dsh-plugin-beyond-simulator 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,19 @@
1
- var fd=Object.create;var Ea=Object.defineProperty;var cd=Object.getOwnPropertyDescriptor;var dd=Object.getOwnPropertyNames;var hd=Object.getPrototypeOf,pd=Object.prototype.hasOwnProperty;var md=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var gd=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dd(e))!pd.call(t,n)&&n!==i&&Ea(t,n,{get:()=>e[n],enumerable:!(r=cd(e,n))||r.enumerable});return t};var yd=(t,e,i)=>(i=t!=null?fd(hd(t)):{},gd(e||!t||!t.__esModule?Ea(i,"default",{value:t,enumerable:!0}):i,t));var No=te((vy,dl)=>{"use strict";dl.exports=Xd;function Xd(t,e){for(var i=new Array(arguments.length-1),r=0,n=2,o=!0;n<arguments.length;)i[r++]=arguments[n++];return new Promise(function(a,l){i[r]=function(f){if(o)if(o=!1,f)l(f);else{for(var h=new Array(arguments.length-1),p=0;p<h.length;)h[p++]=arguments[p];a.apply(null,h)}};try{t.apply(e||null,i)}catch(u){o&&(o=!1,l(u))}})}});var ml=te(pl=>{"use strict";var dn=pl;dn.length=function(e){var i=e.length;if(!i)return 0;for(;i>0&&e.charAt(i-1)==="=";)--i;return Math.floor(i*3/4)};var Ji=new Array(64),hn=new Array(123);for(yt=0;yt<64;)hn[Ji[yt]=yt<26?yt+65:yt<52?yt+71:yt<62?yt-4:yt-59|43]=yt++;var yt;hn[45]=62;hn[95]=63;dn.encode=function(e,i,r){for(var n=null,o=[],s=0,a=0,l;i<r;){var u=e[i++];switch(a){case 0:o[s++]=Ji[u>>2],l=(u&3)<<4,a=1;break;case 1:o[s++]=Ji[l|u>>4],l=(u&15)<<2,a=2;break;case 2:o[s++]=Ji[l|u>>6],o[s++]=Ji[u&63],a=0;break}s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,o)),s=0)}return a&&(o[s++]=Ji[l],o[s++]=61,a===1&&(o[s++]=61)),n?(s&&n.push(String.fromCharCode.apply(String,o.slice(0,s))),n.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var hl="invalid encoding";dn.decode=function(e,i,r){for(var n=r,o=0,s,a=0;a<e.length;){var l=e.charCodeAt(a++);if(l===61&&o>1)break;if((l=hn[l])===void 0)throw Error(hl);switch(o){case 0:s=l,o=1;break;case 1:i[r++]=s<<2|(l&48)>>4,s=l,o=2;break;case 2:i[r++]=(s&15)<<4|(l&60)>>2,s=l,o=3;break;case 3:i[r++]=(s&3)<<6|l,o=0;break}}if(o===1)throw Error(hl);return r-n};var Hd=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Kd=/[-_]/,Wd=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;dn.test=function(e){return Hd.test(e)||Kd.test(e)&&Wd.test(e)}});var yl=te((wy,gl)=>{"use strict";gl.exports=pn;function pn(){this._listeners=Object.create(null)}pn.prototype.on=function(e,i,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:i,ctx:r||this}),this};pn.prototype.off=function(e,i){if(e===void 0)this._listeners=Object.create(null);else if(i===void 0)this._listeners[e]=[];else{var r=this._listeners[e];if(!r)return this;for(var n=0;n<r.length;)r[n].fn===i?r.splice(n,1):++n}return this};pn.prototype.emit=function(e){var i=this._listeners[e];if(i){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<i.length;)i[n].fn.apply(i[n++].ctx,r)}return this}});var Il=te((Sy,_l)=>{"use strict";_l.exports=vl(vl);function vl(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),i=new Uint8Array(e.buffer),r=i[3]===128;function n(l,u,f){e[0]=l,u[f]=i[0],u[f+1]=i[1],u[f+2]=i[2],u[f+3]=i[3]}function o(l,u,f){e[0]=l,u[f]=i[3],u[f+1]=i[2],u[f+2]=i[1],u[f+3]=i[0]}t.writeFloatLE=r?n:o,t.writeFloatBE=r?o:n;function s(l,u){return i[0]=l[u],i[1]=l[u+1],i[2]=l[u+2],i[3]=l[u+3],e[0]}function a(l,u){return i[3]=l[u],i[2]=l[u+1],i[1]=l[u+2],i[0]=l[u+3],e[0]}t.readFloatLE=r?s:a,t.readFloatBE=r?a:s})():(function(){function e(r,n,o,s){var a=n<0?1:0;if(a&&(n=-n),n===0)r(1/n>0?0:2147483648,o,s);else if(isNaN(n))r(2143289344,o,s);else if(n>34028234663852886e22)r((a<<31|2139095040)>>>0,o,s);else if(n<11754943508222875e-54)r((a<<31|Math.round(n/1401298464324817e-60))>>>0,o,s);else{var l=Math.floor(Math.log(n)/Math.LN2),u=Math.round(n*Math.pow(2,-l)*8388608)&8388607;r((a<<31|l+127<<23|u)>>>0,o,s)}}t.writeFloatLE=e.bind(null,bl),t.writeFloatBE=e.bind(null,wl);function i(r,n,o){var s=r(n,o),a=(s>>31)*2+1,l=s>>>23&255,u=s&8388607;return l===255?u?NaN:a*(1/0):l===0?a*1401298464324817e-60*u:a*Math.pow(2,l-150)*(u+8388608)}t.readFloatLE=i.bind(null,Sl),t.readFloatBE=i.bind(null,xl)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),i=new Uint8Array(e.buffer),r=i[7]===128;function n(l,u,f){e[0]=l,u[f]=i[0],u[f+1]=i[1],u[f+2]=i[2],u[f+3]=i[3],u[f+4]=i[4],u[f+5]=i[5],u[f+6]=i[6],u[f+7]=i[7]}function o(l,u,f){e[0]=l,u[f]=i[7],u[f+1]=i[6],u[f+2]=i[5],u[f+3]=i[4],u[f+4]=i[3],u[f+5]=i[2],u[f+6]=i[1],u[f+7]=i[0]}t.writeDoubleLE=r?n:o,t.writeDoubleBE=r?o:n;function s(l,u){return i[0]=l[u],i[1]=l[u+1],i[2]=l[u+2],i[3]=l[u+3],i[4]=l[u+4],i[5]=l[u+5],i[6]=l[u+6],i[7]=l[u+7],e[0]}function a(l,u){return i[7]=l[u],i[6]=l[u+1],i[5]=l[u+2],i[4]=l[u+3],i[3]=l[u+4],i[2]=l[u+5],i[1]=l[u+6],i[0]=l[u+7],e[0]}t.readDoubleLE=r?s:a,t.readDoubleBE=r?a:s})():(function(){function e(r,n,o,s,a,l){var u=s<0?1:0;if(u&&(s=-s),s===0)r(0,a,l+n),r(1/s>0?0:2147483648,a,l+o);else if(isNaN(s))r(0,a,l+n),r(2146959360,a,l+o);else if(s>17976931348623157e292)r(0,a,l+n),r((u<<31|2146435072)>>>0,a,l+o);else{var f;if(s<22250738585072014e-324)f=s/5e-324,r(f>>>0,a,l+n),r((u<<31|f/4294967296)>>>0,a,l+o);else{var h=Math.floor(Math.log(s)/Math.LN2);h===1024&&(h=1023),f=s*Math.pow(2,-h),r(f*4503599627370496>>>0,a,l+n),r((u<<31|h+1023<<20|f*1048576&1048575)>>>0,a,l+o)}}}t.writeDoubleLE=e.bind(null,bl,0,4),t.writeDoubleBE=e.bind(null,wl,4,0);function i(r,n,o,s,a){var l=r(s,a+n),u=r(s,a+o),f=(u>>31)*2+1,h=u>>>20&2047,p=4294967296*(u&1048575)+l;return h===2047?p?NaN:f*(1/0):h===0?f*5e-324*p:f*Math.pow(2,h-1075)*(p+4503599627370496)}t.readDoubleLE=i.bind(null,Sl,0,4),t.readDoubleBE=i.bind(null,xl,4,0)})(),t}function bl(t,e,i){e[i]=t&255,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function wl(t,e,i){e[i]=t>>>24,e[i+1]=t>>>16&255,e[i+2]=t>>>8&255,e[i+3]=t&255}function Sl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function xl(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var kl=te(El=>{"use strict";var gn=El,mn=new TextDecoder("utf-8",{ignoreBOM:!0}),Er,Cl=64;try{Er=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{Er=mn}gn.length=function(e){for(var i=0,r=0,n=0;n<e.length;++n)r=e.charCodeAt(n),r<128?i+=1:r<2048?i+=2:(r&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320?(++n,i+=4):i+=3;return i};function Zi(t,e,i,r){var n=i===0&&r===e.length?e:e.subarray(i,r);return t.decode(n)}gn.read=function(e,i,r){if(r-i<1)return"";if(r-i>=Cl)return Zi(mn,e,i,r);for(var n="",o=i,s,a,l,u,f,h,p,m;o+7<r;o+=8){if(s=e[o],a=e[o+1],l=e[o+2],u=e[o+3],f=e[o+4],h=e[o+5],p=e[o+6],m=e[o+7],(s|a|l|u|f|h|p|m)&128)return n+Zi(mn,e,o,r);n+=String.fromCharCode(s,a,l,u,f,h,p,m)}for(;o<r;++o){if(s=e[o],s&128)return n+Zi(mn,e,o,r);n+=String.fromCharCode(s)}return n};gn.readStrict=function(e,i,r){if(r-i<1)return"";if(r-i>=Cl)return Zi(Er,e,i,r);for(var n="",o=i,s,a,l,u,f,h,p,m;o+7<r;o+=8){if(s=e[o],a=e[o+1],l=e[o+2],u=e[o+3],f=e[o+4],h=e[o+5],p=e[o+6],m=e[o+7],(s|a|l|u|f|h|p|m)&128)return n+Zi(Er,e,o,r);n+=String.fromCharCode(s,a,l,u,f,h,p,m)}for(;o<r;++o){if(s=e[o],s&128)return n+Zi(Er,e,o,r);n+=String.fromCharCode(s)}return n};gn.write=function(e,i,r){for(var n=r,o,s,a=0;a<e.length;++a)o=e.charCodeAt(a),o<128?i[r++]=o:o<2048?(i[r++]=o>>6|192,i[r++]=o&63|128):(o&64512)===55296&&((s=e.charCodeAt(a+1))&64512)===56320?(o=65536+((o&1023)<<10)+(s&1023),++a,i[r++]=o>>18|240,i[r++]=o>>12&63|128,i[r++]=o>>6&63|128,i[r++]=o&63|128):(i[r++]=o>>12|224,i[r++]=o>>6&63|128,i[r++]=o&63|128);return r-n}});var Ol=te((_y,Al)=>{"use strict";Al.exports=Jd;function Jd(t,e,i){var r=i||8192,n=r>>>1,o=null,s=r;return function(l){if(l<1||l>n)return t(l);s+l>r&&(o=t(r),s=0);var u=e.call(o,s,s+=l);return s&7&&(s=(s|7)+1),u}}});var Rl=te((Iy,Tl)=>{"use strict";Tl.exports=Me;var kr;function Me(t,e){this.lo=t>>>0,this.hi=e>>>0}var Ai=Me.zero=new Me(0,0);Ai.toNumber=function(){return 0};Ai.zzEncode=Ai.zzDecode=function(){return this};Ai.length=function(){return 1};var Zd=Me.zeroHash="\0\0\0\0\0\0\0\0";Me.fromNumber=function(e){if(e===0)return Ai;var i=e<0;i&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return i&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new Me(r,n)};Me.from=function(e){if(typeof e=="number")return Me.fromNumber(e);if(typeof e=="string"||e instanceof String)if(kr)e=kr.fromString(e);else return Me.fromNumber(parseInt(e,10));return e.low||e.high?new Me(e.low>>>0,e.high>>>0):Ai};Me.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var i=~this.lo+1>>>0,r=~this.hi>>>0;return i||(r=r+1>>>0),-(i+r*4294967296)}return this.lo+this.hi*4294967296};Me.prototype.toLong=function(e){return kr?new kr(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var si=String.prototype.charCodeAt;Me.fromHash=function(e){return e===Zd?Ai:new Me((si.call(e,0)|si.call(e,1)<<8|si.call(e,2)<<16|si.call(e,3)<<24)>>>0,(si.call(e,4)|si.call(e,5)<<8|si.call(e,6)<<16|si.call(e,7)<<24)>>>0)};Me.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};Me.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};Me.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};Me.prototype.length=function(){var e=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return r===0?i===0?e<16384?e<128?1:2:e<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:r<128?9:10};Me._configure=function(t){kr=t}});var Nl=te((Ar,Po)=>{(function(t,e){function i(r){return r.default||r}typeof define=="function"&&define.amd?define([],function(){var r={};return e(r),i(r)}):typeof Ar=="object"?(e(Ar),typeof Po=="object"&&(Po.exports=i(Ar))):(function(){var r={};e(r),t.Long=i(r)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Ar,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function i(S,c,w){this.low=S|0,this.high=c|0,this.unsigned=!!w}i.prototype.__isLong__,Object.defineProperty(i.prototype,"__isLong__",{value:!0});function r(S){return(S&&S.__isLong__)===!0}function n(S){var c=Math.clz32(S&-S);return S?31-c:c}i.isLong=r;var o={},s={};function a(S,c){var w,M,L;return c?(S>>>=0,(L=0<=S&&S<256)&&(M=s[S],M)?M:(w=u(S,0,!0),L&&(s[S]=w),w)):(S|=0,(L=-128<=S&&S<128)&&(M=o[S],M)?M:(w=u(S,S<0?-1:0,!1),L&&(o[S]=w),w))}i.fromInt=a;function l(S,c){if(isNaN(S))return c?x:G;if(c){if(S<0)return x;if(S>=C)return _}else{if(S<=-k)return R;if(S+1>=k)return j}return S<0?l(-S,c).neg():u(S%b|0,S/b|0,c)}i.fromNumber=l;function u(S,c,w){return new i(S,c,w)}i.fromBits=u;var f=Math.pow;function h(S,c,w){if(S.length===0)throw Error("empty string");if(typeof c=="number"?(w=c,c=!1):c=!!c,S==="NaN"||S==="Infinity"||S==="+Infinity"||S==="-Infinity")return c?x:G;if(w=w||10,w<2||36<w)throw RangeError("radix");var M;if((M=S.indexOf("-"))>0)throw Error("interior hyphen");if(M===0)return h(S.substring(1),c,w).neg();for(var L=l(f(w,8)),X=G,Q=0;Q<S.length;Q+=8){var ce=Math.min(8,S.length-Q),ve=parseInt(S.substring(Q,Q+ce),w);if(ce<8){var be=l(f(w,ce));X=X.mul(be).add(l(ve))}else X=X.mul(L),X=X.add(l(ve))}return X.unsigned=c,X}i.fromString=h;function p(S,c){return typeof S=="number"?l(S,c):typeof S=="string"?h(S,c):u(S.low,S.high,typeof c=="boolean"?c:S.unsigned)}i.fromValue=p;var m=65536,g=1<<24,b=m*m,C=b*b,k=C/2,E=a(g),G=a(0);i.ZERO=G;var x=a(0,!0);i.UZERO=x;var q=a(1);i.ONE=q;var B=a(1,!0);i.UONE=B;var W=a(-1);i.NEG_ONE=W;var j=u(-1,2147483647,!1);i.MAX_VALUE=j;var _=u(-1,-1,!0);i.MAX_UNSIGNED_VALUE=_;var R=u(0,-2147483648,!1);i.MIN_VALUE=R;var y=i.prototype;y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*b+(this.low>>>0):this.high*b+(this.low>>>0)},y.toString=function(c){if(c=c||10,c<2||36<c)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(R)){var w=l(c),M=this.div(w),L=M.mul(w).sub(this);return M.toString(c)+L.toInt().toString(c)}else return"-"+this.neg().toString(c);for(var X=l(f(c,6),this.unsigned),Q=this,ce="";;){var ve=Q.div(X),be=Q.sub(ve.mul(X)).toInt()>>>0,me=be.toString(c);if(Q=ve,Q.isZero())return me+ce;for(;me.length<6;)me="0"+me;ce=""+me+ce}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(R)?64:this.neg().getNumBitsAbs();for(var c=this.high!=0?this.high:this.low,w=31;w>0&&(c&1<<w)==0;w--);return this.high!=0?w+33:w+1},y.isSafeInteger=function(){var c=this.high>>21;return c?this.unsigned?!1:c===-1&&!(this.low===0&&this.high===-2097152):!0},y.isZero=function(){return this.high===0&&this.low===0},y.eqz=y.isZero,y.isNegative=function(){return!this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return(this.low&1)===1},y.isEven=function(){return(this.low&1)===0},y.equals=function(c){return r(c)||(c=p(c)),this.unsigned!==c.unsigned&&this.high>>>31===1&&c.high>>>31===1?!1:this.high===c.high&&this.low===c.low},y.eq=y.equals,y.notEquals=function(c){return!this.eq(c)},y.neq=y.notEquals,y.ne=y.notEquals,y.lessThan=function(c){return this.comp(c)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(c){return this.comp(c)<=0},y.lte=y.lessThanOrEqual,y.le=y.lessThanOrEqual,y.greaterThan=function(c){return this.comp(c)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(c){return this.comp(c)>=0},y.gte=y.greaterThanOrEqual,y.ge=y.greaterThanOrEqual,y.compare=function(c){if(r(c)||(c=p(c)),this.eq(c))return 0;var w=this.isNegative(),M=c.isNegative();return w&&!M?-1:!w&&M?1:this.unsigned?c.high>>>0>this.high>>>0||c.high===this.high&&c.low>>>0>this.low>>>0?-1:1:this.sub(c).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(R)?R:this.not().add(q)},y.neg=y.negate,y.add=function(c){r(c)||(c=p(c));var w=this.high>>>16,M=this.high&65535,L=this.low>>>16,X=this.low&65535,Q=c.high>>>16,ce=c.high&65535,ve=c.low>>>16,be=c.low&65535,me=0,ee=0,ue=0,Se=0;return Se+=X+be,ue+=Se>>>16,Se&=65535,ue+=L+ve,ee+=ue>>>16,ue&=65535,ee+=M+ce,me+=ee>>>16,ee&=65535,me+=w+Q,me&=65535,u(ue<<16|Se,me<<16|ee,this.unsigned)},y.subtract=function(c){return r(c)||(c=p(c)),this.add(c.neg())},y.sub=y.subtract,y.multiply=function(c){if(this.isZero())return this;if(r(c)||(c=p(c)),e){var w=e.mul(this.low,this.high,c.low,c.high);return u(w,e.get_high(),this.unsigned)}if(c.isZero())return this.unsigned?x:G;if(this.eq(R))return c.isOdd()?R:G;if(c.eq(R))return this.isOdd()?R:G;if(this.isNegative())return c.isNegative()?this.neg().mul(c.neg()):this.neg().mul(c).neg();if(c.isNegative())return this.mul(c.neg()).neg();if(this.lt(E)&&c.lt(E))return l(this.toNumber()*c.toNumber(),this.unsigned);var M=this.high>>>16,L=this.high&65535,X=this.low>>>16,Q=this.low&65535,ce=c.high>>>16,ve=c.high&65535,be=c.low>>>16,me=c.low&65535,ee=0,ue=0,Se=0,dt=0;return dt+=Q*me,Se+=dt>>>16,dt&=65535,Se+=X*me,ue+=Se>>>16,Se&=65535,Se+=Q*be,ue+=Se>>>16,Se&=65535,ue+=L*me,ee+=ue>>>16,ue&=65535,ue+=X*be,ee+=ue>>>16,ue&=65535,ue+=Q*ve,ee+=ue>>>16,ue&=65535,ee+=M*me+L*be+X*ve+Q*ce,ee&=65535,u(Se<<16|dt,ee<<16|ue,this.unsigned)},y.mul=y.multiply,y.divide=function(c){if(r(c)||(c=p(c)),c.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&c.low===-1&&c.high===-1)return this;var w=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,c.low,c.high);return u(w,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?x:G;var M,L,X;if(this.unsigned){if(c.unsigned||(c=c.toUnsigned()),c.gt(this))return x;if(c.gt(this.shru(1)))return B;X=x}else{if(this.eq(R)){if(c.eq(q)||c.eq(W))return R;if(c.eq(R))return q;var Q=this.shr(1);return M=Q.div(c).shl(1),M.eq(G)?c.isNegative()?q:W:(L=this.sub(c.mul(M)),X=M.add(L.div(c)),X)}else if(c.eq(R))return this.unsigned?x:G;if(this.isNegative())return c.isNegative()?this.neg().div(c.neg()):this.neg().div(c).neg();if(c.isNegative())return this.div(c.neg()).neg();X=G}for(L=this;L.gte(c);){M=Math.max(1,Math.floor(L.toNumber()/c.toNumber()));for(var ce=Math.ceil(Math.log(M)/Math.LN2),ve=ce<=48?1:f(2,ce-48),be=l(M),me=be.mul(c);me.isNegative()||me.gt(L);)M-=ve,be=l(M,this.unsigned),me=be.mul(c);be.isZero()&&(be=q),X=X.add(be),L=L.sub(me)}return X},y.div=y.divide,y.modulo=function(c){if(r(c)||(c=p(c)),e){var w=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,c.low,c.high);return u(w,e.get_high(),this.unsigned)}return this.sub(this.div(c).mul(c))},y.mod=y.modulo,y.rem=y.modulo,y.not=function(){return u(~this.low,~this.high,this.unsigned)},y.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},y.clz=y.countLeadingZeros,y.countTrailingZeros=function(){return this.low?n(this.low):n(this.high)+32},y.ctz=y.countTrailingZeros,y.and=function(c){return r(c)||(c=p(c)),u(this.low&c.low,this.high&c.high,this.unsigned)},y.or=function(c){return r(c)||(c=p(c)),u(this.low|c.low,this.high|c.high,this.unsigned)},y.xor=function(c){return r(c)||(c=p(c)),u(this.low^c.low,this.high^c.high,this.unsigned)},y.shiftLeft=function(c){return r(c)&&(c=c.toInt()),(c&=63)===0?this:c<32?u(this.low<<c,this.high<<c|this.low>>>32-c,this.unsigned):u(0,this.low<<c-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(c){return r(c)&&(c=c.toInt()),(c&=63)===0?this:c<32?u(this.low>>>c|this.high<<32-c,this.high>>c,this.unsigned):u(this.high>>c-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(c){return r(c)&&(c=c.toInt()),(c&=63)===0?this:c<32?u(this.low>>>c|this.high<<32-c,this.high>>>c,this.unsigned):c===32?u(this.high,0,this.unsigned):u(this.high>>>c-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.shr_u=y.shiftRightUnsigned,y.rotateLeft=function(c){var w;return r(c)&&(c=c.toInt()),(c&=63)===0?this:c===32?u(this.high,this.low,this.unsigned):c<32?(w=32-c,u(this.low<<c|this.high>>>w,this.high<<c|this.low>>>w,this.unsigned)):(c-=32,w=32-c,u(this.high<<c|this.low>>>w,this.low<<c|this.high>>>w,this.unsigned))},y.rotl=y.rotateLeft,y.rotateRight=function(c){var w;return r(c)&&(c=c.toInt()),(c&=63)===0?this:c===32?u(this.high,this.low,this.unsigned):c<32?(w=32-c,u(this.high<<w|this.low>>>c,this.low<<w|this.high>>>c,this.unsigned)):(c-=32,w=32-c,u(this.low<<w|this.high>>>c,this.high<<w|this.low>>>c,this.unsigned))},y.rotr=y.rotateRight,y.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},y.toBytes=function(c){return c?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var c=this.high,w=this.low;return[w&255,w>>>8&255,w>>>16&255,w>>>24,c&255,c>>>8&255,c>>>16&255,c>>>24]},y.toBytesBE=function(){var c=this.high,w=this.low;return[c>>>24,c>>>16&255,c>>>8&255,c&255,w>>>24,w>>>16&255,w>>>8&255,w&255]},i.fromBytes=function(c,w,M){return M?i.fromBytesLE(c,w):i.fromBytesBE(c,w)},i.fromBytesLE=function(c,w){return new i(c[0]|c[1]<<8|c[2]<<16|c[3]<<24,c[4]|c[5]<<8|c[6]<<16|c[7]<<24,w)},i.fromBytesBE=function(c,w){return new i(c[4]<<24|c[5]<<16|c[6]<<8|c[7],c[0]<<24|c[1]<<16|c[2]<<8|c[3],w)},typeof BigInt=="function"&&(i.fromBigInt=function(c,w){var M=Number(BigInt.asIntN(32,c)),L=Number(BigInt.asIntN(32,c>>BigInt(32)));return u(M,L,w)},i.fromValue=function(c,w){return typeof c=="bigint"?i.fromBigInt(c,w):p(c,w)},y.toBigInt=function(){var c=BigInt(this.low>>>0),w=BigInt(this.unsigned?this.high>>>0:this.high);return w<<BigInt(32)|c});var N=t.default=i})});var Tt=te(Fo=>{"use strict";var H=Fo;H.asPromise=No();H.base64=ml();H.EventEmitter=yl();H.float=Il();H.utf8=kl();H.pool=Ol();H.LongBits=Rl();function Pl(t){return t==="__proto__"||t==="prototype"||t==="constructor"}H.isUnsafeProperty=Pl;H.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);H.global=H.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||Fo;H.emptyArray=Object.freeze?Object.freeze([]):[];H.emptyObject=Object.freeze?Object.freeze({}):{};H.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};H.isString=function(e){return typeof e=="string"||e instanceof String};H.isObject=function(e){return e&&typeof e=="object"};H.isset=H.isSet=function(e,i){var r=e[i];return r!=null&&Object.hasOwnProperty.call(e,i)?typeof r!="object"||(Array.isArray(r)?r.length:Object.keys(r).length)>0:!1};H.Buffer=(function(){try{var t=H.global.Buffer;return t.prototype.utf8Write||H.isNode?t:null}catch{return null}})();H.newBuffer=function(e){var i=H.Buffer;return typeof e=="number"?i?i.allocUnsafe(e):new Uint8Array(e):i?i.from(e):new Uint8Array(e)};H.rawField=function(e,i,r){var n=[],o=e<<3|i;for(o>>>=0;o>127;)n.push(o&127|128),o>>>=7;n.push(o);for(var s=0;s<r.length;++s)n.push(r[s]);return H.newBuffer(n)};H.Array=Uint8Array;H.Long=H.global.dcodeIO&&H.global.dcodeIO.Long||H.global.Long||(function(){try{var t=Nl();return t&&t.isLong?t:null}catch{return null}})();H.key2Re=/^(?:true|false|0|1)$/;H.key32Re=/^-?(?:0|[1-9][0-9]*)$/;H.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/;H.longToHash=function(e){return e?H.LongBits.from(e).toHash():H.LongBits.zeroHash};H.longFromHash=function(e,i){var r=H.LongBits.fromHash(e);return H.Long?H.Long.fromBits(r.lo,r.hi,i):r.toNumber(!!i)};H.longFromKey=function(e,i){return H.key64Re.test(e)&&!H.key32Re.test(e)?H.longFromHash(e,i):e};H.boolFromKey=function(e){return e==="true"||e==="1"};function Fl(t){var e=typeof arguments[arguments.length-1]=="boolean",i=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var r=1;r<i;++r){var n=arguments[r];if(n)for(var o=Object.keys(n),s=0;s<o.length;++s)!Pl(o[s])&&(!e||!Object.prototype.hasOwnProperty.call(t,o[s])||t[o[s]]===void 0)&&(t[o[s]]=n[o[s]])}return t}H.merge=Fl;H.nestingLimit=32;H.recursionLimit=100;H.makeProp=function(e,i,r){Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{enumerable:r===void 0?!0:r,configurable:!0,writable:!0})};H.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function Ml(t){function e(i,r){if(!(this instanceof e))return new e(i,r);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),r&&Fl(this,r)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}H.newError=Ml;H.ProtocolError=Ml("ProtocolError");H.oneOfGetter=function(e){for(var i={},r=0;r<e.length;++r)i[e[r]]=1;return function(){for(var n=Object.keys(this),o=n.length-1;o>-1;--o)if(i[n[o]]===1&&this[n[o]]!==void 0&&this[n[o]]!==null)return n[o]}};H.oneOfSetter=function(e){return function(i){for(var r=0;r<e.length;++r)e[r]!==i&&delete this[e[r]]}};H.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}});var vn=te((Ey,ql)=>{"use strict";ql.exports=K;var Rt=Tt(),zo,jt=Rt.LongBits,zl=Rt.base64,Mo=Rt.utf8;function K(){this.pos=0,this.buf=this.constructor.alloc(K.initialBufferSize),this.view=null,this.states=null}K.initialBufferSize=128;Object.defineProperty(K.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var Dl=function(){return Rt.Buffer?function(){return(K.create=function(){return new zo})()}:function(){return new K}};K.create=Dl();K.alloc=function(e){return new Uint8Array(e)};K.alloc=Rt.pool(K.alloc,Uint8Array.prototype.subarray);function Do(t){return t<128?1:t<16384?2:t<2097152?3:t<268435456?4:5}K.prototype._reserve=function(e){var i=this.pos+e;if(i>this.buf.length){var r=this.buf.length<<1;r<i&&(r=i);var n=this.constructor.alloc(r);n.set(this.buf.subarray(0,this.pos),0),this.buf=n,this.view=null}};function Qd(t,e,i){for(var r=0;r<t.length;)e[i++]=t.charCodeAt(r++)}function Oi(t,e,i){for(;t>127;)e[i++]=t&127|128,t>>>=7;return e[i]=t,i+1}K.prototype.uint32=function(e){e=e>>>0,this._reserve(5);var i=this.pos;return this.pos=Oi(e,this.buf,i),this};K.prototype.int32=function(e){return(e|=0)<0?(this._reserve(10),er(jt.fromNumber(e),this.buf,this.pos),this.pos+=10,this):this.uint32(e)};K.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function er(t,e,i){for(var r=t.lo,n=t.hi;n;)e[i++]=r&127|128,r=(r>>>7|n<<25)>>>0,n>>>=7;for(;r>127;)e[i++]=r&127|128,r=r>>>7;return e[i]=r,i+1}K.prototype.uint64=function(e){var i=jt.from(e);this._reserve(10);var r=this.pos;return this.pos=er(i,this.buf,r),this};K.prototype.int64=K.prototype.uint64;K.prototype.sint64=function(e){var i=jt.from(e).zzEncode();this._reserve(10);var r=this.pos;return this.pos=er(i,this.buf,r),this};K.prototype.bool=function(e){return this._reserve(1),this.buf[this.pos++]=e?1:0,this};function Qi(t,e,i){e[i]=t&255,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}K.prototype.fixed32=function(e){return this._reserve(4),Qi(e>>>0,this.buf,this.pos),this.pos+=4,this};K.prototype.sfixed32=K.prototype.fixed32;K.prototype.fixed64=function(e){var i=jt.from(e);return this._reserve(8),Qi(i.lo,this.buf,this.pos),Qi(i.hi,this.buf,this.pos+4),this.pos+=8,this};K.prototype.sfixed64=K.prototype.fixed64;K.prototype.float=function(e){return this._reserve(4),Rt.float.writeFloatLE(e,this.buf,this.pos),this.pos+=4,this};K.prototype.double=function(e){return this._reserve(8),Rt.float.writeDoubleLE(e,this.buf,this.pos),this.pos+=8,this};K.prototype.bytes=function(e){var i=e.length>>>0;if(!i)return this._reserve(1),this.buf[this.pos++]=0,this;if(Rt.isString(e)){var r=K.alloc(i=zl.length(e));zl.decode(e,r,0),e=r}return this.uint32(i),this._reserve(i),this.buf.set(e,this.pos),this.pos+=i,this};K.prototype.raw=function(e){var i=e.length>>>0;return i?(this._reserve(i),this.buf.set(e,this.pos),this.pos+=i,this):this};K.prototype._delim=function(e,i){var r=Do(i);return r>1&&this.buf.copyWithin(e+r,e+1,e+1+i),Oi(i,this.buf,e),this.pos=e+r+i,this};K.prototype.string=function(e){var i=e.length;if(!i)return this._reserve(1),this.buf[this.pos++]=0,this;if(i<128){this._reserve(i*3+5);var r=this.pos;return this._delim(r,Mo.write(e,this.buf,r+1))}var n=Mo.length(e);return this.uint32(n),this._reserve(n),n===e.length?Qd(e,this.buf,this.pos):Mo.write(e,this.buf,this.pos),this.pos+=n,this};K.prototype.uint32s=function(e){var i=e.length;this._reserve(i*5+5);for(var r=this.buf,n=this.pos,o=n+1,s=0;s<i;++s)o=Oi(e[s]>>>0,r,o);return this._delim(n,o-n-1)};K.prototype.int32s=function(e){var i=e.length;this._reserve(i*10+5);for(var r=this.buf,n=this.pos,o=n+1,s,a=0;a<i;++a)(s=e[a]|0)<0?o=er(jt.fromNumber(s),r,o):o=Oi(s,r,o);return this._delim(n,o-n-1)};K.prototype.sint32s=function(e){var i=e.length;this._reserve(i*5+5);for(var r=this.buf,n=this.pos,o=n+1,s=0;s<i;++s)o=Oi((e[s]<<1^e[s]>>31)>>>0,r,o);return this._delim(n,o-n-1)};K.prototype.uint64s=function(e){var i=e.length;this._reserve(i*10+5);for(var r=this.buf,n=this.pos,o=n+1,s=0;s<i;++s)o=er(jt.from(e[s]),r,o);return this._delim(n,o-n-1)};K.prototype.int64s=K.prototype.uint64s;K.prototype.sint64s=function(e){var i=e.length;this._reserve(i*10+5);for(var r=this.buf,n=this.pos,o=n+1,s=0;s<i;++s)o=er(jt.from(e[s]).zzEncode(),r,o);return this._delim(n,o-n-1)};K.prototype.bools=function(e){var i=e.length;this.uint32(i),this._reserve(i);for(var r=this.buf,n=this.pos,o=0;o<i;++o)r[n++]=e[o]?1:0;return this.pos+=i,this};var $l=16,Gl=128;function yn(t,e,i){var r=t.view;if(r||e<i)return r;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}K.prototype.fixed32s=function(e){var i=e.length,r=i*4;this.uint32(r),this._reserve(r);var n=this.pos,o,s=yn(this,i,Gl);if(s)for(o=0;o<i;++o)s.setUint32(n,e[o]>>>0,!0),n+=4;else{var a=this.buf;for(o=0;o<i;++o)Qi(e[o]>>>0,a,n),n+=4}return this.pos+=r,this};K.prototype.sfixed32s=K.prototype.fixed32s;K.prototype.fixed64s=function(e){var i=e.length,r=i*8;this.uint32(r),this._reserve(r);var n=this.pos,o,s,a=yn(this,i,Gl);if(a)for(o=0;o<i;++o)s=jt.from(e[o]),a.setUint32(n,s.lo,!0),a.setUint32(n+4,s.hi,!0),n+=8;else{var l=this.buf;for(o=0;o<i;++o)s=jt.from(e[o]),Qi(s.lo,l,n),Qi(s.hi,l,n+4),n+=8}return this.pos+=r,this};K.prototype.sfixed64s=K.prototype.fixed64s;K.prototype.floats=function(e){var i=e.length,r=i*4;this.uint32(r),this._reserve(r);var n=this.pos,o,s=yn(this,i,$l);if(s)for(o=0;o<i;++o)s.setFloat32(n,e[o],!0),n+=4;else{var a=this.buf;for(o=0;o<i;++o)Rt.float.writeFloatLE(e[o],a,n),n+=4}return this.pos+=r,this};K.prototype.doubles=function(e){var i=e.length,r=i*8;this.uint32(r),this._reserve(r);var n=this.pos,o,s=yn(this,i,$l);if(s)for(o=0;o<i;++o)s.setFloat64(n,e[o],!0),n+=8;else{var a=this.buf;for(o=0;o<i;++o)Rt.float.writeDoubleLE(e[o],a,n),n+=8}return this.pos+=r,this};K.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this};K.prototype.reset=function(){var e=this.states;return e&&e.length?this.pos=e.pop():this.pos=0,this};K.prototype.ldelim=function(){var e=this.states,i,r;if(e&&e.length){var n=e.pop();i=this.pos-n-1,r=Do(i),r>1?(this._reserve(r-1),this.buf.copyWithin(n+r,n+1,n+1+i),this.pos+=r-1,Oi(i,this.buf,n)):this.buf[n]=i}else i=this.pos,r=Do(i),this._reserve(r),this.buf.copyWithin(r,0,i),Oi(i,this.buf,0),this.pos+=r;return this};K.prototype.finish=function(e){if(e)return this.buf.subarray(0,this.pos);var i=this.constructor.alloc(this.pos);return i.set(this.buf.subarray(0,this.pos),0),i};K.prototype.finishInto=function(e,i){return i===void 0&&(i=0),e.set(this.buf.subarray(0,this.pos),i),e};K._configure=function(t){zo=t,K.create=Dl(),zo._configure()}});var Ll=te((ky,Vl)=>{"use strict";Vl.exports=li;var Bl=vn();li.prototype=Object.create(Bl.prototype,{constructor:{value:li,writable:!0,enumerable:!1,configurable:!0}});var ai=Tt();function li(){Bl.call(this)}var $o;li._configure=function(){li.alloc=ai.Buffer&&ai.Buffer.allocUnsafe,$o=ai.Buffer&&ai.Buffer.prototype.utf8Write?function(e,i,r){return i.utf8Write(e,r)}:function(e,i,r){return i.write(e,r)}};li.prototype.bytes=function(e){ai.isString(e)&&(e=ai.Buffer.from(e,"base64"));var i=e.length>>>0;return this.uint32(i),i&&(this._reserve(i),this.buf.set(e,this.pos),this.pos+=i),this};li.prototype.string=function(e){var i=e.length;if(!i)return this._reserve(1),this.buf[this.pos++]=0,this;if(i<128){this._reserve(i*3+5);var r=this.pos,n=this.buf;return this._delim(r,i<40?ai.utf8.write(e,n,r+1):$o(e,n,r+1))}var o=ai.Buffer.byteLength(e);return this.uint32(o),this._reserve(o),$o(e,this.buf,this.pos),this.pos+=o,this};li._configure()});var wn=te((Ay,Jl)=>{"use strict";Jl.exports=se;var vt=Tt(),qo,Ul=vt.LongBits,Xl=vt.utf8;function ge(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function se(t){this.buf=t,this.pos=0,this.len=t.length,this.view=null,this.discardUnknown=se.discardUnknown}function jl(t){if(Array.isArray(t)&&(t=new Uint8Array(t)),t instanceof Uint8Array)return new se(t);throw Error("illegal buffer")}var Hl=function(){return vt.Buffer?function(i){return(se.create=function(n){return vt.Buffer.isBuffer(n)?new qo(n):jl(n)})(i)}:jl};se.create=Hl();se.prototype.raw=function(e,i){return this.buf.subarray(e,i)};se.prototype.uint32=function(){var e=this.buf,i=this.pos,r=(e[i]&127)>>>0;if(e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&127)<<7)>>>0,e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&127)<<14)>>>0,e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&127)<<21)>>>0,e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&15)<<28)>>>0,e[i++]<128)return this.pos=i,r;for(var n=0;n<5;++n){if(i>=this.len)throw this.pos=i,ge(this);if(e[i++]<128)return this.pos=i,r}throw this.pos=i,Error("invalid varint encoding")};se.prototype.tag=function(){var e=this.buf,i=this.pos,r=(e[i]&127)>>>0;if(e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&127)<<7)>>>0,e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&127)<<14)>>>0,e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&127)<<21)>>>0,e[i++]<128)return this.pos=i,r;if(r=(r|(e[i]&15)<<28)>>>0,e[i]<128&&(e[i]&112)===0)return this.pos=i+1,r;throw this.pos=i+1,Error("invalid tag encoding")};se.prototype.int32=function(){return this.uint32()|0};se.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function Go(){var t=new Ul(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<4;++e){if(this.pos>=this.len)throw ge(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}throw ge(this)}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw ge(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}se.prototype.bool=function(){for(var e=!1,i,r=0;r<10;++r){if(this.pos>=this.len)throw ge(this);if(i=this.buf[this.pos++],i&127&&(e=!0),i<128)return e}throw Error("invalid varint encoding")};function tr(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}se.prototype.fixed32=function(){if(this.pos+4>this.len)throw ge(this,4);return tr(this.buf,this.pos+=4)};se.prototype.sfixed32=function(){if(this.pos+4>this.len)throw ge(this,4);return tr(this.buf,this.pos+=4)|0};function Yl(){if(this.pos+8>this.len)throw ge(this,8);return new Ul(tr(this.buf,this.pos+=4),tr(this.buf,this.pos+=4))}se.prototype.float=function(){if(this.pos+4>this.len)throw ge(this,4);var e=vt.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};se.prototype.double=function(){if(this.pos+8>this.len)throw ge(this,4);var e=vt.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};se.prototype.uint32s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos,r=this.buf,n=this.pos,o;n<i;)o=r[n++],o<128?e.push(o):(this.pos=n-1,e.push(this.uint32()),n=this.pos);return this.pos=n,e};se.prototype.int32s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos,r=this.buf,n=this.pos,o;n<i;)o=r[n++],o<128?e.push(o):(this.pos=n-1,e.push(this.int32()),n=this.pos);return this.pos=n,e};se.prototype.sint32s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.sint32());return e};se.prototype.bools=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos,r=this.buf,n=this.pos,o;n<i;)o=r[n++],o<128?e.push(o!==0):(this.pos=n-1,e.push(this.bool()),n=this.pos);return this.pos=n,e};var Kl=8,Wl=128;function bn(t,e,i){var r=t.view;if(r||e<i)return r;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}se.prototype.fixed32s=function(e){e===void 0&&(e=[]);var i=this.uint32(),r=this.pos+i;if(r>this.len)throw ge(this,i);var n=i>>>2,o=e.length,s=this.pos;e.length=o+n;var a=bn(this,n,Wl);if(a)for(var l=0;l<n;++l,s+=4)e[o++]=a.getUint32(s,!0);else for(var u=this.buf,f=0;f<n;++f,s+=4)e[o++]=tr(u,s+4);if(this.pos=s,s!==r)throw ge(this,4);return e};se.prototype.sfixed32s=function(e){e===void 0&&(e=[]);var i=this.uint32(),r=this.pos+i;if(r>this.len)throw ge(this,i);var n=i>>>2,o=e.length,s=this.pos;e.length=o+n;var a=bn(this,n,Wl);if(a)for(var l=0;l<n;++l,s+=4)e[o++]=a.getInt32(s,!0);else for(var u=this.buf,f=0;f<n;++f,s+=4)e[o++]=tr(u,s+4)|0;if(this.pos=s,s!==r)throw ge(this,4);return e};se.prototype.floats=function(e){e===void 0&&(e=[]);var i=this.uint32(),r=this.pos+i;if(r>this.len)throw ge(this,i);var n=i>>>2,o=e.length,s=this.pos;e.length=o+n;var a=bn(this,n,Kl);if(a)for(var l=0;l<n;++l,s+=4)e[o++]=a.getFloat32(s,!0);else for(var u=this.buf,f=0;f<n;++f,s+=4)e[o++]=vt.float.readFloatLE(u,s);if(this.pos=s,s!==r)throw ge(this,4);return e};se.prototype.doubles=function(e){e===void 0&&(e=[]);var i=this.uint32(),r=this.pos+i;if(r>this.len)throw ge(this,i);var n=i>>>3,o=e.length,s=this.pos;e.length=o+n;var a=bn(this,n,Kl);if(a)for(var l=0;l<n;++l,s+=8)e[o++]=a.getFloat64(s,!0);else for(var u=this.buf,f=0;f<n;++f,s+=8)e[o++]=vt.float.readDoubleLE(u,s);if(this.pos=s,s!==r)throw ge(this,8);return e};se.prototype.uint64s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.uint64());return e};se.prototype.int64s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.int64());return e};se.prototype.sint64s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.sint64());return e};se.prototype.fixed64s=function(e){e===void 0&&(e=[]);var i=this.uint32(),r=this.pos+i,n=e.length;if(r>this.len)throw ge(this,i);var o=i>>>3;e.length=n+o;for(var s=0;s<o;++s)e[n++]=this.fixed64();if(this.pos!==r)throw ge(this,8);return e};se.prototype.sfixed64s=function(e){e===void 0&&(e=[]);var i=this.uint32(),r=this.pos+i,n=e.length;if(r>this.len)throw ge(this,i);var o=i>>>3;e.length=n+o;for(var s=0;s<o;++s)e[n++]=this.sfixed64();if(this.pos!==r)throw ge(this,8);return e};se.prototype.bytes=function(){var e=this.uint32(),i=this.pos,r=this.pos+e;if(r>this.len)throw ge(this,e);return this.pos=r,this.raw(i,r)};se.prototype.string=function(){var e=this.uint32(),i=this.pos,r=this.pos+e;if(r>this.len)throw ge(this,e);return this.pos=r,Xl.read(this.buf,i,r)};se.prototype.stringVerify=function(){var e=this.uint32(),i=this.pos,r=this.pos+e;if(r>this.len)throw ge(this,e);return this.pos=r,Xl.readStrict(this.buf,i,r)};se.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ge(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ge(this);while(this.buf[this.pos++]&128);return this};se.recursionLimit=vt.recursionLimit;se.discardUnknown=!0;se.prototype.skipType=function(t,e,i){if(e===void 0&&(e=0),e>se.recursionLimit)throw Error("max depth exceeded");if(i===0)throw Error("illegal tag: field number 0");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),n=r>>>3;if(t=r&7,!n)throw Error("illegal tag: field number 0");if(t===4){if(i!==void 0&&n!==i)throw Error("invalid end group tag");break}this.skipType(t,e+1,n)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};se._configure=function(t){qo=t,se.create=Hl(),qo._configure();var e=vt.Long?"toLong":"toNumber";vt.merge(se.prototype,{int64:function(){return Go.call(this)[e](!1)},uint64:function(){return Go.call(this)[e](!0)},sint64:function(){return Go.call(this).zzDecode()[e](!1)},fixed64:function(){return Yl.call(this)[e](!0)},sfixed64:function(){return Yl.call(this)[e](!1)}})}});var tu=te((Oy,eu)=>{"use strict";eu.exports=ui;var Ql=wn();ui.prototype=Object.create(Ql.prototype,{constructor:{value:ui,writable:!0,enumerable:!1,configurable:!0}});var Zl=Tt();function ui(t){Ql.call(this,t)}ui._configure=function(){Zl.Buffer&&(ui.prototype._slice=Zl.Buffer.prototype.slice)};ui.prototype.raw=function(e,i){return this._slice.call(this.buf,e,i)};ui.prototype.string=function(){var e=this.uint32(),i=this.pos,r=this.pos+e;if(r>this.len)throw RangeError("index out of range: "+this.pos+" + "+e+" > "+this.len);return this.pos=r,this.buf.utf8Slice?this.buf.utf8Slice(i,r):this.buf.toString("utf-8",i,r)};ui._configure()});var ru=te((Ty,iu)=>{"use strict";iu.exports=Or;var Bo=Tt();Or.prototype=Object.create(Bo.EventEmitter.prototype,{constructor:{value:Or,writable:!0,enumerable:!1,configurable:!0}});function Or(t,e,i){if(typeof t!="function")throw TypeError("rpcImpl must be a function");Bo.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!i}Or.prototype.rpcCall=function t(e,i,r,n,o){if(!n)throw TypeError("request must be specified");var s=this;if(!o)return Bo.asPromise(t,s,e,i,r,n);if(!s.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return s.rpcImpl(e,i[s.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(l,u){if(l)return s.emit("error",l,e),o(l);if(u===null){s.end(!0);return}if(!(u instanceof r))try{u=r[s.responseDelimited?"decodeDelimited":"decode"](u)}catch(f){return s.emit("error",f,e),o(f)}return s.emit("data",u,e),o(null,u)})}catch(a){s.emit("error",a,e),setTimeout(function(){o(a)},0);return}};Or.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Vo=te(nu=>{"use strict";var eh=nu;eh.Service=ru()});var Lo=te((Ny,ou)=>{"use strict";ou.exports=Object.create(null)});var au=te(Ue=>{"use strict";Ue.build="minimal";Ue.Writer=vn();Ue.BufferWriter=Ll();Ue.Reader=wn();Ue.BufferReader=tu();Ue.util=Tt();Ue.rpc=Vo();Ue.roots=Lo();Ue.configure=su;function su(){Ue.util.LongBits._configure(Ue.util.Long),Ue.Writer._configure(Ue.BufferWriter),Ue.Reader._configure(Ue.BufferReader)}su()});var Yo=te(lu=>{"use strict";var jo=lu;jo.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;jo.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;jo.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/});var fu=te((My,uu)=>{"use strict";uu.exports=Uo;var th=Yo(),ih=th.reservedRe;function Uo(t,e){typeof t=="string"&&(e=t,t=void 0);var i=[];function r(o){if(typeof o!="string"){var s=n();if(Uo.verbose&&console.log("codegen: "+s),s="return "+s,o){for(var a=Object.keys(o),l=new Array(a.length+1),u=new Array(a.length),f=0;f<a.length;)l[f]=a[f],u[f]=o[a[f++]];return l[f]=s,Function.apply(null,l).apply(null,u)}return Function(s)()}for(var h=new Array(arguments.length-1),p=0;p<h.length;)h[p]=arguments[++p];if(p=0,o=o.replace(/%([%dfijs])/g,function(g,b){var C=h[p++];switch(b){case"d":case"f":return C=Number(C),Object.is(C,-0)?"-0":String(C);case"i":return String(Math.floor(C));case"j":return JSON.stringify(C);case"s":return String(C)}return"%"}),p!==h.length)throw Error("parameter count mismatch");return i.push(o),r}function n(o){return"function "+rh(o||e)+"("+(t&&t.join(",")||"")+`){
1
+ var Id=Object.create;var Gs=Object.defineProperty;var Cd=Object.getOwnPropertyDescriptor;var Ad=Object.getOwnPropertyNames;var kd=Object.getPrototypeOf,Od=Object.prototype.hasOwnProperty;var Td=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var te=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Rd=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ad(e))!Od.call(t,r)&&r!==i&&Gs(t,r,{get:()=>e[r],enumerable:!(n=Cd(e,r))||n.enumerable});return t};var Nd=(t,e,i)=>(i=t!=null?Id(kd(t)):{},Rd(e||!t||!t.__esModule?Gs(i,"default",{value:t,enumerable:!0}):i,t));var Vo=te((Hm,Cl)=>{"use strict";Cl.exports=f0;function f0(t,e){for(var i=new Array(arguments.length-1),n=0,r=2,o=!0;r<arguments.length;)i[n++]=arguments[r++];return new Promise(function(s,l){i[n]=function(f){if(o)if(o=!1,f)l(f);else{for(var h=new Array(arguments.length-1),m=0;m<h.length;)h[m++]=arguments[m];s.apply(null,h)}};try{t.apply(e||null,i)}catch(c){o&&(o=!1,l(c))}})}});var Ol=te(kl=>{"use strict";var vr=kl;vr.length=function(e){var i=e.length;if(!i)return 0;for(;i>0&&e.charAt(i-1)==="=";)--i;return Math.floor(i*3/4)};var tn=new Array(64),wr=new Array(123);for(St=0;St<64;)wr[tn[St]=St<26?St+65:St<52?St+71:St<62?St-4:St-59|43]=St++;var St;wr[45]=62;wr[95]=63;vr.encode=function(e,i,n){for(var r=null,o=[],a=0,s=0,l;i<n;){var c=e[i++];switch(s){case 0:o[a++]=tn[c>>2],l=(c&3)<<4,s=1;break;case 1:o[a++]=tn[l|c>>4],l=(c&15)<<2,s=2;break;case 2:o[a++]=tn[l|c>>6],o[a++]=tn[c&63],s=0;break}a>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,o)),a=0)}return s&&(o[a++]=tn[l],o[a++]=61,s===1&&(o[a++]=61)),r?(a&&r.push(String.fromCharCode.apply(String,o.slice(0,a))),r.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var Al="invalid encoding";vr.decode=function(e,i,n){for(var r=n,o=0,a,s=0;s<e.length;){var l=e.charCodeAt(s++);if(l===61&&o>1)break;if((l=wr[l])===void 0)throw Error(Al);switch(o){case 0:a=l,o=1;break;case 1:i[n++]=a<<2|(l&48)>>4,a=l,o=2;break;case 2:i[n++]=(a&15)<<4|(l&60)>>2,a=l,o=3;break;case 3:i[n++]=(a&3)<<6|l,o=0;break}}if(o===1)throw Error(Al);return n-r};var u0=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,d0=/[-_]/,h0=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;vr.test=function(e){return u0.test(e)||d0.test(e)&&h0.test(e)}});var Rl=te((Km,Tl)=>{"use strict";Tl.exports=Sr;function Sr(){this._listeners=Object.create(null)}Sr.prototype.on=function(e,i,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:i,ctx:n||this}),this};Sr.prototype.off=function(e,i){if(e===void 0)this._listeners=Object.create(null);else if(i===void 0)this._listeners[e]=[];else{var n=this._listeners[e];if(!n)return this;for(var r=0;r<n.length;)n[r].fn===i?n.splice(r,1):++r}return this};Sr.prototype.emit=function(e){var i=this._listeners[e];if(i){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<i.length;)i[r].fn.apply(i[r++].ctx,n)}return this}});var $l=te((Wm,Dl)=>{"use strict";Dl.exports=Nl(Nl);function Nl(t){return typeof Float32Array<"u"?(function(){var e=new Float32Array([-0]),i=new Uint8Array(e.buffer),n=i[3]===128;function r(l,c,f){e[0]=l,c[f]=i[0],c[f+1]=i[1],c[f+2]=i[2],c[f+3]=i[3]}function o(l,c,f){e[0]=l,c[f]=i[3],c[f+1]=i[2],c[f+2]=i[1],c[f+3]=i[0]}t.writeFloatLE=n?r:o,t.writeFloatBE=n?o:r;function a(l,c){return i[0]=l[c],i[1]=l[c+1],i[2]=l[c+2],i[3]=l[c+3],e[0]}function s(l,c){return i[3]=l[c],i[2]=l[c+1],i[1]=l[c+2],i[0]=l[c+3],e[0]}t.readFloatLE=n?a:s,t.readFloatBE=n?s:a})():(function(){function e(n,r,o,a){var s=r<0?1:0;if(s&&(r=-r),r===0)n(1/r>0?0:2147483648,o,a);else if(isNaN(r))n(2143289344,o,a);else if(r>34028234663852886e22)n((s<<31|2139095040)>>>0,o,a);else if(r<11754943508222875e-54)n((s<<31|Math.round(r/1401298464324817e-60))>>>0,o,a);else{var l=Math.floor(Math.log(r)/Math.LN2),c=Math.round(r*Math.pow(2,-l)*8388608)&8388607;n((s<<31|l+127<<23|c)>>>0,o,a)}}t.writeFloatLE=e.bind(null,Pl),t.writeFloatBE=e.bind(null,Fl);function i(n,r,o){var a=n(r,o),s=(a>>31)*2+1,l=a>>>23&255,c=a&8388607;return l===255?c?NaN:s*(1/0):l===0?s*1401298464324817e-60*c:s*Math.pow(2,l-150)*(c+8388608)}t.readFloatLE=i.bind(null,Ml),t.readFloatBE=i.bind(null,zl)})(),typeof Float64Array<"u"?(function(){var e=new Float64Array([-0]),i=new Uint8Array(e.buffer),n=i[7]===128;function r(l,c,f){e[0]=l,c[f]=i[0],c[f+1]=i[1],c[f+2]=i[2],c[f+3]=i[3],c[f+4]=i[4],c[f+5]=i[5],c[f+6]=i[6],c[f+7]=i[7]}function o(l,c,f){e[0]=l,c[f]=i[7],c[f+1]=i[6],c[f+2]=i[5],c[f+3]=i[4],c[f+4]=i[3],c[f+5]=i[2],c[f+6]=i[1],c[f+7]=i[0]}t.writeDoubleLE=n?r:o,t.writeDoubleBE=n?o:r;function a(l,c){return i[0]=l[c],i[1]=l[c+1],i[2]=l[c+2],i[3]=l[c+3],i[4]=l[c+4],i[5]=l[c+5],i[6]=l[c+6],i[7]=l[c+7],e[0]}function s(l,c){return i[7]=l[c],i[6]=l[c+1],i[5]=l[c+2],i[4]=l[c+3],i[3]=l[c+4],i[2]=l[c+5],i[1]=l[c+6],i[0]=l[c+7],e[0]}t.readDoubleLE=n?a:s,t.readDoubleBE=n?s:a})():(function(){function e(n,r,o,a,s,l){var c=a<0?1:0;if(c&&(a=-a),a===0)n(0,s,l+r),n(1/a>0?0:2147483648,s,l+o);else if(isNaN(a))n(0,s,l+r),n(2146959360,s,l+o);else if(a>17976931348623157e292)n(0,s,l+r),n((c<<31|2146435072)>>>0,s,l+o);else{var f;if(a<22250738585072014e-324)f=a/5e-324,n(f>>>0,s,l+r),n((c<<31|f/4294967296)>>>0,s,l+o);else{var h=Math.floor(Math.log(a)/Math.LN2);h===1024&&(h=1023),f=a*Math.pow(2,-h),n(f*4503599627370496>>>0,s,l+r),n((c<<31|h+1023<<20|f*1048576&1048575)>>>0,s,l+o)}}}t.writeDoubleLE=e.bind(null,Pl,0,4),t.writeDoubleBE=e.bind(null,Fl,4,0);function i(n,r,o,a,s){var l=n(a,s+r),c=n(a,s+o),f=(c>>31)*2+1,h=c>>>20&2047,m=4294967296*(c&1048575)+l;return h===2047?m?NaN:f*(1/0):h===0?f*5e-324*m:f*Math.pow(2,h-1075)*(m+4503599627370496)}t.readDoubleLE=i.bind(null,Ml,0,4),t.readDoubleBE=i.bind(null,zl,4,0)})(),t}function Pl(t,e,i){e[i]=t&255,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function Fl(t,e,i){e[i]=t>>>24,e[i+1]=t>>>16&255,e[i+2]=t>>>8&255,e[i+3]=t&255}function Ml(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function zl(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var Bl=te(Vl=>{"use strict";var xr=Vl,Er=new TextDecoder("utf-8",{ignoreBOM:!0}),Rn,Gl=64;try{Rn=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{Rn=Er}xr.length=function(e){for(var i=0,n=0,r=0;r<e.length;++r)n=e.charCodeAt(r),n<128?i+=1:n<2048?i+=2:(n&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320?(++r,i+=4):i+=3;return i};function nn(t,e,i,n){var r=i===0&&n===e.length?e:e.subarray(i,n);return t.decode(r)}xr.read=function(e,i,n){if(n-i<1)return"";if(n-i>=Gl)return nn(Er,e,i,n);for(var r="",o=i,a,s,l,c,f,h,m,p;o+7<n;o+=8){if(a=e[o],s=e[o+1],l=e[o+2],c=e[o+3],f=e[o+4],h=e[o+5],m=e[o+6],p=e[o+7],(a|s|l|c|f|h|m|p)&128)return r+nn(Er,e,o,n);r+=String.fromCharCode(a,s,l,c,f,h,m,p)}for(;o<n;++o){if(a=e[o],a&128)return r+nn(Er,e,o,n);r+=String.fromCharCode(a)}return r};xr.readStrict=function(e,i,n){if(n-i<1)return"";if(n-i>=Gl)return nn(Rn,e,i,n);for(var r="",o=i,a,s,l,c,f,h,m,p;o+7<n;o+=8){if(a=e[o],s=e[o+1],l=e[o+2],c=e[o+3],f=e[o+4],h=e[o+5],m=e[o+6],p=e[o+7],(a|s|l|c|f|h|m|p)&128)return r+nn(Rn,e,o,n);r+=String.fromCharCode(a,s,l,c,f,h,m,p)}for(;o<n;++o){if(a=e[o],a&128)return r+nn(Rn,e,o,n);r+=String.fromCharCode(a)}return r};xr.write=function(e,i,n){for(var r=n,o,a,s=0;s<e.length;++s)o=e.charCodeAt(s),o<128?i[n++]=o:o<2048?(i[n++]=o>>6|192,i[n++]=o&63|128):(o&64512)===55296&&((a=e.charCodeAt(s+1))&64512)===56320?(o=65536+((o&1023)<<10)+(a&1023),++s,i[n++]=o>>18|240,i[n++]=o>>12&63|128,i[n++]=o>>6&63|128,i[n++]=o&63|128):(i[n++]=o>>12|224,i[n++]=o>>6&63|128,i[n++]=o&63|128);return n-r}});var Ll=te((Zm,ql)=>{"use strict";ql.exports=p0;function p0(t,e,i){var n=i||8192,r=n>>>1,o=null,a=n;return function(l){if(l<1||l>r)return t(l);a+l>n&&(o=t(n),a=0);var c=e.call(o,a,a+=l);return a&7&&(a=(a|7)+1),c}}});var Ul=te((Qm,jl)=>{"use strict";jl.exports=ze;var Nn;function ze(t,e){this.lo=t>>>0,this.hi=e>>>0}var Ri=ze.zero=new ze(0,0);Ri.toNumber=function(){return 0};Ri.zzEncode=Ri.zzDecode=function(){return this};Ri.length=function(){return 1};var m0=ze.zeroHash="\0\0\0\0\0\0\0\0";ze.fromNumber=function(e){if(e===0)return Ri;var i=e<0;i&&(e=-e);var n=e>>>0,r=(e-n)/4294967296>>>0;return i&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new ze(n,r)};ze.from=function(e){if(typeof e=="number")return ze.fromNumber(e);if(typeof e=="string"||e instanceof String)if(Nn)e=Nn.fromString(e);else return ze.fromNumber(parseInt(e,10));return e.low||e.high?new ze(e.low>>>0,e.high>>>0):Ri};ze.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var i=~this.lo+1>>>0,n=~this.hi>>>0;return i||(n=n+1>>>0),-(i+n*4294967296)}return this.lo+this.hi*4294967296};ze.prototype.toLong=function(e){return Nn?new Nn(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var li=String.prototype.charCodeAt;ze.fromHash=function(e){return e===m0?Ri:new ze((li.call(e,0)|li.call(e,1)<<8|li.call(e,2)<<16|li.call(e,3)<<24)>>>0,(li.call(e,4)|li.call(e,5)<<8|li.call(e,6)<<16|li.call(e,7)<<24)>>>0)};ze.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};ze.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};ze.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};ze.prototype.length=function(){var e=this.lo,i=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?i===0?e<16384?e<128?1:2:e<2097152?3:4:i<16384?i<128?5:6:i<2097152?7:8:n<128?9:10};ze._configure=function(t){Nn=t}});var Yl=te((Pn,Bo)=>{(function(t,e){function i(n){return n.default||n}typeof define=="function"&&define.amd?define([],function(){var n={};return e(n),i(n)}):typeof Pn=="object"?(e(Pn),typeof Bo=="object"&&(Bo.exports=i(Pn))):(function(){var n={};e(n),t.Long=i(n)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:Pn,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function i(A,u,E){this.low=A|0,this.high=u|0,this.unsigned=!!E}i.prototype.__isLong__,Object.defineProperty(i.prototype,"__isLong__",{value:!0});function n(A){return(A&&A.__isLong__)===!0}function r(A){var u=Math.clz32(A&-A);return A?31-u:u}i.isLong=n;var o={},a={};function s(A,u){var E,M,j;return u?(A>>>=0,(j=0<=A&&A<256)&&(M=a[A],M)?M:(E=c(A,0,!0),j&&(a[A]=E),E)):(A|=0,(j=-128<=A&&A<128)&&(M=o[A],M)?M:(E=c(A,A<0?-1:0,!1),j&&(o[A]=E),E))}i.fromInt=s;function l(A,u){if(isNaN(A))return u?I:G;if(u){if(A<0)return I;if(A>=w)return x}else{if(A<=-S)return O;if(A+1>=S)return q}return A<0?l(-A,u).neg():c(A%g|0,A/g|0,u)}i.fromNumber=l;function c(A,u,E){return new i(A,u,E)}i.fromBits=c;var f=Math.pow;function h(A,u,E){if(A.length===0)throw Error("empty string");if(typeof u=="number"?(E=u,u=!1):u=!!u,A==="NaN"||A==="Infinity"||A==="+Infinity"||A==="-Infinity")return u?I:G;if(E=E||10,E<2||36<E)throw RangeError("radix");var M;if((M=A.indexOf("-"))>0)throw Error("interior hyphen");if(M===0)return h(A.substring(1),u,E).neg();for(var j=l(f(E,8)),H=G,Z=0;Z<A.length;Z+=8){var ue=Math.min(8,A.length-Z),we=parseInt(A.substring(Z,Z+ue),E);if(ue<8){var Se=l(f(E,ue));H=H.mul(Se).add(l(we))}else H=H.mul(j),H=H.add(l(we))}return H.unsigned=u,H}i.fromString=h;function m(A,u){return typeof A=="number"?l(A,u):typeof A=="string"?h(A,u):c(A.low,A.high,typeof u=="boolean"?u:A.unsigned)}i.fromValue=m;var p=65536,b=1<<24,g=p*p,w=g*g,S=w/2,_=s(b),G=s(0);i.ZERO=G;var I=s(0,!0);i.UZERO=I;var $=s(1);i.ONE=$;var V=s(1,!0);i.UONE=V;var Y=s(-1);i.NEG_ONE=Y;var q=c(-1,2147483647,!1);i.MAX_VALUE=q;var x=c(-1,-1,!0);i.MAX_UNSIGNED_VALUE=x;var O=c(0,-2147483648,!1);i.MIN_VALUE=O;var y=i.prototype;y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*g+(this.low>>>0):this.high*g+(this.low>>>0)},y.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(O)){var E=l(u),M=this.div(E),j=M.mul(E).sub(this);return M.toString(u)+j.toInt().toString(u)}else return"-"+this.neg().toString(u);for(var H=l(f(u,6),this.unsigned),Z=this,ue="";;){var we=Z.div(H),Se=Z.sub(we.mul(H)).toInt()>>>0,pe=Se.toString(u);if(Z=we,Z.isZero())return pe+ue;for(;pe.length<6;)pe="0"+pe;ue=""+pe+ue}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,E=31;E>0&&(u&1<<E)==0;E--);return this.high!=0?E+33:E+1},y.isSafeInteger=function(){var u=this.high>>21;return u?this.unsigned?!1:u===-1&&!(this.low===0&&this.high===-2097152):!0},y.isZero=function(){return this.high===0&&this.low===0},y.eqz=y.isZero,y.isNegative=function(){return!this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return(this.low&1)===1},y.isEven=function(){return(this.low&1)===0},y.equals=function(u){return n(u)||(u=m(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},y.eq=y.equals,y.notEquals=function(u){return!this.eq(u)},y.neq=y.notEquals,y.ne=y.notEquals,y.lessThan=function(u){return this.comp(u)<0},y.lt=y.lessThan,y.lessThanOrEqual=function(u){return this.comp(u)<=0},y.lte=y.lessThanOrEqual,y.le=y.lessThanOrEqual,y.greaterThan=function(u){return this.comp(u)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(u){return this.comp(u)>=0},y.gte=y.greaterThanOrEqual,y.ge=y.greaterThanOrEqual,y.compare=function(u){if(n(u)||(u=m(u)),this.eq(u))return 0;var E=this.isNegative(),M=u.isNegative();return E&&!M?-1:!E&&M?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.sub(u).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add($)},y.neg=y.negate,y.add=function(u){n(u)||(u=m(u));var E=this.high>>>16,M=this.high&65535,j=this.low>>>16,H=this.low&65535,Z=u.high>>>16,ue=u.high&65535,we=u.low>>>16,Se=u.low&65535,pe=0,Q=0,fe=0,_e=0;return _e+=H+Se,fe+=_e>>>16,_e&=65535,fe+=j+we,Q+=fe>>>16,fe&=65535,Q+=M+ue,pe+=Q>>>16,Q&=65535,pe+=E+Z,pe&=65535,c(fe<<16|_e,pe<<16|Q,this.unsigned)},y.subtract=function(u){return n(u)||(u=m(u)),this.add(u.neg())},y.sub=y.subtract,y.multiply=function(u){if(this.isZero())return this;if(n(u)||(u=m(u)),e){var E=e.mul(this.low,this.high,u.low,u.high);return c(E,e.get_high(),this.unsigned)}if(u.isZero())return this.unsigned?I:G;if(this.eq(O))return u.isOdd()?O:G;if(u.eq(O))return this.isOdd()?O:G;if(this.isNegative())return u.isNegative()?this.neg().mul(u.neg()):this.neg().mul(u).neg();if(u.isNegative())return this.mul(u.neg()).neg();if(this.lt(_)&&u.lt(_))return l(this.toNumber()*u.toNumber(),this.unsigned);var M=this.high>>>16,j=this.high&65535,H=this.low>>>16,Z=this.low&65535,ue=u.high>>>16,we=u.high&65535,Se=u.low>>>16,pe=u.low&65535,Q=0,fe=0,_e=0,yt=0;return yt+=Z*pe,_e+=yt>>>16,yt&=65535,_e+=H*pe,fe+=_e>>>16,_e&=65535,_e+=Z*Se,fe+=_e>>>16,_e&=65535,fe+=j*pe,Q+=fe>>>16,fe&=65535,fe+=H*Se,Q+=fe>>>16,fe&=65535,fe+=Z*we,Q+=fe>>>16,fe&=65535,Q+=M*pe+j*Se+H*we+Z*ue,Q&=65535,c(_e<<16|yt,Q<<16|fe,this.unsigned)},y.mul=y.multiply,y.divide=function(u){if(n(u)||(u=m(u)),u.isZero())throw Error("division by zero");if(e){if(!this.unsigned&&this.high===-2147483648&&u.low===-1&&u.high===-1)return this;var E=(this.unsigned?e.div_u:e.div_s)(this.low,this.high,u.low,u.high);return c(E,e.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?I:G;var M,j,H;if(this.unsigned){if(u.unsigned||(u=u.toUnsigned()),u.gt(this))return I;if(u.gt(this.shru(1)))return V;H=I}else{if(this.eq(O)){if(u.eq($)||u.eq(Y))return O;if(u.eq(O))return $;var Z=this.shr(1);return M=Z.div(u).shl(1),M.eq(G)?u.isNegative()?$:Y:(j=this.sub(u.mul(M)),H=M.add(j.div(u)),H)}else if(u.eq(O))return this.unsigned?I:G;if(this.isNegative())return u.isNegative()?this.neg().div(u.neg()):this.neg().div(u).neg();if(u.isNegative())return this.div(u.neg()).neg();H=G}for(j=this;j.gte(u);){M=Math.max(1,Math.floor(j.toNumber()/u.toNumber()));for(var ue=Math.ceil(Math.log(M)/Math.LN2),we=ue<=48?1:f(2,ue-48),Se=l(M),pe=Se.mul(u);pe.isNegative()||pe.gt(j);)M-=we,Se=l(M,this.unsigned),pe=Se.mul(u);Se.isZero()&&(Se=$),H=H.add(Se),j=j.sub(pe)}return H},y.div=y.divide,y.modulo=function(u){if(n(u)||(u=m(u)),e){var E=(this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,u.low,u.high);return c(E,e.get_high(),this.unsigned)}return this.sub(this.div(u).mul(u))},y.mod=y.modulo,y.rem=y.modulo,y.not=function(){return c(~this.low,~this.high,this.unsigned)},y.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},y.clz=y.countLeadingZeros,y.countTrailingZeros=function(){return this.low?r(this.low):r(this.high)+32},y.ctz=y.countTrailingZeros,y.and=function(u){return n(u)||(u=m(u)),c(this.low&u.low,this.high&u.high,this.unsigned)},y.or=function(u){return n(u)||(u=m(u)),c(this.low|u.low,this.high|u.high,this.unsigned)},y.xor=function(u){return n(u)||(u=m(u)),c(this.low^u.low,this.high^u.high,this.unsigned)},y.shiftLeft=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?c(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):c(0,this.low<<u-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?c(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):c(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(u){return n(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?c(this.low>>>u|this.high<<32-u,this.high>>>u,this.unsigned):u===32?c(this.high,0,this.unsigned):c(this.high>>>u-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.shr_u=y.shiftRightUnsigned,y.rotateLeft=function(u){var E;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?c(this.high,this.low,this.unsigned):u<32?(E=32-u,c(this.low<<u|this.high>>>E,this.high<<u|this.low>>>E,this.unsigned)):(u-=32,E=32-u,c(this.high<<u|this.low>>>E,this.low<<u|this.high>>>E,this.unsigned))},y.rotl=y.rotateLeft,y.rotateRight=function(u){var E;return n(u)&&(u=u.toInt()),(u&=63)===0?this:u===32?c(this.high,this.low,this.unsigned):u<32?(E=32-u,c(this.high<<E|this.low>>>u,this.low<<E|this.high>>>u,this.unsigned)):(u-=32,E=32-u,c(this.low<<E|this.high>>>u,this.high<<E|this.low>>>u,this.unsigned))},y.rotr=y.rotateRight,y.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},y.toBytes=function(u){return u?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var u=this.high,E=this.low;return[E&255,E>>>8&255,E>>>16&255,E>>>24,u&255,u>>>8&255,u>>>16&255,u>>>24]},y.toBytesBE=function(){var u=this.high,E=this.low;return[u>>>24,u>>>16&255,u>>>8&255,u&255,E>>>24,E>>>16&255,E>>>8&255,E&255]},i.fromBytes=function(u,E,M){return M?i.fromBytesLE(u,E):i.fromBytesBE(u,E)},i.fromBytesLE=function(u,E){return new i(u[0]|u[1]<<8|u[2]<<16|u[3]<<24,u[4]|u[5]<<8|u[6]<<16|u[7]<<24,E)},i.fromBytesBE=function(u,E){return new i(u[4]<<24|u[5]<<16|u[6]<<8|u[7],u[0]<<24|u[1]<<16|u[2]<<8|u[3],E)},typeof BigInt=="function"&&(i.fromBigInt=function(u,E){var M=Number(BigInt.asIntN(32,u)),j=Number(BigInt.asIntN(32,u>>BigInt(32)));return c(M,j,E)},i.fromValue=function(u,E){return typeof u=="bigint"?i.fromBigInt(u,E):m(u,E)},y.toBigInt=function(){var u=BigInt(this.low>>>0),E=BigInt(this.unsigned?this.high>>>0:this.high);return E<<BigInt(32)|u});var P=t.default=i})});var Pt=te(qo=>{"use strict";var X=qo;X.asPromise=Vo();X.base64=Ol();X.EventEmitter=Rl();X.float=$l();X.utf8=Bl();X.pool=Ll();X.LongBits=Ul();function Hl(t){return t==="__proto__"||t==="prototype"||t==="constructor"}X.isUnsafeProperty=Hl;X.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);X.global=X.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||qo;X.emptyArray=Object.freeze?Object.freeze([]):[];X.emptyObject=Object.freeze?Object.freeze({}):{};X.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};X.isString=function(e){return typeof e=="string"||e instanceof String};X.isObject=function(e){return e&&typeof e=="object"};X.isset=X.isSet=function(e,i){var n=e[i];return n!=null&&Object.hasOwnProperty.call(e,i)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};X.Buffer=(function(){try{var t=X.global.Buffer;return t.prototype.utf8Write||X.isNode?t:null}catch{return null}})();X.newBuffer=function(e){var i=X.Buffer;return typeof e=="number"?i?i.allocUnsafe(e):new Uint8Array(e):i?i.from(e):new Uint8Array(e)};X.rawField=function(e,i,n){var r=[],o=e<<3|i;for(o>>>=0;o>127;)r.push(o&127|128),o>>>=7;r.push(o);for(var a=0;a<n.length;++a)r.push(n[a]);return X.newBuffer(r)};X.Array=Uint8Array;X.Long=X.global.dcodeIO&&X.global.dcodeIO.Long||X.global.Long||(function(){try{var t=Yl();return t&&t.isLong?t:null}catch{return null}})();X.key2Re=/^(?:true|false|0|1)$/;X.key32Re=/^-?(?:0|[1-9][0-9]*)$/;X.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/;X.longToHash=function(e){return e?X.LongBits.from(e).toHash():X.LongBits.zeroHash};X.longFromHash=function(e,i){var n=X.LongBits.fromHash(e);return X.Long?X.Long.fromBits(n.lo,n.hi,i):n.toNumber(!!i)};X.longFromKey=function(e,i){return X.key64Re.test(e)&&!X.key32Re.test(e)?X.longFromHash(e,i):e};X.boolFromKey=function(e){return e==="true"||e==="1"};function Xl(t){var e=typeof arguments[arguments.length-1]=="boolean",i=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var n=1;n<i;++n){var r=arguments[n];if(r)for(var o=Object.keys(r),a=0;a<o.length;++a)!Hl(o[a])&&(!e||!Object.prototype.hasOwnProperty.call(t,o[a])||t[o[a]]===void 0)&&(t[o[a]]=r[o[a]])}return t}X.merge=Xl;X.nestingLimit=32;X.recursionLimit=100;X.makeProp=function(e,i,n){Object.prototype.hasOwnProperty.call(e,i)||Object.defineProperty(e,i,{enumerable:n===void 0?!0:n,configurable:!0,writable:!0})};X.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function Kl(t){function e(i,n){if(!(this instanceof e))return new e(i,n);Object.defineProperty(this,"message",{get:function(){return i}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&Xl(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}X.newError=Kl;X.ProtocolError=Kl("ProtocolError");X.oneOfGetter=function(e){for(var i={},n=0;n<e.length;++n)i[e[n]]=1;return function(){for(var r=Object.keys(this),o=r.length-1;o>-1;--o)if(i[r[o]]===1&&this[r[o]]!==void 0&&this[r[o]]!==null)return r[o]}};X.oneOfSetter=function(e){return function(i){for(var n=0;n<e.length;++n)e[n]!==i&&delete this[e[n]]}};X.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}});var Ir=te((t2,ec)=>{"use strict";ec.exports=K;var Ft=Pt(),jo,Ht=Ft.LongBits,Wl=Ft.base64,Lo=Ft.utf8;function K(){this.pos=0,this.buf=this.constructor.alloc(K.initialBufferSize),this.view=null,this.states=null}K.initialBufferSize=128;Object.defineProperty(K.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var Jl=function(){return Ft.Buffer?function(){return(K.create=function(){return new jo})()}:function(){return new K}};K.create=Jl();K.alloc=function(e){return new Uint8Array(e)};K.alloc=Ft.pool(K.alloc,Uint8Array.prototype.subarray);function Uo(t){return t<128?1:t<16384?2:t<2097152?3:t<268435456?4:5}K.prototype._reserve=function(e){var i=this.pos+e;if(i>this.buf.length){var n=this.buf.length<<1;n<i&&(n=i);var r=this.constructor.alloc(n);r.set(this.buf.subarray(0,this.pos),0),this.buf=r,this.view=null}};function b0(t,e,i){for(var n=0;n<t.length;)e[i++]=t.charCodeAt(n++)}function Ni(t,e,i){for(;t>127;)e[i++]=t&127|128,t>>>=7;return e[i]=t,i+1}K.prototype.uint32=function(e){e=e>>>0,this._reserve(5);var i=this.pos;return this.pos=Ni(e,this.buf,i),this};K.prototype.int32=function(e){return(e|=0)<0?(this._reserve(10),on(Ht.fromNumber(e),this.buf,this.pos),this.pos+=10,this):this.uint32(e)};K.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function on(t,e,i){for(var n=t.lo,r=t.hi;r;)e[i++]=n&127|128,n=(n>>>7|r<<25)>>>0,r>>>=7;for(;n>127;)e[i++]=n&127|128,n=n>>>7;return e[i]=n,i+1}K.prototype.uint64=function(e){var i=Ht.from(e);this._reserve(10);var n=this.pos;return this.pos=on(i,this.buf,n),this};K.prototype.int64=K.prototype.uint64;K.prototype.sint64=function(e){var i=Ht.from(e).zzEncode();this._reserve(10);var n=this.pos;return this.pos=on(i,this.buf,n),this};K.prototype.bool=function(e){return this._reserve(1),this.buf[this.pos++]=e?1:0,this};function rn(t,e,i){e[i]=t&255,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}K.prototype.fixed32=function(e){return this._reserve(4),rn(e>>>0,this.buf,this.pos),this.pos+=4,this};K.prototype.sfixed32=K.prototype.fixed32;K.prototype.fixed64=function(e){var i=Ht.from(e);return this._reserve(8),rn(i.lo,this.buf,this.pos),rn(i.hi,this.buf,this.pos+4),this.pos+=8,this};K.prototype.sfixed64=K.prototype.fixed64;K.prototype.float=function(e){return this._reserve(4),Ft.float.writeFloatLE(e,this.buf,this.pos),this.pos+=4,this};K.prototype.double=function(e){return this._reserve(8),Ft.float.writeDoubleLE(e,this.buf,this.pos),this.pos+=8,this};K.prototype.bytes=function(e){var i=e.length>>>0;if(!i)return this._reserve(1),this.buf[this.pos++]=0,this;if(Ft.isString(e)){var n=K.alloc(i=Wl.length(e));Wl.decode(e,n,0),e=n}return this.uint32(i),this._reserve(i),this.buf.set(e,this.pos),this.pos+=i,this};K.prototype.raw=function(e){var i=e.length>>>0;return i?(this._reserve(i),this.buf.set(e,this.pos),this.pos+=i,this):this};K.prototype._delim=function(e,i){var n=Uo(i);return n>1&&this.buf.copyWithin(e+n,e+1,e+1+i),Ni(i,this.buf,e),this.pos=e+n+i,this};K.prototype.string=function(e){var i=e.length;if(!i)return this._reserve(1),this.buf[this.pos++]=0,this;if(i<128){this._reserve(i*3+5);var n=this.pos;return this._delim(n,Lo.write(e,this.buf,n+1))}var r=Lo.length(e);return this.uint32(r),this._reserve(r),r===e.length?b0(e,this.buf,this.pos):Lo.write(e,this.buf,this.pos),this.pos+=r,this};K.prototype.uint32s=function(e){var i=e.length;this._reserve(i*5+5);for(var n=this.buf,r=this.pos,o=r+1,a=0;a<i;++a)o=Ni(e[a]>>>0,n,o);return this._delim(r,o-r-1)};K.prototype.int32s=function(e){var i=e.length;this._reserve(i*10+5);for(var n=this.buf,r=this.pos,o=r+1,a,s=0;s<i;++s)(a=e[s]|0)<0?o=on(Ht.fromNumber(a),n,o):o=Ni(a,n,o);return this._delim(r,o-r-1)};K.prototype.sint32s=function(e){var i=e.length;this._reserve(i*5+5);for(var n=this.buf,r=this.pos,o=r+1,a=0;a<i;++a)o=Ni((e[a]<<1^e[a]>>31)>>>0,n,o);return this._delim(r,o-r-1)};K.prototype.uint64s=function(e){var i=e.length;this._reserve(i*10+5);for(var n=this.buf,r=this.pos,o=r+1,a=0;a<i;++a)o=on(Ht.from(e[a]),n,o);return this._delim(r,o-r-1)};K.prototype.int64s=K.prototype.uint64s;K.prototype.sint64s=function(e){var i=e.length;this._reserve(i*10+5);for(var n=this.buf,r=this.pos,o=r+1,a=0;a<i;++a)o=on(Ht.from(e[a]).zzEncode(),n,o);return this._delim(r,o-r-1)};K.prototype.bools=function(e){var i=e.length;this.uint32(i),this._reserve(i);for(var n=this.buf,r=this.pos,o=0;o<i;++o)n[r++]=e[o]?1:0;return this.pos+=i,this};var Zl=16,Ql=128;function _r(t,e,i){var n=t.view;if(n||e<i)return n;var r=t.buf;return t.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}K.prototype.fixed32s=function(e){var i=e.length,n=i*4;this.uint32(n),this._reserve(n);var r=this.pos,o,a=_r(this,i,Ql);if(a)for(o=0;o<i;++o)a.setUint32(r,e[o]>>>0,!0),r+=4;else{var s=this.buf;for(o=0;o<i;++o)rn(e[o]>>>0,s,r),r+=4}return this.pos+=n,this};K.prototype.sfixed32s=K.prototype.fixed32s;K.prototype.fixed64s=function(e){var i=e.length,n=i*8;this.uint32(n),this._reserve(n);var r=this.pos,o,a,s=_r(this,i,Ql);if(s)for(o=0;o<i;++o)a=Ht.from(e[o]),s.setUint32(r,a.lo,!0),s.setUint32(r+4,a.hi,!0),r+=8;else{var l=this.buf;for(o=0;o<i;++o)a=Ht.from(e[o]),rn(a.lo,l,r),rn(a.hi,l,r+4),r+=8}return this.pos+=n,this};K.prototype.sfixed64s=K.prototype.fixed64s;K.prototype.floats=function(e){var i=e.length,n=i*4;this.uint32(n),this._reserve(n);var r=this.pos,o,a=_r(this,i,Zl);if(a)for(o=0;o<i;++o)a.setFloat32(r,e[o],!0),r+=4;else{var s=this.buf;for(o=0;o<i;++o)Ft.float.writeFloatLE(e[o],s,r),r+=4}return this.pos+=n,this};K.prototype.doubles=function(e){var i=e.length,n=i*8;this.uint32(n),this._reserve(n);var r=this.pos,o,a=_r(this,i,Zl);if(a)for(o=0;o<i;++o)a.setFloat64(r,e[o],!0),r+=8;else{var s=this.buf;for(o=0;o<i;++o)Ft.float.writeDoubleLE(e[o],s,r),r+=8}return this.pos+=n,this};K.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this};K.prototype.reset=function(){var e=this.states;return e&&e.length?this.pos=e.pop():this.pos=0,this};K.prototype.ldelim=function(){var e=this.states,i,n;if(e&&e.length){var r=e.pop();i=this.pos-r-1,n=Uo(i),n>1?(this._reserve(n-1),this.buf.copyWithin(r+n,r+1,r+1+i),this.pos+=n-1,Ni(i,this.buf,r)):this.buf[r]=i}else i=this.pos,n=Uo(i),this._reserve(n),this.buf.copyWithin(n,0,i),Ni(i,this.buf,0),this.pos+=n;return this};K.prototype.finish=function(e){if(e)return this.buf.subarray(0,this.pos);var i=this.constructor.alloc(this.pos);return i.set(this.buf.subarray(0,this.pos),0),i};K.prototype.finishInto=function(e,i){return i===void 0&&(i=0),e.set(this.buf.subarray(0,this.pos),i),e};K._configure=function(t){jo=t,K.create=Jl(),jo._configure()}});var nc=te((i2,ic)=>{"use strict";ic.exports=fi;var tc=Ir();fi.prototype=Object.create(tc.prototype,{constructor:{value:fi,writable:!0,enumerable:!1,configurable:!0}});var ci=Pt();function fi(){tc.call(this)}var Yo;fi._configure=function(){fi.alloc=ci.Buffer&&ci.Buffer.allocUnsafe,Yo=ci.Buffer&&ci.Buffer.prototype.utf8Write?function(e,i,n){return i.utf8Write(e,n)}:function(e,i,n){return i.write(e,n)}};fi.prototype.bytes=function(e){ci.isString(e)&&(e=ci.Buffer.from(e,"base64"));var i=e.length>>>0;return this.uint32(i),i&&(this._reserve(i),this.buf.set(e,this.pos),this.pos+=i),this};fi.prototype.string=function(e){var i=e.length;if(!i)return this._reserve(1),this.buf[this.pos++]=0,this;if(i<128){this._reserve(i*3+5);var n=this.pos,r=this.buf;return this._delim(n,i<40?ci.utf8.write(e,r,n+1):Yo(e,r,n+1))}var o=ci.Buffer.byteLength(e);return this.uint32(o),this._reserve(o),Yo(e,this.buf,this.pos),this.pos+=o,this};fi._configure()});var Ar=te((n2,uc)=>{"use strict";uc.exports=oe;var Et=Pt(),Xo,ac=Et.LongBits,sc=Et.utf8;function ye(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function oe(t){this.buf=t,this.pos=0,this.len=t.length,this.view=null,this.discardUnknown=oe.discardUnknown}function rc(t){if(Array.isArray(t)&&(t=new Uint8Array(t)),t instanceof Uint8Array)return new oe(t);throw Error("illegal buffer")}var lc=function(){return Et.Buffer?function(i){return(oe.create=function(r){return Et.Buffer.isBuffer(r)?new Xo(r):rc(r)})(i)}:rc};oe.create=lc();oe.prototype.raw=function(e,i){return this.buf.subarray(e,i)};oe.prototype.uint32=function(){var e=this.buf,i=this.pos,n=(e[i]&127)>>>0;if(e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&127)<<7)>>>0,e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&127)<<14)>>>0,e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&127)<<21)>>>0,e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&15)<<28)>>>0,e[i++]<128)return this.pos=i,n;for(var r=0;r<5;++r){if(i>=this.len)throw this.pos=i,ye(this);if(e[i++]<128)return this.pos=i,n}throw this.pos=i,Error("invalid varint encoding")};oe.prototype.tag=function(){var e=this.buf,i=this.pos,n=(e[i]&127)>>>0;if(e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&127)<<7)>>>0,e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&127)<<14)>>>0,e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&127)<<21)>>>0,e[i++]<128)return this.pos=i,n;if(n=(n|(e[i]&15)<<28)>>>0,e[i]<128&&(e[i]&112)===0)return this.pos=i+1,n;throw this.pos=i+1,Error("invalid tag encoding")};oe.prototype.int32=function(){return this.uint32()|0};oe.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function Ho(){var t=new ac(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<4;++e){if(this.pos>=this.len)throw ye(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}throw ye(this)}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw ye(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}oe.prototype.bool=function(){for(var e=!1,i,n=0;n<10;++n){if(this.pos>=this.len)throw ye(this);if(i=this.buf[this.pos++],i&127&&(e=!0),i<128)return e}throw Error("invalid varint encoding")};function an(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}oe.prototype.fixed32=function(){if(this.pos+4>this.len)throw ye(this,4);return an(this.buf,this.pos+=4)};oe.prototype.sfixed32=function(){if(this.pos+4>this.len)throw ye(this,4);return an(this.buf,this.pos+=4)|0};function oc(){if(this.pos+8>this.len)throw ye(this,8);return new ac(an(this.buf,this.pos+=4),an(this.buf,this.pos+=4))}oe.prototype.float=function(){if(this.pos+4>this.len)throw ye(this,4);var e=Et.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};oe.prototype.double=function(){if(this.pos+8>this.len)throw ye(this,4);var e=Et.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};oe.prototype.uint32s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos,n=this.buf,r=this.pos,o;r<i;)o=n[r++],o<128?e.push(o):(this.pos=r-1,e.push(this.uint32()),r=this.pos);return this.pos=r,e};oe.prototype.int32s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos,n=this.buf,r=this.pos,o;r<i;)o=n[r++],o<128?e.push(o):(this.pos=r-1,e.push(this.int32()),r=this.pos);return this.pos=r,e};oe.prototype.sint32s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.sint32());return e};oe.prototype.bools=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos,n=this.buf,r=this.pos,o;r<i;)o=n[r++],o<128?e.push(o!==0):(this.pos=r-1,e.push(this.bool()),r=this.pos);return this.pos=r,e};var cc=8,fc=128;function Cr(t,e,i){var n=t.view;if(n||e<i)return n;var r=t.buf;return t.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}oe.prototype.fixed32s=function(e){e===void 0&&(e=[]);var i=this.uint32(),n=this.pos+i;if(n>this.len)throw ye(this,i);var r=i>>>2,o=e.length,a=this.pos;e.length=o+r;var s=Cr(this,r,fc);if(s)for(var l=0;l<r;++l,a+=4)e[o++]=s.getUint32(a,!0);else for(var c=this.buf,f=0;f<r;++f,a+=4)e[o++]=an(c,a+4);if(this.pos=a,a!==n)throw ye(this,4);return e};oe.prototype.sfixed32s=function(e){e===void 0&&(e=[]);var i=this.uint32(),n=this.pos+i;if(n>this.len)throw ye(this,i);var r=i>>>2,o=e.length,a=this.pos;e.length=o+r;var s=Cr(this,r,fc);if(s)for(var l=0;l<r;++l,a+=4)e[o++]=s.getInt32(a,!0);else for(var c=this.buf,f=0;f<r;++f,a+=4)e[o++]=an(c,a+4)|0;if(this.pos=a,a!==n)throw ye(this,4);return e};oe.prototype.floats=function(e){e===void 0&&(e=[]);var i=this.uint32(),n=this.pos+i;if(n>this.len)throw ye(this,i);var r=i>>>2,o=e.length,a=this.pos;e.length=o+r;var s=Cr(this,r,cc);if(s)for(var l=0;l<r;++l,a+=4)e[o++]=s.getFloat32(a,!0);else for(var c=this.buf,f=0;f<r;++f,a+=4)e[o++]=Et.float.readFloatLE(c,a);if(this.pos=a,a!==n)throw ye(this,4);return e};oe.prototype.doubles=function(e){e===void 0&&(e=[]);var i=this.uint32(),n=this.pos+i;if(n>this.len)throw ye(this,i);var r=i>>>3,o=e.length,a=this.pos;e.length=o+r;var s=Cr(this,r,cc);if(s)for(var l=0;l<r;++l,a+=8)e[o++]=s.getFloat64(a,!0);else for(var c=this.buf,f=0;f<r;++f,a+=8)e[o++]=Et.float.readDoubleLE(c,a);if(this.pos=a,a!==n)throw ye(this,8);return e};oe.prototype.uint64s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.uint64());return e};oe.prototype.int64s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.int64());return e};oe.prototype.sint64s=function(e){e===void 0&&(e=[]);for(var i=this.uint32()+this.pos;this.pos<i;)e.push(this.sint64());return e};oe.prototype.fixed64s=function(e){e===void 0&&(e=[]);var i=this.uint32(),n=this.pos+i,r=e.length;if(n>this.len)throw ye(this,i);var o=i>>>3;e.length=r+o;for(var a=0;a<o;++a)e[r++]=this.fixed64();if(this.pos!==n)throw ye(this,8);return e};oe.prototype.sfixed64s=function(e){e===void 0&&(e=[]);var i=this.uint32(),n=this.pos+i,r=e.length;if(n>this.len)throw ye(this,i);var o=i>>>3;e.length=r+o;for(var a=0;a<o;++a)e[r++]=this.sfixed64();if(this.pos!==n)throw ye(this,8);return e};oe.prototype.bytes=function(){var e=this.uint32(),i=this.pos,n=this.pos+e;if(n>this.len)throw ye(this,e);return this.pos=n,this.raw(i,n)};oe.prototype.string=function(){var e=this.uint32(),i=this.pos,n=this.pos+e;if(n>this.len)throw ye(this,e);return this.pos=n,sc.read(this.buf,i,n)};oe.prototype.stringVerify=function(){var e=this.uint32(),i=this.pos,n=this.pos+e;if(n>this.len)throw ye(this,e);return this.pos=n,sc.readStrict(this.buf,i,n)};oe.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ye(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ye(this);while(this.buf[this.pos++]&128);return this};oe.recursionLimit=Et.recursionLimit;oe.discardUnknown=!0;oe.prototype.skipType=function(t,e,i){if(e===void 0&&(e=0),e>oe.recursionLimit)throw Error("max depth exceeded");if(i===0)throw Error("illegal tag: field number 0");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var n=this.tag(),r=n>>>3;if(t=n&7,!r)throw Error("illegal tag: field number 0");if(t===4){if(i!==void 0&&r!==i)throw Error("invalid end group tag");break}this.skipType(t,e+1,r)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};oe._configure=function(t){Xo=t,oe.create=lc(),Xo._configure();var e=Et.Long?"toLong":"toNumber";Et.merge(oe.prototype,{int64:function(){return Ho.call(this)[e](!1)},uint64:function(){return Ho.call(this)[e](!0)},sint64:function(){return Ho.call(this).zzDecode()[e](!1)},fixed64:function(){return oc.call(this)[e](!0)},sfixed64:function(){return oc.call(this)[e](!1)}})}});var mc=te((r2,pc)=>{"use strict";pc.exports=ui;var hc=Ar();ui.prototype=Object.create(hc.prototype,{constructor:{value:ui,writable:!0,enumerable:!1,configurable:!0}});var dc=Pt();function ui(t){hc.call(this,t)}ui._configure=function(){dc.Buffer&&(ui.prototype._slice=dc.Buffer.prototype.slice)};ui.prototype.raw=function(e,i){return this._slice.call(this.buf,e,i)};ui.prototype.string=function(){var e=this.uint32(),i=this.pos,n=this.pos+e;if(n>this.len)throw RangeError("index out of range: "+this.pos+" + "+e+" > "+this.len);return this.pos=n,this.buf.utf8Slice?this.buf.utf8Slice(i,n):this.buf.toString("utf-8",i,n)};ui._configure()});var gc=te((o2,bc)=>{"use strict";bc.exports=Fn;var Ko=Pt();Fn.prototype=Object.create(Ko.EventEmitter.prototype,{constructor:{value:Fn,writable:!0,enumerable:!1,configurable:!0}});function Fn(t,e,i){if(typeof t!="function")throw TypeError("rpcImpl must be a function");Ko.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!i}Fn.prototype.rpcCall=function t(e,i,n,r,o){if(!r)throw TypeError("request must be specified");var a=this;if(!o)return Ko.asPromise(t,a,e,i,n,r);if(!a.rpcImpl){setTimeout(function(){o(Error("already ended"))},0);return}try{return a.rpcImpl(e,i[a.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(l,c){if(l)return a.emit("error",l,e),o(l);if(c===null){a.end(!0);return}if(!(c instanceof n))try{c=n[a.responseDelimited?"decodeDelimited":"decode"](c)}catch(f){return a.emit("error",f,e),o(f)}return a.emit("data",c,e),o(null,c)})}catch(s){a.emit("error",s,e),setTimeout(function(){o(s)},0);return}};Fn.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Wo=te(yc=>{"use strict";var g0=yc;g0.Service=gc()});var Jo=te((s2,vc)=>{"use strict";vc.exports=Object.create(null)});var Sc=te(Xe=>{"use strict";Xe.build="minimal";Xe.Writer=Ir();Xe.BufferWriter=nc();Xe.Reader=Ar();Xe.BufferReader=mc();Xe.util=Pt();Xe.rpc=Wo();Xe.roots=Jo();Xe.configure=wc;function wc(){Xe.util.LongBits._configure(Xe.util.Long),Xe.Writer._configure(Xe.BufferWriter),Xe.Reader._configure(Xe.BufferReader)}wc()});var Qo=te(Ec=>{"use strict";var Zo=Ec;Zo.numberRe=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;Zo.typeRefRe=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;Zo.reservedRe=/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/});var _c=te((f2,xc)=>{"use strict";xc.exports=ea;var y0=Qo(),v0=y0.reservedRe;function ea(t,e){typeof t=="string"&&(e=t,t=void 0);var i=[];function n(o){if(typeof o!="string"){var a=r();if(ea.verbose&&console.log("codegen: "+a),a="return "+a,o){for(var s=Object.keys(o),l=new Array(s.length+1),c=new Array(s.length),f=0;f<s.length;)l[f]=s[f],c[f]=o[s[f++]];return l[f]=a,Function.apply(null,l).apply(null,c)}return Function(a)()}for(var h=new Array(arguments.length-1),m=0;m<h.length;)h[m]=arguments[++m];if(m=0,o=o.replace(/%([%dfijs])/g,function(b,g){var w=h[m++];switch(g){case"d":case"f":return w=Number(w),Object.is(w,-0)?"-0":String(w);case"i":return String(Math.floor(w));case"j":return JSON.stringify(w);case"s":return String(w)}return"%"}),m!==h.length)throw Error("parameter count mismatch");return i.push(o),n}function r(o){return"function "+w0(o||e)+"("+(t&&t.join(",")||"")+`){
2
2
  `+i.join(`
3
3
  `)+`
4
- }`}return Object.defineProperty(r,"toString",{value:n,writable:!0,enumerable:!0,configurable:!0}),r}Uo.verbose=!1;function rh(t){return!t||(t=String(t).replace(/[^\w$]/g,""),!t)?"":(/^\d/.test(t)&&(t="_"+t),ih.test(t)?t+"_":t)}});var Xo=te((zy,cu)=>{"use strict";var ir=null;try{ir=md("fs"),(!ir||!ir.readFile||!ir.readFileSync)&&(ir=null)}catch{}cu.exports=ir});var hu=te((Dy,du)=>{"use strict";du.exports=Tr;var nh=No(),Ho=Xo();function Tr(t,e,i){return typeof e=="function"?(i=e,e={}):e||(e={}),i?!e.xhr&&Ho&&Ho.readFile?Ho.readFile(t,function(n,o){return n&&typeof XMLHttpRequest<"u"?Tr.xhr(t,e,i):n?i(n):i(null,e.binary?o:o.toString("utf8"))}):Tr.xhr(t,e,i):nh(Tr,this,t,e)}Tr.xhr=function(e,i,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(n.readyState===4){if(n.status!==0&&n.status!==200)return r(Error("status "+n.status));if(i.binary){var s=n.response;if(!s){s=[];for(var a=0;a<n.responseText.length;++a)s.push(n.responseText.charCodeAt(a)&255)}return r(null,typeof Uint8Array<"u"?new Uint8Array(s):s)}return r(null,n.responseText)}},i.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}});var gu=te(mu=>{"use strict";var Jo=mu,Wo=/^[a-zA-Z][a-zA-Z0-9+.-]+:\/\//;function oh(t){if(typeof URL>"u"||!Wo.test(t))return null;try{return new URL(t).href}catch{return null}}function sh(t,e){if(typeof URL>"u"||!Wo.test(t)||Wo.test(e))return null;try{return new URL(e,t).href}catch{return null}}var pu=Jo.isAbsolute=function(e){return/^(?:\/|\w+:|\\\\\w+)/.test(e)},Ko=Jo.normalize=function(e){var i=oh(e);if(i)return i;var r=e.substring(0,2),n="";r==="\\\\"&&(n=r,e=e.substring(2)),e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var o=e.split("/"),s=pu(e),a="";s&&(a=o.shift()+"/");for(var l=0;l<o.length;)o[l]===".."?l>0&&o[l-1]!==".."?o.splice(--l,2):s?o.splice(l,1):++l:o[l]==="."?o.splice(l,1):++l;return n+a+o.join("/")};Jo.resolve=function(e,i,r){var n=sh(e,i);return n||(r||(i=Ko(i)),pu(i)?i:(r||(e=Ko(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?Ko(e+"/"+i):i))}});var nr=te((Gy,bu)=>{"use strict";bu.exports=le;var Sn=di();le.prototype=Object.create(Sn.prototype,{constructor:{value:le,writable:!0,enumerable:!1,configurable:!0}});le.className="Namespace";var Zo=ci(),fi=Ve(),ah=Ni(),Ti,rr,Ri;le.fromJSON=function(e,i,r){if(r===void 0&&(r=0),r>fi.recursionLimit)throw Error("max depth exceeded");return new le(e,i.options).addJSON(i.nested,r)};function yu(t,e){if(t&&t.length){for(var i={},r=0;r<t.length;++r)i[t[r].name]=t[r].toJSON(e);return i}}le.arrayToJSON=yu;le.isReservedId=function(e,i){if(e){for(var r=0;r<e.length;++r)if(typeof e[r]!="string"&&e[r][0]<=i&&e[r][1]>=i)return!0}return!1};le.isReservedName=function(e,i){if(e){for(var r=0;r<e.length;++r)if(e[r]===i)return!0}return!1};function le(t,e){Sn.call(this,t,e),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function vu(t){t._nestedArray=null,t._lookupCache=Object.create(null);for(var e=t;e=e.parent;)e._lookupCache=Object.create(null);return t}Object.defineProperty(le.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=fi.toArray(this.nested))}});le.prototype.toJSON=function(e){return fi.toObject(["options",this.options,"nested",yu(this.nestedArray,e)])};le.prototype.addJSON=function(e,i){if(i===void 0&&(i=0),i>fi.recursionLimit)throw Error("max depth exceeded");var r=this;if(e)for(var n=Object.keys(e),o=0,s;o<n.length;++o)s=e[n[o]],r.add((s.fields!==void 0?Ti.fromJSON:s.values!==void 0?Ri.fromJSON:s.methods!==void 0?rr.fromJSON:s.id!==void 0?Zo.fromJSON:le.fromJSON)(n[o],s,i+1));return this};le.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};le.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof Ri)return this.nested[e].values;throw Error("no such enum: "+e)};le.prototype.add=function(e){if(!(e instanceof Zo&&e.extend!==void 0||e instanceof Ti||e instanceof ah||e instanceof Ri||e instanceof rr||e instanceof le))throw TypeError("object must be a valid nested object");if(e.name==="__proto__")return this;if(!this.nested)this.nested={};else{var i=this.get(e.name);if(i)if(i instanceof le&&e instanceof le&&!(i instanceof Ti||i instanceof rr)){for(var r=i.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(i),this.nested||(this.nested={}),e.setOptions(i.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof Ti||this instanceof rr||this instanceof Ri||this instanceof Zo||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var o=this;o=o.parent;)o._needsRecursiveFeatureResolution=!0,o._needsRecursiveResolve=!0;return e.onAdd(this),vu(this)};le.prototype.remove=function(e){if(!(e instanceof Sn))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);if(!fi.remove(this.nested,e,e.name))throw Error(e+" is not a member of "+this);return Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),vu(this)};le.prototype.define=function(e,i){if(fi.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");if(e.length>fi.recursionLimit)throw Error("max depth exceeded");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(r=r.nested[n],!(r instanceof le))throw Error("path conflicts with non-namespace objects")}else r.add(r=new le(n))}return i&&r.addJSON(i),r};le.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._needsRecursiveFeatureResolution&&this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,i=0;for(this.resolve();i<e.length;)e[i]instanceof le?e[i++].resolveAll():e[i++].resolve();return this._needsRecursiveResolve=!1,this};le.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,Sn.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(i=>{i._resolveFeaturesRecursive(e)}),this):this};le.prototype.lookup=function(e,i,r){if(typeof i=="boolean"?(r=i,i=void 0):i&&!Array.isArray(i)&&(i=[i]),fi.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var n=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),i);var o=this._lookupImpl(e,n);if(o&&(!i||i.indexOf(o.constructor)>-1)||(o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+n],o&&(!i||i.indexOf(o.constructor)>-1)))return o;if(r)return null;for(var s=this;s.parent;){if(o=s.parent._lookupImpl(e,n),o&&(!i||i.indexOf(o.constructor)>-1))return o;s=s.parent}return null};le.prototype._lookupImpl=function(e,i){if(Object.prototype.hasOwnProperty.call(this._lookupCache,i))return this._lookupCache[i];var r=this.get(e[0]),n=null;if(r)e.length===1?n=r:r instanceof le&&(e=e.slice(1),n=r._lookupImpl(e,e.join(".")));else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof le&&(r=this._nestedArray[o]._lookupImpl(e,i))){n=r;break}return this._lookupCache[i]=n,n};le.prototype.lookupType=function(e){var i=this.lookup(e,[Ti]);if(!i)throw Error("no such type: "+e);return i};le.prototype.lookupEnum=function(e){var i=this.lookup(e,[Ri]);if(!i)throw Error("no such Enum '"+e+"' in "+this);return i};le.prototype.lookupTypeOrEnum=function(e){var i=this.lookup(e,[Ti,Ri]);if(!i)throw Error("no such Type or Enum '"+e+"' in "+this);return i};le.prototype.lookupService=function(e){var i=this.lookup(e,[rr]);if(!i)throw Error("no such Service '"+e+"' in "+this);return i};le._configure=function(t,e,i){Ti=t,rr=e,Ri=i}});var xn=te((qy,wu)=>{"use strict";wu.exports=Nt;var Qo=ci();Nt.prototype=Object.create(Qo.prototype,{constructor:{value:Nt,writable:!0,enumerable:!1,configurable:!0}});Nt.className="MapField";var lh=hi(),or=Ve();function Nt(t,e,i,r,n,o){if(Qo.call(this,t,e,r,void 0,void 0,n,o),!or.isString(i))throw TypeError("keyType must be a string");this.keyType=i,this.resolvedKeyType=null,this.map=!0}Nt.fromJSON=function(e,i){var r=new Nt(e,i.id,i.keyType,i.type,i.options,i.comment);return i.protoName&&(r.protoName=i.protoName),i.jsonName!==void 0?r.jsonName=i.jsonName:i.options&&i.options.json_name!==void 0&&(r.jsonName=i.options.json_name),r};Nt.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return or.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"protoName",this.protoName!==this.name?this.protoName:void 0,"jsonName",this.jsonName!==or.jsonName(this.protoName||this.name)?this.jsonName:void 0,"options",this.options,"comment",i?this.comment:void 0])};Nt.prototype.resolve=function(){if(this.resolved)return this;if(lh.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return Qo.prototype.resolve.call(this)};Nt.d=function(e,i,r){return typeof r=="function"?r=or.decorateType(r).name:r&&typeof r=="object"&&(r=or.decorateEnum(r).name),function(o,s){or.decorateType(o.constructor).add(new Nt(s,e,i,r))}}});var _n=te((By,Su)=>{"use strict";Su.exports=pi;var es=di();pi.prototype=Object.create(es.prototype,{constructor:{value:pi,writable:!0,enumerable:!1,configurable:!0}});pi.className="Method";var sr=Ve();function pi(t,e,i,r,n,o,s,a,l){if(sr.isObject(n)?(s=n,n=o=void 0):sr.isObject(o)&&(s=o,o=void 0),!(e===void 0||sr.isString(e)))throw TypeError("type must be a string");if(!sr.isString(i))throw TypeError("requestType must be a string");if(!sr.isString(r))throw TypeError("responseType must be a string");es.call(this,t,s),this.type=e||"rpc",this.requestType=i,this.requestStream=n?!0:void 0,this.responseType=r,this.responseStream=o?!0:void 0,this.path="/"+this.name,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=a,this.parsedOptions=l}pi.fromJSON=function(e,i){return new pi(e,i.type,i.requestType,i.responseType,i.requestStream,i.responseStream,i.options,i.comment,i.parsedOptions)};pi.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return sr.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",i?this.comment:void 0,"parsedOptions",this.parsedOptions])};pi.prototype.resolve=function(){if(this.resolved)return this;if(this.parent){var e=this.parent.fullName;e.charAt(0)==="."&&(e=e.substring(1)),this.path="/"+e+"/"+this.name}else this.path="/"+this.name;return this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),es.prototype.resolve.call(this)}});var Cn=te((Vy,Iu)=>{"use strict";Iu.exports=tt;var Yt=nr();tt.prototype=Object.create(Yt.prototype,{constructor:{value:tt,writable:!0,enumerable:!1,configurable:!0}});tt.className="Service";var ts=_n(),In=Ve(),xu=Vo();function tt(t,e){Yt.call(this,t,e),this.methods={},this._methodsArray=null}tt.fromJSON=function(e,i,r){if(r===void 0&&(r=0),r>In.recursionLimit)throw Error("max depth exceeded");var n=new tt(e,i.options);if(i.methods)for(var o=Object.keys(i.methods),s=0;s<o.length;++s)n.add(ts.fromJSON(o[s],i.methods[o[s]]));return i.nested&&n.addJSON(i.nested,r),i.edition&&(n._edition=i.edition),n.comment=i.comment,n._defaultEdition="proto3",n};tt.prototype.toJSON=function(e){var i=Yt.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return In.toObject(["edition",this._editionToJSON(),"options",i&&i.options||void 0,"methods",Yt.arrayToJSON(this.methodsArray,e)||{},"nested",i&&i.nested||void 0,"comment",r?this.comment:void 0])};Object.defineProperty(tt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=In.toArray(this.methods))}});function _u(t){return t._methodsArray=null,t}tt.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:Yt.prototype.get.call(this,e)};tt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Yt.prototype.resolve.call(this);for(var e=this.methodsArray,i=0;i<e.length;++i)e[i].resolve();return this};tt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Yt.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(i=>{i._resolveFeaturesRecursive(e)}),this):this};tt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof ts?e.name==="__proto__"?this:(this.methods[e.name]=e,e.parent=this,_u(this)):Yt.prototype.add.call(this,e)};tt.prototype.remove=function(e){if(e instanceof ts){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,_u(this)}return Yt.prototype.remove.call(this,e)};tt.prototype.create=function(e,i,r){for(var n=new xu.Service(e,i,r),o=0,s;o<this.methodsArray.length;++o){var a=In.lcFirst((s=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,"");n[a]=(function(l,u,f){return function(p,m){return xu.Service.prototype.rpcCall.call(this,l,u,f,p,m)}})(s,s.resolvedRequestType.ctor,s.resolvedResponseType.ctor)}return n}});var En=te((Ly,Cu)=>{"use strict";Cu.exports=Pt;var uh=Tt();function Pt(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)t[e[i]]!=null&&e[i]!=="__proto__"&&(this[e[i]]=t[e[i]])}Pt.create=function(e){return this.$type.create(e)};Pt.encode=function(e,i){return this.$type.encode(e,i)};Pt.encodeDelimited=function(e,i){return this.$type.encodeDelimited(e,i)};Pt.decode=function(e){return this.$type.decode(e)};Pt.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};Pt.verify=function(e){return this.$type.verify(e)};Pt.fromObject=function(e){return this.$type.fromObject(e)};Pt.toObject=function(e,i){return this.$type.toObject(e,i)};Pt.prototype.toJSON=function(){return this.$type.toObject(this,uh.toJSONOptions)}});var is=te((jy,Eu)=>{"use strict";Eu.exports=ch;var kn=bt(),ze=hi(),An=Ve();function fh(t){return"missing required '"+t.name+"'"}function Rr(t){return t._features.utf8_validation==="VERIFY"?"stringVerify":"string"}function ar(t,e){return t("if(!r.discardUnknown){")('util.makeProp(m,"$unknowns",false);')("(m.$unknowns||(m.$unknowns=[])).push(%s)",e)("}")}function ch(t){for(var e=!1,i=!1,r=0;r<t.fieldsArray.length;++r){var n=t._fieldsArray[r];n.map&&(e=!0),(n.resolvedType instanceof kn||!n.repeated&&!n.map&&!n.hasPresence)&&(i=!0)}var o=An.codegen(["r","l","z","q","g"])("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(q===undefined)q=0")("if(q>Reader.recursionLimit)")('throw Error("max depth exceeded")')("var c=l===undefined?r.len:r.pos+l,m=g||new C"+(e?",k,v":i?",v":""))("while(r.pos<c){")("var s=r.pos")("var t=r.tag()")("if(t===z){")("z=undefined")("break")("}");for(t.fieldsArray.length&&o("var u=t&7")("switch(t>>>=3){"),r=0;r<t.fieldsArray.length;++r){var s=t._fieldsArray[r].resolve(),a=s.resolvedType instanceof kn?"int32":s.type,l="m"+An.safeProp(s.name),u=s.resolvedType instanceof kn&&s.resolvedType._features.enum_type==="CLOSED";if(s.map){o("case %i:{",s.id)("if(u!==2)")("break"),u||o("if(%s===util.emptyObject)",l)("%s={}",l),o("var c2=r.uint32()+r.pos"),ze.defaults[s.keyType]!==void 0?o("k=%j",ze.defaults[s.keyType]):o("k=null"),ze.long[a]!==void 0?o("v=util.Long?util.Long.fromNumber(0,%j):0",a==="uint64"||a==="fixed64"):ze.defaults[a]!==void 0?o("v=%j",ze.defaults[a]):o("v=null"),o("while(r.pos<c2){")("var t2=r.tag()")("u=t2&7")("switch(t2>>>=3){")("case 1:")("if(u!==%i)",ze.mapKey[s.keyType])("break")("k=r.%s()",s.keyType==="string"?Rr(s):s.keyType)("continue")("case 2:")("if(u!==%i)",ze.basic[a]===void 0?2:ze.basic[a])("break"),ze.basic[a]===void 0?o("v=types[%i].decode(r,r.uint32(),undefined,q+1,v)",r):o("v=r.%s()",a==="string"?Rr(s):a),o("continue")("}")("r.skipType(u,q,t2)")("}"),u&&(o("if(types[%i].valuesById[v]===undefined){",r),ar(o,"r.raw(s,r.pos)")("continue")("}")("if(%s===util.emptyObject)",l)("%s={}",l));var f=ze.basic[a]===void 0?"v||new types["+r+"].ctor":"v";ze.long[s.keyType]!==void 0?o('%s[typeof k==="object"?util.longToHash(k):k]=%s',l,f):(s.keyType==="string"&&o('if(k==="__proto__")')("util.makeProp(%s,k)",l),o("%s[k]=%s",l,f))}else s.repeated?(o("case %i:",s.id)("{"),ze.packed[a]!==void 0&&(o("if(u===2){"),u?(o("var c2=r.uint32()+r.pos")("while(r.pos<c2){")("s=r.pos")("v=r.%s()",a)("if(types[%i].valuesById[v]!==undefined){",r)("if(!(%s&&%s.length))",l,l)("%s=[]",l)("%s.push(v)",l)("}else"),ar(o,"util.rawField("+s.id+",0,r.raw(s,r.pos))")("}")):o("if(!(%s&&%s.length))",l,l)("%s=[]",l)("r.%ss(%s)",a,l),o("continue")("}")),o("if(u!==%i)",ze.basic[a]===void 0?s.delimited?3:2:ze.basic[a])("break"),u||o("if(!(%s&&%s.length))",l,l)("%s=[]",l),ze.basic[a]===void 0?s.delimited?o("%s.push(types[%i].decode(r,undefined,%i,q+1))",l,r,s.id*8+4):o("%s.push(types[%i].decode(r,r.uint32(),undefined,q+1))",l,r):u?(o("v=r.%s()",a)("if(types[%i].valuesById[v]!==undefined){",r)("if(!(%s&&%s.length))",l,l)("%s=[]",l)("%s.push(v)",l)("}else"),ar(o,"r.raw(s,r.pos)")):o("%s.push(r.%s())",l,a==="string"?Rr(s):a)):ze.basic[a]===void 0?(o("case %i:{",s.id)("if(u!==%i)",s.delimited?3:2)("break"),s.delimited?o("%s=types[%i].decode(r,undefined,%i,q+1,%s)",l,r,s.id*8+4,l):o("%s=types[%i].decode(r,r.uint32(),undefined,q+1,%s)",l,r,l)):s.hasPresence?(o("case %i:{",s.id)("if(u!==%i)",ze.basic[a])("break"),u?(o("v=r.%s()",a)("if(types[%i].valuesById[v]!==undefined){",r)("%s=v",l),s.partOf&&o("m%s=%j",An.safeProp(s.partOf.name),s.name),o("}else"),ar(o,"r.raw(s,r.pos)")):o("%s=r.%s()",l,a==="string"?Rr(s):a)):(o("case %i:{",s.id)("if(u!==%i)",ze.basic[a])("break"),u?(o("v=r.%s()",a)("if(types[%i].valuesById[v]!==undefined){",r)("if(v!==%j)",s.typeDefault)("%s=v",l)("else")("delete %s",l)("}else{"),ar(o,"r.raw(s,r.pos)")("}")):(s.resolvedType instanceof kn&&s.typeDefault!==0?o("if((v=r.%s())!==%j)",a,s.typeDefault):a==="string"?o("if((v=r.%s()).length)",Rr(s)):a==="bytes"?o("if((v=r.%s()).length)",a):ze.long[a]!==void 0?o('if(typeof(v=r.%s())==="object"?v.low||v.high:v!==0)',a):o(a==="double"||a==="float"?"if(!Object.is(v=r.%s(),0))":"if(v=r.%s())",a),o("%s=v",l)("else")("delete %s",l)));s.partOf&&!u&&o("m%s=%j",An.safeProp(s.partOf.name),s.name),o("continue")("}")}for(r&&o("}"),o("r.skipType(%s,q,t)",r?"u":"t&7"),ar(o,"r.raw(s,r.pos)")("}")("if(z!==undefined)")('throw Error("missing end group")'),r=0;r<t._fieldsArray.length;++r){var h=t._fieldsArray[r];h.required&&o("if(!Object.hasOwnProperty.call(m,%j))",h.name)("throw util.ProtocolError(%j,{instance:m})",fh(h))}return o("return m")}});var os=te((Yy,ku)=>{"use strict";ku.exports=ph;var dh=bt(),rs=Ve();function ot(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function ns(t,e,i,r){var n=e.resolvedType;if(n)if(n instanceof dh)if(n._features.enum_type==="CLOSED"){t("switch(%s){",r)("default:")("return%j",ot(e,"enum value"));for(var o=Object.keys(n.values),s=0;s<o.length;++s)t("case %i:",n.values[o[s]]);t("break")("}")}else t('if(typeof %s!=="number"||(%s|0)!==%s)',r,r,r)("return%j",ot(e,"enum value"));else t("{")("var e=types[%i].verify(%s,q+1);",i,r)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",r)("return%j",ot(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",r,r,r,r)("return%j",ot(e,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',r)("return%j",ot(e,"number"));break;case"bool":t('if(typeof %s!=="boolean")',r)("return%j",ot(e,"boolean"));break;case"string":t("if(!util.isString(%s))",r)("return%j",ot(e,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',r,r,r)("return%j",ot(e,"buffer"));break}return t}function hh(t,e,i){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",i)("return%j",ot(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",i)("return%j",ot(e,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",i)("return%j",ot(e,"boolean key"));break}return t}function ph(t){var e=rs.codegen(["m","q"])('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(q===undefined)q=0")("if(q>util.recursionLimit)")("return%j","max depth exceeded"),i=t.oneofsArray,r={};i.length&&e("var p={}");for(var n=0;n<t.fieldsArray.length;++n){var o=t._fieldsArray[n].resolve(),s="m"+rs.safeProp(o.name);if(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",s,o.name),o.map)e("if(!util.isObject(%s))",s)("return%j",ot(o,"object"))("var k=Object.keys(%s)",s)("for(var i=0;i<k.length;++i){"),hh(e,o,"k[i]"),ns(e,o,n,s+"[k[i]]")("}");else if(o.repeated)e("if(!Array.isArray(%s))",s)("return%j",ot(o,"array"))("for(var i=0;i<%s.length;++i){",s),ns(e,o,n,s+"[i]")("}");else{if(o.partOf){var a=rs.safeProp(o.partOf.name);r[o.partOf.name]===1&&e("if(p%s===1)",a)("return%j",o.partOf.name+": multiple values"),r[o.partOf.name]=1,e("p%s=1",a)}ns(e,o,n,s)}o.optional&&e("}")}return e("return null")}});var us=te(Ou=>{"use strict";var Au=Ou,Ut=bt(),ls=hi(),wt=Ve();function ss(t,e,i,r,n){if(e.resolvedType)if(e.resolvedType instanceof Ut){var o=n?"m"+n+"[m"+n+".length]":"m"+r;t("switch(d%s){",r);for(var s=e.resolvedType.values,a=Object.keys(s),l=0;l<a.length;++l)t("case%j:",a[l])("case %i:",s[a[l]])("%s=%j",o,s[a[l]])("break");t("default:"),e.resolvedType._features.enum_type!=="CLOSED"&&t('if(typeof d%s==="number"&&(d%s|0)===d%s)',r,r,r)("%s=d%s",o,r),t("}")}else t("if(!util.isObject(d%s))",r)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s,q+1)",r,i,r);else{var u=!1;switch(e.type){case"double":case"float":t("m%s=Number(d%s)",r,r);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",r,r);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",r,r);break;case"uint64":case"fixed64":u=!0;case"int64":case"sint64":case"sfixed64":t("if(util.Long)")("m%s=util.Long.fromValue(d%s,%j)",r,r,u)('else if(typeof d%s==="string")',r)("m%s=parseInt(d%s,10)",r,r)('else if(typeof d%s==="number")',r)("m%s=d%s",r,r)('else if(typeof d%s==="object")',r)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",r,r,r,u?"true":"");break;case"bytes":t('if(typeof d%s==="string")',r)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",r,r,r)("else if(d%s.length>=0)",r)("m%s=d%s",r,r);break;case"string":t("m%s=String(d%s)",r,r);break;case"bool":t("m%s=Boolean(d%s)",r,r);break}}return t}Au.fromObject=function(e){var i=e.fieldsArray,r=wt.codegen(["d","q"])("if(d instanceof C)")("return d")("if(!util.isObject(d))")("throw TypeError(%j)",e.fullName+": object expected")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")');if(!i.length)return r("return new C");r("var m=new C");for(var n=0;n<i.length;++n){var o=i[n].resolve(),s=wt.safeProp(o.name),a=!o.hasPresence&&!o.repeated&&!o.map&&(o.resolvedType instanceof Ut||ls.basic[o.type]!==void 0);o.map?(r("if(d%s){",s)("if(!util.isObject(d%s))",s)("throw TypeError(%j)",o.fullName+": object expected")("m%s={}",s)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",s),r('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[i])",s),ss(r,o,n,s+"[ks[i]]")("}")("}")):o.repeated?(r("if(d%s){",s)("if(!Array.isArray(d%s))",s)("throw TypeError(%j)",o.fullName+": array expected"),o.resolvedType instanceof Ut?r("m%s=[]",s):r("m%s=Array(d%s.length)",s,s),r("for(var i=0;i<d%s.length;++i){",s),ss(r,o,n,s+"[i]",o.resolvedType instanceof Ut?s:void 0)("}")("}")):(o.resolvedType instanceof Ut||r("if(d%s!=null){",s),a&&(o.resolvedType instanceof Ut?r('if(d%s!==%j&&(typeof d%s!=="string"||types[%i].values[d%s]!==%j)){',s,o.typeDefault,s,n,s,o.typeDefault):o.type==="string"?r('if(typeof d%s!=="string"||d%s.length){',s,s):o.type==="bytes"?r("if(d%s.length){",s):o.type==="bool"?r("if(d%s){",s):o.type==="double"||o.type==="float"?r("if(!Object.is(Number(d%s),0)){",s):ls.long[o.type]!==void 0?r('if(typeof d%s==="object"?d%s.low||d%s.high:Number(d%s)!==0){',s,s,s,s):r("if(Number(d%s)!==0){",s)),ss(r,o,n,s),a&&r("}"),o.resolvedType instanceof Ut||r("}"))}return r("return m")};function as(t,e,i,r,n){if(n||(n=r),e.resolvedType)e.resolvedType instanceof Ut?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",r,i,n,n,i,n,n):t("d%s=types[%i].toObject(m%s,o,q+1)",r,i,n);else{var o=!1;switch(e.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",r,n,n,n);break;case"uint64":case"fixed64":o=!0;case"int64":case"sint64":case"sfixed64":t('if(typeof BigInt!=="undefined"&&o.longs===BigInt)')('d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()',r,n,n,n,n,o)('else if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",r,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",r,n,n,n,o?"true":"",n);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",r,n,n,n,n);break;default:t("d%s=m%s",r,n);break}}return t}Au.toObject=function(e){var i=e.fieldsArray.slice().sort(wt.compareFieldsById);if(!i.length)return wt.codegen()("return {}");for(var r=wt.codegen(["m","o","q"])("if(!o)")("o={}")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")')("var d={}"),n=[],o=[],s=[],a=0;a<i.length;++a)i[a].partOf||(i[a].resolve().repeated?n:i[a].map?o:s).push(i[a]);if(n.length){for(r("if(o.arrays||o.defaults){"),a=0;a<n.length;++a)r("d%s=[]",wt.safeProp(n[a].name));r("}")}if(o.length){for(r("if(o.objects||o.defaults){"),a=0;a<o.length;++a)r("d%s={}",wt.safeProp(o[a].name));r("}")}if(s.length){for(r("if(o.defaults){"),a=0;a<s.length;++a){var l=s[a],u=wt.safeProp(l.name);if(l.resolvedType instanceof Ut)r("d%s=o.enums===String?%j:%j",u,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)('d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n',u)("}else")('d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i',u,l.typeDefault.toString(),l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var f=Array.prototype.slice.call(l.typeDefault);r("if(o.bytes===String)d%s=%j",u,wt.base64.encode(l.typeDefault,0,l.typeDefault.length))("else{")("d%s=%j",u,f)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",u,u)("}")}else(l.type==="double"||l.type==="float")&&typeof l.typeDefault=="number"&&(!isFinite(l.typeDefault)||Object.is(l.typeDefault,-0))?r("d%s=%f",u,l.typeDefault)("if(o.json&&!isFinite(d%s))d%s=String(d%s)",u,u,u):r("d%s=%j",u,l.typeDefault)}r("}")}var h=!1;for(a=0;a<i.length;++a){var l=i[a],p=e._fieldsArray.indexOf(l),u=wt.safeProp(l.name);if(l.map){h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",u,u)("d%s={}",u);var m=ls.long[l.keyType]!==void 0,g=u+"[ks2[j]]";r("for(var j=0;j<ks2.length;++j){"),m&&r("var k2=util.longFromKey(ks2[j],%j).toString()",l.keyType==="uint64"||l.keyType==="fixed64"),r('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",u),as(r,l,p,m?u+"[k2]":g,g)("}")}else l.repeated?(r("if(m%s&&m%s.length){",u,u)("d%s=Array(m%s.length)",u,u)("for(var j=0;j<m%s.length;++j){",u),as(r,l,p,u+"[j]")("}")):(r("if(m%s!=null&&Object.hasOwnProperty.call(m,%j)){",u,l.name),as(r,l,p,u),l.partOf&&!l.partOf.isProto3Optional&&r("if(o.oneofs)")("d%s=%j",wt.safeProp(l.partOf.name),l.name));r("}")}return r("return d")}});var fs=te(Tu=>{"use strict";var mh=Tu,gh=En(),yh=Tt();mh[".google.protobuf.Any"]={fromObject:function(t,e){if(t&&t["@type"]){var i=t["@type"].substring(t["@type"].lastIndexOf("/")+1),r=this.lookup(i,[this.constructor]);if(r){var n=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return n.indexOf("/")===-1&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(t,e===void 0?1:e+1)).finish()})}}return this.fromObject(t,e)},toObject:function(t,e,i){if(i===void 0&&(i=0),i>yh.recursionLimit)throw Error("max depth exceeded");var r="type.googleapis.com/",n="",o="";if(e&&e.json&&t.type_url&&t.value){o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),n=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var s=this.lookup(o,[this.constructor]);s&&(t=s.decode(t.value,void 0,void 0,i+1))}if(!(t instanceof this.ctor)&&t instanceof gh){var a=t.$type.toObject(t,e,i+1),l=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return n===""&&(n=r),o=n+l,a["@type"]=o,a}return this.toObject(t,e,i)}}});var Rn=te((Hy,Pu)=>{"use strict";Pu.exports=pe;var ut=nr();pe.prototype=Object.create(ut.prototype,{constructor:{value:pe,writable:!0,enumerable:!1,configurable:!0}});pe.className="Type";var vh=bt(),hs=Ni(),On=ci(),bh=xn(),wh=Cn(),cs=En(),ds=wn(),Nu=vn(),De=Ve(),Sh=ps(),xh=is(),_h=os(),Ru=us(),Ih=fs();function pe(t,e){t=t.replace(/\W/g,""),ut.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null,this._fieldsByJsonName=null}Object.defineProperties(pe.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e<t.length;++e){var i=this.fields[t[e]],r=i.id;if(this._fieldsById[r])throw Error("duplicate id "+r+" in "+this);this._fieldsById[r]=i}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=De.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=De.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=pe.generateConstructor(this)())},set:function(t){var e=t.prototype;e instanceof cs||(t.prototype=new cs,Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),De.merge(t.prototype,e)),t.$type=t.prototype.$type=this,De.merge(t,cs,!0),this._ctor=t,delete this.decode,delete this.fromObject;for(var i=0,r;i<this.fieldsArray.length;++i)r=this._fieldsArray[i].resolve(),t.prototype[r.name]=r.defaultValue;var n={};for(i=0;i<this.oneofsArray.length;++i)n[this._oneofsArray[i].resolve().name]={get:De.oneOfGetter(this._oneofsArray[i].oneof),set:De.oneOfSetter(this._oneofsArray[i].oneof)};i&&Object.defineProperties(t.prototype,n)}}});pe.generateConstructor=function(e){for(var i=De.codegen(["p"]),r=0,n;r<e.fieldsArray.length;++r)(n=e._fieldsArray[r]).map?i("this%s={}",De.safeProp(n.name)):n.repeated&&i("this%s=[]",De.safeProp(n.name));return i('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")};function Tn(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=t._fieldsByJsonName=null,delete t.encode,delete t.decode,delete t.verify,t}pe.fromJSON=function(e,i,r){if(r===void 0&&(r=0),r>De.nestingLimit)throw Error("max depth exceeded");var n=new pe(e,i.options);n.extensions=i.extensions,n.reserved=i.reserved;for(var o=Object.keys(i.fields),s=0;s<o.length;++s)n.add((typeof i.fields[o[s]].keyType<"u"?bh.fromJSON:On.fromJSON)(o[s],i.fields[o[s]]));if(i.oneofs)for(o=Object.keys(i.oneofs),s=0;s<o.length;++s)n.add(hs.fromJSON(o[s],i.oneofs[o[s]]));if(i.nested)for(o=Object.keys(i.nested),s=0;s<o.length;++s){var a=i.nested[o[s]];n.add((a.id!==void 0?On.fromJSON:a.fields!==void 0?pe.fromJSON:a.values!==void 0?vh.fromJSON:a.methods!==void 0?wh.fromJSON:ut.fromJSON)(o[s],a,r+1))}return i.extensions&&i.extensions.length&&(n.extensions=i.extensions),i.reserved&&i.reserved.length&&(n.reserved=i.reserved),i.group&&(n.group=!0),i.comment&&(n.comment=i.comment),i.edition&&(n._edition=i.edition),n._defaultEdition="proto3",n};pe.prototype.toJSON=function(e){var i=ut.prototype.toJSON.call(this,e),r=e?!!e.keepComments:!1;return De.toObject(["edition",this._editionToJSON(),"options",i&&i.options||void 0,"oneofs",ut.arrayToJSON(this.oneofsArray,e),"fields",ut.arrayToJSON(this.fieldsArray.filter(function(n){return!n.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",i&&i.nested||void 0,"comment",r?this.comment:void 0])};pe.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;ut.prototype.resolveAll.call(this);var e=this.oneofsArray;for(r=0;r<e.length;)e[r++].resolve();for(var i=this.fieldsArray,r=0;r<i.length;)i[r++].resolve();return this};pe.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,ut.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(i=>{i._resolveFeatures(e)}),this.fieldsArray.forEach(i=>{i._resolveFeatures(e)}),this):this};pe.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};pe.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof On&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name)||e.name.charAt(0)==="$")throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),Tn(this))}if(e instanceof hs){if(e.name.charAt(0)==="$")throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),Tn(this))}return ut.prototype.add.call(this,e)};pe.prototype.remove=function(e){if(e instanceof On&&e.extend===void 0){if(!De.remove(this.fields,e,e.name))throw Error(e+" is not a member of "+this);return e.parent=null,e.onRemove(this),Tn(this)}if(e instanceof hs){if(!De.remove(this.oneofs,e,e.name))throw Error(e+" is not a member of "+this);return e.parent=null,e.onRemove(this),Tn(this)}return ut.prototype.remove.call(this,e)};pe.prototype.isReservedId=function(e){return ut.isReservedId(this.reserved,e)};pe.prototype.isReservedName=function(e){return ut.isReservedName(this.reserved,e)};pe.prototype.create=function(e){return new this.ctor(e)};pe.prototype.setup=function(){var e=this.root;if(e&&e._needsRecursiveFeatureResolution){var i=e._edition||this._edition;i&&e._resolveFeaturesRecursive(i)}for(var r=this.fullName,n=[],o=0;o<this.fieldsArray.length;++o)n.push(this._fieldsArray[o].resolve().resolvedType);this.encode=Sh(this)({Writer:Nu,types:n,util:De}),this.decode=xh(this)({Reader:ds,types:n,util:De,C:this.ctor}),this.verify=_h(this)({types:n,util:De}),this.fromObject=Ru.fromObject(this)({types:n,util:De,C:this.ctor}),this.toObject=Ru.toObject(this)({types:n,util:De});var s=Ih[r];if(s){var a=Object.create(this);a._ctor=this.ctor,a.fromObject=this.fromObject,this.fromObject=s.fromObject.bind(a),a.toObject=this.toObject,this.toObject=s.toObject.bind(a)}return this};pe.prototype.encode=function(e,i){return this.setup().encode.apply(this,arguments)};pe.prototype.encodeDelimited=function(e,i){return this.encode(e,(i||Nu.create()).fork()).ldelim()};pe.prototype.decode=function(e,i){return this.setup().decode.apply(this,arguments)};pe.prototype.decodeDelimited=function(e){return e instanceof ds||(e=ds.create(e)),this.decode(e,e.uint32())};pe.prototype.verify=function(e){return this.setup().verify.apply(this,arguments)};pe.prototype.fromObject=function(e){return this.setup().fromObject.apply(this,arguments)};pe.prototype.toObject=function(e,i){return this.setup().toObject.apply(this,arguments)};pe.prototype.getTypeUrl=function(e){e===void 0&&(e="type.googleapis.com");var i=this.fullName;return e+"/"+(i.charAt(0)==="."?i.substring(1):i)};pe.d=function(e){return function(r){De.decorateType(r,e)}}});var Mn=te((Ky,zu)=>{"use strict";zu.exports=it;var Fn=nr();it.prototype=Object.create(Fn.prototype,{constructor:{value:it,writable:!0,enumerable:!1,configurable:!0}});it.className="Root";var Nn=ci(),ms=bt(),Ch=Ni(),Ft=Ve(),gs,ys,lr;function it(t){Fn.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}it.fromJSON=function(e,i,r){if(r===void 0&&(r=0),r>Ft.recursionLimit)throw Error("max depth exceeded");return i||(i=new it),e.options&&i.setOptions(e.options),i.addJSON(e.nested,r).resolveAll()};it.prototype.resolvePath=Ft.path.resolve;it.prototype.fetch=Ft.fetch;function Mu(){}it.prototype.load=function t(e,i,r){typeof i=="function"&&(r=i,i=void 0);var n=this;if(!r)return Ft.asPromise(t,n,e,i);var o=r===Mu;function s(m,g){if(r){if(o)throw m;g&&g.resolveAll();var b=r;r=null,b(m,g)}}function a(m){var g=m.lastIndexOf("google/protobuf/");if(g>-1){var b=m.substring(g);if(Object.prototype.hasOwnProperty.call(lr,b))return b}return Object.prototype.hasOwnProperty.call(lr,m)?m:null}function l(m,g,b){b===void 0&&(b=0);try{if(b>Ft.recursionLimit)throw Error("max depth exceeded");if(Ft.isString(g)&&g.charAt(0)==="{"&&(g=JSON.parse(g)),!Ft.isString(g))n.setOptions(g.options).addJSON(g.nested);else{ys.filename=m;var C=ys(g,n,i),k,E=0;if(C.imports)for(;E<C.imports.length;++E)(k=a(C.imports[E])||n.resolvePath(m,C.imports[E]))&&u(k,!1,b+1);if(C.weakImports)for(E=0;E<C.weakImports.length;++E)(k=a(C.weakImports[E])||n.resolvePath(m,C.weakImports[E]))&&u(k,!0,b+1)}}catch(G){s(G)}!o&&!f&&s(null,n)}function u(m,g,b){if(b===void 0&&(b=0),m=a(m)||m,!(n.files.indexOf(m)>-1)){if(n.files.push(m),Object.prototype.hasOwnProperty.call(lr,m)){o?l(m,lr[m],b):(++f,setTimeout(function(){--f,l(m,lr[m],b)}));return}if(o){var C;try{C=Ft.fs.readFileSync(m).toString("utf8")}catch(k){g||s(k);return}l(m,C,b)}else++f,n.fetch(m,function(k,E){if(--f,!!r){if(k){g?f||s(null,n):s(k);return}l(m,E,b)}})}}var f=0;Ft.isString(e)&&(e=[e]);for(var h=0,p;h<e.length;++h)(p=n.resolvePath("",e[h]))&&u(p);return o?(n.resolveAll(),n):(f||s(null,n),n)};it.prototype.loadSync=function(e,i){if(!Ft.isNode)throw Error("not supported");return this.load(e,i,Mu)};it.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return Fn.prototype.resolveAll.call(this)};var Pn=/^[A-Z]/;function Fu(t,e){var i=e.parent.lookup(e.extend);if(i){var r=new Nn(e.fullName,e.id,e.type,e.rule,void 0,e.options);return i.get(r.name)||(r.declaringField=e,e.extensionField=r,i.add(r)),!0}return!1}it.prototype._handleAdd=function(e){if(e instanceof Nn)e.extend!==void 0&&!e.extensionField&&(Fu(this,e)||this.deferred.push(e));else if(e instanceof ms)Pn.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof Ch)){if(e instanceof gs)for(var i=0;i<this.deferred.length;)Fu(this,this.deferred[i])?this.deferred.splice(i,1):++i;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);Pn.test(e.name)&&(e.parent[e.name]=e)}(e instanceof gs||e instanceof ms||e instanceof Nn)&&(this._fullyQualifiedObjects[e.fullName]=e)};it.prototype._handleRemove=function(e){if(e instanceof Nn){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var i=this.deferred.indexOf(e);i>-1&&this.deferred.splice(i,1)}}else if(e instanceof ms)Pn.test(e.name)&&delete e.parent[e.name];else if(e instanceof Fn){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);Pn.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};it._configure=function(t,e,i){gs=t,ys=e,lr=i}});var Ve=te((Wy,Gu)=>{"use strict";var _e=Gu.exports=Tt(),Du=Lo(),vs,bs;_e.codegen=fu();_e.fetch=hu();_e.path=gu();_e.patterns=Yo();var $u=_e.patterns.reservedRe;_e.fs=Xo();_e.toArray=function(e){if(e){for(var i=Object.keys(e),r=new Array(i.length),n=0;n<i.length;)r[n]=e[i[n++]];return r}return[]};_e.toObject=function(e){for(var i={},r=0;r<e.length;){var n=e[r++],o=e[r++];o!==void 0&&(i[n]=o)}return i};_e.remove=function(e,i,r){if(!e)return!1;if(r!==void 0&&Object.prototype.hasOwnProperty.call(e,r)&&e[r]===i)return delete e[r],!0;for(var n=Object.keys(e),o=0;o<n.length;++o)if(e[n[o]]===i)return delete e[n[o]],!0;return!1};_e.isReserved=function(e){return $u.test(e)};_e.safeProp=function(e){return!/^[$\w_]+$/.test(e)||$u.test(e)?"["+JSON.stringify(e)+"]":"."+e};_e.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var Eh=/_([a-z])/g;_e.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(Eh,function(i,r){return r.toUpperCase()})};_e.jsonName=function(e){for(var i="",r=!1,n=0;n<e.length;++n){var o=e.charAt(n);o==="_"?r=!0:r?(i+=o.toUpperCase(),r=!1):i+=o}return i};_e.compareFieldsById=function(e,i){return e.id-i.id};_e.decorateType=function(e,i){if(e.$type)return i&&e.$type.name!==i&&(_e.decorateRoot.remove(e.$type),e.$type.name=i,_e.decorateRoot.add(e.$type)),e.$type;vs||(vs=Rn());var r=new vs(i||e.name);return _e.decorateRoot.add(r),r.ctor=e,Object.defineProperty(e,"$type",{value:r,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:r,enumerable:!1}),r};var kh=0;_e.decorateEnum=function(e){if(e.$type)return e.$type;bs||(bs=bt());var i=new bs("Enum"+kh++,e);return _e.decorateRoot.add(i),Object.defineProperty(e,"$type",{value:i,enumerable:!1}),i};_e.setProperty=function(e,i,r,n){function o(s,a,l){var u=a.shift();if(_e.isUnsafeProperty(u))return s;if(a.length>0)s[u]=o(s[u]||{},a,l);else{var f=s[u];if(f&&n)return s;f&&(l=[].concat(f).concat(l)),s[u]=l}return s}if(typeof e!="object")throw TypeError("dst must be an object");if(!i)throw TypeError("path must be specified");if(i=i.split("."),i.length>_e.recursionLimit)throw Error("max depth exceeded");return o(e,i,r)};Object.defineProperty(_e,"decorateRoot",{get:function(){return Du.decorated||(Du.decorated=new(Mn()))}})});var hi=te(qu=>{"use strict";var Nr=qu,Ah=Ve(),Oh=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function Pr(t,e){var i=0,r=Object.create(null);for(e|=0;i<t.length;)r[Oh[i+e]]=t[i++];return r}Nr.basic=Pr([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Nr.defaults=Pr([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",Ah.emptyArray,null]);Nr.long=Pr([0,0,0,1,1],7);Nr.mapKey=Pr([0,0,0,5,5,0,0,0,1,1,0,2],2);Nr.packed=Pr([1,5,0,0,0,5,5,0,0,0,1,1,0])});var ci=te((Zy,Vu)=>{"use strict";Vu.exports=$e;var Mr=di();$e.prototype=Object.create(Mr.prototype,{constructor:{value:$e,writable:!0,enumerable:!1,configurable:!0}});$e.className="Field";var Bu=bt(),zn=hi(),Ae=Ve(),Fr,Th=/^(?:required|optional|repeated)$/;$e.fromJSON=function(e,i){var r=new $e(e,i.id,i.type,i.rule,i.extend,i.options,i.comment);return i.edition&&(r._edition=i.edition),i.protoName&&(r.protoName=i.protoName),i.jsonName!==void 0?r.jsonName=i.jsonName:i.options&&i.options.json_name!==void 0&&(r.jsonName=i.options.json_name),r._defaultEdition="proto3",r};function $e(t,e,i,r,n,o,s){if(Ae.isObject(r)?(s=n,o=r,r=n=void 0):Ae.isObject(n)&&(s=o,o=n,n=void 0),Mr.call(this,t,o),!Ae.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Ae.isString(i))throw TypeError("type must be a string");if(r!==void 0&&!Th.test(r=r.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(n!==void 0&&!Ae.isString(n))throw TypeError("extend must be a string");this.rule=r&&r!=="optional"?r:void 0,this.type=i,this.id=e,this.extend=n||void 0,this.repeated=r==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Ae.Long?zn.long[i]!==void 0:!1,this.bytes=i==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=s,this.protoName=void 0,this.jsonName=void 0}Object.defineProperty($e.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty($e.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty($e.prototype,"delimited",{get:function(){return this.resolvedType instanceof Fr&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty($e.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty($e.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});$e.prototype.setOption=function(e,i,r){return Mr.prototype.setOption.call(this,e,i,r)};$e.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return Ae.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"protoName",this.protoName!==this.name?this.protoName:void 0,"jsonName",this.jsonName!==Ae.jsonName(this.protoName||this.name)?this.jsonName:void 0,"options",this.options,"comment",i?this.comment:void 0])};$e.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=zn.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof Fr?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof Bu&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof Bu)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long){var e=this.type==="uint64"||this.type==="fixed64";this.typeDefault=typeof this.typeDefault=="string"?Ae.Long.fromString(this.typeDefault,e):Ae.Long.fromNumber(this.typeDefault,e),Object.freeze&&Object.freeze(this.typeDefault)}else if(zn.long[this.type]!==void 0&&typeof this.typeDefault=="string")this.typeDefault=parseInt(this.typeDefault,10);else if(this.bytes&&typeof this.typeDefault=="string"){var i;Ae.base64.test(this.typeDefault)?Ae.base64.decode(this.typeDefault,i=Ae.newBuffer(Ae.base64.length(this.typeDefault)),0):Ae.utf8.write(this.typeDefault,i=Ae.newBuffer(Ae.utf8.length(this.typeDefault)),0),this.typeDefault=i}return this.map?this.defaultValue=Ae.emptyObject:this.repeated?this.defaultValue=Ae.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof Fr&&this.parent._ctor&&(this.parent._ctor.prototype[this.name]=this.defaultValue),this.protoName===void 0&&(this.protoName=this.name),this.jsonName===void 0&&(this.jsonName=Ae.jsonName(this.protoName)),Mr.prototype.resolve.call(this)};$e.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var i={};if(this.rule==="required"&&(i.field_presence="LEGACY_REQUIRED"),this.parent&&zn.defaults[this.type]===void 0){var r=this.parent.get(this.type.split(".").pop());r&&r instanceof Fr&&r.group&&(i.message_encoding="DELIMITED")}return this.getOption("packed")===!0?i.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(i.repeated_field_encoding="EXPANDED"),i};$e.prototype._resolveFeatures=function(e){return Mr.prototype._resolveFeatures.call(this,this._edition||e)};$e.d=function(e,i,r,n){return typeof i=="function"?i=Ae.decorateType(i).name:i&&typeof i=="object"&&(i=Ae.decorateEnum(i).name),function(s,a){Ae.decorateType(s.constructor).add(new $e(a,e,i,r,{default:n}))}};$e._configure=function(e){Fr=e}});var Ni=te((Qy,Yu)=>{"use strict";Yu.exports=rt;var $n=di();rt.prototype=Object.create($n.prototype,{constructor:{value:rt,writable:!0,enumerable:!1,configurable:!0}});rt.className="OneOf";var Lu=ci(),Dn=Ve();function rt(t,e,i,r){if(Array.isArray(e)||(i=e,e=void 0),$n.call(this,t,i),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=r}rt.fromJSON=function(e,i){return new rt(e,i.oneof,i.options,i.comment)};rt.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return Dn.toObject(["options",this.options,"oneof",this.oneof,"comment",i?this.comment:void 0])};function ju(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}rt.prototype.add=function(e){if(!(e instanceof Lu))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,ju(this),this};rt.prototype.remove=function(e){if(!(e instanceof Lu))throw TypeError("field must be a Field");var i=this.fieldsArray.indexOf(e);if(i<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(i,1),i=this.oneof.indexOf(e.name),i>-1&&this.oneof.splice(i,1),e.partOf=null,this};rt.prototype.onAdd=function(e){$n.prototype.onAdd.call(this,e);for(var i=this,r=0;r<this.oneof.length;++r){var n=e.get(this.oneof[r]);n&&!n.partOf&&(n.partOf=i,i.fieldsArray.push(n))}ju(this)};rt.prototype.onRemove=function(e){for(var i=0,r;i<this.fieldsArray.length;++i)(r=this.fieldsArray[i]).parent&&r.parent.remove(r);$n.prototype.onRemove.call(this,e)};Object.defineProperty(rt.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var t=this.fieldsArray[0];return t.options!=null&&t.options.proto3_optional===!0}});rt.d=function(){for(var e=new Array(arguments.length),i=0;i<arguments.length;)e[i]=arguments[i++];return function(n,o){Dn.decorateType(n.constructor).add(new rt(o,e)),Object.defineProperty(n,o,{get:Dn.oneOfGetter(e),set:Dn.oneOfSetter(e)})}}});var di=te((e1,Uu)=>{"use strict";Uu.exports=Ye;Ye.className="ReflectionObject";var Rh=Ni(),St=Ve(),Gn,Nh={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE2024",default_symbol_visibility:"EXPORT_TOP_LEVEL"},Ph={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"},Fh={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"},Mh={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"};function Ye(t,e){if(!St.isString(t))throw TypeError("name must be a string");if(e&&!St.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=t,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(Ye.prototype,{root:{get:function(){for(var t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],e=this.parent;e;)t.unshift(e.name),e=e.parent;return t.join(".")}}});Ye.prototype.toJSON=function(){throw Error()};Ye.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var i=e.root;i instanceof Gn&&i._handleAdd(this)};Ye.prototype.onRemove=function(e){var i=e.root;i instanceof Gn&&i._handleRemove(this),this.parent=null,this.resolved=!1};Ye.prototype.resolve=function(){return this.resolved?this:(this.root instanceof Gn&&(this.resolved=!0),this)};Ye.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};Ye.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var i={};if(!e)throw new Error("Unknown edition for "+this.fullName);var r=St.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")i=Object.assign({},Fh);else if(e==="proto3")i=Object.assign({},Mh);else if(e==="2023")i=Object.assign({},Ph);else if(e==="2024")i=Object.assign({},Nh);else throw new Error("Unknown edition: "+e);this._features=St.merge(i,r)}else if(this.partOf instanceof Rh){var n=St.merge({},this.partOf._features);this._features=St.merge(n,r)}else if(!this.declaringField)if(this.parent){var o=St.merge({},this.parent._features);this._features=St.merge(o,r)}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};Ye.prototype._inferLegacyProtoFeatures=function(){return{}};Ye.prototype.getOption=function(e){if(this.options&&Object.prototype.hasOwnProperty.call(this.options,e))return this.options[e]};Ye.prototype.setOption=function(e,i,r){if(e==="__proto__")return this;if(this.options||(this.options={}),/^features\./.test(e))St.setProperty(this.options,e,i,r);else{var n=this.getOption(e);(!r||n===void 0)&&(n!==i&&(this.resolved=!1),this.options[e]=i)}return this};Ye.prototype.setParsedOption=function(e,i,r){if(e==="__proto__")return this;this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(o){var s=o[e];St.setProperty(s,r,i)}else o={},o[e]=St.setProperty({},r,i),n.push(o)}else{var a={};a[e]=i,n.push(a)}return this};Ye.prototype.setOptions=function(e,i){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],i);return this};Object.defineProperty(Ye.prototype,"toString",{value:function(){var e=this.constructor.className,i=this.fullName;return i.length?e+" "+i:e},writable:!0,enumerable:!1,configurable:!0});Ye.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};Ye._configure=function(t){Gn=t}});var bt=te((t1,Hu)=>{"use strict";Hu.exports=ft;var ws=di();ft.prototype=Object.create(ws.prototype,{constructor:{value:ft,writable:!0,enumerable:!1,configurable:!0}});ft.className="Enum";var Xu=nr(),ur=Ve();function ft(t,e,i,r,n,o){if(ws.call(this,t,i),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById=Object.create(null),this.values=Object.create(this.valuesById),this.comment=r,this.comments=n||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,e)for(var s=Object.keys(e),a=0;a<s.length;++a)s[a]!=="__proto__"&&typeof e[s[a]]=="number"&&(this.values[s[a]]=e[s[a]],this.valuesById[e[s[a]]]===void 0&&(this.valuesById[e[s[a]]]=s[a]))}ft.prototype._resolveFeatures=function(e){return e=this._edition||e,ws.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(i=>{var r=ur.merge({},this._features);this._valuesFeatures[i]=ur.merge(r,this.valuesOptions&&this.valuesOptions[i]&&this.valuesOptions[i].features||{})}),this};ft.fromJSON=function(e,i){var r=new ft(e,i.values,i.options,i.comment,i.comments,i.valuesOptions);return r.reserved=i.reserved,i.edition&&(r._edition=i.edition),r._defaultEdition="proto3",r};ft.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return ur.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",i?this.comment:void 0,"comments",i?this.comments:void 0])};ft.prototype.add=function(e,i,r,n){if(!ur.isString(e))throw TypeError("name must be a string");if(!ur.isInteger(i))throw TypeError("id must be an integer");if(e==="__proto__")return this;if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(i))throw Error("id "+i+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[i]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+i+" in "+this);this.values[e]=i}else this.valuesById[this.values[e]=i]=e;return n&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=r||null,this};ft.prototype.remove=function(e){if(!ur.isString(e))throw TypeError("name must be a string");var i=this.values[e];if(i==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[i],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};ft.prototype.isReservedId=function(e){return Xu.isReservedId(this.reserved,e)};ft.prototype.isReservedName=function(e){return Xu.isReservedName(this.reserved,e)}});var ps=te((i1,Wu)=>{"use strict";Wu.exports=zh;var Ss=bt(),mi=hi(),xs=Ve();function Ku(t,e,i,r){return e.delimited?t("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)",i,r,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()",i,r,(e.id<<3|2)>>>0)}function zh(t){for(var e=xs.codegen(["m","w","q"])("if(!w)")("w=Writer.create()")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")'),i,r,n=t.fieldsArray.slice().sort(xs.compareFieldsById),i=0;i<n.length;++i){var o=n[i].resolve(),s=t._fieldsArray.indexOf(o),a=o.resolvedType instanceof Ss?"int32":o.type,l=mi.basic[a];r="m"+xs.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",r,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",r),o.keyType==="bool"?e("w.uint32(%i).fork().uint32(%i).bool(util.boolFromKey(ks[i]))",(o.id<<3|2)>>>0,8|mi.mapKey[o.keyType]):mi.long[o.keyType]!==void 0?e("w.uint32(%i).fork().uint32(%i).%s(util.longFromKey(ks[i],%j))",(o.id<<3|2)>>>0,8|mi.mapKey[o.keyType],o.keyType,o.keyType==="uint64"||o.keyType==="fixed64"):e("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|mi.mapKey[o.keyType],o.keyType),l===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()",s,r):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|l,a,r),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",r,r),o.packed&&mi.packed[a]!==void 0?e("w.uint32(%i).%ss(%s)",(o.id<<3|2)>>>0,a,r):(e("for(var i=0;i<%s.length;++i)",r),l===void 0?Ku(e,o,s,r+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|l)>>>0,a,r)),e("}")):(o.required||(o.hasPresence||!(o.resolvedType instanceof Ss||mi.basic[a]!==void 0)?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",r,o.name):o.resolvedType instanceof Ss?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!==%j)",r,o.name,r,o.typeDefault):a==="bool"?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!==false)",r,o.name,r):a==="string"?e('if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!=="")',r,o.name,r):a==="bytes"?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s.length)",r,o.name,r):a==="double"||a==="float"?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&!Object.is(%s,0))",r,o.name,r):mi.long[a]!==void 0?e('if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&(typeof %s==="object"?%s.low||%s.high:%s!==0))',r,o.name,r,r,r,r):e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!==0)",r,o.name,r)),l===void 0?Ku(e,o,s,r):e("w.uint32(%i).%s(%s)",(o.id<<3|l)>>>0,a,r))}return e('if(m.$unknowns!=null&&Object.hasOwnProperty.call(m,"$unknowns"))')("for(var i=0;i<m.$unknowns.length;++i)")("w.raw(m.$unknowns[i])")("return w")}});var Zu=te((ae,Ju)=>{"use strict";ae=Ju.exports=au();ae.build="light";function Dh(t,e,i){return typeof e=="function"?(i=e,e=new ae.Root):e||(e=new ae.Root),e.load(t,i)}ae.load=Dh;function $h(t,e){return e||(e=new ae.Root),e.loadSync(t)}ae.loadSync=$h;ae.encoder=ps();ae.decoder=is();ae.verifier=os();ae.converter=us();ae.ReflectionObject=di();ae.Namespace=nr();ae.Root=Mn();ae.Enum=bt();ae.Type=Rn();ae.Field=ci();ae.OneOf=Ni();ae.MapField=xn();ae.Service=Cn();ae.Method=_n();ae.Message=En();ae.wrappers=fs();ae.types=hi();ae.util=Ve();ae.ReflectionObject._configure(ae.Root);ae.Namespace._configure(ae.Type,ae.Service,ae.Enum);ae.Root._configure(ae.Type,void 0,{});ae.Field._configure(ae.Type)});var Is=te((r1,tf)=>{"use strict";tf.exports=ef;var _s=/[\s{}=;:[\],'"()<>]/g,Gh=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,qh=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,Bh=/^ *[*/]+ */,Vh=/^\s*\*?\/*/,Lh=/\n/g,jh=/\s/,Yh=/\\(.?)/g,Uh={0:"\0",r:"\r",n:`
5
- `,t:" "};function Qu(t){return t.replace(Yh,function(e,i){switch(i){case"\\":case"":return i;default:return Uh[i]||""}})}ef.unescape=Qu;function ef(t,e){t=t.toString();var i=0,r=t.length,n=1,o=0,s={},a=[],l=null;function u(x){return Error("illegal "+x+" (line "+n+")")}function f(){var x=l==="'"?qh:Gh;x.lastIndex=i-1;var q=x.exec(t);if(!q)throw u("string");return i=x.lastIndex,C(l),l=null,Qu(q[1])}function h(x){return t.charAt(x)}function p(x,q,B){var W={type:t.charAt(x++),lineEmpty:!1,leading:B},j;e?j=2:j=3;var _=x-j,R;do if(--_<0||(R=t.charAt(_))===`
6
- `){W.lineEmpty=!0;break}while(R===" "||R===" ");for(var y=t.substring(x,q).split(Lh),N=0;N<y.length;++N)y[N]=y[N].replace(e?Vh:Bh,"").trim();W.text=y.join(`
7
- `).trim(),s[n]=W,o=n}function m(x){var q=g(x),B=t.substring(x,q),W=/^\s*\/\//.test(B);return W}function g(x){for(var q=x;q<r&&h(q)!==`
8
- `;)q++;return q}function b(){if(a.length>0)return a.shift();if(l)return f();var x,q,B,W,j,_,R=i===0;do{if(i===r)return null;for(x=!1;jh.test(B=h(i));)if(B===`
9
- `&&(R=!0,++n),++i===r)return null;if(h(i)==="/"){if(++i===r)throw u("comment");if(h(i)==="/")if(e){if(W=i,j=!1,m(i-1)){j=!0;do{if(i=g(i),i===r||(i++,!R))break;_=m(i),_&&n++}while(_)}else i=Math.min(r,g(i)+1);j&&(p(W,i,R),R=!0),n++,x=!0}else{for(j=h(W=i+1)==="/";h(++i)!==`
10
- `;)if(i===r)return null;++i,j&&(p(W,i-1,R),R=!0),++n,x=!0}else if((B=h(i))==="*"){W=i+1,j=e||h(W)==="*";do{if(B===`
11
- `&&++n,++i===r)throw u("comment");q=B,B=h(i)}while(q!=="*"||B!=="/");++i,j&&(p(W,i-2,R),R=!0),x=!0}else return"/"}}while(x);var y=i;_s.lastIndex=0;var N=_s.test(h(y++));if(!N)for(;y<r&&!_s.test(h(y));)++y;var S=t.substring(i,i=y);return(S==='"'||S==="'")&&(l=S),S}function C(x){a.push(x)}function k(){if(!a.length){var x=b();if(x===null)return null;C(x)}return a[0]}function E(x,q){var B=k(),W=B===x;if(W)return b(),!0;if(!q)throw u("token '"+B+"', '"+x+"' expected");return!1}function G(x){var q=null,B;return x===void 0?(B=s[n-1],delete s[n-1],B&&(e||B.type==="*"||B.lineEmpty)&&(q=B.leading?B.text:null)):(o<x&&k(),B=s[x],delete s[x],B&&!B.lineEmpty&&(e||B.type==="/")&&(q=B.leading?null:B.text)),q}return Object.defineProperty({next:b,peek:k,push:C,skip:E,cmnt:G},"line",{get:function(){return n}})}});var af=te((n1,sf)=>{"use strict";sf.exports=Ht;Ht.filename=null;Ht.defaults={keepCase:!1};var Xh=Is(),rf=Mn(),nf=Rn(),qn=ci(),Hh=xn(),of=Ni(),Kh=bt(),Wh=Cn(),Jh=_n(),Zh=di(),Qh=hi(),Xt=Ve(),ep=/^[1-9][0-9]*$/,tp=/^-?[1-9][0-9]*$/,ip=/^0[x][0-9a-fA-F]+$/,rp=/^-?0[x][0-9a-fA-F]+$/,np=/^0[0-7]+$/,op=/^-?0[0-7]+$/,sp=/^(?:u?int|sint|s?fixed)(?:32|64)$/,ap=/^(?:uint|fixed)(?:32|64)$/,lp=Xt.patterns.numberRe,Mt=/^[a-zA-Z_][a-zA-Z_0-9]*$/,xt=Xt.patterns.typeRefRe,up=536870911,fp=2147483647;function Ht(t,e,i){e instanceof rf||(i=e,e=new rf),i||(i=Ht.defaults);var r=i.preferTrailingComment||!1,n=Xh(t,i.alternateCommentMode||!1),o=n.next,s=n.push,a=n.peek,l=n.skip,u=n.cmnt,f=!0,h,p,m,g="proto2",b=e,C=[],k={},E=i.keepCase?function(O){return O}:Xt.camelCase;function G(){C.forEach(O=>{O._edition=g,Object.keys(k).forEach(A=>{O.getOption(A)===void 0&&O.setOption(A,k[A],!0)})})}function x(O,A,P){var F=Ht.filename;return P||(Ht.filename=null),Error("illegal "+(A||"token")+" '"+O+"' ("+(F?F+", ":"")+"line "+n.line+")")}function q(){var O=[],A;do{if((A=o())!=='"'&&A!=="'")throw x(A);O.push(o()),l(A),A=a()}while(A==='"'||A==="'");return O.join("")}function B(O){var A=o();switch(A){case"'":case'"':return s(A),q();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return j(A,!0)}catch{if(O&&xt.test(A))return A;throw x(A,"value")}}function W(O,A,P,F){var V,J;do if(A&&((V=a())==='"'||V==="'")){var re=q();if(O.push(re),g>=2023)throw x(re,"id")}else try{O.push([J=R(o(),F,P),l("to",!0)?R(o(),F,P):J])}catch(ie){if(A&&xt.test(V)&&g>=2023)O.push(V);else throw ie}while(l(",",!0));var ne={options:void 0};ne.setOption=function(ie,Fe){this.options===void 0&&(this.options={}),this.options[ie]=Fe},M(ne,function(Fe){if(Fe==="option")ee(ne,Fe),l(";");else throw x(Fe)},function(){Gt(ne)})}function j(O,A){var P=1;switch(O.charAt(0)==="-"&&(P=-1,O=O.substring(1)),O){case"inf":case"INF":case"Inf":return P*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return P*0}if(ep.test(O))return P*parseInt(O,10);if(ip.test(O))return P*parseInt(O,16);if(np.test(O))return P*parseInt(O,8);if(lp.test(O))return P*parseFloat(O);throw x(O,"number",A)}function _(O,A,P){if(O===null)throw x(O,"end of input");if(!A&&O.charAt(0)==="-")throw x(O,P||"integer");if(O==="0"||O==="-0")return 0;var F;if(tp.test(O))F=parseInt(O,10);else if(rp.test(O))F=parseInt(O,16);else if(op.test(O))F=parseInt(O,8);else throw x(O,P||"integer");return F||0}function R(O,A,P){switch(O){case"max":case"MAX":case"Max":return P||up}return _(O,A,"id")}function y(){if(h!==void 0)throw x("package");if(h=o(),h===null||!xt.test(h))throw x(h,"name");b=b.define(h),l(";")}function N(){var O=a(),A;switch(O){case"option":if(g<"2024")throw x("option");o(),q(),l(";");return;case"weak":A=m||(m=[]),o();break;case"public":o();default:A=p||(p=[]);break}O=q(),l(";"),A.push(O)}function S(){if(l("="),g=q(),g<2023)throw x(g,"syntax");l(";")}function c(){if(l("="),g=q(),!["2023","2024"].includes(g))throw x(g,"edition");l(";")}function w(O,A,P){switch(P===void 0&&(P=0),A){case"option":return ee(O,A),l(";"),!0;case"message":return L(O,A,P+1),!0;case"enum":return be(O,A),!0;case"export":case"local":return g<"2024"||(A=o(),A==="export"||A==="local")||A!=="message"&&A!=="enum"?!1:w(O,A,P);case"service":return Oe(O,A,P+1),!0;case"extend":return ht(O,A,P),!0}return!1}function M(O,A,P){var F=n.line;if(O&&(typeof O.comment!="string"&&(O.comment=u()),O.filename=Ht.filename),l("{",!0)){for(var V;(V=o())!=="}";)A(V);l(";",!0)}else P&&P(),l(";"),O&&(typeof O.comment!="string"||r)&&(O.comment=u(F)||O.comment)}function L(O,A,P){if(P===void 0&&(P=0),P>Xt.nestingLimit)throw Error("max depth exceeded");if((A=o())===null||!Mt.test(A))throw x(A,"type name");var F=new nf(A);M(F,function(J){if(!w(F,J,P))switch(J){case";":break;case"map":ce(F,J);break;case"required":if(g!=="proto2")throw x(J);case"repeated":X(F,J,void 0,P+1);break;case"optional":if(g==="proto3")X(F,"proto3_optional",void 0,P+1);else{if(g!=="proto2")throw x(J);X(F,"optional",void 0,P+1)}break;case"oneof":ve(F,J,P+1);break;case"extensions":W(F.extensions||(F.extensions=[]));break;case"reserved":W(F.reserved||(F.reserved=[]),!0);break;default:if(g==="proto2"||!xt.test(J))throw x(J);s(J),X(F,"optional",void 0,P+1);break}}),O.add(F),O===b&&C.push(F)}function X(O,A,P,F){var V=o();if(V===null)throw x(V,"end of input");if(V==="group"){Q(O,A,P,F);return}for(;V.endsWith(".")||(a()||"").startsWith(".");){var J=o();if(J===null)throw x(J,"end of input");V+=J}if(!xt.test(V))throw x(V,"type");var re=o();if(re===null)throw x(re,"end of input");if(!Mt.test(re))throw x(re,"name");var ne=re;re=E(re),l("=");var ie=new qn(re,R(o()),V,A==="proto3_optional"?"optional":A,P);if(ne!==re&&(ie.protoName=ne),M(ie,function(kt){if(kt==="option")ee(ie,kt),l(";");else throw x(kt)},function(){Gt(ie)}),A==="proto3_optional"){var Fe=new of("_"+re);ie.setOption("proto3_optional",!0),Fe.add(ie),O.add(Fe)}else O.add(ie);O===b&&C.push(ie)}function Q(O,A,P,F){if(F===void 0&&(F=0),F>Xt.nestingLimit)throw Error("max depth exceeded");if(g>=2023)throw x("group");var V=o();if(V===null||!Mt.test(V))throw x(V,"name");var J=Xt.lcFirst(V);V===J&&(V=Xt.ucFirst(V)),l("=");var re=R(o()),ne=new nf(V);ne.group=!0;var ie=new qn(J,re,V,A,P);ie.filename=Ht.filename,M(ne,function(Re){switch(Re){case";":break;case"map":ce(ne);break;case"option":ee(ne,Re),l(";");break;case"required":case"repeated":X(ne,Re,void 0,F+1);break;case"optional":g==="proto3"?X(ne,"proto3_optional",void 0,F+1):X(ne,"optional",void 0,F+1);break;case"message":L(ne,Re,F+1);break;case"enum":be(ne,Re);break;case"reserved":W(ne.reserved||(ne.reserved=[]),!0);break;case"export":case"local":if(g<"2024")throw x(Re);switch(Re=o(),Re){case"message":L(ne,Re,F+1);break;case"enum":L(ne,Re,F+1);break;default:throw x(Re)}break;default:throw x(Re)}}),O.add(ne).add(ie),O===b&&(C.push(ne),C.push(ie))}function ce(O){l("<");var A=o();if(Qh.mapKey[A]===void 0)throw x(A,"type");l(",");var P=o();if(!xt.test(P))throw x(P,"type");l(">");var F=o();if(F===null||!Mt.test(F))throw x(F,"name");l("=");var V=F;F=E(F);var J=new Hh(F,R(o()),A,P);V!==F&&(J.protoName=V),M(J,function(ne){if(ne==="option")ee(J,ne),l(";");else throw x(ne)},function(){Gt(J)}),O.add(J)}function ve(O,A,P){if((A=o())===null||!Mt.test(A))throw x(A,"name");var F=new of(E(A));M(F,function(J){J==="option"?(ee(F,J),l(";")):(s(J),X(F,"optional",void 0,P))}),O.add(F)}function be(O,A){if((A=o())===null||!Mt.test(A))throw x(A,"name");var P=new Kh(A),F=[];M(P,function(re){switch(re){case";":break;case"option":ee(P,re),l(";");break;case"reserved":W(P.reserved||(P.reserved=[]),!0,fp,!0),P.reserved===void 0&&(P.reserved=[]);break;default:F.push(me(re))}});for(var V=0;V<F.length;++V)P.add(F[V].name,F[V].id,F[V].comment,F[V].options);O.add(P),O===b&&C.push(P)}function me(O){if(!Mt.test(O))throw x(O,"name");l("=");var A=R(o(),!0),P={options:void 0};return P.getOption=function(F){return this.options[F]},P.setOption=function(F,V){Zh.prototype.setOption.call(P,F,V)},P.setParsedOption=function(){},M(P,function(V){if(V==="option")ee(P,V),l(";");else throw x(V)},function(){Gt(P)}),{name:O,id:A,comment:P.comment,options:P.parsedOptions||P.options}}function ee(O,A){var P,F,V=!0;for(A==="option"&&(A=o());A!=="=";){if(A===null)throw x(A,"end of input");if(A==="("){var J=o();l(")"),A="("+J+")"}if(V){if(V=!1,A.includes(".")&&!A.includes("(")){var re=A.split(".");P=re[0]+".",A=re[1];continue}P=A}else F=F?F+=A:A;A=o()}var ne=F?P.concat(F):P,ie=ue(O,ne);F=F&&F[0]==="."?F.slice(1):F,P=P&&P[P.length-1]==="."?P.slice(0,-1):P,dt(O,P,ie,F)}function ue(O,A,P){if(P===void 0&&(P=0),P>Xt.recursionLimit)throw Error("max depth exceeded");if(l("{",!0)){for(var F={};!l("}",!0);){de=o();var V;if(de===null)throw x(de,"end of input");if(de==="["){de=o();var J=de===null?-1:de.lastIndexOf("/");if(de===null||!xt.test(J<0?de:de.slice(J+1)))throw x(de,"name");V="["+de+"]",l("]")}else{if(!Mt.test(de))throw x(de,"name");V=de}var re;if(l(":",!0),a()==="{")re=ue(O,A+"."+V,P+1);else if(a()==="["){re=[];var ne,ie;if(l("[",!0)&&!l("]",!0)){do ie=a()==="{",ne=ie?ue(O,A+"."+V,P+1):B(!0),re.push(ne);while(l(",",!0));l("]"),typeof ne<"u"&&(ie||Se(O,A+"."+V,ne))}}else re=B(!0),Se(O,A+"."+V,re);var Fe=Object.prototype.hasOwnProperty.call(F,V)?F[V]:void 0;Fe&&(re=[].concat(Fe).concat(re)),V!=="__proto__"&&(F[V]=re),l(",",!0),l(";",!0)}return F}var Re=A==="default"&&O instanceof qn&&sp.test(O.type)?_(o(),!ap.test(O.type)):B(!0);return Se(O,A,Re),Re}function Se(O,A,P){if(b===O&&/^features\./.test(A)){k[A]=P;return}A==="json_name"&&O instanceof qn&&(O.jsonName=P),O.setOption&&O.setOption(A,P)}function dt(O,A,P,F){O.setParsedOption&&O.setParsedOption(A,P,F)}function Gt(O){if(l("[",!0)){do ee(O,"option");while(l(",",!0));l("]")}return O}function Oe(O,A,P){if(P===void 0&&(P=0),P>Xt.recursionLimit)throw Error("max depth exceeded");if((A=o())===null||!Mt.test(A))throw x(A,"service name");var F=new Wh(A);M(F,function(J){if(!w(F,J,P)&&J!==";")if(J==="rpc")at(F,J);else throw x(J)}),O.add(F),O===b&&C.push(F)}function at(O,A){var P=u(),F=A;if(!Mt.test(A=o()))throw x(A,"name");var V=A,J,re,ne,ie;if(l("("),l("stream",!0)&&(re=!0),!xt.test(A=o())||(J=A,l(")"),l("returns"),l("("),l("stream",!0)&&(ie=!0),!xt.test(A=o())))throw x(A);ne=A,l(")");var Fe=new Jh(V,F,J,ne,re,ie);Fe.comment=P,M(Fe,function(kt){if(kt!==";")if(kt==="option")ee(Fe,kt),l(";");else throw x(kt)}),O.add(Fe)}function ht(O,A,P){if((A=o())===null||!xt.test(A))throw x(A,"reference");var F=A;M(null,function(J){switch(J){case"required":case"repeated":X(O,J,F,P+1);break;case"optional":g==="proto3"?X(O,"proto3_optional",F,P+1):X(O,"optional",F,P+1);break;default:if(g==="proto2"||!xt.test(J))throw x(J);s(J),X(O,"optional",F,P+1);break}})}for(var de;(de=o())!==null;)switch(de){case";":break;case"package":if(!f)throw x(de);y();break;case"import":N();break;case"syntax":if(!f)throw x(de);S();break;case"edition":if(!f)throw x(de);c();break;case"option":ee(b,de),l(";",!0);break;default:if(w(b,de,0)){f=!1;continue}throw x(de)}return G(),Ht.filename=null,{package:h,imports:p,weakImports:m,root:e}}});var ff=te((o1,uf)=>{"use strict";uf.exports=_t;var cp=/\/|\./;function _t(t,e){cp.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),_t[t]=e}_t("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var lf;_t("duration",{Duration:lf={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});_t("timestamp",{Timestamp:lf});_t("empty",{Empty:{fields:{}}});_t("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1,protoName:"null_value"},numberValue:{type:"double",id:2,protoName:"number_value"},stringValue:{type:"string",id:3,protoName:"string_value"},boolValue:{type:"bool",id:4,protoName:"bool_value"},structValue:{type:"Struct",id:5,protoName:"struct_value"},listValue:{type:"ListValue",id:6,protoName:"list_value"}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});_t("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});_t("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});_t.get=function(e){return _t[e]||null}});var df=te((zt,cf)=>{"use strict";zt=cf.exports=Zu();zt.build="full";zt.tokenize=Is();zt.parse=af();zt.common=ff();zt.Root._configure(zt.Type,zt.parse,zt.common)});var pf=te((s1,hf)=>{"use strict";hf.exports=df()});import{parentPort as xa}from"node:worker_threads";import{existsSync as Zr,readFileSync as Wm}from"node:fs";import{randomUUID as Hc}from"node:crypto";import{isAbsolute as Aa,win32 as Oa}from"node:path";function ka(t,e=!1){let i=String(t??"").trim().replaceAll("\\","/");if(e&&(!i||i==="."))return"";if(!i||Aa(i)||Oa.isAbsolute(i)||i.split("/").some(r=>!r||r==="."||r===".."||/[<>:"|?*\x00-\x1f]/.test(r)||/[. ]$/.test(r)||/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(r)))throw new Error("\u811A\u672C\u76EE\u5F55/\u8DEF\u5F84\u5FC5\u987B\u662F\u6709\u6548\u7684\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u4E0D\u80FD\u5305\u542B .. \u6216 Windows \u7279\u6B8A\u6587\u4EF6\u540D");return i}function mo(t){if(t==null)return null;if(t.version!==1)throw new Error("unsupported scriptSync version");let e=String(t.clientImportRoot||"").trim();if(!Aa(e)&&!Oa.isAbsolute(e))throw new Error("\u5B9E\u673A\u5BFC\u5165\u6839\u76EE\u5F55\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");return{version:1,workspaceDir:ka(t.workspaceDir,!0),clientImportRoot:e,clientSubdir:ka(t.clientSubdir,!0)}}import{basename as vr,dirname as Jm,isAbsolute as Zm,join as Kc,resolve as Wc}from"node:path";var vd=[[10003004,10003004],[10005001,10005142],[10006001,10006002],[10007002,10007002],[10008001,10008001],[10009001,10009011],[20001001,20001074],[20001076,20001121],[20001123,20001156],[20001158,20001302],[20001304,20001568],[20001570,20001999],[20002001,20002755],[20002757,20002999],[20003001,20003455],[30001001,30001016],[30002001,30002017],[30003001,30003011],[30004001,30004001],[30005001,30005020],[30006001,30006026],[30007001,30007013],[30008001,30008011]];function Ta(t){return!Number.isSafeInteger(t)||!vd.some(([e,i])=>t>=e&&t<=i)?null:t===10003004||t===10008001?128:256}var bd=[[100001,100006],[100101,100213],[101001,101018],[101020,101028],[101030,101046],[101048,101048],[101050,101054],[101056,101080],[102001,102052],[103001,103148],[104001,104010],[105001,105140],[105142,105219],[105221,105317],[106001,106047],[106049,106096],[107001,107007],[107010,107020],[107031,107092],[107094,107180],[107183,107201],[107203,107205],[107207,107228],[107231,107278],[107280,107402],[108001,108017],[108019,108020],[109001,109031],[109033,109034],[109036,109075],[110001,110053],[111001,111139],[112001,112042]];function ei(t){return t==null||t===""?"StaticReference":typeof t=="string"?t:typeof t.Name=="string"?t.Name:"Unknown"}function Ra(t,e){return ei(e)==="StaticReference"&&go(t,e)}function go(t,e){let i=ei(e);return i==="Prefab"?Ta(t)!==null:i==="StaticReference"&&Number.isSafeInteger(t)&&t>100006&&bd.some(([r,n])=>t>=r&&t<=n)}var rn="7.1.0",Be=Object.freeze(["KEYBOARD","TOUCHSCREEN","CONTROLLER_CONSOLE","CONTROLLER_MOBILE"]),Te=Object.freeze({"pc-16-9":{id:"pc-16-9",device:"pc",platform:"KEYBOARD",width:1600,height:900,ratio:"16:9",luaDevice:"KeyboardAndMouse",label:"PC 1600\xD7900"},"pc-21-9":{id:"pc-21-9",device:"pc",platform:"KEYBOARD",width:2100,height:900,ratio:"21:9",luaDevice:"KeyboardAndMouse",label:"PC 2100\xD7900"},"mobile-16-9":{id:"mobile-16-9",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:720,ratio:"16:9",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7720"},"mobile-19.5-9":{id:"mobile-19.5-9",device:"mobile",platform:"TOUCHSCREEN",width:1560,height:720,ratio:"19.5:9",luaDevice:"Mobile",label:"\u624B\u673A 1560\xD7720"},"mobile-4-3":{id:"mobile-4-3",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:960,ratio:"4:3",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7960"}}),nn="pc-16-9",Ze=2,Li=Object.freeze({KEYBOARD:"pc-16-9",TOUCHSCREEN:"mobile-16-9",CONTROLLER_CONSOLE:"pc-16-9",CONTROLLER_MOBILE:"mobile-16-9"}),ji=Object.freeze({"server-container":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",container:"\u5BB9\u5668\u8282\u70B9",textbox:"\u6587\u672C\u6846",image:"\u56FE\u7247",button:"\u9884\u8BBE\u6309\u94AE",cursor:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF",grid:"\u7F51\u683C\u89C6\u7A97",reference:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6",textwindow:"\u6587\u672C\u89C6\u7A97",keyhint:"\u6309\u952E\u63D0\u793A",animation:"\u754C\u9762\u52A8\u6548",fullscreen:"\u5168\u5C4F\u52A8\u6548"}),on=Object.freeze(["server-container","container","textbox","cursor","reference","grid","image","button","textwindow","keyhint","animation","fullscreen"]),Na=Object.freeze({"server-container":null,container:[150,150],textbox:[100,40],image:[80,80],button:[150,50],cursor:[150,50],grid:[80,80],reference:[80,80],textwindow:[100,40],keyhint:[40,40],animation:[100,100],fullscreen:null}),wd=Object.freeze({100001:"rect",100002:"circle",100003:"triangle",100004:"fourstar",100005:"fivestar",100006:"ring"});function Yi(t,e){return ei(e)==="StaticReference"&&wd[t]||(go(t,e)?"sprite":"missing")}var Pa=50888,xr=Object.freeze({font:4294967295,bg:16777215,outline:858993459,image:4294967295});function Ui(t,e="$",i=new Set){if(t===void 0)throw new Error(`undefined at ${e}`);if(typeof t=="number"&&!Number.isFinite(t))throw new Error(`non-finite number at ${e}`);if(typeof t=="bigint"||typeof t=="function"||typeof t=="symbol")throw new Error(`non-JSON value at ${e}`);if(!(t===null||typeof t!="object")){if(i.has(t))throw new Error(`circular value at ${e}`);if(i.add(t),Array.isArray(t))t.forEach((r,n)=>Ui(r,`${e}[${n}]`,i));else for(let[r,n]of Object.entries(t))Ui(n,`${e}.${r}`,i);i.delete(t)}}function oe(t){return Ui(t),JSON.parse(JSON.stringify(t))}function Fa(t,e="$"){Ui(t,e)}function Ma(t){return Te[t]||Te[nn]}function _r(t,e=0,i=0){return!t||typeof t!="object"?{x:e,y:i}:{x:Number(t.x??e),y:Number(t.y??i)}}function Sd(t){return!t||typeof t!="object"?{x:1,y:1,z:1}:{x:Number(t.x??1),y:Number(t.y??1),z:Number(t.z??1)}}function xd(t){return!t||typeof t!="object"?{x:0,y:0,z:0}:{x:Number(t.x??0),y:Number(t.y??0),z:Number(t.z??0)}}function sn({layout:t="center",size:e=[100,40],offset:i=[0,0]}={}){return t==="stretch"?{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:0,y:0},anchorMax:{x:1,y:1},offset:{x:0,y:0},size:{x:0,y:0},pivot:{x:.5,y:.5}}:{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:.5,y:.5},anchorMax:{x:.5,y:.5},offset:{x:Number(i[0]??0),y:Number(i[1]??0)},size:{x:Number(e[0]??0),y:Number(e[1]??0)},pivot:{x:.5,y:.5}}}function Ot(t){let e=t||sn();return{scale:Sd(e.scale),rotation:xd(e.rotation),anchorMin:_r(e.anchorMin??e.anchor_min,.5,.5),anchorMax:_r(e.anchorMax??e.anchor_max,.5,.5),offset:_r(e.offset,0,0),size:_r(e.size,0,0),pivot:_r(e.pivot,.5,.5)}}function Le(t,e=0){let i=Number(t);return Number.isFinite(i)?i:e}function Vt(t,e){let i=t.width,r=t.height,n=t.left,o=t.bottom,s=e.anchorMin||{x:e.anchorMinX,y:e.anchorMinY},a=e.anchorMax||{x:e.anchorMaxX,y:e.anchorMaxY},l=e.offset||{x:e.anchoredPositionX,y:e.anchoredPositionY},u=e.size||{x:e.sizeDeltaX,y:e.sizeDeltaY},f=e.pivot||{x:e.pivotX,y:e.pivotY},h=Le(s?.x,.5)*i,p=Le(s?.y,.5)*r,m=Le(a?.x,.5)*i,g=Le(a?.y,.5)*r,b=Le(u?.x),C=Le(u?.y),k=Le(f?.x,.5),E=Le(f?.y,.5),G=m-h+b,x=g-p+C,q=n+h+Le(l?.x)-b*k,B=o+p+Le(l?.y)-C*E;return{left:q,bottom:B,width:G,height:x,right:q+G,top:B+x,centerX:q+G/2,centerY:B+x/2}}function Xi(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}}function _d(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,tx:t.a*e.tx+t.c*e.ty+t.tx,ty:t.b*e.tx+t.d*e.ty+t.ty}}function mt(t,e,i){return{x:t.a*e+t.c*i+t.tx,y:t.b*e+t.d*i+t.ty}}function Hi(t){let e=t.a*t.d-t.b*t.c;return!Number.isFinite(e)||Math.abs(e)<1e-8?null:{a:t.d/e,b:-t.b/e,c:-t.c/e,d:t.a/e,tx:(t.c*t.ty-t.d*t.tx)/e,ty:(t.b*t.tx-t.a*t.ty)/e}}function yo(t,e){let i=e.rotation||{x:e.localRotationX,y:e.localRotationY,z:e.localRotationZ},r=e.scale||{x:e.localScaleX,y:e.localScaleY},n=e.pivot||{x:e.pivotX,y:e.pivotY},o=Le(i?.z)*Math.PI/180,s=Math.cos(o),a=Math.sin(o),l=Le(i?.x)*Math.PI/180,u=Le(i?.y)*Math.PI/180,f=Math.cos(l),h=Math.sin(l),p=Math.cos(u),m=Math.sin(u),g=W=>Math.abs(W)<1e-12?0:W,b=Le(r?.x,1),C=Le(r?.y,1),k=t.left+t.width*Le(n?.x,.5),E=t.bottom+t.height*Le(n?.y,.5),G=g(p*s+m*h*a)*b,x=g(f*a)*b,q=g(-p*a+m*h*s)*C,B=g(f*s)*C;return{a:G,b:x,c:q,d:B,tx:k-G*k-q*E,ty:E-x*k-B*E}}function Ir(t,e,i){return _d(t||Xi(),yo(e,i))}function za(t,e){let i=mt(e,t.centerX,t.centerY),r=Math.abs(t.width*Math.hypot(e.a,e.b)),n=Math.abs(t.height*Math.hypot(e.c,e.d));return{left:i.x-r/2,bottom:i.y-n/2,width:r,height:n,centerX:i.x,centerY:i.y,rotationZ:Math.atan2(e.b,e.a)*180/Math.PI}}function Qe(t){let e=typeof t=="string"?Ma(t):t;return{left:0,bottom:0,width:e.width,height:e.height,right:e.width,top:e.height,centerX:e.width/2,centerY:e.height/2}}function vo(t){return{posX:t.centerX,posY:t.centerY,width:t.width,height:t.height}}function xi(t,e,i){let r=Ot(e),n=t.width,o=t.height,s=r.anchorMin.x*n,a=r.anchorMin.y*o,l=r.anchorMax.x*n,u=r.anchorMax.y*o,f=Number(i.width),h=Number(i.height),p=Number(i.posX),m=Number(i.posY),g=p-f/2,b=m-h/2;return r.size={x:f-(l-s),y:h-(u-a)},r.offset={x:g-t.left-s+r.size.x*r.pivot.x,y:b-t.bottom-a+r.size.y*r.pivot.y},r}function Da(t,e){let i=Ot(t),n={"bottom-left":[[0,0],[0,0],[0,0]],bottom:[[.5,0],[.5,0],[.5,0]],"bottom-right":[[1,0],[1,0],[1,0]],left:[[0,.5],[0,.5],[0,.5]],center:[[.5,.5],[.5,.5],[.5,.5]],right:[[1,.5],[1,.5],[1,.5]],"top-left":[[0,1],[0,1],[0,1]],top:[[.5,1],[.5,1],[.5,1]],"top-right":[[1,1],[1,1],[1,1]],stretch:[[0,0],[1,1],[.5,.5]],"stretch-horizontal":[[0,.5],[1,.5],[.5,.5]],"stretch-vertical":[[.5,0],[.5,1],[.5,.5]]}[e];return n&&(i.anchorMin={x:n[0][0],y:n[0][1]},i.anchorMax={x:n[1][0],y:n[1][1]},i.pivot={x:n[2][0],y:n[2][1]}),i}function $a(t){let e=Ot(t),i=(r,n)=>Math.abs(r-n)<1e-4;if(i(e.anchorMin.x,0)&&i(e.anchorMin.y,0)&&i(e.anchorMax.x,1)&&i(e.anchorMax.y,1))return"stretch";if(i(e.anchorMin.x,e.anchorMax.x)&&i(e.anchorMin.y,e.anchorMax.y)){let r=e.anchorMin.x,n=e.anchorMin.y,o=[[0,0,"bottom-left"],[.5,0,"bottom"],[1,0,"bottom-right"],[0,.5,"left"],[.5,.5,"center"],[1,.5,"right"],[0,1,"top-left"],[.5,1,"top"],[1,1,"top-right"]];for(let s of o)if(i(r,s[0])&&i(n,s[1]))return s[2]}return"custom"}function _i(t){return Ma(t).platform}function Ga(t){let e={};for(let i of Be)e[i]=t(i);return e}var Id={scale:["x","y","z"],rotation:["x","y","z"],anchorMin:["x","y"],anchorMax:["x","y"],offset:["x","y"],size:["x","y"],pivot:["x","y"]};function qa(t,e){for(let[i,r]of Object.entries(Id))for(let n of r)if(!Number.isFinite(t?.[i]?.[n]))throw new Error(`${e}.${i}.${n} must be a finite number`)}function ti(t,e="transformByPlatform"){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e}: \u9700\u8981\u5B8C\u6574\u7684\u56DB\u5E73\u53F0\u5E03\u5C40`);for(let i of Object.keys(t))if(!Be.includes(i))throw new Error(`${e}: unknown platform ${i}`);for(let i of Be)qa(t[i],`${e}.${i}`)}function Ii(t){if(Object.hasOwn(t,"transformByCanvas"))throw new Error(`${t.name||t.id||"\u63A7\u4EF6"}: \u4E0D\u518D\u652F\u6301 transformByCanvas\uFF1B\u8BF7\u4F7F\u7528\u56DB\u5E73\u53F0 transformByPlatform \u5E03\u5C40`);ti(t.transformByPlatform,`${t.name||t.id||"\u63A7\u4EF6"}.transformByPlatform`)}function Ci(t,e){if(!Be.includes(e))throw new Error(`unknown platform ${e}`);return qa(t?.[e],`transformByPlatform.${e}`),Ot(t[e])}var Cd=Object.freeze([{key:"genericField501",label:"\u901A\u7528\u69FD field501",type:"number",defaultValue:0,wire:"GenericSlot.field501"},{key:"footerField505",label:"\u5C3E\u90E8\u69FD field505",type:"number",defaultValue:0,wire:"FooterSlot.field505"}]),Ed=Object.freeze({container:[],textbox:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]}],textwindow:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]},{key:"textField511",label:"\u6587\u672C\u89C6\u7A97 field511",type:"number",defaultValue:1,wire:"TextConfig.field511"},{key:"textViewField502",label:"\u89C6\u7A97\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field502"},{key:"textViewField503",label:"\u89C6\u7A97\u6807\u8BB0 field503",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field503"}],cursor:[{key:"cursorField501",label:"\u5149\u6807\u68C0\u6D4B field501",type:"number",defaultValue:1,wire:"CursorConfig.field501"}],reference:[{key:"templateRefSlot",label:"\u6A21\u677F\u5F15\u7528\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.templateRefSlot"}],grid:[{key:"gridField501",label:"\u7F51\u683C\u6807\u8BB0 field501",type:"number",defaultValue:1,wire:"GridViewConfig.field501"},{key:"gridField507",label:"\u7F51\u683C\u6807\u8BB0 field507",type:"number",defaultValue:1,wire:"GridViewConfig.field507"},{key:"gridField508",label:"\u7F51\u683C\u6807\u8BB0 field508",type:"number",defaultValue:1,wire:"GridViewConfig.field508"},{key:"gridField509",label:"\u7F51\u683C\u6807\u8BB0 field509",type:"number",defaultValue:1,wire:"GridViewConfig.field509"},{key:"gridField511",label:"\u7F51\u683C\u6807\u8BB0 field511",type:"number",defaultValue:5,wire:"GridViewConfig.field511"},{key:"gridField512",label:"\u7F51\u683C\u6807\u8BB0 field512",type:"number",defaultValue:1,wire:"GridViewConfig.field512"}],keyhint:[{key:"keyHintField501",label:"\u6309\u952E\u63D0\u793A field501",type:"number",defaultValue:1,wire:"KeyHintConfig.field501"},{key:"keyHintField502",label:"\u952E\u9F20\u952E\u4F4D\u539F\u59CB\u503C",type:"number",defaultValue:1,wire:"KeyHintConfig.field502"}],image:[{key:"imageSlotType",label:"\u56FE\u7247\u7C7B\u578B\u539F\u59CB\u503C",type:"number",defaultValue:0,wire:"ImageSlotConfig.imageType"},{key:"imageField502",label:"\u56FE\u7247\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"ImageConfig.field502"},{key:"imageField504",label:"\u56FE\u7247\u6807\u8BB0 field504",type:"number",defaultValue:1,wire:"ImageConfig.field504"},{key:"imageField505",label:"\u56FE\u7247\u6807\u8BB0 field505",type:"number",defaultValue:1,wire:"ImageConfig.field505"},{key:"imageField507",label:"\u56FE\u7247\u6807\u8BB0 field507",type:"number",defaultValue:2,wire:"ImageConfig.field507"},{key:"imageFillType",label:"\u586B\u5145\u5F62\u72B6\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:1,wire:"ImageConfig.fillType",options:[{value:1,label:"1 \xB7 \u6A2A\u5411"},{value:2,label:"2 \xB7 \u7EB5\u5411"},{value:3,label:"3 \xB7 90\u5EA6\u73AF\u7ED5"},{value:4,label:"4 \xB7 180\u5EA6\u73AF\u7ED5"},{value:5,label:"5 \xB7 360\u5EA6\u73AF\u7ED5"}]}],animation:[{key:"effectSlot",label:"\u754C\u9762\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.effectSlot"}],fullscreen:[{key:"fullscreenEffectSlot",label:"\u5168\u5C4F\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.fullscreenEffectSlot"}]});function Ba(t){return[...Cd,...Ed[t]||[]]}function Va(t,e){return Ba(t).find(i=>i.key===e)||null}function bo(t,e){if(!t)throw new Error("unknown raw GIA field");if(t.type==="string")return String(e??"");let i=Number(e);if(!Number.isFinite(i))throw new Error(`${t.wire} must be a finite number`);return Math.trunc(i)}function La(t,e={}){let i={};for(let r of Ba(t)){let n=Object.hasOwn(e||{},r.key)?e[r.key]:r.defaultValue;i[r.key]=bo(r,n)}if(t==="reference")for(let r of["templateRefSlotBase64","templateRefOuterBase64"]){if(!Object.hasOwn(e||{},r))continue;let n=e[r];if(typeof n!="string"||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(n))throw new Error(`${r} must be base64`);n&&(i[r]=n)}return i}function gt(t){let e=Number(t);return Number.isSafeInteger(e)&&e>0&&e<=2147483647}function wo(t,e){if(t){e(t);for(let i of t.children||[])wo(i,e)}}function Ki(t,e=new Set,{skipServerContainer:i=!1}={}){return wo(t,r=>{i&&r.kind==="server-container"||gt(r.guid)&&e.add(Number(r.guid))}),e}function ii(t,e=1073741850){let i=Number.isSafeInteger(e)&&e>0?e:1073741850;i<1073741850&&(i=1073741850);for(let r of t)gt(r)&&r>=i&&(i=Number(r)+1);for(;t.has(i);)i+=1;if(i>2147483647)throw new Error("GUID space exhausted");return i}function ja(t,e=new Set,{skipServerContainer:i=!1}={}){let r=[];wo(t,n=>{if(i&&n.kind==="server-container")return;let o=Number(n.guid);if(gt(o)&&!e.has(o)){e.add(o),n.guid=o;return}r.push(n)});for(let n of r){let o=ii(e);n.guid=o,e.add(o)}return e}function lt(t){return Number.isSafeInteger(t)&&t>0&&t<=2147483647}function Lt(t,{warnings:e=[]}={}){if(t.meta?.assetType!=="client-control-template")return;if(t.meta.giaAssetIndexSchemaVersion>1)throw new Error(`\u4E0D\u652F\u6301\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7248\u672C ${t.meta.giaAssetIndexSchemaVersion}`);let i=[],r=g=>{g.kind!=="server-container"&&i.push(g);for(let b of g.children||[])r(b)};r(t.root);let n=new Map,o=new Map;for(let g of i){if(!lt(g.giaInfoIndex))continue;let b=n.get(g.giaInfoIndex)||[];b.push(g),n.set(g.giaInfoIndex,b);let C=o.get(g.kind)||new Set;C.add(g.giaInfoIndex),o.set(g.kind,C)}let s=(t.root.children||[]).filter(g=>g.kind!=="server-container"),a=new Set(s),l=s.some((g,b)=>lt(g.giaInfoIndex)&&s.slice(0,b).some(C=>C.giaInfoIndex===g.giaInfoIndex)),u=!t.meta.giaAssetIndexSchemaVersion&&l&&i.every(g=>g.giaInfoIndexSource!=="authoring")&&[...o.values()].every(g=>g.size===1)&&[...n.values()].every(g=>g.every(b=>b.kind===g[0].kind)),f=new Set;if(u)for(let g of n.values()){let b=g.find(C=>a.has(C))||g[0];for(let C of g)C!==b&&f.add(C)}let h=new Map,p=Number.isSafeInteger(t.meta.giaNextAssetIndex)&&t.meta.giaNextAssetIndex>=2?t.meta.giaNextAssetIndex:2;for(let g of i){if(!lt(g.giaInfoIndex)||(p=Math.max(p,g.giaInfoIndex+1),f.has(g)))continue;let b=h.get(g.giaInfoIndex);if(b&&(b.giaInfoIndexSource==="authoring"||g.giaInfoIndexSource==="authoring"))throw new Error(`\u65B0\u5EFA\u8D44\u4EA7\u7F16\u53F7 ${g.giaInfoIndex} \u91CD\u590D\uFF1A${b.name} / ${g.name}`);h.set(g.giaInfoIndex,g)}u&&(p=Math.max(p,13));let m=u?[...s,...i.filter(g=>!a.has(g))].filter(g=>f.has(g)||!lt(g.giaInfoIndex)):i.filter(g=>!lt(g.giaInfoIndex));if(m.length&&p+m.length-1>2147483647)throw new Error("\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7A7A\u95F4\u5DF2\u8017\u5C3D");for(let g of m)g.giaInfoIndex=p++,g.giaInfoIndexSource="authoring";t.meta.giaNextAssetIndex=p,t.meta.giaAssetIndexSchemaVersion=1,f.size&&e.push(`\u65E7\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u81EA\u52A8\u8FC1\u79FB\uFF1A\u4FEE\u590D ${f.size} \u6761\u6309\u63A7\u4EF6\u7C7B\u578B\u590D\u7528\u7684\u7F16\u53F7\uFF1BGUID\u3001Lua \u5F15\u7528\u548C\u63A7\u4EF6\u5C5E\u6027\u4FDD\u6301\u4E0D\u53D8\u3002`)}var So=1;function xo(t="n"){let e=`${t}${So}`;return So+=1,e}function an(t=1){So=t}function _o(t,{isRootContainer:e=!1}={}){if(t==="server-container"||t==="fullscreen"||t==="container"&&e)return sn({layout:"stretch"});let i=Na[t]||[80,80];return sn({layout:"center",size:i})}function kd(t,e){return Ga(()=>_o(t,e))}function Ad(t){ti(t);let e={};for(let i of Be)e[i]=Ci(t,i);return e}function we(t,e={}){if(!ji[t])throw new Error(`unknown kind: ${t}`);Object.hasOwn(e,"transformByCanvas")&&Ii(e);let i=e.isRootContainer===!0,r=e.id||xo(t==="server-container"?"sc":"n"),n=Object.hasOwn(e,"transformByPlatform")?Ad(e.transformByPlatform):kd(t,{isRootContainer:i}),o={id:r,kind:t,name:e.name||ji[t],guid:e.guid??0,giaRelatedGuids:Array.isArray(e.giaRelatedGuids)?e.giaRelatedGuids.filter(s=>Number.isSafeInteger(Number(s))&&Number(s)>0).map(Number):[],...lt(Number(e.giaInfoIndex))?{giaInfoIndex:Number(e.giaInfoIndex),giaInfoIndexSource:e.giaInfoIndexSource==="authoring"?"authoring":"imported"}:{},active:e.active!==!1,visible:e.visible!==!1,canControllerFocus:e.canControllerFocus??e.giaRaw?.footerField505===1,syncAllDevices:e.syncAllDevices!==!1,giaRaw:La(t,e.giaRaw),transformByPlatform:n,children:[],scriptMappingIds:Array.isArray(e.scriptMappingIds)?e.scriptMappingIds.filter(s=>Number.isSafeInteger(Number(s))&&Number(s)>0).map(Number):[]};if(t==="container"&&(o.isolateNavigation=e.isolateNavigation===!0,o.disableKeyEventPassthrough=e.disableKeyEventPassthrough===!0,o.disableCursorEventPassthrough=e.disableCursorEventPassthrough===!0,o.showCursor=e.showCursor===!0),(t==="textbox"||t==="textwindow")&&(o.fontSize=e.fontSize??20,o.adaptiveFontSize=e.adaptiveFontSize===!0,o.minimumFontSize=e.minimumFontSize??20,o.fontColor=e.fontColor??xr.font,o.bgColor=e.bgColor??xr.bg,o.enableOutline=e.enableOutline!==!1,o.outlineColor=e.outlineColor??xr.outline,o.horizontalAlignment=e.horizontalAlignment||"Left",o.verticalAlignment=e.verticalAlignment||"Top",Number.isInteger(e.giaRaw?.textVerticalAlign)&&![0,1,2].includes(e.giaRaw.textVerticalAlign)&&(o.giaRaw.textVerticalAlign=e.giaRaw.textVerticalAlign),o.text=e.text??"",Object.hasOwn(e.giaRaw||{},"textAlign")||(o.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o.horizontalAlignment]??o.giaRaw.textAlign),t==="textwindow"&&(o.interactable=e.interactable!==!1,o.showScrollBar=e.showScrollBar!==!1)),t==="image"&&(o.imageSource=e.imageSource||"StaticReference",o.imageType=["Basic","Stretch"].includes(e.imageType)?e.imageType:null,o.imageId=e.imageId??100001,o.imageColor=e.imageColor??xr.image,o.enableMask=e.enableMask===!0,o.enableSoftEdge=e.enableSoftEdge===!0,o.softEdgeMode=e.softEdgeMode||"Percentage",o.softEdgeWidthX=e.softEdgeWidthX??8,o.softEdgeWidthY=e.softEdgeWidthY??8,o.horizontalSoftRange=e.horizontalSoftRange??85,o.verticalSoftRange=e.verticalSoftRange??85,o.enableFill=e.enableFill===!0,o.fillType=e.fillType||"Horizontal",o.fillHorizontalType=e.fillHorizontalType||"Left",o.fillVerticalType=e.fillVerticalType||"Bottom",o.fillRadial90Type=e.fillRadial90Type||"BottomLeft",o.fillRadialType=e.fillRadialType||"Bottom",o.fillAmount=e.fillAmount??1,o.reverseMaskArea=e.reverseMaskArea===!0||e.reverseMask===!0,Object.hasOwn(e.giaRaw||{},"imageFillType")||(o.giaRaw.imageFillType={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o.fillType]??o.giaRaw.imageFillType)),t==="button"&&(o.raycastTarget=e.raycastTarget!==!1,o.interactable=e.interactable!==!1,o.clickAudioId=e.clickAudioId??Pa,o.unavailableChildId=e.unavailableChildId??null,o.hoverChildId=e.hoverChildId??null,o.pressedChildId=e.pressedChildId??null,o.selectedChildId=e.selectedChildId??null),t==="cursor"&&(o.raycastTarget=e.raycastTarget??e.giaRaw?.cursorField501!==0),t==="reference"&&(o.referencedPrefabId=e.referencedPrefabId??e.giaRaw?.templateRefSlot??null,Object.hasOwn(e.giaRaw||{},"templateRefSlot")||(o.giaRaw.templateRefSlot=String(o.referencedPrefabId??""))),t==="grid"&&(o.itemPrefabId=e.itemPrefabId??null,o.raycastTarget=e.raycastTarget!==!1,o.interactable=e.interactable!==!1,o.showScrollBar=e.showScrollBar!==!1,o.scrollDirection=e.scrollDirection||"Vertical",o.layoutConstraint=e.layoutConstraint||"AutoWrap",o.layoutConstraintFixedCount=e.layoutConstraintFixedCount??null,o.cellSizeX=e.cellSizeX??50,o.cellSizeY=e.cellSizeY??50,o.spacingX=e.spacingX??8,o.spacingY=e.spacingY??8,o.padding1X=e.padding1X??20,o.padding1Y=e.padding1Y??20,o.padding2X=e.padding2X??20,o.padding2Y=e.padding2Y??20,o.previewCount=e.previewCount??e.giaRaw?.gridField511??5,Object.hasOwn(e.giaRaw||{},"gridField511")||(o.giaRaw.gridField511=Math.trunc(o.previewCount))),t==="keyhint"&&(o.keyboardKeyCode=e.keyboardKeyCode??e.giaRaw?.keyHintField502??null,o.controllerKeyCode=e.controllerKeyCode??e.giaRaw?.keyHintField501??null,Object.hasOwn(e.giaRaw||{},"keyHintField502")||(o.giaRaw.keyHintField502=Math.trunc(o.keyboardKeyCode??1)),Object.hasOwn(e.giaRaw||{},"keyHintField501")||(o.giaRaw.keyHintField501=Math.trunc(o.controllerKeyCode??1))),t==="animation"||t==="fullscreen"){let s=t==="animation"?e.giaRaw?.effectSlot:e.giaRaw?.fullscreenEffectSlot;o.animationId=e.animationId??s??null,o.playSoundEffect=e.playSoundEffect??null,t==="animation"&&(o.layer=e.layer??null);let a=t==="animation"?"effectSlot":"fullscreenEffectSlot";Object.hasOwn(e.giaRaw||{},a)||(o.giaRaw[a]=String(o.animationId??""))}if(e.children)for(let s of e.children)o.children.push(s);return o}function Ei(){an(1);let t=we("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668"}),e=we("container",{id:"n1",name:"\u5BB9\u5668\u8282\u70B9",isRootContainer:!0}),i=we("textbox",{id:"n2",name:"\u6587\u672C\u6846",text:"\u6587\u672C"}),r=we("cursor",{id:"n3",name:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF"}),n=we("reference",{id:"n4",name:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6"}),o=we("grid",{id:"n5",name:"\u7F51\u683C\u89C6\u7A97"}),s=we("button",{id:"n6",name:"\u9884\u8BBE\u6309\u94AE"}),a=we("textwindow",{id:"n7",name:"\u6587\u672C\u89C6\u7A97"}),l=we("keyhint",{id:"n8",name:"\u6309\u952E\u63D0\u793A"}),u=we("image",{id:"n9",name:"\u56FE\u7247",imageId:100005}),f=we("animation",{id:"n10",name:"\u754C\u9762\u52A8\u6548"}),h=we("fullscreen",{id:"n11",name:"\u5168\u5C4F\u52A8\u6548"}),p=(m,g,b)=>{for(let C of Object.values(m.transformByPlatform))C.offset={x:g,y:b}};return p(i,-300,250),p(r,-300,140),p(n,-300,30),p(o,-300,-100),p(s,0,0),p(a,300,250),p(l,300,140),p(u,300,30),p(f,300,-100),e.children.push(i,r,n,o,s,a,l,u,f,h),t.children.push(e),an(12),ja(t),{version:1,layoutSchemaVersion:Ze,meta:{name:"\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"authoring",sourceFile:""},canvasId:"pc-16-9",selectedId:"n2",root:t}}function Wi(){an(1);let t=we("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"}),e=we("container",{id:"n1",guid:1073742100,name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F"}),i=we("textbox",{id:"n2",guid:1073742101,name:"\u6A21\u677F\u6807\u9898",text:"\u5BA2\u6237\u7AEF\u6A21\u677F\u5DF2\u5B9E\u4F8B\u5316",fontSize:28,horizontalAlignment:"Middle"}),r=we("image",{id:"n3",guid:1073742102,name:"\u6A21\u677F\u56FE\u6807",imageId:100005}),n=we("button",{id:"n4",guid:1073742103,name:"\u786E\u8BA4\u6309\u94AE"}),o=we("textbox",{id:"n5",guid:1073742104,name:"\u6309\u94AE\u6587\u5B57",text:"\u786E\u8BA4",horizontalAlignment:"Middle",verticalAlignment:"Top"}),s=(u,f,h)=>{for(let p of Object.values(u.transformByPlatform))p.offset={x:f,y:h}};((u,f,h)=>{for(let p of Object.values(u.transformByPlatform))p.size={x:f,y:h}})(e,520,320),s(i,0,110),s(r,0,0),s(n,0,-110),n.children.push(o),e.children.push(i,r,n),t.children.push(e),an(6);let l={version:1,layoutSchemaVersion:Ze,meta:{name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F",assetType:"client-control-template",sourceFormat:"authoring",sourceFile:"",gameVersion:rn,giaOwnerUid:114514,giaFileId:1073741829,giaFileName:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia"},canvasId:"pc-16-9",selectedId:"n1",root:t};return Lt(l),l}function ke(t,e,i=null){e(t,i);for(let r of t.children||[])ke(r,e,t)}function je(t,e){let i=null;return ke(t,r=>{r.id===e&&(i=r)}),i}function Io(t,e="n"){let i=xo(e);for(;je(t,i);)i=xo(e);return i}function ri(t,e){let i=null;return ke(t,(r,n)=>{r.id===e&&(i=n)}),i}function Co(t){let e=t.root||t;return e.kind==="container"?e:(e.children||[]).find(i=>i.kind==="container")||(e.children||[])[0]||e}function Cr(t){if(t.meta?.assetType!=="client-control-template")return Co(t);let e=je(t.root,t.selectedId);if(!e||e.kind==="server-container")return t.root.children?.[0]||t.root;let i=ri(t.root,e.id);for(;i&&i.kind!=="server-container";)e=i,i=ri(t.root,e.id);return e}function Eo(t){Ii(t);let e={id:t.id,name:t.name,guid:t.guid,giaRelatedGuids:t.giaRelatedGuids,giaInfoIndex:t.giaInfoIndex,giaInfoIndexSource:t.giaInfoIndexSource,scriptMappingIds:t.scriptMappingIds,giaRaw:t.giaRaw,active:t.active,visible:t.visible,canControllerFocus:t.canControllerFocus,syncAllDevices:t.syncAllDevices,transformByPlatform:t.transformByPlatform};t.kind==="container"&&(e.isolateNavigation=t.isolateNavigation,e.disableKeyEventPassthrough=t.disableKeyEventPassthrough,e.disableCursorEventPassthrough=t.disableCursorEventPassthrough,e.showCursor=t.showCursor),(t.kind==="textbox"||t.kind==="textwindow")&&(e.fontSize=t.fontSize,e.adaptiveFontSize=t.adaptiveFontSize,e.minimumFontSize=t.minimumFontSize,e.fontColor=t.fontColor,e.bgColor=t.bgColor,e.enableOutline=t.enableOutline,e.outlineColor=t.outlineColor,e.horizontalAlignment=t.horizontalAlignment,e.verticalAlignment=t.verticalAlignment,e.text=t.text??"",t.kind==="textwindow"&&(e.interactable=t.interactable,e.showScrollBar=t.showScrollBar)),t.kind==="image"&&(e.imageSource=t.imageSource,e.imageType=t.imageType,e.imageId=t.imageId,e.imageColor=t.imageColor,e.enableMask=t.enableMask,e.enableSoftEdge=t.enableSoftEdge,e.softEdgeMode=t.softEdgeMode,e.softEdgeWidthX=t.softEdgeWidthX,e.softEdgeWidthY=t.softEdgeWidthY,e.horizontalSoftRange=t.horizontalSoftRange,e.verticalSoftRange=t.verticalSoftRange,e.enableFill=t.enableFill,e.fillType=t.fillType,e.fillHorizontalType=t.fillHorizontalType,e.fillVerticalType=t.fillVerticalType,e.fillRadial90Type=t.fillRadial90Type,e.fillRadialType=t.fillRadialType,e.fillAmount=t.fillAmount,e.reverseMaskArea=t.reverseMaskArea??t.reverseMask),t.kind==="button"&&(e.raycastTarget=t.raycastTarget,e.interactable=t.interactable,e.clickAudioId=t.clickAudioId,e.unavailableChildId=t.unavailableChildId??null,e.hoverChildId=t.hoverChildId??null,e.pressedChildId=t.pressedChildId??null,e.selectedChildId=t.selectedChildId??null),t.kind==="cursor"&&(e.raycastTarget=t.raycastTarget),t.kind==="reference"&&(e.referencedPrefabId=t.referencedPrefabId??null),t.kind==="grid"&&(e.itemPrefabId=t.itemPrefabId??null,e.raycastTarget=t.raycastTarget,e.interactable=t.interactable,e.showScrollBar=t.showScrollBar,e.scrollDirection=t.scrollDirection,e.layoutConstraint=t.layoutConstraint,e.layoutConstraintFixedCount=t.layoutConstraintFixedCount??null,e.cellSizeX=t.cellSizeX,e.cellSizeY=t.cellSizeY,e.spacingX=t.spacingX,e.spacingY=t.spacingY,e.padding1X=t.padding1X,e.padding1Y=t.padding1Y,e.padding2X=t.padding2X,e.padding2Y=t.padding2Y,e.previewCount=t.previewCount),t.kind==="keyhint"&&(e.keyboardKeyCode=t.keyboardKeyCode??null,e.controllerKeyCode=t.controllerKeyCode??null),(t.kind==="animation"||t.kind==="fullscreen")&&(e.animationId=t.animationId??null,e.playSoundEffect=t.playSoundEffect??null,t.kind==="animation"&&(e.layer=t.layer??null)),e.isRootContainer=t.kind==="container"&&Od(t.transformByPlatform);let i=we(t.kind,e);return i.children=(t.children||[]).map(r=>Eo(r)),i}function Od(t){let e=t&&(t.KEYBOARD||Object.values(t)[0]);return e?Math.abs(e.anchorMin?.x??.5)<1e-4&&Math.abs(e.anchorMin?.y??.5)<1e-4&&Math.abs((e.anchorMax?.x??.5)-1)<1e-4&&Math.abs((e.anchorMax?.y??.5)-1)<1e-4:!1}function Ya(t,e,i={}){if(t.kind==="server-container"&&e!=="container")throw new Error("server container only accepts container nodes");let r=we(e,i);return t.children.push(r),r}function Ua(t,e){if(t.id===e)throw new Error("cannot remove root");let i=ri(t,e);if(!i)return!1;let r=i.children.findIndex(n=>n.id===e);return r<0?!1:(i.children.splice(r,1),!0)}var Xa=1e-4;function Td(t,e){return Math.abs(t.anchorMax[e]-t.anchorMin[e])>Xa&&Math.abs(t.size[e])<=Xa}function Rd(t,e,i){if(!(e.width>0)||!(e.height>0))throw new Error("source parent must have positive size");if(!(i.width>0)||!(i.height>0))throw new Error("target parent must have positive size");let r=Vt(e,t),n=(r.centerX-e.left)/e.width,o=(r.centerY-e.bottom)/e.height,s=xi(i,t,{posX:i.left+n*i.width,posY:i.bottom+o*i.height,width:r.width,height:r.height});for(let a of["x","y"])Td(t,a)&&(s.offset[a]=t.offset[a],s.size[a]=t.size[a]);return s}function Ha({transformByPlatform:t,source:e,canvasId:i,syncAllDevices:r,sourceParentBox:n=Qe(i),targetParentBoxByPlatform:o={}}){ti(t);let s=_i(i),a={};for(let l of Be)l===s?a[l]=Ot(e):r!==!1?a[l]=Rd(e,n,o[l]||Qe(Li[l])):a[l]=Ci(t,l);return ti(a),a}function ni(t,e){return Ci(t,_i(e))}import{createCanvas as Ud}from"@napi-rs/canvas";import{existsSync as Md,openSync as zd,closeSync as Dd,fstatSync as $d,readFileSync as Gd}from"node:fs";import{extname as qd,isAbsolute as Bd}from"node:path";import{createHash as Vd}from"node:crypto";import{workerData as fn}from"node:worker_threads";import{GlobalFonts as el}from"@napi-rs/canvas";var Ka='"Microsoft YaHei UI","Microsoft YaHei","HarmonyOS Sans SC","Noto Sans CJK SC",sans-serif';var ko=t=>`QxqyLocal_${t}`,Wa=t=>t?`"${ko(t)}",${Ka}`:Ka;import{existsSync as Nd,mkdirSync as Yg,readFileSync as Pd,renameSync as Ug,rmSync as Xg,writeFileSync as Hg}from"node:fs";import{homedir as Ao}from"node:os";import{dirname as Jg,join as ln,win32 as un}from"node:path";function Ja(t=process.platform,e=process.env){if(t!=="win32")return[];let i=e.SystemDrive||"C:",r=e.ProgramFiles||`${i}\\Program Files`,n="YuanShen_Data\\StreamingAssets\\MiHoYoSDKRes\\HttpServerResources\\font\\zh-cn.ttf";return[...new Set([un.join(r,"Genshin Impact","Genshin Impact Game",n),un.join(i+"\\","Mihoyo","Genshin Impact","Genshin Impact Game",n),un.join(r,"HoYoPlay","games","Genshin Impact game",n),un.join(r,"miHoYo Launcher","games","Genshin Impact Game",n)])]}function Fd(){if(process.env.QXQY_FONT_CONFIG_PATH)return process.env.QXQY_FONT_CONFIG_PATH;let t=process.platform==="win32"?process.env.APPDATA||ln(Ao(),"AppData","Roaming"):process.platform==="darwin"?ln(Ao(),"Library","Application Support"):process.env.XDG_CONFIG_HOME||ln(Ao(),".config");return ln(t,"beyond-simulator","font.json")}function Za(t){if(!t||!["auto","custom","system"].includes(t.mode))throw new Error("\u8BF7\u9009\u62E9\u81EA\u52A8\u67E5\u627E\u3001\u6307\u5B9A\u6587\u4EF6\u6216\u7CFB\u7EDF\u5B57\u4F53");let e=typeof t.path=="string"?t.path.trim():"";if(e.length>4096)throw new Error("\u5B57\u4F53\u8DEF\u5F84\u8FC7\u957F");if((e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1)),t.mode==="custom"&&!e)throw new Error("\u8BF7\u586B\u5199\u5B57\u4F53\u6587\u4EF6\u7684\u7EDD\u5BF9\u8DEF\u5F84");return{mode:t.mode,path:t.mode==="custom"?e:""}}function Qa(t=Fd()){if(!Nd(t))return{mode:"auto",path:""};try{return Za(JSON.parse(Pd(t,"utf8")))}catch{throw new Error("\u672C\u673A\u5B57\u4F53\u8BBE\u7F6E\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u5728\u300C\u5B57\u4F53\u8BBE\u7F6E\u300D\u4E2D\u91CD\u65B0\u4FDD\u5B58")}}function ol(t){let e=Buffer.from(t),i=e.subarray(0,4).toString("hex");if(e.length<12||e.length>33554432||!["00010000","4f54544f"].includes(i))throw new Error("QXQY_FONT_PATH must contain a valid TTF or OTF font (at most 32 MiB)");let r=Vd("sha256").update(e).digest("hex"),n=ko(r);try{if(!el.has(n)&&!el.register(e,n))throw new Error("invalid font")}catch{throw new Error("QXQY_FONT_PATH font could not be registered")}return{id:r,data:e,type:i==="4f54544f"?"font/otf":"font/ttf"}}function Oo(t){if(!t)return null;if(!Bd(t)||![".ttf",".otf"].includes(qd(t).toLowerCase()))throw new Error("QXQY_FONT_PATH must be an absolute path to a TTF or OTF font");let e,i;try{e=zd(t,"r");let r=$d(e);if(!r.isFile()||r.size<12||r.size>33554432)throw new Error("invalid size");i=Gd(e)}catch{throw new Error("QXQY_FONT_PATH must point to a readable font file of at most 32 MiB")}finally{e!==void 0&&Dd(e)}return ol(i)}var tl=!1,cn=null,il={path:"",source:"system"},rl=null,Ld="";function jd(t){if(t.mode==="custom")return{font:Oo(t.path),path:t.path,source:"custom"};if(t.mode==="auto"){let e;for(let i of Ja())if(Md(i))try{return{font:Oo(i),path:i,source:"auto"}}catch(r){e=r}if(e)throw e}return{font:null,path:"",source:"system"}}function Yd(){if(!tl){if(fn&&Object.hasOwn(fn,"localFont"))cn=fn.localFont?ol(fn.localFont):null;else if(process.env.QXQY_FONT_PATH)cn=Oo(process.env.QXQY_FONT_PATH),il={path:process.env.QXQY_FONT_PATH,source:"environment"};else try{rl=Qa();let t=jd(rl);cn=t.font,il={path:t.path,source:t.source}}catch(t){Ld=t.message}tl=!0}return cn}var sl=()=>Wa(Yd()?.id);var To=Ud(1,1).getContext("2d"),al=new WeakMap,ll=(t,e)=>Math.max(1,Math.trunc(Number.isFinite(Number(t))?Number(t):e));function ki(t,e,i){let r=String(t.text??"").replace(/\r\n?/g,`
12
- `),n=ll(t.fontSize,20),o=Math.min(n,ll(t.minimumFontSize,10)),s=t.adaptiveFontSize===!0,a=sl(),l=JSON.stringify([r,e,i,n,o,s,t.kind,t.showScrollBar,a]),u=al.get(t);if(u?.key===l)return u.value;let f=(m,g)=>{To.font=`${m}px ${a}`;let b=[];for(let q of r.split(`
13
- `)){let B="";for(let W of q)B&&To.measureText(B+W).width>g&&(b.push(B),B=""),B+=W;b.push(B)}let C=m*1.2,k=b.length*C,E=t.kind==="textbox"&&r?m*.25+4:0,G=r?k+E:0,x=G<=i+1e-6&&b.every(q=>To.measureText(q).width<=g+1e-6);return{fontSize:m,lines:b,lineHeight:C,contentHeight:k,blockInset:E,requiredHeight:G,textWidth:g,fits:x}},h=Math.max(0,e-4),p=f(n,h);if(s&&!p.fits&&o<n){p=f(o,h);let m=o+1,g=n-1;for(;m<=g;){let b=Math.floor((m+g)/2),C=f(b,h);C.fits?(p=C,m=b+1):g=b-1}}return t.kind==="textwindow"&&t.showScrollBar!==!1&&p.contentHeight>i&&(p=f(p.fontSize,Math.max(0,h-12))),al.set(t,{key:l,value:p}),p}function ul(t,e){let i=[];function r(n){e[n.id]&&i.push(e[n.id]);let o=n.children||[];for(let s=o.length-1;s>=0;s-=1)r(o[s])}return r(t),i}function oi(t,e,i=_i(e)){let r=Qe(e),n={};function o(s,a,l){let u=Ci(s.transformByPlatform,i),f=Vt(a,u),h=s.kind==="server-container"?l:Ir(l,f,u),p=za(f,h);n[s.id]={...f,...vo(f),id:s.id,kind:s.kind,name:s.name,visible:s.visible!==!1,active:s.active!==!1,rotationX:u.rotation.x,rotationY:u.rotation.y,rotationZ:u.rotation.z,renderLeft:p.left,renderBottom:p.bottom,renderWidth:p.width,renderHeight:p.height,renderRotationZ:p.rotationZ,renderMatrix:h,primitive:s.kind==="image"?Yi(s.imageId,s.imageSource):null,...s.kind==="textbox"||s.kind==="textwindow"?{text:s.text??"",fontSize:s.fontSize,adaptiveFontSize:s.adaptiveFontSize===!0,minimumFontSize:s.minimumFontSize,textLayout:ki(s,f.width,f.height),fontColor:s.fontColor,bgColor:s.bgColor,enableOutline:s.enableOutline!==!1,outlineColor:s.outlineColor,horizontalAlignment:s.horizontalAlignment,verticalAlignment:s.verticalAlignment}:{},...s.kind==="image"?{imageSource:s.imageSource,imageType:s.imageType??null,imageId:s.imageId,imageColor:s.imageColor,enableMask:s.enableMask===!0,enableSoftEdge:s.enableSoftEdge===!0,softEdgeMode:s.softEdgeMode,softEdgeWidthX:s.softEdgeWidthX,softEdgeWidthY:s.softEdgeWidthY,horizontalSoftRange:s.horizontalSoftRange,verticalSoftRange:s.verticalSoftRange,enableFill:s.enableFill===!0,fillType:s.fillType,fillHorizontalType:s.fillHorizontalType,fillVerticalType:s.fillVerticalType,fillRadial90Type:s.fillRadial90Type,fillRadialType:s.fillRadialType,fillAmount:s.fillAmount,reverseMaskArea:s.reverseMaskArea===!0}:{},...s.kind==="button"?{raycastTarget:s.raycastTarget!==!1,interactable:s.interactable!==!1,clickAudioId:s.clickAudioId,unavailableChildId:s.unavailableChildId??null,hoverChildId:s.hoverChildId??null,pressedChildId:s.pressedChildId??null,selectedChildId:s.selectedChildId??null}:{}};let m=s.kind==="server-container"?a:f;for(let g of s.children||[])o(g,m,h)}return o(t,r,Xi()),{canvas:r,boxes:n}}function Ro(t,e){let i=[];function r(n,o,s=null,a=[],l=0,u=1,f=t.id){i.push({id:n.id,guid:e?.get(n.id)??(n.guid||0),kind:n.kind,name:n.name,label:ji[n.kind]||n.kind,depth:o,parentId:s,ancestorIds:a,siblingIndex:l,siblingCount:u,templateId:f,childCount:(n.children||[]).length,incomplete:!on.includes(n.kind)});let h=n.children||[];for(let p=0;p<h.length;p+=1)r(h[p],o+1,n.id,[...a,n.id],p,h.length,f)}return r(t,0),i}function z(t,e,i,r,n={}){return{key:t,label:e,type:i,value:r,...n}}function fl(t,e,i,r){if(!t)return null;let n=ni(t.transformByPlatform,e),o=vo(i),s=[z("name","\u540D\u79F0","string",t.name),z("active","\u521D\u59CB\u6FC0\u6D3B","bool",t.active!==!1),z("visible","\u521D\u59CB\u53EF\u89C1\u6027","bool",t.visible!==!1),z("canControllerFocus","\u53EF\u88AB\u624B\u67C4\u6447\u6746\u5BFC\u822A\u9009\u4E2D","bool",t.canControllerFocus===!0),z("posX","\u4F4D\u7F6E X","number",o.posX,{computed:!0}),z("posY","\u4F4D\u7F6E Y","number",o.posY,{computed:!0}),z("width","\u5927\u5C0F W","number",o.width,{computed:!0}),z("height","\u5927\u5C0F H","number",o.height,{computed:!0}),z("rotationX","\u65CB\u8F6C X","number",n.rotation.x),z("rotationY","\u65CB\u8F6C Y","number",n.rotation.y),z("rotationZ","\u65CB\u8F6C Z","number",n.rotation.z),z("syncAllDevices","\u540C\u6B65\u4FE1\u606F\u81F3\u6240\u6709\u8BBE\u5907","bool",t.syncAllDevices!==!1),z("anchorType","\u951A\u70B9\u7C7B\u578B","enum",$a(n),{options:[{value:"center",label:"\u5C45\u4E2D"},{value:"top-left",label:"\u5DE6\u4E0A"},{value:"top",label:"\u4E0A\u65B9"},{value:"top-right",label:"\u53F3\u4E0A"},{value:"left",label:"\u5DE6\u4FA7"},{value:"right",label:"\u53F3\u4FA7"},{value:"bottom-left",label:"\u5DE6\u4E0B"},{value:"bottom",label:"\u4E0B\u65B9"},{value:"bottom-right",label:"\u53F3\u4E0B"},{value:"stretch",label:"\u53CC\u5411\u62C9\u4F38"},{value:"stretch-horizontal",label:"\u6C34\u5E73\u62C9\u4F38"},{value:"stretch-vertical",label:"\u5782\u76F4\u62C9\u4F38"},{value:"custom",label:"\u81EA\u5B9A\u4E49"}]}),z("anchorMinX","\u951A\u70B9 Min X","number",n.anchorMin.x),z("anchorMinY","\u951A\u70B9 Min Y","number",n.anchorMin.y),z("anchorMaxX","\u951A\u70B9 Max X","number",n.anchorMax.x),z("anchorMaxY","\u951A\u70B9 Max Y","number",n.anchorMax.y),z("pivotX","\u4E2D\u5FC3 X","number",n.pivot.x),z("pivotY","\u4E2D\u5FC3 Y","number",n.pivot.y)];if(t.kind==="container"&&s.push(z("isolateNavigation","\u9694\u79BB\u624B\u67C4\u5BFC\u822A","bool",t.isolateNavigation===!0),z("disableKeyEventPassthrough","\u5C4F\u853D\u6309\u952E\u4E8B\u4EF6\u7A7F\u900F","bool",t.disableKeyEventPassthrough===!0),z("disableCursorEventPassthrough","\u5C4F\u853D\u533A\u57DF\u5185\u70B9\u51FB\u4E8B\u4EF6\u7A7F\u900F","bool",t.disableCursorEventPassthrough===!0),z("showCursor","\u663E\u793A\u5E38\u9A7B\u5149\u6807","bool",t.showCursor===!0)),t.kind==="textbox"||t.kind==="textwindow"){let a=t.giaRaw?.textAlign,l=[0,1,2].includes(a)?t.horizontalAlignment||"Left":`__unrecognized:${a}`;s.push(z("fontSize","\u5B57\u53F7","number",t.fontSize),z("adaptiveFontSize","\u5B57\u53F7\u81EA\u9002\u5E94","bool",t.adaptiveFontSize===!0),z("minimumFontSize","\u6700\u5C0F\u5B57\u53F7","number",t.minimumFontSize),z("fontColor","\u6587\u672C\u8272","color",t.fontColor),z("bgColor","\u80CC\u666F\u8272","color",t.bgColor),z("enableOutline","\u542F\u7528\u63CF\u8FB9","bool",t.enableOutline!==!1),z("outlineColor","\u63CF\u8FB9\u8272","color",t.outlineColor),z("horizontalAlignment","\u6C34\u5E73\u5BF9\u9F50","enum",l,{...[0,1,2].includes(a)?{}:{unknownValue:a},options:[{value:"Left",label:"\u5DE6\u5BF9\u9F50"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Right",label:"\u53F3\u5BF9\u9F50"}]}),z("verticalAlignment","\u5782\u76F4\u5BF9\u9F50","enum",t.verticalAlignment||"Top",{options:[{value:"Top",label:"\u9876\u90E8"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Bottom",label:"\u5E95\u90E8"}]}),z("text","\u6587\u672C","text",t.text??""))}if(t.kind==="image"){let a=t.giaRaw?.imageFillType,l=[1,2,3,4,5].includes(a)?t.fillType:`__unrecognized:${a}`;s.push(z("imageSource","\u56FE\u7247\u6E90","enum",t.imageSource,{options:[{value:"StaticReference",label:"\u9759\u6001\u5F15\u7528"},{value:"Prefab",label:"\u5143\u4EF6"}]}),z("imageId","imageId","number",t.imageId??0),z("imageType","\u56FE\u7247\u7C7B\u578B","enum",t.imageType??null,{options:[{value:"Basic",label:"\u57FA\u7840"},{value:"Stretch",label:"\u62C9\u4F38"}]}),z("imageColor","\u586B\u5145\u8272","color",t.imageColor),z("enableMask","\u5F00\u542F\u906E\u7F69","bool",t.enableMask===!0),z("enableSoftEdge","\u8FB9\u7F18\u7FBD\u5316","bool",t.enableSoftEdge===!0,{gia:"W"}),z("softEdgeMode","\u7FBD\u5316\u6A21\u5F0F","enum",t.softEdgeMode,{options:[{value:"Percentage",label:"\u767E\u5206\u6BD4"},{value:"Pixel",label:"\u50CF\u7D20"}]}),z("softEdgeWidthX","\u7FBD\u5316\u5BBD\u5EA6 X","number",t.softEdgeWidthX),z("softEdgeWidthY","\u7FBD\u5316\u5BBD\u5EA6 Y","number",t.softEdgeWidthY),z("horizontalSoftRange","\u6C34\u5E73\u7FBD\u5316\u8303\u56F4","number",t.horizontalSoftRange),z("verticalSoftRange","\u5782\u76F4\u7FBD\u5316\u8303\u56F4","number",t.verticalSoftRange),z("enableFill","\u6309\u8FDB\u5EA6\u586B\u5145","bool",t.enableFill===!0,{gia:"W"}),z("fillType","\u5F62\u72B6","enum",l,{...[1,2,3,4,5].includes(a)?{}:{unknownValue:a},options:[{value:"Horizontal",label:"\u6A2A\u5411"},{value:"Vertical",label:"\u7EB5\u5411"},{value:"Radial90",label:"90\u5EA6\u73AF\u7ED5"},{value:"Radial180",label:"180\u5EA6\u73AF\u7ED5"},{value:"Radial360",label:"360\u5EA6\u73AF\u7ED5"}]}),z("fillHorizontalType","\u65B9\u5411","enum",t.fillHorizontalType,{options:[{value:"Left",label:"\u4ECE\u5DE6\u81F3\u53F3"},{value:"Right",label:"\u4ECE\u53F3\u81F3\u5DE6"}]}),z("fillVerticalType","\u65B9\u5411","enum",t.fillVerticalType,{options:[{value:"Bottom",label:"\u4ECE\u4E0B\u81F3\u4E0A"},{value:"Top",label:"\u4ECE\u4E0A\u81F3\u4E0B"}]}),z("fillRadial90Type","\u8D77\u70B9","enum",t.fillRadial90Type,{options:[{value:"BottomLeft",label:"\u5DE6\u4E0B"},{value:"TopLeft",label:"\u5DE6\u4E0A"},{value:"TopRight",label:"\u53F3\u4E0A"},{value:"BottomRight",label:"\u53F3\u4E0B"}]}),z("fillRadialType","\u8D77\u70B9","enum",t.fillRadialType,{options:[{value:"Bottom",label:"\u4E0B\u65B9"},{value:"Left",label:"\u5DE6\u4FA7"},{value:"Top",label:"\u4E0A\u65B9"},{value:"Right",label:"\u53F3\u4FA7"}]}),z("fillAmount","\u8FDB\u5EA6","percent",t.fillAmount),z("reverseMaskArea","\u906E\u7F69\u533A\u57DF\u53CD\u8F6C","bool",t.reverseMaskArea===!0,{gia:"W"}))}if(t.kind==="button"){let a=[{value:"",label:"\u672A\u8BBE\u7F6E"},...(t.children||[]).map(l=>({value:l.id,label:`${l.name} \xB7 ${l.id}`}))];s.push(z("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",t.raycastTarget!==!1),z("interactable","\u6309\u94AE\u662F\u5426\u53EF\u7528","bool",t.interactable!==!1),z("unavailableChildId","\u4E0D\u53EF\u7528\u72B6\u6001\u8282\u70B9","node",t.unavailableChildId,{options:a,gia:"W"}),z("hoverChildId","\u60AC\u505C\u72B6\u6001\u8282\u70B9","node",t.hoverChildId,{options:a,gia:"W"}),z("pressedChildId","\u6309\u4E0B\u72B6\u6001\u8282\u70B9","node",t.pressedChildId,{options:a,gia:"W"}),z("selectedChildId","\u9009\u4E2D\u72B6\u6001\u8282\u70B9","node",t.selectedChildId,{options:a,gia:"W"}),z("clickAudioId","\u70B9\u51FB\u97F3\u6548","number",t.clickAudioId))}return t.kind==="reference"&&s.push(z("referencedPrefabId","\u5F15\u7528\u63A7\u4EF6\u6A21\u677F\u7D22\u5F15","string",t.referencedPrefabId??"")),(t.kind==="textwindow"||t.kind==="grid")&&s.push(z("interactable","\u5141\u8BB8\u6EDA\u52A8\u4EA4\u4E92","bool",t.interactable!==!1),z("showScrollBar","\u663E\u793A\u6EDA\u52A8\u6761","bool",t.showScrollBar!==!1)),t.kind==="grid"&&s.push(z("itemPrefabId","\u5217\u8868\u9879\u6A21\u677F\u7D22\u5F15","number",t.itemPrefabId??0),z("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",t.raycastTarget!==!1),z("scrollDirection","\u6EDA\u52A8\u65B9\u5411","enum",t.scrollDirection,{options:[{value:"Vertical",label:"\u7EB5\u5411"},{value:"Horizontal",label:"\u6A2A\u5411"}]}),z("layoutConstraint","\u6392\u5217\u9650\u5236","enum",t.layoutConstraint,{options:[{value:"AutoWrap",label:"\u81EA\u52A8\u6362\u884C"},{value:"Fixed",label:"\u56FA\u5B9A\u884C\u5217\u6570"}]}),z("layoutConstraintFixedCount","\u6BCF\u884C\u6216\u6BCF\u5217\u6570\u91CF","number",t.layoutConstraintFixedCount??1),z("cellSizeX","\u5217\u8868\u9879\u5927\u5C0F W","number",t.cellSizeX,{evidence:"W"}),z("cellSizeY","\u5217\u8868\u9879\u5927\u5C0F H","number",t.cellSizeY,{evidence:"W"}),z("spacingX","\u5217\u8868\u9879\u95F4\u9694 X","number",t.spacingX,{evidence:"W"}),z("spacingY","\u5217\u8868\u9879\u95F4\u9694 Y","number",t.spacingY,{evidence:"W"}),z("padding1X","\u8FB9\u8DDD\u5411\u91CF 1 X","number",t.padding1X,{evidence:"W"}),z("padding1Y","\u8FB9\u8DDD\u5411\u91CF 1 Y","number",t.padding1Y,{evidence:"W"}),z("padding2X","\u8FB9\u8DDD\u5411\u91CF 2 X","number",t.padding2X,{evidence:"W"}),z("padding2Y","\u8FB9\u8DDD\u5411\u91CF 2 Y","number",t.padding2Y,{evidence:"W"}),z("previewCount","\u9884\u89C8\u6570\u91CF","number",t.previewCount)),t.kind==="keyhint"&&s.push(z("keyboardKeyCode","\u952E\u9F20\u6309\u952E","number",t.keyboardKeyCode??t.giaRaw?.keyHintField502??1,{gia:"W"}),z("controllerKeyCode","\u624B\u67C4\u6309\u952E","number",t.controllerKeyCode??t.giaRaw?.keyHintField501??1)),(t.kind==="animation"||t.kind==="fullscreen")&&s.push(z("animationId",t.kind==="animation"?"\u52A8\u6548\u7D22\u5F15":"\u5168\u5C4F\u52A8\u6548\u7D22\u5F15","string",t.animationId??"")),(!on.includes(t.kind)||t.kind==="textwindow"||t.kind==="grid")&&s.push(z("incomplete","\u5B8C\u6574\u5EA6","note",t.kind==="textwindow"||t.kind==="grid"?"\u8BD5\u73A9\u652F\u6301\u57FA\u7840\u6EDA\u52A8\uFF1B\u6EDA\u52A8\u4EA4\u4E92\u3001\u6EDA\u52A8\u6761\u53CA\u5217\u8868\u914D\u7F6E\u4EE5 JSON/Lua \u4E3A\u51C6\uFF0C\u76F8\u5173 GIA \u5F00\u5173\u6620\u5C04\u5C1A\u672A\u6838\u5B9E\u3002":"\u672C\u9636\u6BB5\u4EC5\u516C\u5171\u53D8\u6362\uFF0C\u4E1A\u52A1\u69FD\u4E0D\u5B8C\u6574")),{id:t.id,guid:r?.get(t.id)??(t.guid||0),kind:t.kind,label:ji[t.kind]||t.kind,incomplete:!on.includes(t.kind),fields:s}}function cl(t,e,i){let r=(Array.isArray(t)?t:Object.values(t)).filter(n=>n.kind!=="server-container");for(let n=r.length-1;n>=0;n-=1){let o=r[n];if(!o.visible||!o.active)continue;let s=o.renderMatrix&&Hi(o.renderMatrix),a=s&&mt(s,e,i);if(a&&a.x>=o.left&&a.x<=o.right&&a.y>=o.bottom&&a.y<=o.top)return o.id}return null}var gf=yd(pf(),1);function fr(t,e=!1){let i=[],r=(n,o)=>{n.kind!=="server-container"&&i.push({node:n,parent:o});let s=e&&n.kind!=="server-container"?[...n.children||[]].reverse():n.children||[];for(let a of s)r(a,n)};return r(t.root,null),i}var dp=String.raw`
4
+ }`}return Object.defineProperty(n,"toString",{value:r,writable:!0,enumerable:!0,configurable:!0}),n}ea.verbose=!1;function w0(t){return!t||(t=String(t).replace(/[^\w$]/g,""),!t)?"":(/^\d/.test(t)&&(t="_"+t),v0.test(t)?t+"_":t)}});var ta=te((u2,Ic)=>{"use strict";var sn=null;try{sn=Td("fs"),(!sn||!sn.readFile||!sn.readFileSync)&&(sn=null)}catch{}Ic.exports=sn});var Ac=te((d2,Cc)=>{"use strict";Cc.exports=Mn;var S0=Vo(),ia=ta();function Mn(t,e,i){return typeof e=="function"?(i=e,e={}):e||(e={}),i?!e.xhr&&ia&&ia.readFile?ia.readFile(t,function(r,o){return r&&typeof XMLHttpRequest<"u"?Mn.xhr(t,e,i):r?i(r):i(null,e.binary?o:o.toString("utf8"))}):Mn.xhr(t,e,i):S0(Mn,this,t,e)}Mn.xhr=function(e,i,n){var r=new XMLHttpRequest;r.onreadystatechange=function(){if(r.readyState===4){if(r.status!==0&&r.status!==200)return n(Error("status "+r.status));if(i.binary){var a=r.response;if(!a){a=[];for(var s=0;s<r.responseText.length;++s)a.push(r.responseText.charCodeAt(s)&255)}return n(null,typeof Uint8Array<"u"?new Uint8Array(a):a)}return n(null,r.responseText)}},i.binary&&("overrideMimeType"in r&&r.overrideMimeType("text/plain; charset=x-user-defined"),r.responseType="arraybuffer"),r.open("GET",e),r.send()}});var Tc=te(Oc=>{"use strict";var oa=Oc,ra=/^[a-zA-Z][a-zA-Z0-9+.-]+:\/\//;function E0(t){if(typeof URL>"u"||!ra.test(t))return null;try{return new URL(t).href}catch{return null}}function x0(t,e){if(typeof URL>"u"||!ra.test(t)||ra.test(e))return null;try{return new URL(e,t).href}catch{return null}}var kc=oa.isAbsolute=function(e){return/^(?:\/|\w+:|\\\\\w+)/.test(e)},na=oa.normalize=function(e){var i=E0(e);if(i)return i;var n=e.substring(0,2),r="";n==="\\\\"&&(r=n,e=e.substring(2)),e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var o=e.split("/"),a=kc(e),s="";a&&(s=o.shift()+"/");for(var l=0;l<o.length;)o[l]===".."?l>0&&o[l-1]!==".."?o.splice(--l,2):a?o.splice(l,1):++l:o[l]==="."?o.splice(l,1):++l;return r+s+o.join("/")};oa.resolve=function(e,i,n){var r=x0(e,i);return r||(n||(i=na(i)),kc(i)?i:(n||(e=na(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?na(e+"/"+i):i))}});var cn=te((p2,Pc)=>{"use strict";Pc.exports=le;var kr=pi();le.prototype=Object.create(kr.prototype,{constructor:{value:le,writable:!0,enumerable:!1,configurable:!0}});le.className="Namespace";var aa=hi(),di=je(),_0=Mi(),Pi,ln,Fi;le.fromJSON=function(e,i,n){if(n===void 0&&(n=0),n>di.recursionLimit)throw Error("max depth exceeded");return new le(e,i.options).addJSON(i.nested,n)};function Rc(t,e){if(t&&t.length){for(var i={},n=0;n<t.length;++n)i[t[n].name]=t[n].toJSON(e);return i}}le.arrayToJSON=Rc;le.isReservedId=function(e,i){if(e){for(var n=0;n<e.length;++n)if(typeof e[n]!="string"&&e[n][0]<=i&&e[n][1]>=i)return!0}return!1};le.isReservedName=function(e,i){if(e){for(var n=0;n<e.length;++n)if(e[n]===i)return!0}return!1};function le(t,e){kr.call(this,t,e),this.nested=void 0,this._nestedArray=null,this._lookupCache=Object.create(null),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0}function Nc(t){t._nestedArray=null,t._lookupCache=Object.create(null);for(var e=t;e=e.parent;)e._lookupCache=Object.create(null);return t}Object.defineProperty(le.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=di.toArray(this.nested))}});le.prototype.toJSON=function(e){return di.toObject(["options",this.options,"nested",Rc(this.nestedArray,e)])};le.prototype.addJSON=function(e,i){if(i===void 0&&(i=0),i>di.recursionLimit)throw Error("max depth exceeded");var n=this;if(e)for(var r=Object.keys(e),o=0,a;o<r.length;++o)a=e[r[o]],n.add((a.fields!==void 0?Pi.fromJSON:a.values!==void 0?Fi.fromJSON:a.methods!==void 0?ln.fromJSON:a.id!==void 0?aa.fromJSON:le.fromJSON)(r[o],a,i+1));return this};le.prototype.get=function(e){return this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};le.prototype.getEnum=function(e){if(this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)&&this.nested[e]instanceof Fi)return this.nested[e].values;throw Error("no such enum: "+e)};le.prototype.add=function(e){if(!(e instanceof aa&&e.extend!==void 0||e instanceof Pi||e instanceof _0||e instanceof Fi||e instanceof ln||e instanceof le))throw TypeError("object must be a valid nested object");if(e.name==="__proto__")return this;if(!this.nested)this.nested={};else{var i=this.get(e.name);if(i)if(i instanceof le&&e instanceof le&&!(i instanceof Pi||i instanceof ln)){for(var n=i.nestedArray,r=0;r<n.length;++r)e.add(n[r]);this.remove(i),this.nested||(this.nested={}),e.setOptions(i.options,!0)}else throw Error("duplicate name '"+e.name+"' in "+this)}this.nested[e.name]=e,this instanceof Pi||this instanceof ln||this instanceof Fi||this instanceof aa||e._edition||(e._edition=e._defaultEdition),this._needsRecursiveFeatureResolution=!0,this._needsRecursiveResolve=!0;for(var o=this;o=o.parent;)o._needsRecursiveFeatureResolution=!0,o._needsRecursiveResolve=!0;return e.onAdd(this),Nc(this)};le.prototype.remove=function(e){if(!(e instanceof kr))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);if(!di.remove(this.nested,e,e.name))throw Error(e+" is not a member of "+this);return Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),Nc(this)};le.prototype.define=function(e,i){if(di.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&e[0]==="")throw Error("path must be relative");if(e.length>di.recursionLimit)throw Error("max depth exceeded");for(var n=this;e.length>0;){var r=e.shift();if(n.nested&&n.nested[r]){if(n=n.nested[r],!(n instanceof le))throw Error("path conflicts with non-namespace objects")}else n.add(n=new le(r))}return i&&n.addJSON(i),n};le.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;this._needsRecursiveFeatureResolution&&this._resolveFeaturesRecursive(this._edition);var e=this.nestedArray,i=0;for(this.resolve();i<e.length;)e[i]instanceof le?e[i++].resolveAll():e[i++].resolve();return this._needsRecursiveResolve=!1,this};le.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(this._needsRecursiveFeatureResolution=!1,e=this._edition||e,kr.prototype._resolveFeaturesRecursive.call(this,e),this.nestedArray.forEach(i=>{i._resolveFeaturesRecursive(e)}),this):this};le.prototype.lookup=function(e,i,n){if(typeof i=="boolean"?(n=i,i=void 0):i&&!Array.isArray(i)&&(i=[i]),di.isString(e)&&e.length){if(e===".")return this.root;e=e.split(".")}else if(!e.length)return this;var r=e.join(".");if(e[0]==="")return this.root.lookup(e.slice(1),i);var o=this._lookupImpl(e,r);if(o&&(!i||i.indexOf(o.constructor)>-1)||(o=this.root._fullyQualifiedObjects&&this.root._fullyQualifiedObjects["."+r],o&&(!i||i.indexOf(o.constructor)>-1)))return o;if(n)return null;for(var a=this;a.parent;){if(o=a.parent._lookupImpl(e,r),o&&(!i||i.indexOf(o.constructor)>-1))return o;a=a.parent}return null};le.prototype._lookupImpl=function(e,i){if(Object.prototype.hasOwnProperty.call(this._lookupCache,i))return this._lookupCache[i];var n=this.get(e[0]),r=null;if(n)e.length===1?r=n:n instanceof le&&(e=e.slice(1),r=n._lookupImpl(e,e.join(".")));else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof le&&(n=this._nestedArray[o]._lookupImpl(e,i))){r=n;break}return this._lookupCache[i]=r,r};le.prototype.lookupType=function(e){var i=this.lookup(e,[Pi]);if(!i)throw Error("no such type: "+e);return i};le.prototype.lookupEnum=function(e){var i=this.lookup(e,[Fi]);if(!i)throw Error("no such Enum '"+e+"' in "+this);return i};le.prototype.lookupTypeOrEnum=function(e){var i=this.lookup(e,[Pi,Fi]);if(!i)throw Error("no such Type or Enum '"+e+"' in "+this);return i};le.prototype.lookupService=function(e){var i=this.lookup(e,[ln]);if(!i)throw Error("no such Service '"+e+"' in "+this);return i};le._configure=function(t,e,i){Pi=t,ln=e,Fi=i}});var Or=te((m2,Fc)=>{"use strict";Fc.exports=Mt;var sa=hi();Mt.prototype=Object.create(sa.prototype,{constructor:{value:Mt,writable:!0,enumerable:!1,configurable:!0}});Mt.className="MapField";var I0=mi(),fn=je();function Mt(t,e,i,n,r,o){if(sa.call(this,t,e,n,void 0,void 0,r,o),!fn.isString(i))throw TypeError("keyType must be a string");this.keyType=i,this.resolvedKeyType=null,this.map=!0}Mt.fromJSON=function(e,i){var n=new Mt(e,i.id,i.keyType,i.type,i.options,i.comment);return i.protoName&&(n.protoName=i.protoName),i.jsonName!==void 0?n.jsonName=i.jsonName:i.options&&i.options.json_name!==void 0&&(n.jsonName=i.options.json_name),n};Mt.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return fn.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"protoName",this.protoName!==this.name?this.protoName:void 0,"jsonName",this.jsonName!==fn.jsonName(this.protoName||this.name)?this.jsonName:void 0,"options",this.options,"comment",i?this.comment:void 0])};Mt.prototype.resolve=function(){if(this.resolved)return this;if(I0.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return sa.prototype.resolve.call(this)};Mt.d=function(e,i,n){return typeof n=="function"?n=fn.decorateType(n).name:n&&typeof n=="object"&&(n=fn.decorateEnum(n).name),function(o,a){fn.decorateType(o.constructor).add(new Mt(a,e,i,n))}}});var Tr=te((b2,Mc)=>{"use strict";Mc.exports=bi;var la=pi();bi.prototype=Object.create(la.prototype,{constructor:{value:bi,writable:!0,enumerable:!1,configurable:!0}});bi.className="Method";var un=je();function bi(t,e,i,n,r,o,a,s,l){if(un.isObject(r)?(a=r,r=o=void 0):un.isObject(o)&&(a=o,o=void 0),!(e===void 0||un.isString(e)))throw TypeError("type must be a string");if(!un.isString(i))throw TypeError("requestType must be a string");if(!un.isString(n))throw TypeError("responseType must be a string");la.call(this,t,a),this.type=e||"rpc",this.requestType=i,this.requestStream=r?!0:void 0,this.responseType=n,this.responseStream=o?!0:void 0,this.path="/"+this.name,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=s,this.parsedOptions=l}bi.fromJSON=function(e,i){return new bi(e,i.type,i.requestType,i.responseType,i.requestStream,i.responseStream,i.options,i.comment,i.parsedOptions)};bi.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return un.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",i?this.comment:void 0,"parsedOptions",this.parsedOptions])};bi.prototype.resolve=function(){if(this.resolved)return this;if(this.parent){var e=this.parent.fullName;e.charAt(0)==="."&&(e=e.substring(1)),this.path="/"+e+"/"+this.name}else this.path="/"+this.name;return this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),la.prototype.resolve.call(this)}});var Nr=te((g2,$c)=>{"use strict";$c.exports=nt;var Xt=cn();nt.prototype=Object.create(Xt.prototype,{constructor:{value:nt,writable:!0,enumerable:!1,configurable:!0}});nt.className="Service";var ca=Tr(),Rr=je(),zc=Wo();function nt(t,e){Xt.call(this,t,e),this.methods={},this._methodsArray=null}nt.fromJSON=function(e,i,n){if(n===void 0&&(n=0),n>Rr.recursionLimit)throw Error("max depth exceeded");var r=new nt(e,i.options);if(i.methods)for(var o=Object.keys(i.methods),a=0;a<o.length;++a)r.add(ca.fromJSON(o[a],i.methods[o[a]]));return i.nested&&r.addJSON(i.nested,n),i.edition&&(r._edition=i.edition),r.comment=i.comment,r._defaultEdition="proto3",r};nt.prototype.toJSON=function(e){var i=Xt.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return Rr.toObject(["edition",this._editionToJSON(),"options",i&&i.options||void 0,"methods",Xt.arrayToJSON(this.methodsArray,e)||{},"nested",i&&i.nested||void 0,"comment",n?this.comment:void 0])};Object.defineProperty(nt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=Rr.toArray(this.methods))}});function Dc(t){return t._methodsArray=null,t}nt.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.methods,e)?this.methods[e]:Xt.prototype.get.call(this,e)};nt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;Xt.prototype.resolve.call(this);for(var e=this.methodsArray,i=0;i<e.length;++i)e[i].resolve();return this};nt.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,Xt.prototype._resolveFeaturesRecursive.call(this,e),this.methodsArray.forEach(i=>{i._resolveFeaturesRecursive(e)}),this):this};nt.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof ca?e.name==="__proto__"?this:(this.methods[e.name]=e,e.parent=this,Dc(this)):Xt.prototype.add.call(this,e)};nt.prototype.remove=function(e){if(e instanceof ca){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,Dc(this)}return Xt.prototype.remove.call(this,e)};nt.prototype.create=function(e,i,n){for(var r=new zc.Service(e,i,n),o=0,a;o<this.methodsArray.length;++o){var s=Rr.lcFirst((a=this._methodsArray[o]).resolve().name).replace(/[^$\w_]/g,"");r[s]=(function(l,c,f){return function(m,p){return zc.Service.prototype.rpcCall.call(this,l,c,f,m,p)}})(a,a.resolvedRequestType.ctor,a.resolvedResponseType.ctor)}return r}});var Pr=te((y2,Gc)=>{"use strict";Gc.exports=zt;var C0=Pt();function zt(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)t[e[i]]!=null&&e[i]!=="__proto__"&&(this[e[i]]=t[e[i]])}zt.create=function(e){return this.$type.create(e)};zt.encode=function(e,i){return this.$type.encode(e,i)};zt.encodeDelimited=function(e,i){return this.$type.encodeDelimited(e,i)};zt.decode=function(e){return this.$type.decode(e)};zt.decodeDelimited=function(e){return this.$type.decodeDelimited(e)};zt.verify=function(e){return this.$type.verify(e)};zt.fromObject=function(e){return this.$type.fromObject(e)};zt.toObject=function(e,i){return this.$type.toObject(e,i)};zt.prototype.toJSON=function(){return this.$type.toObject(this,C0.toJSONOptions)}});var fa=te((v2,Vc)=>{"use strict";Vc.exports=k0;var Fr=xt(),De=mi(),Mr=je();function A0(t){return"missing required '"+t.name+"'"}function zn(t){return t._features.utf8_validation==="VERIFY"?"stringVerify":"string"}function dn(t,e){return t("if(!r.discardUnknown){")('util.makeProp(m,"$unknowns",false);')("(m.$unknowns||(m.$unknowns=[])).push(%s)",e)("}")}function k0(t){for(var e=!1,i=!1,n=0;n<t.fieldsArray.length;++n){var r=t._fieldsArray[n];r.map&&(e=!0),(r.resolvedType instanceof Fr||!r.repeated&&!r.map&&!r.hasPresence)&&(i=!0)}var o=Mr.codegen(["r","l","z","q","g"])("if(!(r instanceof Reader))")("r=Reader.create(r)")("if(q===undefined)q=0")("if(q>Reader.recursionLimit)")('throw Error("max depth exceeded")')("var c=l===undefined?r.len:r.pos+l,m=g||new C"+(e?",k,v":i?",v":""))("while(r.pos<c){")("var s=r.pos")("var t=r.tag()")("if(t===z){")("z=undefined")("break")("}");for(t.fieldsArray.length&&o("var u=t&7")("switch(t>>>=3){"),n=0;n<t.fieldsArray.length;++n){var a=t._fieldsArray[n].resolve(),s=a.resolvedType instanceof Fr?"int32":a.type,l="m"+Mr.safeProp(a.name),c=a.resolvedType instanceof Fr&&a.resolvedType._features.enum_type==="CLOSED";if(a.map){o("case %i:{",a.id)("if(u!==2)")("break"),c||o("if(%s===util.emptyObject)",l)("%s={}",l),o("var c2=r.uint32()+r.pos"),De.defaults[a.keyType]!==void 0?o("k=%j",De.defaults[a.keyType]):o("k=null"),De.long[s]!==void 0?o("v=util.Long?util.Long.fromNumber(0,%j):0",s==="uint64"||s==="fixed64"):De.defaults[s]!==void 0?o("v=%j",De.defaults[s]):o("v=null"),o("while(r.pos<c2){")("var t2=r.tag()")("u=t2&7")("switch(t2>>>=3){")("case 1:")("if(u!==%i)",De.mapKey[a.keyType])("break")("k=r.%s()",a.keyType==="string"?zn(a):a.keyType)("continue")("case 2:")("if(u!==%i)",De.basic[s]===void 0?2:De.basic[s])("break"),De.basic[s]===void 0?o("v=types[%i].decode(r,r.uint32(),undefined,q+1,v)",n):o("v=r.%s()",s==="string"?zn(a):s),o("continue")("}")("r.skipType(u,q,t2)")("}"),c&&(o("if(types[%i].valuesById[v]===undefined){",n),dn(o,"r.raw(s,r.pos)")("continue")("}")("if(%s===util.emptyObject)",l)("%s={}",l));var f=De.basic[s]===void 0?"v||new types["+n+"].ctor":"v";De.long[a.keyType]!==void 0?o('%s[typeof k==="object"?util.longToHash(k):k]=%s',l,f):(a.keyType==="string"&&o('if(k==="__proto__")')("util.makeProp(%s,k)",l),o("%s[k]=%s",l,f))}else a.repeated?(o("case %i:",a.id)("{"),De.packed[s]!==void 0&&(o("if(u===2){"),c?(o("var c2=r.uint32()+r.pos")("while(r.pos<c2){")("s=r.pos")("v=r.%s()",s)("if(types[%i].valuesById[v]!==undefined){",n)("if(!(%s&&%s.length))",l,l)("%s=[]",l)("%s.push(v)",l)("}else"),dn(o,"util.rawField("+a.id+",0,r.raw(s,r.pos))")("}")):o("if(!(%s&&%s.length))",l,l)("%s=[]",l)("r.%ss(%s)",s,l),o("continue")("}")),o("if(u!==%i)",De.basic[s]===void 0?a.delimited?3:2:De.basic[s])("break"),c||o("if(!(%s&&%s.length))",l,l)("%s=[]",l),De.basic[s]===void 0?a.delimited?o("%s.push(types[%i].decode(r,undefined,%i,q+1))",l,n,a.id*8+4):o("%s.push(types[%i].decode(r,r.uint32(),undefined,q+1))",l,n):c?(o("v=r.%s()",s)("if(types[%i].valuesById[v]!==undefined){",n)("if(!(%s&&%s.length))",l,l)("%s=[]",l)("%s.push(v)",l)("}else"),dn(o,"r.raw(s,r.pos)")):o("%s.push(r.%s())",l,s==="string"?zn(a):s)):De.basic[s]===void 0?(o("case %i:{",a.id)("if(u!==%i)",a.delimited?3:2)("break"),a.delimited?o("%s=types[%i].decode(r,undefined,%i,q+1,%s)",l,n,a.id*8+4,l):o("%s=types[%i].decode(r,r.uint32(),undefined,q+1,%s)",l,n,l)):a.hasPresence?(o("case %i:{",a.id)("if(u!==%i)",De.basic[s])("break"),c?(o("v=r.%s()",s)("if(types[%i].valuesById[v]!==undefined){",n)("%s=v",l),a.partOf&&o("m%s=%j",Mr.safeProp(a.partOf.name),a.name),o("}else"),dn(o,"r.raw(s,r.pos)")):o("%s=r.%s()",l,s==="string"?zn(a):s)):(o("case %i:{",a.id)("if(u!==%i)",De.basic[s])("break"),c?(o("v=r.%s()",s)("if(types[%i].valuesById[v]!==undefined){",n)("if(v!==%j)",a.typeDefault)("%s=v",l)("else")("delete %s",l)("}else{"),dn(o,"r.raw(s,r.pos)")("}")):(a.resolvedType instanceof Fr&&a.typeDefault!==0?o("if((v=r.%s())!==%j)",s,a.typeDefault):s==="string"?o("if((v=r.%s()).length)",zn(a)):s==="bytes"?o("if((v=r.%s()).length)",s):De.long[s]!==void 0?o('if(typeof(v=r.%s())==="object"?v.low||v.high:v!==0)',s):o(s==="double"||s==="float"?"if(!Object.is(v=r.%s(),0))":"if(v=r.%s())",s),o("%s=v",l)("else")("delete %s",l)));a.partOf&&!c&&o("m%s=%j",Mr.safeProp(a.partOf.name),a.name),o("continue")("}")}for(n&&o("}"),o("r.skipType(%s,q,t)",n?"u":"t&7"),dn(o,"r.raw(s,r.pos)")("}")("if(z!==undefined)")('throw Error("missing end group")'),n=0;n<t._fieldsArray.length;++n){var h=t._fieldsArray[n];h.required&&o("if(!Object.hasOwnProperty.call(m,%j))",h.name)("throw util.ProtocolError(%j,{instance:m})",A0(h))}return o("return m")}});var ha=te((w2,Bc)=>{"use strict";Bc.exports=R0;var O0=xt(),ua=je();function lt(t,e){return t.name+": "+e+(t.repeated&&e!=="array"?"[]":t.map&&e!=="object"?"{k:"+t.keyType+"}":"")+" expected"}function da(t,e,i,n){var r=e.resolvedType;if(r)if(r instanceof O0)if(r._features.enum_type==="CLOSED"){t("switch(%s){",n)("default:")("return%j",lt(e,"enum value"));for(var o=Object.keys(r.values),a=0;a<o.length;++a)t("case %i:",r.values[o[a]]);t("break")("}")}else t('if(typeof %s!=="number"||(%s|0)!==%s)',n,n,n)("return%j",lt(e,"enum value"));else t("{")("var e=types[%i].verify(%s,q+1);",i,n)("if(e)")("return%j+e",e.name+".")("}");else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.isInteger(%s))",n)("return%j",lt(e,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",lt(e,"integer|Long"));break;case"float":case"double":t('if(typeof %s!=="number")',n)("return%j",lt(e,"number"));break;case"bool":t('if(typeof %s!=="boolean")',n)("return%j",lt(e,"boolean"));break;case"string":t("if(!util.isString(%s))",n)("return%j",lt(e,"string"));break;case"bytes":t('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",lt(e,"buffer"));break}return t}function T0(t,e,i){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":t("if(!util.key32Re.test(%s))",i)("return%j",lt(e,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":t("if(!util.key64Re.test(%s))",i)("return%j",lt(e,"integer|Long key"));break;case"bool":t("if(!util.key2Re.test(%s))",i)("return%j",lt(e,"boolean key"));break}return t}function R0(t){var e=ua.codegen(["m","q"])('if(typeof m!=="object"||m===null)')("return%j","object expected")("if(q===undefined)q=0")("if(q>util.recursionLimit)")("return%j","max depth exceeded"),i=t.oneofsArray,n={};i.length&&e("var p={}");for(var r=0;r<t.fieldsArray.length;++r){var o=t._fieldsArray[r].resolve(),a="m"+ua.safeProp(o.name);if(o.optional&&e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",a,o.name),o.map)e("if(!util.isObject(%s))",a)("return%j",lt(o,"object"))("var k=Object.keys(%s)",a)("for(var i=0;i<k.length;++i){"),T0(e,o,"k[i]"),da(e,o,r,a+"[k[i]]")("}");else if(o.repeated)e("if(!Array.isArray(%s))",a)("return%j",lt(o,"array"))("for(var i=0;i<%s.length;++i){",a),da(e,o,r,a+"[i]")("}");else{if(o.partOf){var s=ua.safeProp(o.partOf.name);n[o.partOf.name]===1&&e("if(p%s===1)",s)("return%j",o.partOf.name+": multiple values"),n[o.partOf.name]=1,e("p%s=1",s)}da(e,o,r,a)}o.optional&&e("}")}return e("return null")}});var ga=te(Lc=>{"use strict";var qc=Lc,Kt=xt(),ba=mi(),_t=je();function pa(t,e,i,n,r){if(e.resolvedType)if(e.resolvedType instanceof Kt){var o=r?"m"+r+"[m"+r+".length]":"m"+n;t("switch(d%s){",n);for(var a=e.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)t("case%j:",s[l])("case %i:",a[s[l]])("%s=%j",o,a[s[l]])("break");t("default:"),e.resolvedType._features.enum_type!=="CLOSED"&&t('if(typeof d%s==="number"&&(d%s|0)===d%s)',n,n,n)("%s=d%s",o,n),t("}")}else t("if(!util.isObject(d%s))",n)("throw TypeError(%j)",e.fullName+": object expected")("m%s=types[%i].fromObject(d%s,q+1)",n,i,n);else{var c=!1;switch(e.type){case"double":case"float":t("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":t("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":t("m%s=d%s|0",n,n);break;case"uint64":case"fixed64":c=!0;case"int64":case"sint64":case"sfixed64":t("if(util.Long)")("m%s=util.Long.fromValue(d%s,%j)",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":t('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length>=0)",n)("m%s=d%s",n,n);break;case"string":t("m%s=String(d%s)",n,n);break;case"bool":t("m%s=Boolean(d%s)",n,n);break}}return t}qc.fromObject=function(e){var i=e.fieldsArray,n=_t.codegen(["d","q"])("if(d instanceof C)")("return d")("if(!util.isObject(d))")("throw TypeError(%j)",e.fullName+": object expected")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")');if(!i.length)return n("return new C");n("var m=new C");for(var r=0;r<i.length;++r){var o=i[r].resolve(),a=_t.safeProp(o.name),s=!o.hasPresence&&!o.repeated&&!o.map&&(o.resolvedType instanceof Kt||ba.basic[o.type]!==void 0);o.map?(n("if(d%s){",a)("if(!util.isObject(d%s))",a)("throw TypeError(%j)",o.fullName+": object expected")("m%s={}",a)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",a),n('if(ks[i]==="__proto__")')("util.makeProp(m%s,ks[i])",a),pa(n,o,r,a+"[ks[i]]")("}")("}")):o.repeated?(n("if(d%s){",a)("if(!Array.isArray(d%s))",a)("throw TypeError(%j)",o.fullName+": array expected"),o.resolvedType instanceof Kt?n("m%s=[]",a):n("m%s=Array(d%s.length)",a,a),n("for(var i=0;i<d%s.length;++i){",a),pa(n,o,r,a+"[i]",o.resolvedType instanceof Kt?a:void 0)("}")("}")):(o.resolvedType instanceof Kt||n("if(d%s!=null){",a),s&&(o.resolvedType instanceof Kt?n('if(d%s!==%j&&(typeof d%s!=="string"||types[%i].values[d%s]!==%j)){',a,o.typeDefault,a,r,a,o.typeDefault):o.type==="string"?n('if(typeof d%s!=="string"||d%s.length){',a,a):o.type==="bytes"?n("if(d%s.length){",a):o.type==="bool"?n("if(d%s){",a):o.type==="double"||o.type==="float"?n("if(!Object.is(Number(d%s),0)){",a):ba.long[o.type]!==void 0?n('if(typeof d%s==="object"?d%s.low||d%s.high:Number(d%s)!==0){',a,a,a,a):n("if(Number(d%s)!==0){",a)),pa(n,o,r,a),s&&n("}"),o.resolvedType instanceof Kt||n("}"))}return n("return m")};function ma(t,e,i,n,r){if(r||(r=n),e.resolvedType)e.resolvedType instanceof Kt?t("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,i,r,r,i,r,r):t("d%s=types[%i].toObject(m%s,o,q+1)",n,i,r);else{var o=!1;switch(e.type){case"double":case"float":t("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,r,r,r);break;case"uint64":case"fixed64":o=!0;case"int64":case"sint64":case"sfixed64":t('if(typeof BigInt!=="undefined"&&o.longs===BigInt)')('d%s=typeof m%s==="number"?BigInt(m%s):util.Long.fromBits(m%s.low>>>0,m%s.high>>>0,%j).toBigInt()',n,r,r,r,r,o)('else if(typeof m%s==="number")',r)("d%s=o.longs===String?String(m%s):m%s",n,r,r)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,r,r,r,o?"true":"",r);break;case"bytes":t("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,r,r,r,r);break;default:t("d%s=m%s",n,r);break}}return t}qc.toObject=function(e){var i=e.fieldsArray.slice().sort(_t.compareFieldsById);if(!i.length)return _t.codegen()("return {}");for(var n=_t.codegen(["m","o","q"])("if(!o)")("o={}")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")')("var d={}"),r=[],o=[],a=[],s=0;s<i.length;++s)i[s].partOf||(i[s].resolve().repeated?r:i[s].map?o:a).push(i[s]);if(r.length){for(n("if(o.arrays||o.defaults){"),s=0;s<r.length;++s)n("d%s=[]",_t.safeProp(r[s].name));n("}")}if(o.length){for(n("if(o.objects||o.defaults){"),s=0;s<o.length;++s)n("d%s={}",_t.safeProp(o[s].name));n("}")}if(a.length){for(n("if(o.defaults){"),s=0;s<a.length;++s){var l=a[s],c=_t.safeProp(l.name);if(l.resolvedType instanceof Kt)n("d%s=o.enums===String?%j:%j",c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)('d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():typeof BigInt!=="undefined"&&o.longs===BigInt?n.toBigInt():n',c)("}else")('d%s=o.longs===String?%j:typeof BigInt!=="undefined"&&o.longs===BigInt?BigInt(%j):%i',c,l.typeDefault.toString(),l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var f=Array.prototype.slice.call(l.typeDefault);n("if(o.bytes===String)d%s=%j",c,_t.base64.encode(l.typeDefault,0,l.typeDefault.length))("else{")("d%s=%j",c,f)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")}else(l.type==="double"||l.type==="float")&&typeof l.typeDefault=="number"&&(!isFinite(l.typeDefault)||Object.is(l.typeDefault,-0))?n("d%s=%f",c,l.typeDefault)("if(o.json&&!isFinite(d%s))d%s=String(d%s)",c,c,c):n("d%s=%j",c,l.typeDefault)}n("}")}var h=!1;for(s=0;s<i.length;++s){var l=i[s],m=e._fieldsArray.indexOf(l),c=_t.safeProp(l.name);if(l.map){h||(h=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c);var p=ba.long[l.keyType]!==void 0,b=c+"[ks2[j]]";n("for(var j=0;j<ks2.length;++j){"),p&&n("var k2=util.longFromKey(ks2[j],%j).toString()",l.keyType==="uint64"||l.keyType==="fixed64"),n('if(ks2[j]==="__proto__")')("util.makeProp(d%s,ks2[j])",c),ma(n,l,m,p?c+"[k2]":b,b)("}")}else l.repeated?(n("if(m%s&&m%s.length){",c,c)("d%s=Array(m%s.length)",c,c)("for(var j=0;j<m%s.length;++j){",c),ma(n,l,m,c+"[j]")("}")):(n("if(m%s!=null&&Object.hasOwnProperty.call(m,%j)){",c,l.name),ma(n,l,m,c),l.partOf&&!l.partOf.isProto3Optional&&n("if(o.oneofs)")("d%s=%j",_t.safeProp(l.partOf.name),l.name));n("}")}return n("return d")}});var ya=te(jc=>{"use strict";var N0=jc,P0=Pr(),F0=Pt();N0[".google.protobuf.Any"]={fromObject:function(t,e){if(t&&t["@type"]){var i=t["@type"].substring(t["@type"].lastIndexOf("/")+1),n=this.lookup(i,[this.constructor]);if(n){var r=t["@type"].charAt(0)==="."?t["@type"].slice(1):t["@type"];return r.indexOf("/")===-1&&(r="/"+r),this.create({type_url:r,value:n.encode(n.fromObject(t,e===void 0?1:e+1)).finish()})}}return this.fromObject(t,e)},toObject:function(t,e,i){if(i===void 0&&(i=0),i>F0.recursionLimit)throw Error("max depth exceeded");var n="type.googleapis.com/",r="",o="";if(e&&e.json&&t.type_url&&t.value){o=t.type_url.substring(t.type_url.lastIndexOf("/")+1),r=t.type_url.substring(0,t.type_url.lastIndexOf("/")+1);var a=this.lookup(o,[this.constructor]);a&&(t=a.decode(t.value,void 0,void 0,i+1))}if(!(t instanceof this.ctor)&&t instanceof P0){var s=t.$type.toObject(t,e,i+1),l=t.$type.fullName[0]==="."?t.$type.fullName.slice(1):t.$type.fullName;return r===""&&(r=n),o=r+l,s["@type"]=o,s}return this.toObject(t,e,i)}}});var $r=te((x2,Hc)=>{"use strict";Hc.exports=he;var pt=cn();he.prototype=Object.create(pt.prototype,{constructor:{value:he,writable:!0,enumerable:!1,configurable:!0}});he.className="Type";var M0=xt(),Sa=Mi(),zr=hi(),z0=Or(),D0=Nr(),va=Pr(),wa=Ar(),Yc=Ir(),$e=je(),$0=Ea(),G0=fa(),V0=ha(),Uc=ga(),B0=ya();function he(t,e){t=t.replace(/\W/g,""),pt.call(this,t,e),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null,this._fieldsByJsonName=null}Object.defineProperties(he.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var t=Object.keys(this.fields),e=0;e<t.length;++e){var i=this.fields[t[e]],n=i.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=i}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=$e.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=$e.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=he.generateConstructor(this)())},set:function(t){var e=t.prototype;e instanceof va||(t.prototype=new va,Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),$e.merge(t.prototype,e)),t.$type=t.prototype.$type=this,$e.merge(t,va,!0),this._ctor=t,delete this.decode,delete this.fromObject;for(var i=0,n;i<this.fieldsArray.length;++i)n=this._fieldsArray[i].resolve(),t.prototype[n.name]=n.defaultValue;var r={};for(i=0;i<this.oneofsArray.length;++i)r[this._oneofsArray[i].resolve().name]={get:$e.oneOfGetter(this._oneofsArray[i].oneof),set:$e.oneOfSetter(this._oneofsArray[i].oneof)};i&&Object.defineProperties(t.prototype,r)}}});he.generateConstructor=function(e){for(var i=$e.codegen(["p"]),n=0,r;n<e.fieldsArray.length;++n)(r=e._fieldsArray[n]).map?i("this%s={}",$e.safeProp(r.name)):r.repeated&&i("this%s=[]",$e.safeProp(r.name));return i('if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null&&ks[i]!=="__proto__")')("this[ks[i]]=p[ks[i]]")};function Dr(t){return t._fieldsById=t._fieldsArray=t._oneofsArray=t._fieldsByJsonName=null,delete t.encode,delete t.decode,delete t.verify,t}he.fromJSON=function(e,i,n){if(n===void 0&&(n=0),n>$e.nestingLimit)throw Error("max depth exceeded");var r=new he(e,i.options);r.extensions=i.extensions,r.reserved=i.reserved;for(var o=Object.keys(i.fields),a=0;a<o.length;++a)r.add((typeof i.fields[o[a]].keyType<"u"?z0.fromJSON:zr.fromJSON)(o[a],i.fields[o[a]]));if(i.oneofs)for(o=Object.keys(i.oneofs),a=0;a<o.length;++a)r.add(Sa.fromJSON(o[a],i.oneofs[o[a]]));if(i.nested)for(o=Object.keys(i.nested),a=0;a<o.length;++a){var s=i.nested[o[a]];r.add((s.id!==void 0?zr.fromJSON:s.fields!==void 0?he.fromJSON:s.values!==void 0?M0.fromJSON:s.methods!==void 0?D0.fromJSON:pt.fromJSON)(o[a],s,n+1))}return i.extensions&&i.extensions.length&&(r.extensions=i.extensions),i.reserved&&i.reserved.length&&(r.reserved=i.reserved),i.group&&(r.group=!0),i.comment&&(r.comment=i.comment),i.edition&&(r._edition=i.edition),r._defaultEdition="proto3",r};he.prototype.toJSON=function(e){var i=pt.prototype.toJSON.call(this,e),n=e?!!e.keepComments:!1;return $e.toObject(["edition",this._editionToJSON(),"options",i&&i.options||void 0,"oneofs",pt.arrayToJSON(this.oneofsArray,e),"fields",pt.arrayToJSON(this.fieldsArray.filter(function(r){return!r.declaringField}),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",i&&i.nested||void 0,"comment",n?this.comment:void 0])};he.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;pt.prototype.resolveAll.call(this);var e=this.oneofsArray;for(n=0;n<e.length;)e[n++].resolve();for(var i=this.fieldsArray,n=0;n<i.length;)i[n++].resolve();return this};he.prototype._resolveFeaturesRecursive=function(e){return this._needsRecursiveFeatureResolution?(e=this._edition||e,pt.prototype._resolveFeaturesRecursive.call(this,e),this.oneofsArray.forEach(i=>{i._resolveFeatures(e)}),this.fieldsArray.forEach(i=>{i._resolveFeatures(e)}),this):this};he.prototype.get=function(e){return Object.prototype.hasOwnProperty.call(this.fields,e)?this.fields[e]:this.oneofs&&Object.prototype.hasOwnProperty.call(this.oneofs,e)?this.oneofs[e]:this.nested&&Object.prototype.hasOwnProperty.call(this.nested,e)?this.nested[e]:null};he.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof zr&&e.extend===void 0){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name)||e.name.charAt(0)==="$")throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),Dr(this))}if(e instanceof Sa){if(e.name.charAt(0)==="$")throw Error("name '"+e.name+"' is reserved in "+this);return e.name==="__proto__"?this:(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),Dr(this))}return pt.prototype.add.call(this,e)};he.prototype.remove=function(e){if(e instanceof zr&&e.extend===void 0){if(!$e.remove(this.fields,e,e.name))throw Error(e+" is not a member of "+this);return e.parent=null,e.onRemove(this),Dr(this)}if(e instanceof Sa){if(!$e.remove(this.oneofs,e,e.name))throw Error(e+" is not a member of "+this);return e.parent=null,e.onRemove(this),Dr(this)}return pt.prototype.remove.call(this,e)};he.prototype.isReservedId=function(e){return pt.isReservedId(this.reserved,e)};he.prototype.isReservedName=function(e){return pt.isReservedName(this.reserved,e)};he.prototype.create=function(e){return new this.ctor(e)};he.prototype.setup=function(){var e=this.root;if(e&&e._needsRecursiveFeatureResolution){var i=e._edition||this._edition;i&&e._resolveFeaturesRecursive(i)}for(var n=this.fullName,r=[],o=0;o<this.fieldsArray.length;++o)r.push(this._fieldsArray[o].resolve().resolvedType);this.encode=$0(this)({Writer:Yc,types:r,util:$e}),this.decode=G0(this)({Reader:wa,types:r,util:$e,C:this.ctor}),this.verify=V0(this)({types:r,util:$e}),this.fromObject=Uc.fromObject(this)({types:r,util:$e,C:this.ctor}),this.toObject=Uc.toObject(this)({types:r,util:$e});var a=B0[n];if(a){var s=Object.create(this);s._ctor=this.ctor,s.fromObject=this.fromObject,this.fromObject=a.fromObject.bind(s),s.toObject=this.toObject,this.toObject=a.toObject.bind(s)}return this};he.prototype.encode=function(e,i){return this.setup().encode.apply(this,arguments)};he.prototype.encodeDelimited=function(e,i){return this.encode(e,(i||Yc.create()).fork()).ldelim()};he.prototype.decode=function(e,i){return this.setup().decode.apply(this,arguments)};he.prototype.decodeDelimited=function(e){return e instanceof wa||(e=wa.create(e)),this.decode(e,e.uint32())};he.prototype.verify=function(e){return this.setup().verify.apply(this,arguments)};he.prototype.fromObject=function(e){return this.setup().fromObject.apply(this,arguments)};he.prototype.toObject=function(e,i){return this.setup().toObject.apply(this,arguments)};he.prototype.getTypeUrl=function(e){e===void 0&&(e="type.googleapis.com");var i=this.fullName;return e+"/"+(i.charAt(0)==="."?i.substring(1):i)};he.d=function(e){return function(n){$e.decorateType(n,e)}}});var qr=te((_2,Wc)=>{"use strict";Wc.exports=rt;var Br=cn();rt.prototype=Object.create(Br.prototype,{constructor:{value:rt,writable:!0,enumerable:!1,configurable:!0}});rt.className="Root";var Gr=hi(),xa=xt(),q0=Mi(),Dt=je(),_a,Ia,hn;function rt(t){Br.call(this,"",t),this.deferred=[],this.files=[],this._edition="proto2",this._fullyQualifiedObjects={}}rt.fromJSON=function(e,i,n){if(n===void 0&&(n=0),n>Dt.recursionLimit)throw Error("max depth exceeded");return i||(i=new rt),e.options&&i.setOptions(e.options),i.addJSON(e.nested,n).resolveAll()};rt.prototype.resolvePath=Dt.path.resolve;rt.prototype.fetch=Dt.fetch;function Kc(){}rt.prototype.load=function t(e,i,n){typeof i=="function"&&(n=i,i=void 0);var r=this;if(!n)return Dt.asPromise(t,r,e,i);var o=n===Kc;function a(p,b){if(n){if(o)throw p;b&&b.resolveAll();var g=n;n=null,g(p,b)}}function s(p){var b=p.lastIndexOf("google/protobuf/");if(b>-1){var g=p.substring(b);if(Object.prototype.hasOwnProperty.call(hn,g))return g}return Object.prototype.hasOwnProperty.call(hn,p)?p:null}function l(p,b,g){g===void 0&&(g=0);try{if(g>Dt.recursionLimit)throw Error("max depth exceeded");if(Dt.isString(b)&&b.charAt(0)==="{"&&(b=JSON.parse(b)),!Dt.isString(b))r.setOptions(b.options).addJSON(b.nested);else{Ia.filename=p;var w=Ia(b,r,i),S,_=0;if(w.imports)for(;_<w.imports.length;++_)(S=s(w.imports[_])||r.resolvePath(p,w.imports[_]))&&c(S,!1,g+1);if(w.weakImports)for(_=0;_<w.weakImports.length;++_)(S=s(w.weakImports[_])||r.resolvePath(p,w.weakImports[_]))&&c(S,!0,g+1)}}catch(G){a(G)}!o&&!f&&a(null,r)}function c(p,b,g){if(g===void 0&&(g=0),p=s(p)||p,!(r.files.indexOf(p)>-1)){if(r.files.push(p),Object.prototype.hasOwnProperty.call(hn,p)){o?l(p,hn[p],g):(++f,setTimeout(function(){--f,l(p,hn[p],g)}));return}if(o){var w;try{w=Dt.fs.readFileSync(p).toString("utf8")}catch(S){b||a(S);return}l(p,w,g)}else++f,r.fetch(p,function(S,_){if(--f,!!n){if(S){b?f||a(null,r):a(S);return}l(p,_,g)}})}}var f=0;Dt.isString(e)&&(e=[e]);for(var h=0,m;h<e.length;++h)(m=r.resolvePath("",e[h]))&&c(m);return o?(r.resolveAll(),r):(f||a(null,r),r)};rt.prototype.loadSync=function(e,i){if(!Dt.isNode)throw Error("not supported");return this.load(e,i,Kc)};rt.prototype.resolveAll=function(){if(!this._needsRecursiveResolve)return this;if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(e){return"'extend "+e.extend+"' in "+e.parent.fullName}).join(", "));return Br.prototype.resolveAll.call(this)};var Vr=/^[A-Z]/;function Xc(t,e){var i=e.parent.lookup(e.extend);if(i){var n=new Gr(e.fullName,e.id,e.type,e.rule,void 0,e.options);return i.get(n.name)||(n.declaringField=e,e.extensionField=n,i.add(n)),!0}return!1}rt.prototype._handleAdd=function(e){if(e instanceof Gr)e.extend!==void 0&&!e.extensionField&&(Xc(this,e)||this.deferred.push(e));else if(e instanceof xa)Vr.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof q0)){if(e instanceof _a)for(var i=0;i<this.deferred.length;)Xc(this,this.deferred[i])?this.deferred.splice(i,1):++i;for(var n=0;n<e.nestedArray.length;++n)this._handleAdd(e._nestedArray[n]);Vr.test(e.name)&&(e.parent[e.name]=e)}(e instanceof _a||e instanceof xa||e instanceof Gr)&&(this._fullyQualifiedObjects[e.fullName]=e)};rt.prototype._handleRemove=function(e){if(e instanceof Gr){if(e.extend!==void 0)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var i=this.deferred.indexOf(e);i>-1&&this.deferred.splice(i,1)}}else if(e instanceof xa)Vr.test(e.name)&&delete e.parent[e.name];else if(e instanceof Br){for(var n=0;n<e.nestedArray.length;++n)this._handleRemove(e._nestedArray[n]);Vr.test(e.name)&&delete e.parent[e.name]}delete this._fullyQualifiedObjects[e.fullName]};rt._configure=function(t,e,i){_a=t,Ia=e,hn=i}});var je=te((I2,Qc)=>{"use strict";var Ie=Qc.exports=Pt(),Jc=Jo(),Ca,Aa;Ie.codegen=_c();Ie.fetch=Ac();Ie.path=Tc();Ie.patterns=Qo();var Zc=Ie.patterns.reservedRe;Ie.fs=ta();Ie.toArray=function(e){if(e){for(var i=Object.keys(e),n=new Array(i.length),r=0;r<i.length;)n[r]=e[i[r++]];return n}return[]};Ie.toObject=function(e){for(var i={},n=0;n<e.length;){var r=e[n++],o=e[n++];o!==void 0&&(i[r]=o)}return i};Ie.remove=function(e,i,n){if(!e)return!1;if(n!==void 0&&Object.prototype.hasOwnProperty.call(e,n)&&e[n]===i)return delete e[n],!0;for(var r=Object.keys(e),o=0;o<r.length;++o)if(e[r[o]]===i)return delete e[r[o]],!0;return!1};Ie.isReserved=function(e){return Zc.test(e)};Ie.safeProp=function(e){return!/^[$\w_]+$/.test(e)||Zc.test(e)?"["+JSON.stringify(e)+"]":"."+e};Ie.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var L0=/_([a-z])/g;Ie.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(L0,function(i,n){return n.toUpperCase()})};Ie.jsonName=function(e){for(var i="",n=!1,r=0;r<e.length;++r){var o=e.charAt(r);o==="_"?n=!0:n?(i+=o.toUpperCase(),n=!1):i+=o}return i};Ie.compareFieldsById=function(e,i){return e.id-i.id};Ie.decorateType=function(e,i){if(e.$type)return i&&e.$type.name!==i&&(Ie.decorateRoot.remove(e.$type),e.$type.name=i,Ie.decorateRoot.add(e.$type)),e.$type;Ca||(Ca=$r());var n=new Ca(i||e.name);return Ie.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var j0=0;Ie.decorateEnum=function(e){if(e.$type)return e.$type;Aa||(Aa=xt());var i=new Aa("Enum"+j0++,e);return Ie.decorateRoot.add(i),Object.defineProperty(e,"$type",{value:i,enumerable:!1}),i};Ie.setProperty=function(e,i,n,r){function o(a,s,l){var c=s.shift();if(Ie.isUnsafeProperty(c))return a;if(s.length>0)a[c]=o(a[c]||{},s,l);else{var f=a[c];if(f&&r)return a;f&&(l=[].concat(f).concat(l)),a[c]=l}return a}if(typeof e!="object")throw TypeError("dst must be an object");if(!i)throw TypeError("path must be specified");if(i=i.split("."),i.length>Ie.recursionLimit)throw Error("max depth exceeded");return o(e,i,n)};Object.defineProperty(Ie,"decorateRoot",{get:function(){return Jc.decorated||(Jc.decorated=new(qr()))}})});var mi=te(ef=>{"use strict";var Dn=ef,U0=je(),Y0=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function $n(t,e){var i=0,n=Object.create(null);for(e|=0;i<t.length;)n[Y0[i+e]]=t[i++];return n}Dn.basic=$n([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);Dn.defaults=$n([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",U0.emptyArray,null]);Dn.long=$n([0,0,0,1,1],7);Dn.mapKey=$n([0,0,0,5,5,0,0,0,1,1,0,2],2);Dn.packed=$n([1,5,0,0,0,5,5,0,0,0,1,1,0])});var hi=te((A2,nf)=>{"use strict";nf.exports=Ge;var Vn=pi();Ge.prototype=Object.create(Vn.prototype,{constructor:{value:Ge,writable:!0,enumerable:!1,configurable:!0}});Ge.className="Field";var tf=xt(),Lr=mi(),Te=je(),Gn,H0=/^(?:required|optional|repeated)$/;Ge.fromJSON=function(e,i){var n=new Ge(e,i.id,i.type,i.rule,i.extend,i.options,i.comment);return i.edition&&(n._edition=i.edition),i.protoName&&(n.protoName=i.protoName),i.jsonName!==void 0?n.jsonName=i.jsonName:i.options&&i.options.json_name!==void 0&&(n.jsonName=i.options.json_name),n._defaultEdition="proto3",n};function Ge(t,e,i,n,r,o,a){if(Te.isObject(n)?(a=r,o=n,n=r=void 0):Te.isObject(r)&&(a=o,o=r,r=void 0),Vn.call(this,t,o),!Te.isInteger(e)||e<0)throw TypeError("id must be a non-negative integer");if(!Te.isString(i))throw TypeError("type must be a string");if(n!==void 0&&!H0.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(r!==void 0&&!Te.isString(r))throw TypeError("extend must be a string");this.rule=n&&n!=="optional"?n:void 0,this.type=i,this.id=e,this.extend=r||void 0,this.repeated=n==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Te.Long?Lr.long[i]!==void 0:!1,this.bytes=i==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this.comment=a,this.protoName=void 0,this.jsonName=void 0}Object.defineProperty(Ge.prototype,"required",{get:function(){return this._features.field_presence==="LEGACY_REQUIRED"}});Object.defineProperty(Ge.prototype,"optional",{get:function(){return!this.required}});Object.defineProperty(Ge.prototype,"delimited",{get:function(){return this.resolvedType instanceof Gn&&this._features.message_encoding==="DELIMITED"}});Object.defineProperty(Ge.prototype,"packed",{get:function(){return this._features.repeated_field_encoding==="PACKED"}});Object.defineProperty(Ge.prototype,"hasPresence",{get:function(){return this.repeated||this.map?!1:this.partOf||this.declaringField||this.extensionField||this._features.field_presence!=="IMPLICIT"}});Ge.prototype.setOption=function(e,i,n){return Vn.prototype.setOption.call(this,e,i,n)};Ge.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return Te.toObject(["edition",this._editionToJSON(),"rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"protoName",this.protoName!==this.name?this.protoName:void 0,"jsonName",this.jsonName!==Te.jsonName(this.protoName||this.name)?this.jsonName:void 0,"options",this.options,"comment",i?this.comment:void 0])};Ge.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=Lr.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof Gn?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof tf&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof tf)&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long){var e=this.type==="uint64"||this.type==="fixed64";this.typeDefault=typeof this.typeDefault=="string"?Te.Long.fromString(this.typeDefault,e):Te.Long.fromNumber(this.typeDefault,e),Object.freeze&&Object.freeze(this.typeDefault)}else if(Lr.long[this.type]!==void 0&&typeof this.typeDefault=="string")this.typeDefault=parseInt(this.typeDefault,10);else if(this.bytes&&typeof this.typeDefault=="string"){var i;Te.base64.test(this.typeDefault)?Te.base64.decode(this.typeDefault,i=Te.newBuffer(Te.base64.length(this.typeDefault)),0):Te.utf8.write(this.typeDefault,i=Te.newBuffer(Te.utf8.length(this.typeDefault)),0),this.typeDefault=i}return this.map?this.defaultValue=Te.emptyObject:this.repeated?this.defaultValue=Te.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof Gn&&this.parent._ctor&&(this.parent._ctor.prototype[this.name]=this.defaultValue),this.protoName===void 0&&(this.protoName=this.name),this.jsonName===void 0&&(this.jsonName=Te.jsonName(this.protoName)),Vn.prototype.resolve.call(this)};Ge.prototype._inferLegacyProtoFeatures=function(e){if(e!=="proto2"&&e!=="proto3")return{};var i={};if(this.rule==="required"&&(i.field_presence="LEGACY_REQUIRED"),this.parent&&Lr.defaults[this.type]===void 0){var n=this.parent.get(this.type.split(".").pop());n&&n instanceof Gn&&n.group&&(i.message_encoding="DELIMITED")}return this.getOption("packed")===!0?i.repeated_field_encoding="PACKED":this.getOption("packed")===!1&&(i.repeated_field_encoding="EXPANDED"),i};Ge.prototype._resolveFeatures=function(e){return Vn.prototype._resolveFeatures.call(this,this._edition||e)};Ge.d=function(e,i,n,r){return typeof i=="function"?i=Te.decorateType(i).name:i&&typeof i=="object"&&(i=Te.decorateEnum(i).name),function(a,s){Te.decorateType(a.constructor).add(new Ge(s,e,i,n,{default:r}))}};Ge._configure=function(e){Gn=e}});var Mi=te((k2,af)=>{"use strict";af.exports=ot;var Ur=pi();ot.prototype=Object.create(Ur.prototype,{constructor:{value:ot,writable:!0,enumerable:!1,configurable:!0}});ot.className="OneOf";var rf=hi(),jr=je();function ot(t,e,i,n){if(Array.isArray(e)||(i=e,e=void 0),Ur.call(this,t,i),!(e===void 0||Array.isArray(e)))throw TypeError("fieldNames must be an Array");this.oneof=e||[],this.fieldsArray=[],this.comment=n}ot.fromJSON=function(e,i){return new ot(e,i.oneof,i.options,i.comment)};ot.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return jr.toObject(["options",this.options,"oneof",this.oneof,"comment",i?this.comment:void 0])};function of(t){if(t.parent)for(var e=0;e<t.fieldsArray.length;++e)t.fieldsArray[e].parent||t.parent.add(t.fieldsArray[e])}ot.prototype.add=function(e){if(!(e instanceof rf))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,of(this),this};ot.prototype.remove=function(e){if(!(e instanceof rf))throw TypeError("field must be a Field");var i=this.fieldsArray.indexOf(e);if(i<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(i,1),i=this.oneof.indexOf(e.name),i>-1&&this.oneof.splice(i,1),e.partOf=null,this};ot.prototype.onAdd=function(e){Ur.prototype.onAdd.call(this,e);for(var i=this,n=0;n<this.oneof.length;++n){var r=e.get(this.oneof[n]);r&&!r.partOf&&(r.partOf=i,i.fieldsArray.push(r))}of(this)};ot.prototype.onRemove=function(e){for(var i=0,n;i<this.fieldsArray.length;++i)(n=this.fieldsArray[i]).parent&&n.parent.remove(n);Ur.prototype.onRemove.call(this,e)};Object.defineProperty(ot.prototype,"isProto3Optional",{get:function(){if(this.fieldsArray==null||this.fieldsArray.length!==1)return!1;var t=this.fieldsArray[0];return t.options!=null&&t.options.proto3_optional===!0}});ot.d=function(){for(var e=new Array(arguments.length),i=0;i<arguments.length;)e[i]=arguments[i++];return function(r,o){jr.decorateType(r.constructor).add(new ot(o,e)),Object.defineProperty(r,o,{get:jr.oneOfGetter(e),set:jr.oneOfSetter(e)})}}});var pi=te((O2,sf)=>{"use strict";sf.exports=He;He.className="ReflectionObject";var X0=Mi(),It=je(),Yr,K0={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE2024",default_symbol_visibility:"EXPORT_TOP_LEVEL"},W0={enum_type:"OPEN",field_presence:"EXPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"},J0={enum_type:"CLOSED",field_presence:"EXPLICIT",json_format:"LEGACY_BEST_EFFORT",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"EXPANDED",utf8_validation:"NONE",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"},Z0={enum_type:"OPEN",field_presence:"IMPLICIT",json_format:"ALLOW",message_encoding:"LENGTH_PREFIXED",repeated_field_encoding:"PACKED",utf8_validation:"VERIFY",enforce_naming_style:"STYLE_LEGACY",default_symbol_visibility:"EXPORT_ALL"};function He(t,e){if(!It.isString(t))throw TypeError("name must be a string");if(e&&!It.isObject(e))throw TypeError("options must be an object");this.options=e,this.parsedOptions=null,this.name=t,this._edition=null,this._defaultEdition="proto2",this._features={},this._featuresResolved=!1,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(He.prototype,{root:{get:function(){for(var t=this;t.parent!==null;)t=t.parent;return t}},fullName:{get:function(){for(var t=[this.name],e=this.parent;e;)t.unshift(e.name),e=e.parent;return t.join(".")}}});He.prototype.toJSON=function(){throw Error()};He.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var i=e.root;i instanceof Yr&&i._handleAdd(this)};He.prototype.onRemove=function(e){var i=e.root;i instanceof Yr&&i._handleRemove(this),this.parent=null,this.resolved=!1};He.prototype.resolve=function(){return this.resolved?this:(this.root instanceof Yr&&(this.resolved=!0),this)};He.prototype._resolveFeaturesRecursive=function(e){return this._resolveFeatures(this._edition||e)};He.prototype._resolveFeatures=function(e){if(!this._featuresResolved){var i={};if(!e)throw new Error("Unknown edition for "+this.fullName);var n=It.merge({},this.options&&this.options.features,this._inferLegacyProtoFeatures(e));if(this._edition){if(e==="proto2")i=Object.assign({},J0);else if(e==="proto3")i=Object.assign({},Z0);else if(e==="2023")i=Object.assign({},W0);else if(e==="2024")i=Object.assign({},K0);else throw new Error("Unknown edition: "+e);this._features=It.merge(i,n)}else if(this.partOf instanceof X0){var r=It.merge({},this.partOf._features);this._features=It.merge(r,n)}else if(!this.declaringField)if(this.parent){var o=It.merge({},this.parent._features);this._features=It.merge(o,n)}else throw new Error("Unable to find a parent for "+this.fullName);this.extensionField&&(this.extensionField._features=this._features),this._featuresResolved=!0}};He.prototype._inferLegacyProtoFeatures=function(){return{}};He.prototype.getOption=function(e){if(this.options&&Object.prototype.hasOwnProperty.call(this.options,e))return this.options[e]};He.prototype.setOption=function(e,i,n){if(e==="__proto__")return this;if(this.options||(this.options={}),/^features\./.test(e))It.setProperty(this.options,e,i,n);else{var r=this.getOption(e);(!n||r===void 0)&&(r!==i&&(this.resolved=!1),this.options[e]=i)}return this};He.prototype.setParsedOption=function(e,i,n){if(e==="__proto__")return this;this.parsedOptions||(this.parsedOptions=[]);var r=this.parsedOptions;if(n){var o=r.find(function(l){return Object.prototype.hasOwnProperty.call(l,e)});if(o){var a=o[e];It.setProperty(a,n,i)}else o={},o[e]=It.setProperty({},n,i),r.push(o)}else{var s={};s[e]=i,r.push(s)}return this};He.prototype.setOptions=function(e,i){if(e)for(var n=Object.keys(e),r=0;r<n.length;++r)this.setOption(n[r],e[n[r]],i);return this};Object.defineProperty(He.prototype,"toString",{value:function(){var e=this.constructor.className,i=this.fullName;return i.length?e+" "+i:e},writable:!0,enumerable:!1,configurable:!0});He.prototype._editionToJSON=function(){if(!(!this._edition||this._edition==="proto3"))return this._edition};He._configure=function(t){Yr=t}});var xt=te((T2,cf)=>{"use strict";cf.exports=mt;var ka=pi();mt.prototype=Object.create(ka.prototype,{constructor:{value:mt,writable:!0,enumerable:!1,configurable:!0}});mt.className="Enum";var lf=cn(),pn=je();function mt(t,e,i,n,r,o){if(ka.call(this,t,i),e&&typeof e!="object")throw TypeError("values must be an object");if(this.valuesById=Object.create(null),this.values=Object.create(this.valuesById),this.comment=n,this.comments=r||{},this.valuesOptions=o,this._valuesFeatures={},this.reserved=void 0,e)for(var a=Object.keys(e),s=0;s<a.length;++s)a[s]!=="__proto__"&&typeof e[a[s]]=="number"&&(this.values[a[s]]=e[a[s]],this.valuesById[e[a[s]]]===void 0&&(this.valuesById[e[a[s]]]=a[s]))}mt.prototype._resolveFeatures=function(e){return e=this._edition||e,ka.prototype._resolveFeatures.call(this,e),Object.keys(this.values).forEach(i=>{var n=pn.merge({},this._features);this._valuesFeatures[i]=pn.merge(n,this.valuesOptions&&this.valuesOptions[i]&&this.valuesOptions[i].features||{})}),this};mt.fromJSON=function(e,i){var n=new mt(e,i.values,i.options,i.comment,i.comments,i.valuesOptions);return n.reserved=i.reserved,i.edition&&(n._edition=i.edition),n._defaultEdition="proto3",n};mt.prototype.toJSON=function(e){var i=e?!!e.keepComments:!1;return pn.toObject(["edition",this._editionToJSON(),"options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",i?this.comment:void 0,"comments",i?this.comments:void 0])};mt.prototype.add=function(e,i,n,r){if(!pn.isString(e))throw TypeError("name must be a string");if(!pn.isInteger(i))throw TypeError("id must be an integer");if(e==="__proto__")return this;if(this.values[e]!==void 0)throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(i))throw Error("id "+i+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(this.valuesById[i]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+i+" in "+this);this.values[e]=i}else this.valuesById[this.values[e]=i]=e;return r&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[e]=r||null),this.comments[e]=n||null,this};mt.prototype.remove=function(e){if(!pn.isString(e))throw TypeError("name must be a string");var i=this.values[e];if(i==null)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[i],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this};mt.prototype.isReservedId=function(e){return lf.isReservedId(this.reserved,e)};mt.prototype.isReservedName=function(e){return lf.isReservedName(this.reserved,e)}});var Ea=te((R2,uf)=>{"use strict";uf.exports=Q0;var Oa=xt(),gi=mi(),Ta=je();function ff(t,e,i,n){return e.delimited?t("types[%i].encode(%s,w.uint32(%i),q+1).uint32(%i)",i,n,(e.id<<3|3)>>>0,(e.id<<3|4)>>>0):t("types[%i].encode(%s,w.uint32(%i).fork(),q+1).ldelim()",i,n,(e.id<<3|2)>>>0)}function Q0(t){for(var e=Ta.codegen(["m","w","q"])("if(!w)")("w=Writer.create()")("if(q===undefined)q=0")("if(q>util.recursionLimit)")('throw Error("max depth exceeded")'),i,n,r=t.fieldsArray.slice().sort(Ta.compareFieldsById),i=0;i<r.length;++i){var o=r[i].resolve(),a=t._fieldsArray.indexOf(o),s=o.resolvedType instanceof Oa?"int32":o.type,l=gi.basic[s];n="m"+Ta.safeProp(o.name),o.map?(e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,o.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n),o.keyType==="bool"?e("w.uint32(%i).fork().uint32(%i).bool(util.boolFromKey(ks[i]))",(o.id<<3|2)>>>0,8|gi.mapKey[o.keyType]):gi.long[o.keyType]!==void 0?e("w.uint32(%i).fork().uint32(%i).%s(util.longFromKey(ks[i],%j))",(o.id<<3|2)>>>0,8|gi.mapKey[o.keyType],o.keyType,o.keyType==="uint64"||o.keyType==="fixed64"):e("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(o.id<<3|2)>>>0,8|gi.mapKey[o.keyType],o.keyType),l===void 0?e("types[%i].encode(%s[ks[i]],w.uint32(18).fork(),q+1).ldelim().ldelim()",a,n):e(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|l,s,n),e("}")("}")):o.repeated?(e("if(%s!=null&&%s.length){",n,n),o.packed&&gi.packed[s]!==void 0?e("w.uint32(%i).%ss(%s)",(o.id<<3|2)>>>0,s,n):(e("for(var i=0;i<%s.length;++i)",n),l===void 0?ff(e,o,a,n+"[i]"):e("w.uint32(%i).%s(%s[i])",(o.id<<3|l)>>>0,s,n)),e("}")):(o.required||(o.hasPresence||!(o.resolvedType instanceof Oa||gi.basic[s]!==void 0)?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,o.name):o.resolvedType instanceof Oa?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!==%j)",n,o.name,n,o.typeDefault):s==="bool"?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!==false)",n,o.name,n):s==="string"?e('if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!=="")',n,o.name,n):s==="bytes"?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s.length)",n,o.name,n):s==="double"||s==="float"?e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&!Object.is(%s,0))",n,o.name,n):gi.long[s]!==void 0?e('if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&(typeof %s==="object"?%s.low||%s.high:%s!==0))',n,o.name,n,n,n,n):e("if(%s!=null&&Object.hasOwnProperty.call(m,%j)&&%s!==0)",n,o.name,n)),l===void 0?ff(e,o,a,n):e("w.uint32(%i).%s(%s)",(o.id<<3|l)>>>0,s,n))}return e('if(m.$unknowns!=null&&Object.hasOwnProperty.call(m,"$unknowns"))')("for(var i=0;i<m.$unknowns.length;++i)")("w.raw(m.$unknowns[i])")("return w")}});var hf=te((se,df)=>{"use strict";se=df.exports=Sc();se.build="light";function e1(t,e,i){return typeof e=="function"?(i=e,e=new se.Root):e||(e=new se.Root),e.load(t,i)}se.load=e1;function t1(t,e){return e||(e=new se.Root),e.loadSync(t)}se.loadSync=t1;se.encoder=Ea();se.decoder=fa();se.verifier=ha();se.converter=ga();se.ReflectionObject=pi();se.Namespace=cn();se.Root=qr();se.Enum=xt();se.Type=$r();se.Field=hi();se.OneOf=Mi();se.MapField=Or();se.Service=Nr();se.Method=Tr();se.Message=Pr();se.wrappers=ya();se.types=mi();se.util=je();se.ReflectionObject._configure(se.Root);se.Namespace._configure(se.Type,se.Service,se.Enum);se.Root._configure(se.Type,void 0,{});se.Field._configure(se.Type)});var Na=te((N2,bf)=>{"use strict";bf.exports=mf;var Ra=/[\s{}=;:[\],'"()<>]/g,i1=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n1=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,r1=/^ *[*/]+ */,o1=/^\s*\*?\/*/,a1=/\n/g,s1=/\s/,l1=/\\(.?)/g,c1={0:"\0",r:"\r",n:`
5
+ `,t:" "};function pf(t){return t.replace(l1,function(e,i){switch(i){case"\\":case"":return i;default:return c1[i]||""}})}mf.unescape=pf;function mf(t,e){t=t.toString();var i=0,n=t.length,r=1,o=0,a={},s=[],l=null;function c(I){return Error("illegal "+I+" (line "+r+")")}function f(){var I=l==="'"?n1:i1;I.lastIndex=i-1;var $=I.exec(t);if(!$)throw c("string");return i=I.lastIndex,w(l),l=null,pf($[1])}function h(I){return t.charAt(I)}function m(I,$,V){var Y={type:t.charAt(I++),lineEmpty:!1,leading:V},q;e?q=2:q=3;var x=I-q,O;do if(--x<0||(O=t.charAt(x))===`
6
+ `){Y.lineEmpty=!0;break}while(O===" "||O===" ");for(var y=t.substring(I,$).split(a1),P=0;P<y.length;++P)y[P]=y[P].replace(e?o1:r1,"").trim();Y.text=y.join(`
7
+ `).trim(),a[r]=Y,o=r}function p(I){var $=b(I),V=t.substring(I,$),Y=/^\s*\/\//.test(V);return Y}function b(I){for(var $=I;$<n&&h($)!==`
8
+ `;)$++;return $}function g(){if(s.length>0)return s.shift();if(l)return f();var I,$,V,Y,q,x,O=i===0;do{if(i===n)return null;for(I=!1;s1.test(V=h(i));)if(V===`
9
+ `&&(O=!0,++r),++i===n)return null;if(h(i)==="/"){if(++i===n)throw c("comment");if(h(i)==="/")if(e){if(Y=i,q=!1,p(i-1)){q=!0;do{if(i=b(i),i===n||(i++,!O))break;x=p(i),x&&r++}while(x)}else i=Math.min(n,b(i)+1);q&&(m(Y,i,O),O=!0),r++,I=!0}else{for(q=h(Y=i+1)==="/";h(++i)!==`
10
+ `;)if(i===n)return null;++i,q&&(m(Y,i-1,O),O=!0),++r,I=!0}else if((V=h(i))==="*"){Y=i+1,q=e||h(Y)==="*";do{if(V===`
11
+ `&&++r,++i===n)throw c("comment");$=V,V=h(i)}while($!=="*"||V!=="/");++i,q&&(m(Y,i-2,O),O=!0),I=!0}else return"/"}}while(I);var y=i;Ra.lastIndex=0;var P=Ra.test(h(y++));if(!P)for(;y<n&&!Ra.test(h(y));)++y;var A=t.substring(i,i=y);return(A==='"'||A==="'")&&(l=A),A}function w(I){s.push(I)}function S(){if(!s.length){var I=g();if(I===null)return null;w(I)}return s[0]}function _(I,$){var V=S(),Y=V===I;if(Y)return g(),!0;if(!$)throw c("token '"+V+"', '"+I+"' expected");return!1}function G(I){var $=null,V;return I===void 0?(V=a[r-1],delete a[r-1],V&&(e||V.type==="*"||V.lineEmpty)&&($=V.leading?V.text:null)):(o<I&&S(),V=a[I],delete a[I],V&&!V.lineEmpty&&(e||V.type==="/")&&($=V.leading?null:V.text)),$}return Object.defineProperty({next:g,peek:S,push:w,skip:_,cmnt:G},"line",{get:function(){return r}})}});var Sf=te((P2,wf)=>{"use strict";wf.exports=Jt;Jt.filename=null;Jt.defaults={keepCase:!1};var f1=Na(),gf=qr(),yf=$r(),Hr=hi(),u1=Or(),vf=Mi(),d1=xt(),h1=Nr(),p1=Tr(),m1=pi(),b1=mi(),Wt=je(),g1=/^[1-9][0-9]*$/,y1=/^-?[1-9][0-9]*$/,v1=/^0[x][0-9a-fA-F]+$/,w1=/^-?0[x][0-9a-fA-F]+$/,S1=/^0[0-7]+$/,E1=/^-?0[0-7]+$/,x1=/^(?:u?int|sint|s?fixed)(?:32|64)$/,_1=/^(?:uint|fixed)(?:32|64)$/,I1=Wt.patterns.numberRe,$t=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Ct=Wt.patterns.typeRefRe,C1=536870911,A1=2147483647;function Jt(t,e,i){e instanceof gf||(i=e,e=new gf),i||(i=Jt.defaults);var n=i.preferTrailingComment||!1,r=f1(t,i.alternateCommentMode||!1),o=r.next,a=r.push,s=r.peek,l=r.skip,c=r.cmnt,f=!0,h,m,p,b="proto2",g=e,w=[],S={},_=i.keepCase?function(T){return T}:Wt.camelCase;function G(){w.forEach(T=>{T._edition=b,Object.keys(S).forEach(k=>{T.getOption(k)===void 0&&T.setOption(k,S[k],!0)})})}function I(T,k,N){var F=Jt.filename;return N||(Jt.filename=null),Error("illegal "+(k||"token")+" '"+T+"' ("+(F?F+", ":"")+"line "+r.line+")")}function $(){var T=[],k;do{if((k=o())!=='"'&&k!=="'")throw I(k);T.push(o()),l(k),k=s()}while(k==='"'||k==="'");return T.join("")}function V(T){var k=o();switch(k){case"'":case'"':return a(k),$();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return q(k,!0)}catch{if(T&&Ct.test(k))return k;throw I(k,"value")}}function Y(T,k,N,F){var L,W;do if(k&&((L=s())==='"'||L==="'")){var ae=$();if(T.push(ae),b>=2023)throw I(ae,"id")}else try{T.push([W=O(o(),F,N),l("to",!0)?O(o(),F,N):W])}catch(de){if(k&&Ct.test(L)&&b>=2023)T.push(L);else throw de}while(l(",",!0));var re={options:void 0};re.setOption=function(de,Oe){this.options===void 0&&(this.options={}),this.options[de]=Oe},M(re,function(Oe){if(Oe==="option")Q(re,Oe),l(";");else throw I(Oe)},function(){qt(re)})}function q(T,k){var N=1;switch(T.charAt(0)==="-"&&(N=-1,T=T.substring(1)),T){case"inf":case"INF":case"Inf":return N*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return N*0}if(g1.test(T))return N*parseInt(T,10);if(v1.test(T))return N*parseInt(T,16);if(S1.test(T))return N*parseInt(T,8);if(I1.test(T))return N*parseFloat(T);throw I(T,"number",k)}function x(T,k,N){if(T===null)throw I(T,"end of input");if(!k&&T.charAt(0)==="-")throw I(T,N||"integer");if(T==="0"||T==="-0")return 0;var F;if(y1.test(T))F=parseInt(T,10);else if(w1.test(T))F=parseInt(T,16);else if(E1.test(T))F=parseInt(T,8);else throw I(T,N||"integer");return F||0}function O(T,k,N){switch(T){case"max":case"MAX":case"Max":return N||C1}return x(T,k,"id")}function y(){if(h!==void 0)throw I("package");if(h=o(),h===null||!Ct.test(h))throw I(h,"name");g=g.define(h),l(";")}function P(){var T=s(),k;switch(T){case"option":if(b<"2024")throw I("option");o(),$(),l(";");return;case"weak":k=p||(p=[]),o();break;case"public":o();default:k=m||(m=[]);break}T=$(),l(";"),k.push(T)}function A(){if(l("="),b=$(),b<2023)throw I(b,"syntax");l(";")}function u(){if(l("="),b=$(),!["2023","2024"].includes(b))throw I(b,"edition");l(";")}function E(T,k,N){switch(N===void 0&&(N=0),k){case"option":return Q(T,k),l(";"),!0;case"message":return j(T,k,N+1),!0;case"enum":return Se(T,k),!0;case"export":case"local":return b<"2024"||(k=o(),k==="export"||k==="local")||k!=="message"&&k!=="enum"?!1:E(T,k,N);case"service":return Re(T,k,N+1),!0;case"extend":return ut(T,k,N),!0}return!1}function M(T,k,N){var F=r.line;if(T&&(typeof T.comment!="string"&&(T.comment=c()),T.filename=Jt.filename),l("{",!0)){for(var L;(L=o())!=="}";)k(L);l(";",!0)}else N&&N(),l(";"),T&&(typeof T.comment!="string"||n)&&(T.comment=c(F)||T.comment)}function j(T,k,N){if(N===void 0&&(N=0),N>Wt.nestingLimit)throw Error("max depth exceeded");if((k=o())===null||!$t.test(k))throw I(k,"type name");var F=new yf(k);M(F,function(W){if(!E(F,W,N))switch(W){case";":break;case"map":ue(F,W);break;case"required":if(b!=="proto2")throw I(W);case"repeated":H(F,W,void 0,N+1);break;case"optional":if(b==="proto3")H(F,"proto3_optional",void 0,N+1);else{if(b!=="proto2")throw I(W);H(F,"optional",void 0,N+1)}break;case"oneof":we(F,W,N+1);break;case"extensions":Y(F.extensions||(F.extensions=[]));break;case"reserved":Y(F.reserved||(F.reserved=[]),!0);break;default:if(b==="proto2"||!Ct.test(W))throw I(W);a(W),H(F,"optional",void 0,N+1);break}}),T.add(F),T===g&&w.push(F)}function H(T,k,N,F){var L=o();if(L===null)throw I(L,"end of input");if(L==="group"){Z(T,k,N,F);return}for(;L.endsWith(".")||(s()||"").startsWith(".");){var W=o();if(W===null)throw I(W,"end of input");L+=W}if(!Ct.test(L))throw I(L,"type");var ae=o();if(ae===null)throw I(ae,"end of input");if(!$t.test(ae))throw I(ae,"name");var re=ae;ae=_(ae),l("=");var de=new Hr(ae,O(o()),L,k==="proto3_optional"?"optional":k,N);if(re!==ae&&(de.protoName=re),M(de,function(Ee){if(Ee==="option")Q(de,Ee),l(";");else throw I(Ee)},function(){qt(de)}),k==="proto3_optional"){var Oe=new vf("_"+ae);de.setOption("proto3_optional",!0),Oe.add(de),T.add(Oe)}else T.add(de);T===g&&w.push(de)}function Z(T,k,N,F){if(F===void 0&&(F=0),F>Wt.nestingLimit)throw Error("max depth exceeded");if(b>=2023)throw I("group");var L=o();if(L===null||!$t.test(L))throw I(L,"name");var W=Wt.lcFirst(L);L===W&&(L=Wt.ucFirst(L)),l("=");var ae=O(o()),re=new yf(L);re.group=!0;var de=new Hr(W,ae,L,k,N);de.filename=Jt.filename,M(re,function(Fe){switch(Fe){case";":break;case"map":ue(re);break;case"option":Q(re,Fe),l(";");break;case"required":case"repeated":H(re,Fe,void 0,F+1);break;case"optional":b==="proto3"?H(re,"proto3_optional",void 0,F+1):H(re,"optional",void 0,F+1);break;case"message":j(re,Fe,F+1);break;case"enum":Se(re,Fe);break;case"reserved":Y(re.reserved||(re.reserved=[]),!0);break;case"export":case"local":if(b<"2024")throw I(Fe);switch(Fe=o(),Fe){case"message":j(re,Fe,F+1);break;case"enum":j(re,Fe,F+1);break;default:throw I(Fe)}break;default:throw I(Fe)}}),T.add(re).add(de),T===g&&(w.push(re),w.push(de))}function ue(T){l("<");var k=o();if(b1.mapKey[k]===void 0)throw I(k,"type");l(",");var N=o();if(!Ct.test(N))throw I(N,"type");l(">");var F=o();if(F===null||!$t.test(F))throw I(F,"name");l("=");var L=F;F=_(F);var W=new u1(F,O(o()),k,N);L!==F&&(W.protoName=L),M(W,function(re){if(re==="option")Q(W,re),l(";");else throw I(re)},function(){qt(W)}),T.add(W)}function we(T,k,N){if((k=o())===null||!$t.test(k))throw I(k,"name");var F=new vf(_(k));M(F,function(W){W==="option"?(Q(F,W),l(";")):(a(W),H(F,"optional",void 0,N))}),T.add(F)}function Se(T,k){if((k=o())===null||!$t.test(k))throw I(k,"name");var N=new d1(k),F=[];M(N,function(ae){switch(ae){case";":break;case"option":Q(N,ae),l(";");break;case"reserved":Y(N.reserved||(N.reserved=[]),!0,A1,!0),N.reserved===void 0&&(N.reserved=[]);break;default:F.push(pe(ae))}});for(var L=0;L<F.length;++L)N.add(F[L].name,F[L].id,F[L].comment,F[L].options);T.add(N),T===g&&w.push(N)}function pe(T){if(!$t.test(T))throw I(T,"name");l("=");var k=O(o(),!0),N={options:void 0};return N.getOption=function(F){return this.options[F]},N.setOption=function(F,L){m1.prototype.setOption.call(N,F,L)},N.setParsedOption=function(){},M(N,function(L){if(L==="option")Q(N,L),l(";");else throw I(L)},function(){qt(N)}),{name:T,id:k,comment:N.comment,options:N.parsedOptions||N.options}}function Q(T,k){var N,F,L=!0;for(k==="option"&&(k=o());k!=="=";){if(k===null)throw I(k,"end of input");if(k==="("){var W=o();l(")"),k="("+W+")"}if(L){if(L=!1,k.includes(".")&&!k.includes("(")){var ae=k.split(".");N=ae[0]+".",k=ae[1];continue}N=k}else F=F?F+=k:k;k=o()}var re=F?N.concat(F):N,de=fe(T,re);F=F&&F[0]==="."?F.slice(1):F,N=N&&N[N.length-1]==="."?N.slice(0,-1):N,yt(T,N,de,F)}function fe(T,k,N){if(N===void 0&&(N=0),N>Wt.recursionLimit)throw Error("max depth exceeded");if(l("{",!0)){for(var F={};!l("}",!0);){me=o();var L;if(me===null)throw I(me,"end of input");if(me==="["){me=o();var W=me===null?-1:me.lastIndexOf("/");if(me===null||!Ct.test(W<0?me:me.slice(W+1)))throw I(me,"name");L="["+me+"]",l("]")}else{if(!$t.test(me))throw I(me,"name");L=me}var ae;if(l(":",!0),s()==="{")ae=fe(T,k+"."+L,N+1);else if(s()==="["){ae=[];var re,de;if(l("[",!0)&&!l("]",!0)){do de=s()==="{",re=de?fe(T,k+"."+L,N+1):V(!0),ae.push(re);while(l(",",!0));l("]"),typeof re<"u"&&(de||_e(T,k+"."+L,re))}}else ae=V(!0),_e(T,k+"."+L,ae);var Oe=Object.prototype.hasOwnProperty.call(F,L)?F[L]:void 0;Oe&&(ae=[].concat(Oe).concat(ae)),L!=="__proto__"&&(F[L]=ae),l(",",!0),l(";",!0)}return F}var Fe=k==="default"&&T instanceof Hr&&x1.test(T.type)?x(o(),!_1.test(T.type)):V(!0);return _e(T,k,Fe),Fe}function _e(T,k,N){if(g===T&&/^features\./.test(k)){S[k]=N;return}k==="json_name"&&T instanceof Hr&&(T.jsonName=N),T.setOption&&T.setOption(k,N)}function yt(T,k,N,F){T.setParsedOption&&T.setParsedOption(k,N,F)}function qt(T){if(l("[",!0)){do Q(T,"option");while(l(",",!0));l("]")}return T}function Re(T,k,N){if(N===void 0&&(N=0),N>Wt.recursionLimit)throw Error("max depth exceeded");if((k=o())===null||!$t.test(k))throw I(k,"service name");var F=new h1(k);M(F,function(W){if(!E(F,W,N)&&W!==";")if(W==="rpc")ft(F,W);else throw I(W)}),T.add(F),T===g&&w.push(F)}function ft(T,k){var N=c(),F=k;if(!$t.test(k=o()))throw I(k,"name");var L=k,W,ae,re,de;if(l("("),l("stream",!0)&&(ae=!0),!Ct.test(k=o())||(W=k,l(")"),l("returns"),l("("),l("stream",!0)&&(de=!0),!Ct.test(k=o())))throw I(k);re=k,l(")");var Oe=new p1(L,F,W,re,ae,de);Oe.comment=N,M(Oe,function(Ee){if(Ee!==";")if(Ee==="option")Q(Oe,Ee),l(";");else throw I(Ee)}),T.add(Oe)}function ut(T,k,N){if((k=o())===null||!Ct.test(k))throw I(k,"reference");var F=k;M(null,function(W){switch(W){case"required":case"repeated":H(T,W,F,N+1);break;case"optional":b==="proto3"?H(T,"proto3_optional",F,N+1):H(T,"optional",F,N+1);break;default:if(b==="proto2"||!Ct.test(W))throw I(W);a(W),H(T,"optional",F,N+1);break}})}for(var me;(me=o())!==null;)switch(me){case";":break;case"package":if(!f)throw I(me);y();break;case"import":P();break;case"syntax":if(!f)throw I(me);A();break;case"edition":if(!f)throw I(me);u();break;case"option":Q(g,me),l(";",!0);break;default:if(E(g,me,0)){f=!1;continue}throw I(me)}return G(),Jt.filename=null,{package:h,imports:m,weakImports:p,root:e}}});var _f=te((F2,xf)=>{"use strict";xf.exports=At;var k1=/\/|\./;function At(t,e){k1.test(t)||(t="google/protobuf/"+t+".proto",e={nested:{google:{nested:{protobuf:{nested:e}}}}}),At[t]=e}At("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var Ef;At("duration",{Duration:Ef={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});At("timestamp",{Timestamp:Ef});At("empty",{Empty:{fields:{}}});At("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1,protoName:"null_value"},numberValue:{type:"double",id:2,protoName:"number_value"},stringValue:{type:"string",id:3,protoName:"string_value"},boolValue:{type:"bool",id:4,protoName:"bool_value"},structValue:{type:"Struct",id:5,protoName:"struct_value"},listValue:{type:"ListValue",id:6,protoName:"list_value"}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});At("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});At("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});At.get=function(e){return At[e]||null}});var Cf=te((Gt,If)=>{"use strict";Gt=If.exports=hf();Gt.build="full";Gt.tokenize=Na();Gt.parse=Sf();Gt.common=_f();Gt.Root._configure(Gt.Type,Gt.parse,Gt.common)});var kf=te((M2,Af)=>{"use strict";Af.exports=Cf()});import{parentPort as Ms}from"node:worker_threads";import{existsSync as rr,readFileSync as wp}from"node:fs";import{randomUUID as rd}from"node:crypto";import{isAbsolute as Bs,win32 as qs}from"node:path";function Vs(t,e=!1){let i=String(t??"").trim().replaceAll("\\","/");if(e&&(!i||i==="."))return"";if(!i||Bs(i)||qs.isAbsolute(i)||i.split("/").some(n=>!n||n==="."||n===".."||/[<>:"|?*\x00-\x1f]/.test(n)||/[. ]$/.test(n)||/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(n)))throw new Error("\u811A\u672C\u76EE\u5F55/\u8DEF\u5F84\u5FC5\u987B\u662F\u6709\u6548\u7684\u76F8\u5BF9\u8DEF\u5F84\uFF0C\u4E0D\u80FD\u5305\u542B .. \u6216 Windows \u7279\u6B8A\u6587\u4EF6\u540D");return i}function Eo(t){if(t==null)return null;if(t.version!==1)throw new Error("unsupported scriptSync version");let e=String(t.clientImportRoot||"").trim();if(!Bs(e)&&!qs.isAbsolute(e))throw new Error("\u5B9E\u673A\u5BFC\u5165\u6839\u76EE\u5F55\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84");return{version:1,workspaceDir:Vs(t.workspaceDir,!0),clientImportRoot:e,clientSubdir:Vs(t.clientSubdir,!0)}}import{basename as En,dirname as Sp,isAbsolute as Ep,join as od,resolve as ad}from"node:path";var Pd=[[10003004,10003004],[10005001,10005142],[10006001,10006002],[10007002,10007002],[10008001,10008001],[10009001,10009011],[20001001,20001074],[20001076,20001121],[20001123,20001156],[20001158,20001302],[20001304,20001568],[20001570,20001999],[20002001,20002755],[20002757,20002999],[20003001,20003455],[30001001,30001016],[30002001,30002017],[30003001,30003011],[30004001,30004001],[30005001,30005020],[30006001,30006026],[30007001,30007013],[30008001,30008011]];function Ls(t){return!Number.isSafeInteger(t)||!Pd.some(([e,i])=>t>=e&&t<=i)?null:t===10003004||t===10008001?128:256}var Fd=[[100001,100006],[100101,100213],[101001,101018],[101020,101028],[101030,101046],[101048,101048],[101050,101054],[101056,101080],[102001,102052],[103001,103148],[104001,104010],[105001,105140],[105142,105219],[105221,105317],[106001,106047],[106049,106096],[107001,107007],[107010,107020],[107031,107092],[107094,107180],[107183,107201],[107203,107205],[107207,107228],[107231,107278],[107280,107402],[108001,108017],[108019,108020],[109001,109031],[109033,109034],[109036,109075],[110001,110053],[111001,111139],[112001,112042]];function ii(t){return t==null||t===""?"StaticReference":typeof t=="string"?t:typeof t.Name=="string"?t.Name:"Unknown"}function js(t,e){return ii(e)==="StaticReference"&&xo(t,e)}function xo(t,e){let i=ii(e);return i==="Prefab"?Ls(t)!==null:i==="StaticReference"&&Number.isSafeInteger(t)&&t>100006&&Fd.some(([n,r])=>t>=n&&t<=r)}var lr="7.1.0",Le=Object.freeze(["KEYBOARD","TOUCHSCREEN","CONTROLLER_CONSOLE","CONTROLLER_MOBILE"]),Pe=Object.freeze({"pc-16-9":{id:"pc-16-9",device:"pc",platform:"KEYBOARD",width:1600,height:900,ratio:"16:9",luaDevice:"KeyboardAndMouse",label:"PC 1600\xD7900"},"pc-21-9":{id:"pc-21-9",device:"pc",platform:"KEYBOARD",width:2100,height:900,ratio:"21:9",luaDevice:"KeyboardAndMouse",label:"PC 2100\xD7900"},"mobile-16-9":{id:"mobile-16-9",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:720,ratio:"16:9",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7720"},"mobile-19.5-9":{id:"mobile-19.5-9",device:"mobile",platform:"TOUCHSCREEN",width:1560,height:720,ratio:"19.5:9",luaDevice:"Mobile",label:"\u624B\u673A 1560\xD7720"},"mobile-4-3":{id:"mobile-4-3",device:"mobile",platform:"TOUCHSCREEN",width:1280,height:960,ratio:"4:3",luaDevice:"Mobile",label:"\u624B\u673A 1280\xD7960"}}),cr="pc-16-9",Ze=2,Hi=Object.freeze({KEYBOARD:"pc-16-9",TOUCHSCREEN:"mobile-16-9",CONTROLLER_CONSOLE:"pc-16-9",CONTROLLER_MOBILE:"mobile-16-9"}),Xi=Object.freeze({"server-container":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",container:"\u5BB9\u5668\u8282\u70B9",textbox:"\u6587\u672C\u6846",image:"\u56FE\u7247",button:"\u9884\u8BBE\u6309\u94AE",cursor:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF",grid:"\u7F51\u683C\u89C6\u7A97",reference:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6",textwindow:"\u6587\u672C\u89C6\u7A97",keyhint:"\u6309\u952E\u63D0\u793A",animation:"\u754C\u9762\u52A8\u6548",fullscreen:"\u5168\u5C4F\u52A8\u6548"}),fr=Object.freeze(["server-container","container","textbox","cursor","reference","grid","image","button","textwindow","keyhint","animation","fullscreen"]),Us=Object.freeze({"server-container":null,container:[150,150],textbox:[100,40],image:[80,80],button:[150,50],cursor:[150,50],grid:[80,80],reference:[80,80],textwindow:[100,40],keyhint:[40,40],animation:[100,100],fullscreen:null}),Md=Object.freeze({100001:"rect",100002:"circle",100003:"triangle",100004:"fourstar",100005:"fivestar",100006:"ring"});function Ki(t,e){return ii(e)==="StaticReference"&&Md[t]||(xo(t,e)?"sprite":"missing")}var Ys=50888,In=Object.freeze({font:4294967295,bg:16777215,outline:858993459,image:4294967295});function Wi(t,e="$",i=new Set){if(t===void 0)throw new Error(`undefined at ${e}`);if(typeof t=="number"&&!Number.isFinite(t))throw new Error(`non-finite number at ${e}`);if(typeof t=="bigint"||typeof t=="function"||typeof t=="symbol")throw new Error(`non-JSON value at ${e}`);if(!(t===null||typeof t!="object")){if(i.has(t))throw new Error(`circular value at ${e}`);if(i.add(t),Array.isArray(t))t.forEach((n,r)=>Wi(n,`${e}[${r}]`,i));else for(let[n,r]of Object.entries(t))Wi(r,`${e}.${n}`,i);i.delete(t)}}function ie(t){return Wi(t),JSON.parse(JSON.stringify(t))}function Hs(t,e="$"){Wi(t,e)}function Xs(t){return Pe[t]||Pe[cr]}function Cn(t,e=0,i=0){return!t||typeof t!="object"?{x:e,y:i}:{x:Number(t.x??e),y:Number(t.y??i)}}function zd(t){return!t||typeof t!="object"?{x:1,y:1,z:1}:{x:Number(t.x??1),y:Number(t.y??1),z:Number(t.z??1)}}function Dd(t){return!t||typeof t!="object"?{x:0,y:0,z:0}:{x:Number(t.x??0),y:Number(t.y??0),z:Number(t.z??0)}}function ur({layout:t="center",size:e=[100,40],offset:i=[0,0]}={}){return t==="stretch"?{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:0,y:0},anchorMax:{x:1,y:1},offset:{x:0,y:0},size:{x:0,y:0},pivot:{x:.5,y:.5}}:{scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},anchorMin:{x:.5,y:.5},anchorMax:{x:.5,y:.5},offset:{x:Number(i[0]??0),y:Number(i[1]??0)},size:{x:Number(e[0]??0),y:Number(e[1]??0)},pivot:{x:.5,y:.5}}}function Nt(t){let e=t||ur();return{scale:zd(e.scale),rotation:Dd(e.rotation),anchorMin:Cn(e.anchorMin??e.anchor_min,.5,.5),anchorMax:Cn(e.anchorMax??e.anchor_max,.5,.5),offset:Cn(e.offset,0,0),size:Cn(e.size,0,0),pivot:Cn(e.pivot,.5,.5)}}function Ue(t,e=0){let i=Number(t);return Number.isFinite(i)?i:e}function jt(t,e){let i=t.width,n=t.height,r=t.left,o=t.bottom,a=e.anchorMin||{x:e.anchorMinX,y:e.anchorMinY},s=e.anchorMax||{x:e.anchorMaxX,y:e.anchorMaxY},l=e.offset||{x:e.anchoredPositionX,y:e.anchoredPositionY},c=e.size||{x:e.sizeDeltaX,y:e.sizeDeltaY},f=e.pivot||{x:e.pivotX,y:e.pivotY},h=Ue(a?.x,.5)*i,m=Ue(a?.y,.5)*n,p=Ue(s?.x,.5)*i,b=Ue(s?.y,.5)*n,g=Ue(c?.x),w=Ue(c?.y),S=Ue(f?.x,.5),_=Ue(f?.y,.5),G=p-h+g,I=b-m+w,$=r+h+Ue(l?.x)-g*S,V=o+m+Ue(l?.y)-w*_;return{left:$,bottom:V,width:G,height:I,right:$+G,top:V+I,centerX:$+G/2,centerY:V+I/2}}function Ji(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}}function $d(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,tx:t.a*e.tx+t.c*e.ty+t.tx,ty:t.b*e.tx+t.d*e.ty+t.ty}}function wt(t,e,i){return{x:t.a*e+t.c*i+t.tx,y:t.b*e+t.d*i+t.ty}}function Zi(t){let e=t.a*t.d-t.b*t.c;return!Number.isFinite(e)||Math.abs(e)<1e-8?null:{a:t.d/e,b:-t.b/e,c:-t.c/e,d:t.a/e,tx:(t.c*t.ty-t.d*t.tx)/e,ty:(t.b*t.tx-t.a*t.ty)/e}}function _o(t,e){let i=e.rotation||{x:e.localRotationX,y:e.localRotationY,z:e.localRotationZ},n=e.scale||{x:e.localScaleX,y:e.localScaleY},r=e.pivot||{x:e.pivotX,y:e.pivotY},o=Ue(i?.z)*Math.PI/180,a=Math.cos(o),s=Math.sin(o),l=Ue(i?.x)*Math.PI/180,c=Ue(i?.y)*Math.PI/180,f=Math.cos(l),h=Math.sin(l),m=Math.cos(c),p=Math.sin(c),b=Y=>Math.abs(Y)<1e-12?0:Y,g=Ue(n?.x,1),w=Ue(n?.y,1),S=t.left+t.width*Ue(r?.x,.5),_=t.bottom+t.height*Ue(r?.y,.5),G=b(m*a+p*h*s)*g,I=b(f*s)*g,$=b(-m*s+p*h*a)*w,V=b(f*a)*w;return{a:G,b:I,c:$,d:V,tx:S-G*S-$*_,ty:_-I*S-V*_}}function An(t,e,i){return $d(t||Ji(),_o(e,i))}function Ks(t,e){let i=wt(e,t.centerX,t.centerY),n=Math.abs(t.width*Math.hypot(e.a,e.b)),r=Math.abs(t.height*Math.hypot(e.c,e.d));return{left:i.x-n/2,bottom:i.y-r/2,width:n,height:r,centerX:i.x,centerY:i.y,rotationZ:Math.atan2(e.b,e.a)*180/Math.PI}}function Qe(t){let e=typeof t=="string"?Xs(t):t;return{left:0,bottom:0,width:e.width,height:e.height,right:e.width,top:e.height,centerX:e.width/2,centerY:e.height/2}}function Io(t){return{posX:t.centerX,posY:t.centerY,width:t.width,height:t.height}}function xi(t,e,i){let n=Nt(e),r=t.width,o=t.height,a=n.anchorMin.x*r,s=n.anchorMin.y*o,l=n.anchorMax.x*r,c=n.anchorMax.y*o,f=Number(i.width),h=Number(i.height),m=Number(i.posX),p=Number(i.posY),b=m-f/2,g=p-h/2;return n.size={x:f-(l-a),y:h-(c-s)},n.offset={x:b-t.left-a+n.size.x*n.pivot.x,y:g-t.bottom-s+n.size.y*n.pivot.y},n}function Ws(t,e){let i=Nt(t),r={"bottom-left":[[0,0],[0,0],[0,0]],bottom:[[.5,0],[.5,0],[.5,0]],"bottom-right":[[1,0],[1,0],[1,0]],left:[[0,.5],[0,.5],[0,.5]],center:[[.5,.5],[.5,.5],[.5,.5]],right:[[1,.5],[1,.5],[1,.5]],"top-left":[[0,1],[0,1],[0,1]],top:[[.5,1],[.5,1],[.5,1]],"top-right":[[1,1],[1,1],[1,1]],stretch:[[0,0],[1,1],[.5,.5]],"stretch-horizontal":[[0,.5],[1,.5],[.5,.5]],"stretch-vertical":[[.5,0],[.5,1],[.5,.5]]}[e];return r&&(i.anchorMin={x:r[0][0],y:r[0][1]},i.anchorMax={x:r[1][0],y:r[1][1]},i.pivot={x:r[2][0],y:r[2][1]}),i}function Js(t){let e=Nt(t),i=(n,r)=>Math.abs(n-r)<1e-4;if(i(e.anchorMin.x,0)&&i(e.anchorMin.y,0)&&i(e.anchorMax.x,1)&&i(e.anchorMax.y,1))return"stretch";if(i(e.anchorMin.x,e.anchorMax.x)&&i(e.anchorMin.y,e.anchorMax.y)){let n=e.anchorMin.x,r=e.anchorMin.y,o=[[0,0,"bottom-left"],[.5,0,"bottom"],[1,0,"bottom-right"],[0,.5,"left"],[.5,.5,"center"],[1,.5,"right"],[0,1,"top-left"],[.5,1,"top"],[1,1,"top-right"]];for(let a of o)if(i(n,a[0])&&i(r,a[1]))return a[2]}return"custom"}function _i(t){return Xs(t).platform}function Zs(t){let e={};for(let i of Le)e[i]=t(i);return e}var Gd={scale:["x","y","z"],rotation:["x","y","z"],anchorMin:["x","y"],anchorMax:["x","y"],offset:["x","y"],size:["x","y"],pivot:["x","y"]};function Qs(t,e){for(let[i,n]of Object.entries(Gd))for(let r of n)if(!Number.isFinite(t?.[i]?.[r]))throw new Error(`${e}.${i}.${r} must be a finite number`)}function ni(t,e="transformByPlatform"){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e}: \u9700\u8981\u5B8C\u6574\u7684\u56DB\u5E73\u53F0\u5E03\u5C40`);for(let i of Object.keys(t))if(!Le.includes(i))throw new Error(`${e}: unknown platform ${i}`);for(let i of Le)Qs(t[i],`${e}.${i}`)}function Ii(t){if(Object.hasOwn(t,"transformByCanvas"))throw new Error(`${t.name||t.id||"\u63A7\u4EF6"}: \u4E0D\u518D\u652F\u6301 transformByCanvas\uFF1B\u8BF7\u4F7F\u7528\u56DB\u5E73\u53F0 transformByPlatform \u5E03\u5C40`);ni(t.transformByPlatform,`${t.name||t.id||"\u63A7\u4EF6"}.transformByPlatform`)}function Ci(t,e){if(!Le.includes(e))throw new Error(`unknown platform ${e}`);return Qs(t?.[e],`transformByPlatform.${e}`),Nt(t[e])}var Vd=Object.freeze([{key:"genericField501",label:"\u901A\u7528\u69FD field501",type:"number",defaultValue:0,wire:"GenericSlot.field501"},{key:"footerField505",label:"\u5C3E\u90E8\u69FD field505",type:"number",defaultValue:0,wire:"FooterSlot.field505"}]),Bd=Object.freeze({container:[],textbox:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]}],textwindow:[{key:"textField501",label:"\u6587\u672C\u914D\u7F6E field501",type:"number",defaultValue:20,wire:"TextConfig.field501"},{key:"textField503",label:"\u6587\u672C\u914D\u7F6E field503",type:"number",defaultValue:12,wire:"TextConfig.field503"},{key:"textAlign",label:"\u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:0,wire:"TextConfig.align",options:[{value:0,label:"0 \xB7 \u5DE6\u5BF9\u9F50"},{value:1,label:"1 \xB7 \u5C45\u4E2D"},{value:2,label:"2 \xB7 \u53F3\u5BF9\u9F50"}]},{key:"textField511",label:"\u6587\u672C\u89C6\u7A97 field511",type:"number",defaultValue:1,wire:"TextConfig.field511"},{key:"textViewField502",label:"\u89C6\u7A97\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field502"},{key:"textViewField503",label:"\u89C6\u7A97\u6807\u8BB0 field503",type:"number",defaultValue:1,wire:"TextConfig.viewFlags.field503"}],cursor:[{key:"cursorField501",label:"\u5149\u6807\u68C0\u6D4B field501",type:"number",defaultValue:1,wire:"CursorConfig.field501"}],reference:[{key:"templateRefSlot",label:"\u6A21\u677F\u5F15\u7528\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.templateRefSlot"}],grid:[{key:"gridField501",label:"\u7F51\u683C\u6807\u8BB0 field501",type:"number",defaultValue:1,wire:"GridViewConfig.field501"},{key:"gridField507",label:"\u7F51\u683C\u6807\u8BB0 field507",type:"number",defaultValue:1,wire:"GridViewConfig.field507"},{key:"gridField508",label:"\u7F51\u683C\u6807\u8BB0 field508",type:"number",defaultValue:1,wire:"GridViewConfig.field508"},{key:"gridField509",label:"\u7F51\u683C\u6807\u8BB0 field509",type:"number",defaultValue:1,wire:"GridViewConfig.field509"},{key:"gridField511",label:"\u7F51\u683C\u6807\u8BB0 field511",type:"number",defaultValue:5,wire:"GridViewConfig.field511"},{key:"gridField512",label:"\u7F51\u683C\u6807\u8BB0 field512",type:"number",defaultValue:1,wire:"GridViewConfig.field512"}],keyhint:[{key:"keyHintField501",label:"\u6309\u952E\u63D0\u793A field501",type:"number",defaultValue:1,wire:"KeyHintConfig.field501"},{key:"keyHintField502",label:"\u952E\u9F20\u952E\u4F4D\u539F\u59CB\u503C",type:"number",defaultValue:1,wire:"KeyHintConfig.field502"}],image:[{key:"imageSlotType",label:"\u56FE\u7247\u7C7B\u578B\u539F\u59CB\u503C",type:"number",defaultValue:0,wire:"ImageSlotConfig.imageType"},{key:"imageField502",label:"\u56FE\u7247\u6807\u8BB0 field502",type:"number",defaultValue:1,wire:"ImageConfig.field502"},{key:"imageField504",label:"\u56FE\u7247\u6807\u8BB0 field504",type:"number",defaultValue:1,wire:"ImageConfig.field504"},{key:"imageField505",label:"\u56FE\u7247\u6807\u8BB0 field505",type:"number",defaultValue:1,wire:"ImageConfig.field505"},{key:"imageField507",label:"\u56FE\u7247\u6807\u8BB0 field507",type:"number",defaultValue:2,wire:"ImageConfig.field507"},{key:"imageFillType",label:"\u586B\u5145\u5F62\u72B6\u679A\u4E3E\u539F\u59CB\u503C",type:"enum",defaultValue:1,wire:"ImageConfig.fillType",options:[{value:1,label:"1 \xB7 \u6A2A\u5411"},{value:2,label:"2 \xB7 \u7EB5\u5411"},{value:3,label:"3 \xB7 90\u5EA6\u73AF\u7ED5"},{value:4,label:"4 \xB7 180\u5EA6\u73AF\u7ED5"},{value:5,label:"5 \xB7 360\u5EA6\u73AF\u7ED5"}]}],animation:[{key:"effectSlot",label:"\u754C\u9762\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.effectSlot"}],fullscreen:[{key:"fullscreenEffectSlot",label:"\u5168\u5C4F\u52A8\u6548\u69FD\u539F\u59CB\u503C",type:"string",defaultValue:"",wire:"Details.fullscreenEffectSlot"}]});function el(t){return[...Vd,...Bd[t]||[]]}function tl(t,e){return el(t).find(i=>i.key===e)||null}function Co(t,e){if(!t)throw new Error("unknown raw GIA field");if(t.type==="string")return String(e??"");let i=Number(e);if(!Number.isFinite(i))throw new Error(`${t.wire} must be a finite number`);return Math.trunc(i)}function il(t,e={}){let i={};for(let n of el(t)){let r=Object.hasOwn(e||{},n.key)?e[n.key]:n.defaultValue;i[n.key]=Co(n,r)}if(t==="reference")for(let n of["templateRefSlotBase64","templateRefOuterBase64"]){if(!Object.hasOwn(e||{},n))continue;let r=e[n];if(typeof r!="string"||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))throw new Error(`${n} must be base64`);r&&(i[n]=r)}return i}function dt(t){let e=Number(t);return Number.isSafeInteger(e)&&e>=1073741824&&e<=1077936127}function Ut(t){let e=Number(t);return Number.isSafeInteger(e)&&e>0&&e<=2147483647}function Ao(t,e){if(Ut(t)&&!dt(t))throw new Error(`${e||"\u8D44\u4EA7"}: \u7D22\u5F15 ${t} \u8D85\u51FA 1073741824\u20131077936127\uFF1B\u8BF7\u5148\u6821\u51C6\u7D22\u5F15\u5E76\u6838\u5BF9 Lua \u5F15\u7528\uFF0C\u5BFC\u51FA\u4E0D\u4F1A\u81EA\u52A8\u91CD\u7F16\u53F7\u3002`)}function ko(t,e){if(t){e(t);for(let i of t.children||[])ko(i,e)}}function Qi(t,e=new Set,{skipServerContainer:i=!1}={}){return ko(t,n=>{i&&n.kind==="server-container"||dt(n.guid)&&e.add(Number(n.guid))}),e}function ri(t,e=1073741850){let i=Number.isSafeInteger(e)&&e>0?e:1073741850;i<1073741850&&(i=1073741850);for(let n of t)dt(n)&&n>=i&&(i=Number(n)+1);for(;t.has(i);)i+=1;if(i>1077936127)throw new Error("GUID space exhausted");return i}function nl(t,e=new Set,{skipServerContainer:i=!1}={}){let n=[];ko(t,r=>{if(i&&r.kind==="server-container")return;let o=Number(r.guid);if(dt(o)&&!e.has(o)){e.add(o),r.guid=o;return}n.push(r)});for(let r of n){let o=ri(e);r.guid=o,e.add(o)}return e}function ht(t){return Number.isSafeInteger(t)&&t>0&&t<=2147483647}function Yt(t,{warnings:e=[]}={}){if(t.meta?.assetType!=="client-control-template")return;if(t.meta.giaAssetIndexSchemaVersion>1)throw new Error(`\u4E0D\u652F\u6301\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7248\u672C ${t.meta.giaAssetIndexSchemaVersion}`);let i=[],n=b=>{b.kind!=="server-container"&&i.push(b);for(let g of b.children||[])n(g)};n(t.root);let r=new Map,o=new Map;for(let b of i){if(!ht(b.giaInfoIndex))continue;let g=r.get(b.giaInfoIndex)||[];g.push(b),r.set(b.giaInfoIndex,g);let w=o.get(b.kind)||new Set;w.add(b.giaInfoIndex),o.set(b.kind,w)}let a=(t.root.children||[]).filter(b=>b.kind!=="server-container"),s=new Set(a),l=a.some((b,g)=>ht(b.giaInfoIndex)&&a.slice(0,g).some(w=>w.giaInfoIndex===b.giaInfoIndex)),c=!t.meta.giaAssetIndexSchemaVersion&&l&&i.every(b=>b.giaInfoIndexSource!=="authoring")&&[...o.values()].every(b=>b.size===1)&&[...r.values()].every(b=>b.every(g=>g.kind===b[0].kind)),f=new Set;if(c)for(let b of r.values()){let g=b.find(w=>s.has(w))||b[0];for(let w of b)w!==g&&f.add(w)}let h=new Map,m=Number.isSafeInteger(t.meta.giaNextAssetIndex)&&t.meta.giaNextAssetIndex>=2?t.meta.giaNextAssetIndex:2;for(let b of i){if(!ht(b.giaInfoIndex)||(m=Math.max(m,b.giaInfoIndex+1),f.has(b)))continue;let g=h.get(b.giaInfoIndex);if(g&&(g.giaInfoIndexSource==="authoring"||b.giaInfoIndexSource==="authoring"))throw new Error(`\u65B0\u5EFA\u8D44\u4EA7\u7F16\u53F7 ${b.giaInfoIndex} \u91CD\u590D\uFF1A${g.name} / ${b.name}`);h.set(b.giaInfoIndex,b)}c&&(m=Math.max(m,13));let p=c?[...a,...i.filter(b=>!s.has(b))].filter(b=>f.has(b)||!ht(b.giaInfoIndex)):i.filter(b=>!ht(b.giaInfoIndex));if(p.length&&m+p.length-1>2147483647)throw new Error("\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u7A7A\u95F4\u5DF2\u8017\u5C3D");for(let b of p)b.giaInfoIndex=m++,b.giaInfoIndexSource="authoring";t.meta.giaNextAssetIndex=m,t.meta.giaAssetIndexSchemaVersion=1,f.size&&e.push(`\u65E7\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7\u81EA\u52A8\u8FC1\u79FB\uFF1A\u4FEE\u590D ${f.size} \u6761\u6309\u63A7\u4EF6\u7C7B\u578B\u590D\u7528\u7684\u7F16\u53F7\uFF1BGUID\u3001Lua \u5F15\u7528\u548C\u63A7\u4EF6\u5C5E\u6027\u4FDD\u6301\u4E0D\u53D8\u3002`)}var Oo=1;function To(t="n"){let e=`${t}${Oo}`;return Oo+=1,e}function dr(t=1){Oo=t}function Ro(t,{isRootContainer:e=!1}={}){if(t==="server-container"||t==="fullscreen"||t==="container"&&e)return ur({layout:"stretch"});let i=Us[t]||[80,80];return ur({layout:"center",size:i})}function qd(t,e){return Zs(()=>Ro(t,e))}function Ld(t){ni(t);let e={};for(let i of Le)e[i]=Ci(t,i);return e}function xe(t,e={}){if(!Xi[t])throw new Error(`unknown kind: ${t}`);Object.hasOwn(e,"transformByCanvas")&&Ii(e);let i=e.isRootContainer===!0,n=e.id||To(t==="server-container"?"sc":"n"),r=Object.hasOwn(e,"transformByPlatform")?Ld(e.transformByPlatform):qd(t,{isRootContainer:i}),o={id:n,kind:t,name:e.name||Xi[t],guid:e.guid??0,giaRelatedGuids:Array.isArray(e.giaRelatedGuids)?e.giaRelatedGuids.filter(a=>Number.isSafeInteger(Number(a))&&Number(a)>0).map(Number):[],...ht(Number(e.giaInfoIndex))?{giaInfoIndex:Number(e.giaInfoIndex),giaInfoIndexSource:e.giaInfoIndexSource==="authoring"?"authoring":"imported"}:{},active:e.active!==!1,visible:e.visible!==!1,canControllerFocus:e.canControllerFocus??e.giaRaw?.footerField505===1,syncAllDevices:e.syncAllDevices!==!1,giaRaw:il(t,e.giaRaw),transformByPlatform:r,children:[],scriptMappingIds:Array.isArray(e.scriptMappingIds)?e.scriptMappingIds.filter(a=>Number.isSafeInteger(Number(a))&&Number(a)>0).map(Number):[]};if(t==="container"&&(o.isolateNavigation=e.isolateNavigation===!0,o.disableKeyEventPassthrough=e.disableKeyEventPassthrough===!0,o.disableCursorEventPassthrough=e.disableCursorEventPassthrough===!0,o.showCursor=Object.hasOwn(e,"showCursor")?e.showCursor===!0:!0),(t==="textbox"||t==="textwindow")&&(o.fontSize=e.fontSize??20,o.adaptiveFontSize=e.adaptiveFontSize===!0,o.minimumFontSize=e.minimumFontSize??20,o.fontColor=e.fontColor??In.font,o.bgColor=e.bgColor??In.bg,o.enableOutline=e.enableOutline!==!1,o.outlineColor=e.outlineColor??In.outline,o.horizontalAlignment=e.horizontalAlignment||"Left",o.verticalAlignment=e.verticalAlignment||"Top",Number.isInteger(e.giaRaw?.textVerticalAlign)&&![0,1,2].includes(e.giaRaw.textVerticalAlign)&&(o.giaRaw.textVerticalAlign=e.giaRaw.textVerticalAlign),o.text=e.text??"",Object.hasOwn(e.giaRaw||{},"textAlign")||(o.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o.horizontalAlignment]??o.giaRaw.textAlign),t==="textwindow"&&(o.interactable=e.interactable!==!1,o.showScrollBar=e.showScrollBar!==!1)),t==="image"&&(o.imageSource=e.imageSource||"StaticReference",o.imageType=["Basic","Stretch"].includes(e.imageType)?e.imageType:null,o.imageId=e.imageId??100001,o.imageColor=e.imageColor??In.image,o.enableMask=e.enableMask===!0,o.enableSoftEdge=e.enableSoftEdge===!0,o.softEdgeMode=e.softEdgeMode||"Percentage",o.softEdgeWidthX=e.softEdgeWidthX??8,o.softEdgeWidthY=e.softEdgeWidthY??8,o.horizontalSoftRange=e.horizontalSoftRange??85,o.verticalSoftRange=e.verticalSoftRange??85,o.enableFill=e.enableFill===!0,o.fillType=e.fillType||"Horizontal",o.fillHorizontalType=e.fillHorizontalType||"Left",o.fillVerticalType=e.fillVerticalType||"Bottom",o.fillRadial90Type=e.fillRadial90Type||"BottomLeft",o.fillRadialType=e.fillRadialType||"Bottom",o.fillAmount=e.fillAmount??1,o.reverseMaskArea=e.reverseMaskArea===!0||e.reverseMask===!0,Object.hasOwn(e.giaRaw||{},"imageFillType")||(o.giaRaw.imageFillType={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o.fillType]??o.giaRaw.imageFillType)),t==="button"&&(o.raycastTarget=e.raycastTarget!==!1,o.interactable=e.interactable!==!1,o.clickAudioId=e.clickAudioId??Ys,o.unavailableChildId=e.unavailableChildId??null,o.hoverChildId=e.hoverChildId??null,o.pressedChildId=e.pressedChildId??null,o.selectedChildId=e.selectedChildId??null),t==="cursor"&&(o.raycastTarget=e.raycastTarget??e.giaRaw?.cursorField501!==0),t==="reference"&&(o.referencedPrefabId=e.referencedPrefabId??e.giaRaw?.templateRefSlot??null,Object.hasOwn(e.giaRaw||{},"templateRefSlot")||(o.giaRaw.templateRefSlot=String(o.referencedPrefabId??""))),t==="grid"&&(o.itemPrefabId=e.itemPrefabId??null,o.raycastTarget=e.raycastTarget!==!1,o.interactable=e.interactable!==!1,o.showScrollBar=e.showScrollBar!==!1,o.scrollDirection=e.scrollDirection||"Vertical",o.layoutConstraint=e.layoutConstraint||"AutoWrap",o.layoutConstraintFixedCount=e.layoutConstraintFixedCount??null,o.cellSizeX=e.cellSizeX??50,o.cellSizeY=e.cellSizeY??50,o.spacingX=e.spacingX??8,o.spacingY=e.spacingY??8,o.padding1X=e.padding1X??20,o.padding1Y=e.padding1Y??20,o.padding2X=e.padding2X??20,o.padding2Y=e.padding2Y??20,o.previewCount=e.previewCount??e.giaRaw?.gridField511??5,Object.hasOwn(e.giaRaw||{},"gridField511")||(o.giaRaw.gridField511=Math.trunc(o.previewCount))),t==="keyhint"&&(o.keyboardKeyCode=e.keyboardKeyCode??e.giaRaw?.keyHintField502??null,o.controllerKeyCode=e.controllerKeyCode??e.giaRaw?.keyHintField501??null,Object.hasOwn(e.giaRaw||{},"keyHintField502")||(o.giaRaw.keyHintField502=Math.trunc(o.keyboardKeyCode??1)),Object.hasOwn(e.giaRaw||{},"keyHintField501")||(o.giaRaw.keyHintField501=Math.trunc(o.controllerKeyCode??1))),t==="animation"||t==="fullscreen"){let a=t==="animation"?e.giaRaw?.effectSlot:e.giaRaw?.fullscreenEffectSlot;o.animationId=e.animationId??a??null,o.playSoundEffect=e.playSoundEffect??null,t==="animation"&&(o.layer=e.layer??null);let s=t==="animation"?"effectSlot":"fullscreenEffectSlot";Object.hasOwn(e.giaRaw||{},s)||(o.giaRaw[s]=String(o.animationId??""))}if(e.children)for(let a of e.children)o.children.push(a);return o}function Ai(){dr(1);let t=xe("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668"}),e=xe("container",{id:"n1",name:"\u5BB9\u5668\u8282\u70B9",isRootContainer:!0}),i=xe("textbox",{id:"n2",name:"\u6587\u672C\u6846",text:"\u6587\u672C"}),n=xe("cursor",{id:"n3",name:"\u5149\u6807\u68C0\u6D4B\u533A\u57DF"}),r=xe("reference",{id:"n4",name:"\u6A21\u677F\u5F15\u7528\u63A7\u4EF6"}),o=xe("grid",{id:"n5",name:"\u7F51\u683C\u89C6\u7A97"}),a=xe("button",{id:"n6",name:"\u9884\u8BBE\u6309\u94AE"}),s=xe("textwindow",{id:"n7",name:"\u6587\u672C\u89C6\u7A97"}),l=xe("keyhint",{id:"n8",name:"\u6309\u952E\u63D0\u793A"}),c=xe("image",{id:"n9",name:"\u56FE\u7247",imageId:100005}),f=xe("animation",{id:"n10",name:"\u754C\u9762\u52A8\u6548"}),h=xe("fullscreen",{id:"n11",name:"\u5168\u5C4F\u52A8\u6548"}),m=(p,b,g)=>{for(let w of Object.values(p.transformByPlatform))w.offset={x:b,y:g}};return m(i,-300,250),m(n,-300,140),m(r,-300,30),m(o,-300,-100),m(a,0,0),m(s,300,250),m(l,300,140),m(c,300,30),m(f,300,-100),e.children.push(i,n,r,o,a,s,l,c,f,h),t.children.push(e),dr(12),nl(t),{version:1,layoutSchemaVersion:Ze,meta:{name:"\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"authoring",sourceFile:""},canvasId:"pc-16-9",selectedId:"n2",root:t}}function en(){dr(1);let t=xe("server-container",{id:"sc1",name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"}),e=xe("container",{id:"n1",guid:1073742100,name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F"}),i=xe("textbox",{id:"n2",guid:1073742101,name:"\u6A21\u677F\u6807\u9898",text:"\u5BA2\u6237\u7AEF\u6A21\u677F\u5DF2\u5B9E\u4F8B\u5316",fontSize:28,horizontalAlignment:"Middle"}),n=xe("image",{id:"n3",guid:1073742102,name:"\u6A21\u677F\u56FE\u6807",imageId:100005}),r=xe("button",{id:"n4",guid:1073742103,name:"\u786E\u8BA4\u6309\u94AE"}),o=xe("textbox",{id:"n5",guid:1073742104,name:"\u6309\u94AE\u6587\u5B57",text:"\u786E\u8BA4",horizontalAlignment:"Middle",verticalAlignment:"Top"}),a=(c,f,h)=>{for(let m of Object.values(c.transformByPlatform))m.offset={x:f,y:h}};((c,f,h)=>{for(let m of Object.values(c.transformByPlatform))m.size={x:f,y:h}})(e,520,320),a(i,0,110),a(n,0,0),a(r,0,-110),r.children.push(o),e.children.push(i,n,r),t.children.push(e),dr(6);let l={version:1,layoutSchemaVersion:Ze,meta:{name:"Lua\u5B9E\u4F8B\u5316\u9762\u677F",assetType:"client-control-template",sourceFormat:"authoring",sourceFile:"",gameVersion:lr,giaOwnerUid:114514,giaFileId:1073741829,giaFileName:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia"},canvasId:"pc-16-9",selectedId:"n1",root:t};return Yt(l),l}function be(t,e,i=null){e(t,i);for(let n of t.children||[])be(n,e,t)}function Ye(t,e){let i=null;return be(t,n=>{n.id===e&&(i=n)}),i}function No(t,e="n"){let i=To(e);for(;Ye(t,i);)i=To(e);return i}function oi(t,e){let i=null;return be(t,(n,r)=>{n.id===e&&(i=r)}),i}function Po(t){let e=t.root||t;return e.kind==="container"?e:(e.children||[]).find(i=>i.kind==="container")||(e.children||[])[0]||e}function kn(t){if(t.meta?.assetType!=="client-control-template")return Po(t);let e=Ye(t.root,t.selectedId);if(!e||e.kind==="server-container")return t.root.children?.[0]||t.root;let i=oi(t.root,e.id);for(;i&&i.kind!=="server-container";)e=i,i=oi(t.root,e.id);return e}function Fo(t){Ii(t);let e={id:t.id,name:t.name,guid:t.guid,giaRelatedGuids:t.giaRelatedGuids,giaInfoIndex:t.giaInfoIndex,giaInfoIndexSource:t.giaInfoIndexSource,scriptMappingIds:t.scriptMappingIds,giaRaw:t.giaRaw,active:t.active,visible:t.visible,canControllerFocus:t.canControllerFocus,syncAllDevices:t.syncAllDevices,transformByPlatform:t.transformByPlatform};t.kind==="container"&&(e.isolateNavigation=t.isolateNavigation,e.disableKeyEventPassthrough=t.disableKeyEventPassthrough,e.disableCursorEventPassthrough=t.disableCursorEventPassthrough,e.showCursor=t.showCursor),(t.kind==="textbox"||t.kind==="textwindow")&&(e.fontSize=t.fontSize,e.adaptiveFontSize=t.adaptiveFontSize,e.minimumFontSize=t.minimumFontSize,e.fontColor=t.fontColor,e.bgColor=t.bgColor,e.enableOutline=t.enableOutline,e.outlineColor=t.outlineColor,e.horizontalAlignment=t.horizontalAlignment,e.verticalAlignment=t.verticalAlignment,e.text=t.text??"",t.kind==="textwindow"&&(e.interactable=t.interactable,e.showScrollBar=t.showScrollBar)),t.kind==="image"&&(e.imageSource=t.imageSource,e.imageType=t.imageType,e.imageId=t.imageId,e.imageColor=t.imageColor,e.enableMask=t.enableMask,e.enableSoftEdge=t.enableSoftEdge,e.softEdgeMode=t.softEdgeMode,e.softEdgeWidthX=t.softEdgeWidthX,e.softEdgeWidthY=t.softEdgeWidthY,e.horizontalSoftRange=t.horizontalSoftRange,e.verticalSoftRange=t.verticalSoftRange,e.enableFill=t.enableFill,e.fillType=t.fillType,e.fillHorizontalType=t.fillHorizontalType,e.fillVerticalType=t.fillVerticalType,e.fillRadial90Type=t.fillRadial90Type,e.fillRadialType=t.fillRadialType,e.fillAmount=t.fillAmount,e.reverseMaskArea=t.reverseMaskArea??t.reverseMask),t.kind==="button"&&(e.raycastTarget=t.raycastTarget,e.interactable=t.interactable,e.clickAudioId=t.clickAudioId,e.unavailableChildId=t.unavailableChildId??null,e.hoverChildId=t.hoverChildId??null,e.pressedChildId=t.pressedChildId??null,e.selectedChildId=t.selectedChildId??null),t.kind==="cursor"&&(e.raycastTarget=t.raycastTarget),t.kind==="reference"&&(e.referencedPrefabId=t.referencedPrefabId??null),t.kind==="grid"&&(e.itemPrefabId=t.itemPrefabId??null,e.raycastTarget=t.raycastTarget,e.interactable=t.interactable,e.showScrollBar=t.showScrollBar,e.scrollDirection=t.scrollDirection,e.layoutConstraint=t.layoutConstraint,e.layoutConstraintFixedCount=t.layoutConstraintFixedCount??null,e.cellSizeX=t.cellSizeX,e.cellSizeY=t.cellSizeY,e.spacingX=t.spacingX,e.spacingY=t.spacingY,e.padding1X=t.padding1X,e.padding1Y=t.padding1Y,e.padding2X=t.padding2X,e.padding2Y=t.padding2Y,e.previewCount=t.previewCount),t.kind==="keyhint"&&(e.keyboardKeyCode=t.keyboardKeyCode??null,e.controllerKeyCode=t.controllerKeyCode??null),(t.kind==="animation"||t.kind==="fullscreen")&&(e.animationId=t.animationId??null,e.playSoundEffect=t.playSoundEffect??null,t.kind==="animation"&&(e.layer=t.layer??null)),e.isRootContainer=t.kind==="container"&&jd(t.transformByPlatform);let i=xe(t.kind,e);return i.children=(t.children||[]).map(n=>Fo(n)),i}function jd(t){let e=t&&(t.KEYBOARD||Object.values(t)[0]);return e?Math.abs(e.anchorMin?.x??.5)<1e-4&&Math.abs(e.anchorMin?.y??.5)<1e-4&&Math.abs((e.anchorMax?.x??.5)-1)<1e-4&&Math.abs((e.anchorMax?.y??.5)-1)<1e-4:!1}function rl(t,e,i={}){if(t.kind==="server-container"&&e!=="container")throw new Error("server container only accepts container nodes");let n=xe(e,i);return t.children.push(n),n}function ol(t,e){if(t.id===e)throw new Error("cannot remove root");let i=oi(t,e);if(!i)return!1;let n=i.children.findIndex(r=>r.id===e);return n<0?!1:(i.children.splice(n,1),!0)}var al=1e-4;function Ud(t,e){return Math.abs(t.anchorMax[e]-t.anchorMin[e])>al&&Math.abs(t.size[e])<=al}function Yd(t,e,i){if(!(e.width>0)||!(e.height>0))throw new Error("source parent must have positive size");if(!(i.width>0)||!(i.height>0))throw new Error("target parent must have positive size");let n=jt(e,t),r=(n.centerX-e.left)/e.width,o=(n.centerY-e.bottom)/e.height,a=xi(i,t,{posX:i.left+r*i.width,posY:i.bottom+o*i.height,width:n.width,height:n.height});for(let s of["x","y"])Ud(t,s)&&(a.offset[s]=t.offset[s],a.size[s]=t.size[s]);return a}function sl({transformByPlatform:t,source:e,canvasId:i,syncAllDevices:n,sourceParentBox:r=Qe(i),targetParentBoxByPlatform:o={}}){ni(t);let a=_i(i),s={};for(let l of Le)l===a?s[l]=Nt(e):n!==!1?s[l]=Yd(e,r,o[l]||Qe(Hi[l])):s[l]=Ci(t,l);return ni(s),s}function ai(t,e){return Ci(t,_i(e))}import{createCanvas as l0}from"@napi-rs/canvas";import{existsSync as Wd,openSync as Jd,closeSync as Zd,fstatSync as Qd,readFileSync as e0}from"node:fs";import{extname as t0,isAbsolute as i0}from"node:path";import{createHash as n0}from"node:crypto";import{workerData as mr}from"node:worker_threads";import{GlobalFonts as hl}from"@napi-rs/canvas";var ll='"Microsoft YaHei UI","Microsoft YaHei","HarmonyOS Sans SC","Noto Sans CJK SC",sans-serif';var Mo=t=>`QxqyLocal_${t}`,cl=t=>t?`"${Mo(t)}",${ll}`:ll;import{existsSync as Hd,mkdirSync as mm,readFileSync as Xd,renameSync as bm,rmSync as gm,writeFileSync as ym}from"node:fs";import{homedir as zo}from"node:os";import{dirname as Sm,join as hr,win32 as pr}from"node:path";function fl(t=process.platform,e=process.env){if(t!=="win32")return[];let i=e.SystemDrive||"C:",n=e.ProgramFiles||`${i}\\Program Files`,r="YuanShen_Data\\StreamingAssets\\MiHoYoSDKRes\\HttpServerResources\\font\\zh-cn.ttf";return[...new Set([pr.join(n,"Genshin Impact","Genshin Impact Game",r),pr.join(i+"\\","Mihoyo","Genshin Impact","Genshin Impact Game",r),pr.join(n,"HoYoPlay","games","Genshin Impact game",r),pr.join(n,"miHoYo Launcher","games","Genshin Impact Game",r)])]}function Kd(){if(process.env.QXQY_FONT_CONFIG_PATH)return process.env.QXQY_FONT_CONFIG_PATH;let t=process.platform==="win32"?process.env.APPDATA||hr(zo(),"AppData","Roaming"):process.platform==="darwin"?hr(zo(),"Library","Application Support"):process.env.XDG_CONFIG_HOME||hr(zo(),".config");return hr(t,"beyond-simulator","font.json")}function ul(t){if(!t||!["auto","custom","system"].includes(t.mode))throw new Error("\u8BF7\u9009\u62E9\u81EA\u52A8\u67E5\u627E\u3001\u6307\u5B9A\u6587\u4EF6\u6216\u7CFB\u7EDF\u5B57\u4F53");let e=t.scope===void 0?"all":t.scope;if(!["game","all"].includes(e))throw new Error("\u8BF7\u9009\u62E9\u5B57\u4F53\u5E94\u7528\u8303\u56F4");let i=typeof t.path=="string"?t.path.trim():"";if(i.length>4096)throw new Error("\u5B57\u4F53\u8DEF\u5F84\u8FC7\u957F");if((i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))&&(i=i.slice(1,-1)),t.mode==="custom"&&!i)throw new Error("\u8BF7\u586B\u5199\u5B57\u4F53\u6587\u4EF6\u7684\u7EDD\u5BF9\u8DEF\u5F84");return{mode:t.mode,path:t.mode==="custom"?i:"",scope:e}}function dl(t=Kd()){if(!Hd(t))return{mode:"auto",path:"",scope:"all"};try{return ul(JSON.parse(Xd(t,"utf8")))}catch{throw new Error("\u672C\u673A\u5B57\u4F53\u8BBE\u7F6E\u65E0\u6CD5\u8BFB\u53D6\uFF0C\u8BF7\u5728\u300C\u5B57\u4F53\u8BBE\u7F6E\u300D\u4E2D\u91CD\u65B0\u4FDD\u5B58")}}function gl(t){let e=Buffer.from(t),i=e.subarray(0,4).toString("hex");if(e.length<12||e.length>33554432||!["00010000","4f54544f"].includes(i))throw new Error("QXQY_FONT_PATH must contain a valid TTF or OTF font (at most 32 MiB)");let n=n0("sha256").update(e).digest("hex"),r=Mo(n);try{if(!hl.has(r)&&!hl.register(e,r))throw new Error("invalid font")}catch{throw new Error("QXQY_FONT_PATH font could not be registered")}return{id:n,data:e,type:i==="4f54544f"?"font/otf":"font/ttf"}}function Do(t){if(!t)return null;if(!i0(t)||![".ttf",".otf"].includes(t0(t).toLowerCase()))throw new Error("QXQY_FONT_PATH must be an absolute path to a TTF or OTF font");let e,i;try{e=Jd(t,"r");let n=Qd(e);if(!n.isFile()||n.size<12||n.size>33554432)throw new Error("invalid size");i=e0(e)}catch{throw new Error("QXQY_FONT_PATH must point to a readable font file of at most 32 MiB")}finally{e!==void 0&&Zd(e)}return gl(i)}var pl=!1,br=null,On={path:"",source:"system",scope:"all"},gr=null,ml="";function r0(t){if(t.mode==="custom")return{font:Do(t.path),path:t.path,source:"custom"};if(t.mode==="auto"){let e;for(let i of fl())if(Wd(i))try{return{font:Do(i),path:i,source:"auto"}}catch(n){e=n}if(e)throw e}return{font:null,path:"",source:"system"}}function o0(){if(!pl){if(mr&&Object.hasOwn(mr,"localFont"))br=mr.localFont?gl(mr.localFont):null;else{try{gr=dl()}catch(t){ml=t.message}if(On.scope=gr?.scope||"all",process.env.QXQY_FONT_PATH)br=Do(process.env.QXQY_FONT_PATH),On={...On,path:process.env.QXQY_FONT_PATH,source:"environment"};else if(gr)try{let t=r0(gr);br=t.font,On={...On,path:t.path,source:t.source}}catch(t){ml=t.message}}pl=!0}return br}var yl=()=>cl(o0()?.id);var $o=Object.freeze({aqua:"00ffff",black:"000000",blue:"0000ff",brown:"a52a2a",cyan:"00ffff",darkblue:"0000a0",fuchsia:"ff00ff",green:"008000",grey:"808080",lightblue:"add8e6",lime:"00ff00",magenta:"ff00ff",maroon:"800000",navy:"000080",olive:"808000",orange:"ffa500",purple:"800080",red:"ff0000",silver:"c0c0c0",teal:"008080",white:"ffffff",yellow:"ffff00"});function a0(t){let e=Object.hasOwn($o,t.toLowerCase())?$o[t.toLowerCase()]:t.slice(1);return!Object.hasOwn($o,t.toLowerCase())&&!/^#[\da-f]{6}([\da-f]{2})?$/i.test(t)?null:(parseInt(e.slice(6)||"ff",16)<<24|parseInt(e.slice(0,6),16))>>>0}function s0(t){let e=/^<\/(b|i|color|size)>$/i.exec(t);if(e)return{name:e[1].toLowerCase(),close:!0};let i=/^<(b|i)>$/i.exec(t);if(i)return{name:i[1].toLowerCase(),value:!0};let n=/^<(color|size)=(?:"([^"\s<>]+)"|'([^'\s<>]+)'|([^\s'"<>]+))>$/i.exec(t);if(!n)return null;let r=n[1].toLowerCase(),o=n[2]??n[3]??n[4];if(r==="color"){let s=a0(o);return s===null?null:{name:r,value:s}}let a=Number(o);return/^\d+$/.test(o)&&Number.isSafeInteger(a)&&a>0?{name:r,value:a}:null}function vl(t){let e=String(t??"").replace(/\r\n?/g,`
12
+ `),i=[],n=[],r=0;for(let l of e.matchAll(/<[^<>\r\n]*>/g)){l.index>r&&i.push({text:e.slice(r,l.index)});let c={text:l[0],tag:s0(l[0]),paired:!1};i.push(c),r=l.index+l[0].length,c.tag&&(c.tag.close?n.at(-1)?.tag.name===c.tag.name?n.pop().paired=c.paired=!0:n.length=0:n.push(c))}r<e.length&&i.push({text:e.slice(r)});let o=[],a=[{bold:!1,italic:!1,size:null,color:null}],s=!1;for(let l of i)if(l.paired)if(s=!0,l.tag.close)a.pop();else{let c={b:"bold",i:"italic",size:"size",color:"color"}[l.tag.name];a.push({...a.at(-1),[c]:l.tag.value})}else if(l.text){let c=a.at(-1),f=o.at(-1);f&&["bold","italic","size","color"].every(h=>f[h]===c[h])?f.text+=l.text:o.push({text:l.text,...c})}return{rich:s,text:o.map(l=>l.text).join(""),runs:o}}function wl(t,e){return`${t.italic?"italic ":""}${t.bold?"bold ":""}${t.fontSize}px ${e}`}var ki=l0(1,1).getContext("2d"),Sl=new WeakMap,El=(t,e)=>Math.max(1,Math.trunc(Number.isFinite(Number(t))?Number(t):e));function c0(t,e,i,n,r,o){let a=[],s=[],l=0,c=e,f=0,h=()=>{let w=s.length?s.reduce(($,V)=>Math.max($,V.fontSize),0):c,S=w*1.2,_=s.length?s.reduce(($,V)=>Math.max($,V.ascent),0):w*.8,G=s.length?s.reduce(($,V)=>Math.max($,V.descent),0):w*.2,I=(S-_-G)/2+_;a.push({runs:s,width:l,top:f,height:S,baseline:I,fontSize:w}),f+=S,s=[],l=0};for(let w of t.runs){let S={fontSize:w.size??e,bold:w.bold,italic:w.italic,color:w.color};ki.font=wl(S,n);let _=ki.measureText("Mg"),G=_.fontBoundingBoxAscent??_.emHeightAscent??S.fontSize*.8,I=_.fontBoundingBoxDescent??_.emHeightDescent??S.fontSize*.2;c=S.fontSize;for(let $ of w.text){if($===`
13
+ `){h();continue}let V=s.at(-1),Y=V&&["fontSize","bold","italic","color"].every(O=>V[O]===S[O]),q=ki.measureText((Y?V.text:"")+$).width,x=l+q-(Y?V.width:0);s.length&&x>i&&(h(),V=null,q=ki.measureText($).width,x=q),V&&Y?(V.text+=$,V.width=q):s.push({text:$,...S,x:l,width:q,ascent:G,descent:I}),l=x}}h();let m=a.map(w=>w.runs.map(S=>S.text).join("")),p=a.reduce((w,S)=>Math.max(w,S.fontSize),0),b=r==="textbox"&&t.text?p*.25+4:0,g=t.text?f+b:0;return{fontSize:e,lines:m,lineHeight:e*1.2,contentHeight:f,blockInset:b,requiredHeight:g,textWidth:i,fits:g<=o+1e-6&&a.every(w=>w.width<=i+1e-6),richLines:a}}function Oi(t,e,i){let n=String(t.text??"").replace(/\r\n?/g,`
14
+ `),r=El(t.fontSize,20),o=Math.min(r,El(t.minimumFontSize,10)),a=t.adaptiveFontSize===!0,s=yl(),l=JSON.stringify([n,e,i,r,o,a,t.kind,t.showScrollBar,s]),c=Sl.get(t);if(c?.key===l)return c.value;let f=vl(n),h=(w,S)=>{if(f.rich)return c0(f,w,S,s,t.kind,i);ki.font=`${w}px ${s}`;let _=[];for(let q of n.split(`
15
+ `)){let x="";for(let O of q)x&&ki.measureText(x+O).width>S&&(_.push(x),x=""),x+=O;_.push(x)}let G=w*1.2,I=_.length*G,$=t.kind==="textbox"&&n?w*.25+4:0,V=n?I+$:0,Y=V<=i+1e-6&&_.every(q=>ki.measureText(q).width<=S+1e-6);return{fontSize:w,lines:_,lineHeight:G,contentHeight:I,blockInset:$,requiredHeight:V,textWidth:S,fits:Y}},m=Math.max(0,e-4),p=h(r,m);if(a&&!p.fits&&o<r){p=h(o,m);let w=o+1,S=r-1;for(;w<=S;){let _=Math.floor((w+S)/2),G=h(_,m);G.fits?(p=G,w=_+1):S=_-1}}t.kind==="textwindow"&&t.showScrollBar!==!1&&p.contentHeight>i&&(p=h(p.fontSize,Math.max(0,m-12)));let b=p.lines.length,g=p.contentHeight;if(t.kind==="textbox"&&(b=0,g=0,p.lines.join(`
16
+ `)))for(let w=0;w<p.lines.length;w++){let S=p.richLines?.[w],_=S?S.top+S.height:(w+1)*p.lineHeight;if(_+p.blockInset>i+1e-6)break;b=w+1,g=_}return p={...p,visibleLineCount:b,visibleContentHeight:g},Sl.set(t,{key:l,value:p}),p}var yr=t=>Number.isFinite(Number(t))?Math.max(0,Number(t)):0;function Tn(t,e){if(!t||t.kind!=="image"||t.enableMask!==!0||!e)return null;let i=yr(t.sourceWidth??t.width),n=yr(t.sourceHeight??t.height),r=t.enableSoftEdge===!0,o=t.softEdgeMode!=="Pixel",a=r?yr(t.softEdgeWidthX):0,s=r?yr(t.softEdgeWidthY):0;return{id:t.id,matrix:e,width:i,height:n,featherX:o?i*a/100:a,featherY:o?n*s/100:s}}function Ti(t,e,i){let n=wt(t,e,i);return{a:t.a,b:t.b,c:t.c,d:t.d,tx:n.x,ty:n.y}}function xl(t,e){let i=[];function n(r){e[r.id]&&i.push(e[r.id]);let o=r.children||[];for(let a=o.length-1;a>=0;a-=1)n(o[a])}return n(t),i}function si(t,e,i=_i(e)){let n=Qe(e),r={};function o(a,s,l,c=!0,f=[]){let h=Ci(a.transformByPlatform,i),m=jt(s,h),p=a.kind==="server-container"?l:An(l,m,h),b=Ks(m,p),g=c&&a.visible!==!1,w=a.kind==="image"&&a.enableMask===!0?Tn({...a,width:m.width,height:m.height},Ti(p,m.centerX,m.centerY)):null,S=w?[...f,w]:f;r[a.id]={...m,...Io(m),id:a.id,kind:a.kind,name:a.name,visible:a.visible!==!1,visibleInHierarchy:g,active:a.active!==!1,rotationX:h.rotation.x,rotationY:h.rotation.y,rotationZ:h.rotation.z,renderLeft:b.left,renderBottom:b.bottom,renderWidth:b.width,renderHeight:b.height,renderRotationZ:b.rotationZ,renderMatrix:p,...S.length?{masks:S}:{},primitive:a.kind==="image"?Ki(a.imageId,a.imageSource):null,...["animation","fullscreen"].includes(a.kind)?{animationId:a.animationId??null,playSoundEffect:a.playSoundEffect!==!1,layer:a.layer||"AboveAllControls"}:{},...a.kind==="textbox"||a.kind==="textwindow"?{text:a.text??"",fontSize:a.fontSize,adaptiveFontSize:a.adaptiveFontSize===!0,minimumFontSize:a.minimumFontSize,textLayout:Oi(a,m.width,m.height),fontColor:a.fontColor,bgColor:a.bgColor,enableOutline:a.enableOutline!==!1,outlineColor:a.outlineColor,horizontalAlignment:a.horizontalAlignment,verticalAlignment:a.verticalAlignment}:{},...a.kind==="image"?{imageSource:a.imageSource,imageType:a.imageType??null,imageId:a.imageId,imageColor:a.imageColor,enableMask:a.enableMask===!0,enableSoftEdge:a.enableSoftEdge===!0,softEdgeMode:a.softEdgeMode,softEdgeWidthX:a.softEdgeWidthX,softEdgeWidthY:a.softEdgeWidthY,horizontalSoftRange:a.horizontalSoftRange,verticalSoftRange:a.verticalSoftRange,enableFill:a.enableFill===!0,fillType:a.fillType,fillHorizontalType:a.fillHorizontalType,fillVerticalType:a.fillVerticalType,fillRadial90Type:a.fillRadial90Type,fillRadialType:a.fillRadialType,fillAmount:a.fillAmount,reverseMaskArea:a.reverseMaskArea===!0}:{},...a.kind==="button"?{raycastTarget:a.raycastTarget!==!1,interactable:a.interactable!==!1,clickAudioId:a.clickAudioId,unavailableChildId:a.unavailableChildId??null,hoverChildId:a.hoverChildId??null,pressedChildId:a.pressedChildId??null,selectedChildId:a.selectedChildId??null}:{}};let _=a.kind==="server-container"?s:m;for(let G of a.children||[])o(G,_,p,g,S)}return o(t,n,Ji()),{canvas:n,boxes:r}}function Go(t,e){let i=[];function n(r,o,a=null,s=[],l=0,c=1,f=t.id){i.push({id:r.id,guid:e?.get(r.id)??(r.guid||0),kind:r.kind,name:r.name,label:Xi[r.kind]||r.kind,depth:o,parentId:a,ancestorIds:s,siblingIndex:l,siblingCount:c,templateId:f,childCount:(r.children||[]).length,incomplete:!fr.includes(r.kind)});let h=r.children||[];for(let m=0;m<h.length;m+=1)n(h[m],o+1,r.id,[...s,r.id],m,h.length,f)}return n(t,0),i}function D(t,e,i,n,r={}){return{key:t,label:e,type:i,value:n,...r}}function _l(t,e,i,n){if(!t)return null;let r=ai(t.transformByPlatform,e),o=Io(i),a=[D("name","\u540D\u79F0","string",t.name),D("active","\u521D\u59CB\u6FC0\u6D3B","bool",t.active!==!1),D("visible","\u521D\u59CB\u53EF\u89C1\u6027","bool",t.visible!==!1),D("canControllerFocus","\u53EF\u88AB\u624B\u67C4\u6447\u6746\u5BFC\u822A\u9009\u4E2D","bool",t.canControllerFocus===!0),D("posX","\u4F4D\u7F6E X","number",o.posX,{computed:!0}),D("posY","\u4F4D\u7F6E Y","number",o.posY,{computed:!0}),D("width","\u5927\u5C0F W","number",o.width,{computed:!0}),D("height","\u5927\u5C0F H","number",o.height,{computed:!0}),D("rotationX","\u65CB\u8F6C X","number",r.rotation.x),D("rotationY","\u65CB\u8F6C Y","number",r.rotation.y),D("rotationZ","\u65CB\u8F6C Z","number",r.rotation.z),D("syncAllDevices","\u540C\u6B65\u4FE1\u606F\u81F3\u6240\u6709\u8BBE\u5907","bool",t.syncAllDevices!==!1),D("anchorType","\u951A\u70B9\u7C7B\u578B","enum",Js(r),{options:[{value:"center",label:"\u5C45\u4E2D"},{value:"top-left",label:"\u5DE6\u4E0A"},{value:"top",label:"\u4E0A\u65B9"},{value:"top-right",label:"\u53F3\u4E0A"},{value:"left",label:"\u5DE6\u4FA7"},{value:"right",label:"\u53F3\u4FA7"},{value:"bottom-left",label:"\u5DE6\u4E0B"},{value:"bottom",label:"\u4E0B\u65B9"},{value:"bottom-right",label:"\u53F3\u4E0B"},{value:"stretch",label:"\u53CC\u5411\u62C9\u4F38"},{value:"stretch-horizontal",label:"\u6C34\u5E73\u62C9\u4F38"},{value:"stretch-vertical",label:"\u5782\u76F4\u62C9\u4F38"},{value:"custom",label:"\u81EA\u5B9A\u4E49"}]}),D("anchorMinX","\u951A\u70B9 Min X","number",r.anchorMin.x),D("anchorMinY","\u951A\u70B9 Min Y","number",r.anchorMin.y),D("anchorMaxX","\u951A\u70B9 Max X","number",r.anchorMax.x),D("anchorMaxY","\u951A\u70B9 Max Y","number",r.anchorMax.y),D("pivotX","\u4E2D\u5FC3 X","number",r.pivot.x),D("pivotY","\u4E2D\u5FC3 Y","number",r.pivot.y)];if(t.kind==="container"&&a.push(D("isolateNavigation","\u9694\u79BB\u624B\u67C4\u5BFC\u822A","bool",t.isolateNavigation===!0),D("disableKeyEventPassthrough","\u5C4F\u853D\u6309\u952E\u4E8B\u4EF6\u7A7F\u900F","bool",t.disableKeyEventPassthrough===!0),D("disableCursorEventPassthrough","\u5C4F\u853D\u533A\u57DF\u5185\u70B9\u51FB\u4E8B\u4EF6\u7A7F\u900F","bool",t.disableCursorEventPassthrough===!0),D("showCursor","\u663E\u793A\u5E38\u9A7B\u5149\u6807","bool",t.showCursor===!0)),t.kind==="textbox"||t.kind==="textwindow"){let s=t.giaRaw?.textAlign,l=[0,1,2].includes(s)?t.horizontalAlignment||"Left":`__unrecognized:${s}`;a.push(D("fontSize","\u5B57\u53F7","number",t.fontSize),D("adaptiveFontSize","\u5B57\u53F7\u81EA\u9002\u5E94","bool",t.adaptiveFontSize===!0),D("minimumFontSize","\u6700\u5C0F\u5B57\u53F7","number",t.minimumFontSize),D("fontColor","\u6587\u672C\u8272","color",t.fontColor),D("bgColor","\u80CC\u666F\u8272","color",t.bgColor),D("enableOutline","\u542F\u7528\u63CF\u8FB9","bool",t.enableOutline!==!1),D("outlineColor","\u63CF\u8FB9\u8272","color",t.outlineColor),D("horizontalAlignment","\u6C34\u5E73\u5BF9\u9F50","enum",l,{...[0,1,2].includes(s)?{}:{unknownValue:s},options:[{value:"Left",label:"\u5DE6\u5BF9\u9F50"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Right",label:"\u53F3\u5BF9\u9F50"}]}),D("verticalAlignment","\u5782\u76F4\u5BF9\u9F50","enum",t.verticalAlignment||"Top",{options:[{value:"Top",label:"\u9876\u90E8"},{value:"Middle",label:"\u5C45\u4E2D"},{value:"Bottom",label:"\u5E95\u90E8"}]}),D("text","\u6587\u672C","text",t.text??""))}if(t.kind==="image"){let s=t.giaRaw?.imageFillType,l=[1,2,3,4,5].includes(s)?t.fillType:`__unrecognized:${s}`;a.push(D("imageSource","\u56FE\u7247\u6E90","enum",t.imageSource,{options:[{value:"StaticReference",label:"\u9759\u6001\u5F15\u7528"},{value:"Prefab",label:"\u5143\u4EF6"}]}),D("imageId","imageId","number",t.imageId??0),D("imageType","\u56FE\u7247\u7C7B\u578B","enum",t.imageType??null,{options:[{value:"Basic",label:"\u57FA\u7840"},{value:"Stretch",label:"\u62C9\u4F38"}]}),D("imageColor","\u586B\u5145\u8272","color",t.imageColor),D("enableMask","\u5F00\u542F\u906E\u7F69","bool",t.enableMask===!0),D("enableSoftEdge","\u8FB9\u7F18\u7FBD\u5316","bool",t.enableSoftEdge===!0,{gia:"W"}),D("softEdgeMode","\u7FBD\u5316\u6A21\u5F0F","enum",t.softEdgeMode,{options:[{value:"Percentage",label:"\u767E\u5206\u6BD4"},{value:"Pixel",label:"\u50CF\u7D20"}]}),D("softEdgeWidthX","\u7FBD\u5316\u5BBD\u5EA6 X","number",t.softEdgeWidthX),D("softEdgeWidthY","\u7FBD\u5316\u5BBD\u5EA6 Y","number",t.softEdgeWidthY),D("horizontalSoftRange","\u6C34\u5E73\u7FBD\u5316\u8303\u56F4","number",t.horizontalSoftRange),D("verticalSoftRange","\u5782\u76F4\u7FBD\u5316\u8303\u56F4","number",t.verticalSoftRange),D("enableFill","\u6309\u8FDB\u5EA6\u586B\u5145","bool",t.enableFill===!0,{gia:"W"}),D("fillType","\u5F62\u72B6","enum",l,{...[1,2,3,4,5].includes(s)?{}:{unknownValue:s},options:[{value:"Horizontal",label:"\u6A2A\u5411"},{value:"Vertical",label:"\u7EB5\u5411"},{value:"Radial90",label:"90\u5EA6\u73AF\u7ED5"},{value:"Radial180",label:"180\u5EA6\u73AF\u7ED5"},{value:"Radial360",label:"360\u5EA6\u73AF\u7ED5"}]}),D("fillHorizontalType","\u65B9\u5411","enum",t.fillHorizontalType,{options:[{value:"Left",label:"\u4ECE\u5DE6\u81F3\u53F3"},{value:"Right",label:"\u4ECE\u53F3\u81F3\u5DE6"}]}),D("fillVerticalType","\u65B9\u5411","enum",t.fillVerticalType,{options:[{value:"Bottom",label:"\u4ECE\u4E0B\u81F3\u4E0A"},{value:"Top",label:"\u4ECE\u4E0A\u81F3\u4E0B"}]}),D("fillRadial90Type","\u8D77\u70B9","enum",t.fillRadial90Type,{options:[{value:"BottomLeft",label:"\u5DE6\u4E0B"},{value:"TopLeft",label:"\u5DE6\u4E0A"},{value:"TopRight",label:"\u53F3\u4E0A"},{value:"BottomRight",label:"\u53F3\u4E0B"}]}),D("fillRadialType","\u8D77\u70B9","enum",t.fillRadialType,{options:[{value:"Bottom",label:"\u4E0B\u65B9"},{value:"Left",label:"\u5DE6\u4FA7"},{value:"Top",label:"\u4E0A\u65B9"},{value:"Right",label:"\u53F3\u4FA7"}]}),D("fillAmount","\u8FDB\u5EA6","percent",t.fillAmount),D("reverseMaskArea","\u906E\u7F69\u533A\u57DF\u53CD\u8F6C","bool",t.reverseMaskArea===!0,{gia:"W"}))}if(t.kind==="button"){let s=[{value:"",label:"\u672A\u8BBE\u7F6E"},...(t.children||[]).map(l=>({value:l.id,label:`${l.name} \xB7 ${l.id}`}))];a.push(D("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",t.raycastTarget!==!1),D("interactable","\u6309\u94AE\u662F\u5426\u53EF\u7528","bool",t.interactable!==!1),D("unavailableChildId","\u4E0D\u53EF\u7528\u72B6\u6001\u8282\u70B9","node",t.unavailableChildId,{options:s,gia:"W"}),D("hoverChildId","\u60AC\u505C\u72B6\u6001\u8282\u70B9","node",t.hoverChildId,{options:s,gia:"W"}),D("pressedChildId","\u6309\u4E0B\u72B6\u6001\u8282\u70B9","node",t.pressedChildId,{options:s,gia:"W"}),D("selectedChildId","\u9009\u4E2D\u72B6\u6001\u8282\u70B9","node",t.selectedChildId,{options:s,gia:"W"}),D("clickAudioId","\u70B9\u51FB\u97F3\u6548","number",t.clickAudioId))}return t.kind==="reference"&&a.push(D("referencedPrefabId","\u5F15\u7528\u63A7\u4EF6\u6A21\u677F\u7D22\u5F15","string",t.referencedPrefabId??"")),(t.kind==="textwindow"||t.kind==="grid")&&a.push(D("interactable","\u5141\u8BB8\u6EDA\u52A8\u4EA4\u4E92","bool",t.interactable!==!1),D("showScrollBar","\u663E\u793A\u6EDA\u52A8\u6761","bool",t.showScrollBar!==!1)),t.kind==="grid"&&a.push(D("itemPrefabId","\u5217\u8868\u9879\u6A21\u677F\u7D22\u5F15","number",t.itemPrefabId??0),D("raycastTarget","\u53EF\u88AB\u5149\u6807\u5C04\u7EBF\u68C0\u6D4B","bool",t.raycastTarget!==!1),D("scrollDirection","\u6EDA\u52A8\u65B9\u5411","enum",t.scrollDirection,{options:[{value:"Vertical",label:"\u7EB5\u5411"},{value:"Horizontal",label:"\u6A2A\u5411"}]}),D("layoutConstraint","\u6392\u5217\u9650\u5236","enum",t.layoutConstraint,{options:[{value:"AutoWrap",label:"\u81EA\u52A8\u6362\u884C"},{value:"Fixed",label:"\u56FA\u5B9A\u884C\u5217\u6570"}]}),D("layoutConstraintFixedCount","\u6BCF\u884C\u6216\u6BCF\u5217\u6570\u91CF","number",t.layoutConstraintFixedCount??1),D("cellSizeX","\u5217\u8868\u9879\u5927\u5C0F W","number",t.cellSizeX,{evidence:"W"}),D("cellSizeY","\u5217\u8868\u9879\u5927\u5C0F H","number",t.cellSizeY,{evidence:"W"}),D("spacingX","\u5217\u8868\u9879\u95F4\u9694 X","number",t.spacingX,{evidence:"W"}),D("spacingY","\u5217\u8868\u9879\u95F4\u9694 Y","number",t.spacingY,{evidence:"W"}),D("padding1X","\u8FB9\u8DDD\u5411\u91CF 1 X","number",t.padding1X,{evidence:"W"}),D("padding1Y","\u8FB9\u8DDD\u5411\u91CF 1 Y","number",t.padding1Y,{evidence:"W"}),D("padding2X","\u8FB9\u8DDD\u5411\u91CF 2 X","number",t.padding2X,{evidence:"W"}),D("padding2Y","\u8FB9\u8DDD\u5411\u91CF 2 Y","number",t.padding2Y,{evidence:"W"}),D("previewCount","\u9884\u89C8\u6570\u91CF","number",t.previewCount)),t.kind==="keyhint"&&a.push(D("keyboardKeyCode","\u952E\u9F20\u6309\u952E","number",t.keyboardKeyCode??t.giaRaw?.keyHintField502??1,{gia:"W"}),D("controllerKeyCode","\u624B\u67C4\u6309\u952E","number",t.controllerKeyCode??t.giaRaw?.keyHintField501??1)),(t.kind==="animation"||t.kind==="fullscreen")&&(a.push(D("animationId",t.kind==="animation"?"\u52A8\u6548\u7D22\u5F15":"\u5168\u5C4F\u52A8\u6548\u7D22\u5F15","string",t.animationId??"")),a.push(D("playSoundEffect","\u64AD\u653E\u52A8\u6548\u97F3\u6548","bool",t.playSoundEffect!==!1)),t.kind==="animation"&&a.push(D("layer","\u52A8\u6548\u5C42\u7EA7","enum",t.layer||"AboveAllControls",{options:[{value:"AboveAllControls",label:"\u6240\u6709\u63A7\u4EF6\u4E4B\u4E0A"},{value:"BelowAllControls",label:"\u6240\u6709\u63A7\u4EF6\u4E4B\u4E0B"}]}))),(!fr.includes(t.kind)||t.kind==="textwindow"||t.kind==="grid")&&a.push(D("incomplete","\u5B8C\u6574\u5EA6","note",t.kind==="textwindow"||t.kind==="grid"?"\u8BD5\u73A9\u652F\u6301\u57FA\u7840\u6EDA\u52A8\uFF1B\u6EDA\u52A8\u4EA4\u4E92\u3001\u6EDA\u52A8\u6761\u53CA\u5217\u8868\u914D\u7F6E\u4EE5 JSON/Lua \u4E3A\u51C6\uFF0C\u76F8\u5173 GIA \u5F00\u5173\u6620\u5C04\u5C1A\u672A\u6838\u5B9E\u3002":["animation","fullscreen"].includes(t.kind)?"\u652F\u6301\u6D4F\u89C8\u5668\u52A8\u6548\u64AD\u653E\uFF1B\u975E\u7A7A\u52A8\u6548 GIA \u914D\u7F6E\u5C1A\u672A\u6838\u5B9E\u3002":"\u672C\u9636\u6BB5\u4EC5\u516C\u5171\u53D8\u6362\uFF0C\u4E1A\u52A1\u69FD\u4E0D\u5B8C\u6574")),{id:t.id,guid:n?.get(t.id)??(t.guid||0),kind:t.kind,label:Xi[t.kind]||t.kind,incomplete:!fr.includes(t.kind),fields:a}}function Il(t,e,i){let n=(Array.isArray(t)?t:Object.values(t)).filter(r=>r.kind!=="server-container");for(let r=n.length-1;r>=0;r-=1){let o=n[r];if(!o.visible||o.visibleInHierarchy===!1||!o.active)continue;let a=o.renderMatrix&&Zi(o.renderMatrix),s=a&&wt(a,e,i);if(s&&s.x>=o.left&&s.x<=o.right&&s.y>=o.bottom&&s.y<=o.top)return o.id}return null}var Tf=Nd(kf(),1);function mn(t,e=!1){let i=[],n=(r,o)=>{r.kind!=="server-container"&&i.push({node:r,parent:o});let a=e&&r.kind!=="server-container"?[...r.children||[]].reverse():r.children||[];for(let s of a)n(s,r)};return n(t.root,null),i}var O1=String.raw`
14
17
  syntax = "proto3";
15
18
  // Root.graph is singular in the game's canonical schema, but template-list
16
19
  // assets legally emit field 1 more than once. Model it as repeated here so
@@ -111,13 +114,13 @@ message ImageConfig {
111
114
  message SliceVector { float field501 = 501; float field502 = 502; }
112
115
  }
113
116
  message FooterSlot { int32 field505 = 505; }
114
- `,{root:hp}=gf.default.parse(dp,{keepCase:!1}),It=hp.lookupType("Root"),gi=20,Cs=4,yf=806,vf=1657,zr={image:23,"server-container":24,container:25,grid:26,reference:27,button:28,animation:29,fullscreen:30,textbox:31,textwindow:32,cursor:33,keyhint:34},bf={KEYBOARD:0,TOUCHSCREEN:1,CONTROLLER_CONSOLE:2,CONTROLLER_MOBILE:3},pp="server-control-template",Vn="client-control-template";function Bn(t,e){let i=Number(t);return Number.isFinite(i)?i:e}var mp=Object.fromEntries(Object.entries(bf).map(([t,e])=>[e,t])),wf=Object.freeze({container:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["68/91","empty78","containerNodeSlot"],["67/90","empty77","footerSlot"]],textbox:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["64/84","empty74","textConfig"],["67/90","empty77","footerSlot"]],cursor:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["65/85","empty75","cursorConfig"],["67/90","empty77","footerSlot"]],reference:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["66/89","empty76","templateRefSlot"],["67/90","empty77","footerSlot"]],grid:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["69/92","empty79","gridView"],["67/90","empty77","footerSlot"]],button:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["70/93","empty80","buttonPreset"],["67/90","empty77","footerSlot"]],textwindow:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["71/94","empty81","textConfig"],["67/90","empty77","footerSlot"]],keyhint:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["72/95","empty82","keyHint"],["67/90","empty77","footerSlot"]],image:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["73/96","empty83","imageSlot"],["74/97","empty84","image"],["67/90","empty77","footerSlot"]],animation:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["75/98","empty85","effectSlot"],["67/90","empty77","footerSlot"]],fullscreen:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["76/99","empty86","fullscreenEffectSlot"],["67/90","empty77","footerSlot"]]}),Sf=Object.freeze({"4/23":5,"4/86":5,"1/12":4,"62/82":64,"63/83":65,"64/84":66,"65/85":67,"66/89":68,"67/90":69,"68/91":70,"69/92":71,"70/93":72,"71/94":66,"72/95":74,"73/96":75,"74/97":76,"75/98":77,"76/99":78}),gp=Object.freeze([["2/15","name",null],["4/23","field14","field14"],["1/12","transform","transform"],["62/82","empty72","rootChildRef"]]);function Es(t){return{class:1,type:8,id:t}}function Dr(t,e,i,r){return{...r,field501:e,field502:i,field503:1,nodeRef:Es(t)}}function yp(t){let e=[],i=t.meta?.assetType==="client-control-template";return ke(t.root,r=>{i&&r.kind==="server-container"||e.push(r)}),e}function $r(t,e=new Set){let i=new Map,r=[];for(let n of yp(t)){let o=Number(n.guid);gt(o)&&!e.has(o)?(e.add(o),n.guid=o,i.set(n.id,o)):r.push(n)}for(let n of r){let o=ii(e);e.add(o),n.guid=o,i.set(n.id,o)}return i}function vp(t){return{scale:{x:t.scale.x,y:t.scale.y,z:t.scale.z},anchorMin:{x:t.anchorMin.x,y:t.anchorMin.y},anchorMax:{x:t.anchorMax.x,y:t.anchorMax.y},offset:{x:t.offset.x,y:t.offset.y},size:{x:t.size.x,y:t.size.y},pivot:{x:t.pivot.x,y:t.pivot.y},field508:Object.fromEntries(Object.entries(t.rotation).filter(([,e])=>e!==0))}}function bp(t,e){let r={multiPlatform:{platforms:Be.map(n=>({platformType:bf[n],transform:vp(t.transformByPlatform[n])})),field502:zr[t.kind]||25,...t.syncAllDevices===!1?{}:{field504:1}},type:2};return{transform:{multiPlatform:{},type:2},field501:1,field502:12,details:Dr(e,4,12,{transform:r})}}function wp(t,e,i){let r=i?{empty15:"",field501:5}:{field17:{},field501:7},n=i?r:{...r,...t.visible===!1?{field17:{initiallyHidden:!0}}:{},...t.active===!1?{initiallyInactive:!0}:{}};return[{name:{value:t.name},field501:2,field502:15},{field14:r,field501:4,field502:i?23:86,details:Dr(e,5,i?23:86,{field14:n})},bp(t,e)]}function Sp(t,e,i,r){let n=(u,f,h,p,m)=>({[h]:"",field501:u,field502:f,details:Dr(e,u+2,f,{[p]:m})}),o=t.giaRaw||{},s=Array.isArray(t.scriptMappingIds)&&t.scriptMappingIds.length?{field501:o.genericField501||1,field502:t.scriptMappingIds.map(u=>({field1:{id:Number(u)}}))}:{field501:o.genericField501??0},a=n(63,83,"empty73","genericSlot",s),l=n(67,90,"empty77","footerSlot",{field505:[void 0,0,1].includes(o.footerField505)?t.canControllerFocus?1:0:o.footerField505});if(t.kind==="container")return[a,n(68,91,"empty78","containerNodeSlot",{...t.isolateNavigation?{isolateNavigation:!0}:{},...t.disableKeyEventPassthrough?{disableKeyEventPassthrough:!0}:{},...t.disableCursorEventPassthrough?{disableCursorEventPassthrough:!0}:{},...t.showCursor?{showCursor:!0}:{}}),l];if(t.kind==="textbox"||t.kind==="textwindow"){t.verticalAlignment==="Middle"&&r.push(`${t.name}: \u5782\u76F4\u5C45\u4E2D\u6309\u63A8\u5B9A\u503C\u5BFC\u51FA\uFF0C\u5C1A\u5F85\u5B9E\u673A\u786E\u8BA4\u3002`);let u={Left:0,Middle:1,Right:2}[t.horizontalAlignment]??0,f=Number.isFinite(o.textAlign)?Math.trunc(o.textAlign):u,h={field501:o.textField501??20,field503:o.textField503??12,color:t.fontColor>>>0,color2:t.bgColor>>>0,color3:t.outlineColor>>>0,text:{value:t.text||""},fontSize:Math.trunc(t.fontSize),minimumFontSize:Math.trunc(t.minimumFontSize),...t.adaptiveFontSize?{adaptive:1}:{},...t.enableOutline===!1?{outlineOff:1}:{},...f?{align:f}:{},verticalAlign:o.textVerticalAlign??{Top:0,Middle:1,Bottom:2}[t.verticalAlignment]??0};return t.kind==="textwindow"?((t.interactable===!1||t.showScrollBar===!1)&&r.push(`${t.name}: \u6587\u672C\u89C6\u7A97\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),h.field511=o.textField511??1,h.viewFlags={field502:o.textViewField502??1,field503:o.textViewField503??1},[a,{empty81:"",field501:71,field502:94,details:Dr(e,66,94,{textConfig:h})},l]):[a,n(64,84,"empty74","textConfig",h),l]}if(t.kind==="image"){let u=[0,1].includes(o.imageSlotType??0)?t.imageType==="Stretch"?1:0:o.imageSlotType;t.imageType==null&&t.imageSource==="StaticReference"&&t.imageId>100006&&r.push(`${t.name}: \u56FE\u7247\u7C7B\u578B\u968F\u7D20\u6750\u8FB9\u754C\u81EA\u52A8\u9009\u62E9\uFF0CGIA \u6309\u57FA\u7840\u5BFC\u51FA\uFF1B\u9700\u8981\u62C9\u4F38\u8BF7\u5148\u660E\u786E\u9009\u62E9\u6216\u5728 Lua \u8BBE\u7F6E imageType\u3002`),t.imageSource&&t.imageSource!=="StaticReference"&&r.push(`${t.name}: \u56FE\u7247\u6765\u6E90 ${t.imageSource} \u4EC5\u4FDD\u5B58\u5728 JSON\uFF0C\u5C1A\u672A\u6620\u5C04\u5230 GIA\uFF1B\u8BF7\u5728 Lua \u4E2D\u7528 SetImage(Enum.ImageSource.${t.imageSource}, ${t.imageId}) \u8BBE\u7F6E\u3002`);let f={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[t.fillType],h=Number.isFinite(o.imageFillType)?Math.trunc(o.imageFillType):f||1;t.enableFill&&!h&&r.push(`${t.name}: \u586B\u5145\u5F62\u72B6\u539F\u59CB\u679A\u4E3E\u4E3A 0\uFF0C\u5DF2\u5173\u95ED\u5BFC\u51FA\u6587\u4EF6\u4E2D\u7684\u8FDB\u5EA6\u586B\u5145\u3002`),t.fillType==="Horizontal"&&t.fillHorizontalType!=="Left"&&r.push(`${t.name}: \u5F53\u524D\u6A2A\u5411\u586B\u5145\u65B9\u5411\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`),t.fillType==="Radial180"&&t.fillRadialType!=="Bottom"&&r.push(`${t.name}: \u5F53\u524D 180 \u5EA6\u586B\u5145\u8D77\u70B9\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`);let p={field502:o.imageField502??1,field504:o.imageField504??1,field505:o.imageField505??1,field507:o.imageField507??2,field508:Math.round(Math.max(0,Math.min(1,Number(t.fillAmount)||0))*100),border:{field501:Bn(t.softEdgeWidthX,8),field502:Bn(t.softEdgeWidthY,8)},field512:Bn(t.horizontalSoftRange,85),field513:Bn(t.verticalSoftRange,85),fillType:h,...t.enableMask?{enableMask:1}:{},...t.enableSoftEdge?{enableSoftEdge:1}:{},...t.softEdgeMode==="Pixel"?{softEdgePixel:1}:{},...t.enableFill&&h?{enableFill:1}:{},...t.reverseMaskArea?{reverseMask:1}:{}};return[a,n(73,96,"empty83","imageSlot",{field502:Number.isFinite(t.imageColor)?t.imageColor>>>0:4294967295,assetId:t.imageId>>>0,...u?{imageType:u}:{}}),n(74,97,"empty84","image",p),l]}if(t.kind==="button"){let u=(g,b)=>{let C=t[g];return C?(t.children||[]).some(k=>k.id===C)?i.get(C)||0:(r.push(`${t.name}: ${b}\u72B6\u6001\u8282\u70B9\u4E0D\u662F\u6309\u94AE\u7684\u76F4\u63A5\u5B50\u63A7\u4EF6\uFF0CGIA \u672A\u5199\u5165\u8BE5\u72B6\u6001\u3002`),0):0},f=u("unavailableChildId","\u4E0D\u53EF\u7528"),h=u("hoverChildId","\u60AC\u505C"),p=u("pressedChildId","\u6309\u4E0B"),m=u("selectedChildId","\u9009\u4E2D");return[a,n(70,93,"empty80","buttonPreset",{clickAudioId:Math.trunc(t.clickAudioId),...f?{disabledChild:f}:{},...h?{hoverChild:h}:{},...p?{pressedChild:p}:{},...m?{selectedChild:m}:{},...t.interactable?{interactable:1}:{},...t.raycastTarget?{raycastTarget:1}:{}}),l]}if(t.kind==="cursor")return[a,n(65,85,"empty75","cursorConfig",{field501:[void 0,0,1].includes(o.cursorField501)?t.raycastTarget!==!1?1:0:o.cursorField501}),l];if(t.kind==="reference"){let u=o.templateRefSlotBase64;(u||o.templateRefOuterBase64)&&r.push(`${t.name}: \u6A21\u677F\u5F15\u7528\u7684\u975E\u7A7A\u4E8C\u8FDB\u5236\u914D\u7F6E\u5C1A\u672A\u89E3\u6790\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u88AB\u5F15\u7528\u6A21\u677F\u3002`);let f=n(66,89,"empty76","templateRefSlot",u?Buffer.from(u,"base64"):Buffer.from(o.templateRefSlot??"","utf8"));return f.empty76=Buffer.from(o.templateRefOuterBase64||"","base64"),[a,f,l]}return t.kind==="grid"?((t.itemPrefabId||t.interactable===!1||t.showScrollBar===!1||t.raycastTarget===!1||t.scrollDirection!=="Vertical"||t.layoutConstraint!=="AutoWrap")&&r.push(`${t.name}: \u7F51\u683C\u5217\u8868\u9879\u6A21\u677F\u3001\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u3001\u6EDA\u52A8\u65B9\u5411\u53CA\u6392\u5217\u9650\u5236\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),[a,n(69,92,"empty79","gridView",{field501:o.gridField501??1,cellSize:{field501:t.cellSizeX,field502:t.cellSizeY},gap:{field501:t.spacingX,field502:t.spacingY},padding1:{field501:t.padding1X,field502:t.padding1Y},padding2:{field501:t.padding2X,field502:t.padding2Y},field507:o.gridField507??1,field508:o.gridField508??1,field509:o.gridField509??1,field511:o.gridField511??5,field512:o.gridField512??1}),l]):t.kind==="keyhint"?[a,n(72,95,"empty82","keyHint",{field501:Number.isFinite(o.keyHintField501)?Math.trunc(o.keyHintField501):t.controllerKeyCode??1,field502:Number.isFinite(o.keyHintField502)?Math.trunc(o.keyHintField502):t.keyboardKeyCode??1}),l]:t.kind==="animation"?[a,n(75,98,"empty85","effectSlot",o.effectSlot??""),l]:t.kind==="fullscreen"?[a,n(76,99,"empty86","fullscreenEffectSlot",o.fullscreenEffectSlot??""),l]:(r.push(`${t.name}: ${t.kind} \u4E0D\u662F\u5DF2\u77E5 GIA \u63A7\u4EF6\u7C7B\u578B\uFF0C\u5DF2\u4EC5\u5199\u516C\u5171\u53D8\u6362\u3002`),[a,l])}function xp(t,e){if(e)return 1;if(!lt(t.giaInfoIndex))throw new Error(`${t.name}: \u7F3A\u5C11\u5408\u6CD5\u7684\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7`);return t.giaInfoIndex}function _p(t,e,i){let r=Array.isArray(t.giaRelatedGuids)?t.giaRelatedGuids.filter(n=>Number.isSafeInteger(n)&&n>0&&n<=2147483647):[];return r.length?r:(e.push(`${t.name}: \u65B0${i}\u5199\u5165\u663E\u5F0F\u7A7A Info.related\uFF0C\u907F\u514D\u8DE8\u6C99\u7BB1\u590D\u7528\u4F34\u751F\u8D44\u6E90 GUID \u4EA7\u751F\u65E0\u6CD5\u52A0\u8F7D\u7684\u7D22\u5F15\u3002`),[])}function ks(t,e){let i=String(t.meta?.giaFilePath||"").trim();if(/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i))return i;let r=(u,f)=>Number.isSafeInteger(Number(u))&&Number(u)>0?Number(u):f,n=r(t.meta?.giaOwnerUid,114514),o=r(t.meta?.giaTimestamp,Math.floor(Date.now()/1e3)),s=r(t.meta?.giaFileId,e?1073741829:1073741830),a=e?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F-\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668.gia",l=String(t.meta?.giaFileName||a).replace(/[\\/:*?"<>|]/gu,"-").replace(/\.gia$/iu,"").trim()||a.replace(/\.gia$/iu,"");return`${n}-${o}-${s}-\\${l}.gia`}function Ln(t,e,i,r,n,o=!1,s=!1,a=s,l=!1){let u=i.get(t.id),h=(l?[...t.children||[]].reverse():t.children||[]).map(g=>i.get(g.id)),p=o?r:h,m=wp(t,u,o);if(o){let g=t.children?.[0];g&&m.push({empty72:"",field501:62,field502:82,details:Dr(u,64,82,{rootChildRef:{guid:i.get(g.id)}})})}else m.push(...Sp(t,u,i,n));return{id:Es(u),relatedIds:p.map(g=>Es(g)),name:t.name,which:o?21:s?70:15,ui:{content:{guid:u,info:[{guid:{value:u},field501:1,field502:5},...o||a?[{index:{value:xp(t,o)},field501:2,field502:6}]:[],...o||s?[{related:{value:_p(t,n,o?"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F")},field501:4,field502:4}]:[]],children:o?[]:h,parent:e&&e.kind!=="server-container"?i.get(e.id):0,data:m}}}}function Ip(t,e){let i=new Map;for(let r of t||[]){if(!r.controlId||!(e===Vn?r.controlAsset===Vn:r.controlAsset!==Vn))continue;let o=i.get(r.controlId)||[];o.push(r.guid),i.set(r.controlId,o)}return i}function xf(t,e,i,r){let n=Ip(e,i),o=new Map;ke(t.root,s=>{n.has(s.id)&&(o.set(s,s.scriptMappingIds),s.scriptMappingIds=n.get(s.id))});try{return r()}finally{for(let[s,a]of o)a===void 0?delete s.scriptMappingIds:s.scriptMappingIds=a}}function As(t){let e=Number(t.meta?.giaModeFlag);return Number.isSafeInteger(e)&&e>=0?{modeFlag:e}:{}}function Os(t){let e=t.meta?.gameVersion;return!e||e==="7.0.50"?rn:e}function _f(t,e,i,r,n=[]){let o=fr(t,!0),s=o.filter(({parent:f})=>f?.kind==="server-container");if(!s.length)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6A21\u677F");let a=new Set(s.map(({node:f})=>f.id)),l=o.filter(({node:f})=>!a.has(f.id)),u=o.map(({node:f})=>e.get(f.id));return xf(t,n,Vn,()=>({graph:s.map(({node:f,parent:h})=>Ln(f,h,e,u,i,!1,!0,!0,!0)),accessories:l.map(({node:f,parent:h})=>Ln(f,h,e,u,i,!1,!1,!0,!0)),filePath:r||ks(t,!0),gameVersion:Os(t),...As(t)}))}function If(t,e,i,r,n){let o=fr(t),s=[o[0],...o.slice(1).reverse()],a=s.map(({node:l})=>e.get(l.id));return xf(t,i.scripts,pp,()=>({graph:[Ln(t.root,null,e,a,r,!0,!1,!1,!0),...i.units||[]],accessories:s.map(({node:l,parent:u})=>Ln(l,u,e,a,r,!1,!1,!1,!0)),filePath:n||ks(t,!1),gameVersion:Os(t),...As(t)}))}function Cf(t,e){let i=Ts(t),r=e(i);if(!r.valid)throw new Error(`GIA compatibility validation failed:
115
- ${r.errors.join(`
116
- `)}`);return i}function Ef(t,e={}){ke(t.root,Ii);let i=[];Lt(t,{warnings:i});let r=$r(oe(t)),n=t.meta?.assetType==="client-control-template",o;if(n)o=_f(t,r,i,void 0,e.scripts||[]);else{let a=Rs(e.scripts||[],new Set(r.values()));i.push(...a.warnings),o=If(t,r,a,i)}return{buffer:Cf(o,n?Ps:Fs),warnings:[...new Set(i)]}}function kf(t,e,i={}){ke(t.root,Ii),e&&ke(e.root,Ii);let r=["\u6574\u5408\u5305\u628A\u670D\u52A1\u7AEF UIControlGroup \u4E0E\u5BA2\u6237\u7AEF UIControlTemplate \u5E76\u6392\u5199\u5165\u540C\u4E00 GIA \u7684 Root.graph\uFF1B\u5BFC\u5165\u65F6\u62C6\u56DE\u4E24\u7C7B\u8D44\u4EA7\uFF0C\u6A21\u677F\u8FB9\u754C\u3001\u811A\u672C\u6620\u5C04\u4E0E\u63A7\u4EF6\u6302\u8F7D\u5173\u7CFB\u4F1A\u4FDD\u7559\u3002"];e&&Lt(e,{warnings:r});let n=e?.root?.children||[];n.length||r.push("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4E3A\u7A7A\uFF0C\u6574\u5408\u5305\u53EA\u5305\u542B\u670D\u52A1\u7AEF\u63A7\u4EF6\u4E0E\u811A\u672C\u3002");let o=new Set,s=oe(t),a=e?oe(e):null,l=$r(s,o),u=Rs(i.scripts||[],o);r.push(...u.warnings.filter(C=>C!==Of));let f=String(i.fileName||`${s.meta?.name||"\u6574\u5408\u5305"} \xB7 \u6574\u5408\u5305.gia`),h=ks({...s,meta:{...s.meta,giaFileName:f}},!1),p=If(s,l,u,r,h),m={graph:[],accessories:[]};if(n.length&&a){let C=$r({...a,meta:{...a.meta,assetType:"client-control-template"}},o);m=_f(a,C,r,h,u.scripts)}let g={graph:[...p.graph,...m.graph],accessories:[...p.accessories,...m.accessories],filePath:h,gameVersion:Os({meta:{gameVersion:t.meta?.gameVersion||e?.meta?.gameVersion}}),...As(t)};return{buffer:Cf(g,Fs),warnings:[...new Set(r)]}}var Pi=69,Af=30,Of="\u811A\u672C\u6302\u8F7D\u5173\u7CFB\u4E0D\u8FDB\u5165 GIA\uFF1A\u5B98\u65B9 script.gia \u53EA\u542B\u6620\u5C04\uFF08ID/\u540D\u79F0/\u8DEF\u5F84/\u6E90\u7801\uFF09\uFF0C\u5BFC\u5165\u540E\u9700\u91CD\u65B0\u6302\u8F7D\u3002";function Cp(t){return(String(t.path||"").replace(/\\/g,"/").split("/").pop()||"").replace(/\.lua$/iu,"")||`\u811A\u672C${t.id||""}`}function Ts(t){let e=It.verify(t);if(e)throw new Error(`GIA encode validation failed: ${e}`);let i=It.encode(It.create(t)).finish(),r=Buffer.alloc(gi+i.length+Cs);return r.writeUInt32BE(r.length-4,0),r.writeUInt32BE(1,4),r.writeUInt32BE(yf,8),r.writeUInt32BE(3,12),r.writeUInt32BE(i.length,16),Buffer.from(i).copy(r,gi),r.writeUInt32BE(vf,gi+i.length),r}function Rs(t,e=new Set){let i=(t||[]).filter(s=>s.path||s.source).map(s=>({...s})),r=[];for(let s of i){let a=Number(s.guid);gt(a)&&!e.has(a)?(e.add(a),s.guid=a):r.push(s)}for(let s of r){let a=ii(e);e.add(a),s.guid=a}let n=[];return(t||[]).some(s=>s.controlId)&&n.push(Of),{units:i.map(s=>{let a=Cp(s),l=String(s.path||"").replace(/\\/g,"/"),u=/\.lua$/iu.test(l)?l:`${l||a}.lua`,f={id:s.guid,name:a,filePath:u};return String(s.source||"")&&(f.source=String(s.source)),{id:{class:Af,id:s.guid},name:a,which:Pi,script:{mapping:f}}}),warnings:n,scripts:i}}function Tf(t){let e=Rs(t);if(!e.units.length)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let i={graph:e.units,filePath:`114514-${Math.floor(Date.now()/1e3)}-1073741832-\\script.gia`,gameVersion:"7.0.51"},r=Ts(i),n=Ep(r);if(!n.valid)throw new Error(`GIA compatibility validation failed:
117
+ `,{root:T1}=Tf.default.parse(O1,{keepCase:!1}),kt=T1.lookupType("Root"),yi=20,Pa=4,Rf=806,Nf=1657,Bn={image:23,"server-container":24,container:25,grid:26,reference:27,button:28,animation:29,fullscreen:30,textbox:31,textwindow:32,cursor:33,keyhint:34},Pf={KEYBOARD:0,TOUCHSCREEN:1,CONTROLLER_CONSOLE:2,CONTROLLER_MOBILE:3},R1="server-control-template",Kr="client-control-template";function Xr(t,e){let i=Number(t);return Number.isFinite(i)?i:e}var N1=Object.fromEntries(Object.entries(Pf).map(([t,e])=>[e,t])),Ff=Object.freeze({container:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["68/91","empty78","containerNodeSlot"],["67/90","empty77","footerSlot"]],textbox:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["64/84","empty74","textConfig"],["67/90","empty77","footerSlot"]],cursor:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["65/85","empty75","cursorConfig"],["67/90","empty77","footerSlot"]],reference:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["66/89","empty76","templateRefSlot"],["67/90","empty77","footerSlot"]],grid:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["69/92","empty79","gridView"],["67/90","empty77","footerSlot"]],button:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["70/93","empty80","buttonPreset"],["67/90","empty77","footerSlot"]],textwindow:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["71/94","empty81","textConfig"],["67/90","empty77","footerSlot"]],keyhint:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["72/95","empty82","keyHint"],["67/90","empty77","footerSlot"]],image:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["73/96","empty83","imageSlot"],["74/97","empty84","image"],["67/90","empty77","footerSlot"]],animation:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["75/98","empty85","effectSlot"],["67/90","empty77","footerSlot"]],fullscreen:[["2/15","name",null],["4/86","field14","field14"],["1/12","transform","transform"],["63/83","empty73","genericSlot"],["76/99","empty86","fullscreenEffectSlot"],["67/90","empty77","footerSlot"]]}),Mf=Object.freeze({"4/23":5,"4/86":5,"1/12":4,"62/82":64,"63/83":65,"64/84":66,"65/85":67,"66/89":68,"67/90":69,"68/91":70,"69/92":71,"70/93":72,"71/94":66,"72/95":74,"73/96":75,"74/97":76,"75/98":77,"76/99":78}),P1=Object.freeze([["2/15","name",null],["4/23","field14","field14"],["1/12","transform","transform"],["62/82","empty72","rootChildRef"]]);function Fa(t){return{class:1,type:8,id:t}}function qn(t,e,i,n){return{...n,field501:e,field502:i,field503:1,nodeRef:Fa(t)}}function F1(t){let e=[],i=t.meta?.assetType==="client-control-template";return be(t.root,n=>{i&&n.kind==="server-container"||e.push(n)}),e}function Ln(t,e=new Set,{preserveLegacy:i=!1}={}){let n=new Map,r=[],o=F1(t);if(!i)for(let a of o)Ao(a.guid,a.name);for(let a of o){let s=Number(a.guid);(i?Ut(s):dt(s))&&!e.has(s)?(e.add(s),a.guid=s,n.set(a.id,s)):r.push(a)}for(let a of r){let s=ri(e);e.add(s),a.guid=s,n.set(a.id,s)}return n}function M1(t){return{scale:{x:t.scale.x,y:t.scale.y,z:t.scale.z},anchorMin:{x:t.anchorMin.x,y:t.anchorMin.y},anchorMax:{x:t.anchorMax.x,y:t.anchorMax.y},offset:{x:t.offset.x,y:t.offset.y},size:{x:t.size.x,y:t.size.y},pivot:{x:t.pivot.x,y:t.pivot.y},field508:Object.fromEntries(Object.entries(t.rotation).filter(([,e])=>e!==0))}}function z1(t,e){let n={multiPlatform:{platforms:Le.map(r=>({platformType:Pf[r],transform:M1(t.transformByPlatform[r])})),field502:Bn[t.kind]||25,...t.syncAllDevices===!1?{}:{field504:1}},type:2};return{transform:{multiPlatform:{},type:2},field501:1,field502:12,details:qn(e,4,12,{transform:n})}}function D1(t,e,i){let n=i?{empty15:"",field501:5}:{field17:{},field501:7},r=i?n:{...n,...t.visible===!1?{field17:{initiallyHidden:!0}}:{},...t.active===!1?{initiallyInactive:!0}:{}};return[{name:{value:t.name},field501:2,field502:15},{field14:n,field501:4,field502:i?23:86,details:qn(e,5,i?23:86,{field14:r})},z1(t,e)]}function $1(t,e,i,n){let r=(c,f,h,m,p)=>({[h]:"",field501:c,field502:f,details:qn(e,c+2,f,{[m]:p})}),o=t.giaRaw||{},a=Array.isArray(t.scriptMappingIds)&&t.scriptMappingIds.length?{field501:o.genericField501||1,field502:t.scriptMappingIds.map(c=>({field1:{id:Number(c)}}))}:{field501:o.genericField501??0},s=r(63,83,"empty73","genericSlot",a),l=r(67,90,"empty77","footerSlot",{field505:[void 0,0,1].includes(o.footerField505)?t.canControllerFocus?1:0:o.footerField505});if(t.kind==="container")return[s,r(68,91,"empty78","containerNodeSlot",{...t.isolateNavigation?{isolateNavigation:!0}:{},...t.disableKeyEventPassthrough?{disableKeyEventPassthrough:!0}:{},...t.disableCursorEventPassthrough?{disableCursorEventPassthrough:!0}:{},...t.showCursor?{showCursor:!0}:{}}),l];if(t.kind==="textbox"||t.kind==="textwindow"){t.verticalAlignment==="Middle"&&n.push(`${t.name}: \u5782\u76F4\u5C45\u4E2D\u6309\u63A8\u5B9A\u503C\u5BFC\u51FA\uFF0C\u5C1A\u5F85\u5B9E\u673A\u786E\u8BA4\u3002`);let c={Left:0,Middle:1,Right:2}[t.horizontalAlignment]??0,f=Number.isFinite(o.textAlign)?Math.trunc(o.textAlign):c,h={field501:o.textField501??20,field503:o.textField503??12,color:t.fontColor>>>0,color2:t.bgColor>>>0,color3:t.outlineColor>>>0,text:{value:t.text||""},fontSize:Math.trunc(t.fontSize),minimumFontSize:Math.trunc(t.minimumFontSize),...t.adaptiveFontSize?{adaptive:1}:{},...t.enableOutline===!1?{outlineOff:1}:{},...f?{align:f}:{},verticalAlign:o.textVerticalAlign??{Top:0,Middle:1,Bottom:2}[t.verticalAlignment]??0};return t.kind==="textwindow"?((t.interactable===!1||t.showScrollBar===!1)&&n.push(`${t.name}: \u6587\u672C\u89C6\u7A97\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),h.field511=o.textField511??1,h.viewFlags={field502:o.textViewField502??1,field503:o.textViewField503??1},[s,{empty81:"",field501:71,field502:94,details:qn(e,66,94,{textConfig:h})},l]):[s,r(64,84,"empty74","textConfig",h),l]}if(t.kind==="image"){let c=[0,1].includes(o.imageSlotType??0)?t.imageType==="Stretch"?1:0:o.imageSlotType;t.imageType==null&&t.imageSource==="StaticReference"&&t.imageId>100006&&n.push(`${t.name}: \u56FE\u7247\u7C7B\u578B\u968F\u7D20\u6750\u8FB9\u754C\u81EA\u52A8\u9009\u62E9\uFF0CGIA \u6309\u57FA\u7840\u5BFC\u51FA\uFF1B\u9700\u8981\u62C9\u4F38\u8BF7\u5148\u660E\u786E\u9009\u62E9\u6216\u5728 Lua \u8BBE\u7F6E imageType\u3002`),t.imageSource&&t.imageSource!=="StaticReference"&&n.push(`${t.name}: \u56FE\u7247\u6765\u6E90 ${t.imageSource} \u4EC5\u4FDD\u5B58\u5728 JSON\uFF0C\u5C1A\u672A\u6620\u5C04\u5230 GIA\uFF1B\u8BF7\u5728 Lua \u4E2D\u7528 SetImage(Enum.ImageSource.${t.imageSource}, ${t.imageId}) \u8BBE\u7F6E\u3002`);let f={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[t.fillType],h=Number.isFinite(o.imageFillType)?Math.trunc(o.imageFillType):f||1;t.enableFill&&!h&&n.push(`${t.name}: \u586B\u5145\u5F62\u72B6\u539F\u59CB\u679A\u4E3E\u4E3A 0\uFF0C\u5DF2\u5173\u95ED\u5BFC\u51FA\u6587\u4EF6\u4E2D\u7684\u8FDB\u5EA6\u586B\u5145\u3002`),t.fillType==="Horizontal"&&t.fillHorizontalType!=="Left"&&n.push(`${t.name}: \u5F53\u524D\u6A2A\u5411\u586B\u5145\u65B9\u5411\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`),t.fillType==="Radial180"&&t.fillRadialType!=="Bottom"&&n.push(`${t.name}: \u5F53\u524D 180 \u5EA6\u586B\u5145\u8D77\u70B9\u6682\u4E0D\u652F\u6301\u5199\u5165 GIA\u3002`);let m={field502:o.imageField502??1,field504:o.imageField504??1,field505:o.imageField505??1,field507:o.imageField507??2,field508:Math.round(Math.max(0,Math.min(1,Number(t.fillAmount)||0))*100),border:{field501:Xr(t.softEdgeWidthX,8),field502:Xr(t.softEdgeWidthY,8)},field512:Xr(t.horizontalSoftRange,85),field513:Xr(t.verticalSoftRange,85),fillType:h,...t.enableMask?{enableMask:1}:{},...t.enableSoftEdge?{enableSoftEdge:1}:{},...t.softEdgeMode==="Pixel"?{softEdgePixel:1}:{},...t.enableFill&&h?{enableFill:1}:{},...t.reverseMaskArea?{reverseMask:1}:{}};return[s,r(73,96,"empty83","imageSlot",{field502:Number.isFinite(t.imageColor)?t.imageColor>>>0:4294967295,assetId:t.imageId>>>0,...c?{imageType:c}:{}}),r(74,97,"empty84","image",m),l]}if(t.kind==="button"){let c=(b,g)=>{let w=t[b];return w?(t.children||[]).some(S=>S.id===w)?i.get(w)||0:(n.push(`${t.name}: ${g}\u72B6\u6001\u8282\u70B9\u4E0D\u662F\u6309\u94AE\u7684\u76F4\u63A5\u5B50\u63A7\u4EF6\uFF0CGIA \u672A\u5199\u5165\u8BE5\u72B6\u6001\u3002`),0):0},f=c("unavailableChildId","\u4E0D\u53EF\u7528"),h=c("hoverChildId","\u60AC\u505C"),m=c("pressedChildId","\u6309\u4E0B"),p=c("selectedChildId","\u9009\u4E2D");return[s,r(70,93,"empty80","buttonPreset",{clickAudioId:Math.trunc(t.clickAudioId),...f?{disabledChild:f}:{},...h?{hoverChild:h}:{},...m?{pressedChild:m}:{},...p?{selectedChild:p}:{},...t.interactable?{interactable:1}:{},...t.raycastTarget?{raycastTarget:1}:{}}),l]}if(t.kind==="cursor")return[s,r(65,85,"empty75","cursorConfig",{field501:[void 0,0,1].includes(o.cursorField501)?t.raycastTarget!==!1?1:0:o.cursorField501}),l];if(t.kind==="reference"){let c=o.templateRefSlotBase64;(c||o.templateRefOuterBase64)&&n.push(`${t.name}: \u6A21\u677F\u5F15\u7528\u7684\u975E\u7A7A\u4E8C\u8FDB\u5236\u914D\u7F6E\u5C1A\u672A\u89E3\u6790\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\uFF1B\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u88AB\u5F15\u7528\u6A21\u677F\u3002`);let f=r(66,89,"empty76","templateRefSlot",c?Buffer.from(c,"base64"):Buffer.from(o.templateRefSlot??"","utf8"));return f.empty76=Buffer.from(o.templateRefOuterBase64||"","base64"),[s,f,l]}return t.kind==="grid"?((t.itemPrefabId||t.interactable===!1||t.showScrollBar===!1||t.raycastTarget===!1||t.scrollDirection!=="Vertical"||t.layoutConstraint!=="AutoWrap")&&n.push(`${t.name}: \u7F51\u683C\u5217\u8868\u9879\u6A21\u677F\u3001\u4EA4\u4E92/\u6EDA\u52A8\u6761\u5F00\u5173\u3001\u6EDA\u52A8\u65B9\u5411\u53CA\u6392\u5217\u9650\u5236\u4EC5\u4FDD\u5B58\u5728 JSON\uFF0CGIA \u672A\u6620\u5C04\u8FD9\u4E9B\u6539\u52A8\u3002`),[s,r(69,92,"empty79","gridView",{field501:o.gridField501??1,cellSize:{field501:t.cellSizeX,field502:t.cellSizeY},gap:{field501:t.spacingX,field502:t.spacingY},padding1:{field501:t.padding1X,field502:t.padding1Y},padding2:{field501:t.padding2X,field502:t.padding2Y},field507:o.gridField507??1,field508:o.gridField508??1,field509:o.gridField509??1,field511:o.gridField511??5,field512:o.gridField512??1}),l]):t.kind==="keyhint"?[s,r(72,95,"empty82","keyHint",{field501:Number.isFinite(o.keyHintField501)?Math.trunc(o.keyHintField501):t.controllerKeyCode??1,field502:Number.isFinite(o.keyHintField502)?Math.trunc(o.keyHintField502):t.keyboardKeyCode??1}),l]:t.kind==="animation"?[s,r(75,98,"empty85","effectSlot",o.effectSlot??""),l]:t.kind==="fullscreen"?[s,r(76,99,"empty86","fullscreenEffectSlot",o.fullscreenEffectSlot??""),l]:(n.push(`${t.name}: ${t.kind} \u4E0D\u662F\u5DF2\u77E5 GIA \u63A7\u4EF6\u7C7B\u578B\uFF0C\u5DF2\u4EC5\u5199\u516C\u5171\u53D8\u6362\u3002`),[s,l])}function G1(t,e){if(e)return 1;if(!ht(t.giaInfoIndex))throw new Error(`${t.name}: \u7F3A\u5C11\u5408\u6CD5\u7684\u5BA2\u6237\u7AEF\u8D44\u4EA7\u7F16\u53F7`);return t.giaInfoIndex}function V1(t,e,i){let n=Array.isArray(t.giaRelatedGuids)?t.giaRelatedGuids.filter(r=>Number.isSafeInteger(r)&&r>0&&r<=2147483647):[];return n.length?n:(e.push(`${t.name}: \u65B0${i}\u5199\u5165\u663E\u5F0F\u7A7A Info.related\uFF0C\u907F\u514D\u8DE8\u6C99\u7BB1\u590D\u7528\u4F34\u751F\u8D44\u6E90 GUID \u4EA7\u751F\u65E0\u6CD5\u52A0\u8F7D\u7684\u7D22\u5F15\u3002`),[])}function Ma(t,e){let i=String(t.meta?.giaFilePath||"").trim();if(/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i))return i;let n=(c,f)=>Number.isSafeInteger(Number(c))&&Number(c)>0?Number(c):f,r=n(t.meta?.giaOwnerUid,114514),o=n(t.meta?.giaTimestamp,Math.floor(Date.now()/1e3)),a=n(t.meta?.giaFileId,e?1073741829:1073741830),s=e?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868.gia":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F-\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668.gia",l=String(t.meta?.giaFileName||s).replace(/[\\/:*?"<>|]/gu,"-").replace(/\.gia$/iu,"").trim()||s.replace(/\.gia$/iu,"");return`${r}-${o}-${a}-\\${l}.gia`}function Wr(t,e,i,n,r,o=!1,a=!1,s=a,l=!1){let c=i.get(t.id),h=(l?[...t.children||[]].reverse():t.children||[]).map(b=>i.get(b.id)),m=o?n:h,p=D1(t,c,o);if(o){let b=t.children?.[0];b&&p.push({empty72:"",field501:62,field502:82,details:qn(c,64,82,{rootChildRef:{guid:i.get(b.id)}})})}else p.push(...$1(t,c,i,r));return{id:Fa(c),relatedIds:m.map(b=>Fa(b)),name:t.name,which:o?21:a?70:15,ui:{content:{guid:c,info:[{guid:{value:c},field501:1,field502:5},...o||s?[{index:{value:G1(t,o)},field501:2,field502:6}]:[],...o||a?[{related:{value:V1(t,r,o?"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F")},field501:4,field502:4}]:[]],children:o?[]:h,parent:e&&e.kind!=="server-container"?i.get(e.id):0,data:p}}}}function B1(t,e){let i=new Map;for(let n of t||[]){if(!n.controlId||!(e===Kr?n.controlAsset===Kr:n.controlAsset!==Kr))continue;let o=i.get(n.controlId)||[];o.push(n.guid),i.set(n.controlId,o)}return i}function zf(t,e,i,n){let r=B1(e,i),o=new Map;be(t.root,a=>{r.has(a.id)&&(o.set(a,a.scriptMappingIds),a.scriptMappingIds=r.get(a.id))});try{return n()}finally{for(let[a,s]of o)s===void 0?delete a.scriptMappingIds:a.scriptMappingIds=s}}function za(t){let e=Number(t.meta?.giaModeFlag);return Number.isSafeInteger(e)&&e>=0?{modeFlag:e}:{}}function Da(t){let e=t.meta?.gameVersion;return!e||e==="7.0.50"?lr:e}function Df(t,e,i,n,r=[]){let o=mn(t,!0),a=o.filter(({parent:f})=>f?.kind==="server-container");if(!a.length)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u9700\u8981\u4E00\u4E2A\u6A21\u677F");let s=new Set(a.map(({node:f})=>f.id)),l=o.filter(({node:f})=>!s.has(f.id)),c=o.map(({node:f})=>e.get(f.id));return zf(t,r,Kr,()=>({graph:a.map(({node:f,parent:h})=>Wr(f,h,e,c,i,!1,!0,!0,!0)),accessories:l.map(({node:f,parent:h})=>Wr(f,h,e,c,i,!1,!1,!0,!0)),filePath:n||Ma(t,!0),gameVersion:Da(t),...za(t)}))}function $f(t,e,i,n,r){let o=mn(t),a=[o[0],...o.slice(1).reverse()],s=a.map(({node:l})=>e.get(l.id));return zf(t,i.scripts,R1,()=>({graph:[Wr(t.root,null,e,s,n,!0,!1,!1,!0),...i.units||[]],accessories:a.map(({node:l,parent:c})=>Wr(l,c,e,s,n,!1,!1,!1,!0)),filePath:r||Ma(t,!1),gameVersion:Da(t),...za(t)}))}function Gf(t,e){let i=Ga(t),n=e(i);if(!n.valid)throw new Error(`GIA compatibility validation failed:
117
118
  ${n.errors.join(`
118
- `)}`);return{buffer:r,warnings:[...new Set(e.warnings)]}}function Ns(t){return It.toObject(It.decode(Yn(t)),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0})}function Rf(t){try{let i=Ns(t).graph||[];return i.length>0&&i.every(r=>Number(r.which)===Pi)}catch{return!1}}function Nf(t){let e=[...t.graph||[],...t.accessories||[]].filter(n=>Number(n.which)===Pi),i=[],r=e.map((n,o)=>{let s=n.script?.mapping||{},a=Number(n.id?.id)||0;a<=0&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04\u7F3A\u5C11 GraphUnit.id.id\uFF0C\u5DF2\u6309 0 \u5904\u7406\uFF08\u5BFC\u51FA\u65F6\u4F1A\u91CD\u65B0\u5206\u914D\uFF09\u3002`);let l=Number(s.id)||0;return l&&l!==a&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04 id(${l}) \u4E0E\u5355\u5143 id(${a}) \u4E0D\u4E00\u81F4\uFF0C\u4EE5\u5355\u5143 id \u4E3A\u51C6\u3002`),{guid:a,path:String(s.filePath||""),source:String(s.source||"")}});for(let[n,o]of r.entries())o.path&&!/\.lua$/iu.test(o.path)&&i.push(`\u7B2C ${n+1} \u6761\u811A\u672C\u6620\u5C04 file_path \u7F3A\u5C11 .lua \u540E\u7F00\uFF08${o.path}\uFF09\uFF0C\u771F\u673A\u53EF\u80FD\u62D2\u7EDD\u5BFC\u5165\uFF1B\u6A21\u62DF\u5668\u5185\u6309\u5F52\u4E00\u5316\u8DEF\u5F84\u7167\u5E38 require\u3002`);return{scripts:r,warnings:i}}function Pf(t){let e=Ns(t),i=Nf(e);if(!i.scripts.length)throw new Error("GIA \u5185\u6CA1\u6709\u811A\u672C\u6620\u5C04\u5355\u5143\uFF08which=69\uFF09");return{scripts:i.scripts,warnings:i.warnings,metadata:{assetType:"lua-script"}}}function Ep(t){let e=[],i;try{i=Ns(t)}catch(n){return{valid:!1,errors:[n?.message||String(n)],scriptCount:0}}let r=i.graph||[];return r.length||e.push("Root.graph \u4E3A\u7A7A"),(i.accessories||[]).length&&e.push("script.gia \u4E0D\u5E94\u5305\u542B accessories"),r.forEach((n,o)=>{let s=`\u5355\u5143 ${o+1}`;Number(n.which)!==Pi&&e.push(`${s}: which \u5E94\u4E3A 69\uFF0C\u5B9E\u9645 ${n.which}`),Number(n.id?.class)!==Af&&e.push(`${s}: id.class \u5E94\u4E3A 30\uFF0C\u5B9E\u9645 ${n.id?.class}`),Number(n.id?.type??0)!==0&&e.push(`${s}: id.type \u5E94\u7F3A\u7701`);let a=n.script?.mapping;if(!a){e.push(`${s}: \u7F3A\u5C11 field35 ScriptMappingWrapper`);return}Number(n.id?.id)<=0&&e.push(`${s}: GraphUnit.id.id \u975E\u6CD5`),Number(a.id)!==Number(n.id?.id)&&e.push(`${s}: mapping.id \u5E94\u7B49\u4E8E GraphUnit.id.id`),String(a.name||"")!==String(n.name||"")&&e.push(`${s}: mapping.name \u5E94\u7B49\u4E8E GraphUnit.name`),String(a.filePath||"").trim()?/\.lua$/iu.test(String(a.filePath))||e.push(`${s}: file_path \u5E94\u4EE5 .lua \u7ED3\u5C3E\uFF08\u5B98\u65B9 script.gia \u6837\u672C\u5747\u4E3A \u540D\u79F0.lua\uFF0C\u771F\u673A require \u65F6\u624D\u53BB\u6269\u5C55\u540D\uFF09`):e.push(`${s}: file_path \u4E3A\u7A7A`)}),{valid:e.length===0,errors:e,scriptCount:r.length}}function Yn(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);if(e.length<gi+Cs)throw new Error("GIA \u6587\u4EF6\u8FC7\u77ED");if(e.readUInt32BE(4)!==1||e.readUInt32BE(8)!==yf||e.readUInt32BE(12)!==3)throw new Error("\u4E0D\u662F\u53D7\u652F\u6301\u7684 GIA v1 \u6587\u4EF6");let i=e.readUInt32BE(16);if(i!==e.length-gi-Cs)throw new Error("GIA payload \u957F\u5EA6\u4E0D\u4E00\u81F4");if(e.readUInt32BE(gi+i)!==vf)throw new Error("GIA \u5C3E\u6807\u8BB0\u65E0\u6548");return e.subarray(gi,gi+i)}function Xe(t,e){return t.ui?.content?.data?.find(i=>i.details?.[e])?.details?.[e]||null}function kp(t){let e=t.ui?.content?.data?.find(o=>o.field501===66&&o.field502===89||Object.hasOwn(o.details||{},"templateRefSlot")),i=Buffer.from(e?.details?.templateRefSlot||[]),r=i.toString("utf8"),n=Buffer.from(r,"utf8").equals(i)&&!/[\u0000-\u001f\u007f-\u009f]/u.test(r);return{referencedPrefabId:n?r:"",raw:{templateRefSlot:n?r:"",...n?{}:{templateRefSlotBase64:i.toString("base64")},...e?.empty76?.length?{templateRefOuterBase64:Buffer.from(e.empty76).toString("base64")}:{}}}}function Ap(t){let e=Xe(t,"transform")?.multiPlatform,i={};for(let n of e?.platforms||[]){let o=mp[n.platformType||0],s=n.transform||{};i[o]={scale:s.scale?{x:s.scale.x??0,y:s.scale.y??0,z:s.scale.z??0}:{x:1,y:1,z:1},rotation:{x:s.field508?.x??0,y:s.field508?.y??0,z:s.field508?.z??0},anchorMin:{x:s.anchorMin?.x??0,y:s.anchorMin?.y??0},anchorMax:{x:s.anchorMax?.x??0,y:s.anchorMax?.y??0},offset:{x:s.offset?.x??0,y:s.offset?.y??0},size:{x:s.size?.x??0,y:s.size?.y??0},pivot:s.pivot?{x:s.pivot.x??0,y:s.pivot.y??0}:{x:.5,y:.5}}}let r=i.KEYBOARD||i[Object.keys(i)[0]];if(!r)throw new Error(`GIA \u63A7\u4EF6 ${t.name||t.id?.id} \u7F3A\u5C11\u591A\u5E73\u53F0\u53D8\u6362`);for(let n of Be)i[n]||(i[n]=structuredClone(r));return i}function jn(t){let e=t.ui?.content?.data||[];return e.some(i=>i.details?.textConfig)?e.some(i=>i.field501===71)?"textwindow":"textbox":e.some(i=>i.details?.cursorConfig)?"cursor":e.some(i=>Object.hasOwn(i.details||{},"templateRefSlot")||i.field501===66&&i.field502===89)?"reference":e.some(i=>i.details?.gridView)?"grid":e.some(i=>i.details?.buttonPreset)?"button":e.some(i=>i.details?.keyHint)?"keyhint":e.some(i=>i.details?.image||i.details?.imageSlot)?"image":e.some(i=>Object.hasOwn(i.details||{},"effectSlot"))?"animation":e.some(i=>Object.hasOwn(i.details||{},"fullscreenEffectSlot"))?"fullscreen":(e.some(i=>Object.hasOwn(i.details||{},"containerNodeSlot")),"container")}function mf(t,{reverseSiblings:e=!1,idOffset:i=0}={}){if(!t.length)return{nodes:new Map,rootCandidates:[],warnings:[]};let r=new Map(t.map((u,f)=>[u.id?.id,`n${i+f+1}`])),n=new Map,o=new Map,s=[];for(let u of t){let f=jn(u),h=Xe(u,"textConfig"),p=Xe(u,"imageSlot"),m=Xe(u,"image"),g=Xe(u,"buttonPreset"),b=Xe(u,"gridView"),C=Xe(u,"genericSlot"),k=Xe(u,"footerSlot"),E=Xe(u,"cursorConfig"),G=Xe(u,"keyHint"),x=Xe(u,"containerNodeSlot"),q=f==="reference"?kp(u):null,B=Xe(u,"effectSlot"),W=Xe(u,"fullscreenEffectSlot"),j=we(f,{id:r.get(u.id?.id),guid:u.id?.id||0,giaInfoIndex:(u.ui?.content?.info||[]).find(_=>_.field501===2&&_.field502===6)?.index?.value,giaRelatedGuids:(u.ui?.content?.info||[]).find(_=>_.field501===4&&_.field502===4)?.related?.value||[],name:u.name||f,visible:Xe(u,"field14")?.field17?.initiallyHidden!==!0,active:Xe(u,"field14")?.initiallyInactive!==!0,canControllerFocus:k?.field505===1,scriptMappingIds:(C?.field502||[]).map(_=>Number(_?.field1?.id)).filter(_=>Number.isSafeInteger(_)&&_>0),transformByPlatform:Ap(u),syncAllDevices:Xe(u,"transform")?.multiPlatform?.field504===1,giaRaw:{genericField501:C?.field501??0,footerField505:k?.field505??0,...f==="textbox"||f==="textwindow"?{textField501:h?.field501??20,textField503:h?.field503??12,textAlign:h?.align??0,...[void 0,0,1,2].includes(h?.verticalAlign)?{}:{textVerticalAlign:h.verticalAlign},...f==="textwindow"?{textField511:h?.field511??1,textViewField502:h?.viewFlags?.field502??1,textViewField503:h?.viewFlags?.field503??1}:{}}:{},...f==="cursor"?{cursorField501:E?.field501??0}:{},...q?.raw||{},...f==="grid"?{gridField501:b?.field501??1,gridField507:b?.field507??1,gridField508:b?.field508??1,gridField509:b?.field509??1,gridField511:b?.field511??5,gridField512:b?.field512??1}:{},...f==="keyhint"?{keyHintField501:G?.field501??1,keyHintField502:G?.field502??1}:{},...f==="image"?{imageSlotType:p?.imageType??0,imageField502:m?.field502??1,imageField504:m?.field504??1,imageField505:m?.field505??1,imageField507:m?.field507??2,imageFillType:m?.fillType??1}:{},...f==="animation"?{effectSlot:B??""}:{},...f==="fullscreen"?{fullscreenEffectSlot:W??""}:{}},...f==="container"?{isolateNavigation:x?.isolateNavigation===!0,disableKeyEventPassthrough:x?.disableKeyEventPassthrough===!0,disableCursorEventPassthrough:x?.disableCursorEventPassthrough===!0,showCursor:x?.showCursor===!0}:{},...f==="cursor"?{raycastTarget:E?.field501===1}:{},...f==="textbox"||f==="textwindow"?{text:h?.text?.value??"",fontSize:h?.fontSize??20,minimumFontSize:h?.minimumFontSize??20,adaptiveFontSize:h?.adaptive===1,fontColor:h?.color??4294967295,bgColor:h?.color2??0,enableOutline:h?.outlineOff!==1,outlineColor:h?.color3??858993459,horizontalAlignment:h?.align===1?"Middle":h?.align===2?"Right":"Left",verticalAlignment:{0:"Top",1:"Middle",2:"Bottom"}[h?.verticalAlign??0]||"Top",...f==="textwindow"?{interactable:!0,showScrollBar:!0}:{}}:{},...f==="image"?{imageSource:"StaticReference",imageId:p?.assetId??0,imageType:p?.imageType===1?"Stretch":"Basic",imageColor:Number.isFinite(p?.field502)?p.field502>>>0:4294967295,enableMask:m?.enableMask===1,enableSoftEdge:m?.enableSoftEdge===1,enableFill:m?.enableFill===1,softEdgeMode:m?.softEdgePixel===1?"Pixel":"Percentage",softEdgeWidthX:m?.border?.field501??8,softEdgeWidthY:m?.border?.field502??8,horizontalSoftRange:m?.field512??85,verticalSoftRange:m?.field513??85,fillType:{1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[m?.fillType]||"Horizontal",fillAmount:Number.isFinite(m?.field508)?Math.max(0,Math.min(1,m.field508/100)):m?.enableFill===1?0:1,reverseMaskArea:m?.reverseMask===1}:{},...f==="button"?{interactable:g?.interactable===1,raycastTarget:g?.raycastTarget===1,clickAudioId:g?.clickAudioId??50888}:{},...f==="grid"?{cellSizeX:b?.cellSize?.field501??50,cellSizeY:b?.cellSize?.field502??50,spacingX:b?.gap?.field501??8,spacingY:b?.gap?.field502??8,padding1X:b?.padding1?.field501??20,padding1Y:b?.padding1?.field502??20,padding2X:b?.padding2?.field501??20,padding2Y:b?.padding2?.field502??20,previewCount:b?.field511??5}:{},...q?{referencedPrefabId:q.referencedPrefabId}:{},...f==="keyhint"?{keyboardKeyCode:G?.field502??null,controllerKeyCode:G?.field501??null}:{},...f==="animation"?{animationId:B??""}:{},...f==="fullscreen"?{animationId:W??""}:{}});n.set(u.id?.id,j),(q?.raw.templateRefSlotBase64||q?.raw.templateRefOuterBase64)&&s.push(`${j.name}: \u6A21\u677F\u5F15\u7528\u914D\u7F6E\u542B\u5C1A\u672A\u89E3\u6790\u7684\u4E8C\u8FDB\u5236\u5B57\u6BB5\uFF0C\u5DF2\u539F\u6837\u4FDD\u5B58\uFF1B\u5F15\u7528\u76EE\u6807\u672A\u63A8\u65AD\uFF0C\u9884\u89C8\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(h?.align)&&s.push(`${j.name}: \u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E ${h.align} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(h?.verticalAlign)&&s.push(`${j.name}: \u5782\u76F4\u5BF9\u9F50\u679A\u4E3E ${h.verticalAlign} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),f==="image"&&![void 0,0,1,2,3,4,5].includes(m?.fillType)&&s.push(`${j.name}: \u586B\u5145\u5F62\u72B6\u679A\u4E3E ${m.fillType} \u672A\u8BC6\u522B\uFF0C\u5DF2\u4FDD\u7559\u539F\u503C\u3002`),f==="button"&&o.set(j.id,{unavailableChildId:g?.disabledChild,hoverChildId:g?.hoverChild,pressedChildId:g?.pressedChild,selectedChildId:g?.selectedChild})}let a=[],l=new Set;for(let u of t){let f=n.get(u.id?.id),h=(u.ui?.content?.children||[]).map(p=>n.get(p)).filter(Boolean);if(h.length){f.children=e?h.slice().reverse():h;for(let p of h)l.add(p.id)}}for(let u of t){let f=n.get(u.id?.id),h=u.ui?.content?.parent||0,p=n.get(h);p?l.has(f.id)||(e?p.children.unshift(f):p.children.push(f)):a.push(f)}for(let[u,f]of o){let h=[...n.values()].find(p=>p.id===u);for(let[p,m]of Object.entries(f))h[p]=r.get(m)||null}return{nodes:n,rootCandidates:a,warnings:s}}function Ff(t){let e=Yn(t),i=It.toObject(It.decode(e),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0}),r=[...i.graph||[],...i.accessories||[]],n=k=>!!k.ui?.content&&[15,21,70].includes(Number(k.which)),o=(i.graph||[]).filter(n);if(!o.some(k=>k.ui?.content))throw new Error("GIA \u4E0D\u542B\u53EF\u8BC6\u522B\u7684 UIControlGroup \u4E3B\u56FE");let s=o.find(k=>k.which===21)||null,a=o.filter(k=>Number(k.which)===70),l=(i.accessories||[]).filter(n),u=new Set((s?.relatedIds||[]).map(k=>k.id||0)),f=s?u.size?l.filter(k=>u.has(k.id?.id||0)):l:[],h=a.length?[...a,...l.filter(k=>!u.has(k.id?.id||0))]:s?[]:[...o,...l];if(!f.length&&!h.length)throw new Error("GIA \u4E0D\u542B\u5BA2\u6237\u7AEF\u63A7\u4EF6");let p=["GIA \u5BFC\u5165\u4E3A\u5DF2\u9A8C\u8BC1 UI \u5B57\u6BB5\u7684\u8BED\u4E49\u5BFC\u5165\uFF1B\u672A\u77E5 protobuf \u5B57\u6BB5\u4E0D\u4F1A\u8FDB\u5165 Authoring JSON\u3002"],m=r.filter(k=>!n(k)&&Number(k.which)!==Pi);m.length&&p.push(`\u8DF3\u8FC7 ${m.length} \u4E2A\u975E UI / \u975E\u811A\u672C\u4F9D\u8D56\u5355\u5143\uFF1B\u8FD9\u4E9B\u8D44\u6E90\u4E0D\u4F1A\u8FDB\u5165\u5B58\u6863\u6216\u91CD\u65B0\u5BFC\u51FA\u3002`);let g=Nf(i);p.push(...g.warnings);let b=null,C=null;if(f.length){let k=mf(f,{reverseSiblings:!0,idOffset:0});p.push(...k.warnings);let E=k.rootCandidates.find(x=>x.kind==="container")||k.rootCandidates[0];if(!E)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6839\u63A7\u4EF6");let G=we("server-container",{id:"sc1",guid:s?.id?.id||0,name:s?.name||"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",giaRelatedGuids:(s?.ui?.content?.info||[]).find(x=>x.field501===4&&x.field502===4)?.related?.value||[]});G.children=[E],k.rootCandidates.length>1&&p.push(`\u68C0\u6D4B\u5230 ${k.rootCandidates.length} \u4E2A\u65E0\u7236\u8282\u70B9\u63A7\u4EF6\uFF0C\u4EC5\u5BFC\u5165\u4EE5\u201C${E.name}\u201D\u4E3A\u6839\u7684\u6811\u3002`),b={version:1,layoutSchemaVersion:Ze,meta:{name:s?.name||"\u5BFC\u5165\u7684\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:E.id,script:{controlId:E.id,path:"",source:""},root:G}}if(h.length){let k=mf(h,{reverseSiblings:!1,idOffset:1e3});if(p.push(...k.warnings),!k.rootCandidates.length)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6A21\u677F");let E=we("server-container",{id:"sc1",guid:0,name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"});E.children=k.rootCandidates,C={version:1,layoutSchemaVersion:Ze,meta:{name:k.rootCandidates.length===1?k.rootCandidates[0].name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868",assetType:"client-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:k.rootCandidates[0].id,script:{controlId:k.rootCandidates[0].id,path:"",source:""},root:E},Lt(C,{warnings:p});for(let G of k.rootCandidates)ke(G,x=>x.children.reverse());b||(b=C)}return{project:b,clientProject:C&&b!==C?C:void 0,scripts:g.scripts,warnings:p,metadata:{gameVersion:i.gameVersion||"",filePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{modeFlag:Number(i.modeFlag)}:{},combined:!!(s&&a.length)}}}function Ps(t){let e=Yn(t),i=It.toObject(It.decode(e),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),r=i.graph||[],n=i.accessories||[],o=[],s=(m,g)=>m!=null&&Object.prototype.hasOwnProperty.call(m,g),a=new Map,l=[];/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||o.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`);let u=r.filter(m=>m.which===70).map(m=>{let g=jn(m),b=m.ui?.content?.info||[],C=b.find(G=>G.field501===2&&G.field502===6)?.index?.value,k=b.find(G=>G.field501===4&&G.field502===4),E=k?.related?.value||[];return lt(C)||o.push(`${m.name}: Info.index=${C??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`),k||o.push(`${m.name}: \u9876\u5C42 UIControlTemplate \u7F3A\u5C11 Info.related \u8BB0\u5F55`),{id:m.id?.id||0,name:m.name||"",kind:g,actualIndex:C,relatedPresent:!!k,relatedGuids:E}}),f=new Map;for(let m of u){if(!lt(m.actualIndex))continue;let g=f.get(m.actualIndex);g?o.push(`${m.name}: \u72EC\u7ACB\u6A21\u677F\u8D44\u4EA7\u7F16\u53F7 ${m.actualIndex} \u4E0E ${g.name} \u91CD\u590D`):f.set(m.actualIndex,m)}u.length||o.push("Root.graph \u4E0D\u542B UIControlTemplate(70)");let h=0,p=0;for(let m of[...r,...n]){if(!m.ui?.content)continue;let g=m.id?.id||0,b=m.ui.content,C=jn(m),k=r.includes(m)&&m.which===70,E=`${m.name||"<unnamed>"}(${g||"<missing-guid>"})`;!Number.isSafeInteger(g)||g<=0||g>2147483647?o.push(`${E}: GraphUnit GUID \u975E\u6CD5`):a.has(g)?o.push(`${E}: GUID \u4E0E ${a.get(g).name||"<unnamed>"} \u91CD\u590D`):a.set(g,m),(m.id?.class!==1||m.id?.type!==8)&&o.push(`${E}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),b.guid!==g&&o.push(`${E}: content.guid=${b.guid??"<missing>"} \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`),k&&m.which!==70&&o.push(`${E}: \u6A21\u677F\u6839 which \u5FC5\u987B\u4E3A UIControlTemplate(70)`),!k&&m.which!==15&&o.push(`${E}: \u9644\u4EF6\u63A7\u4EF6 which \u5FC5\u987B\u4E3A UIControl(15)`);let G=b.info||[],x=G.find(w=>w.field501===1&&w.field502===5),q=G.find(w=>w.field501===2&&w.field502===6);x?.guid?.value!==g&&o.push(`${E}: Info.self GUID \u7F3A\u5931\u6216\u4E0E\u81EA\u8EAB\u4E0D\u4E00\u81F4`),lt(q?.index?.value)||o.push(`${E}: Info.index=${q?.index?.value??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`);let B=G.find(w=>w.field501===4&&w.field502===4);k&&!B&&o.push(`${E}: \u9876\u5C42\u6A21\u677F\u7F3A\u5C11 Info.related \u8BB0\u5F55`),!k&&B&&o.push(`${E}: \u9644\u4EF6\u63A7\u4EF6\u4E0D\u5E94\u5199 Info.related`);let W=wf[C],j=b.data||[],_=j.map(w=>`${w.field501}/${w.field502}`),R=W?.map(([w])=>w)||[];W?JSON.stringify(_)!==JSON.stringify(R)&&o.push(`${E}: Data \u69FD\u4F4D\u987A\u5E8F ${_.join(",")}\uFF0C\u5E94\u4E3A ${R.join(",")}`):o.push(`${E}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${C}`);for(let w=0;w<Math.min(j.length,W?.length||0);w+=1){let M=j[w],[L,X,Q]=W[w];if(s(M,X)||o.push(`${E}: Data ${L} \u7F3A\u5C11 ${X} \u5206\u652F`),!Q)continue;s(M.details,Q)||o.push(`${E}: Details ${L} \u7F3A\u5C11 ${Q} \u5206\u652F`);let ce=Sf[L];(M.details?.field501!==ce||M.details?.field502!==M.field502||M.details?.field503!==1)&&o.push(`${E}: Details ${L} \u6807\u8BB0\u5E94\u4E3A ${ce}/${M.field502}/1`);let ve=M.details?.nodeRef;(ve?.class!==1||ve?.type!==8||ve?.id!==g)&&o.push(`${E}: Details ${L} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let y=(m.ui.content.data||[]).find(w=>w.field501===4&&w.field502===86);y&&(s(y.field14,"field17")?h+=1:o.push(`${E}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`),s(y.details?.field14,"field17")?h+=1:o.push(`${E}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`));let N=(m.ui.content.data||[]).find(w=>w.details?.transform)?.details?.transform?.multiPlatform?.platforms||[];N.length!==4&&o.push(`${E}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${N.length}\uFF0C\u5E94\u4E3A 4`);let S=N.map(w=>w.platformType||0);JSON.stringify(S)!==JSON.stringify([0,1,2,3])&&o.push(`${E}: \u5E73\u53F0\u987A\u5E8F ${S.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let c=(m.ui.content.data||[]).find(w=>w.details?.transform)?.details?.transform;c?.multiPlatform?.field502!==zr[C]&&o.push(`${E}: \u53D8\u6362 preset=${c?.multiPlatform?.field502??"<missing>"}\uFF0C${C} \u5E94\u4E3A ${zr[C]}`);for(let w of N)s(w.transform,"field508")?p+=1:o.push(`${E}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);l.push({id:g,name:m.name||"",kind:C,template:k,parent:b.parent||0,children:[...b.children||[]],relatedIds:(m.relatedIds||[]).map(w=>w.id||0),dataSignatures:_})}for(let m of l){let g=`${m.name||"<unnamed>"}(${m.id})`;if(JSON.stringify(m.relatedIds)!==JSON.stringify(m.children)&&o.push(`${g}: GraphUnit.relatedIds \u4E0E content.children \u4E0D\u4E00\u81F4`),m.template&&m.parent&&o.push(`${g}: \u9876\u5C42\u6A21\u677F\u4E0D\u5E94\u6709 parent`),!m.template){let b=a.get(m.parent);b?(b.ui?.content?.children||[]).includes(m.id)||o.push(`${g}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):o.push(`${g}: parent=${m.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let b of m.children){let C=a.get(b);C?(C.ui?.content?.parent||0)!==m.id&&o.push(`${g}: child=${b} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):o.push(`${g}: child=${b} \u4E0D\u5B58\u5728`)}}return{valid:o.length===0,errors:o,filePath:i.filePath||"",gameVersion:i.gameVersion||"",templateCount:u.length,accessoryCount:n.length,templates:u,units:l,explicitEmpty:{field17:h,rectField508:p}}}function Fs(t){let e=Yn(t),i=It.toObject(It.decode(e),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),r=(i.graph||[]).filter(c=>c.ui?.content&&Number(c.which)===21),n=(i.graph||[]).filter(c=>Number(c.which)===70),o=(i.graph||[]).filter(c=>Number(c.which)===Pi),s=(i.accessories||[]).filter(c=>c.ui?.content),a=[],l=(c,w)=>c!=null&&Object.prototype.hasOwnProperty.call(c,w);/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||a.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`),r.length!==1&&a.push(`\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F UIControlGroup \u6570\u91CF=${r.length}\uFF0C\u5E94\u4E3A 1`);let u=(i.graph||[]).filter(c=>{let w=Number(c.which);return w===Pi||w===70||w===21?!1:!c.ui?.content});u.length&&a.push(`Root.graph \u542B ${u.length} \u4E2A\u65E0\u6CD5\u8BC6\u522B\u7684\u975E\u63A7\u4EF6/\u975E\u811A\u672C\u5355\u5143`);let f=r[0];if(!f)return{valid:!1,errors:a,filePath:i.filePath||"",gameVersion:i.gameVersion||"",accessoryCount:s.length,controls:[],scriptCount:o.length,explicitEmpty:{field17:0,rectField508:0}};let h=[f,...n,...s],p=new Map;for(let c of h){let w=c.id?.id||0,M=`${c.name||"<unnamed>"}(${w||"<missing-guid>"})`;!Number.isSafeInteger(w)||w<=0||w>2147483647?a.push(`${M}: GraphUnit GUID \u975E\u6CD5`):p.has(w)?a.push(`${M}: GUID \u91CD\u590D`):p.set(w,c),(c.id?.class!==1||c.id?.type!==8)&&a.push(`${M}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),c.ui?.content?.guid!==w&&a.push(`${M}: content.guid \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`)}let m=f.id?.id||0,g=f.ui.content,b=`${f.name||"<unnamed>"}(${m})`;f.which!==21&&a.push(`${b}: which \u5FC5\u987B\u4E3A UIControlGroup(21)`);let C=g.info||[];C.find(c=>c.field501===1&&c.field502===5)?.guid?.value!==m&&a.push(`${b}: Info.self GUID \u7F3A\u5931\u6216\u4E0D\u4E00\u81F4`),C.find(c=>c.field501===2&&c.field502===6)?.index?.value!==1&&a.push(`${b}: Info.index \u5FC5\u987B\u4E3A 1`);let k=C.find(c=>c.field501===4&&c.field502===4);k||a.push(`${b}: \u7F3A\u5C11\u663E\u5F0F Info.related \u8BB0\u5F55`);let E=0,G=0,x=(c,w,M,L=!1)=>{let X=c.id?.id||0,Q=`${c.name||"<unnamed>"}(${X})`,ce=c.ui.content.data||[],ve=ce.map(Oe=>`${Oe.field501}/${Oe.field502}`),be=M.map(([Oe])=>Oe);JSON.stringify(ve)!==JSON.stringify(be)&&a.push(`${Q}: Data \u69FD\u4F4D\u987A\u5E8F ${ve.join(",")}\uFF0C\u5E94\u4E3A ${be.join(",")}`);for(let Oe=0;Oe<Math.min(ce.length,M.length);Oe+=1){let at=ce[Oe],[ht,de,O]=M[Oe];if(l(at,de)||a.push(`${Q}: Data ${ht} \u7F3A\u5C11 ${de} \u5206\u652F`),!O)continue;l(at.details,O)||a.push(`${Q}: Details ${ht} \u7F3A\u5C11 ${O} \u5206\u652F`);let A=Sf[ht];(at.details?.field501!==A||at.details?.field502!==at.field502||at.details?.field503!==1)&&a.push(`${Q}: Details ${ht} \u6807\u8BB0\u5E94\u4E3A ${A}/${at.field502}/1`);let P=at.details?.nodeRef;(P?.class!==1||P?.type!==8||P?.id!==X)&&a.push(`${Q}: Details ${ht} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let me=ce.find(Oe=>Oe.field501===4&&Oe.field502===(L?23:86)),ee=L?"empty15":"field17";l(me?.field14,ee)?L||(E+=1):a.push(`${Q}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.${ee} \u7A7A\u4E32`),l(me?.details?.field14,ee)?L||(E+=1):a.push(`${Q}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.${ee} \u7A7A\u4E32`);let ue=ce.find(Oe=>Oe.details?.transform)?.details?.transform,Se=ue?.multiPlatform?.platforms||[];Se.length!==4&&a.push(`${Q}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${Se.length}\uFF0C\u5E94\u4E3A 4`);let dt=Se.map(Oe=>Oe.platformType||0);JSON.stringify(dt)!==JSON.stringify([0,1,2,3])&&a.push(`${Q}: \u5E73\u53F0\u987A\u5E8F ${dt.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let Gt=L?zr["server-container"]:zr[w];ue?.multiPlatform?.field502!==Gt&&a.push(`${Q}: \u53D8\u6362 preset=${ue?.multiPlatform?.field502??"<missing>"}\uFF0C\u5E94\u4E3A ${Gt}`);for(let Oe of Se)l(Oe.transform,"field508")?G+=1:a.push(`${Q}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);return ve};x(f,"server-container",gp,!0);let q=(f.relatedIds||[]).map(c=>c.id||0),B=new Set(q),W=s.filter(c=>B.has(c.id?.id||0)),j=W.map(c=>c.id?.id||0);JSON.stringify(q)!==JSON.stringify(j)&&a.push(`${b}: \u4E3B\u56FE relatedIds \u5FC5\u987B\u6309\u987A\u5E8F\u8986\u76D6\u672C\u7EC4 accessories`);let _=g.data?.find(c=>c.details?.rootChildRef)?.details?.rootChildRef?.guid||0,R=p.get(_);(!R||!W.includes(R))&&a.push(`${b}: 62/82 \u6839\u8282\u70B9\u5F15\u7528\u4E0D\u5B58\u5728`),j[0]!==_&&a.push(`${b}: \u6839\u5BB9\u5668\u8282\u70B9\u5FC5\u987B\u662F\u672C\u7EC4 accessories[0]`);let y=[];for(let c of W){let w=c.id?.id||0,M=c.ui.content,L=`${c.name||"<unnamed>"}(${w})`,X=jn(c);c.which!==15&&a.push(`${L}: which \u5FC5\u987B\u4E3A UIControl(15)`);let Q=M.info||[];(Q.length!==1||Q[0]?.field501!==1||Q[0]?.field502!==5||Q[0]?.guid?.value!==w)&&a.push(`${L}: \u670D\u52A1\u7AEF\u5BB9\u5668\u5185\u63A7\u4EF6 Info \u5FC5\u987B\u53EA\u542B\u81EA\u8EAB GUID`);let ce=wf[X];ce||a.push(`${L}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${X}`);let ve=ce?x(c,X,ce):[];y.push({id:w,name:c.name||"",kind:X,parent:M.parent||0,children:[...M.children||[]],relatedIds:(c.relatedIds||[]).map(be=>be.id||0),dataSignatures:ve})}let N=y.find(c=>c.id===_);N&&(N.kind!=="container"&&a.push(`${N.name}(${_}): \u6839\u63A7\u4EF6\u5FC5\u987B\u4E3A\u5BB9\u5668\u8282\u70B9`),N.parent&&a.push(`${N.name}(${_}): \u6839\u63A7\u4EF6\u4E0D\u5E94\u6709 parent`));let S=new Map(y.map(c=>[c.id,c]));for(let c of y){let w=`${c.name}(${c.id})`;if(JSON.stringify(c.relatedIds)!==JSON.stringify(c.children)&&a.push(`${w}: relatedIds \u5FC5\u987B\u4E0E\u76F4\u63A5 children \u4E00\u81F4`),c.id!==_){let M=S.get(c.parent);M?M.children.includes(c.id)||a.push(`${w}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):a.push(`${w}: parent=${c.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let M of c.children){let L=S.get(M);L?L.parent!==c.id&&a.push(`${w}: child=${M} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):a.push(`${w}: child=${M} \u4E0D\u5B58\u5728`)}}if(n.length){let c=Ps(Ts({...i,graph:n,accessories:s.filter(w=>!B.has(w.id?.id||0))}));a.push(...c.errors.map(w=>`\u5BA2\u6237\u7AEF\u6A21\u677F: ${w}`))}return{valid:a.length===0,errors:a,filePath:i.filePath||"",gameVersion:i.gameVersion||"",graph:{id:m,name:f.name||"",relatedGuids:k?.related?.value||[],rootGuid:_},accessoryCount:s.length,controls:y,scriptCount:o.length,explicitEmpty:{field17:E,rectField508:G}}}function Mf(t,e=[]){if(!t||t.layoutSchemaVersion===Ze)return t;if(t.layoutSchemaVersion!==void 0&&t.layoutSchemaVersion!==1)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=2 \u6216\u53EF\u8FC1\u79FB\u7684\u65E7\u5E03\u5C40\uFF0C\u6536\u5230 ${t.layoutSchemaVersion}`);if(!t.root)return{...t,layoutSchemaVersion:Ze};let i=structuredClone(t),r=0;return ke(i.root,n=>{let o=n.transformByPlatform||{},s=n.transformByCanvas||{},a=n.name||n.id;for(let u of Object.keys(o))if(!Be.includes(u))throw new Error(`${a}: unknown platform ${u}`);let l={};for(let u of Be){let f=Li[u],h=Te[f].platform,p=Object.keys(Te).filter(C=>Te[C].platform===h&&s[C]),m=s[f]?f:p[0],g=u==="CONTROLLER_CONSOLE"?l.KEYBOARD:u==="CONTROLLER_MOBILE"?l.TOUCHSCREEN:null,b=o[u]??g??(m?s[m]:null);if(l[u]=b?Ot(b):_o(n.kind),b||e.push(`${a}: ${u} \u65E0\u65E7\u5E03\u5C40\uFF0C\u5DF2\u4F7F\u7528\u63A7\u4EF6\u9ED8\u8BA4\u503C`),!o[u]&&!g&&m&&m!==f&&e.push(`${a}: \u7F3A\u5C11 ${f}\uFF0C\u5DF2\u91C7\u7528 ${m} \u7684\u951A\u70B9\u548C\u5C3A\u5BF8\u53C2\u6570`),!g)for(let C of p)JSON.stringify(l[u])!==JSON.stringify(Ot(s[C]))&&e.push(`${a}: ${C} \u4E0E ${u} \u5E03\u5C40\u51B2\u7A81\uFF0C\u4FDD\u7559${o[u]?"\u5DF2\u6709\u5E73\u53F0":m}\u53C2\u6570`)}ti(l,`${a}.transformByPlatform`),n.transformByPlatform=l,delete n.transformByCanvas,r++}),i.layoutSchemaVersion=Ze,e.unshift(`\u5DF2\u81EA\u52A8\u8FC1\u79FB\u65E7\u5E03\u5C40\uFF1A${r} \u4E2A\u63A7\u4EF6\u8F6C\u6362\u4E3A\u56DB\u5E73\u53F0\u53C2\u6570\uFF1B\u518D\u6B21\u4FDD\u5B58\u5C06\u4F7F\u7528\u65B0\u7248\u683C\u5F0F`),i}function Ms(t){if(![1,2,3,4].includes(t))throw new Error(`\u4EC5\u652F\u6301 version=1\u20134 \u7684\u5B58\u6863\uFF0C\u6536\u5230 ${t}`)}function Ds(t,e,i,r=t.canvasId){let n=ri(t.root,e);return!n||n.kind==="server-container"?Qe(r):i[n.id]||Qe(r)}function yi(t,{warnings:e=[]}={}){if(!t)return Ei();if(t=Mf(t,e),(t.root||t.layoutSchemaVersion!==void 0)&&t.layoutSchemaVersion!==Ze)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=${Ze} \u7684\u56DB\u5E73\u53F0\u5E03\u5C40\uFF0C\u4E0D\u652F\u6301\u65E7\u753B\u5E03\u5E03\u5C40\u6216\u5176\u4ED6\u7248\u672C`);let i=t.meta?.assetType==="client-control-template"?"client-control-template":"server-control-template",r=i==="client-control-template"?Wi():Ei(),n={layoutSchemaVersion:Ze,version:Number.isSafeInteger(t.version)&&t.version>0?t.version:1,meta:{name:String(t.meta?.name||r.meta.name),assetType:i,sourceFormat:String(t.meta?.sourceFormat||r.meta.sourceFormat),sourceFile:String(t.meta?.sourceFile||""),...t.meta?.gameVersion?{gameVersion:String(t.meta.gameVersion)}:{},...t.meta?.giaFilePath?{giaFilePath:String(t.meta.giaFilePath)}:{},...Number.isSafeInteger(Number(t.meta?.giaOwnerUid))?{giaOwnerUid:Number(t.meta.giaOwnerUid)}:{},...Number.isSafeInteger(Number(t.meta?.giaTimestamp))?{giaTimestamp:Number(t.meta.giaTimestamp)}:{},...Number.isSafeInteger(Number(t.meta?.giaFileId))?{giaFileId:Number(t.meta.giaFileId)}:{},...t.meta?.giaFileName?{giaFileName:String(t.meta.giaFileName)}:{},...Number.isSafeInteger(t.meta?.giaNextAssetIndex)&&t.meta.giaNextAssetIndex>=2?{giaNextAssetIndex:t.meta.giaNextAssetIndex}:{},...Number.isSafeInteger(t.meta?.giaAssetIndexSchemaVersion)&&t.meta.giaAssetIndexSchemaVersion>0?{giaAssetIndexSchemaVersion:t.meta.giaAssetIndexSchemaVersion}:{},...Number.isSafeInteger(Number(t.meta?.giaModeFlag))&&Number(t.meta.giaModeFlag)>=0?{giaModeFlag:Number(t.meta.giaModeFlag)}:{}},canvasId:t.canvasId&&Te[t.canvasId]?t.canvasId:nn,selectedId:t.selectedId||r.selectedId,root:Eo(t.root||r.root)};return qf(n),Lt(n,{warnings:e}),n}function qf(t){let e=new Set;ke(t.root,i=>{if(typeof i.id!="string"||!i.id)throw new Error("node id must be a non-empty string");if(e.has(i.id))throw new Error(`duplicate node id: ${i.id}`);e.add(i.id)}),e.has(t.selectedId)||(t.selectedId=Co(t.root).id)}function zf(t){return ii(Ki(t))}function Op(t,e){let i=!1;return ke(t,r=>{r.id===e&&(i=!0)}),i}function Tp(t,e,i,r){let o=oi(t.root,t.canvasId).boxes[e.id],s=i.children.findIndex(h=>h.id===e.id);if(s<0)throw new Error("reparent: source node is not attached");if(i.children.splice(s,1),r.children.push(e),!o)return;let a=oi(t.root,t.canvasId),l=r.kind==="server-container"?Qe(t.canvasId):a.boxes[r.id]||Qe(t.canvasId),u=ni(e.transformByPlatform,t.canvasId),f=xi(l,u,{posX:o.centerX,posY:o.centerY,width:o.width,height:o.height});cr(t,e,f)}function Rp(t,e){return t.meta.assetType!=="client-control-template"?Ro(t.root,e):(t.root.children||[]).flatMap(i=>Ro(i,e))}function Bf(t,e){let i=ul(t.root,e);if(t.meta.assetType!=="client-control-template")return i;let r=Cr(t),n=new Set;return r&&r.kind!=="server-container"&&ke(r,o=>n.add(o.id)),i.filter(o=>n.has(o.id))}function Vf(t){let{canvas:e,boxes:i}=oi(t.root,t.canvasId),r=$r(t),n=je(t.root,t.selectedId),o=n?i[n.id]:null;return oe({layoutSchemaVersion:Ze,version:t.version,meta:{...t.meta},canvasId:t.canvasId,canvas:{id:t.canvasId,width:e.width,height:e.height,platform:Te[t.canvasId].platform,label:Te[t.canvasId].label,presets:Object.values(Te).map(s=>({id:s.id,label:s.label,width:s.width,height:s.height,platform:s.platform}))},selectedId:t.selectedId,asset:{type:t.meta.assetType,label:t.meta.assetType==="client-control-template"?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F",templateCount:t.meta.assetType==="client-control-template"?t.root.children.length:1,currentTemplateId:t.meta.assetType==="client-control-template"&&Cr(t)?.id||""},tree:Rp(t,r),boxes:Bf(t,i),inspector:fl(n,t.canvasId,o||e,r),root:t.root})}function cr(t,e,i){let r=oi(t.root,t.canvasId),n=Ds(t,e.id,r.boxes),o={};if(e.syncAllDevices!==!1)for(let s of Be){if(s===_i(t.canvasId))continue;let a=Li[s],l=oi(t.root,a,s);o[s]=Ds(t,e.id,l.boxes,a)}e.transformByPlatform=Ha({transformByPlatform:e.transformByPlatform,source:i,canvasId:t.canvasId,syncAllDevices:e.syncAllDevices!==!1,sourceParentBox:n,targetParentBoxByPlatform:o})}var Np=new Set(["name","active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text","imageSource","imageType","imageId","imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","enableFill","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount","reverseMaskArea","raycastTarget","interactable","clickAudioId","unavailableChildId","hoverChildId","pressedChildId","selectedChildId","showScrollBar","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","scrollDirection","layoutConstraint","referencedPrefabId","animationId","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),Pp=new Set(["posX","posY","width","height"]),Fp=new Set(["anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]);function Mp(t){if(typeof t=="number"&&Number.isFinite(t))return t>>>0;if(typeof t=="string"){let e=t.trim();if(e.startsWith("#")){let r=e.slice(1);if(r.length===6)return(4278190080|parseInt(r,16))>>>0;if(r.length===8)return parseInt(r,16)>>>0}let i=Number(e);if(Number.isFinite(i))return i>>>0}throw new Error("color must be an ARGB integer or #RRGGBB/#AARRGGBB string")}function Kt(t,e){let i=Number(t);if(!Number.isFinite(i))throw new Error(`${e} must be a finite number`);return i}function Df(t){if(t===!0||t===1||t==="1"||t==="true")return!0;if(t===!1||t===0||t==="0"||t==="false")return!1;throw new Error("boolean field requires true or false")}var zp=new Set(["fontSize","minimumFontSize","imageId","clickAudioId","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","fillAmount","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),Dp=new Set(["active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","adaptiveFontSize","enableOutline","enableMask","enableSoftEdge","enableFill","reverseMaskArea","raycastTarget","interactable","showScrollBar"]),$p=new Set(["name","imageSource","horizontalAlignment","verticalAlignment","text","softEdgeMode","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","scrollDirection","layoutConstraint","referencedPrefabId","animationId"]),$f=new Set(["unavailableChildId","hoverChildId","pressedChildId","selectedChildId"]),Gf={imageSource:["StaticReference","Prefab"],imageType:["Basic","Stretch",null],scrollDirection:["Horizontal","Vertical"],layoutConstraint:["AutoWrap","Fixed"],softEdgeMode:["Percentage","Pixel"],fillType:["Horizontal","Vertical","Radial90","Radial180","Radial360"],fillHorizontalType:["Left","Right"],fillVerticalType:["Bottom","Top"],fillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],fillRadialType:["Bottom","Left","Top","Right"]};function Gp(t,e){if(!e||typeof e!="object")throw new Error("patch requires op");let i=e.op;if(i==="select")return e.id&&je(t.root,e.id)&&(t.selectedId=e.id),t;if(i==="pick"){let{boxes:r}=oi(t.root,t.canvasId),n=Bf(t,r),o=cl(n,Number(e.x),Number(e.y));return o&&(t.selectedId=o),t}if(i==="setCanvas")return e.canvasId&&Te[e.canvasId]&&(t.canvasId=e.canvasId),t;if(i==="setScript")throw new Error("\u811A\u672C\u7531\u5B58\u6863\u7EDF\u4E00\u7BA1\u7406\uFF0C\u8BF7\u4F7F\u7528 addScript / updateScript / removeScript \u64CD\u4F5C");if(i==="newAsset"){let r=e.assetType==="client-control-template"?Wi():Ei();return t.version=r.version,t.meta=r.meta,t.canvasId=r.canvasId,t.selectedId=r.selectedId,t.root=r.root,t}if(i==="addTemplate"){if(t.meta.assetType!=="client-control-template")throw new Error("\u53EA\u6709\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B\u53EF\u4EE5\u65B0\u589E\u6A21\u677F");let r=we(e.kind,{id:Io(t.root),guid:zf(t.root),name:e.name||`\u65B0${e.kind==="container"?"\u5BB9\u5668\u8282\u70B9":e.kind}\u6A21\u677F`});return t.root.children.push(r),t.selectedId=r.id,t}if(i==="add"){let r=je(t.root,e.parentId||t.selectedId);if(!r)throw new Error("add: parent not found");let n=Ya(r,e.kind,{id:Io(t.root),guid:zf(t.root),name:e.name});return t.selectedId=n.id,t}if(i==="reparent"){if(t.meta.assetType!=="client-control-template")throw new Error("\u5C42\u7EA7\u8C03\u6574\u4EC5\u9002\u7528\u4E8E\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B");let r=je(t.root,e.id||t.selectedId),n=r?ri(t.root,r.id):null,o=je(t.root,e.parentId);if(!r||r.kind==="server-container"||!n)throw new Error("reparent: node not found");if(!o)throw new Error("reparent: parent not found");if(o.id===r.id||Op(r,o.id))throw new Error("\u63A7\u4EF6\u4E0D\u80FD\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u540E\u4EE3\u4E0B\u9762");if(o.kind==="server-container"&&n.kind==="server-container")return t;if(n.kind==="server-container"&&o.kind!=="server-container"&&t.root.children.length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u9876\u5C42\u6A21\u677F");return Tp(t,r,n,o),t.selectedId=r.id,t}if(i==="moveSibling"){let r=je(t.root,e.id||t.selectedId),n=r?ri(t.root,r.id):null;if(!r||!n)throw new Error("moveSibling: node not found");let o=n.children.findIndex(l=>l.id===r.id),s=e.direction==="up"?-1:e.direction==="down"?1:0,a=o+s;return!s||a<0||a>=n.children.length||(n.children.splice(o,1),n.children.splice(a,0,r),t.selectedId=r.id),t}if(i==="remove"){let r=e.id||t.selectedId,n=ri(t.root,r);if(n?.kind==="server-container"){if(t.meta.assetType!=="client-control-template")throw new Error("\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F\u7684\u5BA2\u6237\u7AEF\u6839\u8282\u70B9\u4E0D\u80FD\u5220\u9664");if((t.root.children||[]).length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u6A21\u677F")}return Ua(t.root,r)&&(ke(t.root,o=>{if(o.kind==="button")for(let s of $f)o[s]&&!je(t.root,o[s])&&(o[s]=null)}),t.selectedId=n?n.id:t.root.id),t}if(i==="set"){let r=je(t.root,e.id||t.selectedId);if(!r)throw new Error("set: node not found");let n=e.key;n==="reverseMask"&&(n="reverseMaskArea");let o=e.value;if(r.kind==="reference"&&["referencedPrefabId","giaRaw.templateRefSlot"].includes(n)&&(r.giaRaw.templateRefSlotBase64||r.giaRaw.templateRefOuterBase64))throw new Error("\u8BE5\u6A21\u677F\u5F15\u7528\u542B\u5C1A\u672A\u89E3\u6790\u7684\u539F\u59CB\u914D\u7F6E\uFF0C\u6682\u4E0D\u80FD\u6539\u5199\u76EE\u6807\u7D22\u5F15\uFF1B\u8BF7\u5728\u5B98\u65B9\u7F16\u8F91\u5668\u4FEE\u6539\u540E\u91CD\u65B0\u5BFC\u5165");if(n.startsWith("giaRaw.")){let u=n.slice(7);if(!u||u.includes("."))throw new Error("invalid raw GIA field path");let f=Va(r.kind,u);if(!f)throw new Error(`unknown raw GIA field for ${r.kind}: ${u}`);if(r.giaRaw||={},r.giaRaw[u]=bo(f,o),u==="footerField505"&&[0,1].includes(r.giaRaw[u])&&(r.canControllerFocus=r.giaRaw[u]===1),r.kind==="cursor"&&u==="cursorField501"&&[0,1].includes(r.giaRaw[u])&&(r.raycastTarget=r.giaRaw[u]===1),(r.kind==="textbox"||r.kind==="textwindow")&&u==="textAlign"){let h={0:"Left",1:"Middle",2:"Right"}[r.giaRaw[u]];h&&(r.horizontalAlignment=h)}if(r.kind==="image"&&u==="imageFillType"){let h={1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[r.giaRaw[u]];h&&(r.fillType=h)}return r.kind==="keyhint"&&u==="keyHintField502"&&(r.keyboardKeyCode=r.giaRaw[u]),r.kind==="keyhint"&&u==="keyHintField501"&&(r.controllerKeyCode=r.giaRaw[u]),t}if(n==="syncAllDevices"){if(r.syncAllDevices=Df(o),r.syncAllDevices){let u=ni(r.transformByPlatform,t.canvasId);cr(t,r,u)}return t}if(Np.has(n)){if(n.endsWith("Color")&&(o=Mp(o)),zp.has(n)){if(o=Kt(o,n),o<0)throw new Error(`${n} must not be negative`);if((n==="imageId"||n==="clickAudioId"||n==="keyboardKeyCode"||n==="controllerKeyCode")&&(o=Math.trunc(o)),n==="fillAmount"&&o>1)throw new Error("fillAmount must be between 0 and 1")}if(Dp.has(n)&&(o=Df(o)),$p.has(n)&&(o=String(o??"")),n==="horizontalAlignment"&&!["Left","Middle","Right"].includes(o))throw new Error("invalid horizontalAlignment");if(n==="verticalAlignment"&&!["Top","Middle","Bottom"].includes(o))throw new Error("invalid verticalAlignment");if(Gf[n]&&!Gf[n].includes(o))throw new Error(`invalid ${n}`);if($f.has(n))if(o===""||o===void 0||o===null)o=null;else{o=String(o);let u=je(t.root,o);if(!u||u===r||u.kind==="server-container"||!(r.children||[]).some(f=>f.id===o))throw new Error(`${n} must reference a direct child of this button`)}if(r.kind==="image"&&(n==="imageSource"||n==="imageId")&&r[n]!==o&&(r.imageType=null,r.giaRaw.imageSlotType=0),r[n]=o,r.kind==="image"&&n==="imageType"&&(r.giaRaw.imageSlotType=o==="Stretch"?1:0),n==="canControllerFocus"&&(r.giaRaw.footerField505=o?1:0),r.kind==="cursor"&&n==="raycastTarget"&&(r.giaRaw.cursorField501=o?1:0),(r.kind==="textbox"||r.kind==="textwindow")&&n==="horizontalAlignment"&&(r.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o]),(r.kind==="textbox"||r.kind==="textwindow")&&n==="verticalAlignment"&&delete r.giaRaw.textVerticalAlign,r.kind==="image"&&n==="fillType"){let u={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o];u&&(r.giaRaw.imageFillType=u)}return r.kind==="reference"&&n==="referencedPrefabId"&&(r.giaRaw.templateRefSlot=o),r.kind==="grid"&&n==="previewCount"&&(r.giaRaw.gridField511=Math.trunc(o)),r.kind==="keyhint"&&n==="keyboardKeyCode"&&(r.giaRaw.keyHintField502=Math.trunc(o)),r.kind==="keyhint"&&n==="controllerKeyCode"&&(r.giaRaw.keyHintField501=Math.trunc(o)),(r.kind==="animation"||r.kind==="fullscreen")&&n==="animationId"&&(r.giaRaw[r.kind==="animation"?"effectSlot":"fullscreenEffectSlot"]=o),t}let{boxes:s}=oi(t.root,t.canvasId),a=Ds(t,r.id,s),l=ni(r.transformByPlatform,t.canvasId);if(n==="anchorType"){let u=zs(s[r.id]),f=Da(l,o);return f=xi(a,f,u),cr(t,r,f),t}if(["rotationX","rotationY","rotationZ"].includes(n)){let u={...l,rotation:{...l.rotation,[n.slice(-1).toLowerCase()]:Kt(o,n)}};return cr(t,r,u),t}if(Fp.has(n)){let u=zs(s[r.id]),f={...l,anchorMin:{...l.anchorMin},anchorMax:{...l.anchorMax},pivot:{...l.pivot}};return n==="anchorMinX"&&(f.anchorMin.x=Kt(o,n)),n==="anchorMinY"&&(f.anchorMin.y=Kt(o,n)),n==="anchorMaxX"&&(f.anchorMax.x=Kt(o,n)),n==="anchorMaxY"&&(f.anchorMax.y=Kt(o,n)),n==="pivotX"&&(f.pivot.x=Kt(o,n)),n==="pivotY"&&(f.pivot.y=Kt(o,n)),cr(t,r,xi(a,f,u)),t}if(Pp.has(n)){let u=zs(s[r.id]),f=Kt(o,n);if((n==="width"||n==="height")&&f<0)throw new Error(`${n} must not be negative`);return u[n]=f,cr(t,r,xi(a,l,u)),t}throw new Error(`set: unknown key ${n}`)}if(i==="replace"){let r=yi(e.project);return t.version=r.version,t.meta=r.meta,t.canvasId=r.canvasId,t.selectedId=r.selectedId,t.root=r.root,t}throw new Error(`unknown op ${i}`)}function $s(t,e){if(!e||typeof e!="object")throw new Error("patch requires op");if(e.expectedRevision!==void 0&&Number(e.expectedRevision)!==t.version)throw new Error(`revision conflict: expected ${e.expectedRevision}, current ${t.version}`);let i=t.version,r=JSON.parse(JSON.stringify(t));return Gp(r,e),qf(r),Lt(r),r.version=i+1,Object.keys(t).forEach(n=>{delete t[n]}),Object.assign(t,r),t}function zs(t){return t?{posX:t.centerX,posY:t.centerY,width:t.width,height:t.height}:{posX:0,posY:0,width:0,height:0}}import qp from"fengari";var{lua:d,lauxlib:Ie,lualib:Lf,to_luastring:Un,to_jsstring:Bp}=qp,Vp=d.LUA_TNIL,Lp=d.LUA_TBOOLEAN,jp=d.LUA_TNUMBER,Yp=d.LUA_TSTRING,jf=d.LUA_TTABLE,Up=d.LUA_TFUNCTION,Gs=d.LUA_TUSERDATA,Ct=d.LUA_OK,Yf=new WeakMap,qs=Symbol("luaTableEntries"),Bs={__scriptHostKey:!0};function D(t){return Un(String(t))}function Fi(t,e){Yf.set(t,e)}function st(t){return Yf.get(t)}var Gr=class{constructor(e){this.value=e}};function Ge(t,e,i){if(i instanceof Gr){d.lua_pushnumber(t,i.value);return}if(i==null){d.lua_pushnil(t);return}let r=typeof i;if(r==="boolean"){d.lua_pushboolean(t,i);return}if(r==="number"){Number.isInteger(i)&&Math.abs(i)<=2147483647?d.lua_pushinteger(t,i):d.lua_pushnumber(t,i);return}if(r==="string"){d.lua_pushstring(t,D(i));return}if(r==="function"){Kp(t,e,i);return}if(i&&i[qs]){let n=i[qs];d.lua_createtable(t,Array.isArray(i)?i.length:0,n.length);for(let[o,s]of n)Ge(t,e,o),Ge(t,e,s),d.lua_settable(t,-3);return}if(Array.isArray(i)){d.lua_createtable(t,i.length,0);for(let n=0;n<i.length;n++)Ge(t,e,i[n]),d.lua_rawseti(t,-2,n+1);return}if(i&&i.__kind==="EnumItem"){e.pushEnumItem(t,i);return}if(i&&i.__kind==="CursorEventData"){e.pushCursor(t,i);return}if(i&&i.__kind==="Script"){e.pushScript(t,i);return}if(i&&i.typeofName){e.pushControl(t,i);return}if(i&&i.__kind==="ServerSignal"){e.pushSignal(t,i);return}if(i&&(i.SetEase||i.Append)){e.pushTween(t,i);return}if(r==="object"){d.lua_createtable(t,0,Object.keys(i).length);for(let[n,o]of Object.entries(i))Ge(t,e,o),d.lua_setfield(t,-2,D(n));return}d.lua_pushnil(t)}function Ce(t,e){if(d.lua_isnil(t,e)||d.lua_type(t,e)===d.LUA_TNONE)return"";if(!d.lua_isstring(t,e)&&d.lua_type(t,e)!==d.LUA_TNUMBER)return`lua_type=${d.lua_type(t,e)}`;let i=d.lua_tostring(t,e);return i==null?"":Bp(i)}function Wt(t,e){e=d.lua_absindex(t,e);let i=d.lua_type(t,e);if(i===Gs)return st(d.lua_touserdata(t,e));if(i===jf){d.lua_pushlightuserdata(t,Bs),d.lua_rawget(t,e);let r=d.lua_type(t,-1)===Gs?d.lua_touserdata(t,-1):null;return d.lua_pop(t,1),r?st(r):null}return null}function He(t,e,i){i=d.lua_absindex(t,i);let r=d.lua_type(t,i);if(r===Vp)return null;if(r===Lp)return!!d.lua_toboolean(t,i);if(r===jp)return d.lua_isinteger(t,i)?d.lua_tointeger(t,i):d.lua_tonumber(t,i);if(r===Yp)return Ce(t,i);if(r===Gs){let n=d.lua_touserdata(t,i);return st(n)??n}if(r===Up)return Xp(t,e,i);if(r===jf){let n=Wt(t,i);if(n)return n;let o=[];for(d.lua_pushnil(t);d.lua_next(t,i)!==0;){let u=He(t,e,-2),f=He(t,e,-1);o.push([u,f]),d.lua_pop(t,1)}let s=new Map(o.filter(([u])=>Number.isInteger(u)&&u>=1)),a=0;for(;s.has(a+1);)a+=1;let l=a>0?[]:{};for(let[u,f]of o)Array.isArray(l)&&Number.isInteger(u)&&u>=1?l[u-1]=f:(typeof u=="string"||typeof u=="number")&&(l[u]=f);return Object.defineProperty(l,qs,{value:o}),l}return null}function Xp(t,e,i){e.luaFunctions||(e.luaFunctions=new Map);let r=typeof d.lua_topointer=="function"?d.lua_topointer(t,i):null;if(r!=null&&e.luaFunctions.has(r))return e.luaFunctions.get(r);d.lua_pushvalue(t,i);let n=Ie.luaL_ref(t,d.LUA_REGISTRYINDEX),o=Hp(t,e,n);return r!=null&&e.luaFunctions.set(r,o),o}function Hp(t,e,i){let r=(...n)=>{if(r.__luaRef==null)throw new Error("attempt to call a released Lua callback");let o=d.lua_gettop(t);d.lua_rawgeti(t,d.LUA_REGISTRYINDEX,r.__luaRef);for(let u of n)Ge(t,e,u);if(d.lua_pcall(t,n.length,d.LUA_MULTRET,0)!==Ct){let u=Ce(t,-1);throw d.lua_settop(t,o),new Error(u)}let a=d.lua_gettop(t)-o,l=[];for(let u=1;u<=a;u++)l.push(He(t,e,o+u));if(d.lua_settop(t,o),l.length!==0)return l.length===1?l[0]:l};return r.__luaRef=i,r.__luaState=t,r}function Uf(t){t?.__luaRef!=null&&(t.__luaHolds=(t.__luaHolds||0)+1)}function Xf(t,e){if(!e||e.__luaRef==null||!e.__luaState)return;if(e.__luaHolds>1){e.__luaHolds-=1;return}let i=e.__luaState;if((!t?.luaStates||t.luaStates.has(i))&&Ie.luaL_unref(i,d.LUA_REGISTRYINDEX,e.__luaRef),e.__luaRef=null,e.__luaState=null,t?.luaFunctions)for(let[r,n]of t.luaFunctions)n===e&&t.luaFunctions.delete(r)}function Kp(t,e,i){d.lua_pushlightuserdata(t,i),d.lua_pushlightuserdata(t,e),d.lua_pushcclosure(t,function(n){let o=d.lua_touserdata(n,d.lua_upvalueindex(1)),s=d.lua_touserdata(n,d.lua_upvalueindex(2)),a=d.lua_gettop(n),l=[];for(let u=1;u<=a;u++)l.push(He(n,s,u));try{let u=o(...l);if(Array.isArray(u)&&u.__multi){for(let f of u)Ge(n,s,f);return u.length}return u===void 0?0:(Ge(n,s,u),1)}catch(u){return d.lua_pushstring(n,D(String(u&&u.message?u.message:u))),d.lua_error(n)}},2)}function Hf(t){!t||typeof d.lua_close!="function"||d.lua_close(t)}function Kf(t){if(Ie.luaL_loadstring(t,D(["local nativeGetMetatable = getmetatable","getmetatable = function(value)",' if type(value) == "string" then return nil end'," return nativeGetMetatable(value)","end"].join(`
119
- `)))===Ct&&d.lua_pcall(t,0,0,0),d.lua_settop(t,0),d.lua_pushnil(t),d.lua_setglobal(t,D("_VERSION")),d.lua_getglobal(t,D("string")),!d.lua_isnil(t,-1))for(let i of["dump","pack","unpack"])d.lua_pushnil(t),d.lua_setfield(t,-2,D(i));if(d.lua_pop(t,1),d.lua_pushnil(t),d.lua_setglobal(t,D("io")),d.lua_getglobal(t,D("os")),!d.lua_isnil(t,-1))for(let i of Object.keys({execute:1,getenv:1,remove:1,rename:1,tmpname:1,setlocale:1,exit:1}))d.lua_pushnil(t),d.lua_setfield(t,-2,D(i));d.lua_pop(t,1),d.lua_getglobal(t,D("debug")),d.lua_isnil(t,-1)?d.lua_pop(t,1):(d.lua_getfield(t,-1,D("traceback")),d.lua_newtable(t),d.lua_pushvalue(t,-2),d.lua_setfield(t,-2,D("traceback")),d.lua_setglobal(t,D("debug")),d.lua_pop(t,2)),d.lua_getglobal(t,D("math")),d.lua_isnil(t,-1)||(d.lua_pushcfunction(t,i=>{let r=d.lua_tonumber(i,1);return d.lua_pushboolean(i,Number.isNaN(r)),1}),d.lua_setfield(t,-2,D("isnan")),d.lua_pushcfunction(t,i=>{let r=d.lua_tonumber(i,1);return d.lua_pushboolean(i,r===1/0||r===-1/0),1}),d.lua_setfield(t,-2,D("isinf"))),d.lua_pop(t,1),d.lua_pushnil(t),d.lua_setglobal(t,D("package")),d.lua_pushnil(t),d.lua_setglobal(t,D("load")),d.lua_pushnil(t),d.lua_setglobal(t,D("loadfile")),d.lua_pushnil(t),d.lua_setglobal(t,D("dofile")),d.lua_pushnil(t),d.lua_setglobal(t,D("collectgarbage")),d.lua_pushnil(t),d.lua_setglobal(t,D("coroutine")),d.lua_pushnil(t),d.lua_setglobal(t,D("fengari"))}var ct=(t,e=0)=>Number.isFinite(Number(t))?Number(t):e,Wf=t=>t?.Name||t,Xn=t=>Math.max(0,Math.min(1,ct(t)));function qr(t){let e=t.parent?qr(t.parent):[t.runtime.canvasWidth,t.runtime.canvasHeight];return[Math.max(0,(t.anchorMaxX-t.anchorMinX)*e[0]+ct(t.sizeDeltaX)),Math.max(0,(t.anchorMaxY-t.anchorMinY)*e[1]+ct(t.sizeDeltaY))]}function Br(t){let[e,i]=qr(t),r=Wf(t.scrollDirection)==="Horizontal",n=Math.max(1,ct(t.cellSizeX,50)),o=Math.max(1,ct(t.cellSizeY,50)),s=Math.max(0,ct(t.spacingX)),a=Math.max(0,ct(t.spacingY)),l=Math.max(0,ct(t.padding1X)),u=Math.max(0,ct(t.padding1Y)),f=Math.max(0,ct(t.padding2X)),h=Math.max(0,ct(t.padding2Y)),p=r?i-u-h:e-l-f,m=r?o:n,g=r?a:s,b=Wf(t.layoutConstraint)==="Fixed"?Math.max(1,Math.floor(ct(t.layoutConstraintFixedCount,1))):Math.max(1,Math.floor((p+g)/(m+g))),C=Math.ceil(t.itemCount/b),k=C?r?l+f+C*n+(C-1)*s:u+h+C*o+(C-1)*a:0,E=r?e:i,G=Math.max(0,k-E);return{width:e,height:i,horizontal:r,cellW:n,cellH:o,gapX:s,gapY:a,left:l,top:u,right:f,bottom:h,lanes:b,length:k,viewport:E,max:G,offset:Xn(t.scrollProgress)*G}}function dr(t){let e=Br(t);for(let i=0;i<(t._gridItems?.length||0);i+=1){let r=t._gridItems[i];if(!r.alive||r.parent!==t)continue;let n=Math.floor(i/e.lanes),o=i%e.lanes,s=e.horizontal?n:o,a=e.horizontal?o:n,l=e.left+s*(e.cellW+e.gapX)+e.cellW/2-(e.horizontal?e.offset:0),u=-e.top-a*(e.cellH+e.gapY)-e.cellH/2+(e.horizontal?0:e.offset),f={anchorMinX:0,anchorMaxX:0,anchorMinY:1,anchorMaxY:1,pivotX:.5,pivotY:.5,sizeDeltaX:e.cellW,sizeDeltaY:e.cellH,anchoredPositionX:l,anchoredPositionY:u};Object.entries(f).some(([h,p])=>r[h]!==p)&&(Object.assign(r,f),r.markPlayDirty(!0))}return e}var Jf={container:"ClientUIContainerControl",textbox:"ClientUITextBoxControl",textwindow:"ClientUITextWindowControl",image:"ClientUIImageControl",button:"ClientUIPresetButtonControl",cursor:"ClientUICursorEventAreaControl",grid:"ClientUIGridScrollerControl",keyhint:"ClientUIKeyHintControl",animation:"ClientUIAnimationControl",fullscreen:"ClientUIFullscreenAnimationControl",reference:"ClientUIReferenceControl"},Wp=["alive","Id","prefabIndex","active","activeInHierarchy","visible"],Hn=new Set(["active","visible","parent","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]),Jp=["name","parent","anchoredPositionX","anchoredPositionY","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY","localScaleX","localScaleY","localScaleZ","localRotationX","localRotationY","localRotationZ","canControllerFocus"],Zp={image:["imageSource","imageId"],grid:["itemCount","scrollDirection","layoutConstraint","layoutConstraintFixedCount"],reference:["referencedPrefabIndex"]},Qp={container:["isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor"],textbox:["text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],textwindow:["interactable","showScrollBar","text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],image:["imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","reverseMaskArea","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount"],button:["interactable","clickAudioId","raycastTarget"],cursor:["raycastTarget"],grid:["itemPrefabIndex","raycastTarget","showScrollBar","interactable","scrollProgress"],keyhint:["keyboardKeyCode","controllerKeyCode"],animation:["animationId","playSoundEffect","layer"],fullscreen:["animationId","playSoundEffect"]},em=["GetChildren","GetChild","FindChild","SetActive","SetVisible","GetSiblingIndex","SetSiblingIndex","SetAsFirstSibling","SetAsLastSibling","GetAnchoredPosition","SetAnchoredPosition","GetSizeDelta","SetSizeDelta","GetAnchorMin","SetAnchorMin","GetAnchorMax","SetAnchorMax","GetPivot","SetPivot","GetLocalScale","SetLocalScale","GetLocalRotation","SetLocalRotation","GetScriptByPath","GetScript","GetScripts","AddKeyEventListener","RemoveKeyEventListener","RemoveKeyEventListeners","RemoveAllKeyEventListeners","AddNavigationEventListener","RemoveNavigationEventListener","RemoveNavigationEventListeners","RemoveAllNavigationEventListeners","SetControllerNavigation","GetControllerNavigation"],Zf=["AddCursorEventListener","RemoveCursorEventListener","RemoveCursorEventListeners","RemoveAllCursorEventListeners","SimulateCursorClick"],tm={image:["SetImage","SetSoftEdgeWidth","SetFillUnused","SetFillHorizontal","SetFillVertical","SetFillRadial90","SetFillRadial180","SetFillRadial360"],button:Zf,cursor:Zf,animation:["PlayAnimation","StopAnimation"],grid:["RefreshItems","GetItemIndex","GetItemSize","GetItemSpacing","GetPadding","ScrollToItemAt","GetContentLength"]};function Ls(t,e){return t.kind==="image"&&e==="imageType"&&t.runtime.canSelectImageType(t.imageId,t.imageSource)?"rw":Wp.includes(e)||(Zp[t.kind]||[]).includes(e)?"ro":Jp.includes(e)||(Qp[t.kind]||[]).includes(e)?"rw":null}var im=["localRotationX","localRotationY","localRotationZ"],hr=Math.PI/180;function Qf(t,e){return[t[3]*e[0]+t[0]*e[3]+t[1]*e[2]-t[2]*e[1],t[3]*e[1]-t[0]*e[2]+t[1]*e[3]+t[2]*e[0],t[3]*e[2]+t[0]*e[1]-t[1]*e[0]+t[2]*e[3],t[3]*e[3]-t[0]*e[0]-t[1]*e[1]-t[2]*e[2]]}function Vs(t){if(Object.is(t,-0))return t;let e=(t%360+360)%360,i=Math.round(e*1e6)/1e6;return i>=360?0:i}function ec(t,e,i){let r=E=>[Math.sin(E*hr/2),Math.cos(E*hr/2)],[n,o]=r(t),[s,a]=r(e),[l,u]=r(i),[f,h,p,m]=Qf(Qf([0,s,0,a],[n,0,0,o]),[0,0,l,u]),g=Math.max(-1,Math.min(1,-2*(h*p-m*f))),b,C,k;return Math.abs(g)>.999999?(b=Math.sign(g)*90,C=2*Math.atan2(h,m)/hr,k=0):(b=Math.asin(g)/hr,C=Math.atan2(2*(m*h+f*p),1-2*(f*f+h*h))/hr,k=Math.atan2(2*(m*p+f*h),1-2*(f*f+p*p))/hr),[Vs(b),Vs(C),Vs(k)]}function tc(t,e){return em.includes(e)||(tm[t.kind]||[]).includes(e)}var rm={container:{isolateNavigation:!1,disableKeyEventPassthrough:!1,disableCursorEventPassthrough:!1,showCursor:!1},textbox:{text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},textwindow:{interactable:!0,showScrollBar:!0,text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},image:{imageSource:null,imageId:0,imageColor:4294967295,imageType:null,enableMask:!1,enableSoftEdge:!1,softEdgeMode:"Percentage",softEdgeWidthX:8,softEdgeWidthY:8,horizontalSoftRange:85,verticalSoftRange:85,enableFill:!1,fillType:"Unused",fillHorizontalType:"Left",fillVerticalType:"Bottom",fillRadial90Type:"BottomLeft",fillRadialType:"Bottom",reverseMaskArea:!1,fillAmount:1},button:{interactable:!0,clickAudioId:0,raycastTarget:!0,unavailableChildId:null,hoverChildId:null,pressedChildId:null,selectedChildId:null,pressed:!1},cursor:{raycastTarget:!0},grid:{itemCount:0,itemPrefabIndex:null,raycastTarget:!0,interactable:!0,showScrollBar:!0,scrollDirection:"Vertical",layoutConstraint:"AutoWrap",layoutConstraintFixedCount:null,scrollProgress:0,cellSizeX:50,cellSizeY:50,spacingX:8,spacingY:8,padding1X:20,padding1Y:20,padding2X:20,padding2Y:20,previewCount:5},keyhint:{keyboardKeyCode:null,controllerKeyCode:null},animation:{animationId:null,playSoundEffect:null,layer:null,raycastTarget:!1},fullscreen:{animationId:null,playSoundEffect:null,raycastTarget:!1},reference:{referencedPrefabIndex:null}},vi=class t{constructor(e,i){this.runtime=e,this.kind=i.kind||"container",this.typeofName=Jf[this.kind]||Jf.container,this.alive=!0,this.Id=i.Id??e.nextControlId(),this.authoringId=i.authoringId??null,this.prefabIndex=i.prefabIndex??0,this.name=i.name??"",this.active=i.active===!0,this.visible=i.visible!==!1,this._parent=null,this.children=[],this.scripts=[],this.cursorListeners=new Map,this.keyListeners=new Map,this.navListeners=new Map,this.navConfig=new Map,this.anchoredPositionX=i.anchoredPositionX??0,this.anchoredPositionY=i.anchoredPositionY??0,this.sizeDeltaX=i.sizeDeltaX??0,this.sizeDeltaY=i.sizeDeltaY??0,this.anchorMinX=i.anchorMinX??.5,this.anchorMinY=i.anchorMinY??.5,this.anchorMaxX=i.anchorMaxX??.5,this.anchorMaxY=i.anchorMaxY??.5,this.pivotX=i.pivotX??.5,this.pivotY=i.pivotY??.5,this.localScaleX=i.localScaleX??1,this.localScaleY=i.localScaleY??1,this.localScaleZ=i.localScaleZ??1,this.localRotationX=i.localRotationX??0,this.localRotationY=i.localRotationY??0,this.localRotationZ=i.localRotationZ??0,this.canControllerFocus=i.canControllerFocus??!1,this._playDirty=!0,this._playDeepDirty=!0,this._playChildDirty=!1,(this.kind==="grid"||this.kind==="textwindow")&&(this.runtime.scrollControls||=new Set,this.runtime.scrollControls.add(this));let r=rm[this.kind]||{};for(let[n,o]of Object.entries(r))this[n]===void 0&&(this[n]=i[n]!==void 0?i[n]:o);if(this.kind==="grid"&&(this.scrollProgress=i.scrollProgress??0),i.children)for(let n of i.children){let o=n instanceof t?n:new t(e,n);this.addChild(o)}}get parent(){return this._parent}set parent(e){if(this._parent===e)return;if(e!==null&&!(e instanceof t))throw new Error("parent must be a Control or nil");if(e&&e.runtime!==this.runtime)throw new Error("parent must belong to the same runtime");if(e===this)throw new Error("cannot parent a control to itself or its descendant");for(let r=e;r;r=r._parent)if(r===this)throw new Error("cannot parent a control to itself or its descendant");let i=this._parent;if(i){let r=i.children.indexOf(this);r>=0&&i.children.splice(r,1),i.markPlayDirty(!0)}else{let r=this.runtime.roots.indexOf(this);r>=0&&this.runtime.roots.splice(r,1)}this._parent=e,this.markPlayDirty(!0),e&&!e.children.includes(this)?(e.children.push(this),e.markPlayDirty(!0)):!e&&this.alive&&!this.runtime.roots.includes(this)&&this.runtime.roots.push(this)}markPlayDirty(e=!1){this._playDirty=!0,e&&(this._playDeepDirty=!0);for(let i=this._parent;i&&!i._playChildDirty;i=i._parent)i._playChildDirty=!0}get activeInHierarchy(){return this.active?this._parent?this._parent.activeInHierarchy:!0:!1}get scrollProgress(){return this._scrollProgress??0}set scrollProgress(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("scrollProgress must be a finite number");this._scrollProgress=Xn(e),this.markPlayDirty()}addChild(e){return e.parent=this,e}GetChildren(){return this.children.slice()}GetChild(e){return this.children.find(i=>i.name===e)||null}FindChild(e){if(!e)return null;if(!e.includes("/"))return this.GetChild(e);let i=e.split("/").filter(Boolean),r=this;for(let n of i)if(r=r.GetChild(n),!r)return null;return r}SetActive(e){let i=!!e;if(this.active!==i){if(typeof this.runtime?.onControlActiveChanging=="function"){this.runtime.onControlActiveChanging(this,i);return}this.active=i,this.markPlayDirty(!0)}}SetVisible(e){this.visible=!!e,this.markPlayDirty(!0)}GetSiblingIndex(){if(!this._parent)return-1;let e=this._parent.children,i=e.indexOf(this);return i<0?-1:e.length-1-i}SetSiblingIndex(e){if(!this._parent)return!1;let i=this._parent.children,r=i.indexOf(this);if(r<0)return!1;let n=i.length-1;return!Number.isInteger(e)||e<0||e>n?!1:(i.splice(r,1),i.splice(n-e,0,this),this._parent.markPlayDirty(!0),this.markPlayDirty(),!0)}SetAsFirstSibling(){return this.SetSiblingIndex(0)}SetAsLastSibling(){return this._parent?this.SetSiblingIndex(this._parent.children.length-1):!1}GetAnchoredPosition(){return[this.anchoredPositionX,this.anchoredPositionY]}SetAnchoredPosition(e,i){this.anchoredPositionX=e,this.anchoredPositionY=i,this.markPlayDirty()}GetSizeDelta(){return[this.sizeDeltaX,this.sizeDeltaY]}SetSizeDelta(e,i){this.sizeDeltaX=e,this.sizeDeltaY=i,this.markPlayDirty(!0)}GetAnchorMin(){return[this.anchorMinX,this.anchorMinY]}SetAnchorMin(e,i){this.anchorMinX=e,this.anchorMinY=i,this.markPlayDirty(!0)}GetAnchorMax(){return[this.anchorMaxX,this.anchorMaxY]}SetAnchorMax(e,i){this.anchorMaxX=e,this.anchorMaxY=i,this.markPlayDirty(!0)}GetPivot(){return[this.pivotX,this.pivotY]}SetPivot(e,i){this.pivotX=e,this.pivotY=i,this.markPlayDirty(!0)}GetLocalScale(){return[this.localScaleX,this.localScaleY,this.localScaleZ]}SetLocalScale(e,i,r){this.localScaleX=e,this.localScaleY=i,this.localScaleZ=r,this.markPlayDirty()}GetLocalRotation(){return ec(this.localRotationX,this.localRotationY,this.localRotationZ)}luaFieldValue(e){if(e==="imageType")return this.imageType??"Stretch";let i=im.indexOf(e);return i<0?this[e]:ec(this.localRotationX,this.localRotationY,this.localRotationZ)[i]}SetLocalRotation(e,i,r){this.localRotationX=e,this.localRotationY=i,this.localRotationZ=r,this.markPlayDirty()}GetScriptByPath(e){return this.scripts.find(i=>i.path===e)||null}GetScript(e){return this.scripts.find(i=>i.scriptMappingId===e)||null}GetScripts(){return this.scripts.slice()}_addListener(e,i,r){let n=e.get(i)||[];n.push(r),e.set(i,n),this.runtime.retainLuaCallback?.(r)}_removeListener(e,i,r){let n=e.get(i);if(!n)return;let o=n.filter(s=>s!==r);e.set(i,o);for(let s=o.length;s<n.length;s++)this.runtime.unrefLuaCallback?.(r)}_removeListeners(e,i){let r=e.get(i)||[];for(let n of r)this.runtime.unrefLuaCallback?.(n);e.delete(i)}_removeAllListeners(e){for(let i of e.values())for(let r of i)this.runtime.unrefLuaCallback?.(r);e.clear()}AddCursorEventListener(e,i){this._addListener(this.cursorListeners,e,i)}RemoveCursorEventListener(e,i){this._removeListener(this.cursorListeners,e,i)}RemoveCursorEventListeners(e){this._removeListeners(this.cursorListeners,e)}RemoveAllCursorEventListeners(){this._removeAllListeners(this.cursorListeners)}SimulateCursorClick(){let e=this.runtime.makeCursorEventData({x:0,y:0,pressX:0,pressY:0});this.emitCursor("CursorDown",e),this.emitCursor("CursorUp",e),this.emitCursor("CursorClick",e)}emitCursor(e,i){if(!this.runtime.cursorEventsEnabled(this))return;let r=this.cursorListeners.get(e)||[];for(let n of r)n(i)}AddKeyEventListener(e,i){this._addListener(this.keyListeners,e,i)}RemoveKeyEventListener(e,i){this._removeListener(this.keyListeners,e,i)}RemoveKeyEventListeners(e){this._removeListeners(this.keyListeners,e)}RemoveAllKeyEventListeners(){this._removeAllListeners(this.keyListeners)}emitKey(e){let i=this.keyListeners.get(e)||[];for(let r of i)if(r()===!0)return!0;return!1}AddNavigationEventListener(e,i){this._addListener(this.navListeners,e,i)}RemoveNavigationEventListener(e,i){this._removeListener(this.navListeners,e,i)}RemoveNavigationEventListeners(e){this._removeListeners(this.navListeners,e)}RemoveAllNavigationEventListeners(){this._removeAllListeners(this.navListeners)}SetControllerNavigation(e,i,r){this.navConfig.set(e,{mode:i,target:r})}GetControllerNavigation(e){let i=this.navConfig.get(e),r=i?[i.mode,i.target]:[null,null];return r.__multi=!0,r}SetImage(e,i){let r=this.imageSource?.Name||this.imageSource,n=e?.Name||e;(i!==this.imageId||r!==n)&&(this.imageType=null),this.imageSource=e,this.imageId=i,this.markPlayDirty()}SetSoftEdgeWidth(e,i){this.softEdgeWidthX=e,this.softEdgeWidthY=i,this.markPlayDirty()}SetFillUnused(){this.fillType="Unused",this.markPlayDirty()}SetFillHorizontal(e,i){this.fillType="Horizontal",this.fillHorizontalType=e,this.fillAmount=i,this.markPlayDirty()}SetFillVertical(e,i){this.fillType="Vertical",this.fillVerticalType=e,this.fillAmount=i,this.markPlayDirty()}SetFillRadial90(e,i){this.fillType="Radial90",this.fillRadial90Type=e,this.fillAmount=i,this.markPlayDirty()}SetFillRadial180(e,i){this.fillType="Radial180",this.fillRadialType=e,this.fillAmount=i,this.markPlayDirty()}SetFillRadial360(e,i){this.fillType="Radial360",this.fillRadialType=e,this.fillAmount=i,this.markPlayDirty()}PlayAnimation(){}StopAnimation(){}RefreshItems(e,i){if(!Number.isInteger(e)||e<0||e>2e3)throw new Error("RefreshItems: simulator supports 0..2000 items");if(typeof i!="function")throw new Error("RefreshItems: callback must be a function");if(!this.alive||this._refreshingGrid)throw new Error("RefreshItems: destroyed control or recursive refresh");if(e&&!this.runtime.templates.has(Number(this.itemPrefabIndex)))throw new Error("RefreshItems: item template not found");if(e&&["OnInit","OnDestroy"].includes(this.runtime.lifecyclePhase))throw new Error("RefreshItems: items cannot be created during OnInit/OnDestroy");this._refreshingGrid=!0;try{this._gridItems||=[];let r=[];for(let n of this._gridItems)n.alive&&n.parent===this&&n.prefabIndex===Number(this.itemPrefabIndex)&&r.length<e?r.push(n):n.alive&&n.parent===this&&this.runtime.destroyControl(n);for(this._gridItems=r;r.length<e;){let n=this.runtime.instantiate(this.itemPrefabIndex,this,this.runtime.lifecyclePhase);if(!n)throw new Error("RefreshItems: could not instantiate item");r.push(n),n.SetActive(!0)}this.itemCount=e,dr(this),this.markPlayDirty(!0);for(let n=0;n<r.length&&this.alive;n+=1)i(r[n],n)}finally{this._refreshingGrid=!1}}GetItemIndex(e){return e?.alive&&e.parent===this?this._gridItems?.indexOf(e)??-1:-1}GetItemSize(){return[this.cellSizeX,this.cellSizeY]}GetItemSpacing(){return[this.spacingX,this.spacingY]}GetPadding(){return[this.padding1Y,this.padding2Y,this.padding1X,this.padding2X]}ScrollToItemAt(e,i){if(!Number.isInteger(e)||e<0||e>=this.itemCount)throw new Error("ScrollToItemAt: item index out of range");let r=Br(this),n=r.horizontal?r.cellW:r.cellH,o=r.horizontal?r.gapX:r.gapY,s=(r.horizontal?r.left:r.top)+Math.floor(e/r.lanes)*(n+o),a=i?.Name||i;if(!["Top","Center","Bottom"].includes(a))throw new Error("ScrollToItemAt: invalid alignment");let l=s-(a==="Center"?(r.viewport-n)/2:a==="Bottom"?r.viewport-n:0);this.scrollProgress=r.max?Xn(l/r.max):0,dr(this),this.markPlayDirty(!0)}GetContentLength(){return Br(this).length}};function Dt(t,e){e(t);for(let i of t.children)Dt(i,e)}function js(t,e=[],i=""){e.push(`${i}${t.name||"(unnamed)"} [${t.typeofName}] Id=${t.Id}`);for(let r of t.children)js(r,e,i+" ");return e}function Kn(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}var ic={Linear:t=>t,InSine:t=>1-Math.cos(t*Math.PI/2),OutSine:t=>Math.sin(t*Math.PI/2),InOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,InQuad:t=>t*t,OutQuad:t=>1-(1-t)*(1-t),InOutQuad:t=>t<.5?2*t*t:1-(-2*t+2)**2/2,InCubic:t=>t*t*t,OutCubic:t=>1-(1-t)**3,InOutCubic:t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2,InQuart:t=>t**4,OutQuart:t=>1-(1-t)**4,InOutQuart:t=>t<.5?8*t**4:1-(-2*t+2)**4/2,InQuint:t=>t**5,OutQuint:t=>1-(1-t)**5,InOutQuint:t=>t<.5?16*t**5:1-(-2*t+2)**5/2,InExpo:t=>t===0?0:2**(10*t-10),OutExpo:t=>t===1?1:1-2**(-10*t),InOutExpo:t=>t===0||t===1?t:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,InCirc:t=>1-Math.sqrt(1-t**2),OutCirc:t=>Math.sqrt(1-(t-1)**2),InOutCirc:t=>t<.5?(1-Math.sqrt(1-(2*t)**2))/2:(Math.sqrt(1-(-2*t+2)**2)+1)/2,InBack:t=>(1.70158+1)*t*t*t-1.70158*t*t,OutBack:t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,InOutBack:t=>{let i=2.5949095;return t<.5?(2*t)**2*((i+1)*2*t-i)/2:((2*t-2)**2*((i+1)*(t*2-2)+i)+2)/2},InElastic:t=>t===0||t===1?t:-(2**(10*t-10))*Math.sin((t*10-10.75)*(2*Math.PI/3)),OutElastic:t=>t===0||t===1?t:2**(-10*t)*Math.sin((t*10-.75)*(2*Math.PI/3))+1,InOutElastic:t=>{if(t===0||t===1)return t;let e=2*Math.PI/4.5;return t<.5?-(2**(20*t-10)*Math.sin((20*t-11.125)*e))/2:2**(-20*t+10)*Math.sin((20*t-11.125)*e)/2+1},InBounce:t=>1-Kn(1-t),OutBounce:Kn,InOutBounce:t=>t<.5?(1-Kn(1-2*t))/2:(1+Kn(2*t-1))/2};function rc(t,e){let i=ic[t]||ic.Linear;return e<=0?0:e>=1?1:i(e)}function pr(t,e,i,r=255){let n=Wn(t),o=Wn(e),s=Wn(i);return((r==null?255:Wn(r))<<24|n<<16|o<<8|s)>>>0}function Vr(t){let e=t>>>0;return[e>>>16&255,e>>>8&255,e&255,e>>>24&255]}function Wn(t){let e=Number(t);return Number.isFinite(e)?Math.max(0,Math.min(255,Math.trunc(e))):0}function nc(t,e,i){let r=Vr(t),n=Vr(e);return pr(r[0]+(n[0]-r[0])*i,r[1]+(n[1]-r[1])*i,r[2]+(n[2]-r[2])*i,r[3]+(n[3]-r[3])*i)}var nm=new Set(["fontColor","bgColor","outlineColor","imageColor"]),om=new Set(["fontSize","minimumFontSize"]),Ys=1e-9;function sm(t,e){return typeof t?.luaFieldValue=="function"?t.luaFieldValue(e):t[e]}var Lr=class{constructor(e,i,r,n){this.runtime=e,this.object=i,this.data={...r},this.duration=Math.max(0,Number(n)||0),this.easeName="Linear",this.relative=!1,this.playing=!1,this.paused=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.from={},this.to={},this.initialFrom=null,this.initialTo=null,this.onComplete=null,this.onStepComplete=null,this.killed=!1,this.dead=!1,this.completed=!1}capture(){this.from={},this.to={};for(let[e,i]of Object.entries(this.data)){let r=sm(this.object,e);this.from[e]=r,this.to[e]=this.relative?Number(r)+Number(i):i}}restoreInitial(){this.from={...this.initialFrom},this.to={...this.initialTo}}SetEase(e){return this.easeName=typeof e=="string"?e:e?.Name||"Linear",this}SetRelative(e){return this.relative=!!e,this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._start(!1)}_begin(e){this.playing=!0,this.paused=!1,this.elapsed=0,this.loopIndex=0,this.killed=!1,this.completed=!1,e&&this.initialFrom?this.restoreInitial():(this.capture(),this.initialFrom={...this.from},this.initialTo={...this.to})}_start(e){return this._begin(e),this.runtime.tweens.add(this),this.runtime.animations.add(this),this}get loopCount(){return this.loops>0?this.loops:1}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){return this.dead?this:this._start(!0)}Complete(){this.dead||this.completed||(this.initialFrom||this._begin(!1),this.apply(1),this.finish(!0))}Kill(e){e?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(e){return this.onComplete=e,this}SetOnStepComplete(e){return this.onStepComplete=e,this}SetLoops(e){return this.loops=e,this}apply(e){if(this.object?.alive===!1)return;let i=rc(this.easeName,e),r=!1,n=!1;for(let o of Object.keys(this.to)){let s=this.from[o],a=this.to[o];if(nm.has(o)&&typeof s=="number"&&typeof a=="number")this.object[o]=nc(s,a,i);else if(typeof s=="number"&&typeof a=="number"){let l=s+(a-s)*i;this.object[o]=om.has(o)?Math.trunc(l):l}else this.object[o]=i>=1?a:s;r=!0,Hn.has(o)&&(n=!0)}r&&typeof this.object?.markPlayDirty=="function"&&this.object.markPlayDirty(n)}_advance(e,i){this.elapsed+=e;let r=this.duration<=0?1:Math.min(1,this.elapsed/this.duration);return this.apply(r),r<1?!1:i>=0&&this.loopIndex+1>=i?!0:(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.elapsed=0,this.restoreInitial(),!1)}step(e){!this.playing||this.paused||this.killed||this._advance(e,this.loops<0?-1:this.loopCount)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0))}finish(e){this.playing=!1,this.killed=!0,e&&(this.completed=!0),this.runtime.tweens.delete(this),this.runtime.animations.delete(this),e&&this.onComplete&&this.runtime.safeCall(this.onComplete)}},mr=class{constructor(e){this.runtime=e,this.steps=[],this.playing=!1,this.paused=!1,this.killed=!1,this.dead=!1,this.completed=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.onComplete=null,this.onStepComplete=null,this._entries=null}Append(e){return this.steps.push({kind:"tween",tween:e,parallel:!1}),this}AppendInterval(e){return this.steps.push({kind:"interval",duration:e}),this}AppendCallback(e){return this.steps.push({kind:"callback",fn:e}),this}Join(e){return this.steps.push({kind:"tween",tween:e,parallel:!0}),this}Insert(e,i){return this.steps.push({kind:"insert",time:e,tween:i}),this}InsertCallback(e,i){return this.steps.push({kind:"insertCb",time:e,fn:i}),this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._play()}_play(){return this.playing=!0,this.paused=!1,this.killed=!1,this.completed=!1,this.elapsed=0,this.loopIndex=0,this._schedule(),this.runtime.sequences.add(this),this.runtime.animations.add(this),this}_schedule(){let e=0,i=0,r=!1,n=[],o=s=>s.duration*s.loopCount;for(let s of this.steps)if(s.kind==="tween"&&s.parallel){let a=r?i:e;n.push({at:a,tween:s.tween}),e=Math.max(e,a+o(s.tween))}else s.kind==="tween"?(n.push({at:e,tween:s.tween}),i=e,r=!0,e+=o(s.tween)):s.kind==="interval"?(i=e,r=!0,e+=s.duration):s.kind==="callback"?n.push({at:e,fn:s.fn}):s.kind==="insert"?(n.push({at:s.time,tween:s.tween}),e=Math.max(e,s.time+o(s.tween))):s.kind==="insertCb"&&(n.push({at:s.time,fn:s.fn}),e=Math.max(e,s.time));this._entries=n.map((s,a)=>({...s,index:a,end:s.tween?s.at+o(s.tween):s.at})),this._end=e,this._resetEntries()}_resetEntries(){for(let e of this._entries)e.started=!1,e.done=!1}_startChild(e){e.started=!0,e.tween._begin(!!e.tween.initialFrom)}_finishChild(e){e.done=!0,e.tween.apply(1),e.tween.onStepComplete&&this.runtime.safeCall(e.tween.onStepComplete),e.tween.finish(!0)}_advanceTo(e,i){let r=this._entries,n=[];for(let s of r)!s.started&&s.at<=e+Ys&&n.push({at:s.at,rank:s.fn?1:2,entry:s}),s.tween&&!s.done&&s.end<=e+Ys&&n.push({at:s.end,rank:0,entry:s});n.sort((s,a)=>s.at-a.at||s.rank-a.rank||s.entry.index-a.entry.index);let o=new Set;for(let{rank:s,entry:a}of n)if(s===1){if(a.started=!0,this.runtime.safeCall(a.fn),!this.playing||this.killed||this._entries!==r)return!1}else a.started||(this._startChild(a),o.add(a)),s===0&&!a.done&&this._finishChild(a);for(let s of r)!s.tween||!s.started||s.done||(o.has(s)?s.tween._advance(e-s.at,s.tween.loopCount):s.tween._advance(i,s.tween.loopCount));return!0}step(e){!this.playing||this.paused||this.killed||(this.elapsed+=e,this._advanceTo(this.elapsed,e)&&(this.elapsed+Ys<this._end||(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.loops<0||this.loopIndex<this.loops?(this.elapsed=0,this._resetEntries()):this.finish(!0))))}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){this.dead||this._play()}Complete(){this.dead||this.completed||(this._entries||this._schedule(),this.playing=!0,this.killed=!1,this._advanceTo(1/0,0)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0)))}Kill(e){e?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(e){return this.onComplete=e,this}SetOnStepComplete(e){return this.onStepComplete=e,this}SetLoops(e){return this.loops=e,this}finish(e){this.playing=!1,this.killed=!0,e&&(this.completed=!0),this.runtime.sequences.delete(this),this.runtime.animations.delete(this),e&&this.onComplete&&this.runtime.safeCall(this.onComplete)}};var Jn={EaseType:["Linear","InSine","OutSine","InOutSine","InQuad","OutQuad","InOutQuad","InCubic","OutCubic","InOutCubic","InQuart","OutQuart","InOutQuart","InQuint","OutQuint","InOutQuint","InExpo","OutExpo","InOutExpo","InCirc","OutCirc","InOutCirc","InBack","OutBack","InOutBack","InElastic","OutElastic","InOutElastic","InBounce","OutBounce","InOutBounce"],CustomVariableEntityType:["Level","PlayerSelf","AvatarSelf"],Device:["KeyboardAndMouse","Mobile","Controller","MobileController"],StageMode:["Beyond","Classic"],LanguageType:["LanguageNone","LanguageEng","LanguageChs","LanguageCht","LanguageFra","LanguageDeu","LanguageSpa","LanguagePor","LanguageRus","LanguageJpn","LanguageKor","LanguageTha","LanguageVie","LanguageInd","LanguageTur","LanguageIta"],ParamType:["Entity","EntityList","Int","IntList","Bool","BoolList","Float","FloatList","String","StringList","Vector3","Vector3List","Guid","GuidList","ConfigId","PrefabId","ConfigIdList","PrefabIdList"],CursorEventType:["CursorDown","CursorUp","CursorEnter","CursorExit","CursorDrag","CursorBeginDrag","CursorEndDrag","CursorClick"],ScrollDirection:["Horizontal","Vertical"],ScrollLayoutConstraint:["AutoWrap","Fixed"],ScrollAlignType:["Bottom","Center","Top"],ControllerNavigationDir:["Up","Down","Left","Right"],ControllerNavigationEventType:["Confirm","Cancel","Focus","LostFocus","RightStickUp","RightStickDown","RightStickRight","RightStickLeft","LeftStickUp","LeftStickDown","LeftStickRight","LeftStickLeft"],ControllerNavigationMode:["None","NearestControl","Specified"],TextHorizontalAlignment:["Left","Middle","Right"],TextVerticalAlignment:["Top","Middle","Bottom"],ImageType:["Basic","Stretch"],ImageSource:["StaticReference","Item","Equipment","Skill","UnitStatus","Faction","Currency","Prefab"],ImageFillType:["Unused","Horizontal","Vertical","Radial90","Radial180","Radial360"],ImageFillHorizontalType:["Left","Right"],ImageFillVerticalType:["Bottom","Top"],ImageFillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],ImageFillRadialType:["Bottom","Left","Top","Right"],ImageMaskSoftEdgeMode:["Percentage","Pixel"],UIAnimationLayer:["AboveAllControls","BelowAllControls"]},am=[...Array.from({length:43},(t,e)=>`CraftspersonKey${e+1}`),"MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","None"],lm=[...Array.from({length:14},(t,e)=>`CraftspersonKey${e+1}`),"SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey","None"];function um(){let t=[];for(let e of["Down","Up"]){for(let i=1;i<=43;i++)t.push(`KeyboardCraftspersonKey${i}${e}`);for(let i of["MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key"])t.push(`Keyboard${i}${e}`);for(let i=1;i<=14;i++)t.push(`ControllerCraftspersonKey${i}${e}`);for(let i of["SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey"])t.push(`Controller${i}${e}`)}return t}Jn.KeyboardKeyCode=am;Jn.ControllerKeyCode=lm;Jn.KeyEventType=um();var oc=new Map;function Mi(t,e){let i=`${t}\0${e}`,r=oc.get(i);return r||(r={__kind:"EnumItem",Name:e,FullName:`Enum.${t}.${e}`,EnumType:t},oc.set(i,r)),r}function Us(t,e){return e==null?e:e.__kind==="EnumItem"?Mi(e.EnumType||t,e.Name):typeof e=="string"&&e?Mi(t,e):e}function Xs(){let t={};for(let[e,i]of Object.entries(Jn)){let r={};for(let n of i)r[n]=Mi(e,n);t[e]=r}return t}var fm=new Set(["Id","prefabIndex","imageId","fontSize","minimumFontSize","clickAudioId","itemCount","itemPrefabIndex","animationId","referencedPrefabIndex"]),cm=new Set(["imageColor","fontColor","bgColor","outlineColor"]),sc={horizontalAlignment:"TextHorizontalAlignment",verticalAlignment:"TextVerticalAlignment",imageSource:"ImageSource",imageType:"ImageType",fillType:"ImageFillType",fillHorizontalType:"ImageFillHorizontalType",fillVerticalType:"ImageFillVerticalType",fillRadial90Type:"ImageFillRadial90Type",fillRadialType:"ImageFillRadialType",softEdgeMode:"ImageMaskSoftEdgeMode",layer:"UIAnimationLayer",scrollDirection:"ScrollDirection",layoutConstraint:"ScrollLayoutConstraint"},zi=d.LUA_REGISTRYINDEX,ac=d.LUA_MULTRET,dm=Object.freeze({InstantiateClientUIControl:2,DestroyClientUIControl:1,GetClientUIControl:1,FindClientUIRoot:1,GetClientUIRoots:0,GetUICanvasSize:0,GetCursorUIPos:0,GetDevice:0,SetControllerFocus:1,GetControllerFocus:0,GetControllerLeftStickAxis:0,GetControllerRightStickAxis:0,Tween:3,TweenSequence:0,ServerSignal:1,GetGlobalCustomVariableValue:2,PauseLevelTime:1,IsLevelTimePaused:0,PlayAudio2D:1,StopAudio:1,IsAudioAlive:1,GetLanguageType:0,GetStageMode:0,IsTestPlay:0,GetText:1,PrintClientUITree:0});function et(t){return t==null?"":typeof t=="string"?t:t.Name||t.FullName||String(t)}var Zn=class{constructor(e={}){this.canvasWidth=e.canvasWidth??1600,this.canvasHeight=e.canvasHeight??900,this.device=e.device??"KeyboardAndMouse",this.language=e.language??"LanguageChs",this.stageMode=e.stageMode??"Classic",this.testPlay=e.testPlay!==!1,this.canSelectImageType=e.canSelectImageType||(()=>!1),this.clock={time:0,levelTime:0,paused:!1,frame:0},this.logs=[],this.mountErrors=[],this.tweens=new Set,this.sequences=new Set,this.animations=new Set,this.audios=new Map,this.nextAudioId=1,this.audioDuration=e.audioDuration||(()=>null),this.audioHistory=[],this.audioWarnings=new Set,this.audioRevision=0,this._nextControlId=1,this._playRemoved=[],this._nextScriptMappingId=1,this.lifecyclePhase="idle",this.controlsById=new Map,this.roots=[],this.templates=new Map,this.scriptFiles=new Map,this.requireAliases=new Map,this.requireCache=new Map,this.moduleBaseEnvironments=new Map,this.luaFunctions=new Map,this.mountedScripts=[],this.serverVars={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)},this.serverBridge=null,this.varHandlers=[],this.signalHandlers=[],this.cursor={x:0,y:0},this.focus=null,this.stick={left:[0,0],right:[0,0]},this.enumTree=Xs(),this.luaStates=new Set,this.L=null}nextControlId(){let e=this._nextControlId;return this._nextControlId+=1,e}resolveScriptMappingId(e){let i=Number(e);if(Number.isSafeInteger(i)&&i>0)return this._nextScriptMappingId=Math.max(this._nextScriptMappingId,i+1),i;let r=this._nextScriptMappingId;return this._nextScriptMappingId+=1,r}pushPackedColor(e,i){let r=i>>>0;(r|0)===r?d.lua_pushinteger(e,r):d.lua_pushnumber(e,r)}retainLuaCallback(e){Uf(e)}unrefLuaCallback(e){Xf(this,e)}log(e,...i){let r=i.map(n=>n==null?"nil":typeof n=="object"&&n!==null&&n.__kind==="EnumItem"?n.Name:String(n)).join(" ");this.logs.push({level:e,text:r,time:this.clock.time})}safeCall(e,...i){try{return e(...i)}catch(r){this.log("lua-error",r&&r.message?r.message:String(r))}}scriptCanRun(e){if(!e?.alive||!e.enabled)return!1;let i=e.object;return!i||i.alive&&i.activeInHierarchy}cursorEventsEnabled(e){for(let i=e;i;i=i.parent)if(i.kind==="container"&&i.showCursor===!0)return!0;return!1}registerTemplate(e,i){this.templates.set(Number(e),i)}registerScriptFile(e,i){let r=this.normalizeRequirePath(e);this.scriptFiles.set(r,i),r.startsWith("default_import_file/")||this.requireAliases.set(`default_import_file/${r}`,r)}normalizeRequirePath(e){let i=String(e).replace(/\\/g,"/");return i.endsWith(".lua")&&(i=i.slice(0,-4)),i=i.replace(/\./g,"/"),i}addRoot(e){let i=e instanceof vi?e:new vi(this,e);return this.roots.push(i),Dt(i,r=>this.controlsById.set(r.Id,r)),this.mountSpecScripts(e,i),i}mountSpecScripts(e,i){if(e instanceof vi)return;let r=o=>(o.scripts?.length||0)>0||(o.children||[]).some(r);if(!e||!r(e))return;let n=this.lifecyclePhase;try{let o=(s,a)=>{for(let u of s.scripts||[])try{this.mountScript({path:u.path,source:u.source,control:a,scriptMappingId:u.scriptMappingId})}catch(f){let h=f&&f.message?f.message:String(f);this.mountErrors.push(h),this.log("lua-error",h)}let l=s.children||[];for(let u=0;u<l.length;u+=1)o(l[u],a?.children?.[u])};o(e,i)}finally{this.lifecyclePhase=n}}makeCursorEventData({x:e=0,y:i=0,pressX:r=e,pressY:n=i,deltaX:o=e-r,deltaY:s=i-n,dragging:a=!1,touchId:l=-1}={}){let u=this;return{__kind:"CursorEventData",typeofName:"CursorEventData",dragging:a,touchId:l,x:e,y:i,pressX:r,pressY:n,GetUIPos(){return[e,i]},GetPressUIPos(){return[r,n]},GetUIPosDelta(){return[o,s]}}}boot(){let e=this.newLuaThread();this.L=e}installGlobals(e){let i=this;d.lua_pushcfunction(e,r=>{let n=d.lua_gettop(r),o=[];for(let s=1;s<=n;s++)o.push(He(r,i,s));return i.log("info",...o),0}),d.lua_setglobal(e,D("print")),d.lua_pushcfunction(e,r=>{let n=d.lua_gettop(r),o=[];for(let s=1;s<=n;s++)o.push(He(r,i,s));return i.log("error",...o),0}),d.lua_setglobal(e,D("printerr")),d.lua_pushcfunction(e,r=>{if(d.lua_type(r,1)===d.LUA_TTABLE&&!Wt(r,1))return d.lua_pushstring(r,D("table")),1;let n=He(r,i,1);return d.lua_pushstring(r,D(i.typeofOf(n))),1}),d.lua_setglobal(e,D("typeof")),this.pushColorLib(e),this.pushEnumLib(e),this.pushGameLib(e),d.lua_pushcfunction(e,r=>i.luaRequire(r)),d.lua_setglobal(e,D("require"))}typeofOf(e){return e==null?"nil":e.__kind==="Script"?"Script":e.__kind==="EnumItem"?"EnumItem":e.__kind==="CursorEventData"?"CursorEventData":e.__kind==="ServerSignal"?"ServerSignal":e instanceof mr?"TweenSequence":e instanceof Lr?"Tween":e.typeofName?e.typeofName:typeof e=="number"?"number":typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e}pushColorLib(e){d.lua_newtable(e),d.lua_pushcfunction(e,i=>(this.pushPackedColor(i,pr(d.lua_tonumber(i,1),d.lua_tonumber(i,2),d.lua_tonumber(i,3),255)),1)),d.lua_setfield(e,-2,D("FromRGB")),d.lua_pushcfunction(e,i=>{let r=d.lua_isnoneornil(i,4)?255:d.lua_tonumber(i,4);return this.pushPackedColor(i,pr(d.lua_tonumber(i,1),d.lua_tonumber(i,2),d.lua_tonumber(i,3),r)),1}),d.lua_setfield(e,-2,D("FromRGBA")),d.lua_pushcfunction(e,i=>{let r=d.lua_tonumber(i,1)>>>0;for(let n of Vr(r))d.lua_pushinteger(i,n);return 4}),d.lua_setfield(e,-2,D("ToRGBA")),d.lua_newtable(e),d.lua_pushcfunction(e,i=>{let r=d.lua_tonumber(i,2),n=d.lua_tonumber(i,3),o=d.lua_tonumber(i,4),s=d.lua_isnoneornil(i,5)?255:d.lua_tonumber(i,5);return this.pushPackedColor(i,pr(r,n,o,s)),1}),d.lua_setfield(e,-2,D("__call")),d.lua_setmetatable(e,-2),d.lua_setglobal(e,D("Color"))}pushEnumLib(e){d.lua_newtable(e);for(let[i,r]of Object.entries(this.enumTree)){d.lua_newtable(e);for(let[n,o]of Object.entries(r))this.pushEnumItem(e,o),d.lua_setfield(e,-2,D(n));d.lua_setfield(e,-2,D(i))}d.lua_setglobal(e,D("Enum"))}pushEnumItem(e,i){let r=d.lua_newuserdata(e,0);Fi(r,i),Ie.luaL_setmetatable(e,D("EnumItem"))}pushControl(e,i){let r=d.lua_newuserdata(e,0);Fi(r,i),Ie.luaL_setmetatable(e,D("Control"))}pushScript(e,i){d.lua_newtable(e),d.lua_pushlightuserdata(e,Bs);let r=d.lua_newuserdata(e,0);Fi(r,i),d.lua_rawset(e,-3),Ie.luaL_getmetatable(e,D("Script")),d.lua_setmetatable(e,-2)}pushTween(e,i){let r=d.lua_newuserdata(e,0);Fi(r,i);let n=i instanceof mr?"TweenSequence":"Tween";Ie.luaL_setmetatable(e,D(n))}pushSignal(e,i){let r=d.lua_newuserdata(e,0);Fi(r,i),Ie.luaL_setmetatable(e,D("ServerSignal"))}pushCursor(e,i){let r=d.lua_newuserdata(e,0);Fi(r,i),Ie.luaL_setmetatable(e,D("CursorEventData"))}pushGameLib(e){let i=this;d.lua_newtable(e);let r={InstantiateClientUIControl:n=>{let o=d.lua_tointeger(n,1),s=st(d.lua_touserdata(n,2)),a=i.instantiate(o,s,i.lifecyclePhase);return a?(i.pushControl(n,a),1):(d.lua_pushnil(n),1)},DestroyClientUIControl:n=>{let o=st(d.lua_touserdata(n,1));return o&&i.destroyControl(o),0},GetClientUIControl:n=>{let o=d.lua_tointeger(n,1),s=i.controlsById.get(o);return s?i.pushControl(n,s):d.lua_pushnil(n),1},FindClientUIRoot:n=>{let o=Ce(n,1),s=i.roots.find(a=>a.name===o);return s?i.pushControl(n,s):d.lua_pushnil(n),1},GetClientUIRoots:n=>(d.lua_createtable(n,i.roots.length,0),i.roots.forEach((o,s)=>{i.pushControl(n,o),d.lua_rawseti(n,-2,s+1)}),1),GetUICanvasSize:n=>(d.lua_pushnumber(n,i.canvasWidth),d.lua_pushnumber(n,i.canvasHeight),2),GetCursorUIPos:n=>(d.lua_pushnumber(n,i.cursor.x),d.lua_pushnumber(n,i.cursor.y),2),GetDevice:n=>(i.pushEnumItem(n,Mi("Device",i.device)),1),SetControllerFocus:n=>(i.focus=st(d.lua_touserdata(n,1)),0),GetControllerFocus:n=>(i.focus?i.pushControl(n,i.focus):d.lua_pushnil(n),1),GetControllerLeftStickAxis:n=>(d.lua_pushnumber(n,i.stick.left[0]),d.lua_pushnumber(n,i.stick.left[1]),2),GetControllerRightStickAxis:n=>(d.lua_pushnumber(n,i.stick.right[0]),d.lua_pushnumber(n,i.stick.right[1]),2),Tween:n=>{let o=st(d.lua_touserdata(n,1))||He(n,i,1),s=He(n,i,2)||{},a=d.lua_tonumber(n,3),l=new Lr(i,o,s,a);return i.pushTween(n,l),1},TweenSequence:n=>(i.pushTween(n,new mr(i)),1),ServerSignal:n=>{let o=Ce(n,1);return i.pushSignal(n,i.makeServerSignal(o)),1},GetGlobalCustomVariableValue:n=>{let o=et(He(n,i,1)),s=Ce(n,2);return Ge(n,i,i.getVar(o,s)),1},PauseLevelTime:n=>(i.clock.paused=!!d.lua_toboolean(n,1),0),IsLevelTimePaused:n=>(d.lua_pushboolean(n,i.clock.paused),1),PlayAudio2D:n=>{let o=i.playAudio(i.audioInteger(n));return d.lua_pushinteger(n,o),1},StopAudio:n=>(i.stopAudio(i.audioInteger(n)),0),IsAudioAlive:n=>{let o=i.audios.get(i.audioInteger(n));return d.lua_pushboolean(n,!!(o&&o.alive)),1},GetLanguageType:n=>(i.pushEnumItem(n,Mi("LanguageType",i.language)),1),GetStageMode:n=>(i.pushEnumItem(n,Mi("StageMode",i.stageMode)),1),IsTestPlay:n=>(d.lua_pushboolean(n,i.testPlay),1),GetText:n=>{let o=Ce(n,1);return d.lua_pushstring(n,D(o)),1},PrintClientUITree:n=>{for(let o of i.roots)i.log("info",js(o).join(`
120
- `));return 0}};for(let[n,o]of Object.entries(r)){let s=dm[n];if(s===void 0)throw new Error(`missing game arity for ${n}`);d.lua_pushcfunction(e,a=>{let l=d.lua_gettop(a);return l!==s?Ie.luaL_error(a,D(`bad argument count to '${n}' (${s} expected, got ${l})`)):o(a)}),d.lua_setfield(e,-2,D(n))}d.lua_setglobal(e,D("game"))}makeServerSignal(e){let i=[],r=this;return{__kind:"ServerSignal",name:e,AddParam(n,o){i.push({type:et(n),value:o})},AddInt(n){i.push({type:"Int",value:n})},AddIntList(n){i.push({type:"IntList",value:n})},AddFloat(n){i.push({type:"Float",value:n})},AddFloatList(n){i.push({type:"FloatList",value:n})},AddString(n){i.push({type:"String",value:n})},AddStringList(n){i.push({type:"StringList",value:n})},AddVector3(n){i.push({type:"Vector3",value:n})},AddVector3List(n){i.push({type:"Vector3List",value:n})},AddBool(n){i.push({type:"Bool",value:n})},AddBoolList(n){i.push({type:"BoolList",value:n})},AddGuid(n){i.push({type:"Guid",value:n})},AddGuidList(n){i.push({type:"GuidList",value:n})},AddEntity(n){i.push({type:"Entity",value:n})},AddEntityList(n){i.push({type:"EntityList",value:n})},AddPrefabId(n){i.push({type:"PrefabId",value:n})},AddPrefabIdList(n){i.push({type:"PrefabIdList",value:n})},AddConfigId(n){i.push({type:"ConfigId",value:n})},AddConfigIdList(n){i.push({type:"ConfigIdList",value:n})},SendSignal(){let n=i.slice();r.serverBridge&&typeof r.serverBridge.receiveFromClient=="function"&&r.serverBridge.receiveFromClient(e,n)}}}audioInteger(e){let i=d.lua_tonumber(e,1);return d.lua_type(e,1)!==d.LUA_TNUMBER||!Number.isSafeInteger(i)?Ie.luaL_error(e,D("audio argument must be an integer")):i}playAudio(e){this.audioRevision++;let i=this.nextAudioId++,r=this.audioDuration(e),n=Number.isFinite(r)&&r>0,o={instanceId:i,audioId:e,startedAt:this.clock.time,duration:n?r:0,alive:n,stopped:!1};return this.audioHistory.push(o),this.audioHistory.length>128&&this.audioHistory.shift(),n?(this.audios.size>=128&&this.stopAudio(this.audios.keys().next().value),this.audios.set(i,o)):this.audioWarnings.has(e)||(this.audioWarnings.size>=128&&this.audioWarnings.delete(this.audioWarnings.values().next().value),this.audioWarnings.add(e),this.log("warn",`\u97F3\u6548 ${e} \u672A\u5217\u5165\u6A21\u62DF\u5668\u97F3\u9891\u767D\u540D\u5355`)),i}stopAudio(e){let i=this.audios.get(e)||this.audioHistory.find(r=>r.instanceId===e);i&&!i.stopped&&(i.alive=!1,i.stopped=!0,this.audioRevision++),this.audios.delete(e)}audioSnapshot(){return{sequence:this.nextAudioId-1,revision:this.audioRevision,active:[...this.audios.values()].map(e=>({...e})),recent:this.audioHistory.map(e=>({...e}))}}instantiate(e,i,r){if(r==="OnInit"||r==="OnDestroy")return null;let n=this.templates.get(Number(e));if(!n||!i)return null;let o=new vi(this,{...n,Id:this.nextControlId(),authoringId:null,prefabIndex:Number(e)});return i.addChild(o),o.SetAsLastSibling(),Dt(o,s=>this.controlsById.set(s.Id,s)),this.mountSpecScripts(n,o),o}destroyControl(e){if(!(!e||!e.alive)){if(e._destroying)throw new Error(`\u5BA2\u6237\u7AEF\u63A7\u4EF6\u751F\u547D\u5468\u671F\u5904\u4E8E\u521B\u5EFA\u6216\u9500\u6BC1\u65F6\uFF0C\u65E0\u6CD5\u8C03\u7528DestroyClientUIControl, ID:${e.name}`);Dt(e,i=>{i._destroying=!0}),this._destroyControlTree(e)}}_destroyControlTree(e){this.releaseControlListeners(e);for(let i of e.scripts.slice())this.unmountScript(i);for(let i of e.children.slice())this._destroyControlTree(i);if(e.alive=!1,this.scrollControls?.delete(e),this._playRemoved.push(e.Id),e.parent){let i=e.parent,r=i.children.indexOf(e);r>=0&&i.children.splice(r,1),e._parent=null,i.markPlayDirty(!0)}else{let i=this.roots.indexOf(e);i>=0&&this.roots.splice(i,1)}this.controlsById.delete(e.Id),this.focus===e&&(this.focus=null);for(let i of[...this.tweens])i.object===e&&i.Kill(!1)}releaseControlListeners(e){for(let i of e.cursorListeners.values())for(let r of i)this.unrefLuaCallback(r);for(let i of e.keyListeners.values())for(let r of i)this.unrefLuaCallback(r);for(let i of e.navListeners.values())for(let r of i)this.unrefLuaCallback(r);e.cursorListeners.clear(),e.keyListeners.clear(),e.navListeners.clear(),e.navConfig.clear()}onControlActiveChanging(e,i){let r=[];Dt(e,n=>r.push({control:n,was:n.activeInHierarchy})),e.active=!!i,e.markPlayDirty(!0);for(let n of r){let o=n.control.activeInHierarchy;if(n.was!==o)for(let s of n.control.scripts.slice())o?this.enableScript(s):this.disableScript(s)}}bindScriptEnv(e){let i=e.env;return i?(this.pushScript(i,e),d.lua_setglobal(i,D("script")),i):null}disableScript(e){if(!e?.alive||!e.env||e.lifecyclePhase!=="running")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnDisable",e.lifecyclePhase="OnDisable",this.bindScriptEnv(e),this.callGlobal(e.env,"OnDisable"),e.lifecyclePhase="disabled",this.lifecyclePhase=i}enableScript(e){if(!e?.alive||!e.env||e.lifecyclePhase!=="disabled")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnEnable",e.lifecyclePhase="OnEnable",this.bindScriptEnv(e),this.callGlobal(e.env,"OnEnable"),e.lifecyclePhase="running",this.lifecyclePhase=i}unmountScript(e){if(!e||!e.alive)return;let i=e.env,r=this.lifecyclePhase;i&&(e.lifecyclePhase==="running"&&(this.lifecyclePhase="OnDisable",e.lifecyclePhase="OnDisable",this.bindScriptEnv(e),this.callGlobal(i,"OnDisable")),this.lifecyclePhase="OnDestroy",e.lifecyclePhase="OnDestroy",this.bindScriptEnv(e),this.callGlobal(i,"OnDestroy")),e.alive=!1,e.lifecyclePhase="destroyed",this.lifecyclePhase=r,this.mountedScripts=this.mountedScripts.filter(n=>n!==e),e.object&&(e.object.scripts=e.object.scripts.filter(n=>n!==e)),this.varHandlers=this.varHandlers.filter(n=>n.script!==e),this.signalHandlers=this.signalHandlers.filter(n=>n.script!==e),i&&i!==this.L&&this.closeTrackedLuaState(i),e.env=null}installMetatables(e){this.mtEnum(e),this.mtControl(e),this.mtScript(e),this.mtTween(e),this.mtSeq(e),this.mtSignal(e),this.mtCursor(e)}mtIndexNewindex(e,i,r,n,o,s){Ie.luaL_newmetatable(e,D(i)),d.lua_pushcfunction(e,a=>{let l=Wt(a,1)||st(d.lua_touserdata(a,1)),u=Ce(a,2);if(o[u]&&(!s||s(l,u)))return d.lua_pushcfunction(a,o[u]),1;let f;try{f=r(l,u)}catch(h){return Ie.luaL_error(a,D(String(h.message||h)))}return f===void 0?(d.lua_pushnil(a),1):(Ge(a,this,f),1)}),d.lua_setfield(e,-2,D("__index")),d.lua_pushcfunction(e,a=>{try{let l=Wt(a,1)||st(d.lua_touserdata(a,1)),u=Ce(a,2),f=He(a,this,3);return n(l,u,f),0}catch(l){return d.lua_pushstring(a,D(String(l.message||l))),d.lua_error(a)}}),d.lua_setfield(e,-2,D("__newindex")),d.lua_pushcfunction(e,a=>{let l=Wt(a,1)||st(d.lua_touserdata(a,1)),u=Wt(a,2)||st(d.lua_touserdata(a,2));return d.lua_pushboolean(a,l===u),1}),d.lua_setfield(e,-2,D("__eq")),d.lua_pop(e,1)}method(e){let i=this;return r=>{let n=Wt(r,1)||st(d.lua_touserdata(r,1)),o=d.lua_gettop(r),s=[];for(let a=2;a<=o;a++)s.push(He(r,i,a));try{let a=e(n,...s);if(a===n)return d.lua_pushvalue(r,1),1;if(a===void 0)return 0;if(Array.isArray(a)&&a.__multi){for(let l of a)Ge(r,i,l);return a.length}if(Array.isArray(a)&&!(a.length&&typeof a[0]=="object"&&a[0]?.typeofName)){if(a.__controls)return d.lua_createtable(r,a.length,0),a.forEach((l,u)=>{i.pushControl(r,l),d.lua_rawseti(r,-2,u+1)}),1;if(a.__scripts)return d.lua_createtable(r,a.length,0),a.forEach((l,u)=>{i.pushScript(r,l),d.lua_rawseti(r,-2,u+1)}),1;if(typeof a[0]=="number"&&a.length<=4){for(let l of a)d.lua_pushnumber(r,l);return a.length}}return Ge(r,i,a),1}catch(a){return d.lua_pushstring(r,D(String(a.message||a))),d.lua_error(r)}}}mtEnum(e){let i=new Set(["Name","FullName","EnumType"]);this.mtIndexNewindex(e,"EnumItem",(r,n)=>i.has(n)?r[n]:void 0,(r,n)=>{throw new Error(`cannot set ${n}, no such field`)},{})}mtCursor(e){let i=new Set(["dragging","touchId"]);this.mtIndexNewindex(e,"CursorEventData",(r,n)=>i.has(n)?r[n]:void 0,(r,n)=>{throw new Error(`cannot set ${n}, no such field`)},{GetUIPos:this.method(r=>r.GetUIPos()),GetPressUIPos:this.method(r=>r.GetPressUIPos()),GetUIPosDelta:this.method(r=>r.GetUIPosDelta())})}mtControl(e){let i=this.method((n,o)=>n.SetVisible(o)),r={GetChildren:this.method(n=>{let o=n.GetChildren();return o.__controls=!0,o}),GetChild:this.method((n,o)=>n.GetChild(o)),FindChild:this.method((n,o)=>n.FindChild(o)),SetActive:this.method((n,o)=>n.SetActive(o)),SetVisible:n=>d.lua_isboolean(n,2)?i(n):Ie.luaL_error(n,D("bad argument #2 to 'SetVisible' (boolean expected, got %s)"),Ie.luaL_typename(n,2)),GetSiblingIndex:this.method(n=>n.GetSiblingIndex()),SetSiblingIndex:this.method((n,o)=>n.SetSiblingIndex(o)),SetAsFirstSibling:this.method(n=>n.SetAsFirstSibling()),SetAsLastSibling:this.method(n=>n.SetAsLastSibling()),GetAnchoredPosition:this.method(n=>n.GetAnchoredPosition()),SetAnchoredPosition:this.method((n,o,s)=>n.SetAnchoredPosition(o,s)),GetSizeDelta:this.method(n=>n.GetSizeDelta()),SetSizeDelta:this.method((n,o,s)=>n.SetSizeDelta(o,s)),GetAnchorMin:this.method(n=>n.GetAnchorMin()),SetAnchorMin:this.method((n,o,s)=>n.SetAnchorMin(o,s)),GetAnchorMax:this.method(n=>n.GetAnchorMax()),SetAnchorMax:this.method((n,o,s)=>n.SetAnchorMax(o,s)),GetPivot:this.method(n=>n.GetPivot()),SetPivot:this.method((n,o,s)=>n.SetPivot(o,s)),GetLocalScale:this.method(n=>n.GetLocalScale()),SetLocalScale:this.method((n,o,s,a)=>n.SetLocalScale(o,s,a)),GetLocalRotation:this.method(n=>n.GetLocalRotation()),SetLocalRotation:this.method((n,o,s,a)=>n.SetLocalRotation(o,s,a)),GetScriptByPath:this.method((n,o)=>n.GetScriptByPath(o)),GetScript:this.method((n,o)=>n.GetScript(o)),GetScripts:this.method(n=>{let o=n.GetScripts();return o.__scripts=!0,o}),AddCursorEventListener:this.method((n,o,s)=>n.AddCursorEventListener(et(o),s)),RemoveCursorEventListener:this.method((n,o,s)=>n.RemoveCursorEventListener(et(o),s)),RemoveCursorEventListeners:this.method((n,o)=>n.RemoveCursorEventListeners(et(o))),RemoveAllCursorEventListeners:this.method(n=>n.RemoveAllCursorEventListeners()),SimulateCursorClick:this.method(n=>n.SimulateCursorClick()),AddKeyEventListener:this.method((n,o,s)=>n.AddKeyEventListener(et(o),s)),RemoveKeyEventListener:this.method((n,o,s)=>n.RemoveKeyEventListener(et(o),s)),RemoveKeyEventListeners:this.method((n,o)=>n.RemoveKeyEventListeners(et(o))),RemoveAllKeyEventListeners:this.method(n=>n.RemoveAllKeyEventListeners()),AddNavigationEventListener:this.method((n,o,s)=>n.AddNavigationEventListener(et(o),s)),RemoveNavigationEventListener:this.method((n,o,s)=>n.RemoveNavigationEventListener(et(o),s)),RemoveNavigationEventListeners:this.method((n,o)=>n.RemoveNavigationEventListeners(et(o))),RemoveAllNavigationEventListeners:this.method(n=>n.RemoveAllNavigationEventListeners()),SetControllerNavigation:this.method((n,o,s,a)=>n.SetControllerNavigation(et(o),s,a)),GetControllerNavigation:this.method((n,o)=>n.GetControllerNavigation(et(o))),SetImage:this.method((n,o,s)=>n.SetImage(o,s)),SetSoftEdgeWidth:this.method((n,o,s)=>n.SetSoftEdgeWidth(o,s)),SetFillUnused:this.method(n=>n.SetFillUnused()),SetFillHorizontal:this.method((n,o,s)=>n.SetFillHorizontal(o,s)),SetFillVertical:this.method((n,o,s)=>n.SetFillVertical(o,s)),SetFillRadial90:this.method((n,o,s)=>n.SetFillRadial90(o,s)),SetFillRadial180:this.method((n,o,s)=>n.SetFillRadial180(o,s)),SetFillRadial360:this.method((n,o,s)=>n.SetFillRadial360(o,s)),PlayAnimation:this.method(n=>n.PlayAnimation()),StopAnimation:this.method(n=>n.StopAnimation()),RefreshItems:this.method((n,o,s)=>{this.retainLuaCallback(s);try{n.RefreshItems(o,s)}finally{this.unrefLuaCallback(s)}}),GetItemIndex:this.method((n,o)=>n.GetItemIndex(o)),GetItemSize:this.method(n=>n.GetItemSize()),GetItemSpacing:this.method(n=>n.GetItemSpacing()),GetPadding:this.method(n=>n.GetPadding()),ScrollToItemAt:this.method((n,o,s)=>n.ScrollToItemAt(o,s)),GetContentLength:this.method(n=>n.GetContentLength())};this.mtIndexNewindex(e,"Control",(n,o)=>{if(!Ls(n,o))return;if(!n.alive&&o!=="alive")throw new Error(`attempt to read '${o}' of a destroyed control`);let s=n.luaFieldValue(o),a=sc[o];return a?Us(a,s):typeof s=="number"&&!fm.has(o)&&!cm.has(o)?new Gr(s):s},(n,o,s)=>{if(Ls(n,o)==="rw"){if((o==="fontSize"||o==="minimumFontSize")&&!Number.isInteger(s)){let u=s===null?"nil":typeof s;throw new Error(`bad argument #2 to '${o}' (integer expected, got ${u})`)}let l=sc[o];if(o==="imageType"&&(s?.EnumType!=="ImageType"||!["Basic","Stretch"].includes(s.Name)))throw new Error("imageType requires Enum.ImageType.Basic or Stretch");n[o]=l?Us(l,s):s,typeof n.markPlayDirty=="function"&&n.markPlayDirty(Hn.has(o));return}throw new Error(`cannot set ${o}, no such field`)},r,tc)}mtScript(e){let i=this,r=new Set(["alive","scriptMappingId","object","path","enabled"]);this.mtIndexNewindex(e,"Script",(n,o)=>r.has(o)?n[o]:void 0,(n,o,s)=>{if(o==="enabled"){n.enabled=!!s;return}throw new Error(`cannot set ${o}, no such field`)},{GetParam:this.method((n,o)=>Object.prototype.hasOwnProperty.call(n.params,o)?n.params[o]:null),Invoke:n=>i.luaInvoke(n),EnableUpdate:this.method((n,o)=>{n.updateEnabled=!!o}),RegisterServerSignalHandler:this.method((n,o,s)=>{i.signalHandlers.push({script:n,name:o,fn:s})}),UnregisterServerSignalHandler:this.method((n,o)=>{i.signalHandlers=i.signalHandlers.filter(s=>!(s.script===n&&s.name===o))}),RegisterCustomVariableChangedHandler:this.method((n,o,s,a)=>{i.varHandlers.push({script:n,entityType:et(o),name:s,fn:a})}),UnregisterCustomVariableChangedHandler:this.method((n,o,s)=>{let a=et(o);i.varHandlers=i.varHandlers.filter(l=>!(l.script===n&&l.entityType===a&&l.name===s))})})}mtTween(e){this.mtIndexNewindex(e,"Tween",()=>{},()=>{},{SetEase:this.method((i,r)=>i.SetEase(r)),SetRelative:this.method((i,r)=>i.SetRelative(r)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,r)=>i.Kill(r)),SetOnComplete:this.method((i,r)=>i.SetOnComplete(r)),SetOnStepComplete:this.method((i,r)=>i.SetOnStepComplete(r)),SetLoops:this.method((i,r)=>i.SetLoops(r))})}mtSeq(e){this.mtIndexNewindex(e,"TweenSequence",()=>{},()=>{},{Append:this.method((i,r)=>i.Append(r)),AppendInterval:this.method((i,r)=>i.AppendInterval(r)),AppendCallback:this.method((i,r)=>i.AppendCallback(r)),Join:this.method((i,r)=>i.Join(r)),Insert:this.method((i,r,n)=>i.Insert(r,n)),InsertCallback:this.method((i,r,n)=>i.InsertCallback(r,n)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,r)=>i.Kill(r)),SetOnComplete:this.method((i,r)=>i.SetOnComplete(r)),SetOnStepComplete:this.method((i,r)=>i.SetOnStepComplete(r)),SetLoops:this.method((i,r)=>i.SetLoops(r))})}mtSignal(e){this.mtIndexNewindex(e,"ServerSignal",()=>{},()=>{},{AddParam:this.method((i,r,n)=>i.AddParam(r,n)),SendSignal:this.method(i=>i.SendSignal()),AddInt:this.method((i,r)=>i.AddInt(r)),AddIntList:this.method((i,r)=>i.AddIntList(r)),AddFloat:this.method((i,r)=>i.AddFloat(r)),AddFloatList:this.method((i,r)=>i.AddFloatList(r)),AddString:this.method((i,r)=>i.AddString(r)),AddStringList:this.method((i,r)=>i.AddStringList(r)),AddVector3:this.method((i,r)=>i.AddVector3(r)),AddVector3List:this.method((i,r)=>i.AddVector3List(r)),AddBool:this.method((i,r)=>i.AddBool(r)),AddBoolList:this.method((i,r)=>i.AddBoolList(r)),AddGuid:this.method((i,r)=>i.AddGuid(r)),AddGuidList:this.method((i,r)=>i.AddGuidList(r)),AddEntity:this.method((i,r)=>i.AddEntity(r)),AddEntityList:this.method((i,r)=>i.AddEntityList(r)),AddPrefabId:this.method((i,r)=>i.AddPrefabId(r)),AddPrefabIdList:this.method((i,r)=>i.AddPrefabIdList(r)),AddConfigId:this.method((i,r)=>i.AddConfigId(r)),AddConfigIdList:this.method((i,r)=>i.AddConfigIdList(r))})}luaRequire(e){let i=Ce(e,1),r=this.normalizeRequirePath(i),n=this.requireAliases.get(r)||r;d.lua_rawgeti(e,zi,d.LUA_RIDX_MAINTHREAD);let o=d.lua_tothread(e,-1);d.lua_pop(e,1);let s=this.requireCache.get(o);s||(s=new Map,this.requireCache.set(o,s));let a=s.get(n);if(a?.loading)return d.lua_pushstring(e,D(`failed to load script '${r}': cyclic require`)),d.lua_error(e);if(a&&a.ref!=null)return d.lua_rawgeti(e,zi,a.ref),1;let l=this.scriptFiles.get(n);if(l==null)return d.lua_pushstring(e,D(`failed to load script '${r}'`)),d.lua_error(e);let u=d.lua_gettop(e);s.set(n,{loading:!0});try{this.loadModule(e,o,n,l),d.lua_pushvalue(e,-1);let f=Ie.luaL_ref(e,zi);return s.set(n,{ref:f}),1}catch(f){return s.delete(n),d.lua_settop(e,u),d.lua_pushstring(e,D(`failed to load script '${r}': ${f.message||f}`)),d.lua_error(e)}}newLuaThread(){let e=Ie.luaL_newstate();return Lf.luaL_openlibs(e),Kf(e),this.installMetatables(e),this.installGlobals(e),this.luaStates.add(e),d.lua_pushglobaltable(e),this.copyLuaEnvironment(e,-1),d.lua_remove(e,-2),this.moduleBaseEnvironments.set(e,Ie.luaL_ref(e,zi)),e}copyLuaEnvironment(e,i){let r=d.lua_absindex(e,i);d.lua_newtable(e);let n=d.lua_absindex(e,-1);for(d.lua_pushnil(e);d.lua_next(e,r)!==0;)d.lua_pushvalue(e,-2),d.lua_pushvalue(e,-2),d.lua_rawset(e,n),d.lua_pop(e,1);d.lua_pushvalue(e,n),d.lua_setfield(e,n,D("_G"))}closeTrackedLuaState(e){if(!e||!this.luaStates.has(e))return;for(let r of this.requireCache.get(e)?.values()||[])r.ref!=null&&Ie.luaL_unref(e,zi,r.ref);this.requireCache.delete(e);let i=this.moduleBaseEnvironments.get(e);if(i!=null&&Ie.luaL_unref(e,zi,i),this.moduleBaseEnvironments.delete(e),this.luaStates.delete(e),this.luaFunctions)for(let[r,n]of this.luaFunctions)n.__luaState===e&&this.luaFunctions.delete(r);Hf(e)}loadModule(e,i,r,n){let o={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(),object:null,path:r,enabled:!0,updateEnabled:!1,params:{},env:e,invoke(){}},s=String(n).replace(/^\uFEFF/,""),a=Un(s);if(Ie.luaL_loadbuffer(e,a,a.length,D(`@${r}`))!==Ct)throw new Error(Ce(e,-1));let u=d.lua_absindex(e,-1);if(d.lua_rawgeti(e,zi,this.moduleBaseEnvironments.get(i)),this.copyLuaEnvironment(e,-1),d.lua_remove(e,-2),this.pushScript(e,o),d.lua_setfield(e,-2,D("script")),d.lua_setupvalue(e,u,1),d.lua_pcall(e,0,1,0)!==Ct)throw new Error(Ce(e,-1))}mountScript({path:e,source:i,control:r,params:n={},scriptMappingId:o=void 0}){this.L||this.boot();let s=this.newLuaThread(),a={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(o),object:r,path:this.normalizeRequirePath(e),enabled:!0,updateEnabled:!1,params:n,env:s,lifecyclePhase:"idle"};a.invoke=(u,f)=>this.invokeOn(s,u,f),r&&r.scripts.push(a),this.mountedScripts.push(a),this.pushScript(s,a),d.lua_setglobal(s,D("script"));let l=this.lifecyclePhase;try{this.lifecyclePhase="OnInit",a.lifecyclePhase="OnInit",this.runChunk(s,i,e);let u=this.callGlobal(s,"OnInit");u&&this.mountErrors.push(u),this.lifecyclePhase="OnEnable",a.lifecyclePhase="OnEnable";let f=this.callGlobal(s,"OnEnable");f&&this.mountErrors.push(f),this.lifecyclePhase="OnStart",a.lifecyclePhase="OnStart";let h=this.callGlobal(s,"OnStart");return h&&this.mountErrors.push(h),this.lifecyclePhase="running",a.lifecyclePhase="running",a}catch(u){throw a.alive=!1,a.lifecyclePhase="failed",this.mountedScripts=this.mountedScripts.filter(f=>f!==a),r&&(r.scripts=r.scripts.filter(f=>f!==a)),this.varHandlers=this.varHandlers.filter(f=>f.script!==a),this.signalHandlers=this.signalHandlers.filter(f=>f.script!==a),this.lifecyclePhase=l,s&&s!==this.L&&this.closeTrackedLuaState(s),a.env=null,u}}runChunk(e,i,r){let n=String(i).replace(/^\uFEFF/,""),o=Un(n),s=Ie.luaL_loadbuffer(e,o,o.length,D(`@${r}`));if(s!==Ct){let l=Ce(e,-1)||`luaL_loadbuffer status ${s}`;throw d.lua_pop(e,1),new Error(l)}let a=d.lua_pcall(e,0,0,0);if(a!==Ct){let l=Ce(e,-1)||`lua_pcall status ${a}`;throw d.lua_pop(e,1),new Error(l)}}callGlobal(e,i){if(d.lua_getglobal(e,D(i)),d.lua_isfunction(e,-1)){if(d.lua_pcall(e,0,0,0)!==Ct){let n=Ce(e,-1);d.lua_pop(e,1);let o=`${i}: ${n}`;return this.log("lua-error",o),o}}else d.lua_pop(e,1);return null}callGlobalDt(e,i,r){if(d.lua_getglobal(e,D(i)),d.lua_isfunction(e,-1)){if(d.lua_pushnumber(e,r),d.lua_pcall(e,1,0,0)!==Ct){let o=Ce(e,-1);d.lua_pop(e,1),this.log("lua-error",`${i}: ${o}`)}}else d.lua_pop(e,1)}luaInvoke(e){let i=Wt(e,1);if(!i||i.__kind!=="Script")return Ie.luaL_error(e,D("bad self to 'Invoke' (Script expected)"));let r=Ce(e,2),n=i.env;if(!n||n.l_G!==e.l_G){let l=[];for(let h=3;h<=d.lua_gettop(e);h++)l.push(He(e,this,h));let u;try{u=i.invoke(r,l)}catch(h){return Ie.luaL_error(e,D(String(h.message||h)))}if(u===void 0)return 0;let f=Array.isArray(u)&&u.__multi?u:[u];for(let h of f)Ge(e,this,h);return f.length}let o=2;if(d.lua_getglobal(e,D(r)),!d.lua_isfunction(e,-1))return 0;d.lua_replace(e,o),d.lua_remove(e,1);let s=d.lua_gettop(e)-1;return d.lua_pcall(e,s,ac,0)!==Ct?d.lua_error(e):d.lua_gettop(e)}invokeOn(e,i,r){let n=d.lua_gettop(e);if(d.lua_getglobal(e,D(i)),!d.lua_isfunction(e,-1)){d.lua_settop(e,n);return}for(let l of r)Ge(e,this,l);if(d.lua_pcall(e,r.length,ac,0)!==Ct){let l=Ce(e,-1);throw d.lua_settop(e,n),new Error(l)}let s=d.lua_gettop(e)-n;if(s<=0){d.lua_settop(e,n);return}if(s===1){let l=He(e,this,-1);return d.lua_settop(e,n),l}let a=[];for(let l=1;l<=s;l++)a.push(He(e,this,n+l));return d.lua_settop(e,n),a.__multi=!0,a}runScriptPhase(e,i){for(let r of this.mountedScripts){if(!this.scriptCanRun(r))continue;let n=r.env;n&&(this.pushScript(n,r),d.lua_setglobal(n,D("script")),!(e==="OnUpdate"&&!r.updateEnabled)&&this.callGlobalDt(n,e,i))}}step(e=1/30){if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new TypeError("dt must be a finite non-negative number");this.clock.frame++,this.clock.time+=e;for(let[r,n]of this.audios)this.clock.time+1e-9>=n.startedAt+n.duration&&(n.alive=!1,this.audios.delete(r),this.audioRevision++);let i=!this.clock.paused;for(let r of[...this.animations])r.step(e);this.runScriptPhase("OnUpdate",e),i&&(this.clock.levelTime+=e,this.runScriptPhase("OnLevelUpdate",e))}injectKey(e){let i=r=>{if(!r.alive||!r.activeInHierarchy)return!1;if(r.keyListeners.has(e)&&r.emitKey(e))return!0;for(let n of[...r.children])if(i(n))return!0;return!1};for(let r of[...this.roots])i(r)}injectCursor(e,i,r){let n=r||this.makeCursorEventData({});Number.isFinite(n.x)&&Number.isFinite(n.y)&&(this.cursor.x=n.x,this.cursor.y=n.y),e.emitCursor(i,n)}getVar(e,i){if(this.serverBridge&&typeof this.serverBridge.getVar=="function")return this.serverBridge.getVar(e,i);let r=this.serverVars[e];return r?r[i]:void 0}notifyVarHandlers(e,i){for(let r of this.varHandlers)this.scriptCanRun(r.script)&&r.entityType===e&&r.name===i&&this.safeCall(r.fn,this.enumTree.CustomVariableEntityType[e],i)}setVar(e,i,r){if(this.serverBridge&&typeof this.serverBridge.setVar=="function"){this.serverBridge.setVar(e,i,r);return}let n=this.serverVars[e]||(this.serverVars[e]=Object.create(null));n[i]=r,this.notifyVarHandlers(e,i)}sendClientSignal(e,i){for(let r of this.signalHandlers)this.scriptCanRun(r.script)&&r.name===e&&this.safeCall(r.fn,e,i)}evalQueryScript(e,i){this.L||this.boot();let r=this.L;d.lua_createtable(r,0,5);let n=(o,s)=>{d.lua_pushcfunction(r,s),d.lua_setfield(r,-2,D(o))};return n("var",o=>(Ge(o,this,i.var(Ce(o,1),Ce(o,2))),1)),n("logContains",o=>(d.lua_pushboolean(o,i.logContains(Ce(o,1))),1)),n("control",o=>(Ge(o,this,i.control(Ce(o,1))),1)),n("logs",o=>(Ge(o,this,i.logs()),1)),n("signals",o=>(Ge(o,this,i.signals(Ce(o,1))),1)),n("serverLogs",o=>(Ge(o,this,i.serverLogs?i.serverLogs():[]),1)),n("serverLogContains",o=>{let s=i.serverLogContains;return d.lua_pushboolean(o,s?!!s(Ce(o,1)):!1),1}),d.lua_setglobal(r,D("query")),this.runChunk(r,e,"autotest-assert"),!0}destroy(){for(let e of this.roots.slice())this.destroyControl(e);for(let e of this.mountedScripts.slice())this.unmountScript(e);this.lifecyclePhase="idle",this.mountedScripts=[],this.luaFunctions.clear();for(let e of[...this.luaStates])this.closeTrackedLuaState(e);this.L=null,this.audios.clear(),this.audioHistory.length=0,this.audioWarnings.clear()}};function jr(t){let e=new Zn(t);return e.boot(),e}var $i=Object.freeze(Array.from({length:8},(t,e)=>`Player${e+1}`)),Ws=Object.freeze(Array.from({length:8},(t,e)=>`Avatar${e+1}`)),mc=Object.freeze(["Level","PlayerSelf","AvatarSelf"]);var Hs=Object.freeze([...mc,...$i,...Ws]),gc=Object.freeze(["PlayerSelf","AllPlayers",...$i]),hm=Object.freeze(["Level","PlayerSelf",...$i]),lc=Object.freeze(["Int","Float","String","Bool","Vector3","Entity","Guid","PrefabId","ConfigId","IntList","FloatList","StringList","BoolList","Vector3List","EntityList","GuidList","PrefabIdList","ConfigIdList","Dict","Struct"]),pm=-2147483648,mm=2147483647,gm=new Set(["set-custom-variable","get-custom-variable","custom-variable-changed","\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF","\u83B7\u53D6\u81EA\u5B9A\u4E49\u53D8\u91CF","\u81EA\u5B9A\u4E49\u53D8\u91CF\u53D8\u5316\u65F6","send-signal","listen-signal","send-client-script-signal","\u53D1\u9001\u4FE1\u53F7","\u76D1\u542C\u4FE1\u53F7","\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7","setVar","getVar","signal","var"]);function Yr(t){return`Player${Number(t)}`}function Qn(t){return`Avatar${Number(t)}`}function uc(t){let e=String(t||"").match(/^(?:Player|Avatar)([1-8])$/);return e?Number(e[1]):0}function Di(t){if(t==null||t==="")return 1;let e=Number(t);if(!Number.isInteger(e)||e<1||e>8)throw new Error("playerCount must be an integer 1-8");return e}function Jt(t,e=8){let i=Di(e);if(t==null||t==="")return 1;let r=Number(t);if(!Number.isInteger(r)||r<1||r>i)throw new Error(`playerIndex must be an integer 1-${i}`);return r}function fc(){let t={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)};for(let e of $i)t[e]=Object.create(null);for(let e of Ws)t[e]=Object.create(null);return t}function yc(t){let e=String(t||"");if(!Hs.includes(e))throw new Error(`unknown CustomVariableEntityType: ${t}`);return e}function ym(t,e){let i=yc(t);if(!hm.includes(i))throw new Error(`${e}.entityType must be Level, PlayerSelf, or Player1-8`);return i}function Ur(t){let e=String(t??"");if(!e)throw new Error("custom variable name is required");return e}function eo(t){let e=String(t??"");if(!e)throw new Error("signal name is required");return e}function Ks(t){let e=String(t||"PlayerSelf");if(!gc.includes(e))throw new Error(`unsupported client signal target: ${t}. use PlayerSelf, AllPlayers, or Player1-8`);return e}function Xr(t){if(t==null)return"";if(typeof t=="boolean")return"Bool";if(typeof t=="string")return"String";if(typeof t=="number")return Number.isInteger(t)?"Int":"Float";if(Array.isArray(t)){if(t.length===0)return"IntList";let e=Xr(t[0]);return e&&!e.endsWith("List")&&e!=="Dict"&&e!=="Struct"?`${e}List`:"IntList"}return t&&typeof t=="object"?"x"in t||"y"in t||"z"in t?"Vector3":"Dict":""}function nt(t){return t===void 0?null:JSON.parse(JSON.stringify(t))}function cc(t){return Array.isArray(t)?t.map(e=>e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"value")&&"type"in e?e.value:e):[]}function dc(t){return Array.isArray(t)?t.map(e=>e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"value")&&"type"in e?{type:String(e.type||""),value:e.value}:{type:Xr(e),value:e}):[]}function vm(t){return String(t?.kind||t?.type||t?.name||t?.id||"")}function to(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function vc(t,e){if(!to(t)||!Object.prototype.hasOwnProperty.call(t,"fromSignalParam"))return null;if(Object.keys(t).some(r=>r!=="fromSignalParam"))throw new Error(`${e}.fromSignalParam cannot be combined with literal fields`);let i=Number(t.fromSignalParam);if(!Number.isSafeInteger(i)||i<0)throw new Error(`${e}.fromSignalParam must be a non-negative integer`);return{fromSignalParam:i}}function hc(t,e){return vc(t,e)||nt(t)}function bm(t,e,i){if(!to(t))throw new Error(`serverLogic.rules[${e}].actions[${i}] must be an object`);let r=String(t.kind||t.type||""),n=`serverLogic.rules[${e}].actions[${i}]`;if(r==="setCustomVariable"){let o=ym(t.entityType,n);if(!Object.prototype.hasOwnProperty.call(t,"value"))throw new Error(`${n}.value is required`);return{kind:r,entityType:o,name:Ur(t.name),value:hc(t.value,`${n}.value`),...t.variableType?{variableType:String(t.variableType)}:{}}}if(r==="sendClientScriptSignal"){if(!Array.isArray(t.params))throw new Error(`${n}.params must be an array`);return{kind:r,target:Ks(t.target),signalName:eo(t.signalName),params:t.params.map((o,s)=>hc(o,`${n}.params[${s}]`))}}throw new Error(`${n}.kind must be setCustomVariable or sendClientScriptSignal`)}function Hr(t){if(t==null)return{version:1,rules:[]};if(!to(t))throw new Error("serverLogic must be an object");let e=t.rules===void 0?[]:t.rules;if(!Array.isArray(e))throw new Error("serverLogic.rules must be an array");return{version:1,rules:e.map((i,r)=>{if(!to(i))throw new Error(`serverLogic.rules[${r}] must be an object`);if(!Array.isArray(i.actions)||i.actions.length===0)throw new Error(`serverLogic.rules[${r}].actions must be a non-empty array`);return{id:String(i.id||`signal-${r+1}`),signalName:eo(i.signalName),actions:i.actions.map((n,o)=>bm(n,r,o))}})}}function pc(t,e,{typed:i=!1}={}){let r=vc(t,"server logic value");if(r){let n=i?e.params:e.values;if(r.fromSignalParam>=n.length)throw new Error(`signal ${e.name} has no parameter at index ${r.fromSignalParam}`);return nt(n[r.fromSignalParam])}return nt(t)}function wm(t){return t==="Level"?"Level":$i.includes(t)?"PlayerSelf":Ws.includes(t)?"AvatarSelf":t}function bc(t={}){let e=fc(),i=fc(),r=[],n=[],o=[],s=[],a=Array.from({length:9},()=>null),l=1,u=0,f=Number(t.onlineLatencyMs||0);(!Number.isFinite(f)||f<0)&&(f=0);let h=Hr(t.logic),p=Di(t.playerCount),m=Jt(t.viewPlayerIndex,p);function g(_,R){s.push({source:"server",level:String(_||"engine"),text:String(R),time:u})}function b(_){let R=a[_||m],y=Number(R?.clock?.time);Number.isFinite(y)&&(u=y)}function C(_,R,y,N){e[_][R]=y,i[_][R]={type:N||Xr(y)||i[_][R]?.type||""}}function k(_,R,y){return typeof y!="number"||!Number.isInteger(y)?{ok:!0,value:y}:y>=pm&&y<=mm?{ok:!0,value:y}:(g("engine",`Int custom variable ${_}.${R} out of range ${y}; keeping previous legal value`),{ok:!1,value:e[_][R]})}function E(_,R){let y=yc(_),N=R||m;return y==="PlayerSelf"?Yr(N):y==="AvatarSelf"?Qn(N):y}function G(_,R){let y=wm(_);if(_==="Level"){for(let c=1;c<=p;c+=1){let w=a[c];w&&typeof w.notifyVarHandlers=="function"&&w.notifyVarHandlers("Level",R)}return}let N=uc(_);if(!N)return;let S=a[N];S&&typeof S.notifyVarHandlers=="function"&&S.notifyVarHandlers(y,R)}function x(_,R){let y=Ks(_);return y==="AllPlayers"?Array.from({length:p},(N,S)=>S+1):y==="PlayerSelf"?[R||m]:[uc(y)]}function q(_){for(let R of h.rules)if(R.signalName===_.name)for(let y of R.actions){if(y.kind==="setCustomVariable"){let N=pc(y.value,_);j.setVar(y.entityType,y.name,N,{type:y.variableType,playerIndex:_.playerIndex}),g("info",`logic ${R.id}: set ${y.entityType}.${y.name}`);continue}if(y.kind==="sendClientScriptSignal"){let N=y.params.map(S=>pc(S,_,{typed:!0}));j.sendToClient(y.signalName,N,{target:y.target,playerIndex:_.playerIndex}),g("info",`logic ${R.id}: sent ${y.signalName} to ${y.target}`)}}}function B(_,R){_&&(_.serverBridge={getVar:(y,N)=>j.getVar(y,N,{playerIndex:R}),setVar:(y,N,S)=>j.setVar(y,N,S,{playerIndex:R}),receiveFromClient:(y,N)=>j.receiveFromClient(y,N,{playerIndex:R})})}function W(_){_&&(_.serverBridge=null)}let j={ENTITY_TYPES:mc,ALL_ENTITY_TYPES:Hs,CLIENT_SIGNAL_TARGETS:gc,get clock(){return u},get playerCount(){return p},get viewPlayerIndex(){return m},setClock(_){u=Number(_)||0},setPlayerCount(_){return p=Di(_),m>p&&(m=p),p},setViewPlayerIndex(_){return m=Jt(_,p),m},log(_,R){g(_,R)},defineVar(_,R,y={},{playerIndex:N}={}){let S=E(_,N),c=Ur(R);if(Object.prototype.hasOwnProperty.call(e[S],c))throw new Error(`custom variable already exists: ${S}.${c}`);let w=y.type?String(y.type):Xr(y.value??y.defaultValue);if(w&&!lc.includes(w))throw new Error(`unsupported custom variable type: ${w}`);let M=y.value!==void 0?y.value:y.defaultValue!==void 0?y.defaultValue:null;return C(S,c,M,w),j.getVar(S,c)},getVar(_,R,{playerIndex:y}={}){let N=E(_,y),S=Ur(R);if(!Object.prototype.hasOwnProperty.call(e[N],S)){g("engine",`GetGlobalCustomVariableValue missing ${N}.${S}; returning nil (simulator policy)`);return}return e[N][S]},setVar(_,R,y,{notify:N=!0,type:S,playerIndex:c}={}){let w=E(_,c),M=Ur(R),L=S||i[w][M]?.type||Xr(y);if(L&&!lc.includes(L)&&L!=="")throw new Error(`unsupported custom variable type: ${L}`);let X=y;if(!((L==="Int"||L===""&&typeof y=="number"&&Number.isInteger(y))&&(X=k(w,M,y).value,X===void 0)))return C(w,M,X,L),N&&G(w,M),X},listVars(_){let R=_?[E(_)]:["Level",...Array.from({length:p},(N,S)=>Yr(S+1)),...Array.from({length:p},(N,S)=>Qn(S+1))],y=[];for(let N of R)for(let S of Object.keys(e[N]))y.push({entityType:N,name:S,type:i[N][S]?.type||"",value:nt(e[N][S])});return y},receiveFromClient(_,R=[],{playerIndex:y}={}){let N=Jt(y||m,p);b(N);let S=eo(_),c={id:l++,direction:"inbound",name:S,params:dc(R),values:cc(R),time:u,playerIndex:N,from:Yr(N)};return r.push(c),q(c),c},sendToClient(_,R=[],{target:y="PlayerSelf",playerIndex:N}={}){let S=eo(_),c=Ks(y),M=x(c,N||m),L={id:l++,direction:"outbound",name:S,params:dc(R),values:cc(R),time:u,target:c,players:M,deliverAt:u+f/1e3,delivered:!1};return n.push(L),f===0?j.deliver(L):o.push(L),L},getLogic(){return nt(h)},setLogic(_){return h=Hr(_),j.getLogic()},deliver(_){if(!_||_.delivered)return;_.delivered=!0;let R=Array.isArray(_.players)&&_.players.length?_.players:x(_.target);for(let y of R){let N=a[y];N&&typeof N.sendClientSignal=="function"&&N.sendClientSignal(_.name,_.values)}},flush(_){_!==void 0&&(u=Number(_)||0);let R=[];for(let y=o.length-1;y>=0;y-=1)o[y].deliverAt<=u&&R.push(o.splice(y,1)[0]);R.sort((y,N)=>y.id-N.id);for(let y of R)j.deliver(y);return R},inbound(){return r.slice()},outbound(){return n.slice()},loadConfig(_){if(_!=null){if(typeof _!="object")throw new Error("server config must be an object");if(_.graph&&!Array.isArray(_.nodes))throw new Error("unsupported server node graph: v1 only accepts custom variables and signals");for(let R of _.nodes||[]){let y=vm(R);if(!gm.has(y))throw new Error(`unsupported server node: ${y||JSON.stringify(R)}. v1 only supports custom variables and signals`)}if(_.onlineLatencyMs!==void 0){let R=Number(_.onlineLatencyMs);if(!Number.isFinite(R)||R<0)throw new Error("onlineLatencyMs must be a non-negative finite number");f=R}_.playerCount!==void 0&&j.setPlayerCount(_.playerCount),_.viewPlayerIndex!==void 0&&j.setViewPlayerIndex(_.viewPlayerIndex),(_.logic!==void 0||_.serverLogic!==void 0)&&j.setLogic(_.logic??_.serverLogic);for(let R of _.vars||[]){let y=E(R.entityType),N=Ur(R.name);Object.prototype.hasOwnProperty.call(e[y],N)?j.setVar(y,N,R.value??R.defaultValue,{notify:!1,type:R.type}):j.defineVar(y,N,R)}}},attachRuntime(_,{playerIndex:R=1}={}){let y=Jt(R,8);return a[y]&&a[y]!==_&&W(a[y]),a[y]=_||null,B(a[y],y),j},attachRuntimes(_){j.detachRuntime();let R=Array.isArray(_)?_:[];for(let y=0;y<R.length&&y<8;y+=1)a[y+1]=R[y]||null,B(a[y+1],y+1);return j},detachRuntime(){for(let _=1;_<=8;_+=1)W(a[_]),a[_]=null},snapshot(){let _=Yr(m),R=Qn(m),y={Level:{},PlayerSelf:{},AvatarSelf:{}};for(let N of Object.keys(e.Level))y.Level[N]={type:i.Level[N]?.type||"",value:nt(e.Level[N])};for(let N of Object.keys(e[_]))y.PlayerSelf[N]={type:i[_][N]?.type||"",value:nt(e[_][N])};for(let N of Object.keys(e[R]))y.AvatarSelf[N]={type:i[R][N]?.type||"",value:nt(e[R][N])};for(let N=1;N<=p;N+=1){let S=Yr(N),c=Qn(N);y[S]={},y[c]={};for(let w of Object.keys(e[S]))y[S][w]={type:i[S][w]?.type||"",value:nt(e[S][w])};for(let w of Object.keys(e[c]))y[c][w]={type:i[c][w]?.type||"",value:nt(e[c][w])}}return{clock:u,onlineLatencyMs:f,playerCount:p,viewPlayerIndex:m,logic:j.getLogic(),vars:y,inbound:r.map(N=>({id:N.id,name:N.name,params:nt(N.params),values:nt(N.values),time:N.time,playerIndex:N.playerIndex,from:N.from})),outbound:n.map(N=>({id:N.id,name:N.name,params:nt(N.params),values:nt(N.values),time:N.time,target:N.target,players:Array.isArray(N.players)?N.players.slice():[],deliverAt:N.deliverAt,delivered:!!N.delivered})),logs:s.map(N=>({source:"server",level:N.level,text:N.text,time:N.time}))}},reset(){for(let _ of Hs){for(let R of Object.keys(e[_]))delete e[_][R];for(let R of Object.keys(i[_]))delete i[_][R]}r.length=0,n.length=0,o.length=0,s.length=0,l=1,u=0},destroy(){j.detachRuntime(),j.reset()}};t.config&&j.loadConfig(t.config);for(let _ of t.vars||[])j.defineVar(_.entityType,_.name,_);return j}var Sm={container:"container",textbox:"textbox",image:"image",button:"button",cursor:"cursor",grid:"grid",reference:"reference",textwindow:"textwindow",keyhint:"keyhint",animation:"animation",fullscreen:"fullscreen"};function Js(t,e,i=null){let r=ni(t.transformByPlatform,e),n={authoringId:t.id,kind:Sm[t.kind]||"container",name:t.name,prefabIndex:t.guid||0,active:t.active!==!1,visible:t.visible!==!1,canControllerFocus:t.canControllerFocus===!0,anchoredPositionX:r.offset.x,anchoredPositionY:r.offset.y,sizeDeltaX:r.size.x,sizeDeltaY:r.size.y,anchorMinX:r.anchorMin.x,anchorMinY:r.anchorMin.y,anchorMaxX:r.anchorMax.x,anchorMaxY:r.anchorMax.y,pivotX:r.pivot.x,pivotY:r.pivot.y,localScaleX:r.scale.x,localScaleY:r.scale.y,localScaleZ:r.scale.z,localRotationX:r.rotation.x,localRotationY:r.rotation.y,localRotationZ:r.rotation.z,children:(t.children||[]).map(s=>Js(s,e,i))},o=i?.get(t.id);return o?.length&&(n.scripts=o.map(s=>{let a=Number(s.guid);return{path:s.path||s.id,source:s.source||"",...Number.isSafeInteger(a)&&a>0?{scriptMappingId:a}:{}}})),t.kind==="container"&&(n.isolateNavigation=t.isolateNavigation===!0,n.disableKeyEventPassthrough=t.disableKeyEventPassthrough===!0,n.disableCursorEventPassthrough=t.disableCursorEventPassthrough===!0,n.showCursor=t.showCursor===!0),(t.kind==="textbox"||t.kind==="textwindow")&&(n.text=t.text??"",n.fontSize=t.fontSize,n.adaptiveFontSize=t.adaptiveFontSize===!0,n.minimumFontSize=t.minimumFontSize,n.fontColor=t.fontColor,n.bgColor=t.bgColor,n.enableOutline=t.enableOutline!==!1,n.outlineColor=t.outlineColor,n.horizontalAlignment=t.horizontalAlignment||"Left",n.verticalAlignment=t.verticalAlignment||"Top",t.kind==="textwindow"&&(n.interactable=t.interactable!==!1,n.showScrollBar=t.showScrollBar!==!1)),t.kind==="image"&&(n.imageSource=t.imageSource,n.imageType=t.imageType??null,n.imageId=t.imageId??0,n.imageColor=t.imageColor,n.raycastTarget=t.raycastTarget===!0,n.enableMask=t.enableMask===!0,n.enableSoftEdge=t.enableSoftEdge===!0,n.softEdgeMode=t.softEdgeMode,n.softEdgeWidthX=t.softEdgeWidthX,n.softEdgeWidthY=t.softEdgeWidthY,n.horizontalSoftRange=t.horizontalSoftRange,n.verticalSoftRange=t.verticalSoftRange,n.enableFill=t.enableFill===!0,n.fillType=t.enableFill?t.fillType:"Unused",n.fillHorizontalType=t.fillHorizontalType,n.fillVerticalType=t.fillVerticalType,n.fillRadial90Type=t.fillRadial90Type,n.fillRadialType=t.fillRadialType,n.fillAmount=t.fillAmount,n.reverseMaskArea=t.reverseMaskArea===!0),t.kind==="button"&&(n.raycastTarget=t.raycastTarget!==!1,n.interactable=t.interactable!==!1,n.clickAudioId=t.clickAudioId,n.unavailableChildId=t.unavailableChildId??null,n.hoverChildId=t.hoverChildId??null,n.pressedChildId=t.pressedChildId??null,n.selectedChildId=t.selectedChildId??null),t.kind==="cursor"&&(n.raycastTarget=t.raycastTarget!==!1),t.kind==="reference"&&(n.referencedPrefabIndex=t.referencedPrefabId),t.kind==="grid"&&(n.itemPrefabIndex=t.itemPrefabId,n.raycastTarget=t.raycastTarget!==!1,n.interactable=t.interactable!==!1,n.showScrollBar=t.showScrollBar!==!1,n.scrollDirection=t.scrollDirection,n.layoutConstraint=t.layoutConstraint,n.layoutConstraintFixedCount=t.layoutConstraintFixedCount,n.cellSizeX=t.cellSizeX,n.cellSizeY=t.cellSizeY,n.spacingX=t.spacingX,n.spacingY=t.spacingY,n.padding1X=t.padding1X,n.padding1Y=t.padding1Y,n.padding2X=t.padding2X,n.padding2Y=t.padding2Y,n.previewCount=t.previewCount),t.kind==="keyhint"&&(n.keyboardKeyCode=t.keyboardKeyCode,n.controllerKeyCode=t.controllerKeyCode),(t.kind==="animation"||t.kind==="fullscreen")&&(n.raycastTarget=!1,n.animationId=t.animationId,n.playSoundEffect=t.playSoundEffect,t.kind==="animation"&&(n.layer=t.layer)),n}function Zs(t,e=[],i=""){let r=i&&Te[i]?i:t.canvasId,n=Te[r],o=Cr(t),s=new Map;for(let l of e){if(!l.controlId)continue;let u=s.get(l.controlId)||[];u.push(l),s.set(l.controlId,u)}let a=t.meta?.assetType==="client-control-template"?(t.root.children||[]).map(l=>Js(l,r,s)):[];return{canvasId:r,platform:n.platform,device:n.luaDevice,canvasWidth:n.width,canvasHeight:n.height,root:Js(o,r,s),templates:a}}var io="qxqy-autotest";var qi=.03333333333333333,xm=new Set(["pointer","key","click","pause","resume","serverSet","serverSend","view"]),_m=new Set(["log","control","var","signal","tree","lua"]);function Gi(t,e){let i=Number(t);if(!Number.isFinite(i))throw new Error(`${e} must be a finite number`);return i}function Qs(t){return JSON.parse(JSON.stringify(t??null))}function ro(t,e){if(!t||typeof t!="object")throw new Error(`events[${e}] must be an object`);let i=String(t.kind||t.do||"");if(!xm.has(i))throw new Error(`unsupported event kind: ${i||"(empty)"}`);let r=t.payload&&typeof t.payload=="object"?{...t.payload}:{};if(i==="pointer")!r.type&&t.type&&(r.type=t.type),r.x===void 0&&(r.x=t.x),r.y===void 0&&(r.y=t.y),r.x=Gi(r.x,"pointer.x"),r.y=Gi(r.y,"pointer.y"),r.type=String(r.type||"click"),r.type==="wheel"&&(r.deltaX=Gi(r.deltaX??t.deltaX??0,"pointer.deltaX"),r.deltaY=Gi(r.deltaY??t.deltaY??0,"pointer.deltaY"));else if(i==="key"){if(r.typeName=String(r.typeName||r.key||t.typeName||t.key||""),!r.typeName)throw new Error("key event requires typeName")}else if(i==="click"){if(r.name=String(r.name||t.name||""),!r.name)throw new Error("click event requires control name")}else if(i==="serverSet"){if(r.entityType=String(r.entityType||t.entityType||""),r.name=String(r.name||t.name||""),r.value===void 0&&(r.value=t.value),r.value===void 0&&(r.value=null),!r.entityType||!r.name)throw new Error("serverSet requires entityType and name")}else if(i==="serverSend"){if(r.name=String(r.name||t.name||""),r.params=Array.isArray(r.params)?r.params:Array.isArray(t.params)?t.params:[],r.target=String(r.target||t.target||"PlayerSelf"),!r.name)throw new Error("serverSend requires signal name")}else if(i==="view"&&(r.playerIndex=Number(r.playerIndex||r.viewPlayerIndex||t.playerIndex||t.viewPlayerIndex||0),!Number.isInteger(r.playerIndex)||r.playerIndex<1))throw new Error("view event requires playerIndex 1-8");return{t:Gi(t.t??0,"event.t"),source:String(t.source||"user"),kind:i,payload:r}}function ea(t,e){if(!t||typeof t!="object")throw new Error(`asserts[${e}] must be an object`);let i=String(t.kind||(t.check?"log":""));if(!_m.has(i))throw new Error(`unsupported assert kind: ${i||"(empty)"}`);let r={kind:i};if(t.at!==void 0&&(r.at=Gi(t.at,"assert.at")),i==="log"){if(r.contains=String(t.contains||t.check||t.text||""),r.source=t.source==="server"?"server":"client",t.level&&(r.level=String(t.level)),!r.contains)throw new Error("log assert requires contains")}else if(i==="control"){if(r.id=t.id?String(t.id):"",r.name=t.name?String(t.name):"",r.field=String(t.field||""),!r.field)throw new Error("control assert requires field");if(!r.id&&!r.name)throw new Error("control assert requires id or name");if(!Object.prototype.hasOwnProperty.call(t,"equals"))throw new Error("control assert requires equals");r.equals=Qs(t.equals)}else if(i==="var"){if(r.entityType=String(t.entityType||""),r.name=String(t.name||""),!r.entityType||!r.name)throw new Error("var assert requires entityType and name");if(!Object.prototype.hasOwnProperty.call(t,"equals"))throw new Error("var assert requires equals");r.equals=Qs(t.equals)}else if(i==="signal"){if(r.direction=t.direction==="outbound"?"outbound":"inbound",r.name=String(t.name||""),!r.name)throw new Error("signal assert requires name");t.values!==void 0&&(r.values=Qs(t.values))}else if(i==="tree"){if(r.name=String(t.name||""),r.exists=t.exists!==!1,!r.name)throw new Error("tree assert requires name")}else if(i==="lua"&&(r.source=String(t.source||""),!r.source.trim()))throw new Error("lua assert requires source");return r}function wc(t){let e=0,i=[],r=[];for(let n of t){if(!n||typeof n!="object")throw new Error("queue step must be an object");if(n.do!=="start"){if(n.do==="step"){e+=Gi(n.dt??qi,"step.dt");continue}if(n.do==="pointer"||n.do==="key"||n.do==="click"||n.do==="pause"||n.do==="resume"||n.do==="serverSet"||n.do==="serverSend"||n.do==="view"){i.push(ro({...n,kind:n.do,t:e},i.length));continue}if(n.assert||n.check||n.kind){r.push(ea({...n.assert||n,at:n.at??e},r.length));continue}throw new Error(`unsupported queue step: ${JSON.stringify(n)}`)}}return{events:i,asserts:r,dt:qi}}function Kr(t){if(Array.isArray(t)){let r=wc(t);return{format:io,version:1,name:"",dt:r.dt,events:r.events,asserts:r.asserts}}if(!t||typeof t!="object")throw new Error("autotest case must be an object or step array");if(Array.isArray(t.queue)||Array.isArray(t.steps)){let r=wc(t.queue||t.steps);return{format:io,version:1,name:String(t.name||""),dt:Number(t.dt)>0?Number(t.dt):r.dt,events:r.events,asserts:r.asserts}}let e=(t.events||[]).map((r,n)=>ro(r,n)),i=(t.asserts||[]).map((r,n)=>ea(r,n));return e.sort((r,n)=>r.t-n.t||0),{format:io,version:1,name:String(t.name||""),dt:Number(t.dt)>0?Number(t.dt):qi,playerCount:Number(t.playerCount)>0?Number(t.playerCount):1,events:e,asserts:i}}function Sc(t,e={}){let i=(t||[]).map((r,n)=>ro(r,n));return{format:io,version:1,name:String(e.name||""),dt:Number(e.dt)>0?Number(e.dt):qi,playerCount:Number(e.playerCount)>0?Number(e.playerCount):1,events:i,asserts:(e.asserts||[]).map((r,n)=>ea(r,n))}}function xc(t,e,i){if(!t)return null;let r=ro({...e,t:e.t??i??0},t.events.length);return t.events.push(r),r}var no=(t,e)=>Math.max(0,Math.min(e,Number.isFinite(t)?t:0));function _c(t,e,i){let r=ki(t,e,i),n=Math.max(0,r.contentHeight-i),o=no(t._scrollOffset||0,n);return t._scrollOffset=o,{...r,length:r.contentHeight,max:n,offset:o,viewport:i,horizontal:!1,width:e,height:i}}function oo(t,e,i){if(!t?.showBar||t.max<=0||e<=0||i<=0)return null;let r=t.horizontal===!0,n=r?e:i,o=Math.max(0,n-4),s=Math.min(o,Math.max(18,o*n/(n+t.max))),a=o-s,l=a*t.offset/t.max,u=Math.min(8,r?i:e),f=r?{x:-e/2+2,y:i/2-u-2,width:o,height:u}:{x:e/2-u-2,y:-i/2+2,width:u,height:o},h=r?{...f,x:f.x+l,width:s}:{...f,y:f.y+l,height:s};return{track:f,thumb:h,travel:a}}var Im=[[10001,"ura.1ht4.2ag9.1hh5.jbb.k02.jcw.2tv.2wn.2xk.2r3.d5s.94l.ebv.kcr.b40.77k.9gp.97w.1hb5.jag.btu.jc9.hp5.bmj.blq.blq.ff9.ffk.o74.1owl.rp.mg.l3.lf.lh.qy.1a3z.2xk.2xk.2xk.2xk.2xk.17dc.1f2b.2bc.2bc.2bc.2bc.2bc.ffo.ffo.126.1fk.4mo.4mo.15e.1h2.237.2ba.2kd.2bc.4mo.4mo.4mo.4mo.1mc.1n6.2cu.1ud.2b1.2ee.1tj.1tk"],[20001,"o6.fh.kb.cr.og.sm.6x.8c.87.o7.vz.kt.qo.lg.ob.9w.mg.1kz.zc.1ex.1d5.ps.uu.su.qs.ys.zp.10k.15a.xc.uk.mx.1ax.nt.tu.19m.uj.1ku.tt.100.ie.d3.fp.ie.ie.d3.fp.ie.8p.7k.fw.h0.qc.ot.uc.ot.rk.gb.1c2.ff.cl.9v.wg.1ir.1lr.1b8.1ri.1p0.104.10n.mw.j6.jb.f1.dv.84.a0.cp.bx.1ko.1au.1ia.rs.rt.rs.t7.x6.wi.zc.16f.1i6.2jh.28d.qh.k8.1gz.1ko.2iv.1xp.1l4.1gk.10j.yo.1jk.1jk.xv.104.15o.1xg.1xg.1xi.25i.p1.t1.yh.1ak.1i6.1y2.xt.32u.3g6.1bz.2mn.14l.14c.1e1.op.s8.p2.v5.2ix.1a0.ry.16m.17n.13c.134.ys.yu.xr.sl.sr.sd.yh.z5.gd.gl.hx.h2.g8.fj.iy.hz.jj.th.12n.16r.d3.j9.dg.lj.fl.a7.f9.iw.el.27f.1dh.1rh.2ph.yd.w5.x5.tr.pq.zf.16h.1a5.17t.wy.vn.y8.wl.yv.2ye.2qt.1ah.163.19t.uf.119.2vv.1bm.13h.14p.1so.c3.as.9z.19w.1l4.1nl.rj.we"],[30001,"jo.my.ss.dw.c1.b4.hl.hl.hl.cz.dw.dw.b4.dw.fr.kd.qv.px.px.74.6u.8h.60.8q.8b.eo.eo.eo.8k.a5.99.12v.13y.lg.m4.qr.dw.ex.g0.ef.cd.br.11n.17h.1b8.1c9.9p.ag.9z.l9.m8.m8.lw.m8.cz.99.b4.8c.63.7f.6h.99.re.pp.pi.cq.c9.cp.ck.c6.b0.bd.al.f6.gl.ed.fs.lc.k6.kh.i6.cx.j1.hk.gb.d7.h7.g2.em.kj.kn.k4.j5.rh.t0.qt.mj.i7.ih.i2.hd.3r.8d.6u.6z.by.de.dg.cr.1a5.1ab.16c.18g.n2.ly.no.nt.f9.de.lr.fe.f0.fj.el.fo.t1.g9.ly.h3.g6.de.2ak.2f3.wf.kg.qn.11p.rg.uj.u6.11c.22o.2cs.3dp.3dq.3d5.3d6.1zx.18v"],[40001,"19x.215.2zt.1ex.2pj.7hy.1ur.1gn.1g7.1b1.u9.1tw.108.1ew.rs.1qu.w9.lk.244.qi.b6.tk.jg.jg.jg.y4.c1.b4.iv.hi.r4.n7.gy.ev.qe.12z.18n.dw.1l6.ou.wz.1un.19t.18k.yy.1hs.sl.dw.1vl.100.14k.1q8.209.1jk.1xr.ua.1j2.pr.26h.1gs.s9.px.15v.pf.1jk.xc.1hb.111.172.ut.285.1oh.149.zj.22r.2l9.14a.ok.23y.1eh.xe.1j0.1rp.1cz.wf.1mh.22k.334.1z2.1xo.1br.4ji.5nq.5nf.2za.18r.h3.eo.ia.1kn.dc.ss.s0.1bl.1oc.is.km.177.1ec.1ao.h4.hp.dx.l9.iw.i3.12w.n1.yq.12w.1ju.yx.14s.18b.22t.u3.my.2rb.36w.13u.z8.20r.18g.19r.2x9.w4.q2.1d2.wo.13a.v6.17w.ur.288.1b6.14m.1fi.1xx.1ee.kj.121.j2.1d2.2ad.1ri.2lc.1vk.138.12r.xj.1h5.1c5.2qx.1gj.t2.lv.rf.18q.1kz.dw.2aq.ia.1i9.k5.199.f4.10y.18a.xf.rk.1g9.1q3.10h.sj.15o.e3.dz.sv.135.w9.yg.aw.2a2.19m.22w.1c8.272.13o.104.1sr.rs.1pb.d5.df.kp.jq.1a7.s8.1ao.ba.rb.in.pz.q8.140.ij.1e7.jl.yk.117.10i.1tn.1oj.1sv.sj.1e3.2so.1c7.1gv.178.107.10n.1dx.1qi.1wp.2bc.218.16r.105.xc.z6.11w.1mc.1y9.17p.1cs.2ij.18c.1ie.nn.16c.1ce.xb.1ei.3j0.ve.14x.1sx.285.1b8.1at.v4.rv.rs.10z.xq.11o.15k.xq.u1.i2.pu.i4.l3.9u.oh.mc.nm.pw.1i3.1h4.pj.111.l4.lb.qq.qf.u0.h4.nk.yf.6h.ij.ds.oy.re.m8.1gl.cz.16z.a1.1f8.1x6.vp.dz.gp.g6.fr.vl.fr.gg.qc.aj.99.go.ij.fz.11a.x5.mo.1u9.h0.m8.10m.1an.2bc.3uw.2gk.124.xb.1uk.1b6.2xj.1os.11a.vs.1i9.1lr.2gv.265.668.1xg.45j.404.2x1.1io.3om.4q2.4mo.1d4.2bp.1pr.166.2y6.2bv.361.2nc.2bc.3g0.7g4.334.2bc.2xo.3uw.6ic.4ig.3uw.23v.1la.2zr.1jt.1cq.27a.1n1.19x.1qg.1jn.1ca.26y.2d6.4v4.4mo.4mo.7ps.1jk.153.1fo.1dm.1s2.1w1.oe.1lb.319.2eg.58p.4mo.3dw.2y2.2xm.1u8.1ko.12n.1e0.2sd.1md.2cl.1q2.372.4mo.48s.b14.3fu.334.334.34i.4nf.4ji.5eg.3uw.2u8.1g1.110.37x.2jo.su.334.3aj.3uw.63f.2bc.2bc.8v4.1ts.ax5.5du.34d.3oc.34j.4si.174.rt.1rp.2b0.37d.1ta.2gh.28a.22z.1nc.1a5.1pa.4dd.3ha.2cs.5mv.4mq.5c2.3uw.1gf.4md.113.10x.21o.2hj.1b3.1cx.1ol.3ar.1fv.17t.1a7.2uj.2we.1jk"],[50001,"1o8.1k1.mo.1wu.2c9.22d.1kb.23n.1b8.1ic.24c.2wz.1mq.1mu.1jx.1z1.o3.190.vp.1h7.th.4mo.1rp.4mo.4mo.7ps.zz.143.21v.1nf.34s.1s3.r9.18t.s1.r9.21w.277.ls.25k.5v1.2bc.1kh.wt.14i.1eq.15o.668.sh.rl.3wi.3vc.43c.3yn.17c.f5.xu.jg.176.19v.1xy.23m.18x.30c.10l.13k.v8.vp.17t.qj.17m.1wr.1la.8t.s7.18d.1l2.152.mx.1c8.1l4.1f5.1xe.rz.2hz.1et.13t.xb.14r.15o.z0.1zo.ur.257.1gb.li.12d.15a.132.1m1.3vu.296.1mg.11m.z0.159.mp.hd.x4.1go.ns.xh.2a7.tt.2vb.1bx.1kh.u3.11i.1y1.24e.2hp.2mn.1w6.3zm.166.14g.1mo.2v9.2rg.2f9.1r0.139.m1.k3.ys.1dy.29k.1mm.22m.3zx.4dr.2h7.22o.tv.rm.1et.2wv.2ar.1t7.ku.12s.10b.1v9.1gu.12m.1b3.tv.1c8.tk.10s.ul.1tt.ka.oi.qb.13f.13f.13k.17h.1uh.ez.en.2x7.2ln.2h8.3h8.ig.n9.27o.18b.hl.nm.uk.11a.1ta.1k4.1eh.wv.1go.1gg.sc.18u.1dz.2aq.vt.2l7.25h.1l5.1kn.1vc.1b4.28i.17t.1d6.1k2.18z.jy.jw.dh.1mx.fr.vp.35w.34z.35w.34z.4so.vf.yx.1bg.1d3.2yc.1tg.8q3.99g.am.2du.rm.rg.xa.2cw.xc.1j6.1if.18z.13a.yz.142.1z5.262.1bj.1y8.ur.u5.16j.1pf.1bi.l8.1il.3vz.2dr.jo.ls.18s.16l.18c.141.219.1yz.1fc.24t.27e.481.1vp.25h.1yq.1zn.1uw.11u.1jp.1pz.39o.t6.1mj.1u5.11l.1vd.1dk.1zb.1ic.3ql.14p.1wq.25x.267.zn.zn.1pf.13z.1j7.r9.1hb.4yp.1lt.1cw.1z4.19z.1og.1j4.1cl.1eg.u8.16s.1en.zu.1hr.1js.19g.303.22j.2oa.180.1v7.2ud.2d7.21s.3g9.vh.v1.284.3lg.3lg.17q.1h3.4mo.1cm.1rv.22i.2mc.2j3.27o.333.1q8.237.2ll.23b.2sp.2ll.2ox.2cf.2f8.2hz.1uo.y4.s9.w6.2dg.2q9.up.1m1.1vz.2n8.192.1eb.z7.2em.2q3.1sd.1gj.348.3vf.2iu.29x.1dc.7oj.4pq.5vb.4mx.5me.5sf.5yf.7ps.yj.q0.10w.13p.18b.2wd.11q.2vx.dd.iv.12p.jh.u9.1uy.w0.3f0.3bj.126.qo.1gj.11k.pu.22h.1z6.rp.y4.y0.xl.1d0.11s.wa.1a6.127.10m.12r.1nh.1fy.yo.1js.162.n4.174.1aj.y4.o8.qz.rh.qa.18s.mr.j3.ii.sr.sx.1jk.17l.mj.zr.uy.wa.19t.2bt.xe.1od.hs.xr.5b.12c.1ab.we.gz.mz.4y.sf.11s.e0.1l7.ew.h6.jz.l0.e8.1cx.p6.17u.bw.1ah.10r.10e.o9.1bc.uv.lq.tl.zb.100.jy.b8.bj.336.10n.na.sq.14r.yr.nm.123.tf.l1.zp.1xc.1vk.31l.zl.2bj.2b9.2fv.17p.y0.so.1ln.29c.1eh.nh.xn.131.qc.186.ff.fc.xq.1bm.la.l8.14f.243.111.xi.qw.1qn.11v.1ur.1jx.1ks.s9.nz.269.1zj.2zd.1pv.18n.2vk.p3.1fh.13v.1lf.1lu.2db.1sr.1k3.26o.1dl.1f3.187.2lh.166.v9.xh.1e3.119.s2.mt.1iu.1k6.1o2.12s.u4.2br.1q3.qv.1e4.1zu.1v4.1vk.1t3.3p7.1ob.14d.1ns.1ef.1e4.12w.2kk.1ba.2jx.1e0.1s5.12w.17r.14s.wz.1qp.183.3fb.188.1gr.2ot.168.1u7.w8.28o.1zd.32z.230.w7.vq.x8.1qh.19f.14o.2r9.qg.1ey.1qr.1p6.3a3.1ov.13d.tz.wk.22v.1qa.2l9.yw.yf.nw.p6.1ly.1jk.1nh.x9.q0.17r.17h.ux.uw.12y.p7.g7.kt.14c.ze.1kh.1eo.18a.1d8.26j.15k.19f.1ym.1j5.1c6.11k.1sd.1jp.1ws.13s.1o5.214.sx.px.20x.14h.1ja.s6.1q8.w8.1ks.so.ub.121.202.1ej.1g1.1s8.2bc.4t1.bih.3uw.3pb.avp.6c7.bko.5eg.79c.6wh.3wd.4pn.55j.4a5.3gg.bko.5ei.52p.578.bcv.6gr.2bc.4j9.5y7.9d2.2bb.2bc.668.73z.5pg.50f.5m7.788.267.642.8h2.8h2.49s.64g.5e8.5e8.2bb.3ih.5ur.6bk.578.4ck.3sg.5fe.23i.e9w.2b8.5oj.6bw.2al.2rk.2rk.5pj.n6e.350.6v9.70t.639.3uw.3uw.2bg.639.2bb.2bd.6gj.2bh.660.578.3bk.65e.359.3o0.44i.4tn.1zq.5ee.4a5.3zu.rs.639.33q.5eg.1k1.15o.dw.3uw.b7p.7qd.898.4l4.5uu.5uu.b4g.2yh.2yh.3uw.51a.51a.5kk.66f.iq9.3n7.4nb.46a.1wb.20p.bih.8xa.7ps.70t.70t.4rv.5p1.6aq.ts.63z.668.5v2.5nu.563.55s.55s.5p3.2ga.32x.42x.5cr.4c2.71b.5zp.5c2.66t.4c8.2bc.2bc.2gn.3ea.2kp.fz6.8hz.3e8.4an.bko.j7e.jag.7sr.2bc.3zx.7qd.5ut.5jp.2wk.5q7.3uw.334.4i3.3uw.4bd.5eu.46h.4i2.6t4.446.5s7.5cg.4bk.5nd.7bf.4rt.23b.2bc.2bc.2bc.2bc.2ba.4mo.4dv.3wn.2bc.1we.4he.2bc.4gz.3wn.3km.4xy.4hi.4mr.2bc.247.3yj.2c6.2bc.3aj.446.4ub.3uw.51.e0.86.is.i1.hg.mn.m4.2c.7h.sg.e3.jb.7r.eq.nf.u0.60.4o.ke.47.47.47.47.b8.4x.dr.dy.rw.rw.59.8j.5z.a5.l3.c0.ik.f7.li.lr.7x.dv.du.dd.5e.91.1b.ce.cc.59.bh.e6.8m.9n.cl.lt.7ip.4mr.4si.4kf.vo.we.13e.17n.1iw.2pi.lp.r6.gw.7x.xz.qt.bq.ls.q1.eh.bx.cr.3c.j7.b8.fz.4k.8p.bg.5w.iy.j3.12o.rs.cz.dp.yz.jk.63.63.7ps.7ps.7ps.40g.3jp.4tw.89k.88a.7s0.83d.668.7ps.2fw.2ev.2fp.7ps.2jb.2dh.2ud.25i.24c.2bt.1pa.17r.1a7.7ps.7pt.5rg.4nl.3vv.7qo.31a.2p0.2k0.49a.3v4.3nl.1ug.1ug.1l6.7s1.7ps.2cp.2f8.2i7.7ps.28q.2be.275.1ma.1oz.1q7.16s.1iq.1e0.78m.7ps.2bc.2bc.2bc.bko.2wu.2wu.2wu.3b4.38f.3uw.3uw.3uw.3uw.7ps.7qa.32n.2gg.2wk.7rv.1v3.1qq.1rb.1zk.1my.1zp.1yn.1oh.1uh.7st.9q.9q.9q.9q.9q.kk.kk.kk.kk.kk.dw.dp.dw.rs.rs.rs.rs.s4.sd.54j.5n8.2n6.21r.1nu.1o5.14u.t6.3f7.2j0.32c.304.189.1gf.18w.18j.1st.1vq.116.kw.3uw.3uw.vr.zx.xc.tc.7d.7r.9d.9w.8s.9p.3b.3b"]].map(([t,e])=>[t,e.split(".").map(i=>parseInt(i,36)/1e3)]);function Ic(t){if(!Number.isSafeInteger(t))return null;for(let[e,i]of Im)if(t>=e&&t<e+i.length)return i[t-e];return null}var so=t=>Number.isFinite(Number(t))?Math.max(0,Number(t)):0;function Cc(t,e){if(!t||t.kind!=="image"||t.enableMask!==!0||!e)return null;let i=so(t.sourceWidth??t.width),r=so(t.sourceHeight??t.height),n=t.enableSoftEdge===!0,o=t.softEdgeMode!=="Pixel",s=n?so(t.softEdgeWidthX):0,a=n?so(t.softEdgeWidthY):0;return{id:t.id,matrix:e,width:i,height:r,featherX:o?i*s/100:s,featherY:o?r*a/100:a}}function Ec(t,e,i){let r=mt(t,e,i);return{a:t.a,b:t.b,c:t.c,d:t.d,tx:r.x,ty:r.y}}import{randomUUID as Tc}from"node:crypto";function uo(t){for(let e of t.runtime.scrollControls||[]){let[i,r]=qr(e),n=e.kind==="grid"?dr(e):_c(e,i,r),o={offset:n.offset,max:n.max,horizontal:n.horizontal,showBar:e.showScrollBar!==!1,textWidth:n.textWidth??0,lines:n.lines||[],lineHeight:n.lineHeight||0,contentLength:n.length,...e.kind==="textwindow"?{fontSize:n.fontSize}:{}},s=JSON.stringify(o);e._scrollKey!==s&&(e._scrollKey=s,e._scroll=o,e.markPlayDirty())}}function Rc(t){return{...t._scroll?{scroll:t._scroll}:{},...t.parent?._gridItems?.includes(t)?{clipToParent:!0}:{}}}function ta(t,e){let i=t._scroll?.max||0;t.kind==="grid"?t.scrollProgress=i?no(e,i)/i:0:t._scrollOffset=no(e,i),t.markPlayDirty()}var Cm=Object.freeze(Object.values(Te).map(t=>Object.freeze({id:t.id,label:t.label,platform:t.platform,width:t.width,height:t.height})));function fo(t){uo(t);let e=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),i=new Map;function r(n,o,s){let a=Vt(o,n);a.activeInHierarchy=s&&n.active!==!1,i.set(n.Id,a);let l=a.activeInHierarchy;for(let u of n.children)r(u,a,l)}for(let n of t.runtime.roots)r(n,e,!0);return i}function Nc(t,e=fo(t)){let i=new Map;function r(n,o){let s=e.get(n.Id);if(!s)return;let a=Ir(o,s,n);i.set(n.Id,a);for(let l of n.children)r(l,a)}for(let n of t.runtime.roots)r(n,Xi());return i}function Pc(t,e){let i=e.get(t.Id);return{id:t.Id,prefabId:t.prefabIndex,authoringId:t.authoringId,name:t.name,kind:t.kind,typeofName:t.typeofName,instantiated:!t.authoringId,active:!!t.active,visible:!!t.visible,activeInHierarchy:!!i?.activeInHierarchy,raycastTarget:t.raycastTarget!==!1,interactable:t.interactable!==!1,pressed:t.pressed===!0,...t._scroll?{scrollOffset:t._scroll.offset,scrollMax:t._scroll.max}:{},...t.kind==="grid"?{itemCount:t.itemCount,scrollProgress:t.scrollProgress}:{},anchoredPositionX:t.anchoredPositionX,anchoredPositionY:t.anchoredPositionY,sizeDeltaX:t.sizeDeltaX,sizeDeltaY:t.sizeDeltaY,localScaleX:t.localScaleX,localScaleY:t.localScaleY,localScaleZ:t.localScaleZ,localRotationZ:t.localRotationZ,text:t.kind==="textbox"||t.kind==="textwindow"?t.text??"":null,fontSize:t.kind==="textbox"||t.kind==="textwindow"?t.fontSize:null,adaptiveFontSize:t.kind==="textbox"||t.kind==="textwindow"?t.adaptiveFontSize===!0:null,minimumFontSize:t.kind==="textbox"||t.kind==="textwindow"?t.minimumFontSize:null,fontColor:t.kind==="textbox"||t.kind==="textwindow"?t.fontColor:null,bgColor:t.kind==="textbox"||t.kind==="textwindow"?t.bgColor:null,enableOutline:t.kind==="textbox"||t.kind==="textwindow"?t.enableOutline===!0:null,outlineColor:t.kind==="textbox"||t.kind==="textwindow"?t.outlineColor:null,imageId:t.kind==="image"?t.imageId??0:null,imageSource:t.kind==="image"?ei(t.imageSource):null,imageType:t.kind==="image"?t.imageType==null?null:Et(t.imageType):null,primitive:t.kind==="image"?Yi(t.imageId,t.imageSource):null,imageColor:t.kind==="image"?t.imageColor:null,enableMask:t.kind==="image"?t.enableMask===!0:null,enableSoftEdge:t.kind==="image"?t.enableSoftEdge===!0:null,softEdgeMode:t.kind==="image"?t.softEdgeMode:null,softEdgeWidthX:t.kind==="image"?t.softEdgeWidthX:null,softEdgeWidthY:t.kind==="image"?t.softEdgeWidthY:null,horizontalSoftRange:t.kind==="image"?t.horizontalSoftRange:null,verticalSoftRange:t.kind==="image"?t.verticalSoftRange:null,enableFill:t.kind==="image"?t.enableFill===!0:null,fillType:t.kind==="image"?t.fillType:null,fillHorizontalType:t.kind==="image"?t.fillHorizontalType:null,fillVerticalType:t.kind==="image"?t.fillVerticalType:null,fillRadial90Type:t.kind==="image"?t.fillRadial90Type:null,fillRadialType:t.kind==="image"?t.fillRadialType:null,reverseMaskArea:t.kind==="image"?t.reverseMaskArea===!0:null,fillAmount:t.kind==="image"?t.fillAmount:null,box:i?{left:i.left,bottom:i.bottom,width:i.width,height:i.height}:null,children:t.children.map(r=>Pc(r,e))}}function Em(){return{pointerDownControl:null,pointerDownPosition:null,pointerLastPosition:null,pointerDragging:!1,pointerHoverControl:null,pointerScroll:null,hoveredControl:null,selectedControl:null,stateRestores:new Map,viewCache:null}}function km(t,e,i,r){let n=jr({canvasWidth:t.canvasWidth,canvasHeight:t.canvasHeight,device:t.device,audioDuration:Ic,canSelectImageType:Ra,...r?{language:r}:{}});for(let o of[...t.templates||[],...e?.templates||[]])Number.isSafeInteger(o.prefabIndex)&&o.prefabIndex>0&&n.registerTemplate(o.prefabIndex,o);for(let o of i){let s=o.path||o.id,a=o.source||"";s&&a&&n.registerScriptFile(s,a)}return n}var Am=["pointerDownControl","pointerDownPosition","pointerLastPosition","pointerDragging","pointerHoverControl","pointerScroll","hoveredControl","selectedControl","stateRestores","viewCache"];function Om(t){Object.defineProperty(t,"runtime",{configurable:!0,enumerable:!0,get(){return t.runtimes[t.viewPlayerIndex-1]}});for(let e of Am)Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){return t.views[t.viewPlayerIndex-1][e]},set(i){t.views[t.viewPlayerIndex-1][e]=i}})}function Fc(t,{templatesProject:e=null,scripts:i=[],sceneScripts:r=null,templateScripts:n=null,serverConfig:o=null,canvasId:s="",playerCount:a=1,viewPlayerIndex:l=1,language:u=""}={}){let f=r||i,h=n||i,p=Zs(t,f,s),m=e?Zs(e,h,s):null,g=Di(a),b=Jt(l,g),C=bc({playerCount:g,viewPlayerIndex:b});o&&C.loadConfig({...o,playerCount:g,viewPlayerIndex:b});let k=[];for(let x=0;x<g;x+=1)k.push(km(p,m,i,u));C.attachRuntimes(k);for(let x of k)x.addRoot(p.root);let E={audioSessionId:Tc(),runtimes:k,views:k.map(()=>Em()),playerCount:g,viewPlayerIndex:b,server:C,compiled:p,mountError:k.find(x=>x.mountErrors[0])?.mountErrors[0]||null,debugPaused:!1,history:{events:[]},recording:!0};Om(E);let G=E.viewPlayerIndex;for(let x=1;x<=g;x+=1)E.viewPlayerIndex=x,qm(E);return E.viewPlayerIndex=G,E}function oa(t,e){if(!t)throw new Error("play session has not started");let i=Jt(e,t.playerCount);return i===t.viewPlayerIndex||(bi(t,{kind:"view",payload:{playerIndex:i}}),t.viewPlayerIndex=i,t.viewCache=null,t.server&&t.server.setViewPlayerIndex(i)),i}function bi(t,e){!t?.recording||!t.history||xc(t.history,{...e,source:e.source||"user"},t.runtime.clock.time)}function Tm(t){return t?.history?.events||[]}var sa=new Set(["image","textbox","textwindow","button","grid"]);function Rm(t,e){let i=mt(e,t.centerX,t.centerY);return{centerX:i.x,centerY:i.y,scaleX:Math.hypot(e.a,e.b),scaleY:Math.hypot(e.c,e.d),rotationZ:Math.atan2(e.b,e.a)*180/Math.PI,matrix:{a:e.a,b:e.b,c:e.c,d:e.d,tx:i.x,ty:i.y}}}function Et(t){return typeof t=="string"?t:t?.Name}function Mc(t){return{fillType:Et(t.fillType),fillHorizontalType:Et(t.fillHorizontalType),fillVerticalType:Et(t.fillVerticalType),fillAmount:t.fillAmount}}function Nm(t,e,i){let r=Math.abs(e.width*i.scaleX),n=Math.abs(e.height*i.scaleY),o={id:t.Id,kind:t.kind,name:t.name,left:i.centerX-r/2,bottom:i.centerY-n/2,width:r,height:n,sourceWidth:e.width,sourceHeight:e.height,rotationZ:i.rotationZ,matrix:i.matrix,pressed:t.pressed===!0,...Rc(t)};return t.kind==="image"&&(o.imageSource=ei(t.imageSource),o.imageType=t.imageType==null?null:Et(t.imageType),o.primitive=Yi(t.imageId,o.imageSource),o.imageColor=t.imageColor,o.imageId=t.imageId,Object.assign(o,Mc(t))),(t.kind==="textbox"||t.kind==="textwindow")&&(o.text=t.text??"",o.fontSize=t.fontSize,o.adaptiveFontSize=t.adaptiveFontSize===!0,o.minimumFontSize=t.minimumFontSize,o.textLayout=ki(t,e.width,e.height),o.fontColor=t.fontColor,o.bgColor=t.bgColor,o.enableOutline=t.enableOutline===!0,o.outlineColor=t.outlineColor,o.horizontalAlignment=Et(t.horizontalAlignment),o.verticalAlignment=Et(t.verticalAlignment)),o}function Pm(t,e=fo(t)){let i=[],r=Nc(t,e);function n(o,s=[],a=[]){let l=e.get(o.Id);if(!l||o.visible===!1||!l.activeInHierarchy)return;let u=r.get(o.Id);if(!u)return;let f=Rm(l,u),h=o.kind==="image"&&o.enableMask===!0?Cc({...zc(o,l),id:o.Id},Ec(u,l.centerX,l.centerY)):null,p=h?[...a,h]:a,m=()=>i.push({...Nm(o,l,f),...s.length?{clipPolygons:s}:{},...p.length?{masks:p}:{}});sa.has(o.kind)&&o.kind!=="grid"&&m();let g=o.children||[];for(let b=g.length-1;b>=0;b-=1){let C=o._gridItems?.includes(g[b])?[...s,[[l.left,l.bottom],[l.right,l.bottom],[l.right,l.top],[l.left,l.top]].map(([k,E])=>mt(u,k,E))]:s;n(g[b],C,p)}o.kind==="grid"&&m()}for(let o of t.runtime.roots)n(o);return i}function zc(t,e){let i={kind:t.kind,name:t.name,sourceWidth:e.width,sourceHeight:e.height,pressed:t.pressed===!0,...Rc(t)};return t.kind==="image"&&(i.imageSource=ei(t.imageSource),i.imageType=t.imageType==null?null:Et(t.imageType),i.primitive=Yi(t.imageId,i.imageSource),i.imageColor=t.imageColor,i.imageId=t.imageId,Object.assign(i,Mc(t),{enableMask:t.enableMask===!0,enableSoftEdge:t.enableSoftEdge===!0,softEdgeMode:Et(t.softEdgeMode)||"Percentage",softEdgeWidthX:t.softEdgeWidthX,softEdgeWidthY:t.softEdgeWidthY})),(t.kind==="textbox"||t.kind==="textwindow")&&(i.text=t.text??"",i.fontSize=t.fontSize,i.adaptiveFontSize=t.adaptiveFontSize===!0,i.minimumFontSize=t.minimumFontSize,i.textLayout=ki(t,e.width,e.height),i.fontColor=t.fontColor,i.bgColor=t.bgColor,i.enableOutline=t.enableOutline===!0,i.outlineColor=t.outlineColor,i.horizontalAlignment=Et(t.horizontalAlignment),i.verticalAlignment=Et(t.verticalAlignment)),i}function Fm(t,e,i){let r=yo(t,e),n=mt(r,t.centerX,t.centerY);return{a:r.a,b:r.b,c:r.c,d:r.d,tx:n.x-(i?i.centerX:0),ty:n.y-(i?i.centerY:0)}}function Dc(t){let e=t.matrix;return[t.parent,t.z,t.group?1:0,e.a,e.b,e.c,e.d,e.tx,e.ty,t.kind,t.name,t.sourceWidth,t.sourceHeight,t.pressed,t.primitive,t.imageColor,t.imageId,t.imageSource,t.imageType,t.fillType,t.fillHorizontalType,t.fillVerticalType,t.fillAmount,t.enableMask,t.enableSoftEdge,t.softEdgeMode,t.softEdgeWidthX,t.softEdgeWidthY,t.text,t.fontSize,t.fontColor,t.bgColor,t.adaptiveFontSize,t.minimumFontSize,JSON.stringify(t.textLayout),t.enableOutline,t.outlineColor,t.horizontalAlignment,t.verticalAlignment,JSON.stringify(t.scroll),t.clipToParent].join(" ")}function $c(t,e,i,r,n,o){return{id:t.Id,parent:e,z:n,group:o>=16,matrix:Fm(r,t,i),...zc(t,r)}}function Mm(t){let e=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),i=new Set,r=new Map,n=new Map;function o(l,u,f){let h=Vt(u,l);if(h.activeInHierarchy=f&&l.active!==!1,n.set(l.Id,h),l.visible===!1||!h.activeInHierarchy)return!1;let p=l.children||[],m=sa.has(l.kind),g=0;for(let b=0;b<p.length;b+=1)o(p[b],h,h.activeInHierarchy)&&(m=!0,g+=1);return m?(i.add(l.Id),r.set(l.Id,g),!0):!1}function s(l,u,f,h){if(!i.has(l.Id))return;let p=n.get(l.Id);a.push($c(l,u,f,p,h,r.get(l.Id)||0));let m=l.children||[];for(let g=0;g<m.length;g+=1)s(m[g],l.Id,p,g)}let a=[];for(let l=0;l<t.runtime.roots.length;l+=1)o(t.runtime.roots[l],e,!0),s(t.runtime.roots[l],null,null,l);return{nodes:a,childCounts:r}}function ra(t){let e=t._playChildDirty===!0||t._playDeepDirty===!0;if(t._playDirty=!1,t._playChildDirty=!1,t._playDeepDirty=!1,!e)return;let i=t.children;for(let r=0;r<i.length;r+=1)ra(i[r])}function zm(t,e){let i=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),r=[],n=[],o=e.count,s=t.runtime._playRemoved||[];for(let u=0;u<s.length;u+=1){let f=s[u];e.fingerprints.has(f)&&(n.push(f),e.fingerprints.delete(f),e.childCounts.delete(f),o-=1)}t.runtime._playRemoved=[];function a(u){e.fingerprints.has(u.Id)&&(n.push(u.Id),e.fingerprints.delete(u.Id),e.childCounts.delete(u.Id),o-=1);let f=u.children;for(let h=0;h<f.length;h+=1)a(f[h])}function l(u,f,h,p,m,g){let b=g||u._playDeepDirty===!0,C=b||u._playDirty===!0,k=b||u._playChildDirty===!0;if(!C&&!k)return;if(!(m&&u.active!==!1)||u.visible===!1){a(u);return}let G=Vt(f,u),x=e.childCounts.get(u.Id)||0;if(k){x=0;let R=u.children;for(let y=0;y<R.length;y+=1)l(R[y],G,u.Id,y,!0,b),e.fingerprints.has(R[y].Id)&&(x+=1)}if(!(sa.has(u.kind)||x>0)){e.fingerprints.has(u.Id)&&(n.push(u.Id),e.fingerprints.delete(u.Id),e.childCounts.delete(u.Id),o-=1);return}let B=e.childCounts.get(u.Id);e.childCounts.set(u.Id,x);let W=x>=16!=(B||0)>=16;if(!C&&!W&&e.fingerprints.has(u.Id))return;let j=$c(u,h,f===i?null:f,G,p,x),_=Dc(j);e.fingerprints.get(j.id)!==_&&(e.fingerprints.has(j.id)||(o+=1),e.fingerprints.set(j.id,_),r.push(j))}for(let u=0;u<t.runtime.roots.length;u+=1)l(t.runtime.roots[u],i,null,u,!0,!1);return e.count=o,{changed:r,removed:n,count:o}}function Dm(t,e){let i=t.viewCache||(t.viewCache={rev:0,fingerprints:new Map,childCounts:new Map,count:0}),r=Number(e);if(!(Number.isFinite(r)&&r===i.rev&&i.fingerprints.size>0)){let{nodes:l,childCounts:u}=Mm(t);i.rev+=1,i.fingerprints=new Map(l.map(f=>[f.id,Dc(f)])),i.childCounts=u,i.count=l.length;for(let f of t.runtime.roots)ra(f);return{format:"tree-v1",revision:i.rev,reset:!0,count:l.length,nodes:l}}let{changed:o,removed:s,count:a}=zm(t,i);i.rev+=1;for(let l of t.runtime.roots)ra(l);return{format:"tree-v1",revision:i.rev,reset:!1,count:a,changed:o,removed:s}}function aa(t,{inspect:e=!1,view:i=!1,paint:r=!1,sceneRev:n,compact:o=!1}={}){uo(t),t.audioSessionId||=Tc();let s=t.runtime,a=t.compiled,[l,u]=[s.canvasWidth,s.canvasHeight];t.server&&t.server.setClock(s.clock.time);let f=o?s.logs.slice(-100):s.logs,h=Tm(t),p=t.server?t.server.snapshot():{vars:{},inbound:[],outbound:[],logs:[]};o&&(p.inbound=p.inbound.slice(-100),p.outbound=p.outbound.slice(-100),p.logs=p.logs.slice(-100));let m={canvasId:a.canvasId,platform:a.platform,device:s.device,canvasWidth:l,canvasHeight:u,canvasPresets:Cm,playerCount:t.playerCount||1,viewPlayerIndex:t.viewPlayerIndex||1,players:Array.from({length:t.playerCount||1},(g,b)=>({index:b+1,label:`\u73A9\u5BB6${b+1}`,entityType:`Player${b+1}`})),time:s.clock.time,frame:s.clock.frame,paused:!!t.debugPaused,levelTimePaused:!!s.clock.paused,audio:{sessionId:t.audioSessionId,playerIndex:t.viewPlayerIndex||1,...s.audioSnapshot()},mountError:t.mountError||s.mountErrors[0]||null,logs:f.map(g=>({source:"client",level:g.level,text:g.text,time:g.time})),tree:[],paint:[],scene:null,server:p,history:(o?h.slice(-100):h).map(g=>({t:g.t,source:g.source||"user",kind:g.kind,payload:g.payload||{}}))};if(e||r){let g=fo(t);e&&(m.tree=s.roots.map(b=>Pc(b,g))),r&&(m.paint=Pm(t,g))}return i&&(m.scene=Dm(t,n)),Ui(m),m}function co(t,e=1/30){let i=t.runtimes||(t.runtime?[t.runtime]:[]);for(let r of i)r.step(e);t.server&&(t.server.setClock(t.runtime.clock.time),t.server.flush())}function la(t,e){bi(t,{kind:"key",payload:{typeName:String(e)}}),t.runtime.injectKey(e)}function $m(t,e){let i=null;for(let r of t.runtime.roots)Dt(r,n=>{!i&&n.name===e&&(i=n)});return i}function ua(t,e){bi(t,{kind:"click",payload:{name:String(e)}});let i=$m(t,e);i&&fa(i)&&(i.kind==="button"||i.kind==="cursor")&&i.SimulateCursorClick()}function Gm(t,e){return!t||!e?null:t.children.find(i=>i.authoringId===e||i.Id===e)||null}var Gc={unavailable:"unavailableChildId",hover:"hoverChildId",pressed:"pressedChildId",selected:"selectedChildId"};function qc(t,e){let i=[];for(let[r,n]of Object.entries(Gc)){let o=e[n]?Gm(e,e[n]):null;o&&i.push({state:r,child:o})}return i}function qm(t){for(let e of t.runtime.roots)Dt(e,i=>{if(i.kind==="button"){for(let{child:r}of qc(t,i))t.stateRestores.has(r.Id)||t.stateRestores.set(r.Id,{child:r,active:r.active,visible:r.visible}),r.active=!0,r.visible=!1,typeof r.markPlayDirty=="function"&&r.markPlayDirty(!0);Wr(t,i)}})}function Wr(t,e){if(!e||e.kind!=="button")return;let i=null;e.interactable===!1?i="unavailable":e.pressed===!0?i="pressed":t.hoveredControl===e?i="hover":t.selectedControl===e&&(i="selected");for(let r of qc(t,e))r.child.active=!0,r.child.visible=r.state===i,typeof r.child.markPlayDirty=="function"&&r.child.markPlayDirty(!0)}function ia(t){if(!t)return null;let e=t.parent;return e?.kind==="button"&&Object.values(Gc).map(r=>e[r]).filter(Boolean).includes(t.authoringId)?e:t}function fa(t){return t.kind==="button"?t.raycastTarget!==!1&&t.interactable!==!1:t.kind==="cursor"||t.kind==="grid"?t.raycastTarget!==!1:t.kind==="textwindow"?t.interactable!==!1:t.raycastTarget===!0}function Bc(t){return t.kind==="container"||t.kind==="grid"||t.kind==="textwindow"||t.kind==="reference"||t.kind==="button"}function Vc(t,e){let i=t.Id,r=e.get(i);if(r!==void 0)return r;let n=fa(t);if(!n&&Bc(t)){let o=t.children;for(let s=0;s<o.length;s+=1)if(Vc(o[s],e)){n=!0;break}}return e.set(i,n),n}function ao(t,e,i){uo(t);let r=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),n=new Map;function o(a,l,u,f){if(!f||a.active===!1||a.visible===!1||!Vc(a,n))return null;let h=Vt(l,a),p=Ir(u,h,a),m=Hi(p);if(!m)return null;let g=mt(m,e,i);if(g.x<h.left||g.x>h.right||g.y<h.bottom||g.y>h.top)return null;if(lo(a)){let b=oo(a._scroll,h.width,h.height)?.track,C=g.x-h.centerX,k=h.centerY-g.y;if(b&&C>=b.x&&C<=b.x+b.width&&k>=b.y&&k<=b.y+b.height)return a}if(Bc(a))for(let b=0;b<a.children.length;b+=1){let C=o(a.children[b],h,p,!0);if(C)return C}return fa(a)?a:null}let s=Xi();for(let a=t.runtime.roots.length-1;a>=0;a-=1){let l=o(t.runtime.roots[a],r,s,!0);if(l)return l}return null}function gr(t,e,i,{dragging:r=!1,press:n=null,previous:o=null}={}){let s=n||{x:e,y:i},a=o||{x:e,y:i};return t.runtime.makeCursorEventData({x:e,y:i,pressX:s.x,pressY:s.y,deltaX:e-a.x,deltaY:i-a.y,dragging:r})}function na(t,e,i){e.kind==="grid"||e.kind==="textwindow"||(e.pressed=i,typeof e.markPlayDirty=="function"&&e.markPlayDirty(),Wr(t,e))}function lo(t){if(!t?.alive||!t.activeInHierarchy||t.interactable===!1||t.raycastTarget===!1)return!1;for(let e=t;e;e=e.parent)if(e.visible===!1)return!1;return t._scroll?.max>0}function kc(t){for(let e=t;e;e=e.parent)if(lo(e))return e;return null}function Ac(t,e,i,r){let n=fo(t),o=n.get(e.Id),s=Nc(t,n).get(e.Id),a=s&&Hi(s);if(!o||!a)return null;let l=mt(a,i,r);return{x:l.x-o.centerX,y:o.centerY-l.y,width:o.width,height:o.height}}function Oc(t,e,i){let r=t.pointerDownControl;if(r?.alive){let n=gr(t,e,i,{dragging:t.pointerDragging,press:t.pointerDownPosition,previous:t.pointerLastPosition});t.runtime.injectCursor(r,"CursorUp",n),t.pointerDragging&&!t.pointerScroll&&t.runtime.injectCursor(r,"CursorEndDrag",n),na(t,r,!1)}t.pointerDownControl=null,t.pointerScroll=null,t.pointerDownPosition=null,t.pointerDragging=!1,t.pointerLastPosition={x:e,y:i}}function Jr(t,e,i,r,n={}){let o=Number(i),s=Number(r);if(!Number.isFinite(o)||!Number.isFinite(s))throw new Error("pointer coordinates must be finite");t.runtime.cursor.x=o,t.runtime.cursor.y=s;let a=Number(n.deltaX??0),l=Number(n.deltaY??0);if(e==="wheel"&&(!Number.isFinite(a)||!Number.isFinite(l)))throw new Error("wheel deltas must be finite");if(n.silent||bi(t,{kind:"pointer",payload:{type:e,x:o,y:s,...e==="wheel"?{deltaX:a,deltaY:l}:{}}}),e==="wheel"){let u=ao(t,o,s),f=kc(u);if(f){let h=f._scroll.horizontal&&a||l;ta(f,f._scroll.offset+h)}return u}if(e==="cancel")return Oc(t,o,s),null;if((e==="move"||e==="up")&&t.pointerScroll&&!lo(t.pointerScroll.control)&&Oc(t,o,s),e==="move"){let u=t.pointerLastPosition||{x:o,y:s},f=t.pointerHoverControl,h=ia(ao(t,o,s)),p=gr(t,o,s,{previous:u});f&&f!==h&&t.runtime.injectCursor(f,"CursorExit",p),h&&f!==h&&t.runtime.injectCursor(h,"CursorEnter",p),t.pointerHoverControl=h;let m=t.hoveredControl;t.hoveredControl=h?.kind==="button"?h:null,m&&m!==t.hoveredControl&&Wr(t,m),t.hoveredControl&&Wr(t,t.hoveredControl);let g=t.pointerDownControl,b=t.pointerScroll;if(b)if(!lo(b.control))t.pointerScroll=null;else{let C=Ac(t,b.control,o,s);if(C){let k=b.control._scroll,E=k.horizontal?C.x-b.start.x:C.y-b.start.y,G=oo(k,C.width,C.height)?.travel||0,x=b.bar?G?E*k.max/G:0:-E;ta(b.control,b.offset+x)}}if(g?.alive){let C=t.pointerDownPosition||u,k=Math.hypot(o-C.x,s-C.y)>5;!t.pointerDragging&&k&&(b||t.runtime.injectCursor(g,"CursorBeginDrag",gr(t,o,s,{press:C,previous:u,dragging:!1})),t.pointerDragging=!0),t.pointerDragging&&!b&&t.runtime.injectCursor(g,"CursorDrag",gr(t,o,s,{press:C,previous:u,dragging:!0}))}return t.pointerLastPosition={x:o,y:s},h}if(e==="down"){let u=ia(ao(t,o,s));t.pointerDownControl=u,t.pointerDownPosition={x:o,y:s},t.pointerLastPosition={x:o,y:s},t.pointerDragging=!1,t.pointerScroll=null;let f=kc(u);if(f){let h=Ac(t,f,o,s),p=h&&oo(f._scroll,h.width,h.height),m=b=>h.x>=b.x&&h.x<=b.x+b.width&&h.y>=b.y&&h.y<=b.y+b.height,g=p&&m(p.track);if(g&&!m(p.thumb)){let b=f._scroll.horizontal?h.x-p.track.x-p.thumb.width/2:h.y-p.track.y-p.thumb.height/2;ta(f,p.travel?b/p.travel*f._scroll.max:0),uo(t)}h&&(t.pointerScroll={control:f,start:h,offset:f._scroll.offset,bar:!!g})}return u&&(na(t,u,!0),t.runtime.injectCursor(u,"CursorDown",gr(t,o,s))),u}if(e==="up"){let u=t.pointerDownControl,f=ia(ao(t,o,s));if(u?.alive){let h=gr(t,o,s,{press:t.pointerDownPosition,previous:t.pointerLastPosition,dragging:t.pointerDragging});if(t.runtime.injectCursor(u,"CursorUp",h),t.pointerDragging)t.pointerScroll||t.runtime.injectCursor(u,"CursorEndDrag",h);else if(f===u&&!t.pointerScroll?.bar){t.runtime.injectCursor(u,"CursorClick",h);let p=t.selectedControl;t.selectedControl=u.kind==="button"?u:null,p&&p!==t.selectedControl&&Wr(t,p)}na(t,u,!1)}return t.pointerDownControl=null,t.pointerDownPosition=null,t.pointerLastPosition={x:o,y:s},t.pointerDragging=!1,t.pointerScroll=null,f}if(e==="click")return Jr(t,"down",o,s,{silent:!0}),Jr(t,"up",o,s,{silent:!0});throw new Error(`unknown pointer type ${e}`)}function ca(t,e,i,r){if(!t?.server)throw new Error("play session has no server");return bi(t,{kind:"serverSet",payload:{entityType:e,name:i,value:r,playerIndex:t.viewPlayerIndex}}),t.server.setVar(e,i,r,{playerIndex:t.viewPlayerIndex})}function Lc(t,e,i){if(!t?.server)throw new Error("play session has no server");let r=t.server.getVar(e,i,{playerIndex:t.viewPlayerIndex});return r===void 0?null:r}function da(t,e,i=[],r="PlayerSelf"){if(!t?.server)throw new Error("play session has no server");return bi(t,{kind:"serverSend",payload:{name:e,params:i,target:r,playerIndex:t.viewPlayerIndex}}),t.server.sendToClient(e,i,{target:r,playerIndex:t.viewPlayerIndex})}function ho(t){return{snapshot:e=>aa(t,e),step:e=>co(t,e),pointer:(e,i,r,n)=>Jr(t,e,i,r,n),key:e=>la(t,e),click:e=>ua(t,e),view:e=>oa(t,e),pause:()=>{bi(t,{kind:"pause",payload:{}}),t.debugPaused=!0},resume:()=>{bi(t,{kind:"resume",payload:{}}),t.debugPaused=!1},serverSet:(e,i,r)=>ca(t,e,i,r),serverSend:(e,i,r)=>da(t,e,i,r)}}function ha(t){t?.server&&t.server.destroy();let e=t?.runtimes||(t?.runtime?[t.runtime]:[]);for(let i of e)i.destroy()}function pa(t,e){return JSON.stringify(t)===JSON.stringify(e)}function jc(t,e){for(let i of t||[])e(i),i.children?.length&&jc(i.children,e)}function ma(t,{id:e,name:i}){let r=null;return jc(t,n=>{r||(e&&String(n.id)===String(e)||!e&&i&&n.name===i)&&(r=n)}),r}function Bm(t,e){if(t){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];if(t.box&&Object.prototype.hasOwnProperty.call(t.box,e))return t.box[e]}}function Vm(t){return{var(e,i){return t.server?.vars?.[e]?.[i]?.value??null},logs(){return(t.logs||[]).map(e=>e.text)},logContains(e){return(t.logs||[]).some(i=>String(i.text||"").includes(String(e)))},serverLogs(){return(t.server?.logs||t.serverLogs||[]).map(e=>e.text)},serverLogContains(e){return(t.server?.logs||t.serverLogs||[]).some(i=>String(i.text||"").includes(String(e)))},control(e){let i=ma(t.tree,{name:String(e)});return i?{id:i.id,name:i.name,kind:i.kind,active:i.active,visible:i.visible,pressed:i.pressed,text:i.text,interactable:i.interactable}:null},signals(e){let i=e==="outbound"?"outbound":"inbound";return(t.server?.[i]||[]).map(r=>({name:r.name,values:r.values}))}}}function Lm(t,e){if(t.kind==="log"){let i=t.source==="server"?e.server?.logs||e.serverLogs||[]:e.logs||[];return i.some(n=>t.level&&n.level!==t.level?!1:String(n.text||"").includes(t.contains))?{ok:!0,actual:t.contains}:{ok:!1,actual:i.map(n=>n.text).slice(-8),expected:t.contains}}if(t.kind==="control"){let i=ma(e.tree,t);if(!i)return{ok:!1,actual:null,expected:t.equals,message:`control not found: ${t.id||t.name}`};let r=Bm(i,t.field);return pa(r,t.equals)?{ok:!0,actual:r}:{ok:!1,actual:r,expected:t.equals}}if(t.kind==="var"){let i=e.server?.vars?.[t.entityType],n=!i||!Object.prototype.hasOwnProperty.call(i,t.name)?null:i[t.name].value;return pa(n,t.equals)?{ok:!0,actual:n}:{ok:!1,actual:n,expected:t.equals}}if(t.kind==="signal"){let i=t.direction==="outbound"?e.server?.outbound||[]:e.server?.inbound||[],r=i.find(n=>n.name===t.name&&(t.values===void 0||pa(n.values,t.values)));return r?{ok:!0,actual:r.values}:{ok:!1,actual:i.map(n=>({name:n.name,values:n.values})),expected:{name:t.name,values:t.values??null}}}if(t.kind==="tree"){let i=!!ma(e.tree,{name:t.name});return i===t.exists?{ok:!0,actual:i}:{ok:!1,actual:i,expected:t.exists}}return{ok:!1,message:`unsupported assert kind ${t.kind}`}}function jm(t,e){let i=jr();try{return i.evalQueryScript(t,Vm(e)),{ok:!0,actual:!0}}catch(r){return{ok:!1,message:r?.message||String(r)}}finally{i.destroy()}}function Yc(t,e){return t.kind==="lua"?jm(t.source,e):Lm(t,e)}function Ym(t,e){let i=e>0?e:qi;return Math.round((t+i)*1e9)/1e9}function Um(t,e){let i=e.payload||{};if(e.kind==="pointer")t.pointer(i.type,i.x,i.y,i);else if(e.kind==="key")t.key(i.typeName);else if(e.kind==="click")t.click(i.name);else if(e.kind==="pause")t.pause();else if(e.kind==="resume")t.resume();else if(e.kind==="serverSet")t.serverSet(i.entityType,i.name,i.value);else if(e.kind==="serverSend")t.serverSend(i.name,i.params,i.target);else if(e.kind==="view")t.view(i.playerIndex);else throw new Error(`unsupported event kind: ${e.kind}`)}function Xm(t,e){let i=Yc(t,e);return{kind:t.kind,at:Number(t.at||0),ok:!!i.ok,actual:i.actual??null,expected:i.expected??null,message:i.message||""}}function Uc(t,e){let i=Kr(e),r=i.events.slice().sort((k,E)=>k.t-E.t),n=i.asserts.slice(),o=i.dt||qi,s=r.reduce((k,E)=>Math.max(k,E.t),0),a=n.reduce((k,E)=>Math.max(k,Number(E.at||0)),0),l=Math.max(s,a),u=0,f=[],h=0,p=n.some(k=>k.kind==="control"||k.kind==="tree"||k.kind==="lua"),m=t.snapshot({inspect:p}),g=()=>{for(;u<r.length&&r[u].t<=h+1e-9;)Um(t,r[u]),u+=1,m=t.snapshot({inspect:p})},b=()=>{for(let k of n)if(!k._done&&Number(k.at||0)<=h+1e-9){let E=Xm(k,m);if(f.push(E),k._done=!0,!E.ok)return{passed:!1,failedAt:h,frame:m.frame||0,results:f,snapshot:m}}return null};g();let C=b();if(C)return ga(i,C);for(;h+1e-9<l;){t.step(o),h=Ym(h,o),m=t.snapshot({inspect:p}),g();let k=b();if(k)return ga(i,k)}return ga(i,{passed:f.every(k=>k.ok),failedAt:null,frame:m.frame||0,results:f,snapshot:m})}function ga(t,e){return oe({format:t.format,name:t.name,passed:e.passed,failedAt:e.failedAt,frame:e.frame,results:e.results,snapshot:{time:e.snapshot?.time??0,frame:e.snapshot?.frame??0,logs:e.snapshot?.logs||[],serverLogs:e.snapshot?.serverLogs||e.snapshot?.server?.logs||[],server:e.snapshot?.server||{vars:{},inbound:[],outbound:[],logs:[]}}})}function ya(t){return Array.isArray(t)?t.slice():[]}import{createHash as Hm}from"node:crypto";var Xc=t=>Hm("sha256").update(JSON.stringify(t.map(({id:e,path:i,source:r})=>({id:e,path:i,source:r})))).digest("hex");var Qm={Level:"\u5173\u5361",PlayerSelf:"\u5F53\u524D\u73A9\u5BB6",AvatarSelf:"\u5F53\u524D\u89D2\u8272",...Object.fromEntries($i.map((t,e)=>[t,`\u73A9\u5BB6${e+1}`])),...Object.fromEntries(Array.from({length:8},(t,e)=>[`Avatar${e+1}`,`\u89D2\u8272${e+1}`]))};function eg(t,e=1){let i=t?.vars||{},r=[],n=Number(e)>0?Number(e):1,o=["Level","PlayerSelf","AvatarSelf"];if(n>1)for(let a=1;a<=n;a+=1)o.push(`Player${a}`,`Avatar${a}`);let s=new Set;for(let a of o){if(s.has(a)||!i[a])continue;s.add(a);let l=i[a]||{};for(let u of Object.keys(l))r.push(oe({entityType:a,entityLabel:Qm[a]||a,name:u,type:l[u]?.type||"",value:l[u]?.value??null}))}return r}var Vi="qxqy-simulator-save",tg="qxqy-simulator-scripts",qe="server-control-template",fe="client-control-template",va={[qe]:"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F",[fe]:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"};function Bi(t){return t===fe?"client":"server"}function br(t){if(!(typeof t=="number"||typeof t=="string"&&/^\d+$/.test(t.trim()))||!gt(t))throw new Error("\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F 1\u20132147483647 \u8303\u56F4\u5185\u7684\u6574\u6570");return Number(t)}function ba(t=[]){if(!Array.isArray(t))throw new Error("controlGuidChanges \u5FC5\u987B\u662F\u6570\u7EC4");let e=new Set;return t.map(i=>{if(!i||typeof i.id!="string"||!i.id||e.has(i.id)||![qe,fe].includes(i.controlAsset)||typeof i.controlId!="string"||!i.controlId||typeof i.controlName!="string")throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u6216\u91CD\u590D\u7684\u53D8\u66F4\u8BB0\u5F55");if(e.add(i.id),i.batchId!==void 0&&(typeof i.batchId!="string"||!i.batchId))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 batchId");if(i.scriptSignature!==void 0&&!/^[a-f0-9]{64}$/.test(i.scriptSignature))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 scriptSignature");return{id:i.id,controlAsset:i.controlAsset,controlId:i.controlId,controlName:i.controlName,oldGuid:br(i.oldGuid),newGuid:br(i.newGuid),...i.batchId?{batchId:i.batchId}:{},...i.scriptSignature?{scriptSignature:i.scriptSignature}:{}}})}function ig(t){let e=[t?.guid,t?.id];for(let i of e){let r=Number(i);if(Number.isSafeInteger(r)&&r>0&&r<=2147483647)return r}return 0}function po(t){let e=String(t?.controlAsset||""),i=ig(t);return{id:String(i||t?.id||""),guid:i,path:String(t?.path||""),source:String(t?.source||""),controlId:String(t?.controlId||""),controlAsset:e===fe||e==="client"?fe:e===qe||e==="server"?qe:""}}function rg(t){let e=[],i=(r,n="")=>{if(r&&(r.path||r.source)){let o=po(r);e.push(n?{...o,controlAsset:n}:o)}};if(Array.isArray(t?.assets?.scripts)){for(let r of t.assets.scripts)r&&(r.path||r.source)&&e.push(po(r));return e}if(i(t?.assets?.server?.script,qe),i(t?.assets?.client?.script,fe),t&&t.format!==Vi){i(t?.script);for(let r of t?.scripts||[])i(r)}return e}function wa(t){return yi(t===fe?Wi():Ei())}var ng="\u672A\u7ED1\u5B9A",yr="\u672A\u547D\u540D\u5B58\u6863",og="\u672A\u547D\u540D\u754C\u9762";function sg(t){let e=t;for(let i=0;i<8;i++){if(Zr(Kc(e,"simulator","studio"))&&Zr(Kc(e,"lua")))return e;let r=Jm(e);if(r===e)break;e=r}return t}function ag(t){return t?{name:vr(t),path:t,bound:!0}:{name:ng,path:"",bound:!1}}function lg(t,e=process.cwd()){if(Zm(t)&&Zr(t))return t;let i=e||process.cwd(),r=sg(i),n=Wc(r,t);if(Zr(n))return n;let o=Wc(i,t);if(Zr(o))return o;throw new Error("script file not found: "+t)}function Sa(t,e={}){t?.format===Vi&&Ms(t.version);let i=[],r=typeof e.workspacePath=="string"&&e.workspacePath?e.workspacePath:"",n=t?.format===Vi&&t.assets,o=ba(t?.controlGuidChanges),s=mo(t?.scriptSync),a=n?null:yi(t,{warnings:i}),l={server:n&&t.assets.server?yi(t.assets.server,{warnings:i}):wa(qe),client:n&&t.assets.client?yi(t.assets.client,{warnings:i}):wa(fe)};a&&(l[Bi(a.meta.assetType)]=a);let u=n&&t.activeAssetType===fe?fe:a?.meta.assetType||qe,f=n&&t.meta?.name?String(t.meta.name):"",h=()=>f||yr;!t?.meta?.name&&l.server.meta.name==="\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4"&&(l.server.meta.name=og);let p=[],m=new Set;function g(){m.clear(),Ki(l.server.root,m),Ki(l.client.root,m,{skipServerContainer:!0});for(let v of p)gt(v.guid)&&m.add(Number(v.guid))}function b(v=0){g();let I=gt(v)&&!m.has(Number(v))?Number(v):ii(m);return m.add(I),I}function C(v){let I=po(v),T=b(I.guid);return{...I,guid:T,id:String(T)}}A(rg(t));let k=Hr(t?.serverLogic),E=null,G="",x=1,q=1;function B(v){let I=String(v||"").trim();if(!I)return"";if(!Te[I])throw new Error(`unknown canvas preset: ${I} (available: ${Object.keys(Te).join(", ")})`);return I}let W=()=>l[Bi(u)];function j(v){if(!v)return null;for(let[I,T]of[["server",l.server],["client",l.client]]){let $=je(T.root,v);if($&&$.kind!=="server-container")return{key:I,node:$}}return null}function _(v){if(!v.controlId)return null;let I=v.controlAsset===fe?"client":v.controlAsset===qe?"server":null;if(I){let T=je(l[I].root,v.controlId);return T&&T.kind!=="server-container"?{key:I,node:T}:null}return j(v.controlId)}function R(){for(let v of p)v.controlId&&!_(v)&&(v.controlId="",v.controlAsset="")}function y(v){if(!gt(v))return null;for(let[I,T]of[[qe,l.server],[fe,l.client]]){let $="";if(ke(T.root,Y=>{!$&&(Y.scriptMappingIds||[]).includes(Number(v))&&($=Y.id)}),$)return{controlId:$,controlAsset:I}}return null}function N(v,I,T){let $=l[Bi(v.controlAsset)],Y=$&&je($.root,v.controlId);Y&&(Y.scriptMappingIds=(Y.scriptMappingIds||[]).map(U=>Number(U)===Number(I)?Number(T):U))}R();function S(){return p.map(v=>{let I=_(v),T=I?I.key==="client"?fe:qe:"";return oe({id:v.id,guid:v.guid||0,path:v.path||"",source:v.source||"",controlId:v.controlId||"",controlAsset:v.controlAsset||T,controlName:I?.node.name||"",assetType:T,assetLabel:I?va[T]:"",mounted:!!I})})}function c(){let v=[],I=(T,$)=>{ke(T.root,Y=>{Y.kind!=="server-container"&&v.push(oe({id:Y.id,name:Y.name,kind:Y.kind,assetType:$,assetLabel:va[$]}))})};return I(l.server,qe),I(l.client,fe),v}function w(v){let I=[];return ke(v.root,T=>{T.kind!=="server-container"&&I.push(JSON.stringify({kind:T.kind,guid:T.guid,name:T.name,text:T.text??null,imageId:T.imageId??null,imageSource:T.imageSource??null,imageType:T.imageType??null,fontSize:T.fontSize??null,adaptiveFontSize:T.adaptiveFontSize??null,minimumFontSize:T.minimumFontSize??null,fontColor:T.fontColor??null,bgColor:T.bgColor??null,imageColor:T.imageColor??null,fillType:T.fillType??null,fillAmount:T.fillAmount??null,syncAllDevices:T.syncAllDevices!==!1,transformByPlatform:T.transformByPlatform||null}))}),I.join("/")}let M=w(Wi()),L=w(Ei());function X(v){let I=w(v);return v.meta?.assetType===fe?I===M:I===L}function Q(v,I){return String(v||"").replace(/[\\/:*?"<>|]/g,"-").trim()||I}function ce(v){let I=Q(h(),yr),T=v.meta?.assetType===fe?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F";return`${I} \xB7 ${T}`}function ve(){if(!((l.server.root.children||[]).find(I=>I.kind==="container")||l.server.root.children?.[0]))throw new Error("\u6574\u5408\u5305\u9700\u8981\u670D\u52A1\u7AEF\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u4E0B\u81F3\u5C11\u6709\u4E00\u4E2A\u6839\u63A7\u4EF6");return kf(l.server,l.client,{scripts:p,fileName:`${Q(h(),yr)} \xB7 \u6574\u5408\u5305.gia`})}function be(){let v=I=>({type:I.meta.assetType,name:I.meta.name,sourceFile:I.meta.sourceFile||""});return{format:Vi,name:h(),activeAssetType:u,assets:{server:v(l.server),client:v(l.client),scripts:S()}}}function me(){return oe({format:Vi,version:4,meta:{name:h()},activeAssetType:u,serverLogic:k,controlGuidChanges:o,scriptSync:s,assets:{server:l.server,client:l.client,scripts:p.map(v=>oe({id:v.id,guid:v.guid||0,path:v.path||"",source:v.source||"",controlId:v.controlId||"",controlAsset:v.controlAsset||""}))}})}function ee(){let v=W(),I=Vf(v);if(I.workspace=ag(r),I.save=be(),I.scripts=S(),I.mountTargets=c(),I.serverLogic=k,I.migrationWarnings=[...i],I.controlGuidChanges=oe(o),u===fe){let T=fr(v,!0);I.clientGuidAutofill={count:T.length,templateCount:T.filter(({parent:$})=>$?.kind==="server-container").length,selectedOffset:T.findIndex(({node:$})=>$.id===I.selectedId)}}return I.scriptSync=oe(s),Fa(I),I}function ue(v){let I=W();if(v.expectedRevision!==void 0&&Number(v.expectedRevision)!==I.version)throw new Error(`revision conflict: expected ${v.expectedRevision}, current ${I.version}`);return I}function Se(v,I,T=""){let $=String(I||"");if($){let Y=T===fe?fe:T===qe?qe:"";if(!_({controlId:$,controlAsset:Y}))throw new Error("\u6302\u8F7D\u76EE\u6807\u5FC5\u987B\u662F\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F");v.controlAsset=Y}else v.controlAsset="";v.controlId=$}function dt(v){let I=ue(v);if(v.op==="addScript"){let T=C({path:String(v.path||""),source:String(v.source||""),controlId:"",controlAsset:""});v.controlId!==void 0&&v.controlId!==""&&Se(T,v.controlId,v.controlAsset),p.push(T)}else if(v.op==="updateScript"){let T=p.find($=>$.id===v.id);if(!T)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${v.id}`);v.controlId!==void 0&&Se(T,v.controlId,v.controlAsset),v.path!==void 0&&(T.path=String(v.path)),v.source!==void 0&&(T.source=String(v.source))}else if(v.op==="removeScript"){let T=p.length;if(p=p.filter($=>$.id!==v.id),p.length===T)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${v.id}`)}return I.version+=1,ee()}function Gt(v){let I=ue(v),T=je(I.root,v.id??I.selectedId);if(!T||T.kind==="server-container")throw new Error("\u4EC5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5141\u8BB8\u4FEE\u6539\u7D22\u5F15");let $=br(v.guid);if(br(T.guid),v.autoFillClientGuids!==void 0&&typeof v.autoFillClientGuids!="boolean")throw new Error("autoFillClientGuids \u5FC5\u987B\u662F\u5E03\u5C14\u503C");let Y=v.autoFillClientGuids===!0;if(Y&&u!==fe)throw new Error("\u81EA\u52A8\u586B\u5145\u4EC5\u652F\u6301\u5BA2\u6237\u7AEF\u6A21\u677F\u5217\u8868\uFF1B\u670D\u52A1\u7AEF\u754C\u9762\u7684\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199");let U=Y?fr(I,!0).map(({node:Z})=>Z):[T],he=$-U.indexOf(T),xe=U.map((Z,Pe)=>({node:Z,oldGuid:br(Z.guid),newGuid:br(he+Pe)})),qt=xe.filter(({oldGuid:Z,newGuid:Pe})=>Z!==Pe);if(!qt.length)return ee();let Ne=new Map(xe.map(({oldGuid:Z,newGuid:Pe})=>[Z,Pe]));if(Ne.size!==xe.length)throw new Error("\u5BA2\u6237\u7AEF\u6A21\u677F\u5B58\u5728\u91CD\u590D\u65E7\u7D22\u5F15\uFF0C\u65E0\u6CD5\u81EA\u52A8\u586B\u5145\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49");let Qt=new Set(U),Ke=[];for(let Z of Object.values(l))ke(Z.root,Pe=>{Z===l.client&&Pe.kind==="server-container"||Ke.push({node:Pe,project:Z})});let Si=new Map([...Ke.filter(Z=>!Qt.has(Z.node)).map(({node:Z})=>[Number(Z.guid),Z.name]),...p.map(Z=>[Number(Z.guid),Z.path||"Lua \u811A\u672C"])]);for(let{newGuid:Z}of qt)if(Si.has(Z))throw new Error(`\u63A7\u4EF6\u7D22\u5F15 ${Z} \u5DF2\u88AB\u300C${Si.get(Z)}\u300D\u5360\u7528\uFF1B\u8BF7\u5148\u586B\u5199\u5B83\u7684\u5B9E\u9645\u7D22\u5F15\u3002\u672C\u6B21\u672A\u4FEE\u6539\u4EFB\u4F55\u7D22\u5F15\u3002`);let At=[],Ee=(Z,Pe,Bt)=>{let pt=Z?.[Pe];(typeof pt=="number"||typeof pt=="string"&&/^\d+$/.test(pt.trim()))&&Ne.has(Number(pt))&&Ne.get(Number(pt))!==Number(pt)&&At.push({owner:Z,key:Pe,project:Bt.project,oldGuid:Number(pt),newGuid:Ne.get(Number(pt))})};for(let Z of Ke)Ee(Z.node,"referencedPrefabId",Z),Ee(Z.node,"itemPrefabId",Z),Ee(Z.node.giaRaw,"templateRefSlot",Z);let We=new Map;for(let{node:Z}of Ke)We.set(Number(Z.guid),(We.get(Number(Z.guid))||0)+1);for(let{oldGuid:Z}of At)if(We.get(Z)!==1)throw new Error(`\u65E7\u7D22\u5F15 ${Z} \u5728\u591A\u68F5\u8D44\u4EA7\u6811\u4E2D\u91CD\u590D\uFF0C\u65E0\u6CD5\u786E\u5B9A\u6A21\u677F\u5F15\u7528\u5F52\u5C5E\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49\u540E\u4FEE\u6539`);let Sr=Y?Hc():"",Je=Xc(p);for(let{node:Z,oldGuid:Pe,newGuid:Bt}of qt)Z.guid=Bt,o.push({id:Hc(),controlAsset:u,controlId:Z.id,controlName:Z.name,oldGuid:Pe,newGuid:Bt,scriptSignature:Je,...Sr?{batchId:Sr}:{}});let tn=new Set([I]);for(let{owner:Z,key:Pe,project:Bt,newGuid:pt}of At)Z[Pe]=typeof Z[Pe]=="string"?String(pt):pt,tn.add(Bt);for(let Z of tn)Z.version+=1;return ee()}function Oe(v){let I=ue(v);if(!Array.isArray(v.changeIds)||!v.changeIds.length||v.changeIds.some($=>typeof $!="string"||!o.some(Y=>Y.id===$)))throw new Error("\u8BF7\u660E\u786E\u6307\u5B9A\u5DF2\u6838\u5BF9 Lua \u5F15\u7528\u7684\u6709\u6548\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55 changeIds");let T=new Set(v.changeIds);return o=o.filter($=>!T.has($.id)),I.version+=1,ee()}function at(v){if(!v||typeof v!="object")throw new Error("patch requires op");if(v.op==="setScriptSync"){let I=ue(v);return s=mo(v.config),I.version+=1,ee()}if(v.op==="setControlGuid")return Gt(v);if(v.op==="acknowledgeControlGuidChanges")return Oe(v);if(v.op==="setServerLogic"){let I=ue(v);return k=Hr(v.logic),I.version+=1,ee()}if(v.op==="addScript"||v.op==="updateScript"||v.op==="removeScript")return dt(v);if(v.op==="selectAsset")return u=v.assetType===fe?fe:qe,ee();if(v.op==="renameSave"){let I=String(v.name||"").trim();if(!I)throw new Error("\u5B58\u6863\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return f=I,ee()}if(v.op==="newAsset"){let I=ue(v);u=v.assetType===fe?fe:qe;let T=wa(u);return T.version=I.version+1,l[Bi(u)]=T,o=o.filter($=>$.controlAsset!==u),R(),ee()}return $s(W(),v),R(),ee()}function ht(v){return p.filter(I=>{let T=_(I);return!!(T&&T.key==="client"==(v===fe))})}function de(v="json",I=""){let T=O(v,I);if(o.length&&!["save","archive"].includes(String(v).toLowerCase())){let $=o.map(Y=>`\u63A7\u4EF6\u7D22\u5F15\u5F85\u6838\u5BF9 Lua \u5F15\u7528\uFF1A${va[Y.controlAsset]} / ${Y.controlName} (${Y.controlId})\uFF1A${Y.oldGuid} \u2192 ${Y.newGuid}\u3002\u8BF7\u6309\u8BED\u4E49\u66F4\u65B0\u811A\u672C\u4E2D\u7684\u63A7\u4EF6\u7D22\u5F15\u5F15\u7528\uFF0C\u6838\u5BF9\u540E\u786E\u8BA4\u53D8\u66F4\u8BB0\u5F55 ${Y.id}\uFF1B\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\u3002`);T.warnings=[...new Set([...T.warnings||[],...$])]}return T}function O(v="json",I=""){let T=String(v).toLowerCase();if(T==="save"||T==="archive"){let U=Buffer.from(JSON.stringify(me(),null,2),"utf8");return oe({filename:`${h().replace(/[\\/:*?"<>|]/g,"-")} \xB7 \u8D44\u4EA7\u5305.json`,mimeType:"application/json",encoding:"base64",data:U.toString("base64"),warnings:[]})}if(T==="save-gia"||T==="archive-gia"){let U=[],he=[],xe=(Ne,Qt="")=>{let Ke=de(Ne,Qt);U.push(oe({filename:Ke.filename,mimeType:Ke.mimeType,encoding:Ke.encoding,data:Ke.data,warnings:Ke.warnings||[]})),he.push(...Ke.warnings||[])},qt=(Ne,Qt)=>{let Ke=l[Bi(Ne)],Si=Ne===u,At=p.some(Ee=>Ee.controlAsset===Ne&&Ee.controlId);if(!Si&&X(Ke)&&!At){he.push(Qt);return}xe("gia",Ne)};if(qt(qe,"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u6A71\u7A97\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),qt(fe,"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u300CLua\u5B9E\u4F8B\u5316\u9762\u677F\u300D\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),p.some(Ne=>Ne.path||Ne.source)&&xe("scripts-gia"),!U.length)throw new Error("\u8D44\u4EA7\u5305 GIA \u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u5DF2\u6539\u52A8\u9879\uFF1B\u8BF7\u5148\u7F16\u8F91\u5F53\u524D\u754C\u9762\uFF0C\u6216\u6539\u7528\u300C\u5F53\u524D\u754C\u9762 GIA\u300D\u3002");return oe({format:"qxqy-gia-package",files:U,warnings:[...new Set(he)]})}if(T==="gia-combined"||T==="combined-gia"||T==="combined"){let U=ve();return oe({filename:`${Q(h(),yr)} \xB7 \u6574\u5408\u5305.gia`,mimeType:"application/octet-stream",encoding:"base64",data:U.buffer.toString("base64"),warnings:[...new Set(U.warnings||[])]})}if(T==="scripts"){let U=oe({format:tg,version:1,scripts:p.map(xe=>oe({id:xe.id,guid:xe.guid||0,path:xe.path||"",source:xe.source||"",controlId:xe.controlId||"",controlAsset:xe.controlAsset||""}))}),he=Buffer.from(JSON.stringify(U,null,2),"utf8");return oe({filename:`${Q(h(),yr)} \xB7 \u811A\u672C.json`,mimeType:"application/json",encoding:"base64",data:he.toString("base64"),warnings:[]})}if(T==="scripts-gia"||T==="scriptsgia"){let U=Tf(p);return oe({filename:`${Q(h(),yr)} \xB7 \u811A\u672C.gia`,mimeType:"application/octet-stream",encoding:"base64",data:U.buffer.toString("base64"),warnings:U.warnings})}if(T==="lua"){let U=p.find(xe=>xe.id===I)||p.find(xe=>xe.path===I);if(!U)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let he=vr(U.path||"")||`qxqy-script-${U.id}`;return oe({filename:/\.lua$/i.test(he)?he:`${he}.lua`,mimeType:"text/x-lua",encoding:"base64",data:Buffer.from(U.source||"","utf8").toString("base64"),warnings:[]})}let $=I?l[Bi(I)]:W(),Y=ce($);if(T==="json"){let U=oe({...$,scripts:ht($.meta.assetType),controlGuidChanges:o.filter(xe=>xe.controlAsset===$.meta.assetType)}),he=Buffer.from(JSON.stringify(U,null,2),"utf8");return oe({filename:`${Y}.json`,mimeType:"application/json",encoding:"base64",data:he.toString("base64"),warnings:[]})}if(T==="gia"){let U=Ef($,$.meta.assetType===fe?{scripts:ht(fe)}:{}),he=$.meta.assetType===fe?[]:ht(qe);return he.length&&U.warnings.unshift(`\u5F53\u524D\u670D\u52A1\u5668\u63A7\u4EF6 GIA \u4E0D\u5305\u542B ${he.length} \u4E2A Lua \u811A\u672C\u7684\u6E90\u7801\uFF1B\u8BF7\u4F7F\u7528\u300C\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\u300D\uFF0C\u6216\u53E6\u884C\u5BFC\u5165\u811A\u672C\u5305\u5E76\u6838\u5BF9\u6302\u8F7D\u3002`),oe({filename:`${Y}.gia`,mimeType:"application/octet-stream",encoding:"base64",data:U.buffer.toString("base64"),warnings:U.warnings})}throw new Error(`unsupported export format: ${v}`)}function A(v){for(let I of v){let T=po(I);if(!T.path&&!T.source)continue;let $=T.controlId?null:y(T.guid),Y=C($?{...T,...$}:T);$&&Y.guid!==T.guid&&N($,T.guid,Y.guid),Y.controlId&&!_(Y)&&(Y.controlId="",Y.controlAsset=""),p.push(Y)}}function P(v,I,T=""){let $=String(v||"").toLowerCase();if(typeof I!="string"||!I)throw new Error("import data is required");let Y=Buffer.from(I,"base64"),U,he=[],xe={},qt=[];if($==="json"){try{U=JSON.parse(Y.toString("utf8"))}catch{throw new Error("JSON \u6587\u4EF6\u65E0\u6548")}if(U?.project&&(U=U.project),U?.format===Vi&&U?.assets){Ms(U.version);let Ee=Sa(U);he.push(...Ee.get().migrationWarnings);let We=Ee.archiveData();return l.server=We.assets.server,l.client=We.assets.client,i=[...he],u=U.activeAssetType===fe?fe:qe,f=String(U.meta?.name||vr(T).replace(/\.json$/i,"")||f),k=We.serverLogic,p=We.assets.scripts,o=We.controlGuidChanges,s=We.scriptSync,m.clear(),oe({snapshot:ee(),warnings:he,metadata:{format:Vi}})}}else{if($==="lua")return p.push(C({path:vr(T||"imported.lua"),source:Y.toString("utf8"),controlId:""})),oe({snapshot:ee(),warnings:he,metadata:{assetType:"lua-script"}});if($==="gia"){if(Rf(Y)){let Je=Pf(Y);return A(Je.scripts),oe({snapshot:ee(),warnings:Je.warnings,metadata:Je.metadata})}let Ee=Ff(Y);U=Ee.project,he=Ee.warnings,xe=Ee.metadata,Ee.clientProject&&(l.client=yi(Ee.clientProject),o=o.filter(Je=>Je.controlAsset!==fe),he.push("\u6574\u5408\u5305\u5DF2\u62C6\u56DE\u300CUI\u63A7\u4EF6-\u670D\u52A1\u7AEF\u300D\u4E0E\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\uFF1B\u5BA2\u6237\u7AEF\u6A21\u677F\u8FB9\u754C\u5DF2\u4FDD\u7559\u3002"));let We=new Map,Sr=(Je,tn)=>{Je&&ke(Je.root,Z=>{for(let Pe of Z.scriptMappingIds||[]){let Bt=We.get(Number(Pe));if(Bt){he.push(`\u811A\u672C GUID ${Pe} \u540C\u65F6\u6302\u8F7D\u5230\u591A\u4E2A\u63A7\u4EF6\uFF0C\u5DF2\u4FDD\u7559\u201C${Bt.controlAsset===qe?"\u670D\u52A1\u7AEF":"\u5BA2\u6237\u7AEF"}\u201D\u76EE\u6807\u3002`);continue}We.set(Number(Pe),{controlId:Z.id,controlAsset:tn})}})};Sr(Ee.project,Ee.project.meta.assetType),Sr(Ee.clientProject,fe),qt=(Ee.scripts||[]).map(Je=>We.has(Number(Je.guid))?{...Je,...We.get(Number(Je.guid))}:Je)}else throw new Error(`unsupported import format: ${v}`)}let Ne=yi(U,{warnings:he}),Qt=ba(U?.controlGuidChanges);if(Qt.some(Ee=>Ee.controlAsset!==Ne.meta.assetType))throw new Error("\u5355\u8D44\u4EA7 JSON \u7684\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55\u5FC5\u987B\u5C5E\u4E8E\u5F53\u524D\u5BFC\u5165\u8D44\u4EA7");let Ke=ba([...o.filter(Ee=>Ee.controlAsset!==Ne.meta.assetType),...Qt]);i=[...he];let Si=Bi(Ne.meta.assetType);l[Si]=Ne,o=Ke,u=Ne.meta.assetType;let At=l[Si];return T&&(At.meta.name=vr(T).replace(/\.(json|gia)$/i,"")||At.meta.name,At.meta.sourceFile=vr(T),At.meta.sourceFormat=$),A(qt),A(U?.scripts||[]),U?.script&&(U.script.path||U.script.source)&&A([U.script]),oe({snapshot:ee(),warnings:he,metadata:xe})}function F(v,I){return $s(W(),{op:"pick",x:v,y:I}),ee()}function V(v){let I=typeof v=="string"&&v?v:"";!I||I===r||(r=I)}function J(v){let I=v.source||"";if(!I.trim()&&v.path.trim())try{I=Wm(lg(v.path,r),"utf8")}catch(T){throw new Error(`\u811A\u672C ${v.path} \u8BFB\u53D6\u5931\u8D25: ${T?.message||T}`)}return I}function re(v={}){let I=B(v.canvasId);I&&(G=I),v.playerCount!==void 0&&v.playerCount!==null&&v.playerCount!==""&&(x=Di(v.playerCount),q>x&&(q=1)),v.viewPlayerIndex!==void 0&&v.viewPlayerIndex!==null&&v.viewPlayerIndex!==""&&(q=Jt(v.viewPlayerIndex,x)),E&&ha(E);let T=p.map(Y=>{try{return{id:Y.id,guid:Y.guid||0,path:Y.path||Y.id,source:J(Y),controlId:Y.controlId||"",controlAsset:Y.controlAsset||""}}catch(U){return{id:Y.id,guid:Y.guid||0,path:Y.path||Y.id,source:`error([==[ ${String(U.message).replace(/]=+]/g,"] =]")} ])`,controlId:Y.controlId||"",controlAsset:Y.controlAsset||""}}}),$=Y=>T.filter(U=>{let he={controlId:U.controlId,controlAsset:U.controlAsset},xe=U.controlId?_(he):null;return!!(xe&&xe.key===Y)});return E=Fc(l.server,{templatesProject:l.client,scripts:T,sceneScripts:$("server"),templateScripts:$("client"),serverConfig:{logic:k},canvasId:G,playerCount:x,viewPlayerIndex:q,language:v.language||""}),ie(v)}function ne(v,I={}){let T=B(v);if(!T)throw new Error("playSetCanvas requires canvasId");return re({...I,canvasId:T})}function ie(v={}){if(!E)return oe({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]});let I=aa(E,v);return I.running=!0,I.logs=ya(I.logs),I.serverLogs=ya(I.server?.logs||[]),I.serverVars=eg(I.server,I.playerCount||1),I}function Fe(v,I={}){return E||re(),co(E,v),I.observe===!1?oe({running:!0,time:E.runtime.clock.time,frame:E.runtime.clock.frame,paused:!!E.debugPaused,levelTimePaused:!!E.runtime.clock.paused,playerCount:E.playerCount||1,viewPlayerIndex:E.viewPlayerIndex||1}):ie(I)}function Re(v=0){re();let I=Math.max(0,Number(v)||0);for(let T=0;T<I;T++)co(E,1/30);return ie()}function kt(){return E&&ha(E),E=null,G="",x=1,q=1,oe({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]})}function Jc(v,I={}){let T=wr();return q=oa(T,v),I.observe===!1?null:ie(I)}function Zc(v,I={}){if(!E)throw new Error("play session has not started");return la(E,v),I.observe===!1?null:ie(I)}function Qc(v,I={}){if(!E)throw new Error("play session has not started");return ua(E,v),I.observe===!1?null:ie(I)}function ed(v,I,T,$={}){if(!E)throw new Error("play session has not started");return Jr(E,v,I,T,$),$.observe===!1?null:ie($)}function td(v={}){return E&&ho(E).pause(),v.observe===!1?null:ie(v)}function id(v={}){return E&&ho(E).resume(),v.observe===!1?null:ie(v)}function wr(){if(!E)throw new Error("play session has not started");return E}function rd(v,I){let T=wr();if(!v&&!I){let $=ie();return oe({vars:$.serverVars||[]})}return oe({entityType:String(v||""),name:String(I||""),value:Lc(T,v,I)})}function nd(v,I,T){let $=wr();return ca($,v,I,T),ie()}function od(v,I=[],T="PlayerSelf"){let $=wr();return da($,v,I,T),ie()}function sd(){let v=ie();return oe({events:v.history||[],case:Sc(v.history||[],{playerCount:v.playerCount||1})})}function ad(v={}){let I=ie(),T=Kr({name:v.name||"",dt:v.dt,playerCount:v.playerCount||I.playerCount||1,events:v.events||I.history||[],asserts:v.asserts||[]});return oe(T)}function ld(v,I={}){let T=Kr(v);re({...I,playerCount:I.playerCount||T.playerCount||1});let $=wr();$.recording=!1;try{return Uc(ho($),v)}finally{$.recording=!0}}function ud(){if(!E)return{running:!1,paused:!1,time:0,frame:0,playerCount:1,viewPlayerIndex:1};let v=E.runtime.clock;return{running:!0,paused:!!E.debugPaused,levelTimePaused:!!v.paused,time:v.time,frame:v.frame,playerCount:E.playerCount||1,viewPlayerIndex:E.viewPlayerIndex||1}}let Ca={get:ee,patch:at,setWorkspace:V,exportData:de,importData:P,pick:F,playStart:re,playSetCanvas:ne,playSetView:Jc,playGet:ie,playStatus:ud,playStep:Fe,playRun:Re,playStop:kt,playKey:Zc,playClick:Qc,playPointer:ed,playPause:td,playResume:id,playServerGet:rd,playServerSet:nd,playServerSend:od,playHistory:sd,playSaveCase:ad,playRunCase:ld,archiveData:me};return Object.defineProperty(Ca,"_project",{enumerable:!1,get:W}),Ca}var ye=null,_a=!1,Zt=0,$t=0,Ia="realtime",ug=33,Qr=1/30,fg=5;function en(t={}){return{...t.inspect?{inspect:!0}:{},...t.view?{view:!0}:{},...t.paint?{paint:!0}:{},...t.compact?{compact:!0}:{},...t.sceneRev!==void 0&&t.sceneRev!==null?{sceneRev:t.sceneRev}:{}}}function cg(t={}){let e=en(t);for(let i of["canvasId","playerCount","viewPlayerIndex","language"])t[i]!==void 0&&t[i]!==null&&t[i]!==""&&(e[i]=t[i]);return e}function wi(t={}){return t.light?{...ye.playStatus()}:ye.playGet(en(t))}function dg(){if(!ye||_a||Ia!=="realtime")return;let t=ye.playStatus();if(!t.running||t.paused){Zt=0,$t=0;return}let e=Date.now();if(!Zt){Zt=e;return}_a=!0;try{$t+=Math.min(.25,Math.max(0,(e-Zt)/1e3)),Zt=e;let i=0;for(;$t>=Qr&&i<fg;)ye.playStep(Qr,{observe:!1}),$t-=Qr,i+=1;$t>Qr&&($t=Qr)}finally{_a=!1}}var dv=setInterval(dg,ug);function hg(t,e={}){if(t==="start"){let i=e.clockMode??"realtime";if(i!=="manual"&&i!=="realtime")throw new Error("clockMode must be manual or realtime");return ye&&ye.playStop(),ye=Sa(e.archive||e.project,{workspacePath:e.workspacePath||""}),Ia=i,Zt=0,$t=0,ye.playStart(cg(e))}if(!ye)throw new Error("play session has not started");if(t==="get")return e.light?wi(e):ye.playGet(en(e));if(t==="step"){let i=ye.playStep(e.dt,e.light?{observe:!1}:en(e));return e.light?wi(e):i}if(t==="pointer")return ye.playPointer(e.type,e.x,e.y,{observe:!1,deltaX:e.deltaX,deltaY:e.deltaY}),wi(e);if(t==="key")return ye.playKey(e.key,{observe:!1}),wi(e);if(t==="click")return ye.playClick(e.name,{observe:!1}),wi(e);if(t==="pause")return ye.playPause({observe:!1}),Zt=0,$t=0,wi(e);if(t==="resume")return ye.playResume({observe:!1}),Zt=0,$t=0,wi(e);if(t==="device")return ye.playSetCanvas(e.canvasId,en(e));if(t==="view")return ye.playSetView(e.playerIndex??e.viewPlayerIndex,{observe:!1}),wi(e);if(t==="serverGet")return ye.playServerGet(e.entityType,e.name);if(t==="serverSet")return ye.playServerSet(e.entityType,e.name,e.value);if(t==="serverSend")return ye.playServerSend(e.name,e.params||[],e.target||"PlayerSelf");if(t==="history")return ye.playHistory();if(t==="saveCase")return ye.playSaveCase(e.case||e);if(t==="runCase")return ye.playRunCase(e.case||e,{canvasId:e.canvasId,playerCount:e.playerCount,viewPlayerIndex:e.viewPlayerIndex});if(t==="stop"){let i=ye.playStop();return ye=null,Zt=0,$t=0,i}throw new Error(`unknown play action: ${t}`)}xa.on("message",t=>{let{id:e,action:i,args:r={}}=t||{};try{let n=hg(i,r),o=typeof n?.running=="boolean"?{...n,clockMode:Ia}:n;xa.postMessage({id:e,ok:!0,value:o,error:null})}catch(n){xa.postMessage({id:e,ok:!1,value:null,error:n?.message||String(n)})}});
119
+ `)}`);return i}function $a(t,e={}){be(t.root,Ii);let i=[];Yt(t,{warnings:i});let n=Ln(ie(t)),r=t.meta?.assetType==="client-control-template",o;if(r){let s=e.includeScriptMappings?Jr(e.scripts||[],new Set(n.values())):null;o=Df(t,n,i,void 0,s?.scripts||e.scripts||[]),s&&o.accessories.push(...s.units)}else{let s=Jr(e.scripts||[],new Set(n.values()));i.push(...s.warnings),o=$f(t,n,s,i)}return{buffer:Gf(o,r?Ba:qa),warnings:[...new Set(i)]}}function Vf(t,e,i={}){be(t.root,Ii),e&&be(e.root,Ii);let n=["\u6574\u5408\u5305\u628A\u670D\u52A1\u7AEF UIControlGroup \u4E0E\u5BA2\u6237\u7AEF UIControlTemplate \u5E76\u6392\u5199\u5165\u540C\u4E00 GIA \u7684 Root.graph\uFF1B\u5BFC\u5165\u65F6\u62C6\u56DE\u4E24\u7C7B\u8D44\u4EA7\uFF0C\u6A21\u677F\u8FB9\u754C\u3001\u811A\u672C\u6620\u5C04\u4E0E\u63A7\u4EF6\u6302\u8F7D\u5173\u7CFB\u4F1A\u4FDD\u7559\u3002"];e&&Yt(e,{warnings:n});let r=e?.root?.children||[];r.length||n.push("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4E3A\u7A7A\uFF0C\u6574\u5408\u5305\u53EA\u5305\u542B\u670D\u52A1\u7AEF\u63A7\u4EF6\u4E0E\u811A\u672C\u3002");let o=new Set,a=ie(t),s=e?ie(e):null,l=Ln(a,o),c=Jr(i.scripts||[],o);n.push(...c.warnings.filter(w=>w!==qf));let f=String(i.fileName||`${a.meta?.name||"\u6574\u5408\u5305"} \xB7 \u6574\u5408\u5305.gia`),h=Ma({...a,meta:{...a.meta,giaFileName:f}},!1),m=$f(a,l,c,n,h),p={graph:[],accessories:[]};if(r.length&&s){let w=Ln({...s,meta:{...s.meta,assetType:"client-control-template"}},o);p=Df(s,w,n,h,c.scripts)}let b={graph:[...m.graph,...p.graph],accessories:[...m.accessories,...p.accessories],filePath:h,gameVersion:Da({meta:{gameVersion:t.meta?.gameVersion||e?.meta?.gameVersion}}),...za(t)};return{buffer:Gf(b,qa),warnings:[...new Set(n)]}}var zi=69,Bf=30,qf="\u811A\u672C\u6302\u8F7D\u5173\u7CFB\u4E0D\u8FDB\u5165 GIA\uFF1A\u5B98\u65B9 script.gia \u53EA\u542B\u6620\u5C04\uFF08ID/\u540D\u79F0/\u8DEF\u5F84/\u6E90\u7801\uFF09\uFF0C\u5BFC\u5165\u540E\u9700\u91CD\u65B0\u6302\u8F7D\u3002";function q1(t){return(String(t.path||"").replace(/\\/g,"/").split("/").pop()||"").replace(/\.lua$/iu,"")||`\u811A\u672C${t.id||""}`}function Ga(t){let e=kt.verify(t);if(e)throw new Error(`GIA encode validation failed: ${e}`);let i=kt.encode(kt.create(t)).finish(),n=Buffer.alloc(yi+i.length+Pa);return n.writeUInt32BE(n.length-4,0),n.writeUInt32BE(1,4),n.writeUInt32BE(Rf,8),n.writeUInt32BE(3,12),n.writeUInt32BE(i.length,16),Buffer.from(i).copy(n,yi),n.writeUInt32BE(Nf,yi+i.length),n}function Jr(t,e=new Set){let i=(t||[]).filter(a=>a.path||a.source).map(a=>({...a})),n=[];for(let a of i)Ao(a.guid,a.path||a.id);for(let a of i){let s=Number(a.guid);dt(s)&&!e.has(s)?(e.add(s),a.guid=s):n.push(a)}for(let a of n){let s=ri(e);e.add(s),a.guid=s}let r=[];return(t||[]).some(a=>a.controlId)&&r.push(qf),{units:i.map(a=>{let s=q1(a),l=String(a.path||"").replace(/\\/g,"/"),c=/\.lua$/iu.test(l)?l:`${l||s}.lua`,f={id:a.guid,name:s,filePath:c};return String(a.source||"")&&(f.source=String(a.source)),{id:{class:Bf,id:a.guid},name:s,which:zi,script:{mapping:f}}}),warnings:r,scripts:i}}function Lf(t){let e=Jr(t);if(!e.units.length)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let i={graph:e.units,filePath:`114514-${Math.floor(Date.now()/1e3)}-1073741832-\\script.gia`,gameVersion:"7.0.51"},n=Ga(i),r=L1(n);if(!r.valid)throw new Error(`GIA compatibility validation failed:
120
+ ${r.errors.join(`
121
+ `)}`);return{buffer:n,warnings:[...new Set(e.warnings)]}}function Va(t){return kt.toObject(kt.decode(Qr(t)),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0})}function jf(t){try{let i=Va(t).graph||[];return i.length>0&&i.every(n=>Number(n.which)===zi)}catch{return!1}}function Uf(t){let e=[...t.graph||[],...t.accessories||[]].filter(r=>Number(r.which)===zi),i=[],n=e.map((r,o)=>{let a=r.script?.mapping||{},s=Number(r.id?.id)||0;s<=0&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04\u7F3A\u5C11 GraphUnit.id.id\uFF0C\u5DF2\u6309 0 \u5904\u7406\uFF08\u5BFC\u51FA\u65F6\u4F1A\u91CD\u65B0\u5206\u914D\uFF09\u3002`);let l=Number(a.id)||0;return l&&l!==s&&i.push(`\u7B2C ${o+1} \u6761\u811A\u672C\u6620\u5C04 id(${l}) \u4E0E\u5355\u5143 id(${s}) \u4E0D\u4E00\u81F4\uFF0C\u4EE5\u5355\u5143 id \u4E3A\u51C6\u3002`),{guid:s,path:String(a.filePath||""),source:String(a.source||"")}});for(let[r,o]of n.entries())o.path&&!/\.lua$/iu.test(o.path)&&i.push(`\u7B2C ${r+1} \u6761\u811A\u672C\u6620\u5C04 file_path \u7F3A\u5C11 .lua \u540E\u7F00\uFF08${o.path}\uFF09\uFF0C\u771F\u673A\u53EF\u80FD\u62D2\u7EDD\u5BFC\u5165\uFF1B\u6A21\u62DF\u5668\u5185\u6309\u5F52\u4E00\u5316\u8DEF\u5F84\u7167\u5E38 require\u3002`);return{scripts:n,warnings:i}}function Yf(t){let e=Va(t),i=Uf(e);if(!i.scripts.length)throw new Error("GIA \u5185\u6CA1\u6709\u811A\u672C\u6620\u5C04\u5355\u5143\uFF08which=69\uFF09");return{scripts:i.scripts,warnings:i.warnings,metadata:{assetType:"lua-script"}}}function L1(t){let e=[],i;try{i=Va(t)}catch(r){return{valid:!1,errors:[r?.message||String(r)],scriptCount:0}}let n=i.graph||[];return n.length||e.push("Root.graph \u4E3A\u7A7A"),(i.accessories||[]).length&&e.push("script.gia \u4E0D\u5E94\u5305\u542B accessories"),n.forEach((r,o)=>{let a=`\u5355\u5143 ${o+1}`;Number(r.which)!==zi&&e.push(`${a}: which \u5E94\u4E3A 69\uFF0C\u5B9E\u9645 ${r.which}`),Number(r.id?.class)!==Bf&&e.push(`${a}: id.class \u5E94\u4E3A 30\uFF0C\u5B9E\u9645 ${r.id?.class}`),Number(r.id?.type??0)!==0&&e.push(`${a}: id.type \u5E94\u7F3A\u7701`);let s=r.script?.mapping;if(!s){e.push(`${a}: \u7F3A\u5C11 field35 ScriptMappingWrapper`);return}dt(r.id?.id)||e.push(`${a}: GraphUnit.id.id \u975E\u6CD5\uFF08\u5141\u8BB8 0x40000000\u20130x403FFFFF\uFF09`),Number(s.id)!==Number(r.id?.id)&&e.push(`${a}: mapping.id \u5E94\u7B49\u4E8E GraphUnit.id.id`),String(s.name||"")!==String(r.name||"")&&e.push(`${a}: mapping.name \u5E94\u7B49\u4E8E GraphUnit.name`),String(s.filePath||"").trim()?/\.lua$/iu.test(String(s.filePath))||e.push(`${a}: file_path \u5E94\u4EE5 .lua \u7ED3\u5C3E\uFF08\u5B98\u65B9 script.gia \u6837\u672C\u5747\u4E3A \u540D\u79F0.lua\uFF0C\u771F\u673A require \u65F6\u624D\u53BB\u6269\u5C55\u540D\uFF09`):e.push(`${a}: file_path \u4E3A\u7A7A`)}),{valid:e.length===0,errors:e,scriptCount:n.length}}function Qr(t){let e=Buffer.isBuffer(t)?t:Buffer.from(t);if(e.length<yi+Pa)throw new Error("GIA \u6587\u4EF6\u8FC7\u77ED");if(e.readUInt32BE(4)!==1||e.readUInt32BE(8)!==Rf||e.readUInt32BE(12)!==3)throw new Error("\u4E0D\u662F\u53D7\u652F\u6301\u7684 GIA v1 \u6587\u4EF6");let i=e.readUInt32BE(16);if(i!==e.length-yi-Pa)throw new Error("GIA payload \u957F\u5EA6\u4E0D\u4E00\u81F4");if(e.readUInt32BE(yi+i)!==Nf)throw new Error("GIA \u5C3E\u6807\u8BB0\u65E0\u6548");return e.subarray(yi,yi+i)}function Ke(t,e){return t.ui?.content?.data?.find(i=>i.details?.[e])?.details?.[e]||null}function j1(t){let e=t.ui?.content?.data?.find(o=>o.field501===66&&o.field502===89||Object.hasOwn(o.details||{},"templateRefSlot")),i=Buffer.from(e?.details?.templateRefSlot||[]),n=i.toString("utf8"),r=Buffer.from(n,"utf8").equals(i)&&!/[\u0000-\u001f\u007f-\u009f]/u.test(n);return{referencedPrefabId:r?n:"",raw:{templateRefSlot:r?n:"",...r?{}:{templateRefSlotBase64:i.toString("base64")},...e?.empty76?.length?{templateRefOuterBase64:Buffer.from(e.empty76).toString("base64")}:{}}}}function U1(t){let e=Ke(t,"transform")?.multiPlatform,i={};for(let r of e?.platforms||[]){let o=N1[r.platformType||0],a=r.transform||{};i[o]={scale:a.scale?{x:a.scale.x??0,y:a.scale.y??0,z:a.scale.z??0}:{x:1,y:1,z:1},rotation:{x:a.field508?.x??0,y:a.field508?.y??0,z:a.field508?.z??0},anchorMin:{x:a.anchorMin?.x??0,y:a.anchorMin?.y??0},anchorMax:{x:a.anchorMax?.x??0,y:a.anchorMax?.y??0},offset:{x:a.offset?.x??0,y:a.offset?.y??0},size:{x:a.size?.x??0,y:a.size?.y??0},pivot:a.pivot?{x:a.pivot.x??0,y:a.pivot.y??0}:{x:.5,y:.5}}}let n=i.KEYBOARD||i[Object.keys(i)[0]];if(!n)throw new Error(`GIA \u63A7\u4EF6 ${t.name||t.id?.id} \u7F3A\u5C11\u591A\u5E73\u53F0\u53D8\u6362`);for(let r of Le)i[r]||(i[r]=structuredClone(n));return i}function Zr(t){let e=t.ui?.content?.data||[];return e.some(i=>i.details?.textConfig)?e.some(i=>i.field501===71)?"textwindow":"textbox":e.some(i=>i.details?.cursorConfig)?"cursor":e.some(i=>Object.hasOwn(i.details||{},"templateRefSlot")||i.field501===66&&i.field502===89)?"reference":e.some(i=>i.details?.gridView)?"grid":e.some(i=>i.details?.buttonPreset)?"button":e.some(i=>i.details?.keyHint)?"keyhint":e.some(i=>i.details?.image||i.details?.imageSlot)?"image":e.some(i=>Object.hasOwn(i.details||{},"effectSlot"))?"animation":e.some(i=>Object.hasOwn(i.details||{},"fullscreenEffectSlot"))?"fullscreen":(e.some(i=>Object.hasOwn(i.details||{},"containerNodeSlot")),"container")}function Of(t,{reverseSiblings:e=!1,idOffset:i=0}={}){if(!t.length)return{nodes:new Map,rootCandidates:[],warnings:[]};let n=new Map(t.map((c,f)=>[c.id?.id,`n${i+f+1}`])),r=new Map,o=new Map,a=[];for(let c of t){let f=Zr(c),h=Ke(c,"textConfig"),m=Ke(c,"imageSlot"),p=Ke(c,"image"),b=Ke(c,"buttonPreset"),g=Ke(c,"gridView"),w=Ke(c,"genericSlot"),S=Ke(c,"footerSlot"),_=Ke(c,"cursorConfig"),G=Ke(c,"keyHint"),I=Ke(c,"containerNodeSlot"),$=f==="reference"?j1(c):null,V=Ke(c,"effectSlot"),Y=Ke(c,"fullscreenEffectSlot"),q=xe(f,{id:n.get(c.id?.id),guid:c.id?.id||0,giaInfoIndex:(c.ui?.content?.info||[]).find(x=>x.field501===2&&x.field502===6)?.index?.value,giaRelatedGuids:(c.ui?.content?.info||[]).find(x=>x.field501===4&&x.field502===4)?.related?.value||[],name:c.name||f,visible:Ke(c,"field14")?.field17?.initiallyHidden!==!0,active:Ke(c,"field14")?.initiallyInactive!==!0,canControllerFocus:S?.field505===1,scriptMappingIds:(w?.field502||[]).map(x=>Number(x?.field1?.id)).filter(x=>Number.isSafeInteger(x)&&x>0),transformByPlatform:U1(c),syncAllDevices:Ke(c,"transform")?.multiPlatform?.field504===1,giaRaw:{genericField501:w?.field501??0,footerField505:S?.field505??0,...f==="textbox"||f==="textwindow"?{textField501:h?.field501??20,textField503:h?.field503??12,textAlign:h?.align??0,...[void 0,0,1,2].includes(h?.verticalAlign)?{}:{textVerticalAlign:h.verticalAlign},...f==="textwindow"?{textField511:h?.field511??1,textViewField502:h?.viewFlags?.field502??1,textViewField503:h?.viewFlags?.field503??1}:{}}:{},...f==="cursor"?{cursorField501:_?.field501??0}:{},...$?.raw||{},...f==="grid"?{gridField501:g?.field501??1,gridField507:g?.field507??1,gridField508:g?.field508??1,gridField509:g?.field509??1,gridField511:g?.field511??5,gridField512:g?.field512??1}:{},...f==="keyhint"?{keyHintField501:G?.field501??1,keyHintField502:G?.field502??1}:{},...f==="image"?{imageSlotType:m?.imageType??0,imageField502:p?.field502??1,imageField504:p?.field504??1,imageField505:p?.field505??1,imageField507:p?.field507??2,imageFillType:p?.fillType??1}:{},...f==="animation"?{effectSlot:V??""}:{},...f==="fullscreen"?{fullscreenEffectSlot:Y??""}:{}},...f==="container"?{isolateNavigation:I?.isolateNavigation===!0,disableKeyEventPassthrough:I?.disableKeyEventPassthrough===!0,disableCursorEventPassthrough:I?.disableCursorEventPassthrough===!0,showCursor:I?.showCursor===!0}:{},...f==="cursor"?{raycastTarget:_?.field501===1}:{},...f==="textbox"||f==="textwindow"?{text:h?.text?.value??"",fontSize:h?.fontSize??20,minimumFontSize:h?.minimumFontSize??20,adaptiveFontSize:h?.adaptive===1,fontColor:h?.color??4294967295,bgColor:h?.color2??0,enableOutline:h?.outlineOff!==1,outlineColor:h?.color3??858993459,horizontalAlignment:h?.align===1?"Middle":h?.align===2?"Right":"Left",verticalAlignment:{0:"Top",1:"Middle",2:"Bottom"}[h?.verticalAlign??0]||"Top",...f==="textwindow"?{interactable:!0,showScrollBar:!0}:{}}:{},...f==="image"?{imageSource:"StaticReference",imageId:m?.assetId??0,imageType:m?.imageType===1?"Stretch":"Basic",imageColor:Number.isFinite(m?.field502)?m.field502>>>0:4294967295,enableMask:p?.enableMask===1,enableSoftEdge:p?.enableSoftEdge===1,enableFill:p?.enableFill===1,softEdgeMode:p?.softEdgePixel===1?"Pixel":"Percentage",softEdgeWidthX:p?.border?.field501??8,softEdgeWidthY:p?.border?.field502??8,horizontalSoftRange:p?.field512??85,verticalSoftRange:p?.field513??85,fillType:{1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[p?.fillType]||"Horizontal",fillAmount:Number.isFinite(p?.field508)?Math.max(0,Math.min(1,p.field508/100)):p?.enableFill===1?0:1,reverseMaskArea:p?.reverseMask===1}:{},...f==="button"?{interactable:b?.interactable===1,raycastTarget:b?.raycastTarget===1,clickAudioId:b?.clickAudioId??50888}:{},...f==="grid"?{cellSizeX:g?.cellSize?.field501??50,cellSizeY:g?.cellSize?.field502??50,spacingX:g?.gap?.field501??8,spacingY:g?.gap?.field502??8,padding1X:g?.padding1?.field501??20,padding1Y:g?.padding1?.field502??20,padding2X:g?.padding2?.field501??20,padding2Y:g?.padding2?.field502??20,previewCount:g?.field511??5}:{},...$?{referencedPrefabId:$.referencedPrefabId}:{},...f==="keyhint"?{keyboardKeyCode:G?.field502??null,controllerKeyCode:G?.field501??null}:{},...f==="animation"?{animationId:V??""}:{},...f==="fullscreen"?{animationId:Y??""}:{}});r.set(c.id?.id,q),($?.raw.templateRefSlotBase64||$?.raw.templateRefOuterBase64)&&a.push(`${q.name}: \u6A21\u677F\u5F15\u7528\u914D\u7F6E\u542B\u5C1A\u672A\u89E3\u6790\u7684\u4E8C\u8FDB\u5236\u5B57\u6BB5\uFF0C\u5DF2\u539F\u6837\u4FDD\u5B58\uFF1B\u5F15\u7528\u76EE\u6807\u672A\u63A8\u65AD\uFF0C\u9884\u89C8\u4E0D\u4F1A\u81EA\u52A8\u5C55\u5F00\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(h?.align)&&a.push(`${q.name}: \u6C34\u5E73\u5BF9\u9F50\u679A\u4E3E ${h.align} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),(f==="textbox"||f==="textwindow")&&![void 0,0,1,2].includes(h?.verticalAlign)&&a.push(`${q.name}: \u5782\u76F4\u5BF9\u9F50\u679A\u4E3E ${h.verticalAlign} \u7684\u542B\u4E49\u672A\u77E5\uFF0C\u5DF2\u539F\u6837\u4FDD\u7559\u3002`),f==="image"&&![void 0,0,1,2,3,4,5].includes(p?.fillType)&&a.push(`${q.name}: \u586B\u5145\u5F62\u72B6\u679A\u4E3E ${p.fillType} \u672A\u8BC6\u522B\uFF0C\u5DF2\u4FDD\u7559\u539F\u503C\u3002`),f==="button"&&o.set(q.id,{unavailableChildId:b?.disabledChild,hoverChildId:b?.hoverChild,pressedChildId:b?.pressedChild,selectedChildId:b?.selectedChild})}let s=[],l=new Set;for(let c of t){let f=r.get(c.id?.id),h=(c.ui?.content?.children||[]).map(m=>r.get(m)).filter(Boolean);if(h.length){f.children=e?h.slice().reverse():h;for(let m of h)l.add(m.id)}}for(let c of t){let f=r.get(c.id?.id),h=c.ui?.content?.parent||0,m=r.get(h);m?l.has(f.id)||(e?m.children.unshift(f):m.children.push(f)):s.push(f)}for(let[c,f]of o){let h=[...r.values()].find(m=>m.id===c);for(let[m,p]of Object.entries(f))h[m]=n.get(p)||null}return{nodes:r,rootCandidates:s,warnings:a}}function Hf(t){let e=Qr(t),i=kt.toObject(kt.decode(e),{longs:Number,enums:Number,bytes:Buffer,defaults:!1,arrays:!0,objects:!0}),n=[...i.graph||[],...i.accessories||[]],r=S=>!!S.ui?.content&&[15,21,70].includes(Number(S.which)),o=(i.graph||[]).filter(r);if(!o.some(S=>S.ui?.content))throw new Error("GIA \u4E0D\u542B\u53EF\u8BC6\u522B\u7684 UIControlGroup \u4E3B\u56FE");let a=o.find(S=>S.which===21)||null,s=o.filter(S=>Number(S.which)===70),l=(i.accessories||[]).filter(r),c=new Set((a?.relatedIds||[]).map(S=>S.id||0)),f=a?c.size?l.filter(S=>c.has(S.id?.id||0)):l:[],h=s.length?[...s,...l.filter(S=>!c.has(S.id?.id||0))]:a?[]:[...o,...l];if(!f.length&&!h.length)throw new Error("GIA \u4E0D\u542B\u5BA2\u6237\u7AEF\u63A7\u4EF6");let m=["GIA \u5BFC\u5165\u4E3A\u5DF2\u9A8C\u8BC1 UI \u5B57\u6BB5\u7684\u8BED\u4E49\u5BFC\u5165\uFF1B\u672A\u77E5 protobuf \u5B57\u6BB5\u4E0D\u4F1A\u8FDB\u5165 Authoring JSON\u3002"],p=n.filter(S=>!r(S)&&Number(S.which)!==zi);p.length&&m.push(`\u8DF3\u8FC7 ${p.length} \u4E2A\u975E UI / \u975E\u811A\u672C\u4F9D\u8D56\u5355\u5143\uFF1B\u8FD9\u4E9B\u8D44\u6E90\u4E0D\u4F1A\u8FDB\u5165\u5B58\u6863\u6216\u91CD\u65B0\u5BFC\u51FA\u3002`);let b=Uf(i);m.push(...b.warnings);let g=null,w=null;if(f.length){let S=Of(f,{reverseSiblings:!0,idOffset:0});m.push(...S.warnings);let _=S.rootCandidates.find(I=>I.kind==="container")||S.rootCandidates[0];if(!_)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6839\u63A7\u4EF6");let G=xe("server-container",{id:"sc1",guid:a?.id?.id||0,name:a?.name||"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668",giaRelatedGuids:(a?.ui?.content?.info||[]).find(I=>I.field501===4&&I.field502===4)?.related?.value||[]});G.children=[_],S.rootCandidates.length>1&&m.push(`\u68C0\u6D4B\u5230 ${S.rootCandidates.length} \u4E2A\u65E0\u7236\u8282\u70B9\u63A7\u4EF6\uFF0C\u4EC5\u5BFC\u5165\u4EE5\u201C${_.name}\u201D\u4E3A\u6839\u7684\u6811\u3002`),g={version:1,layoutSchemaVersion:Ze,meta:{name:a?.name||"\u5BFC\u5165\u7684\u754C\u9762\u63A7\u4EF6\u7EC4",assetType:"server-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:_.id,script:{controlId:_.id,path:"",source:""},root:G}}if(h.length){let S=Of(h,{reverseSiblings:!1,idOffset:1e3});if(m.push(...S.warnings),!S.rootCandidates.length)throw new Error("GIA \u672A\u627E\u5230\u5BA2\u6237\u7AEF\u6A21\u677F");let _=xe("server-container",{id:"sc1",guid:0,name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"});_.children=S.rootCandidates,w={version:1,layoutSchemaVersion:Ze,meta:{name:S.rootCandidates.length===1?S.rootCandidates[0].name:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868",assetType:"client-control-template",sourceFormat:"gia",sourceFile:"",gameVersion:i.gameVersion||"",giaFilePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{giaModeFlag:Number(i.modeFlag)}:{}},canvasId:"pc-16-9",selectedId:S.rootCandidates[0].id,script:{controlId:S.rootCandidates[0].id,path:"",source:""},root:_},Yt(w,{warnings:m});for(let G of S.rootCandidates)be(G,I=>I.children.reverse());g||(g=w)}return{project:g,clientProject:w&&g!==w?w:void 0,scripts:b.scripts,warnings:m,metadata:{gameVersion:i.gameVersion||"",filePath:i.filePath||"",...Number.isSafeInteger(Number(i.modeFlag))?{modeFlag:Number(i.modeFlag)}:{},combined:!!(a&&s.length)}}}function Ba(t){let e=Qr(t),i=kt.toObject(kt.decode(e),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),n=i.graph||[],r=i.accessories||[],o=[],a=(p,b)=>p!=null&&Object.prototype.hasOwnProperty.call(p,b),s=new Map,l=[];/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||o.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`);let c=n.filter(p=>p.which===70).map(p=>{let b=Zr(p),g=p.ui?.content?.info||[],w=g.find(G=>G.field501===2&&G.field502===6)?.index?.value,S=g.find(G=>G.field501===4&&G.field502===4),_=S?.related?.value||[];return ht(w)||o.push(`${p.name}: Info.index=${w??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`),S||o.push(`${p.name}: \u9876\u5C42 UIControlTemplate \u7F3A\u5C11 Info.related \u8BB0\u5F55`),{id:p.id?.id||0,name:p.name||"",kind:b,actualIndex:w,relatedPresent:!!S,relatedGuids:_}}),f=new Map;for(let p of c){if(!ht(p.actualIndex))continue;let b=f.get(p.actualIndex);b?o.push(`${p.name}: \u72EC\u7ACB\u6A21\u677F\u8D44\u4EA7\u7F16\u53F7 ${p.actualIndex} \u4E0E ${b.name} \u91CD\u590D`):f.set(p.actualIndex,p)}c.length||o.push("Root.graph \u4E0D\u542B UIControlTemplate(70)");let h=0,m=0;for(let p of[...n,...r]){if(!p.ui?.content)continue;let b=p.id?.id||0,g=p.ui.content,w=Zr(p),S=n.includes(p)&&p.which===70,_=`${p.name||"<unnamed>"}(${b||"<missing-guid>"})`;dt(b)?s.has(b)?o.push(`${_}: GUID \u4E0E ${s.get(b).name||"<unnamed>"} \u91CD\u590D`):s.set(b,p):o.push(`${_}: GraphUnit GUID \u975E\u6CD5\uFF08\u5141\u8BB8 0x40000000\u20130x403FFFFF\uFF09`),(p.id?.class!==1||p.id?.type!==8)&&o.push(`${_}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),g.guid!==b&&o.push(`${_}: content.guid=${g.guid??"<missing>"} \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`),S&&p.which!==70&&o.push(`${_}: \u6A21\u677F\u6839 which \u5FC5\u987B\u4E3A UIControlTemplate(70)`),!S&&p.which!==15&&o.push(`${_}: \u9644\u4EF6\u63A7\u4EF6 which \u5FC5\u987B\u4E3A UIControl(15)`);let G=g.info||[],I=G.find(E=>E.field501===1&&E.field502===5),$=G.find(E=>E.field501===2&&E.field502===6);I?.guid?.value!==b&&o.push(`${_}: Info.self GUID \u7F3A\u5931\u6216\u4E0E\u81EA\u8EAB\u4E0D\u4E00\u81F4`),ht($?.index?.value)||o.push(`${_}: Info.index=${$?.index?.value??"<missing>"}\uFF0C\u5FC5\u987B\u662F\u6B63\u6574\u6570`);let V=G.find(E=>E.field501===4&&E.field502===4);S&&!V&&o.push(`${_}: \u9876\u5C42\u6A21\u677F\u7F3A\u5C11 Info.related \u8BB0\u5F55`),!S&&V&&o.push(`${_}: \u9644\u4EF6\u63A7\u4EF6\u4E0D\u5E94\u5199 Info.related`);let Y=Ff[w],q=g.data||[],x=q.map(E=>`${E.field501}/${E.field502}`),O=Y?.map(([E])=>E)||[];Y?JSON.stringify(x)!==JSON.stringify(O)&&o.push(`${_}: Data \u69FD\u4F4D\u987A\u5E8F ${x.join(",")}\uFF0C\u5E94\u4E3A ${O.join(",")}`):o.push(`${_}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${w}`);for(let E=0;E<Math.min(q.length,Y?.length||0);E+=1){let M=q[E],[j,H,Z]=Y[E];if(a(M,H)||o.push(`${_}: Data ${j} \u7F3A\u5C11 ${H} \u5206\u652F`),!Z)continue;a(M.details,Z)||o.push(`${_}: Details ${j} \u7F3A\u5C11 ${Z} \u5206\u652F`);let ue=Mf[j];(M.details?.field501!==ue||M.details?.field502!==M.field502||M.details?.field503!==1)&&o.push(`${_}: Details ${j} \u6807\u8BB0\u5E94\u4E3A ${ue}/${M.field502}/1`);let we=M.details?.nodeRef;(we?.class!==1||we?.type!==8||we?.id!==b)&&o.push(`${_}: Details ${j} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let y=(p.ui.content.data||[]).find(E=>E.field501===4&&E.field502===86);y&&(a(y.field14,"field17")?h+=1:o.push(`${_}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`),a(y.details?.field14,"field17")?h+=1:o.push(`${_}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.field17 \u7A7A\u4E32`));let P=(p.ui.content.data||[]).find(E=>E.details?.transform)?.details?.transform?.multiPlatform?.platforms||[];P.length!==4&&o.push(`${_}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${P.length}\uFF0C\u5E94\u4E3A 4`);let A=P.map(E=>E.platformType||0);JSON.stringify(A)!==JSON.stringify([0,1,2,3])&&o.push(`${_}: \u5E73\u53F0\u987A\u5E8F ${A.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let u=(p.ui.content.data||[]).find(E=>E.details?.transform)?.details?.transform;u?.multiPlatform?.field502!==Bn[w]&&o.push(`${_}: \u53D8\u6362 preset=${u?.multiPlatform?.field502??"<missing>"}\uFF0C${w} \u5E94\u4E3A ${Bn[w]}`);for(let E of P)a(E.transform,"field508")?m+=1:o.push(`${_}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);l.push({id:b,name:p.name||"",kind:w,template:S,parent:g.parent||0,children:[...g.children||[]],relatedIds:(p.relatedIds||[]).map(E=>E.id||0),dataSignatures:x})}for(let p of l){let b=`${p.name||"<unnamed>"}(${p.id})`;if(JSON.stringify(p.relatedIds)!==JSON.stringify(p.children)&&o.push(`${b}: GraphUnit.relatedIds \u4E0E content.children \u4E0D\u4E00\u81F4`),p.template&&p.parent&&o.push(`${b}: \u9876\u5C42\u6A21\u677F\u4E0D\u5E94\u6709 parent`),!p.template){let g=s.get(p.parent);g?(g.ui?.content?.children||[]).includes(p.id)||o.push(`${b}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):o.push(`${b}: parent=${p.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let g of p.children){let w=s.get(g);w?(w.ui?.content?.parent||0)!==p.id&&o.push(`${b}: child=${g} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):o.push(`${b}: child=${g} \u4E0D\u5B58\u5728`)}}return{valid:o.length===0,errors:o,filePath:i.filePath||"",gameVersion:i.gameVersion||"",templateCount:c.length,accessoryCount:r.length,templates:c,units:l,explicitEmpty:{field17:h,rectField508:m}}}function qa(t){let e=Qr(t),i=kt.toObject(kt.decode(e),{longs:Number,enums:Number,defaults:!1,arrays:!0,objects:!0}),n=(i.graph||[]).filter(u=>u.ui?.content&&Number(u.which)===21),r=(i.graph||[]).filter(u=>Number(u.which)===70),o=(i.graph||[]).filter(u=>Number(u.which)===zi),a=(i.accessories||[]).filter(u=>u.ui?.content),s=[],l=(u,E)=>u!=null&&Object.prototype.hasOwnProperty.call(u,E);/^\d+-\d+-\d+-\\.+\.gia$/iu.test(i.filePath||"")||s.push(`Root.filePath \u4E0D\u662F UID-TIME-ID-\\\u6587\u4EF6\u540D.gia\uFF1A${i.filePath||"<missing>"}`),n.length!==1&&s.push(`\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F UIControlGroup \u6570\u91CF=${n.length}\uFF0C\u5E94\u4E3A 1`);let c=(i.graph||[]).filter(u=>{let E=Number(u.which);return E===zi||E===70||E===21?!1:!u.ui?.content});c.length&&s.push(`Root.graph \u542B ${c.length} \u4E2A\u65E0\u6CD5\u8BC6\u522B\u7684\u975E\u63A7\u4EF6/\u975E\u811A\u672C\u5355\u5143`);let f=n[0];if(!f)return{valid:!1,errors:s,filePath:i.filePath||"",gameVersion:i.gameVersion||"",accessoryCount:a.length,controls:[],scriptCount:o.length,explicitEmpty:{field17:0,rectField508:0}};let h=[f,...r,...a],m=new Map;for(let u of h){let E=u.id?.id||0,M=`${u.name||"<unnamed>"}(${E||"<missing-guid>"})`;dt(E)?m.has(E)?s.push(`${M}: GUID \u91CD\u590D`):m.set(E,u):s.push(`${M}: GraphUnit GUID \u975E\u6CD5\uFF08\u5141\u8BB8 0x40000000\u20130x403FFFFF\uFF09`),(u.id?.class!==1||u.id?.type!==8)&&s.push(`${M}: GraphUnit.id \u5FC5\u987B\u4E3A class=1,type=8`),u.ui?.content?.guid!==E&&s.push(`${M}: content.guid \u4E0E GraphUnit.id.id \u4E0D\u4E00\u81F4`)}let p=f.id?.id||0,b=f.ui.content,g=`${f.name||"<unnamed>"}(${p})`;f.which!==21&&s.push(`${g}: which \u5FC5\u987B\u4E3A UIControlGroup(21)`);let w=b.info||[];w.find(u=>u.field501===1&&u.field502===5)?.guid?.value!==p&&s.push(`${g}: Info.self GUID \u7F3A\u5931\u6216\u4E0D\u4E00\u81F4`),w.find(u=>u.field501===2&&u.field502===6)?.index?.value!==1&&s.push(`${g}: Info.index \u5FC5\u987B\u4E3A 1`);let S=w.find(u=>u.field501===4&&u.field502===4);S||s.push(`${g}: \u7F3A\u5C11\u663E\u5F0F Info.related \u8BB0\u5F55`);let _=0,G=0,I=(u,E,M,j=!1)=>{let H=u.id?.id||0,Z=`${u.name||"<unnamed>"}(${H})`,ue=u.ui.content.data||[],we=ue.map(Re=>`${Re.field501}/${Re.field502}`),Se=M.map(([Re])=>Re);JSON.stringify(we)!==JSON.stringify(Se)&&s.push(`${Z}: Data \u69FD\u4F4D\u987A\u5E8F ${we.join(",")}\uFF0C\u5E94\u4E3A ${Se.join(",")}`);for(let Re=0;Re<Math.min(ue.length,M.length);Re+=1){let ft=ue[Re],[ut,me,T]=M[Re];if(l(ft,me)||s.push(`${Z}: Data ${ut} \u7F3A\u5C11 ${me} \u5206\u652F`),!T)continue;l(ft.details,T)||s.push(`${Z}: Details ${ut} \u7F3A\u5C11 ${T} \u5206\u652F`);let k=Mf[ut];(ft.details?.field501!==k||ft.details?.field502!==ft.field502||ft.details?.field503!==1)&&s.push(`${Z}: Details ${ut} \u6807\u8BB0\u5E94\u4E3A ${k}/${ft.field502}/1`);let N=ft.details?.nodeRef;(N?.class!==1||N?.type!==8||N?.id!==H)&&s.push(`${Z}: Details ${ut} node_ref \u672A\u6307\u5411\u81EA\u8EAB`)}let pe=ue.find(Re=>Re.field501===4&&Re.field502===(j?23:86)),Q=j?"empty15":"field17";l(pe?.field14,Q)?j||(_+=1):s.push(`${Z}: \u7C7B\u578B Data \u7F3A\u5C11\u663E\u5F0F Field14.${Q} \u7A7A\u4E32`),l(pe?.details?.field14,Q)?j||(_+=1):s.push(`${Z}: \u7C7B\u578B Details \u7F3A\u5C11\u663E\u5F0F Field14.${Q} \u7A7A\u4E32`);let fe=ue.find(Re=>Re.details?.transform)?.details?.transform,_e=fe?.multiPlatform?.platforms||[];_e.length!==4&&s.push(`${Z}: \u591A\u5E73\u53F0\u53D8\u6362\u6570\u91CF=${_e.length}\uFF0C\u5E94\u4E3A 4`);let yt=_e.map(Re=>Re.platformType||0);JSON.stringify(yt)!==JSON.stringify([0,1,2,3])&&s.push(`${Z}: \u5E73\u53F0\u987A\u5E8F ${yt.join(",")}\uFF0C\u5E94\u4E3A 0,1,2,3`);let qt=j?Bn["server-container"]:Bn[E];fe?.multiPlatform?.field502!==qt&&s.push(`${Z}: \u53D8\u6362 preset=${fe?.multiPlatform?.field502??"<missing>"}\uFF0C\u5E94\u4E3A ${qt}`);for(let Re of _e)l(Re.transform,"field508")?G+=1:s.push(`${Z}: RectTransform \u7F3A\u5C11\u663E\u5F0F field508 \u7A7A\u4E32`);return we};I(f,"server-container",P1,!0);let $=(f.relatedIds||[]).map(u=>u.id||0),V=new Set($),Y=a.filter(u=>V.has(u.id?.id||0)),q=Y.map(u=>u.id?.id||0);JSON.stringify($)!==JSON.stringify(q)&&s.push(`${g}: \u4E3B\u56FE relatedIds \u5FC5\u987B\u6309\u987A\u5E8F\u8986\u76D6\u672C\u7EC4 accessories`);let x=b.data?.find(u=>u.details?.rootChildRef)?.details?.rootChildRef?.guid||0,O=m.get(x);(!O||!Y.includes(O))&&s.push(`${g}: 62/82 \u6839\u8282\u70B9\u5F15\u7528\u4E0D\u5B58\u5728`),q[0]!==x&&s.push(`${g}: \u6839\u5BB9\u5668\u8282\u70B9\u5FC5\u987B\u662F\u672C\u7EC4 accessories[0]`);let y=[];for(let u of Y){let E=u.id?.id||0,M=u.ui.content,j=`${u.name||"<unnamed>"}(${E})`,H=Zr(u);u.which!==15&&s.push(`${j}: which \u5FC5\u987B\u4E3A UIControl(15)`);let Z=M.info||[];(Z.length!==1||Z[0]?.field501!==1||Z[0]?.field502!==5||Z[0]?.guid?.value!==E)&&s.push(`${j}: \u670D\u52A1\u7AEF\u5BB9\u5668\u5185\u63A7\u4EF6 Info \u5FC5\u987B\u53EA\u542B\u81EA\u8EAB GUID`);let ue=Ff[H];ue||s.push(`${j}: \u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u7C7B\u578B ${H}`);let we=ue?I(u,H,ue):[];y.push({id:E,name:u.name||"",kind:H,parent:M.parent||0,children:[...M.children||[]],relatedIds:(u.relatedIds||[]).map(Se=>Se.id||0),dataSignatures:we})}let P=y.find(u=>u.id===x);P&&(P.kind!=="container"&&s.push(`${P.name}(${x}): \u6839\u63A7\u4EF6\u5FC5\u987B\u4E3A\u5BB9\u5668\u8282\u70B9`),P.parent&&s.push(`${P.name}(${x}): \u6839\u63A7\u4EF6\u4E0D\u5E94\u6709 parent`));let A=new Map(y.map(u=>[u.id,u]));for(let u of y){let E=`${u.name}(${u.id})`;if(JSON.stringify(u.relatedIds)!==JSON.stringify(u.children)&&s.push(`${E}: relatedIds \u5FC5\u987B\u4E0E\u76F4\u63A5 children \u4E00\u81F4`),u.id!==x){let M=A.get(u.parent);M?M.children.includes(u.id)||s.push(`${E}: \u7236\u63A7\u4EF6 children \u672A\u53CD\u5411\u5305\u542B\u81EA\u8EAB`):s.push(`${E}: parent=${u.parent||"<missing>"} \u4E0D\u5B58\u5728`)}for(let M of u.children){let j=A.get(M);j?j.parent!==u.id&&s.push(`${E}: child=${M} \u7684 parent \u672A\u6307\u56DE\u81EA\u8EAB`):s.push(`${E}: child=${M} \u4E0D\u5B58\u5728`)}}if(r.length){let u=Ba(Ga({...i,graph:r,accessories:a.filter(E=>!V.has(E.id?.id||0))}));s.push(...u.errors.map(E=>`\u5BA2\u6237\u7AEF\u6A21\u677F: ${E}`))}return{valid:s.length===0,errors:s,filePath:i.filePath||"",gameVersion:i.gameVersion||"",graph:{id:p,name:f.name||"",relatedGuids:S?.related?.value||[],rootGuid:x},accessoryCount:a.length,controls:y,scriptCount:o.length,explicitEmpty:{field17:_,rectField508:G}}}function Xf(t,e=[]){if(!t||t.layoutSchemaVersion===Ze)return t;if(t.layoutSchemaVersion!==void 0&&t.layoutSchemaVersion!==1)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=2 \u6216\u53EF\u8FC1\u79FB\u7684\u65E7\u5E03\u5C40\uFF0C\u6536\u5230 ${t.layoutSchemaVersion}`);if(!t.root)return{...t,layoutSchemaVersion:Ze};let i=structuredClone(t),n=0;return be(i.root,r=>{let o=r.transformByPlatform||{},a=r.transformByCanvas||{},s=r.name||r.id;for(let c of Object.keys(o))if(!Le.includes(c))throw new Error(`${s}: unknown platform ${c}`);let l={};for(let c of Le){let f=Hi[c],h=Pe[f].platform,m=Object.keys(Pe).filter(w=>Pe[w].platform===h&&a[w]),p=a[f]?f:m[0],b=c==="CONTROLLER_CONSOLE"?l.KEYBOARD:c==="CONTROLLER_MOBILE"?l.TOUCHSCREEN:null,g=o[c]??b??(p?a[p]:null);if(l[c]=g?Nt(g):Ro(r.kind),g||e.push(`${s}: ${c} \u65E0\u65E7\u5E03\u5C40\uFF0C\u5DF2\u4F7F\u7528\u63A7\u4EF6\u9ED8\u8BA4\u503C`),!o[c]&&!b&&p&&p!==f&&e.push(`${s}: \u7F3A\u5C11 ${f}\uFF0C\u5DF2\u91C7\u7528 ${p} \u7684\u951A\u70B9\u548C\u5C3A\u5BF8\u53C2\u6570`),!b)for(let w of m)JSON.stringify(l[c])!==JSON.stringify(Nt(a[w]))&&e.push(`${s}: ${w} \u4E0E ${c} \u5E03\u5C40\u51B2\u7A81\uFF0C\u4FDD\u7559${o[c]?"\u5DF2\u6709\u5E73\u53F0":p}\u53C2\u6570`)}ni(l,`${s}.transformByPlatform`),r.transformByPlatform=l,delete r.transformByCanvas,n++}),i.layoutSchemaVersion=Ze,e.unshift(`\u5DF2\u81EA\u52A8\u8FC1\u79FB\u65E7\u5E03\u5C40\uFF1A${n} \u4E2A\u63A7\u4EF6\u8F6C\u6362\u4E3A\u56DB\u5E73\u53F0\u53C2\u6570\uFF1B\u518D\u6B21\u4FDD\u5B58\u5C06\u4F7F\u7528\u65B0\u7248\u683C\u5F0F`),i}function La(t){if(![1,2,3,4].includes(t))throw new Error(`\u4EC5\u652F\u6301 version=1\u20134 \u7684\u5B58\u6863\uFF0C\u6536\u5230 ${t}`)}function Ua(t,e,i,n=t.canvasId){let r=oi(t.root,e);return!r||r.kind==="server-container"?Qe(n):i[r.id]||Qe(n)}function vi(t,{warnings:e=[]}={}){if(!t)return Ai();if(t=Xf(t,e),(t.root||t.layoutSchemaVersion!==void 0)&&t.layoutSchemaVersion!==Ze)throw new Error(`\u4EC5\u652F\u6301 layoutSchemaVersion=${Ze} \u7684\u56DB\u5E73\u53F0\u5E03\u5C40\uFF0C\u4E0D\u652F\u6301\u65E7\u753B\u5E03\u5E03\u5C40\u6216\u5176\u4ED6\u7248\u672C`);let i=t.meta?.assetType==="client-control-template"?"client-control-template":"server-control-template",n=i==="client-control-template"?en():Ai(),r={layoutSchemaVersion:Ze,version:Number.isSafeInteger(t.version)&&t.version>0?t.version:1,meta:{name:String(t.meta?.name||n.meta.name),assetType:i,sourceFormat:String(t.meta?.sourceFormat||n.meta.sourceFormat),sourceFile:String(t.meta?.sourceFile||""),...t.meta?.gameVersion?{gameVersion:String(t.meta.gameVersion)}:{},...t.meta?.giaFilePath?{giaFilePath:String(t.meta.giaFilePath)}:{},...Number.isSafeInteger(Number(t.meta?.giaOwnerUid))?{giaOwnerUid:Number(t.meta.giaOwnerUid)}:{},...Number.isSafeInteger(Number(t.meta?.giaTimestamp))?{giaTimestamp:Number(t.meta.giaTimestamp)}:{},...Number.isSafeInteger(Number(t.meta?.giaFileId))?{giaFileId:Number(t.meta.giaFileId)}:{},...t.meta?.giaFileName?{giaFileName:String(t.meta.giaFileName)}:{},...Number.isSafeInteger(t.meta?.giaNextAssetIndex)&&t.meta.giaNextAssetIndex>=2?{giaNextAssetIndex:t.meta.giaNextAssetIndex}:{},...Number.isSafeInteger(t.meta?.giaAssetIndexSchemaVersion)&&t.meta.giaAssetIndexSchemaVersion>0?{giaAssetIndexSchemaVersion:t.meta.giaAssetIndexSchemaVersion}:{},...Number.isSafeInteger(Number(t.meta?.giaModeFlag))&&Number(t.meta.giaModeFlag)>=0?{giaModeFlag:Number(t.meta.giaModeFlag)}:{}},canvasId:t.canvasId&&Pe[t.canvasId]?t.canvasId:cr,selectedId:t.selectedId||n.selectedId,root:Fo(t.root||n.root)};return Qf(r),Yt(r,{warnings:e}),r}function Qf(t){let e=new Set;be(t.root,i=>{if(typeof i.id!="string"||!i.id)throw new Error("node id must be a non-empty string");if(e.has(i.id))throw new Error(`duplicate node id: ${i.id}`);e.add(i.id)}),e.has(t.selectedId)||(t.selectedId=Po(t.root).id)}function Kf(t){return ri(Qi(t))}function Y1(t,e){let i=!1;return be(t,n=>{n.id===e&&(i=!0)}),i}function H1(t,e,i,n){let o=si(t.root,t.canvasId).boxes[e.id],a=i.children.findIndex(h=>h.id===e.id);if(a<0)throw new Error("reparent: source node is not attached");if(i.children.splice(a,1),n.children.push(e),!o)return;let s=si(t.root,t.canvasId),l=n.kind==="server-container"?Qe(t.canvasId):s.boxes[n.id]||Qe(t.canvasId),c=ai(e.transformByPlatform,t.canvasId),f=xi(l,c,{posX:o.centerX,posY:o.centerY,width:o.width,height:o.height});bn(t,e,f)}function X1(t,e){return t.meta.assetType!=="client-control-template"?Go(t.root,e):(t.root.children||[]).flatMap(i=>Go(i,e))}function eu(t,e){let i=xl(t.root,e);if(t.meta.assetType!=="client-control-template")return i;let n=kn(t),r=new Set;return n&&n.kind!=="server-container"&&be(n,o=>r.add(o.id)),i.filter(o=>r.has(o.id))}function Ya(t){let{canvas:e,boxes:i}=si(t.root,t.canvasId),n=Ln(t,new Set,{preserveLegacy:!0}),r=Ye(t.root,t.selectedId),o=r?i[r.id]:null;return ie({layoutSchemaVersion:Ze,version:t.version,meta:{...t.meta},canvasId:t.canvasId,canvas:{id:t.canvasId,width:e.width,height:e.height,platform:Pe[t.canvasId].platform,label:Pe[t.canvasId].label,presets:Object.values(Pe).map(a=>({id:a.id,label:a.label,width:a.width,height:a.height,platform:a.platform}))},selectedId:t.selectedId,asset:{type:t.meta.assetType,label:t.meta.assetType==="client-control-template"?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F",templateCount:t.meta.assetType==="client-control-template"?t.root.children.length:1,currentTemplateId:t.meta.assetType==="client-control-template"&&kn(t)?.id||""},tree:X1(t,n),boxes:eu(t,i),inspector:_l(r,t.canvasId,o||e,n),root:t.root})}function bn(t,e,i){let n=si(t.root,t.canvasId),r=Ua(t,e.id,n.boxes),o={};if(e.syncAllDevices!==!1)for(let a of Le){if(a===_i(t.canvasId))continue;let s=Hi[a],l=si(t.root,s,a);o[a]=Ua(t,e.id,l.boxes,s)}e.transformByPlatform=sl({transformByPlatform:e.transformByPlatform,source:i,canvasId:t.canvasId,syncAllDevices:e.syncAllDevices!==!1,sourceParentBox:r,targetParentBoxByPlatform:o})}var K1=new Set(["name","active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","fontSize","adaptiveFontSize","minimumFontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","text","imageSource","imageType","imageId","imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","enableFill","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount","reverseMaskArea","raycastTarget","interactable","clickAudioId","unavailableChildId","hoverChildId","pressedChildId","selectedChildId","showScrollBar","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","scrollDirection","layoutConstraint","referencedPrefabId","animationId","playSoundEffect","layer","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),W1=new Set(["posX","posY","width","height"]),J1=new Set(["anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]);function Z1(t){if(typeof t=="number"&&Number.isFinite(t))return t>>>0;if(typeof t=="string"){let e=t.trim();if(e.startsWith("#")){let n=e.slice(1);if(n.length===6)return(4278190080|parseInt(n,16))>>>0;if(n.length===8)return parseInt(n,16)>>>0}let i=Number(e);if(Number.isFinite(i))return i>>>0}throw new Error("color must be an ARGB integer or #RRGGBB/#AARRGGBB string")}function Zt(t,e){let i=Number(t);if(!Number.isFinite(i))throw new Error(`${e} must be a finite number`);return i}function Wf(t){if(t===!0||t===1||t==="1"||t==="true")return!0;if(t===!1||t===0||t==="0"||t==="false")return!1;throw new Error("boolean field requires true or false")}var Q1=new Set(["fontSize","minimumFontSize","imageId","clickAudioId","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","fillAmount","cellSizeX","cellSizeY","spacingX","spacingY","padding1X","padding1Y","padding2X","padding2Y","previewCount","keyboardKeyCode","controllerKeyCode","itemPrefabId","layoutConstraintFixedCount"]),eh=new Set(["active","visible","canControllerFocus","isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor","adaptiveFontSize","enableOutline","enableMask","enableSoftEdge","enableFill","reverseMaskArea","raycastTarget","interactable","showScrollBar","playSoundEffect"]),th=new Set(["name","imageSource","horizontalAlignment","verticalAlignment","text","softEdgeMode","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","scrollDirection","layoutConstraint","referencedPrefabId","animationId"]),Jf=new Set(["unavailableChildId","hoverChildId","pressedChildId","selectedChildId"]),Zf={layer:["AboveAllControls","BelowAllControls"],imageSource:["StaticReference","Prefab"],imageType:["Basic","Stretch",null],scrollDirection:["Horizontal","Vertical"],layoutConstraint:["AutoWrap","Fixed"],softEdgeMode:["Percentage","Pixel"],fillType:["Horizontal","Vertical","Radial90","Radial180","Radial360"],fillHorizontalType:["Left","Right"],fillVerticalType:["Bottom","Top"],fillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],fillRadialType:["Bottom","Left","Top","Right"]};function ih(t,e){if(!e||typeof e!="object")throw new Error("patch requires op");let i=e.op;if(i==="select")return e.id&&Ye(t.root,e.id)&&(t.selectedId=e.id),t;if(i==="pick"){let{boxes:n}=si(t.root,t.canvasId),r=eu(t,n),o=Il(r,Number(e.x),Number(e.y));return o&&(t.selectedId=o),t}if(i==="setCanvas")return e.canvasId&&Pe[e.canvasId]&&(t.canvasId=e.canvasId),t;if(i==="setScript")throw new Error("\u811A\u672C\u7531\u5B58\u6863\u7EDF\u4E00\u7BA1\u7406\uFF0C\u8BF7\u4F7F\u7528 addScript / updateScript / removeScript \u64CD\u4F5C");if(i==="newAsset"){let n=e.assetType==="client-control-template"?en():Ai();return t.version=n.version,t.meta=n.meta,t.canvasId=n.canvasId,t.selectedId=n.selectedId,t.root=n.root,t}if(i==="addTemplate"){if(t.meta.assetType!=="client-control-template")throw new Error("\u53EA\u6709\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B\u53EF\u4EE5\u65B0\u589E\u6A21\u677F");let n=xe(e.kind,{id:No(t.root),guid:Kf(t.root),name:e.name||`\u65B0${e.kind==="container"?"\u5BB9\u5668\u8282\u70B9":e.kind}\u6A21\u677F`});return t.root.children.push(n),t.selectedId=n.id,t}if(i==="add"){let n=Ye(t.root,e.parentId||t.selectedId);if(!n)throw new Error("add: parent not found");let r=rl(n,e.kind,{id:No(t.root),guid:Kf(t.root),name:e.name});return t.selectedId=r.id,t}if(i==="reparent"){if(t.meta.assetType!=="client-control-template")throw new Error("\u5C42\u7EA7\u8C03\u6574\u4EC5\u9002\u7528\u4E8E\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5DE5\u7A0B");let n=Ye(t.root,e.id||t.selectedId),r=n?oi(t.root,n.id):null,o=Ye(t.root,e.parentId);if(!n||n.kind==="server-container"||!r)throw new Error("reparent: node not found");if(!o)throw new Error("reparent: parent not found");if(o.id===n.id||Y1(n,o.id))throw new Error("\u63A7\u4EF6\u4E0D\u80FD\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u540E\u4EE3\u4E0B\u9762");if(o.kind==="server-container"&&r.kind==="server-container")return t;if(r.kind==="server-container"&&o.kind!=="server-container"&&t.root.children.length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u9876\u5C42\u6A21\u677F");return H1(t,n,r,o),t.selectedId=n.id,t}if(i==="moveSibling"){let n=Ye(t.root,e.id||t.selectedId),r=n?oi(t.root,n.id):null;if(!n||!r)throw new Error("moveSibling: node not found");let o=r.children.findIndex(l=>l.id===n.id),a=e.direction==="up"?-1:e.direction==="down"?1:0,s=o+a;return!a||s<0||s>=r.children.length||(r.children.splice(o,1),r.children.splice(s,0,n),t.selectedId=n.id),t}if(i==="remove"){let n=e.id||t.selectedId,r=oi(t.root,n);if(r?.kind==="server-container"){if(t.meta.assetType!=="client-control-template")throw new Error("\u670D\u52A1\u7AEF\u63A7\u4EF6\u6A21\u677F\u7684\u5BA2\u6237\u7AEF\u6839\u8282\u70B9\u4E0D\u80FD\u5220\u9664");if((t.root.children||[]).length<=1)throw new Error("\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5217\u8868\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u6A21\u677F")}return ol(t.root,n)&&(be(t.root,o=>{if(o.kind==="button")for(let a of Jf)o[a]&&!Ye(t.root,o[a])&&(o[a]=null)}),t.selectedId=r?r.id:t.root.id),t}if(i==="set"){let n=Ye(t.root,e.id||t.selectedId);if(!n)throw new Error("set: node not found");let r=e.key;r==="reverseMask"&&(r="reverseMaskArea");let o=e.value;if(n.kind==="reference"&&["referencedPrefabId","giaRaw.templateRefSlot"].includes(r)&&(n.giaRaw.templateRefSlotBase64||n.giaRaw.templateRefOuterBase64))throw new Error("\u8BE5\u6A21\u677F\u5F15\u7528\u542B\u5C1A\u672A\u89E3\u6790\u7684\u539F\u59CB\u914D\u7F6E\uFF0C\u6682\u4E0D\u80FD\u6539\u5199\u76EE\u6807\u7D22\u5F15\uFF1B\u8BF7\u5728\u5B98\u65B9\u7F16\u8F91\u5668\u4FEE\u6539\u540E\u91CD\u65B0\u5BFC\u5165");if(r.startsWith("giaRaw.")){let c=r.slice(7);if(!c||c.includes("."))throw new Error("invalid raw GIA field path");let f=tl(n.kind,c);if(!f)throw new Error(`unknown raw GIA field for ${n.kind}: ${c}`);if(n.giaRaw||={},n.giaRaw[c]=Co(f,o),c==="footerField505"&&[0,1].includes(n.giaRaw[c])&&(n.canControllerFocus=n.giaRaw[c]===1),n.kind==="cursor"&&c==="cursorField501"&&[0,1].includes(n.giaRaw[c])&&(n.raycastTarget=n.giaRaw[c]===1),(n.kind==="textbox"||n.kind==="textwindow")&&c==="textAlign"){let h={0:"Left",1:"Middle",2:"Right"}[n.giaRaw[c]];h&&(n.horizontalAlignment=h)}if(n.kind==="image"&&c==="imageFillType"){let h={1:"Horizontal",2:"Vertical",3:"Radial90",4:"Radial180",5:"Radial360"}[n.giaRaw[c]];h&&(n.fillType=h)}return n.kind==="keyhint"&&c==="keyHintField502"&&(n.keyboardKeyCode=n.giaRaw[c]),n.kind==="keyhint"&&c==="keyHintField501"&&(n.controllerKeyCode=n.giaRaw[c]),t}if(r==="syncAllDevices"){if(n.syncAllDevices=Wf(o),n.syncAllDevices){let c=ai(n.transformByPlatform,t.canvasId);bn(t,n,c)}return t}if(K1.has(r)){if(r==="layer"&&n.kind!=="animation")throw new Error("layer is only available on UI animations");if(r==="playSoundEffect"&&!["animation","fullscreen"].includes(n.kind))throw new Error("playSoundEffect requires an animation control");if(r.endsWith("Color")&&(o=Z1(o)),Q1.has(r)){if(o=Zt(o,r),o<0)throw new Error(`${r} must not be negative`);if((r==="imageId"||r==="clickAudioId"||r==="keyboardKeyCode"||r==="controllerKeyCode")&&(o=Math.trunc(o)),r==="fillAmount"&&o>1)throw new Error("fillAmount must be between 0 and 1")}if(eh.has(r)&&(o=Wf(o)),th.has(r)&&(o=String(o??"")),r==="horizontalAlignment"&&!["Left","Middle","Right"].includes(o))throw new Error("invalid horizontalAlignment");if(r==="verticalAlignment"&&!["Top","Middle","Bottom"].includes(o))throw new Error("invalid verticalAlignment");if(Zf[r]&&!Zf[r].includes(o))throw new Error(`invalid ${r}`);if(Jf.has(r))if(o===""||o===void 0||o===null)o=null;else{o=String(o);let c=Ye(t.root,o);if(!c||c===n||c.kind==="server-container"||!(n.children||[]).some(f=>f.id===o))throw new Error(`${r} must reference a direct child of this button`)}if(n.kind==="image"&&(r==="imageSource"||r==="imageId")&&n[r]!==o&&(n.imageType=null,n.giaRaw.imageSlotType=0),n[r]=o,n.kind==="image"&&r==="imageType"&&(n.giaRaw.imageSlotType=o==="Stretch"?1:0),r==="canControllerFocus"&&(n.giaRaw.footerField505=o?1:0),n.kind==="cursor"&&r==="raycastTarget"&&(n.giaRaw.cursorField501=o?1:0),(n.kind==="textbox"||n.kind==="textwindow")&&r==="horizontalAlignment"&&(n.giaRaw.textAlign={Left:0,Middle:1,Right:2}[o]),(n.kind==="textbox"||n.kind==="textwindow")&&r==="verticalAlignment"&&delete n.giaRaw.textVerticalAlign,n.kind==="image"&&r==="fillType"){let c={Horizontal:1,Vertical:2,Radial90:3,Radial180:4,Radial360:5}[o];c&&(n.giaRaw.imageFillType=c)}return n.kind==="reference"&&r==="referencedPrefabId"&&(n.giaRaw.templateRefSlot=o),n.kind==="grid"&&r==="previewCount"&&(n.giaRaw.gridField511=Math.trunc(o)),n.kind==="keyhint"&&r==="keyboardKeyCode"&&(n.giaRaw.keyHintField502=Math.trunc(o)),n.kind==="keyhint"&&r==="controllerKeyCode"&&(n.giaRaw.keyHintField501=Math.trunc(o)),(n.kind==="animation"||n.kind==="fullscreen")&&r==="animationId"&&(n.giaRaw[n.kind==="animation"?"effectSlot":"fullscreenEffectSlot"]=o),t}let{boxes:a}=si(t.root,t.canvasId),s=Ua(t,n.id,a),l=ai(n.transformByPlatform,t.canvasId);if(r==="anchorType"){let c=ja(a[n.id]),f=Ws(l,o);return f=xi(s,f,c),bn(t,n,f),t}if(["rotationX","rotationY","rotationZ"].includes(r)){let c={...l,rotation:{...l.rotation,[r.slice(-1).toLowerCase()]:Zt(o,r)}};return bn(t,n,c),t}if(J1.has(r)){let c=ja(a[n.id]),f={...l,anchorMin:{...l.anchorMin},anchorMax:{...l.anchorMax},pivot:{...l.pivot}};return r==="anchorMinX"&&(f.anchorMin.x=Zt(o,r)),r==="anchorMinY"&&(f.anchorMin.y=Zt(o,r)),r==="anchorMaxX"&&(f.anchorMax.x=Zt(o,r)),r==="anchorMaxY"&&(f.anchorMax.y=Zt(o,r)),r==="pivotX"&&(f.pivot.x=Zt(o,r)),r==="pivotY"&&(f.pivot.y=Zt(o,r)),bn(t,n,xi(s,f,c)),t}if(W1.has(r)){let c=ja(a[n.id]),f=Zt(o,r);if((r==="width"||r==="height")&&f<0)throw new Error(`${r} must not be negative`);return c[r]=f,bn(t,n,xi(s,l,c)),t}throw new Error(`set: unknown key ${r}`)}if(i==="replace"){let n=vi(e.project);return t.version=n.version,t.meta=n.meta,t.canvasId=n.canvasId,t.selectedId=n.selectedId,t.root=n.root,t}throw new Error(`unknown op ${i}`)}function Ha(t,e){if(!e||typeof e!="object")throw new Error("patch requires op");if(e.expectedRevision!==void 0&&Number(e.expectedRevision)!==t.version)throw new Error(`revision conflict: expected ${e.expectedRevision}, current ${t.version}`);let i=t.version,n=JSON.parse(JSON.stringify(t));return ih(n,e),Qf(n),Yt(n),n.version=i+1,Object.keys(t).forEach(r=>{delete t[r]}),Object.assign(t,n),t}function ja(t){return t?{posX:t.centerX,posY:t.centerY,width:t.width,height:t.height}:{posX:0,posY:0,width:0,height:0}}import nh from"fengari";var{lua:d,lauxlib:Ce,lualib:tu,to_luastring:eo,to_jsstring:rh}=nh,oh=d.LUA_TNIL,ah=d.LUA_TBOOLEAN,sh=d.LUA_TNUMBER,lh=d.LUA_TSTRING,iu=d.LUA_TTABLE,ch=d.LUA_TFUNCTION,Xa=d.LUA_TUSERDATA,Ot=d.LUA_OK,nu=new WeakMap,Ka=Symbol("luaTableEntries"),Wa={__scriptHostKey:!0};function B(t){return eo(String(t))}function Di(t,e){nu.set(t,e)}function ct(t){return nu.get(t)}var jn=class{constructor(e){this.value=e}};function Ve(t,e,i){if(i instanceof jn){d.lua_pushnumber(t,i.value);return}if(i==null){d.lua_pushnil(t);return}let n=typeof i;if(n==="boolean"){d.lua_pushboolean(t,i);return}if(n==="number"){Number.isInteger(i)&&Math.abs(i)<=2147483647?d.lua_pushinteger(t,i):d.lua_pushnumber(t,i);return}if(n==="string"){d.lua_pushstring(t,B(i));return}if(n==="function"){dh(t,e,i);return}if(i&&i[Ka]){let r=i[Ka];d.lua_createtable(t,Array.isArray(i)?i.length:0,r.length);for(let[o,a]of r)Ve(t,e,o),Ve(t,e,a),d.lua_settable(t,-3);return}if(Array.isArray(i)){d.lua_createtable(t,i.length,0);for(let r=0;r<i.length;r++)Ve(t,e,i[r]),d.lua_rawseti(t,-2,r+1);return}if(i&&i.__kind==="EnumItem"){e.pushEnumItem(t,i);return}if(i&&i.__kind==="CursorEventData"){e.pushCursor(t,i);return}if(i&&i.__kind==="Script"){e.pushScript(t,i);return}if(i&&i.typeofName){e.pushControl(t,i);return}if(i&&i.__kind==="ServerSignal"){e.pushSignal(t,i);return}if(i&&(i.SetEase||i.Append)){e.pushTween(t,i);return}if(n==="object"){d.lua_createtable(t,0,Object.keys(i).length);for(let[r,o]of Object.entries(i))Ve(t,e,o),d.lua_setfield(t,-2,B(r));return}d.lua_pushnil(t)}function ke(t,e){if(d.lua_isnil(t,e)||d.lua_type(t,e)===d.LUA_TNONE)return"";if(!d.lua_isstring(t,e)&&d.lua_type(t,e)!==d.LUA_TNUMBER)return`lua_type=${d.lua_type(t,e)}`;let i=d.lua_tostring(t,e);return i==null?"":rh(i)}function Qt(t,e){e=d.lua_absindex(t,e);let i=d.lua_type(t,e);if(i===Xa)return ct(d.lua_touserdata(t,e));if(i===iu){d.lua_pushlightuserdata(t,Wa),d.lua_rawget(t,e);let n=d.lua_type(t,-1)===Xa?d.lua_touserdata(t,-1):null;return d.lua_pop(t,1),n?ct(n):null}return null}function We(t,e,i){i=d.lua_absindex(t,i);let n=d.lua_type(t,i);if(n===oh)return null;if(n===ah)return!!d.lua_toboolean(t,i);if(n===sh)return d.lua_isinteger(t,i)?d.lua_tointeger(t,i):d.lua_tonumber(t,i);if(n===lh)return ke(t,i);if(n===Xa){let r=d.lua_touserdata(t,i);return ct(r)??r}if(n===ch)return fh(t,e,i);if(n===iu){let r=Qt(t,i);if(r)return r;let o=[];for(d.lua_pushnil(t);d.lua_next(t,i)!==0;){let c=We(t,e,-2),f=We(t,e,-1);o.push([c,f]),d.lua_pop(t,1)}let a=new Map(o.filter(([c])=>Number.isInteger(c)&&c>=1)),s=0;for(;a.has(s+1);)s+=1;let l=s>0?[]:{};for(let[c,f]of o)Array.isArray(l)&&Number.isInteger(c)&&c>=1?l[c-1]=f:(typeof c=="string"||typeof c=="number")&&(l[c]=f);return Object.defineProperty(l,Ka,{value:o}),l}return null}function fh(t,e,i){e.luaFunctions||(e.luaFunctions=new Map);let n=typeof d.lua_topointer=="function"?d.lua_topointer(t,i):null;if(n!=null&&e.luaFunctions.has(n))return e.luaFunctions.get(n);d.lua_pushvalue(t,i);let r=Ce.luaL_ref(t,d.LUA_REGISTRYINDEX),o=uh(t,e,r);return n!=null&&e.luaFunctions.set(n,o),o}function uh(t,e,i){let n=(...r)=>{if(n.__luaRef==null)throw new Error("attempt to call a released Lua callback");let o=d.lua_gettop(t);d.lua_rawgeti(t,d.LUA_REGISTRYINDEX,n.__luaRef);for(let c of r)Ve(t,e,c);if(d.lua_pcall(t,r.length,d.LUA_MULTRET,0)!==Ot){let c=ke(t,-1);throw d.lua_settop(t,o),new Error(c)}let s=d.lua_gettop(t)-o,l=[];for(let c=1;c<=s;c++)l.push(We(t,e,o+c));if(d.lua_settop(t,o),l.length!==0)return l.length===1?l[0]:l};return n.__luaRef=i,n.__luaState=t,n}function ru(t){t?.__luaRef!=null&&(t.__luaHolds=(t.__luaHolds||0)+1)}function ou(t,e){if(!e||e.__luaRef==null||!e.__luaState)return;if(e.__luaHolds>1){e.__luaHolds-=1;return}let i=e.__luaState;if((!t?.luaStates||t.luaStates.has(i))&&Ce.luaL_unref(i,d.LUA_REGISTRYINDEX,e.__luaRef),e.__luaRef=null,e.__luaState=null,t?.luaFunctions)for(let[n,r]of t.luaFunctions)r===e&&t.luaFunctions.delete(n)}function dh(t,e,i){d.lua_pushlightuserdata(t,i),d.lua_pushlightuserdata(t,e),d.lua_pushcclosure(t,function(r){let o=d.lua_touserdata(r,d.lua_upvalueindex(1)),a=d.lua_touserdata(r,d.lua_upvalueindex(2)),s=d.lua_gettop(r),l=[];for(let c=1;c<=s;c++)l.push(We(r,a,c));try{let c=o(...l);if(Array.isArray(c)&&c.__multi){for(let f of c)Ve(r,a,f);return c.length}return c===void 0?0:(Ve(r,a,c),1)}catch(c){return d.lua_pushstring(r,B(String(c&&c.message?c.message:c))),d.lua_error(r)}},2)}function au(t){!t||typeof d.lua_close!="function"||d.lua_close(t)}function su(t){if(Ce.luaL_loadstring(t,B(["local nativeGetMetatable = getmetatable","getmetatable = function(value)",' if type(value) == "string" then return nil end'," return nativeGetMetatable(value)","end"].join(`
122
+ `)))===Ot&&d.lua_pcall(t,0,0,0),d.lua_settop(t,0),d.lua_pushnil(t),d.lua_setglobal(t,B("_VERSION")),d.lua_getglobal(t,B("string")),!d.lua_isnil(t,-1))for(let i of["dump","pack","unpack"])d.lua_pushnil(t),d.lua_setfield(t,-2,B(i));if(d.lua_pop(t,1),d.lua_pushnil(t),d.lua_setglobal(t,B("io")),d.lua_getglobal(t,B("os")),!d.lua_isnil(t,-1))for(let i of Object.keys({execute:1,getenv:1,remove:1,rename:1,tmpname:1,setlocale:1,exit:1}))d.lua_pushnil(t),d.lua_setfield(t,-2,B(i));d.lua_pop(t,1),d.lua_getglobal(t,B("debug")),d.lua_isnil(t,-1)?d.lua_pop(t,1):(d.lua_getfield(t,-1,B("traceback")),d.lua_newtable(t),d.lua_pushvalue(t,-2),d.lua_setfield(t,-2,B("traceback")),d.lua_setglobal(t,B("debug")),d.lua_pop(t,2)),d.lua_getglobal(t,B("math")),d.lua_isnil(t,-1)||(d.lua_pushcfunction(t,i=>{let n=d.lua_tonumber(i,1);return d.lua_pushboolean(i,Number.isNaN(n)),1}),d.lua_setfield(t,-2,B("isnan")),d.lua_pushcfunction(t,i=>{let n=d.lua_tonumber(i,1);return d.lua_pushboolean(i,n===1/0||n===-1/0),1}),d.lua_setfield(t,-2,B("isinf"))),d.lua_pop(t,1),d.lua_pushnil(t),d.lua_setglobal(t,B("package")),d.lua_pushnil(t),d.lua_setglobal(t,B("load")),d.lua_pushnil(t),d.lua_setglobal(t,B("loadfile")),d.lua_pushnil(t),d.lua_setglobal(t,B("dofile")),d.lua_pushnil(t),d.lua_setglobal(t,B("collectgarbage")),d.lua_pushnil(t),d.lua_setglobal(t,B("coroutine")),d.lua_pushnil(t),d.lua_setglobal(t,B("fengari"))}var bt=(t,e=0)=>Number.isFinite(Number(t))?Number(t):e,lu=t=>t?.Name||t,to=t=>Math.max(0,Math.min(1,bt(t)));function Un(t){let e=t.parent?Un(t.parent):[t.runtime.canvasWidth,t.runtime.canvasHeight];return[Math.max(0,(t.anchorMaxX-t.anchorMinX)*e[0]+bt(t.sizeDeltaX)),Math.max(0,(t.anchorMaxY-t.anchorMinY)*e[1]+bt(t.sizeDeltaY))]}function Yn(t){let[e,i]=Un(t),n=lu(t.scrollDirection)==="Horizontal",r=Math.max(1,bt(t.cellSizeX,50)),o=Math.max(1,bt(t.cellSizeY,50)),a=Math.max(0,bt(t.spacingX)),s=Math.max(0,bt(t.spacingY)),l=Math.max(0,bt(t.padding1X)),c=Math.max(0,bt(t.padding1Y)),f=Math.max(0,bt(t.padding2X)),h=Math.max(0,bt(t.padding2Y)),m=n?i-c-h:e-l-f,p=n?o:r,b=n?s:a,g=lu(t.layoutConstraint)==="Fixed"?Math.max(1,Math.floor(bt(t.layoutConstraintFixedCount,1))):Math.max(1,Math.floor((m+b)/(p+b))),w=Math.ceil(t.itemCount/g),S=w?n?l+f+w*r+(w-1)*a:c+h+w*o+(w-1)*s:0,_=n?e:i,G=Math.max(0,S-_);return{width:e,height:i,horizontal:n,cellW:r,cellH:o,gapX:a,gapY:s,left:l,top:c,right:f,bottom:h,lanes:g,length:S,viewport:_,max:G,offset:to(t.scrollProgress)*G}}function gn(t){let e=Yn(t);for(let i=0;i<(t._gridItems?.length||0);i+=1){let n=t._gridItems[i];if(!n.alive||n.parent!==t)continue;let r=Math.floor(i/e.lanes),o=i%e.lanes,a=e.horizontal?r:o,s=e.horizontal?o:r,l=e.left+a*(e.cellW+e.gapX)+e.cellW/2-(e.horizontal?e.offset:0),c=-e.top-s*(e.cellH+e.gapY)-e.cellH/2+(e.horizontal?0:e.offset),f={anchorMinX:0,anchorMaxX:0,anchorMinY:1,anchorMaxY:1,pivotX:.5,pivotY:.5,sizeDeltaX:e.cellW,sizeDeltaY:e.cellH,anchoredPositionX:l,anchoredPositionY:c};Object.entries(f).some(([h,m])=>n[h]!==m)&&(Object.assign(n,f),n.markPlayDirty(!0))}return e}var cu={container:"ClientUIContainerControl",textbox:"ClientUITextBoxControl",textwindow:"ClientUITextWindowControl",image:"ClientUIImageControl",button:"ClientUIPresetButtonControl",cursor:"ClientUICursorEventAreaControl",grid:"ClientUIGridScrollerControl",keyhint:"ClientUIKeyHintControl",animation:"ClientUIAnimationControl",fullscreen:"ClientUIFullscreenAnimationControl",reference:"ClientUIReferenceControl"},hh=["alive","id","Id","prefabIndex","active","activeInHierarchy","visible"],io=new Set(["active","visible","parent","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY"]),ph=["name","parent","anchoredPositionX","anchoredPositionY","sizeDeltaX","sizeDeltaY","anchorMinX","anchorMinY","anchorMaxX","anchorMaxY","pivotX","pivotY","localScaleX","localScaleY","localScaleZ","localRotationX","localRotationY","localRotationZ","canControllerFocus"],mh={image:["imageSource","imageId"],grid:["itemCount","scrollDirection","layoutConstraint","layoutConstraintFixedCount"],reference:["referencedPrefabIndex"]},bh={container:["isolateNavigation","disableKeyEventPassthrough","disableCursorEventPassthrough","showCursor"],textbox:["text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],textwindow:["interactable","showScrollBar","text","fontSize","fontColor","bgColor","enableOutline","outlineColor","horizontalAlignment","verticalAlignment","adaptiveFontSize","minimumFontSize"],image:["imageColor","enableMask","enableSoftEdge","softEdgeMode","softEdgeWidthX","softEdgeWidthY","horizontalSoftRange","verticalSoftRange","reverseMaskArea","fillType","fillHorizontalType","fillVerticalType","fillRadial90Type","fillRadialType","fillAmount"],button:["interactable","clickAudioId","raycastTarget"],cursor:["raycastTarget"],grid:["itemPrefabIndex","raycastTarget","showScrollBar","interactable","scrollProgress"],keyhint:["keyboardKeyCode","controllerKeyCode"],animation:["animationId","playSoundEffect","layer"],fullscreen:["animationId","playSoundEffect"]},gh=["GetChildren","GetChild","FindChild","SetActive","SetVisible","GetSiblingIndex","SetSiblingIndex","SetAsFirstSibling","SetAsLastSibling","GetAnchoredPosition","SetAnchoredPosition","GetSizeDelta","SetSizeDelta","GetAnchorMin","SetAnchorMin","GetAnchorMax","SetAnchorMax","GetPivot","SetPivot","GetLocalScale","SetLocalScale","GetLocalRotation","SetLocalRotation","GetScriptByPath","GetScript","GetScripts","AddKeyEventListener","RemoveKeyEventListener","RemoveKeyEventListeners","RemoveAllKeyEventListeners","AddNavigationEventListener","RemoveNavigationEventListener","RemoveNavigationEventListeners","RemoveAllNavigationEventListeners","SetControllerNavigation","GetControllerNavigation"],fu=["AddCursorEventListener","RemoveCursorEventListener","RemoveCursorEventListeners","RemoveAllCursorEventListeners","SimulateCursorClick"],yh={image:["SetImage","SetSoftEdgeWidth","SetFillUnused","SetFillHorizontal","SetFillVertical","SetFillRadial90","SetFillRadial180","SetFillRadial360"],button:fu,cursor:fu,animation:["PlayAnimation","StopAnimation"],grid:["RefreshItems","GetItemIndex","GetItemSize","GetItemSpacing","GetPadding","ScrollToItemAt","GetContentLength"]};function Za(t,e){return t.kind==="image"&&e==="imageType"&&t.runtime.canSelectImageType(t.imageId,t.imageSource)?"rw":hh.includes(e)||(mh[t.kind]||[]).includes(e)?"ro":ph.includes(e)||(bh[t.kind]||[]).includes(e)?"rw":null}var vh=["localRotationX","localRotationY","localRotationZ"],yn=Math.PI/180;function uu(t,e){return[t[3]*e[0]+t[0]*e[3]+t[1]*e[2]-t[2]*e[1],t[3]*e[1]-t[0]*e[2]+t[1]*e[3]+t[2]*e[0],t[3]*e[2]+t[0]*e[1]-t[1]*e[0]+t[2]*e[3],t[3]*e[3]-t[0]*e[0]-t[1]*e[1]-t[2]*e[2]]}function Ja(t){if(Object.is(t,-0))return t;let e=(t%360+360)%360,i=Math.round(e*1e6)/1e6;return i>=360?0:i}function du(t,e,i){let n=_=>[Math.sin(_*yn/2),Math.cos(_*yn/2)],[r,o]=n(t),[a,s]=n(e),[l,c]=n(i),[f,h,m,p]=uu(uu([0,a,0,s],[r,0,0,o]),[0,0,l,c]),b=Math.max(-1,Math.min(1,-2*(h*m-p*f))),g,w,S;return Math.abs(b)>.999999?(g=Math.sign(b)*90,w=2*Math.atan2(h,p)/yn,S=0):(g=Math.asin(b)/yn,w=Math.atan2(2*(p*h+f*m),1-2*(f*f+h*h))/yn,S=Math.atan2(2*(p*m+f*h),1-2*(f*f+m*m))/yn),[Ja(g),Ja(w),Ja(S)]}function hu(t,e){return gh.includes(e)||(yh[t.kind]||[]).includes(e)}var wh={container:{isolateNavigation:!1,disableKeyEventPassthrough:!1,disableCursorEventPassthrough:!1,showCursor:!1},textbox:{text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},textwindow:{interactable:!0,showScrollBar:!0,text:"",fontSize:20,fontColor:4294967295,bgColor:0,enableOutline:!1,outlineColor:0,horizontalAlignment:null,verticalAlignment:null,adaptiveFontSize:!1,minimumFontSize:10},image:{imageSource:null,imageId:0,imageColor:4294967295,imageType:null,enableMask:!1,enableSoftEdge:!1,softEdgeMode:"Percentage",softEdgeWidthX:8,softEdgeWidthY:8,horizontalSoftRange:85,verticalSoftRange:85,enableFill:!1,fillType:"Unused",fillHorizontalType:"Left",fillVerticalType:"Bottom",fillRadial90Type:"BottomLeft",fillRadialType:"Bottom",reverseMaskArea:!1,fillAmount:1},button:{interactable:!0,clickAudioId:0,raycastTarget:!0,unavailableChildId:null,hoverChildId:null,pressedChildId:null,selectedChildId:null,pressed:!1},cursor:{raycastTarget:!0},grid:{itemCount:0,itemPrefabIndex:null,raycastTarget:!0,interactable:!0,showScrollBar:!0,scrollDirection:"Vertical",layoutConstraint:"AutoWrap",layoutConstraintFixedCount:null,scrollProgress:0,cellSizeX:50,cellSizeY:50,spacingX:8,spacingY:8,padding1X:20,padding1Y:20,padding2X:20,padding2Y:20,previewCount:5},keyhint:{keyboardKeyCode:null,controllerKeyCode:null},animation:{animationId:null,playSoundEffect:null,layer:null,raycastTarget:!1},fullscreen:{animationId:null,playSoundEffect:null,raycastTarget:!1},reference:{referencedPrefabIndex:null}},wi=class t{constructor(e,i){this.runtime=e,this.kind=i.kind||"container",this.typeofName=cu[this.kind]||cu.container,this.alive=!0,this.Id=i.Id??e.nextControlId(),this.authoringId=i.authoringId??null,this.prefabIndex=i.prefabIndex??0,this.name=i.name??"",this.active=i.active===!0,this.visible=i.visible!==!1,this._parent=null,this.children=[],this.scripts=[],this.cursorListeners=new Map,this.keyListeners=new Map,this.navListeners=new Map,this.navConfig=new Map,this.anchoredPositionX=i.anchoredPositionX??0,this.anchoredPositionY=i.anchoredPositionY??0,this.sizeDeltaX=i.sizeDeltaX??0,this.sizeDeltaY=i.sizeDeltaY??0,this.anchorMinX=i.anchorMinX??.5,this.anchorMinY=i.anchorMinY??.5,this.anchorMaxX=i.anchorMaxX??.5,this.anchorMaxY=i.anchorMaxY??.5,this.pivotX=i.pivotX??.5,this.pivotY=i.pivotY??.5,this.localScaleX=i.localScaleX??1,this.localScaleY=i.localScaleY??1,this.localScaleZ=i.localScaleZ??1,this.localRotationX=i.localRotationX??0,this.localRotationY=i.localRotationY??0,this.localRotationZ=i.localRotationZ??0,this.canControllerFocus=i.canControllerFocus??!1,this._playDirty=!0,this._playDeepDirty=!0,this._playChildDirty=!1,(this.kind==="grid"||this.kind==="textwindow")&&(this.runtime.scrollControls||=new Set,this.runtime.scrollControls.add(this));let n=wh[this.kind]||{};for(let[r,o]of Object.entries(n))this[r]===void 0&&(this[r]=i[r]!==void 0?i[r]:o);if((this.kind==="animation"||this.kind==="fullscreen")&&(this.runtime.uiAnimations||=new Set,this.runtime.uiAnimations.add(this),this.PlayAnimation()),this.kind==="grid"&&(this.scrollProgress=i.scrollProgress??0),i.children)for(let r of i.children){let o=r instanceof t?r:new t(e,r);this.addChild(o)}}get parent(){return this._parent}set parent(e){if(this._parent===e)return;if(e!==null&&!(e instanceof t))throw new Error("parent must be a Control or nil");if(e&&e.runtime!==this.runtime)throw new Error("parent must belong to the same runtime");if(e===this)throw new Error("cannot parent a control to itself or its descendant");for(let n=e;n;n=n._parent)if(n===this)throw new Error("cannot parent a control to itself or its descendant");let i=this._parent;if(i){let n=i.children.indexOf(this);n>=0&&i.children.splice(n,1),i.markPlayDirty(!0)}else{let n=this.runtime.roots.indexOf(this);n>=0&&this.runtime.roots.splice(n,1)}this._parent=e,this.markPlayDirty(!0),e&&!e.children.includes(this)?(e.children.push(this),e.markPlayDirty(!0)):!e&&this.alive&&!this.runtime.roots.includes(this)&&this.runtime.roots.push(this)}markPlayDirty(e=!1){this._playDirty=!0,e&&(this._playDeepDirty=!0);for(let i=this._parent;i&&!i._playChildDirty;i=i._parent)i._playChildDirty=!0}get activeInHierarchy(){return this.active?this._parent?this._parent.activeInHierarchy:!0:!1}get scrollProgress(){return this._scrollProgress??0}set scrollProgress(e){if(typeof e!="number"||!Number.isFinite(e))throw new Error("scrollProgress must be a finite number");this._scrollProgress=to(e),this.markPlayDirty()}addChild(e){return e.parent=this,e}GetChildren(){return this.children.slice()}GetChild(e){return this.children.find(i=>i.name===e)||null}FindChild(e){if(!e)return null;if(!e.includes("/"))return this.GetChild(e);let i=e.split("/").filter(Boolean),n=this;for(let r of i)if(n=n.GetChild(r),!n)return null;return n}SetActive(e){let i=!!e;if(this.active!==i){if(typeof this.runtime?.onControlActiveChanging=="function"){this.runtime.onControlActiveChanging(this,i);return}this.active=i,this.markPlayDirty(!0)}}SetVisible(e){this.visible=!!e,this.markPlayDirty(!0)}GetSiblingIndex(){if(!this._parent)return-1;let e=this._parent.children,i=e.indexOf(this);return i<0?-1:e.length-1-i}SetSiblingIndex(e){if(!this._parent)return!1;let i=this._parent.children,n=i.indexOf(this);if(n<0)return!1;let r=i.length-1;return!Number.isInteger(e)||e<0||e>r?!1:(i.splice(n,1),i.splice(r-e,0,this),this._parent.markPlayDirty(!0),this.markPlayDirty(),!0)}SetAsFirstSibling(){return this.SetSiblingIndex(0)}SetAsLastSibling(){return this._parent?this.SetSiblingIndex(this._parent.children.length-1):!1}GetAnchoredPosition(){return[this.anchoredPositionX,this.anchoredPositionY]}SetAnchoredPosition(e,i){this.anchoredPositionX=e,this.anchoredPositionY=i,this.markPlayDirty()}GetSizeDelta(){return[this.sizeDeltaX,this.sizeDeltaY]}SetSizeDelta(e,i){this.sizeDeltaX=e,this.sizeDeltaY=i,this.markPlayDirty(!0)}GetAnchorMin(){return[this.anchorMinX,this.anchorMinY]}SetAnchorMin(e,i){this.anchorMinX=e,this.anchorMinY=i,this.markPlayDirty(!0)}GetAnchorMax(){return[this.anchorMaxX,this.anchorMaxY]}SetAnchorMax(e,i){this.anchorMaxX=e,this.anchorMaxY=i,this.markPlayDirty(!0)}GetPivot(){return[this.pivotX,this.pivotY]}SetPivot(e,i){this.pivotX=e,this.pivotY=i,this.markPlayDirty(!0)}GetLocalScale(){return[this.localScaleX,this.localScaleY,this.localScaleZ]}SetLocalScale(e,i,n){this.localScaleX=e,this.localScaleY=i,this.localScaleZ=n,this.markPlayDirty()}GetLocalRotation(){return du(this.localRotationX,this.localRotationY,this.localRotationZ)}luaFieldValue(e){if(e==="id")return this.Id;if(e==="imageType")return this.imageType??"Stretch";let i=vh.indexOf(e);return i<0?this[e]:du(this.localRotationX,this.localRotationY,this.localRotationZ)[i]}SetLocalRotation(e,i,n){this.localRotationX=e,this.localRotationY=i,this.localRotationZ=n,this.markPlayDirty()}GetScriptByPath(e){return this.scripts.find(i=>i.path===e)||null}GetScript(e){return this.scripts.find(i=>i.scriptMappingId===e)||null}GetScripts(){return this.scripts.slice()}_addListener(e,i,n){let r=e.get(i)||[];r.push(n),e.set(i,r),this.runtime.retainLuaCallback?.(n)}_removeListener(e,i,n){let r=e.get(i);if(!r)return;let o=r.filter(a=>a!==n);e.set(i,o);for(let a=o.length;a<r.length;a++)this.runtime.unrefLuaCallback?.(n)}_removeListeners(e,i){let n=e.get(i)||[];for(let r of n)this.runtime.unrefLuaCallback?.(r);e.delete(i)}_removeAllListeners(e){for(let i of e.values())for(let n of i)this.runtime.unrefLuaCallback?.(n);e.clear()}AddCursorEventListener(e,i){this._addListener(this.cursorListeners,e,i)}RemoveCursorEventListener(e,i){this._removeListener(this.cursorListeners,e,i)}RemoveCursorEventListeners(e){this._removeListeners(this.cursorListeners,e)}RemoveAllCursorEventListeners(){this._removeAllListeners(this.cursorListeners)}SimulateCursorClick(){let e=this.runtime.makeCursorEventData({x:0,y:0,pressX:0,pressY:0});this.emitCursor("CursorDown",e),this.emitCursor("CursorUp",e),this.emitCursor("CursorClick",e)}emitCursor(e,i){if(!this.runtime.cursorEventsEnabled(this))return;let n=this.cursorListeners.get(e)||[];for(let r of n)r(i)}AddKeyEventListener(e,i){this._addListener(this.keyListeners,e,i)}RemoveKeyEventListener(e,i){this._removeListener(this.keyListeners,e,i)}RemoveKeyEventListeners(e){this._removeListeners(this.keyListeners,e)}RemoveAllKeyEventListeners(){this._removeAllListeners(this.keyListeners)}emitKey(e){let i=this.keyListeners.get(e)||[];for(let n of i)if(n()===!0)return!0;return!1}AddNavigationEventListener(e,i){this._addListener(this.navListeners,e,i)}RemoveNavigationEventListener(e,i){this._removeListener(this.navListeners,e,i)}RemoveNavigationEventListeners(e){this._removeListeners(this.navListeners,e)}RemoveAllNavigationEventListeners(){this._removeAllListeners(this.navListeners)}SetControllerNavigation(e,i,n){this.navConfig.set(e,{mode:i,target:n})}GetControllerNavigation(e){let i=this.navConfig.get(e),n=i?[i.mode,i.target]:[null,null];return n.__multi=!0,n}SetImage(e,i){let n=this.imageSource?.Name||this.imageSource,r=e?.Name||e;(i!==this.imageId||n!==r)&&(this.imageType=null),this.imageSource=e,this.imageId=i,this.markPlayDirty()}SetSoftEdgeWidth(e,i){this.softEdgeWidthX=e,this.softEdgeWidthY=i,this.markPlayDirty()}SetFillUnused(){this.fillType="Unused",this.markPlayDirty()}SetFillHorizontal(e,i){this.fillType="Horizontal",this.fillHorizontalType=e,this.fillAmount=i,this.markPlayDirty()}SetFillVertical(e,i){this.fillType="Vertical",this.fillVerticalType=e,this.fillAmount=i,this.markPlayDirty()}SetFillRadial90(e,i){this.fillType="Radial90",this.fillRadial90Type=e,this.fillAmount=i,this.markPlayDirty()}SetFillRadial180(e,i){this.fillType="Radial180",this.fillRadialType=e,this.fillAmount=i,this.markPlayDirty()}SetFillRadial360(e,i){this.fillType="Radial360",this.fillRadialType=e,this.fillAmount=i,this.markPlayDirty()}get animationId(){return this._animationId}set animationId(e){this._animationId!==e&&(this._animationId=e,this._uiAnimation&&this.PlayAnimation())}PlayAnimation(){this.alive&&(this._uiAnimation={generation:(this._uiAnimation?.generation||0)+1,startedAt:this.runtime.clock.time,playing:!0},this.markPlayDirty())}StopAnimation(){this._uiAnimation&&(this._uiAnimation.playing=!1),this.markPlayDirty()}RefreshItems(e,i){if(!Number.isInteger(e)||e<0||e>2e3)throw new Error("RefreshItems: simulator supports 0..2000 items");if(typeof i!="function")throw new Error("RefreshItems: callback must be a function");if(!this.alive||this._refreshingGrid)throw new Error("RefreshItems: destroyed control or recursive refresh");if(e&&!this.runtime.templates.has(Number(this.itemPrefabIndex)))throw new Error("RefreshItems: item template not found");if(e&&["OnInit","OnDestroy"].includes(this.runtime.lifecyclePhase))throw new Error("RefreshItems: items cannot be created during OnInit/OnDestroy");this._refreshingGrid=!0;try{this._gridItems||=[];let n=[];for(let r of this._gridItems)r.alive&&r.parent===this&&r.prefabIndex===Number(this.itemPrefabIndex)&&n.length<e?n.push(r):r.alive&&r.parent===this&&this.runtime.destroyControl(r);for(this._gridItems=n;n.length<e;){let r=this.runtime.instantiate(this.itemPrefabIndex,this,this.runtime.lifecyclePhase);if(!r)throw new Error("RefreshItems: could not instantiate item");n.push(r),r.SetActive(!0)}this.itemCount=e,gn(this),this.markPlayDirty(!0);for(let r=0;r<n.length&&this.alive;r+=1)i(n[r],r)}finally{this._refreshingGrid=!1}}GetItemIndex(e){return e?.alive&&e.parent===this?this._gridItems?.indexOf(e)??-1:-1}GetItemSize(){return[this.cellSizeX,this.cellSizeY]}GetItemSpacing(){return[this.spacingX,this.spacingY]}GetPadding(){return[this.padding1Y,this.padding2Y,this.padding1X,this.padding2X]}ScrollToItemAt(e,i){if(!Number.isInteger(e)||e<0||e>=this.itemCount)throw new Error("ScrollToItemAt: item index out of range");let n=Yn(this),r=n.horizontal?n.cellW:n.cellH,o=n.horizontal?n.gapX:n.gapY,a=(n.horizontal?n.left:n.top)+Math.floor(e/n.lanes)*(r+o),s=i?.Name||i;if(!["Top","Center","Bottom"].includes(s))throw new Error("ScrollToItemAt: invalid alignment");let l=a-(s==="Center"?(n.viewport-r)/2:s==="Bottom"?n.viewport-r:0);this.scrollProgress=n.max?to(l/n.max):0,gn(this),this.markPlayDirty(!0)}GetContentLength(){return Yn(this).length}};function Vt(t,e){e(t);for(let i of t.children)Vt(i,e)}function Qa(t,e=[],i=""){e.push(`${i}${t.name||"(unnamed)"} [${t.typeofName}] Id=${t.Id}`);for(let n of t.children)Qa(n,e,i+" ");return e}function no(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}var pu={Linear:t=>t,InSine:t=>1-Math.cos(t*Math.PI/2),OutSine:t=>Math.sin(t*Math.PI/2),InOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,InQuad:t=>t*t,OutQuad:t=>1-(1-t)*(1-t),InOutQuad:t=>t<.5?2*t*t:1-(-2*t+2)**2/2,InCubic:t=>t*t*t,OutCubic:t=>1-(1-t)**3,InOutCubic:t=>t<.5?4*t*t*t:1-(-2*t+2)**3/2,InQuart:t=>t**4,OutQuart:t=>1-(1-t)**4,InOutQuart:t=>t<.5?8*t**4:1-(-2*t+2)**4/2,InQuint:t=>t**5,OutQuint:t=>1-(1-t)**5,InOutQuint:t=>t<.5?16*t**5:1-(-2*t+2)**5/2,InExpo:t=>t===0?0:2**(10*t-10),OutExpo:t=>t===1?1:1-2**(-10*t),InOutExpo:t=>t===0||t===1?t:t<.5?2**(20*t-10)/2:(2-2**(-20*t+10))/2,InCirc:t=>1-Math.sqrt(1-t**2),OutCirc:t=>Math.sqrt(1-(t-1)**2),InOutCirc:t=>t<.5?(1-Math.sqrt(1-(2*t)**2))/2:(Math.sqrt(1-(-2*t+2)**2)+1)/2,InBack:t=>(1.70158+1)*t*t*t-1.70158*t*t,OutBack:t=>1+2.70158*(t-1)**3+1.70158*(t-1)**2,InOutBack:t=>{let i=2.5949095;return t<.5?(2*t)**2*((i+1)*2*t-i)/2:((2*t-2)**2*((i+1)*(t*2-2)+i)+2)/2},InElastic:t=>t===0||t===1?t:-(2**(10*t-10))*Math.sin((t*10-10.75)*(2*Math.PI/3)),OutElastic:t=>t===0||t===1?t:2**(-10*t)*Math.sin((t*10-.75)*(2*Math.PI/3))+1,InOutElastic:t=>{if(t===0||t===1)return t;let e=2*Math.PI/4.5;return t<.5?-(2**(20*t-10)*Math.sin((20*t-11.125)*e))/2:2**(-20*t+10)*Math.sin((20*t-11.125)*e)/2+1},InBounce:t=>1-no(1-t),OutBounce:no,InOutBounce:t=>t<.5?(1-no(1-2*t))/2:(1+no(2*t-1))/2};function mu(t,e){let i=pu[t]||pu.Linear;return e<=0?0:e>=1?1:i(e)}function vn(t,e,i,n=255){let r=ro(t),o=ro(e),a=ro(i);return((n==null?255:ro(n))<<24|r<<16|o<<8|a)>>>0}function Hn(t){let e=t>>>0;return[e>>>16&255,e>>>8&255,e&255,e>>>24&255]}function ro(t){let e=Number(t);return Number.isFinite(e)?Math.max(0,Math.min(255,Math.trunc(e))):0}function bu(t,e,i){let n=Hn(t),r=Hn(e);return vn(n[0]+(r[0]-n[0])*i,n[1]+(r[1]-n[1])*i,n[2]+(r[2]-n[2])*i,n[3]+(r[3]-n[3])*i)}var Sh=new Set(["fontColor","bgColor","outlineColor","imageColor"]),Eh=new Set(["fontSize","minimumFontSize"]),es=1e-9;function xh(t,e){return typeof t?.luaFieldValue=="function"?t.luaFieldValue(e):t[e]}var Xn=class{constructor(e,i,n,r){this.runtime=e,this.object=i,this.data={...n},this.duration=Math.max(0,Number(r)||0),this.easeName="Linear",this.relative=!1,this.playing=!1,this.paused=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.from={},this.to={},this.initialFrom=null,this.initialTo=null,this.onComplete=null,this.onStepComplete=null,this.killed=!1,this.dead=!1,this.completed=!1}capture(){this.from={},this.to={};for(let[e,i]of Object.entries(this.data)){let n=xh(this.object,e);this.from[e]=n,this.to[e]=this.relative?Number(n)+Number(i):i}}restoreInitial(){this.from={...this.initialFrom},this.to={...this.initialTo}}SetEase(e){return this.easeName=typeof e=="string"?e:e?.Name||"Linear",this}SetRelative(e){return this.relative=!!e,this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._start(!1)}_begin(e){this.playing=!0,this.paused=!1,this.elapsed=0,this.loopIndex=0,this.killed=!1,this.completed=!1,e&&this.initialFrom?this.restoreInitial():(this.capture(),this.initialFrom={...this.from},this.initialTo={...this.to})}_start(e){return this._begin(e),this.runtime.tweens.add(this),this.runtime.animations.add(this),this}get loopCount(){return this.loops>0?this.loops:1}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){return this.dead?this:this._start(!0)}Complete(){this.dead||this.completed||(this.initialFrom||this._begin(!1),this.apply(1),this.finish(!0))}Kill(e){e?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(e){return this.onComplete=e,this}SetOnStepComplete(e){return this.onStepComplete=e,this}SetLoops(e){return this.loops=e,this}apply(e){if(this.object?.alive===!1)return;let i=mu(this.easeName,e),n=!1,r=!1;for(let o of Object.keys(this.to)){let a=this.from[o],s=this.to[o];if(Sh.has(o)&&typeof a=="number"&&typeof s=="number")this.object[o]=bu(a,s,i);else if(typeof a=="number"&&typeof s=="number"){let l=a+(s-a)*i;this.object[o]=Eh.has(o)?Math.trunc(l):l}else this.object[o]=i>=1?s:a;n=!0,io.has(o)&&(r=!0)}n&&typeof this.object?.markPlayDirty=="function"&&this.object.markPlayDirty(r)}_advance(e,i){this.elapsed+=e;let n=this.duration<=0?1:Math.min(1,this.elapsed/this.duration);return this.apply(n),n<1?!1:i>=0&&this.loopIndex+1>=i?!0:(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.elapsed=0,this.restoreInitial(),!1)}step(e){!this.playing||this.paused||this.killed||this._advance(e,this.loops<0?-1:this.loopCount)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0))}finish(e){this.playing=!1,this.killed=!0,e&&(this.completed=!0),this.runtime.tweens.delete(this),this.runtime.animations.delete(this),e&&this.onComplete&&this.runtime.safeCall(this.onComplete)}},wn=class{constructor(e){this.runtime=e,this.steps=[],this.playing=!1,this.paused=!1,this.killed=!1,this.dead=!1,this.completed=!1,this.elapsed=0,this.loops=1,this.loopIndex=0,this.onComplete=null,this.onStepComplete=null,this._entries=null}Append(e){return this.steps.push({kind:"tween",tween:e,parallel:!1}),this}AppendInterval(e){return this.steps.push({kind:"interval",duration:e}),this}AppendCallback(e){return this.steps.push({kind:"callback",fn:e}),this}Join(e){return this.steps.push({kind:"tween",tween:e,parallel:!0}),this}Insert(e,i){return this.steps.push({kind:"insert",time:e,tween:i}),this}InsertCallback(e,i){return this.steps.push({kind:"insertCb",time:e,fn:i}),this}Play(){return this.dead?this:this.playing?(this.paused=!1,this):this._play()}_play(){return this.playing=!0,this.paused=!1,this.killed=!1,this.completed=!1,this.elapsed=0,this.loopIndex=0,this._schedule(),this.runtime.sequences.add(this),this.runtime.animations.add(this),this}_schedule(){let e=0,i=0,n=!1,r=[],o=a=>a.duration*a.loopCount;for(let a of this.steps)if(a.kind==="tween"&&a.parallel){let s=n?i:e;r.push({at:s,tween:a.tween}),e=Math.max(e,s+o(a.tween))}else a.kind==="tween"?(r.push({at:e,tween:a.tween}),i=e,n=!0,e+=o(a.tween)):a.kind==="interval"?(i=e,n=!0,e+=a.duration):a.kind==="callback"?r.push({at:e,fn:a.fn}):a.kind==="insert"?(r.push({at:a.time,tween:a.tween}),e=Math.max(e,a.time+o(a.tween))):a.kind==="insertCb"&&(r.push({at:a.time,fn:a.fn}),e=Math.max(e,a.time));this._entries=r.map((a,s)=>({...a,index:s,end:a.tween?a.at+o(a.tween):a.at})),this._end=e,this._resetEntries()}_resetEntries(){for(let e of this._entries)e.started=!1,e.done=!1}_startChild(e){e.started=!0,e.tween._begin(!!e.tween.initialFrom)}_finishChild(e){e.done=!0,e.tween.apply(1),e.tween.onStepComplete&&this.runtime.safeCall(e.tween.onStepComplete),e.tween.finish(!0)}_advanceTo(e,i){let n=this._entries,r=[];for(let a of n)!a.started&&a.at<=e+es&&r.push({at:a.at,rank:a.fn?1:2,entry:a}),a.tween&&!a.done&&a.end<=e+es&&r.push({at:a.end,rank:0,entry:a});r.sort((a,s)=>a.at-s.at||a.rank-s.rank||a.entry.index-s.entry.index);let o=new Set;for(let{rank:a,entry:s}of r)if(a===1){if(s.started=!0,this.runtime.safeCall(s.fn),!this.playing||this.killed||this._entries!==n)return!1}else s.started||(this._startChild(s),o.add(s)),a===0&&!s.done&&this._finishChild(s);for(let a of n)!a.tween||!a.started||a.done||(o.has(a)?a.tween._advance(e-a.at,a.tween.loopCount):a.tween._advance(i,a.tween.loopCount));return!0}step(e){!this.playing||this.paused||this.killed||(this.elapsed+=e,this._advanceTo(this.elapsed,e)&&(this.elapsed+es<this._end||(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.loopIndex++,this.loops<0||this.loopIndex<this.loops?(this.elapsed=0,this._resetEntries()):this.finish(!0))))}Pause(){this.paused=!0}Resume(){this.paused=!1}Restart(){this.dead||this._play()}Complete(){this.dead||this.completed||(this._entries||this._schedule(),this.playing=!0,this.killed=!1,this._advanceTo(1/0,0)&&(this.onStepComplete&&this.runtime.safeCall(this.onStepComplete),this.finish(!0)))}Kill(e){e?this.Complete():this.finish(!1),this.dead=!0}SetOnComplete(e){return this.onComplete=e,this}SetOnStepComplete(e){return this.onStepComplete=e,this}SetLoops(e){return this.loops=e,this}finish(e){this.playing=!1,this.killed=!0,e&&(this.completed=!0),this.runtime.sequences.delete(this),this.runtime.animations.delete(this),e&&this.onComplete&&this.runtime.safeCall(this.onComplete)}};var oo={EaseType:["Linear","InSine","OutSine","InOutSine","InQuad","OutQuad","InOutQuad","InCubic","OutCubic","InOutCubic","InQuart","OutQuart","InOutQuart","InQuint","OutQuint","InOutQuint","InExpo","OutExpo","InOutExpo","InCirc","OutCirc","InOutCirc","InBack","OutBack","InOutBack","InElastic","OutElastic","InOutElastic","InBounce","OutBounce","InOutBounce"],CustomVariableEntityType:["Level","PlayerSelf","AvatarSelf"],Device:["KeyboardAndMouse","Mobile","Controller","MobileController"],StageMode:["Beyond","Classic"],LanguageType:["LanguageNone","LanguageEng","LanguageChs","LanguageCht","LanguageFra","LanguageDeu","LanguageSpa","LanguagePor","LanguageRus","LanguageJpn","LanguageKor","LanguageTha","LanguageVie","LanguageInd","LanguageTur","LanguageIta"],ParamType:["Entity","EntityList","Int","IntList","Bool","BoolList","Float","FloatList","String","StringList","Vector3","Vector3List","Guid","GuidList","ConfigId","PrefabId","ConfigIdList","PrefabIdList"],CursorEventType:["CursorDown","CursorUp","CursorEnter","CursorExit","CursorDrag","CursorBeginDrag","CursorEndDrag","CursorClick"],ScrollDirection:["Horizontal","Vertical"],ScrollLayoutConstraint:["AutoWrap","Fixed"],ScrollAlignType:["Bottom","Center","Top"],ControllerNavigationDir:["Up","Down","Left","Right"],ControllerNavigationEventType:["Confirm","Cancel","Focus","LostFocus","RightStickUp","RightStickDown","RightStickRight","RightStickLeft","LeftStickUp","LeftStickDown","LeftStickRight","LeftStickLeft"],ControllerNavigationMode:["None","NearestControl","Specified"],TextHorizontalAlignment:["Left","Middle","Right"],TextVerticalAlignment:["Top","Middle","Bottom"],ImageType:["Basic","Stretch"],ImageSource:["StaticReference","Item","Equipment","Skill","UnitStatus","Faction","Currency","Prefab"],ImageFillType:["Unused","Horizontal","Vertical","Radial90","Radial180","Radial360"],ImageFillHorizontalType:["Left","Right"],ImageFillVerticalType:["Bottom","Top"],ImageFillRadial90Type:["BottomLeft","TopLeft","TopRight","BottomRight"],ImageFillRadialType:["Bottom","Left","Top","Right"],ImageMaskSoftEdgeMode:["Percentage","Pixel"],UIAnimationLayer:["AboveAllControls","BelowAllControls"]},_h=[...Array.from({length:43},(t,e)=>`CraftspersonKey${e+1}`),"MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","None"],Ih=[...Array.from({length:14},(t,e)=>`CraftspersonKey${e+1}`),"SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey","None"];function Ch(){let t=[];for(let e of["Down","Up"]){for(let i=1;i<=43;i++)t.push(`KeyboardCraftspersonKey${i}${e}`);for(let i of["MoveForwardKey","MoveBackwardKey","MoveLeftKey","MoveRightKey","SwitchToWalkOrRunKey","SprintKey","JumpKey","DropKey","OpenShortcutWheelKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key"])t.push(`Keyboard${i}${e}`);for(let i=1;i<=14;i++)t.push(`ControllerCraftspersonKey${i}${e}`);for(let i of["SprintKey","JumpKey","InteractKey","NormalAttackKey","CharacterSkill1Key","CharacterSkill2Key","CharacterSkill3Key","CharacterSkill4Key","MenuConfirmKey","MenuBackKey"])t.push(`Controller${i}${e}`)}return t}oo.KeyboardKeyCode=_h;oo.ControllerKeyCode=Ih;oo.KeyEventType=Ch();var gu=new Map;function $i(t,e){let i=`${t}\0${e}`,n=gu.get(i);return n||(n={__kind:"EnumItem",Name:e,FullName:`Enum.${t}.${e}`,EnumType:t},gu.set(i,n)),n}function ts(t,e){return e==null?e:e.__kind==="EnumItem"?$i(e.EnumType||t,e.Name):typeof e=="string"&&e?$i(t,e):e}function is(){let t={};for(let[e,i]of Object.entries(oo)){let n={};for(let r of i)n[r]=$i(e,r);t[e]=n}return t}var Ah=new Set(["id","Id","prefabIndex","imageId","fontSize","minimumFontSize","clickAudioId","itemCount","itemPrefabIndex","animationId","referencedPrefabIndex"]),kh=new Set(["imageColor","fontColor","bgColor","outlineColor"]),yu={horizontalAlignment:"TextHorizontalAlignment",verticalAlignment:"TextVerticalAlignment",imageSource:"ImageSource",imageType:"ImageType",fillType:"ImageFillType",fillHorizontalType:"ImageFillHorizontalType",fillVerticalType:"ImageFillVerticalType",fillRadial90Type:"ImageFillRadial90Type",fillRadialType:"ImageFillRadialType",softEdgeMode:"ImageMaskSoftEdgeMode",layer:"UIAnimationLayer",scrollDirection:"ScrollDirection",layoutConstraint:"ScrollLayoutConstraint"},Gi=d.LUA_REGISTRYINDEX,vu=d.LUA_MULTRET,Oh=Object.freeze({InstantiateClientUIControl:2,DestroyClientUIControl:1,GetClientUIControl:1,FindClientUIRoot:1,GetClientUIRoots:0,GetUICanvasSize:0,GetCursorUIPos:0,GetDevice:0,SetControllerFocus:1,GetControllerFocus:0,GetControllerLeftStickAxis:0,GetControllerRightStickAxis:0,Tween:3,TweenSequence:0,ServerSignal:1,GetGlobalCustomVariableValue:2,PauseLevelTime:1,IsLevelTimePaused:0,PlayAudio2D:1,StopAudio:1,IsAudioAlive:1,GetLanguageType:0,GetStageMode:0,IsTestPlay:0,GetText:1,PrintClientUITree:0});function et(t){return t==null?"":typeof t=="string"?t:t.Name||t.FullName||String(t)}var ao=class{constructor(e={}){this.canvasWidth=e.canvasWidth??1600,this.canvasHeight=e.canvasHeight??900,this.device=e.device??"KeyboardAndMouse",this.language=e.language??"LanguageChs",this.stageMode=e.stageMode??"Classic",this.testPlay=e.testPlay!==!1,this.canSelectImageType=e.canSelectImageType||(()=>!1),this.clock={time:0,levelTime:0,paused:!1,frame:0},this.logs=[],this.mountErrors=[],this.tweens=new Set,this.sequences=new Set,this.animations=new Set,this.audios=new Map,this.nextAudioId=1,this.audioDuration=e.audioDuration||(()=>null),this.audioHistory=[],this.audioWarnings=new Set,this.audioRevision=0,this._nextControlId=1,this._playRemoved=[],this._nextScriptMappingId=1,this.lifecyclePhase="idle",this.controlsById=new Map,this.roots=[],this.templates=new Map,this.scriptFiles=new Map,this.requireAliases=new Map,this.requireCache=new Map,this.moduleBaseEnvironments=new Map,this.luaFunctions=new Map,this.mountedScripts=[],this.serverVars={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)},this.serverBridge=null,this.varHandlers=[],this.signalHandlers=[],this.cursor={x:0,y:0},this.focus=null,this.stick={left:[0,0],right:[0,0]},this.enumTree=is(),this.luaStates=new Set,this.L=null}nextControlId(){let e=this._nextControlId;return this._nextControlId+=1,e}resolveScriptMappingId(e){let i=Number(e);if(Number.isSafeInteger(i)&&i>0)return this._nextScriptMappingId=Math.max(this._nextScriptMappingId,i+1),i;let n=this._nextScriptMappingId;return this._nextScriptMappingId+=1,n}pushPackedColor(e,i){let n=i>>>0;(n|0)===n?d.lua_pushinteger(e,n):d.lua_pushnumber(e,n)}retainLuaCallback(e){ru(e)}unrefLuaCallback(e){ou(this,e)}log(e,...i){let n=i.map(r=>r==null?"nil":typeof r=="object"&&r!==null&&r.__kind==="EnumItem"?r.Name:String(r)).join(" ");this.logs.push({level:e,text:n,time:this.clock.time})}safeCall(e,...i){try{return e(...i)}catch(n){this.log("lua-error",n&&n.message?n.message:String(n))}}scriptCanRun(e){if(!e?.alive||!e.enabled)return!1;let i=e.object;return!i||i.alive&&i.activeInHierarchy}cursorEventsEnabled(e){for(let i=e;i;i=i.parent)if(i.kind==="container"&&i.showCursor===!0)return!0;return!1}registerTemplate(e,i){this.templates.set(Number(e),i)}registerScriptFile(e,i){let n=this.normalizeRequirePath(e);this.scriptFiles.set(n,i),n.startsWith("default_import_file/")||this.requireAliases.set(`default_import_file/${n}`,n)}normalizeRequirePath(e){let i=String(e).replace(/\\/g,"/");return i.endsWith(".lua")&&(i=i.slice(0,-4)),i=i.replace(/\./g,"/"),i}addRoot(e){let i=e instanceof wi?e:new wi(this,e);return this.roots.push(i),Vt(i,n=>this.controlsById.set(n.Id,n)),this.mountSpecScripts(e,i),i}mountSpecScripts(e,i){if(e instanceof wi)return;let n=o=>(o.scripts?.length||0)>0||(o.children||[]).some(n);if(!e||!n(e))return;let r=this.lifecyclePhase;try{let o=(a,s)=>{for(let c of a.scripts||[])try{this.mountScript({path:c.path,source:c.source,control:s,scriptMappingId:c.scriptMappingId})}catch(f){let h=f&&f.message?f.message:String(f);this.mountErrors.push(h),this.log("lua-error",h)}let l=a.children||[];for(let c=0;c<l.length;c+=1)o(l[c],s?.children?.[c])};o(e,i)}finally{this.lifecyclePhase=r}}makeCursorEventData({x:e=0,y:i=0,pressX:n=e,pressY:r=i,deltaX:o=e-n,deltaY:a=i-r,dragging:s=!1,touchId:l=-1}={}){let c=this;return{__kind:"CursorEventData",typeofName:"CursorEventData",dragging:s,touchId:l,x:e,y:i,pressX:n,pressY:r,GetUIPos(){return[e,i]},GetPressUIPos(){return[n,r]},GetUIPosDelta(){return[o,a]}}}boot(){let e=this.newLuaThread();this.L=e}installGlobals(e){let i=this;d.lua_pushcfunction(e,n=>{let r=d.lua_gettop(n),o=[];for(let a=1;a<=r;a++)o.push(We(n,i,a));return i.log("info",...o),0}),d.lua_setglobal(e,B("print")),d.lua_pushcfunction(e,n=>{let r=d.lua_gettop(n),o=[];for(let a=1;a<=r;a++)o.push(We(n,i,a));return i.log("error",...o),0}),d.lua_setglobal(e,B("printerr")),d.lua_pushcfunction(e,n=>{if(d.lua_type(n,1)===d.LUA_TTABLE&&!Qt(n,1))return d.lua_pushstring(n,B("table")),1;let r=We(n,i,1);return d.lua_pushstring(n,B(i.typeofOf(r))),1}),d.lua_setglobal(e,B("typeof")),this.pushColorLib(e),this.pushEnumLib(e),this.pushGameLib(e),d.lua_pushcfunction(e,n=>i.luaRequire(n)),d.lua_setglobal(e,B("require"))}typeofOf(e){return e==null?"nil":e.__kind==="Script"?"Script":e.__kind==="EnumItem"?"EnumItem":e.__kind==="CursorEventData"?"CursorEventData":e.__kind==="ServerSignal"?"ServerSignal":e instanceof wn?"TweenSequence":e instanceof Xn?"Tween":e.typeofName?e.typeofName:typeof e=="number"?"number":typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e}pushColorLib(e){d.lua_newtable(e),d.lua_pushcfunction(e,i=>(this.pushPackedColor(i,vn(d.lua_tonumber(i,1),d.lua_tonumber(i,2),d.lua_tonumber(i,3),255)),1)),d.lua_setfield(e,-2,B("FromRGB")),d.lua_pushcfunction(e,i=>{let n=d.lua_isnoneornil(i,4)?255:d.lua_tonumber(i,4);return this.pushPackedColor(i,vn(d.lua_tonumber(i,1),d.lua_tonumber(i,2),d.lua_tonumber(i,3),n)),1}),d.lua_setfield(e,-2,B("FromRGBA")),d.lua_pushcfunction(e,i=>{let n=d.lua_tonumber(i,1)>>>0;for(let r of Hn(n))d.lua_pushinteger(i,r);return 4}),d.lua_setfield(e,-2,B("ToRGBA")),d.lua_newtable(e),d.lua_pushcfunction(e,i=>{let n=d.lua_tonumber(i,2),r=d.lua_tonumber(i,3),o=d.lua_tonumber(i,4),a=d.lua_isnoneornil(i,5)?255:d.lua_tonumber(i,5);return this.pushPackedColor(i,vn(n,r,o,a)),1}),d.lua_setfield(e,-2,B("__call")),d.lua_setmetatable(e,-2),d.lua_setglobal(e,B("Color"))}pushEnumLib(e){d.lua_newtable(e);for(let[i,n]of Object.entries(this.enumTree)){d.lua_newtable(e);for(let[r,o]of Object.entries(n))this.pushEnumItem(e,o),d.lua_setfield(e,-2,B(r));d.lua_setfield(e,-2,B(i))}d.lua_setglobal(e,B("Enum"))}pushEnumItem(e,i){let n=d.lua_newuserdata(e,0);Di(n,i),Ce.luaL_setmetatable(e,B("EnumItem"))}pushControl(e,i){let n=d.lua_newuserdata(e,0);Di(n,i),Ce.luaL_setmetatable(e,B("Control"))}pushScript(e,i){d.lua_newtable(e),d.lua_pushlightuserdata(e,Wa);let n=d.lua_newuserdata(e,0);Di(n,i),d.lua_rawset(e,-3),Ce.luaL_getmetatable(e,B("Script")),d.lua_setmetatable(e,-2)}pushTween(e,i){let n=d.lua_newuserdata(e,0);Di(n,i);let r=i instanceof wn?"TweenSequence":"Tween";Ce.luaL_setmetatable(e,B(r))}pushSignal(e,i){let n=d.lua_newuserdata(e,0);Di(n,i),Ce.luaL_setmetatable(e,B("ServerSignal"))}pushCursor(e,i){let n=d.lua_newuserdata(e,0);Di(n,i),Ce.luaL_setmetatable(e,B("CursorEventData"))}pushGameLib(e){let i=this;d.lua_newtable(e);let n={InstantiateClientUIControl:r=>{let o=d.lua_tointeger(r,1),a=ct(d.lua_touserdata(r,2)),s=i.instantiate(o,a,i.lifecyclePhase);return s?(i.pushControl(r,s),1):(d.lua_pushnil(r),1)},DestroyClientUIControl:r=>{let o=ct(d.lua_touserdata(r,1));return o&&i.destroyControl(o),0},GetClientUIControl:r=>{let o=d.lua_tointeger(r,1),a=i.controlsById.get(o);return a?i.pushControl(r,a):d.lua_pushnil(r),1},FindClientUIRoot:r=>{let o=ke(r,1),a=i.roots.find(s=>s.name===o);return a?i.pushControl(r,a):d.lua_pushnil(r),1},GetClientUIRoots:r=>(d.lua_createtable(r,i.roots.length,0),i.roots.forEach((o,a)=>{i.pushControl(r,o),d.lua_rawseti(r,-2,a+1)}),1),GetUICanvasSize:r=>(d.lua_pushnumber(r,i.canvasWidth),d.lua_pushnumber(r,i.canvasHeight),2),GetCursorUIPos:r=>(d.lua_pushnumber(r,i.cursor.x),d.lua_pushnumber(r,i.cursor.y),2),GetDevice:r=>(i.pushEnumItem(r,$i("Device",i.device)),1),SetControllerFocus:r=>(i.focus=ct(d.lua_touserdata(r,1)),0),GetControllerFocus:r=>(i.focus?i.pushControl(r,i.focus):d.lua_pushnil(r),1),GetControllerLeftStickAxis:r=>(d.lua_pushnumber(r,i.stick.left[0]),d.lua_pushnumber(r,i.stick.left[1]),2),GetControllerRightStickAxis:r=>(d.lua_pushnumber(r,i.stick.right[0]),d.lua_pushnumber(r,i.stick.right[1]),2),Tween:r=>{let o=ct(d.lua_touserdata(r,1))||We(r,i,1),a=We(r,i,2)||{},s=d.lua_tonumber(r,3),l=new Xn(i,o,a,s);return i.pushTween(r,l),1},TweenSequence:r=>(i.pushTween(r,new wn(i)),1),ServerSignal:r=>{let o=ke(r,1);return i.pushSignal(r,i.makeServerSignal(o)),1},GetGlobalCustomVariableValue:r=>{let o=et(We(r,i,1)),a=ke(r,2);return Ve(r,i,i.getVar(o,a)),1},PauseLevelTime:r=>(i.clock.paused=!!d.lua_toboolean(r,1),0),IsLevelTimePaused:r=>(d.lua_pushboolean(r,i.clock.paused),1),PlayAudio2D:r=>{let o=i.playAudio(i.audioInteger(r));return d.lua_pushinteger(r,o),1},StopAudio:r=>(i.stopAudio(i.audioInteger(r)),0),IsAudioAlive:r=>{let o=i.audios.get(i.audioInteger(r));return d.lua_pushboolean(r,!!(o&&o.alive)),1},GetLanguageType:r=>(i.pushEnumItem(r,$i("LanguageType",i.language)),1),GetStageMode:r=>(i.pushEnumItem(r,$i("StageMode",i.stageMode)),1),IsTestPlay:r=>(d.lua_pushboolean(r,i.testPlay),1),GetText:r=>{let o=ke(r,1);return d.lua_pushstring(r,B(o)),1},PrintClientUITree:r=>{for(let o of i.roots)i.log("info",Qa(o).join(`
123
+ `));return 0}};for(let[r,o]of Object.entries(n)){let a=Oh[r];if(a===void 0)throw new Error(`missing game arity for ${r}`);d.lua_pushcfunction(e,s=>{let l=d.lua_gettop(s);return l!==a?Ce.luaL_error(s,B(`bad argument count to '${r}' (${a} expected, got ${l})`)):o(s)}),d.lua_setfield(e,-2,B(r))}d.lua_setglobal(e,B("game"))}makeServerSignal(e){let i=[],n=this;return{__kind:"ServerSignal",name:e,AddParam(r,o){i.push({type:et(r),value:o})},AddInt(r){i.push({type:"Int",value:r})},AddIntList(r){i.push({type:"IntList",value:r})},AddFloat(r){i.push({type:"Float",value:r})},AddFloatList(r){i.push({type:"FloatList",value:r})},AddString(r){i.push({type:"String",value:r})},AddStringList(r){i.push({type:"StringList",value:r})},AddVector3(r){i.push({type:"Vector3",value:r})},AddVector3List(r){i.push({type:"Vector3List",value:r})},AddBool(r){i.push({type:"Bool",value:r})},AddBoolList(r){i.push({type:"BoolList",value:r})},AddGuid(r){i.push({type:"Guid",value:r})},AddGuidList(r){i.push({type:"GuidList",value:r})},AddEntity(r){i.push({type:"Entity",value:r})},AddEntityList(r){i.push({type:"EntityList",value:r})},AddPrefabId(r){i.push({type:"PrefabId",value:r})},AddPrefabIdList(r){i.push({type:"PrefabIdList",value:r})},AddConfigId(r){i.push({type:"ConfigId",value:r})},AddConfigIdList(r){i.push({type:"ConfigIdList",value:r})},SendSignal(){let r=i.slice();n.serverBridge&&typeof n.serverBridge.receiveFromClient=="function"&&n.serverBridge.receiveFromClient(e,r)}}}audioInteger(e){let i=d.lua_tonumber(e,1);return d.lua_type(e,1)!==d.LUA_TNUMBER||!Number.isSafeInteger(i)?Ce.luaL_error(e,B("audio argument must be an integer")):i}playAudio(e){this.audioRevision++;let i=this.nextAudioId++,n=this.audioDuration(e),r=Number.isFinite(n)&&n>0,o={instanceId:i,audioId:e,startedAt:this.clock.time,duration:r?n:0,alive:r,stopped:!1};return this.audioHistory.push(o),this.audioHistory.length>128&&this.audioHistory.shift(),r?(this.audios.size>=128&&this.stopAudio(this.audios.keys().next().value),this.audios.set(i,o)):this.audioWarnings.has(e)||(this.audioWarnings.size>=128&&this.audioWarnings.delete(this.audioWarnings.values().next().value),this.audioWarnings.add(e),this.log("warn",`\u97F3\u6548 ${e} \u672A\u5217\u5165\u6A21\u62DF\u5668\u97F3\u9891\u767D\u540D\u5355`)),i}stopAudio(e){let i=this.audios.get(e)||this.audioHistory.find(n=>n.instanceId===e);i&&!i.stopped&&(i.alive=!1,i.stopped=!0,this.audioRevision++),this.audios.delete(e)}audioSnapshot(){return{sequence:this.nextAudioId-1,revision:this.audioRevision,active:[...this.audios.values()].map(e=>({...e})),recent:this.audioHistory.map(e=>({...e}))}}instantiate(e,i,n){if(n==="OnInit"||n==="OnDestroy")return null;let r=this.templates.get(Number(e));if(!r||!i)return null;let o=new wi(this,{...r,Id:this.nextControlId(),authoringId:null,prefabIndex:Number(e)});return i.addChild(o),o.SetAsLastSibling(),Vt(o,a=>this.controlsById.set(a.Id,a)),this.mountSpecScripts(r,o),o}destroyControl(e){if(!(!e||!e.alive)){if(e._destroying)throw new Error(`\u5BA2\u6237\u7AEF\u63A7\u4EF6\u751F\u547D\u5468\u671F\u5904\u4E8E\u521B\u5EFA\u6216\u9500\u6BC1\u65F6\uFF0C\u65E0\u6CD5\u8C03\u7528DestroyClientUIControl, ID:${e.name}`);Vt(e,i=>{i._destroying=!0}),this._destroyControlTree(e)}}_destroyControlTree(e){this.releaseControlListeners(e);for(let i of e.scripts.slice())this.unmountScript(i);for(let i of e.children.slice())this._destroyControlTree(i);if(e.alive=!1,this.scrollControls?.delete(e),this.uiAnimations?.delete(e),this._playRemoved.push(e.Id),e.parent){let i=e.parent,n=i.children.indexOf(e);n>=0&&i.children.splice(n,1),e._parent=null,i.markPlayDirty(!0)}else{let i=this.roots.indexOf(e);i>=0&&this.roots.splice(i,1)}this.controlsById.delete(e.Id),this.focus===e&&(this.focus=null);for(let i of[...this.tweens])i.object===e&&i.Kill(!1)}releaseControlListeners(e){for(let i of e.cursorListeners.values())for(let n of i)this.unrefLuaCallback(n);for(let i of e.keyListeners.values())for(let n of i)this.unrefLuaCallback(n);for(let i of e.navListeners.values())for(let n of i)this.unrefLuaCallback(n);e.cursorListeners.clear(),e.keyListeners.clear(),e.navListeners.clear(),e.navConfig.clear()}onControlActiveChanging(e,i){let n=[];Vt(e,r=>n.push({control:r,was:r.activeInHierarchy})),e.active=!!i,e.markPlayDirty(!0);for(let r of n){let o=r.control.activeInHierarchy;if(r.was!==o)for(let a of r.control.scripts.slice())o?this.enableScript(a):this.disableScript(a)}}bindScriptEnv(e){let i=e.env;return i?(this.pushScript(i,e),d.lua_setglobal(i,B("script")),i):null}disableScript(e){if(!e?.alive||!e.env||e.lifecyclePhase!=="running")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnDisable",e.lifecyclePhase="OnDisable",this.bindScriptEnv(e),this.callGlobal(e.env,"OnDisable"),e.lifecyclePhase="disabled",this.lifecyclePhase=i}enableScript(e){if(!e?.alive||!e.env||e.lifecyclePhase!=="disabled")return;let i=this.lifecyclePhase;this.lifecyclePhase="OnEnable",e.lifecyclePhase="OnEnable",this.bindScriptEnv(e),this.callGlobal(e.env,"OnEnable"),e.lifecyclePhase="running",this.lifecyclePhase=i}unmountScript(e){if(!e||!e.alive)return;let i=e.env,n=this.lifecyclePhase;i&&(e.lifecyclePhase==="running"&&(this.lifecyclePhase="OnDisable",e.lifecyclePhase="OnDisable",this.bindScriptEnv(e),this.callGlobal(i,"OnDisable")),this.lifecyclePhase="OnDestroy",e.lifecyclePhase="OnDestroy",this.bindScriptEnv(e),this.callGlobal(i,"OnDestroy")),e.alive=!1,e.lifecyclePhase="destroyed",this.lifecyclePhase=n,this.mountedScripts=this.mountedScripts.filter(r=>r!==e),e.object&&(e.object.scripts=e.object.scripts.filter(r=>r!==e)),this.varHandlers=this.varHandlers.filter(r=>r.script!==e),this.signalHandlers=this.signalHandlers.filter(r=>r.script!==e),i&&i!==this.L&&this.closeTrackedLuaState(i),e.env=null}installMetatables(e){this.mtEnum(e),this.mtControl(e),this.mtScript(e),this.mtTween(e),this.mtSeq(e),this.mtSignal(e),this.mtCursor(e)}mtIndexNewindex(e,i,n,r,o,a){Ce.luaL_newmetatable(e,B(i)),d.lua_pushcfunction(e,s=>{let l=Qt(s,1)||ct(d.lua_touserdata(s,1)),c=ke(s,2);if(o[c]&&(!a||a(l,c)))return d.lua_pushcfunction(s,o[c]),1;let f;try{f=n(l,c)}catch(h){return Ce.luaL_error(s,B(String(h.message||h)))}return f===void 0?(d.lua_pushnil(s),1):(Ve(s,this,f),1)}),d.lua_setfield(e,-2,B("__index")),d.lua_pushcfunction(e,s=>{try{let l=Qt(s,1)||ct(d.lua_touserdata(s,1)),c=ke(s,2),f=We(s,this,3);return r(l,c,f),0}catch(l){return d.lua_pushstring(s,B(String(l.message||l))),d.lua_error(s)}}),d.lua_setfield(e,-2,B("__newindex")),d.lua_pushcfunction(e,s=>{let l=Qt(s,1)||ct(d.lua_touserdata(s,1)),c=Qt(s,2)||ct(d.lua_touserdata(s,2));return d.lua_pushboolean(s,l===c),1}),d.lua_setfield(e,-2,B("__eq")),d.lua_pop(e,1)}method(e){let i=this;return n=>{let r=Qt(n,1)||ct(d.lua_touserdata(n,1)),o=d.lua_gettop(n),a=[];for(let s=2;s<=o;s++)a.push(We(n,i,s));try{let s=e(r,...a);if(s===r)return d.lua_pushvalue(n,1),1;if(s===void 0)return 0;if(Array.isArray(s)&&s.__multi){for(let l of s)Ve(n,i,l);return s.length}if(Array.isArray(s)&&!(s.length&&typeof s[0]=="object"&&s[0]?.typeofName)){if(s.__controls)return d.lua_createtable(n,s.length,0),s.forEach((l,c)=>{i.pushControl(n,l),d.lua_rawseti(n,-2,c+1)}),1;if(s.__scripts)return d.lua_createtable(n,s.length,0),s.forEach((l,c)=>{i.pushScript(n,l),d.lua_rawseti(n,-2,c+1)}),1;if(typeof s[0]=="number"&&s.length<=4){for(let l of s)d.lua_pushnumber(n,l);return s.length}}return Ve(n,i,s),1}catch(s){return d.lua_pushstring(n,B(String(s.message||s))),d.lua_error(n)}}}mtEnum(e){let i=new Set(["Name","FullName","EnumType"]);this.mtIndexNewindex(e,"EnumItem",(n,r)=>i.has(r)?n[r]:void 0,(n,r)=>{throw new Error(`cannot set ${r}, no such field`)},{})}mtCursor(e){let i=new Set(["dragging","touchId"]);this.mtIndexNewindex(e,"CursorEventData",(n,r)=>i.has(r)?n[r]:void 0,(n,r)=>{throw new Error(`cannot set ${r}, no such field`)},{GetUIPos:this.method(n=>n.GetUIPos()),GetPressUIPos:this.method(n=>n.GetPressUIPos()),GetUIPosDelta:this.method(n=>n.GetUIPosDelta())})}mtControl(e){let i=this.method((r,o)=>r.SetVisible(o)),n={GetChildren:this.method(r=>{let o=r.GetChildren();return o.__controls=!0,o}),GetChild:this.method((r,o)=>r.GetChild(o)),FindChild:this.method((r,o)=>r.FindChild(o)),SetActive:this.method((r,o)=>r.SetActive(o)),SetVisible:r=>d.lua_isboolean(r,2)?i(r):Ce.luaL_error(r,B("bad argument #2 to 'SetVisible' (boolean expected, got %s)"),Ce.luaL_typename(r,2)),GetSiblingIndex:this.method(r=>r.GetSiblingIndex()),SetSiblingIndex:this.method((r,o)=>r.SetSiblingIndex(o)),SetAsFirstSibling:this.method(r=>r.SetAsFirstSibling()),SetAsLastSibling:this.method(r=>r.SetAsLastSibling()),GetAnchoredPosition:this.method(r=>r.GetAnchoredPosition()),SetAnchoredPosition:this.method((r,o,a)=>r.SetAnchoredPosition(o,a)),GetSizeDelta:this.method(r=>r.GetSizeDelta()),SetSizeDelta:this.method((r,o,a)=>r.SetSizeDelta(o,a)),GetAnchorMin:this.method(r=>r.GetAnchorMin()),SetAnchorMin:this.method((r,o,a)=>r.SetAnchorMin(o,a)),GetAnchorMax:this.method(r=>r.GetAnchorMax()),SetAnchorMax:this.method((r,o,a)=>r.SetAnchorMax(o,a)),GetPivot:this.method(r=>r.GetPivot()),SetPivot:this.method((r,o,a)=>r.SetPivot(o,a)),GetLocalScale:this.method(r=>r.GetLocalScale()),SetLocalScale:this.method((r,o,a,s)=>r.SetLocalScale(o,a,s)),GetLocalRotation:this.method(r=>r.GetLocalRotation()),SetLocalRotation:this.method((r,o,a,s)=>r.SetLocalRotation(o,a,s)),GetScriptByPath:this.method((r,o)=>r.GetScriptByPath(o)),GetScript:this.method((r,o)=>r.GetScript(o)),GetScripts:this.method(r=>{let o=r.GetScripts();return o.__scripts=!0,o}),AddCursorEventListener:this.method((r,o,a)=>r.AddCursorEventListener(et(o),a)),RemoveCursorEventListener:this.method((r,o,a)=>r.RemoveCursorEventListener(et(o),a)),RemoveCursorEventListeners:this.method((r,o)=>r.RemoveCursorEventListeners(et(o))),RemoveAllCursorEventListeners:this.method(r=>r.RemoveAllCursorEventListeners()),SimulateCursorClick:this.method(r=>r.SimulateCursorClick()),AddKeyEventListener:this.method((r,o,a)=>r.AddKeyEventListener(et(o),a)),RemoveKeyEventListener:this.method((r,o,a)=>r.RemoveKeyEventListener(et(o),a)),RemoveKeyEventListeners:this.method((r,o)=>r.RemoveKeyEventListeners(et(o))),RemoveAllKeyEventListeners:this.method(r=>r.RemoveAllKeyEventListeners()),AddNavigationEventListener:this.method((r,o,a)=>r.AddNavigationEventListener(et(o),a)),RemoveNavigationEventListener:this.method((r,o,a)=>r.RemoveNavigationEventListener(et(o),a)),RemoveNavigationEventListeners:this.method((r,o)=>r.RemoveNavigationEventListeners(et(o))),RemoveAllNavigationEventListeners:this.method(r=>r.RemoveAllNavigationEventListeners()),SetControllerNavigation:this.method((r,o,a,s)=>r.SetControllerNavigation(et(o),a,s)),GetControllerNavigation:this.method((r,o)=>r.GetControllerNavigation(et(o))),SetImage:this.method((r,o,a)=>r.SetImage(o,a)),SetSoftEdgeWidth:this.method((r,o,a)=>r.SetSoftEdgeWidth(o,a)),SetFillUnused:this.method(r=>r.SetFillUnused()),SetFillHorizontal:this.method((r,o,a)=>r.SetFillHorizontal(o,a)),SetFillVertical:this.method((r,o,a)=>r.SetFillVertical(o,a)),SetFillRadial90:this.method((r,o,a)=>r.SetFillRadial90(o,a)),SetFillRadial180:this.method((r,o,a)=>r.SetFillRadial180(o,a)),SetFillRadial360:this.method((r,o,a)=>r.SetFillRadial360(o,a)),PlayAnimation:this.method(r=>r.PlayAnimation()),StopAnimation:this.method(r=>r.StopAnimation()),RefreshItems:this.method((r,o,a)=>{this.retainLuaCallback(a);try{r.RefreshItems(o,a)}finally{this.unrefLuaCallback(a)}}),GetItemIndex:this.method((r,o)=>r.GetItemIndex(o)),GetItemSize:this.method(r=>r.GetItemSize()),GetItemSpacing:this.method(r=>r.GetItemSpacing()),GetPadding:this.method(r=>r.GetPadding()),ScrollToItemAt:this.method((r,o,a)=>r.ScrollToItemAt(o,a)),GetContentLength:this.method(r=>r.GetContentLength())};this.mtIndexNewindex(e,"Control",(r,o)=>{if(!Za(r,o))return;if(!r.alive&&o!=="alive")throw new Error(`attempt to read '${o}' of a destroyed control`);let a=r.luaFieldValue(o),s=yu[o];return s?ts(s,a):typeof a=="number"&&!Ah.has(o)&&!kh.has(o)?new jn(a):a},(r,o,a)=>{if(Za(r,o)==="rw"){if((o==="fontSize"||o==="minimumFontSize")&&!Number.isInteger(a)){let c=a===null?"nil":typeof a;throw new Error(`bad argument #2 to '${o}' (integer expected, got ${c})`)}let l=yu[o];if(o==="animationId"&&!Number.isSafeInteger(a))throw new Error("animationId requires an integer");if(o==="playSoundEffect"&&typeof a!="boolean")throw new Error("playSoundEffect requires a boolean");if(o==="layer"&&(a?.EnumType!=="UIAnimationLayer"||!["AboveAllControls","BelowAllControls"].includes(a.Name)))throw new Error("layer requires Enum.UIAnimationLayer");if(o==="imageType"&&(a?.EnumType!=="ImageType"||!["Basic","Stretch"].includes(a.Name)))throw new Error("imageType requires Enum.ImageType.Basic or Stretch");r[o]=l?ts(l,a):a,typeof r.markPlayDirty=="function"&&r.markPlayDirty(io.has(o));return}throw new Error(`cannot set ${o}, no such field`)},n,hu)}mtScript(e){let i=this,n=new Set(["alive","scriptMappingId","object","path","enabled"]);this.mtIndexNewindex(e,"Script",(r,o)=>n.has(o)?r[o]:void 0,(r,o,a)=>{if(o==="enabled"){r.enabled=!!a;return}throw new Error(`cannot set ${o}, no such field`)},{GetParam:this.method((r,o)=>Object.prototype.hasOwnProperty.call(r.params,o)?r.params[o]:null),Invoke:r=>i.luaInvoke(r),EnableUpdate:this.method((r,o)=>{r.updateEnabled=!!o}),RegisterServerSignalHandler:this.method((r,o,a)=>{i.signalHandlers.push({script:r,name:o,fn:a})}),UnregisterServerSignalHandler:this.method((r,o)=>{i.signalHandlers=i.signalHandlers.filter(a=>!(a.script===r&&a.name===o))}),RegisterCustomVariableChangedHandler:this.method((r,o,a,s)=>{i.varHandlers.push({script:r,entityType:et(o),name:a,fn:s})}),UnregisterCustomVariableChangedHandler:this.method((r,o,a)=>{let s=et(o);i.varHandlers=i.varHandlers.filter(l=>!(l.script===r&&l.entityType===s&&l.name===a))})})}mtTween(e){this.mtIndexNewindex(e,"Tween",()=>{},()=>{},{SetEase:this.method((i,n)=>i.SetEase(n)),SetRelative:this.method((i,n)=>i.SetRelative(n)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,n)=>i.Kill(n)),SetOnComplete:this.method((i,n)=>i.SetOnComplete(n)),SetOnStepComplete:this.method((i,n)=>i.SetOnStepComplete(n)),SetLoops:this.method((i,n)=>i.SetLoops(n))})}mtSeq(e){this.mtIndexNewindex(e,"TweenSequence",()=>{},()=>{},{Append:this.method((i,n)=>i.Append(n)),AppendInterval:this.method((i,n)=>i.AppendInterval(n)),AppendCallback:this.method((i,n)=>i.AppendCallback(n)),Join:this.method((i,n)=>i.Join(n)),Insert:this.method((i,n,r)=>i.Insert(n,r)),InsertCallback:this.method((i,n,r)=>i.InsertCallback(n,r)),Play:this.method(i=>i.Play()),Pause:this.method(i=>i.Pause()),Resume:this.method(i=>i.Resume()),Restart:this.method(i=>i.Restart()),Complete:this.method(i=>i.Complete()),Kill:this.method((i,n)=>i.Kill(n)),SetOnComplete:this.method((i,n)=>i.SetOnComplete(n)),SetOnStepComplete:this.method((i,n)=>i.SetOnStepComplete(n)),SetLoops:this.method((i,n)=>i.SetLoops(n))})}mtSignal(e){this.mtIndexNewindex(e,"ServerSignal",()=>{},()=>{},{AddParam:this.method((i,n,r)=>i.AddParam(n,r)),SendSignal:this.method(i=>i.SendSignal()),AddInt:this.method((i,n)=>i.AddInt(n)),AddIntList:this.method((i,n)=>i.AddIntList(n)),AddFloat:this.method((i,n)=>i.AddFloat(n)),AddFloatList:this.method((i,n)=>i.AddFloatList(n)),AddString:this.method((i,n)=>i.AddString(n)),AddStringList:this.method((i,n)=>i.AddStringList(n)),AddVector3:this.method((i,n)=>i.AddVector3(n)),AddVector3List:this.method((i,n)=>i.AddVector3List(n)),AddBool:this.method((i,n)=>i.AddBool(n)),AddBoolList:this.method((i,n)=>i.AddBoolList(n)),AddGuid:this.method((i,n)=>i.AddGuid(n)),AddGuidList:this.method((i,n)=>i.AddGuidList(n)),AddEntity:this.method((i,n)=>i.AddEntity(n)),AddEntityList:this.method((i,n)=>i.AddEntityList(n)),AddPrefabId:this.method((i,n)=>i.AddPrefabId(n)),AddPrefabIdList:this.method((i,n)=>i.AddPrefabIdList(n)),AddConfigId:this.method((i,n)=>i.AddConfigId(n)),AddConfigIdList:this.method((i,n)=>i.AddConfigIdList(n))})}luaRequire(e){let i=ke(e,1),n=this.normalizeRequirePath(i),r=this.requireAliases.get(n)||n;d.lua_rawgeti(e,Gi,d.LUA_RIDX_MAINTHREAD);let o=d.lua_tothread(e,-1);d.lua_pop(e,1);let a=this.requireCache.get(o);a||(a=new Map,this.requireCache.set(o,a));let s=a.get(r);if(s?.loading)return d.lua_pushstring(e,B(`failed to load script '${n}': cyclic require`)),d.lua_error(e);if(s&&s.ref!=null)return d.lua_rawgeti(e,Gi,s.ref),1;let l=this.scriptFiles.get(r);if(l==null)return d.lua_pushstring(e,B(`failed to load script '${n}'`)),d.lua_error(e);let c=d.lua_gettop(e);a.set(r,{loading:!0});try{this.loadModule(e,o,r,l),d.lua_pushvalue(e,-1);let f=Ce.luaL_ref(e,Gi);return a.set(r,{ref:f}),1}catch(f){return a.delete(r),d.lua_settop(e,c),d.lua_pushstring(e,B(`failed to load script '${n}': ${f.message||f}`)),d.lua_error(e)}}newLuaThread(){let e=Ce.luaL_newstate();return tu.luaL_openlibs(e),su(e),this.installMetatables(e),this.installGlobals(e),this.luaStates.add(e),d.lua_pushglobaltable(e),this.copyLuaEnvironment(e,-1),d.lua_remove(e,-2),this.moduleBaseEnvironments.set(e,Ce.luaL_ref(e,Gi)),e}copyLuaEnvironment(e,i){let n=d.lua_absindex(e,i);d.lua_newtable(e);let r=d.lua_absindex(e,-1);for(d.lua_pushnil(e);d.lua_next(e,n)!==0;)d.lua_pushvalue(e,-2),d.lua_pushvalue(e,-2),d.lua_rawset(e,r),d.lua_pop(e,1);d.lua_pushvalue(e,r),d.lua_setfield(e,r,B("_G"))}closeTrackedLuaState(e){if(!e||!this.luaStates.has(e))return;for(let n of this.requireCache.get(e)?.values()||[])n.ref!=null&&Ce.luaL_unref(e,Gi,n.ref);this.requireCache.delete(e);let i=this.moduleBaseEnvironments.get(e);if(i!=null&&Ce.luaL_unref(e,Gi,i),this.moduleBaseEnvironments.delete(e),this.luaStates.delete(e),this.luaFunctions)for(let[n,r]of this.luaFunctions)r.__luaState===e&&this.luaFunctions.delete(n);au(e)}loadModule(e,i,n,r){let o={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(),object:null,path:n,enabled:!0,updateEnabled:!1,params:{},env:e,invoke(){}},a=String(r).replace(/^\uFEFF/,""),s=eo(a);if(Ce.luaL_loadbuffer(e,s,s.length,B(`@${n}`))!==Ot)throw new Error(ke(e,-1));let c=d.lua_absindex(e,-1);if(d.lua_rawgeti(e,Gi,this.moduleBaseEnvironments.get(i)),this.copyLuaEnvironment(e,-1),d.lua_remove(e,-2),this.pushScript(e,o),d.lua_setfield(e,-2,B("script")),d.lua_setupvalue(e,c,1),d.lua_pcall(e,0,1,0)!==Ot)throw new Error(ke(e,-1))}mountScript({path:e,source:i,control:n,params:r={},scriptMappingId:o=void 0}){this.L||this.boot();let a=this.newLuaThread(),s={__kind:"Script",alive:!0,scriptMappingId:this.resolveScriptMappingId(o),object:n,path:this.normalizeRequirePath(e),enabled:!0,updateEnabled:!1,params:r,env:a,lifecyclePhase:"idle"};s.invoke=(c,f)=>this.invokeOn(a,c,f),n&&n.scripts.push(s),this.mountedScripts.push(s),this.pushScript(a,s),d.lua_setglobal(a,B("script"));let l=this.lifecyclePhase;try{this.lifecyclePhase="OnInit",s.lifecyclePhase="OnInit",this.runChunk(a,i,e);let c=this.callGlobal(a,"OnInit");c&&this.mountErrors.push(c),this.lifecyclePhase="OnEnable",s.lifecyclePhase="OnEnable";let f=this.callGlobal(a,"OnEnable");f&&this.mountErrors.push(f),this.lifecyclePhase="OnStart",s.lifecyclePhase="OnStart";let h=this.callGlobal(a,"OnStart");return h&&this.mountErrors.push(h),this.lifecyclePhase="running",s.lifecyclePhase="running",s}catch(c){throw s.alive=!1,s.lifecyclePhase="failed",this.mountedScripts=this.mountedScripts.filter(f=>f!==s),n&&(n.scripts=n.scripts.filter(f=>f!==s)),this.varHandlers=this.varHandlers.filter(f=>f.script!==s),this.signalHandlers=this.signalHandlers.filter(f=>f.script!==s),this.lifecyclePhase=l,a&&a!==this.L&&this.closeTrackedLuaState(a),s.env=null,c}}runChunk(e,i,n){let r=String(i).replace(/^\uFEFF/,""),o=eo(r),a=Ce.luaL_loadbuffer(e,o,o.length,B(`@${n}`));if(a!==Ot){let l=ke(e,-1)||`luaL_loadbuffer status ${a}`;throw d.lua_pop(e,1),new Error(l)}let s=d.lua_pcall(e,0,0,0);if(s!==Ot){let l=ke(e,-1)||`lua_pcall status ${s}`;throw d.lua_pop(e,1),new Error(l)}}callGlobal(e,i){if(d.lua_getglobal(e,B(i)),d.lua_isfunction(e,-1)){if(d.lua_pcall(e,0,0,0)!==Ot){let r=ke(e,-1);d.lua_pop(e,1);let o=`${i}: ${r}`;return this.log("lua-error",o),o}}else d.lua_pop(e,1);return null}callGlobalDt(e,i,n){if(d.lua_getglobal(e,B(i)),d.lua_isfunction(e,-1)){if(d.lua_pushnumber(e,n),d.lua_pcall(e,1,0,0)!==Ot){let o=ke(e,-1);d.lua_pop(e,1),this.log("lua-error",`${i}: ${o}`)}}else d.lua_pop(e,1)}luaInvoke(e){let i=Qt(e,1);if(!i||i.__kind!=="Script")return Ce.luaL_error(e,B("bad self to 'Invoke' (Script expected)"));let n=ke(e,2),r=i.env;if(!r||r.l_G!==e.l_G){let l=[];for(let h=3;h<=d.lua_gettop(e);h++)l.push(We(e,this,h));let c;try{c=i.invoke(n,l)}catch(h){return Ce.luaL_error(e,B(String(h.message||h)))}if(c===void 0)return 0;let f=Array.isArray(c)&&c.__multi?c:[c];for(let h of f)Ve(e,this,h);return f.length}let o=2;if(d.lua_getglobal(e,B(n)),!d.lua_isfunction(e,-1))return 0;d.lua_replace(e,o),d.lua_remove(e,1);let a=d.lua_gettop(e)-1;return d.lua_pcall(e,a,vu,0)!==Ot?d.lua_error(e):d.lua_gettop(e)}invokeOn(e,i,n){let r=d.lua_gettop(e);if(d.lua_getglobal(e,B(i)),!d.lua_isfunction(e,-1)){d.lua_settop(e,r);return}for(let l of n)Ve(e,this,l);if(d.lua_pcall(e,n.length,vu,0)!==Ot){let l=ke(e,-1);throw d.lua_settop(e,r),new Error(l)}let a=d.lua_gettop(e)-r;if(a<=0){d.lua_settop(e,r);return}if(a===1){let l=We(e,this,-1);return d.lua_settop(e,r),l}let s=[];for(let l=1;l<=a;l++)s.push(We(e,this,r+l));return d.lua_settop(e,r),s.__multi=!0,s}runScriptPhase(e,i){for(let n of this.mountedScripts){if(!this.scriptCanRun(n))continue;let r=n.env;r&&(this.pushScript(r,n),d.lua_setglobal(r,B("script")),!(e==="OnUpdate"&&!n.updateEnabled)&&this.callGlobalDt(r,e,i))}}step(e=1/30){if(typeof e!="number"||!Number.isFinite(e)||e<0)throw new TypeError("dt must be a finite non-negative number");this.clock.frame++,this.clock.time+=e;for(let[n,r]of this.audios)this.clock.time+1e-9>=r.startedAt+r.duration&&(r.alive=!1,this.audios.delete(n),this.audioRevision++);let i=!this.clock.paused;for(let n of[...this.animations])n.step(e);this.runScriptPhase("OnUpdate",e),i&&(this.clock.levelTime+=e,this.runScriptPhase("OnLevelUpdate",e))}injectKey(e){let i=n=>{if(!n.alive||!n.activeInHierarchy)return!1;if(n.keyListeners.has(e)&&n.emitKey(e))return!0;for(let r of[...n.children])if(i(r))return!0;return!1};for(let n of[...this.roots])i(n)}injectCursor(e,i,n){let r=n||this.makeCursorEventData({});Number.isFinite(r.x)&&Number.isFinite(r.y)&&(this.cursor.x=r.x,this.cursor.y=r.y),e.emitCursor(i,r)}getVar(e,i){if(this.serverBridge&&typeof this.serverBridge.getVar=="function")return this.serverBridge.getVar(e,i);let n=this.serverVars[e];return n?n[i]:void 0}notifyVarHandlers(e,i){for(let n of this.varHandlers)this.scriptCanRun(n.script)&&n.entityType===e&&n.name===i&&this.safeCall(n.fn,this.enumTree.CustomVariableEntityType[e],i)}setVar(e,i,n){if(this.serverBridge&&typeof this.serverBridge.setVar=="function"){this.serverBridge.setVar(e,i,n);return}let r=this.serverVars[e]||(this.serverVars[e]=Object.create(null));r[i]=n,this.notifyVarHandlers(e,i)}sendClientSignal(e,i){for(let n of this.signalHandlers)this.scriptCanRun(n.script)&&n.name===e&&this.safeCall(n.fn,e,i)}evalQueryScript(e,i){this.L||this.boot();let n=this.L;d.lua_createtable(n,0,5);let r=(o,a)=>{d.lua_pushcfunction(n,a),d.lua_setfield(n,-2,B(o))};return r("var",o=>(Ve(o,this,i.var(ke(o,1),ke(o,2))),1)),r("logContains",o=>(d.lua_pushboolean(o,i.logContains(ke(o,1))),1)),r("control",o=>(Ve(o,this,i.control(ke(o,1))),1)),r("logs",o=>(Ve(o,this,i.logs()),1)),r("signals",o=>(Ve(o,this,i.signals(ke(o,1))),1)),r("serverLogs",o=>(Ve(o,this,i.serverLogs?i.serverLogs():[]),1)),r("serverLogContains",o=>{let a=i.serverLogContains;return d.lua_pushboolean(o,a?!!a(ke(o,1)):!1),1}),d.lua_setglobal(n,B("query")),this.runChunk(n,e,"autotest-assert"),!0}destroy(){for(let e of this.roots.slice())this.destroyControl(e);for(let e of this.mountedScripts.slice())this.unmountScript(e);this.lifecyclePhase="idle",this.mountedScripts=[],this.luaFunctions.clear();for(let e of[...this.luaStates])this.closeTrackedLuaState(e);this.L=null,this.audios.clear(),this.audioHistory.length=0,this.audioWarnings.clear()}};function Kn(t){let e=new ao(t);return e.boot(),e}var Bi=Object.freeze(Array.from({length:8},(t,e)=>`Player${e+1}`)),os=Object.freeze(Array.from({length:8},(t,e)=>`Avatar${e+1}`)),Au=Object.freeze(["Level","PlayerSelf","AvatarSelf"]);var ns=Object.freeze([...Au,...Bi,...os]),ku=Object.freeze(["PlayerSelf","AllPlayers",...Bi]),Th=Object.freeze(["Level","PlayerSelf",...Bi]),wu=Object.freeze(["Int","Float","String","Bool","Vector3","Entity","Guid","PrefabId","ConfigId","IntList","FloatList","StringList","BoolList","Vector3List","EntityList","GuidList","PrefabIdList","ConfigIdList","Dict","Struct"]),Rh=-2147483648,Nh=2147483647,Ph=new Set(["set-custom-variable","get-custom-variable","custom-variable-changed","\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u53D8\u91CF","\u83B7\u53D6\u81EA\u5B9A\u4E49\u53D8\u91CF","\u81EA\u5B9A\u4E49\u53D8\u91CF\u53D8\u5316\u65F6","send-signal","listen-signal","send-client-script-signal","\u53D1\u9001\u4FE1\u53F7","\u76D1\u542C\u4FE1\u53F7","\u53D1\u9001\u5BA2\u6237\u7AEF\u811A\u672C\u4FE1\u53F7","setVar","getVar","signal","var"]);function Wn(t){return`Player${Number(t)}`}function so(t){return`Avatar${Number(t)}`}function Su(t){let e=String(t||"").match(/^(?:Player|Avatar)([1-8])$/);return e?Number(e[1]):0}function Vi(t){if(t==null||t==="")return 1;let e=Number(t);if(!Number.isInteger(e)||e<1||e>8)throw new Error("playerCount must be an integer 1-8");return e}function ei(t,e=8){let i=Vi(e);if(t==null||t==="")return 1;let n=Number(t);if(!Number.isInteger(n)||n<1||n>i)throw new Error(`playerIndex must be an integer 1-${i}`);return n}function Eu(){let t={Level:Object.create(null),PlayerSelf:Object.create(null),AvatarSelf:Object.create(null)};for(let e of Bi)t[e]=Object.create(null);for(let e of os)t[e]=Object.create(null);return t}function Ou(t){let e=String(t||"");if(!ns.includes(e))throw new Error(`unknown CustomVariableEntityType: ${t}`);return e}function Fh(t,e){let i=Ou(t);if(!Th.includes(i))throw new Error(`${e}.entityType must be Level, PlayerSelf, or Player1-8`);return i}function Jn(t){let e=String(t??"");if(!e)throw new Error("custom variable name is required");return e}function lo(t){let e=String(t??"");if(!e)throw new Error("signal name is required");return e}function rs(t){let e=String(t||"PlayerSelf");if(!ku.includes(e))throw new Error(`unsupported client signal target: ${t}. use PlayerSelf, AllPlayers, or Player1-8`);return e}function Zn(t){if(t==null)return"";if(typeof t=="boolean")return"Bool";if(typeof t=="string")return"String";if(typeof t=="number")return Number.isInteger(t)?"Int":"Float";if(Array.isArray(t)){if(t.length===0)return"IntList";let e=Zn(t[0]);return e&&!e.endsWith("List")&&e!=="Dict"&&e!=="Struct"?`${e}List`:"IntList"}return t&&typeof t=="object"?"x"in t||"y"in t||"z"in t?"Vector3":"Dict":""}function at(t){return t===void 0?null:JSON.parse(JSON.stringify(t))}function xu(t){return Array.isArray(t)?t.map(e=>e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"value")&&"type"in e?e.value:e):[]}function _u(t){return Array.isArray(t)?t.map(e=>e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"value")&&"type"in e?{type:String(e.type||""),value:e.value}:{type:Zn(e),value:e}):[]}function Mh(t){return String(t?.kind||t?.type||t?.name||t?.id||"")}function co(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Tu(t,e){if(!co(t)||!Object.prototype.hasOwnProperty.call(t,"fromSignalParam"))return null;if(Object.keys(t).some(n=>n!=="fromSignalParam"))throw new Error(`${e}.fromSignalParam cannot be combined with literal fields`);let i=Number(t.fromSignalParam);if(!Number.isSafeInteger(i)||i<0)throw new Error(`${e}.fromSignalParam must be a non-negative integer`);return{fromSignalParam:i}}function Iu(t,e){return Tu(t,e)||at(t)}function zh(t,e,i){if(!co(t))throw new Error(`serverLogic.rules[${e}].actions[${i}] must be an object`);let n=String(t.kind||t.type||""),r=`serverLogic.rules[${e}].actions[${i}]`;if(n==="setCustomVariable"){let o=Fh(t.entityType,r);if(!Object.prototype.hasOwnProperty.call(t,"value"))throw new Error(`${r}.value is required`);return{kind:n,entityType:o,name:Jn(t.name),value:Iu(t.value,`${r}.value`),...t.variableType?{variableType:String(t.variableType)}:{}}}if(n==="sendClientScriptSignal"){if(!Array.isArray(t.params))throw new Error(`${r}.params must be an array`);return{kind:n,target:rs(t.target),signalName:lo(t.signalName),params:t.params.map((o,a)=>Iu(o,`${r}.params[${a}]`))}}throw new Error(`${r}.kind must be setCustomVariable or sendClientScriptSignal`)}function Qn(t){if(t==null)return{version:1,rules:[]};if(!co(t))throw new Error("serverLogic must be an object");let e=t.rules===void 0?[]:t.rules;if(!Array.isArray(e))throw new Error("serverLogic.rules must be an array");return{version:1,rules:e.map((i,n)=>{if(!co(i))throw new Error(`serverLogic.rules[${n}] must be an object`);if(!Array.isArray(i.actions)||i.actions.length===0)throw new Error(`serverLogic.rules[${n}].actions must be a non-empty array`);return{id:String(i.id||`signal-${n+1}`),signalName:lo(i.signalName),actions:i.actions.map((r,o)=>zh(r,n,o))}})}}function Cu(t,e,{typed:i=!1}={}){let n=Tu(t,"server logic value");if(n){let r=i?e.params:e.values;if(n.fromSignalParam>=r.length)throw new Error(`signal ${e.name} has no parameter at index ${n.fromSignalParam}`);return at(r[n.fromSignalParam])}return at(t)}function Dh(t){return t==="Level"?"Level":Bi.includes(t)?"PlayerSelf":os.includes(t)?"AvatarSelf":t}function Ru(t={}){let e=Eu(),i=Eu(),n=[],r=[],o=[],a=[],s=Array.from({length:9},()=>null),l=1,c=0,f=Number(t.onlineLatencyMs||0);(!Number.isFinite(f)||f<0)&&(f=0);let h=Qn(t.logic),m=Vi(t.playerCount),p=ei(t.viewPlayerIndex,m);function b(x,O){a.push({source:"server",level:String(x||"engine"),text:String(O),time:c})}function g(x){let O=s[x||p],y=Number(O?.clock?.time);Number.isFinite(y)&&(c=y)}function w(x,O,y,P){e[x][O]=y,i[x][O]={type:P||Zn(y)||i[x][O]?.type||""}}function S(x,O,y){return typeof y!="number"||!Number.isInteger(y)?{ok:!0,value:y}:y>=Rh&&y<=Nh?{ok:!0,value:y}:(b("engine",`Int custom variable ${x}.${O} out of range ${y}; keeping previous legal value`),{ok:!1,value:e[x][O]})}function _(x,O){let y=Ou(x),P=O||p;return y==="PlayerSelf"?Wn(P):y==="AvatarSelf"?so(P):y}function G(x,O){let y=Dh(x);if(x==="Level"){for(let u=1;u<=m;u+=1){let E=s[u];E&&typeof E.notifyVarHandlers=="function"&&E.notifyVarHandlers("Level",O)}return}let P=Su(x);if(!P)return;let A=s[P];A&&typeof A.notifyVarHandlers=="function"&&A.notifyVarHandlers(y,O)}function I(x,O){let y=rs(x);return y==="AllPlayers"?Array.from({length:m},(P,A)=>A+1):y==="PlayerSelf"?[O||p]:[Su(y)]}function $(x){for(let O of h.rules)if(O.signalName===x.name)for(let y of O.actions){if(y.kind==="setCustomVariable"){let P=Cu(y.value,x);q.setVar(y.entityType,y.name,P,{type:y.variableType,playerIndex:x.playerIndex}),b("info",`logic ${O.id}: set ${y.entityType}.${y.name}`);continue}if(y.kind==="sendClientScriptSignal"){let P=y.params.map(A=>Cu(A,x,{typed:!0}));q.sendToClient(y.signalName,P,{target:y.target,playerIndex:x.playerIndex}),b("info",`logic ${O.id}: sent ${y.signalName} to ${y.target}`)}}}function V(x,O){x&&(x.serverBridge={getVar:(y,P)=>q.getVar(y,P,{playerIndex:O}),setVar:(y,P,A)=>q.setVar(y,P,A,{playerIndex:O}),receiveFromClient:(y,P)=>q.receiveFromClient(y,P,{playerIndex:O})})}function Y(x){x&&(x.serverBridge=null)}let q={ENTITY_TYPES:Au,ALL_ENTITY_TYPES:ns,CLIENT_SIGNAL_TARGETS:ku,get clock(){return c},get playerCount(){return m},get viewPlayerIndex(){return p},setClock(x){c=Number(x)||0},setPlayerCount(x){return m=Vi(x),p>m&&(p=m),m},setViewPlayerIndex(x){return p=ei(x,m),p},log(x,O){b(x,O)},defineVar(x,O,y={},{playerIndex:P}={}){let A=_(x,P),u=Jn(O);if(Object.prototype.hasOwnProperty.call(e[A],u))throw new Error(`custom variable already exists: ${A}.${u}`);let E=y.type?String(y.type):Zn(y.value??y.defaultValue);if(E&&!wu.includes(E))throw new Error(`unsupported custom variable type: ${E}`);let M=y.value!==void 0?y.value:y.defaultValue!==void 0?y.defaultValue:null;return w(A,u,M,E),q.getVar(A,u)},getVar(x,O,{playerIndex:y}={}){let P=_(x,y),A=Jn(O);if(!Object.prototype.hasOwnProperty.call(e[P],A)){b("engine",`GetGlobalCustomVariableValue missing ${P}.${A}; returning nil (simulator policy)`);return}return e[P][A]},setVar(x,O,y,{notify:P=!0,type:A,playerIndex:u}={}){let E=_(x,u),M=Jn(O),j=A||i[E][M]?.type||Zn(y);if(j&&!wu.includes(j)&&j!=="")throw new Error(`unsupported custom variable type: ${j}`);let H=y;if(!((j==="Int"||j===""&&typeof y=="number"&&Number.isInteger(y))&&(H=S(E,M,y).value,H===void 0)))return w(E,M,H,j),P&&G(E,M),H},listVars(x){let O=x?[_(x)]:["Level",...Array.from({length:m},(P,A)=>Wn(A+1)),...Array.from({length:m},(P,A)=>so(A+1))],y=[];for(let P of O)for(let A of Object.keys(e[P]))y.push({entityType:P,name:A,type:i[P][A]?.type||"",value:at(e[P][A])});return y},receiveFromClient(x,O=[],{playerIndex:y}={}){let P=ei(y||p,m);g(P);let A=lo(x),u={id:l++,direction:"inbound",name:A,params:_u(O),values:xu(O),time:c,playerIndex:P,from:Wn(P)};return n.push(u),$(u),u},sendToClient(x,O=[],{target:y="PlayerSelf",playerIndex:P}={}){let A=lo(x),u=rs(y),M=I(u,P||p),j={id:l++,direction:"outbound",name:A,params:_u(O),values:xu(O),time:c,target:u,players:M,deliverAt:c+f/1e3,delivered:!1};return r.push(j),f===0?q.deliver(j):o.push(j),j},getLogic(){return at(h)},setLogic(x){return h=Qn(x),q.getLogic()},deliver(x){if(!x||x.delivered)return;x.delivered=!0;let O=Array.isArray(x.players)&&x.players.length?x.players:I(x.target);for(let y of O){let P=s[y];P&&typeof P.sendClientSignal=="function"&&P.sendClientSignal(x.name,x.values)}},flush(x){x!==void 0&&(c=Number(x)||0);let O=[];for(let y=o.length-1;y>=0;y-=1)o[y].deliverAt<=c&&O.push(o.splice(y,1)[0]);O.sort((y,P)=>y.id-P.id);for(let y of O)q.deliver(y);return O},inbound(){return n.slice()},outbound(){return r.slice()},loadConfig(x){if(x!=null){if(typeof x!="object")throw new Error("server config must be an object");if(x.graph&&!Array.isArray(x.nodes))throw new Error("unsupported server node graph: v1 only accepts custom variables and signals");for(let O of x.nodes||[]){let y=Mh(O);if(!Ph.has(y))throw new Error(`unsupported server node: ${y||JSON.stringify(O)}. v1 only supports custom variables and signals`)}if(x.onlineLatencyMs!==void 0){let O=Number(x.onlineLatencyMs);if(!Number.isFinite(O)||O<0)throw new Error("onlineLatencyMs must be a non-negative finite number");f=O}x.playerCount!==void 0&&q.setPlayerCount(x.playerCount),x.viewPlayerIndex!==void 0&&q.setViewPlayerIndex(x.viewPlayerIndex),(x.logic!==void 0||x.serverLogic!==void 0)&&q.setLogic(x.logic??x.serverLogic);for(let O of x.vars||[]){let y=_(O.entityType),P=Jn(O.name);Object.prototype.hasOwnProperty.call(e[y],P)?q.setVar(y,P,O.value??O.defaultValue,{notify:!1,type:O.type}):q.defineVar(y,P,O)}}},attachRuntime(x,{playerIndex:O=1}={}){let y=ei(O,8);return s[y]&&s[y]!==x&&Y(s[y]),s[y]=x||null,V(s[y],y),q},attachRuntimes(x){q.detachRuntime();let O=Array.isArray(x)?x:[];for(let y=0;y<O.length&&y<8;y+=1)s[y+1]=O[y]||null,V(s[y+1],y+1);return q},detachRuntime(){for(let x=1;x<=8;x+=1)Y(s[x]),s[x]=null},snapshot(){let x=Wn(p),O=so(p),y={Level:{},PlayerSelf:{},AvatarSelf:{}};for(let P of Object.keys(e.Level))y.Level[P]={type:i.Level[P]?.type||"",value:at(e.Level[P])};for(let P of Object.keys(e[x]))y.PlayerSelf[P]={type:i[x][P]?.type||"",value:at(e[x][P])};for(let P of Object.keys(e[O]))y.AvatarSelf[P]={type:i[O][P]?.type||"",value:at(e[O][P])};for(let P=1;P<=m;P+=1){let A=Wn(P),u=so(P);y[A]={},y[u]={};for(let E of Object.keys(e[A]))y[A][E]={type:i[A][E]?.type||"",value:at(e[A][E])};for(let E of Object.keys(e[u]))y[u][E]={type:i[u][E]?.type||"",value:at(e[u][E])}}return{clock:c,onlineLatencyMs:f,playerCount:m,viewPlayerIndex:p,logic:q.getLogic(),vars:y,inbound:n.map(P=>({id:P.id,name:P.name,params:at(P.params),values:at(P.values),time:P.time,playerIndex:P.playerIndex,from:P.from})),outbound:r.map(P=>({id:P.id,name:P.name,params:at(P.params),values:at(P.values),time:P.time,target:P.target,players:Array.isArray(P.players)?P.players.slice():[],deliverAt:P.deliverAt,delivered:!!P.delivered})),logs:a.map(P=>({source:"server",level:P.level,text:P.text,time:P.time}))}},reset(){for(let x of ns){for(let O of Object.keys(e[x]))delete e[x][O];for(let O of Object.keys(i[x]))delete i[x][O]}n.length=0,r.length=0,o.length=0,a.length=0,l=1,c=0},destroy(){q.detachRuntime(),q.reset()}};t.config&&q.loadConfig(t.config);for(let x of t.vars||[])q.defineVar(x.entityType,x.name,x);return q}var $h={container:"container",textbox:"textbox",image:"image",button:"button",cursor:"cursor",grid:"grid",reference:"reference",textwindow:"textwindow",keyhint:"keyhint",animation:"animation",fullscreen:"fullscreen"};function as(t,e,i=null){let n=ai(t.transformByPlatform,e),r={authoringId:t.id,kind:$h[t.kind]||"container",name:t.name,prefabIndex:t.guid||0,active:t.active!==!1,visible:t.visible!==!1,canControllerFocus:t.canControllerFocus===!0,anchoredPositionX:n.offset.x,anchoredPositionY:n.offset.y,sizeDeltaX:n.size.x,sizeDeltaY:n.size.y,anchorMinX:n.anchorMin.x,anchorMinY:n.anchorMin.y,anchorMaxX:n.anchorMax.x,anchorMaxY:n.anchorMax.y,pivotX:n.pivot.x,pivotY:n.pivot.y,localScaleX:n.scale.x,localScaleY:n.scale.y,localScaleZ:n.scale.z,localRotationX:n.rotation.x,localRotationY:n.rotation.y,localRotationZ:n.rotation.z,children:(t.children||[]).map(a=>as(a,e,i))},o=i?.get(t.id);if(o?.length&&(r.scripts=o.map(a=>{let s=Number(a.guid);return{path:a.path||a.id,source:a.source||"",...Number.isSafeInteger(s)&&s>0?{scriptMappingId:s}:{}}})),t.kind==="container"&&(r.isolateNavigation=t.isolateNavigation===!0,r.disableKeyEventPassthrough=t.disableKeyEventPassthrough===!0,r.disableCursorEventPassthrough=t.disableCursorEventPassthrough===!0,r.showCursor=t.showCursor===!0),(t.kind==="textbox"||t.kind==="textwindow")&&(r.text=t.text??"",r.fontSize=t.fontSize,r.adaptiveFontSize=t.adaptiveFontSize===!0,r.minimumFontSize=t.minimumFontSize,r.fontColor=t.fontColor,r.bgColor=t.bgColor,r.enableOutline=t.enableOutline!==!1,r.outlineColor=t.outlineColor,r.horizontalAlignment=t.horizontalAlignment||"Left",r.verticalAlignment=t.verticalAlignment||"Top",t.kind==="textwindow"&&(r.interactable=t.interactable!==!1,r.showScrollBar=t.showScrollBar!==!1)),t.kind==="image"&&(r.imageSource=t.imageSource,r.imageType=t.imageType??null,r.imageId=t.imageId??0,r.imageColor=t.imageColor,r.raycastTarget=t.raycastTarget===!0,r.enableMask=t.enableMask===!0,r.enableSoftEdge=t.enableSoftEdge===!0,r.softEdgeMode=t.softEdgeMode,r.softEdgeWidthX=t.softEdgeWidthX,r.softEdgeWidthY=t.softEdgeWidthY,r.horizontalSoftRange=t.horizontalSoftRange,r.verticalSoftRange=t.verticalSoftRange,r.enableFill=t.enableFill===!0,r.fillType=t.enableFill?t.fillType:"Unused",r.fillHorizontalType=t.fillHorizontalType,r.fillVerticalType=t.fillVerticalType,r.fillRadial90Type=t.fillRadial90Type,r.fillRadialType=t.fillRadialType,r.fillAmount=t.fillAmount,r.reverseMaskArea=t.reverseMaskArea===!0),t.kind==="button"&&(r.raycastTarget=t.raycastTarget!==!1,r.interactable=t.interactable!==!1,r.clickAudioId=t.clickAudioId,r.unavailableChildId=t.unavailableChildId??null,r.hoverChildId=t.hoverChildId??null,r.pressedChildId=t.pressedChildId??null,r.selectedChildId=t.selectedChildId??null),t.kind==="cursor"&&(r.raycastTarget=t.raycastTarget!==!1),t.kind==="reference"&&(r.referencedPrefabIndex=t.referencedPrefabId),t.kind==="grid"&&(r.itemPrefabIndex=t.itemPrefabId,r.raycastTarget=t.raycastTarget!==!1,r.interactable=t.interactable!==!1,r.showScrollBar=t.showScrollBar!==!1,r.scrollDirection=t.scrollDirection,r.layoutConstraint=t.layoutConstraint,r.layoutConstraintFixedCount=t.layoutConstraintFixedCount,r.cellSizeX=t.cellSizeX,r.cellSizeY=t.cellSizeY,r.spacingX=t.spacingX,r.spacingY=t.spacingY,r.padding1X=t.padding1X,r.padding1Y=t.padding1Y,r.padding2X=t.padding2X,r.padding2Y=t.padding2Y,r.previewCount=t.previewCount),t.kind==="keyhint"&&(r.keyboardKeyCode=t.keyboardKeyCode,r.controllerKeyCode=t.controllerKeyCode),t.kind==="animation"||t.kind==="fullscreen"){r.raycastTarget=!1;let a=Number(t.animationId);r.animationId=t.animationId!=null&&String(t.animationId).trim()!==""&&Number.isSafeInteger(a)?a:t.animationId,r.playSoundEffect=t.playSoundEffect,t.kind==="animation"&&(r.layer=t.layer)}return r}function ss(t,e=[],i=""){let n=i&&Pe[i]?i:t.canvasId,r=Pe[n],o=kn(t),a=new Map;for(let l of e){if(!l.controlId)continue;let c=a.get(l.controlId)||[];c.push(l),a.set(l.controlId,c)}let s=t.meta?.assetType==="client-control-template"?(t.root.children||[]).map(l=>as(l,n,a)):[];return{canvasId:n,platform:r.platform,device:r.luaDevice,canvasWidth:r.width,canvasHeight:r.height,root:as(o,n,a),templates:s}}var fo="qxqy-autotest";var Li=.03333333333333333,Gh=new Set(["pointer","key","click","pause","resume","serverSet","serverSend","view"]),Vh=new Set(["log","control","var","signal","tree","lua"]);function qi(t,e){let i=Number(t);if(!Number.isFinite(i))throw new Error(`${e} must be a finite number`);return i}function ls(t){return JSON.parse(JSON.stringify(t??null))}function uo(t,e){if(!t||typeof t!="object")throw new Error(`events[${e}] must be an object`);let i=String(t.kind||t.do||"");if(!Gh.has(i))throw new Error(`unsupported event kind: ${i||"(empty)"}`);let n=t.payload&&typeof t.payload=="object"?{...t.payload}:{};if(i==="pointer")!n.type&&t.type&&(n.type=t.type),n.x===void 0&&(n.x=t.x),n.y===void 0&&(n.y=t.y),n.x=qi(n.x,"pointer.x"),n.y=qi(n.y,"pointer.y"),n.type=String(n.type||"click"),n.type==="wheel"&&(n.deltaX=qi(n.deltaX??t.deltaX??0,"pointer.deltaX"),n.deltaY=qi(n.deltaY??t.deltaY??0,"pointer.deltaY"));else if(i==="key"){if(n.typeName=String(n.typeName||n.key||t.typeName||t.key||""),!n.typeName)throw new Error("key event requires typeName")}else if(i==="click"){if(n.name=String(n.name||t.name||""),!n.name)throw new Error("click event requires control name")}else if(i==="serverSet"){if(n.entityType=String(n.entityType||t.entityType||""),n.name=String(n.name||t.name||""),n.value===void 0&&(n.value=t.value),n.value===void 0&&(n.value=null),!n.entityType||!n.name)throw new Error("serverSet requires entityType and name")}else if(i==="serverSend"){if(n.name=String(n.name||t.name||""),n.params=Array.isArray(n.params)?n.params:Array.isArray(t.params)?t.params:[],n.target=String(n.target||t.target||"PlayerSelf"),!n.name)throw new Error("serverSend requires signal name")}else if(i==="view"&&(n.playerIndex=Number(n.playerIndex||n.viewPlayerIndex||t.playerIndex||t.viewPlayerIndex||0),!Number.isInteger(n.playerIndex)||n.playerIndex<1))throw new Error("view event requires playerIndex 1-8");return{t:qi(t.t??0,"event.t"),source:String(t.source||"user"),kind:i,payload:n}}function cs(t,e){if(!t||typeof t!="object")throw new Error(`asserts[${e}] must be an object`);let i=String(t.kind||(t.check?"log":""));if(!Vh.has(i))throw new Error(`unsupported assert kind: ${i||"(empty)"}`);let n={kind:i};if(t.at!==void 0&&(n.at=qi(t.at,"assert.at")),i==="log"){if(n.contains=String(t.contains||t.check||t.text||""),n.source=t.source==="server"?"server":"client",t.level&&(n.level=String(t.level)),!n.contains)throw new Error("log assert requires contains")}else if(i==="control"){if(n.id=t.id?String(t.id):"",n.name=t.name?String(t.name):"",n.field=String(t.field||""),!n.field)throw new Error("control assert requires field");if(!n.id&&!n.name)throw new Error("control assert requires id or name");if(!Object.prototype.hasOwnProperty.call(t,"equals"))throw new Error("control assert requires equals");n.equals=ls(t.equals)}else if(i==="var"){if(n.entityType=String(t.entityType||""),n.name=String(t.name||""),!n.entityType||!n.name)throw new Error("var assert requires entityType and name");if(!Object.prototype.hasOwnProperty.call(t,"equals"))throw new Error("var assert requires equals");n.equals=ls(t.equals)}else if(i==="signal"){if(n.direction=t.direction==="outbound"?"outbound":"inbound",n.name=String(t.name||""),!n.name)throw new Error("signal assert requires name");t.values!==void 0&&(n.values=ls(t.values))}else if(i==="tree"){if(n.name=String(t.name||""),n.exists=t.exists!==!1,!n.name)throw new Error("tree assert requires name")}else if(i==="lua"&&(n.source=String(t.source||""),!n.source.trim()))throw new Error("lua assert requires source");return n}function Nu(t){let e=0,i=[],n=[];for(let r of t){if(!r||typeof r!="object")throw new Error("queue step must be an object");if(r.do!=="start"){if(r.do==="step"){e+=qi(r.dt??Li,"step.dt");continue}if(r.do==="pointer"||r.do==="key"||r.do==="click"||r.do==="pause"||r.do==="resume"||r.do==="serverSet"||r.do==="serverSend"||r.do==="view"){i.push(uo({...r,kind:r.do,t:e},i.length));continue}if(r.assert||r.check||r.kind){n.push(cs({...r.assert||r,at:r.at??e},n.length));continue}throw new Error(`unsupported queue step: ${JSON.stringify(r)}`)}}return{events:i,asserts:n,dt:Li}}function er(t){if(Array.isArray(t)){let n=Nu(t);return{format:fo,version:1,name:"",dt:n.dt,events:n.events,asserts:n.asserts}}if(!t||typeof t!="object")throw new Error("autotest case must be an object or step array");if(Array.isArray(t.queue)||Array.isArray(t.steps)){let n=Nu(t.queue||t.steps);return{format:fo,version:1,name:String(t.name||""),dt:Number(t.dt)>0?Number(t.dt):n.dt,events:n.events,asserts:n.asserts}}let e=(t.events||[]).map((n,r)=>uo(n,r)),i=(t.asserts||[]).map((n,r)=>cs(n,r));return e.sort((n,r)=>n.t-r.t||0),{format:fo,version:1,name:String(t.name||""),dt:Number(t.dt)>0?Number(t.dt):Li,playerCount:Number(t.playerCount)>0?Number(t.playerCount):1,events:e,asserts:i}}function Pu(t,e={}){let i=(t||[]).map((n,r)=>uo(n,r));return{format:fo,version:1,name:String(e.name||""),dt:Number(e.dt)>0?Number(e.dt):Li,playerCount:Number(e.playerCount)>0?Number(e.playerCount):1,events:i,asserts:(e.asserts||[]).map((n,r)=>cs(n,r))}}function Fu(t,e,i){if(!t)return null;let n=uo({...e,t:e.t??i??0},t.events.length);return t.events.push(n),n}var ho=(t,e)=>Math.max(0,Math.min(e,Number.isFinite(t)?t:0));function Mu(t,e,i){let n=Oi(t,e,i),r=Math.max(0,n.contentHeight-i),o=ho(t._scrollOffset||0,r);return t._scrollOffset=o,{...n,length:n.contentHeight,max:r,offset:o,viewport:i,horizontal:!1,width:e,height:i}}function po(t,e,i){if(!t?.showBar||t.max<=0||e<=0||i<=0)return null;let n=t.horizontal===!0,r=n?e:i,o=Math.max(0,r-4),a=Math.min(o,Math.max(18,o*r/(r+t.max))),s=o-a,l=s*t.offset/t.max,c=Math.min(8,n?i:e),f=n?{x:-e/2+2,y:i/2-c-2,width:o,height:c}:{x:e/2-c-2,y:-i/2+2,width:c,height:o},h=n?{...f,x:f.x+l,width:a}:{...f,y:f.y+l,height:a};return{track:f,thumb:h,travel:s}}var Bh=[[10001,"ura.1ht4.2ag9.1hh5.jbb.k02.jcw.2tv.2wn.2xk.2r3.d5s.94l.ebv.kcr.b40.77k.9gp.97w.1hb5.jag.btu.jc9.hp5.bmj.blq.blq.ff9.ffk.o74.1owl.rp.mg.l3.lf.lh.qy.1a3z.2xk.2xk.2xk.2xk.2xk.17dc.1f2b.2bc.2bc.2bc.2bc.2bc.ffo.ffo.126.1fk.4mo.4mo.15e.1h2.237.2ba.2kd.2bc.4mo.4mo.4mo.4mo.1mc.1n6.2cu.1ud.2b1.2ee.1tj.1tk"],[20001,"o6.fh.kb.cr.og.sm.6x.8c.87.o7.vz.kt.qo.lg.ob.9w.mg.1kz.zc.1ex.1d5.ps.uu.su.qs.ys.zp.10k.15a.xc.uk.mx.1ax.nt.tu.19m.uj.1ku.tt.100.ie.d3.fp.ie.ie.d3.fp.ie.8p.7k.fw.h0.qc.ot.uc.ot.rk.gb.1c2.ff.cl.9v.wg.1ir.1lr.1b8.1ri.1p0.104.10n.mw.j6.jb.f1.dv.84.a0.cp.bx.1ko.1au.1ia.rs.rt.rs.t7.x6.wi.zc.16f.1i6.2jh.28d.qh.k8.1gz.1ko.2iv.1xp.1l4.1gk.10j.yo.1jk.1jk.xv.104.15o.1xg.1xg.1xi.25i.p1.t1.yh.1ak.1i6.1y2.xt.32u.3g6.1bz.2mn.14l.14c.1e1.op.s8.p2.v5.2ix.1a0.ry.16m.17n.13c.134.ys.yu.xr.sl.sr.sd.yh.z5.gd.gl.hx.h2.g8.fj.iy.hz.jj.th.12n.16r.d3.j9.dg.lj.fl.a7.f9.iw.el.27f.1dh.1rh.2ph.yd.w5.x5.tr.pq.zf.16h.1a5.17t.wy.vn.y8.wl.yv.2ye.2qt.1ah.163.19t.uf.119.2vv.1bm.13h.14p.1so.c3.as.9z.19w.1l4.1nl.rj.we"],[30001,"jo.my.ss.dw.c1.b4.hl.hl.hl.cz.dw.dw.b4.dw.fr.kd.qv.px.px.74.6u.8h.60.8q.8b.eo.eo.eo.8k.a5.99.12v.13y.lg.m4.qr.dw.ex.g0.ef.cd.br.11n.17h.1b8.1c9.9p.ag.9z.l9.m8.m8.lw.m8.cz.99.b4.8c.63.7f.6h.99.re.pp.pi.cq.c9.cp.ck.c6.b0.bd.al.f6.gl.ed.fs.lc.k6.kh.i6.cx.j1.hk.gb.d7.h7.g2.em.kj.kn.k4.j5.rh.t0.qt.mj.i7.ih.i2.hd.3r.8d.6u.6z.by.de.dg.cr.1a5.1ab.16c.18g.n2.ly.no.nt.f9.de.lr.fe.f0.fj.el.fo.t1.g9.ly.h3.g6.de.2ak.2f3.wf.kg.qn.11p.rg.uj.u6.11c.22o.2cs.3dp.3dq.3d5.3d6.1zx.18v"],[40001,"19x.215.2zt.1ex.2pj.7hy.1ur.1gn.1g7.1b1.u9.1tw.108.1ew.rs.1qu.w9.lk.244.qi.b6.tk.jg.jg.jg.y4.c1.b4.iv.hi.r4.n7.gy.ev.qe.12z.18n.dw.1l6.ou.wz.1un.19t.18k.yy.1hs.sl.dw.1vl.100.14k.1q8.209.1jk.1xr.ua.1j2.pr.26h.1gs.s9.px.15v.pf.1jk.xc.1hb.111.172.ut.285.1oh.149.zj.22r.2l9.14a.ok.23y.1eh.xe.1j0.1rp.1cz.wf.1mh.22k.334.1z2.1xo.1br.4ji.5nq.5nf.2za.18r.h3.eo.ia.1kn.dc.ss.s0.1bl.1oc.is.km.177.1ec.1ao.h4.hp.dx.l9.iw.i3.12w.n1.yq.12w.1ju.yx.14s.18b.22t.u3.my.2rb.36w.13u.z8.20r.18g.19r.2x9.w4.q2.1d2.wo.13a.v6.17w.ur.288.1b6.14m.1fi.1xx.1ee.kj.121.j2.1d2.2ad.1ri.2lc.1vk.138.12r.xj.1h5.1c5.2qx.1gj.t2.lv.rf.18q.1kz.dw.2aq.ia.1i9.k5.199.f4.10y.18a.xf.rk.1g9.1q3.10h.sj.15o.e3.dz.sv.135.w9.yg.aw.2a2.19m.22w.1c8.272.13o.104.1sr.rs.1pb.d5.df.kp.jq.1a7.s8.1ao.ba.rb.in.pz.q8.140.ij.1e7.jl.yk.117.10i.1tn.1oj.1sv.sj.1e3.2so.1c7.1gv.178.107.10n.1dx.1qi.1wp.2bc.218.16r.105.xc.z6.11w.1mc.1y9.17p.1cs.2ij.18c.1ie.nn.16c.1ce.xb.1ei.3j0.ve.14x.1sx.285.1b8.1at.v4.rv.rs.10z.xq.11o.15k.xq.u1.i2.pu.i4.l3.9u.oh.mc.nm.pw.1i3.1h4.pj.111.l4.lb.qq.qf.u0.h4.nk.yf.6h.ij.ds.oy.re.m8.1gl.cz.16z.a1.1f8.1x6.vp.dz.gp.g6.fr.vl.fr.gg.qc.aj.99.go.ij.fz.11a.x5.mo.1u9.h0.m8.10m.1an.2bc.3uw.2gk.124.xb.1uk.1b6.2xj.1os.11a.vs.1i9.1lr.2gv.265.668.1xg.45j.404.2x1.1io.3om.4q2.4mo.1d4.2bp.1pr.166.2y6.2bv.361.2nc.2bc.3g0.7g4.334.2bc.2xo.3uw.6ic.4ig.3uw.23v.1la.2zr.1jt.1cq.27a.1n1.19x.1qg.1jn.1ca.26y.2d6.4v4.4mo.4mo.7ps.1jk.153.1fo.1dm.1s2.1w1.oe.1lb.319.2eg.58p.4mo.3dw.2y2.2xm.1u8.1ko.12n.1e0.2sd.1md.2cl.1q2.372.4mo.48s.b14.3fu.334.334.34i.4nf.4ji.5eg.3uw.2u8.1g1.110.37x.2jo.su.334.3aj.3uw.63f.2bc.2bc.8v4.1ts.ax5.5du.34d.3oc.34j.4si.174.rt.1rp.2b0.37d.1ta.2gh.28a.22z.1nc.1a5.1pa.4dd.3ha.2cs.5mv.4mq.5c2.3uw.1gf.4md.113.10x.21o.2hj.1b3.1cx.1ol.3ar.1fv.17t.1a7.2uj.2we.1jk"],[50001,"1o8.1k1.mo.1wu.2c9.22d.1kb.23n.1b8.1ic.24c.2wz.1mq.1mu.1jx.1z1.o3.190.vp.1h7.th.4mo.1rp.4mo.4mo.7ps.zz.143.21v.1nf.34s.1s3.r9.18t.s1.r9.21w.277.ls.25k.5v1.2bc.1kh.wt.14i.1eq.15o.668.sh.rl.3wi.3vc.43c.3yn.17c.f5.xu.jg.176.19v.1xy.23m.18x.30c.10l.13k.v8.vp.17t.qj.17m.1wr.1la.8t.s7.18d.1l2.152.mx.1c8.1l4.1f5.1xe.rz.2hz.1et.13t.xb.14r.15o.z0.1zo.ur.257.1gb.li.12d.15a.132.1m1.3vu.296.1mg.11m.z0.159.mp.hd.x4.1go.ns.xh.2a7.tt.2vb.1bx.1kh.u3.11i.1y1.24e.2hp.2mn.1w6.3zm.166.14g.1mo.2v9.2rg.2f9.1r0.139.m1.k3.ys.1dy.29k.1mm.22m.3zx.4dr.2h7.22o.tv.rm.1et.2wv.2ar.1t7.ku.12s.10b.1v9.1gu.12m.1b3.tv.1c8.tk.10s.ul.1tt.ka.oi.qb.13f.13f.13k.17h.1uh.ez.en.2x7.2ln.2h8.3h8.ig.n9.27o.18b.hl.nm.uk.11a.1ta.1k4.1eh.wv.1go.1gg.sc.18u.1dz.2aq.vt.2l7.25h.1l5.1kn.1vc.1b4.28i.17t.1d6.1k2.18z.jy.jw.dh.1mx.fr.vp.35w.34z.35w.34z.4so.vf.yx.1bg.1d3.2yc.1tg.8q3.99g.am.2du.rm.rg.xa.2cw.xc.1j6.1if.18z.13a.yz.142.1z5.262.1bj.1y8.ur.u5.16j.1pf.1bi.l8.1il.3vz.2dr.jo.ls.18s.16l.18c.141.219.1yz.1fc.24t.27e.481.1vp.25h.1yq.1zn.1uw.11u.1jp.1pz.39o.t6.1mj.1u5.11l.1vd.1dk.1zb.1ic.3ql.14p.1wq.25x.267.zn.zn.1pf.13z.1j7.r9.1hb.4yp.1lt.1cw.1z4.19z.1og.1j4.1cl.1eg.u8.16s.1en.zu.1hr.1js.19g.303.22j.2oa.180.1v7.2ud.2d7.21s.3g9.vh.v1.284.3lg.3lg.17q.1h3.4mo.1cm.1rv.22i.2mc.2j3.27o.333.1q8.237.2ll.23b.2sp.2ll.2ox.2cf.2f8.2hz.1uo.y4.s9.w6.2dg.2q9.up.1m1.1vz.2n8.192.1eb.z7.2em.2q3.1sd.1gj.348.3vf.2iu.29x.1dc.7oj.4pq.5vb.4mx.5me.5sf.5yf.7ps.yj.q0.10w.13p.18b.2wd.11q.2vx.dd.iv.12p.jh.u9.1uy.w0.3f0.3bj.126.qo.1gj.11k.pu.22h.1z6.rp.y4.y0.xl.1d0.11s.wa.1a6.127.10m.12r.1nh.1fy.yo.1js.162.n4.174.1aj.y4.o8.qz.rh.qa.18s.mr.j3.ii.sr.sx.1jk.17l.mj.zr.uy.wa.19t.2bt.xe.1od.hs.xr.5b.12c.1ab.we.gz.mz.4y.sf.11s.e0.1l7.ew.h6.jz.l0.e8.1cx.p6.17u.bw.1ah.10r.10e.o9.1bc.uv.lq.tl.zb.100.jy.b8.bj.336.10n.na.sq.14r.yr.nm.123.tf.l1.zp.1xc.1vk.31l.zl.2bj.2b9.2fv.17p.y0.so.1ln.29c.1eh.nh.xn.131.qc.186.ff.fc.xq.1bm.la.l8.14f.243.111.xi.qw.1qn.11v.1ur.1jx.1ks.s9.nz.269.1zj.2zd.1pv.18n.2vk.p3.1fh.13v.1lf.1lu.2db.1sr.1k3.26o.1dl.1f3.187.2lh.166.v9.xh.1e3.119.s2.mt.1iu.1k6.1o2.12s.u4.2br.1q3.qv.1e4.1zu.1v4.1vk.1t3.3p7.1ob.14d.1ns.1ef.1e4.12w.2kk.1ba.2jx.1e0.1s5.12w.17r.14s.wz.1qp.183.3fb.188.1gr.2ot.168.1u7.w8.28o.1zd.32z.230.w7.vq.x8.1qh.19f.14o.2r9.qg.1ey.1qr.1p6.3a3.1ov.13d.tz.wk.22v.1qa.2l9.yw.yf.nw.p6.1ly.1jk.1nh.x9.q0.17r.17h.ux.uw.12y.p7.g7.kt.14c.ze.1kh.1eo.18a.1d8.26j.15k.19f.1ym.1j5.1c6.11k.1sd.1jp.1ws.13s.1o5.214.sx.px.20x.14h.1ja.s6.1q8.w8.1ks.so.ub.121.202.1ej.1g1.1s8.2bc.4t1.bih.3uw.3pb.avp.6c7.bko.5eg.79c.6wh.3wd.4pn.55j.4a5.3gg.bko.5ei.52p.578.bcv.6gr.2bc.4j9.5y7.9d2.2bb.2bc.668.73z.5pg.50f.5m7.788.267.642.8h2.8h2.49s.64g.5e8.5e8.2bb.3ih.5ur.6bk.578.4ck.3sg.5fe.23i.e9w.2b8.5oj.6bw.2al.2rk.2rk.5pj.n6e.350.6v9.70t.639.3uw.3uw.2bg.639.2bb.2bd.6gj.2bh.660.578.3bk.65e.359.3o0.44i.4tn.1zq.5ee.4a5.3zu.rs.639.33q.5eg.1k1.15o.dw.3uw.b7p.7qd.898.4l4.5uu.5uu.b4g.2yh.2yh.3uw.51a.51a.5kk.66f.iq9.3n7.4nb.46a.1wb.20p.bih.8xa.7ps.70t.70t.4rv.5p1.6aq.ts.63z.668.5v2.5nu.563.55s.55s.5p3.2ga.32x.42x.5cr.4c2.71b.5zp.5c2.66t.4c8.2bc.2bc.2gn.3ea.2kp.fz6.8hz.3e8.4an.bko.j7e.jag.7sr.2bc.3zx.7qd.5ut.5jp.2wk.5q7.3uw.334.4i3.3uw.4bd.5eu.46h.4i2.6t4.446.5s7.5cg.4bk.5nd.7bf.4rt.23b.2bc.2bc.2bc.2bc.2ba.4mo.4dv.3wn.2bc.1we.4he.2bc.4gz.3wn.3km.4xy.4hi.4mr.2bc.247.3yj.2c6.2bc.3aj.446.4ub.3uw.51.e0.86.is.i1.hg.mn.m4.2c.7h.sg.e3.jb.7r.eq.nf.u0.60.4o.ke.47.47.47.47.b8.4x.dr.dy.rw.rw.59.8j.5z.a5.l3.c0.ik.f7.li.lr.7x.dv.du.dd.5e.91.1b.ce.cc.59.bh.e6.8m.9n.cl.lt.7ip.4mr.4si.4kf.vo.we.13e.17n.1iw.2pi.lp.r6.gw.7x.xz.qt.bq.ls.q1.eh.bx.cr.3c.j7.b8.fz.4k.8p.bg.5w.iy.j3.12o.rs.cz.dp.yz.jk.63.63.7ps.7ps.7ps.40g.3jp.4tw.89k.88a.7s0.83d.668.7ps.2fw.2ev.2fp.7ps.2jb.2dh.2ud.25i.24c.2bt.1pa.17r.1a7.7ps.7pt.5rg.4nl.3vv.7qo.31a.2p0.2k0.49a.3v4.3nl.1ug.1ug.1l6.7s1.7ps.2cp.2f8.2i7.7ps.28q.2be.275.1ma.1oz.1q7.16s.1iq.1e0.78m.7ps.2bc.2bc.2bc.bko.2wu.2wu.2wu.3b4.38f.3uw.3uw.3uw.3uw.7ps.7qa.32n.2gg.2wk.7rv.1v3.1qq.1rb.1zk.1my.1zp.1yn.1oh.1uh.7st.9q.9q.9q.9q.9q.kk.kk.kk.kk.kk.dw.dp.dw.rs.rs.rs.rs.s4.sd.54j.5n8.2n6.21r.1nu.1o5.14u.t6.3f7.2j0.32c.304.189.1gf.18w.18j.1st.1vq.116.kw.3uw.3uw.vr.zx.xc.tc.7d.7r.9d.9w.8s.9p.3b.3b"]].map(([t,e])=>[t,e.split(".").map(i=>parseInt(i,36)/1e3)]);function zu(t){if(!Number.isSafeInteger(t))return null;for(let[e,i]of Bh)if(t>=e&&t<e+i.length)return i[t-e];return null}var fs={version:"ct-v1",catalogSha256:"fcdd2087b0ce558f90489db6c1368211d8b110e8cc755baf1efd731814a53fd4",assets:[{id:10001001,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u96F7\u80FD\u91CF\u6EE1\u503C1",nameEn:"Electro Energy Max Value 1",video:"video/10001001.webm",icon:"icon/10001001.png",audio:[]},{id:10001002,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u706B\u80FD\u91CF\u6EE1\u503C1",nameEn:"Pyro Energy Max Value 1",video:"video/10001002.webm",icon:"icon/10001002.png",audio:[]},{id:10001003,scope:"ui",width:174,height:182,loop:!0,duration:10,name:"\u8349\u80FD\u91CF\u6EE1\u503C1",nameEn:"Dendro Energy Max Value 1",video:"video/10001003.webm",icon:"icon/10001003.png",audio:[]},{id:10001004,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u51B0\u80FD\u91CF\u6EE1\u503C1",nameEn:"Cryo Energy Max Value 1",video:"video/10001004.webm",icon:"icon/10001004.png",audio:[]},{id:10001005,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u5CA9\u80FD\u91CF\u6EE1\u503C1",nameEn:"Geo Energy Max Value 1",video:"video/10001005.webm",icon:"icon/10001005.png",audio:[]},{id:10001006,scope:"ui",width:186,height:186,loop:!0,duration:10,name:"\u6C34\u80FD\u91CF\u6EE1\u503C1",nameEn:"Hydro Energy Max Value 1",video:"video/10001006.webm",icon:"icon/10001006.png",audio:[]},{id:10001007,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u98CE\u80FD\u91CF\u6EE1\u503C1",nameEn:"Anemo Energy Max Value 1",video:"video/10001007.webm",icon:"icon/10001007.png",audio:[]},{id:10001008,scope:"ui",width:224,height:224,loop:!1,duration:1.3,name:"\u53EF\u7528\u63D0\u793A1",nameEn:"Available Hint 1",video:"video/10001008.webm",icon:"icon/10001008.png",audio:[]},{id:10001009,scope:"ui",width:224,height:224,loop:!1,duration:1.3,name:"\u53EF\u7528\u63D0\u793A2",nameEn:"Available Hint 2",video:"video/10001009.webm",icon:"icon/10001009.png",audio:[]},{id:10001010,scope:"ui",width:176,height:176,loop:!0,duration:10,name:"\u96F7\u80FD\u91CF\u6EE1\u503C2",nameEn:"Electro Energy Max Value 2",video:"video/10001010.webm",icon:"icon/10001010.png",audio:[]},{id:10001011,scope:"ui",width:182,height:182,loop:!0,duration:10,name:"\u706B\u80FD\u91CF\u6EE1\u503C2",nameEn:"Pyro Energy Max Value 2",video:"video/10001011.webm",icon:"icon/10001011.png",audio:[]},{id:10001012,scope:"ui",width:162,height:162,loop:!0,duration:10,name:"\u8349\u80FD\u91CF\u6EE1\u503C2",nameEn:"Dendro Energy Max Value 2",video:"video/10001012.webm",icon:"icon/10001012.png",audio:[]},{id:10001013,scope:"ui",width:176,height:184,loop:!0,duration:10,name:"\u51B0\u80FD\u91CF\u6EE1\u503C2",nameEn:"Cryo Energy Max Value 2",video:"video/10001013.webm",icon:"icon/10001013.png",audio:[]},{id:10001014,scope:"ui",width:170,height:170,loop:!0,duration:10,name:"\u5CA9\u80FD\u91CF\u6EE1\u503C2",nameEn:"Geo Energy Max Value 2",video:"video/10001014.webm",icon:"icon/10001014.png",audio:[]},{id:10001015,scope:"ui",width:186,height:186,loop:!0,duration:10,name:"\u6C34\u80FD\u91CF\u6EE1\u503C2",nameEn:"Hydro Energy Max Value 2",video:"video/10001015.webm",icon:"icon/10001015.png",audio:[]},{id:10001016,scope:"ui",width:180,height:180,loop:!0,duration:10,name:"\u98CE\u80FD\u91CF\u6EE1\u503C2",nameEn:"Anemo Energy Max Value 2",video:"video/10001016.webm",icon:"icon/10001016.png",audio:[]},{id:10001017,scope:"ui",width:300,height:280,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C1",nameEn:"Energy Max Value 1",video:"video/10001017.webm",icon:"icon/10001017.png",audio:["audio/10001017.mp3"]},{id:10001018,scope:"ui",width:220,height:226,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C2",nameEn:"Energy Max Value 2",video:"video/10001018.webm",icon:"icon/10001018.png",audio:[]},{id:10001019,scope:"ui",width:220,height:226,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C3",nameEn:"Energy Max Value 3",video:"video/10001019.webm",icon:"icon/10001019.png",audio:[]},{id:10001020,scope:"ui",width:210,height:216,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C4",nameEn:"Energy Max Value 4",video:"video/10001020.webm",icon:"icon/10001020.png",audio:[]},{id:10001021,scope:"ui",width:216,height:220,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C5",nameEn:"Energy Max Value 5",video:"video/10001021.webm",icon:"icon/10001021.png",audio:[]},{id:10001022,scope:"ui",width:216,height:220,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C6",nameEn:"Energy Max Value 6",video:"video/10001022.webm",icon:"icon/10001022.png",audio:[]},{id:10001023,scope:"ui",width:216,height:220,loop:!0,duration:10,name:"\u80FD\u91CF\u6EE1\u503C7",nameEn:"Energy Max Value 7",video:"video/10001023.webm",icon:"icon/10001023.png",audio:[]},{id:10001024,scope:"ui",width:134,height:134,loop:!0,duration:10,name:"\u96F7\u5143\u7D20\u5171\u9E23",nameEn:"Electro Elemental Resonance",video:"video/10001024.webm",icon:"icon/10001024.png",audio:[]},{id:10001025,scope:"ui",width:130,height:134,loop:!0,duration:10,name:"\u706B\u5143\u7D20\u5171\u9E23",nameEn:"Pyro Elemental Resonance",video:"video/10001025.webm",icon:"icon/10001025.png",audio:[]},{id:10001026,scope:"ui",width:130,height:130,loop:!0,duration:10,name:"\u8349\u5143\u7D20\u5171\u9E23",nameEn:"Dendro Elemental Resonance",video:"video/10001026.webm",icon:"icon/10001026.png",audio:[]},{id:10001027,scope:"ui",width:128,height:128,loop:!0,duration:10,name:"\u51B0\u5143\u7D20\u5171\u9E23",nameEn:"Cryo Elemental Resonance",video:"video/10001027.webm",icon:"icon/10001027.png",audio:[]},{id:10001028,scope:"ui",width:130,height:130,loop:!0,duration:10,name:"\u5CA9\u5143\u7D20\u5171\u9E23",nameEn:"Geo Elemental Resonance",video:"video/10001028.webm",icon:"icon/10001028.png",audio:[]},{id:10001029,scope:"ui",width:130,height:134,loop:!0,duration:10,name:"\u6C34\u5143\u7D20\u5171\u9E23",nameEn:"Hydro Elemental Resonance",video:"video/10001029.webm",icon:"icon/10001029.png",audio:[]},{id:10001030,scope:"ui",width:130,height:130,loop:!0,duration:10,name:"\u98CE\u5143\u7D20\u5171\u9E23",nameEn:"Anemo Elemental Resonance",video:"video/10001030.webm",icon:"icon/10001030.png",audio:[]},{id:10001031,scope:"ui",width:156,height:160,loop:!1,duration:1,name:"\u6C34\u70AE\u6548\u679C1",nameEn:"Hydro Cannon Effect 1",video:"video/10001031.webm",icon:"icon/10001031.png",audio:[]},{id:10001032,scope:"ui",width:216,height:216,loop:!1,duration:.933,name:"\u6C34\u70AE\u6548\u679C2",nameEn:"Hydro Cannon Effect 2",video:"video/10001032.webm",icon:"icon/10001032.png",audio:["audio/10001032.mp3"]},{id:10001033,scope:"ui",width:488,height:488,loop:!1,duration:1.2,name:"\u97F3\u7B26\u6548\u679C1",nameEn:"Note Effect 1",video:"video/10001033.webm",icon:"icon/10001033.png",audio:[]},{id:10001034,scope:"ui",width:536,height:536,loop:!1,duration:1.4,name:"\u97F3\u7B26\u6548\u679C2",nameEn:"Note Effect 2",video:"video/10001034.webm",icon:"icon/10001034.png",audio:[]},{id:10001035,scope:"ui",width:262,height:266,loop:!0,duration:10,name:"\u97F3\u7B26\u6548\u679C3",nameEn:"Note Effect 3",video:"video/10001035.webm",icon:"icon/10001035.png",audio:[]},{id:10001036,scope:"ui",width:536,height:536,loop:!1,duration:1.4,name:"\u97F3\u7B26\u6548\u679C4",nameEn:"Note Effect 4",video:"video/10001036.webm",icon:"icon/10001036.png",audio:[]},{id:10001037,scope:"ui",width:262,height:266,loop:!0,duration:10,name:"\u97F3\u7B26\u6548\u679C5",nameEn:"Note Effect 5",video:"video/10001037.webm",icon:"icon/10001037.png",audio:[]},{id:10001038,scope:"ui",width:190,height:190,loop:!0,duration:10,name:"\u6269\u6563\u6548\u679C1",nameEn:"Swirl Effect 1",video:"video/10001038.webm",icon:"icon/10001038.png",audio:[]},{id:10001039,scope:"ui",width:208,height:208,loop:!1,duration:.766,name:"\u70B9\u51FB\u6548\u679C1",nameEn:"Press Effect 1",video:"video/10001039.webm",icon:"icon/10001039.png",audio:[]},{id:10001040,scope:"ui",width:390,height:390,loop:!1,duration:1.2,name:"\u8F6C\u6362\u6548\u679C1",nameEn:"Conversion Effect 1",video:"video/10001040.webm",icon:"icon/10001040.png",audio:["audio/10001040.mp3"]},{id:10001041,scope:"ui",width:208,height:208,loop:!0,duration:10,name:"\u8F6C\u6362\u6548\u679C2",nameEn:"Conversion Effect 2",video:"video/10001041.webm",icon:"icon/10001041.png",audio:[]},{id:10001042,scope:"ui",width:208,height:208,loop:!0,duration:10,name:"\u8F6C\u6362\u6548\u679C3",nameEn:"Conversion Effect 3",video:"video/10001042.webm",icon:"icon/10001042.png",audio:[]},{id:10001043,scope:"ui",width:168,height:180,loop:!1,duration:1.233,name:"\u70B9\u51FB\u6548\u679C2",nameEn:"Press Effect 2",video:"video/10001043.webm",icon:"icon/10001043.png",audio:["audio/10001043.mp3","audio/10001043_02.mp3"]},{id:10001044,scope:"ui",width:190,height:198,loop:!1,duration:1.566,name:"\u70B9\u51FB\u6548\u679C3",nameEn:"Press Effect 3",video:"video/10001044.webm",icon:"icon/10001044.png",audio:[]},{id:10001045,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C4",nameEn:"Press Effect 4",video:"video/10001045.webm",icon:"icon/10001045.png",audio:[]},{id:10001046,scope:"ui",width:106,height:122,loop:!1,duration:.8,name:"\u70B9\u51FB\u6548\u679C5",nameEn:"Press Effect 5",video:"video/10001046.webm",icon:"icon/10001046.png",audio:[]},{id:10001047,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C6",nameEn:"Press Effect 6",video:"video/10001047.webm",icon:"icon/10001047.png",audio:[]},{id:10001048,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C7",nameEn:"Press Effect 7",video:"video/10001048.webm",icon:"icon/10001048.png",audio:[]},{id:10001049,scope:"ui",width:130,height:118,loop:!1,duration:1,name:"\u70B9\u51FB\u6548\u679C8",nameEn:"Press Effect 8",video:"video/10001049.webm",icon:"icon/10001049.png",audio:[]},{id:10001050,scope:"ui",width:114,height:114,loop:!1,duration:.733,name:"\u70B9\u51FB\u6548\u679C9",nameEn:"Press Effect 9",video:"video/10001050.webm",icon:"icon/10001050.png",audio:[]},{id:10001051,scope:"ui",width:408,height:408,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C1",nameEn:"Highlight Effect 1",video:"video/10001051.webm",icon:"icon/10001051.png",audio:[]},{id:10001052,scope:"ui",width:272,height:272,loop:!1,duration:.9,name:"\u95EA\u70C1\u6548\u679C1",nameEn:"Blink Effect 1",video:"video/10001052.webm",icon:"icon/10001052.png",audio:[]},{id:10001053,scope:"ui",width:176,height:194,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C2",nameEn:"Highlight Effect 2",video:"video/10001053.webm",icon:"icon/10001053.png",audio:[]},{id:10001054,scope:"ui",width:274,height:286,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C2",nameEn:"Blink Effect 2",video:"video/10001054.webm",icon:"icon/10001054.png",audio:[]},{id:10001055,scope:"ui",width:368,height:368,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C3",nameEn:"Blink Effect 3",video:"video/10001055.webm",icon:"icon/10001055.png",audio:[]},{id:10001056,scope:"ui",width:226,height:210,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C3",nameEn:"Highlight Effect 3",video:"video/10001056.webm",icon:"icon/10001056.png",audio:[]},{id:10001057,scope:"ui",width:304,height:304,loop:!1,duration:.966,name:"\u8F6C\u6362\u6548\u679C4",nameEn:"Conversion Effect 4",video:"video/10001057.webm",icon:"icon/10001057.png",audio:["audio/10001057.mp3"]},{id:10001058,scope:"ui",width:174,height:178,loop:!1,duration:1.6,name:"\u95EA\u70C1\u6548\u679C4",nameEn:"Blink Effect 4",video:"video/10001058.webm",icon:"icon/10001058.png",audio:[]},{id:10001059,scope:"ui",width:362,height:362,loop:!1,duration:1.766,name:"\u95EA\u70C1\u6548\u679C5",nameEn:"Blink Effect 5",video:"video/10001059.webm",icon:"icon/10001059.png",audio:["audio/10001059.mp3"]},{id:10001060,scope:"ui",width:190,height:192,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C6",nameEn:"Blink Effect 6",video:"video/10001060.webm",icon:"icon/10001060.png",audio:[]},{id:10001061,scope:"ui",width:890,height:456,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C7",nameEn:"Blink Effect 7",video:"video/10001061.webm",icon:"icon/10001061.png",audio:[]},{id:10001062,scope:"ui",width:890,height:646,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C8",nameEn:"Blink Effect 8",video:"video/10001062.webm",icon:"icon/10001062.png",audio:[]},{id:10001063,scope:"ui",width:290,height:290,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C4",nameEn:"Highlight Effect 4",video:"video/10001063.webm",icon:"icon/10001063.png",audio:[]},{id:10001064,scope:"ui",width:272,height:272,loop:!1,duration:.866,name:"\u6D88\u9664\u6548\u679C1",nameEn:"Clear Effect 1",video:"video/10001064.webm",icon:"icon/10001064.png",audio:[]},{id:10001065,scope:"ui",width:272,height:272,loop:!1,duration:.9,name:"\u6D88\u9664\u6548\u679C2",nameEn:"Clear Effect 2",video:"video/10001065.webm",icon:"icon/10001065.png",audio:[]},{id:10001066,scope:"ui",width:238,height:210,loop:!1,duration:1.066,name:"\u6D88\u9664\u6548\u679C3",nameEn:"Clear Effect 3",video:"video/10001066.webm",icon:"icon/10001066.png",audio:[]},{id:10001067,scope:"ui",width:154,height:154,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C9",nameEn:"Blink Effect 9",video:"video/10001067.webm",icon:"icon/10001067.png",audio:[]},{id:10001068,scope:"ui",width:484,height:484,loop:!1,duration:1,name:"\u95EA\u70C1\u6548\u679C10",nameEn:"Blink Effect 10",video:"video/10001068.webm",icon:"icon/10001068.png",audio:[]},{id:10001069,scope:"ui",width:326,height:326,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C5",nameEn:"Highlight Effect 5",video:"video/10001069.webm",icon:"icon/10001069.png",audio:[]},{id:10001070,scope:"ui",width:206,height:196,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C6",nameEn:"Highlight Effect 6",video:"video/10001070.webm",icon:"icon/10001070.png",audio:[]},{id:10001071,scope:"ui",width:2236,height:2236,loop:!0,duration:10,name:"\u6C1B\u56F4\u6548\u679C1",nameEn:"Ambience Effect 1",video:"video/10001071.webm",icon:"icon/10001071.png",audio:[]},{id:10001072,scope:"ui",width:406,height:406,loop:!0,duration:10,name:"\u6C1B\u56F4\u6548\u679C2",nameEn:"Ambience Effect 2",video:"video/10001072.webm",icon:"icon/10001072.png",audio:[]},{id:10001073,scope:"ui",width:376,height:336,loop:!1,duration:2.1,name:"\u95EA\u70C1\u6548\u679C11",nameEn:"Blink Effect 11",video:"video/10001073.webm",icon:"icon/10001073.png",audio:[]},{id:10001074,scope:"ui",width:258,height:228,loop:!1,duration:1.666,name:"\u95EA\u70C1\u6548\u679C12",nameEn:"Blink Effect 12",video:"video/10001074.webm",icon:"icon/10001074.png",audio:[]},{id:10001075,scope:"ui",width:322,height:322,loop:!0,duration:10,name:"\u9AD8\u4EAE\u6548\u679C7",nameEn:"Highlight Effect 7",video:"video/10001075.webm",icon:"icon/10001075.png",audio:[]},{id:10001076,scope:"ui",width:258,height:270,loop:!1,duration:1.2,name:"\u4E92\u52A8\u6548\u679C1",nameEn:"Interaction Effect 1",video:"video/10001076.webm",icon:"icon/10001076.png",audio:[]},{id:10001077,scope:"ui",width:126,height:118,loop:!1,duration:1.1,name:"\u88C5\u9970\u6548\u679C1",nameEn:"Decoration Effect 1",video:"video/10001077.webm",icon:"icon/10001077.png",audio:[]},{id:10001078,scope:"ui",width:220,height:248,loop:!1,duration:1.133,name:"\u88C5\u9970\u6548\u679C2",nameEn:"Decoration Effect 2",video:"video/10001078.webm",icon:"icon/10001078.png",audio:[]},{id:10001079,scope:"ui",width:234,height:232,loop:!1,duration:1.166,name:"\u88C5\u9970\u6548\u679C3",nameEn:"Decoration Effect 3",video:"video/10001079.webm",icon:"icon/10001079.png",audio:[]},{id:10001080,scope:"ui",width:582,height:550,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C4",nameEn:"Decoration Effect 4",video:"video/10001080.webm",icon:"icon/10001080.png",audio:[]},{id:10001081,scope:"ui",width:388,height:400,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C5",nameEn:"Decoration Effect 5",video:"video/10001081.webm",icon:"icon/10001081.png",audio:[]},{id:10001082,scope:"ui",width:386,height:386,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C6",nameEn:"Decoration Effect 6",video:"video/10001082.webm",icon:"icon/10001082.png",audio:[]},{id:10001083,scope:"ui",width:196,height:196,loop:!1,duration:1.2,name:"\u88C5\u9970\u6548\u679C7",nameEn:"Decoration Effect 7",video:"video/10001083.webm",icon:"icon/10001083.png",audio:[]},{id:10001084,scope:"ui",width:496,height:462,loop:!1,duration:.7,name:"\u95EA\u70C1\u6548\u679C13",nameEn:"Blink Effect 13",video:"video/10001084.webm",icon:"icon/10001084.png",audio:[]},{id:10001085,scope:"ui",width:426,height:336,loop:!1,duration:.566,name:"\u95EA\u70C1\u6548\u679C14",nameEn:"Blink Effect 14",video:"video/10001085.webm",icon:"icon/10001085.png",audio:[]},{id:10001086,scope:"ui",width:266,height:190,loop:!1,duration:.866,name:"\u88C5\u9970\u6548\u679C8",nameEn:"Decoration Effect 8",video:"video/10001086.webm",icon:"icon/10001086.png",audio:[]},{id:10001087,scope:"ui",width:310,height:252,loop:!1,duration:1.166,name:"\u88C5\u9970\u6548\u679C9",nameEn:"Decoration Effect 9",video:"video/10001087.webm",icon:"icon/10001087.png",audio:[]},{id:10001088,scope:"ui",width:310,height:252,loop:!1,duration:1.166,name:"\u88C5\u9970\u6548\u679C10",nameEn:"Decoration Effect 10",video:"video/10001088.webm",icon:"icon/10001088.png",audio:[]},{id:10001089,scope:"ui",width:178,height:74,loop:!1,duration:1.966,name:"\u88C5\u9970\u6548\u679C11",nameEn:"Decoration Effect 11",video:"video/10001089.webm",icon:"icon/10001089.png",audio:[]},{id:10001090,scope:"ui",width:190,height:190,loop:!1,duration:1.166,name:"\u95EA\u70C1\u6548\u679C15",nameEn:"Blink Effect 15",video:"video/10001090.webm",icon:"icon/10001090.png",audio:[]},{id:10001091,scope:"ui",width:188,height:188,loop:!1,duration:1.6,name:"\u95EA\u70C1\u6548\u679C16",nameEn:"Blink Effect 16",video:"video/10001091.webm",icon:"icon/10001091.png",audio:[]},{id:10001092,scope:"ui",width:200,height:200,loop:!0,duration:10,name:"\u88C5\u9970\u6548\u679C12",nameEn:"Decoration Effect 12",video:"video/10001092.webm",icon:"icon/10001092.png",audio:[]},{id:10001093,scope:"ui",width:294,height:302,loop:!1,duration:1.033,name:"\u88C5\u9970\u6548\u679C13",nameEn:"Decoration Effect 13",video:"video/10001093.webm",icon:"icon/10001093.png",audio:[]},{id:10001094,scope:"ui",width:310,height:310,loop:!1,duration:.833,name:"\u88C5\u9970\u6548\u679C14",nameEn:"Decoration Effect 14",video:"video/10001094.webm",icon:"icon/10001094.png",audio:[]},{id:10001095,scope:"ui",width:252,height:300,loop:!1,duration:1.8,name:"\u88C5\u9970\u6548\u679C15",nameEn:"Decoration Effect 15",video:"video/10001095.webm",icon:"icon/10001095.png",audio:[]},{id:10001096,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C16",nameEn:"Decoration Effect 16",video:"video/10001096.webm",icon:"icon/10001096.png",audio:[]},{id:10001097,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C17",nameEn:"Decoration Effect 17",video:"video/10001097.webm",icon:"icon/10001097.png",audio:[]},{id:10001098,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C18",nameEn:"Decoration Effect 18",video:"video/10001098.webm",icon:"icon/10001098.png",audio:[]},{id:10001099,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C19",nameEn:"Decoration Effect 19",video:"video/10001099.webm",icon:"icon/10001099.png",audio:[]},{id:10001100,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C20",nameEn:"Decoration Effect 20",video:"video/10001100.webm",icon:"icon/10001100.png",audio:[]},{id:10001101,scope:"ui",width:252,height:252,loop:!1,duration:1.6,name:"\u88C5\u9970\u6548\u679C21",nameEn:"Decoration Effect 21",video:"video/10001101.webm",icon:"icon/10001101.png",audio:[]},{id:10001102,scope:"ui",width:260,height:260,loop:!1,duration:1.133,name:"\u9AD8\u4EAE\u6548\u679C8",nameEn:"Highlight Effect 8",video:"video/10001102.webm",icon:"icon/10001102.png",audio:[]},{id:10001103,scope:"ui",width:260,height:260,loop:!1,duration:1.166,name:"\u9AD8\u4EAE\u6548\u679C9",nameEn:"Highlight Effect 9",video:"video/10001103.webm",icon:"icon/10001103.png",audio:[]},{id:10001104,scope:"ui",width:322,height:344,loop:!1,duration:1.133,name:"\u9AD8\u4EAE\u6548\u679C10",nameEn:"Highlight Effect 10",video:"video/10001104.webm",icon:"icon/10001104.png",audio:[]},{id:10001105,scope:"ui",width:380,height:394,loop:!1,duration:1.133,name:"\u9AD8\u4EAE\u6548\u679C11",nameEn:"Highlight Effect 11",video:"video/10001105.webm",icon:"icon/10001105.png",audio:[]},{id:10001106,scope:"ui",width:176,height:140,loop:!0,duration:10,name:"\u6C1B\u56F4\u6548\u679C3",nameEn:"Ambience Effect 3",video:"video/10001106.webm",icon:"icon/10001106.png",audio:[]},{id:10001107,scope:"ui",width:136,height:136,loop:!1,duration:.8,name:"\u95EA\u70C1\u6548\u679C17",nameEn:"Blink Effect 17",video:"video/10001107.webm",icon:"icon/10001107.png",audio:["audio/10001107.mp3"]},{id:10001108,scope:"ui",width:206,height:212,loop:!1,duration:1.7,name:"\u95EA\u70C1\u6548\u679C18",nameEn:"Blink Effect 18",video:"video/10001108.webm",icon:"icon/10001108.png",audio:["audio/10001108.mp3"]},{id:10001109,scope:"ui",width:182,height:182,loop:!1,duration:1.666,name:"\u95EA\u70C1\u6548\u679C19",nameEn:"Blink Effect 19",video:"video/10001109.webm",icon:"icon/10001109.png",audio:[]},{id:10001110,scope:"ui",width:650,height:306,loop:!1,duration:1.533,name:"\u95EA\u70C1\u6548\u679C20",nameEn:"Blink Effect 20",video:"video/10001110.webm",icon:"icon/10001110.png",audio:["audio/10001110.mp3"]},{id:10001111,scope:"ui",width:742,height:494,loop:!1,duration:.9,name:"\u95EA\u70C1\u6548\u679C21",nameEn:"Blink Effect 21",video:"video/10001111.webm",icon:"icon/10001111.png",audio:["audio/10001111.mp3"]},{id:10001112,scope:"ui",width:872,height:462,loop:!1,duration:.9,name:"\u95EA\u70C1\u6548\u679C22",nameEn:"Blink Effect 22",video:"video/10001112.webm",icon:"icon/10001112.png",audio:["audio/10001112.mp3"]},{id:10001113,scope:"ui",width:182,height:182,loop:!1,duration:1.166,name:"\u95EA\u70C1\u6548\u679C23",nameEn:"Blink Effect 23",video:"video/10001113.webm",icon:"icon/10001113.png",audio:[]},{id:10001114,scope:"ui",width:116,height:228,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF1",nameEn:"Progress Accumulation 1",video:"video/10001114.webm",icon:"icon/10001114.png",audio:[]},{id:10001115,scope:"ui",width:520,height:676,loop:!1,duration:1.133,name:"\u8FDB\u5EA6\u7D2F\u79EF2",nameEn:"Progress Accumulation 2",video:"video/10001115.webm",icon:"icon/10001115.png",audio:[]},{id:10001116,scope:"ui",width:88,height:88,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF3",nameEn:"Progress Accumulation 3",video:"video/10001116.webm",icon:"icon/10001116.png",audio:[]},{id:10001117,scope:"ui",width:166,height:278,loop:!1,duration:1.466,name:"\u95EA\u70C1\u6548\u679C24",nameEn:"Blink Effect 24",video:"video/10001117.webm",icon:"icon/10001117.png",audio:[]},{id:10001118,scope:"ui",width:106,height:106,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C25",nameEn:"Blink Effect 25",video:"video/10001118.webm",icon:"icon/10001118.png",audio:[]},{id:10001119,scope:"ui",width:118,height:118,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C26",nameEn:"Blink Effect 26",video:"video/10001119.webm",icon:"icon/10001119.png",audio:[]},{id:10001120,scope:"ui",width:130,height:118,loop:!1,duration:1.566,name:"\u95EA\u70C1\u6548\u679C27",nameEn:"Blink Effect 27",video:"video/10001120.webm",icon:"icon/10001120.png",audio:["audio/10001120.mp3","audio/10001120_02.mp3","audio/10001120_03.mp3","audio/10001120_04.mp3","audio/10001120_05.mp3","audio/10001120_06.mp3","audio/10001120_07.mp3","audio/10001120_08.mp3","audio/10001120_09.mp3","audio/10001120_10.mp3","audio/10001120_11.mp3"]},{id:10001121,scope:"ui",width:376,height:400,loop:!1,duration:1.333,name:"\u95EA\u70C1\u6548\u679C28",nameEn:"Blink Effect 28",video:"video/10001121.webm",icon:"icon/10001121.png",audio:[]},{id:10001122,scope:"ui",width:986,height:706,loop:!1,duration:2.6,name:"\u95EA\u70C1\u6548\u679C29",nameEn:"Blink Effect 29",video:"video/10001122.webm",icon:"icon/10001122.png",audio:[]},{id:10001124,scope:"ui",width:2334,height:2714,loop:!1,duration:1.4,name:"\u7ED3\u7B97\u6548\u679C1",nameEn:"Settlement Effect 1",video:"video/10001124.webm",icon:"icon/10001124.png",audio:[]},{id:10001125,scope:"ui",width:2214,height:2270,loop:!1,duration:1.233,name:"\u7ED3\u7B97\u6548\u679C2",nameEn:"Settlement Effect 2",video:"video/10001125.webm",icon:"icon/10001125.png",audio:[]},{id:10001126,scope:"ui",width:2574,height:1178,loop:!1,duration:3.133,name:"\u7ED3\u7B97\u6548\u679C3",nameEn:"Settlement Effect 3",video:"video/10001126.webm",icon:"icon/10001126.png",audio:[]},{id:10001127,scope:"ui",width:1918,height:1138,loop:!1,duration:3.066,name:"\u7ED3\u7B97\u6548\u679C4",nameEn:"Settlement Effect 4",video:"video/10001127.webm",icon:"icon/10001127.png",audio:[]},{id:10001128,scope:"ui",width:548,height:212,loop:!1,duration:1.966,name:"\u95EA\u70C1\u6548\u679C30",nameEn:"Blink Effect 30",video:"video/10001128.webm",icon:"icon/10001128.png",audio:[]},{id:10001129,scope:"ui",width:638,height:520,loop:!1,duration:1.133,name:"\u95EA\u70C1\u6548\u679C31",nameEn:"Blink Effect 31",video:"video/10001129.webm",icon:"icon/10001129.png",audio:["audio/10001129.mp3"]},{id:10001130,scope:"ui",width:284,height:142,loop:!1,duration:1.2,name:"\u95EA\u70C1\u6548\u679C32",nameEn:"Blink Effect 32",video:"video/10001130.webm",icon:"icon/10001130.png",audio:[]},{id:10001131,scope:"ui",width:790,height:790,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C33",nameEn:"Blink Effect 33",video:"video/10001131.webm",icon:"icon/10001131.png",audio:["audio/10001131.mp3"]},{id:10001132,scope:"ui",width:1020,height:264,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C34",nameEn:"Blink Effect 34",video:"video/10001132.webm",icon:"icon/10001132.png",audio:[]},{id:10001133,scope:"ui",width:1348,height:358,loop:!1,duration:1.5,name:"\u7ED3\u7B97\u6548\u679C5",nameEn:"Settlement Effect 5",video:"video/10001133.webm",icon:"icon/10001133.png",audio:[]},{id:10001134,scope:"ui",width:1116,height:290,loop:!1,duration:2,name:"\u95EA\u70C1\u6548\u679C35",nameEn:"Blink Effect 35",video:"video/10001134.webm",icon:"icon/10001134.png",audio:["audio/10001134.mp3"]},{id:10001135,scope:"ui",width:1116,height:290,loop:!1,duration:2,name:"\u95EA\u70C1\u6548\u679C36",nameEn:"Blink Effect 36",video:"video/10001135.webm",icon:"icon/10001135.png",audio:["audio/10001135.mp3"]},{id:10001136,scope:"ui",width:1520,height:296,loop:!1,duration:1.466,name:"\u95EA\u70C1\u6548\u679C37",nameEn:"Blink Effect 37",video:"video/10001136.webm",icon:"icon/10001136.png",audio:[]},{id:10001137,scope:"ui",width:2266,height:706,loop:!1,duration:2.066,name:"\u95EA\u70C1\u6548\u679C38",nameEn:"Blink Effect 38",video:"video/10001137.webm",icon:"icon/10001137.png",audio:[]},{id:10001138,scope:"ui",width:912,height:192,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C39",nameEn:"Blink Effect 39",video:"video/10001138.webm",icon:"icon/10001138.png",audio:[]},{id:10001139,scope:"ui",width:912,height:192,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C40",nameEn:"Blink Effect 40",video:"video/10001139.webm",icon:"icon/10001139.png",audio:[]},{id:10001140,scope:"ui",width:912,height:174,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C41",nameEn:"Blink Effect 41",video:"video/10001140.webm",icon:"icon/10001140.png",audio:[]},{id:10001141,scope:"ui",width:912,height:102,loop:!1,duration:2.033,name:"\u95EA\u70C1\u6548\u679C42",nameEn:"Blink Effect 42",video:"video/10001141.webm",icon:"icon/10001141.png",audio:[]},{id:10001142,scope:"ui",width:1766,height:1542,loop:!1,duration:3.8,name:"\u95EA\u70C1\u6548\u679C43",nameEn:"Blink Effect 43",video:"video/10001142.webm",icon:"icon/10001142.png",audio:[]},{id:10001143,scope:"ui",width:1312,height:168,loop:!1,duration:1.066,name:"\u95EA\u70C1\u6548\u679C44",nameEn:"Blink Effect 44",video:"video/10001143.webm",icon:"icon/10001143.png",audio:["audio/10001143.mp3","audio/10001143_02.mp3"]},{id:10001144,scope:"ui",width:698,height:82,loop:!1,duration:2.233,name:"\u95EA\u70C1\u6548\u679C45",nameEn:"Blink Effect 45",video:"video/10001144.webm",icon:"icon/10001144.png",audio:[]},{id:10001145,scope:"ui",width:698,height:92,loop:!1,duration:2.266,name:"\u95EA\u70C1\u6548\u679C46",nameEn:"Blink Effect 46",video:"video/10001145.webm",icon:"icon/10001145.png",audio:[]},{id:10001146,scope:"ui",width:698,height:92,loop:!1,duration:2.266,name:"\u95EA\u70C1\u6548\u679C47",nameEn:"Blink Effect 47",video:"video/10001146.webm",icon:"icon/10001146.png",audio:[]},{id:10001147,scope:"ui",width:306,height:54,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF4",nameEn:"Progress Accumulation 4",video:"video/10001147.webm",icon:"icon/10001147.png",audio:[]},{id:10001148,scope:"ui",width:934,height:194,loop:!1,duration:1.233,name:"\u8FDB\u5EA6\u7D2F\u79EF5",nameEn:"Progress Accumulation 5",video:"video/10001148.webm",icon:"icon/10001148.png",audio:[]},{id:10001149,scope:"ui",width:616,height:248,loop:!0,duration:10,name:"\u95EA\u70C1\u6548\u679C48",nameEn:"Blink Effect 48",video:"video/10001149.webm",icon:"icon/10001149.png",audio:[]},{id:10001150,scope:"ui",width:746,height:228,loop:!1,duration:1.366,name:"\u95EA\u70C1\u6548\u679C49",nameEn:"Blink Effect 49",video:"video/10001150.webm",icon:"icon/10001150.png",audio:[]},{id:10001151,scope:"ui",width:606,height:210,loop:!1,duration:1.233,name:"\u95EA\u70C1\u6548\u679C50",nameEn:"Blink Effect 50",video:"video/10001151.webm",icon:"icon/10001151.png",audio:[]},{id:10001152,scope:"ui",width:1674,height:346,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF6",nameEn:"Progress Accumulation 6",video:"video/10001152.webm",icon:"icon/10001152.png",audio:[]},{id:10001153,scope:"ui",width:1110,height:400,loop:!1,duration:1.2,name:"\u95EA\u70C1\u6548\u679C51",nameEn:"Blink Effect 51",video:"video/10001153.webm",icon:"icon/10001153.png",audio:["audio/10001153.mp3","audio/10001153_02.mp3"]},{id:10001154,scope:"ui",width:1178,height:506,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF7",nameEn:"Progress Accumulation 7",video:"video/10001154.webm",icon:"icon/10001154.png",audio:[]},{id:10001155,scope:"ui",width:1254,height:200,loop:!1,duration:1.2,name:"\u8FDB\u5EA6\u7D2F\u79EF8",nameEn:"Progress Accumulation 8",video:"video/10001155.webm",icon:"icon/10001155.png",audio:["audio/10001155.mp3"]},{id:10001156,scope:"ui",width:1180,height:202,loop:!1,duration:1.2,name:"\u8FDB\u5EA6\u7D2F\u79EF9",nameEn:"Progress Accumulation 9",video:"video/10001156.webm",icon:"icon/10001156.png",audio:["audio/10001156.mp3"]},{id:10001157,scope:"ui",width:654,height:118,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF10",nameEn:"Progress Accumulation 10",video:"video/10001157.webm",icon:"icon/10001157.png",audio:[]},{id:10001158,scope:"ui",width:962,height:162,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF11",nameEn:"Progress Accumulation 11",video:"video/10001158.webm",icon:"icon/10001158.png",audio:[]},{id:10001159,scope:"ui",width:1016,height:142,loop:!0,duration:10,name:"\u8FDB\u5EA6\u7D2F\u79EF12",nameEn:"Progress Accumulation 12",video:"video/10001159.webm",icon:"icon/10001159.png",audio:[]},{id:10001160,scope:"ui",width:790,height:210,loop:!1,duration:1,name:"\u8FDB\u5EA6\u7D2F\u79EF13",nameEn:"Progress Accumulation 13",video:"video/10001160.webm",icon:"icon/10001160.png",audio:[]},{id:10002001,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F41",nameEn:"View Ambience 1",video:"video/10002001.webm",icon:"icon/10002001.png",audio:["audio/10002001.mp3"]},{id:10002002,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F42",nameEn:"View Ambience 2",video:"video/10002002.webm",icon:"icon/10002002.png",audio:[]},{id:10002003,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F43",nameEn:"View Ambience 3",video:"video/10002003.webm",icon:"icon/10002003.png",audio:[]},{id:10002004,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F44",nameEn:"View Ambience 4",video:"video/10002004.webm",icon:"icon/10002004.png",audio:[]},{id:10002005,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F45",nameEn:"View Ambience 5",video:"video/10002005.webm",icon:"icon/10002005.png",audio:[]},{id:10002006,scope:"screen",width:1280,height:720,loop:!1,duration:1.9,name:"\u89C6\u91CE\u6C1B\u56F46",nameEn:"View Ambience 6",video:"video/10002006.webm",icon:"icon/10002006.png",audio:[]},{id:10002007,scope:"screen",width:1280,height:720,loop:!1,duration:2.4,name:"\u89C6\u91CE\u6C1B\u56F47",nameEn:"View Ambience 7",video:"video/10002007.webm",icon:"icon/10002007.png",audio:[]},{id:10002008,scope:"screen",width:1280,height:720,loop:!1,duration:3.433,name:"\u89C6\u91CE\u6C1B\u56F48",nameEn:"View Ambience 8",video:"video/10002008.webm",icon:"icon/10002008.png",audio:["audio/10002008.mp3"]},{id:10002009,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F49",nameEn:"View Ambience 9",video:"video/10002009.webm",icon:"icon/10002009.png",audio:["audio/10002009.mp3"]},{id:10002010,scope:"screen",width:1280,height:720,loop:!1,duration:2.5,name:"\u89C6\u91CE\u6C1B\u56F410",nameEn:"View Ambience 10",video:"video/10002010.webm",icon:"icon/10002010.png",audio:[]},{id:10002011,scope:"screen",width:1280,height:720,loop:!1,duration:1.8,name:"\u89C6\u91CE\u6C1B\u56F411",nameEn:"View Ambience 11",video:"video/10002011.webm",icon:"icon/10002011.png",audio:[]},{id:10002012,scope:"screen",width:1280,height:720,loop:!1,duration:2.933,name:"\u89C6\u91CE\u6C1B\u56F412",nameEn:"View Ambience 12",video:"video/10002012.webm",icon:"icon/10002012.png",audio:[]},{id:10002013,scope:"screen",width:1280,height:720,loop:!1,duration:3.9,name:"\u89C6\u91CE\u6C1B\u56F413",nameEn:"View Ambience 13",video:"video/10002013.webm",icon:"icon/10002013.png",audio:[]},{id:10002014,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F414",nameEn:"View Ambience 14",video:"video/10002014.webm",icon:"icon/10002014.png",audio:[]},{id:10002015,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F415",nameEn:"View Ambience 15",video:"video/10002015.webm",icon:"icon/10002015.png",audio:["audio/10002015.mp3"]},{id:10002016,scope:"screen",width:1280,height:720,loop:!1,duration:2.5,name:"\u89C6\u91CE\u6C1B\u56F416",nameEn:"View Ambience 16",video:"video/10002016.webm",icon:"icon/10002016.png",audio:[]},{id:10002017,scope:"screen",width:1280,height:720,loop:!1,duration:.733,name:"\u89C6\u91CE\u6C1B\u56F417",nameEn:"View Ambience 17",video:"video/10002017.webm",icon:"icon/10002017.png",audio:[]},{id:10002018,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F418",nameEn:"View Ambience 18",video:"video/10002018.webm",icon:"icon/10002018.png",audio:[]},{id:10002019,scope:"screen",width:1280,height:720,loop:!1,duration:2.2,name:"\u89C6\u91CE\u6C1B\u56F419",nameEn:"View Ambience 19",video:"video/10002019.webm",icon:"icon/10002019.png",audio:[]},{id:10002020,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F420",nameEn:"View Ambience 20",video:"video/10002020.webm",icon:"icon/10002020.png",audio:[]},{id:10002021,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F421",nameEn:"View Ambience 21",video:"video/10002021.webm",icon:"icon/10002021.png",audio:[]},{id:10002022,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F422",nameEn:"View Ambience 22",video:"video/10002022.webm",icon:"icon/10002022.png",audio:[]},{id:10002023,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F423",nameEn:"View Ambience 23",video:"video/10002023.webm",icon:"icon/10002023.png",audio:[]},{id:10002024,scope:"screen",width:1280,height:720,loop:!1,duration:3.4,name:"\u89C6\u91CE\u6C1B\u56F424",nameEn:"View Ambience 24",video:"video/10002024.webm",icon:"icon/10002024.png",audio:[]},{id:10002025,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F425",nameEn:"View Ambience 25",video:"video/10002025.webm",icon:"icon/10002025.png",audio:[]},{id:10002026,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F426",nameEn:"View Ambience 26",video:"video/10002026.webm",icon:"icon/10002026.png",audio:["audio/10002026.mp3"]},{id:10002027,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F427",nameEn:"View Ambience 27",video:"video/10002027.webm",icon:"icon/10002027.png",audio:[]},{id:10002028,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F428",nameEn:"View Ambience 28",video:"video/10002028.webm",icon:"icon/10002028.png",audio:[]},{id:10002029,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F429",nameEn:"View Ambience 29",video:"video/10002029.webm",icon:"icon/10002029.png",audio:[]},{id:10002030,scope:"screen",width:1280,height:720,loop:!1,duration:1.966,name:"\u89C6\u91CE\u6C1B\u56F430",nameEn:"View Ambience 30",video:"video/10002030.webm",icon:"icon/10002030.png",audio:[]},{id:10002031,scope:"screen",width:1280,height:720,loop:!1,duration:1.166,name:"\u89C6\u91CE\u6C1B\u56F431",nameEn:"View Ambience 31",video:"video/10002031.webm",icon:"icon/10002031.png",audio:["audio/10002031.mp3","audio/10002031_02.mp3","audio/10002031_03.mp3","audio/10002031_04.mp3"]},{id:10002032,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F432",nameEn:"View Ambience 32",video:"video/10002032.webm",icon:"icon/10002032.png",audio:["audio/10002032.mp3"]},{id:10002033,scope:"screen",width:1280,height:720,loop:!1,duration:2,name:"\u89C6\u91CE\u6C1B\u56F433",nameEn:"View Ambience 33",video:"video/10002033.webm",icon:"icon/10002033.png",audio:["audio/10002033.mp3","audio/10002033_02.mp3"]},{id:10002034,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F434",nameEn:"View Ambience 34",video:"video/10002034.webm",icon:"icon/10002034.png",audio:[]},{id:10002035,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u89C6\u91CE\u6C1B\u56F435",nameEn:"View Ambience 35",video:"video/10002035.webm",icon:"icon/10002035.png",audio:["audio/10002035.mp3"]},{id:10002036,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u7784\u51C6\u6548\u679C1",nameEn:"Aiming Effect 1",video:"video/10002036.webm",icon:"icon/10002036.png",audio:[]},{id:10002037,scope:"screen",width:1280,height:720,loop:!0,duration:10,name:"\u7784\u51C6\u6548\u679C2",nameEn:"Aiming Effect 2",video:"video/10002037.webm",icon:"icon/10002037.png",audio:["audio/10002037.mp3"]}],files:{"audio/10001017.mp3":{bytes:6524,sha256:"82470dfef398dab45fb3d50134da7b49573e7189f683d2bdf0849b478f267c79",duration:.850667},"audio/10001032.mp3":{bytes:27907,sha256:"53ca71dde10d2d7b6fbf7232d2461f48e564c2d847cbb29f9aac685114634dff",duration:1.258231},"audio/10001040.mp3":{bytes:24212,sha256:"faf6a45ba3d02a6d86ba43f8fe8bf7dbadd22997f0e16ed22b990b0eeaac05c2",duration:1.202104},"audio/10001043.mp3":{bytes:15068,sha256:"ffe52807864f795fd7f8e5e235fca49537437d70a34db83d66352063fe538a52",duration:.570563},"audio/10001043_02.mp3":{bytes:12812,sha256:"b8c194027b798e504f51ae73b67ae63e0d56904ebc95d458b0065d995fa2ed58",duration:.501813},"audio/10001057.mp3":{bytes:28220,sha256:"df501138ff9ae6a43fc8b434c09a401093a5598e9366136e7071e1c57baeb238",duration:1.613042},"audio/10001059.mp3":{bytes:29516,sha256:"2d80dbec2dde2348c3c9dcf95598a79bd851aa8329c5ed68e33d40a532ee491c",duration:1.4855},"audio/10001107.mp3":{bytes:27174,sha256:"eedee79d5e4cb0282bba21e5b12a24170a07354f3285d3f50cd47e24ead5149b",duration:1.383039},"audio/10001108.mp3":{bytes:27174,sha256:"eedee79d5e4cb0282bba21e5b12a24170a07354f3285d3f50cd47e24ead5149b",duration:1.383039},"audio/10001110.mp3":{bytes:12164,sha256:"de0f6db4c8942741fa82168431e31f8b54d68260bf412266ef707506ff6f10c3",duration:.448},"audio/10001111.mp3":{bytes:12164,sha256:"de0f6db4c8942741fa82168431e31f8b54d68260bf412266ef707506ff6f10c3",duration:.448},"audio/10001112.mp3":{bytes:12164,sha256:"de0f6db4c8942741fa82168431e31f8b54d68260bf412266ef707506ff6f10c3",duration:.448},"audio/10001120.mp3":{bytes:19556,sha256:"2f7a402979dc442b4214e46d79b2dd1b7925c96c0eaebbbf0555fe3f5bb3a529",duration:1.5},"audio/10001120_02.mp3":{bytes:19772,sha256:"f1c0f5e4b3f8a550d058f14a35340f4cbf56de86b4c409dd13b1125d682e09d6",duration:1.5},"audio/10001120_03.mp3":{bytes:18572,sha256:"630975e0a80512e788648adadc6b2d96c526a6125e13ffffde83e65cf000aa5e",duration:1.5},"audio/10001120_04.mp3":{bytes:21212,sha256:"00da41febe7cf8a8491117ef820c42aa79c65172769b4a12705666e9d7f2b636",duration:1.5},"audio/10001120_05.mp3":{bytes:19220,sha256:"5d85fe103ecc1868eefc679ff676996c329e61881640ac743409899d34fc5b6b",duration:1.5},"audio/10001120_06.mp3":{bytes:24596,sha256:"ce03626d5f0a7ccaf4a6cec7bce8ed915f61d6ec57b3cd532cbfc89da5bdcc3e",duration:1.5},"audio/10001120_07.mp3":{bytes:22316,sha256:"4dadba002982494e40772cccfedce6f6405fb4abc1e81f2206c4c2e0ac2645b5",duration:1.5},"audio/10001120_08.mp3":{bytes:21548,sha256:"309625fddc0d645da062ff788100a656bd83c4ce8cb75d523ed1949387e8252e",duration:1.5},"audio/10001120_09.mp3":{bytes:23060,sha256:"2eaf460f61ae85e8e2a4c324ebb9c4bc4f460fd2489a15943b92d2fa4422d3b6",duration:1.5},"audio/10001120_10.mp3":{bytes:18668,sha256:"6242a47c96c9ce87cb00a6f2288e8209b9ef5e3dc7ecb62bdadbf8672df95714",duration:1.5},"audio/10001120_11.mp3":{bytes:21188,sha256:"880383e307f7fe7210c05c37fc04a0ac8e3c909d500215f72c7228b9c2e660a6",duration:1.5},"audio/10001129.mp3":{bytes:45188,sha256:"07198b0853f2a859c6ccb85ec4ad1e56c6131302f5145f50d39fd98efe7e5387",duration:2.130667},"audio/10001131.mp3":{bytes:45188,sha256:"07198b0853f2a859c6ccb85ec4ad1e56c6131302f5145f50d39fd98efe7e5387",duration:2.130667},"audio/10001134.mp3":{bytes:45908,sha256:"ff64e15c3144791ad9073ee4537eb21ec7cf1d41dd205b0ef051a8263784793f",duration:2.518667},"audio/10001135.mp3":{bytes:49940,sha256:"edf39fa868e9e42da6fe38c8f726bf4162c950543efdfdefb1f85d3dfaa4d72b",duration:2.758667},"audio/10001143.mp3":{bytes:20156,sha256:"740c276f344b457077bc48f627304d15bbd879d06b3d6b6108673f07d2ec0dc5",duration:.841333},"audio/10001143_02.mp3":{bytes:36524,sha256:"b70b6326344739a781ef5ba96103b349d37052102a29cf2d5cddd2517cd13dff",duration:2.298604},"audio/10001153.mp3":{bytes:20372,sha256:"5c7d6a7ee0d3fff9352071a17979c9941ab1e5322e9b5a94692077f932c71ecf",duration:1.074208},"audio/10001153_02.mp3":{bytes:21140,sha256:"34e4852a0e1bcfd46c8820d9d61a1ef5288ba2795decc8829d1cf1c4b04d1b3a",duration:1.074208},"audio/10001155.mp3":{bytes:32132,sha256:"e1b38d6f72b3b7124da2c8a6417484053e1dd2833507d03cea32175d3d8e486c",duration:1.361167},"audio/10001156.mp3":{bytes:17468,sha256:"b945a4cc1ef374343806f677e1e2ab461c452a4eed6992151575791ccae7e9b2",duration:.808958},"audio/10002001.mp3":{bytes:126284,sha256:"9bedc3f73a10d1b4205d53c2c11b22ad1fc54375a430be0f64e2e5a7ed68b35d",duration:6.018875},"audio/10002008.mp3":{bytes:58316,sha256:"e24d9e46941a40c27b0adbc06927f245cb4826445142d3d4d1ca5d4e7a6889b7",duration:2.57125},"audio/10002009.mp3":{bytes:57932,sha256:"abea73a14c14dc143ed4b1244eba7257bf38119edb13923504c00ee11f51deb1",duration:2.5},"audio/10002015.mp3":{bytes:57932,sha256:"abea73a14c14dc143ed4b1244eba7257bf38119edb13923504c00ee11f51deb1",duration:2.5},"audio/10002026.mp3":{bytes:38137,sha256:"3ce1a1df88494fb7179a6df74a9f30f14e185e16060d84daff586c2992f06c1d",duration:1.994603},"audio/10002031.mp3":{bytes:6932,sha256:"81439fcff710fdd6ce4541ddf76edc30f119c44fbf7e6d39df2c6349ffe4a347",duration:.301333},"audio/10002031_02.mp3":{bytes:5420,sha256:"f9ad4c41d670a010fb7e8acc6227e0ea8dc73dc1504972190aa513fdc0257d05",duration:.296104},"audio/10002031_03.mp3":{bytes:8012,sha256:"40c44c0ea861bd86e1bbedda8bf48dbe5c4d0b3a22f493cc2d9dfab43544d9e5",duration:.296104},"audio/10002031_04.mp3":{bytes:5948,sha256:"69c8ab1fc17a47a696e1e65d2a87613ae98377712d09a4d18cfbdf6cb06defae",duration:.296104},"audio/10002032.mp3":{bytes:111082,sha256:"0f17b84ae322621d29af50d88c3ee8d66677926429ae818579eba240e5f07a52",duration:4.90771},"audio/10002033.mp3":{bytes:59847,sha256:"0476fabf3f0d6d000758a82e467a1ff0e363d0efa3e873b60eb2d4194372aa24",duration:2.949274},"audio/10002033_02.mp3":{bytes:60791,sha256:"9f6eac53ec1f8dd02be7a532ee51ddbfc2c1f34c935616194e2c92e8ea8794bd",duration:2.928254},"audio/10002035.mp3":{bytes:93092,sha256:"360a57a535ffe34d8fdd3ef652512dac3cb46c1155791ea5992b3fd5cfde3a0c",duration:4.26},"audio/10002037.mp3":{bytes:50252,sha256:"508a7cadf5dec9f94a41570aa5d0dae7b7ee2fef4bbf42e96b7a8b46da21e51d",duration:2.246667},"icon/10001001.png":{bytes:23905,sha256:"fe51bb11c58eef524f2f6683663a58f69c4272de1d027797ccf1b283b5fcc583"},"icon/10001002.png":{bytes:22166,sha256:"36936f7678f5c5cb0a3a014a76eb9c6bdd5a9f23e72dfbef6d9523523cf9be48"},"icon/10001003.png":{bytes:22959,sha256:"77e1ca70f67b68c3a2ff8951017a95c54af43a02d37f025c4b39e299a0389820"},"icon/10001004.png":{bytes:24182,sha256:"127a9be79e7a0460bbba6f4390b83cf0137a1f50995fd4ddfdf071d0ce9aec5c"},"icon/10001005.png":{bytes:24501,sha256:"78dfe771d99b5002ef7ba93d6b2705aabf28fc8ad362becccd986de62da8b9ee"},"icon/10001006.png":{bytes:23058,sha256:"0bd296f4d2ec3fb3a46f6cbaaeaa959de21e5e94927317cc1c00f3eb767a8ab4"},"icon/10001007.png":{bytes:24384,sha256:"0d858dd1574291ff8365a64381eb7c2244e2f3ee054b89c4291d295af23cb565"},"icon/10001008.png":{bytes:25339,sha256:"60fb9e6b7b0765eb6559360a501220628f73995f20cf32bf600556ed55baebed"},"icon/10001009.png":{bytes:25470,sha256:"6eedb42ef97b243de8b3c7ce7d4ff06ecda408e333c1b67bfb0c3252ba2b71fc"},"icon/10001010.png":{bytes:17067,sha256:"3067643b0330ec446e15ff4b50eadc5c9d75597fac5b7ead544cf9f74c27c8f3"},"icon/10001011.png":{bytes:20283,sha256:"693c10ff57c4f729c5bc4bbc64aa15a7ee9ed1666ad08af11a6bf976e3608ab6"},"icon/10001012.png":{bytes:17900,sha256:"eeb4aa0a6a2e7d52983207ae143660f4cb50c1b529f7c42817112f760ef07520"},"icon/10001013.png":{bytes:20986,sha256:"273f7d86fb8e209bbd2dc06ceb3679c7f8d5d78f57fc3690bfbf83dd48a5fb4c"},"icon/10001014.png":{bytes:19083,sha256:"966cdcbd74d3e990262f5fdf1cc58704f67ca4a2ea5cd36d0118c0be2f312e0c"},"icon/10001015.png":{bytes:19533,sha256:"da2debca11cfa90e1868b966aa19f426664b968d0523ed458bc23e6a26601272"},"icon/10001016.png":{bytes:20596,sha256:"9a584e1393532cc8649512c31319bfa901fc73d557e01c3cd3c77ec80b8a6225"},"icon/10001017.png":{bytes:15766,sha256:"b2588c21a03d6c7795398e2240e527bbdd4e3f718f806f3906930bd68a4c8b85"},"icon/10001018.png":{bytes:18168,sha256:"5e9938443c22663db8434fc568362ae4d3de48cb1b6c411e703aeac07e3b5c4c"},"icon/10001019.png":{bytes:21447,sha256:"7625187d1c358b23e8ff7c38a9a4c6a9952bb0d7f9d4b6cf1256f1a0493df72f"},"icon/10001020.png":{bytes:24125,sha256:"2c07a35ade6a3d73b08d24b76153eedb6de41f1298e840dd5faee04bbf8fbcb0"},"icon/10001021.png":{bytes:19226,sha256:"06046a9387fd8ead3fbe4002c9cafbaa4189852bd683ef3b627133324fc578e9"},"icon/10001022.png":{bytes:19063,sha256:"30406afc29728bd50b1cd1704307effdca73a86db5d3b97a7fd1b2ba936e383a"},"icon/10001023.png":{bytes:19749,sha256:"29ed71483317b6d1f7fdcc4556731ca19a3828158bd70710eaaac5f7512b7aa1"},"icon/10001024.png":{bytes:7178,sha256:"1459dc8c6bba8f391e63d40dc410b0a94ba1ea346a2cc19b8fcee940010a3bd6"},"icon/10001025.png":{bytes:5758,sha256:"7fd586d94c22c9a6c4ad0248974b21d4f29b2a7e2c8c04cecf607f860bd4dd74"},"icon/10001026.png":{bytes:6248,sha256:"1829dd3720c0df86849f78fc5fb532e8412a5302bae20cd4571376c9ae06f43d"},"icon/10001027.png":{bytes:5454,sha256:"fed706b5943134d4fdb776ec35f479bf792a0b4603e23b2030e7893a3159ecd8"},"icon/10001028.png":{bytes:5275,sha256:"f0f01e125afd58d2a7cc6f850e1a69edb8e47d31a424eed21431b0b4f0e34bdd"},"icon/10001029.png":{bytes:6492,sha256:"592c905f1b364684d1004bc17739d1dd563e6aad5a0da97174d6f4d91dde0afc"},"icon/10001030.png":{bytes:5994,sha256:"816c8995dc94a724233222b3a21633d55330bad2c9879509587cfc10a20e9f50"},"icon/10001031.png":{bytes:12053,sha256:"36d3220568ee902b5cdce711946423d79edf54d70b46f7e46d9d79316a60f470"},"icon/10001032.png":{bytes:6189,sha256:"4d2f2a6a4aa56f799fa6d9b2bf112dd14754f3480951962899ed8e19f0f3d5a4"},"icon/10001033.png":{bytes:19270,sha256:"74367881fc31f13f6c8c6aa87a5da0c779d8303cda03aab1b914d03e2e243697"},"icon/10001034.png":{bytes:23429,sha256:"fdf41e7834dacd674f9d14e4db0c3a4598ae18ad7bcb0ed2f819af69decc4564"},"icon/10001035.png":{bytes:10567,sha256:"71e42a76b7d82964f609885a8fd0f4b8082dfbbc450349dd1329fac1d0f3b8d7"},"icon/10001036.png":{bytes:20003,sha256:"3ffb2d2cae852795566819b3bc65e42d6f5cfea442807813e3f110d2ae5306ab"},"icon/10001037.png":{bytes:11651,sha256:"0f2f343b4030beb38a5d03ca500b16292ee3402853a685eea33907da3166d00d"},"icon/10001038.png":{bytes:3402,sha256:"4fe6ebe2f6160b91c3c51971e4d588fa75f17dc58680c5e7525547eadb8a9922"},"icon/10001039.png":{bytes:16348,sha256:"c91c4bb5fd6c4ca331d4e47015669bd8727d2c91a3d79e97dceabba5484eed51"},"icon/10001040.png":{bytes:15606,sha256:"02c74e003d186f3c5ca4ea280312e2629faade7a3b95dc9ea320f587d411c658"},"icon/10001041.png":{bytes:7378,sha256:"dcec72b04c3096893874d605112c6c8aca2182a5d7af4231e08e279155efc6f0"},"icon/10001042.png":{bytes:9216,sha256:"4d53cec5485b07cde76ef6a459d7f30b73cbb149c7d22d70f94c9d4f08caca95"},"icon/10001043.png":{bytes:7268,sha256:"d0c2a175a0de3b1ed673ff2298cd964e93681a79b8bae03cb3a9940bf2b295b7"},"icon/10001044.png":{bytes:17785,sha256:"b166e9094cfb03ecce6eeeef4715623325ec4b86eda3236e72d34c7f1e4c7aee"},"icon/10001045.png":{bytes:20257,sha256:"dba951310f94d16e23800d78e6f15fb09753de1106fce0b6b65c869ac836ae5e"},"icon/10001046.png":{bytes:18695,sha256:"ccabfef92ec484881baade8997962077e362dde9552a0eefa4c11a063156bc61"},"icon/10001047.png":{bytes:20724,sha256:"571f24becceb229b8388a458c72bf5367c9c9b1bd2f511be9b6175f34c3fa743"},"icon/10001048.png":{bytes:19845,sha256:"3bccfb7c346d124071a2746f75d9e519d90985f07a9122cbb373347646c50d1e"},"icon/10001049.png":{bytes:26620,sha256:"62eaca8f1fa7013d5a9039864571102c640f0ad38b7fc19c34e475caf719cda5"},"icon/10001050.png":{bytes:21554,sha256:"9757b6b14968327fbd2933e4bc1df5c88e8acaa6a1654f880d0aa60557d0f012"},"icon/10001051.png":{bytes:23608,sha256:"3649049db87f65e60857124089570f03d8a87ccd367eddf1cd3189dc49318222"},"icon/10001052.png":{bytes:10144,sha256:"2939136db3eeca57cf771b6e776b0d00ef93b53d00a436b1429c8035821cb49b"},"icon/10001053.png":{bytes:16400,sha256:"29c5e8192b476e74b655b9b717ffa08b0195d5e098951a07904128b2fdfd8cd3"},"icon/10001054.png":{bytes:26202,sha256:"f73fbc019e699b109591814aae3f6d8b111b1388e6bb129ccb35edf7b526dd6d"},"icon/10001055.png":{bytes:19948,sha256:"48de3fe25bdde874eac546529417ffcc4ad395640539895293de829bc9d28fcb"},"icon/10001056.png":{bytes:9550,sha256:"a681352376be706911851bb90563ed343968c35c58c7af3a77fff4b4c16ea3a2"},"icon/10001057.png":{bytes:4530,sha256:"f855883dd19a55155968b77c238f2b5fe0cd894569959ec0f776b3c7d9c0006d"},"icon/10001058.png":{bytes:19430,sha256:"d94b796fbddaf0d63531c0b5569b26ef3e5cb42a51b06faced91b6c9fe467c94"},"icon/10001059.png":{bytes:21181,sha256:"71fe484027e51e4b7af32da4a4d3c661bef1dc5e011710aa0c8512db46237072"},"icon/10001060.png":{bytes:19537,sha256:"cb3ee2648a2b1b656e731d8b2c0cb102bc2eed1c6125b166e1867ca0129b4117"},"icon/10001061.png":{bytes:19347,sha256:"2b7bff19a05b1868e680b8d96919aa1449a7a35fb16fad62ce12d9e546f1cc8c"},"icon/10001062.png":{bytes:24195,sha256:"381bb70063fa7dcc3eda51a116bd79c44f41f32fb2abe647c3957570ca3c5257"},"icon/10001063.png":{bytes:24414,sha256:"240ad25841dcf341fc202efeb82009b52f9e99a403129b251443248f8729200d"},"icon/10001064.png":{bytes:21752,sha256:"8f37873cb51acc05c3e38534b272fc0dffaf2455e85f123fb7d1273584e9a276"},"icon/10001065.png":{bytes:22353,sha256:"082328a9b48c365b77eb4b7c7fe3461647af52da0f6f8d3a9a6aed4715ef55c9"},"icon/10001066.png":{bytes:25040,sha256:"93e8e9a1154521759b8275da6dd7813520067bdbb958fa1ef40a3e2db5d33ebd"},"icon/10001067.png":{bytes:17900,sha256:"764844d417a505af87d84c5b45ed11d8d4f6751e0bb934296354baf2c5e9b7db"},"icon/10001068.png":{bytes:27775,sha256:"f1696ad983c71560c9954d23d24e32fa79d877b7f136b115526d74002dfa13ee"},"icon/10001069.png":{bytes:27560,sha256:"14a34457ecf46a8f4a587ec4c7349a56dfa50550382dade7b3496365165b6f3c"},"icon/10001070.png":{bytes:7342,sha256:"392327cac6f05cd50cf10517e065449b3e3d63a20f2e7028cb54597341fffa1a"},"icon/10001071.png":{bytes:8292,sha256:"e35b725fd8337d3caf63550d9b3483fcc4d2e033711538db5cf792c1990760f2"},"icon/10001072.png":{bytes:2941,sha256:"92b0722a12b3370aaa2ddc69da17d1df9ded02d96e1310d9f88d22531d1e52bf"},"icon/10001073.png":{bytes:26648,sha256:"8cb0bfeb6f957c3507f9c59987440e34f9b8af8435ded2e80451c47c5e40e3ed"},"icon/10001074.png":{bytes:15602,sha256:"ade023a5bbeabcb56c1f14936c05d43a55836d9e0d530ac27a582ce5fd099cbd"},"icon/10001075.png":{bytes:29167,sha256:"d104103a60927435254c590c3d13294426f05ea81193ba5581ac1c56dbad690d"},"icon/10001076.png":{bytes:21611,sha256:"d42eff9554cf6b8010729decfe48c67f82fbe044d7174ffcf6f66ce1e0aaa776"},"icon/10001077.png":{bytes:17232,sha256:"417922105baee5e55df1ca41dec0f6ea50e5597e25e972bda5e85921ba89defa"},"icon/10001078.png":{bytes:22903,sha256:"f595cae988c1aa72bb46aaed66fbd4eb2a80b0d428e6f69279e6cc5eb8f33d43"},"icon/10001079.png":{bytes:12314,sha256:"d786c8e75869e85cd1282fedbdd7184599d467323ec627ba84fc8ac4d5b32802"},"icon/10001080.png":{bytes:21705,sha256:"40070edd6457107645f67436623734dc991b9ca443ab90f69f70dbaaea7a39ad"},"icon/10001081.png":{bytes:20562,sha256:"d56e7c2c982f3b27cd11f81799f37e59bed9c0ee33c38cb388a761faa3ff4aa7"},"icon/10001082.png":{bytes:16044,sha256:"d1a2f46512f076d4c94d595d09bd79a621823a9beb605d7550ec7c0a18063fee"},"icon/10001083.png":{bytes:20479,sha256:"fdccdda6ccfed67eac85cfa376d6f8a40ee1219ddd3cad6900b277b609e192eb"},"icon/10001084.png":{bytes:10321,sha256:"8ed3211996fe8174c1eea74b1b5187b507fda63b2d4f9c92d1a198d2560b00b3"},"icon/10001085.png":{bytes:14763,sha256:"2f965520fc95c4616a4af85f5340788038a5b4530ee2e687153ce58559c03220"},"icon/10001086.png":{bytes:18341,sha256:"060c578e663efedf5cb8516fedc4f05837fcf63a55b977d19658324708910776"},"icon/10001087.png":{bytes:4213,sha256:"769837b1d6caa5bbd3e3aa99ea416c57538b18c7c24d918e284d9c1251bbc460"},"icon/10001088.png":{bytes:4172,sha256:"5d4ea01aaec16fe631fc2383d258bba90158083c6bfcd8c1183dc22bad62fc0e"},"icon/10001089.png":{bytes:3474,sha256:"90625242ffa6ef70ba55f48bc7ecdb056c359db8381831ff22f9885d3c3f22f3"},"icon/10001090.png":{bytes:7435,sha256:"513808a1c0e913a192a113b8503698612af55c7ba9f3f341d24f50995aa7e902"},"icon/10001091.png":{bytes:22367,sha256:"7daa0d126bd8a7389720014dcb8448da8bc21eb0b381a99062bfa81d0b4d090c"},"icon/10001092.png":{bytes:12227,sha256:"9d63290e2cfa3acf8d58df425be36a101579b867c66c306986d762d7d4f422fd"},"icon/10001093.png":{bytes:26518,sha256:"bc385ef5b565fd3a9e6f923d6172155fd25472be7705b2b62569b07b8dc08cf6"},"icon/10001094.png":{bytes:25052,sha256:"e4ae56756a19592c96fe52a7a4b538c943377c2a20d921d8fecaea6a8f0c7dea"},"icon/10001095.png":{bytes:23206,sha256:"c4f38e680893ecda45e5c7e3589a2b852a15f4345abe4ec23629e1836d4db70e"},"icon/10001096.png":{bytes:22122,sha256:"f686a5ea91407ebdc08f4291b5169bd552ed5c8d8333be59db9366770cf7ff2b"},"icon/10001097.png":{bytes:12560,sha256:"f73d09781a3c85f822b0c88fa72b740cd50a15c2b8f592fa87979353ab4469dd"},"icon/10001098.png":{bytes:15059,sha256:"7e8050b1404cc16aa86a71b41dbc9d21925a9b78ad9e5254cc4e9624deb31f6c"},"icon/10001099.png":{bytes:15584,sha256:"ac80e1a8be3932dd9961cf91cbb2b177c47600b2bebe29e415bbb6fea798164c"},"icon/10001100.png":{bytes:16326,sha256:"c09dc9a07b44cf2c71c61756237422b4a0c2d2067321cd43695ce6585cffcf56"},"icon/10001101.png":{bytes:10612,sha256:"7aedce9017c7ee89d59e134d9ddd054dd907a26db6c45e7fc20b7506c51b687a"},"icon/10001102.png":{bytes:23039,sha256:"493c35fb2876f09ab03cfe98eb72b4897c8ae425650572c20fb92e71434c98ca"},"icon/10001103.png":{bytes:19364,sha256:"530857b7b8e777d3f96fda60ccb9f23007ecac339c4f752ef3c85a297b3a7966"},"icon/10001104.png":{bytes:28069,sha256:"e9eb24af2a0ba2805b54c614f10221fcb7c1d73217b5d0dc6b7e00fea2e26c33"},"icon/10001105.png":{bytes:26082,sha256:"24952154a32e5955b8503c92d6ebbd85991930130c4308e2cafe9f7c5f577230"},"icon/10001106.png":{bytes:1651,sha256:"617f1f8e08229f2678330ba3c3b6167ba865b07f93691127e870b8d6adf6641b"},"icon/10001107.png":{bytes:22485,sha256:"938d08c4bf33909d7f0895c84a91713cfd1e6f937f33ff2da5eaf2b52eb5b06d"},"icon/10001108.png":{bytes:24430,sha256:"a601101f8b16bdd131b47c8f66433bcb973d1b695d992b09e634a728dff54535"},"icon/10001109.png":{bytes:15975,sha256:"210c74315ec41a5d3c19c29a76bdd3413765f8f17ded734dc0691e76d85b2191"},"icon/10001110.png":{bytes:2344,sha256:"e655f46b6fccd2edafc4eb323d8678eb28f3c3ff117e3ac9f69c60c1827ace46"},"icon/10001111.png":{bytes:3021,sha256:"85f3c7595d26004037c41ec5303b62384a0e78b1ae06bdb99386e027de99ff54"},"icon/10001112.png":{bytes:3407,sha256:"89107889930ee230b538fbbaf11e6d0d041ab412ddf5b9d834a35c30289184e6"},"icon/10001113.png":{bytes:20006,sha256:"043f3dc850dd766a97ca36a4a6b6a4f69f6bd1a39b503a94ae7f44d24a3f9f94"},"icon/10001114.png":{bytes:13510,sha256:"00746c36384a8db4907dd246d6eefa673f5d1779ebd7411e9ce240b605129211"},"icon/10001115.png":{bytes:25840,sha256:"81c3874b31b33ff76ff5696828fc7e041acbc4e5802a159e6d7cf39623b6e4d9"},"icon/10001116.png":{bytes:26845,sha256:"e08add35bb5d9dab63eb2113db0a3f02837033f89ef5bf03d6fb6bde4b143a7e"},"icon/10001117.png":{bytes:5260,sha256:"7d5929d69cf88c4fd3aad5d0924e5501c8d6466ae8deea9dd98587bcc683ace5"},"icon/10001118.png":{bytes:2319,sha256:"4a2e00b11368da3400d0fde87af9ae0004a491f9e5166cbe9ba3e412d8c42977"},"icon/10001119.png":{bytes:9639,sha256:"69c0e0c0244fe4f9a863a749dd0697021334cf6f8a940aae48047447d07abfb5"},"icon/10001120.png":{bytes:3934,sha256:"92b3b1c0bb994c6eda4527f6b6dd2af58c3fa895d04867856d0ff59ccfd19048"},"icon/10001121.png":{bytes:20543,sha256:"2ab3a15500ca6a11e4ca65bc371d95c0af1e0563cc2c0dc4f20c8c01ab092e38"},"icon/10001122.png":{bytes:12810,sha256:"b5836c452bfa9d9a1db7a362538da5568db5824118c696eb3a2c158ae70f0cf6"},"icon/10001124.png":{bytes:35989,sha256:"619ff5c41712328cb34e98705aa8df74574a1821770a4586b22909577a4bc58e"},"icon/10001125.png":{bytes:29137,sha256:"99a9ab0501de6dba85c2abc0e1e36adf7a86f10fb37875e2680f2f6d9ca3e83f"},"icon/10001126.png":{bytes:22453,sha256:"f43f07f4c18e71b27570d8523eb3a8e029420c31ffadcb3e3aa1bbaa80a9fe4d"},"icon/10001127.png":{bytes:19714,sha256:"07781839310d272bc7aa3dad17d09224462964e4a677466697030781c8fa71ce"},"icon/10001128.png":{bytes:13908,sha256:"e1181919aa1dcf4fce455f94c43548cdc4db1eccbd1056cd9cc2dd3eb8f61d64"},"icon/10001129.png":{bytes:17401,sha256:"350f315d554986c5a522f79ce80a4f33b658317e2dfd28e765f31f1f55d9fd8b"},"icon/10001130.png":{bytes:12296,sha256:"9a43c99b2df57772c96547b0de18a8d0760d6c324c2b9d3cc3db33467dd08503"},"icon/10001131.png":{bytes:5038,sha256:"75d352f831fb2cb7f33db7514a5e8c96e1dbaedcf370955cad7783baa0845efe"},"icon/10001132.png":{bytes:7256,sha256:"b0dba588447f82e38c20eb54684a9d1f84ea83fb011287908f81cac2d9c29756"},"icon/10001133.png":{bytes:6606,sha256:"96100d356bd18b99201bde0a3196a851804f391a99e915a189d1ece883c4e349"},"icon/10001134.png":{bytes:7075,sha256:"93352721db5da92231f0b53f01f72aacc33670a820e2fa6331f402c79ab3dff3"},"icon/10001135.png":{bytes:7300,sha256:"e978e0bfac39714827cd7dd770b54fda77e5e7bc82392ce8092e9ba616ceac3c"},"icon/10001136.png":{bytes:4617,sha256:"403a83d32973ff5007759b8910d8d38f29c42d0caaee60876a29951a263008c1"},"icon/10001137.png":{bytes:6923,sha256:"e64530fb2cc4cb2e95be5481ce47d78a99d095cb4739f6c58f0269bb6c06df60"},"icon/10001138.png":{bytes:3412,sha256:"0d8839c0f16110389f079dd0cdaf32130b0d4363994cd62e51f64775a89736c6"},"icon/10001139.png":{bytes:3432,sha256:"ed8360d109e366c6a330c2806137f37d458194adcb5d7a5d61da0c168061f316"},"icon/10001140.png":{bytes:2813,sha256:"b3d6c1d80544a5327c21f9e63e452ed129e729e4ba18653013386bfe9a26d6ea"},"icon/10001141.png":{bytes:1976,sha256:"7874744cf4f00e0a676a4d76eb469e72ecd5fed016ae4b25a164f78994dedc19"},"icon/10001142.png":{bytes:15037,sha256:"14d12854b4b17da8ba54f0808be9acca2cdea82f004b047343b288fc5c442d65"},"icon/10001143.png":{bytes:5652,sha256:"5f02f7cf842d9aef4b81b784e3dce9ed4e820745c97efde3b7af2fa94cc6f2c6"},"icon/10001144.png":{bytes:3080,sha256:"ed7b8552f4dff8310e269986336dba5cbe76ccb6e065156b825bf8e0b5c8fdfc"},"icon/10001145.png":{bytes:2987,sha256:"ffa4d3452e8d0c751aec973fffe797c2e872175cd5912d0393c72b3da8cad13c"},"icon/10001146.png":{bytes:5483,sha256:"4ed80b9c3fa0d88c6cef1289f18048b9b373742348e991e23b3ac042bd71ad26"},"icon/10001147.png":{bytes:1152,sha256:"05750a2593db8d6cb0e64755e447fa2236cc5edfdd633a8ab9be8d8b5fcd7d89"},"icon/10001148.png":{bytes:2662,sha256:"421eafe1622cd73809a8b09b7a74074628a8acc9df8c4411f7ee51fb96a6cc2d"},"icon/10001149.png":{bytes:5963,sha256:"a16c6f9abbd6d866df576878a10477bb1f9c055d4ad19a050e3305b394f80058"},"icon/10001150.png":{bytes:7106,sha256:"66161334208241a31f9f5bca369733c81c6070de9b1d9f4c922c6c5a15dcc684"},"icon/10001151.png":{bytes:10932,sha256:"260a9dc36d191df0700e243e8461362605ddd759a0bd7fb382a9175ead3d9c91"},"icon/10001152.png":{bytes:5867,sha256:"e1980362d5eed82c2806a9ea5fc1b0ccdac33629f7aee398f74c5f54389ed683"},"icon/10001153.png":{bytes:9870,sha256:"e1e279e3065898eca9503c8652b74a71b4151284a733ee9293026be4d249c05d"},"icon/10001154.png":{bytes:9156,sha256:"6c6bd25805bb81659537de7814550b6b4daaddaf894645eb630ff9520a246d04"},"icon/10001155.png":{bytes:5172,sha256:"057bb0e931efc9b955b43943dcbbe5df73cc34ffd1755df8986e0f8f691b4794"},"icon/10001156.png":{bytes:4527,sha256:"5b93b62d5f786efce3b63ad62da61c67f15a65441a47fcb2df3cf92807170758"},"icon/10001157.png":{bytes:1326,sha256:"054bbfcfbb69453dfeec70ac86a3fef70f4ea818110a9a8285bd294d65972d60"},"icon/10001158.png":{bytes:4270,sha256:"dc54dad40d681aaf0f6aac8b3dd4b419e05a079d5d05bd4561a7348b9edf7927"},"icon/10001159.png":{bytes:3192,sha256:"b3962f15d41f625b1435c7d7182f2b744fa9de0ff299503dd3683171de794d2a"},"icon/10001160.png":{bytes:5158,sha256:"9e52b24f602584cc198214039c10c2bd33609b3c448ddfd2acbd565beb8bfbac"},"icon/10002001.png":{bytes:20145,sha256:"f4d95a54594309ab6deed445289097af22295f51ff5b7139acad7bb06045bcb3"},"icon/10002002.png":{bytes:21810,sha256:"af166959cddb542b83349dcc045096dae6185cd52d48a013dad78fe7ba1053ce"},"icon/10002003.png":{bytes:21958,sha256:"8bd0e7b9603ab0136ce86d8f7ace42ae23640013f07464730efd774655bd1628"},"icon/10002004.png":{bytes:23769,sha256:"4c1e6d5b3eef62b104f392bcd6cbf3ae7d2abaee06b161a1a65c6e916734945f"},"icon/10002005.png":{bytes:23898,sha256:"b30336b8be741b5a6315bf6ffffde315446e1639d9438e649f282153eec3f13b"},"icon/10002006.png":{bytes:36362,sha256:"81973c5d0fc8a86e8cec23d9d3eeb68f23ea95c302e8fefccaec90a320891427"},"icon/10002007.png":{bytes:23004,sha256:"1b42dcbd00fb4f45d6818b05e8b56c2880b0b2fbe061d17562f0c2125e6dbef6"},"icon/10002008.png":{bytes:25821,sha256:"7a6a91b0b32ef193de8601d3779c8a96b30c8994f746ecdb14920f364f434401"},"icon/10002009.png":{bytes:29951,sha256:"d736d5118775d03725093e1dd6bc51236c7fa39ed00184487db2267bae5f9f4f"},"icon/10002010.png":{bytes:26085,sha256:"6b92c88569ffcdd8b2cd4836f281b36ef5085c468fbb14923d085317e3d25c81"},"icon/10002011.png":{bytes:25715,sha256:"827cbcdb97487fefbfb801847e4acbcf298d0c10037173d612b006f615ef5ef0"},"icon/10002012.png":{bytes:26384,sha256:"e7ae9e007cddcc3c1f3a0d8206052b107ed5726276105583f4bb9015a14c5fa3"},"icon/10002013.png":{bytes:27500,sha256:"5ff084b46a5b00e83aefdba355c33bd972cad0537c08fee7bc6ffb42bc0ebdc6"},"icon/10002014.png":{bytes:20236,sha256:"c98b3528d9506c343a680e3699c3481dc0e17a7c14966b447a963c8bc0639c81"},"icon/10002015.png":{bytes:30913,sha256:"1efb63f37ed6ebcb4e28488901b4866d37204840be668a677e53fd8735b55c53"},"icon/10002016.png":{bytes:26866,sha256:"a91a05fa0e2f633e32011fc416ecc7b79096bdc531480200bc64b71ff8c05b5a"},"icon/10002017.png":{bytes:27987,sha256:"e9adecf78cac8b30edfec13604726b9e04a3bc5cc9ab2459ca09957a4300130b"},"icon/10002018.png":{bytes:25698,sha256:"2c9ce8412106fef0b68132d1bb13358b0c2953ab968f248559f1b4bfb043cc80"},"icon/10002019.png":{bytes:20846,sha256:"891a3906fc6324235cdbf4c83c7e0d58c6a7a71c423b2bb0a38e04d0de717d4b"},"icon/10002020.png":{bytes:19304,sha256:"b06d5f3d0a91dd2b49174f680d829d73260a6d4cbec4fff48a6131d4a4e89695"},"icon/10002021.png":{bytes:21812,sha256:"01dad29e897e1660646fdaa826b72fadbe822ceb13bbad6cb57fd1f9519e3139"},"icon/10002022.png":{bytes:19095,sha256:"eb571c371e8c9f6447d1567652425c43d2e6cfa9ed5f3dbd6b29fd3ff26f741e"},"icon/10002023.png":{bytes:20241,sha256:"5769cad4d0fa0effb7498b15f97ee1f45e6655275df15164e04f79ef314324e3"},"icon/10002024.png":{bytes:14546,sha256:"b823c0e0b8e4b852519254794cf219b42e02021d667528c6387a545fc2a066ac"},"icon/10002025.png":{bytes:28393,sha256:"5374e4d458ac4d8ae45419c0040c1981f12395afb984b631c48b640b8be2aebb"},"icon/10002026.png":{bytes:5243,sha256:"f97e20c0f2ea8e3c2d3b3dfaa9d3b9449e3ed559364cc2e7ab1516d0cb88bd78"},"icon/10002027.png":{bytes:4486,sha256:"cdd1376115bf45ba21b47c6e574a5b28f7c83cb36159bb1f7c60d737f9ec8ecc"},"icon/10002028.png":{bytes:3253,sha256:"41e38057943bc5dfbb24d8279c9ce23b58c871615deb28d934b0bb954bb66df2"},"icon/10002029.png":{bytes:24855,sha256:"60c949a324f60ac215dd01ea0dd4471ccff9b912717fd3b03443dea31dd87940"},"icon/10002030.png":{bytes:4435,sha256:"0a3e76f32808add9274d8e65d279b33521b655036d24cf87de3f5fa11de6dfc9"},"icon/10002031.png":{bytes:27998,sha256:"8fa5a2187292213adab843c9fbc68e8f099371a3ed74c55195998f92810e8b4f"},"icon/10002032.png":{bytes:21697,sha256:"9ece6166203932aad1a59d851258dc92e17f67f11de52b642c3abedeef571a3a"},"icon/10002033.png":{bytes:35521,sha256:"99c220eec1407ade7a0a5ff8c22a8dc6e4149ac6d0f407c005f78f8338f9bab5"},"icon/10002034.png":{bytes:6754,sha256:"b5097a0501688fe67edf17c7a993ce12323a2b86b55226db7cad7d9c2ffa016b"},"icon/10002035.png":{bytes:9625,sha256:"172106dc0c33f12daad2eee2ab1278f94c1026d0d6db70320851f2908eb9eb46"},"icon/10002036.png":{bytes:2474,sha256:"43ca13e6572a60aacfba330ac86bf5211a6901914fbd1559fffbb89ca15ccd41"},"icon/10002037.png":{bytes:23717,sha256:"d232b256c550eb85f96d5eb28f19a661f2127f383f49bf4ba4348f935f32dbe9"},"video/10001001.webm":{bytes:147646,sha256:"a72065f7abcc9387fb3dccd473d509bec7b421aa6c34c89e344dd8ee294bc2d2",duration:10},"video/10001002.webm":{bytes:171594,sha256:"b6e89b1967387bf40278b73414d90f0a3b8c61b0e4bfa63e74f67fa049ad3482",duration:10},"video/10001003.webm":{bytes:151975,sha256:"c5fa8ecbc3e6992256ee128dc400d2c93bf91fe5f7813a4d289c4b6d477fda54",duration:10},"video/10001004.webm":{bytes:164765,sha256:"d85282288b6a845d35f7ec6bfe49fc0f5d4766fe61ae30b87a9df6ff2a4961fc",duration:10},"video/10001005.webm":{bytes:189607,sha256:"0f186507b14407573ebb42da49a5749809e28819854cd46b4bf82b858ff057fd",duration:10},"video/10001006.webm":{bytes:136733,sha256:"cd11113d02047c42e3c03be3f2835f34eb52d0fe595b8e380a69fa86d9a40957",duration:10},"video/10001007.webm":{bytes:174723,sha256:"c9e65dbd73985b4ee5e716b63f5a9bf5719be8b95ea9a3a61a3aae772adaa064",duration:10},"video/10001008.webm":{bytes:13947,sha256:"d494a403015acc7700b45021ce269771edc8766e62f2bd82a7d26c9f60c63bb5",duration:1.3},"video/10001009.webm":{bytes:15895,sha256:"04d442aa0a51199be173b17a069b8365ae3205b26db275fb73355356fa1f871a",duration:1.3},"video/10001010.webm":{bytes:83391,sha256:"9bb064beb2f4622cc761ba26e5793da93c576d9c26be517912bd0d25f82763a2",duration:10},"video/10001011.webm":{bytes:107849,sha256:"d884e886fd74baba25a896921907e37675329915a90081fbcdd30e84fe4df099",duration:10},"video/10001012.webm":{bytes:84881,sha256:"c3ed5ae0813a45908906170ed6513b64c20a51f72aa0783ee55112ddb8701f80",duration:10},"video/10001013.webm":{bytes:96819,sha256:"560da96c18685b4fe4acc7b32ab940f229bc7ed1c57b0dd4511be7c22e5b6162",duration:10},"video/10001014.webm":{bytes:140840,sha256:"6ae425c9aa6d7ce1a476f18caa12ef0b124fa8b98e446696a3bba29ef6ae9a32",duration:10},"video/10001015.webm":{bytes:106513,sha256:"78e68a0cd736cf5c7a433f79f603126d0036bec8a751c937c7b96106180865c9",duration:10},"video/10001016.webm":{bytes:126160,sha256:"206ff8c1ba2836b2e58a907458b3c5a9ded69556eb4e29685725f49a90a2b481",duration:10},"video/10001017.webm":{bytes:217547,sha256:"0b1402a3ab2b0b3fa2284c33dec5b818049399a3a7cf1c2bf6b891c604905577",duration:10},"video/10001018.webm":{bytes:78212,sha256:"b5681b42272c66d918e143a63b6b4f9c044cd6b3ef1a8d2050a26f583b6b7a2c",duration:10},"video/10001019.webm":{bytes:175270,sha256:"6f493f9db0be094ab927becf8be553d416eab7ccdbac76896cd02a33ea094af3",duration:10},"video/10001020.webm":{bytes:227796,sha256:"57eb38683cf84e8abbd6319da39e08e4233baee90bac54568034fca55f7a253b",duration:10},"video/10001021.webm":{bytes:216527,sha256:"e19c751b9c36ce5d68c18a161ada9216e23f7cf8598638de9c8b4c2911d6e390",duration:10},"video/10001022.webm":{bytes:188626,sha256:"6ca2e91020c1141ee626b5dca2c7c190978562a70af2a6982f387c1e9cd9e53d",duration:10},"video/10001023.webm":{bytes:199004,sha256:"0b42968e4ac8f1152244e3821ef33d15954bfd3efba5709568b778b7ef375d23",duration:10},"video/10001024.webm":{bytes:60772,sha256:"a1a4269849425bc985f07f4e2c9e7bfd2fa5094238926b9d4096b8155bee39ce",duration:10},"video/10001025.webm":{bytes:61785,sha256:"0d7e10b6b97b5cbb5098046277b0315b0db4b5542ad8da82758adb800eb970f0",duration:10},"video/10001026.webm":{bytes:59199,sha256:"d2404c66eb3f357ae6349541a53fa713c4d81793c9b5f273cb6d5b949ded6330",duration:10},"video/10001027.webm":{bytes:37421,sha256:"c97fd7cda4cf46636757fd2913f5cdbfc44db0c183d7190499c3f54c1b007bc5",duration:10},"video/10001028.webm":{bytes:57620,sha256:"0deb4f0b933adce6785a46c2319e63721774f185532875fb4434f78eb905863d",duration:10},"video/10001029.webm":{bytes:66083,sha256:"ae3ef6d5ed1c676ce11136f98404159bbd3e847b7967c7cd76e53060df090ddd",duration:10},"video/10001030.webm":{bytes:58745,sha256:"0c7965cbed1119b1ff13e1b3381129a28468a6464279751590063f11efd8028a",duration:10},"video/10001031.webm":{bytes:8557,sha256:"5847d08b09f9f39575fba5fabada6133757231545bf08656ae145136c8d21bd9",duration:1},"video/10001032.webm":{bytes:25221,sha256:"0a401d8d73d2a838d01daecdf047b04ae98cf76cac899ae7a21fda8b9cefc2da",duration:.933},"video/10001033.webm":{bytes:34602,sha256:"896f71d3387bcf4154cec5fe67593c1982374af65cfebd5b989108adc2e07ddd",duration:1.2},"video/10001034.webm":{bytes:125134,sha256:"3804a3b13d8974702162d97a703c63a7aa5bb2690e892a6215d3a61af788fa8a",duration:1.4},"video/10001035.webm":{bytes:67308,sha256:"22651c969c1e7ad47a6aa062a7791fed498069d407dce6471afb760b83eee66c",duration:10},"video/10001036.webm":{bytes:127270,sha256:"f0dabcf3554f6aeb9a3070796760df4f5a7047e435ba94e8c3948bdae24dcc45",duration:1.4},"video/10001037.webm":{bytes:168190,sha256:"3b0423327eac86c2376f2d0e1ad08142c335e80b3bf2a35b58410e43038a39e4",duration:10},"video/10001038.webm":{bytes:131917,sha256:"3153ff561dbb204cff54001334794aff6551dc29e55dbeb0fad35bdef372033a",duration:10},"video/10001039.webm":{bytes:11634,sha256:"2bbbdddc40b1790c6ff3f4a7be9c6ad0f8a5ef521d45e4c7ca9f0a84a70dcca3",duration:.766},"video/10001040.webm":{bytes:29034,sha256:"9187e82dace372eda0441947980d8a981238b519fe8b91b3cd8983a25bc38124",duration:1.2},"video/10001041.webm":{bytes:145234,sha256:"86c73a18f5f07c18427a4f6540e94ae0488a22ba061f931c5071f4524aeb8e33",duration:10},"video/10001042.webm":{bytes:173888,sha256:"f4011ff7a3474cf2ff9cc02eee560e46d3e1ad165848dafb989907199951ac01",duration:10},"video/10001043.webm":{bytes:42182,sha256:"9bd4b77d6cb8be53aa0cb3954a124c523f076cd4b3f3ef646d1a41a272c9a058",duration:1.233},"video/10001044.webm":{bytes:32089,sha256:"789fc8b1316530b118bedf21682606096aa1f4191c1946dcd1d3262713567a84",duration:1.566},"video/10001045.webm":{bytes:9892,sha256:"d9261d0738da8852b6473a93bff97ec9f5d7e8fe130d314b44f4d870f9e2ef85",duration:.733},"video/10001046.webm":{bytes:7771,sha256:"bc5fcfa1b15638d4f4b44cea1f27e02e5c7281e5d422dd70e8945e52524f236b",duration:.8},"video/10001047.webm":{bytes:11433,sha256:"8dfb6ace018b13706517ee2511753af3606a9d646ef98f7808a1bbdf0220e23f",duration:.733},"video/10001048.webm":{bytes:9648,sha256:"d92bced2753f1ab8cd2edbab06905ac82e4b1423235bd32e9259058070d19470",duration:.733},"video/10001049.webm":{bytes:24623,sha256:"54769931e5ce88f652c63c4b190aa017a7e70e5860b046df7a2813f00cb42b59",duration:1},"video/10001050.webm":{bytes:20713,sha256:"919a6070b7e1f042e5a74f091ba8c23924f467cc1ddfdc5816feb3d638cc3acb",duration:.733},"video/10001051.webm":{bytes:317681,sha256:"a1dda360215590f4b5fb7b8a82cbe44d240211270485eae950b5535b01686d08",duration:10},"video/10001052.webm":{bytes:15091,sha256:"ff7685c63cf73e1422f07b59bf5e006b6dad8d2d80b1a8ae0997d13ef58487df",duration:.9},"video/10001053.webm":{bytes:183319,sha256:"c8c07a2deb6b4899a6d1c1b8dda72fac6ed45a11d6646c40f5c2e354a84a8d13",duration:10},"video/10001054.webm":{bytes:17094,sha256:"ca07c647725212c323dad57886c5b56a5eda2ae27909bf5ddf0f3589e99b5b5b",duration:1},"video/10001055.webm":{bytes:53469,sha256:"a8c69dd8c3c9e4836f1c3c9a4c033bc7bfacc0fab9ac2981c48e4391589c41de",duration:1},"video/10001056.webm":{bytes:225400,sha256:"60fbad9fef225e7205c0eba98951387354a8470e9a50db3921494db3dba6ba0f",duration:10},"video/10001057.webm":{bytes:7082,sha256:"0aeb94988ec8862c3bec3f357f380b675da3b0881c48640b37fa3d1215353b9b",duration:.966},"video/10001058.webm":{bytes:90245,sha256:"4bbbc44479a590344eb38e965facc757347d87c63816e0ccf8939d98d8278ecb",duration:1.6},"video/10001059.webm":{bytes:87447,sha256:"fb1b2bf01c971fcf2a69833b2728d8553f058877386c6e17947e2bc28e50f904",duration:1.766},"video/10001060.webm":{bytes:1276390,sha256:"19f135d0143a973a7ea358a64f83aacb227ddd483f200c6fc88738b3a2e1c9b5",duration:10},"video/10001061.webm":{bytes:70336,sha256:"10d1a43ee81a6fb691448a1a3165612edd96943e7188612069a13f57788c3513",duration:1},"video/10001062.webm":{bytes:102563,sha256:"79a12a7baa9ab219c27845166f613f87829073e0214ff26ac1b3239a2f8a8222",duration:1},"video/10001063.webm":{bytes:565456,sha256:"6784dd43aa64a9005df034defe99ca23eedf9a124f0a0681bb9ea531152d5656",duration:10},"video/10001064.webm":{bytes:48740,sha256:"3585e3b7579301babf2a941529d05261f7a4e7993d394be668ce3e6b34269be2",duration:.866},"video/10001065.webm":{bytes:16738,sha256:"96de617b4263a73bdb61e98d4643e8ad6488bc0cc359ee4f8da5eb6b0333c466",duration:.9},"video/10001066.webm":{bytes:12376,sha256:"ca507ca6ab20dae1d3e9ff3cf8fb0fb70763983f4b3c82fe8f05b5b011160189",duration:1.066},"video/10001067.webm":{bytes:23685,sha256:"8702ce3719d477e8a79a5321b152a804a583578aa6335aae221e238e449c4508",duration:10},"video/10001068.webm":{bytes:55734,sha256:"708b564295d3c3e1929d4f5da5af6595e9ef236e692380a838e4230ff3813381",duration:1},"video/10001069.webm":{bytes:1128088,sha256:"56b38a26aaa7913066c3336ba98f7eb1037c17fe80fb110d45e123cc46c36acc",duration:10},"video/10001070.webm":{bytes:975681,sha256:"4c762f4cc796d0a167e47ba18c6c658b9173cc8fd951b9c7537043ac1d3cab4c",duration:10},"video/10001071.webm":{bytes:815992,sha256:"e2547ebac9f4d2dba4cc455fc73cf1de2afa209f4a54473a252f3578b5882361",duration:10},"video/10001072.webm":{bytes:616757,sha256:"551e36eea20409279ac7b058f0658460e88b60c7b62189209ab219ab5ab35969",duration:10},"video/10001073.webm":{bytes:37684,sha256:"913e5eb86f0de97099bc8f1c2860dcc0ccb23af3df7b9565e46d23dcd3d5b2e4",duration:2.1},"video/10001074.webm":{bytes:12604,sha256:"7a034a81cb6b8d09507a83c42b44fa6ce5dac567aaa4dad86900772e81573fac",duration:1.666},"video/10001075.webm":{bytes:107268,sha256:"a58331fcb3c6ca07f581b3ca490eedcd4e4d486ddcf944083038198495dc8c6b",duration:10},"video/10001076.webm":{bytes:32481,sha256:"6c49036a5c3d63f3f8a554e751fde071afa7a88c69c0eb5fa8aac3ead9936c85",duration:1.2},"video/10001077.webm":{bytes:34358,sha256:"8b1cd91b4547b5c773688dc7586d02ef3505b56a6c0e5e8cfe95ac2877074fd9",duration:1.1},"video/10001078.webm":{bytes:46506,sha256:"d2b1506af78535ae8c25d12ed47f613f58c96c237aabd3a69481926279abbad2",duration:1.133},"video/10001079.webm":{bytes:73888,sha256:"14eaab31df0169c82d784132e336f21e3dbcde36e8d863e813fdbbd0cc7fe736",duration:1.166},"video/10001080.webm":{bytes:227149,sha256:"f953d8cb2c360f1a7beff3f1eb0287d2ad5b4b5021cd8add406935e7bce0f499",duration:10},"video/10001081.webm":{bytes:206185,sha256:"bd954a94b76ecb754018c8d2f5600757907fcbf5b8d8fd8c16eba98d2c77bd45",duration:10},"video/10001082.webm":{bytes:414215,sha256:"a66f150faa15b300f9d87422b83566b253c50579b8b08a83e7d5fecdeb33117a",duration:10},"video/10001083.webm":{bytes:103790,sha256:"f7619598f5fd506003b6161a7d7a9f7d13eaf3ae26a51cf560899ee50ab74850",duration:1.2},"video/10001084.webm":{bytes:49760,sha256:"075a51589f5556f125c56e3448e2b8c7fcfeec7f7981228e46991fcadb58b603",duration:.7},"video/10001085.webm":{bytes:39486,sha256:"7782a3f27d41c5b833746b6892a2074821226da33b0dfefe1173c5a45890abbc",duration:.566},"video/10001086.webm":{bytes:24420,sha256:"1e7c975fd2c3027095353ae2b7651e3b9f0104554a072579127817aa5ccdea02",duration:.866},"video/10001087.webm":{bytes:58874,sha256:"5101e1da0097fc9785131be66f411e54f427ef18f21ade4b254728e94ac568b7",duration:1.166},"video/10001088.webm":{bytes:64189,sha256:"a3c150eeaca295e70a351b250bd3554b4633a77f6704e581b72a8bd93f0ea194",duration:1.166},"video/10001089.webm":{bytes:25443,sha256:"0e5a1151fea93701ebc923211c8f5c406e895104a4afb9ba71d521ad45b39b85",duration:1.966},"video/10001090.webm":{bytes:65254,sha256:"89ad6f296294c0abf4fb08e68ebf141d1c602a659c0ec563f7058ac6d2462fd4",duration:1.166},"video/10001091.webm":{bytes:81681,sha256:"3081d901c969bc1f4a4b10a447c3a712a8b4136965c34a76119e1b6dcd5e6cd3",duration:1.6},"video/10001092.webm":{bytes:548135,sha256:"5c013b847ea4b8338927ebd2597c2bb12b9c9a7231853c3d277eba10f9dd453f",duration:10},"video/10001093.webm":{bytes:63342,sha256:"bc87982e78383167ff4c649b6603a78cff1d6cf3cb51349e73626fcb2a5a7b49",duration:1.033},"video/10001094.webm":{bytes:20050,sha256:"53e91848830acea081a4d56ab8db383627a78ebb806ecb6766a2e11ed9573c58",duration:.833},"video/10001095.webm":{bytes:84670,sha256:"172553d18635861bfe28c6f06b5c8cea5e7640287cb75242fec31c12319772d4",duration:1.8},"video/10001096.webm":{bytes:28716,sha256:"31d3f4236eb9e2f2f6cc76003284b02496bc581ab1c8e19cd5929b5828c894ef",duration:1.6},"video/10001097.webm":{bytes:25147,sha256:"2129484b7dfcc5abe518553a0841a92a6582062356acda687b942b2cb221d26f",duration:1.6},"video/10001098.webm":{bytes:76333,sha256:"ac1d85c4f336abd854fd461db4e0951c83346dd2669c38b91e537ec758e9de65",duration:1.6},"video/10001099.webm":{bytes:76173,sha256:"2fba51975dae32febc9c1a270b1b5b769d299f143c4996198c7dfca26efd1014",duration:1.6},"video/10001100.webm":{bytes:80616,sha256:"ee23d3bf91e53bf9eb93d5a7c5879daa54aaa7e7194ba3944758131ebee68c5d",duration:1.6},"video/10001101.webm":{bytes:84160,sha256:"cb606310669a2a1d2f30b0903af51eae290a4276d2d934439999bfa10bdb5604",duration:1.6},"video/10001102.webm":{bytes:82257,sha256:"01cad0b39abfc2f041df3c1e786a11d3323cd25297fbebca2f196f8f556c8d82",duration:1.133},"video/10001103.webm":{bytes:91224,sha256:"106929efba101b9ae0f76b6b637cd4e16863bf9f72f779c2474d0d6cab4fc1fc",duration:1.166},"video/10001104.webm":{bytes:89745,sha256:"0862ade9ff0001d2cb5458e3cb6998a7ac42c2336840d73532f5492e522cbb34",duration:1.133},"video/10001105.webm":{bytes:93873,sha256:"0b03b634e18bb25087af672cee8e29df618540f3ac73761dae9a854a629dcfff",duration:1.133},"video/10001106.webm":{bytes:80898,sha256:"c25414e50001dd924e75c4b9aab2aa4fca72d1765bec268344e1541c9f9734ff",duration:10},"video/10001107.webm":{bytes:14411,sha256:"faa6ad2693c69433203864414e338b8d0f322096ff6b05b826787ec3a7bf7f57",duration:.8},"video/10001108.webm":{bytes:45841,sha256:"5e3c3dbbbd11985807452e9b02a69477d018b60dcf1598ed1deb21ec82bb4a50",duration:1.7},"video/10001109.webm":{bytes:53026,sha256:"2a0c537529b94d06bac852d498825b431a2830d944e8601e752b115b68d481ac",duration:1.666},"video/10001110.webm":{bytes:28873,sha256:"b1ec1a3d0d577270b1eb3fd1dcf2ddc36df9dcea52df0249b8440db3e0ec9b6f",duration:1.533},"video/10001111.webm":{bytes:15873,sha256:"74c62d1739cb80ecfbc66b755c7332a27a53b3ff3c6d72aa75d47804b211ad36",duration:.9},"video/10001112.webm":{bytes:17381,sha256:"e3c96e5b87f26c54347abcc591e241a78ae3ccccfc2eaa0bc447f1400410ed92",duration:.9},"video/10001113.webm":{bytes:28753,sha256:"1b16a8e140a6787675a0201e4ef4dea5633076d9494cdfb6f8c16c9b2507b8ea",duration:1.166},"video/10001114.webm":{bytes:111410,sha256:"13cd5f511962912110c6ac8d6ef7e39a823fcf48477762a18123080866b43138",duration:10},"video/10001115.webm":{bytes:43777,sha256:"0000583cb60ee7e8d562e13bbf5ddd7fc3fd8c9d93d2bcc7b96df9ab524f980e",duration:1.133},"video/10001116.webm":{bytes:87365,sha256:"d96dc3d3f552ca40e77ddd55b50da8c93a7bf34f53a6ecf01802751248f2189c",duration:10},"video/10001117.webm":{bytes:15087,sha256:"9e95f50d1385083834770fa0f09ffe79fa570e93def94b52a6a7a7e64f581a0b",duration:1.466},"video/10001118.webm":{bytes:74213,sha256:"4340b8ff11f8a3795d4d2fcd5c32d112ea4bb92153880f8b3eda34e15a82738d",duration:10},"video/10001119.webm":{bytes:26934,sha256:"244f12529343f2163be2b075dafc1907662ef53ab60c4ad081b8db9d81b4abc1",duration:10},"video/10001120.webm":{bytes:15909,sha256:"77c6308d62f016d2f6a0669f5c165efab2afff3d15611afb54965bc65e3ecca4",duration:1.566},"video/10001121.webm":{bytes:14072,sha256:"d5cc8215a5d4e8499f402cf5ad34e4ed958319a559c669aef9d5507be8f31d03",duration:1.333},"video/10001122.webm":{bytes:39768,sha256:"a0c0c537e22211affdafff6d4a42fee3b6fbe1d0fcdc17adbd5854b6395c9496",duration:2.6},"video/10001124.webm":{bytes:568780,sha256:"39b58e373aa854c91dfad8af90b3b84e9b04b7cde050388152622ac2c1f9c19b",duration:1.4},"video/10001125.webm":{bytes:179690,sha256:"42591454c30e14b1a65f5c7696516edf9e690002ca6fedf5a331e3fb39e13a83",duration:1.233},"video/10001126.webm":{bytes:243266,sha256:"faf35bae68aa35a358447c791c91808872921d4794f5c90e5763d692bd807a9f",duration:3.133},"video/10001127.webm":{bytes:208681,sha256:"42fecb16b110931f78c06d61d52374f5fa74fee60b1b37dcec4c608bf240adba",duration:3.066},"video/10001128.webm":{bytes:14331,sha256:"4a57b0082c4f32309eb212ebea0d1069efb87e4c3da4d65d556ca7d4cf397954",duration:1.966},"video/10001129.webm":{bytes:34019,sha256:"4bcab75c2f7ce6e2980b13fca3f8cb95bfb3bbb46396f52b0691a3b9499b2af9",duration:1.133},"video/10001130.webm":{bytes:10181,sha256:"f9e3bd1de752007281ab2d45fddc933b4709182a765e602879c3c9402dcebef2",duration:1.2},"video/10001131.webm":{bytes:168665,sha256:"275465192460a885a738b907be135e91be2546c9596cf0d0232ffea6d06065a5",duration:10},"video/10001132.webm":{bytes:97830,sha256:"4dbe1e8d33843f8360ad246082650ae7ebd0d66ce6b133e2f12f1d748719d13d",duration:10},"video/10001133.webm":{bytes:51508,sha256:"44b562df1ae76f3a1983447107aeeb00fb439afe3eb3e1d6a67a141467673aa1",duration:1.5},"video/10001134.webm":{bytes:36767,sha256:"adf67abc9bb2872b6aae897ecdaeb281384654e3066d03b07d6616a7393708a0",duration:2},"video/10001135.webm":{bytes:26042,sha256:"c2d6215296f9e200fc75c0d36f8523c4c5b24066a0e8eda2f01b6f5daa717bec",duration:2},"video/10001136.webm":{bytes:28762,sha256:"07d2d47eb8672b958f35fe6abe9ee2dae11db9a8846f1ac8d1e7206e466bf2db",duration:1.466},"video/10001137.webm":{bytes:151972,sha256:"f94c2f584f894e56def265d016e53ebf81473677633dfded66890fe6d3e2f175",duration:2.066},"video/10001138.webm":{bytes:68031,sha256:"43929724a51e2f99d9ebf5f7ffebc51ee90712b7520e213a9457bfcbb5f9a517",duration:2.033},"video/10001139.webm":{bytes:72750,sha256:"19d626334d981b16c00b4c5cc39ddab5bca75034f497f5345f18526e7fe25250",duration:2.033},"video/10001140.webm":{bytes:70456,sha256:"8cadee838df527fbe11b4e8fc5e3b7c784fad21f61c7c214ef7dffca72f0ef58",duration:2.033},"video/10001141.webm":{bytes:42664,sha256:"34f97de7d1dc183a5fb958305424f73ea6498254804c3ad669d44dc04bef939a",duration:2.033},"video/10001142.webm":{bytes:710423,sha256:"dd2aec022ab89b4e048b4e212216e5c0862b6c8be9899970d11b1d7a2267f9be",duration:3.8},"video/10001143.webm":{bytes:14487,sha256:"c393d0afa72faccf42aefb8cf946f08725dd76e28af2cb608049ae9416dc0887",duration:1.066},"video/10001144.webm":{bytes:13412,sha256:"47692e1e22510aef145080fcf1e42d6d4594cbc1ce3ca8dd89f247d7c59fd271",duration:2.233},"video/10001145.webm":{bytes:19632,sha256:"8fa9abcbc084f7952e2dd8b1ec325e676b78e2fd2be421aadbc83137463175f4",duration:2.266},"video/10001146.webm":{bytes:13723,sha256:"bda3925d9183b351f85c8152a9a2ca36ed994e6656fb210e08e2251df70c4ddd",duration:2.266},"video/10001147.webm":{bytes:23765,sha256:"566fafa5c585eb127bb81912324486a26c12db6bce8509763eb130ca1bf4be57",duration:10},"video/10001148.webm":{bytes:48537,sha256:"d7eb086bbe4e43d1733c4b7c4683248fc9686c0d2540b15b44030050415f18e7",duration:1.233},"video/10001149.webm":{bytes:56797,sha256:"a89363c03820728fe3041217caf3daa2c6b3b18c03a38478c9fbc38013df4874",duration:10},"video/10001150.webm":{bytes:71959,sha256:"33d5db768fc90f96ad2dd81fcaa2944ad721331fdba90ebbbc76abe9c9e622ad",duration:1.366},"video/10001151.webm":{bytes:70714,sha256:"f866a0e45980bbb029df58349d1401f259e79076e5a919584eebaea9b94d451b",duration:1.233},"video/10001152.webm":{bytes:1072305,sha256:"b9200f9b1dea6f7350dfaa0d1bc4eadcc4b4f0650fe190fe22ad25bc7e3a2b7e",duration:10},"video/10001153.webm":{bytes:37507,sha256:"add87a7074d611f312fe0c43a24ae18d774ff62a4cd24db69d2526fb7a2e1736",duration:1.2},"video/10001154.webm":{bytes:755336,sha256:"cae2ff5f2dc15d639a5ea411cab50a9bea03fad5f73116764945f6d012be74b6",duration:10},"video/10001155.webm":{bytes:28588,sha256:"ee157e4e1e8452bf7f1dbb32bb5509e9b8659edc5d1bb0bbba0b70af2e6c4328",duration:1.2},"video/10001156.webm":{bytes:21193,sha256:"2655315d0fa59d136b1a77e760a5b085aeaabfe70d1130ea17e937b037160afb",duration:1.2},"video/10001157.webm":{bytes:146426,sha256:"eb48647b768bf300429f157eb570b4c0d7c9d04bb3df53768e6875b91e51931d",duration:10},"video/10001158.webm":{bytes:231389,sha256:"8ea98583d1972f176e3354b6d7c116ac6b2689c1593b02ae4fea55774ca0bf8c",duration:10},"video/10001159.webm":{bytes:69087,sha256:"8b70a7eb8e83a9230bd3b7a658633c84037ed0667b0da87b78206f48ca2f487b",duration:10},"video/10001160.webm":{bytes:46691,sha256:"11698fa6b8a4f5ffd3f289e41266a7097f0e620bbb64359e97f1bcf7430731e4",duration:1},"video/10002001.webm":{bytes:543544,sha256:"6a3509a94437899e30846d0f701e0ae3ccfa82793f51d293ed507c8efaa67099",duration:10},"video/10002002.webm":{bytes:796059,sha256:"8cdab49708511f4d42d45fe0a319d2334e4e9aa42709e946c8d00a1ff77b07fd",duration:10},"video/10002003.webm":{bytes:715230,sha256:"6b5422c889243db499114370af5a260d624180fe17991445f7e3133eee619381",duration:10},"video/10002004.webm":{bytes:693595,sha256:"24aa66de5a0649c10652bb66b70a0407210e26e18a8d2d64b0610ca29fdfb02b",duration:10},"video/10002005.webm":{bytes:815174,sha256:"5ec0b1a66bf28c7bf0b2bc61a7bbbb374be18d4b1f338217ab3d84d88cd2838f",duration:10},"video/10002006.webm":{bytes:194930,sha256:"7ef8f4e4a5ea4430ea4910b06f0dc00c71d61ed9bd54e03b4a268a4d1f3e7525",duration:1.9},"video/10002007.webm":{bytes:93264,sha256:"cbdc07ca88626c73d074eae923aac8972ce8898fd331fecb40cbb22392d32e6a",duration:2.4},"video/10002008.webm":{bytes:669120,sha256:"9299206b7cdc7fc4f319864e425be91f90b4721bcd8555f56ead4dc45f776b27",duration:3.433},"video/10002009.webm":{bytes:434158,sha256:"3db3a361cf11e9ee543dff860ba8a7aef3831d920e1e95fb6773a13f15f7ff6a",duration:10},"video/10002010.webm":{bytes:161424,sha256:"3b6e41d32df6eca2645978e8ba0f13a4aef69aa8217d38e85e5b8db058016a9a",duration:2.5},"video/10002011.webm":{bytes:73568,sha256:"86966a56aef3a2a6a263526d1efa0092044b48ce26f7f076c5bdd259131a8121",duration:1.8},"video/10002012.webm":{bytes:187942,sha256:"2b3e1b9538ddaeb62adeae52b9ea0ab38801430c76bab0f6425da9e127e0d896",duration:2.933},"video/10002013.webm":{bytes:482076,sha256:"14b90e097eebe09d3337afb0867da590081f111b5593d601963dcccf39638a4e",duration:3.9},"video/10002014.webm":{bytes:1475640,sha256:"f81e417888b1a833e254cf069f33a5ff1820bfc1599ac0f86d67a3cea44cad78",duration:10},"video/10002015.webm":{bytes:2392745,sha256:"db572d1dd4f090a104cdeea17a84aaa94c5800820ec66168ccd2eb99cb05d867",duration:10},"video/10002016.webm":{bytes:178656,sha256:"aa5dfb8ef461f168b2b64790b90f5a0e847b2a02aa3964e35a1734b37f0b69dc",duration:2.5},"video/10002017.webm":{bytes:80715,sha256:"addc2369f55de0a067937f48f40f300d123c320efc9c03ff3be6ea922581b575",duration:.733},"video/10002018.webm":{bytes:790722,sha256:"1d8d5b69fe0a5949566c216eac072f739ee0be9d0ac7ad85a809db6fe4da14c5",duration:10},"video/10002019.webm":{bytes:115786,sha256:"1a4a39ff5bd9dd26bfda75176469acca6a2aace830961c3a5e5dc164bcc1ac64",duration:2.2},"video/10002020.webm":{bytes:581822,sha256:"2ce9a04ffb641ef53d0090a22dcb394f580475c41052c5dea83ceed1dffbcd69",duration:10},"video/10002021.webm":{bytes:568208,sha256:"b3aa5b1f712c379a80767d599059adcb482bb8cd2c0f07c404b6fd862c8d7e9b",duration:10},"video/10002022.webm":{bytes:610636,sha256:"8c2663f7c031328ef06dc59aa0c0a11f5e7708b3981b4399d8bfd609573e986f",duration:10},"video/10002023.webm":{bytes:612556,sha256:"79a90a1d7d5f6a2b9a1e81738e12566f14ce96f99fa81ca102aab157b4b2664f",duration:10},"video/10002024.webm":{bytes:1453404,sha256:"7e5412973270e8e58a539c9f83304b4cd07a0faa740a4752b982333e380a1d55",duration:3.4},"video/10002025.webm":{bytes:1544749,sha256:"63af745659c7063ba0d7fff63af97eaf8972c2a5a06cd6739ad518cd4187b153",duration:10},"video/10002026.webm":{bytes:280741,sha256:"cf701673766d966c3b522749ba169622c98261501be50bb3afee3c998898486e",duration:10},"video/10002027.webm":{bytes:327918,sha256:"d59447600017e11aa42fc342833fad186af9f9d1670aba32f922d77fca63d6c6",duration:10},"video/10002028.webm":{bytes:336612,sha256:"827a91d60bf0fa75a131853e0f1fda8855cf2cfdf9b06194d195833bda026986",duration:10},"video/10002029.webm":{bytes:700863,sha256:"1a8ad0969222629d8fd89bafb174df58082aaa50755e3843ca82ad953b18e0aa",duration:10},"video/10002030.webm":{bytes:34533,sha256:"f4080af95380d8f640133b255bbe2b25b03180a3cfcd99aed1f281265c6f18cb",duration:1.966},"video/10002031.webm":{bytes:187567,sha256:"8bbdc15b123c3ac7f3cba16b04ca18571996e6556f190edd4f13d6a50ecd8c0c",duration:1.166},"video/10002032.webm":{bytes:1776997,sha256:"e3b15a717b1db503bd3d838ed9b6fdb70def2fcb4b47f51db24eb86fc03e7923",duration:10},"video/10002033.webm":{bytes:297716,sha256:"425cd20f5a5038f720e0f3c4dd65ab58c6c5ad80aa346b6c9035eb0700e69d3e",duration:2},"video/10002034.webm":{bytes:2495666,sha256:"70f377770e704850e9a2eff20fa283cbae7939fd42b66b85110b9b6eb1aa2add",duration:10},"video/10002035.webm":{bytes:183443,sha256:"a631becd1c4585ec80d91b435a5c6cda28b6b2033f2eb62f929a7580ad2ffbad",duration:10},"video/10002036.webm":{bytes:89987,sha256:"5b523e749db42145e8f3947e86d6e8d9683300b737f7775477cd94f02c1c8004",duration:10},"video/10002037.webm":{bytes:823633,sha256:"a4e7ba6ce6a6a43c31597d6b6430e86c507ab45a89910eb5010f1d058901f539",duration:10}}};var Hb=fs.version;var Lh=Object.freeze(fs.assets.map(Object.freeze)),jh=new Map(Lh.map(t=>[t.id,t]));function Du(t,e="animation"){let i=jh.get(Number(t));return i?.scope===(e==="fullscreen"?"screen":"ui")?i:null}import{randomUUID as Bu}from"node:crypto";function go(t){for(let e of t.runtime.scrollControls||[]){let[i,n]=Un(e),r=e.kind==="grid"?gn(e):Mu(e,i,n),o={offset:r.offset,max:r.max,horizontal:r.horizontal,showBar:e.showScrollBar!==!1,textWidth:r.textWidth??0,lines:r.lines||[],lineHeight:r.lineHeight||0,contentLength:r.length,...e.kind==="textwindow"?{fontSize:r.fontSize}:{}},a=JSON.stringify(o);e._scrollKey!==a&&(e._scrollKey=a,e._scroll=o,e.markPlayDirty())}}function qu(t){return{...t._scroll?{scroll:t._scroll}:{},...t.parent?._gridItems?.includes(t)?{clipToParent:!0}:{}}}function us(t,e){let i=t._scroll?.max||0;t.kind==="grid"?t.scrollProgress=i?ho(e,i)/i:0:t._scrollOffset=ho(e,i),t.markPlayDirty()}var Uh=Object.freeze(Object.values(Pe).map(t=>Object.freeze({id:t.id,label:t.label,platform:t.platform,width:t.width,height:t.height})));function nr(t){go(t);let e=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),i=new Map;function n(r,o,a){let s=jt(o,r);s.activeInHierarchy=a&&r.active!==!1,i.set(r.Id,s);let l=s.activeInHierarchy;for(let c of r.children)n(c,s,l)}for(let r of t.runtime.roots)n(r,e,!0);return i}function bs(t,e=nr(t)){let i=new Map;function n(r,o){let a=e.get(r.Id);if(!a)return;let s=An(o,a,r);i.set(r.Id,s);for(let l of r.children)n(l,s)}for(let r of t.runtime.roots)n(r,Ji());return i}function Lu(t,e){let i=e.get(t.Id);return{id:t.Id,prefabId:t.prefabIndex,authoringId:t.authoringId,name:t.name,kind:t.kind,typeofName:t.typeofName,instantiated:!t.authoringId,active:!!t.active,visible:!!t.visible,activeInHierarchy:!!i?.activeInHierarchy,raycastTarget:t.raycastTarget!==!1,interactable:t.interactable!==!1,pressed:t.pressed===!0,...t._scroll?{scrollOffset:t._scroll.offset,scrollMax:t._scroll.max}:{},...t.kind==="grid"?{itemCount:t.itemCount,scrollProgress:t.scrollProgress}:{},anchoredPositionX:t.anchoredPositionX,anchoredPositionY:t.anchoredPositionY,sizeDeltaX:t.sizeDeltaX,sizeDeltaY:t.sizeDeltaY,localScaleX:t.localScaleX,localScaleY:t.localScaleY,localScaleZ:t.localScaleZ,localRotationZ:t.localRotationZ,text:t.kind==="textbox"||t.kind==="textwindow"?t.text??"":null,fontSize:t.kind==="textbox"||t.kind==="textwindow"?t.fontSize:null,adaptiveFontSize:t.kind==="textbox"||t.kind==="textwindow"?t.adaptiveFontSize===!0:null,minimumFontSize:t.kind==="textbox"||t.kind==="textwindow"?t.minimumFontSize:null,fontColor:t.kind==="textbox"||t.kind==="textwindow"?t.fontColor:null,bgColor:t.kind==="textbox"||t.kind==="textwindow"?t.bgColor:null,enableOutline:t.kind==="textbox"||t.kind==="textwindow"?t.enableOutline===!0:null,outlineColor:t.kind==="textbox"||t.kind==="textwindow"?t.outlineColor:null,imageId:t.kind==="image"?t.imageId??0:null,imageSource:t.kind==="image"?ii(t.imageSource):null,imageType:t.kind==="image"?t.imageType==null?null:gt(t.imageType):null,primitive:t.kind==="image"?Ki(t.imageId,t.imageSource):null,imageColor:t.kind==="image"?t.imageColor:null,enableMask:t.kind==="image"?t.enableMask===!0:null,enableSoftEdge:t.kind==="image"?t.enableSoftEdge===!0:null,softEdgeMode:t.kind==="image"?t.softEdgeMode:null,softEdgeWidthX:t.kind==="image"?t.softEdgeWidthX:null,softEdgeWidthY:t.kind==="image"?t.softEdgeWidthY:null,horizontalSoftRange:t.kind==="image"?t.horizontalSoftRange:null,verticalSoftRange:t.kind==="image"?t.verticalSoftRange:null,enableFill:t.kind==="image"?t.enableFill===!0:null,fillType:t.kind==="image"?t.fillType:null,fillHorizontalType:t.kind==="image"?t.fillHorizontalType:null,fillVerticalType:t.kind==="image"?t.fillVerticalType:null,fillRadial90Type:t.kind==="image"?t.fillRadial90Type:null,fillRadialType:t.kind==="image"?t.fillRadialType:null,reverseMaskArea:t.kind==="image"?t.reverseMaskArea===!0:null,fillAmount:t.kind==="image"?t.fillAmount:null,box:i?{left:i.left,bottom:i.bottom,width:i.width,height:i.height}:null,children:t.children.map(n=>Lu(n,e))}}function Yh(){return{pointerDownControl:null,pointerDownPosition:null,pointerLastPosition:null,pointerDragging:!1,pointerHoverControl:null,pointerScroll:null,hoveredControl:null,selectedControl:null,stateRestores:new Map,viewCache:null}}function Hh(t,e,i,n){let r=Kn({canvasWidth:t.canvasWidth,canvasHeight:t.canvasHeight,device:t.device,audioDuration:zu,canSelectImageType:js,...n?{language:n}:{}});for(let o of[...t.templates||[],...e?.templates||[]])Number.isSafeInteger(o.prefabIndex)&&o.prefabIndex>0&&r.registerTemplate(o.prefabIndex,o);for(let o of i){let a=o.path||o.id,s=o.source||"";a&&s&&r.registerScriptFile(a,s)}return r}var Xh=["pointerDownControl","pointerDownPosition","pointerLastPosition","pointerDragging","pointerHoverControl","pointerScroll","hoveredControl","selectedControl","stateRestores","viewCache"];function Kh(t){Object.defineProperty(t,"runtime",{configurable:!0,enumerable:!0,get(){return t.runtimes[t.viewPlayerIndex-1]}});for(let e of Xh)Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){return t.views[t.viewPlayerIndex-1][e]},set(i){t.views[t.viewPlayerIndex-1][e]=i}})}function ju(t,{templatesProject:e=null,scripts:i=[],sceneScripts:n=null,templateScripts:r=null,serverConfig:o=null,canvasId:a="",playerCount:s=1,viewPlayerIndex:l=1,language:c=""}={}){let f=n||i,h=r||i,m=ss(t,f,a),p=e?ss(e,h,a):null,b=Vi(s),g=ei(l,b),w=Ru({playerCount:b,viewPlayerIndex:g});o&&w.loadConfig({...o,playerCount:b,viewPlayerIndex:g});let S=[];for(let I=0;I<b;I+=1)S.push(Hh(m,p,i,c));w.attachRuntimes(S);for(let I of S)I.addRoot(m.root);let _={audioSessionId:Bu(),runtimes:S,views:S.map(()=>Yh()),playerCount:b,viewPlayerIndex:g,server:w,compiled:m,mountError:S.find(I=>I.mountErrors[0])?.mountErrors[0]||null,debugPaused:!1,history:{events:[]},recording:!0};Kh(_);let G=_.viewPlayerIndex;for(let I=1;I<=b;I+=1)_.viewPlayerIndex=I,sp(_);return _.viewPlayerIndex=G,_}function gs(t,e){if(!t)throw new Error("play session has not started");let i=ei(e,t.playerCount);return i===t.viewPlayerIndex||(Si(t,{kind:"view",payload:{playerIndex:i}}),t.viewPlayerIndex=i,t.viewCache=null,t.server&&t.server.setViewPlayerIndex(i)),i}function Si(t,e){!t?.recording||!t.history||Fu(t.history,{...e,source:e.source||"user"},t.runtime.clock.time)}function Wh(t){return t?.history?.events||[]}var ys=new Set(["image","textbox","textwindow","button","grid"]);function Jh(t,e){let i=wt(e,t.centerX,t.centerY);return{centerX:i.x,centerY:i.y,scaleX:Math.hypot(e.a,e.b),scaleY:Math.hypot(e.c,e.d),rotationZ:Math.atan2(e.b,e.a)*180/Math.PI,matrix:{a:e.a,b:e.b,c:e.c,d:e.d,tx:i.x,ty:i.y}}}function gt(t){return typeof t=="string"?t:t?.Name}function Uu(t){return{fillType:gt(t.fillType),fillHorizontalType:gt(t.fillHorizontalType),fillVerticalType:gt(t.fillVerticalType),fillAmount:t.fillAmount}}function Zh(t,e,i){let n=Math.abs(e.width*i.scaleX),r=Math.abs(e.height*i.scaleY),o={id:t.Id,kind:t.kind,name:t.name,left:i.centerX-n/2,bottom:i.centerY-r/2,width:n,height:r,sourceWidth:e.width,sourceHeight:e.height,rotationZ:i.rotationZ,matrix:i.matrix,pressed:t.pressed===!0,...qu(t)};return t.kind==="image"&&(o.imageSource=ii(t.imageSource),o.imageType=t.imageType==null?null:gt(t.imageType),o.primitive=Ki(t.imageId,o.imageSource),o.imageColor=t.imageColor,o.imageId=t.imageId,Object.assign(o,Uu(t))),(t.kind==="textbox"||t.kind==="textwindow")&&(o.text=t.text??"",o.fontSize=t.fontSize,o.adaptiveFontSize=t.adaptiveFontSize===!0,o.minimumFontSize=t.minimumFontSize,o.textLayout=Oi(t,e.width,e.height),o.fontColor=t.fontColor,o.bgColor=t.bgColor,o.enableOutline=t.enableOutline===!0,o.outlineColor=t.outlineColor,o.horizontalAlignment=gt(t.horizontalAlignment),o.verticalAlignment=gt(t.verticalAlignment)),o}function Qh(t,e=nr(t)){let i=[],n=bs(t,e);function r(o,a=[],s=[]){let l=e.get(o.Id);if(!l||o.visible===!1||!l.activeInHierarchy)return;let c=n.get(o.Id);if(!c)return;let f=Jh(l,c),h=o.kind==="image"&&o.enableMask===!0?Tn({...Yu(o,l),id:o.Id},Ti(c,l.centerX,l.centerY)):null,m=h?[...s,h]:s,p=()=>i.push({...Zh(o,l,f),...a.length?{clipPolygons:a}:{},...m.length?{masks:m}:{}});ys.has(o.kind)&&o.kind!=="grid"&&p();let b=o.children||[];for(let g=b.length-1;g>=0;g-=1){let w=o._gridItems?.includes(b[g])?[...a,[[l.left,l.bottom],[l.right,l.bottom],[l.right,l.top],[l.left,l.top]].map(([S,_])=>wt(c,S,_))]:a;r(b[g],w,m)}o.kind==="grid"&&p()}for(let o of t.runtime.roots)r(o);return i}function Yu(t,e){let i={kind:t.kind,name:t.name,sourceWidth:e.width,sourceHeight:e.height,pressed:t.pressed===!0,...qu(t)};return t.kind==="image"&&(i.imageSource=ii(t.imageSource),i.imageType=t.imageType==null?null:gt(t.imageType),i.primitive=Ki(t.imageId,i.imageSource),i.imageColor=t.imageColor,i.imageId=t.imageId,Object.assign(i,Uu(t),{enableMask:t.enableMask===!0,enableSoftEdge:t.enableSoftEdge===!0,softEdgeMode:gt(t.softEdgeMode)||"Percentage",softEdgeWidthX:t.softEdgeWidthX,softEdgeWidthY:t.softEdgeWidthY})),(t.kind==="textbox"||t.kind==="textwindow")&&(i.text=t.text??"",i.fontSize=t.fontSize,i.adaptiveFontSize=t.adaptiveFontSize===!0,i.minimumFontSize=t.minimumFontSize,i.textLayout=Oi(t,e.width,e.height),i.fontColor=t.fontColor,i.bgColor=t.bgColor,i.enableOutline=t.enableOutline===!0,i.outlineColor=t.outlineColor,i.horizontalAlignment=gt(t.horizontalAlignment),i.verticalAlignment=gt(t.verticalAlignment)),i}function ep(t,e,i){let n=_o(t,e),r=wt(n,t.centerX,t.centerY);return{a:n.a,b:n.b,c:n.c,d:n.d,tx:r.x-(i?i.centerX:0),ty:r.y-(i?i.centerY:0)}}function Hu(t){let e=t.matrix;return[t.parent,t.z,t.group?1:0,e.a,e.b,e.c,e.d,e.tx,e.ty,t.kind,t.name,t.sourceWidth,t.sourceHeight,t.pressed,t.primitive,t.imageColor,t.imageId,t.imageSource,t.imageType,t.fillType,t.fillHorizontalType,t.fillVerticalType,t.fillAmount,t.enableMask,t.enableSoftEdge,t.softEdgeMode,t.softEdgeWidthX,t.softEdgeWidthY,t.text,t.fontSize,t.fontColor,t.bgColor,t.adaptiveFontSize,t.minimumFontSize,JSON.stringify(t.textLayout),t.enableOutline,t.outlineColor,t.horizontalAlignment,t.verticalAlignment,JSON.stringify(t.scroll),t.clipToParent].join(" ")}function Xu(t,e,i,n,r,o){return{id:t.Id,parent:e,z:r,group:o>=16,matrix:ep(n,t,i),...Yu(t,n)}}function tp(t){let e=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),i=new Set,n=new Map,r=new Map;function o(l,c,f){let h=jt(c,l);if(h.activeInHierarchy=f&&l.active!==!1,r.set(l.Id,h),l.visible===!1||!h.activeInHierarchy)return!1;let m=l.children||[],p=ys.has(l.kind),b=0;for(let g=0;g<m.length;g+=1)o(m[g],h,h.activeInHierarchy)&&(p=!0,b+=1);return p?(i.add(l.Id),n.set(l.Id,b),!0):!1}function a(l,c,f,h){if(!i.has(l.Id))return;let m=r.get(l.Id);s.push(Xu(l,c,f,m,h,n.get(l.Id)||0));let p=l.children||[];for(let b=0;b<p.length;b+=1)a(p[b],l.Id,m,b)}let s=[];for(let l=0;l<t.runtime.roots.length;l+=1)o(t.runtime.roots[l],e,!0),a(t.runtime.roots[l],null,null,l);return{nodes:s,childCounts:n}}function hs(t){let e=t._playChildDirty===!0||t._playDeepDirty===!0;if(t._playDirty=!1,t._playChildDirty=!1,t._playDeepDirty=!1,!e)return;let i=t.children;for(let n=0;n<i.length;n+=1)hs(i[n])}function ip(t,e){let i=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),n=[],r=[],o=e.count,a=t.runtime._playRemoved||[];for(let c=0;c<a.length;c+=1){let f=a[c];e.fingerprints.has(f)&&(r.push(f),e.fingerprints.delete(f),e.childCounts.delete(f),o-=1)}t.runtime._playRemoved=[];function s(c){e.fingerprints.has(c.Id)&&(r.push(c.Id),e.fingerprints.delete(c.Id),e.childCounts.delete(c.Id),o-=1);let f=c.children;for(let h=0;h<f.length;h+=1)s(f[h])}function l(c,f,h,m,p,b){let g=b||c._playDeepDirty===!0,w=g||c._playDirty===!0,S=g||c._playChildDirty===!0;if(!w&&!S)return;if(!(p&&c.active!==!1)||c.visible===!1){s(c);return}let G=jt(f,c),I=e.childCounts.get(c.Id)||0;if(S){I=0;let O=c.children;for(let y=0;y<O.length;y+=1)l(O[y],G,c.Id,y,!0,g),e.fingerprints.has(O[y].Id)&&(I+=1)}if(!(ys.has(c.kind)||I>0)){e.fingerprints.has(c.Id)&&(r.push(c.Id),e.fingerprints.delete(c.Id),e.childCounts.delete(c.Id),o-=1);return}let V=e.childCounts.get(c.Id);e.childCounts.set(c.Id,I);let Y=I>=16!=(V||0)>=16;if(!w&&!Y&&e.fingerprints.has(c.Id))return;let q=Xu(c,h,f===i?null:f,G,m,I),x=Hu(q);e.fingerprints.get(q.id)!==x&&(e.fingerprints.has(q.id)||(o+=1),e.fingerprints.set(q.id,x),n.push(q))}for(let c=0;c<t.runtime.roots.length;c+=1)l(t.runtime.roots[c],i,null,c,!0,!1);return e.count=o,{changed:n,removed:r,count:o}}function np(t,e){let i=t.viewCache||(t.viewCache={rev:0,fingerprints:new Map,childCounts:new Map,count:0}),n=Number(e);if(!(Number.isFinite(n)&&n===i.rev&&i.fingerprints.size>0)){let{nodes:l,childCounts:c}=tp(t);i.rev+=1,i.fingerprints=new Map(l.map(f=>[f.id,Hu(f)])),i.childCounts=c,i.count=l.length;for(let f of t.runtime.roots)hs(f);return{format:"tree-v1",revision:i.rev,reset:!0,count:l.length,nodes:l}}let{changed:o,removed:a,count:s}=ip(t,i);i.rev+=1;for(let l of t.runtime.roots)hs(l);return{format:"tree-v1",revision:i.rev,reset:!1,count:s,changed:o,removed:a}}function vs(t,{inspect:e=!1,view:i=!1,paint:n=!1,sceneRev:r,compact:o=!1}={}){go(t),t.audioSessionId||=Bu();let a=t.runtime,s=t.compiled,[l,c]=[a.canvasWidth,a.canvasHeight];t.server&&t.server.setClock(a.clock.time);let f=o?a.logs.slice(-100):a.logs,h=Wh(t),m=t.server?t.server.snapshot():{vars:{},inbound:[],outbound:[],logs:[]};o&&(m.inbound=m.inbound.slice(-100),m.outbound=m.outbound.slice(-100),m.logs=m.logs.slice(-100));let p={canvasId:s.canvasId,platform:s.platform,device:a.device,canvasWidth:l,canvasHeight:c,canvasPresets:Uh,playerCount:t.playerCount||1,viewPlayerIndex:t.viewPlayerIndex||1,players:Array.from({length:t.playerCount||1},(b,g)=>({index:g+1,label:`\u73A9\u5BB6${g+1}`,entityType:`Player${g+1}`})),time:a.clock.time,frame:a.clock.frame,paused:!!t.debugPaused,levelTimePaused:!!a.clock.paused,audio:{sessionId:t.audioSessionId,playerIndex:t.viewPlayerIndex||1,...a.audioSnapshot()},effects:rp(t),mountError:t.mountError||a.mountErrors[0]||null,logs:f.map(b=>({source:"client",level:b.level,text:b.text,time:b.time})),tree:[],paint:[],scene:null,server:m,history:(o?h.slice(-100):h).map(b=>({t:b.t,source:b.source||"user",kind:b.kind,payload:b.payload||{}}))};if(e||n){let b=nr(t);e&&(p.tree=a.roots.map(g=>Lu(g,b))),n&&(p.paint=Qh(t,b))}return i&&(p.scene=np(t,r)),Wi(p),p}function rp(t){let e=a=>a._uiAnimation?.playing&&a.animationId!=null&&String(a.animationId).trim()!==""&&Number(a.animationId)!==0;if(![...t.runtime.uiAnimations||[]].some(e))return[];let i=nr(t),n=bs(t,i),r=[],o=(a,s=[])=>{let l=i.get(a.Id),c=n.get(a.Id);if(!l||!c||!l.activeInHierarchy||a.visible===!1)return;let f=a.kind==="image"&&a.enableMask===!0?Tn({...a,id:a.Id,sourceWidth:l.width,sourceHeight:l.height},Ti(c,l.centerX,l.centerY)):null,h=f?[...s,f]:s,m=a._uiAnimation;if(e(a)){let p=Du(a.animationId,a.kind),b=p?.audio.length?p.audio[(a.Id+m.generation-1)%p.audio.length]:null;r.push({id:a.Id,kind:a.kind,animationId:a.animationId??null,generation:m.generation,startedAt:m.startedAt,playSoundEffect:a.playSoundEffect!==!1,audioPath:b,layer:a.kind==="fullscreen"?"BelowAllControls":gt(a.layer)||"AboveAllControls",matrix:Ti(c,l.centerX,l.centerY),masks:h})}for(let p of[...a.children].reverse()){let b=a._gridItems?.includes(p)?{id:`viewport:${a.Id}`,matrix:Ti(c,l.centerX,l.centerY),width:l.width,height:l.height,featherX:0,featherY:0}:null;o(p,b?[...h,b]:h)}};for(let a of t.runtime.roots)o(a);return r}function yo(t,e=1/30){let i=t.runtimes||(t.runtime?[t.runtime]:[]);for(let n of i)n.step(e);t.server&&(t.server.setClock(t.runtime.clock.time),t.server.flush())}function ws(t,e){Si(t,{kind:"key",payload:{typeName:String(e)}}),t.runtime.injectKey(e)}function op(t,e){let i=null;for(let n of t.runtime.roots)Vt(n,r=>{!i&&r.name===e&&(i=r)});return i}function Ss(t,e){Si(t,{kind:"click",payload:{name:String(e)}});let i=op(t,e);i&&Es(i)&&(i.kind==="button"||i.kind==="cursor")&&i.SimulateCursorClick()}function ap(t,e){return!t||!e?null:t.children.find(i=>i.authoringId===e||i.Id===e)||null}var Ku={unavailable:"unavailableChildId",hover:"hoverChildId",pressed:"pressedChildId",selected:"selectedChildId"};function Wu(t,e){let i=[];for(let[n,r]of Object.entries(Ku)){let o=e[r]?ap(e,e[r]):null;o&&i.push({state:n,child:o})}return i}function sp(t){for(let e of t.runtime.roots)Vt(e,i=>{if(i.kind==="button"){for(let{child:n}of Wu(t,i))t.stateRestores.has(n.Id)||t.stateRestores.set(n.Id,{child:n,active:n.active,visible:n.visible}),n.active=!0,n.visible=!1,typeof n.markPlayDirty=="function"&&n.markPlayDirty(!0);tr(t,i)}})}function tr(t,e){if(!e||e.kind!=="button")return;let i=null;e.interactable===!1?i="unavailable":e.pressed===!0?i="pressed":t.hoveredControl===e?i="hover":t.selectedControl===e&&(i="selected");for(let n of Wu(t,e))n.child.active=!0,n.child.visible=n.state===i,typeof n.child.markPlayDirty=="function"&&n.child.markPlayDirty(!0)}function ds(t){if(!t)return null;let e=t.parent;return e?.kind==="button"&&Object.values(Ku).map(n=>e[n]).filter(Boolean).includes(t.authoringId)?e:t}function Es(t){return t.kind==="button"?t.raycastTarget!==!1&&t.interactable!==!1:t.kind==="cursor"||t.kind==="grid"?t.raycastTarget!==!1:t.kind==="textwindow"?t.interactable!==!1:t.raycastTarget===!0}function ps(t){return t.kind==="container"||t.kind==="grid"||t.kind==="textwindow"||t.kind==="reference"||t.kind==="button"}function lp(t){return t.kind==="grid"||t.kind==="textwindow"}function Ju(t,e){let i=t.Id,n=e.get(i);if(n!==void 0)return n;let r=Es(t);if(!r&&ps(t)){let o=t.children;for(let a=0;a<o.length;a+=1)if(Ju(o[a],e)){r=!0;break}}return e.set(i,r),r}function mo(t,e,i){go(t);let n=Qe({width:t.runtime.canvasWidth,height:t.runtime.canvasHeight}),r=new Map;function o(s,l,c,f){if(!f||s.active===!1||s.visible===!1||!Ju(s,r))return null;let h=jt(l,s),m=An(c,h,s),p=Zi(m);if(!p)return null;let b=wt(p,e,i),g=b.x>=h.left&&b.x<=h.right&&b.y>=h.bottom&&b.y<=h.top;if(!g&&(!ps(s)||lp(s)))return null;if(g&&bo(s)){let w=po(s._scroll,h.width,h.height)?.track,S=b.x-h.centerX,_=h.centerY-b.y;if(w&&S>=w.x&&S<=w.x+w.width&&_>=w.y&&_<=w.y+w.height)return s}if(ps(s))for(let w=0;w<s.children.length;w+=1){let S=o(s.children[w],h,m,!0);if(S)return S}return g&&Es(s)?s:null}let a=Ji();for(let s=t.runtime.roots.length-1;s>=0;s-=1){let l=o(t.runtime.roots[s],n,a,!0);if(l)return l}return null}function Sn(t,e,i,{dragging:n=!1,press:r=null,previous:o=null}={}){let a=r||{x:e,y:i},s=o||{x:e,y:i};return t.runtime.makeCursorEventData({x:e,y:i,pressX:a.x,pressY:a.y,deltaX:e-s.x,deltaY:i-s.y,dragging:n})}function ms(t,e,i){e.kind==="grid"||e.kind==="textwindow"||(e.pressed=i,typeof e.markPlayDirty=="function"&&e.markPlayDirty(),tr(t,e))}function bo(t){if(!t?.alive||!t.activeInHierarchy||t.interactable===!1||t.raycastTarget===!1)return!1;for(let e=t;e;e=e.parent)if(e.visible===!1)return!1;return t._scroll?.max>0}function $u(t){for(let e=t;e;e=e.parent)if(bo(e))return e;return null}function Gu(t,e,i,n){let r=nr(t),o=r.get(e.Id),a=bs(t,r).get(e.Id),s=a&&Zi(a);if(!o||!s)return null;let l=wt(s,i,n);return{x:l.x-o.centerX,y:o.centerY-l.y,width:o.width,height:o.height}}function Vu(t,e,i){let n=t.pointerDownControl;if(n?.alive){let r=Sn(t,e,i,{dragging:t.pointerDragging,press:t.pointerDownPosition,previous:t.pointerLastPosition});t.runtime.injectCursor(n,"CursorUp",r),t.pointerDragging&&!t.pointerScroll&&t.runtime.injectCursor(n,"CursorEndDrag",r),ms(t,n,!1)}t.pointerDownControl=null,t.pointerScroll=null,t.pointerDownPosition=null,t.pointerDragging=!1,t.pointerLastPosition={x:e,y:i}}function ir(t,e,i,n,r={}){let o=Number(i),a=Number(n);if(!Number.isFinite(o)||!Number.isFinite(a))throw new Error("pointer coordinates must be finite");t.runtime.cursor.x=o,t.runtime.cursor.y=a;let s=Number(r.deltaX??0),l=Number(r.deltaY??0);if(e==="wheel"&&(!Number.isFinite(s)||!Number.isFinite(l)))throw new Error("wheel deltas must be finite");if(r.silent||Si(t,{kind:"pointer",payload:{type:e,x:o,y:a,...e==="wheel"?{deltaX:s,deltaY:l}:{}}}),e==="wheel"){let c=mo(t,o,a),f=$u(c);if(f){let h=f._scroll.horizontal&&s||l;us(f,f._scroll.offset+h)}return c}if(e==="cancel")return Vu(t,o,a),null;if((e==="move"||e==="up")&&t.pointerScroll&&!bo(t.pointerScroll.control)&&Vu(t,o,a),e==="move"){let c=t.pointerLastPosition||{x:o,y:a},f=t.pointerHoverControl,h=ds(mo(t,o,a)),m=Sn(t,o,a,{previous:c});f&&f!==h&&t.runtime.injectCursor(f,"CursorExit",m),h&&f!==h&&t.runtime.injectCursor(h,"CursorEnter",m),t.pointerHoverControl=h;let p=t.hoveredControl;t.hoveredControl=h?.kind==="button"?h:null,p&&p!==t.hoveredControl&&tr(t,p),t.hoveredControl&&tr(t,t.hoveredControl);let b=t.pointerDownControl,g=t.pointerScroll;if(g)if(!bo(g.control))t.pointerScroll=null;else{let w=Gu(t,g.control,o,a);if(w){let S=g.control._scroll,_=S.horizontal?w.x-g.start.x:w.y-g.start.y,G=po(S,w.width,w.height)?.travel||0,I=g.bar?G?_*S.max/G:0:-_;us(g.control,g.offset+I)}}if(b?.alive){let w=t.pointerDownPosition||c,S=Math.hypot(o-w.x,a-w.y)>5;!t.pointerDragging&&S&&(g||t.runtime.injectCursor(b,"CursorBeginDrag",Sn(t,o,a,{press:w,previous:c,dragging:!1})),t.pointerDragging=!0),t.pointerDragging&&!g&&t.runtime.injectCursor(b,"CursorDrag",Sn(t,o,a,{press:w,previous:c,dragging:!0}))}return t.pointerLastPosition={x:o,y:a},h}if(e==="down"){let c=ds(mo(t,o,a));t.pointerDownControl=c,t.pointerDownPosition={x:o,y:a},t.pointerLastPosition={x:o,y:a},t.pointerDragging=!1,t.pointerScroll=null;let f=$u(c);if(f){let h=Gu(t,f,o,a),m=h&&po(f._scroll,h.width,h.height),p=g=>h.x>=g.x&&h.x<=g.x+g.width&&h.y>=g.y&&h.y<=g.y+g.height,b=m&&p(m.track);if(b&&!p(m.thumb)){let g=f._scroll.horizontal?h.x-m.track.x-m.thumb.width/2:h.y-m.track.y-m.thumb.height/2;us(f,m.travel?g/m.travel*f._scroll.max:0),go(t)}h&&(t.pointerScroll={control:f,start:h,offset:f._scroll.offset,bar:!!b})}return c&&(ms(t,c,!0),t.runtime.injectCursor(c,"CursorDown",Sn(t,o,a))),c}if(e==="up"){let c=t.pointerDownControl,f=ds(mo(t,o,a));if(c?.alive){let h=Sn(t,o,a,{press:t.pointerDownPosition,previous:t.pointerLastPosition,dragging:t.pointerDragging});if(t.runtime.injectCursor(c,"CursorUp",h),t.pointerDragging)t.pointerScroll||t.runtime.injectCursor(c,"CursorEndDrag",h);else if(f===c&&!t.pointerScroll?.bar){t.runtime.injectCursor(c,"CursorClick",h);let m=t.selectedControl;t.selectedControl=c.kind==="button"?c:null,m&&m!==t.selectedControl&&tr(t,m)}ms(t,c,!1)}return t.pointerDownControl=null,t.pointerDownPosition=null,t.pointerLastPosition={x:o,y:a},t.pointerDragging=!1,t.pointerScroll=null,f}if(e==="click")return ir(t,"down",o,a,{silent:!0}),ir(t,"up",o,a,{silent:!0});throw new Error(`unknown pointer type ${e}`)}function xs(t,e,i,n){if(!t?.server)throw new Error("play session has no server");return Si(t,{kind:"serverSet",payload:{entityType:e,name:i,value:n,playerIndex:t.viewPlayerIndex}}),t.server.setVar(e,i,n,{playerIndex:t.viewPlayerIndex})}function Zu(t,e,i){if(!t?.server)throw new Error("play session has no server");let n=t.server.getVar(e,i,{playerIndex:t.viewPlayerIndex});return n===void 0?null:n}function _s(t,e,i=[],n="PlayerSelf"){if(!t?.server)throw new Error("play session has no server");return Si(t,{kind:"serverSend",payload:{name:e,params:i,target:n,playerIndex:t.viewPlayerIndex}}),t.server.sendToClient(e,i,{target:n,playerIndex:t.viewPlayerIndex})}function vo(t){return{snapshot:e=>vs(t,e),step:e=>yo(t,e),pointer:(e,i,n,r)=>ir(t,e,i,n,r),key:e=>ws(t,e),click:e=>Ss(t,e),view:e=>gs(t,e),pause:()=>{Si(t,{kind:"pause",payload:{}}),t.debugPaused=!0},resume:()=>{Si(t,{kind:"resume",payload:{}}),t.debugPaused=!1},serverSet:(e,i,n)=>xs(t,e,i,n),serverSend:(e,i,n)=>_s(t,e,i,n)}}function Is(t){t?.server&&t.server.destroy();let e=t?.runtimes||(t?.runtime?[t.runtime]:[]);for(let i of e)i.destroy()}function Cs(t,e){return JSON.stringify(t)===JSON.stringify(e)}function Qu(t,e){for(let i of t||[])e(i),i.children?.length&&Qu(i.children,e)}function As(t,{id:e,name:i}){let n=null;return Qu(t,r=>{n||(e&&String(r.id)===String(e)||!e&&i&&r.name===i)&&(n=r)}),n}function cp(t,e){if(t){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];if(t.box&&Object.prototype.hasOwnProperty.call(t.box,e))return t.box[e]}}function fp(t){return{var(e,i){return t.server?.vars?.[e]?.[i]?.value??null},logs(){return(t.logs||[]).map(e=>e.text)},logContains(e){return(t.logs||[]).some(i=>String(i.text||"").includes(String(e)))},serverLogs(){return(t.server?.logs||t.serverLogs||[]).map(e=>e.text)},serverLogContains(e){return(t.server?.logs||t.serverLogs||[]).some(i=>String(i.text||"").includes(String(e)))},control(e){let i=As(t.tree,{name:String(e)});return i?{id:i.id,name:i.name,kind:i.kind,active:i.active,visible:i.visible,pressed:i.pressed,text:i.text,interactable:i.interactable}:null},signals(e){let i=e==="outbound"?"outbound":"inbound";return(t.server?.[i]||[]).map(n=>({name:n.name,values:n.values}))}}}function up(t,e){if(t.kind==="log"){let i=t.source==="server"?e.server?.logs||e.serverLogs||[]:e.logs||[];return i.some(r=>t.level&&r.level!==t.level?!1:String(r.text||"").includes(t.contains))?{ok:!0,actual:t.contains}:{ok:!1,actual:i.map(r=>r.text).slice(-8),expected:t.contains}}if(t.kind==="control"){let i=As(e.tree,t);if(!i)return{ok:!1,actual:null,expected:t.equals,message:`control not found: ${t.id||t.name}`};let n=cp(i,t.field);return Cs(n,t.equals)?{ok:!0,actual:n}:{ok:!1,actual:n,expected:t.equals}}if(t.kind==="var"){let i=e.server?.vars?.[t.entityType],r=!i||!Object.prototype.hasOwnProperty.call(i,t.name)?null:i[t.name].value;return Cs(r,t.equals)?{ok:!0,actual:r}:{ok:!1,actual:r,expected:t.equals}}if(t.kind==="signal"){let i=t.direction==="outbound"?e.server?.outbound||[]:e.server?.inbound||[],n=i.find(r=>r.name===t.name&&(t.values===void 0||Cs(r.values,t.values)));return n?{ok:!0,actual:n.values}:{ok:!1,actual:i.map(r=>({name:r.name,values:r.values})),expected:{name:t.name,values:t.values??null}}}if(t.kind==="tree"){let i=!!As(e.tree,{name:t.name});return i===t.exists?{ok:!0,actual:i}:{ok:!1,actual:i,expected:t.exists}}return{ok:!1,message:`unsupported assert kind ${t.kind}`}}function dp(t,e){let i=Kn();try{return i.evalQueryScript(t,fp(e)),{ok:!0,actual:!0}}catch(n){return{ok:!1,message:n?.message||String(n)}}finally{i.destroy()}}function ed(t,e){return t.kind==="lua"?dp(t.source,e):up(t,e)}function hp(t,e){let i=e>0?e:Li;return Math.round((t+i)*1e9)/1e9}function pp(t,e){let i=e.payload||{};if(e.kind==="pointer")t.pointer(i.type,i.x,i.y,i);else if(e.kind==="key")t.key(i.typeName);else if(e.kind==="click")t.click(i.name);else if(e.kind==="pause")t.pause();else if(e.kind==="resume")t.resume();else if(e.kind==="serverSet")t.serverSet(i.entityType,i.name,i.value);else if(e.kind==="serverSend")t.serverSend(i.name,i.params,i.target);else if(e.kind==="view")t.view(i.playerIndex);else throw new Error(`unsupported event kind: ${e.kind}`)}function mp(t,e){let i=ed(t,e);return{kind:t.kind,at:Number(t.at||0),ok:!!i.ok,actual:i.actual??null,expected:i.expected??null,message:i.message||""}}function td(t,e){let i=er(e),n=i.events.slice().sort((S,_)=>S.t-_.t),r=i.asserts.slice(),o=i.dt||Li,a=n.reduce((S,_)=>Math.max(S,_.t),0),s=r.reduce((S,_)=>Math.max(S,Number(_.at||0)),0),l=Math.max(a,s),c=0,f=[],h=0,m=r.some(S=>S.kind==="control"||S.kind==="tree"||S.kind==="lua"),p=t.snapshot({inspect:m}),b=()=>{for(;c<n.length&&n[c].t<=h+1e-9;)pp(t,n[c]),c+=1,p=t.snapshot({inspect:m})},g=()=>{for(let S of r)if(!S._done&&Number(S.at||0)<=h+1e-9){let _=mp(S,p);if(f.push(_),S._done=!0,!_.ok)return{passed:!1,failedAt:h,frame:p.frame||0,results:f,snapshot:p}}return null};b();let w=g();if(w)return ks(i,w);for(;h+1e-9<l;){t.step(o),h=hp(h,o),p=t.snapshot({inspect:m}),b();let S=g();if(S)return ks(i,S)}return ks(i,{passed:f.every(S=>S.ok),failedAt:null,frame:p.frame||0,results:f,snapshot:p})}function ks(t,e){return ie({format:t.format,name:t.name,passed:e.passed,failedAt:e.failedAt,frame:e.frame,results:e.results,snapshot:{time:e.snapshot?.time??0,frame:e.snapshot?.frame??0,logs:e.snapshot?.logs||[],serverLogs:e.snapshot?.serverLogs||e.snapshot?.server?.logs||[],server:e.snapshot?.server||{vars:{},inbound:[],outbound:[],logs:[]}}})}function Os(t){return Array.isArray(t)?t.slice():[]}import{createHash as bp}from"node:crypto";var id=t=>bp("sha256").update(JSON.stringify(t.map(({id:e,path:i,source:n})=>({id:e,path:i,source:n})))).digest("hex");function Ts(t,e=[]){let i=[],n=new Map,r=new Map;for(let s of e)r.set(s.controlId,(r.get(s.controlId)||0)+1);function o(s){let l=(s.children||[]).map(o),c={controlCount:1+l.reduce((f,h)=>f+h.controlCount,0),scriptCount:(r.get(s.id)||0)+l.reduce((f,h)=>f+h.scriptCount,0)};return n.set(s.id,c),c}o(t.root);function a(s,l="",c=[]){i.push({id:s.id,name:s.name,kind:s.kind,guid:s.guid,parentId:l,ancestorIds:c,depth:c.length,...n.get(s.id)});for(let f of s.children||[])a(f,s.id,[...c,s.id])}for(let s of t.root.children||[])a(s);return i}function nd(t,e,{controlIds:i,includeScripts:n=!0}={}){if(!Array.isArray(i)||!i.length||i.some(g=>typeof g!="string"||!g))throw new Error("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E00\u4E2A\u5BA2\u6237\u7AEF\u63A7\u4EF6 controlIds");if(typeof n!="boolean")throw new Error("includeScripts must be a boolean");let r=Ts(t,e),o=new Map(r.map(g=>[g.id,g]));for(let g of i)if(!o.has(g))throw new Error(`\u672A\u77E5\u5BA2\u6237\u7AEF\u63A7\u4EF6\uFF1A${g}`);let a=new Set(i),s=r.filter(g=>a.has(g.id)&&!g.ancestorIds.some(w=>a.has(w))),l=ie(t),c=new Map;be(l.root,g=>c.set(g.id,g)),l.root.children=s.map(g=>c.get(g.id)),l.selectedId=s[0].id;let f=new Set;be(l.root,g=>{g.kind!=="server-container"&&f.add(g.id)});let h=[];for(let g of s)g.parentId&&h.push(`${g.name}\uFF1A\u4EC5\u5728\u5BFC\u51FA\u526F\u672C\u4E2D\u63D0\u5347\u4E3A\u72EC\u7ACB\u6A21\u677F\uFF0C\u4FDD\u7559\u56DB\u5E73\u53F0\u5C40\u90E8\u53D8\u6362\uFF1B\u5916\u90E8\u7236\u7EA7\u7684\u7F29\u653E\u3001\u65CB\u8F6C\u3001\u906E\u7F69\u53CA\u663E\u9690\u4E0D\u5305\u542B\u5728\u5185\u3002`);let m=new Set([...f].map(g=>c.get(g).guid));be(l.root,g=>{for(let w of["referencedPrefabId","itemPrefabId"]){let S=g[w];S&&!m.has(Number(S))&&h.push(`${g.name}\uFF1A\u5F15\u7528 ${S} \u4E0D\u5728\u672C\u6B21\u5BFC\u51FA\u4E2D\uFF0C\u8BF7\u540C\u65F6\u5BFC\u5165\u5BF9\u5E94\u6A21\u677F\u3002`)}g.giaRaw?.templateRefSlotBase64&&h.push(`${g.name}\uFF1A\u4E8C\u8FDB\u5236\u6A21\u677F\u5F15\u7528\u539F\u6837\u4FDD\u7559\uFF0C\u65E0\u6CD5\u81EA\u52A8\u5224\u65AD\u5916\u90E8\u4F9D\u8D56\u3002`),!n&&g.scriptMappingIds?.length&&(g.scriptMappingIds=[])});let p=n?e.filter(g=>!g.controlId||f.has(g.controlId)):[];for(let g of p)!g.source&&g.path&&h.push(`${g.path}\uFF1A\u4EC5\u767B\u8BB0\u4E86\u8DEF\u5F84\uFF0C\u6CA1\u6709\u5185\u8054\u6E90\u7801\uFF1B\u8BF7\u6838\u5BF9\u6E38\u620F\u5185\u7684\u811A\u672C\u6587\u4EF6\u3002`);n&&p.some(g=>!g.controlId)&&h.push("\u5DF2\u5305\u542B\u672A\u6302\u8F7D\u7684 Lua \u6A21\u5757\uFF1BLua \u52A8\u6001\u5F15\u7528\u65E0\u6CD5\u81EA\u52A8\u5224\u65AD\uFF0C\u8BF7\u6838\u5BF9\u5916\u90E8\u6A21\u677F\u548C\u811A\u672C\u4F9D\u8D56\u3002"),!n&&e.some(g=>f.has(g.controlId))&&h.push("\u672C\u6B21\u672A\u5305\u542B\u6302\u8F7D\u811A\u672C\uFF0C\u5BFC\u5165\u540E\u9700\u53E6\u884C\u5BFC\u5165\u5E76\u6302\u8F7D\u3002");let b=new Set(p.map(g=>g.guid));return n&&be(l.root,g=>{for(let w of g.scriptMappingIds||[])b.has(w)||h.push(`${g.name}\uFF1A\u811A\u672C\u6620\u5C04 ${w} \u7684\u6E90\u7801\u672A\u767B\u8BB0\uFF0C\u8BF7\u53E6\u884C\u5BFC\u5165\u3002`)}),{project:l,scripts:p,warnings:[...new Set(h)],selection:{controlIds:s.map(g=>g.id),controlCount:f.size,templateCount:s.length,scriptCount:p.length,includeScripts:n}}}var xp={Level:"\u5173\u5361",PlayerSelf:"\u5F53\u524D\u73A9\u5BB6",AvatarSelf:"\u5F53\u524D\u89D2\u8272",...Object.fromEntries(Bi.map((t,e)=>[t,`\u73A9\u5BB6${e+1}`])),...Object.fromEntries(Array.from({length:8},(t,e)=>[`Avatar${e+1}`,`\u89D2\u8272${e+1}`]))};function _p(t,e=1){let i=t?.vars||{},n=[],r=Number(e)>0?Number(e):1,o=["Level","PlayerSelf","AvatarSelf"];if(r>1)for(let s=1;s<=r;s+=1)o.push(`Player${s}`,`Avatar${s}`);let a=new Set;for(let s of o){if(a.has(s)||!i[s])continue;a.add(s);let l=i[s]||{};for(let c of Object.keys(l))n.push(ie({entityType:s,entityLabel:xp[s]||s,name:c,type:l[c]?.type||"",value:l[c]?.value??null}))}return n}var Yi="qxqy-simulator-save",Ip="qxqy-simulator-scripts",Be="server-control-template",ce="client-control-template",Rs={[Be]:"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F",[ce]:"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F"};function ji(t){return t===ce?"client":"server"}function sd(t){if(!(typeof t=="number"||typeof t=="string"&&/^\d+$/.test(t.trim()))||!dt(t))throw new Error(`\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F ${1073741824}\u2013${1077936127}\uFF080x40000000\u20130x403FFFFF\uFF09\u8303\u56F4\u5185\u7684\u6574\u6570`);return Number(t)}function wo(t){let e=typeof t=="number"||typeof t=="string"&&/^\d+$/.test(t.trim()),i=Number(t);if(!e||!Ut(i))throw new Error("\u63A7\u4EF6\u7D22\u5F15\u5FC5\u987B\u662F 1\u20132147483647 \u8303\u56F4\u5185\u7684\u6574\u6570");return i}function Ns(t=[]){if(!Array.isArray(t))throw new Error("controlGuidChanges \u5FC5\u987B\u662F\u6570\u7EC4");let e=new Set;return t.map(i=>{if(!i||typeof i.id!="string"||!i.id||e.has(i.id)||![Be,ce].includes(i.controlAsset)||typeof i.controlId!="string"||!i.controlId||typeof i.controlName!="string")throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u6216\u91CD\u590D\u7684\u53D8\u66F4\u8BB0\u5F55");if(e.add(i.id),i.batchId!==void 0&&(typeof i.batchId!="string"||!i.batchId))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 batchId");if(i.scriptSignature!==void 0&&!/^[a-f0-9]{64}$/.test(i.scriptSignature))throw new Error("controlGuidChanges \u5305\u542B\u65E0\u6548\u7684 scriptSignature");return{id:i.id,controlAsset:i.controlAsset,controlId:i.controlId,controlName:i.controlName,oldGuid:wo(i.oldGuid),newGuid:wo(i.newGuid),...i.batchId?{batchId:i.batchId}:{},...i.scriptSignature?{scriptSignature:i.scriptSignature}:{}}})}function Cp(t){let e=[t?.guid,t?.id];for(let i of e){let n=Number(i);if(Ut(n))return n}return 0}function So(t){let e=String(t?.controlAsset||""),i=Cp(t);return{id:String(i||t?.id||""),guid:i,path:String(t?.path||""),source:String(t?.source||""),controlId:String(t?.controlId||""),controlAsset:e===ce||e==="client"?ce:e===Be||e==="server"?Be:""}}function Ap(t){let e=[],i=(n,r="")=>{if(n&&(n.path||n.source)){let o=So(n);e.push(r?{...o,controlAsset:r}:o)}};if(Array.isArray(t?.assets?.scripts)){for(let n of t.assets.scripts)n&&(n.path||n.source)&&e.push(So(n));return e}if(i(t?.assets?.server?.script,Be),i(t?.assets?.client?.script,ce),t&&t.format!==Yi){i(t?.script);for(let n of t?.scripts||[])i(n)}return e}function Ps(t){return vi(t===ce?en():Ai())}var kp="\u672A\u7ED1\u5B9A",Ui="\u672A\u547D\u540D\u5B58\u6863",Op="\u672A\u547D\u540D\u754C\u9762";function Tp(t){let e=t;for(let i=0;i<8;i++){if(rr(od(e,"simulator","studio"))&&rr(od(e,"lua")))return e;let n=Sp(e);if(n===e)break;e=n}return t}function Rp(t){return t?{name:En(t),path:t,bound:!0}:{name:kp,path:"",bound:!1}}function Np(t,e=process.cwd()){if(Ep(t)&&rr(t))return t;let i=e||process.cwd(),n=Tp(i),r=ad(n,t);if(rr(r))return r;let o=ad(i,t);if(rr(o))return o;throw new Error("script file not found: "+t)}function Fs(t,e={}){t?.format===Yi&&La(t.version);let i=[],n=typeof e.workspacePath=="string"&&e.workspacePath?e.workspacePath:"",r=t?.format===Yi&&t.assets,o=Ns(t?.controlGuidChanges),a=Eo(t?.scriptSync),s=r?null:vi(t,{warnings:i}),l={server:r&&t.assets.server?vi(t.assets.server,{warnings:i}):Ps(Be),client:r&&t.assets.client?vi(t.assets.client,{warnings:i}):Ps(ce)};s&&(l[ji(s.meta.assetType)]=s);let c=r&&t.activeAssetType===ce?ce:s?.meta.assetType||Be,f=r&&t.meta?.name?String(t.meta.name):"",h=()=>f||Ui;!t?.meta?.name&&l.server.meta.name==="\u672A\u547D\u540D\u754C\u9762\u63A7\u4EF6\u7EC4"&&(l.server.meta.name=Op);let m=[],p=new Set;function b(){p.clear(),Qi(l.server.root,p),Qi(l.client.root,p,{skipServerContainer:!0});for(let v of m)Ut(v.guid)&&p.add(Number(v.guid))}function g(v=0){b();let C=Ut(v)&&!p.has(Number(v))?Number(v):ri(p);return p.add(C),C}function w(v){let C=So(v),R=g(C.guid);return{...C,guid:R,id:String(R)}}L(Ap(t));let S=Qn(t?.serverLogic),_=null,G="",I=1,$=1;function V(v){let C=String(v||"").trim();if(!C)return"";if(!Pe[C])throw new Error(`unknown canvas preset: ${C} (available: ${Object.keys(Pe).join(", ")})`);return C}let Y=()=>l[ji(c)];function q(v){if(!v)return null;for(let[C,R]of[["server",l.server],["client",l.client]]){let z=Ye(R.root,v);if(z&&z.kind!=="server-container")return{key:C,node:z}}return null}function x(v){if(!v.controlId)return null;let C=v.controlAsset===ce?"client":v.controlAsset===Be?"server":null;if(C){let R=Ye(l[C].root,v.controlId);return R&&R.kind!=="server-container"?{key:C,node:R}:null}return q(v.controlId)}function O(){for(let v of m)v.controlId&&!x(v)&&(v.controlId="",v.controlAsset="")}function y(v){if(!Ut(v))return null;for(let[C,R]of[[Be,l.server],[ce,l.client]]){let z="";if(be(R.root,U=>{!z&&(U.scriptMappingIds||[]).includes(Number(v))&&(z=U.id)}),z)return{controlId:z,controlAsset:C}}return null}function P(v,C,R){let z=l[ji(v.controlAsset)],U=z&&Ye(z.root,v.controlId);U&&(U.scriptMappingIds=(U.scriptMappingIds||[]).map(ne=>Number(ne)===Number(C)?Number(R):ne))}O();function A(){return m.map(v=>{let C=x(v),R=C?C.key==="client"?ce:Be:"";return ie({id:v.id,guid:v.guid||0,path:v.path||"",source:v.source||"",controlId:v.controlId||"",controlAsset:v.controlAsset||R,controlName:C?.node.name||"",assetType:R,assetLabel:C?Rs[R]:"",mounted:!!C})})}function u(){let v=[],C=(R,z)=>{be(R.root,U=>{U.kind!=="server-container"&&v.push(ie({id:U.id,name:U.name,kind:U.kind,assetType:z,assetLabel:Rs[z]}))})};return C(l.server,Be),C(l.client,ce),v}function E(v){let C=[];return be(v.root,R=>{R.kind!=="server-container"&&C.push(JSON.stringify({kind:R.kind,guid:R.guid,name:R.name,text:R.text??null,imageId:R.imageId??null,imageSource:R.imageSource??null,imageType:R.imageType??null,fontSize:R.fontSize??null,adaptiveFontSize:R.adaptiveFontSize??null,minimumFontSize:R.minimumFontSize??null,fontColor:R.fontColor??null,bgColor:R.bgColor??null,imageColor:R.imageColor??null,fillType:R.fillType??null,fillAmount:R.fillAmount??null,syncAllDevices:R.syncAllDevices!==!1,transformByPlatform:R.transformByPlatform||null}))}),C.join("/")}let M=E(en()),j=E(Ai());function H(v){let C=E(v);return v.meta?.assetType===ce?C===M:C===j}function Z(v,C){return String(v||"").replace(/[\\/:*?"<>|]/g,"-").trim()||C}function ue(v){let C=Z(h(),Ui),R=v.meta?.assetType===ce?"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F":"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F";return`${C} \xB7 ${R}`}function we(){if(!((l.server.root.children||[]).find(C=>C.kind==="container")||l.server.root.children?.[0]))throw new Error("\u6574\u5408\u5305\u9700\u8981\u670D\u52A1\u7AEF\u5BA2\u6237\u7AEF\u63A7\u4EF6\u5BB9\u5668\u4E0B\u81F3\u5C11\u6709\u4E00\u4E2A\u6839\u63A7\u4EF6");return Vf(l.server,l.client,{scripts:m,fileName:`${Z(h(),Ui)} \xB7 \u6574\u5408\u5305.gia`})}function Se(){let v=C=>({type:C.meta.assetType,name:C.meta.name,sourceFile:C.meta.sourceFile||""});return{format:Yi,name:h(),activeAssetType:c,assets:{server:v(l.server),client:v(l.client),scripts:A()}}}function pe(){return ie({format:Yi,version:4,meta:{name:h()},activeAssetType:c,serverLogic:S,controlGuidChanges:o,scriptSync:a,assets:{server:l.server,client:l.client,scripts:m.map(v=>ie({id:v.id,guid:v.guid||0,path:v.path||"",source:v.source||"",controlId:v.controlId||"",controlAsset:v.controlAsset||""}))}})}function Q(){let v=Y(),C=Ya(v);if(C.workspace=Rp(n),C.save=Se(),C.scripts=A(),C.mountTargets=u(),C.serverLogic=S,C.migrationWarnings=[...i],C.controlGuidChanges=ie(o),c===ce){let R=mn(v,!0);C.clientGuidAutofill={count:R.length,templateCount:R.filter(({parent:z})=>z?.kind==="server-container").length,selectedOffset:R.findIndex(({node:z})=>z.id===C.selectedId)}}return C.scriptSync=ie(a),Hs(C),C}function fe(v){let C=Y();if(v.expectedRevision!==void 0&&Number(v.expectedRevision)!==C.version)throw new Error(`revision conflict: expected ${v.expectedRevision}, current ${C.version}`);return C}function _e(v,C,R=""){let z=String(C||"");if(z){let U=R===ce?ce:R===Be?Be:"";if(!x({controlId:z,controlAsset:U}))throw new Error("\u6302\u8F7D\u76EE\u6807\u5FC5\u987B\u662F\u5B58\u6863\u5185\u7684\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F");v.controlAsset=U}else v.controlAsset="";v.controlId=z}function yt(v){let C=fe(v);if(v.op==="addScript"){let R=w({path:String(v.path||""),source:String(v.source||""),controlId:"",controlAsset:""});v.controlId!==void 0&&v.controlId!==""&&_e(R,v.controlId,v.controlAsset),m.push(R)}else if(v.op==="updateScript"){let R=m.find(z=>z.id===v.id);if(!R)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${v.id}`);v.controlId!==void 0&&_e(R,v.controlId,v.controlAsset),v.path!==void 0&&(R.path=String(v.path)),v.source!==void 0&&(R.source=String(v.source))}else if(v.op==="removeScript"){let R=m.length;if(m=m.filter(z=>z.id!==v.id),m.length===R)throw new Error(`\u811A\u672C\u4E0D\u5B58\u5728: ${v.id}`)}return C.version+=1,Q()}function qt(v){let C=fe(v),R=Ye(C.root,v.id??C.selectedId);if(!R||R.kind==="server-container")throw new Error("\u4EC5\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6216\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u5141\u8BB8\u4FEE\u6539\u7D22\u5F15");let z=sd(v.guid);if(wo(R.guid),v.autoFillClientGuids!==void 0&&typeof v.autoFillClientGuids!="boolean")throw new Error("autoFillClientGuids \u5FC5\u987B\u662F\u5E03\u5C14\u503C");let U=v.autoFillClientGuids===!0;if(U&&c!==ce)throw new Error("\u81EA\u52A8\u586B\u5145\u4EC5\u652F\u6301\u5BA2\u6237\u7AEF\u6A21\u677F\u5217\u8868\uFF1B\u670D\u52A1\u7AEF\u754C\u9762\u7684\u7D22\u5F15\u9700\u5355\u72EC\u586B\u5199");let ne=U?mn(C,!0).map(({node:J})=>J):[R],ee=z-ne.indexOf(R),ge=ne.map((J,Me)=>({node:J,oldGuid:wo(J.guid),newGuid:sd(ee+Me)})),Ae=ge.filter(({oldGuid:J,newGuid:Me})=>J!==Me);if(!Ae.length)return Q();let st=new Map(ge.map(({oldGuid:J,newGuid:Me})=>[J,Me]));if(st.size!==ge.length)throw new Error("\u5BA2\u6237\u7AEF\u6A21\u677F\u5B58\u5728\u91CD\u590D\u65E7\u7D22\u5F15\uFF0C\u65E0\u6CD5\u81EA\u52A8\u586B\u5145\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49");let tt=new Set(ne),Tt=[];for(let J of Object.values(l))be(J.root,Me=>{J===l.client&&Me.kind==="server-container"||Tt.push({node:Me,project:J})});let it=new Map([...Tt.filter(J=>!tt.has(J.node)).map(({node:J})=>[Number(J.guid),J.name]),...m.map(J=>[Number(J.guid),J.path||"Lua \u811A\u672C"])]);for(let{newGuid:J}of Ae)if(it.has(J))throw new Error(`\u63A7\u4EF6\u7D22\u5F15 ${J} \u5DF2\u88AB\u300C${it.get(J)}\u300D\u5360\u7528\uFF1B\u8BF7\u5148\u586B\u5199\u5B83\u7684\u5B9E\u9645\u7D22\u5F15\u3002\u672C\u6B21\u672A\u4FEE\u6539\u4EFB\u4F55\u7D22\u5F15\u3002`);let Rt=[],Ne=(J,Me,Lt)=>{let vt=J?.[Me];(typeof vt=="number"||typeof vt=="string"&&/^\d+$/.test(vt.trim()))&&st.has(Number(vt))&&st.get(Number(vt))!==Number(vt)&&Rt.push({owner:J,key:Me,project:Lt.project,oldGuid:Number(vt),newGuid:st.get(Number(vt))})};for(let J of Tt)Ne(J.node,"referencedPrefabId",J),Ne(J.node,"itemPrefabId",J),Ne(J.node.giaRaw,"templateRefSlot",J);let qe=new Map;for(let{node:J}of Tt)qe.set(Number(J.guid),(qe.get(Number(J.guid))||0)+1);for(let{oldGuid:J}of Rt)if(qe.get(J)!==1)throw new Error(`\u65E7\u7D22\u5F15 ${J} \u5728\u591A\u68F5\u8D44\u4EA7\u6811\u4E2D\u91CD\u590D\uFF0C\u65E0\u6CD5\u786E\u5B9A\u6A21\u677F\u5F15\u7528\u5F52\u5C5E\uFF1B\u8BF7\u5148\u6D88\u9664\u6B67\u4E49\u540E\u4FEE\u6539`);let _n=U?rd():"",Je=id(m);for(let{node:J,oldGuid:Me,newGuid:Lt}of Ae)J.guid=Lt,o.push({id:rd(),controlAsset:c,controlId:J.id,controlName:J.name,oldGuid:Me,newGuid:Lt,scriptSignature:Je,..._n?{batchId:_n}:{}});let sr=new Set([C]);for(let{owner:J,key:Me,project:Lt,newGuid:vt}of Rt)J[Me]=typeof J[Me]=="string"?String(vt):vt,sr.add(Lt);for(let J of sr)J.version+=1;return Q()}function Re(v){let C=fe(v);if(!Array.isArray(v.changeIds)||!v.changeIds.length||v.changeIds.some(z=>typeof z!="string"||!o.some(U=>U.id===z)))throw new Error("\u8BF7\u660E\u786E\u6307\u5B9A\u5DF2\u6838\u5BF9 Lua \u5F15\u7528\u7684\u6709\u6548\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55 changeIds");let R=new Set(v.changeIds);return o=o.filter(z=>!R.has(z.id)),C.version+=1,Q()}function ft(v){if(!v||typeof v!="object")throw new Error("patch requires op");if(v.op==="setScriptSync"){let C=fe(v);return a=Eo(v.config),C.version+=1,Q()}if(v.op==="setControlGuid")return qt(v);if(v.op==="acknowledgeControlGuidChanges")return Re(v);if(v.op==="setServerLogic"){let C=fe(v);return S=Qn(v.logic),C.version+=1,Q()}if(v.op==="addScript"||v.op==="updateScript"||v.op==="removeScript")return yt(v);if(v.op==="selectAsset")return c=v.assetType===ce?ce:Be,Q();if(v.op==="renameSave"){let C=String(v.name||"").trim();if(!C)throw new Error("\u5B58\u6863\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");return f=C,Q()}if(v.op==="newAsset"){let C=fe(v);c=v.assetType===ce?ce:Be;let R=Ps(c);return R.version=C.version+1,l[ji(c)]=R,o=o.filter(z=>z.controlAsset!==c),O(),Q()}return Ha(Y(),v),O(),Q()}function ut(v){return m.filter(C=>{let R=x(C);return!!(R&&R.key==="client"==(v===ce))})}function me(){return ie({assetType:ce,revision:l.client.version,rows:Ts(l.client,ut(ce))})}function T(v={}){if(v.expectedRevision!==void 0&&v.expectedRevision!==l.client.version)throw new Error("revision conflict: reload export choices");let C=m.filter(z=>!z.controlId||x(z)?.key==="client"),R=nd(l.client,C,v);if(v.canvasId){if(!Pe[v.canvasId])throw new Error(`unknown canvas preset: ${v.canvasId}`);R.project.canvasId=v.canvasId}return R}function k(v={}){let C=T(v);return ie({snapshot:Ya(C.project),selection:C.selection,warnings:C.warnings})}function N(v="json",C="",R={}){let z=F(v,C,R);if(o.length&&!["save","archive"].includes(String(v).toLowerCase())){let U=o.map(ne=>`\u63A7\u4EF6\u7D22\u5F15\u5F85\u6838\u5BF9 Lua \u5F15\u7528\uFF1A${Rs[ne.controlAsset]} / ${ne.controlName} (${ne.controlId})\uFF1A${ne.oldGuid} \u2192 ${ne.newGuid}\u3002\u8BF7\u6309\u8BED\u4E49\u66F4\u65B0\u811A\u672C\u4E2D\u7684\u63A7\u4EF6\u7D22\u5F15\u5F15\u7528\uFF0C\u6838\u5BF9\u540E\u786E\u8BA4\u53D8\u66F4\u8BB0\u5F55 ${ne.id}\uFF1B\u4E0D\u8981\u5168\u5C40\u66FF\u6362\u540C\u503C\u6570\u5B57\u3002`);z.warnings=[...new Set([...z.warnings||[],...U])]}return z}function F(v="json",C="",R={}){let z=String(v).toLowerCase();if(z==="gia-partial"){let ee=T(R),ge=$a(ee.project,{scripts:ee.scripts,includeScriptMappings:!0}),Ae=ee.selection.templateCount===1?ee.project.root.children[0].name:"\u90E8\u5206\u7EC4\u5408";return ie({filename:`${Z(h(),Ui)} \xB7 ${Z(Ae,"\u90E8\u5206\u7EC4\u5408")}.gia`,mimeType:"application/octet-stream",encoding:"base64",data:ge.buffer.toString("base64"),selection:ee.selection,warnings:[...new Set([...ee.warnings,...ge.warnings])]})}if(z==="save"||z==="archive"){let ee=Buffer.from(JSON.stringify(pe(),null,2),"utf8");return ie({filename:`${h().replace(/[\\/:*?"<>|]/g,"-")} \xB7 \u8D44\u4EA7\u5305.json`,mimeType:"application/json",encoding:"base64",data:ee.toString("base64"),warnings:[]})}if(z==="save-gia"||z==="archive-gia"){let ee=[],ge=[],Ae=(tt,Tt="")=>{let it=N(tt,Tt);ee.push(ie({filename:it.filename,mimeType:it.mimeType,encoding:it.encoding,data:it.data,warnings:it.warnings||[]})),ge.push(...it.warnings||[])},st=(tt,Tt)=>{let it=l[ji(tt)],Rt=tt===c,Ne=m.some(qe=>qe.controlAsset===tt&&qe.controlId);if(!Rt&&H(it)&&!Ne){ge.push(Tt);return}Ae("gia",tt)};if(st(Be,"\u670D\u52A1\u5668\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u6A71\u7A97\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),st(ce,"\u5BA2\u6237\u7AEF\u63A7\u4EF6\u6A21\u677F\u4ECD\u662F\u9ED8\u8BA4\u300CLua\u5B9E\u4F8B\u5316\u9762\u677F\u300D\uFF0C\u672A\u6539\u52A8\u4E14\u5F53\u524D\u672A\u663E\u793A\uFF0C\u5DF2\u4ECE\u8D44\u4EA7\u5305 GIA \u4E2D\u7701\u7565\u3002"),m.some(tt=>tt.path||tt.source)&&Ae("scripts-gia"),!ee.length)throw new Error("\u8D44\u4EA7\u5305 GIA \u6CA1\u6709\u53EF\u5BFC\u51FA\u7684\u5DF2\u6539\u52A8\u9879\uFF1B\u8BF7\u5148\u7F16\u8F91\u5F53\u524D\u754C\u9762\uFF0C\u6216\u6539\u7528\u300C\u5F53\u524D\u754C\u9762 GIA\u300D\u3002");return ie({format:"qxqy-gia-package",files:ee,warnings:[...new Set(ge)]})}if(z==="gia-combined"||z==="combined-gia"||z==="combined"){let ee=we();return ie({filename:`${Z(h(),Ui)} \xB7 \u6574\u5408\u5305.gia`,mimeType:"application/octet-stream",encoding:"base64",data:ee.buffer.toString("base64"),warnings:[...new Set(ee.warnings||[])]})}if(z==="scripts"){let ee=ie({format:Ip,version:1,scripts:m.map(Ae=>ie({id:Ae.id,guid:Ae.guid||0,path:Ae.path||"",source:Ae.source||"",controlId:Ae.controlId||"",controlAsset:Ae.controlAsset||""}))}),ge=Buffer.from(JSON.stringify(ee,null,2),"utf8");return ie({filename:`${Z(h(),Ui)} \xB7 \u811A\u672C.json`,mimeType:"application/json",encoding:"base64",data:ge.toString("base64"),warnings:[]})}if(z==="scripts-gia"||z==="scriptsgia"){let ee=Lf(m);return ie({filename:`${Z(h(),Ui)} \xB7 \u811A\u672C.gia`,mimeType:"application/octet-stream",encoding:"base64",data:ee.buffer.toString("base64"),warnings:ee.warnings})}if(z==="lua"){let ee=m.find(Ae=>Ae.id===C)||m.find(Ae=>Ae.path===C);if(!ee)throw new Error("\u6CA1\u6709\u53EF\u5BFC\u51FA\u7684 Lua \u811A\u672C\uFF0C\u8BF7\u5148\u5728\u201CLua \u811A\u672C\u201D\u9875\u521B\u5EFA");let ge=En(ee.path||"")||`qxqy-script-${ee.id}`;return ie({filename:/\.lua$/i.test(ge)?ge:`${ge}.lua`,mimeType:"text/x-lua",encoding:"base64",data:Buffer.from(ee.source||"","utf8").toString("base64"),warnings:[]})}let U=C?l[ji(C)]:Y(),ne=ue(U);if(z==="json"){let ee=ie({...U,scripts:ut(U.meta.assetType),controlGuidChanges:o.filter(Ae=>Ae.controlAsset===U.meta.assetType)}),ge=Buffer.from(JSON.stringify(ee,null,2),"utf8");return ie({filename:`${ne}.json`,mimeType:"application/json",encoding:"base64",data:ge.toString("base64"),warnings:[]})}if(z==="gia"){let ee=$a(U,U.meta.assetType===ce?{scripts:ut(ce)}:{}),ge=U.meta.assetType===ce?[]:ut(Be);return ge.length&&ee.warnings.unshift(`\u5F53\u524D\u670D\u52A1\u5668\u63A7\u4EF6 GIA \u4E0D\u5305\u542B ${ge.length} \u4E2A Lua \u811A\u672C\u7684\u6E90\u7801\uFF1B\u8BF7\u4F7F\u7528\u300C\u8D44\u4EA7\u5305 GIA \u6574\u5408\u5305\u300D\uFF0C\u6216\u53E6\u884C\u5BFC\u5165\u811A\u672C\u5305\u5E76\u6838\u5BF9\u6302\u8F7D\u3002`),ie({filename:`${ne}.gia`,mimeType:"application/octet-stream",encoding:"base64",data:ee.buffer.toString("base64"),warnings:ee.warnings})}throw new Error(`unsupported export format: ${v}`)}function L(v){for(let C of v){let R=So(C);if(!R.path&&!R.source)continue;let z=R.controlId?null:y(R.guid),U=w(z?{...R,...z}:R);z&&U.guid!==R.guid&&P(z,R.guid,U.guid),U.controlId&&!x(U)&&(U.controlId="",U.controlAsset=""),m.push(U)}}function W(v,C,R=""){let z=String(v||"").toLowerCase();if(typeof C!="string"||!C)throw new Error("import data is required");let U=Buffer.from(C,"base64"),ne,ee=[],ge={},Ae=[];if(z==="json"){try{ne=JSON.parse(U.toString("utf8"))}catch{throw new Error("JSON \u6587\u4EF6\u65E0\u6548")}if(ne?.project&&(ne=ne.project),ne?.format===Yi&&ne?.assets){La(ne.version);let Ne=Fs(ne);ee.push(...Ne.get().migrationWarnings);let qe=Ne.archiveData();return l.server=qe.assets.server,l.client=qe.assets.client,i=[...ee],c=ne.activeAssetType===ce?ce:Be,f=String(ne.meta?.name||En(R).replace(/\.json$/i,"")||f),S=qe.serverLogic,m=qe.assets.scripts,o=qe.controlGuidChanges,a=qe.scriptSync,p.clear(),ie({snapshot:Q(),warnings:ee,metadata:{format:Yi}})}}else{if(z==="lua")return m.push(w({path:En(R||"imported.lua"),source:U.toString("utf8"),controlId:""})),ie({snapshot:Q(),warnings:ee,metadata:{assetType:"lua-script"}});if(z==="gia"){if(jf(U)){let Je=Yf(U);return L(Je.scripts),ie({snapshot:Q(),warnings:Je.warnings,metadata:Je.metadata})}let Ne=Hf(U);ne=Ne.project,ee=Ne.warnings,ge=Ne.metadata,Ne.clientProject&&(l.client=vi(Ne.clientProject),o=o.filter(Je=>Je.controlAsset!==ce),ee.push("\u6574\u5408\u5305\u5DF2\u62C6\u56DE\u300CUI\u63A7\u4EF6-\u670D\u52A1\u7AEF\u300D\u4E0E\u300CUI\u63A7\u4EF6-\u5BA2\u6237\u7AEF\u300D\uFF1B\u5BA2\u6237\u7AEF\u6A21\u677F\u8FB9\u754C\u5DF2\u4FDD\u7559\u3002"));let qe=new Map,_n=(Je,sr)=>{Je&&be(Je.root,J=>{for(let Me of J.scriptMappingIds||[]){let Lt=qe.get(Number(Me));if(Lt){ee.push(`\u811A\u672C GUID ${Me} \u540C\u65F6\u6302\u8F7D\u5230\u591A\u4E2A\u63A7\u4EF6\uFF0C\u5DF2\u4FDD\u7559\u201C${Lt.controlAsset===Be?"\u670D\u52A1\u7AEF":"\u5BA2\u6237\u7AEF"}\u201D\u76EE\u6807\u3002`);continue}qe.set(Number(Me),{controlId:J.id,controlAsset:sr})}})};_n(Ne.project,Ne.project.meta.assetType),_n(Ne.clientProject,ce),Ae=(Ne.scripts||[]).map(Je=>qe.has(Number(Je.guid))?{...Je,...qe.get(Number(Je.guid))}:Je)}else throw new Error(`unsupported import format: ${v}`)}let st=vi(ne,{warnings:ee}),tt=Ns(ne?.controlGuidChanges);if(tt.some(Ne=>Ne.controlAsset!==st.meta.assetType))throw new Error("\u5355\u8D44\u4EA7 JSON \u7684\u7D22\u5F15\u53D8\u66F4\u8BB0\u5F55\u5FC5\u987B\u5C5E\u4E8E\u5F53\u524D\u5BFC\u5165\u8D44\u4EA7");let Tt=Ns([...o.filter(Ne=>Ne.controlAsset!==st.meta.assetType),...tt]);i=[...ee];let it=ji(st.meta.assetType);l[it]=st,o=Tt,c=st.meta.assetType;let Rt=l[it];return R&&(Rt.meta.name=En(R).replace(/\.(json|gia)$/i,"")||Rt.meta.name,Rt.meta.sourceFile=En(R),Rt.meta.sourceFormat=z),L(Ae),L(ne?.scripts||[]),ne?.script&&(ne.script.path||ne.script.source)&&L([ne.script]),ie({snapshot:Q(),warnings:ee,metadata:ge})}function ae(v,C){return Ha(Y(),{op:"pick",x:v,y:C}),Q()}function re(v){let C=typeof v=="string"&&v?v:"";!C||C===n||(n=C)}function de(v){let C=v.source||"";if(!C.trim()&&v.path.trim())try{C=wp(Np(v.path,n),"utf8")}catch(R){throw new Error(`\u811A\u672C ${v.path} \u8BFB\u53D6\u5931\u8D25: ${R?.message||R}`)}return C}function Oe(v={}){let C=V(v.canvasId);C&&(G=C),v.playerCount!==void 0&&v.playerCount!==null&&v.playerCount!==""&&(I=Vi(v.playerCount),$>I&&($=1)),v.viewPlayerIndex!==void 0&&v.viewPlayerIndex!==null&&v.viewPlayerIndex!==""&&($=ei(v.viewPlayerIndex,I)),_&&Is(_);let R=m.map(U=>{try{return{id:U.id,guid:U.guid||0,path:U.path||U.id,source:de(U),controlId:U.controlId||"",controlAsset:U.controlAsset||""}}catch(ne){return{id:U.id,guid:U.guid||0,path:U.path||U.id,source:`error([==[ ${String(ne.message).replace(/]=+]/g,"] =]")} ])`,controlId:U.controlId||"",controlAsset:U.controlAsset||""}}}),z=U=>R.filter(ne=>{let ee={controlId:ne.controlId,controlAsset:ne.controlAsset},ge=ne.controlId?x(ee):null;return!!(ge&&ge.key===U)});return _=ju(l.server,{templatesProject:l.client,scripts:R,sceneScripts:z("server"),templateScripts:z("client"),serverConfig:{logic:S},canvasId:G,playerCount:I,viewPlayerIndex:$,language:v.language||""}),Ee(v)}function Fe(v,C={}){let R=V(v);if(!R)throw new Error("playSetCanvas requires canvasId");return Oe({...C,canvasId:R})}function Ee(v={}){if(!_)return ie({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]});let C=vs(_,v);return C.running=!0,C.logs=Os(C.logs),C.serverLogs=Os(C.server?.logs||[]),C.serverVars=_p(C.server,C.playerCount||1),C}function cd(v,C={}){return _||Oe(),yo(_,v),C.observe===!1?ie({running:!0,time:_.runtime.clock.time,frame:_.runtime.clock.frame,paused:!!_.debugPaused,levelTimePaused:!!_.runtime.clock.paused,playerCount:_.playerCount||1,viewPlayerIndex:_.viewPlayerIndex||1}):Ee(C)}function fd(v=0){Oe();let C=Math.max(0,Number(v)||0);for(let R=0;R<C;R++)yo(_,1/30);return Ee()}function ud(){return _&&Is(_),_=null,G="",I=1,$=1,ie({running:!1,tree:[],logs:[],serverLogs:[],serverVars:[]})}function dd(v,C={}){let R=xn();return $=gs(R,v),C.observe===!1?null:Ee(C)}function hd(v,C={}){if(!_)throw new Error("play session has not started");return ws(_,v),C.observe===!1?null:Ee(C)}function pd(v,C={}){if(!_)throw new Error("play session has not started");return Ss(_,v),C.observe===!1?null:Ee(C)}function md(v,C,R,z={}){if(!_)throw new Error("play session has not started");return ir(_,v,C,R,z),z.observe===!1?null:Ee(z)}function bd(v={}){return _&&vo(_).pause(),v.observe===!1?null:Ee(v)}function gd(v={}){return _&&vo(_).resume(),v.observe===!1?null:Ee(v)}function xn(){if(!_)throw new Error("play session has not started");return _}function yd(v,C){let R=xn();if(!v&&!C){let z=Ee();return ie({vars:z.serverVars||[]})}return ie({entityType:String(v||""),name:String(C||""),value:Zu(R,v,C)})}function vd(v,C,R){let z=xn();return xs(z,v,C,R),Ee()}function wd(v,C=[],R="PlayerSelf"){let z=xn();return _s(z,v,C,R),Ee()}function Sd(){let v=Ee();return ie({events:v.history||[],case:Pu(v.history||[],{playerCount:v.playerCount||1})})}function Ed(v={}){let C=Ee(),R=er({name:v.name||"",dt:v.dt,playerCount:v.playerCount||C.playerCount||1,events:v.events||C.history||[],asserts:v.asserts||[]});return ie(R)}function xd(v,C={}){let R=er(v);Oe({...C,playerCount:C.playerCount||R.playerCount||1});let z=xn();z.recording=!1;try{return td(vo(z),v)}finally{z.recording=!0}}function _d(){if(!_)return{running:!1,paused:!1,time:0,frame:0,playerCount:1,viewPlayerIndex:1};let v=_.runtime.clock;return{running:!0,paused:!!_.debugPaused,levelTimePaused:!!v.paused,time:v.time,frame:v.frame,playerCount:_.playerCount||1,viewPlayerIndex:_.viewPlayerIndex||1}}let $s={get:Q,patch:ft,setWorkspace:re,exportData:N,exportChoices:me,exportPreview:k,importData:W,pick:ae,playStart:Oe,playSetCanvas:Fe,playSetView:dd,playGet:Ee,playStatus:_d,playStep:cd,playRun:fd,playStop:ud,playKey:hd,playClick:pd,playPointer:md,playPause:bd,playResume:gd,playServerGet:yd,playServerSet:vd,playServerSend:wd,playHistory:Sd,playSaveCase:Ed,playRunCase:xd,archiveData:pe};return Object.defineProperty($s,"_project",{enumerable:!1,get:Y}),$s}var ve=null,zs=!1,ti=0,Bt=0,Ds="realtime",ld=!1,Pp=33,or=1/30,Fp=5;function ar(t={}){return{...t.inspect?{inspect:!0}:{},...t.view?{view:!0}:{},...t.paint?{paint:!0}:{},...t.compact?{compact:!0}:{},...t.sceneRev!==void 0&&t.sceneRev!==null?{sceneRev:t.sceneRev}:{}}}function Mp(t={}){let e=ar(t);for(let i of["canvasId","playerCount","viewPlayerIndex","language"])t[i]!==void 0&&t[i]!==null&&t[i]!==""&&(e[i]=t[i]);return e}function Ei(t={}){return t.light?{...ve.playStatus()}:ve.playGet(ar(t))}function zp(){if(!ve||zs||Ds!=="realtime")return;let t=ve.playStatus();if(!t.running||t.paused){ti=0,Bt=0;return}let e=Date.now();if(!ti){ti=e;return}zs=!0;try{Bt+=Math.min(.25,Math.max(0,(e-ti)/1e3)),ti=e;let i=0;for(;Bt>=or&&i<Fp;)ve.playStep(or,{observe:!1}),Bt-=or,i+=1;Bt>or&&(Bt=or)}finally{zs=!1}}var Xg=setInterval(zp,Pp);function Dp(t,e={}){if(t==="start"){let i=e.clockMode??"realtime";if(i!=="manual"&&i!=="realtime")throw new Error("clockMode must be manual or realtime");return ve&&ve.playStop(),ve=Fs(e.archive||e.project,{workspacePath:e.workspacePath||""}),Ds=i,ld=e.muteAudio===!0,ti=0,Bt=0,ve.playStart(Mp(e))}if(!ve)throw new Error("play session has not started");if(t==="get")return e.light?Ei(e):ve.playGet(ar(e));if(t==="step"){let i=ve.playStep(e.dt,e.light?{observe:!1}:ar(e));return e.light?Ei(e):i}if(t==="pointer")return ve.playPointer(e.type,e.x,e.y,{observe:!1,deltaX:e.deltaX,deltaY:e.deltaY}),Ei(e);if(t==="key")return ve.playKey(e.key,{observe:!1}),Ei(e);if(t==="click")return ve.playClick(e.name,{observe:!1}),Ei(e);if(t==="pause")return ve.playPause({observe:!1}),ti=0,Bt=0,Ei(e);if(t==="resume")return ve.playResume({observe:!1}),ti=0,Bt=0,Ei(e);if(t==="device")return ve.playSetCanvas(e.canvasId,ar(e));if(t==="view")return ve.playSetView(e.playerIndex??e.viewPlayerIndex,{observe:!1}),Ei(e);if(t==="serverGet")return ve.playServerGet(e.entityType,e.name);if(t==="serverSet")return ve.playServerSet(e.entityType,e.name,e.value);if(t==="serverSend")return ve.playServerSend(e.name,e.params||[],e.target||"PlayerSelf");if(t==="history")return ve.playHistory();if(t==="saveCase")return ve.playSaveCase(e.case||e);if(t==="runCase")return ve.playRunCase(e.case||e,{canvasId:e.canvasId,playerCount:e.playerCount,viewPlayerIndex:e.viewPlayerIndex});if(t==="stop"){let i=ve.playStop();return ve=null,ti=0,Bt=0,i}throw new Error(`unknown play action: ${t}`)}Ms.on("message",t=>{let{id:e,action:i,args:n={}}=t||{};try{let r=Dp(i,n),o=typeof r?.running=="boolean"?{...r,clockMode:Ds,audioMuted:ld}:r;Ms.postMessage({id:e,ok:!0,value:o,error:null})}catch(r){Ms.postMessage({id:e,ok:!1,value:null,error:r?.message||String(r)})}});
121
124
  /*! Bundled license information:
122
125
 
123
126
  long/umd/index.js: