@wwawing/all 3.9.2 → 3.9.3
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.
|
@@ -18,4 +18,4 @@ s.mode.CTRGladman=function(){var t=s.lib.BlockCipherMode.extend();function e(t){
|
|
|
18
18
|
|
|
19
19
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
20
20
|
*/
|
|
21
|
-
function(t){var e=s,a=e.lib,i=a.WordArray,r=a.Hasher,o=e.algo,n=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),_=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),h=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=r.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=0;a<16;a++){var s=e+a,i=t[s];t[s]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var r,o,p,g,A,S,I,v,T,O,D,C=this._hash.words,M=u.words,N=l.words,P=n.words,b=_.words,R=c.words,L=h.words;for(S=r=C[0],I=o=C[1],v=p=C[2],T=g=C[3],O=A=C[4],a=0;a<80;a+=1)D=r+t[e+P[a]]|0,D+=a<16?d(o,p,g)+M[0]:a<32?E(o,p,g)+M[1]:a<48?f(o,p,g)+M[2]:a<64?y(o,p,g)+M[3]:w(o,p,g)+M[4],D=(D=m(D|=0,R[a]))+A|0,r=A,A=g,g=m(p,10),p=o,o=D,D=S+t[e+b[a]]|0,D+=a<16?w(I,v,T)+N[0]:a<32?y(I,v,T)+N[1]:a<48?f(I,v,T)+N[2]:a<64?E(I,v,T)+N[3]:d(I,v,T)+N[4],D=(D=m(D|=0,L[a]))+O|0,S=O,O=T,T=m(v,10),v=I,I=D;D=C[1]+p+T|0,C[1]=C[2]+g+O|0,C[2]=C[3]+A+S|0,C[3]=C[4]+r+I|0,C[4]=C[0]+o+v|0,C[0]=D},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,s=8*t.sigBytes;e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,r=i.words,o=0;o<5;o++){var n=r[o];r[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return i},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,a){return t^e^a}function E(t,e,a){return t&e|~t&a}function f(t,e,a){return(t|~e)^a}function y(t,e,a){return t&a|e&~a}function w(t,e,a){return t^(e|~a)}function m(t,e){return t<<e|t>>>32-e}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),s.RIPEMD160)},637:function(t,e,a){var s,i,r,o,n,_,c,h;t.exports=(h=a(359),i=(s=h).lib,r=i.WordArray,o=i.Hasher,n=s.algo,_=[],c=n.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=this._hash.words,s=a[0],i=a[1],r=a[2],o=a[3],n=a[4],c=0;c<80;c++){if(c<16)_[c]=0|t[e+c];else{var h=_[c-3]^_[c-8]^_[c-14]^_[c-16];_[c]=h<<1|h>>>31}var u=(s<<5|s>>>27)+n+_[c];u+=c<20?1518500249+(i&r|~i&o):c<40?1859775393+(i^r^o):c<60?(i&r|i&o|r&o)-1894007588:(i^r^o)-899497514,n=o,o=r,r=i<<30|i>>>2,i=s,s=u}a[0]=a[0]+s|0,a[1]=a[1]+i|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(a/4294967296),e[15+(s+64>>>9<<4)]=a,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),s.SHA1=o._createHelper(c),s.HmacSHA1=o._createHmacHelper(c),h.SHA1)},640:function(t,e,a){var s,i,r,o,n,_;t.exports=(_=a(359),a(93),i=(s=_).lib.WordArray,r=s.algo,o=r.SHA256,n=r.SHA224=o.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=4,t}}),s.SHA224=o._createHelper(n),s.HmacSHA224=o._createHmacHelper(n),_.SHA224)},93:function(t,e,a){var s;t.exports=(s=a(359),function(t){var e=s,a=e.lib,i=a.WordArray,r=a.Hasher,o=e.algo,n=[],_=[];!function(){function e(e){for(var a=t.sqrt(e),s=2;s<=a;s++)if(!(e%s))return!1;return!0}function a(t){return 4294967296*(t-(0|t))|0}for(var s=2,i=0;i<64;)e(s)&&(i<8&&(n[i]=a(t.pow(s,.5))),_[i]=a(t.pow(s,1/3)),i++),s++}();var c=[],h=o.SHA256=r.extend({_doReset:function(){this._hash=new i.init(n.slice(0))},_doProcessBlock:function(t,e){for(var a=this._hash.words,s=a[0],i=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var d=c[p-15],E=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,f=c[p-2],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=E+c[p-7]+y+c[p-16]}var w=s&i^s&r^i&r,m=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),g=l+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&h^~n&u)+_[p]+c[p];l=u,u=h,h=n,n=o+g|0,o=r,r=i,i=s,s=g+(m+w)|0}a[0]=a[0]+s|0,a[1]=a[1]+i|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0,a[5]=a[5]+h|0,a[6]=a[6]+u|0,a[7]=a[7]+l|0},_doFinalize:function(){var e=this._data,a=e.words,s=8*this._nDataBytes,i=8*e.sigBytes;return a[i>>>5]|=128<<24-i%32,a[14+(i+64>>>9<<4)]=t.floor(s/4294967296),a[15+(i+64>>>9<<4)]=s,e.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(h),e.HmacSHA256=r._createHmacHelper(h)}(Math),s.SHA256)},140:function(t,e,a){var s;t.exports=(s=a(359),a(467),function(t){var e=s,a=e.lib,i=a.WordArray,r=a.Hasher,o=e.x64.Word,n=e.algo,_=[],c=[],h=[];!function(){for(var t=1,e=0,a=0;a<24;a++){_[t+5*e]=(a+1)*(a+2)/2%64;var s=(2*t+3*e)%5;t=e%5,e=s}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,r=0;r<24;r++){for(var n=0,u=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?u^=1<<p:n^=1<<p-32}128&i?i=i<<1^113:i<<=1}h[r]=o.create(n,u)}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=o.create()}();var l=n.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var a=this._state,s=this.blockSize/2,i=0;i<s;i++){var r=t[e+2*i],o=t[e+2*i+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(C=a[i]).high^=o,C.low^=r}for(var n=0;n<24;n++){for(var l=0;l<5;l++){for(var p=0,d=0,E=0;E<5;E++)p^=(C=a[l+5*E]).high,d^=C.low;var f=u[l];f.high=p,f.low=d}for(l=0;l<5;l++){var y=u[(l+4)%5],w=u[(l+1)%5],m=w.high,g=w.low;for(p=y.high^(m<<1|g>>>31),d=y.low^(g<<1|m>>>31),E=0;E<5;E++)(C=a[l+5*E]).high^=p,C.low^=d}for(var A=1;A<25;A++){var S=(C=a[A]).high,I=C.low,v=_[A];v<32?(p=S<<v|I>>>32-v,d=I<<v|S>>>32-v):(p=I<<v-32|S>>>64-v,d=S<<v-32|I>>>64-v);var T=u[c[A]];T.high=p,T.low=d}var O=u[0],D=a[0];for(O.high=D.high,O.low=D.low,l=0;l<5;l++)for(E=0;E<5;E++){var C=a[A=l+5*E],M=u[A],N=u[(l+1)%5+5*E],P=u[(l+2)%5+5*E];C.high=M.high^~N.high&P.high,C.low=M.low^~N.low&P.low}C=a[0];var b=h[n];C.high^=b.high,C.low^=b.low}},_doFinalize:function(){var e=this._data,a=e.words,s=(this._nDataBytes,8*e.sigBytes),r=32*this.blockSize;a[s>>>5]|=1<<24-s%32,a[(t.ceil((s+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*a.length,this._process();for(var o=this._state,n=this.cfg.outputLength/8,_=n/8,c=[],h=0;h<_;h++){var u=o[h],l=u.high,p=u.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new i.init(c,n)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),a=0;a<25;a++)e[a]=e[a].clone();return t}});e.SHA3=r._createHelper(l),e.HmacSHA3=r._createHmacHelper(l)}(Math),s.SHA3)},716:function(t,e,a){var s,i,r,o,n,_,c,h;t.exports=(h=a(359),a(467),a(834),i=(s=h).x64,r=i.Word,o=i.WordArray,n=s.algo,_=n.SHA512,c=n.SHA384=_.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=_._doFinalize.call(this);return t.sigBytes-=16,t}}),s.SHA384=_._createHelper(c),s.HmacSHA384=_._createHmacHelper(c),h.SHA384)},834:function(t,e,a){var s;t.exports=(s=a(359),a(467),function(){var t=s,e=t.lib.Hasher,a=t.x64,i=a.Word,r=a.WordArray,o=t.algo;function n(){return i.create.apply(i,arguments)}var _=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=n()}();var h=o.SHA512=e.extend({_doReset:function(){this._hash=new r.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var a=this._hash.words,s=a[0],i=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=s.high,d=s.low,E=i.high,f=i.low,y=r.high,w=r.low,m=o.high,g=o.low,A=n.high,S=n.low,I=h.high,v=h.low,T=u.high,O=u.low,D=l.high,C=l.low,M=p,N=d,P=E,b=f,R=y,L=w,x=m,B=g,U=A,W=S,Y=I,k=v,F=T,G=O,V=D,H=C,K=0;K<80;K++){var j,X,J=c[K];if(K<16)X=J.high=0|t[e+2*K],j=J.low=0|t[e+2*K+1];else{var Z=c[K-15],Q=Z.high,q=Z.low,z=(Q>>>1|q<<31)^(Q>>>8|q<<24)^Q>>>7,$=(q>>>1|Q<<31)^(q>>>8|Q<<24)^(q>>>7|Q<<25),tt=c[K-2],et=tt.high,at=tt.low,st=(et>>>19|at<<13)^(et<<3|at>>>29)^et>>>6,it=(at>>>19|et<<13)^(at<<3|et>>>29)^(at>>>6|et<<26),rt=c[K-7],ot=rt.high,nt=rt.low,_t=c[K-16],ct=_t.high,ht=_t.low;X=(X=(X=z+ot+((j=$+nt)>>>0<$>>>0?1:0))+st+((j+=it)>>>0<it>>>0?1:0))+ct+((j+=ht)>>>0<ht>>>0?1:0),J.high=X,J.low=j}var ut,lt=U&Y^~U&F,pt=W&k^~W&G,dt=M&P^M&R^P&R,Et=N&b^N&L^b&L,ft=(M>>>28|N<<4)^(M<<30|N>>>2)^(M<<25|N>>>7),yt=(N>>>28|M<<4)^(N<<30|M>>>2)^(N<<25|M>>>7),wt=(U>>>14|W<<18)^(U>>>18|W<<14)^(U<<23|W>>>9),mt=(W>>>14|U<<18)^(W>>>18|U<<14)^(W<<23|U>>>9),gt=_[K],At=gt.high,St=gt.low,It=V+wt+((ut=H+mt)>>>0<H>>>0?1:0),vt=yt+Et;V=F,H=G,F=Y,G=k,Y=U,k=W,U=x+(It=(It=(It=It+lt+((ut+=pt)>>>0<pt>>>0?1:0))+At+((ut+=St)>>>0<St>>>0?1:0))+X+((ut+=j)>>>0<j>>>0?1:0))+((W=B+ut|0)>>>0<B>>>0?1:0)|0,x=R,B=L,R=P,L=b,P=M,b=N,M=It+(ft+dt+(vt>>>0<yt>>>0?1:0))+((N=ut+vt|0)>>>0<ut>>>0?1:0)|0}d=s.low=d+N,s.high=p+M+(d>>>0<N>>>0?1:0),f=i.low=f+b,i.high=E+P+(f>>>0<b>>>0?1:0),w=r.low=w+L,r.high=y+R+(w>>>0<L>>>0?1:0),g=o.low=g+B,o.high=m+x+(g>>>0<B>>>0?1:0),S=n.low=S+W,n.high=A+U+(S>>>0<W>>>0?1:0),v=h.low=v+k,h.high=I+Y+(v>>>0<k>>>0?1:0),O=u.low=O+G,u.high=T+F+(O>>>0<G>>>0?1:0),C=l.low=C+H,l.high=D+V+(C>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[30+(s+128>>>10<<5)]=Math.floor(a/4294967296),e[31+(s+128>>>10<<5)]=a,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(h),t.HmacSHA512=e._createHmacHelper(h)}(),s.SHA512)},567:function(t,e,a){var s;t.exports=(s=a(359),a(139),a(174),a(844),a(951),function(){var t=s,e=t.lib,a=e.WordArray,i=e.BlockCipher,r=t.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=r.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],a=0;a<56;a++){var s=o[a]-1;e[a]=t[s>>>5]>>>31-s%32&1}for(var i=this._subKeys=[],r=0;r<16;r++){var c=i[r]=[],h=_[r];for(a=0;a<24;a++)c[a/6|0]|=e[(n[a]-1+h)%28]<<31-a%6,c[4+(a/6|0)]|=e[28+(n[a+24]-1+h)%28]<<31-a%6;for(c[0]=c[0]<<1|c[0]>>>31,a=1;a<7;a++)c[a]=c[a]>>>4*(a-1)+3;c[7]=c[7]<<5|c[7]>>>27}var u=this._invSubKeys=[];for(a=0;a<16;a++)u[a]=i[15-a]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,a){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var s=0;s<16;s++){for(var i=a[s],r=this._lBlock,o=this._rBlock,n=0,_=0;_<8;_++)n|=c[_][((o^i[_])&h[_])>>>0];this._lBlock=o,this._rBlock=r^n}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var a=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=a,this._lBlock^=a<<t}function p(t,e){var a=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=a,this._rBlock^=a<<t}t.DES=i._createHelper(u);var d=r.TripleDES=i.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),s=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=u.createEncryptor(a.create(e)),this._des2=u.createEncryptor(a.create(s)),this._des3=u.createEncryptor(a.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),s.TripleDES)},467:function(t,e,a){var s;t.exports=(s=a(359),function(t){var e=s,a=e.lib,i=a.Base,r=a.WordArray,o=e.x64={};o.Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),o.WordArray=i.extend({init:function(e,a){e=this.words=e||[],this.sigBytes=a!=t?a:8*e.length},toX32:function(){for(var t=this.words,e=t.length,a=[],s=0;s<e;s++){var i=t[s];a.push(i.high),a.push(i.low)}return r.create(a,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),a=e.length,s=0;s<a;s++)e[s]=e[s].clone();return t}})}(),s)},633:function(){},106:function(){}},e={};function a(s){var i=e[s];if(void 0!==i)return i.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,a),r.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t,e;!function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}(t||(t={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_I=73]="KEY_I",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_S=83]="KEY_S",t[t.KEY_V=86]="KEY_V",t[t.KEY_W=87]="KEY_W",t[t.KEY_X=88]="KEY_X",t[t.KEY_Y=89]="KEY_Y",t[t.KEY_Z=90]="KEY_Z",t[t.KEY_F1=112]="KEY_F1",t[t.KEY_F2=113]="KEY_F2",t[t.KEY_F3=114]="KEY_F3",t[t.KEY_F4=115]="KEY_F4",t[t.KEY_F5=116]="KEY_F5",t[t.KEY_F6=117]="KEY_F6",t[t.KEY_F7=118]="KEY_F7",t[t.KEY_F8=119]="KEY_F8",t[t.KEY_F9=120]="KEY_F9",t[t.KEY_F10=121]="KEY_F10",t[t.KEY_F12=123]="KEY_F12"}(e||(e={}));var s,i,r=function(){function e(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),this._keyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}return e.prototype.checkHitKey=function(e){var a=this.getKeyState(e);return a===t.KEYDOWN||a===t.KEYPRESS},e.prototype.getKeyState=function(e){return this._prevKeyState[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForControllPlayer=function(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForMessageCheck=function(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=Q.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?t.KEYPRESS_MESSAGECHANGE:t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},e.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},e.prototype.update=function(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++},e.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},e.prototype.allClear=function(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1},e.KEY_BUFFER_MAX=256,e}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(s||(s={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(i||(i={}));var o,n,_=function(){function t(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}return t.prototype.checkClickMouse=function(t){var e;return(e=void 0!==t?this.getMouseState(t):this.getMouseState())===s.MOUSEDOWN||e===s.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?s.NONE:this._prevMouseState?this._mouseState?s.MOUSEPRESS:s.MOUSEUP:this._mouseState?s.MOUSEDOWN:s.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?s.NONE:this._prevMouseStateOnControllable?this._mouseState?s.MOUSEPRESS:s.MOUSEUP:this._mouseState?s.MOUSEDOWN:s.NONE},t.prototype.setPressInfo=function(t,e){this._nextMouseState=!0,this._inputDir=t,this._touchID=e},t.prototype.setReleaseInfo=function(){this._touchID=0,this._nextMouseState=!1},t.prototype.touchIDIsSetDir=function(){return this._touchID===i.DIR_KEY},t.prototype.memorizeMouseStateOnControllableFrame=function(){this._prevMouseStateOnControllable=this._mouseState},t.prototype.update=function(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState},t.prototype.clear=function(){this._nextMouseState=!1},t.prototype.getTouchID=function(){return this._touchID},t}();!function(t){t[t.BUTTON_INDEX_B=0]="BUTTON_INDEX_B",t[t.BUTTON_INDEX_A=1]="BUTTON_INDEX_A",t[t.BUTTON_INDEX_Y=2]="BUTTON_INDEX_Y",t[t.BUTTON_INDEX_X=3]="BUTTON_INDEX_X",t[t.BUTTON_INDEX_L=4]="BUTTON_INDEX_L",t[t.BUTTON_INDEX_R=5]="BUTTON_INDEX_R",t[t.BUTTON_INDEX_ZL=6]="BUTTON_INDEX_ZL",t[t.BUTTON_INDEX_ZR=7]="BUTTON_INDEX_ZR",t[t.BUTTON_INDEX_MINUS=8]="BUTTON_INDEX_MINUS",t[t.BUTTON_INDEX_PLUS=9]="BUTTON_INDEX_PLUS",t[t.BUTTON_INDEX_LEFT_STICK=10]="BUTTON_INDEX_LEFT_STICK",t[t.BUTTON_INDEX_RIGHT_STICK=11]="BUTTON_INDEX_RIGHT_STICK",t[t.BUTTON_CROSS_KEY_UP=12]="BUTTON_CROSS_KEY_UP",t[t.BUTTON_CROSS_KEY_DOWN=13]="BUTTON_CROSS_KEY_DOWN",t[t.BUTTON_CROSS_KEY_LEFT=14]="BUTTON_CROSS_KEY_LEFT",t[t.BUTTON_CROSS_KEY_RIGHT=15]="BUTTON_CROSS_KEY_RIGHT"}(o||(o={})),function(t){t[t.AXES_L_HORIZONTAL_INDEX=0]="AXES_L_HORIZONTAL_INDEX",t[t.AXES_L_VERTICAL_INDEX=1]="AXES_L_VERTICAL_INDEX",t[t.AXES_R_HORIZONTAL_INDEX=2]="AXES_R_HORIZONTAL_INDEX",t[t.AXES_R_VERTICAL_INDEX=3]="AXES_R_VERTICAL_INDEX",t[t.AXES_CROSS_KEY=9]="AXES_CROSS_KEY"}(n||(n={}));var c,h,u,l=function(){function t(){var t;for(this.gamepad=null,this.triggers=[],t=0;t<16;t++)this.triggers[t]=!1}return t.prototype.update=function(){this.gamepad=null;var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(t&&t.length>0&&t[0]){var e=t[0];this.gamepad=e}},t.prototype.buttonTrigger=function(){for(var t,e,a,s,i,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(!this.gamepad)return!1;for(e=r.length,t=0;t<e;t++){a=r[t];var n=this.gamepad.buttons[a];if(!n)return!1;if(s="object"==typeof n?!0===n.pressed:1===n,i=this.triggers[a],this.triggers[a]=s,s&&!i)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,a,s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(!this.gamepad)return!1;for(e=s.length,t=0;t<e;t++){a=s[t];var r=this.gamepad.buttons[a];if(!r)return!1;if("object"==typeof r?!0===r.pressed:1===r)return!0}return!1},t.prototype.crossPressed=function(){for(var t,e,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++)switch(a[t]){case o.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_UP))return!0;break;case o.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_DOWN))return!0;break;case o.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_LEFT))return!0;break;case o.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_RIGHT))return!0}return!1},t.prototype.vibration=function(t){return!!this.gamepad&&(!!this.gamepad.vibrationActuator&&void(t?this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:1,strongMagnitude:.5}):this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:.5,strongMagnitude:1})))},t.prototype.stickFloor=function(){for(var t,e,a,s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(!this.gamepad)return 0;for(e=s.length,t=0;t<e;t++){a=s[t];var r=this.gamepad.axes[a];return"number"!=typeof r?0:Math.floor(10*r)/10}return 0},t}(),p=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),d=function(){function t(t,e){this.strength=t,this.defence=e}return t.prototype.add=function(t){return this.strength+=t.strength,this.defence+=t.defence,this},t.prototype.plus=function(e){return new t(this.strength+e.strength,this.defence+e.defence)},t.prototype.minus=function(e){return new t(this.strength-e.strength,this.defence-e.defence)},t.prototype.equals=function(t){return this.strength===t.strength&&this.defence===t.defence},t}(),E=function(t){function e(e,a,s,i){var r=t.call(this,a,s)||this;return r.energy=e,r.gold=i,r}return p(e,t),e.prototype.add=function(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this},e.prototype.plus=function(t){return t instanceof e?new e(this.energy+t.energy,this.strength+t.strength,this.defence+t.defence,this.gold+t.gold):new e(this.energy,this.strength+t.strength,this.defence+t.defence,this.gold)},e.prototype.minus=function(t){return t instanceof e?new e(this.energy-t.energy,this.strength-t.strength,this.defence-t.defence,this.gold-t.gold):new e(this.energy,this.strength-t.strength,this.defence-t.defence,this.gold)},e.prototype.equals=function(t){return this.energy===t.energy&&this.strength===t.strength&&this.defence===t.defence&&this.gold===t.gold},e.prototype.calculateScore=function(t){var e=this;return Object.keys(t).reduce((function(a,s){return a+t[s]*e[s]}),0)},e}(d),f=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.convertIntoPosition=function(t){return new y(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?u.RIGHT_UP:this.y===t.y?u.RIGHT:u.RIGHT_DOWN:this.x===t.x?this.y>t.y?u.UP:this.y===t.y?u.NO_DIRECTION:u.DOWN:this.y>t.y?u.LEFT_UP:this.y===t.y?u.LEFT:u.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),y=function(){function t(t,e,a,s,i){if(void 0===s&&(s=0),void 0===i&&(i=0),this._wwa=t,void 0===this._wwa)throw new Error("WWAのインスタンスが存在しません. ");var r=this._wwa.getMapWidth();if(e<0||e>=r||e>=r-1&&s>0||a<0||a>=r||a>=r-1&&i>0)throw new Error("範囲外の座標です!! parts:("+e+", "+a+"), offset:("+s+", "+i+"), mapWidth = "+r);this._partsCoord=new f(e,a),this._offsetCoord=new f(s,i)}return t.prototype.getPartsCoord=function(){return this._partsCoord},t.prototype.getOffsetCoord=function(){return this._offsetCoord},t.prototype.getScreenTopPosition=function(){var e=Math.floor(this._partsCoord.x/(Q.H_PARTS_NUM_IN_WINDOW-1))*(Q.H_PARTS_NUM_IN_WINDOW-1),a=Math.floor(this._partsCoord.y/(Q.V_PARTS_NUM_IN_WINDOW-1))*(Q.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,a,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),a=this._wwa.getMapWidth(),s=t.getPartsCoord().clone();return e.x===a-1&&s.x--,e.y===a-1&&s.y--,s.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var a=this._partsCoord;return new t(this._wwa,a.x+v[e],a.y+T[e],0,0)}var s=this._partsCoord.x,i=this._partsCoord.y;return this._offsetCoord.x<0?s--:this._offsetCoord.x>0&&s++,this._offsetCoord.y<0?i--:this._offsetCoord.y>0&&i++,new t(this._wwa,s,i,0,0)},t.prototype.getNextFramePosition=function(e,a,s){var i=this._partsCoord.x,r=this._partsCoord.y,o=this._offsetCoord.x+v[e]*a,n=this._offsetCoord.y+T[e]*s;if(o<0){var _=Math.floor(Math.abs(o)/Q.CHIP_SIZE);i-=_,o=(o+_*Q.CHIP_SIZE)%Q.CHIP_SIZE}if(n<0){var c=Math.floor(Math.abs(n)/Q.CHIP_SIZE);r-=c,n=(n+c*Q.CHIP_SIZE)%Q.CHIP_SIZE}return o>=Q.CHIP_SIZE&&(i+=Math.floor(o/Q.CHIP_SIZE),o=(o+Q.CHIP_SIZE)%Q.CHIP_SIZE),n>=Q.CHIP_SIZE&&(r+=Math.floor(n/Q.CHIP_SIZE),n=(n+Q.CHIP_SIZE)%Q.CHIP_SIZE),new t(this._wwa,i,r,o,n)},t.prototype.isJustPosition=function(){return 0==this._offsetCoord.x&&0==this._offsetCoord.y},t.prototype.isScreenTopPosition=function(){var t=this.getScreenTopPosition();return this.equals(t)},t.prototype.equals=function(t){return this._partsCoord.equals(t.getPartsCoord())&&this._offsetCoord.equals(t.getOffsetCoord())},t.prototype.isInCameraRange=function(t,e){void 0===e&&(e=!1);var a=t.getPosition()._partsCoord,s=this._partsCoord.x,i=this._partsCoord.y,r=e?1:0;return a.x<=s&&s<a.x+Q.H_PARTS_NUM_IN_WINDOW-r&&a.y<=i&&i<a.y+Q.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===Q.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===Q.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),w=function(t,e,a){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=a.clone()},m=function(t,e,a,s,i){this.partsIDObj=t,this.x=e,this.y=a,this.isStatic=s,this.isFighting=i};!function(t){t[t.GOTO_WWA=0]="GOTO_WWA",t[t.BATTLE_REPORT=1]="BATTLE_REPORT",t[t.GAME_END=2]="GAME_END"}(h||(h={})),function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=3]="UP",t[t.LEFT_DOWN=4]="LEFT_DOWN",t[t.LEFT_UP=5]="LEFT_UP",t[t.RIGHT_DOWN=6]="RIGHT_DOWN",t[t.RIGHT_UP=7]="RIGHT_UP",t[t.NO_DIRECTION=8]="NO_DIRECTION"}(u||(u={}));var g,A,S,I,v=[-1,1,0,0,-1,-1,1,1,0],T=[0,0,1,-1,1,-1,1,-1,0],O=[4,6,2,0],D=[e.KEY_LEFT,e.KEY_RIGHT,e.KEY_DOWN,e.KEY_UP];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(g||(g={})),function(t){t[t.MAP=0]="MAP",t[t.OBJECT=1]="OBJECT",t[t.CHOICE_YES=2]="CHOICE_YES",t[t.CHOICE_NO=3]="CHOICE_NO"}(A||(A={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(S||(S={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(I||(I={}));var C,M,N,P,b,R,L,x,B,U=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?C.XBOX:t.match(/windows/i)?C.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?C.IOS:C.MACINTOSH:t.match(/iphone|ipad|ipod/i)?C.IOS:t.match(/oculus/i)?C.OCULUS:t.match(/android/i)?C.ANDROID:t.match(/nintendo/i)?C.NINTENDO:t.match(/playstation/i)?C.PLAY_STATION:t.match(/linux/i)?C.LINUX:C.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?N.CHROME:t.match(/firefox/i)?N.FIREFOX:t.match(/safari/i)?N.SAFARI:N.OTHERS},t.prototype.getDevice=function(){switch(this.os){case C.WINDOWS:case C.MACINTOSH:case C.LINUX:return M.PC;case C.IOS:case C.ANDROID:return M.SP;case C.OCULUS:return M.VR;case C.NINTENDO:case C.PLAY_STATION:case C.XBOX:return M.GAME}return M.OTHERS},t}();!function(t){t[t.WINDOWS=1]="WINDOWS",t[t.MACINTOSH=2]="MACINTOSH",t[t.LINUX=3]="LINUX",t[t.ANDROID=4]="ANDROID",t[t.IOS=5]="IOS",t[t.NINTENDO=6]="NINTENDO",t[t.PLAY_STATION=7]="PLAY_STATION",t[t.OCULUS=8]="OCULUS",t[t.XBOX=9]="XBOX",t[t.OTHERS=9999]="OTHERS"}(C||(C={})),function(t){t[t.PC=1]="PC",t[t.SP=2]="SP",t[t.VR=3]="VR",t[t.GAME=4]="GAME",t[t.OTHERS=9999]="OTHERS"}(M||(M={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(N||(N={})),function(t){t[t.NONE=0]="NONE",t[t.CALL_BY_MAP_PARTS=1]="CALL_BY_MAP_PARTS",t[t.CALL_BY_OBJECT_PARTS=2]="CALL_BY_OBJECT_PARTS",t[t.CALL_BY_ITEM_USE=3]="CALL_BY_ITEM_USE",t[t.CALL_BY_QUICK_SAVE=4]="CALL_BY_QUICK_SAVE",t[t.CALL_BY_QUICK_LOAD=5]="CALL_BY_QUICK_LOAD",t[t.CALL_BY_RESTART_GAME=6]="CALL_BY_RESTART_GAME",t[t.CALL_BY_GOTO_WWA=7]="CALL_BY_GOTO_WWA",t[t.CALL_BY_PASSWORD_SAVE=8]="CALL_BY_PASSWORD_SAVE",t[t.CALL_BY_PASSWORD_LOAD=9]="CALL_BY_PASSWORD_LOAD",t[t.CALL_BY_END_GAME=10]="CALL_BY_END_GAME",t[t.CALL_BY_SUSPEND=11]="CALL_BY_SUSPEND",t[t.CALL_BY_LOG_QUICK_SAVE=12]="CALL_BY_LOG_QUICK_SAVE",t[t.CALL_BY_LOG_QUICK_LOAD=13]="CALL_BY_LOG_QUICK_LOAD"}(P||(P={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.QUICK_SAVE=1]="QUICK_SAVE",t[t.RESTART_GAME=2]="RESTART_GAME",t[t.GOTO_WWA=3]="GOTO_WWA"}(b||(b={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(R||(R={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(L||(L={})),function(t){t[t.STATIC=0]="STATIC",t[t.CHASE_PLAYER=1]="CHASE_PLAYER",t[t.RUN_OUT=2]="RUN_OUT",t[t.HANG_AROUND=3]="HANG_AROUND"}(x||(x={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(B||(B={}));var W,Y,k,F=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.ASK_LINK=5]="ASK_LINK",t[t.NO_MONEY=6]="NO_MONEY",t[t.NO_ITEM=7]="NO_ITEM",t[t.USE_ITEM=8]="USE_ITEM"}(W||(W={})),function(t){t[t.CLICKABLE_ITEM=0]="CLICKABLE_ITEM",t[t.FULL_ITEM=1]="FULL_ITEM",t[t.LOAD_SE=2]="LOAD_SE"}(Y||(Y={})),function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MOENEY=37]="SET_MOENEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.NO_GAMEOVER=56]="NO_GAMEOVER",t[t.ELSE_IF=57]="ELSE_IF",t[t.ELSE=58]="ELSE",t[t.END_IF=59]="END_IF",t[t.SET=60]="SET",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE"}(k||(k={}));var G,V,H,K={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$no_gameover:56,$else_if:57,$else:58,$endif:59,$set:60,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(G||(G={})),function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.WIDE_CELL_ROW=4]="WIDE_CELL_ROW",t[t.ITEM_BG=5]="ITEM_BG",t[t.MAIN_FRAME=6]="MAIN_FRAME"}(V||(V={})),function(t){t[t.DECISION=1]="DECISION",t[t.ATTACK=3]="ATTACK",t[t.BGM_LB=70]="BGM_LB",t[t.NO_SOUND=99]="NO_SOUND"}(H||(H={}));var j,X=[1,2,5,8,10,20],J=["超低速","低速","準低速","中速","高速","超高速"],Z=["energy","strength","defence","gold"],Q=function(){function t(){}return t.WWA_HOME="http://wwajp.com",t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_TYPE=3,t.ATR_MODE=4,t.ATR_STRING=5,t.ATR_X=6,t.ATR_Y=7,t.ATR_X2=8,t.ATR_Y2=9,t.ATR_ENERGY=10,t.ATR_STRENGTH=11,t.ATR_DEFENCE=12,t.ATR_GOLD=13,t.ATR_ITEM=14,t.ATR_NUMBER=15,t.ATR_JUMP_X=16,t.ATR_MOVE=16,t.ATR_JUMP_Y=17,t.ATR_SOUND=19,t.ATR_APPERANCE_BASE=20,t.REL_ATR_APPERANCE_ID=0,t.REL_ATR_APPERANCE_X=1,t.REL_ATR_APPERANCE_Y=2,t.REL_ATR_APPERANCE_TYPE=3,t.REL_ATR_APPERANCE_UNIT_LENGTH=4,t.ATR_RANDOM_BASE=10,t.RANDOM_ATR_NUM=10,t.RANDOM_ITERATION_MAX=10,t.MAP_STREET=0,t.MAP_WALL=1,t.MAP_LOCALGATE=2,t.MAP_URLGATE=4,t.OBJECT_NORMAL=0,t.OBJECT_MESSAGE=1,t.OBJECT_URLGATE=2,t.OBJECT_STATUS=3,t.OBJECT_ITEM=4,t.OBJECT_DOOR=5,t.OBJECT_MONSTER=6,t.OBJECT_SCORE=11,t.OBJECT_SELL=14,t.OBJECT_BUY=15,t.OBJECT_RANDOM=16,t.OBJECT_SELECT=17,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGRELPOS_YESNO_YES_X=0,t.IMGRELPOS_YESNO_NO_X=1,t.IMGRELPOS_YESNO_YESP_X=2,t.IMGRELPOS_YESNO_NOP_X=3,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.SPLASH_SCREEN_DISP_MILLS=100,t.DEFAULT_FRAME_INTERVAL=20,t.GAMEOVER_FRAME_INTERVAL=50,t.YESNO_PRESS_DISP_FRAME_NUM=20,t.WAIT_TIME_FRAME_NUM=6,t.CHIP_SIZE=40,t.MAP_WINDOW_WIDTH=440,t.MAP_WINDOW_HEIGHT=440,t.H_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_WIDTH/t.CHIP_SIZE,t.V_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_HEIGHT/t.CHIP_SIZE,t.MIN_SPEED_INDEX=0,t.MAX_SPEED_INDEX=X.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[X.length-2,X.length-1],t.ANIMATION_REP_HALF_FRAME=22,t.PLAYER_LOOKING_AROUND_START_FRAME=4*t.ANIMATION_REP_HALF_FRAME,t.RELATIVE_COORD_BIAS=1e4,t.RELATIVE_COORD_LOWER=t.RELATIVE_COORD_BIAS-1e3,t.PLAYER_COORD=t.RELATIVE_COORD_BIAS-1e3,t.LOCALGATE_PLAYER_WAIT_FRAME=5,t.STATUS_CHANGED_EFFECT_FRAME_NUM=20,t.PASSABLE_OBJECT=1,t.APPERANCE_PARTS_MIN_INDEX=0,t.APPERANCE_PARTS_MAX_INDEX=9,t.APPERANCE_PARTS_MIN_INDEX_NO=5,t.APPERANCE_PARTS_MAX_INDEX_YES=4,t.FADEOUT_SPEED=8,t.STATUS_MINUS_BORDER=3e4,t.ITEMBOX_IS_FULL=-1,t.BATTLE_INTERVAL_FRAME_NUM=10,t.BATTLE_SPEED_CHANGE_TURN_NUM=40,t.RANDOM_MOVE_ITERATION_NUM=50,t.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8,t.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8,t.SOUND_MAX=100,t.ITEM_BORDER_IMG_DATA_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC",t.LOAD_STAGE_MAX_EXCEPT_AUDIO=7,t.WWA_STYLE_TAG_ID="wwa-additional-style",t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STRBACK_COLOR_R=0,t.DEFAULT_STRBACK_COLOR_G=0,t.DEFAULT_STRBACK_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20,t.WWAP_SERVER_OLD="http://wwawing.com/wwap",t.WWAP_SERVER="https://wwaphoenix.github.io",t.WWAP_SERVER_AUDIO_DIR="audio",t.WWAP_SERVER_TITLE_IMG="cover_p.gif",t.WWAP_SERVER_LOADER_NO_WORKER="wwaload.noworker.js",t.SCREEN_WIDTH=560,t.SCREEN_HEIGHT=440,t.LOADING_FONT="Times New Roman",t.MSG_STR_WIDTH=16,t.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20,t.ITEMBOX_TOP_Y=140,t.USER_VAR_NUM=256,t.USER_VAR_NUM_MAX_VALUE=9007199254740991,t.USET_VAR_NUM_MIN_VALUE=-9007199254740991,t.CONTROLL_WAIT_FRAME=6,t.INLINE_USER_VAR_VIEWER_DISPLAY_NUM=10,t}(),q=function(){function t(){}return t.QUICK_SAVE_MAX=4,t.QUICK_SAVE_THUMNAIL_WIDTH=99,t.QUICK_SAVE_THUMNAIL_HEIGHT=99,t.SAVE_INTERVAL_MOVE=200,t.INDEXEDDB_DB_NAME="WWA_WING_DB",t.INDEXEDDB_TABLE_NAME="SAVE_TABLE",t.DATE_LAST_SAVE_TEXT_COLOR="rgba(255,255,0,1)",t}(),z=function(){function t(){}return t.EMPTY_LOAD="",t.EMPTY_SAVE="",t.PASSWORD="Password",t.QUICK_SAVE="Quick Save",t.QUICK_LOAD="Quick Load",t.BATTLE_REPORT="Battle Report",t.GAME_END="Game End",t.GOTO_WWA="Goto WWA",t.RESTART_GAME="Restart Game",t}(),$=function(){};!function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE",t[t.GAME_INIT=7]="GAME_INIT",t[t.AUDIO=8]="AUDIO",t[t.FINISH=9]="FINISH"}(j||(j={}));var tt,et,at,st,it,rt=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],ot=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(tt||(tt={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(et||(et={})),function(t){t[t.COLOR_FRAME=0]="COLOR_FRAME",t[t.COLOR_FRAMEOUT=1]="COLOR_FRAMEOUT",t[t.COLOR_STR=2]="COLOR_STR",t[t.COLOR_STATUS_STR=4]="COLOR_STATUS_STR"}(at||(at={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(st||(st={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(it||(it={}));var nt,_t=function(t){return document.getElementById(t)},ct=function(t){return document.querySelector(t)},ht=function(t){return document.querySelector(t)},ut=function(t){return document.querySelectorAll(t)},lt=function(t,e){var a,s,i=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return a=t-_t("wwa-wrapper").offsetLeft+i,s=e-_t("wwa-wrapper").offsetTop+r,new f(a,s)},pt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},dt=function(t){var e="";if(t instanceof Array){for(var a=0;a<t.length;a++)e+=dt(t[a])+"/";return e}return t+""},Et=function(){function t(t,e,a){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:a}),this._isTransparent=a}return t.prototype.drawCanvas=function(t,e,a,s,i){this.ctx.drawImage(t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*a,Q.CHIP_SIZE,Q.CHIP_SIZE,s,i,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clear=function(){this.clearRect(0,0,this.cvs.width,this.cvs.height)},t.prototype.clearRectWithLowerYLimit=function(t){this.clearRect(0,0,this.cvs.width,t)},t.prototype.clearRect=function(t,e,a,s){this._isTransparent?this.ctx.clearRect(t,e,a,s):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,a,s))},t}(),ft=function(){function t(t,e,a,s){var i;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],i=0;i<2;i++)this._objectCanvases[i]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=s,this._load(),this._frameCoord=a.clone(),this.cpPartsLog=new f(0,0)}return t.prototype._load=function(){var t=this;this._frameCoord,this._isLoaded||(this.mapCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this.mapObjectCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this._image=new Image,this._image.addEventListener("load",(function(){t.createFrame(),t._loadCompleteCallBack()})),this._image.addEventListener("error",(function(){throw new Error("Image Load Failed!!\nfile name:"+t._fileName)})),this._image.src=this._fileName,this._isLoaded=!0)},t.prototype.createFrame=function(){this._frameCanvas.clear(),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y,0,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(var t=1;t<Q.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,Q.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,Q.CHIP_SIZE*t,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(t=1;t<Q.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,Q.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var a,s=t.length;for(e=0;e<s;e++){var i=t[e];(a=this._effectCanvases[e])?a.clear():a=this._effectCanvases[e]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<Q.V_PARTS_NUM_IN_WINDOW;r++)for(var o=0;o<Q.H_PARTS_NUM_IN_WINDOW;o++)a.drawCanvas(this._image,i.x,i.y,o*Q.CHIP_SIZE,r*Q.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,a,s){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE,a,s,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,a,s,i,r){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*a,Q.CHIP_SIZE*s,i,r,Q.CHIP_SIZE*a,Q.CHIP_SIZE*s)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,a,s,i){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,s+Q.CHIP_SIZE-i);r>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE-r,a,s,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var a=this;return function(s,i,r,o,n){if(!a._isLoaded)throw new Error("No image was loaded.");var _=Math.max(0,e(o,n));_>=Q.CHIP_SIZE||t.ctx.drawImage(a._image,Q.CHIP_SIZE*s,Q.CHIP_SIZE*i+_,Q.CHIP_SIZE,Q.CHIP_SIZE-_,r,o+_,Q.CHIP_SIZE,Q.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,a,s,i){this.copyCanvas(this._backCanvas,(function(t,e){return t+Q.CHIP_SIZE-e}))(t,e,a,s,i)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,a,s,i){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,a,s,i)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,a,s,i,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+Q.CHIP_SIZE-e}))(e,a,s,i,r)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,a,s,i,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,a,s,i,r)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawObjectCanvas=function(t){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._objectCanvases[t].cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.clearBackCanvas=function(){this._backCanvas.clear()},t.prototype.clearBackCanvasWithLowerYLimit=function(t){this._backCanvas.clearRectWithLowerYLimit(t)},t.prototype.clearObjectCanvases=function(){var t;for(t=0;t<2;t++)this._objectCanvases[t].clear()},t.prototype.clearObjectCanvasesWithLowerYLimit=function(t){var e;for(e=0;e<2;e++)this._objectCanvases[e].clearRectWithLowerYLimit(t)},t.prototype.drawCanvasWithLowerYLimit=function(t,e,a,s,i){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,i-s);r>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e+r,Q.CHIP_SIZE,Q.CHIP_SIZE-r,a,s+r,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,a,s){this._ctx.clearRect(t,e,a,s)},t.prototype.drawBase=function(t,e,a,s){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,a,s)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),yt=function(){function t(t){this._position=null,this.reset(t)}return t.prototype.setPlayer=function(t){this._player=t},t.prototype.isResetting=function(){return this._isResetting},t.prototype.getPosition=function(){return this._position},t.prototype.getPreviousPosition=function(){return this._positionPrev},t.prototype.resetPreviousPosition=function(){this._positionPrev=null},t.prototype.move=function(t){var e=X[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(Q.H_PARTS_NUM_IN_WINDOW-1),e*(Q.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep},t.prototype.isFinalStep=function(){if(!1===this._isResetting)throw new Error("リセット中ではありません。");return this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW-1},t.prototype.reset=function(t){this._positionPrev=this._position,this._position=t.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0},t}(),wt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),mt=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),gt=function(t){function e(e){return t.call(this,e)||this}return wt(e,t),e}(mt);!function(t){function e(e){return t.call(this,e)||this}wt(e,t)}(mt);!function(t){t[t.CONTROLLABLE=0]="CONTROLLABLE",t[t.MOVING=1]="MOVING",t[t.CAMERA_MOVING=2]="CAMERA_MOVING",t[t.MESSAGE_WAITING=3]="MESSAGE_WAITING",t[t.LOCALGATE_JUMPED=4]="LOCALGATE_JUMPED",t[t.BATTLE=5]="BATTLE",t[t.ESTIMATE_WINDOW_WAITING=6]="ESTIMATE_WINDOW_WAITING",t[t.PASSWORD_WINDOW_WAITING=7]="PASSWORD_WINDOW_WAITING",t[t.LOCALGATE_JUMPED_WITH_MESSAGE=8]="LOCALGATE_JUMPED_WITH_MESSAGE"}(nt||(nt={}));var At=function(t){function e(e,a,s,i,r,o,n){var _=t.call(this,a)||this;_.itemTransitioningClassName="item-transitioning",_.overwittenItemClassName="item-overwritten",_.overwittenItemSelector=".".concat(_.overwittenItemClassName),_.itemEffectStartTimers=new Array(Q.ITEMBOX_SIZE),_._status=i,_._equipStatus=new d(0,0),_._itemBox=new Array(Q.ITEMBOX_SIZE),_._itemBoxElement=new Array(Q.ITEMBOX_SIZE),_._itemUsingEvent=new Array(Q.ITEMBOX_SIZE);for(var c=0;c<_._itemBox.length;c++)_._itemBox[c]=0,_._itemBoxElement[c]=ht("#item"+c+">.item-disp");return _.updateItemBox(),_._energyMax=r,_._dir=u.DOWN,_._isMovingImage=!1,_._wwa=e,_._state=nt.CONTROLLABLE,_._camera=s,_._isPartsEventExecuted=!1,_._energyValueElement=ht("#disp-energy>.status-value-box"),_._strengthValueElement=ht("#disp-strength>.status-value-box"),_._defenceValueElement=ht("#disp-defence>.status-value-box"),_._goldValueElement=ht("#disp-gold>.status-value-box"),_._isReadyToUseItem=!1,_._isClickableItemGot=!1,_._moves=o,_._frameCount=0,_._moveMacroWaitingRemainMoves=0,_._moveObjectAutoExecTimer=0,_.updateStatusValueBox(),_._partsAppeared=!1,_._afterMoveMacroFlag=!1,_._isPreparedForLookingAround=!0,_._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME,_._speedIndex=n,_._messageDelayFrameCount=0,_}return wt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===nt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=nt.CONTROLLABLE)}else if(this._state===nt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=nt.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0),this._position=t}},e.prototype.controll=function(t){var e,a;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex]),a=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(a)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=nt.CAMERA_MOVING}catch(t){this._state=nt.CONTROLLABLE}return}if(!this.canMoveTo(a))return this._wwa.getMapTypeByPosition(a)===Q.MAP_WALL&&this._wwa.checkMap(a.getPartsCoord()),void this._wwa.checkObject(a.getPartsCoord());this._position=e,this._state=nt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}},e.prototype.setDir=function(t){this._isPreparedForLookingAround=!1,this._dir=t},e.prototype.canMoveTo=function(t){if(null===t)return!1;if(this._wwa.debug)return!0;this._wwa.getMapWidth(),t.getPartsCoord(),t.getOffsetCoord();return!(0===this._wwa.getMapIdByPosition(t)&&!this._wwa.isOldMap())&&(this._wwa.getMapTypeByPosition(t)!==Q.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_MODE)===Q.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_NUMBER)===Q.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,Q.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==nt.MOVING||this._state==nt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.DOWN||e.y===t.y&&this._dir===u.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.UP||e.y===t.y&&this._dir===u.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===nt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&!t&&this._wwa.canInput()},e.prototype.getCopyOfItemBox=function(){return this._itemBox.slice()},e.prototype.getDir=function(){return this._dir},e.prototype.isMovingImage=function(){return this._isMovingImage},e.prototype.toggleMovingImage=function(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0},e.prototype.getEnergyMax=function(){return this._energyMax},e.prototype.isJumped=function(){return this._state===nt.LOCALGATE_JUMPED||this._state===nt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=nt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===nt.MESSAGE_WAITING},e.prototype.isDelayFrame=function(){return this._messageDelayFrameCount>0},e.prototype.updateDelayFrame=function(){this._messageDelayFrameCount--},e.prototype.setDelayFrame=function(){this._messageDelayFrameCount=1},e.prototype.clearMessageWaiting=function(){this._state===nt.MESSAGE_WAITING&&(this._state=nt.CONTROLLABLE,this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=nt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===nt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===nt.ESTIMATE_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=nt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===nt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===nt.PASSWORD_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===I.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===I.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==nt.LOCALGATE_JUMPED&&this._state!==nt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===nt.LOCALGATE_JUMPED?nt.CONTROLLABLE:nt.MESSAGE_WAITING)},e.prototype.jumpTo=function(t){var e=this._camera.getPosition();this.getPosition();return!this._position.equals(t)&&(this._position=t,t.isInCameraRange(this._camera,!0)||this._camera.reset(t),this._state=this._state===nt.MESSAGE_WAITING?nt.LOCALGATE_JUMPED_WITH_MESSAGE:nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.DOWN).hasLocalGate()?this._dir=u.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(u.UP).hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.RIGHT).hasLocalGate()?this._dir=u.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(u.LEFT).hasLocalGate()?this._dir=u.RIGHT:this._dir=u.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME},e.prototype.addStatusAll=function(t){return this._status.add(t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status},e.prototype.setEnergyMax=function(t){return this._energyMax=t,0!==t&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.setEnergy=function(t){return this._status.energy=t,this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()},e.prototype.setStrength=function(t){return this._status.strength=t,this.updateStatusValueBox(),t},e.prototype.setDefence=function(t){return this._status.defence=t,this.updateStatusValueBox(),t},e.prototype.setGold=function(t){return this._status.gold=t,this.updateStatusValueBox(),t},e.prototype.getStatus=function(){return this._status.plus(this._equipStatus)},e.prototype.getStatusWithoutEquipments=function(){return this._status.plus(new d(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new d(0,0))},e.prototype.updateStatusValueBox=function(){var t,e=this._status.plus(this._equipStatus);this._energyValueElement.textContent=this._wwa.isVisibleStatus("energy")?String(e.energy):"",this._strengthValueElement.textContent=this._wwa.isVisibleStatus("strength")?String(e.strength):"",this._defenceValueElement.textContent=this._wwa.isVisibleStatus("defence")?String(e.defence):"",this._goldValueElement.textContent=this._wwa.isVisibleStatus("gold")?String(e.gold):"",null===(t=this._wwa._messageWindow)||void 0===t||t.update(),this._wwa.updateScore()},e.prototype.updateItemBox=function(t){for(var e=this,a=function(a){var i=s._itemBoxElement[a],r=ct("#item"+a);if(0===s._itemBox[a])return i.style.backgroundPosition="-40px 0px",s.disposeItemEffect(a,s._itemBoxElement[a],r),"continue";var o=s._wwa.getObjectCropXById(s._itemBox[a]),n=s._wwa.getObjectCropYById(s._itemBox[a]);if(!t||a!==t.insertPos-1)return i.style.backgroundPosition="-"+o+"px -"+n+"px",s.disposeItemEffect(a,s._itemBoxElement[a],r),"continue";var _=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,c=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,h=-_*Q.DEFAULT_FRAME_INTERVAL/Q.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,u=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=u?t.itemBoxBackgroundImageCoord.x:s._wwa.getObjectCropXById(t.overwrittenObjectId),p=u?t.itemBoxBackgroundImageCoord.y:s._wwa.getObjectCropYById(t.overwrittenObjectId);i.style.left=_+"px",i.style.top=c+"px","number"==typeof s.itemEffectStartTimers[a]&&clearInterval(s.itemEffectStartTimers[a]),s.itemEffectStartTimers[a]=window.setTimeout((function(){e.itemEffectStartTimers[a]=void 0,e.startItemEffect(a,i,r,{target:{x:o,y:n},overwritten:{x:l,y:p}},h)}),Q.DEFAULT_FRAME_INTERVAL)},s=this,i=0;i<this._itemBoxElement.length;i++)a(i)},e.prototype.startItemEffect=function(t,e,a,s,i){var r=this,o=a.querySelector(this.overwittenItemSelector);o&&a.removeChild(o);var n=document.createElement("div");n.classList.add(this.overwittenItemClassName),n.style.backgroundPosition="-"+s.overwritten.x+"px -"+s.overwritten.y+"px",n.style.backgroundImage=a.style.backgroundImage,a.appendChild(n),e.style.backgroundPosition="-"+s.target.x+"px -"+s.target.y+"px",e.style.transitionDuration=i+"ms",e.style.transitionProperty="left,top",e.style.transitionTimingFunction="linear",e.style.left="0",e.style.top="0",a.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){r.disposeItemEffect(t,e,a)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,a){"number"==typeof this.itemEffectStartTimers[t]&&(clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=void 0),e.style.transitionDuration="0s",e.style.transitionProperty="",e.style.left="0",e.style.top="0",a.classList.contains(this.itemTransitioningClassName)&&a.classList.remove(this.itemTransitioningClassName);var s=a.querySelector(this.overwittenItemSelector);s&&a.removeChild(s)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,a,s){var i,r,o;void 0===e&&(e=0),void 0===a&&(a=!1);var n=this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((i=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");_=this._itemBox[i-1],this._forceSetItemBox(i,t)}else if(!1===a)if(i=e,o=this._itemBox[i-1],this._wwa.getObjectAttributeById(o,Q.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER)){if((r=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(r,o),this._forceSetItemBox(i,t)}else _=this._itemBox[i-1],this._forceSetItemBox(i,t);else i=e,_=this._itemBox[i-1],this._forceSetItemBox(i,t);this._updateEquipmentStatus(),this.updateItemBox(s?{insertPos:i,itemScreenPixelCoord:s.screenPixelCoord,itemBoxBackgroundImageCoord:s.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new f(Q.MAP_WINDOW_WIDTH+(i-1)%3*Q.CHIP_SIZE,Q.ITEMBOX_TOP_Y+Math.floor((i-1)/3)*Q.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var a=this,s=ht("#item"+(t-1)+">.item-click-border"),i=this._wwa.getObjectAttributeById(e,Q.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&i!==S.NORMAL){var r=this._wwa.getSystemMessageById(Y.CLICKABLE_ITEM);if(!this._isClickableItemGot){if("BLANK"!==r){var o="";switch(this._wwa.userDevice.device){case M.PC:o="このアイテムは右のボックスを選択することで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case M.VR:o="このアイテムは右のボックスをクリックすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case M.SP:o="このアイテムは右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case M.GAME:switch(this._wwa.userDevice.os){case C.NINTENDO:o="このアイテムはXボタンを押すか、右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.PLAY_STATION:o="このアイテムは△ボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.XBOX:o="このアイテムはYボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。"}}this._wwa.setMessageQueue(""===r?o:r,!1,!0)}this._isClickableItemGot=!0}s.style.display="block",function(t){a._itemUsingEvent[t-1]=function(){(a.isControllable()||a._wwa._messageWindow.isItemMenuChoice())&&(a._wwa._itemMenu.close(),a._wwa._setNextMessage(),a._wwa.onselectitem(t))}}(t),s.addEventListener("click",this._itemUsingEvent[t-1])}},e.prototype._getBlankItemPos=function(){var t;for(t=1;t<this._itemBox.length+1;t++)if(0===this._itemBox[t-1])return t;return Q.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new d(0,0);for(t=0;t<Q.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_DEFENCE));var a=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(a),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<Q.ITEMBOX_SIZE;e++)if(this._itemBox[e]===t)return!0;return!1},e.prototype.canUseItem=function(t){var e=this._itemBox[t-1];return 0!==e&&this._wwa.getObjectAttributeById(e,Q.ATR_MODE)!==S.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,Q.ATR_MODE)!==S.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=_t("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),Q.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==Q.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],Q.ATR_MODE)!==S.NORMAL&&((e=ht("#item"+(t-1)+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[t-1]),e.style.display="none"),this._itemBox[t-1]=0,this._updateEquipmentStatus(),this.updateItemBox())},e.prototype.removeItemByPartsID=function(t){var e;if(!this.hasItem(t))throw new Error("アイテムを持っていない");for(var a=0;a<Q.ITEMBOX_SIZE;a++)if(this._itemBox[a]===t)return this._wwa.getObjectAttributeById(this._itemBox[a],Q.ATR_MODE)!==S.NORMAL&&((e=ht("#item"+a+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[a]),e.style.display="none"),this._itemBox[a]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=Q.ITEMBOX_SIZE;t++)this.removeItemByItemPosition(t);this._updateEquipmentStatus(),this.updateItemBox()},e.prototype.hasGold=function(t){return this._status.gold>=t},e.prototype.payGold=function(t){if(!this.hasGold(t))throw new Error("お金が足りない");this.setGold(this._status.gold-t)},e.prototype.earnGold=function(t){this.setGold(this._status.gold+t)},e.prototype.setPartsAppearedFlag=function(){this._partsAppeared=!0},e.prototype.clearPartsAppearedFlag=function(){this._partsAppeared=!1},e.prototype.isPartsAppearedTime=function(){return!0===this._partsAppeared},e.prototype.startBattleWith=function(t){this._isPlayerTurn=!0,this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=nt.BATTLE},e.prototype.isFighting=function(){return this._state===nt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>Q.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(H.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(H.ATTACK),this._wwa.vibration(!0));var t=this.getStatus(),e=this._enemy.status;if(this._isPlayerTurn){if(t.strength>e.defence||t.defence<e.strength)return e.energy>t.strength-e.defence?t.strength>e.defence&&this._enemy.damage(t.strength-e.defence):(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,Q.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new E(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(I.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(I.OBJECT,0,this._enemy.position),this._wwa.appearParts(this._enemy.position,A.OBJECT,this._enemy.partsID),this._state=nt.CONTROLLABLE,this._wwa.setMessageQueue(this._enemy.message,!1,!1,this._enemy.partsID,I.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess(),this._wwa.setMessageQueue("相手の防御能力が高すぎる!",!1,!0),this._battleTurnNum=0,this._enemy=null}else e.strength>t.defence&&(t.energy>e.strength-t.defence?this.damage(e.strength-t.defence):(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=nt.CONTROLLABLE,this._battleTurnNum=0,this._enemy=null,this._wwa.shouldApplyGameOver({isCalledByMacro:!1})&&this._wwa.gameover()));this._isPlayerTurn=!0}},e.prototype.readyToUseItem=function(t){var e;if(!this.canUseItem(t))throw new Error("アイテムがないか、アイテムが使えません。");e=this._itemBox[t-1],this._wwa.getObjectAttributeById(e,Q.ATR_STRING),this._wwa.appearParts(this._position.getPartsCoord(),A.OBJECT,e),this._readyToUseItemPos=t,this._isReadyToUseItem=!0},e.prototype.isReadyToUseItem=function(){return this._isReadyToUseItem},e.prototype.getDrawingCenterPosition=function(){var t=this._position.getPartsCoord(),e=this._position.getOffsetCoord(),a=this._camera.getPosition(),s=a.getPartsCoord(),i=a.getOffsetCoord(),r=(t.x-s.x)*Q.CHIP_SIZE+e.x-i.x+Q.CHIP_SIZE/2,o=(t.y-s.y)*Q.CHIP_SIZE+e.y-i.y+Q.CHIP_SIZE/2;return new f(r,o)},e.prototype.getPlayTimeText=function(){var t=Math.floor(this._frameCount/60);return t>=36e6?"9999:99:99":("000"+(t/60/60|0)).slice(-4)+":"+("0"+(t/60|0)%60).slice(-2)+":"+("0"+t%60).slice(-2)},e.prototype.mainFrameCount=function(){this._frameCount++},e.prototype.getFrameCount=function(){return this._frameCount},e.prototype.setFrameCount=function(t){return"number"!=typeof t&&(t=0),this._frameCount=t},e.prototype.getMoveCount=function(){return this._moves},e.prototype.setMoveCount=function(t){return this._moves=t},e.prototype.isMoveObjectAutoExecTime=function(){return 0===this._moveObjectAutoExecTimer},e.prototype.setMoveMacroWaiting=function(t){t<0||(this._moveMacroWaitingRemainMoves=t,this._moveObjectAutoExecTimer=0)},e.prototype.resetMoveObjectAutoExecTimer=function(){this._moveObjectAutoExecTimer=Q.CHIP_SIZE/X[this._speedIndex],this._moveMacroWaitingRemainMoves--},e.prototype.decrementMoveObjectAutoExecTimer=function(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&(this._afterMoveMacroFlag=!0)),0},e.prototype.isWaitingMoveMacro=function(){return 0!==this._moveMacroWaitingRemainMoves||0!==this._moveObjectAutoExecTimer},e.prototype.decrementLookingAroundTimer=function(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0},e.prototype.isLookingAround=function(){return this._isPreparedForLookingAround&&0===this._lookingAroundTimer},e.prototype.getSpeedIndex=function(){return this._speedIndex},e.prototype.speedUp=function(){return this._speedIndex=Math.min(Q.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(Q.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(gt),St=function(){function t(t,e,a,s,i,r,o){this._partsID=t,this._position=e,this._imgCoord=a,this._status=s,this._message=i,this._item=r,this._battleEndCallback=o}return Object.defineProperty(t.prototype,"partsID",{get:function(){return this._partsID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgCoord",{get:function(){return this._imgCoord},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t)},t.prototype.battleEndProcess=function(){this._battleEndCallback()},t}(),It=function(){function t(t,e,a,s,i){this._player=t,this._objectID=e,this._srcPos=a,this._destPos=s,this._dir=i,this._currentPos=this._srcPos.clone()}return t.prototype.update=function(){var t=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,X[t],X[t]),this._currentPos},Object.defineProperty(t.prototype,"isAchievedDestination",{get:function(){return this._currentPos.equals(this._destPos)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._currentPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforePosition",{get:function(){return this._srcPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destination",{get:function(){return this._destPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objID",{get:function(){return this._objectID},enumerable:!1,configurable:!0}),t}(),vt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,a,s){this._queue.push(new It(this._player,t,e,a,s))},t.prototype.update=function(){for(var t=[],e=[],a=0;a<this._queue.length;a++)this._queue[a].update(),this._queue[a].isAchievedDestination?(t.push(this._queue[a]),this._wwa.setPartsOnPosition(I.OBJECT,0,this._queue[a].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(I.OBJECT,this._queue[a].objID,this._queue[a].destination.getPartsCoord())):e.push(this._queue[a]);return this._queue=e,t},t.prototype.clear=function(){this._queue=[]},Object.defineProperty(t.prototype,"objectMovingData",{get:function(){return this.objectMovingData},enumerable:!1,configurable:!0}),t.prototype.getOffsetByBeforePartsCoord=function(t){var e=this._queue.filter((function(e){return e.beforePosition.getPartsCoord().equals(t)}));return 0===e.length?null:e[0].currentPosition.getOffsetCoord()},t}(),Tt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Ot=function(){function t(t,e,a,s){this.isSystemMessage=e,this.isEndOfPartsEvent=a,this.macro=s,this.messageArray="string"==typeof t?[t]:t,void 0===this.macro&&(this.macro=[])}return t.prototype.isEmpty=function(){return 0===this.messageArray.length||1===this.messageArray.length&&""===this.messageArray[0]},t.prototype.generatePrintableMessage=function(){return this.messageArray.reduce((function(t,e){var a="string"==typeof e?e:e();return"".concat(t).concat(a)}),"")},t}(),Dt=function(){function t(t,e,a,s,i,r){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=a,this._triggerPartsPosition=s,this.macroType=i,this.macroArgs=r}return t.prototype.isJunction=function(){return[k.IF,k.ELSE_IF,k.ELSE,k.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case k.IMGPLAYER:this._executeImgPlayerMacro();break;case k.IMGYESNO:this._executeImgYesNoMacro();break;case k.HPMAX:this._executeHPMaxMacro();break;case k.SAVE:this._executeSaveMacro();break;case k.ITEM:this._executeItemMacro();break;case k.DEFAULT:this._executeDefaultMacro();break;case k.OLDMAP:this._executeOldMapMacro();break;case k.PARTS:this._executePartsMacro();break;case k.MOVE:this._executeMoveMacro();break;case k.MAP:this._executeMapMacro();break;case k.DIRMAP:this._executeDirMapMacro();break;case k.IMGFRAME:this._executeImgFrameMacro();break;case k.IMGBOM:this._executeImgBomMacro();break;case k.DELPLAYER:this._executeDelPlayerMacro();break;case k.FACE:this._executeFaceMacro();break;case k.EFFECT:this._executeEffectMacro();break;case k.GAMEOVER:this._executeGameOverMacro();break;case k.IMGCLICK:this._executeImgClickMacro();break;case k.STATUS:this._executeStatusMacro();break;case k.EFFITEM:this._executeEffItemMacro();break;case k.COLOR:this._executeColorMacro();break;case k.WAIT:this._executeWaitMacro();break;case k.SOUND:this._executeSoundMacro();break;case k.GAMEPAD_BUTTON:this._executeGamePadButtonMacro();break;case k.OLDMOVE:this._executeOldMoveMacro();break;case k.JUMPGATE:this._executeJumpGateMacro();break;case k.RECPOSITION:this._executeRecPositionMacro();break;case k.JUMPRECPOSITION:this._executeJumpRecPositionMacro();break;case k.CONSOLE_LOG:this._executeConsoleLogMacro();break;case k.COPY_HP_TO:this._executeCopyHpToMacro();break;case k.SET_HP:this._executeSetHPMacro();break;case k.COPY_HPMAX_TO:this._executeCopyHpMaxToMacro();break;case k.SET_HPMAX:this._executeSetHpMaxMacro();break;case k.COPY_AT_TO:this._executeCopyAtToMacro();break;case k.SET_AT:this._executeSetAtMacro();break;case k.COPY_DF_TO:this._executeCopyDfToMacro();break;case k.SET_DF:this._executeSetDfMacro();break;case k.COPY_MONEY_TO:this._executeCopyMoneyToMacro();break;case k.SET_MOENEY:this._executeSetMoneyMacro();break;case k.COPY_STEP_COUNT_TO:this._executeSetStepCountMacro();break;case k.VAR_SET_VAL:this._executeVarSetValMacro();break;case k.VAR_SET:this._executeVarSetMacro();break;case k.VAR_ADD:this._executeVarAddMacro();break;case k.VAR_SUB:this._executeVarSubMacro();break;case k.VAR_MUL:this._executeVarMulMacro();break;case k.VAR_DIV:this._executeVarDivMacro();break;case k.VAR_MOD:this._executeVarModMacro();break;case k.VAR_SET_RAND:this._executeVarSetRandMacro();break;case k.GAME_SPEED:this._executeGameSpeedMacro();break;case k.SHOW_STR:break;case k.IF:this._executeIfMacro();break;case k.ELSE_IF:this._executeIfElseMacro();break;case k.ELSE:this._executeElseMacro();break;case k.END_IF:this._executeEndIfMacro();break;case k.SET_SPEED:this._executeSetSpeedMacro();break;case k.COPY_TIME_TO:this._executeCopyTimeToMacro();break;case k.HIDE_STATUS:this._executeHideStatusMacro();break;case k.VAR_MAP:this._executeVarMapMacro();break;case k.NO_GAMEOVER:this._executeNoGameOverMacro();break;case k.SET:this._executeSetMacro();break;default:console.log("不明なマクロIDが実行されました:"+this.macroType)}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),a=0;a<e.length;a++)e[a]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._parseInt=function(t,e){void 0===e&&(e=0);var a=parseInt(this.macroArgs[t]);return isNaN(a)?e:a},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.outputUserVar(t)},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,0);this._wwa.setUserValRandNum(t,e,a)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.speedChangeJudge(t)},t.prototype._executeIfMacro=function(){if(1===this.macroArgs.length)this._wwa.switchConditionalExecutionStatus(this.macroArgs[0]);else{for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)}},t.prototype._executeIfElseMacro=function(){this._wwa.switchConditionalExecutionStatus(this.macroArgs[0])},t.prototype._executeElseMacro=function(){this._wwa.switchConditionalExecutionStatus()},t.prototype._executeEndIfMacro=function(){this._wwa.resetConditionalMacroExecStaus()},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=0!==this._parseInt(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],s=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,a,t,s)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerImgCoord(new f(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setYesNoImgCoord(new f(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._parseInt(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,I.OBJECT),s=this._parseInt(3);if(a!==I.OBJECT&&a!==I.MAP)throw new Error("パーツ種別が不明です");if(0!==s&&1!==s&&(s=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(a===I.OBJECT){if(t>=this._wwa.getObjectPartsNum()||e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum()||e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.replaceParts(t,e,a,!!s)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],s=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("パーツ番号が不正です");if(s===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,e,a,t,s)},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,I.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(a))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(a===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,a)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2);if(e<0||a<0)throw new Error("座標は正でなければなりません。");if(t===V.ENERGY||t===V.STRENGTH||t===V.DEFENCE||t===V.GOLD)this._wwa.setStatusIconCoord(t,new f(e,a));else if(t===V.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new f(e,a));else if(t===V.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:a});else{if(t!==V.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new f(e,a))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new f(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._parseInt(0),a=this._parseInt(1),s=this._parseInt(2),i=this._parseInt(3),r=this._parseInt(4),o=this._parseInt(5);if(e<0||a<0||s<0||i<0||r<0||o<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new w(new f(e,a),new f(s,i),new f(r,o)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],a=1;a<this.macroArgs.length;a+=2){var s,i=this._parseInt(a);if(i<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(a+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((s=this._parseInt(a+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new f(i,s))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new f(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new f(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");this._wwa.setPlayerStatus(t,e,!0)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2),s=this._parseInt(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||a<0||a>255||s<0||s>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,a,s)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.playSound(t)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>Q.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){this._wwa.execSetMacro(this.macroArgs[0])},t}();function Ct(t,e,a,s,i){var r=i.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==r&&3===r.length||null!==(r=i.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===r.length))throw new Error("マクロではありません");var o=r[1],n=K["$"+o.toLowerCase()],_=r[2]?r[2]:"";return void 0===n?new Dt(t,e,a,s,k.UNDEFINED,_.split(",")):new Dt(t,e,a,s,n,_.split(",").map((function(t){return t.trim()})))}var Mt,Nt=function(){function t(t,e,a,s,i,r,o){this._wwa=t,this._coord=e,this._width=a,this._height=s,this._isVisible=i,this._parentElement=r,this._element=document.createElement("div"),this._element.style.position="absolute",this._element.style.borderWidth="2px",this._element.style.borderStyle="solid",t.isClassicMode()?this._element.style.borderRadius="15px":this._element.style.borderRadius="10px",this._element.classList.add("wwa-message-window"),this._element.style.zIndex=o+"",this._element.style.left=this._coord.x+"px",this._element.style.top=this._coord.y+"px",this._element.style.width=this._width+"px",this._element.style.height=this._height+"px",this._parentElement.appendChild(this._element)}return t.prototype.update=function(t){},t.prototype.show=function(){this._isVisible=!0,this._element.style.display="block",this.update(),this._wwa.wwaCustomEvent("wwa_window_show",{name:this.windowName,element:this._element,text:this._element.textContent})},t.prototype.hide=function(){this._isVisible=!1,this._element.style.display="none",this.update(),this._wwa.wwaCustomEvent("wwa_window_hide",{name:this.windowName})},t.prototype.isVisible=function(){return this._isVisible},Object.defineProperty(t.prototype,"windowName",{get:function(){return"TextWindow"},enumerable:!1,configurable:!0}),t}(),Pt=function(t){function e(e,a,s,i,r,o,n){var _=t.call(this,e,new f(a.x,a.y),s,i,r,o,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=Q.CHIP_SIZE+"px",_._monsterBox.style.height=Q.CHIP_SIZE+"px",_._monsterBox.style.position="absolute",_._monsterBox.style.left="10px",_._monsterBox.style.top="10px",_._monsterBox.style.backgroundImage="url("+_._cgFileName.replace("(","\\(").replace(")","\\)")+")",_._monsterBox.style.backgroundPosition="0 0",_._element.appendChild(_._monsterBox),_._energyBox=document.createElement("div"),_._energyBox.style.position="absolute",_._energyBox.style.left="80px",_._energyBox.style.top="10px",_._energyBox.textContent="生命力 0",_._element.appendChild(_._energyBox),_._strengthBox=document.createElement("div"),_._strengthBox.style.position="absolute",_._strengthBox.style.left="80px",_._strengthBox.style.top="30px",_._strengthBox.textContent="攻撃力 0",_._element.appendChild(_._strengthBox),_._defenceBox=document.createElement("div"),_._defenceBox.style.position="absolute",_._defenceBox.style.left="180px",_._defenceBox.style.top="30px",_._defenceBox.textContent="防御力 0",_._element.appendChild(_._defenceBox),_._isVisible?_._element.style.display="block":_._element.style.display="none",_}return Tt(e,t),e.prototype.update=function(t){void 0!==t&&(this._monsterBox.style.backgroundPosition="-"+t.imgCoord.x+"px -"+t.imgCoord.y+"px",this._energyBox.textContent="生命力 "+t.status.energy,this._strengthBox.textContent="攻撃力 "+t.status.strength,this._defenceBox.textContent="防御力 "+t.status.defence)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"MonsterWindow"},enumerable:!1,configurable:!0}),e}(Nt),bt=function(t){function e(e,a,s,i){var r=this;return e.isClassicMode()?((r=t.call(this,e,new f(2*Q.CHIP_SIZE,30),7*Q.CHIP_SIZE,40,s,i,202)||this)._element.style.borderWidth="0",r._element.style.borderRadius="4px",r._element.style.fontSize="20px",r._element.style.lineHeight="40px"):r=t.call(this,e,new f(a.x,a.y),340,30,s,i,202)||this,r._element.style.textAlign="center",r._isVisible?r._element.style.display="block":r._element.style.display="none",r.update(0),r}return Tt(e,t),e.prototype.update=function(t){void 0!==t&&(this._element.textContent="Score: "+t)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"ScoreWindow"},enumerable:!1,configurable:!0}),e.WINDOW_NAME="ScoreWindow",e}(Nt);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Mt||(Mt={}));var Rt=function(){function t(t,e,a,s,i,r,o,n,_,c){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var h=this,u=r.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=r,this._x=e,this._y=a,this._width=s,this._height=i,this._message=new Ot([],!1),this._isVisible=o,this._isYesno=n,this._isItemMenu=_,this._element=document.createElement("div"),this._element.id="wwa-text-message-window",this._element.classList.add("wwa-message-window"),this._msgWrapperElement=document.createElement("div"),this._msgWrapperElement.style.textAlign="left",this._msgWrapperElement.style.wordWrap="break-word",this._msgWrapperElement.style.margin=t.isClassicMode()?"8px 0 8px 16px":"0",this._msgWrapperElement.style.padding=t.isClassicMode()?"0":"7px",this._element.appendChild(this._msgWrapperElement),this._saveElement=document.createElement("div"),this._saveElement.style.padding="0",this._saveElement.style.margin="0",this._element.appendChild(this._saveElement),this._dummyElement=document.createElement("div"),this._dummyElement.style.display="none",this._dummyElement.style.padding="0",this._dummyElement.style.margin="0",this._dummyElement.style.height="55px",this._element.appendChild(this._dummyElement),this._ynWrapperElement=document.createElement("div"),this._ynWrapperElement.classList.add("wwa-yesno-wrapper"),this._element.appendChild(this._ynWrapperElement),this._parentElement=c,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+u+")",this._divYesElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.YES),h.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+u+")",this._divNoElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.NO),h.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),h._isInputDisable=!1,t.userDevice.device){case M.SP:case M.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,a,s){this._x=t,this._y=e,this._width=a,this._height=s,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,a,s,i){var r,o=s.getPartsCoord().substract(i.getPartsCoord()).y;r=t?Mt.BOTTOM:e?Mt.SCORE:a?Mt.CENTER:o>=Math.ceil(Q.V_PARTS_NUM_IN_WINDOW/2)?Mt.TOP:Mt.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Mt.CENTER?(this._y=Q.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Mt.TOP?(this._y=Math.max(20,Q.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Mt.BOTTOM?(this._y=Math.min(Q.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*Q.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Mt.SCORE?(this._y=80,void this.update()):void 0},t.prototype.setParsedMessage=function(t){this._message=t,this.update()},t.prototype.clear=function(){this._message=new Ot([],!1),this.update()},t.prototype.setYesNoChoice=function(t){return this._isInputDisable=!1,this._isYesno=t,this.update(),this._isYesno},t.prototype.isYesNoChoice=function(){return this._isYesno},t.prototype.isSaveChoice=function(){return this._isSave},t.prototype.setItemMenuChoice=function(t){return this._isInputDisable=!1,this._isItemMenu=t,this.update(),this._isItemMenu},t.prototype.isItemMenuChoice=function(){return this._isItemMenu},t.prototype.setInputDisable=function(){this._isInputDisable=!0},t.prototype.isInputDisable=function(){return this._isInputDisable},t.prototype.show=function(){this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isWideChar=function(t){return null!==t.match(/^[^\x01-\x7E\xA1-\xDF]+$/)},t.prototype.createClassicTextElement=function(t){for(var e=document.createElement("span"),a=0,s="",i=0;i<t.length||0!=a;i++)if(this.isWideChar(t.charAt(i))?a+=2:a+=1,s+=t.charAt(i),a+1>2*Q.MSG_STR_WIDTH){"。"!==t.charAt(i+1)&&"、"!==t.charAt(i+1)||(s+=t.charAt(i+1),i++);var r=document.createElement("span");r.style.display="inline-block",r.style.width="100%",r.textContent=s,e.appendChild(r),a=0,s=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===g.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YESP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):this._wwa.getYesNoState()===g.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NOP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var a=this._message.generatePrintableMessage().split("\n");a.forEach((function(e,s){var i;t._wwa.isClassicMode()?i=t.createClassicTextElement(e):(i=document.createElement("span")).textContent=a[s],t._msgWrapperElement.appendChild(i),t._msgWrapperElement.appendChild(document.createElement("br"))})),this._isVisible?(this._element.style.left=this._x+"px",this._element.style.top=this._y+"px"):(this._element.style.left="-999999px",this._element.style.top="-999999px"),this._isSave?this._saveElement.style.display="block":this._saveElement.style.display="none",this._element.style.width=this._width+"px",this._element.style.minHeight=this._height+"px"},t.prototype.setWWASave=function(t){this._wwaSave=t},t.prototype.createSaveDom=function(){var t,e,a,s,i,r,o,n,_,c,h,u=this;e=document.createElement("div"),c=(n=document.getElementById("disp-energy")).style.backgroundPosition,h=n.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(a=document.createElement("div")).classList.add("savedata"),a.setAttribute("save_id",p),a.addEventListener("click",(function(t){u.setSaveID(0|t.currentTarget.getAttribute("save_id")),u._save_close=!0,t.preventDefault()})),(s=document.createElement("div")).classList.add("ss"),a.appendChild(s),(i=document.createElement("div")).classList.add("wide-cell-row"),i.style.backgroundPosition=c,i.style.backgroundImage=h,a.appendChild(i),e.appendChild(a),t.flag&&(s.appendChild(t.cvs),(r=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(r.style.color=q.DATE_LAST_SAVE_TEXT_COLOR),s.appendChild(r),(o=document.createElement("div")).classList.add("status-icon"),o.style.backgroundImage=h,o.style.backgroundPosition="-120px -80px",i.appendChild(o),(_=document.createElement("div")).classList.add("status-value-box"),_.textContent=t.getStatusEnergy(),i.appendChild(_));this._saveElement.textContent="",this._saveElement.appendChild(e),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1},t.prototype.deleteSaveDom=function(){this._saveElement.textContent="",this._isSave=!1},t.prototype.setSaveID=function(t){this._save_select_id=t;for(var e,a=document.querySelectorAll(".savedata"),s=a.length,i=0;i<s;i++)e=a[i],t===i?e.classList.add("select"):e.classList.remove("select")},t.prototype.save=function(t,e){return this._wwaSave.save(t,e,this._save_select_id)},t.prototype.load=function(){return this._wwaSave.load(this._save_select_id)},t.prototype.saveUpdate=function(){this._save_counter>0&&this._save_counter--},t.prototype.isSaveClose=function(){return this._save_close},t.prototype.cursor_wait=function(){this._save_counter=Q.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case u.DOWN:this._save_select_id-=2,this.cursor_wait();break;case u.UP:this._save_select_id+=2,this.cursor_wait();break;case u.LEFT:this._save_select_id--,this.cursor_wait();break;case u.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+q.QUICK_SAVE_MAX)%q.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Lt=function(){function t(t,e,a){this.id=t,this.imgFileName=e,this.parent=a,this.elem=document.createElement("div"),this.elem.classList.add("est"),this.elem.setAttribute("id","wwa-est-"+t),this.imgElem=document.createElement("div"),this.imgElem.classList.add("est-img-wrapper"),this.imgElem.style.backgroundImage="url("+this.imgFileName.replace("(","\\(").replace(")","\\)")+")",this.statusElem=document.createElement("div"),this.statusElem.classList.add("est-status-wrapper"),this.energyElem=document.createElement("div"),this.energyElem.classList.add("est-energy"),this.energyDispElem=document.createElement("span"),this.energyDispElem.classList.add("est-energy-disp"),this.energyElem.appendChild(this.energyDispElem),this.statusElem.appendChild(this.energyElem),this.strengthElem=document.createElement("div"),this.strengthElem.classList.add("est-strength"),this.strengthDispElem=document.createElement("span"),this.strengthDispElem.classList.add("est-strength-disp"),this.strengthElem.appendChild(this.strengthDispElem),this.statusElem.appendChild(this.strengthElem),this.defenceElem=document.createElement("div"),this.defenceElem.classList.add("est-defence"),this.defenceDispElem=document.createElement("span"),this.defenceDispElem.classList.add("est-defence-disp"),this.defenceElem.appendChild(this.defenceDispElem),this.statusElem.appendChild(this.defenceElem),this.damageElem=document.createElement("div"),this.damageElem.classList.add("est-damage"),this.damageDispElem=document.createElement("span"),this.damageDispElem.classList.add("est-damage-disp"),this.damageElem.appendChild(this.damageDispElem),this.statusElem.appendChild(this.damageElem),this.elem.appendChild(this.imgElem),this.elem.appendChild(this.statusElem)}return t.prototype.hide=function(){this.elem.style.display="none"},t.prototype.show=function(){this.elem.style.display="block"},t.prototype.setResult=function(t,e,a){this.imgElem.style.backgroundPosition="-"+t.x+"px -"+t.y+"px",this.energyDispElem.textContent="生命力 "+e.energy,this.strengthDispElem.textContent="攻撃力 "+e.strength,this.defenceDispElem.textContent="防御力 "+e.defence,a.isNoEffect?this.damageDispElem.textContent="攻撃無効":a.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+a.damage},t}(),xt=function(){function t(t,e,a){var s,i=this;this._wwa=t,this._imgFileName=e,this._parent=a,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var r=0;r<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)s=new Lt(r,this._imgFileName,this._element),this._edes.push(s),this._element.appendChild(s.elem);this._element.addEventListener("click",(function(){i._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var a=0;a<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++)if(a>=e.length)this._edes[a].hide();else{var s=this._wwa.getObjectAttributeById(e[a],Q.ATR_X),i=this._wwa.getObjectAttributeById(e[a],Q.ATR_Y),r=new f(s,i),o=this._wwa.getObjectAttributeById(e[a],Q.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[a],Q.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[a],Q.ATR_DEFENCE),c=new E(o,n,_,0),h=Ut(t,c);this._edes[a].setResult(r,c,h),this._edes[a].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Bt=function(t,e,a){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=a};function Ut(t,e){var a=e.energy,s=t.strength-e.defence,i=Math.max(0,e.strength-t.defence),r=0,o=0;if(!(s>0))return new Bt(!0,!1,0);for(;;){if(r++,(a-=s)<=0)return new Bt(!1,!1,o);if(o+=i,r>1e4)return new Bt(!1,!0,0)}}var Wt,Yt=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},kt=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Wt||(Wt={}));var Ft=function(){function t(t,e,a){var s=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=a,this.COPIED_MESSAGE_DISPLAY_MS=1e3,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-password-window"),this._element.style.display="none",this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("wwa-password-description"),this._passwordBoxElement=document.createElement("textarea"),this._passwordBoxElement.setAttribute("cols","50"),this._passwordBoxElement.setAttribute("rows","16"),this._passwordBoxElement.addEventListener("focus",(function(t){s._passwordBoxElement.select()})),this._buttonWrapperElement=document.createElement("div"),this._buttonWrapperElement.classList.add("wwa-password-submit"),this._okButtonElement=document.createElement("button"),this._okButtonElement.textContent="OK",this._okButtonElement.addEventListener("click",(function(){s._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){s._wwa.hidePasswordWindow(!0)})),this._copyButtonElement=document.createElement("button"),this._copyButtonElement.textContent="コピー",this._copyButtonElement.addEventListener("click",(function(){return Yt(s,void 0,void 0,(function(){var t=this;return kt(this,(function(e){switch(e.label){case 0:return[4,navigator.clipboard.writeText(this.password)];case 1:return e.sent(),this._copyButtonElement.textContent="コピーしました",this._copyButtonElement.disabled=!0,setTimeout((function(){t._copyButtonElement&&(t._copyButtonElement.textContent="コピー",t._copyButtonElement.disabled=!1)}),this.COPIED_MESSAGE_DISPLAY_MS),[2]}}))}))})),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._buttonWrapperElement.appendChild(this._copyButtonElement),this._mode=Wt.LOAD,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}return Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=t,t===Wt.LOAD&&(this.password="")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"password",{get:function(){return this._passwordBoxElement.value},set:function(t){this._passwordBoxElement.value=t},enumerable:!1,configurable:!0}),t.prototype.show=function(t){void 0!==t&&(this.mode=t),this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.update=function(){var t,e="";if(this._mode===Wt.LOAD){t=this._isDisallowLoadOldSave,e="下のボックスに前回のプレイで取得した\n復帰用パスワードを貼り付けてください。\nJava 版 WWA で取得したパスワードはご利用になれません。\n作成者が ".concat(t?"マップの内容":"ワールド名 か マップの暗証番号"," を変更した場合は\nそれ以前に取得したパスワードは使えなくなります。");try{this._passwordBoxElement.removeAttribute("readonly")}catch(t){}this._cancelButtonElement.style.display="inline",this._copyButtonElement.style.display="none"}else e="下記テキストがデータ復帰用のパスワードになっています。\nコピーしてメモ帳などのテキストエディタに貼り付けて\n保存してください。",this._passwordBoxElement.setAttribute("readonly","readonly"),this._cancelButtonElement.style.display="none",this._copyButtonElement.style.display="inline";var a=e.split("\n");this._descriptionElement.textContent="";for(var s=0;s<a.length;s++){var i=document.createElement("span");i.textContent=a[s],this._descriptionElement.appendChild(i),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function Gt(t,e){var a,s,i=document.createElement("style");i.type="text/css",i.setAttribute("id",Q.WWA_STYLE_TAG_ID),(a="head",document.getElementsByTagName(a))[0].appendChild(i),t.innerHTML=(s=null!==e?'\n <div id="wwa-cover">\n <div id="version"></div>\n <div id="progress-message-container">開始しています...</div>\n <div id="progress-bar-bg"></div>\n <div id="progress-bar" class="progress-bar"></div>\n <div id="progress-bar-audio" class="progress-bar"></div>\n <div id="progress-disp">---</div>\n </div>\n ':'\n <div id="wwa-cover">\n <canvas id="progress-panel" width="'.concat(Q.SCREEN_WIDTH,'" height="').concat(Q.SCREEN_HEIGHT,'"></canvas>\n </div>'),'\n <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">\n このブラウザは、Canvas要素をサポートしていません。\n </canvas>\n <canvas id="wwa-map-sub" class="wwa-canvas" width="440" height="440"></canvas>\n <div id="wwa-sidebar">\n <div class="wide-cell-row" id="disp-energy"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-strength"><div class="status-icon"></div><div class="status-value-box"> 0 </div></div>\n <div class="wide-cell-row" id="disp-defence"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-gold"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="item-cell" id="item0"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item1"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item2"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item3"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item4"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item5"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item6"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item7"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item8"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item9"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item10"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item11"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="wide-cell-row" id="cell-load">Password</div><div class="wide-button" id="button-load"></div>\n <div class="wide-cell-row" id="cell-save">Quick Save</div><div class="wide-button" id="button-save"></div>\n <div class="wide-cell-row" id="cell-restart">Restart Game</div><div class="wide-button" id="button-restart"></div>\n <div class="wide-cell-row" id="cell-gotowwa">Goto WWA</div><div class="wide-button" id="button-gotowwa"></div>\n </div>\n <div id="wwa-controller"></div>\n <div id="wwa-fader"></div>\n'.concat(s)),null!==e&&(_t("wwa-cover").style.backgroundImage="url(".concat(e,")"),_t("wwa-cover").style.backgroundRepeat="no-repeat",_t("wwa-cover").style.backgroundPosition="0 0")}var Vt=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=Q.CONTROLL_WAIT_FRAME},t.prototype.allClear=function(){this.col=0,this.row=0,this.counter=0},t.prototype.controll=function(e){if(!(this.counter>0))switch(e){case u.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case u.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case u.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case u.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=ht(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var a=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(a)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,a,s=null;for(e=0;e<t.COL_MAX;e++)for(a=0;a<t.ROW_MAX;a++)(s=_t(t.DOM_ID_TABLE[a][e])).classList.contains("onpress")&&s.classList.remove("onpress")},t.prototype.openView=function(){this.close();_t(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),Ht=a(23);function Kt(t){return"^ /".concat(231*t+8310,"P+>A[]")}function jt(t){return(0,Ht.MD5)(t).toString()}var Xt="map",Jt="mapObject",Zt="systemMessage",Qt="userVar",qt={mapAttribute:!0,objectAttribute:!0,message:!0},zt=function(){},$t=function(){function t(){}return t.compress=function(t){var e,a,s={};for(e in t)if(!qt[e]){switch(typeof(a=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===a&&"worldName"!==e)continue;break;case"object":if(null===a){if(this._restartData[e]===a)continue}else if(void 0===(a=this.compressObject(e,a,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}s[e]=a}return s},t.compressObject=function(t,e,a){var s,i,r,o;switch(t){case Xt:case Jt:var n,_,c,h,u,l,p,d,E,f,y,w,m,g;for(u in s={},E={},d={},e)for(h in i=e[u],r=a[u],o={},_=-1,i)(p=i[h])!==r[h]&&(o[h]=p,void 0===E[p]&&(E[p]={}),void 0===(y=E[p])[u]&&(y[u]=[]),(m=y[u]).push(Number(h)));for(w in E)for(u in y=E[w],void 0===d[w]&&(d[w]={}),f=d[w],void 0===s[w]&&(s[w]=[]),_=-1,y)1===(m=y[u]).length?(void 0===f[l=m[0]]&&(f[l]=[]),(g=f[l]).push(Number(u))):(c=(n=Number(u))-_-1,_=n,s[w].push(this.getCompressArray(m),c));for(w in d)for(h in p=Number(w),_=-1,f=d[w])g=f[h],c=(n=Number(h))-_-1,_=n,1===g.length?s[w].push(c,g[0]):s[w].push(c,this.getCompressArray(g));var A=[];for(w in _=-1,s)c=(n=Number(w))-_-1,_=n,A.push(c,s[w]);return this._usingByteFlag&&JSON.stringify(A).length>=this._mapByteLength?this.compressMapAllObject(e,a,this._firstRandomMapObjectUtf8Table[t]):A;case Zt:var S;for(t in s={},e)S=e[t],a[t]!==S&&(s[t]=S);break;case Qt:return this.compressUserVars(e);default:return e}if(0!==Object.keys(s).length)return s},t.compressUserVars=function(t){return t.map((function(t,e){return[e,t]})).filter((function(t){t[0];return 0!==t[1]}))},t.compressMapAllObject=function(t,e,a){var s,i,r,o,n,_,c,h,u,l,p,d,E,f,y,w,m=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),A=-1;for(r=0,o=0,_=0,c=0,y=0,p=[],f={},u=[],l=[],i=0;i<m;i++)for(s=0;s<m;s++)(h=t[i][s])!==e[i][s]&&(-1===A&&(A=o),g[o]=g[o]|1<<r,_=o,void 0===f[h]&&(f[h]=new te(h,y++)),f[h].count++),8===++r&&(r=0,o++);for(n in f)p[f[n].index]=f[n];for(d in p.sort(this.idSort),E={},p)E[h=p[d].id]=Number(d),u[d]=h;for(i=0;i<m;i++)for(s=0;s<m;s++)(h=t[i][s])!==e[i][s]&&(l[c++]=E[h]);if(a){for(w=g.length,A=-1,_=0,o=0;o<w;o++)g[o]=g[o]&~a[o],0!==g[o]&&(-1===A&&(A=o),_=o);-1===A&&(A=0,_=0)}return[A,g.subarray(A,_+1),u,this.indexListCompress(l,u.length)]},t.indexListCompress=function(t,e){var a,s,i,r,o,n,_=[];for(r=t.length,s=0,a=0;a<r;a++){for(o=t[a],n=0,i=a+1;i<r&&o===t[i];i++)n++,a=i;switch(n){case 0:_[s++]=o;break;case 1:_[s++]=o,_[s++]=o;break;default:_[s++]=o,_[s++]=e+n}}return _},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,a,s,i,r,o,n,_,c=[];for(e=-1,r=t.length,o=0,i=0;i<r;i++){for(a=(s=t[i])-e,n=0,_=i;_<r-1&&t[_]+1===t[_+1];)_++,n++;n<this.MIN_LOOP_COUNT?c[o++]=a:(i=_,s+=n,c[o++]=0,c[o++]=a,c[o++]=n-this.MIN_LOOP_COUNT),e=s}return c},t.getDecompressArray=function(t){var e,a,s,i,r,o,n,_=[];for(e=-1,r=t.length,i=0,n=0;i<r;i++)if(0===(a=t[i])){for(o=(s=e+(a=t[++i]))+t[++i]+this.MIN_LOOP_COUNT;s<=o;s++)_[n++]=s;e=o}else s=e+a,_[n++]=s,e=s;return _},t.decompress=function(t){var e,a,s;for(a in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(s=t[a])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==s&&(s=this.decompressObject(a,s,e[a]));break;case"function":continue}e[a]=s}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,a){var s;switch(t){case Xt:case Jt:var i,r,o,n,_,c,h,u;s={},r=-1;var l,p,d=e;if(4===(u=d.length)&&"number"==typeof d[0]&&(d[1]instanceof Uint8Array||d[1]instanceof Array)&&d[2]instanceof Array&&d[3]instanceof Array)return this.decompressAllMapObject(d,a,this._firstRandomMapObjectUtf8Table[t]),a;for(h=0;h<u;h+=2)r=i=r+Number(d[h])+1,_=i,s[i]=d[h+1];for(c in s){for(_=Number(c),u=(d=s[c]).length,l=[],p=[],h=0;h<u;h+=2){var E=d[h],f=d[h+1];E instanceof Array&&(E=this.getDecompressArray(E)),f instanceof Array&&(f=this.getDecompressArray(f)),"object"==typeof E?l.push({x:E,y:f}):p.push({x:E,y:f})}var y;for(y in r=-1,l)if(r=i=r+Number(l[y].y)+1,E=l[y].x,n=String(i),E instanceof Array)for(u=(d=E).length,h=0;h<u;h++)o=String(d[h]),a[n][o]=_;else o=String(E),a[n][o]=_;for(y in r=-1,p)if(r=i=r+Number(p[y].x)+1,f=p[y].y,o=String(i),f instanceof Array)for(u=(d=f).length,h=0;h<u;h++)a[n=String(d[h])][o]=_;else a[n=String(f)][o]=_}return a;case Qt:return this.decompressUserVars(e);default:if(a);else{if(!e)return;a=a instanceof Array?[]:{}}for(t in e)a[t]=e[t];return a}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var a=e[0],s=e[1];return t[a]=s,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(Q.USER_VAR_NUM),e=0;e<Q.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,a){var s,i,r,o,n,_,c,h,u,l,p,d=this._restartData.mapWidth,E=new Uint8Array(this._mapByteLength);p=t[0],o=t[2],i=t[3];var f=t[1];if(E.set(f,p),a)for(y=E.length,u=0;u<y;u++)E[u]=E[u]|a[u];r=[];var y,w,m,g,A,S,I=o.length;for(y=i.length,w=0,m=0;w<y;w++){if((n=i[w])>=I)for(g=n-I,A=0;A<g;A++)r[m++]=S;else r[m++]=n;S=n}for(h=0,u=0,l=0,_=0,y=E.length,u=0;u<y;u++)for(h=0;h<8;h++){if(0!=(E[u]&1<<h)){if(void 0===(n=r[_++]))return!1;s=o[n],c=l%d,e[l/d|0][c]=s}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[Jt]=this.getChangedUint8Array(e[Jt],t[Jt])},t.getChangedUint8Array=function(t,e){var a,s,i,r,o=this._restartData.mapWidth,n=new Uint8Array(this._mapByteLength),_=-1;for(i=0,r=0,s=0;s<o;s++)for(a=0;a<o;a++)t[s][a]!==e[s][a]&&(-1===_&&(_=r),n[r]=n[r]|1<<i),8===++i&&(i=0,r++);return n},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var a;if(e)try{if(a=this.decompress(e)[0])return a}catch(t){}return this._restartData},t.usingByte=function(t){this._usingByteFlag=t},t._usingByteFlag=!1,t.MIN_LOOP_COUNT=3,t._restartData=void 0,t._mapByteLength=0,t._firstRandomMapObjectUtf8Table=new zt,t}(),te=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},ee=function(){function t(t,e){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=t,this._parent=e,this.cvs=document.createElement("canvas"),this.cvs.width=q.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=q.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){_t("cell-load").textContent=z.QUICK_LOAD},t.prototype.save=function(t,e){return this._statusEnergy=e.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(t,0,0,t.width,t.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=e,this.flag=!0,this.date=new Date,this.showQickLoad(),!0},t.prototype.getStatusEnergy=function(){return this.flag?this._statusEnergy:-1},t.prototype.load=function(){return this.quickSaveData},t.prototype.saveDataSet=function(t,e,a){var s=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=a,this.flag=!0;var i=document.createElement("img");i.src=t,i.addEventListener("load",(function(){s.flag=!0,s.ctx.drawImage(i,0,0,i.width,i.height,0,0,s.cvs.width,s.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,a,s,i,r;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,a=this.date.getDate(),s=this.date.getHours(),i=this.date.getMinutes(),r=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(a=("0"+a).slice(-2))+" "+(s=("0"+s).slice(-2))+":"+(i=("0"+i).slice(-2))+":"+(r=("0"+r).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),ae=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),se=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ae(e,t),e.prototype.save=function(e,a){var s=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,a,this.date),s},e}(ee),ie=se,re=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),oe=function(t){function e(){var a=t.call(this)||this;return Object.setPrototypeOf(a,Object.create(e.prototype)),a}return re(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<q.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,a=0;a<q.QUICK_SAVE_MAX;a++)(e=this[a]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),ne=function(){return ne=Object.assign||function(t){for(var e,a=1,s=arguments.length;a<s;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ne.apply(this,arguments)},_e=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?ne(ne({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?ne(ne({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},ce=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),he=function(t){function e(a,s,i){void 0===i&&(i=e.prototype);var r=t.call(this)||this;r.IDBTransaction={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchangetransaction"},r.keyPath=["id","url"],Object.setPrototypeOf(r,Object.create(i));for(var o=0;o<q.QUICK_SAVE_MAX;o++)r[o]=new ie(o,r);return r.onCheckLoadingSaveData=a,r.onCompleteLoadingSaveData=s,r.createDataBase(),r.selectSaveData(),r}return ce(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(q.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var a=this.indexDBOpen();a.onupgradeneeded=function(e){var s=a.result,i={keyPath:t.keyPath};s.objectStoreNames.contains(q.INDEXEDDB_TABLE_NAME)||s.createObjectStore(q.INDEXEDDB_TABLE_NAME,i).createIndex("url","url",{unique:!1})},a.onsuccess=e.doNotAnything,a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var a=e.transaction(q.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(q.INDEXEDDB_TABLE_NAME)}catch(t){return}return a},e.prototype.makeSaveDataItem=function(t,e,a,s){return{url:location.href,id:t,hash:me.checkOriginalMapString,image:e.toDataURL(),data:a,date:s,worldName:me.worldName,mapDataRevisionKey:me.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var a=t.index("url"),s=IDBKeyRange.only(location.href),i=a.getAll(s);i.onsuccess=function(){e(i.result)}},e.prototype.dbUpdateSaveData=function(t,a,s,i){var r=this,o=this.indexDBOpen();o.onupgradeneeded=e.doNotAnything,o.onsuccess=function(){var n=r.getObjectStore(o.result),_=$t.compress(s),c=r.makeSaveDataItem(t,a,_,i);r.selectDatas[t]=c;var h=n.put(c);h.onsuccess=e.doNotAnything,h.onerror=e.doNotAnything},o.onerror=e.doNotAnything,o.onblocked=e.doNotAnything},e.prototype.dbDeleteSaveData=function(t){var a=this,s=this.indexDBOpen();s.onupgradeneeded=e.doNotAnything,s.onsuccess=function(){var e=a.getObjectStore(s.result);t.forEach((function(t){e.delete([t,location.href])}))},s.onerror=e.doNotAnything,s.onblocked=e.doNotAnything},e.prototype.selectSaveData=function(){var t=this,a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=t.getObjectStore(a.result);t.selectDatas=[];t.getSaveDataResult(e,(function(e){var a,s,i,r=[];for(s=e.length,a=0;a<s;a++){var o=e[a];try{i={id:o.id,hash:o.hash,data:o.data,date:o.date,image:o.image,worldName:o.worldName,mapDataRevisionKey:o.mapDataRevisionKey}}catch(t){continue}var n=t.onCheckLoadingSaveData(i.worldName,i.hash,i.mapDataRevisionKey);if(null===n){if(t[i.id]){var _=_e($t.decompress(i.data)[0]);t[i.id].saveDataSet(i.image,_,i.date)}}else r.push({id:i.id,cause:n})}r.length>0&&t.dbDeleteSaveData(r.map((function(t){return t.id})));var c=r.map((function(t){return t.cause})).filter((function(t,e,a){return a.indexOf(t)===e}));t.onCompleteLoadingSaveData(c)}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything},e.doNotAnything=function(){},e}(oe),ue=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e}(ee),pe=le,de=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Ee=function(t){function e(){var a=t.call(this)||this;a._saveNo=0,a._lastAutoSaveMove=0,a._autoInterval=q.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(a,Object.create(e.prototype));for(var s=0;s<q.QUICK_SAVE_MAX;s++)a[s]=new pe(s,a);return a._saveNo=0,a._lastAutoSaveMove=0,a}return de(e,t),e.prototype.resumeStart=function(){this._lastAutoSaveMove=-1},e.prototype.setPlayer=function(t){this._lastAutoSaveMove=t.getMoveCount()},e.prototype.isAutoSaveFrame=function(t){if(0===this._autoInterval)return!1;var e=t.getMoveCount();return!(this._lastAutoSaveMove>=e)&&(e%this._autoInterval==0&&(this._lastAutoSaveMove=e,!0))},e.prototype.autoSave=function(t,e){this[this._saveNo].save(t,e),this._saveNo++,this._saveNo=this._saveNo%q.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(oe);function fe(t,e){return(0,Ht.MD5)(t+e).toString()}var ye,we=function(){function t(e,a,s,i,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=a,t.mapDataRevisionKey=fe(a,s),this._wwaDBSaveList=new he(i,r),this._wwaLogSaveList=new Ee,this.selectDBSaveDataList()}return t.prototype.resumeStart=function(){this._wwaLogSaveList.resumeStart()},t.prototype.isAutoSaveFrame=function(t){return this._wwaLogSaveList.isAutoSaveFrame(t)},t.prototype.autoSave=function(t,e){this._wwaLogSaveList.autoSave(t,e)},t.prototype.selectDBSaveDataList=function(){this.list=this._wwaDBSaveList},t.prototype.selectLogSaveDataList=function(){this.list=this._wwaLogSaveList},t.prototype.save=function(t,e,a){var s=this.list[a];return!!s&&s.save(t,e)},t.prototype.load=function(t){var e=this.list[t];return e?e.load():null},t.prototype.hasSaveData=function(){return this.list.hasSaveData()},t.prototype.setAutoSaveInterval=function(t){return this._wwaLogSaveList.setAutoSaveInterval(t)},t.prototype.getFirstSaveChoiceCallInfo=function(t){return t?P.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?P.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?P.CALL_BY_LOG_QUICK_LOAD:P.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?P.CALL_BY_LOG_QUICK_LOAD:t?P.CALL_BY_PASSWORD_LOAD:P.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?_t("cell-save").textContent=z.EMPTY_SAVE:_t("cell-save").textContent=z.QUICK_SAVE},t}(),me=we;!function(t){t.UNMATCHED_WORLD_NAME="UNMATCHED_WORLD_NAME",t.UNMATCHED_WORLD_PASS_NUMBER="UNMATCHED_WORLD_PASS_NUMBER",t.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA="DISALLOW_OLD_REVISION_WORLD_SAVE_DATA"}(ye||(ye={}));var ge,Ae=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Se=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ie=function(){function t(t,e,a,s){var i=this;this.id=t,this.fileName=e,this.audioContext=a,this.audioGain=s,this.disposeBufferSource=function(t){try{t.stop(),t.disconnect(i.audioGain),t.buffer=null}catch(t){}t.onended=null},this.audioContext=a,this.audioGain=s,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.load()}return t.prototype.fetchSoundFile=function(){return Ae(this,void 0,void 0,(function(){return Se(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,fetch(this.fileName)];case 1:return[2,t.sent()];case 2:return t.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (fetch)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.getArrayBuffer=function(t){return Ae(this,void 0,void 0,(function(){return Se(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t.arrayBuffer()];case 1:return[2,e.sent()];case 2:return e.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (arrayBuffer)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.load=function(t){return void 0===t&&(t=0),Ae(this,void 0,void 0,(function(){var e,a,s=this;return Se(this,(function(i){switch(i.label){case 0:return t>=10?(console.log("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (最大リトライ回数超過)")),this.isExceededMaxRetryCount=!0,[2]):[4,this.fetchSoundFile()];case 1:return(e=i.sent())?0!==e.status&&200!==e.status?(console.warn("サウンド ".concat(this.id," 番の音声ファイルが見つかりません! HTTPエラー番号: ").concat(e.status)),this.cancelLoad(),[2]):[4,this.getArrayBuffer(e)]:(this.retry(t),[2]);case 2:return(a=i.sent())?(this.audioContext.decodeAudioData(a,(function(e){if(0===e.length)return console.log("サウンド ".concat(s.id," 番の音声ファイルのバッファサイズが 0 です ")),void s.retry(t);s.setData(e)})),[2]):(this.retry(t),[2])}}))}))},t.prototype.retry=function(t){var e=this;setTimeout((function(){return Ae(e,void 0,void 0,(function(){return Se(this,(function(e){switch(e.label){case 0:return[4,this.load(t+1)];case 1:return e.sent(),[2]}}))}))}),100)},t.prototype.setData=function(t){this.audioBuffer=t,this.isLoaded=!0},t.prototype.cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},t.prototype.play=function(){var t=this,e=this.audioContext.createBufferSource();this.bufferSources.push(e),e.buffer=this.audioBuffer,this.isBgm()&&(e.loop=!0),e.connect(this.audioGain);var a=e.duration;(!isFinite(a)||a<0||"number"!=typeof a)&&(a=0),e.start(),e.onended=function(){var a=t.bufferSources.indexOf(e);-1!==a&&t.bufferSources.splice(a,1),t.disposeBufferSource(e)},this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=H.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),ve=function(t,e){for(var a=new Array(t),s=0;s<a.length;s++)a[s]=new Array(e);return a};function Te(t,e){var a=function(t){return t[ge.CHECK]+256*t[ge.CHECK+1]}(t),s=function(t,e){var a,s=0;if(t[ge.VERSION]>=29){for(var i=2;i<e;i++)s+=(a=t[i],((a%=256)>=128?a-256:a)*(i%8+1));s=s%65536&65535}return s}(t,e);if(a!==s)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+a+"ですが、実際の和は"+s+"でした。")}!function(t){t[t.CHECK=0]="CHECK",t[t.VERSION=2]="VERSION",t[t.OLD_MAP_COUNT=3]="OLD_MAP_COUNT",t[t.OLD_OBJ_COUNT=4]="OLD_OBJ_COUNT",t[t.OLD_PLAYER_X=5]="OLD_PLAYER_X",t[t.OLD_PLAYER_Y=6]="OLD_PLAYER_Y",t[t.STATUS_ENERGY=10]="STATUS_ENERGY",t[t.STATUS_STRENGTH=12]="STATUS_STRENGTH",t[t.STATUS_DEFENCE=14]="STATUS_DEFENCE",t[t.STATUS_GOLD=16]="STATUS_GOLD",t[t.OLD_GAMEOVER_X=18]="OLD_GAMEOVER_X",t[t.OLD_GAMEOVER_Y=19]="OLD_GAMEOVER_Y",t[t.OLD_ITEMBOX_TOP=20]="OLD_ITEMBOX_TOP",t[t.STATUS_ENERGY_MAX=32]="STATUS_ENERGY_MAX",t[t.MAP_COUNT=34]="MAP_COUNT",t[t.OBJ_COUNT=36]="OBJ_COUNT",t[t.PLAYER_X=38]="PLAYER_X",t[t.PLAYER_Y=40]="PLAYER_Y",t[t.GAMEOVER_X=42]="GAMEOVER_X",t[t.GAMEOVER_Y=44]="GAMEOVER_Y",t[t.MAP_SIZE=46]="MAP_SIZE",t[t.MESSAGE_NUM=48]="MESSAGE_NUM",t[t.ITEMBOX_TOP=60]="ITEMBOX_TOP",t[t.MAPDATA_TOP=90]="MAPDATA_TOP",t[t.OLD_MAPDATA_TOP=100]="OLD_MAPDATA_TOP"}(ge||(ge={}));var Oe,De,Ce=function(){function t(){}return t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_CROP1=1,t.ATR_CROP2=2,t.ATR_TYPE=3,t.ATR_JUMP_X=16,t.ATR_JUMP_Y=17,t.MAP_LOCALGATE=2,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGPOS_DEFAULT_PLAYER_X=2,t.IMGPOS_DEFAULT_PLAYER_Y=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_STATUS_X=3,t.IMGPOS_DEFAULT_STATUS_Y=2,t.IMGRELPOS_ENERGY_ICON_X=0,t.IMGRELPOS_STRENGTH_ICON_X=1,t.IMGRELPOS_DEFENCE_ICON_X=2,t.IMGRELPOS_GOLD_ICON_X=3,t.IMGPOS_DEFAULT_WIDE_CELL_X=4,t.IMGPOS_DEFAULT_WIDE_CELL_Y=3,t.IMGPOS_DEFAULT_ITEMBOX_X=1,t.IMGPOS_DEFAULT_ITEMBOX_Y=2,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STR_COLOR_R=0,t.DEFAULT_STR_COLOR_G=0,t.DEFAULT_STR_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.DEFAULT_MOVES=0,t.DEFAULT_SPEED_INDEX=3,t.USER_VAR_NUM=256,t}();!function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(Oe||(Oe={})),function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE"}(De||(De={}));var Me=function(){function t(t,e,a){this.byteMapData=t,this.eventEmitter=a,Te(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0,isGameOverDisabled:void 0,gameOverPolicy:"default"}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[ge.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=ge.MAPDATA_TOP:this.currentPosition=ge.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(Oe.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(Oe.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?Ce.MAP_ATR_MAX:Ce.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?Ce.OBJ_ATR_MAX:Ce.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(Oe.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(Oe.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(Oe.MAP),this._convertAttributeV2toV3(Oe.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,a,s;if(t==Oe.MAP)e=this.wwaData.mapPartsMax,a=this.wwaData.mapAttribute,s=Ce.MAP_LOCALGATE;else{if(t!=Oe.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,a=this.wwaData.objectAttribute,s=Ce.OBJECT_LOCALGATE}for(var i=0;i<e;i++){for(var r=9;r>=0;r--){var o=255&a[i][20+2*r],n=a[i][20+2*r]>>8,_=255&a[i][20+2*r+1],c=a[i][20+2*r+1]>>8;250===_?_=9e3:_>100&&(_+=9840),250===c?c=9e3:c>100&&(c+=9840),a[i][20+4*r]=o,a[i][20+4*r+3]=n,a[i][20+4*r+1]=_,a[i][20+4*r+2]=c}a[i][Ce.ATR_TYPE]===s&&(a[i][Ce.ATR_JUMP_X]>100&&(a[i][Ce.ATR_JUMP_X]+=9840),a[i][Ce.ATR_JUMP_Y]>100&&(a[i][Ce.ATR_JUMP_Y]+=9840))}},t.prototype._get1ByteNumber=function(t){return this.byteMapData[t]},t.prototype._get2BytesNumber=function(t){return this.byteMapData[t]+256*this.byteMapData[t+1]},t.prototype._extractInitialParameters=function(){this.wwaData.version>29?(this.wwaData.gameoverX=this._get2BytesNumber(ge.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(ge.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(ge.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(ge.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(ge.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(ge.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(ge.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(ge.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(ge.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(ge.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(ge.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(ge.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(ge.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(ge.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(ge.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(ge.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(ge.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(ge.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(ge.MESSAGE_NUM),this.wwaData.version<28?this.wwaData.mapWidth=71:this.wwaData.version<=29&&(this.wwaData.mapWidth=101)},t.prototype._extractInitialItemData=function(){var t=this.wwaData.version>29?ge.ITEMBOX_TOP:ge.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(Ce.ITEMBOX_SIZE);for(var e=0;e<Ce.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var a,s,i;for(i=ve(this.wwaData.mapWidth,this.wwaData.mapWidth),a=0;a<this.wwaData.mapWidth;a++)for(s=0;s<this.wwaData.mapWidth;s++)this.wwaData.version>29?(i[a][s]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(i[a][s]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(a*this.wwaData.mapWidth+s)%200==0&&this.emitProgress(a*this.wwaData.mapWidth+s,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Oe.MAP?De.MAP_LOAD:De.OBJ_LOAD),i[a][s]>=e&&(i[a][s]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Oe.MAP?De.MAP_LOAD:De.OBJ_LOAD),i},t.prototype._getPartsDataFromBits=function(t,e,a){var s,i,r;for(r=ve(e,a),s=0;s<e;s++)for(i=0;i<a;i++)(s*this.wwaData.mapWidth+i)%200==0&&this.emitProgress(s*a+i,e*a,t===Oe.MAP?De.MAP_ATTR:De.OBJ_ATTR),i!==Ce.ATR_CROP1&&i!==Ce.ATR_CROP2?(r[s][i]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(r[s][i]=0,this.currentPosition+=2);return this.emitProgress(e*a,e*a,t===Oe.MAP?De.MAP_ATTR:De.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,De.RAND_PARTS)},t.prototype.emitProgress=function(t,e,a){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:a})},t}();var Ne=function(){function t(t,e,a,s){this.wwaData=t,this.compressedMapData=e,this.startPosition=a,this.eventEmitter=s,this.OLDVER_MESSAGE_MAX=400}return t.prototype.load=function(){var t=this.wwaData;this.currentPos=this.startPosition,t.version>=30&&(t.worldPassword=this.getMessageFromData()),t.version<=29&&(t.messageNum=this.OLDVER_MESSAGE_MAX),t.message=new Array(t.messageNum);for(var e=0;e<t.message.length;e++)t.message[e]=this.getMessageFromData(),e%200==0&&this.eventEmitter.dispatch("progress",{current:e,total:t.message.length,stage:De.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:De.MESSAGE}),t.worldName=this.getMessageFromData(),t.version<=29?t.worldPassword=this.getMessageFromData():this.getMessageFromData(),""===t.worldPassword?t.worldPassNumber=0:t.version>=29?t.worldPassNumber=(parseInt(t.worldPassword)/10-1197)/17-2357:t.worldPassNumber=parseInt(t.worldPassword),t.charCGName=this.getMessageFromData(),t.mapCGName=this.getMessageFromData(),t.systemMessage=new Array(Ce.SYSTEM_MESSAGE_NUM);for(e=0;e<Ce.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=Ce.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=Ce.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=Ce.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=Ce.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=Ce.DEFAULT_DISABLE_SAVE,t.isOldMap=Ce.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=Ce.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=Ce.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=Ce.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=Ce.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=Ce.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=Ce.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=Ce.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=Ce.DEFAULT_FRAME_COLOR_R,t.frameColorG=Ce.DEFAULT_FRAME_COLOR_G,t.frameColorB=Ce.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=Ce.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=Ce.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=Ce.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=Ce.DEFAULT_STR_COLOR_R,t.fontColorG=Ce.DEFAULT_STR_COLOR_G,t.fontColorB=Ce.DEFAULT_STR_COLOR_B,t.statusColorR=Ce.DEFAULT_STATUS_COLOR_R,t.statusColorG=Ce.DEFAULT_STATUS_COLOR_G,t.statusColorB=Ce.DEFAULT_STATUS_COLOR_B,t.moves=Ce.DEFAULT_MOVES,t.gameSpeedIndex=Ce.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(Ce.USER_VAR_NUM);for(e=0;e<Ce.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t.gameOverPolicy="default",t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Pe=function(){},be=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Re=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Le=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},xe=function(t){function e(e){var a=t.call(this)||this;return a.uri=e,a}return be(e,t),e.fetch=function(t){return Re(this,void 0,void 0,(function(){return Le(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(t)];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("マップデータ 「".concat(t,"」の読み込みに失敗しました。\n 通信環境の良いところで再度お試しください。\n ローカルテストの場合は、ブラウザが対応していない可能性があります。"));case 3:return[2]}}))}))},e.handleError=function(t,e){var a="HTTPステータスコードは ".concat(e.status," です。");switch(e.status){case 200:case 304:return;case 403:throw new Error("マップデータ「".concat(t,"」を読み取る権限がないようです。\n 管理者の方へ: マップデータのパーミッションを確認してください。\n ").concat(a));case 404:throw new Error("マップデータ「".concat(t,"」が見つかりませんでした。\n ").concat(a));default:throw new Error("マップデータ「".concat(t,"」の読み込みに失敗しました。\n ").concat(a))}},e.prototype.request=function(){return Re(this,void 0,void 0,(function(){var t;return Le(this,(function(a){switch(a.label){case 0:return[4,e.fetch(this.uri)];case 1:return t=a.sent(),e.handleError(this.uri,t),[4,t.arrayBuffer()];case 2:return[2,a.sent()]}}))}))},e}(Pe),Be=a(106),Ue=a.n(Be),We=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Ye=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},ke=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Fe=function(t){function e(e){var a=t.call(this)||this;return a.fileName=e,a}return We(e,t),e.prototype.request=function(){return Ye(this,void 0,void 0,(function(){var t=this;return ke(this,(function(e){return[2,new Promise((function(e,a){Ue().readFile(t.fileName,(function(t,s){t&&a(t),e(s.buffer)}))}))]}))}))},e}(Pe),Ge=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Ve=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},He=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return Ge(this,void 0,void 0,(function(){var t,e,a,s,i,r;return Ve(this,(function(o){switch(o.label){case 0:n=this.fileName,t="undefined"!=typeof window?new xe(n):new Fe(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.request()];case 2:return(e=o.sent())?(a=this.loadMapData(e),this.eventEmitter.dispatch("mapData",a),[3,4]):(this.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"}),[2]);case 3:return s=o.sent(),i=s.name||"",r=s.message||"",this.eventEmitter.dispatch("error",{name:i,message:r}),[3,4];case 4:return[2]}var n}))}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),a=function(t){var e,a,s=new Uint8Array(t.length);for(e=0,a=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(s[a++]=t[e],t[e]===t[e+1]){for(var i=t[e+2],r=0;r<i;r++)s[a++]=t[e];e+=2}if(a+255>=s.length){var o=new Uint8Array(s.length+65e3);o.set(s),s=o}}return console.log("EXTRACT DATA = "+a+" "+e),{byteMapData:s,byteMapLength:a,compressedEndPosition:e+3}}(e),s=a.byteMapData,i=a.byteMapLength,r=a.compressedEndPosition,o=new Me(s,i,this.eventEmitter).extractAllData();return new Ne(o,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),Ke=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var a=new CustomEvent(t,{detail:e});this.target.dispatchEvent(a)},t.prototype.addListener=function(t,e){var a=function(t){return e(t.detail)};return this.target.addEventListener(t,a),a},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),je=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Xe=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Je="\\d+",Ze="v\\[".concat(Je,"\\]"),Qe="v\\[(".concat(Je,")\\]"),qe="HP|HPMAX|AT|DF|GD",ze="".concat(Ze,"|").concat(qe),$e="".concat(Je,"|").concat(Ze,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|STEP|TIME|PX|PY","|").concat(qe),ta="RAND\\((?:".concat($e,")\\)"),ea="RAND\\((".concat($e,")\\)"),aa="".concat(ta),sa="".concat($e,"|").concat(aa),ia="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ra="^\\(",oa="\\)$",na=new RegExp("^".concat(Je,"$")),_a=new RegExp("^".concat(Ze,"$")),ca=new RegExp("^".concat(Qe,"$")),ha=new RegExp("^".concat(ta,"$")),ua=new RegExp("^".concat(ea,"$")),la=new RegExp("".concat(ra,"(").concat(ze,")").concat("=","(").concat(sa,")(").concat("\\+|\\-|\\*|\\/|%",")(").concat(sa,")").concat(oa)),pa=new RegExp("".concat(ra,"(").concat(ze,")(").concat(ia,")(").concat(sa,")").concat(oa)),da=new RegExp("".concat(ra,"(").concat(sa,")(").concat(">|<|<=|>=|==|!=",")(").concat(sa,")").concat(oa));function Ea(t){switch(t){case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"AT_ITEMS":case"DF":case"DF_TOTAL":case"DF_ITEMS":case"GD":case"STEP":case"TIME":case"PX":case"PY":return t;default:return _a.test(t)?"VARIABLE":na.test(t)?"NUMBER":ha.test(t)?"RAND":null}}function fa(t,e){switch(Ea(t)){case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"AT_ITEMS":return e.itemStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"DF_ITEMS":return e.itemStatus.defence;case"GD":return e.totalStatus.gold;case"STEP":return e.moveCount;case"VARIABLE":return function(t,e){var a=t.match(ca);if(null===a)throw new Error("変数のフォーマットではありません。");var s=parseInt(a[1],10);return e.userVars[s]}(t,e);case"NUMBER":return function(t){var e=parseInt(t,10);if(isNaN(e))throw new Error("数値として解釈できません: ".concat(t));return e}(t);case"TIME":return e.playTime;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"RAND":var a=fa(t.match(ua)[1],e);return Math.floor(Math.random()*a);default:return 0}}function ya(t,e,a){switch(t){case"=":return a;case"+":case"+=":return e+a;case"-":case"-=":return e-a;case"*":case"*=":return e*a;case"/":case"/=":return 0===a?0:e/a;case"%":case"%=":return 0===a?0:e%a;default:throw new Error("未定義の演算子です")}}function wa(t,e){switch(Ea(e)){case"VARIABLE":var a=e.match(/^v\[(\d+)\]$/),s=parseInt(a[1],10);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:s,rawValue:t};case"NUMBER":throw new Error("左辺値に定数は入れられません");case"HP":return{assignee:"energy",rawValue:t};case"HPMAX":return{assignee:"energyMax",rawValue:t};case"AT":return{assignee:"strength",rawValue:t};case"AT_TOTAL":throw new Error("左辺値に合計攻撃力は入れられません");case"AT_ITEMS":throw new Error("左辺値にアイテム攻撃力は入れられません");case"DF":return{assignee:"defence",rawValue:t};case"DF_TOTAL":throw new Error("左辺値に合計防御力は入れられません");case"DF_ITEMS":throw new Error("左辺値にアイテム防御力は入れられません");case"GD":return{assignee:"gold",rawValue:t};case"STEP":throw new Error("左辺値に歩数は入れられません");case"TIME":throw new Error("左辺値にプレイ時間は入れられません");case"PX":throw new Error("左辺値にプレイヤーX座標は入れられません");case"PY":throw new Error("左辺値にプレイヤーY座標は入れられません");case"RAND":throw new Error("左辺値に乱数は入れられません")}}function ma(t){return t.replace(/\s/g,"")}var ga,Aa=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Sa=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ia=function(t,e,a){if(a||2===arguments.length)for(var s,i=0,r=e.length;i<r;i++)!s&&i in e||(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))};function va(t,e,a){var s=new $;return s.current=t,s.total=e,s.stage=a,s}var Ta=function(){function a(a,i,n,c,p,d,w,m,A,S,I){void 0===i&&(i=!1),void 0===w&&(w=""),void 0===m&&(m=!1),void 0===A&&(A=null);var v,T=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return T._main()},this.soundCheckCaller=function(){return T.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return T._keyStore.checkHitKey(e.KEY_ESC)||T._keyStore.checkHitKey(e.KEY_SHIFT)||T._keyStore.checkHitKey(e.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new Ke(_t("wwa-wrapper")),window.addEventListener("click",(function(t){T._isActive=!1})),_t("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),T._isActive=!0})),this._isActive=!0,null===n?(this._hasTitleImg=!1,this._cvsCover=_t("progress-panel"),(v=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?_t("version").textContent="WWA Wing Ver.3.9.2":this._setLoadingMessage(v,0)}catch(t){}this._dumpElement=A;var O=window.AudioContext||window.webkitAudioContext;O&&(this.audioContext=new O,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var D=new Audio;"no"!==D.canPlayType("audio/mpeg")&&""!==D.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new U,this._isURLGateEnable=i,this._isClassicModeEnable=c,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new E(0,0,0,0),w?"/"!==w[w.length-1]&&(w+="/"):w="./audio/",this._audioDirectory=w,this._bottomButtonType=d?h.GOTO_WWA:h.BATTLE_REPORT;var R=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===M.GAME){if(this.userDevice.os===C.NINTENDO)Q.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=h.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===N.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case M.VR:case M.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(_t("cell-save").textContent=z.QUICK_SAVE,this._usePassword?_t("cell-load").textContent=z.PASSWORD:_t("cell-load").textContent=z.EMPTY_LOAD,this._bottomButtonType){case h.GOTO_WWA:_t("cell-gotowwa").textContent=z.GOTO_WWA;break;case h.BATTLE_REPORT:_t("cell-gotowwa").textContent=z.BATTLE_REPORT;break;case h.GAME_END:_t("cell-gotowwa").textContent=z.GAME_END}this._loadHandler=function(a){T._wwaData=a,T._wwaData.isItemEffectEnabled=p;try{T._hasTitleImg?_t("version").textContent+=" (Map data Ver. "+Math.floor(T._wwaData.version/10)+"."+ +T._wwaData.version%10+")":T._setLoadingMessage(v,1)}catch(t){}var i=_t("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");i.pop(),i.push(T._wwaData.mapCGName),T._wwaData.mapCGName=i.join("/"),T._startTime=(new Date).getTime(),T._restartData=JSON.parse(JSON.stringify(T._wwaData)),T.checkOriginalMapString=T._generateMapDataHash(T._restartData),T.initCSSRule(),T._setProgressBar(va(0,4,j.GAME_INIT)),T._setLoadingMessage(v,2);var n=new Image;n.src=T._wwaData.mapCGName,n.addEventListener("error",(function(){T._setErrorMessage("画像ファイル「"+T._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",v)}));var c=T._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),h=function(t){t.style.backgroundImage="url("+c+")"};Array.prototype.forEach.call(ut("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(T._wwaData.imgItemboxX*Q.CHIP_SIZE,"px -").concat(T._wwaData.imgItemboxY*Q.CHIP_SIZE,"px"),t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(ut(".item-cell>.item-disp"),h),Array.prototype.forEach.call(ut("div.wide-cell-row>.status-icon"),h),T.setStatusIconCoord(V.ENERGY,new f(T._wwaData.imgStatusEnergyX,T._wwaData.imgStatusEnergyY)),T.setStatusIconCoord(V.STRENGTH,new f(T._wwaData.imgStatusStrengthX,T._wwaData.imgStatusStrengthY)),T.setStatusIconCoord(V.DEFENCE,new f(T._wwaData.imgStatusDefenceX,T._wwaData.imgStatusDefenceY)),T.setStatusIconCoord(V.GOLD,new f(T._wwaData.imgStatusGoldX,T._wwaData.imgStatusGoldY)),T._setProgressBar(va(1,4,j.GAME_INIT)),T._setLoadingMessage(v,3),T._mapIDTableCreate(),T._replaceAllRandomObjects();var d=(new Date).getTime();console.log("Loading Complete!"+(d-R)+"ms"),T._cvs=_t("wwa-map");var w=T._cvs.getContext("2d",{alpha:!1});w.fillStyle="rgba( 255, 255, 255, 0.5)",w.fillRect(0,0,440,440);var A=new y(T,T._wwaData.playerX,T._wwaData.playerY);T._camera=new yt(A),T._itemMenu=new Vt;var S=new E(T._wwaData.statusEnergy,T._wwaData.statusStrength,T._wwaData.statusDefence,T._wwaData.statusGold);T._player=new At(T,A,T._camera,S,T._wwaData.statusEnergyMax,T._wwaData.moves,T._wwaData.gameSpeedIndex),T._objectMovingDataManager=new vt(T,T._player),T._camera.setPlayer(T._player),T._keyStore=new r,T._mouseStore=new _,T._gamePadStore=new l,T._messageQueue=[],T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._yesNoChoiceCallInfo=P.NONE,T._prevFrameEventExected=!1,T._lastMessage=new Ot([],!1,!1,[]),T._execMacroListInNextFrame=[],T._passwordLoadExecInNextFrame=!1,T._conditionalMacroExecStatus="outside-ifelse",T._messageWindow=new Rt(T,50,180,340,0,T._wwaData.mapCGName,!1,!0,!1,_t("wwa-wrapper")),T._scoreWindow=new bt(T,new f(50,50),!1,_t("wwa-wrapper")),T._wwaSave=new me(ga,ga._wwaData.worldName,ga._wwaData.worldPassNumber,T._checkSaveDataCompatibility.bind(T),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case ye.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case ye.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case ye.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),T._isDisallowLoadOldSave=m,T._messageWindow.setWWASave(T._wwaSave),$t.setRestartData(T._restartData,T._wwaData),T.clearFaces();var O=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof O&&(T._useSuspend=!0,O)){var D=$t.getStartWWAData(O);T._restartData!==D&&(T._applyQuickLoad(D),T._wwaSave.resumeStart())}var N=_t("wwa-wrapper").getAttribute("data-wwa-autosave");null!==N&&T._wwaSave.setAutoSaveInterval(0|Number(N));var L=_t("wwa-wrapper").getAttribute("data-wwa-looking-around");if(T._useLookingAround=!(L&&L.match(/false/i)),T._setProgressBar(va(2,4,j.GAME_INIT)),T._setLoadingMessage(v,4),window.addEventListener("keydown",(function(t){if(T._isActive){if(T.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();T._keyStore.setPressInfo(t.keyCode),t.keyCode!==e.KEY_F5?T._player.isWaitingMessage()?t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_SPACE||t.preventDefault():T._player.isWaitingPasswordWindow()||t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F2&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(T._isActive){if(T.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();T._keyStore.setReleaseInfo(t.keyCode),t.keyCode===e.KEY_F5?t.preventDefault():t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F9&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||T._player.isWaitingMessage()||T._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){T._keyStore.allClear(),T._mouseStore.clear()})),window.addEventListener("contextmenu",(function(t){T._keyStore.allClear(),T._mouseStore.clear()})),window.addEventListener("help",(function(t){T._isActive&&t.preventDefault()})),T._mouseControllerElement=_t("wwa-controller"),T._mouseControllerElement.addEventListener("mousedown",(function(t){if(T._isActive&&1===t.which){if(T._mouseStore.getMouseState()!==s.NONE)return void t.preventDefault();var e=lt(t.clientX,t.clientY),a=T._player.getDrawingCenterPosition(),i=e.substract(a),r=Math.abs(i.x),o=Math.abs(i.y),n=void 0,_=!1;if(r<Q.CHIP_SIZE&&o<Q.CHIP_SIZE){switch(a.x/Q.CHIP_SIZE|0){case 0:_=!0,n=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.RIGHT}switch(a.y/Q.CHIP_SIZE|0){case 0:_=!0,n=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.DOWN}}_||(i.y>0&&o>r?n=u.DOWN:i.y<0&&o>r?n=u.UP:i.x>0&&o<r?n=u.RIGHT:i.x<0&&o<r&&(n=u.LEFT)),T._mouseStore.setPressInfo(n,0)}})),T._mouseControllerElement.addEventListener("mouseleave",(function(t){T._mouseStore.clear()})),T._mouseControllerElement.addEventListener("mouseup",(function(t){T._isActive&&1===t.which&&(T._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(T.audioContext){var x=function(){T.audioContext.createBufferSource().start(0),T._mouseControllerElement.removeEventListener("touchstart",x),x=null};T._mouseControllerElement.addEventListener("touchstart",x)}T._mouseControllerElement.addEventListener("touchstart",(function(t){if(T._isActive)if(T._mouseStore.getMouseState()===s.NONE){for(var e=t.changedTouches,a=e.length,i=0;i<a;i++){var r=e[i],o=lt(r.clientX,r.clientY),n=T._player.getDrawingCenterPosition(),_=o.substract(n),c=Math.abs(_.x),h=Math.abs(_.y),l=void 0,p=!1;if(c<Q.CHIP_SIZE&&h<Q.CHIP_SIZE){switch(n.x/Q.CHIP_SIZE|0){case 0:p=!0,l=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.RIGHT}switch(n.y/Q.CHIP_SIZE|0){case 0:p=!0,l=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.DOWN}}p||(_.y>0&&h>c?l=u.DOWN:_.y<0&&h>c?l=u.UP:_.x>0&&h<c?l=u.RIGHT:_.x<0&&h<c&&(l=u.LEFT)),T._mouseStore.setPressInfo(l,r.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var B=function(t){if(T._isActive)for(var e=0;e<t.changedTouches.length;e++)if(T._mouseStore.getTouchID()===t.changedTouches[e].identifier){T._mouseStore.setReleaseInfo(),t.preventDefault();break}};T._mouseControllerElement.addEventListener("touchend",B),T._mouseControllerElement.addEventListener("touchcancel",B)}_t("button-load").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.QUICK_LOAD)})),_t("button-save").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.QUICK_SAVE)})),_t("button-restart").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.RESTART_GAME)})),_t("button-gotowwa").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(ut(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){T._displayHelp()}))})),T._frameCoord=new f(Q.IMGPOS_DEFAULT_FRAME_X,Q.IMGPOS_DEFAULT_YESNO_Y),T._battleEffectCoord=new f(Q.IMGPOS_DEFAULT_BATTLE_EFFECT_X,Q.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),T._battleEstimateWindow=new xt(T,T._wwaData.mapCGName,_t("wwa-wrapper")),T._passwordWindow=new Ft(T,_t("wwa-wrapper"),m),T._monsterWindow=new Pt(T,new f(50,180),340,60,!1,_t("wwa-wrapper"),T._wwaData.mapCGName),T._setProgressBar(va(3,4,j.GAME_INIT)),T._isLoadedSound=!1,T._temporaryInputDisable=!1,T._paintSkipByDoorOpen=!1,T._clearFacesInNextFrame=!1,T._useConsole=!1,T.wwaCustomEvent("wwa_startup"),T._cgManager=new ft(w,T._wwaData.mapCGName,T._frameCoord,(function(){T._isSkippedSoundMessage=!0;var a=function(){switch(T.userDevice.device){case M.PC:T.setMessageQueue("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case M.SP:T.setMessageQueue("ゲームを開始します。\n画面にふれてください。",!1,!0)}};if("ON"===T._wwaData.systemMessage[Y.LOAD_SE])return T._isLoadedSound=!0,a(),T._setLoadingMessage(v,j.AUDIO),T.loadSound(),void window.requestAnimationFrame(T.soundCheckCaller);if("OFF"===T._wwaData.systemMessage[Y.LOAD_SE])return T._isLoadedSound=!1,a(),void T.openGameWindow();if(T._isSkippedSoundMessage=!1,T._hasTitleImg||v.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),T._usePassword){var s="効果音・BGMデータをロードしますか?";I&&(s+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),T._messageWindow.setParsedMessage(new Ot(""===T._wwaData.systemMessage[Y.LOAD_SE]?s:T._wwaData.systemMessage[Y.LOAD_SE],!0)),T._messageWindow.show(),T._setProgressBar(va(4,4,j.GAME_INIT));var i=setInterval((function(){T._keyStore.update(),T._gamePadStore.update(),T._yesNoJudgeInNextFrame===g.UNSELECTED&&(T._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||T._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||T._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)?T._yesNoJudgeInNextFrame=g.YES:(T._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||T._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||T._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B))&&(T._yesNoJudgeInNextFrame=g.NO)),T._yesNoJudgeInNextFrame===g.YES?(clearInterval(i),T._messageWindow.update(),T._yesNoJudge=T._yesNoJudgeInNextFrame,T._messageWindow.setInputDisable(),setTimeout((function(){T._player.setDelayFrame(),T._messageWindow.hide(),T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._isLoadedSound=!0,T._setLoadingMessage(v,j.AUDIO),T.loadSound(),window.requestAnimationFrame(T.soundCheckCaller)}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL)):T._yesNoJudgeInNextFrame===g.NO&&(clearInterval(i),T._messageWindow.update(),T._yesNoJudge=T._yesNoJudgeInNextFrame,T._messageWindow.setInputDisable(),setTimeout((function(){T._player.setDelayFrame(),T._messageWindow.hide(),T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._isLoadedSound=!1,T.openGameWindow()}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL))}),Q.DEFAULT_FRAME_INTERVAL)}else clearInterval(i),T._player.setDelayFrame(),T._messageWindow.hide(),T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._isLoadedSound=!0,T.loadSound(),window.requestAnimationFrame(T.soundCheckCaller)})),T.wwaCustomEvent("wwa_start")};var L=new Ke;L.addListener("mapData",(function(t){return T._loadHandler(t)})),L.addListener("progress",(function(t){return T._setProgressBar(t)})),L.addListener("error",(function(t){return T._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,v)})),new He(a,L).requestAndLoadMapData().then((function(){return Aa(T,void 0,void 0,(function(){return Sa(this,(function(t){return this._canDisplayUserVars=I,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[2,S?(e=S,je(void 0,void 0,void 0,(function(){return Xe(this,(function(t){return[2,fetch(e).then((function(t){return 200===t.status||304===t.status?{kind:"data",data:t}:{kind:"httpError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。ステータスコード: ").concat(t.status)}})).catch((function(t){return{kind:"connectionError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。通信状態がいい場所で再度お試しください。")}})).then((function(t){return je(void 0,void 0,void 0,(function(){var e,a;return Xe(this,(function(s){switch(s.label){case 0:return"data"!==t.kind?[3,2]:(a={kind:"data"},[4,t.data.json()]);case 1:return a.data=s.sent(),e=a,[3,3];case 2:e=t,s.label=3;case 3:return[2,e]}}))}))})).catch((function(t){return{kind:"brokenJson",errorMessage:"ファイル ".concat(e," が壊れています。")}}))]}))}))):{kind:"noFileSpecified",errorMessage:"data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。"}]):[2,void 0];var e}))}))})).then((function(t){if(t)if("noFileSpecified"!==t.kind){if("data"!==t.kind)return T._userVarNameListRequestError=t,void T._updateVarDumpInformationArea(T._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return T._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(S," が正しい形式で書かれていません。")},void T._updateVarDumpInformationArea(T._userVarNameListRequestError.errorMessage,!0);if(T._userVarNameList=T.convertUserVariableNameListToArray(t.data),null!==T._dumpElement)for(var e=function(){var t=a.toString(10);if(!T._userVarNameList[a])return"continue";var e=".var-index".concat(t),s=T._dumpElement.querySelector(e),i=s.querySelector("".concat(e," > div"));i.textContent=T._userVarNameList[a],s.setAttribute("data-labelled-var-index","true"),s.addEventListener("mouseover",(function(){return i.removeAttribute("aria-hidden")})),s.addEventListener("mouseleave",(function(){return i.setAttribute("aria-hidden","true")}))},a=0;a<Q.USER_VAR_NUM;a++)e()}else T._updateVarDumpInformationArea(t.errorMessage,!1)}))}return a.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(Q.USER_VAR_NUM),a=0;a<Q.USER_VAR_NUM;a++)e[a]=void 0;return Object.keys(t).forEach((function(a){var s=parseInt(a,10);"string"!=typeof t[a]||"string"!=typeof a||isNaN(s)||s<0||s>=Q.USER_VAR_NUM||(e[s]=t[a])})),e},a.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?(_t("progress-message-container").textContent=t.stage===Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:rt[t.stage],_t("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*Q.MAP_WINDOW_WIDTH+"px",_t("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?_t("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":_t("progress-message-container").textContent="ゲームデータを読み込んでいます。",_t("progress-bar-audio").style.width=t.current*Q.MAP_WINDOW_WIDTH/t.total+"px",_t("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},a.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=et.TITLE+"px "+Q.LOADING_FONT,t.fillText(ot[0],tt.TITLE_X,tt.TITLE_Y),t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("WWA Wing Ver.3.9.2",tt.FOOTER_X,tt.COPYRIGHT_Y);else if(e<=ot.length)t.font=et.LOADING+"px "+Q.LOADING_FONT,e>=2&&(t.clearRect(tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-3),Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText(ot[e-1]+" Complete!",tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-2))),e<ot.length&&t.fillText(ot[e],tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-1)),1==e&&(t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,tt.FOOTER_X,tt.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",tt.FOOTER_X,tt.WORLD_Y+tt.LINE));else{var a;a=this._isSkippedSoundMessage?tt.LOADING_Y+tt.LINE*(ot.length-1):tt.FOOTER_Y,e<=j.AUDIO?t.fillText("Now Sound data Loading .....",tt.LOADING_X,a):(t.clearRect(tt.LOADING_X,a-tt.LINE,Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText("Now Sound data Loading ..... Complete!",tt.LOADING_X,a))}},a.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),e.font=et.ERRROR+"px "+Q.LOADING_FONT,t.split("\n").forEach((function(t,a){e.fillText(t,tt.ERROR_X,tt.ERROR_Y+tt.LINE*a)})))},a.prototype.createSoundInstance=function(t){if(0!==t&&t!==H.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new Ie(t,e,this.audioContext,this.audioGain)}},a.prototype.loadSound=function(){var t=this;this.sounds=new Array(Q.SOUND_MAX+1),this.createSoundInstance(H.DECISION),this.createSoundInstance(H.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var a=this._wwaData.mapAttribute[e][Q.ATR_SOUND];this.createSoundInstance(a)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM){a=this._wwaData.objectAttribute[e][Q.ATR_SOUND];this.createSoundInstance(a)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var a=e.match(/^\$sound=(\d+)/);if(a&&!(a.length<2)){var s=parseInt(a[1],10);!isNaN(s)&&0<s&&s<H.NO_SOUND&&t.createSoundInstance(s)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},a.prototype.checkAllSoundLoaded=function(){var a=0,s=0;if(!this._hasTitleImg)var i=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var r=1;r<=Q.SOUND_MAX;r++){var o=this.sounds[r];void 0===o||o.isError()||(s++,o.hasData()&&a++)}if(a<s&&!this._soundLoadSkipFlag)return this._setProgressBar(va(a,s,j.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(va(Q.SOUND_MAX,Q.SOUND_MAX,j.AUDIO)),this._setLoadingMessage(i,j.FINISH),this.openGameWindow()},a.prototype._setSoundLoadedCheckTimer=function(t){var e=this,a=this.sounds[t];a.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?a.hasData()?(a.play(),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):a.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},a.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},a.prototype.playSound=function(t){if(this._isLoadedSound){if(t<0||t>Q.SOUND_MAX)throw new Error("サウンド番号が範囲外です。");if(!(t>=H.BGM_LB&&this._wwaData.bgm===t))if((t===H.NO_SOUND||t>=H.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].hasData()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==H.NO_SOUND)this.sounds[t].hasData()?t>=H.BGM_LB?(this.sounds[t].play(),this._wwaData.bgm=t):this.sounds[t].play():t>=H.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t))}else t===H.NO_SOUND?this._wwaData.bgm=0:t>=H.BGM_LB&&(this._wwaData.bgm=t)},a.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();_t("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var a=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof a&&(this._useSuspend=!0,a)){var s=$t.getStartWWAData(a);this._restartData!==s&&(this._applyQuickLoad(s),this._wwaSave.resumeStart())}setTimeout((function(){_t("wwa-wrapper").removeChild(_t("wwa-cover")),t._main()}),Q.SPLASH_SCREEN_DISP_MILLS)},a.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){if(_t("item"+(t-1)).classList.add("onpress"),this.playSound(H.DECISION),"BLANK"===this._wwaData.message[W.USE_ITEM]){this._player.readyToUseItem(t);var e=this._player.useItem(),a=this.getObjectAttributeById(e,Q.ATR_STRING);this.setMessageQueue(this.getMessageById(a),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord())}else this.setMessageQueue(""===this._wwaData.message[W.USE_ITEM]?"このアイテムを使用します。\nよろしいですか?":this._wwaData.message[W.USE_ITEM],!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},a.prototype.onselectbutton=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!1);var s=_t(F[t]);if(this.playSound(H.DECISION),this._itemMenu.close(),s.classList.add("onpress"),t===b.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case P.CALL_BY_QUICK_LOAD:case P.CALL_BY_LOG_QUICK_LOAD:var i,r="";switch(this._yesNoChoiceCallInfo){case P.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case P.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),i){case P.CALL_BY_LOG_QUICK_LOAD:this.setMessageQueue(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case P.CALL_BY_PASSWORD_LOAD:this.setMessageQueue(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case P.NONE:this.setMessageQueue(r,!0,!0)}break;case P.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===b.QUICK_SAVE)this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this._wwaSave.selectDBSaveDataList(),this._messageWindow.createSaveDom(),this._usePassword?(this.setMessageQueue("データの一時保存先を選んでください。\n→Noでデータ復帰用パスワードの\n 表示選択ができます。",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_QUICK_SAVE):(this.setMessageQueue("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_QUICK_SAVE));else if(t===b.RESTART_GAME)this.setMessageQueue("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_RESTART_GAME;else if(t===b.GOTO_WWA)if(a)this._bottomButtonType!==h.GOTO_WWA&&_t(F[b.GOTO_WWA]).classList.remove("onpress"),this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case h.GOTO_WWA:this._yesNoChoiceCallInfo=P.CALL_BY_GOTO_WWA,this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0);break;case h.GAME_END:this._yesNoChoiceCallInfo=P.CALL_BY_END_GAME,this.setMessageQueue("WWAゲームを終了しますか?",!0,!0);break;case h.BATTLE_REPORT:this.launchBattleEstimateWindow()}},a.prototype.onpasswordloadcalled=function(){this._usePassword?(_t(F[b.QUICK_LOAD]).classList.add("onpress"),this.setMessageQueue("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_PASSWORD_LOAD):this.setMessageQueue("セーブデータがありません。",!1,!0)},a.prototype.onpasswordsavecalled=function(){_t(F[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_SUSPEND):this._usePassword&&(this.setMessageQueue("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_PASSWORD_SAVE)},a.prototype.onpasssuspendsavecalled=function(){_t(F[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_SUSPEND)},a.prototype.onitemmenucalled=function(){this.setMessageQueue("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(H.DECISION),this._itemMenu.openView()},a.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){var e,a;if(e=t===R.UP?this._player.speedUp():this._player.speedDown(),a="移動速度を【"+J[e]+"】に切り替えました。\n"+(this.isBattleSpeedIndexForQuickBattle(e)?"戦闘も速くなります。\n":"")+"("+(Q.MAX_SPEED_INDEX+1)+"段階中"+(e+1)+")",this.userDevice.os===C.NINTENDO)a+="速度を落とすには-ボタン, 速度を上げるには+ボタンを押してください。";else a+="速度を落とすにはIキー, 速度を上げるにはPキーを押してください。";this.setMessageQueue(a,!1,!0)}else this.setMessageQueue("ここでは移動速度を\n変更できません。",!1,!0)},a.prototype.isBattleSpeedIndexForQuickBattle=function(t){return Q.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},a.prototype._main=function(){var a,i=this;if(this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._gamePadStore.update(),this._waitFrame-- >0)window.requestAnimationFrame(this.mainCaller);else{this._waitFrame=0,void 0!==this._yesNoJudgeInNextFrame&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&(this.clearFaces(),this._clearFacesInNextFrame=!1);for(var r=0;r<this._execMacroListInNextFrame.length;r++)("outside-ifelse"===this._conditionalMacroExecStatus||"can-execute"===this._conditionalMacroExecStatus||this._execMacroListInNextFrame[r].isJunction())&&this._execMacroListInNextFrame[r].execute();this.resetConditionalMacroExecStaus(),this._lastMessage.isEmpty()&&this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),this._execMacroListInNextFrame=[],this._player.mainFrameCount();this._player.getPosition();var n=this._player.getDir();if(this._player.isControllable())this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(P.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame()?this._player.updateDelayFrame():this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(e.KEY_LEFT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_UP)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_RIGHT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_DOWN)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(D[n])?this._checkTurnKeyPressed()?this._player.setDir(n):(this._player.controll(n),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(e.KEY_1)===t.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(e.KEY_2)===t.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(e.KEY_3)===t.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(e.KEY_Q)===t.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(e.KEY_W)===t.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(e.KEY_E)===t.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(e.KEY_A)===t.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(e.KEY_S)===t.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(e.KEY_D)===t.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(e.KEY_Z)===t.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(e.KEY_X)===t.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(e.KEY_C)===t.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(e.KEY_I)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_MINUS)?this.onchangespeed(R.DOWN):this._keyStore.checkHitKey(e.KEY_P)||this._keyStore.checkHitKey(e.KEY_F2)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_PLUS)?this.onchangespeed(R.UP):this._keyStore.getKeyState(e.KEY_F1)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_M)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(e.KEY_F3)?(this.playSound(H.DECISION),this.onselectbutton(b.QUICK_LOAD,!0)):this._keyStore.checkHitKey(e.KEY_F4)?(this.playSound(H.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(e.KEY_F5)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZR)?this.onselectbutton(b.QUICK_LOAD):this._keyStore.checkHitKey(e.KEY_F6)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZL)?this.onselectbutton(b.QUICK_SAVE):this._keyStore.checkHitKey(e.KEY_F7)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_R)?this.onselectbutton(b.RESTART_GAME):this._keyStore.checkHitKey(e.KEY_F8)?this.onselectbutton(b.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(e.KEY_F9)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_X)?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(e.KEY_V)?this._displayUserVars():(this._keyStore.checkHitKey(e.KEY_F12)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_Y))&&this._displayHelp()),this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame();else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update();else if(this._player.isWaitingMessage()){if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===g.UNSELECTED&&(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)?this._yesNoJudge=g.YES:(this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B))&&(this._yesNoJudge=g.NO)),(this._yesNoJudge===g.YES||this._yesNoJudge===g.NO)&&(this.playSound(H.DECISION),this._yesNoDispCounter=Q.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A))this._setNextMessage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(u.LEFT)||this._mouseStore.checkClickMouse(u.UP)||this._mouseStore.checkClickMouse(u.RIGHT)||this._mouseStore.checkClickMouse(u.DOWN)||this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)){for(r=0;r<F.length;r++){(l=_t(F[r])).classList.contains("onpress")&&l.classList.remove("onpress")}this._itemMenu.ng(),this._setNextMessage(),this.playSound(H.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var _=this._keyStore.getKeyStateForMessageCheck(e.KEY_ENTER),c=this._keyStore.getKeyStateForMessageCheck(e.KEY_SPACE),h=this._keyStore.getKeyStateForMessageCheck(e.KEY_ESC);if(_===t.KEYDOWN||_===t.KEYPRESS_MESSAGECHANGE||c===t.KEYDOWN||c===t.KEYPRESS_MESSAGECHANGE||h===t.KEYDOWN||h===t.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===s.MOUSEDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_B)){for(r=0;r<F.length;r++){var l;(l=_t(F[r])).classList.contains("onpress")&&l.classList.remove("onpress")}this._setNextMessage()}}if(null===(a=this._inlineUserVarViewer)||void 0===a?void 0:a.isVisible){var p=!1;this._keyStore.getKeyState(e.KEY_DOWN)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,p=!0),this._keyStore.getKeyState(e.KEY_UP)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,p=!0),this._keyStore.getKeyState(e.KEY_RIGHT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=Q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,p=!0),this._keyStore.getKeyState(e.KEY_LEFT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=Q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,p=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=Q.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>Q.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=Q.USER_VAR_NUM),p&&(this._setNextMessage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(e.KEY_V)===t.KEYDOWN&&this._setNextMessage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_B))&&this.hideBattleEstimateWindow():this._player.isFighting()?(this._player.fight(),this._monsterWindow.update(this._monster)):this._player.isWaitingMoveMacro()&&(this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update());if(this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!(this._player.isJumped()||this._player.isWaitingMessage()||this._player.isWatingEstimateWindow()||this._player.isWaitingMoveMacro()||this._player.isFighting())){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var d=this.checkMap();d||this.checkObject(),this._prevFrameEventExected=d}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==g.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.PASSWORD,this._player.clearPasswordWindowWaiting(),this._passwordLoadExecInNextFrame=!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,this._player.isWaitingMessage()&&this._isClassicModeEnable||(this._animationCounter=(this._animationCounter+1)%(2*Q.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&_t("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&_t("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&_t("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&_t("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){i._loadType===L.QUICK_LOAD?(i._quickLoad(),i.wwaCustomEvent("wwa_quickload")):i._loadType===L.RESTART_GAME?(i._restartGame(),i.wwaCustomEvent("wwa_restert")):i._loadType===L.PASSWORD&&(i._applyQuickLoad(i._passwordSaveExtractData),i._passwordSaveExtractData=void 0,i.wwaCustomEvent("wwa_passwordload")),setTimeout(i.mainCaller,Q.DEFAULT_FRAME_INTERVAL,i)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(r=0;r<Q.USER_VAR_NUM;r++){var E=r.toString(10);this._dumpElement.querySelector(".var".concat(E)).textContent=this._wwaData.userVar[r]+""}}},a.prototype.vibration=function(t){this._gamePadStore.vibration(t)},a.prototype._drawAll=function(){var t,e,a=this._camera.getPosition().getPartsCoord(),s=this._camera.getPosition().getOffsetCoord(),i=Q.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var o=this._camera.getPreviousPosition().getPartsCoord(),n=this._camera.getPreviousPosition().getOffsetCoord();i=this._camera.getTransitionStepNum()*Q.CHIP_SIZE}var _=!1;if(i!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=i,_=!0),a.x===this._cgManager.cpPartsLog.x&&a.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=a.x,this._cgManager.cpPartsLog.y=a.y,_=!0),_&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(o,n,i,!0),this._drawPlayer(o,n,i,!0),this._drawObjects(o,n,i,!0),this._camera.isFinalStep()))var c=255,h=setInterval((function(){var t=_t("wwa-fader");if((c-=3*Q.FADEOUT_SPEED)<=0)return clearInterval(h),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=c/255+""}),20);this._drawMap(a,s,i,!1,_),this._drawPlayer(a,s,i),this._drawObjects(a,s,i,!1,_),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(t=this._player.isTurn()?this._monster.position.x:r.x,e=this._player.isTurn()?this._monster.position.y:r.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,Q.CHIP_SIZE*(t-a.x)-s.x,Q.CHIP_SIZE*(e-a.y)-s.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},a.prototype._drawMap=function(t,e,a,s,i){if(void 0===s&&(s=!1),void 0===i&&(i=!1),void 0!==t){var r,o=Math.max(0,t.x-1),n=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),c=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW);if(r=0,s)for(var h=o;h<=n;h++)for(var u=_;u<=c;u++){var l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(h-t.x)-e.x,f=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,E,f,a)}else{for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h];this._cgManager.mapCache[r]!==l&&(this._cgManager.mapCache[r]=l,i=!0),r++}if(i){this._cgManager.clearBackCanvasWithLowerYLimit(a);for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(h-t.x)-e.x,f=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,f,a)}}this._cgManager.drawBackCanvas()}}},a.prototype._drawPlayer=function(t,e,a,s){if(void 0===s&&(s=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var i,r=this._player.getPosition().getPartsCoord(),o=this._player.getPosition().getOffsetCoord(),n=O[this._player.getDir()],_=(r.x-t.x)*Q.CHIP_SIZE+o.x-e.x,c=(r.y-t.y)*Q.CHIP_SIZE+o.y-e.y;Math.abs(o.x),Math.abs(o.y),this._player.getDir();i=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+n+1:this._wwaData.playerImgPosX+n,s?this._cgManager.drawCanvasWithLowerYLimit(i,this._wwaData.playerImgPosY,_,c,a):this._cgManager.drawCanvasWithUpperYLimit(i,this._wwaData.playerImgPosY,_,c,a)}},a.prototype._drawObjects=function(t,e,a,s,i){if(void 0===s&&(s=!1),void 0===i&&(i=!1),void 0!==t){var r,o,n,_,c,h,u,l,p,d,E,y,w,g,A=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),I=Math.max(0,t.y-1),v=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),T=0,O=this._animationCounter>Q.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(s)for(d=A;d<=S;d++)for(E=I;E<=v;E++)D&&new f(d,E).equals(this._monster.position)||(y=this._wwaData.mapObject[E][d],r=new f(0,0),this._wwaData.objectAttribute[y][Q.ATR_MOVE]!==x.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(r=p),c=Q.CHIP_SIZE*(d-t.x)+r.x-e.x,h=Q.CHIP_SIZE*(E-t.y)+r.y-e.y,o=O||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][o?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][o?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],0===y||this._checkNoDrawObject(new f(d,E),u,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(O?1:0,n,_,c,h,a));else{var C,M,N,P,b,R=[],L=[];for(d=A;d<=S;d++)for(E=I;E<=v;E++)w=y=this._wwaData.mapObject[E][d],u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],this._checkNoDrawObject(new f(d,E),u,l)&&(w=0),M=this._wwaData.objectAttribute[y][Q.ATR_MOVE]===x.STATIC,0!==w&&(N=!(!D||!new f(d,E).equals(this._monster.position)),M?L.push(new m(y,d,E,M,N)):(R.push(new m(y,d,E,M,N)),w=0),N&&(w=0)),this._cgManager.mapObjectCache[T]!==w&&(this._cgManager.mapObjectCache[T]=w,i=!0),T++;for(i&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(a),Array.prototype.push.apply(R,L)),b=R.length,P=0;P<b;P++)if(d=(C=R[P]).x,E=C.y,y=C.partsIDObj,M=C.isStatic,N=C.isFighting,c=Q.CHIP_SIZE*(d-t.x)-e.x,h=Q.CHIP_SIZE*(E-t.y)-e.y,M){if(N)continue;for(g=0;g<2;g++)o=!!g||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][o?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][o?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,c,h,a)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(c+=p.x,h+=p.y),o=O||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][o?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][o?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,c,h,a);this._cgManager.drawObjectCanvas(O?1:0)}}},a.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},a.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},a.prototype._drawFrame=function(){this._cgManager.drawFrame()},a.prototype._checkNoDrawObject=function(t,e,a){var s=this._player.getPosition(),i=s.getPartsCoord();return!(!s.isJustPosition()||i.x!==t.x||i.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===Q.OBJECT_DOOR&&0===a||(e===Q.OBJECT_STATUS||e===Q.OBJECT_MESSAGE||e===Q.OBJECT_ITEM||e===Q.OBJECT_SELL||e===Q.OBJECT_BUY||e===Q.OBJECT_SELL||e===Q.OBJECT_LOCALGATE))},a.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},a.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},a.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},a.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[a][Q.ATR_TYPE]},a.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[a][Q.ATR_TYPE]},a.prototype.getMapAttributeByPosition=function(t,e){var a=t.getPartsCoord(),s=this._wwaData.map[a.y][a.x];return this._wwaData.mapAttribute[s][e]},a.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,Q.ATR_STRING)},a.prototype.getObjectAttributeByPosition=function(t,e){var a=t.getPartsCoord(),s=this._wwaData.mapObject[a.y][a.x];return this._wwaData.objectAttribute[s][e]},a.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},a.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},a.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_X]},a.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_Y]},a.prototype.getMessageById=function(t){return this._wwaData.message[t]},a.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},a.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.map[t.y][t.x],s=this._wwaData.mapAttribute[a][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y,r=!1;return(!i||this._player.getLastExecPartsIDOnSamePosition(I.MAP)!==a)&&(s===Q.MAP_STREET?r=this._execMapStreetEvent(t,a,s):s===Q.MAP_WALL?r=this._execMapWallEvent(t,a,s):s===Q.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,a,s):s===Q.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,a,s)),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.MAP,a),r)},a.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.mapObject[t.y][t.x],s=this._wwaData.objectAttribute[a][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y;i&&this._player.getLastExecPartsIDOnSamePosition(I.OBJECT)===a||(s===Q.OBJECT_NORMAL?this._execObjectNormalEvent(t,a,s):s===Q.OBJECT_MESSAGE?this._execObjectMessageEvent(t,a,s):s===Q.OBJECT_MONSTER?this._execObjectMonsterEvent(t,a,s):s===Q.OBJECT_ITEM?this._execObjectItemEvent(t,a,s):s===Q.OBJECT_DOOR?this._execObjectDoorEvent(t,a,s):s===Q.OBJECT_STATUS?this._execObjectStatusEvent(t,a,s):s===Q.OBJECT_BUY?this._execObjectBuyEvent(t,a,s):s===Q.OBJECT_SELL?this._execObjectSellEvent(t,a,s):s===Q.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,a,s):s===Q.OBJECT_SCORE?this._execObjectScoreEvent(t,a,s):s===Q.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,a,s):s===Q.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,a,s),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.OBJECT,a))},a.prototype._execMapStreetEvent=function(t,e,a){var s=this._wwaData.mapAttribute[e][Q.ATR_ITEM];if(0!==s&&!this._player.hasItem(s))return!1;this.appearParts(t,A.MAP);var i=this._wwaData.mapAttribute[e][Q.ATR_STRING],r=this._wwaData.message[i];this._waitFrame+=this._wwaData.mapAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0;var o=this.setMessageQueue(r,!1,!1,e,I.MAP,t.clone());return this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),0!==i&&o},a.prototype._execMapWallEvent=function(t,e,a){var s=this.getObjectIdByPosition(t.convertIntoPosition(this)),i=this.getObjectAttributeById(s,Q.ATR_TYPE);if(0===s||i===Q.OBJECT_NORMAL||i===Q.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(s,Q.ATR_ITEM))||this.getObjectAttributeById(i,Q.ATR_MODE)===Q.PASSABLE_OBJECT)){this.appearParts(t,A.MAP);var r=this._wwaData.mapAttribute[e][Q.ATR_STRING],o=this._wwaData.message[r];return this.setMessageQueue(o,!1,!1,e,I.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!1}return!1},a.prototype._execMapLocalGateEvent=function(t,e,a){var s=this._player.getPosition().getPartsCoord(),i=this._wwaData.mapAttribute[e][Q.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][Q.ATR_JUMP_Y];return i>Q.RELATIVE_COORD_LOWER&&(i=t.x+i-Q.RELATIVE_COORD_BIAS),r>Q.RELATIVE_COORD_LOWER&&(r=t.y+r-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.MAP),0<=i&&0<=r&&i<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(i!==s.x||r!==s.y)&&(this._player.jumpTo(new y(this,i,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!0)},a.prototype._execMapUrlGateEvent=function(t,e,a){var s=this._wwaData.mapAttribute[e][Q.ATR_STRING];return!this._isURLGateEnable||("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[s].split(/\s/g)[0],!0):void(location.href=pt(this._wwaData.message[s].split(/\s/g)[0])))},a.prototype._execObjectNormalEvent=function(t,e,a){},a.prototype._execObjectMessageEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[e][Q.ATR_SOUND];t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.appearParts(t,A.OBJECT,e),this.playSound(o)},a.prototype._execObjectStatusEvent=function(t,e,a){var s=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),i=this._wwaData.objectAttribute[e][Q.ATR_STRING],r=this._wwaData.message[i],o=this._player.getStatusWithoutEquipments();if(s.strength>Q.STATUS_MINUS_BORDER&&o.strength<s.strength-Q.STATUS_MINUS_BORDER||s.defence>Q.STATUS_MINUS_BORDER&&o.defence<s.defence-Q.STATUS_MINUS_BORDER||s.gold>Q.STATUS_MINUS_BORDER&&o.gold<s.gold-Q.STATUS_MINUS_BORDER)return this.setPartsOnPosition(I.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();s.energy=s.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.energy:s.energy,s.strength=s.strength>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.strength:s.strength,s.defence=s.defence>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.defence:s.defence,s.gold=s.gold>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.gold:s.gold,this._player.addStatusAll(s),this.setStatusChangedEffect(s),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][Q.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?this.gameover():(this.setMessageQueue(r,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},a.prototype._execObjectMonsterEvent=function(t,e,a){var s=this,i=new f(this._wwaData.objectAttribute[e][Q.ATR_X],this._wwaData.objectAttribute[e][Q.ATR_Y]),r=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),o=this._wwaData.message[this._wwaData.objectAttribute[e][Q.ATR_STRING]],n=this._wwaData.objectAttribute[e][Q.ATR_ITEM];this._monster=new St(e,t,i,r,o,n,(function(){s._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},a.prototype._execObjectBuyEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectSellEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectItemEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s];try{var r=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(t.x-r.x)*Q.CHIP_SIZE,n=(t.y-r.y)*Q.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][Q.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(o,n),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0),this.setPartsOnPosition(I.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][Q.ATR_MODE]||(this.setMessageQueue(i,!1,!1,e,I.OBJECT,t.clone()),this.appearParts(t,A.OBJECT,e))}catch(t){"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this.setMessageQueue(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!1,!0)}this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectDoorEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_ITEM],i=this._wwaData.objectAttribute[e][Q.ATR_STRING],r=this._wwaData.message[i];this._player.hasItem(s)&&(0===this._wwaData.objectAttribute[e][Q.ATR_MODE]&&this._player.removeItemByPartsID(s),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]),this.setMessageQueue(r,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this._paintSkipByDoorOpen=!0)},a.prototype._execObjectYesNoChoiceEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectLocalGateEvent=function(t,e,a){var s=this._player.getPosition().getPartsCoord();t.x!==s.x||t.y!==s.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t);var i=this._wwaData.objectAttribute[e][Q.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][Q.ATR_JUMP_Y];i>Q.RELATIVE_COORD_LOWER&&(i=s.x+i-Q.RELATIVE_COORD_BIAS),r>Q.RELATIVE_COORD_LOWER&&(r=s.y+r-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.OBJECT,e),0<=i&&0<=r&&i<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(i!==s.x||r!==s.y)&&(this._player.jumpTo(new y(this,i,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},a.prototype._execObjectUrlGateEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING];this._isURLGateEnable&&("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[s].split(/\s/g)[0]):location.href=pt(this._wwaData.message[s].split(/\s/g)[0]))},a.prototype._execObjectScoreEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=0===s?"スコアを表示します。":this._wwaData.message[s];this.getMessageQueueByRawMessage(i,e,I.OBJECT,t).reduce((function(t,e){return t||!e.isEmpty()}),!1)&&(this._scoreRates={energy:this._wwaData.objectAttribute[e][Q.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][Q.ATR_GOLD]},this.updateScore(),this._scoreWindow.show()),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype.updateScore=function(){if(this._scoreRates){var t=this._player.getStatus().calculateScore(this._scoreRates);this._scoreWindow.update(t)}},a.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===g.YES){if(this._yesNoChoiceCallInfo===P.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.MAP_URLGATE&&(location.href=pt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===P.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new E(0,0,0,e)),this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):"BLANK"!==this._wwaData.message[W.NO_ITEM]&&this._messageQueue.push(new Ot(""===this._wwaData.message[W.NO_ITEM]?"アイテムを持っていない。":this._wwaData.message[W.NO_ITEM],!0));else if(t===Q.OBJECT_SELL)if(this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]))if(this._player.canHaveMoreItems()||0===this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){var a=this._yesNoChoicePartsCoord,s=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),i=(a.x-s.x)*Q.CHIP_SIZE,r=(a.y-s.y)*Q.CHIP_SIZE;this._player.addItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM],0,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(i,r),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0)}var o=new E(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]);this._player.getStatusWithoutEquipments();if(o.energy=o.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-o.energy:o.energy,this.setStatusChangedEffect(o),this._player.addStatusAll(o),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1}))return void this.gameover();this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)}else"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this._messageQueue.push(new Ot(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!0));else"BLANK"!==this._wwaData.message[W.NO_MONEY]&&this._messageQueue.push(new Ot(""===this._wwaData.message[W.NO_MONEY]?"所持金がたりない。":this._wwaData.message[W.NO_MONEY],!0));else t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):t===Q.OBJECT_URLGATE&&(location.href=pt(this._yesNoURL));else this._yesNoChoiceCallInfo===P.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===P.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),_t(F[b.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.QUICK_LOAD)):this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),_t(F[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(P.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===P.CALL_BY_RESTART_GAME?(_t(F[b.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=L.RESTART_GAME):this._yesNoChoiceCallInfo===P.CALL_BY_END_GAME?(window.history.back(-1),_t(F[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===P.CALL_BY_GOTO_WWA?(location.href=pt(Q.WWA_HOME),_t(F[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_LOAD?(_t(F[b.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Wt.LOAD)):this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_SAVE?(_t(F[b.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(P.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Wt.SAVE)):this._yesNoChoiceCallInfo===P.CALL_BY_SUSPEND&&(_t(F[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(P.CALL_BY_SUSPEND));this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=P.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===g.NO){if(this._yesNoChoiceCallInfo===P.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE],Q.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===P.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY||t===Q.OBJECT_SELL||(t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):Q.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===P.CALL_BY_ITEM_USE){_t("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===P.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case P.NONE:_t(F[b.QUICK_LOAD]).classList.remove("onpress");break;case P.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=g.UNSELECTED,void this.onpasswordloadcalled();case P.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var n=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=g.UNSELECTED,n){case P.CALL_BY_PASSWORD_LOAD:this.setMessageQueue("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case P.NONE:this.setMessageQueue("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=g.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());_t(F[b.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===P.CALL_BY_RESTART_GAME)_t(F[b.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_END_GAME)_t(F[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_GOTO_WWA)_t(F[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_LOAD)_t(F[b.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_SAVE)_t(F[b.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=g.UNSELECTED,void this.onpasswordsavecalled();_t(F[b.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=P.NONE,this._messageWindow.setYesNoChoice(!1)}},a.prototype.setMessageQueue=function(t,e,a,s,i,r,o){if(void 0===s&&(s=0),void 0===i&&(i=I.OBJECT),void 0===r&&(r=new f(0,0)),void 0===o&&(o=!1),this._messageQueue=this._messageQueue.concat(this.getMessageQueueByRawMessage(t,s,i,r)),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0!==this._messageQueue.length){for(var n=this._messageQueue.shift(),_=0;_<n.macro.length;_++)this._execMacroListInNextFrame.push(n.macro[_]);if(this._lastMessage=n,!n.isEmpty())return this._messageWindow.setParsedMessage(n),this._messageWindow.setYesNoChoice(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),a,this._player.getPosition(),this._camera.getPosition()),this._player.setMessageWaiting(),!0;0===this._messageQueue.length?this._hideMessageWindow(o):this._setNextMessage()}return!1},a.prototype.getMessageQueueByRawMessage=function(t,e,a,s,i){void 0===i&&(i=!1);var r=t.split(/\n\<c\>/i)[0].split(/\<c\>/i)[0].replace(/\n\<p\>\n/gi,"<P>").replace(/\n\<p\>/gi,"<P>").replace(/\<p\>\n/gi,"<P>").replace(/\<p\>/gi,"<P>").replace(/\/\/.*\n/gi,""),o=[];if(""!==r)for(var n=r.split(/\<p\>/gi),_=0;_<n.length;_++){for(var c=n[_].split("\n"),h=[],u=[],l=0;l<c.length;l++){var p=c[l].match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)(?:.*))/);if(null!==p&&p.length>=2){var d=Ct(this,e,a,s,p[1]);d.macroType===k.SHOW_STR?h.push(this._generateUserValString(d.macroArgs)):u.push(d)}else c[l].match(/^\$/)||h.push([c[l]])}var E=h.reduce((function(t,e,a){var s=0===a?[]:["\n"];return Ia(Ia(Ia([],t,!0),s,!0),e,!0)}),[]);o.push(new Ot(E,i,_===n.length-1,u))}return o},a.prototype.appearParts=function(t,e,a){var s;void 0===a&&(a=0);var i,r,o,n,_,c=e===A.CHOICE_NO?Q.APPERANCE_PARTS_MIN_INDEX_NO:Q.APPERANCE_PARTS_MIN_INDEX,h=e===A.CHOICE_YES?Q.APPERANCE_PARTS_MAX_INDEX_YES:Q.APPERANCE_PARTS_MAX_INDEX;for(e===A.MAP?(a=0===a?this._wwaData.map[t.y][t.x]:a,s=I.MAP):(a=0===a?this._wwaData.mapObject[t.y][t.x]:a,s=I.OBJECT),_=c;_<=h;_++){var u=Q.ATR_APPERANCE_BASE+_*Q.REL_ATR_APPERANCE_UNIT_LENGTH,l=u+Q.REL_ATR_APPERANCE_ID,p=u+Q.REL_ATR_APPERANCE_X,d=u+Q.REL_ATR_APPERANCE_Y,E=u+Q.REL_ATR_APPERANCE_TYPE;if(i=s===I.MAP?this._wwaData.mapAttribute[a][l]:this._wwaData.objectAttribute[a][l],r=s===I.MAP?this._wwaData.mapAttribute[a][E]:this._wwaData.objectAttribute[a][E],o=s===I.MAP?this._wwaData.mapAttribute[a][p]:this._wwaData.objectAttribute[a][p],n=s===I.MAP?this._wwaData.mapAttribute[a][d]:this._wwaData.objectAttribute[a][d],o===Q.PLAYER_COORD?(o=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):o>Q.RELATIVE_COORD_LOWER&&(o=t.x+o-Q.RELATIVE_COORD_BIAS),n===Q.PLAYER_COORD?(n=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):n>Q.RELATIVE_COORD_LOWER&&(n=t.y+n-Q.RELATIVE_COORD_BIAS),0!==o||0!==n)try{if(new y(this,o,n,0,0),r===I.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var w=new f(o,n);this.setPartsOnPosition(I.MAP,i,w)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");w=new f(o,n);this.setPartsOnPosition(I.OBJECT,i,w),this._replaceRandomObject(new f(o,n)),o===this._player.getPosition().getPartsCoord().x&&n===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},a.prototype.appearPartsByDirection=function(t,e,a){var s=this._player.getPosition().getPartsCoord(),i=this._player.getDir(),r=v[i],o=T[i];this.appearPartsEval(s,(r>=0?"+":"-")+Math.abs(r)*t,(o>=0?"+":"-")+Math.abs(o)*t,e,a)},a.prototype.appearPartsEval=function(t,e,a,s,i){var r,o,n=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)r=n.x;else if("+"===e[0])r=t.x+parseInt(e.substr(1));else if("-"===e[0])r=t.x-parseInt(e.substr(1));else if(r=parseInt(e),isNaN(r))throw new Error("座標として解釈できない文字が含まれています。");if("P"===a||"p"===a)o=n.y;else if("+"===a[0])o=t.y+parseInt(a.substr(1));else if("-"===a[0])o=t.y-parseInt(a.substr(1));else if(o=parseInt(a),isNaN(o))throw new Error("座標として解釈できない文字が含まれています。");try{new y(this,r,o,0,0);if(i===I.MAP){if(s>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new f(r,o);this.setPartsOnPosition(I.MAP,s,_)}else{if(s>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new f(r,o);this.setPartsOnPosition(I.OBJECT,s,_),this._replaceRandomObject(new f(r,o)),r===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},a.prototype._replaceRandomObject=function(t){var e,a,s=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[s][Q.ATR_TYPE]===Q.OBJECT_RANDOM){for(var i=0;i<Q.RANDOM_ITERATION_MAX;i++){if(a=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[s][Q.ATR_RANDOM_BASE+a])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM)break;s=e}this.setPartsOnPosition(I.OBJECT,e,t)}},a.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),a=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),s=Math.max(0,t.y-1),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),r=e;r<=a;r++)for(var o=s;o<i;o++)this._replaceRandomObject(new f(r,o))},a.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new f(t,e))},a.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=g.UNSELECTED,this._messageQueue=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=P.NONE,this._player.clearMessageWaiting(),this._messageWindow.clear(),this._messageWindow.setYesNoChoice(!1),this._waitFrame=0,this._temporaryInputDisable=!0,this._execMacroListInNextFrame=[],this._player.jumpTo(new y(this,t,e,0,0))},a.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},a.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},a.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(_t("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(_t("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof E&&(0!==t.energy&&(_t("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(_t("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=Q.STATUS_CHANGED_EFFECT_FRAME_NUM)))},a.prototype.setPartsOnPosition=function(t,e,a){var s,i,r=a.y<<it.BITSHIFT|a.x;t===I.MAP?(s=this._wwaData.map[a.y][a.x],e=this.loadMapPartsID(e),s=this.loadMapPartsID(s),this._wwaData.map[a.y][a.x]=e,-1!==(i=this._mapIDTable[s].indexOf(r))&&this._mapIDTable[s].splice(i,1),-1===(i=this._mapIDTable[e].indexOf(r))&&this._mapIDTable[e].push(r)):(s=this._wwaData.mapObject[a.y][a.x],e=this.loadMapPartsObjectID(e),s=this.loadMapPartsObjectID(s),this._wwaData.mapObject[a.y][a.x]=e,-1!==(i=this._mapObjectIDTable[s].indexOf(r))&&this._mapObjectIDTable[s].splice(i,1),-1===(i=this._mapObjectIDTable[e].indexOf(r))&&this._mapObjectIDTable[e].push(r))},a.prototype._countSamePartsLength=function(t,e){var a;for(a=e+1;a<t.length&&t[a]===t[a-1];a++);return a-e},a.prototype._compressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[];for(var s=0;s<t[a].length;){var i=this._countSamePartsLength(t[a],s);e[a].push([t[a][s],i]),s+=i}}return e},a.prototype._decompressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[],0;for(var s=0;s<t[a].length;s++)for(var i=t[a][s][1],r=0;r<i;r++)e[a].push(t[a][s][0])}return e},a.prototype._generateMapDataHash=function(t){var e="A",a=0,s=0,i=0;for(i=0;i<t.map.length;i++){for(s=0;s<t.map[i].length;)a=this._countSamePartsLength(t.map[i],s),e+=t.map[i][s]+"|"+a+"/",s+=a;for(s=0;s<t.mapObject[i].length;)a=this._countSamePartsLength(t.mapObject[i],s),e+=t.mapObject[i][s]+"|"+a+"/",s+=a}for(var r=0;r<t.mapAttribute.length;r++)for(var o=0;o<t.mapAttribute[r].length;o++)e+=t.mapAttribute[r][o]+"/";for(var n=0;n<t.objectAttribute.length;n++)for(var _=0;_<t.objectAttribute[n].length;_++)e+=t.objectAttribute[n][_]+"/";return jt(e+="Z")},a.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),a=[];for(var s in t)"map"!==s&&"mapObject"!==s&&"mapCompressed"!==s&&"mapObjectCompressed"!==s&&"mapAttribute"!==s&&"objectAttribute"!==s&&"checkString"!==s&&a.push(s);a.sort();for(var i=0;i<a.length;i++)e+=dt(t[a[i]]);return jt(e)},a.prototype.compressSystem=function(){return $t},a.prototype._quickSave=function(t){var e,a,s=JSON.parse(JSON.stringify(this._wwaData)),i=this._player.getPosition().getPartsCoord(),r=this._player.getStatusWithoutEquipments();switch(s.itemBox=this._player.getCopyOfItemBox(),s.playerX=i.x,s.playerY=i.y,s.statusEnergyMax=this._player.getEnergyMax(),s.statusEnergy=r.energy,s.statusStrength=r.strength,s.statusDefence=r.defence,s.statusGold=r.gold,s.moves=this._player.getMoveCount(),s.frameCount=this._player.getFrameCount(),s.gameSpeedIndex=this._player.getSpeedIndex(),t){case P.CALL_BY_LOG_QUICK_SAVE:case P.CALL_BY_QUICK_SAVE:case P.CALL_BY_SUSPEND:break;case P.CALL_BY_PASSWORD_SAVE:s.checkOriginalMapString=this.checkOriginalMapString,s.checkString=this._generateSaveDataHash(s)}switch(s.message=void 0,s.mapAttribute=void 0,s.objectAttribute=void 0,t){case P.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,s),this.wwaCustomEvent("wwa_quicksave",{data:s}),"";case P.CALL_BY_PASSWORD_SAVE:var o=$t.compress(s);o.isCompress=1;var n=JSON.stringify(o);return this.wwaCustomEvent("wwa_passwordsave",{data:s,compress:o}),e=n,a=this._wwaData.worldPassNumber,console.warn(Ht.enc.Utf8.parse(e)),Ht.AES.encrypt(Ht.enc.Utf8.parse(e),Kt(a)).toString();case P.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:s,compress:$t.compress(s)});break;case P.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:s}),this._wwaSave.autoSave(this._cvs,s)}},a.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},a.prototype._decodePassword=function(t){var e,a,s,i="",r=void 0;try{e=t,a=this._wwaData.worldPassNumber,i=Ht.AES.decrypt(e,Kt(a)).toString(Ht.enc.Utf8)}catch(t){r=t}if(!i){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{i=function(t,e,a){return Ht.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,a)).toString(Ht.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){r=t}}if(!i){console.warn("旧方式でのパスワード暗号化解除失敗:",r);var o=r&&r.message?r.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+o)}try{s=JSON.parse(i)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}if(s.isCompress){delete s.isCompress;var n=$t.decompress(s),_=n[0],c=n[1];return[_e(_),c]}return[s,{isWorldNameEmpty:!1}]},a.prototype._quickLoad=function(t,e,a){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===a&&(a=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var s,i=!1;if(null!==e){var r=this._decodePassword(e);s=r[0],i=r[1].isWorldNameEmpty}else s=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(s.message=JSON.parse(JSON.stringify(this._restartData.message)),s.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),s.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===s.map&&(s.map=this._decompressMap(s.mapCompressed)),void 0===s.mapObject&&(s.mapObject=this._decompressMap(s.mapObjectCompressed)),delete s.mapCompressed,delete s.mapObjectCompressed,null!==e){if(!i&&s.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(s.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var o=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&s.checkOriginalMapString!==o)throw console.error("Invalid hash","(password)=".concat(s.checkOriginalMapString," (current map)=").concat(o)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return a&&this._applyQuickLoad(s),s},a.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new y(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(H.NO_SOUND):this.playSound(t.bgm),this.setImgClick(new f(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(V.ENERGY,new f(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(V.STRENGTH,new f(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(V.DEFENCE,new f(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(V.GOLD,new f(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new f(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new f(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},a.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var a=0;a<this._wwaData.mapWidth;a++){var s=a<<it.BITSHIFT|e;t=this._wwaData.map[a][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(s),t=this._wwaData.mapObject[a][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(s)}},a.prototype._restartGame=function(){this._quickLoad(!0)},a.prototype._fadeout=function(t){var e=0,a=Q.MAP_WINDOW_WIDTH,s=Q.FADEOUT_SPEED,i=_t("wwa-fader");i.style.display="block";var r=setInterval((function(){if(e+=s,(a-=2*s)<=0||2*e>Q.MAP_WINDOW_WIDTH)return i.removeAttribute("style"),i.style.display="block",i.style.borderWidth="0",i.style.width=Q.MAP_WINDOW_WIDTH+"px",i.style.height=Q.MAP_WINDOW_HEIGHT+"px",i.style.backgroundColor="#808080",clearInterval(r),void t();i.style.width=a+"px",i.style.height=a+"px",i.style.borderWidth=e+"px"}),20)},a.prototype.moveObjects=function(t){var e,a,s,i=this._camera.getPosition(),r=(this._player.getPosition(),i.getPartsCoord(),i.getPartsCoord().x),o=i.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.OBJECT_LOCALGATE){for(e=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),s=-1;s<=Q.V_PARTS_NUM_IN_WINDOW;s++)for(e[s+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),this.hoge[s+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=Q.H_PARTS_NUM_IN_WINDOW;a++)if(o+s<0||o+s>=this._wwaData.mapWidth||r+a<0||r+a>=this._wwaData.mapWidth)e[s+1][a+1]=0,this.hoge[s+1][a+1]=0;else{try{var n=(_=new y(this,r+a,o+s,0,0)).getPartsCoord()}catch(t){e[s+1][a+1]=0,this.hoge[s+1][a+1]=0;continue}this._wwaData.mapObject[n.y][n.x];e[s+1][a+1]=this._wwaData.mapObject[n.y][n.x],this.hoge[s+1][a+1]=-this._wwaData.mapObject[n.y][n.x]}for(a=-1;a<=Q.H_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth))for(s=-1;s<=Q.V_PARTS_NUM_IN_WINDOW;s++)if(!(o+s<0||o+s>=this._wwaData.mapWidth)){try{var _;n=(_=new y(this,r+a,o+s,0,0)).getPartsCoord()}catch(t){continue}var c=this._wwaData.mapObject[n.y][n.x];if(0!==c&&this._wwaData.objectAttribute[c][Q.ATR_MOVE]!==x.STATIC&&this._wwaData.objectAttribute[c][Q.ATR_TYPE]!==Q.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[c][Q.ATR_TYPE]!==Q.OBJECT_RANDOM&&(this._wwaData.objectAttribute[c][Q.ATR_MOVE]===x.CHASE_PLAYER||this._wwaData.objectAttribute[c][Q.ATR_MOVE]===x.RUN_OUT||this._wwaData.objectAttribute[c][Q.ATR_MOVE]===x.HANG_AROUND)){var h=this._wwaData.objectAttribute[c][Q.ATR_MOVE];if(h!==x.HANG_AROUND){var u,l=this._getCandidateCoord(t,_,h),p=new f(l.x,n.y),d=new f(n.x,l.y),E=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(n,l,r,o,e,c);else{var w=this._getSecondCandidateMoveMode(t,n,l,p,d,this._wwaData.objectAttribute[c][Q.ATR_TYPE]===Q.OBJECT_MONSTER,e);w===B.MODE_X?this._setObjectsInNextFrame(n,p,r,o,e,c):w===B.MODE_Y?this._setObjectsInNextFrame(n,d,r,o,e,c):null===(E=this._getThirdCandidate(t,_,l,h,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)):this._setObjectsInNextFrame(n,E,r,o,e,c)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)}}}},a.prototype._getCandidateCoord=function(t,e,a){var s=e.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var i=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch(t){throw new Error("予期せぬ方向への移動のようです。")}var r=s.clone(),o=0,n=0;return a===x.CHASE_PLAYER?(o=s.x>i.x?-1:s.x<i.x?1:0,n=s.y>i.y?-1:s.y<i.y?1:0):a===x.RUN_OUT&&(o=s.x>i.x?1:s.x<i.x?-1:0,n=s.y>i.y?1:s.y<i.y?-1:0),r.x+=o,r.y+=n,r.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.x)),r.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.y)),r},a.prototype._getSecondCandidateMoveMode=function(t,e,a,s,i,r,o){return!t||(this._player.getDir()!==u.UP&&this._player.getDir()!==u.DOWN||!r)&&(this._player.getDir()!==u.LEFT&&this._player.getDir()!==u.RIGHT||r)?this._objectCanMoveTo(t,s,o)?B.MODE_X:this._objectCanMoveTo(t,i,o)?B.MODE_Y:B.UNDECIDED:this._objectCanMoveTo(t,i,o)?B.MODE_Y:this._objectCanMoveTo(t,s,o)?B.MODE_X:B.UNDECIDED},a.prototype._getThirdCandidate=function(t,e,a,s,i){var r,o=s===x.CHASE_PLAYER?1:s===x.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(r=new f(a.x,_.y+1*o),this._objectCanMoveTo(t,r,i))return r;if(r=new f(a.x,_.y-1*o),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x,_.y+1*o),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x,_.y-1*o),this._objectCanMoveTo(t,r,i))return r}if(n.y!==_.y){if(r=new f(_.x+1*o,a.y),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x-1*o,a.y),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x+1*o,_.y),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x-1*o,_.y),this._objectCanMoveTo(t,r,i))return r}return null},a.prototype._getRandomMoveCoord=function(t,e,a){for(var s=e.getPartsCoord(),i=s.clone(),r=this._wwaData.isOldMove?Q.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:Q.RANDOM_MOVE_ITERATION_NUM,o=0;o<r;o++){var n=Math.floor(8*Math.random());if(i.x=s.x+v[n],i.y=s.y+T[n],this._objectCanMoveTo(t,i,a))return i}return s},a.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},a.prototype._objectCanMoveTo=function(t,e,a){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var s=this._wwaData.map[e.y][e.x],i=this._wwaData.mapObject[e.y][e.x],r=this._wwaData.mapAttribute[s][Q.ATR_TYPE],o=this._camera.getPosition(),n=o.getPartsCoord().x,_=o.getPartsCoord().y;if(0===s&&!this.isOldMap()||r===Q.MAP_WALL)return!1;var c=e.x-n+1,h=e.y-_+1;if(0<=c&&0<=h&&c<a.length&&h<a.length){if(0!==a[h][c])return!1}else if(0!==i)return!1;if(t){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(e))return!1}else if(this._player.getPosition().getPartsCoord().equals(e))return!1;return!0},a.prototype._setObjectsInNextFrame=function(t,e,a,s,i,r){var o=e.x-a+1,n=e.y-s+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=o&&o<i.length&&0<=n&&n<i.length&&(i[t.y-s+1][t.x-a+1]=0,i[e.y-s+1][e.x-a+1]=r,this.hoge[e.y-s+1][e.x-a+1]=r),this._objectMovingDataManager.add(r,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},a.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),a=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW-1),s=Math.max(0,t.y),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(H.DECISION);for(var o=e;o<=a;o++)for(var n=s;n<=i;n++){var _=this._wwaData.mapObject[n][o];this._wwaData.objectAttribute[_][Q.ATR_TYPE]===Q.OBJECT_MONSTER&&-1===r.indexOf(_)&&r.push(_)}return this._bottomButtonType===h.BATTLE_REPORT&&_t(F[b.GOTO_WWA]).classList.add("onpress"),0===r.length?(_t(F[b.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},a.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),_t(F[b.GOTO_WWA]).classList.remove("onpress")},a.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Wt.SAVE)this._player.clearPasswordWindowWaiting();else{try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e}},a.prototype._displayUserVars=function(){if(this._canDisplayUserVars&&this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable())){this.setNowPlayTime();var t="変数一覧\n";this._userVarNameListRequestError&&("noFileSpecified"===this._userVarNameListRequestError.kind?t+=this._userVarNameListRequestError.errorMessage+"\n":(t+="【変数名取得失敗】\n",t+=" すべての変数を名無しとしています。\n",t+=" エラー詳細: ".concat(this._userVarNameListRequestError.errorMessage,"\n")));for(var e=0;e<Q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var a=(this._inlineUserVarViewer.topUserVarIndex+e)%Q.USER_VAR_NUM,s=this._userVarNameList&&this._userVarNameList[a]?this._userVarNameList[a]:"名無し",i="変数 ".concat(a,": ").concat(s);t+="".concat(i,": ").concat(this._wwaData.userVar[a],"\n")}t+="\n操作方法\n",t+="上キー:1つ戻す 下キー:1つ進める\n",t+="左キー:10つ戻す 右キー:10つ進める\n",this.setMessageQueue(t,!1,!0)}},a.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case M.GAME:switch(this.userDevice.os){case C.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.9.2\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.PLAY_STATION:t=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.9.2\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.XBOX:t=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.9.2\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case M.SP:case M.VR:return;case M.PC:t=" 【操作方法】\nF1、M:戦闘結果予測の表示\nF3:復帰用パスワード入力\nF4:復帰用パスワード表示\nF5:一時保存データの読み込み\nF6:データの一時保存\nF7:初めからスタート\nF8:WWA公式ページにリンク\nF12:このリストの表示\nキーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。\n「Enter、Y」はYes,\n「Esc、N」はNoに対応。\n I: 移動速度を落とす/\nF2、P: 移動速度を上げる\n 現在の移動回数:"+this._player.getMoveCount()+"\n プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.9.2\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.setMessageQueue(t,!1,!0)}},a.prototype._setNextMessage=function(t){if(void 0===t&&(t=!1),this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&(this._scoreWindow.hide(),this._scoreRates=void 0),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._messageQueue.length)this._hideMessageWindow();else{var e=this._messageQueue.shift(),a=e.macro;this._lastMessage=e;for(var s=0;s<a.length;s++)this._execMacroListInNextFrame.push(a[s]);e.isEmpty()?0===this._messageQueue.length?this._hideMessageWindow():this._setNextMessage():(this._player.setDelayFrame(),this._messageWindow.hide(),this._messageWindow.setParsedMessage(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),t,this._player.getPosition(),this._camera.getPosition()),this._messageWindow.show(),this._player.setMessageWaiting())}this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},a.prototype._hideMessageWindow=function(t){void 0===t&&(t=!0);var e=0;this._player.isReadyToUseItem()&&(e=this._player.useItem());var a=this.getObjectAttributeById(e,Q.ATR_STRING);this.clearFaces(),0===a?(t&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting()):this.setMessageQueue(this.getMessageById(a),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord(),!0)},a.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},a.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},a.prototype.replaceParts=function(t,e,a,s){void 0===a&&(a=I.OBJECT),void 0===s&&(s=!1);var i,r,o,n,_,c,h,u,l=this._camera.getPosition().getPartsCoord(),p=s?Math.max(0,l.x):0,d=s?Math.min(this._wwaData.mapWidth-1,l.x+Q.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,E=s?Math.max(0,l.y):0,f=s?Math.min(this._wwaData.mapWidth-1,l.y+Q.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(s=0!==p||d!==this._wwaData.mapWidth-1||0!==E||f!==this._wwaData.mapWidth-1,a===I.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),n=this._mapObjectIDTable[t].concat(),(h=this._mapObjectIDTable[t]).length=0,u=this._mapObjectIDTable[e],r=n.length,s)for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.mapObject[c][_]=e,u.push(i)):h.push(i);else{for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.mapObject[c][_]=e;Array.prototype.push.apply(u,n)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),n=this._mapIDTable[t].concat(),(h=this._mapIDTable[t]).length=0,u=this._mapIDTable[e],r=n.length,s)for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.map[c][_]=e,u.push(i)):h.push(i);else{for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.map[c][_]=e;Array.prototype.push.apply(u,n)}},a.prototype.getYesNoImgCoord=function(){return new f(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},a.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},a.prototype.getPlayerImgCoord=function(){return new f(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},a.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},a.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},a.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},a.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},a.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},a.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},a.prototype.isOldMap=function(){return this._wwaData.isOldMap},a.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},a.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},a.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},a.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},a.prototype.setPlayerStatus=function(t,e,a){if(t===G.ENERGY)this._player.setEnergy(e),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:a})&&this.gameover();else if(t===G.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===G.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===G.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==G.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}},a.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},a.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},a.prototype.setStatusIconCoord=function(t,e){var a=e.x*Q.CHIP_SIZE,s=e.y*Q.CHIP_SIZE,i=function(t){ht("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(a,"px -").concat(s,"px")};switch(t){case V.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,i("#disp-energy");break;case V.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,i("#disp-strength");break;case V.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,i("#disp-defence");break;case V.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,i("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},a.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*Q.CHIP_SIZE,a=t.y*Q.CHIP_SIZE;return Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+a+"px"})),t.clone()},a.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},a.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},a.prototype.canInput=function(){return!this._temporaryInputDisable},a.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},a.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},a.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},a.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new f(0,0)))Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(a){a.style.backgroundImage="url('"+e+"')",a.style.backgroundPosition="-"+t.x*Q.CHIP_SIZE+"px -"+t.y*Q.CHIP_SIZE+"px"}))}},a.prototype.addFace=function(t){this._faces.push(t),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())},a.prototype.clearFaces=function(){this._faces=[]},a.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},a.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},a.prototype.setGameOverPolicy=function(t){switch(t){case 0:return void(this._wwaData.gameOverPolicy="default");case 1:return void(this._wwaData.gameOverPolicy="never");case 2:return void(this._wwaData.gameOverPolicy="except-macro");default:return}},a.prototype.initCSSRule=function(){this._styleElm=_t(Q.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},a.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",a=this._isClassicModeEnable?1:.9,s="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(a,");\nborder-color: rgba(").concat(this._wwaData.frameOutColorR,", ").concat(this._wwaData.frameOutColorG,", ").concat(this._wwaData.frameOutColorB,", 1);\ncolor: rgba(").concat(this._wwaData.fontColorR,", ").concat(this._wwaData.fontColorG,", ").concat(this._wwaData.fontColorB,", 1);\nwhite-space: pre-wrap;\n"),i="div#wwa-sidebar",r="\ncolor: rgba(".concat(this._wwaData.statusColorR,", ").concat(this._wwaData.statusColorG,", ").concat(this._wwaData.statusColorB,",1);\nfont-weight: bold;\n");void 0!==this._sheet.addRule?(this._stylePos[st.MESSAGE_WINDOW]=this._sheet.addRule(e,s),this._stylePos[st.SIDEBAR]=this._sheet.addRule(i,r)):(this._stylePos[st.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(s," }"),0),this._stylePos[st.SIDEBAR]=this._sheet.insertRule("".concat(i," { ").concat(r," }"),1))},a.prototype.changeStyleRule=function(t,e,a,s){t===at.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=a,this._wwaData.frameColorB=s):t===at.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=a,this._wwaData.frameOutColorB=s):t===at.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=a,this._wwaData.fontColorB=s):t===at.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=a,this._wwaData.statusColorB=s),this.updateCSSRule()},a.prototype.showMonsterWindow=function(){this._monsterWindow.show()},a.prototype.isClassicMode=function(){return this._isClassicModeEnable},a.prototype.isConsoleOutputMode=function(){return this._useConsole},a.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new y(this,t,e,0,0))},a.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(Q.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},a.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),a=Math.max(Math.min(e,Q.USER_VAR_NUM_MAX_VALUE),Q.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(a)?0:a},a.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<Q.USER_VAR_NUM&&(0|t)===t},a.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},a.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},a.prototype.recUserPosition=function(t,e){var a=this._player.getPosition().getPartsCoord();this.setUserVar(t,a.x),this.setUserVar(e,a.y)},a.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},a.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},a.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},a.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},a.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},a.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},a.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},a.prototype.setHPUserVar=function(t,e){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:e})&&this.gameover(),this._player.updateStatusValueBox()},a.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},a.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},a.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},a.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},a.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},a.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},a.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},a.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},a.prototype.setUserValRandNum=function(t,e,a){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+a)},a.prototype._generateUserValString=function(t){var e=this;return t.map((function(t){var a=parseInt(t,10);return isNaN(a)?t.replace(/\\n/g,"\n"):function(){return e._wwaData.userVar[a]}}))},a.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},a.prototype.switchConditionalExecutionStatus=function(t){if(void 0===t&&(t=""),"can-execute"!==this._conditionalMacroExecStatus)if("outside-ifelse"!==this._conditionalMacroExecStatus&&"cannot-execute"!==this._conditionalMacroExecStatus);else{var e=""===t||function(t,e){var a=ma(t).match(da);if(null===a||a.length<=3)return console.error("判定式が異常です: ".concat(t)),!1;var s=fa(a[1],e),i=fa(a[3],e);return function(t,e,a){switch(t){case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a;case"==":return e===a;case"!=":return e!==a;default:return!1}}(a[2],s,i)}(t,this._generateTokenValues());this._conditionalMacroExecStatus=e?"can-execute":"cannot-execute"}else this._conditionalMacroExecStatus="executed"},a.prototype.execSetMacro=function(t){void 0===t&&(t="");var e=function(t,e){var a=ma(t),s=a.match(la);if(null!==s){var i=fa(s[2],e),r=fa(s[4],e);return wa(ya(s[3],i,r),s[1])}var o=a.match(pa);if(null!==o)return i=fa(o[1],e),r=fa(o[3],e),wa(ya(o[2],i,r),o[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this._generateTokenValues()),a=e.assignee,s=e.rawValue;switch(a){case"energy":this._player.setEnergy(this.toValidStatusValue(s)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0})&&this.gameover();break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(s));break;case"strength":this._player.setStrength(this.toValidStatusValue(s));break;case"defence":this._player.setDefence(this.toValidStatusValue(s));break;case"gold":this._player.setGold(this.toValidStatusValue(s));break;default:if(isNaN(a)||!this.isValidUserVarIndex(a))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(a,this.toAssignableValue(s))}this._player.updateStatusValueBox()},a.prototype._generateTokenValues=function(){return this.setNowPlayTime(),{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._wwaData.playTime,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord()}},a.prototype.resetConditionalMacroExecStaus=function(){this._conditionalMacroExecStatus="outside-ifelse"},a.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var a=parseInt(e[0],10),s=parseInt(e[2],10);if(!this.isValidUserVarIndex(a)||!this.isValidUserVarIndex(s))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var i=this._wwaData.userVar[a],r=e[1],o=this._wwaData.userVar[s],n=function(t){return parseInt(t,10)?I.MAP:I.OBJECT};if(this.compareUserVar(i,r,o)){var _=parseInt(e[3],10),c=e[4],h=e[5],u=n(e[6]);this.appearPartsEval(t,c,h,_,u)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],E=n(e[10]);this.appearPartsEval(t,p,d,l,E)}},a.prototype.compareUserVar=function(t,e,a){switch(e){case"==":return t===a;case"!=":return t!==a;case">=":return t>=a;case">":return t>a;case"<=":return t<=a;case"<":return t<a;default:throw new Error("未定義の演算子です: ".concat(e))}},a.prototype.setPlayerSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},a.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},a.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},a.prototype.hideStatus=function(t,e){if(t<0||t>Z.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(Z[t],!e),this._player.updateStatusValueBox()},a.prototype.varMap=function(t,e,a,s,i){if(!this.isValidUserVarIndex(s))throw new Error("対象のユーザ変数の添字が範囲外です");var r=this._wwaData.userVar[s];if(r<0)throw new Error("負のパーツ番号は指定できません");if(i===I.OBJECT&&r>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(i===I.MAP&&r>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,a,r,i)},a.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(ut("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*Q.CHIP_SIZE,"px -").concat(t.y*Q.CHIP_SIZE,"px")}))},a.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,a,s;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(a=this._wwaData.gamePadButtonItemTable[e]){switch(s=!1,e){case o.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)&&(s=!0);break;case o.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)&&(s=!0);break;case o.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)&&(s=!0);break;case o.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)&&(s=!0)}if(this._gamePadStore.buttonTrigger(e)&&(s=!0),s&&this.onselectitem(a))return!0}return!1},a.prototype.setGamePadButtonItemTable=function(t,e){var a,s;if(!this._wwaData.gamePadButtonItemTable)for(s in this._wwaData.gamePadButtonItemTable=[],o)a=s,this._wwaData.gamePadButtonItemTable[a]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},a.prototype._checkSaveDataCompatibility=function(t,e,a){return void 0!==t&&t!==this._wwaData.worldName?ye.UNMATCHED_WORLD_NAME:a&&a!==fe(this._wwaData.worldName,this._wwaData.worldPassNumber)?ye.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?ye.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},a.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},a.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},a.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var a=this._dumpElement.querySelector(".varlist-information");a&&(a.textContent="".concat(e?"【エラー】":"").concat(t))}},a.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},a}(),Oa=!1;function Da(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(ut("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){Oa=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(Oa)return Oa=!1,t.returnValue=e,e}));var t=_t("wwa-wrapper").getAttribute("data-wwa-title-img");Gt(_t("wwa-wrapper"),t);var e=_t("wwa-wrapper").getAttribute("data-wwa-mapdata"),a=_t("wwa-wrapper").getAttribute("data-wwa-audio-dir"),s=_t("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),i=null,r="true"===_t("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),o=_t("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");_t("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&r&&(i=function(t){var e=ct(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var a=document.createElement("table"),s=document.createElement("tr"),i=document.createElement("th"),r=document.createElement("button"),o=document.createElement("td");r.textContent="隠す",i.textContent="変数一覧",i.setAttribute("colspan","10"),i.classList.add("varlist-header"),i.appendChild(r),s.appendChild(i),o.setAttribute("colspan","10"),o.classList.add("varlist-information"),o.textContent="強調されている番号にカーソルを乗せると説明が表示されます。",a.appendChild(s),a.appendChild(o);for(var n=null,_=null,c=0;c<Q.USER_VAR_NUM;c++){c%10==0&&(null!==n&&(a.appendChild(n),a.appendChild(_)),(n=document.createElement("tr")).classList.add("var-number"),(_=document.createElement("tr")).classList.add("var-val"));var h=document.createElement("th"),u=document.createElement("div");u.textContent="-",u.setAttribute("aria-hidden","true"),h.classList.add("var-index".concat(c));var l=document.createElement("td");h.textContent=c+"",h.appendChild(u),l.classList.add("var".concat(c)),l.textContent="-",n.appendChild(h),_.appendChild(l)}Q.USER_VAR_NUM%10!=0&&(a.appendChild(n),a.appendChild(_)),e.appendChild(a);var p=!0;return r.addEventListener("click",(function(t){p?(this.textContent="表示",o.style.display="none",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),p=!1):(this.textContent="隠す",o.style.display="",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display=""})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display=""})),p=!0)})),e}(s));var n=!0;_t("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(n=!1);var _=_t("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),c=!1;null!==_&&_.match(/^true$/i)&&(c=!0);var h=!0,u=_t("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==u&&u.match(/^false$/i)&&(h=!1);var l=!1,p=_t("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==p&&p.match(/^true$/i)&&(l=!0);var d,E=!(null===(d=_t("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!d.match(/^true$/i));ga=new Ta(e,n,t,c,h,l,a,E,i,o,r)}}"complete"===document.readyState?setTimeout(Da):window.addEventListener("load",(function(){setTimeout(Da)}))}()}();
|
|
21
|
+
function(t){var e=s,a=e.lib,i=a.WordArray,r=a.Hasher,o=e.algo,n=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),_=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),h=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=o.RIPEMD160=r.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=0;a<16;a++){var s=e+a,i=t[s];t[s]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var r,o,p,g,A,S,I,v,T,O,D,C=this._hash.words,M=u.words,N=l.words,P=n.words,b=_.words,R=c.words,L=h.words;for(S=r=C[0],I=o=C[1],v=p=C[2],T=g=C[3],O=A=C[4],a=0;a<80;a+=1)D=r+t[e+P[a]]|0,D+=a<16?d(o,p,g)+M[0]:a<32?E(o,p,g)+M[1]:a<48?f(o,p,g)+M[2]:a<64?y(o,p,g)+M[3]:w(o,p,g)+M[4],D=(D=m(D|=0,R[a]))+A|0,r=A,A=g,g=m(p,10),p=o,o=D,D=S+t[e+b[a]]|0,D+=a<16?w(I,v,T)+N[0]:a<32?y(I,v,T)+N[1]:a<48?f(I,v,T)+N[2]:a<64?E(I,v,T)+N[3]:d(I,v,T)+N[4],D=(D=m(D|=0,L[a]))+O|0,S=O,O=T,T=m(v,10),v=I,I=D;D=C[1]+p+T|0,C[1]=C[2]+g+O|0,C[2]=C[3]+A+S|0,C[3]=C[4]+r+I|0,C[4]=C[0]+o+v|0,C[0]=D},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,s=8*t.sigBytes;e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,r=i.words,o=0;o<5;o++){var n=r[o];r[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return i},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,a){return t^e^a}function E(t,e,a){return t&e|~t&a}function f(t,e,a){return(t|~e)^a}function y(t,e,a){return t&a|e&~a}function w(t,e,a){return t^(e|~a)}function m(t,e){return t<<e|t>>>32-e}e.RIPEMD160=r._createHelper(p),e.HmacRIPEMD160=r._createHmacHelper(p)}(Math),s.RIPEMD160)},637:function(t,e,a){var s,i,r,o,n,_,c,h;t.exports=(h=a(359),i=(s=h).lib,r=i.WordArray,o=i.Hasher,n=s.algo,_=[],c=n.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var a=this._hash.words,s=a[0],i=a[1],r=a[2],o=a[3],n=a[4],c=0;c<80;c++){if(c<16)_[c]=0|t[e+c];else{var h=_[c-3]^_[c-8]^_[c-14]^_[c-16];_[c]=h<<1|h>>>31}var u=(s<<5|s>>>27)+n+_[c];u+=c<20?1518500249+(i&r|~i&o):c<40?1859775393+(i^r^o):c<60?(i&r|i&o|r&o)-1894007588:(i^r^o)-899497514,n=o,o=r,r=i<<30|i>>>2,i=s,s=u}a[0]=a[0]+s|0,a[1]=a[1]+i|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[14+(s+64>>>9<<4)]=Math.floor(a/4294967296),e[15+(s+64>>>9<<4)]=a,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}}),s.SHA1=o._createHelper(c),s.HmacSHA1=o._createHmacHelper(c),h.SHA1)},640:function(t,e,a){var s,i,r,o,n,_;t.exports=(_=a(359),a(93),i=(s=_).lib.WordArray,r=s.algo,o=r.SHA256,n=r.SHA224=o.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=4,t}}),s.SHA224=o._createHelper(n),s.HmacSHA224=o._createHmacHelper(n),_.SHA224)},93:function(t,e,a){var s;t.exports=(s=a(359),function(t){var e=s,a=e.lib,i=a.WordArray,r=a.Hasher,o=e.algo,n=[],_=[];!function(){function e(e){for(var a=t.sqrt(e),s=2;s<=a;s++)if(!(e%s))return!1;return!0}function a(t){return 4294967296*(t-(0|t))|0}for(var s=2,i=0;i<64;)e(s)&&(i<8&&(n[i]=a(t.pow(s,.5))),_[i]=a(t.pow(s,1/3)),i++),s++}();var c=[],h=o.SHA256=r.extend({_doReset:function(){this._hash=new i.init(n.slice(0))},_doProcessBlock:function(t,e){for(var a=this._hash.words,s=a[0],i=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=0;p<64;p++){if(p<16)c[p]=0|t[e+p];else{var d=c[p-15],E=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,f=c[p-2],y=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;c[p]=E+c[p-7]+y+c[p-16]}var w=s&i^s&r^i&r,m=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),g=l+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&h^~n&u)+_[p]+c[p];l=u,u=h,h=n,n=o+g|0,o=r,r=i,i=s,s=g+(m+w)|0}a[0]=a[0]+s|0,a[1]=a[1]+i|0,a[2]=a[2]+r|0,a[3]=a[3]+o|0,a[4]=a[4]+n|0,a[5]=a[5]+h|0,a[6]=a[6]+u|0,a[7]=a[7]+l|0},_doFinalize:function(){var e=this._data,a=e.words,s=8*this._nDataBytes,i=8*e.sigBytes;return a[i>>>5]|=128<<24-i%32,a[14+(i+64>>>9<<4)]=t.floor(s/4294967296),a[15+(i+64>>>9<<4)]=s,e.sigBytes=4*a.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(h),e.HmacSHA256=r._createHmacHelper(h)}(Math),s.SHA256)},140:function(t,e,a){var s;t.exports=(s=a(359),a(467),function(t){var e=s,a=e.lib,i=a.WordArray,r=a.Hasher,o=e.x64.Word,n=e.algo,_=[],c=[],h=[];!function(){for(var t=1,e=0,a=0;a<24;a++){_[t+5*e]=(a+1)*(a+2)/2%64;var s=(2*t+3*e)%5;t=e%5,e=s}for(t=0;t<5;t++)for(e=0;e<5;e++)c[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,r=0;r<24;r++){for(var n=0,u=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?u^=1<<p:n^=1<<p-32}128&i?i=i<<1^113:i<<=1}h[r]=o.create(n,u)}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=o.create()}();var l=n.SHA3=r.extend({cfg:r.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var a=this._state,s=this.blockSize/2,i=0;i<s;i++){var r=t[e+2*i],o=t[e+2*i+1];r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(C=a[i]).high^=o,C.low^=r}for(var n=0;n<24;n++){for(var l=0;l<5;l++){for(var p=0,d=0,E=0;E<5;E++)p^=(C=a[l+5*E]).high,d^=C.low;var f=u[l];f.high=p,f.low=d}for(l=0;l<5;l++){var y=u[(l+4)%5],w=u[(l+1)%5],m=w.high,g=w.low;for(p=y.high^(m<<1|g>>>31),d=y.low^(g<<1|m>>>31),E=0;E<5;E++)(C=a[l+5*E]).high^=p,C.low^=d}for(var A=1;A<25;A++){var S=(C=a[A]).high,I=C.low,v=_[A];v<32?(p=S<<v|I>>>32-v,d=I<<v|S>>>32-v):(p=I<<v-32|S>>>64-v,d=S<<v-32|I>>>64-v);var T=u[c[A]];T.high=p,T.low=d}var O=u[0],D=a[0];for(O.high=D.high,O.low=D.low,l=0;l<5;l++)for(E=0;E<5;E++){var C=a[A=l+5*E],M=u[A],N=u[(l+1)%5+5*E],P=u[(l+2)%5+5*E];C.high=M.high^~N.high&P.high,C.low=M.low^~N.low&P.low}C=a[0];var b=h[n];C.high^=b.high,C.low^=b.low}},_doFinalize:function(){var e=this._data,a=e.words,s=(this._nDataBytes,8*e.sigBytes),r=32*this.blockSize;a[s>>>5]|=1<<24-s%32,a[(t.ceil((s+1)/r)*r>>>5)-1]|=128,e.sigBytes=4*a.length,this._process();for(var o=this._state,n=this.cfg.outputLength/8,_=n/8,c=[],h=0;h<_;h++){var u=o[h],l=u.high,p=u.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),c.push(p),c.push(l)}return new i.init(c,n)},clone:function(){for(var t=r.clone.call(this),e=t._state=this._state.slice(0),a=0;a<25;a++)e[a]=e[a].clone();return t}});e.SHA3=r._createHelper(l),e.HmacSHA3=r._createHmacHelper(l)}(Math),s.SHA3)},716:function(t,e,a){var s,i,r,o,n,_,c,h;t.exports=(h=a(359),a(467),a(834),i=(s=h).x64,r=i.Word,o=i.WordArray,n=s.algo,_=n.SHA512,c=n.SHA384=_.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=_._doFinalize.call(this);return t.sigBytes-=16,t}}),s.SHA384=_._createHelper(c),s.HmacSHA384=_._createHmacHelper(c),h.SHA384)},834:function(t,e,a){var s;t.exports=(s=a(359),a(467),function(){var t=s,e=t.lib.Hasher,a=t.x64,i=a.Word,r=a.WordArray,o=t.algo;function n(){return i.create.apply(i,arguments)}var _=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],c=[];!function(){for(var t=0;t<80;t++)c[t]=n()}();var h=o.SHA512=e.extend({_doReset:function(){this._hash=new r.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var a=this._hash.words,s=a[0],i=a[1],r=a[2],o=a[3],n=a[4],h=a[5],u=a[6],l=a[7],p=s.high,d=s.low,E=i.high,f=i.low,y=r.high,w=r.low,m=o.high,g=o.low,A=n.high,S=n.low,I=h.high,v=h.low,T=u.high,O=u.low,D=l.high,C=l.low,M=p,N=d,P=E,b=f,R=y,L=w,x=m,B=g,U=A,W=S,Y=I,k=v,F=T,G=O,V=D,H=C,K=0;K<80;K++){var j,X,J=c[K];if(K<16)X=J.high=0|t[e+2*K],j=J.low=0|t[e+2*K+1];else{var Z=c[K-15],Q=Z.high,q=Z.low,z=(Q>>>1|q<<31)^(Q>>>8|q<<24)^Q>>>7,$=(q>>>1|Q<<31)^(q>>>8|Q<<24)^(q>>>7|Q<<25),tt=c[K-2],et=tt.high,at=tt.low,st=(et>>>19|at<<13)^(et<<3|at>>>29)^et>>>6,it=(at>>>19|et<<13)^(at<<3|et>>>29)^(at>>>6|et<<26),rt=c[K-7],ot=rt.high,nt=rt.low,_t=c[K-16],ct=_t.high,ht=_t.low;X=(X=(X=z+ot+((j=$+nt)>>>0<$>>>0?1:0))+st+((j+=it)>>>0<it>>>0?1:0))+ct+((j+=ht)>>>0<ht>>>0?1:0),J.high=X,J.low=j}var ut,lt=U&Y^~U&F,pt=W&k^~W&G,dt=M&P^M&R^P&R,Et=N&b^N&L^b&L,ft=(M>>>28|N<<4)^(M<<30|N>>>2)^(M<<25|N>>>7),yt=(N>>>28|M<<4)^(N<<30|M>>>2)^(N<<25|M>>>7),wt=(U>>>14|W<<18)^(U>>>18|W<<14)^(U<<23|W>>>9),mt=(W>>>14|U<<18)^(W>>>18|U<<14)^(W<<23|U>>>9),gt=_[K],At=gt.high,St=gt.low,It=V+wt+((ut=H+mt)>>>0<H>>>0?1:0),vt=yt+Et;V=F,H=G,F=Y,G=k,Y=U,k=W,U=x+(It=(It=(It=It+lt+((ut+=pt)>>>0<pt>>>0?1:0))+At+((ut+=St)>>>0<St>>>0?1:0))+X+((ut+=j)>>>0<j>>>0?1:0))+((W=B+ut|0)>>>0<B>>>0?1:0)|0,x=R,B=L,R=P,L=b,P=M,b=N,M=It+(ft+dt+(vt>>>0<yt>>>0?1:0))+((N=ut+vt|0)>>>0<ut>>>0?1:0)|0}d=s.low=d+N,s.high=p+M+(d>>>0<N>>>0?1:0),f=i.low=f+b,i.high=E+P+(f>>>0<b>>>0?1:0),w=r.low=w+L,r.high=y+R+(w>>>0<L>>>0?1:0),g=o.low=g+B,o.high=m+x+(g>>>0<B>>>0?1:0),S=n.low=S+W,n.high=A+U+(S>>>0<W>>>0?1:0),v=h.low=v+k,h.high=I+Y+(v>>>0<k>>>0?1:0),O=u.low=O+G,u.high=T+F+(O>>>0<G>>>0?1:0),C=l.low=C+H,l.high=D+V+(C>>>0<H>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,a=8*this._nDataBytes,s=8*t.sigBytes;return e[s>>>5]|=128<<24-s%32,e[30+(s+128>>>10<<5)]=Math.floor(a/4294967296),e[31+(s+128>>>10<<5)]=a,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(h),t.HmacSHA512=e._createHmacHelper(h)}(),s.SHA512)},567:function(t,e,a){var s;t.exports=(s=a(359),a(139),a(174),a(844),a(951),function(){var t=s,e=t.lib,a=e.WordArray,i=e.BlockCipher,r=t.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],h=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=r.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],a=0;a<56;a++){var s=o[a]-1;e[a]=t[s>>>5]>>>31-s%32&1}for(var i=this._subKeys=[],r=0;r<16;r++){var c=i[r]=[],h=_[r];for(a=0;a<24;a++)c[a/6|0]|=e[(n[a]-1+h)%28]<<31-a%6,c[4+(a/6|0)]|=e[28+(n[a+24]-1+h)%28]<<31-a%6;for(c[0]=c[0]<<1|c[0]>>>31,a=1;a<7;a++)c[a]=c[a]>>>4*(a-1)+3;c[7]=c[7]<<5|c[7]>>>27}var u=this._invSubKeys=[];for(a=0;a<16;a++)u[a]=i[15-a]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,a){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var s=0;s<16;s++){for(var i=a[s],r=this._lBlock,o=this._rBlock,n=0,_=0;_<8;_++)n|=c[_][((o^i[_])&h[_])>>>0];this._lBlock=o,this._rBlock=r^n}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var a=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=a,this._lBlock^=a<<t}function p(t,e){var a=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=a,this._rBlock^=a<<t}t.DES=i._createHelper(u);var d=r.TripleDES=i.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),s=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=u.createEncryptor(a.create(e)),this._des2=u.createEncryptor(a.create(s)),this._des3=u.createEncryptor(a.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),s.TripleDES)},467:function(t,e,a){var s;t.exports=(s=a(359),function(t){var e=s,a=e.lib,i=a.Base,r=a.WordArray,o=e.x64={};o.Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),o.WordArray=i.extend({init:function(e,a){e=this.words=e||[],this.sigBytes=a!=t?a:8*e.length},toX32:function(){for(var t=this.words,e=t.length,a=[],s=0;s<e;s++){var i=t[s];a.push(i.high),a.push(i.low)}return r.create(a,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),a=e.length,s=0;s<a;s++)e[s]=e[s].clone();return t}})}(),s)},633:function(){},106:function(){}},e={};function a(s){var i=e[s];if(void 0!==i)return i.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,a),r.exports}a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t,e;!function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}(t||(t={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_I=73]="KEY_I",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_S=83]="KEY_S",t[t.KEY_V=86]="KEY_V",t[t.KEY_W=87]="KEY_W",t[t.KEY_X=88]="KEY_X",t[t.KEY_Y=89]="KEY_Y",t[t.KEY_Z=90]="KEY_Z",t[t.KEY_F1=112]="KEY_F1",t[t.KEY_F2=113]="KEY_F2",t[t.KEY_F3=114]="KEY_F3",t[t.KEY_F4=115]="KEY_F4",t[t.KEY_F5=116]="KEY_F5",t[t.KEY_F6=117]="KEY_F6",t[t.KEY_F7=118]="KEY_F7",t[t.KEY_F8=119]="KEY_F8",t[t.KEY_F9=120]="KEY_F9",t[t.KEY_F10=121]="KEY_F10",t[t.KEY_F12=123]="KEY_F12"}(e||(e={}));var s,i,r=function(){function e(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),this._keyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}return e.prototype.checkHitKey=function(e){var a=this.getKeyState(e);return a===t.KEYDOWN||a===t.KEYPRESS},e.prototype.getKeyState=function(e){return this._prevKeyState[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForControllPlayer=function(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForMessageCheck=function(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=Q.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?t.KEYPRESS_MESSAGECHANGE:t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},e.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},e.prototype.update=function(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++},e.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},e.prototype.allClear=function(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1},e.KEY_BUFFER_MAX=256,e}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(s||(s={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(i||(i={}));var o,n,_=function(){function t(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}return t.prototype.checkClickMouse=function(t){var e;return(e=void 0!==t?this.getMouseState(t):this.getMouseState())===s.MOUSEDOWN||e===s.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?s.NONE:this._prevMouseState?this._mouseState?s.MOUSEPRESS:s.MOUSEUP:this._mouseState?s.MOUSEDOWN:s.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?s.NONE:this._prevMouseStateOnControllable?this._mouseState?s.MOUSEPRESS:s.MOUSEUP:this._mouseState?s.MOUSEDOWN:s.NONE},t.prototype.setPressInfo=function(t,e){this._nextMouseState=!0,this._inputDir=t,this._touchID=e},t.prototype.setReleaseInfo=function(){this._touchID=0,this._nextMouseState=!1},t.prototype.touchIDIsSetDir=function(){return this._touchID===i.DIR_KEY},t.prototype.memorizeMouseStateOnControllableFrame=function(){this._prevMouseStateOnControllable=this._mouseState},t.prototype.update=function(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState},t.prototype.clear=function(){this._nextMouseState=!1},t.prototype.getTouchID=function(){return this._touchID},t}();!function(t){t[t.BUTTON_INDEX_B=0]="BUTTON_INDEX_B",t[t.BUTTON_INDEX_A=1]="BUTTON_INDEX_A",t[t.BUTTON_INDEX_Y=2]="BUTTON_INDEX_Y",t[t.BUTTON_INDEX_X=3]="BUTTON_INDEX_X",t[t.BUTTON_INDEX_L=4]="BUTTON_INDEX_L",t[t.BUTTON_INDEX_R=5]="BUTTON_INDEX_R",t[t.BUTTON_INDEX_ZL=6]="BUTTON_INDEX_ZL",t[t.BUTTON_INDEX_ZR=7]="BUTTON_INDEX_ZR",t[t.BUTTON_INDEX_MINUS=8]="BUTTON_INDEX_MINUS",t[t.BUTTON_INDEX_PLUS=9]="BUTTON_INDEX_PLUS",t[t.BUTTON_INDEX_LEFT_STICK=10]="BUTTON_INDEX_LEFT_STICK",t[t.BUTTON_INDEX_RIGHT_STICK=11]="BUTTON_INDEX_RIGHT_STICK",t[t.BUTTON_CROSS_KEY_UP=12]="BUTTON_CROSS_KEY_UP",t[t.BUTTON_CROSS_KEY_DOWN=13]="BUTTON_CROSS_KEY_DOWN",t[t.BUTTON_CROSS_KEY_LEFT=14]="BUTTON_CROSS_KEY_LEFT",t[t.BUTTON_CROSS_KEY_RIGHT=15]="BUTTON_CROSS_KEY_RIGHT"}(o||(o={})),function(t){t[t.AXES_L_HORIZONTAL_INDEX=0]="AXES_L_HORIZONTAL_INDEX",t[t.AXES_L_VERTICAL_INDEX=1]="AXES_L_VERTICAL_INDEX",t[t.AXES_R_HORIZONTAL_INDEX=2]="AXES_R_HORIZONTAL_INDEX",t[t.AXES_R_VERTICAL_INDEX=3]="AXES_R_VERTICAL_INDEX",t[t.AXES_CROSS_KEY=9]="AXES_CROSS_KEY"}(n||(n={}));var c,h,u,l=function(){function t(){var t;for(this.gamepad=null,this.triggers=[],t=0;t<16;t++)this.triggers[t]=!1}return t.prototype.update=function(){this.gamepad=null;var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(t&&t.length>0&&t[0]){var e=t[0];this.gamepad=e}},t.prototype.buttonTrigger=function(){for(var t,e,a,s,i,r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(!this.gamepad)return!1;for(e=r.length,t=0;t<e;t++){a=r[t];var n=this.gamepad.buttons[a];if(!n)return!1;if(s="object"==typeof n?!0===n.pressed:1===n,i=this.triggers[a],this.triggers[a]=s,s&&!i)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,a,s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(!this.gamepad)return!1;for(e=s.length,t=0;t<e;t++){a=s[t];var r=this.gamepad.buttons[a];if(!r)return!1;if("object"==typeof r?!0===r.pressed:1===r)return!0}return!1},t.prototype.crossPressed=function(){for(var t,e,a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++)switch(a[t]){case o.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_UP))return!0;break;case o.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_DOWN))return!0;break;case o.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_LEFT))return!0;break;case o.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(o.BUTTON_CROSS_KEY_RIGHT))return!0}return!1},t.prototype.vibration=function(t){return!!this.gamepad&&(!!this.gamepad.vibrationActuator&&void(t?this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:1,strongMagnitude:.5}):this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:.5,strongMagnitude:1})))},t.prototype.stickFloor=function(){for(var t,e,a,s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];if(!this.gamepad)return 0;for(e=s.length,t=0;t<e;t++){a=s[t];var r=this.gamepad.axes[a];return"number"!=typeof r?0:Math.floor(10*r)/10}return 0},t}(),p=(c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},c(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function a(){this.constructor=t}c(t,e),t.prototype=null===e?Object.create(e):(a.prototype=e.prototype,new a)}),d=function(){function t(t,e){this.strength=t,this.defence=e}return t.prototype.add=function(t){return this.strength+=t.strength,this.defence+=t.defence,this},t.prototype.plus=function(e){return new t(this.strength+e.strength,this.defence+e.defence)},t.prototype.minus=function(e){return new t(this.strength-e.strength,this.defence-e.defence)},t.prototype.equals=function(t){return this.strength===t.strength&&this.defence===t.defence},t}(),E=function(t){function e(e,a,s,i){var r=t.call(this,a,s)||this;return r.energy=e,r.gold=i,r}return p(e,t),e.prototype.add=function(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this},e.prototype.plus=function(t){return t instanceof e?new e(this.energy+t.energy,this.strength+t.strength,this.defence+t.defence,this.gold+t.gold):new e(this.energy,this.strength+t.strength,this.defence+t.defence,this.gold)},e.prototype.minus=function(t){return t instanceof e?new e(this.energy-t.energy,this.strength-t.strength,this.defence-t.defence,this.gold-t.gold):new e(this.energy,this.strength-t.strength,this.defence-t.defence,this.gold)},e.prototype.equals=function(t){return this.energy===t.energy&&this.strength===t.strength&&this.defence===t.defence&&this.gold===t.gold},e.prototype.calculateScore=function(t){var e=this;return Object.keys(t).reduce((function(a,s){return a+t[s]*e[s]}),0)},e}(d),f=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.convertIntoPosition=function(t){return new y(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?u.RIGHT_UP:this.y===t.y?u.RIGHT:u.RIGHT_DOWN:this.x===t.x?this.y>t.y?u.UP:this.y===t.y?u.NO_DIRECTION:u.DOWN:this.y>t.y?u.LEFT_UP:this.y===t.y?u.LEFT:u.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),y=function(){function t(t,e,a,s,i){if(void 0===s&&(s=0),void 0===i&&(i=0),this._wwa=t,void 0===this._wwa)throw new Error("WWAのインスタンスが存在しません. ");var r=this._wwa.getMapWidth();if(e<0||e>=r||e>=r-1&&s>0||a<0||a>=r||a>=r-1&&i>0)throw new Error("範囲外の座標です!! parts:("+e+", "+a+"), offset:("+s+", "+i+"), mapWidth = "+r);this._partsCoord=new f(e,a),this._offsetCoord=new f(s,i)}return t.prototype.getPartsCoord=function(){return this._partsCoord},t.prototype.getOffsetCoord=function(){return this._offsetCoord},t.prototype.getScreenTopPosition=function(){var e=Math.floor(this._partsCoord.x/(Q.H_PARTS_NUM_IN_WINDOW-1))*(Q.H_PARTS_NUM_IN_WINDOW-1),a=Math.floor(this._partsCoord.y/(Q.V_PARTS_NUM_IN_WINDOW-1))*(Q.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,a,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),a=this._wwa.getMapWidth(),s=t.getPartsCoord().clone();return e.x===a-1&&s.x--,e.y===a-1&&s.y--,s.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var a=this._partsCoord;return new t(this._wwa,a.x+v[e],a.y+T[e],0,0)}var s=this._partsCoord.x,i=this._partsCoord.y;return this._offsetCoord.x<0?s--:this._offsetCoord.x>0&&s++,this._offsetCoord.y<0?i--:this._offsetCoord.y>0&&i++,new t(this._wwa,s,i,0,0)},t.prototype.getNextFramePosition=function(e,a,s){var i=this._partsCoord.x,r=this._partsCoord.y,o=this._offsetCoord.x+v[e]*a,n=this._offsetCoord.y+T[e]*s;if(o<0){var _=Math.floor(Math.abs(o)/Q.CHIP_SIZE);i-=_,o=(o+_*Q.CHIP_SIZE)%Q.CHIP_SIZE}if(n<0){var c=Math.floor(Math.abs(n)/Q.CHIP_SIZE);r-=c,n=(n+c*Q.CHIP_SIZE)%Q.CHIP_SIZE}return o>=Q.CHIP_SIZE&&(i+=Math.floor(o/Q.CHIP_SIZE),o=(o+Q.CHIP_SIZE)%Q.CHIP_SIZE),n>=Q.CHIP_SIZE&&(r+=Math.floor(n/Q.CHIP_SIZE),n=(n+Q.CHIP_SIZE)%Q.CHIP_SIZE),new t(this._wwa,i,r,o,n)},t.prototype.isJustPosition=function(){return 0==this._offsetCoord.x&&0==this._offsetCoord.y},t.prototype.isScreenTopPosition=function(){var t=this.getScreenTopPosition();return this.equals(t)},t.prototype.equals=function(t){return this._partsCoord.equals(t.getPartsCoord())&&this._offsetCoord.equals(t.getOffsetCoord())},t.prototype.isInCameraRange=function(t,e){void 0===e&&(e=!1);var a=t.getPosition()._partsCoord,s=this._partsCoord.x,i=this._partsCoord.y,r=e?1:0;return a.x<=s&&s<a.x+Q.H_PARTS_NUM_IN_WINDOW-r&&a.y<=i&&i<a.y+Q.V_PARTS_NUM_IN_WINDOW-r},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===Q.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===Q.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),w=function(t,e,a){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=a.clone()},m=function(t,e,a,s,i){this.partsIDObj=t,this.x=e,this.y=a,this.isStatic=s,this.isFighting=i};!function(t){t[t.GOTO_WWA=0]="GOTO_WWA",t[t.BATTLE_REPORT=1]="BATTLE_REPORT",t[t.GAME_END=2]="GAME_END"}(h||(h={})),function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=3]="UP",t[t.LEFT_DOWN=4]="LEFT_DOWN",t[t.LEFT_UP=5]="LEFT_UP",t[t.RIGHT_DOWN=6]="RIGHT_DOWN",t[t.RIGHT_UP=7]="RIGHT_UP",t[t.NO_DIRECTION=8]="NO_DIRECTION"}(u||(u={}));var g,A,S,I,v=[-1,1,0,0,-1,-1,1,1,0],T=[0,0,1,-1,1,-1,1,-1,0],O=[4,6,2,0],D=[e.KEY_LEFT,e.KEY_RIGHT,e.KEY_DOWN,e.KEY_UP];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(g||(g={})),function(t){t[t.MAP=0]="MAP",t[t.OBJECT=1]="OBJECT",t[t.CHOICE_YES=2]="CHOICE_YES",t[t.CHOICE_NO=3]="CHOICE_NO"}(A||(A={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(S||(S={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(I||(I={}));var C,M,N,P,b,R,L,x,B,U=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?C.XBOX:t.match(/windows/i)?C.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?C.IOS:C.MACINTOSH:t.match(/iphone|ipad|ipod/i)?C.IOS:t.match(/oculus/i)?C.OCULUS:t.match(/android/i)?C.ANDROID:t.match(/nintendo/i)?C.NINTENDO:t.match(/playstation/i)?C.PLAY_STATION:t.match(/linux/i)?C.LINUX:C.OTHERS},t.prototype.getBrowser=function(t){return t.match(/chrome/i)?N.CHROME:t.match(/firefox/i)?N.FIREFOX:t.match(/safari/i)?N.SAFARI:N.OTHERS},t.prototype.getDevice=function(){switch(this.os){case C.WINDOWS:case C.MACINTOSH:case C.LINUX:return M.PC;case C.IOS:case C.ANDROID:return M.SP;case C.OCULUS:return M.VR;case C.NINTENDO:case C.PLAY_STATION:case C.XBOX:return M.GAME}return M.OTHERS},t}();!function(t){t[t.WINDOWS=1]="WINDOWS",t[t.MACINTOSH=2]="MACINTOSH",t[t.LINUX=3]="LINUX",t[t.ANDROID=4]="ANDROID",t[t.IOS=5]="IOS",t[t.NINTENDO=6]="NINTENDO",t[t.PLAY_STATION=7]="PLAY_STATION",t[t.OCULUS=8]="OCULUS",t[t.XBOX=9]="XBOX",t[t.OTHERS=9999]="OTHERS"}(C||(C={})),function(t){t[t.PC=1]="PC",t[t.SP=2]="SP",t[t.VR=3]="VR",t[t.GAME=4]="GAME",t[t.OTHERS=9999]="OTHERS"}(M||(M={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.OTHERS=9999]="OTHERS"}(N||(N={})),function(t){t[t.NONE=0]="NONE",t[t.CALL_BY_MAP_PARTS=1]="CALL_BY_MAP_PARTS",t[t.CALL_BY_OBJECT_PARTS=2]="CALL_BY_OBJECT_PARTS",t[t.CALL_BY_ITEM_USE=3]="CALL_BY_ITEM_USE",t[t.CALL_BY_QUICK_SAVE=4]="CALL_BY_QUICK_SAVE",t[t.CALL_BY_QUICK_LOAD=5]="CALL_BY_QUICK_LOAD",t[t.CALL_BY_RESTART_GAME=6]="CALL_BY_RESTART_GAME",t[t.CALL_BY_GOTO_WWA=7]="CALL_BY_GOTO_WWA",t[t.CALL_BY_PASSWORD_SAVE=8]="CALL_BY_PASSWORD_SAVE",t[t.CALL_BY_PASSWORD_LOAD=9]="CALL_BY_PASSWORD_LOAD",t[t.CALL_BY_END_GAME=10]="CALL_BY_END_GAME",t[t.CALL_BY_SUSPEND=11]="CALL_BY_SUSPEND",t[t.CALL_BY_LOG_QUICK_SAVE=12]="CALL_BY_LOG_QUICK_SAVE",t[t.CALL_BY_LOG_QUICK_LOAD=13]="CALL_BY_LOG_QUICK_LOAD"}(P||(P={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.QUICK_SAVE=1]="QUICK_SAVE",t[t.RESTART_GAME=2]="RESTART_GAME",t[t.GOTO_WWA=3]="GOTO_WWA"}(b||(b={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(R||(R={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(L||(L={})),function(t){t[t.STATIC=0]="STATIC",t[t.CHASE_PLAYER=1]="CHASE_PLAYER",t[t.RUN_OUT=2]="RUN_OUT",t[t.HANG_AROUND=3]="HANG_AROUND"}(x||(x={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(B||(B={}));var W,Y,k,F=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.ASK_LINK=5]="ASK_LINK",t[t.NO_MONEY=6]="NO_MONEY",t[t.NO_ITEM=7]="NO_ITEM",t[t.USE_ITEM=8]="USE_ITEM"}(W||(W={})),function(t){t[t.CLICKABLE_ITEM=0]="CLICKABLE_ITEM",t[t.FULL_ITEM=1]="FULL_ITEM",t[t.LOAD_SE=2]="LOAD_SE"}(Y||(Y={})),function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MOENEY=37]="SET_MOENEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.NO_GAMEOVER=56]="NO_GAMEOVER",t[t.ELSE_IF=57]="ELSE_IF",t[t.ELSE=58]="ELSE",t[t.END_IF=59]="END_IF",t[t.SET=60]="SET",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE"}(k||(k={}));var G,V,H,K={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$no_gameover:56,$else_if:57,$else:58,$endif:59,$set:60,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(G||(G={})),function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.WIDE_CELL_ROW=4]="WIDE_CELL_ROW",t[t.ITEM_BG=5]="ITEM_BG",t[t.MAIN_FRAME=6]="MAIN_FRAME"}(V||(V={})),function(t){t[t.DECISION=1]="DECISION",t[t.ATTACK=3]="ATTACK",t[t.BGM_LB=70]="BGM_LB",t[t.NO_SOUND=99]="NO_SOUND"}(H||(H={}));var j,X=[1,2,5,8,10,20],J=["超低速","低速","準低速","中速","高速","超高速"],Z=["energy","strength","defence","gold"],Q=function(){function t(){}return t.WWA_HOME="http://wwajp.com",t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_TYPE=3,t.ATR_MODE=4,t.ATR_STRING=5,t.ATR_X=6,t.ATR_Y=7,t.ATR_X2=8,t.ATR_Y2=9,t.ATR_ENERGY=10,t.ATR_STRENGTH=11,t.ATR_DEFENCE=12,t.ATR_GOLD=13,t.ATR_ITEM=14,t.ATR_NUMBER=15,t.ATR_JUMP_X=16,t.ATR_MOVE=16,t.ATR_JUMP_Y=17,t.ATR_SOUND=19,t.ATR_APPERANCE_BASE=20,t.REL_ATR_APPERANCE_ID=0,t.REL_ATR_APPERANCE_X=1,t.REL_ATR_APPERANCE_Y=2,t.REL_ATR_APPERANCE_TYPE=3,t.REL_ATR_APPERANCE_UNIT_LENGTH=4,t.ATR_RANDOM_BASE=10,t.RANDOM_ATR_NUM=10,t.RANDOM_ITERATION_MAX=10,t.MAP_STREET=0,t.MAP_WALL=1,t.MAP_LOCALGATE=2,t.MAP_URLGATE=4,t.OBJECT_NORMAL=0,t.OBJECT_MESSAGE=1,t.OBJECT_URLGATE=2,t.OBJECT_STATUS=3,t.OBJECT_ITEM=4,t.OBJECT_DOOR=5,t.OBJECT_MONSTER=6,t.OBJECT_SCORE=11,t.OBJECT_SELL=14,t.OBJECT_BUY=15,t.OBJECT_RANDOM=16,t.OBJECT_SELECT=17,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGRELPOS_YESNO_YES_X=0,t.IMGRELPOS_YESNO_NO_X=1,t.IMGRELPOS_YESNO_YESP_X=2,t.IMGRELPOS_YESNO_NOP_X=3,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.SPLASH_SCREEN_DISP_MILLS=100,t.DEFAULT_FRAME_INTERVAL=20,t.GAMEOVER_FRAME_INTERVAL=50,t.YESNO_PRESS_DISP_FRAME_NUM=20,t.WAIT_TIME_FRAME_NUM=6,t.CHIP_SIZE=40,t.MAP_WINDOW_WIDTH=440,t.MAP_WINDOW_HEIGHT=440,t.H_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_WIDTH/t.CHIP_SIZE,t.V_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_HEIGHT/t.CHIP_SIZE,t.MIN_SPEED_INDEX=0,t.MAX_SPEED_INDEX=X.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[X.length-2,X.length-1],t.ANIMATION_REP_HALF_FRAME=22,t.PLAYER_LOOKING_AROUND_START_FRAME=4*t.ANIMATION_REP_HALF_FRAME,t.RELATIVE_COORD_BIAS=1e4,t.RELATIVE_COORD_LOWER=t.RELATIVE_COORD_BIAS-1e3,t.PLAYER_COORD=t.RELATIVE_COORD_BIAS-1e3,t.LOCALGATE_PLAYER_WAIT_FRAME=5,t.STATUS_CHANGED_EFFECT_FRAME_NUM=20,t.PASSABLE_OBJECT=1,t.APPERANCE_PARTS_MIN_INDEX=0,t.APPERANCE_PARTS_MAX_INDEX=9,t.APPERANCE_PARTS_MIN_INDEX_NO=5,t.APPERANCE_PARTS_MAX_INDEX_YES=4,t.FADEOUT_SPEED=8,t.STATUS_MINUS_BORDER=3e4,t.ITEMBOX_IS_FULL=-1,t.BATTLE_INTERVAL_FRAME_NUM=10,t.BATTLE_SPEED_CHANGE_TURN_NUM=40,t.RANDOM_MOVE_ITERATION_NUM=50,t.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8,t.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8,t.SOUND_MAX=100,t.ITEM_BORDER_IMG_DATA_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC",t.LOAD_STAGE_MAX_EXCEPT_AUDIO=7,t.WWA_STYLE_TAG_ID="wwa-additional-style",t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STRBACK_COLOR_R=0,t.DEFAULT_STRBACK_COLOR_G=0,t.DEFAULT_STRBACK_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20,t.WWAP_SERVER_OLD="http://wwawing.com/wwap",t.WWAP_SERVER="https://wwaphoenix.github.io",t.WWAP_SERVER_AUDIO_DIR="audio",t.WWAP_SERVER_TITLE_IMG="cover_p.gif",t.WWAP_SERVER_LOADER_NO_WORKER="wwaload.noworker.js",t.SCREEN_WIDTH=560,t.SCREEN_HEIGHT=440,t.LOADING_FONT="Times New Roman",t.MSG_STR_WIDTH=16,t.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20,t.ITEMBOX_TOP_Y=140,t.USER_VAR_NUM=256,t.USER_VAR_NUM_MAX_VALUE=9007199254740991,t.USET_VAR_NUM_MIN_VALUE=-9007199254740991,t.CONTROLL_WAIT_FRAME=6,t.INLINE_USER_VAR_VIEWER_DISPLAY_NUM=10,t}(),q=function(){function t(){}return t.QUICK_SAVE_MAX=4,t.QUICK_SAVE_THUMNAIL_WIDTH=99,t.QUICK_SAVE_THUMNAIL_HEIGHT=99,t.SAVE_INTERVAL_MOVE=200,t.INDEXEDDB_DB_NAME="WWA_WING_DB",t.INDEXEDDB_TABLE_NAME="SAVE_TABLE",t.DATE_LAST_SAVE_TEXT_COLOR="rgba(255,255,0,1)",t}(),z=function(){function t(){}return t.EMPTY_LOAD="",t.EMPTY_SAVE="",t.PASSWORD="Password",t.QUICK_SAVE="Quick Save",t.QUICK_LOAD="Quick Load",t.BATTLE_REPORT="Battle Report",t.GAME_END="Game End",t.GOTO_WWA="Goto WWA",t.RESTART_GAME="Restart Game",t}(),$=function(){};!function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE",t[t.GAME_INIT=7]="GAME_INIT",t[t.AUDIO=8]="AUDIO",t[t.FINISH=9]="FINISH"}(j||(j={}));var tt,et,at,st,it,rt=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],ot=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(tt||(tt={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(et||(et={})),function(t){t[t.COLOR_FRAME=0]="COLOR_FRAME",t[t.COLOR_FRAMEOUT=1]="COLOR_FRAMEOUT",t[t.COLOR_STR=2]="COLOR_STR",t[t.COLOR_STATUS_STR=4]="COLOR_STATUS_STR"}(at||(at={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(st||(st={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(it||(it={}));var nt,_t=function(t){return document.getElementById(t)},ct=function(t){return document.querySelector(t)},ht=function(t){return document.querySelector(t)},ut=function(t){return document.querySelectorAll(t)},lt=function(t,e){var a,s,i=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,r=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return a=t-_t("wwa-wrapper").offsetLeft+i,s=e-_t("wwa-wrapper").offsetTop+r,new f(a,s)},pt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},dt=function(t){var e="";if(t instanceof Array){for(var a=0;a<t.length;a++)e+=dt(t[a])+"/";return e}return t+""},Et=function(){function t(t,e,a){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:a}),this._isTransparent=a}return t.prototype.drawCanvas=function(t,e,a,s,i){this.ctx.drawImage(t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*a,Q.CHIP_SIZE,Q.CHIP_SIZE,s,i,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clear=function(){this.clearRect(0,0,this.cvs.width,this.cvs.height)},t.prototype.clearRectWithLowerYLimit=function(t){this.clearRect(0,0,this.cvs.width,t)},t.prototype.clearRect=function(t,e,a,s){this._isTransparent?this.ctx.clearRect(t,e,a,s):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,a,s))},t}(),ft=function(){function t(t,e,a,s){var i;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],i=0;i<2;i++)this._objectCanvases[i]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=s,this._load(),this._frameCoord=a.clone(),this.cpPartsLog=new f(0,0)}return t.prototype._load=function(){var t=this;this._frameCoord,this._isLoaded||(this.mapCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this.mapObjectCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this._image=new Image,this._image.addEventListener("load",(function(){t.createFrame(),t._loadCompleteCallBack()})),this._image.addEventListener("error",(function(){throw new Error("Image Load Failed!!\nfile name:"+t._fileName)})),this._image.src=this._fileName,this._isLoaded=!0)},t.prototype.createFrame=function(){this._frameCanvas.clear(),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y,0,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(var t=1;t<Q.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,Q.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,Q.CHIP_SIZE*t,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(t=1;t<Q.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,Q.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var a,s=t.length;for(e=0;e<s;e++){var i=t[e];(a=this._effectCanvases[e])?a.clear():a=this._effectCanvases[e]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);for(var r=0;r<Q.V_PARTS_NUM_IN_WINDOW;r++)for(var o=0;o<Q.H_PARTS_NUM_IN_WINDOW;o++)a.drawCanvas(this._image,i.x,i.y,o*Q.CHIP_SIZE,r*Q.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,a,s){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE,a,s,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,a,s,i,r){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*a,Q.CHIP_SIZE*s,i,r,Q.CHIP_SIZE*a,Q.CHIP_SIZE*s)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,a,s,i){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,s+Q.CHIP_SIZE-i);r>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE-r,a,s,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var a=this;return function(s,i,r,o,n){if(!a._isLoaded)throw new Error("No image was loaded.");var _=Math.max(0,e(o,n));_>=Q.CHIP_SIZE||t.ctx.drawImage(a._image,Q.CHIP_SIZE*s,Q.CHIP_SIZE*i+_,Q.CHIP_SIZE,Q.CHIP_SIZE-_,r,o+_,Q.CHIP_SIZE,Q.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,a,s,i){this.copyCanvas(this._backCanvas,(function(t,e){return t+Q.CHIP_SIZE-e}))(t,e,a,s,i)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,a,s,i){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,a,s,i)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,a,s,i,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+Q.CHIP_SIZE-e}))(e,a,s,i,r)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,a,s,i,r){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,a,s,i,r)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawObjectCanvas=function(t){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._objectCanvases[t].cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.clearBackCanvas=function(){this._backCanvas.clear()},t.prototype.clearBackCanvasWithLowerYLimit=function(t){this._backCanvas.clearRectWithLowerYLimit(t)},t.prototype.clearObjectCanvases=function(){var t;for(t=0;t<2;t++)this._objectCanvases[t].clear()},t.prototype.clearObjectCanvasesWithLowerYLimit=function(t){var e;for(e=0;e<2;e++)this._objectCanvases[e].clearRectWithLowerYLimit(t)},t.prototype.drawCanvasWithLowerYLimit=function(t,e,a,s,i){if(!this._isLoaded)throw new Error("No image was loaded.");var r=Math.max(0,i-s);r>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e+r,Q.CHIP_SIZE,Q.CHIP_SIZE-r,a,s+r,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,a,s){this._ctx.clearRect(t,e,a,s)},t.prototype.drawBase=function(t,e,a,s){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,a,s)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),yt=function(){function t(t){this._position=null,this.reset(t)}return t.prototype.setPlayer=function(t){this._player=t},t.prototype.isResetting=function(){return this._isResetting},t.prototype.getPosition=function(){return this._position},t.prototype.getPreviousPosition=function(){return this._positionPrev},t.prototype.resetPreviousPosition=function(){this._positionPrev=null},t.prototype.move=function(t){var e=X[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(Q.H_PARTS_NUM_IN_WINDOW-1),e*(Q.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep},t.prototype.isFinalStep=function(){if(!1===this._isResetting)throw new Error("リセット中ではありません。");return this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW-1},t.prototype.reset=function(t){this._positionPrev=this._position,this._position=t.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0},t}(),wt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),mt=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),gt=function(t){function e(e){return t.call(this,e)||this}return wt(e,t),e}(mt);!function(t){function e(e){return t.call(this,e)||this}wt(e,t)}(mt);!function(t){t[t.CONTROLLABLE=0]="CONTROLLABLE",t[t.MOVING=1]="MOVING",t[t.CAMERA_MOVING=2]="CAMERA_MOVING",t[t.MESSAGE_WAITING=3]="MESSAGE_WAITING",t[t.LOCALGATE_JUMPED=4]="LOCALGATE_JUMPED",t[t.BATTLE=5]="BATTLE",t[t.ESTIMATE_WINDOW_WAITING=6]="ESTIMATE_WINDOW_WAITING",t[t.PASSWORD_WINDOW_WAITING=7]="PASSWORD_WINDOW_WAITING",t[t.LOCALGATE_JUMPED_WITH_MESSAGE=8]="LOCALGATE_JUMPED_WITH_MESSAGE"}(nt||(nt={}));var At=function(t){function e(e,a,s,i,r,o,n){var _=t.call(this,a)||this;_.itemTransitioningClassName="item-transitioning",_.overwittenItemClassName="item-overwritten",_.overwittenItemSelector=".".concat(_.overwittenItemClassName),_.itemEffectStartTimers=new Array(Q.ITEMBOX_SIZE),_._status=i,_._equipStatus=new d(0,0),_._itemBox=new Array(Q.ITEMBOX_SIZE),_._itemBoxElement=new Array(Q.ITEMBOX_SIZE),_._itemUsingEvent=new Array(Q.ITEMBOX_SIZE);for(var c=0;c<_._itemBox.length;c++)_._itemBox[c]=0,_._itemBoxElement[c]=ht("#item"+c+">.item-disp");return _.updateItemBox(),_._energyMax=r,_._dir=u.DOWN,_._isMovingImage=!1,_._wwa=e,_._state=nt.CONTROLLABLE,_._camera=s,_._isPartsEventExecuted=!1,_._energyValueElement=ht("#disp-energy>.status-value-box"),_._strengthValueElement=ht("#disp-strength>.status-value-box"),_._defenceValueElement=ht("#disp-defence>.status-value-box"),_._goldValueElement=ht("#disp-gold>.status-value-box"),_._isReadyToUseItem=!1,_._isClickableItemGot=!1,_._moves=o,_._frameCount=0,_._moveMacroWaitingRemainMoves=0,_._moveObjectAutoExecTimer=0,_.updateStatusValueBox(),_._partsAppeared=!1,_._afterMoveMacroFlag=!1,_._isPreparedForLookingAround=!0,_._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME,_._speedIndex=n,_._messageDelayFrameCount=0,_}return wt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===nt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=nt.CONTROLLABLE)}else if(this._state===nt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=nt.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0),this._position=t}},e.prototype.controll=function(t){var e,a;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex]),a=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(a)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=nt.CAMERA_MOVING}catch(t){this._state=nt.CONTROLLABLE}return}if(!this.canMoveTo(a))return this._wwa.getMapTypeByPosition(a)===Q.MAP_WALL&&this._wwa.checkMap(a.getPartsCoord()),void this._wwa.checkObject(a.getPartsCoord());this._position=e,this._state=nt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}},e.prototype.setDir=function(t){this._isPreparedForLookingAround=!1,this._dir=t},e.prototype.canMoveTo=function(t){if(null===t)return!1;if(this._wwa.debug)return!0;this._wwa.getMapWidth(),t.getPartsCoord(),t.getOffsetCoord();return!(0===this._wwa.getMapIdByPosition(t)&&!this._wwa.isOldMap())&&(this._wwa.getMapTypeByPosition(t)!==Q.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_MODE)===Q.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_NUMBER)===Q.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,Q.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==nt.MOVING||this._state==nt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.DOWN||e.y===t.y&&this._dir===u.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.UP||e.y===t.y&&this._dir===u.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===nt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&!t&&this._wwa.canInput()},e.prototype.getCopyOfItemBox=function(){return this._itemBox.slice()},e.prototype.getDir=function(){return this._dir},e.prototype.isMovingImage=function(){return this._isMovingImage},e.prototype.toggleMovingImage=function(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0},e.prototype.getEnergyMax=function(){return this._energyMax},e.prototype.isJumped=function(){return this._state===nt.LOCALGATE_JUMPED||this._state===nt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=nt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===nt.MESSAGE_WAITING},e.prototype.isDelayFrame=function(){return this._messageDelayFrameCount>0},e.prototype.updateDelayFrame=function(){this._messageDelayFrameCount--},e.prototype.setDelayFrame=function(){this._messageDelayFrameCount=1},e.prototype.clearMessageWaiting=function(){this._state===nt.MESSAGE_WAITING&&(this._state=nt.CONTROLLABLE,this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=nt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===nt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===nt.ESTIMATE_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=nt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===nt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===nt.PASSWORD_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===I.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===I.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==nt.LOCALGATE_JUMPED&&this._state!==nt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===nt.LOCALGATE_JUMPED?nt.CONTROLLABLE:nt.MESSAGE_WAITING)},e.prototype.jumpTo=function(t){var e=this._camera.getPosition();this.getPosition();return!this._position.equals(t)&&(this._position=t,t.isInCameraRange(this._camera,!0)||this._camera.reset(t),this._state=this._state===nt.MESSAGE_WAITING?nt.LOCALGATE_JUMPED_WITH_MESSAGE:nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.DOWN).hasLocalGate()?this._dir=u.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(u.UP).hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.RIGHT).hasLocalGate()?this._dir=u.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(u.LEFT).hasLocalGate()?this._dir=u.RIGHT:this._dir=u.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME},e.prototype.addStatusAll=function(t){return this._status.add(t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status},e.prototype.setEnergyMax=function(t){return this._energyMax=t,0!==t&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.setEnergy=function(t){return this._status.energy=t,this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()},e.prototype.setStrength=function(t){return this._status.strength=t,this.updateStatusValueBox(),t},e.prototype.setDefence=function(t){return this._status.defence=t,this.updateStatusValueBox(),t},e.prototype.setGold=function(t){return this._status.gold=t,this.updateStatusValueBox(),t},e.prototype.getStatus=function(){return this._status.plus(this._equipStatus)},e.prototype.getStatusWithoutEquipments=function(){return this._status.plus(new d(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new d(0,0))},e.prototype.updateStatusValueBox=function(){var t,e=this._status.plus(this._equipStatus);this._energyValueElement.textContent=this._wwa.isVisibleStatus("energy")?String(e.energy):"",this._strengthValueElement.textContent=this._wwa.isVisibleStatus("strength")?String(e.strength):"",this._defenceValueElement.textContent=this._wwa.isVisibleStatus("defence")?String(e.defence):"",this._goldValueElement.textContent=this._wwa.isVisibleStatus("gold")?String(e.gold):"",null===(t=this._wwa._messageWindow)||void 0===t||t.update(),this._wwa.updateScore()},e.prototype.updateItemBox=function(t){for(var e=this,a=function(a){var i=s._itemBoxElement[a],r=ct("#item"+a);if(0===s._itemBox[a])return i.style.backgroundPosition="-40px 0px",s.disposeItemEffect(a,s._itemBoxElement[a],r),"continue";var o=s._wwa.getObjectCropXById(s._itemBox[a]),n=s._wwa.getObjectCropYById(s._itemBox[a]);if(!t||a!==t.insertPos-1)return i.style.backgroundPosition="-"+o+"px -"+n+"px",s.disposeItemEffect(a,s._itemBoxElement[a],r),"continue";var _=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,c=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,h=-_*Q.DEFAULT_FRAME_INTERVAL/Q.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,u=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=u?t.itemBoxBackgroundImageCoord.x:s._wwa.getObjectCropXById(t.overwrittenObjectId),p=u?t.itemBoxBackgroundImageCoord.y:s._wwa.getObjectCropYById(t.overwrittenObjectId);i.style.left=_+"px",i.style.top=c+"px","number"==typeof s.itemEffectStartTimers[a]&&clearInterval(s.itemEffectStartTimers[a]),s.itemEffectStartTimers[a]=window.setTimeout((function(){e.itemEffectStartTimers[a]=void 0,e.startItemEffect(a,i,r,{target:{x:o,y:n},overwritten:{x:l,y:p}},h)}),Q.DEFAULT_FRAME_INTERVAL)},s=this,i=0;i<this._itemBoxElement.length;i++)a(i)},e.prototype.startItemEffect=function(t,e,a,s,i){var r=this,o=a.querySelector(this.overwittenItemSelector);o&&a.removeChild(o);var n=document.createElement("div");n.classList.add(this.overwittenItemClassName),n.style.backgroundPosition="-"+s.overwritten.x+"px -"+s.overwritten.y+"px",n.style.backgroundImage=a.style.backgroundImage,a.appendChild(n),e.style.backgroundPosition="-"+s.target.x+"px -"+s.target.y+"px",e.style.transitionDuration=i+"ms",e.style.transitionProperty="left,top",e.style.transitionTimingFunction="linear",e.style.left="0",e.style.top="0",a.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){r.disposeItemEffect(t,e,a)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,a){"number"==typeof this.itemEffectStartTimers[t]&&(clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=void 0),e.style.transitionDuration="0s",e.style.transitionProperty="",e.style.left="0",e.style.top="0",a.classList.contains(this.itemTransitioningClassName)&&a.classList.remove(this.itemTransitioningClassName);var s=a.querySelector(this.overwittenItemSelector);s&&a.removeChild(s)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,a,s){var i,r,o;void 0===e&&(e=0),void 0===a&&(a=!1);var n=this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((i=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");_=this._itemBox[i-1],this._forceSetItemBox(i,t)}else if(!1===a)if(i=e,o=this._itemBox[i-1],this._wwa.getObjectAttributeById(o,Q.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER)){if((r=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(r,o),this._forceSetItemBox(i,t)}else _=this._itemBox[i-1],this._forceSetItemBox(i,t);else i=e,_=this._itemBox[i-1],this._forceSetItemBox(i,t);this._updateEquipmentStatus(),this.updateItemBox(s?{insertPos:i,itemScreenPixelCoord:s.screenPixelCoord,itemBoxBackgroundImageCoord:s.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new f(Q.MAP_WINDOW_WIDTH+(i-1)%3*Q.CHIP_SIZE,Q.ITEMBOX_TOP_Y+Math.floor((i-1)/3)*Q.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var a=this,s=ht("#item"+(t-1)+">.item-click-border"),i=this._wwa.getObjectAttributeById(e,Q.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&i!==S.NORMAL){var r=this._wwa.getSystemMessageById(Y.CLICKABLE_ITEM);if(!this._isClickableItemGot){if("BLANK"!==r){var o="";switch(this._wwa.userDevice.device){case M.PC:o="このアイテムは右のボックスを選択することで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case M.VR:o="このアイテムは右のボックスをクリックすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case M.SP:o="このアイテムは右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case M.GAME:switch(this._wwa.userDevice.os){case C.NINTENDO:o="このアイテムはXボタンを押すか、右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.PLAY_STATION:o="このアイテムは△ボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.XBOX:o="このアイテムはYボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。"}}this._wwa.setMessageQueue(""===r?o:r,!1,!0)}this._isClickableItemGot=!0}s.style.display="block",function(t){a._itemUsingEvent[t-1]=function(){(a.isControllable()||a._wwa._messageWindow.isItemMenuChoice())&&(a._wwa._itemMenu.close(),a._wwa._setNextMessage(),a._wwa.onselectitem(t))}}(t),s.addEventListener("click",this._itemUsingEvent[t-1])}},e.prototype._getBlankItemPos=function(){var t;for(t=1;t<this._itemBox.length+1;t++)if(0===this._itemBox[t-1])return t;return Q.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new d(0,0);for(t=0;t<Q.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_DEFENCE));var a=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(a),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<Q.ITEMBOX_SIZE;e++)if(this._itemBox[e]===t)return!0;return!1},e.prototype.canUseItem=function(t){var e=this._itemBox[t-1];return 0!==e&&this._wwa.getObjectAttributeById(e,Q.ATR_MODE)!==S.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,Q.ATR_MODE)!==S.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=_t("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),Q.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==Q.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],Q.ATR_MODE)!==S.NORMAL&&((e=ht("#item"+(t-1)+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[t-1]),e.style.display="none"),this._itemBox[t-1]=0,this._updateEquipmentStatus(),this.updateItemBox())},e.prototype.removeItemByPartsID=function(t){var e;if(!this.hasItem(t))throw new Error("アイテムを持っていない");for(var a=0;a<Q.ITEMBOX_SIZE;a++)if(this._itemBox[a]===t)return this._wwa.getObjectAttributeById(this._itemBox[a],Q.ATR_MODE)!==S.NORMAL&&((e=ht("#item"+a+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[a]),e.style.display="none"),this._itemBox[a]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=Q.ITEMBOX_SIZE;t++)this.removeItemByItemPosition(t);this._updateEquipmentStatus(),this.updateItemBox()},e.prototype.hasGold=function(t){return this._status.gold>=t},e.prototype.payGold=function(t){if(!this.hasGold(t))throw new Error("お金が足りない");this.setGold(this._status.gold-t)},e.prototype.earnGold=function(t){this.setGold(this._status.gold+t)},e.prototype.setPartsAppearedFlag=function(){this._partsAppeared=!0},e.prototype.clearPartsAppearedFlag=function(){this._partsAppeared=!1},e.prototype.isPartsAppearedTime=function(){return!0===this._partsAppeared},e.prototype.startBattleWith=function(t){this._isPlayerTurn=!0,this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=nt.BATTLE},e.prototype.isFighting=function(){return this._state===nt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>Q.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(H.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(H.ATTACK),this._wwa.vibration(!0));var t=this.getStatus(),e=this._enemy.status;if(this._isPlayerTurn){if(t.strength>e.defence||t.defence<e.strength)return e.energy>t.strength-e.defence?t.strength>e.defence&&this._enemy.damage(t.strength-e.defence):(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,Q.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new E(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(I.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(I.OBJECT,0,this._enemy.position),this._wwa.appearParts(this._enemy.position,A.OBJECT,this._enemy.partsID),this._state=nt.CONTROLLABLE,this._wwa.setMessageQueue(this._enemy.message,!1,!1,this._enemy.partsID,I.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess(),this._wwa.setMessageQueue("相手の防御能力が高すぎる!",!1,!0),this._battleTurnNum=0,this._enemy=null}else e.strength>t.defence&&(t.energy>e.strength-t.defence?this.damage(e.strength-t.defence):(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=nt.CONTROLLABLE,this._battleTurnNum=0,this._enemy=null,this._wwa.shouldApplyGameOver({isCalledByMacro:!1})&&this._wwa.gameover()));this._isPlayerTurn=!0}},e.prototype.readyToUseItem=function(t){var e;if(!this.canUseItem(t))throw new Error("アイテムがないか、アイテムが使えません。");e=this._itemBox[t-1],this._wwa.getObjectAttributeById(e,Q.ATR_STRING),this._wwa.appearParts(this._position.getPartsCoord(),A.OBJECT,e),this._readyToUseItemPos=t,this._isReadyToUseItem=!0},e.prototype.isReadyToUseItem=function(){return this._isReadyToUseItem},e.prototype.getDrawingCenterPosition=function(){var t=this._position.getPartsCoord(),e=this._position.getOffsetCoord(),a=this._camera.getPosition(),s=a.getPartsCoord(),i=a.getOffsetCoord(),r=(t.x-s.x)*Q.CHIP_SIZE+e.x-i.x+Q.CHIP_SIZE/2,o=(t.y-s.y)*Q.CHIP_SIZE+e.y-i.y+Q.CHIP_SIZE/2;return new f(r,o)},e.prototype.getPlayTimeText=function(){var t=Math.floor(this._frameCount/60);return t>=36e6?"9999:99:99":("000"+(t/60/60|0)).slice(-4)+":"+("0"+(t/60|0)%60).slice(-2)+":"+("0"+t%60).slice(-2)},e.prototype.mainFrameCount=function(){this._frameCount++},e.prototype.getFrameCount=function(){return this._frameCount},e.prototype.setFrameCount=function(t){return"number"!=typeof t&&(t=0),this._frameCount=t},e.prototype.getMoveCount=function(){return this._moves},e.prototype.setMoveCount=function(t){return this._moves=t},e.prototype.isMoveObjectAutoExecTime=function(){return 0===this._moveObjectAutoExecTimer},e.prototype.setMoveMacroWaiting=function(t){t<0||(this._moveMacroWaitingRemainMoves=t,this._moveObjectAutoExecTimer=0)},e.prototype.resetMoveObjectAutoExecTimer=function(){this._moveObjectAutoExecTimer=Q.CHIP_SIZE/X[this._speedIndex],this._moveMacroWaitingRemainMoves--},e.prototype.decrementMoveObjectAutoExecTimer=function(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&(this._afterMoveMacroFlag=!0)),0},e.prototype.isWaitingMoveMacro=function(){return 0!==this._moveMacroWaitingRemainMoves||0!==this._moveObjectAutoExecTimer},e.prototype.decrementLookingAroundTimer=function(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0},e.prototype.isLookingAround=function(){return this._isPreparedForLookingAround&&0===this._lookingAroundTimer},e.prototype.getSpeedIndex=function(){return this._speedIndex},e.prototype.speedUp=function(){return this._speedIndex=Math.min(Q.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(Q.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(gt),St=function(){function t(t,e,a,s,i,r,o){this._partsID=t,this._position=e,this._imgCoord=a,this._status=s,this._message=i,this._item=r,this._battleEndCallback=o}return Object.defineProperty(t.prototype,"partsID",{get:function(){return this._partsID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgCoord",{get:function(){return this._imgCoord},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t)},t.prototype.battleEndProcess=function(){this._battleEndCallback()},t}(),It=function(){function t(t,e,a,s,i){this._player=t,this._objectID=e,this._srcPos=a,this._destPos=s,this._dir=i,this._currentPos=this._srcPos.clone()}return t.prototype.update=function(){var t=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,X[t],X[t]),this._currentPos},Object.defineProperty(t.prototype,"isAchievedDestination",{get:function(){return this._currentPos.equals(this._destPos)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._currentPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforePosition",{get:function(){return this._srcPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destination",{get:function(){return this._destPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objID",{get:function(){return this._objectID},enumerable:!1,configurable:!0}),t}(),vt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,a,s){this._queue.push(new It(this._player,t,e,a,s))},t.prototype.update=function(){for(var t=[],e=[],a=0;a<this._queue.length;a++)this._queue[a].update(),this._queue[a].isAchievedDestination?(t.push(this._queue[a]),this._wwa.setPartsOnPosition(I.OBJECT,0,this._queue[a].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(I.OBJECT,this._queue[a].objID,this._queue[a].destination.getPartsCoord())):e.push(this._queue[a]);return this._queue=e,t},t.prototype.clear=function(){this._queue=[]},Object.defineProperty(t.prototype,"objectMovingData",{get:function(){return this.objectMovingData},enumerable:!1,configurable:!0}),t.prototype.getOffsetByBeforePartsCoord=function(t){var e=this._queue.filter((function(e){return e.beforePosition.getPartsCoord().equals(t)}));return 0===e.length?null:e[0].currentPosition.getOffsetCoord()},t}(),Tt=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Ot=function(){function t(t,e,a,s){this.isSystemMessage=e,this.isEndOfPartsEvent=a,this.macro=s,this.messageArray="string"==typeof t?[t]:t,void 0===this.macro&&(this.macro=[])}return t.prototype.isEmpty=function(){return 0===this.messageArray.length||1===this.messageArray.length&&""===this.messageArray[0]},t.prototype.generatePrintableMessage=function(){return this.messageArray.reduce((function(t,e){var a="string"==typeof e?e:e();return"".concat(t).concat(a)}),"")},t}(),Dt=function(){function t(t,e,a,s,i,r){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=a,this._triggerPartsPosition=s,this.macroType=i,this.macroArgs=r}return t.prototype.isJunction=function(){return[k.IF,k.ELSE_IF,k.ELSE,k.END_IF].includes(this.macroType)},t.prototype.execute=function(){try{switch(this.macroType){case k.IMGPLAYER:this._executeImgPlayerMacro();break;case k.IMGYESNO:this._executeImgYesNoMacro();break;case k.HPMAX:this._executeHPMaxMacro();break;case k.SAVE:this._executeSaveMacro();break;case k.ITEM:this._executeItemMacro();break;case k.DEFAULT:this._executeDefaultMacro();break;case k.OLDMAP:this._executeOldMapMacro();break;case k.PARTS:this._executePartsMacro();break;case k.MOVE:this._executeMoveMacro();break;case k.MAP:this._executeMapMacro();break;case k.DIRMAP:this._executeDirMapMacro();break;case k.IMGFRAME:this._executeImgFrameMacro();break;case k.IMGBOM:this._executeImgBomMacro();break;case k.DELPLAYER:this._executeDelPlayerMacro();break;case k.FACE:this._executeFaceMacro();break;case k.EFFECT:this._executeEffectMacro();break;case k.GAMEOVER:this._executeGameOverMacro();break;case k.IMGCLICK:this._executeImgClickMacro();break;case k.STATUS:this._executeStatusMacro();break;case k.EFFITEM:this._executeEffItemMacro();break;case k.COLOR:this._executeColorMacro();break;case k.WAIT:this._executeWaitMacro();break;case k.SOUND:this._executeSoundMacro();break;case k.GAMEPAD_BUTTON:this._executeGamePadButtonMacro();break;case k.OLDMOVE:this._executeOldMoveMacro();break;case k.JUMPGATE:this._executeJumpGateMacro();break;case k.RECPOSITION:this._executeRecPositionMacro();break;case k.JUMPRECPOSITION:this._executeJumpRecPositionMacro();break;case k.CONSOLE_LOG:this._executeConsoleLogMacro();break;case k.COPY_HP_TO:this._executeCopyHpToMacro();break;case k.SET_HP:this._executeSetHPMacro();break;case k.COPY_HPMAX_TO:this._executeCopyHpMaxToMacro();break;case k.SET_HPMAX:this._executeSetHpMaxMacro();break;case k.COPY_AT_TO:this._executeCopyAtToMacro();break;case k.SET_AT:this._executeSetAtMacro();break;case k.COPY_DF_TO:this._executeCopyDfToMacro();break;case k.SET_DF:this._executeSetDfMacro();break;case k.COPY_MONEY_TO:this._executeCopyMoneyToMacro();break;case k.SET_MOENEY:this._executeSetMoneyMacro();break;case k.COPY_STEP_COUNT_TO:this._executeSetStepCountMacro();break;case k.VAR_SET_VAL:this._executeVarSetValMacro();break;case k.VAR_SET:this._executeVarSetMacro();break;case k.VAR_ADD:this._executeVarAddMacro();break;case k.VAR_SUB:this._executeVarSubMacro();break;case k.VAR_MUL:this._executeVarMulMacro();break;case k.VAR_DIV:this._executeVarDivMacro();break;case k.VAR_MOD:this._executeVarModMacro();break;case k.VAR_SET_RAND:this._executeVarSetRandMacro();break;case k.GAME_SPEED:this._executeGameSpeedMacro();break;case k.SHOW_STR:break;case k.IF:this._executeIfMacro();break;case k.ELSE_IF:this._executeIfElseMacro();break;case k.ELSE:this._executeElseMacro();break;case k.END_IF:this._executeEndIfMacro();break;case k.SET_SPEED:this._executeSetSpeedMacro();break;case k.COPY_TIME_TO:this._executeCopyTimeToMacro();break;case k.HIDE_STATUS:this._executeHideStatusMacro();break;case k.VAR_MAP:this._executeVarMapMacro();break;case k.NO_GAMEOVER:this._executeNoGameOverMacro();break;case k.SET:this._executeSetMacro();break;default:console.log("不明なマクロIDが実行されました:"+this.macroType)}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),a=0;a<e.length;a++)e[a]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._parseInt=function(t,e){void 0===e&&(e=0);var a=parseInt(this.macroArgs[t]);return isNaN(a)?e:a},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.outputUserVar(t)},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPUserVar(t,!0)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,0);this._wwa.setUserValRandNum(t,e,a)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.speedChangeJudge(t)},t.prototype._executeIfMacro=function(){if(1===this.macroArgs.length)this._wwa.switchConditionalExecutionStatus(this.macroArgs[0]);else{for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)}},t.prototype._executeIfElseMacro=function(){this._wwa.switchConditionalExecutionStatus(this.macroArgs[0])},t.prototype._executeElseMacro=function(){this._wwa.switchConditionalExecutionStatus()},t.prototype._executeEndIfMacro=function(){this._wwa.resetConditionalMacroExecStaus()},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarPlayTime(t)},t.prototype._executeHideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=0!==this._parseInt(1);this._wwa.hideStatus(t,e)},t.prototype._executeVarMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],s=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,a,t,s)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerImgCoord(new f(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setYesNoImgCoord(new f(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._parseInt(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,I.OBJECT),s=this._parseInt(3);if(a!==I.OBJECT&&a!==I.MAP)throw new Error("パーツ種別が不明です");if(0!==s&&1!==s&&(s=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(a===I.OBJECT){if(t>=this._wwa.getObjectPartsNum()||e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum()||e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.replaceParts(t,e,a,!!s)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],a=this.macroArgs[2],s=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("パーツ番号が不正です");if(s===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,e,a,t,s)},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2,I.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(a))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(a===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,a)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2);if(e<0||a<0)throw new Error("座標は正でなければなりません。");if(t===V.ENERGY||t===V.STRENGTH||t===V.DEFENCE||t===V.GOLD)this._wwa.setStatusIconCoord(t,new f(e,a));else if(t===V.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new f(e,a));else if(t===V.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:a});else{if(t!==V.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new f(e,a))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new f(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._parseInt(0),a=this._parseInt(1),s=this._parseInt(2),i=this._parseInt(3),r=this._parseInt(4),o=this._parseInt(5);if(e<0||a<0||s<0||i<0||r<0||o<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new w(new f(e,a),new f(s,i),new f(r,o)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],a=1;a<this.macroArgs.length;a+=2){var s,i=this._parseInt(a);if(i<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(a+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((s=this._parseInt(a+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new f(i,s))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new f(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new f(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");this._wwa.setPlayerStatus(t,e,!0)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),a=this._parseInt(2),s=this._parseInt(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||a<0||a>255||s<0||s>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,a,s)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.playSound(t)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>Q.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMove(t)},t.prototype._executeNoGameOverMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setGameOverPolicy(t)},t.prototype._executeSetMacro=function(){this._wwa.execSetMacro(this.macroArgs[0])},t}();function Ct(t,e,a,s,i){var r=i.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(!(null!==r&&3===r.length||null!==(r=i.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)/))&&2===r.length))throw new Error("マクロではありません");var o=r[1],n=K["$"+o.toLowerCase()],_=r[2]?r[2]:"";return void 0===n?new Dt(t,e,a,s,k.UNDEFINED,_.split(",")):new Dt(t,e,a,s,n,_.split(",").map((function(t){return t.trim()})))}var Mt,Nt=function(){function t(t,e,a,s,i,r,o){this._wwa=t,this._coord=e,this._width=a,this._height=s,this._isVisible=i,this._parentElement=r,this._element=document.createElement("div"),this._element.style.position="absolute",this._element.style.borderWidth="2px",this._element.style.borderStyle="solid",t.isClassicMode()?this._element.style.borderRadius="15px":this._element.style.borderRadius="10px",this._element.classList.add("wwa-message-window"),this._element.style.zIndex=o+"",this._element.style.left=this._coord.x+"px",this._element.style.top=this._coord.y+"px",this._element.style.width=this._width+"px",this._element.style.height=this._height+"px",this._parentElement.appendChild(this._element)}return t.prototype.update=function(t){},t.prototype.show=function(){this._isVisible=!0,this._element.style.display="block",this.update(),this._wwa.wwaCustomEvent("wwa_window_show",{name:this.windowName,element:this._element,text:this._element.textContent})},t.prototype.hide=function(){this._isVisible=!1,this._element.style.display="none",this.update(),this._wwa.wwaCustomEvent("wwa_window_hide",{name:this.windowName})},t.prototype.isVisible=function(){return this._isVisible},Object.defineProperty(t.prototype,"windowName",{get:function(){return"TextWindow"},enumerable:!1,configurable:!0}),t}(),Pt=function(t){function e(e,a,s,i,r,o,n){var _=t.call(this,e,new f(a.x,a.y),s,i,r,o,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=Q.CHIP_SIZE+"px",_._monsterBox.style.height=Q.CHIP_SIZE+"px",_._monsterBox.style.position="absolute",_._monsterBox.style.left="10px",_._monsterBox.style.top="10px",_._monsterBox.style.backgroundImage="url("+_._cgFileName.replace("(","\\(").replace(")","\\)")+")",_._monsterBox.style.backgroundPosition="0 0",_._element.appendChild(_._monsterBox),_._energyBox=document.createElement("div"),_._energyBox.style.position="absolute",_._energyBox.style.left="80px",_._energyBox.style.top="10px",_._energyBox.textContent="生命力 0",_._element.appendChild(_._energyBox),_._strengthBox=document.createElement("div"),_._strengthBox.style.position="absolute",_._strengthBox.style.left="80px",_._strengthBox.style.top="30px",_._strengthBox.textContent="攻撃力 0",_._element.appendChild(_._strengthBox),_._defenceBox=document.createElement("div"),_._defenceBox.style.position="absolute",_._defenceBox.style.left="180px",_._defenceBox.style.top="30px",_._defenceBox.textContent="防御力 0",_._element.appendChild(_._defenceBox),_._isVisible?_._element.style.display="block":_._element.style.display="none",_}return Tt(e,t),e.prototype.update=function(t){void 0!==t&&(this._monsterBox.style.backgroundPosition="-"+t.imgCoord.x+"px -"+t.imgCoord.y+"px",this._energyBox.textContent="生命力 "+t.status.energy,this._strengthBox.textContent="攻撃力 "+t.status.strength,this._defenceBox.textContent="防御力 "+t.status.defence)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"MonsterWindow"},enumerable:!1,configurable:!0}),e}(Nt),bt=function(t){function e(e,a,s,i){var r=this;return e.isClassicMode()?((r=t.call(this,e,new f(2*Q.CHIP_SIZE,30),7*Q.CHIP_SIZE,40,s,i,202)||this)._element.style.borderWidth="0",r._element.style.borderRadius="4px",r._element.style.fontSize="20px",r._element.style.lineHeight="40px"):r=t.call(this,e,new f(a.x,a.y),340,30,s,i,202)||this,r._element.style.textAlign="center",r._isVisible?r._element.style.display="block":r._element.style.display="none",r.update(0),r}return Tt(e,t),e.prototype.update=function(t){void 0!==t&&(this._element.textContent="Score: "+t)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"ScoreWindow"},enumerable:!1,configurable:!0}),e.WINDOW_NAME="ScoreWindow",e}(Nt);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Mt||(Mt={}));var Rt=function(){function t(t,e,a,s,i,r,o,n,_,c){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var h=this,u=r.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=r,this._x=e,this._y=a,this._width=s,this._height=i,this._message=new Ot([],!1),this._isVisible=o,this._isYesno=n,this._isItemMenu=_,this._element=document.createElement("div"),this._element.id="wwa-text-message-window",this._element.classList.add("wwa-message-window"),this._msgWrapperElement=document.createElement("div"),this._msgWrapperElement.style.textAlign="left",this._msgWrapperElement.style.wordWrap="break-word",this._msgWrapperElement.style.margin=t.isClassicMode()?"8px 0 8px 16px":"0",this._msgWrapperElement.style.padding=t.isClassicMode()?"0":"7px",this._element.appendChild(this._msgWrapperElement),this._saveElement=document.createElement("div"),this._saveElement.style.padding="0",this._saveElement.style.margin="0",this._element.appendChild(this._saveElement),this._dummyElement=document.createElement("div"),this._dummyElement.style.display="none",this._dummyElement.style.padding="0",this._dummyElement.style.margin="0",this._dummyElement.style.height="55px",this._element.appendChild(this._dummyElement),this._ynWrapperElement=document.createElement("div"),this._ynWrapperElement.classList.add("wwa-yesno-wrapper"),this._element.appendChild(this._ynWrapperElement),this._parentElement=c,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+u+")",this._divYesElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.YES),h.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+u+")",this._divNoElement.onclick=function(){h._isInputDisable||(t.setYesNoInput(g.NO),h.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),h._isInputDisable=!1,t.userDevice.device){case M.SP:case M.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,a,s){this._x=t,this._y=e,this._width=a,this._height=s,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,a,s,i){var r,o=s.getPartsCoord().substract(i.getPartsCoord()).y;r=t?Mt.BOTTOM:e?Mt.SCORE:a?Mt.CENTER:o>=Math.ceil(Q.V_PARTS_NUM_IN_WINDOW/2)?Mt.TOP:Mt.BOTTOM,this.setPositionEasy(r)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Mt.CENTER?(this._y=Q.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Mt.TOP?(this._y=Math.max(20,Q.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Mt.BOTTOM?(this._y=Math.min(Q.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*Q.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Mt.SCORE?(this._y=80,void this.update()):void 0},t.prototype.setParsedMessage=function(t){this._message=t,this.update()},t.prototype.clear=function(){this._message=new Ot([],!1),this.update()},t.prototype.setYesNoChoice=function(t){return this._isInputDisable=!1,this._isYesno=t,this.update(),this._isYesno},t.prototype.isYesNoChoice=function(){return this._isYesno},t.prototype.isSaveChoice=function(){return this._isSave},t.prototype.setItemMenuChoice=function(t){return this._isInputDisable=!1,this._isItemMenu=t,this.update(),this._isItemMenu},t.prototype.isItemMenuChoice=function(){return this._isItemMenu},t.prototype.setInputDisable=function(){this._isInputDisable=!0},t.prototype.isInputDisable=function(){return this._isInputDisable},t.prototype.show=function(){this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isWideChar=function(t){return null!==t.match(/^[^\x01-\x7E\xA1-\xDF]+$/)},t.prototype.createClassicTextElement=function(t){for(var e=document.createElement("span"),a=0,s="",i=0;i<t.length||0!=a;i++)if(this.isWideChar(t.charAt(i))?a+=2:a+=1,s+=t.charAt(i),a+1>2*Q.MSG_STR_WIDTH){"。"!==t.charAt(i+1)&&"、"!==t.charAt(i+1)||(s+=t.charAt(i+1),i++);var r=document.createElement("span");r.style.display="inline-block",r.style.width="100%",r.textContent=s,e.appendChild(r),a=0,s=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===g.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YESP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):this._wwa.getYesNoState()===g.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NOP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var a=this._message.generatePrintableMessage().split("\n");a.forEach((function(e,s){var i;t._wwa.isClassicMode()?i=t.createClassicTextElement(e):(i=document.createElement("span")).textContent=a[s],t._msgWrapperElement.appendChild(i),t._msgWrapperElement.appendChild(document.createElement("br"))})),this._isVisible?(this._element.style.left=this._x+"px",this._element.style.top=this._y+"px"):(this._element.style.left="-999999px",this._element.style.top="-999999px"),this._isSave?this._saveElement.style.display="block":this._saveElement.style.display="none",this._element.style.width=this._width+"px",this._element.style.minHeight=this._height+"px"},t.prototype.setWWASave=function(t){this._wwaSave=t},t.prototype.createSaveDom=function(){var t,e,a,s,i,r,o,n,_,c,h,u=this;e=document.createElement("div"),c=(n=document.getElementById("disp-energy")).style.backgroundPosition,h=n.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(a=document.createElement("div")).classList.add("savedata"),a.setAttribute("save_id",p),a.addEventListener("click",(function(t){u.setSaveID(0|t.currentTarget.getAttribute("save_id")),u._save_close=!0,t.preventDefault()})),(s=document.createElement("div")).classList.add("ss"),a.appendChild(s),(i=document.createElement("div")).classList.add("wide-cell-row"),i.style.backgroundPosition=c,i.style.backgroundImage=h,a.appendChild(i),e.appendChild(a),t.flag&&(s.appendChild(t.cvs),(r=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(r.style.color=q.DATE_LAST_SAVE_TEXT_COLOR),s.appendChild(r),(o=document.createElement("div")).classList.add("status-icon"),o.style.backgroundImage=h,o.style.backgroundPosition="-120px -80px",i.appendChild(o),(_=document.createElement("div")).classList.add("status-value-box"),_.textContent=t.getStatusEnergy(),i.appendChild(_));this._saveElement.textContent="",this._saveElement.appendChild(e),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1},t.prototype.deleteSaveDom=function(){this._saveElement.textContent="",this._isSave=!1},t.prototype.setSaveID=function(t){this._save_select_id=t;for(var e,a=document.querySelectorAll(".savedata"),s=a.length,i=0;i<s;i++)e=a[i],t===i?e.classList.add("select"):e.classList.remove("select")},t.prototype.save=function(t,e){return this._wwaSave.save(t,e,this._save_select_id)},t.prototype.load=function(){return this._wwaSave.load(this._save_select_id)},t.prototype.saveUpdate=function(){this._save_counter>0&&this._save_counter--},t.prototype.isSaveClose=function(){return this._save_close},t.prototype.cursor_wait=function(){this._save_counter=Q.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case u.DOWN:this._save_select_id-=2,this.cursor_wait();break;case u.UP:this._save_select_id+=2,this.cursor_wait();break;case u.LEFT:this._save_select_id--,this.cursor_wait();break;case u.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+q.QUICK_SAVE_MAX)%q.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Lt=function(){function t(t,e,a){this.id=t,this.imgFileName=e,this.parent=a,this.elem=document.createElement("div"),this.elem.classList.add("est"),this.elem.setAttribute("id","wwa-est-"+t),this.imgElem=document.createElement("div"),this.imgElem.classList.add("est-img-wrapper"),this.imgElem.style.backgroundImage="url("+this.imgFileName.replace("(","\\(").replace(")","\\)")+")",this.statusElem=document.createElement("div"),this.statusElem.classList.add("est-status-wrapper"),this.energyElem=document.createElement("div"),this.energyElem.classList.add("est-energy"),this.energyDispElem=document.createElement("span"),this.energyDispElem.classList.add("est-energy-disp"),this.energyElem.appendChild(this.energyDispElem),this.statusElem.appendChild(this.energyElem),this.strengthElem=document.createElement("div"),this.strengthElem.classList.add("est-strength"),this.strengthDispElem=document.createElement("span"),this.strengthDispElem.classList.add("est-strength-disp"),this.strengthElem.appendChild(this.strengthDispElem),this.statusElem.appendChild(this.strengthElem),this.defenceElem=document.createElement("div"),this.defenceElem.classList.add("est-defence"),this.defenceDispElem=document.createElement("span"),this.defenceDispElem.classList.add("est-defence-disp"),this.defenceElem.appendChild(this.defenceDispElem),this.statusElem.appendChild(this.defenceElem),this.damageElem=document.createElement("div"),this.damageElem.classList.add("est-damage"),this.damageDispElem=document.createElement("span"),this.damageDispElem.classList.add("est-damage-disp"),this.damageElem.appendChild(this.damageDispElem),this.statusElem.appendChild(this.damageElem),this.elem.appendChild(this.imgElem),this.elem.appendChild(this.statusElem)}return t.prototype.hide=function(){this.elem.style.display="none"},t.prototype.show=function(){this.elem.style.display="block"},t.prototype.setResult=function(t,e,a){this.imgElem.style.backgroundPosition="-"+t.x+"px -"+t.y+"px",this.energyDispElem.textContent="生命力 "+e.energy,this.strengthDispElem.textContent="攻撃力 "+e.strength,this.defenceDispElem.textContent="防御力 "+e.defence,a.isNoEffect?this.damageDispElem.textContent="攻撃無効":a.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+a.damage},t}(),xt=function(){function t(t,e,a){var s,i=this;this._wwa=t,this._imgFileName=e,this._parent=a,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var r=0;r<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;r++)s=new Lt(r,this._imgFileName,this._element),this._edes.push(s),this._element.appendChild(s.elem);this._element.addEventListener("click",(function(){i._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var a=0;a<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;a++)if(a>=e.length)this._edes[a].hide();else{var s=this._wwa.getObjectAttributeById(e[a],Q.ATR_X),i=this._wwa.getObjectAttributeById(e[a],Q.ATR_Y),r=new f(s,i),o=this._wwa.getObjectAttributeById(e[a],Q.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[a],Q.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[a],Q.ATR_DEFENCE),c=new E(o,n,_,0),h=Ut(t,c);this._edes[a].setResult(r,c,h),this._edes[a].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Bt=function(t,e,a){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=a};function Ut(t,e){var a=e.energy,s=t.strength-e.defence,i=Math.max(0,e.strength-t.defence),r=0,o=0;if(!(s>0))return new Bt(!0,!1,0);for(;;){if(r++,(a-=s)<=0)return new Bt(!1,!1,o);if(o+=i,r>1e4)return new Bt(!1,!0,0)}}var Wt,Yt=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},kt=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}};!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Wt||(Wt={}));var Ft=function(){function t(t,e,a){var s=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=a,this.COPIED_MESSAGE_DISPLAY_MS=1e3,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-password-window"),this._element.style.display="none",this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("wwa-password-description"),this._passwordBoxElement=document.createElement("textarea"),this._passwordBoxElement.setAttribute("cols","50"),this._passwordBoxElement.setAttribute("rows","16"),this._passwordBoxElement.addEventListener("focus",(function(t){s._passwordBoxElement.select()})),this._buttonWrapperElement=document.createElement("div"),this._buttonWrapperElement.classList.add("wwa-password-submit"),this._okButtonElement=document.createElement("button"),this._okButtonElement.textContent="OK",this._okButtonElement.addEventListener("click",(function(){s._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){s._wwa.hidePasswordWindow(!0)})),this._copyButtonElement=document.createElement("button"),this._copyButtonElement.textContent="コピー",this._copyButtonElement.addEventListener("click",(function(){return Yt(s,void 0,void 0,(function(){var t=this;return kt(this,(function(e){switch(e.label){case 0:return[4,navigator.clipboard.writeText(this.password)];case 1:return e.sent(),this._copyButtonElement.textContent="コピーしました",this._copyButtonElement.disabled=!0,setTimeout((function(){t._copyButtonElement&&(t._copyButtonElement.textContent="コピー",t._copyButtonElement.disabled=!1)}),this.COPIED_MESSAGE_DISPLAY_MS),[2]}}))}))})),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._buttonWrapperElement.appendChild(this._copyButtonElement),this._mode=Wt.LOAD,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}return Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=t,t===Wt.LOAD&&(this.password="")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"password",{get:function(){return this._passwordBoxElement.value},set:function(t){this._passwordBoxElement.value=t},enumerable:!1,configurable:!0}),t.prototype.show=function(t){void 0!==t&&(this.mode=t),this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.update=function(){var t,e="";if(this._mode===Wt.LOAD){t=this._isDisallowLoadOldSave,e="下のボックスに前回のプレイで取得した\n復帰用パスワードを貼り付けてください。\nJava 版 WWA で取得したパスワードはご利用になれません。\n作成者が ".concat(t?"マップの内容":"ワールド名 か マップの暗証番号"," を変更した場合は\nそれ以前に取得したパスワードは使えなくなります。");try{this._passwordBoxElement.removeAttribute("readonly")}catch(t){}this._cancelButtonElement.style.display="inline",this._copyButtonElement.style.display="none"}else e="下記テキストがデータ復帰用のパスワードになっています。\nコピーしてメモ帳などのテキストエディタに貼り付けて\n保存してください。",this._passwordBoxElement.setAttribute("readonly","readonly"),this._cancelButtonElement.style.display="none",this._copyButtonElement.style.display="inline";var a=e.split("\n");this._descriptionElement.textContent="";for(var s=0;s<a.length;s++){var i=document.createElement("span");i.textContent=a[s],this._descriptionElement.appendChild(i),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function Gt(t,e){var a,s,i=document.createElement("style");i.type="text/css",i.setAttribute("id",Q.WWA_STYLE_TAG_ID),(a="head",document.getElementsByTagName(a))[0].appendChild(i),t.innerHTML=(s=null!==e?'\n <div id="wwa-cover">\n <div id="version"></div>\n <div id="progress-message-container">開始しています...</div>\n <div id="progress-bar-bg"></div>\n <div id="progress-bar" class="progress-bar"></div>\n <div id="progress-bar-audio" class="progress-bar"></div>\n <div id="progress-disp">---</div>\n </div>\n ':'\n <div id="wwa-cover">\n <canvas id="progress-panel" width="'.concat(Q.SCREEN_WIDTH,'" height="').concat(Q.SCREEN_HEIGHT,'"></canvas>\n </div>'),'\n <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">\n このブラウザは、Canvas要素をサポートしていません。\n </canvas>\n <canvas id="wwa-map-sub" class="wwa-canvas" width="440" height="440"></canvas>\n <div id="wwa-sidebar">\n <div class="wide-cell-row" id="disp-energy"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-strength"><div class="status-icon"></div><div class="status-value-box"> 0 </div></div>\n <div class="wide-cell-row" id="disp-defence"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-gold"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="item-cell" id="item0"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item1"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item2"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item3"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item4"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item5"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item6"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item7"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item8"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item9"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item10"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item11"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="wide-cell-row" id="cell-load">Password</div><div class="wide-button" id="button-load"></div>\n <div class="wide-cell-row" id="cell-save">Quick Save</div><div class="wide-button" id="button-save"></div>\n <div class="wide-cell-row" id="cell-restart">Restart Game</div><div class="wide-button" id="button-restart"></div>\n <div class="wide-cell-row" id="cell-gotowwa">Goto WWA</div><div class="wide-button" id="button-gotowwa"></div>\n </div>\n <div id="wwa-controller"></div>\n <div id="wwa-fader"></div>\n'.concat(s)),null!==e&&(_t("wwa-cover").style.backgroundImage="url(".concat(e,")"),_t("wwa-cover").style.backgroundRepeat="no-repeat",_t("wwa-cover").style.backgroundPosition="0 0")}var Vt=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=Q.CONTROLL_WAIT_FRAME},t.prototype.allClear=function(){this.col=0,this.row=0,this.counter=0},t.prototype.controll=function(e){if(!(this.counter>0))switch(e){case u.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case u.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case u.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case u.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=ht(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var a=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(a)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,a,s=null;for(e=0;e<t.COL_MAX;e++)for(a=0;a<t.ROW_MAX;a++)(s=_t(t.DOM_ID_TABLE[a][e])).classList.contains("onpress")&&s.classList.remove("onpress")},t.prototype.openView=function(){this.close();_t(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),Ht=a(23);function Kt(t){return"^ /".concat(231*t+8310,"P+>A[]")}function jt(t){return(0,Ht.MD5)(t).toString()}var Xt="map",Jt="mapObject",Zt="systemMessage",Qt="userVar",qt={mapAttribute:!0,objectAttribute:!0,message:!0},zt=function(){},$t=function(){function t(){}return t.compress=function(t){var e,a,s={};for(e in t)if(!qt[e]){switch(typeof(a=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===a&&"worldName"!==e)continue;break;case"object":if(null===a){if(this._restartData[e]===a)continue}else if(void 0===(a=this.compressObject(e,a,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}s[e]=a}return s},t.compressObject=function(t,e,a){var s,i,r,o;switch(t){case Xt:case Jt:var n,_,c,h,u,l,p,d,E,f,y,w,m,g;for(u in s={},E={},d={},e)for(h in i=e[u],r=a[u],o={},_=-1,i)(p=i[h])!==r[h]&&(o[h]=p,void 0===E[p]&&(E[p]={}),void 0===(y=E[p])[u]&&(y[u]=[]),(m=y[u]).push(Number(h)));for(w in E)for(u in y=E[w],void 0===d[w]&&(d[w]={}),f=d[w],void 0===s[w]&&(s[w]=[]),_=-1,y)1===(m=y[u]).length?(void 0===f[l=m[0]]&&(f[l]=[]),(g=f[l]).push(Number(u))):(c=(n=Number(u))-_-1,_=n,s[w].push(this.getCompressArray(m),c));for(w in d)for(h in p=Number(w),_=-1,f=d[w])g=f[h],c=(n=Number(h))-_-1,_=n,1===g.length?s[w].push(c,g[0]):s[w].push(c,this.getCompressArray(g));var A=[];for(w in _=-1,s)c=(n=Number(w))-_-1,_=n,A.push(c,s[w]);return this._usingByteFlag&&JSON.stringify(A).length>=this._mapByteLength?this.compressMapAllObject(e,a,this._firstRandomMapObjectUtf8Table[t]):A;case Zt:var S;for(t in s={},e)S=e[t],a[t]!==S&&(s[t]=S);break;case Qt:return this.compressUserVars(e);default:return e}if(0!==Object.keys(s).length)return s},t.compressUserVars=function(t){return t.map((function(t,e){return[e,t]})).filter((function(t){t[0];return 0!==t[1]}))},t.compressMapAllObject=function(t,e,a){var s,i,r,o,n,_,c,h,u,l,p,d,E,f,y,w,m=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),A=-1;for(r=0,o=0,_=0,c=0,y=0,p=[],f={},u=[],l=[],i=0;i<m;i++)for(s=0;s<m;s++)(h=t[i][s])!==e[i][s]&&(-1===A&&(A=o),g[o]=g[o]|1<<r,_=o,void 0===f[h]&&(f[h]=new te(h,y++)),f[h].count++),8===++r&&(r=0,o++);for(n in f)p[f[n].index]=f[n];for(d in p.sort(this.idSort),E={},p)E[h=p[d].id]=Number(d),u[d]=h;for(i=0;i<m;i++)for(s=0;s<m;s++)(h=t[i][s])!==e[i][s]&&(l[c++]=E[h]);if(a){for(w=g.length,A=-1,_=0,o=0;o<w;o++)g[o]=g[o]&~a[o],0!==g[o]&&(-1===A&&(A=o),_=o);-1===A&&(A=0,_=0)}return[A,g.subarray(A,_+1),u,this.indexListCompress(l,u.length)]},t.indexListCompress=function(t,e){var a,s,i,r,o,n,_=[];for(r=t.length,s=0,a=0;a<r;a++){for(o=t[a],n=0,i=a+1;i<r&&o===t[i];i++)n++,a=i;switch(n){case 0:_[s++]=o;break;case 1:_[s++]=o,_[s++]=o;break;default:_[s++]=o,_[s++]=e+n}}return _},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,a,s,i,r,o,n,_,c=[];for(e=-1,r=t.length,o=0,i=0;i<r;i++){for(a=(s=t[i])-e,n=0,_=i;_<r-1&&t[_]+1===t[_+1];)_++,n++;n<this.MIN_LOOP_COUNT?c[o++]=a:(i=_,s+=n,c[o++]=0,c[o++]=a,c[o++]=n-this.MIN_LOOP_COUNT),e=s}return c},t.getDecompressArray=function(t){var e,a,s,i,r,o,n,_=[];for(e=-1,r=t.length,i=0,n=0;i<r;i++)if(0===(a=t[i])){for(o=(s=e+(a=t[++i]))+t[++i]+this.MIN_LOOP_COUNT;s<=o;s++)_[n++]=s;e=o}else s=e+a,_[n++]=s,e=s;return _},t.decompress=function(t){var e,a,s;for(a in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(s=t[a])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==s&&(s=this.decompressObject(a,s,e[a]));break;case"function":continue}e[a]=s}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,a){var s;switch(t){case Xt:case Jt:var i,r,o,n,_,c,h,u;s={},r=-1;var l,p,d=e;if(4===(u=d.length)&&"number"==typeof d[0]&&(d[1]instanceof Uint8Array||d[1]instanceof Array)&&d[2]instanceof Array&&d[3]instanceof Array)return this.decompressAllMapObject(d,a,this._firstRandomMapObjectUtf8Table[t]),a;for(h=0;h<u;h+=2)r=i=r+Number(d[h])+1,_=i,s[i]=d[h+1];for(c in s){for(_=Number(c),u=(d=s[c]).length,l=[],p=[],h=0;h<u;h+=2){var E=d[h],f=d[h+1];E instanceof Array&&(E=this.getDecompressArray(E)),f instanceof Array&&(f=this.getDecompressArray(f)),"object"==typeof E?l.push({x:E,y:f}):p.push({x:E,y:f})}var y;for(y in r=-1,l)if(r=i=r+Number(l[y].y)+1,E=l[y].x,n=String(i),E instanceof Array)for(u=(d=E).length,h=0;h<u;h++)o=String(d[h]),a[n][o]=_;else o=String(E),a[n][o]=_;for(y in r=-1,p)if(r=i=r+Number(p[y].x)+1,f=p[y].y,o=String(i),f instanceof Array)for(u=(d=f).length,h=0;h<u;h++)a[n=String(d[h])][o]=_;else a[n=String(f)][o]=_}return a;case Qt:return this.decompressUserVars(e);default:if(a);else{if(!e)return;a=a instanceof Array?[]:{}}for(t in e)a[t]=e[t];return a}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var a=e[0],s=e[1];return t[a]=s,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(Q.USER_VAR_NUM),e=0;e<Q.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,a){var s,i,r,o,n,_,c,h,u,l,p,d=this._restartData.mapWidth,E=new Uint8Array(this._mapByteLength);p=t[0],o=t[2],i=t[3];var f=t[1];if(E.set(f,p),a)for(y=E.length,u=0;u<y;u++)E[u]=E[u]|a[u];r=[];var y,w,m,g,A,S,I=o.length;for(y=i.length,w=0,m=0;w<y;w++){if((n=i[w])>=I)for(g=n-I,A=0;A<g;A++)r[m++]=S;else r[m++]=n;S=n}for(h=0,u=0,l=0,_=0,y=E.length,u=0;u<y;u++)for(h=0;h<8;h++){if(0!=(E[u]&1<<h)){if(void 0===(n=r[_++]))return!1;s=o[n],c=l%d,e[l/d|0][c]=s}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[Jt]=this.getChangedUint8Array(e[Jt],t[Jt])},t.getChangedUint8Array=function(t,e){var a,s,i,r,o=this._restartData.mapWidth,n=new Uint8Array(this._mapByteLength),_=-1;for(i=0,r=0,s=0;s<o;s++)for(a=0;a<o;a++)t[s][a]!==e[s][a]&&(-1===_&&(_=r),n[r]=n[r]|1<<i),8===++i&&(i=0,r++);return n},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var a;if(e)try{if(a=this.decompress(e)[0])return a}catch(t){}return this._restartData},t.usingByte=function(t){this._usingByteFlag=t},t._usingByteFlag=!1,t.MIN_LOOP_COUNT=3,t._restartData=void 0,t._mapByteLength=0,t._firstRandomMapObjectUtf8Table=new zt,t}(),te=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},ee=function(){function t(t,e){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=t,this._parent=e,this.cvs=document.createElement("canvas"),this.cvs.width=q.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=q.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){_t("cell-load").textContent=z.QUICK_LOAD},t.prototype.save=function(t,e){return this._statusEnergy=e.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(t,0,0,t.width,t.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=e,this.flag=!0,this.date=new Date,this.showQickLoad(),!0},t.prototype.getStatusEnergy=function(){return this.flag?this._statusEnergy:-1},t.prototype.load=function(){return this.quickSaveData},t.prototype.saveDataSet=function(t,e,a){var s=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=a,this.flag=!0;var i=document.createElement("img");i.src=t,i.addEventListener("load",(function(){s.flag=!0,s.ctx.drawImage(i,0,0,i.width,i.height,0,0,s.cvs.width,s.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,a,s,i,r;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,a=this.date.getDate(),s=this.date.getHours(),i=this.date.getMinutes(),r=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(a=("0"+a).slice(-2))+" "+(s=("0"+s).slice(-2))+":"+(i=("0"+i).slice(-2))+":"+(r=("0"+r).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),ae=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),se=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ae(e,t),e.prototype.save=function(e,a){var s=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,a,this.date),s},e}(ee),ie=se,re=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),oe=function(t){function e(){var a=t.call(this)||this;return Object.setPrototypeOf(a,Object.create(e.prototype)),a}return re(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<q.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,a=0;a<q.QUICK_SAVE_MAX;a++)(e=this[a]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),ne=function(){return ne=Object.assign||function(t){for(var e,a=1,s=arguments.length;a<s;a++)for(var i in e=arguments[a])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},ne.apply(this,arguments)},_e=function(t){return"boolean"!=typeof(e=t).isGameOverDisabled?e:!0===e.isGameOverDisabled?ne(ne({},e),{isGameOverDisabled:void 0,gameOverPolicy:"never"}):!1===e.isGameOverDisabled?ne(ne({},e),{isGameOverDisabled:void 0,gameOverPolicy:"default"}):e;var e},ce=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),he=function(t){function e(a,s,i){void 0===i&&(i=e.prototype);var r=t.call(this)||this;r.IDBTransaction={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchangetransaction"},r.keyPath=["id","url"],Object.setPrototypeOf(r,Object.create(i));for(var o=0;o<q.QUICK_SAVE_MAX;o++)r[o]=new ie(o,r);return r.onCheckLoadingSaveData=a,r.onCompleteLoadingSaveData=s,r.createDataBase(),r.selectSaveData(),r}return ce(e,t),e.prototype.indexDBOpen=function(){return indexedDB.open(q.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var a=this.indexDBOpen();a.onupgradeneeded=function(e){var s=a.result,i={keyPath:t.keyPath};s.objectStoreNames.contains(q.INDEXEDDB_TABLE_NAME)||s.createObjectStore(q.INDEXEDDB_TABLE_NAME,i).createIndex("url","url",{unique:!1})},a.onsuccess=e.doNotAnything,a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var a=e.transaction(q.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(q.INDEXEDDB_TABLE_NAME)}catch(t){return}return a},e.prototype.makeSaveDataItem=function(t,e,a,s){return{url:location.href,id:t,hash:me.checkOriginalMapString,image:e.toDataURL(),data:a,date:s,worldName:me.worldName,mapDataRevisionKey:me.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var a=t.index("url"),s=IDBKeyRange.only(location.href),i=a.getAll(s);i.onsuccess=function(){e(i.result)}},e.prototype.dbUpdateSaveData=function(t,a,s,i){var r=this,o=this.indexDBOpen();o.onupgradeneeded=e.doNotAnything,o.onsuccess=function(){var n=r.getObjectStore(o.result),_=$t.compress(s),c=r.makeSaveDataItem(t,a,_,i);r.selectDatas[t]=c;var h=n.put(c);h.onsuccess=e.doNotAnything,h.onerror=e.doNotAnything},o.onerror=e.doNotAnything,o.onblocked=e.doNotAnything},e.prototype.dbDeleteSaveData=function(t){var a=this,s=this.indexDBOpen();s.onupgradeneeded=e.doNotAnything,s.onsuccess=function(){var e=a.getObjectStore(s.result);t.forEach((function(t){e.delete([t,location.href])}))},s.onerror=e.doNotAnything,s.onblocked=e.doNotAnything},e.prototype.selectSaveData=function(){var t=this,a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=t.getObjectStore(a.result);t.selectDatas=[];t.getSaveDataResult(e,(function(e){var a,s,i,r=[];for(s=e.length,a=0;a<s;a++){var o=e[a];try{i={id:o.id,hash:o.hash,data:o.data,date:o.date,image:o.image,worldName:o.worldName,mapDataRevisionKey:o.mapDataRevisionKey}}catch(t){continue}var n=t.onCheckLoadingSaveData(i.worldName,i.hash,i.mapDataRevisionKey);if(null===n){if(t[i.id]){var _=_e($t.decompress(i.data)[0]);t[i.id].saveDataSet(i.image,_,i.date)}}else r.push({id:i.id,cause:n})}r.length>0&&t.dbDeleteSaveData(r.map((function(t){return t.id})));var c=r.map((function(t){return t.cause})).filter((function(t,e,a){return a.indexOf(t)===e}));t.onCompleteLoadingSaveData(c)}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything},e.doNotAnything=function(){},e}(oe),ue=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),le=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ue(e,t),e}(ee),pe=le,de=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Ee=function(t){function e(){var a=t.call(this)||this;a._saveNo=0,a._lastAutoSaveMove=0,a._autoInterval=q.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(a,Object.create(e.prototype));for(var s=0;s<q.QUICK_SAVE_MAX;s++)a[s]=new pe(s,a);return a._saveNo=0,a._lastAutoSaveMove=0,a}return de(e,t),e.prototype.resumeStart=function(){this._lastAutoSaveMove=-1},e.prototype.setPlayer=function(t){this._lastAutoSaveMove=t.getMoveCount()},e.prototype.isAutoSaveFrame=function(t){if(0===this._autoInterval)return!1;var e=t.getMoveCount();return!(this._lastAutoSaveMove>=e)&&(e%this._autoInterval==0&&(this._lastAutoSaveMove=e,!0))},e.prototype.autoSave=function(t,e){this[this._saveNo].save(t,e),this._saveNo++,this._saveNo=this._saveNo%q.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(oe);function fe(t,e){return(0,Ht.MD5)(t+e).toString()}var ye,we=function(){function t(e,a,s,i,r){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=a,t.mapDataRevisionKey=fe(a,s),this._wwaDBSaveList=new he(i,r),this._wwaLogSaveList=new Ee,this.selectDBSaveDataList()}return t.prototype.resumeStart=function(){this._wwaLogSaveList.resumeStart()},t.prototype.isAutoSaveFrame=function(t){return this._wwaLogSaveList.isAutoSaveFrame(t)},t.prototype.autoSave=function(t,e){this._wwaLogSaveList.autoSave(t,e)},t.prototype.selectDBSaveDataList=function(){this.list=this._wwaDBSaveList},t.prototype.selectLogSaveDataList=function(){this.list=this._wwaLogSaveList},t.prototype.save=function(t,e,a){var s=this.list[a];return!!s&&s.save(t,e)},t.prototype.load=function(t){var e=this.list[t];return e?e.load():null},t.prototype.hasSaveData=function(){return this.list.hasSaveData()},t.prototype.setAutoSaveInterval=function(t){return this._wwaLogSaveList.setAutoSaveInterval(t)},t.prototype.getFirstSaveChoiceCallInfo=function(t){return t?P.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?P.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?P.CALL_BY_LOG_QUICK_LOAD:P.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?P.CALL_BY_LOG_QUICK_LOAD:t?P.CALL_BY_PASSWORD_LOAD:P.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?_t("cell-save").textContent=z.EMPTY_SAVE:_t("cell-save").textContent=z.QUICK_SAVE},t}(),me=we;!function(t){t.UNMATCHED_WORLD_NAME="UNMATCHED_WORLD_NAME",t.UNMATCHED_WORLD_PASS_NUMBER="UNMATCHED_WORLD_PASS_NUMBER",t.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA="DISALLOW_OLD_REVISION_WORLD_SAVE_DATA"}(ye||(ye={}));var ge,Ae=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Se=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ie=function(){function t(t,e,a,s){var i=this;this.id=t,this.fileName=e,this.audioContext=a,this.audioGain=s,this.disposeBufferSource=function(t){try{t.stop(),t.disconnect(i.audioGain),t.buffer=null}catch(t){}t.onended=null},this.audioContext=a,this.audioGain=s,this.audioBuffer=null,this.bufferSources=[],this.isLoaded=!1,this.load()}return t.prototype.fetchSoundFile=function(){return Ae(this,void 0,void 0,(function(){return Se(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,fetch(this.fileName)];case 1:return[2,t.sent()];case 2:return t.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (fetch)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.getArrayBuffer=function(t){return Ae(this,void 0,void 0,(function(){return Se(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,t.arrayBuffer()];case 1:return[2,e.sent()];case 2:return e.sent(),console.warn("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (arrayBuffer)")),[2,void 0];case 3:return[2]}}))}))},t.prototype.load=function(t){return void 0===t&&(t=0),Ae(this,void 0,void 0,(function(){var e,a,s=this;return Se(this,(function(i){switch(i.label){case 0:return t>=10?(console.log("サウンド ".concat(this.id," 番の音声ファイルの取得失敗 (最大リトライ回数超過)")),this.isExceededMaxRetryCount=!0,[2]):[4,this.fetchSoundFile()];case 1:return(e=i.sent())?0!==e.status&&200!==e.status?(console.warn("サウンド ".concat(this.id," 番の音声ファイルが見つかりません! HTTPエラー番号: ").concat(e.status)),this.cancelLoad(),[2]):[4,this.getArrayBuffer(e)]:(this.retry(t),[2]);case 2:return(a=i.sent())?(this.audioContext.decodeAudioData(a,(function(e){if(0===e.length)return console.log("サウンド ".concat(s.id," 番の音声ファイルのバッファサイズが 0 です ")),void s.retry(t);s.setData(e)})),[2]):(this.retry(t),[2])}}))}))},t.prototype.retry=function(t){var e=this;setTimeout((function(){return Ae(e,void 0,void 0,(function(){return Se(this,(function(e){switch(e.label){case 0:return[4,this.load(t+1)];case 1:return e.sent(),[2]}}))}))}),100)},t.prototype.setData=function(t){this.audioBuffer=t,this.isLoaded=!0},t.prototype.cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},t.prototype.play=function(){var t=this,e=this.audioContext.createBufferSource();this.bufferSources.push(e),e.buffer=this.audioBuffer,this.isBgm()&&(e.loop=!0),e.connect(this.audioGain);var a=e.duration;(!isFinite(a)||a<0||"number"!=typeof a)&&(a=0),e.start(),e.onended=function(){var a=t.bufferSources.indexOf(e);-1!==a&&t.bufferSources.splice(a,1),t.disposeBufferSource(e)},this.audioGain.connect(this.audioContext.destination)},t.prototype.pause=function(){this.bufferSources.forEach(this.disposeBufferSource),this.bufferSources.length=0},t.prototype.isBgm=function(){return this.id>=H.BGM_LB},t.prototype.hasData=function(){return null!==this.audioBuffer},t.prototype.isLoading=function(){return!this.isLoaded},t.prototype.isError=function(){return this.isExceededMaxRetryCount||this.isLoaded&&null===this.audioBuffer},t}(),ve=function(t,e){for(var a=new Array(t),s=0;s<a.length;s++)a[s]=new Array(e);return a};function Te(t,e){var a=function(t){return t[ge.CHECK]+256*t[ge.CHECK+1]}(t),s=function(t,e){var a,s=0;if(t[ge.VERSION]>=29){for(var i=2;i<e;i++)s+=(a=t[i],((a%=256)>=128?a-256:a)*(i%8+1));s=s%65536&65535}return s}(t,e);if(a!==s)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+a+"ですが、実際の和は"+s+"でした。")}!function(t){t[t.CHECK=0]="CHECK",t[t.VERSION=2]="VERSION",t[t.OLD_MAP_COUNT=3]="OLD_MAP_COUNT",t[t.OLD_OBJ_COUNT=4]="OLD_OBJ_COUNT",t[t.OLD_PLAYER_X=5]="OLD_PLAYER_X",t[t.OLD_PLAYER_Y=6]="OLD_PLAYER_Y",t[t.STATUS_ENERGY=10]="STATUS_ENERGY",t[t.STATUS_STRENGTH=12]="STATUS_STRENGTH",t[t.STATUS_DEFENCE=14]="STATUS_DEFENCE",t[t.STATUS_GOLD=16]="STATUS_GOLD",t[t.OLD_GAMEOVER_X=18]="OLD_GAMEOVER_X",t[t.OLD_GAMEOVER_Y=19]="OLD_GAMEOVER_Y",t[t.OLD_ITEMBOX_TOP=20]="OLD_ITEMBOX_TOP",t[t.STATUS_ENERGY_MAX=32]="STATUS_ENERGY_MAX",t[t.MAP_COUNT=34]="MAP_COUNT",t[t.OBJ_COUNT=36]="OBJ_COUNT",t[t.PLAYER_X=38]="PLAYER_X",t[t.PLAYER_Y=40]="PLAYER_Y",t[t.GAMEOVER_X=42]="GAMEOVER_X",t[t.GAMEOVER_Y=44]="GAMEOVER_Y",t[t.MAP_SIZE=46]="MAP_SIZE",t[t.MESSAGE_NUM=48]="MESSAGE_NUM",t[t.ITEMBOX_TOP=60]="ITEMBOX_TOP",t[t.MAPDATA_TOP=90]="MAPDATA_TOP",t[t.OLD_MAPDATA_TOP=100]="OLD_MAPDATA_TOP"}(ge||(ge={}));var Oe,De,Ce=function(){function t(){}return t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_CROP1=1,t.ATR_CROP2=2,t.ATR_TYPE=3,t.ATR_JUMP_X=16,t.ATR_JUMP_Y=17,t.MAP_LOCALGATE=2,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGPOS_DEFAULT_PLAYER_X=2,t.IMGPOS_DEFAULT_PLAYER_Y=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_STATUS_X=3,t.IMGPOS_DEFAULT_STATUS_Y=2,t.IMGRELPOS_ENERGY_ICON_X=0,t.IMGRELPOS_STRENGTH_ICON_X=1,t.IMGRELPOS_DEFENCE_ICON_X=2,t.IMGRELPOS_GOLD_ICON_X=3,t.IMGPOS_DEFAULT_WIDE_CELL_X=4,t.IMGPOS_DEFAULT_WIDE_CELL_Y=3,t.IMGPOS_DEFAULT_ITEMBOX_X=1,t.IMGPOS_DEFAULT_ITEMBOX_Y=2,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STR_COLOR_R=0,t.DEFAULT_STR_COLOR_G=0,t.DEFAULT_STR_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.DEFAULT_MOVES=0,t.DEFAULT_SPEED_INDEX=3,t.USER_VAR_NUM=256,t}();!function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(Oe||(Oe={})),function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE"}(De||(De={}));var Me=function(){function t(t,e,a){this.byteMapData=t,this.eventEmitter=a,Te(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0,isGameOverDisabled:void 0,gameOverPolicy:"default"}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[ge.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=ge.MAPDATA_TOP:this.currentPosition=ge.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(Oe.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(Oe.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?Ce.MAP_ATR_MAX:Ce.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?Ce.OBJ_ATR_MAX:Ce.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(Oe.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(Oe.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(Oe.MAP),this._convertAttributeV2toV3(Oe.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,a,s;if(t==Oe.MAP)e=this.wwaData.mapPartsMax,a=this.wwaData.mapAttribute,s=Ce.MAP_LOCALGATE;else{if(t!=Oe.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,a=this.wwaData.objectAttribute,s=Ce.OBJECT_LOCALGATE}for(var i=0;i<e;i++){for(var r=9;r>=0;r--){var o=255&a[i][20+2*r],n=a[i][20+2*r]>>8,_=255&a[i][20+2*r+1],c=a[i][20+2*r+1]>>8;250===_?_=9e3:_>100&&(_+=9840),250===c?c=9e3:c>100&&(c+=9840),a[i][20+4*r]=o,a[i][20+4*r+3]=n,a[i][20+4*r+1]=_,a[i][20+4*r+2]=c}a[i][Ce.ATR_TYPE]===s&&(a[i][Ce.ATR_JUMP_X]>100&&(a[i][Ce.ATR_JUMP_X]+=9840),a[i][Ce.ATR_JUMP_Y]>100&&(a[i][Ce.ATR_JUMP_Y]+=9840))}},t.prototype._get1ByteNumber=function(t){return this.byteMapData[t]},t.prototype._get2BytesNumber=function(t){return this.byteMapData[t]+256*this.byteMapData[t+1]},t.prototype._extractInitialParameters=function(){this.wwaData.version>29?(this.wwaData.gameoverX=this._get2BytesNumber(ge.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(ge.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(ge.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(ge.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(ge.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(ge.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(ge.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(ge.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(ge.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(ge.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(ge.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(ge.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(ge.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(ge.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(ge.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(ge.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(ge.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(ge.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(ge.MESSAGE_NUM),this.wwaData.version<28?this.wwaData.mapWidth=71:this.wwaData.version<=29&&(this.wwaData.mapWidth=101)},t.prototype._extractInitialItemData=function(){var t=this.wwaData.version>29?ge.ITEMBOX_TOP:ge.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(Ce.ITEMBOX_SIZE);for(var e=0;e<Ce.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var a,s,i;for(i=ve(this.wwaData.mapWidth,this.wwaData.mapWidth),a=0;a<this.wwaData.mapWidth;a++)for(s=0;s<this.wwaData.mapWidth;s++)this.wwaData.version>29?(i[a][s]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(i[a][s]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(a*this.wwaData.mapWidth+s)%200==0&&this.emitProgress(a*this.wwaData.mapWidth+s,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Oe.MAP?De.MAP_LOAD:De.OBJ_LOAD),i[a][s]>=e&&(i[a][s]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===Oe.MAP?De.MAP_LOAD:De.OBJ_LOAD),i},t.prototype._getPartsDataFromBits=function(t,e,a){var s,i,r;for(r=ve(e,a),s=0;s<e;s++)for(i=0;i<a;i++)(s*this.wwaData.mapWidth+i)%200==0&&this.emitProgress(s*a+i,e*a,t===Oe.MAP?De.MAP_ATTR:De.OBJ_ATTR),i!==Ce.ATR_CROP1&&i!==Ce.ATR_CROP2?(r[s][i]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(r[s][i]=0,this.currentPosition+=2);return this.emitProgress(e*a,e*a,t===Oe.MAP?De.MAP_ATTR:De.OBJ_ATTR),r},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,De.RAND_PARTS)},t.prototype.emitProgress=function(t,e,a){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:a})},t}();var Ne=function(){function t(t,e,a,s){this.wwaData=t,this.compressedMapData=e,this.startPosition=a,this.eventEmitter=s,this.OLDVER_MESSAGE_MAX=400}return t.prototype.load=function(){var t=this.wwaData;this.currentPos=this.startPosition,t.version>=30&&(t.worldPassword=this.getMessageFromData()),t.version<=29&&(t.messageNum=this.OLDVER_MESSAGE_MAX),t.message=new Array(t.messageNum);for(var e=0;e<t.message.length;e++)t.message[e]=this.getMessageFromData(),e%200==0&&this.eventEmitter.dispatch("progress",{current:e,total:t.message.length,stage:De.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:De.MESSAGE}),t.worldName=this.getMessageFromData(),t.version<=29?t.worldPassword=this.getMessageFromData():this.getMessageFromData(),""===t.worldPassword?t.worldPassNumber=0:t.version>=29?t.worldPassNumber=(parseInt(t.worldPassword)/10-1197)/17-2357:t.worldPassNumber=parseInt(t.worldPassword),t.charCGName=this.getMessageFromData(),t.mapCGName=this.getMessageFromData(),t.systemMessage=new Array(Ce.SYSTEM_MESSAGE_NUM);for(e=0;e<Ce.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=Ce.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=Ce.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=Ce.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=Ce.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=Ce.DEFAULT_DISABLE_SAVE,t.isOldMap=Ce.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=Ce.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=Ce.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=Ce.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=Ce.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=Ce.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=Ce.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=Ce.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=Ce.DEFAULT_FRAME_COLOR_R,t.frameColorG=Ce.DEFAULT_FRAME_COLOR_G,t.frameColorB=Ce.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=Ce.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=Ce.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=Ce.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=Ce.DEFAULT_STR_COLOR_R,t.fontColorG=Ce.DEFAULT_STR_COLOR_G,t.fontColorB=Ce.DEFAULT_STR_COLOR_B,t.statusColorR=Ce.DEFAULT_STATUS_COLOR_R,t.statusColorG=Ce.DEFAULT_STATUS_COLOR_G,t.statusColorB=Ce.DEFAULT_STATUS_COLOR_B,t.moves=Ce.DEFAULT_MOVES,t.gameSpeedIndex=Ce.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(Ce.USER_VAR_NUM);for(e=0;e<Ce.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t.gameOverPolicy="default",t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Pe=function(){},be=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Re=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Le=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},xe=function(t){function e(e){var a=t.call(this)||this;return a.uri=e,a}return be(e,t),e.fetch=function(t){return Re(this,void 0,void 0,(function(){return Le(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,fetch(t)];case 1:return[2,e.sent()];case 2:throw e.sent(),new Error("マップデータ 「".concat(t,"」の読み込みに失敗しました。\n 通信環境の良いところで再度お試しください。\n ローカルテストの場合は、ブラウザが対応していない可能性があります。"));case 3:return[2]}}))}))},e.handleError=function(t,e){var a="HTTPステータスコードは ".concat(e.status," です。");switch(e.status){case 200:case 304:return;case 403:throw new Error("マップデータ「".concat(t,"」を読み取る権限がないようです。\n 管理者の方へ: マップデータのパーミッションを確認してください。\n ").concat(a));case 404:throw new Error("マップデータ「".concat(t,"」が見つかりませんでした。\n ").concat(a));default:throw new Error("マップデータ「".concat(t,"」の読み込みに失敗しました。\n ").concat(a))}},e.prototype.request=function(){return Re(this,void 0,void 0,(function(){var t;return Le(this,(function(a){switch(a.label){case 0:return[4,e.fetch(this.uri)];case 1:return t=a.sent(),e.handleError(this.uri,t),[4,t.arrayBuffer()];case 2:return[2,a.sent()]}}))}))},e}(Pe),Be=a(106),Ue=a.n(Be),We=function(){var t=function(e,a){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])},t(e,a)};return function(e,a){if("function"!=typeof a&&null!==a)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function s(){this.constructor=e}t(e,a),e.prototype=null===a?Object.create(a):(s.prototype=a.prototype,new s)}}(),Ye=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},ke=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Fe=function(t){function e(e){var a=t.call(this)||this;return a.fileName=e,a}return We(e,t),e.prototype.request=function(){return Ye(this,void 0,void 0,(function(){var t=this;return ke(this,(function(e){return[2,new Promise((function(e,a){Ue().readFile(t.fileName,(function(t,s){t&&a(t),e(s.buffer)}))}))]}))}))},e}(Pe),Ge=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Ve=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},He=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){return Ge(this,void 0,void 0,(function(){var t,e,a,s,i,r;return Ve(this,(function(o){switch(o.label){case 0:n=this.fileName,t="undefined"!=typeof window?new xe(n):new Fe(n),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.request()];case 2:return(e=o.sent())?(a=this.loadMapData(e),this.eventEmitter.dispatch("mapData",a),[3,4]):(this.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"}),[2]);case 3:return s=o.sent(),i=s.name||"",r=s.message||"",this.eventEmitter.dispatch("error",{name:i,message:r}),[3,4];case 4:return[2]}var n}))}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),a=function(t){var e,a,s=new Uint8Array(t.length);for(e=0,a=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(s[a++]=t[e],t[e]===t[e+1]){for(var i=t[e+2],r=0;r<i;r++)s[a++]=t[e];e+=2}if(a+255>=s.length){var o=new Uint8Array(s.length+65e3);o.set(s),s=o}}return console.log("EXTRACT DATA = "+a+" "+e),{byteMapData:s,byteMapLength:a,compressedEndPosition:e+3}}(e),s=a.byteMapData,i=a.byteMapLength,r=a.compressedEndPosition,o=new Me(s,i,this.eventEmitter).extractAllData();return new Ne(o,e,r,this.eventEmitter).load()}catch(t){throw t}},t}(),Ke=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var a=new CustomEvent(t,{detail:e});this.target.dispatchEvent(a)},t.prototype.addListener=function(t,e){var a=function(t){return e(t.detail)};return this.target.addEventListener(t,a),a},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),je=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Xe=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Je="\\d+",Ze="v\\[".concat(Je,"\\]"),Qe="v\\[(".concat(Je,")\\]"),qe="HP|HPMAX|AT|DF|GD",ze="".concat(Ze,"|").concat(qe),$e="".concat(Je,"|").concat(Ze,"|").concat("AT_TOTAL|AT_ITEMS|DF_TOTAL|DF_ITEMS|STEP|TIME|PX|PY","|").concat(qe),ta="RAND\\((?:".concat($e,")\\)"),ea="RAND\\((".concat($e,")\\)"),aa="".concat(ta),sa="".concat($e,"|").concat(aa),ia="".concat("=","|\\+=|\\-=|\\*=|\\/=|%="),ra="^\\(",oa="\\)$",na=new RegExp("^".concat(Je,"$")),_a=new RegExp("^".concat(Ze,"$")),ca=new RegExp("^".concat(Qe,"$")),ha=new RegExp("^".concat(ta,"$")),ua=new RegExp("^".concat(ea,"$")),la=new RegExp("".concat(ra,"(").concat(ze,")").concat("=","(").concat(sa,")(").concat("\\+|\\-|\\*|\\/|%",")(").concat(sa,")").concat(oa)),pa=new RegExp("".concat(ra,"(").concat(ze,")(").concat(ia,")(").concat(sa,")").concat(oa)),da=new RegExp("".concat(ra,"(").concat(sa,")(").concat(">|<|<=|>=|==|!=",")(").concat(sa,")").concat(oa));function Ea(t){switch(t){case"HP":case"HPMAX":case"AT":case"AT_TOTAL":case"AT_ITEMS":case"DF":case"DF_TOTAL":case"DF_ITEMS":case"GD":case"STEP":case"TIME":case"PX":case"PY":return t;default:return _a.test(t)?"VARIABLE":na.test(t)?"NUMBER":ha.test(t)?"RAND":null}}function fa(t,e){switch(Ea(t)){case"HP":return e.totalStatus.energy;case"HPMAX":return e.energyMax;case"AT":return e.bareStatus.strength;case"AT_TOTAL":return e.totalStatus.strength;case"AT_ITEMS":return e.itemStatus.strength;case"DF":return e.bareStatus.defence;case"DF_TOTAL":return e.totalStatus.defence;case"DF_ITEMS":return e.itemStatus.defence;case"GD":return e.totalStatus.gold;case"STEP":return e.moveCount;case"VARIABLE":return function(t,e){var a=t.match(ca);if(null===a)throw new Error("変数のフォーマットではありません。");var s=parseInt(a[1],10);return e.userVars[s]}(t,e);case"NUMBER":return function(t){var e=parseInt(t,10);if(isNaN(e))throw new Error("数値として解釈できません: ".concat(t));return e}(t);case"TIME":return e.playTime;case"PX":return e.playerCoord.x;case"PY":return e.playerCoord.y;case"RAND":var a=fa(t.match(ua)[1],e);return Math.floor(Math.random()*a);default:return 0}}function ya(t,e,a){switch(t){case"=":return a;case"+":case"+=":return e+a;case"-":case"-=":return e-a;case"*":case"*=":return e*a;case"/":case"/=":return 0===a?0:e/a;case"%":case"%=":return 0===a?0:e%a;default:throw new Error("未定義の演算子です")}}function wa(t,e){switch(Ea(e)){case"VARIABLE":var a=e.match(/^v\[(\d+)\]$/),s=parseInt(a[1],10);if(null===s||isNaN(s))throw new Error("ユーザ変数の添字のパースに失敗しました");return{assignee:s,rawValue:t};case"NUMBER":throw new Error("左辺値に定数は入れられません");case"HP":return{assignee:"energy",rawValue:t};case"HPMAX":return{assignee:"energyMax",rawValue:t};case"AT":return{assignee:"strength",rawValue:t};case"AT_TOTAL":throw new Error("左辺値に合計攻撃力は入れられません");case"AT_ITEMS":throw new Error("左辺値にアイテム攻撃力は入れられません");case"DF":return{assignee:"defence",rawValue:t};case"DF_TOTAL":throw new Error("左辺値に合計防御力は入れられません");case"DF_ITEMS":throw new Error("左辺値にアイテム防御力は入れられません");case"GD":return{assignee:"gold",rawValue:t};case"STEP":throw new Error("左辺値に歩数は入れられません");case"TIME":throw new Error("左辺値にプレイ時間は入れられません");case"PX":throw new Error("左辺値にプレイヤーX座標は入れられません");case"PY":throw new Error("左辺値にプレイヤーY座標は入れられません");case"RAND":throw new Error("左辺値に乱数は入れられません")}}function ma(t){return t.replace(/\s/g,"")}var ga,Aa=function(t,e,a,s){return new(a||(a=Promise))((function(i,r){function o(t){try{_(s.next(t))}catch(t){r(t)}}function n(t){try{_(s.throw(t))}catch(t){r(t)}}function _(t){var e;t.done?i(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(o,n)}_((s=s.apply(t,e||[])).next())}))},Sa=function(t,e){var a,s,i,r,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function n(r){return function(n){return function(r){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,s&&(i=2&r[0]?s.return:r[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;switch(s=0,i&&(r=[2&r[0],i.value]),r[0]){case 0:case 1:i=r;break;case 4:return o.label++,{value:r[1],done:!1};case 5:o.label++,s=r[1],r=[0];continue;case 7:r=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==r[0]&&2!==r[0])){o=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(6===r[0]&&o.label<i[1]){o.label=i[1],i=r;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(r);break}i[2]&&o.ops.pop(),o.trys.pop();continue}r=e.call(t,o)}catch(t){r=[6,t],s=0}finally{a=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,n])}}},Ia=function(t,e,a){if(a||2===arguments.length)for(var s,i=0,r=e.length;i<r;i++)!s&&i in e||(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))};function va(t,e,a){var s=new $;return s.current=t,s.total=e,s.stage=a,s}var Ta=function(){function a(a,i,n,c,p,d,w,m,A,S,I){void 0===i&&(i=!1),void 0===w&&(w=""),void 0===m&&(m=!1),void 0===A&&(A=null);var v,T=this;this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return T._main()},this.soundCheckCaller=function(){return T.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return T._keyStore.checkHitKey(e.KEY_ESC)||T._keyStore.checkHitKey(e.KEY_SHIFT)||T._keyStore.checkHitKey(e.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new Ke(_t("wwa-wrapper")),window.addEventListener("click",(function(t){T._isActive=!1})),_t("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),T._isActive=!0})),this._isActive=!0,null===n?(this._hasTitleImg=!1,this._cvsCover=_t("progress-panel"),(v=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?_t("version").textContent="WWA Wing Ver.3.9.3":this._setLoadingMessage(v,0)}catch(t){}this._dumpElement=A;var O=window.AudioContext||window.webkitAudioContext;O&&(this.audioContext=new O,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var D=new Audio;"no"!==D.canPlayType("audio/mpeg")&&""!==D.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new U,this._isURLGateEnable=i,this._isClassicModeEnable=c,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new E(0,0,0,0),w?"/"!==w[w.length-1]&&(w+="/"):w="./audio/",this._audioDirectory=w,this._bottomButtonType=d?h.GOTO_WWA:h.BATTLE_REPORT;var R=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===M.GAME){if(this.userDevice.os===C.NINTENDO)Q.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=h.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===N.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case M.VR:case M.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(_t("cell-save").textContent=z.QUICK_SAVE,this._usePassword?_t("cell-load").textContent=z.PASSWORD:_t("cell-load").textContent=z.EMPTY_LOAD,this._bottomButtonType){case h.GOTO_WWA:_t("cell-gotowwa").textContent=z.GOTO_WWA;break;case h.BATTLE_REPORT:_t("cell-gotowwa").textContent=z.BATTLE_REPORT;break;case h.GAME_END:_t("cell-gotowwa").textContent=z.GAME_END}this._loadHandler=function(a){T._wwaData=a,T._wwaData.isItemEffectEnabled=p;try{T._hasTitleImg?_t("version").textContent+=" (Map data Ver. "+Math.floor(T._wwaData.version/10)+"."+ +T._wwaData.version%10+")":T._setLoadingMessage(v,1)}catch(t){}var i=_t("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");i.pop(),i.push(T._wwaData.mapCGName),T._wwaData.mapCGName=i.join("/"),T._startTime=(new Date).getTime(),T._restartData=JSON.parse(JSON.stringify(T._wwaData)),T.checkOriginalMapString=T._generateMapDataHash(T._restartData),T.initCSSRule(),T._setProgressBar(va(0,4,j.GAME_INIT)),T._setLoadingMessage(v,2);var n=new Image;n.src=T._wwaData.mapCGName,n.addEventListener("error",(function(){T._setErrorMessage("画像ファイル「"+T._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",v)}));var c=T._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),h=function(t){t.style.backgroundImage="url("+c+")"};Array.prototype.forEach.call(ut("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(T._wwaData.imgItemboxX*Q.CHIP_SIZE,"px -").concat(T._wwaData.imgItemboxY*Q.CHIP_SIZE,"px"),t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+c+")"})),Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(ut(".item-cell>.item-disp"),h),Array.prototype.forEach.call(ut("div.wide-cell-row>.status-icon"),h),T.setStatusIconCoord(V.ENERGY,new f(T._wwaData.imgStatusEnergyX,T._wwaData.imgStatusEnergyY)),T.setStatusIconCoord(V.STRENGTH,new f(T._wwaData.imgStatusStrengthX,T._wwaData.imgStatusStrengthY)),T.setStatusIconCoord(V.DEFENCE,new f(T._wwaData.imgStatusDefenceX,T._wwaData.imgStatusDefenceY)),T.setStatusIconCoord(V.GOLD,new f(T._wwaData.imgStatusGoldX,T._wwaData.imgStatusGoldY)),T._setProgressBar(va(1,4,j.GAME_INIT)),T._setLoadingMessage(v,3),T._mapIDTableCreate(),T._replaceAllRandomObjects();var d=(new Date).getTime();console.log("Loading Complete!"+(d-R)+"ms"),T._cvs=_t("wwa-map");var w=T._cvs.getContext("2d",{alpha:!1});w.fillStyle="rgba( 255, 255, 255, 0.5)",w.fillRect(0,0,440,440);var A=new y(T,T._wwaData.playerX,T._wwaData.playerY);T._camera=new yt(A),T._itemMenu=new Vt;var S=new E(T._wwaData.statusEnergy,T._wwaData.statusStrength,T._wwaData.statusDefence,T._wwaData.statusGold);T._player=new At(T,A,T._camera,S,T._wwaData.statusEnergyMax,T._wwaData.moves,T._wwaData.gameSpeedIndex),T._objectMovingDataManager=new vt(T,T._player),T._camera.setPlayer(T._player),T._keyStore=new r,T._mouseStore=new _,T._gamePadStore=new l,T._messageQueue=[],T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._yesNoChoiceCallInfo=P.NONE,T._prevFrameEventExected=!1,T._lastMessage=new Ot([],!1,!1,[]),T._execMacroListInNextFrame=[],T._passwordLoadExecInNextFrame=!1,T._conditionalMacroExecStatus="outside-ifelse",T._messageWindow=new Rt(T,50,180,340,0,T._wwaData.mapCGName,!1,!0,!1,_t("wwa-wrapper")),T._scoreWindow=new bt(T,new f(50,50),!1,_t("wwa-wrapper")),T._wwaSave=new me(ga,ga._wwaData.worldName,ga._wwaData.worldPassNumber,T._checkSaveDataCompatibility.bind(T),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case ye.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case ye.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case ye.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),T._isDisallowLoadOldSave=m,T._messageWindow.setWWASave(T._wwaSave),$t.setRestartData(T._restartData,T._wwaData),T.clearFaces();var O=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof O&&(T._useSuspend=!0,O)){var D=$t.getStartWWAData(O);T._restartData!==D&&(T._applyQuickLoad(D),T._wwaSave.resumeStart())}var N=_t("wwa-wrapper").getAttribute("data-wwa-autosave");null!==N&&T._wwaSave.setAutoSaveInterval(0|Number(N));var L=_t("wwa-wrapper").getAttribute("data-wwa-looking-around");if(T._useLookingAround=!(L&&L.match(/false/i)),T._setProgressBar(va(2,4,j.GAME_INIT)),T._setLoadingMessage(v,4),window.addEventListener("keydown",(function(t){if(T._isActive){if(T.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();T._keyStore.setPressInfo(t.keyCode),t.keyCode!==e.KEY_F5?T._player.isWaitingMessage()?t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_SPACE||t.preventDefault():T._player.isWaitingPasswordWindow()||t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F2&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(T._isActive){if(T.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();T._keyStore.setReleaseInfo(t.keyCode),t.keyCode===e.KEY_F5?t.preventDefault():t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F9&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||T._player.isWaitingMessage()||T._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){T._keyStore.allClear(),T._mouseStore.clear()})),window.addEventListener("contextmenu",(function(t){T._keyStore.allClear(),T._mouseStore.clear()})),window.addEventListener("help",(function(t){T._isActive&&t.preventDefault()})),T._mouseControllerElement=_t("wwa-controller"),T._mouseControllerElement.addEventListener("mousedown",(function(t){if(T._isActive&&1===t.which){if(T._mouseStore.getMouseState()!==s.NONE)return void t.preventDefault();var e=lt(t.clientX,t.clientY),a=T._player.getDrawingCenterPosition(),i=e.substract(a),r=Math.abs(i.x),o=Math.abs(i.y),n=void 0,_=!1;if(r<Q.CHIP_SIZE&&o<Q.CHIP_SIZE){switch(a.x/Q.CHIP_SIZE|0){case 0:_=!0,n=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.RIGHT}switch(a.y/Q.CHIP_SIZE|0){case 0:_=!0,n=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.DOWN}}_||(i.y>0&&o>r?n=u.DOWN:i.y<0&&o>r?n=u.UP:i.x>0&&o<r?n=u.RIGHT:i.x<0&&o<r&&(n=u.LEFT)),T._mouseStore.setPressInfo(n,0)}})),T._mouseControllerElement.addEventListener("mouseleave",(function(t){T._mouseStore.clear()})),T._mouseControllerElement.addEventListener("mouseup",(function(t){T._isActive&&1===t.which&&(T._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(T.audioContext){var x=function(){T.audioContext.createBufferSource().start(0),T._mouseControllerElement.removeEventListener("touchstart",x),x=null};T._mouseControllerElement.addEventListener("touchstart",x)}T._mouseControllerElement.addEventListener("touchstart",(function(t){if(T._isActive)if(T._mouseStore.getMouseState()===s.NONE){for(var e=t.changedTouches,a=e.length,i=0;i<a;i++){var r=e[i],o=lt(r.clientX,r.clientY),n=T._player.getDrawingCenterPosition(),_=o.substract(n),c=Math.abs(_.x),h=Math.abs(_.y),l=void 0,p=!1;if(c<Q.CHIP_SIZE&&h<Q.CHIP_SIZE){switch(n.x/Q.CHIP_SIZE|0){case 0:p=!0,l=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.RIGHT}switch(n.y/Q.CHIP_SIZE|0){case 0:p=!0,l=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.DOWN}}p||(_.y>0&&h>c?l=u.DOWN:_.y<0&&h>c?l=u.UP:_.x>0&&h<c?l=u.RIGHT:_.x<0&&h<c&&(l=u.LEFT)),T._mouseStore.setPressInfo(l,r.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var B=function(t){if(T._isActive)for(var e=0;e<t.changedTouches.length;e++)if(T._mouseStore.getTouchID()===t.changedTouches[e].identifier){T._mouseStore.setReleaseInfo(),t.preventDefault();break}};T._mouseControllerElement.addEventListener("touchend",B),T._mouseControllerElement.addEventListener("touchcancel",B)}_t("button-load").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.QUICK_LOAD)})),_t("button-save").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.QUICK_SAVE)})),_t("button-restart").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.RESTART_GAME)})),_t("button-gotowwa").addEventListener("click",(function(){(T._player.isControllable()||T._messageWindow.isItemMenuChoice())&&T.onselectbutton(b.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(ut(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){T._displayHelp()}))})),T._frameCoord=new f(Q.IMGPOS_DEFAULT_FRAME_X,Q.IMGPOS_DEFAULT_YESNO_Y),T._battleEffectCoord=new f(Q.IMGPOS_DEFAULT_BATTLE_EFFECT_X,Q.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),T._battleEstimateWindow=new xt(T,T._wwaData.mapCGName,_t("wwa-wrapper")),T._passwordWindow=new Ft(T,_t("wwa-wrapper"),m),T._monsterWindow=new Pt(T,new f(50,180),340,60,!1,_t("wwa-wrapper"),T._wwaData.mapCGName),T._setProgressBar(va(3,4,j.GAME_INIT)),T._isLoadedSound=!1,T._temporaryInputDisable=!1,T._paintSkipByDoorOpen=!1,T._clearFacesInNextFrame=!1,T._useConsole=!1,T.wwaCustomEvent("wwa_startup"),T._cgManager=new ft(w,T._wwaData.mapCGName,T._frameCoord,(function(){T._isSkippedSoundMessage=!0;var a=function(){switch(T.userDevice.device){case M.PC:T.setMessageQueue("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case M.SP:T.setMessageQueue("ゲームを開始します。\n画面にふれてください。",!1,!0)}};if("ON"===T._wwaData.systemMessage[Y.LOAD_SE])return T._isLoadedSound=!0,a(),T._setLoadingMessage(v,j.AUDIO),T.loadSound(),void window.requestAnimationFrame(T.soundCheckCaller);if("OFF"===T._wwaData.systemMessage[Y.LOAD_SE])return T._isLoadedSound=!1,a(),void T.openGameWindow();if(T._isSkippedSoundMessage=!1,T._hasTitleImg||v.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),T._usePassword){var s="効果音・BGMデータをロードしますか?";I&&(s+='\n\n※変数表示が有効になっています。\n公開前に必ずHTMLファイル内の\n data-wwa-display-user-vars="true" \nを消してください。'),T._messageWindow.setParsedMessage(new Ot(""===T._wwaData.systemMessage[Y.LOAD_SE]?s:T._wwaData.systemMessage[Y.LOAD_SE],!0)),T._messageWindow.show(),T._setProgressBar(va(4,4,j.GAME_INIT));var i=setInterval((function(){T._keyStore.update(),T._gamePadStore.update(),T._yesNoJudgeInNextFrame===g.UNSELECTED&&(T._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||T._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||T._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)?T._yesNoJudgeInNextFrame=g.YES:(T._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||T._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||T._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B))&&(T._yesNoJudgeInNextFrame=g.NO)),T._yesNoJudgeInNextFrame===g.YES?(clearInterval(i),T._messageWindow.update(),T._yesNoJudge=T._yesNoJudgeInNextFrame,T._messageWindow.setInputDisable(),setTimeout((function(){T._player.setDelayFrame(),T._messageWindow.hide(),T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._isLoadedSound=!0,T._setLoadingMessage(v,j.AUDIO),T.loadSound(),window.requestAnimationFrame(T.soundCheckCaller)}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL)):T._yesNoJudgeInNextFrame===g.NO&&(clearInterval(i),T._messageWindow.update(),T._yesNoJudge=T._yesNoJudgeInNextFrame,T._messageWindow.setInputDisable(),setTimeout((function(){T._player.setDelayFrame(),T._messageWindow.hide(),T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._isLoadedSound=!1,T.openGameWindow()}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL))}),Q.DEFAULT_FRAME_INTERVAL)}else clearInterval(i),T._player.setDelayFrame(),T._messageWindow.hide(),T._yesNoJudge=g.UNSELECTED,T._yesNoJudgeInNextFrame=g.UNSELECTED,T._isLoadedSound=!0,T.loadSound(),window.requestAnimationFrame(T.soundCheckCaller)})),T.wwaCustomEvent("wwa_start")};var L=new Ke;L.addListener("mapData",(function(t){return T._loadHandler(t)})),L.addListener("progress",(function(t){return T._setProgressBar(t)})),L.addListener("error",(function(t){return T._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,v)})),new He(a,L).requestAndLoadMapData().then((function(){return Aa(T,void 0,void 0,(function(){return Sa(this,(function(t){return this._canDisplayUserVars=I,this._userVarNameList=[],this._canDisplayUserVars?(this._inlineUserVarViewer={topUserVarIndex:0,isVisible:!1},[2,S?(e=S,je(void 0,void 0,void 0,(function(){return Xe(this,(function(t){return[2,fetch(e).then((function(t){return 200===t.status||304===t.status?{kind:"data",data:t}:{kind:"httpError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。ステータスコード: ").concat(t.status)}})).catch((function(t){return{kind:"connectionError",errorMessage:"ファイル ".concat(e," が読み込めませんでした。通信状態がいい場所で再度お試しください。")}})).then((function(t){return je(void 0,void 0,void 0,(function(){var e,a;return Xe(this,(function(s){switch(s.label){case 0:return"data"!==t.kind?[3,2]:(a={kind:"data"},[4,t.data.json()]);case 1:return a.data=s.sent(),e=a,[3,3];case 2:e=t,s.label=3;case 3:return[2,e]}}))}))})).catch((function(t){return{kind:"brokenJson",errorMessage:"ファイル ".concat(e," が壊れています。")}}))]}))}))):{kind:"noFileSpecified",errorMessage:"data-wwa-user-var-names-file 属性に、変数の説明を記したファイル名を書くことで、その説明を表示できます。詳しくはマニュアルをご覧ください。"}]):[2,void 0];var e}))}))})).then((function(t){if(t)if("noFileSpecified"!==t.kind){if("data"!==t.kind)return T._userVarNameListRequestError=t,void T._updateVarDumpInformationArea(T._userVarNameListRequestError.errorMessage,!0);if(!t.data||"object"!=typeof t.data)return T._userVarNameListRequestError={kind:"notObject",errorMessage:"ユーザ変数一覧 ".concat(S," が正しい形式で書かれていません。")},void T._updateVarDumpInformationArea(T._userVarNameListRequestError.errorMessage,!0);if(T._userVarNameList=T.convertUserVariableNameListToArray(t.data),null!==T._dumpElement)for(var e=function(){var t=a.toString(10);if(!T._userVarNameList[a])return"continue";var e=".var-index".concat(t),s=T._dumpElement.querySelector(e),i=s.querySelector("".concat(e," > div"));i.textContent=T._userVarNameList[a],s.setAttribute("data-labelled-var-index","true"),s.addEventListener("mouseover",(function(){return i.removeAttribute("aria-hidden")})),s.addEventListener("mouseleave",(function(){return i.setAttribute("aria-hidden","true")}))},a=0;a<Q.USER_VAR_NUM;a++)e()}else T._updateVarDumpInformationArea(t.errorMessage,!1)}))}return a.prototype.convertUserVariableNameListToArray=function(t){for(var e=new Array(Q.USER_VAR_NUM),a=0;a<Q.USER_VAR_NUM;a++)e[a]=void 0;return Object.keys(t).forEach((function(a){var s=parseInt(a,10);"string"!=typeof t[a]||"string"!=typeof a||isNaN(s)||s<0||s>=Q.USER_VAR_NUM||(e[s]=t[a])})),e},a.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?(_t("progress-message-container").textContent=t.stage===Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:rt[t.stage],_t("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*Q.MAP_WINDOW_WIDTH+"px",_t("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?_t("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":_t("progress-message-container").textContent="ゲームデータを読み込んでいます。",_t("progress-bar-audio").style.width=t.current*Q.MAP_WINDOW_WIDTH/t.total+"px",_t("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},a.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=et.TITLE+"px "+Q.LOADING_FONT,t.fillText(ot[0],tt.TITLE_X,tt.TITLE_Y),t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("WWA Wing Ver.3.9.3",tt.FOOTER_X,tt.COPYRIGHT_Y);else if(e<=ot.length)t.font=et.LOADING+"px "+Q.LOADING_FONT,e>=2&&(t.clearRect(tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-3),Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText(ot[e-1]+" Complete!",tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-2))),e<ot.length&&t.fillText(ot[e],tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-1)),1==e&&(t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,tt.FOOTER_X,tt.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",tt.FOOTER_X,tt.WORLD_Y+tt.LINE));else{var a;a=this._isSkippedSoundMessage?tt.LOADING_Y+tt.LINE*(ot.length-1):tt.FOOTER_Y,e<=j.AUDIO?t.fillText("Now Sound data Loading .....",tt.LOADING_X,a):(t.clearRect(tt.LOADING_X,a-tt.LINE,Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText("Now Sound data Loading ..... Complete!",tt.LOADING_X,a))}},a.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),e.font=et.ERRROR+"px "+Q.LOADING_FONT,t.split("\n").forEach((function(t,a){e.fillText(t,tt.ERROR_X,tt.ERROR_Y+tt.LINE*a)})))},a.prototype.createSoundInstance=function(t){if(0!==t&&t!==H.NO_SOUND&&!this.sounds[t]){var e="".concat(this._audioDirectory).concat(t,".").concat(this.audioExtension);this.sounds[t]=new Ie(t,e,this.audioContext,this.audioGain)}},a.prototype.loadSound=function(){var t=this;this.sounds=new Array(Q.SOUND_MAX+1),this.createSoundInstance(H.DECISION),this.createSoundInstance(H.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var a=this._wwaData.mapAttribute[e][Q.ATR_SOUND];this.createSoundInstance(a)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM){a=this._wwaData.objectAttribute[e][Q.ATR_SOUND];this.createSoundInstance(a)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var a=e.match(/^\$sound=(\d+)/);if(a&&!(a.length<2)){var s=parseInt(a[1],10);!isNaN(s)&&0<s&&s<H.NO_SOUND&&t.createSoundInstance(s)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},a.prototype.checkAllSoundLoaded=function(){var a=0,s=0;if(!this._hasTitleImg)var i=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var r=1;r<=Q.SOUND_MAX;r++){var o=this.sounds[r];void 0===o||o.isError()||(s++,o.hasData()&&a++)}if(a<s&&!this._soundLoadSkipFlag)return this._setProgressBar(va(a,s,j.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(va(Q.SOUND_MAX,Q.SOUND_MAX,j.AUDIO)),this._setLoadingMessage(i,j.FINISH),this.openGameWindow()},a.prototype._setSoundLoadedCheckTimer=function(t){var e=this,a=this.sounds[t];a.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?a.hasData()?(a.play(),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):a.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},a.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},a.prototype.playSound=function(t){if(this._isLoadedSound){if(t<0||t>Q.SOUND_MAX)throw new Error("サウンド番号が範囲外です。");if(!(t>=H.BGM_LB&&this._wwaData.bgm===t))if((t===H.NO_SOUND||t>=H.BGM_LB)&&0!==this._wwaData.bgm&&(this.sounds[this._wwaData.bgm].hasData()&&this.sounds[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==H.NO_SOUND)this.sounds[t].hasData()?t>=H.BGM_LB?(this.sounds[t].play(),this._wwaData.bgm=t):this.sounds[t].play():t>=H.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t))}else t===H.NO_SOUND?this._wwaData.bgm=0:t>=H.BGM_LB&&(this._wwaData.bgm=t)},a.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();_t("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var a=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof a&&(this._useSuspend=!0,a)){var s=$t.getStartWWAData(a);this._restartData!==s&&(this._applyQuickLoad(s),this._wwaSave.resumeStart())}setTimeout((function(){_t("wwa-wrapper").removeChild(_t("wwa-cover")),t._main()}),Q.SPLASH_SCREEN_DISP_MILLS)},a.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){if(_t("item"+(t-1)).classList.add("onpress"),this.playSound(H.DECISION),"BLANK"===this._wwaData.message[W.USE_ITEM]){this._player.readyToUseItem(t);var e=this._player.useItem(),a=this.getObjectAttributeById(e,Q.ATR_STRING);this.setMessageQueue(this.getMessageById(a),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord())}else this.setMessageQueue(""===this._wwaData.message[W.USE_ITEM]?"このアイテムを使用します。\nよろしいですか?":this._wwaData.message[W.USE_ITEM],!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},a.prototype.onselectbutton=function(t,e,a){void 0===e&&(e=!1),void 0===a&&(a=!1);var s=_t(F[t]);if(this.playSound(H.DECISION),this._itemMenu.close(),s.classList.add("onpress"),t===b.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case P.CALL_BY_QUICK_LOAD:case P.CALL_BY_LOG_QUICK_LOAD:var i,r="";switch(this._yesNoChoiceCallInfo){case P.CALL_BY_QUICK_LOAD:r="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case P.CALL_BY_LOG_QUICK_LOAD:r="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),i){case P.CALL_BY_LOG_QUICK_LOAD:this.setMessageQueue(r+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case P.CALL_BY_PASSWORD_LOAD:this.setMessageQueue(r+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case P.NONE:this.setMessageQueue(r,!0,!0)}break;case P.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===b.QUICK_SAVE)this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this._wwaSave.selectDBSaveDataList(),this._messageWindow.createSaveDom(),this._usePassword?(this.setMessageQueue("データの一時保存先を選んでください。\n→Noでデータ復帰用パスワードの\n 表示選択ができます。",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_QUICK_SAVE):(this.setMessageQueue("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_QUICK_SAVE));else if(t===b.RESTART_GAME)this.setMessageQueue("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_RESTART_GAME;else if(t===b.GOTO_WWA)if(a)this._bottomButtonType!==h.GOTO_WWA&&_t(F[b.GOTO_WWA]).classList.remove("onpress"),this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case h.GOTO_WWA:this._yesNoChoiceCallInfo=P.CALL_BY_GOTO_WWA,this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0);break;case h.GAME_END:this._yesNoChoiceCallInfo=P.CALL_BY_END_GAME,this.setMessageQueue("WWAゲームを終了しますか?",!0,!0);break;case h.BATTLE_REPORT:this.launchBattleEstimateWindow()}},a.prototype.onpasswordloadcalled=function(){this._usePassword?(_t(F[b.QUICK_LOAD]).classList.add("onpress"),this.setMessageQueue("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_PASSWORD_LOAD):this.setMessageQueue("セーブデータがありません。",!1,!0)},a.prototype.onpasswordsavecalled=function(){_t(F[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_SUSPEND):this._usePassword&&(this.setMessageQueue("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_PASSWORD_SAVE)},a.prototype.onpasssuspendsavecalled=function(){_t(F[b.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=P.CALL_BY_SUSPEND)},a.prototype.onitemmenucalled=function(){this.setMessageQueue("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(H.DECISION),this._itemMenu.openView()},a.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){var e,a;if(e=t===R.UP?this._player.speedUp():this._player.speedDown(),a="移動速度を【"+J[e]+"】に切り替えました。\n"+(this.isBattleSpeedIndexForQuickBattle(e)?"戦闘も速くなります。\n":"")+"("+(Q.MAX_SPEED_INDEX+1)+"段階中"+(e+1)+")",this.userDevice.os===C.NINTENDO)a+="速度を落とすには-ボタン, 速度を上げるには+ボタンを押してください。";else a+="速度を落とすにはIキー, 速度を上げるにはPキーを押してください。";this.setMessageQueue(a,!1,!0)}else this.setMessageQueue("ここでは移動速度を\n変更できません。",!1,!0)},a.prototype.isBattleSpeedIndexForQuickBattle=function(t){return Q.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},a.prototype._main=function(){var a,i=this;if(this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._gamePadStore.update(),this._waitFrame-- >0)window.requestAnimationFrame(this.mainCaller);else{this._waitFrame=0,void 0!==this._yesNoJudgeInNextFrame&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&(this.clearFaces(),this._clearFacesInNextFrame=!1);for(var r=0;r<this._execMacroListInNextFrame.length;r++)("outside-ifelse"===this._conditionalMacroExecStatus||"can-execute"===this._conditionalMacroExecStatus||this._execMacroListInNextFrame[r].isJunction())&&this._execMacroListInNextFrame[r].execute();this.resetConditionalMacroExecStaus(),this._lastMessage.isEmpty()&&this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),this._execMacroListInNextFrame=[],this._player.mainFrameCount();this._player.getPosition();var n=this._player.getDir();if(this._player.isControllable())this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(P.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame()?this._player.updateDelayFrame():this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(e.KEY_LEFT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_UP)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_RIGHT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_DOWN)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===s.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(D[n])?this._checkTurnKeyPressed()?this._player.setDir(n):(this._player.controll(n),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(o.BUTTON_INDEX_B)?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(e.KEY_1)===t.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(e.KEY_2)===t.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(e.KEY_3)===t.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(e.KEY_Q)===t.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(e.KEY_W)===t.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(e.KEY_E)===t.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(e.KEY_A)===t.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(e.KEY_S)===t.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(e.KEY_D)===t.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(e.KEY_Z)===t.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(e.KEY_X)===t.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(e.KEY_C)===t.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(e.KEY_I)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_MINUS)?this.onchangespeed(R.DOWN):this._keyStore.checkHitKey(e.KEY_P)||this._keyStore.checkHitKey(e.KEY_F2)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_PLUS)?this.onchangespeed(R.UP):this._keyStore.getKeyState(e.KEY_F1)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_M)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(e.KEY_F3)?(this.playSound(H.DECISION),this.onselectbutton(b.QUICK_LOAD,!0)):this._keyStore.checkHitKey(e.KEY_F4)?(this.playSound(H.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(e.KEY_F5)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZR)?this.onselectbutton(b.QUICK_LOAD):this._keyStore.checkHitKey(e.KEY_F6)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_ZL)?this.onselectbutton(b.QUICK_SAVE):this._keyStore.checkHitKey(e.KEY_F7)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_R)?this.onselectbutton(b.RESTART_GAME):this._keyStore.checkHitKey(e.KEY_F8)?this.onselectbutton(b.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(e.KEY_F9)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_X)?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():this._keyStore.checkHitKey(e.KEY_V)?this._displayUserVars():(this._keyStore.checkHitKey(e.KEY_F12)||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_Y))&&this._displayHelp()),this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame();else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update();else if(this._player.isWaitingMessage()){if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===g.UNSELECTED&&(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A)?this._yesNoJudge=g.YES:(this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B))&&(this._yesNoJudge=g.NO)),(this._yesNoJudge===g.YES||this._yesNoJudge===g.NO)&&(this.playSound(H.DECISION),this._yesNoDispCounter=Q.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A))this._setNextMessage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(u.LEFT)||this._mouseStore.checkClickMouse(u.UP)||this._mouseStore.checkClickMouse(u.RIGHT)||this._mouseStore.checkClickMouse(u.DOWN)||this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_B)){for(r=0;r<F.length;r++){(l=_t(F[r])).classList.contains("onpress")&&l.classList.remove("onpress")}this._itemMenu.ng(),this._setNextMessage(),this.playSound(H.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var _=this._keyStore.getKeyStateForMessageCheck(e.KEY_ENTER),c=this._keyStore.getKeyStateForMessageCheck(e.KEY_SPACE),h=this._keyStore.getKeyStateForMessageCheck(e.KEY_ESC);if(_===t.KEYDOWN||_===t.KEYPRESS_MESSAGECHANGE||c===t.KEYDOWN||c===t.KEYPRESS_MESSAGECHANGE||h===t.KEYDOWN||h===t.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===s.MOUSEDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_B)){for(r=0;r<F.length;r++){var l;(l=_t(F[r])).classList.contains("onpress")&&l.classList.remove("onpress")}this._setNextMessage()}}if(null===(a=this._inlineUserVarViewer)||void 0===a?void 0:a.isVisible){var p=!1;this._keyStore.getKeyState(e.KEY_DOWN)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex++,p=!0),this._keyStore.getKeyState(e.KEY_UP)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex--,p=!0),this._keyStore.getKeyState(e.KEY_RIGHT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex+=Q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,p=!0),this._keyStore.getKeyState(e.KEY_LEFT)===t.KEYDOWN&&(this._inlineUserVarViewer.topUserVarIndex-=Q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM,p=!0),this._inlineUserVarViewer.topUserVarIndex<0&&(this._inlineUserVarViewer.topUserVarIndex+=Q.USER_VAR_NUM),this._inlineUserVarViewer.topUserVarIndex>Q.USER_VAR_NUM&&(this._inlineUserVarViewer.topUserVarIndex-=Q.USER_VAR_NUM),p&&(this._setNextMessage(),this._inlineUserVarViewer.isVisible=!0,this._displayUserVars()),this._keyStore.getKeyState(e.KEY_V)===t.KEYDOWN&&this._setNextMessage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN||this._gamePadStore.buttonTrigger(o.BUTTON_INDEX_A,o.BUTTON_INDEX_B))&&this.hideBattleEstimateWindow():this._player.isFighting()?(this._player.fight(),this._monsterWindow.update(this._monster)):this._player.isWaitingMoveMacro()&&(this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update());if(this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!(this._player.isJumped()||this._player.isWaitingMessage()||this._player.isWatingEstimateWindow()||this._player.isWaitingMoveMacro()||this._player.isFighting())){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var d=this.checkMap();d||this.checkObject(),this._prevFrameEventExected=d}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==g.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.PASSWORD,this._player.clearPasswordWindowWaiting(),this._passwordLoadExecInNextFrame=!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,this._player.isWaitingMessage()&&this._isClassicModeEnable||(this._animationCounter=(this._animationCounter+1)%(2*Q.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&_t("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&_t("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&_t("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&_t("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){i._loadType===L.QUICK_LOAD?(i._quickLoad(),i.wwaCustomEvent("wwa_quickload")):i._loadType===L.RESTART_GAME?(i._restartGame(),i.wwaCustomEvent("wwa_restert")):i._loadType===L.PASSWORD&&(i._applyQuickLoad(i._passwordSaveExtractData),i._passwordSaveExtractData=void 0,i.wwaCustomEvent("wwa_passwordload")),setTimeout(i.mainCaller,Q.DEFAULT_FRAME_INTERVAL,i)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(r=0;r<Q.USER_VAR_NUM;r++){var E=r.toString(10);this._dumpElement.querySelector(".var".concat(E)).textContent=this._wwaData.userVar[r]+""}}},a.prototype.vibration=function(t){this._gamePadStore.vibration(t)},a.prototype._drawAll=function(){var t,e,a=this._camera.getPosition().getPartsCoord(),s=this._camera.getPosition().getOffsetCoord(),i=Q.MAP_WINDOW_HEIGHT,r=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var o=this._camera.getPreviousPosition().getPartsCoord(),n=this._camera.getPreviousPosition().getOffsetCoord();i=this._camera.getTransitionStepNum()*Q.CHIP_SIZE}var _=!1;if(i!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=i,_=!0),a.x===this._cgManager.cpPartsLog.x&&a.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=a.x,this._cgManager.cpPartsLog.y=a.y,_=!0),_&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(o,n,i,!0),this._drawPlayer(o,n,i,!0),this._drawObjects(o,n,i,!0),this._camera.isFinalStep()))var c=255,h=setInterval((function(){var t=_t("wwa-fader");if((c-=3*Q.FADEOUT_SPEED)<=0)return clearInterval(h),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=c/255+""}),20);this._drawMap(a,s,i,!1,_),this._drawPlayer(a,s,i),this._drawObjects(a,s,i,!1,_),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(t=this._player.isTurn()?this._monster.position.x:r.x,e=this._player.isTurn()?this._monster.position.y:r.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,Q.CHIP_SIZE*(t-a.x)-s.x,Q.CHIP_SIZE*(e-a.y)-s.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},a.prototype._drawMap=function(t,e,a,s,i){if(void 0===s&&(s=!1),void 0===i&&(i=!1),void 0!==t){var r,o=Math.max(0,t.x-1),n=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),c=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW);if(r=0,s)for(var h=o;h<=n;h++)for(var u=_;u<=c;u++){var l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(h-t.x)-e.x,f=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,E,f,a)}else{for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h];this._cgManager.mapCache[r]!==l&&(this._cgManager.mapCache[r]=l,i=!0),r++}if(i){this._cgManager.clearBackCanvasWithLowerYLimit(a);for(h=o;h<=n;h++)for(u=_;u<=c;u++){l=this._wwaData.map[u][h],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(h-t.x)-e.x,f=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,f,a)}}this._cgManager.drawBackCanvas()}}},a.prototype._drawPlayer=function(t,e,a,s){if(void 0===s&&(s=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var i,r=this._player.getPosition().getPartsCoord(),o=this._player.getPosition().getOffsetCoord(),n=O[this._player.getDir()],_=(r.x-t.x)*Q.CHIP_SIZE+o.x-e.x,c=(r.y-t.y)*Q.CHIP_SIZE+o.y-e.y;Math.abs(o.x),Math.abs(o.y),this._player.getDir();i=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+n+1:this._wwaData.playerImgPosX+n,s?this._cgManager.drawCanvasWithLowerYLimit(i,this._wwaData.playerImgPosY,_,c,a):this._cgManager.drawCanvasWithUpperYLimit(i,this._wwaData.playerImgPosY,_,c,a)}},a.prototype._drawObjects=function(t,e,a,s,i){if(void 0===s&&(s=!1),void 0===i&&(i=!1),void 0!==t){var r,o,n,_,c,h,u,l,p,d,E,y,w,g,A=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),I=Math.max(0,t.y-1),v=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),T=0,O=this._animationCounter>Q.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(s)for(d=A;d<=S;d++)for(E=I;E<=v;E++)D&&new f(d,E).equals(this._monster.position)||(y=this._wwaData.mapObject[E][d],r=new f(0,0),this._wwaData.objectAttribute[y][Q.ATR_MOVE]!==x.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(r=p),c=Q.CHIP_SIZE*(d-t.x)+r.x-e.x,h=Q.CHIP_SIZE*(E-t.y)+r.y-e.y,o=O||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][o?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][o?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],0===y||this._checkNoDrawObject(new f(d,E),u,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(O?1:0,n,_,c,h,a));else{var C,M,N,P,b,R=[],L=[];for(d=A;d<=S;d++)for(E=I;E<=v;E++)w=y=this._wwaData.mapObject[E][d],u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],this._checkNoDrawObject(new f(d,E),u,l)&&(w=0),M=this._wwaData.objectAttribute[y][Q.ATR_MOVE]===x.STATIC,0!==w&&(N=!(!D||!new f(d,E).equals(this._monster.position)),M?L.push(new m(y,d,E,M,N)):(R.push(new m(y,d,E,M,N)),w=0),N&&(w=0)),this._cgManager.mapObjectCache[T]!==w&&(this._cgManager.mapObjectCache[T]=w,i=!0),T++;for(i&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(a),Array.prototype.push.apply(R,L)),b=R.length,P=0;P<b;P++)if(d=(C=R[P]).x,E=C.y,y=C.partsIDObj,M=C.isStatic,N=C.isFighting,c=Q.CHIP_SIZE*(d-t.x)-e.x,h=Q.CHIP_SIZE*(E-t.y)-e.y,M){if(N)continue;for(g=0;g<2;g++)o=!!g||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][o?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][o?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,c,h,a)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new f(d,E)))&&(c+=p.x,h+=p.y),o=O||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][o?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][o?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,c,h,a);this._cgManager.drawObjectCanvas(O?1:0)}}},a.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},a.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},a.prototype._drawFrame=function(){this._cgManager.drawFrame()},a.prototype._checkNoDrawObject=function(t,e,a){var s=this._player.getPosition(),i=s.getPartsCoord();return!(!s.isJustPosition()||i.x!==t.x||i.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===Q.OBJECT_DOOR&&0===a||(e===Q.OBJECT_STATUS||e===Q.OBJECT_MESSAGE||e===Q.OBJECT_ITEM||e===Q.OBJECT_SELL||e===Q.OBJECT_BUY||e===Q.OBJECT_SELL||e===Q.OBJECT_LOCALGATE))},a.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},a.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},a.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},a.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[a][Q.ATR_TYPE]},a.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),a=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[a][Q.ATR_TYPE]},a.prototype.getMapAttributeByPosition=function(t,e){var a=t.getPartsCoord(),s=this._wwaData.map[a.y][a.x];return this._wwaData.mapAttribute[s][e]},a.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,Q.ATR_STRING)},a.prototype.getObjectAttributeByPosition=function(t,e){var a=t.getPartsCoord(),s=this._wwaData.mapObject[a.y][a.x];return this._wwaData.objectAttribute[s][e]},a.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},a.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},a.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_X]},a.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_Y]},a.prototype.getMessageById=function(t){return this._wwaData.message[t]},a.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},a.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.map[t.y][t.x],s=this._wwaData.mapAttribute[a][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y,r=!1;return(!i||this._player.getLastExecPartsIDOnSamePosition(I.MAP)!==a)&&(s===Q.MAP_STREET?r=this._execMapStreetEvent(t,a,s):s===Q.MAP_WALL?r=this._execMapWallEvent(t,a,s):s===Q.MAP_LOCALGATE?r=this._execMapLocalGateEvent(t,a,s):s===Q.MAP_URLGATE&&(r=this._execMapUrlGateEvent(t,a,s)),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.MAP,a),r)},a.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var a=this._wwaData.mapObject[t.y][t.x],s=this._wwaData.objectAttribute[a][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y;i&&this._player.getLastExecPartsIDOnSamePosition(I.OBJECT)===a||(s===Q.OBJECT_NORMAL?this._execObjectNormalEvent(t,a,s):s===Q.OBJECT_MESSAGE?this._execObjectMessageEvent(t,a,s):s===Q.OBJECT_MONSTER?this._execObjectMonsterEvent(t,a,s):s===Q.OBJECT_ITEM?this._execObjectItemEvent(t,a,s):s===Q.OBJECT_DOOR?this._execObjectDoorEvent(t,a,s):s===Q.OBJECT_STATUS?this._execObjectStatusEvent(t,a,s):s===Q.OBJECT_BUY?this._execObjectBuyEvent(t,a,s):s===Q.OBJECT_SELL?this._execObjectSellEvent(t,a,s):s===Q.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,a,s):s===Q.OBJECT_SCORE?this._execObjectScoreEvent(t,a,s):s===Q.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,a,s):s===Q.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,a,s),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.OBJECT,a))},a.prototype._execMapStreetEvent=function(t,e,a){var s=this._wwaData.mapAttribute[e][Q.ATR_ITEM];if(0!==s&&!this._player.hasItem(s))return!1;this.appearParts(t,A.MAP);var i=this._wwaData.mapAttribute[e][Q.ATR_STRING],r=this._wwaData.message[i];this._waitFrame+=this._wwaData.mapAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0;var o=this.setMessageQueue(r,!1,!1,e,I.MAP,t.clone());return this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),0!==i&&o},a.prototype._execMapWallEvent=function(t,e,a){var s=this.getObjectIdByPosition(t.convertIntoPosition(this)),i=this.getObjectAttributeById(s,Q.ATR_TYPE);if(0===s||i===Q.OBJECT_NORMAL||i===Q.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(s,Q.ATR_ITEM))||this.getObjectAttributeById(i,Q.ATR_MODE)===Q.PASSABLE_OBJECT)){this.appearParts(t,A.MAP);var r=this._wwaData.mapAttribute[e][Q.ATR_STRING],o=this._wwaData.message[r];return this.setMessageQueue(o,!1,!1,e,I.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!1}return!1},a.prototype._execMapLocalGateEvent=function(t,e,a){var s=this._player.getPosition().getPartsCoord(),i=this._wwaData.mapAttribute[e][Q.ATR_JUMP_X],r=this._wwaData.mapAttribute[e][Q.ATR_JUMP_Y];return i>Q.RELATIVE_COORD_LOWER&&(i=t.x+i-Q.RELATIVE_COORD_BIAS),r>Q.RELATIVE_COORD_LOWER&&(r=t.y+r-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.MAP),0<=i&&0<=r&&i<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(i!==s.x||r!==s.y)&&(this._player.jumpTo(new y(this,i,r,0,0)),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!0)},a.prototype._execMapUrlGateEvent=function(t,e,a){var s=this._wwaData.mapAttribute[e][Q.ATR_STRING];return!this._isURLGateEnable||("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[s].split(/\s/g)[0],!0):void(location.href=pt(this._wwaData.message[s].split(/\s/g)[0])))},a.prototype._execObjectNormalEvent=function(t,e,a){},a.prototype._execObjectMessageEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord(),o=this._wwaData.objectAttribute[e][Q.ATR_SOUND];t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.appearParts(t,A.OBJECT,e),this.playSound(o)},a.prototype._execObjectStatusEvent=function(t,e,a){var s=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),i=this._wwaData.objectAttribute[e][Q.ATR_STRING],r=this._wwaData.message[i],o=this._player.getStatusWithoutEquipments();if(s.strength>Q.STATUS_MINUS_BORDER&&o.strength<s.strength-Q.STATUS_MINUS_BORDER||s.defence>Q.STATUS_MINUS_BORDER&&o.defence<s.defence-Q.STATUS_MINUS_BORDER||s.gold>Q.STATUS_MINUS_BORDER&&o.gold<s.gold-Q.STATUS_MINUS_BORDER)return this.setPartsOnPosition(I.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();s.energy=s.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.energy:s.energy,s.strength=s.strength>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.strength:s.strength,s.defence=s.defence>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.defence:s.defence,s.gold=s.gold>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-s.gold:s.gold,this._player.addStatusAll(s),this.setStatusChangedEffect(s),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][Q.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1})?this.gameover():(this.setMessageQueue(r,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},a.prototype._execObjectMonsterEvent=function(t,e,a){var s=this,i=new f(this._wwaData.objectAttribute[e][Q.ATR_X],this._wwaData.objectAttribute[e][Q.ATR_Y]),r=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),o=this._wwaData.message[this._wwaData.objectAttribute[e][Q.ATR_STRING]],n=this._wwaData.objectAttribute[e][Q.ATR_ITEM];this._monster=new St(e,t,i,r,o,n,(function(){s._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},a.prototype._execObjectBuyEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectSellEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectItemEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s];try{var r=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),o=(t.x-r.x)*Q.CHIP_SIZE,n=(t.y-r.y)*Q.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][Q.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(o,n),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0),this.setPartsOnPosition(I.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][Q.ATR_MODE]||(this.setMessageQueue(i,!1,!1,e,I.OBJECT,t.clone()),this.appearParts(t,A.OBJECT,e))}catch(t){"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this.setMessageQueue(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!1,!0)}this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectDoorEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_ITEM],i=this._wwaData.objectAttribute[e][Q.ATR_STRING],r=this._wwaData.message[i];this._player.hasItem(s)&&(0===this._wwaData.objectAttribute[e][Q.ATR_MODE]&&this._player.removeItemByPartsID(s),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]),this.setMessageQueue(r,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this._paintSkipByDoorOpen=!0)},a.prototype._execObjectYesNoChoiceEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[s],r=this._player.getPosition().getPartsCoord();t.x!==r.x||t.y!==r.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype._execObjectLocalGateEvent=function(t,e,a){var s=this._player.getPosition().getPartsCoord();t.x!==s.x||t.y!==s.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t);var i=this._wwaData.objectAttribute[e][Q.ATR_JUMP_X],r=this._wwaData.objectAttribute[e][Q.ATR_JUMP_Y];i>Q.RELATIVE_COORD_LOWER&&(i=s.x+i-Q.RELATIVE_COORD_BIAS),r>Q.RELATIVE_COORD_LOWER&&(r=s.y+r-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.OBJECT,e),0<=i&&0<=r&&i<this._wwaData.mapWidth&&r<this._wwaData.mapWidth&&(i!==s.x||r!==s.y)&&(this._player.jumpTo(new y(this,i,r,0,0)),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},a.prototype._execObjectUrlGateEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING];this._isURLGateEnable&&("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=P.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[s].split(/\s/g)[0]):location.href=pt(this._wwaData.message[s].split(/\s/g)[0]))},a.prototype._execObjectScoreEvent=function(t,e,a){var s=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=0===s?"スコアを表示します。":this._wwaData.message[s];this.getMessageQueueByRawMessage(i,e,I.OBJECT,t).reduce((function(t,e){return t||!e.isEmpty()}),!1)&&(this._scoreRates={energy:this._wwaData.objectAttribute[e][Q.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][Q.ATR_GOLD]},this.updateScore(),this._scoreWindow.show()),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},a.prototype.updateScore=function(){if(this._scoreRates){var t=this._player.getStatus().calculateScore(this._scoreRates);this._scoreWindow.update(t)}},a.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===g.YES){if(this._yesNoChoiceCallInfo===P.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.MAP_URLGATE&&(location.href=pt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===P.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new E(0,0,0,e)),this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):"BLANK"!==this._wwaData.message[W.NO_ITEM]&&this._messageQueue.push(new Ot(""===this._wwaData.message[W.NO_ITEM]?"アイテムを持っていない。":this._wwaData.message[W.NO_ITEM],!0));else if(t===Q.OBJECT_SELL)if(this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]))if(this._player.canHaveMoreItems()||0===this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){var a=this._yesNoChoicePartsCoord,s=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),i=(a.x-s.x)*Q.CHIP_SIZE,r=(a.y-s.y)*Q.CHIP_SIZE;this._player.addItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM],0,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new f(i,r),itemBoxBackgroundImageCoord:new f(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0)}var o=new E(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]);this._player.getStatusWithoutEquipments();if(o.energy=o.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-o.energy:o.energy,this.setStatusChangedEffect(o),this._player.addStatusAll(o),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY]&&this.shouldApplyGameOver({isCalledByMacro:!1}))return void this.gameover();this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)}else"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this._messageQueue.push(new Ot(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!0));else"BLANK"!==this._wwaData.message[W.NO_MONEY]&&this._messageQueue.push(new Ot(""===this._wwaData.message[W.NO_MONEY]?"所持金がたりない。":this._wwaData.message[W.NO_MONEY],!0));else t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):t===Q.OBJECT_URLGATE&&(location.href=pt(this._yesNoURL));else this._yesNoChoiceCallInfo===P.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===P.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),_t(F[b.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=L.QUICK_LOAD)):this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),_t(F[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(P.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===P.CALL_BY_RESTART_GAME?(_t(F[b.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=L.RESTART_GAME):this._yesNoChoiceCallInfo===P.CALL_BY_END_GAME?(window.history.back(-1),_t(F[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===P.CALL_BY_GOTO_WWA?(location.href=pt(Q.WWA_HOME),_t(F[b.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_LOAD?(_t(F[b.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Wt.LOAD)):this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_SAVE?(_t(F[b.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(P.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Wt.SAVE)):this._yesNoChoiceCallInfo===P.CALL_BY_SUSPEND&&(_t(F[b.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(P.CALL_BY_SUSPEND));this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=P.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===g.NO){if(this._yesNoChoiceCallInfo===P.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE],Q.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===P.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY||t===Q.OBJECT_SELL||(t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):Q.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===P.CALL_BY_ITEM_USE){_t("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===P.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case P.NONE:_t(F[b.QUICK_LOAD]).classList.remove("onpress");break;case P.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=g.UNSELECTED,void this.onpasswordloadcalled();case P.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var n=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=g.UNSELECTED,n){case P.CALL_BY_PASSWORD_LOAD:this.setMessageQueue("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case P.NONE:this.setMessageQueue("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===P.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=g.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());_t(F[b.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===P.CALL_BY_RESTART_GAME)_t(F[b.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_END_GAME)_t(F[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_GOTO_WWA)_t(F[b.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_LOAD)_t(F[b.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_PASSWORD_SAVE)_t(F[b.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===P.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=g.UNSELECTED,void this.onpasswordsavecalled();_t(F[b.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=P.NONE,this._messageWindow.setYesNoChoice(!1)}},a.prototype.setMessageQueue=function(t,e,a,s,i,r,o){if(void 0===s&&(s=0),void 0===i&&(i=I.OBJECT),void 0===r&&(r=new f(0,0)),void 0===o&&(o=!1),this._messageQueue=this._messageQueue.concat(this.getMessageQueueByRawMessage(t,s,i,r)),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0!==this._messageQueue.length){for(var n=this._messageQueue.shift(),_=0;_<n.macro.length;_++)this._execMacroListInNextFrame.push(n.macro[_]);if(this._lastMessage=n,!n.isEmpty())return this._messageWindow.setParsedMessage(n),this._messageWindow.setYesNoChoice(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),a,this._player.getPosition(),this._camera.getPosition()),this._player.setMessageWaiting(),!0;0===this._messageQueue.length?this._hideMessageWindow(o):this._setNextMessage()}return!1},a.prototype.getMessageQueueByRawMessage=function(t,e,a,s,i){void 0===i&&(i=!1);var r=t.split(/\n\<c\>/i)[0].split(/\<c\>/i)[0].replace(/\n\<p\>\n/gi,"<P>").replace(/\n\<p\>/gi,"<P>").replace(/\<p\>\n/gi,"<P>").replace(/\<p\>/gi,"<P>").replace(/\/\/.*\n/gi,""),o=[];if(""!==r)for(var n=r.split(/\<p\>/gi),_=0;_<n.length;_++){for(var c=n[_].split("\n"),h=[],u=[],l=0;l<c.length;l++){var p=c[l].match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)(?:.*))/);if(null!==p&&p.length>=2){var d=Ct(this,e,a,s,p[1]);d.macroType===k.SHOW_STR?h.push(this._generateUserValString(d.macroArgs)):u.push(d)}else c[l].match(/^\$/)||h.push([c[l]])}var E=h.reduce((function(t,e,a){var s=0===a?[]:["\n"];return Ia(Ia(Ia([],t,!0),s,!0),e,!0)}),[]);o.push(new Ot(E,i,_===n.length-1,u))}return o},a.prototype.appearParts=function(t,e,a){var s;void 0===a&&(a=0);var i,r,o,n,_,c=e===A.CHOICE_NO?Q.APPERANCE_PARTS_MIN_INDEX_NO:Q.APPERANCE_PARTS_MIN_INDEX,h=e===A.CHOICE_YES?Q.APPERANCE_PARTS_MAX_INDEX_YES:Q.APPERANCE_PARTS_MAX_INDEX;for(e===A.MAP?(a=0===a?this._wwaData.map[t.y][t.x]:a,s=I.MAP):(a=0===a?this._wwaData.mapObject[t.y][t.x]:a,s=I.OBJECT),_=c;_<=h;_++){var u=Q.ATR_APPERANCE_BASE+_*Q.REL_ATR_APPERANCE_UNIT_LENGTH,l=u+Q.REL_ATR_APPERANCE_ID,p=u+Q.REL_ATR_APPERANCE_X,d=u+Q.REL_ATR_APPERANCE_Y,E=u+Q.REL_ATR_APPERANCE_TYPE;if(i=s===I.MAP?this._wwaData.mapAttribute[a][l]:this._wwaData.objectAttribute[a][l],r=s===I.MAP?this._wwaData.mapAttribute[a][E]:this._wwaData.objectAttribute[a][E],o=s===I.MAP?this._wwaData.mapAttribute[a][p]:this._wwaData.objectAttribute[a][p],n=s===I.MAP?this._wwaData.mapAttribute[a][d]:this._wwaData.objectAttribute[a][d],o===Q.PLAYER_COORD?(o=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):o>Q.RELATIVE_COORD_LOWER&&(o=t.x+o-Q.RELATIVE_COORD_BIAS),n===Q.PLAYER_COORD?(n=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):n>Q.RELATIVE_COORD_LOWER&&(n=t.y+n-Q.RELATIVE_COORD_BIAS),0!==o||0!==n)try{if(new y(this,o,n,0,0),r===I.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var w=new f(o,n);this.setPartsOnPosition(I.MAP,i,w)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");w=new f(o,n);this.setPartsOnPosition(I.OBJECT,i,w),this._replaceRandomObject(new f(o,n)),o===this._player.getPosition().getPartsCoord().x&&n===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},a.prototype.appearPartsByDirection=function(t,e,a){var s=this._player.getPosition().getPartsCoord(),i=this._player.getDir(),r=v[i],o=T[i];this.appearPartsEval(s,(r>=0?"+":"-")+Math.abs(r)*t,(o>=0?"+":"-")+Math.abs(o)*t,e,a)},a.prototype.appearPartsEval=function(t,e,a,s,i){var r,o,n=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)r=n.x;else if("+"===e[0])r=t.x+parseInt(e.substr(1));else if("-"===e[0])r=t.x-parseInt(e.substr(1));else if(r=parseInt(e),isNaN(r))throw new Error("座標として解釈できない文字が含まれています。");if("P"===a||"p"===a)o=n.y;else if("+"===a[0])o=t.y+parseInt(a.substr(1));else if("-"===a[0])o=t.y-parseInt(a.substr(1));else if(o=parseInt(a),isNaN(o))throw new Error("座標として解釈できない文字が含まれています。");try{new y(this,r,o,0,0);if(i===I.MAP){if(s>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new f(r,o);this.setPartsOnPosition(I.MAP,s,_)}else{if(s>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new f(r,o);this.setPartsOnPosition(I.OBJECT,s,_),this._replaceRandomObject(new f(r,o)),r===this._player.getPosition().getPartsCoord().x&&o===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},a.prototype._replaceRandomObject=function(t){var e,a,s=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[s][Q.ATR_TYPE]===Q.OBJECT_RANDOM){for(var i=0;i<Q.RANDOM_ITERATION_MAX;i++){if(a=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[s][Q.ATR_RANDOM_BASE+a])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM)break;s=e}this.setPartsOnPosition(I.OBJECT,e,t)}},a.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),a=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),s=Math.max(0,t.y-1),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),r=e;r<=a;r++)for(var o=s;o<i;o++)this._replaceRandomObject(new f(r,o))},a.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new f(t,e))},a.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._yesNoJudge=g.UNSELECTED,this._messageQueue=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=P.NONE,this._player.clearMessageWaiting(),this._messageWindow.clear(),this._messageWindow.setYesNoChoice(!1),this._waitFrame=0,this._temporaryInputDisable=!0,this._execMacroListInNextFrame=[],this._player.jumpTo(new y(this,t,e,0,0))},a.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},a.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},a.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(_t("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(_t("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof E&&(0!==t.energy&&(_t("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(_t("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=Q.STATUS_CHANGED_EFFECT_FRAME_NUM)))},a.prototype.setPartsOnPosition=function(t,e,a){var s,i,r=a.y<<it.BITSHIFT|a.x;t===I.MAP?(s=this._wwaData.map[a.y][a.x],e=this.loadMapPartsID(e),s=this.loadMapPartsID(s),this._wwaData.map[a.y][a.x]=e,-1!==(i=this._mapIDTable[s].indexOf(r))&&this._mapIDTable[s].splice(i,1),-1===(i=this._mapIDTable[e].indexOf(r))&&this._mapIDTable[e].push(r)):(s=this._wwaData.mapObject[a.y][a.x],e=this.loadMapPartsObjectID(e),s=this.loadMapPartsObjectID(s),this._wwaData.mapObject[a.y][a.x]=e,-1!==(i=this._mapObjectIDTable[s].indexOf(r))&&this._mapObjectIDTable[s].splice(i,1),-1===(i=this._mapObjectIDTable[e].indexOf(r))&&this._mapObjectIDTable[e].push(r))},a.prototype._countSamePartsLength=function(t,e){var a;for(a=e+1;a<t.length&&t[a]===t[a-1];a++);return a-e},a.prototype._compressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[];for(var s=0;s<t[a].length;){var i=this._countSamePartsLength(t[a],s);e[a].push([t[a][s],i]),s+=i}}return e},a.prototype._decompressMap=function(t){for(var e=[],a=0;a<t.length;a++){e[a]=[],0;for(var s=0;s<t[a].length;s++)for(var i=t[a][s][1],r=0;r<i;r++)e[a].push(t[a][s][0])}return e},a.prototype._generateMapDataHash=function(t){var e="A",a=0,s=0,i=0;for(i=0;i<t.map.length;i++){for(s=0;s<t.map[i].length;)a=this._countSamePartsLength(t.map[i],s),e+=t.map[i][s]+"|"+a+"/",s+=a;for(s=0;s<t.mapObject[i].length;)a=this._countSamePartsLength(t.mapObject[i],s),e+=t.mapObject[i][s]+"|"+a+"/",s+=a}for(var r=0;r<t.mapAttribute.length;r++)for(var o=0;o<t.mapAttribute[r].length;o++)e+=t.mapAttribute[r][o]+"/";for(var n=0;n<t.objectAttribute.length;n++)for(var _=0;_<t.objectAttribute[n].length;_++)e+=t.objectAttribute[n][_]+"/";return jt(e+="Z")},a.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),a=[];for(var s in t)"map"!==s&&"mapObject"!==s&&"mapCompressed"!==s&&"mapObjectCompressed"!==s&&"mapAttribute"!==s&&"objectAttribute"!==s&&"checkString"!==s&&a.push(s);a.sort();for(var i=0;i<a.length;i++)e+=dt(t[a[i]]);return jt(e)},a.prototype.compressSystem=function(){return $t},a.prototype._quickSave=function(t){var e,a,s=JSON.parse(JSON.stringify(this._wwaData)),i=this._player.getPosition().getPartsCoord(),r=this._player.getStatusWithoutEquipments();switch(s.itemBox=this._player.getCopyOfItemBox(),s.playerX=i.x,s.playerY=i.y,s.statusEnergyMax=this._player.getEnergyMax(),s.statusEnergy=r.energy,s.statusStrength=r.strength,s.statusDefence=r.defence,s.statusGold=r.gold,s.moves=this._player.getMoveCount(),s.frameCount=this._player.getFrameCount(),s.gameSpeedIndex=this._player.getSpeedIndex(),t){case P.CALL_BY_LOG_QUICK_SAVE:case P.CALL_BY_QUICK_SAVE:case P.CALL_BY_SUSPEND:break;case P.CALL_BY_PASSWORD_SAVE:s.checkOriginalMapString=this.checkOriginalMapString,s.checkString=this._generateSaveDataHash(s)}switch(s.message=void 0,s.mapAttribute=void 0,s.objectAttribute=void 0,t){case P.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,s),this.wwaCustomEvent("wwa_quicksave",{data:s}),"";case P.CALL_BY_PASSWORD_SAVE:var o=$t.compress(s);o.isCompress=1;var n=JSON.stringify(o);return this.wwaCustomEvent("wwa_passwordsave",{data:s,compress:o}),e=n,a=this._wwaData.worldPassNumber,console.warn(Ht.enc.Utf8.parse(e)),Ht.AES.encrypt(Ht.enc.Utf8.parse(e),Kt(a)).toString();case P.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:s,compress:$t.compress(s)});break;case P.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:s}),this._wwaSave.autoSave(this._cvs,s)}},a.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},a.prototype._decodePassword=function(t){var e,a,s,i="",r=void 0;try{e=t,a=this._wwaData.worldPassNumber,i=Ht.AES.decrypt(e,Kt(a)).toString(Ht.enc.Utf8)}catch(t){r=t}if(!i){console.warn("新方式でのパスワード暗号化解除失敗:",r);try{i=function(t,e,a){return Ht.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,a)).toString(Ht.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){r=t}}if(!i){console.warn("旧方式でのパスワード暗号化解除失敗:",r);var o=r&&r.message?r.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+o)}try{s=JSON.parse(i)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}if(s.isCompress){delete s.isCompress;var n=$t.decompress(s),_=n[0],c=n[1];return[_e(_),c]}return[s,{isWorldNameEmpty:!1}]},a.prototype._quickLoad=function(t,e,a){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===a&&(a=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var s,i=!1;if(null!==e){var r=this._decodePassword(e);s=r[0],i=r[1].isWorldNameEmpty}else s=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(s.message=JSON.parse(JSON.stringify(this._restartData.message)),s.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),s.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===s.map&&(s.map=this._decompressMap(s.mapCompressed)),void 0===s.mapObject&&(s.mapObject=this._decompressMap(s.mapObjectCompressed)),delete s.mapCompressed,delete s.mapObjectCompressed,null!==e){if(!i&&s.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(s.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var o=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&s.checkOriginalMapString!==o)throw console.error("Invalid hash","(password)=".concat(s.checkOriginalMapString," (current map)=").concat(o)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return a&&this._applyQuickLoad(s),s},a.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new y(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(H.NO_SOUND):this.playSound(t.bgm),this.setImgClick(new f(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(V.ENERGY,new f(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(V.STRENGTH,new f(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(V.DEFENCE,new f(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(V.GOLD,new f(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new f(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new f(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},a.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var a=0;a<this._wwaData.mapWidth;a++){var s=a<<it.BITSHIFT|e;t=this._wwaData.map[a][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(s),t=this._wwaData.mapObject[a][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(s)}},a.prototype._restartGame=function(){this._quickLoad(!0)},a.prototype._fadeout=function(t){var e=0,a=Q.MAP_WINDOW_WIDTH,s=Q.FADEOUT_SPEED,i=_t("wwa-fader");i.style.display="block";var r=setInterval((function(){if(e+=s,(a-=2*s)<=0||2*e>Q.MAP_WINDOW_WIDTH)return i.removeAttribute("style"),i.style.display="block",i.style.borderWidth="0",i.style.width=Q.MAP_WINDOW_WIDTH+"px",i.style.height=Q.MAP_WINDOW_HEIGHT+"px",i.style.backgroundColor="#808080",clearInterval(r),void t();i.style.width=a+"px",i.style.height=a+"px",i.style.borderWidth=e+"px"}),20)},a.prototype.moveObjects=function(t){var e,a,s,i=this._camera.getPosition(),r=(this._player.getPosition(),i.getPartsCoord(),i.getPartsCoord().x),o=i.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.OBJECT_LOCALGATE){for(e=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),s=-1;s<=Q.V_PARTS_NUM_IN_WINDOW;s++)for(e[s+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),this.hoge[s+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),a=-1;a<=Q.H_PARTS_NUM_IN_WINDOW;a++)if(o+s<0||o+s>=this._wwaData.mapWidth||r+a<0||r+a>=this._wwaData.mapWidth)e[s+1][a+1]=0,this.hoge[s+1][a+1]=0;else{try{var n=(_=new y(this,r+a,o+s,0,0)).getPartsCoord()}catch(t){e[s+1][a+1]=0,this.hoge[s+1][a+1]=0;continue}this._wwaData.mapObject[n.y][n.x];e[s+1][a+1]=this._wwaData.mapObject[n.y][n.x],this.hoge[s+1][a+1]=-this._wwaData.mapObject[n.y][n.x]}for(a=-1;a<=Q.H_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth))for(s=-1;s<=Q.V_PARTS_NUM_IN_WINDOW;s++)if(!(o+s<0||o+s>=this._wwaData.mapWidth)){try{var _;n=(_=new y(this,r+a,o+s,0,0)).getPartsCoord()}catch(t){continue}var c=this._wwaData.mapObject[n.y][n.x];if(0!==c&&this._wwaData.objectAttribute[c][Q.ATR_MOVE]!==x.STATIC&&this._wwaData.objectAttribute[c][Q.ATR_TYPE]!==Q.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[c][Q.ATR_TYPE]!==Q.OBJECT_RANDOM&&(this._wwaData.objectAttribute[c][Q.ATR_MOVE]===x.CHASE_PLAYER||this._wwaData.objectAttribute[c][Q.ATR_MOVE]===x.RUN_OUT||this._wwaData.objectAttribute[c][Q.ATR_MOVE]===x.HANG_AROUND)){var h=this._wwaData.objectAttribute[c][Q.ATR_MOVE];if(h!==x.HANG_AROUND){var u,l=this._getCandidateCoord(t,_,h),p=new f(l.x,n.y),d=new f(n.x,l.y),E=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(n,l,r,o,e,c);else{var w=this._getSecondCandidateMoveMode(t,n,l,p,d,this._wwaData.objectAttribute[c][Q.ATR_TYPE]===Q.OBJECT_MONSTER,e);w===B.MODE_X?this._setObjectsInNextFrame(n,p,r,o,e,c):w===B.MODE_Y?this._setObjectsInNextFrame(n,d,r,o,e,c):null===(E=this._getThirdCandidate(t,_,l,h,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)):this._setObjectsInNextFrame(n,E,r,o,e,c)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,r,o,e,c)}}}},a.prototype._getCandidateCoord=function(t,e,a){var s=e.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var i=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch(t){throw new Error("予期せぬ方向への移動のようです。")}var r=s.clone(),o=0,n=0;return a===x.CHASE_PLAYER?(o=s.x>i.x?-1:s.x<i.x?1:0,n=s.y>i.y?-1:s.y<i.y?1:0):a===x.RUN_OUT&&(o=s.x>i.x?1:s.x<i.x?-1:0,n=s.y>i.y?1:s.y<i.y?-1:0),r.x+=o,r.y+=n,r.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.x)),r.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,r.y)),r},a.prototype._getSecondCandidateMoveMode=function(t,e,a,s,i,r,o){return!t||(this._player.getDir()!==u.UP&&this._player.getDir()!==u.DOWN||!r)&&(this._player.getDir()!==u.LEFT&&this._player.getDir()!==u.RIGHT||r)?this._objectCanMoveTo(t,s,o)?B.MODE_X:this._objectCanMoveTo(t,i,o)?B.MODE_Y:B.UNDECIDED:this._objectCanMoveTo(t,i,o)?B.MODE_Y:this._objectCanMoveTo(t,s,o)?B.MODE_X:B.UNDECIDED},a.prototype._getThirdCandidate=function(t,e,a,s,i){var r,o=s===x.CHASE_PLAYER?1:s===x.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(r=new f(a.x,_.y+1*o),this._objectCanMoveTo(t,r,i))return r;if(r=new f(a.x,_.y-1*o),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x,_.y+1*o),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x,_.y-1*o),this._objectCanMoveTo(t,r,i))return r}if(n.y!==_.y){if(r=new f(_.x+1*o,a.y),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x-1*o,a.y),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x+1*o,_.y),this._objectCanMoveTo(t,r,i))return r;if(r=new f(_.x-1*o,_.y),this._objectCanMoveTo(t,r,i))return r}return null},a.prototype._getRandomMoveCoord=function(t,e,a){for(var s=e.getPartsCoord(),i=s.clone(),r=this._wwaData.isOldMove?Q.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:Q.RANDOM_MOVE_ITERATION_NUM,o=0;o<r;o++){var n=Math.floor(8*Math.random());if(i.x=s.x+v[n],i.y=s.y+T[n],this._objectCanMoveTo(t,i,a))return i}return s},a.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},a.prototype._objectCanMoveTo=function(t,e,a){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var s=this._wwaData.map[e.y][e.x],i=this._wwaData.mapObject[e.y][e.x],r=this._wwaData.mapAttribute[s][Q.ATR_TYPE],o=this._camera.getPosition(),n=o.getPartsCoord().x,_=o.getPartsCoord().y;if(0===s&&!this.isOldMap()||r===Q.MAP_WALL)return!1;var c=e.x-n+1,h=e.y-_+1;if(0<=c&&0<=h&&c<a.length&&h<a.length){if(0!==a[h][c])return!1}else if(0!==i)return!1;if(t){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(e))return!1}else if(this._player.getPosition().getPartsCoord().equals(e))return!1;return!0},a.prototype._setObjectsInNextFrame=function(t,e,a,s,i,r){var o=e.x-a+1,n=e.y-s+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=o&&o<i.length&&0<=n&&n<i.length&&(i[t.y-s+1][t.x-a+1]=0,i[e.y-s+1][e.x-a+1]=r,this.hoge[e.y-s+1][e.x-a+1]=r),this._objectMovingDataManager.add(r,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},a.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),a=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW-1),s=Math.max(0,t.y),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW-1),r=[];this.playSound(H.DECISION);for(var o=e;o<=a;o++)for(var n=s;n<=i;n++){var _=this._wwaData.mapObject[n][o];this._wwaData.objectAttribute[_][Q.ATR_TYPE]===Q.OBJECT_MONSTER&&-1===r.indexOf(_)&&r.push(_)}return this._bottomButtonType===h.BATTLE_REPORT&&_t(F[b.GOTO_WWA]).classList.add("onpress"),0===r.length?(_t(F[b.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),r),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},a.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),_t(F[b.GOTO_WWA]).classList.remove("onpress")},a.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Wt.SAVE)this._player.clearPasswordWindowWaiting();else{try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e}},a.prototype._displayUserVars=function(){if(this._canDisplayUserVars&&this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!0,this._player.isControllable())){this.setNowPlayTime();var t="変数一覧\n";this._userVarNameListRequestError&&("noFileSpecified"===this._userVarNameListRequestError.kind?t+=this._userVarNameListRequestError.errorMessage+"\n":(t+="【変数名取得失敗】\n",t+=" すべての変数を名無しとしています。\n",t+=" エラー詳細: ".concat(this._userVarNameListRequestError.errorMessage,"\n")));for(var e=0;e<Q.INLINE_USER_VAR_VIEWER_DISPLAY_NUM;e++){var a=(this._inlineUserVarViewer.topUserVarIndex+e)%Q.USER_VAR_NUM,s=this._userVarNameList&&this._userVarNameList[a]?this._userVarNameList[a]:"名無し",i="変数 ".concat(a,": ").concat(s);t+="".concat(i,": ").concat(this._wwaData.userVar[a],"\n")}t+="\n操作方法\n",t+="上キー:1つ戻す 下キー:1つ進める\n",t+="左キー:10つ戻す 右キー:10つ進める\n",this.setMessageQueue(t,!1,!0)}},a.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case M.GAME:switch(this.userDevice.os){case C.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.9.3\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.PLAY_STATION:t=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.9.3\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.XBOX:t=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n 現在の移動回数:"+this._player.getMoveCount()+"\n プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.9.3\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case M.SP:case M.VR:return;case M.PC:t=" 【操作方法】\nF1、M:戦闘結果予測の表示\nF3:復帰用パスワード入力\nF4:復帰用パスワード表示\nF5:一時保存データの読み込み\nF6:データの一時保存\nF7:初めからスタート\nF8:WWA公式ページにリンク\nF12:このリストの表示\nキーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。\n「Enter、Y」はYes,\n「Esc、N」はNoに対応。\n I: 移動速度を落とす/\nF2、P: 移動速度を上げる\n 現在の移動回数:"+this._player.getMoveCount()+"\n プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.9.3\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.setMessageQueue(t,!1,!0)}},a.prototype._setNextMessage=function(t){if(void 0===t&&(t=!1),this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&(this._scoreWindow.hide(),this._scoreRates=void 0),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._messageQueue.length)this._hideMessageWindow();else{var e=this._messageQueue.shift(),a=e.macro;this._lastMessage=e;for(var s=0;s<a.length;s++)this._execMacroListInNextFrame.push(a[s]);e.isEmpty()?0===this._messageQueue.length?this._hideMessageWindow():this._setNextMessage():(this._player.setDelayFrame(),this._messageWindow.hide(),this._messageWindow.setParsedMessage(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),t,this._player.getPosition(),this._camera.getPosition()),this._messageWindow.show(),this._player.setMessageWaiting())}this._inlineUserVarViewer&&(this._inlineUserVarViewer.isVisible=!1)},a.prototype._hideMessageWindow=function(t){void 0===t&&(t=!0);var e=0;this._player.isReadyToUseItem()&&(e=this._player.useItem());var a=this.getObjectAttributeById(e,Q.ATR_STRING);this.clearFaces(),0===a?(t&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting()):this.setMessageQueue(this.getMessageById(a),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord(),!0)},a.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},a.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},a.prototype.replaceParts=function(t,e,a,s){void 0===a&&(a=I.OBJECT),void 0===s&&(s=!1);var i,r,o,n,_,c,h,u,l=this._camera.getPosition().getPartsCoord(),p=s?Math.max(0,l.x):0,d=s?Math.min(this._wwaData.mapWidth-1,l.x+Q.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,E=s?Math.max(0,l.y):0,f=s?Math.min(this._wwaData.mapWidth-1,l.y+Q.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(s=0!==p||d!==this._wwaData.mapWidth-1||0!==E||f!==this._wwaData.mapWidth-1,a===I.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),n=this._mapObjectIDTable[t].concat(),(h=this._mapObjectIDTable[t]).length=0,u=this._mapObjectIDTable[e],r=n.length,s)for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.mapObject[c][_]=e,u.push(i)):h.push(i);else{for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.mapObject[c][_]=e;Array.prototype.push.apply(u,n)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),n=this._mapIDTable[t].concat(),(h=this._mapIDTable[t]).length=0,u=this._mapIDTable[e],r=n.length,s)for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=c&&c<=f?(this._wwaData.map[c][_]=e,u.push(i)):h.push(i);else{for(o=0;o<r;o++)_=(i=n[o])&it.BITMASK,c=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.map[c][_]=e;Array.prototype.push.apply(u,n)}},a.prototype.getYesNoImgCoord=function(){return new f(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},a.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},a.prototype.getPlayerImgCoord=function(){return new f(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},a.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},a.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},a.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},a.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},a.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},a.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},a.prototype.isOldMap=function(){return this._wwaData.isOldMap},a.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},a.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},a.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},a.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},a.prototype.setPlayerStatus=function(t,e,a){if(t===G.ENERGY)this._player.setEnergy(e),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:a})&&this.gameover();else if(t===G.STRENGTH)this._player.setStrength(this.toValidStatusValue(e));else if(t===G.DEFENCE)this._player.setDefence(this.toValidStatusValue(e));else if(t===G.GOLD)this._player.setGold(this.toValidStatusValue(e));else{if(t!==G.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(this.toValidStatusValue(e))}},a.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},a.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},a.prototype.setStatusIconCoord=function(t,e){var a=e.x*Q.CHIP_SIZE,s=e.y*Q.CHIP_SIZE,i=function(t){ht("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(a,"px -").concat(s,"px")};switch(t){case V.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,i("#disp-energy");break;case V.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,i("#disp-strength");break;case V.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,i("#disp-defence");break;case V.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,i("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},a.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*Q.CHIP_SIZE,a=t.y*Q.CHIP_SIZE;return Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+a+"px"})),t.clone()},a.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},a.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},a.prototype.canInput=function(){return!this._temporaryInputDisable},a.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},a.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},a.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},a.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new f(0,0)))Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(a){a.style.backgroundImage="url('"+e+"')",a.style.backgroundPosition="-"+t.x*Q.CHIP_SIZE+"px -"+t.y*Q.CHIP_SIZE+"px"}))}},a.prototype.addFace=function(t){this._faces.push(t),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),!1,this._player.getPosition(),this._camera.getPosition())},a.prototype.clearFaces=function(){this._faces=[]},a.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},a.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},a.prototype.setGameOverPolicy=function(t){switch(t){case 0:return void(this._wwaData.gameOverPolicy="default");case 1:return void(this._wwaData.gameOverPolicy="never");case 2:return void(this._wwaData.gameOverPolicy="except-macro");default:return}},a.prototype.initCSSRule=function(){this._styleElm=_t(Q.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},a.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",a=this._isClassicModeEnable?1:.9,s="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(a,");\nborder-color: rgba(").concat(this._wwaData.frameOutColorR,", ").concat(this._wwaData.frameOutColorG,", ").concat(this._wwaData.frameOutColorB,", 1);\ncolor: rgba(").concat(this._wwaData.fontColorR,", ").concat(this._wwaData.fontColorG,", ").concat(this._wwaData.fontColorB,", 1);\nwhite-space: pre-wrap;\n"),i="div#wwa-sidebar",r="\ncolor: rgba(".concat(this._wwaData.statusColorR,", ").concat(this._wwaData.statusColorG,", ").concat(this._wwaData.statusColorB,",1);\nfont-weight: bold;\n");void 0!==this._sheet.addRule?(this._stylePos[st.MESSAGE_WINDOW]=this._sheet.addRule(e,s),this._stylePos[st.SIDEBAR]=this._sheet.addRule(i,r)):(this._stylePos[st.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(s," }"),0),this._stylePos[st.SIDEBAR]=this._sheet.insertRule("".concat(i," { ").concat(r," }"),1))},a.prototype.changeStyleRule=function(t,e,a,s){t===at.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=a,this._wwaData.frameColorB=s):t===at.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=a,this._wwaData.frameOutColorB=s):t===at.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=a,this._wwaData.fontColorB=s):t===at.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=a,this._wwaData.statusColorB=s),this.updateCSSRule()},a.prototype.showMonsterWindow=function(){this._monsterWindow.show()},a.prototype.isClassicMode=function(){return this._isClassicModeEnable},a.prototype.isConsoleOutputMode=function(){return this._useConsole},a.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new y(this,t,e,0,0))},a.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(Q.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},a.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),a=Math.max(Math.min(e,Q.USER_VAR_NUM_MAX_VALUE),Q.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(a)?0:a},a.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<Q.USER_VAR_NUM&&(0|t)===t},a.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},a.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},a.prototype.recUserPosition=function(t,e){var a=this._player.getPosition().getPartsCoord();this.setUserVar(t,a.x),this.setUserVar(e,a.y)},a.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},a.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},a.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},a.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},a.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},a.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},a.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},a.prototype.setHPUserVar=function(t,e){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:e})&&this.gameover(),this._player.updateStatusValueBox()},a.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},a.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},a.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},a.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},a.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},a.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},a.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},a.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},a.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===this._wwaData.userVar[e]?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},a.prototype.setUserValRandNum=function(t,e,a){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+a)},a.prototype._generateUserValString=function(t){var e=this;return t.map((function(t){var a=parseInt(t,10);return isNaN(a)?t.replace(/\\n/g,"\n"):function(){return e._wwaData.userVar[a]}}))},a.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},a.prototype.switchConditionalExecutionStatus=function(t){if(void 0===t&&(t=""),"can-execute"!==this._conditionalMacroExecStatus)if("outside-ifelse"!==this._conditionalMacroExecStatus&&"cannot-execute"!==this._conditionalMacroExecStatus);else{var e=""===t||function(t,e){var a=ma(t).match(da);if(null===a||a.length<=3)return console.error("判定式が異常です: ".concat(t)),!1;var s=fa(a[1],e),i=fa(a[3],e);return function(t,e,a){switch(t){case">":return e>a;case"<":return e<a;case">=":return e>=a;case"<=":return e<=a;case"==":return e===a;case"!=":return e!==a;default:return!1}}(a[2],s,i)}(t,this._generateTokenValues());this._conditionalMacroExecStatus=e?"can-execute":"cannot-execute"}else this._conditionalMacroExecStatus="executed"},a.prototype.execSetMacro=function(t){void 0===t&&(t="");var e=function(t,e){var a=ma(t),s=a.match(la);if(null!==s){var i=fa(s[2],e),r=fa(s[4],e);return wa(ya(s[3],i,r),s[1])}var o=a.match(pa);if(null!==o)return i=fa(o[1],e),r=fa(o[3],e),wa(ya(o[2],i,r),o[1]);throw new Error("setMacroのフォーマットを満たしていません: "+t)}(t,this._generateTokenValues()),a=e.assignee,s=e.rawValue;switch(a){case"energy":this._player.setEnergy(this.toValidStatusValue(s)),this._player.isDead()&&this.shouldApplyGameOver({isCalledByMacro:!0})&&this.gameover();break;case"energyMax":this._player.setEnergyMax(this.toValidStatusValue(s));break;case"strength":this._player.setStrength(this.toValidStatusValue(s));break;case"defence":this._player.setDefence(this.toValidStatusValue(s));break;case"gold":this._player.setGold(this.toValidStatusValue(s));break;default:if(isNaN(a)||!this.isValidUserVarIndex(a))throw new Error("ユーザ変数の添字が範囲外です。");this.setUserVar(a,this.toAssignableValue(s))}this._player.updateStatusValueBox()},a.prototype._generateTokenValues=function(){return this.setNowPlayTime(),{totalStatus:this._player.getStatus(),bareStatus:this._player.getStatusWithoutEquipments(),itemStatus:this._player.getStatusOfEquipments(),energyMax:this._player.getEnergyMax(),moveCount:this._player.getMoveCount(),playTime:this._wwaData.playTime,userVars:this._wwaData.userVar,playerCoord:this._player.getPosition().getPartsCoord()}},a.prototype.resetConditionalMacroExecStaus=function(){this._conditionalMacroExecStatus="outside-ifelse"},a.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var a=parseInt(e[0],10),s=parseInt(e[2],10);if(!this.isValidUserVarIndex(a)||!this.isValidUserVarIndex(s))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var i=this._wwaData.userVar[a],r=e[1],o=this._wwaData.userVar[s],n=function(t){return parseInt(t,10)?I.MAP:I.OBJECT};if(this.compareUserVar(i,r,o)){var _=parseInt(e[3],10),c=e[4],h=e[5],u=n(e[6]);this.appearPartsEval(t,c,h,_,u)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],E=n(e[10]);this.appearPartsEval(t,p,d,l,E)}},a.prototype.compareUserVar=function(t,e,a){switch(e){case"==":return t===a;case"!=":return t!==a;case">=":return t>=a;case">":return t>a;case"<=":return t<=a;case"<":return t<a;default:throw new Error("未定義の演算子です: ".concat(e))}},a.prototype.setPlayerSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},a.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},a.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},a.prototype.hideStatus=function(t,e){if(t<0||t>Z.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(Z[t],!e),this._player.updateStatusValueBox()},a.prototype.varMap=function(t,e,a,s,i){if(!this.isValidUserVarIndex(s))throw new Error("対象のユーザ変数の添字が範囲外です");var r=this._wwaData.userVar[s];if(r<0)throw new Error("負のパーツ番号は指定できません");if(i===I.OBJECT&&r>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(i===I.MAP&&r>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,a,r,i)},a.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(ut("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*Q.CHIP_SIZE,"px -").concat(t.y*Q.CHIP_SIZE,"px")}))},a.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,a,s;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(a=this._wwaData.gamePadButtonItemTable[e]){switch(s=!1,e){case o.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_LEFT)&&(s=!0);break;case o.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_RIGHT)&&(s=!0);break;case o.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_UP)&&(s=!0);break;case o.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(o.BUTTON_CROSS_KEY_DOWN)&&(s=!0)}if(this._gamePadStore.buttonTrigger(e)&&(s=!0),s&&this.onselectitem(a))return!0}return!1},a.prototype.setGamePadButtonItemTable=function(t,e){var a,s;if(!this._wwaData.gamePadButtonItemTable)for(s in this._wwaData.gamePadButtonItemTable=[],o)a=s,this._wwaData.gamePadButtonItemTable[a]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},a.prototype._checkSaveDataCompatibility=function(t,e,a){return void 0!==t&&t!==this._wwaData.worldName?ye.UNMATCHED_WORLD_NAME:a&&a!==fe(this._wwaData.worldName,this._wwaData.worldPassNumber)?ye.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?ye.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},a.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},a.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},a.prototype._updateVarDumpInformationArea=function(t,e){if(void 0===e&&(e=!1),this._dumpElement){var a=this._dumpElement.querySelector(".varlist-information");a&&(a.textContent="".concat(e?"【エラー】":"").concat(t))}},a.prototype.shouldApplyGameOver=function(t){return t.isCalledByMacro?"default"===this._wwaData.gameOverPolicy:"default"===this._wwaData.gameOverPolicy||"except-macro"===this._wwaData.gameOverPolicy},a}(),Oa=!1;function Da(){if(navigator.userAgent.match(/(?:msie|trident)/i)||navigator.userAgent.match(/edge/i))alert("このゲームをプレイするには、Google Chrome や Mozilla Firefox などの最新のブラウザでこのページを開いてください。\nご利用の環境のサポートは、既に終了しています。");else{Array.prototype.forEach.call(ut("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){Oa=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(Oa)return Oa=!1,t.returnValue=e,e}));var t=_t("wwa-wrapper").getAttribute("data-wwa-title-img");Gt(_t("wwa-wrapper"),t);var e=_t("wwa-wrapper").getAttribute("data-wwa-mapdata"),a=_t("wwa-wrapper").getAttribute("data-wwa-audio-dir"),s=_t("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),i=null,r="true"===_t("wwa-wrapper").getAttribute("data-wwa-display-user-vars"),o=_t("wwa-wrapper").getAttribute("data-wwa-user-var-names-file");_t("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&r&&(i=function(t){var e=ct(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var a=document.createElement("table"),s=document.createElement("tr"),i=document.createElement("th"),r=document.createElement("button"),o=document.createElement("td");r.textContent="隠す",i.textContent="変数一覧",i.setAttribute("colspan","10"),i.classList.add("varlist-header"),i.appendChild(r),s.appendChild(i),o.setAttribute("colspan","10"),o.classList.add("varlist-information"),o.textContent="強調されている番号にカーソルを乗せると説明が表示されます。",a.appendChild(s),a.appendChild(o);for(var n=null,_=null,c=0;c<Q.USER_VAR_NUM;c++){c%10==0&&(null!==n&&(a.appendChild(n),a.appendChild(_)),(n=document.createElement("tr")).classList.add("var-number"),(_=document.createElement("tr")).classList.add("var-val"));var h=document.createElement("th"),u=document.createElement("div");u.textContent="-",u.setAttribute("aria-hidden","true"),h.classList.add("var-index".concat(c));var l=document.createElement("td");h.textContent=c+"",h.appendChild(u),l.classList.add("var".concat(c)),l.textContent="-",n.appendChild(h),_.appendChild(l)}Q.USER_VAR_NUM%10!=0&&(a.appendChild(n),a.appendChild(_)),e.appendChild(a);var p=!0;return r.addEventListener("click",(function(t){p?(this.textContent="表示",o.style.display="none",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),p=!1):(this.textContent="隠す",o.style.display="",Array.prototype.forEach.call(a.querySelectorAll("tr.var-number"),(function(t){t.style.display=""})),Array.prototype.forEach.call(a.querySelectorAll("tr.var-val"),(function(t){t.style.display=""})),p=!0)})),e}(s));var n=!0;_t("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(n=!1);var _=_t("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),c=!1;null!==_&&_.match(/^true$/i)&&(c=!0);var h=!0,u=_t("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==u&&u.match(/^false$/i)&&(h=!1);var l=!1,p=_t("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==p&&p.match(/^true$/i)&&(l=!0);var d,E=!(null===(d=_t("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!d.match(/^true$/i));ga=new Ta(e,n,t,c,h,l,a,E,i,o,r)}}"complete"===document.readyState?setTimeout(Da):window.addEventListener("load",(function(){setTimeout(Da)}))}()}();
|