handler-playable-sdk 1.0.82 → 1.0.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConfigOverride-V7DLPL5I.js → ConfigOverride-XECG7H5B.js} +1 -1
- package/dist/chunk-EFRB44UC.js +1 -0
- package/dist/{chunk-PW2FGMCO.js → chunk-GVZ2445E.js} +1 -1
- package/dist/{chunk-HQ5ANFUZ.js → chunk-ZDXLQU2P.js} +190 -182
- package/dist/cli/brand-dna.mjs +1 -1
- package/dist/cli/canva-import.mjs +1 -1
- package/dist/cli/cleanup-assets.mjs +1 -1
- package/dist/cli/fix-scales.mjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/screen-helper.mjs +1 -1
- package/dist/cli/setup-library.mjs +1 -1
- package/dist/cli/student-helper/add-logic.mjs +1 -1
- package/dist/cli/student-helper/add-object.mjs +1 -1
- package/dist/cli/student-helper/arg-parsing.mjs +1 -1
- package/dist/cli/student-helper/asset-registry.mjs +1 -1
- package/dist/cli/student-helper/bullet-system.mjs +1 -1
- package/dist/cli/student-helper/collectable-system.mjs +1 -1
- package/dist/cli/student-helper/constants.mjs +1 -1
- package/dist/cli/student-helper/drag-snap-couples.mjs +1 -1
- package/dist/cli/student-helper/endgame-screen.mjs +1 -1
- package/dist/cli/student-helper/fs-io.mjs +1 -1
- package/dist/cli/student-helper/logic-defaults.mjs +1 -1
- package/dist/cli/student-helper/print-help.mjs +1 -1
- package/dist/cli/student-helper/prompts.mjs +1 -1
- package/dist/cli/student-helper/scratch-card.mjs +1 -1
- package/dist/cli/student-helper/screen-utils.mjs +1 -1
- package/dist/cli/student-helper/snippets.mjs +1 -1
- package/dist/cli/student-helper/start-screen.mjs +1 -1
- package/dist/cli/student-helper/swerve-collect.mjs +1 -1
- package/dist/cli/student-helper/tap-destroy.mjs +1 -1
- package/dist/cli/student-helper/template-packs.mjs +1 -1
- package/dist/cli/student-helper.mjs +1 -1
- package/dist/cli/sync-screens.mjs +1 -1
- package/dist/cli/validate-assets.mjs +1 -1
- package/dist/cli/validate.mjs +1 -1
- package/dist/{config-3JDCJ3GB.js → config-TFSKV7GO.js} +1 -1
- package/dist/index.cjs +229 -221
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +16 -16
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +13 -13
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-HVKF2KYL.js +0 -1
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a0_0x5884(){var _0x385502=['FSkiW57dSMi','rGldI3PiCSkLv8o9CWTVzG','WO4yymoMimkffmklemogFglcLSkJ','W5FdMvWoWONdQIO3dqW','WQpdQLyJdG','hCo3W5Lhp8kfBG','hxe1W6yca8k2','FW7cPSo+fW','gwFcKeVcMWzo','WQfIW7zszN/cVmkjW50OWQxdOCoz','nmkcD0ldVuldG1dcM0W','aSkqhSo9WOldSHlcQrSeW5m7iG','i27cIW','EqldPSoEW58','DCkLWOXPzq','WQldHmkgW5PiCmoVWPJdU8oRfCkxhW','W5tdKLWfW5pcHhqXoavlDrq','rLPCoCoOcvy','gY5zD14WqCo3','AHhcHCoMha','WOqDASoKjmkgxmouiSo1EfC','W5xcUs4MWRu','nSoIDq','W6hcPc7cOCkN','iYfDBSoBy2y','WPumvw81iSkVASobWRK','WO3cRSokq8k0wCkIWP8Srq','WROEAvBcSSo1ECoY','mmkpDuhcRtFcN3NcHM3dImoAtq','Amk6kJ1KfmkPC8oPWO3cKCklWPC','bshdMHJdOW','zZOEWQ/cMq','WRRdSmklr055W4dcI8kyErBdKmoo','h3T9tuajxa'];a0_0x5884=function(){return _0x385502;};return a0_0x5884();}(function(_0x2478f3,_0x574412){var a0_0x51cb73={_0x1ca943:0x550,_0x2d2578:0x552,_0x4c4dc5:0x556,_0x59fa73:'7WKc',_0x3b8dac:0x54a,_0x3ee905:0x54e,_0x5d7de5:0x55d,_0x219c28:'C)te',_0xd9ee12:0x559,_0x1b4b16:0x5be,_0xa57e0d:0x5c9,_0xb840f1:0x5c6,_0x2d0e40:0x5c4,_0x4c65b5:0x5a3,_0x1eb424:0x5ad,_0x33c127:'Iabj',_0x505471:0x531,_0x376558:0x542,_0xd62d2f:0x532,_0x3a9a41:'1G8%',_0x509f9e:0x537,_0x4d8fd7:0x5af,_0xafe4a8:0x5ba,_0x561bec:0x5bc,_0x9ac882:0x5c6,_0x5d93f4:0x5ab,_0x3fa98f:0x5b9,_0x44fc6f:'6g$H',_0x121d51:0x5b4,_0x361a60:'2T%O',_0x33351e:0x5ad,_0x33995e:0x5b4,_0x47aa25:0x5c7,_0x4bd1d5:'MSML',_0x3b7977:0x553,_0xb5c0db:0x566,_0x4480b8:'qlLK',_0x1d94fb:0x567,_0x5e42aa:0x5bc,_0x5f59c9:'Spy7',_0x3b290d:0x596,_0xff55cd:0x595,_0x3c3abf:0x57e},a0_0x26bf6={_0x2a56cd:0x391},a0_0x38d1dc={_0x1102a6:0x368},_0xc5e4f2=_0x2478f3();function _0x12a73f(_0x308d3a,_0x3975e0,_0xece3bb,_0x2cbc0e,_0x3b2eb9){return a0_0x1499(_0x2cbc0e-0x3d8,_0x3b2eb9);}function _0x534316(_0x5a39a3,_0x3e5a4f,_0x27b903,_0x396263,_0x4aef80){return a0_0x1499(_0x3e5a4f-a0_0x38d1dc._0x1102a6,_0x396263);}function _0x4e4db1(_0x21570a,_0x54599e,_0x951059,_0x2ee9c4,_0xbe7470){return a0_0x1499(_0x2ee9c4-a0_0x26bf6._0x2a56cd,_0x951059);}while(!![]){try{var _0x5041fc=parseInt(_0x534316(a0_0x51cb73._0x1ca943,a0_0x51cb73._0x2d2578,a0_0x51cb73._0x4c4dc5,a0_0x51cb73._0x59fa73,0x553))/(0x1ff*0x2+-0x19f5+-0x128*-0x13)*(-parseInt(_0x534316(a0_0x51cb73._0x3b8dac,a0_0x51cb73._0x3ee905,a0_0x51cb73._0x5d7de5,a0_0x51cb73._0x219c28,a0_0x51cb73._0xd9ee12))/(-0x915+0x2611+-0x1cfa))+parseInt(_0x12a73f(a0_0x51cb73._0x1b4b16,a0_0x51cb73._0xa57e0d,a0_0x51cb73._0xb840f1,a0_0x51cb73._0x2d0e40,'ud!W'))/(-0x86*0x16+-0x318+-0x13*-0xc5)*(-parseInt(_0x12a73f(0x5b7,a0_0x51cb73._0x4c65b5,a0_0x51cb73._0x1b4b16,a0_0x51cb73._0x1eb424,a0_0x51cb73._0x33c127))/(-0x15aa*-0x1+-0xe20+-0x786))+-parseInt(_0x534316(a0_0x51cb73._0x505471,a0_0x51cb73._0x376558,a0_0x51cb73._0xd62d2f,a0_0x51cb73._0x3a9a41,a0_0x51cb73._0x509f9e))/(0x146*0xd+-0x1891*-0x1+-0x291a*0x1)*(parseInt(_0x12a73f(a0_0x51cb73._0x4d8fd7,0x5c9,0x5c1,a0_0x51cb73._0xafe4a8,a0_0x51cb73._0x33c127))/(-0xa*0x337+0xecb*-0x1+-0xb*-0x445))+parseInt(_0x12a73f(a0_0x51cb73._0x561bec,a0_0x51cb73._0x9ac882,a0_0x51cb73._0x5d93f4,a0_0x51cb73._0x3fa98f,a0_0x51cb73._0x44fc6f))/(-0x2593*0x1+-0x1fc7+-0x1*-0x4561)*(parseInt(_0x12a73f(a0_0x51cb73._0x121d51,0x5c6,0x5bd,0x5bb,a0_0x51cb73._0x361a60))/(-0x1f0c+0x227*-0xd+-0x1*-0x3b0f))+-parseInt(_0x12a73f(a0_0x51cb73._0x33351e,a0_0x51cb73._0x33995e,a0_0x51cb73._0x47aa25,a0_0x51cb73._0x561bec,a0_0x51cb73._0x4bd1d5))/(-0x7d0+-0x2ac+0xa85)*(-parseInt(_0x534316(a0_0x51cb73._0x3b7977,0x55a,a0_0x51cb73._0xb5c0db,a0_0x51cb73._0x4480b8,a0_0x51cb73._0x1d94fb))/(0x241*0xb+0x17*0x2+-0x18ef))+-parseInt(_0x12a73f(0x5d3,a0_0x51cb73._0x5e42aa,0x5d7,0x5c7,a0_0x51cb73._0x5f59c9))/(-0x1bc0+0xdf*0x29+0x1*-0x7ec)+parseInt(_0x4e4db1(a0_0x51cb73._0x3b290d,a0_0x51cb73._0xff55cd,'C)te',0x587,a0_0x51cb73._0x3c3abf))/(0x668+-0x617+-0x45);if(_0x5041fc===_0x574412)break;else _0xc5e4f2['push'](_0xc5e4f2['shift']());}catch(_0x183bb4){_0xc5e4f2['push'](_0xc5e4f2['shift']());}}}(a0_0x5884,0xeb4a0+0xfdb4+-0x5a68f));var a0_0x33a8dc=(function(){var _0x389fe5=!![];return function(_0x271617,_0x4607bb){var a0_0x5796f7={_0x28aedc:0x597,_0x5370c1:0x584,_0xb7402:0x592},_0x20e170=_0x389fe5?function(){var a0_0x37e679={_0x379629:0x3b1};function _0x2e2425(_0x1b3ac0,_0x217d83,_0x257ff5,_0x39130c,_0x69c5c9){return a0_0x1499(_0x69c5c9-a0_0x37e679._0x379629,_0x39130c);}if(_0x4607bb){var _0x5390dc=_0x4607bb[_0x2e2425(a0_0x5796f7._0x28aedc,a0_0x5796f7._0x5370c1,a0_0x5796f7._0xb7402,'Qdke',0x58a)](_0x271617,arguments);return _0x4607bb=null,_0x5390dc;}}:function(){};return _0x389fe5=![],_0x20e170;};}()),a0_0x3029f9=a0_0x33a8dc(this,function(){var a0_0x184580={_0x4e4c2b:0x3d8,_0x29df51:'fWfX',_0x1be877:0x3d1,_0x107900:0x3df,_0x570399:'1G8%',_0x49d54d:0x3e4,_0x3127e6:0x3ce,_0x569d41:0x345,_0x49851d:0x330,_0x1274c4:0x33a,_0x310871:'Az(K',_0x13ce11:0x338,_0x8875d3:0x149,_0xf0396e:0x142,_0x3bbbb9:'Spy7',_0x17544f:0x14e,_0x1bd58f:0x3cf,_0x11bda1:'T*@A',_0x204ff6:0x3cb,_0x271a70:0x3c5,_0x2dd6ed:'J@ga',_0x5cf49a:0x3bd,_0x4b414e:0x14f,_0x135e52:0x159,_0x4472e7:'Qdke',_0x13b7a6:0x151,_0xcf937f:0x134,_0x3ccde8:0x13e,_0x3f1dba:'(1Dv',_0x37e3de:0x13a,_0x4f7d00:0x144,_0x1ee303:0x166,_0x25bd09:'Ti!t',_0x1fb43b:0x157,_0x419231:0x351,_0x2a4a4f:0x341,_0x1b43f3:'frJ8',_0x4979e3:0x345,_0x30601c:0x341,_0x58a5c7:0x32b,_0x5ca4a4:'(mZu'},a0_0x480276={_0x11089f:0x1ef},a0_0x5e8a51={_0x5dae5a:0x151};function _0xd4894d(_0x50bf70,_0x63cc0b,_0x1ab22a,_0x144261,_0x4f81ba){return a0_0x1499(_0x4f81ba-a0_0x5e8a51._0x5dae5a,_0x144261);}var _0x456734={};function _0x483e52(_0x490523,_0x424279,_0x23cbaf,_0xaf8b67,_0x468bdf){return a0_0x1499(_0x490523-a0_0x480276._0x11089f,_0x424279);}_0x456734[_0x483e52(a0_0x184580._0x4e4c2b,a0_0x184580._0x29df51,0x3cc,a0_0x184580._0x1be877,a0_0x184580._0x107900)]='(((.+'+_0x483e52(a0_0x184580._0x107900,a0_0x184580._0x570399,a0_0x184580._0x49d54d,a0_0x184580._0x107900,a0_0x184580._0x3127e6)+'+$';var _0x4d4fac=_0x456734;function _0x3041be(_0x40ac59,_0x11835c,_0x45d354,_0x276748,_0x1c676f){return a0_0x1499(_0x1c676f- -0x9a,_0x45d354);}return a0_0x3029f9[_0xd4894d(a0_0x184580._0x569d41,a0_0x184580._0x49851d,a0_0x184580._0x1274c4,a0_0x184580._0x310871,a0_0x184580._0x13ce11)+_0x3041be(a0_0x184580._0x8875d3,a0_0x184580._0xf0396e,a0_0x184580._0x3bbbb9,0x14b,a0_0x184580._0x17544f)]()[_0x483e52(a0_0x184580._0x1bd58f,a0_0x184580._0x11bda1,0x3e0,a0_0x184580._0x3127e6,a0_0x184580._0x204ff6)+'h'](_0x4d4fac[_0x483e52(a0_0x184580._0x271a70,a0_0x184580._0x2dd6ed,0x3c6,0x3c9,a0_0x184580._0x5cf49a)])[_0x3041be(a0_0x184580._0x4b414e,a0_0x184580._0x135e52,a0_0x184580._0x4472e7,a0_0x184580._0x13b7a6,0x14b)+_0x3041be(a0_0x184580._0xcf937f,a0_0x184580._0x3ccde8,a0_0x184580._0x3f1dba,a0_0x184580._0x37e3de,a0_0x184580._0x4f7d00)]()[_0x3041be(a0_0x184580._0x1ee303,0x157,a0_0x184580._0x25bd09,0x151,a0_0x184580._0x1fb43b)+'ructo'+'r'](a0_0x3029f9)[_0xd4894d(0x34e,a0_0x184580._0x419231,a0_0x184580._0x2a4a4f,a0_0x184580._0x1b43f3,a0_0x184580._0x4979e3)+'h'](_0x4d4fac[_0xd4894d(a0_0x184580._0x30601c,a0_0x184580._0x58a5c7,a0_0x184580._0x1274c4,a0_0x184580._0x5ca4a4,a0_0x184580._0x49851d)]);});a0_0x3029f9();import{A as a0_0x3fad99,B as a0_0x34554f,C as a0_0x24443a,D as a0_0x52fe32,b as a0_0x2a637d,c as a0_0x1e9b28,d as a0_0x32c435,e as a0_0x7b343a,f as a0_0x3fd9d5,g as a0_0x46c1f1,h as a0_0x769512,i as a0_0x1c62ee,j as a0_0x11847a,k as a0_0x4d5886,l as a0_0xf28536,m as a0_0x439345,n as a0_0x4b526f,o as a0_0x752a84,p as a0_0x167db1,q as a0_0x910576,r as a0_0x106ffb,s as a0_0xd8251c,t as a0_0x3d5a0c,u as a0_0x5bb58e,v as a0_0x518222,w as a0_0x5e26fa,x as a0_0x475c27,y as a0_0x2d531e,z as a0_0x3a5ee3}from'../chunk-HQ5ANFUZ.js';import{a as a0_0x44264f,b as a0_0x1ec812,c as a0_0x4a1e0e,d as a0_0x47a0ba,e as a0_0xb99e72}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';function a0_0x1499(_0x2be941,_0x5e3294){_0x2be941=_0x2be941-(0xd18+0x1*-0x212c+-0x4f*-0x47);var _0x1347f1=a0_0x5884();var _0x2036a0=_0x1347f1[_0x2be941];if(a0_0x1499['vNAUZA']===undefined){var _0x39c75e=function(_0x505dd2){var _0x1c9a3e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x2d0bf4='',_0x43e43f='',_0x4daba0=_0x2d0bf4+_0x39c75e;for(var _0x51a769=0x1*-0x52f+0x1252+-0xd23,_0x4dc266,_0x3a3b4f,_0x465d70=-0x44*0x7+-0x4e*-0x19+0xb*-0x86;_0x3a3b4f=_0x505dd2['charAt'](_0x465d70++);~_0x3a3b4f&&(_0x4dc266=_0x51a769%(0xeed*-0x2+0x1*0x535+-0x18a9*-0x1)?_0x4dc266*(0x2126*-0x1+0x6*0x625+-0x378)+_0x3a3b4f:_0x3a3b4f,_0x51a769++%(0x1*0x10af+0x1edd*0x1+-0x2f88))?_0x2d0bf4+=_0x4daba0['charCodeAt'](_0x465d70+(0x855+0xb13*-0x1+0x2c8*0x1))-(0x683*0x2+-0x2622+-0xae*-0x25)!==-0x12a6+-0x1*0x124c+-0x24f2*-0x1?String['fromCharCode'](-0x2*0xe8a+-0x1*-0xd01+0x2e*0x5f&_0x4dc266>>(-(0x5*-0x464+0x14b*0x16+-0x67c)*_0x51a769&0x191a+0x7*-0x3e9+0x24b)):_0x51a769:0x1*-0x163b+-0x192f*0x1+0x2f6a){_0x3a3b4f=_0x1c9a3e['indexOf'](_0x3a3b4f);}for(var _0x4b6dec=0x1*0x1f92+0xbe7+-0x1f*0x167,_0x6849fc=_0x2d0bf4['length'];_0x4b6dec<_0x6849fc;_0x4b6dec++){_0x43e43f+='%'+('00'+_0x2d0bf4['charCodeAt'](_0x4b6dec)['toString'](0xe5f+-0x52*0x3a+0x1*0x445))['slice'](-(-0x95c+0x1ced+-0x138f*0x1));}return decodeURIComponent(_0x43e43f);};var _0x3529ef=function(_0x872ffc,_0x1da287){var _0x48ed3d=[],_0x1a9c3e=0xd3e+0x12e7+-0x2025,_0x30a26b,_0x5a17ac='';_0x872ffc=_0x39c75e(_0x872ffc);var _0x51057f;for(_0x51057f=0x65*-0x59+-0x1aa7+0x3dc4;_0x51057f<-0x1fa5+0x889*-0x3+0x3a40*0x1;_0x51057f++){_0x48ed3d[_0x51057f]=_0x51057f;}for(_0x51057f=0xf*0x14b+-0x1f0+0x6d*-0x29;_0x51057f<-0x1d91+-0x2*-0x3a9+0xb*0x21d;_0x51057f++){_0x1a9c3e=(_0x1a9c3e+_0x48ed3d[_0x51057f]+_0x1da287['charCodeAt'](_0x51057f%_0x1da287['length']))%(0x1845+0x968+-0x20ad),_0x30a26b=_0x48ed3d[_0x51057f],_0x48ed3d[_0x51057f]=_0x48ed3d[_0x1a9c3e],_0x48ed3d[_0x1a9c3e]=_0x30a26b;}_0x51057f=0x1756+0xe*0x257+0xa*-0x59c,_0x1a9c3e=0x238*0xb+-0x15*0x17+-0x1685;for(var _0x22ef94=-0xc97+-0x8ff+-0x399*-0x6;_0x22ef94<_0x872ffc['length'];_0x22ef94++){_0x51057f=(_0x51057f+(0x2573+-0x1*0x3d8+0x176*-0x17))%(-0x2107+0x7ff*0x1+-0x77*-0x38),_0x1a9c3e=(_0x1a9c3e+_0x48ed3d[_0x51057f])%(-0x24af*-0x1+-0xa39*0x3+-0x504),_0x30a26b=_0x48ed3d[_0x51057f],_0x48ed3d[_0x51057f]=_0x48ed3d[_0x1a9c3e],_0x48ed3d[_0x1a9c3e]=_0x30a26b,_0x5a17ac+=String['fromCharCode'](_0x872ffc['charCodeAt'](_0x22ef94)^_0x48ed3d[(_0x48ed3d[_0x51057f]+_0x48ed3d[_0x1a9c3e])%(-0x1*0x3bc+0x652*0x4+-0x41c*0x5)]);}return _0x5a17ac;};a0_0x1499['oHGEjQ']=_0x3529ef,a0_0x1499['LViWOg']={},a0_0x1499['vNAUZA']=!![];}var _0x1aac69=_0x1347f1[0x18a6*-0x1+-0xe1f+0x1*0x26c5],_0x4a21d4=_0x2be941+_0x1aac69,_0x1e7285=a0_0x1499['LViWOg'][_0x4a21d4];if(!_0x1e7285){if(a0_0x1499['Yyshnl']===undefined){var _0x1d476c=function(_0x8e7353){this['yMdhhI']=_0x8e7353,this['kiwBhh']=[-0x136*0xa+0x103f+-0x422,0x22e1*-0x1+0x93c+0x19a5,-0x2eb*-0x6+0x1169*-0x1+0x1*-0x19],this['HfutTd']=function(){return'newState';},this['lyDsUJ']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['AUNAhM']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x1d476c['prototype']['mBFsYa']=function(){var _0x3ac42b=new RegExp(this['lyDsUJ']+this['AUNAhM']),_0x56e7cd=_0x3ac42b['test'](this['HfutTd']['toString']())?--this['kiwBhh'][0x1aaf+-0x484+-0x162a]:--this['kiwBhh'][-0x114d*0x2+0xe12+0x3*0x6d8];return this['aHdvDf'](_0x56e7cd);},_0x1d476c['prototype']['aHdvDf']=function(_0x29d70e){if(!Boolean(~_0x29d70e))return _0x29d70e;return this['aDeLja'](this['yMdhhI']);},_0x1d476c['prototype']['aDeLja']=function(_0x51f47d){for(var _0x2888ca=-0x8a7*0x3+-0x3ee*-0x5+0x64f,_0x9cb671=this['kiwBhh']['length'];_0x2888ca<_0x9cb671;_0x2888ca++){this['kiwBhh']['push'](Math['round'](Math['random']())),_0x9cb671=this['kiwBhh']['length'];}return _0x51f47d(this['kiwBhh'][0x2611+-0x2582+-0x8f]);},new _0x1d476c(a0_0x1499)['mBFsYa'](),a0_0x1499['Yyshnl']=!![];}_0x2036a0=a0_0x1499['oHGEjQ'](_0x2036a0,_0x5e3294),a0_0x1499['LViWOg'][_0x4a21d4]=_0x2036a0;}else _0x2036a0=_0x1e7285;return _0x2036a0;}export{a0_0x44264f as AssetCache,a0_0x4a1e0e as AssetLoader,a0_0x5bb58e as AssetSystem,a0_0x47a0ba as AssetTextures,a0_0xd8251c as Assets,a0_0x752a84 as BaseSystem,a0_0x4b526f as GameEngine,a0_0x7b343a as GameObject,a0_0x3fd9d5 as GameObjectManager,a0_0x439345 as ObjectFactory,a0_0x32c435 as Renderer,a0_0x167db1 as RuntimeObjectRegistry,a0_0x1e9b28 as Transform,a0_0x34554f as applyScreenAnchor,a0_0x910576 as basePixi,a0_0x5e26fa as clearResponsiveElements,a0_0x2a637d as createPixiBase,a0_0x11847a as getRegisteredFontIds,a0_0x518222 as globalResponsiveMultipliers,a0_0xb99e72 as initAssetTextures,a0_0x3d5a0c as initAssets,a0_0x24443a as layout,a0_0xf28536 as playLottieOverlay,a0_0x1c62ee as registerFont,a0_0x1ec812 as registerType,a0_0x2d531e as resolveAnchorVec2,a0_0x46c1f1 as resolveFont,a0_0x769512 as resolveFontWeight,a0_0x3a5ee3 as resolveScreenAnchorPoint,a0_0x3fad99 as resolveScreenRatioPoint,a0_0x52fe32 as runInitSequence,a0_0x4d5886 as setLottieInstance,a0_0x106ffb as spawnSceneFromConfig,a0_0x475c27 as updateScreenState};
|
|
1
|
+
(function(_0x18e252,_0x39e1df){var a0_0x1e37f1={_0x32c750:0x348,_0x799690:0x341,_0x2143b3:0x343,_0x3bdd3c:0x347,_0x558adb:0x1c6,_0x300bd7:'H&6#',_0x19b2d0:0x1b8,_0x13e108:0x1bd,_0x1f2439:0x1c3,_0x4efa9b:0x29e,_0x2b9a41:0x29a,_0x123d78:'5a&Q',_0x34f0fc:0x2a3,_0xb2f057:0x299,_0x4eef1e:0x336,_0x42754f:0x325,_0x868144:0x328,_0x20ea58:0x330,_0x38700f:0x29d,_0x41f143:0x2ac,_0x1b797b:'nhWp',_0x3d9f34:0x2a4,_0x3c4364:0x2ae,_0x17cfa0:0x34f,_0x1af991:0x337,_0x23b86f:'!8&p',_0x1bd19e:0x346,_0x68b16d:0x28f,_0x316426:0x297,_0x46e847:'eiSm',_0x24495d:0x29b,_0x1c3a34:0x333,_0x10d1f8:0x341,_0x4d025f:0x334,_0x1b6581:'qqRg'},a0_0x35f140={_0x256a6b:0x2b9};function _0x85576b(_0x4686c6,_0x5da2b2,_0x2d93d4,_0x1678cd,_0x3abbc4){return a0_0x5dc7(_0x4686c6-0x144,_0x5da2b2);}function _0x19e090(_0x36845e,_0x36babb,_0x284d46,_0x287c63,_0x3f3642){return a0_0x5dc7(_0x287c63- -0x321,_0x284d46);}function _0x11aa9b(_0x358b87,_0x16663f,_0x68d0ff,_0x1d1af1,_0x38d545){return a0_0x5dc7(_0x68d0ff-a0_0x35f140._0x256a6b,_0x1d1af1);}var _0x57f560=_0x18e252();while(!![]){try{var _0x1c3ef0=parseInt(_0x11aa9b(a0_0x1e37f1._0x32c750,a0_0x1e37f1._0x799690,a0_0x1e37f1._0x2143b3,'7YpO',a0_0x1e37f1._0x3bdd3c))/(-0x145c+-0x1f7d+-0x33da*-0x1)+parseInt(_0x85576b(a0_0x1e37f1._0x558adb,a0_0x1e37f1._0x300bd7,a0_0x1e37f1._0x19b2d0,a0_0x1e37f1._0x13e108,a0_0x1e37f1._0x1f2439))/(0x25dd+0xe9d+-0x3478)+parseInt(_0x19e090(-a0_0x1e37f1._0x4efa9b,-a0_0x1e37f1._0x2b9a41,a0_0x1e37f1._0x123d78,-a0_0x1e37f1._0x34f0fc,-a0_0x1e37f1._0xb2f057))/(-0x2349+0xb5b+0x17f1)+-parseInt(_0x11aa9b(a0_0x1e37f1._0x4eef1e,a0_0x1e37f1._0x42754f,a0_0x1e37f1._0x868144,'w9$Y',a0_0x1e37f1._0x20ea58))/(-0xfb*0x1f+0x1*-0x1ed2+0x3d3b)+parseInt(_0x19e090(-a0_0x1e37f1._0x38700f,-a0_0x1e37f1._0x41f143,a0_0x1e37f1._0x1b797b,-a0_0x1e37f1._0x3d9f34,-a0_0x1e37f1._0x3c4364))/(0x1f6*-0x3+0x17cb*-0x1+0x1db2)+parseInt(_0x11aa9b(a0_0x1e37f1._0x17cfa0,a0_0x1e37f1._0x1af991,0x341,a0_0x1e37f1._0x23b86f,a0_0x1e37f1._0x1bd19e))/(-0x2*-0xe77+0x1851+-0x3539)*(-parseInt(_0x19e090(-a0_0x1e37f1._0x68b16d,-a0_0x1e37f1._0x316426,a0_0x1e37f1._0x46e847,-a0_0x1e37f1._0x24495d,-a0_0x1e37f1._0x2b9a41))/(-0x1ce2+0x4ec+-0x17*-0x10b))+parseInt(_0x11aa9b(a0_0x1e37f1._0x1af991,0x338,a0_0x1e37f1._0x1c3a34,'*ooN',0x341))/(-0x141f+-0x1d2*0x2+0x17cb)*(-parseInt(_0x11aa9b(a0_0x1e37f1._0x10d1f8,0x332,a0_0x1e37f1._0x4d025f,a0_0x1e37f1._0x1b6581,0x33c))/(-0x1e6f+-0x2658+-0x4*-0x1134));if(_0x1c3ef0===_0x39e1df)break;else _0x57f560['push'](_0x57f560['shift']());}catch(_0x29ac94){_0x57f560['push'](_0x57f560['shift']());}}}(a0_0x213d,0x16bd0+-0x42e4*0xa+0x2f286));var a0_0x5e9f52=(function(){var a0_0x52dc91={_0x38792f:0x439,_0x44be58:0x430,_0x1729f4:'Zo!v',_0x23a0f5:0x438,_0xb1bc77:0x433},_0xa640b0=!![];return function(_0x3e9f5e,_0x56cd65){var a0_0x170c35={_0x52215d:0x3b2},_0x4a2f85=_0xa640b0?function(){function _0x4c3fb2(_0x3afcb1,_0x341e86,_0x22cf6b,_0x14b0fd,_0x1ea753){return a0_0x5dc7(_0x3afcb1-a0_0x170c35._0x52215d,_0x22cf6b);}if(_0x56cd65){var _0x26732e=_0x56cd65[_0x4c3fb2(a0_0x52dc91._0x38792f,a0_0x52dc91._0x44be58,a0_0x52dc91._0x1729f4,a0_0x52dc91._0x23a0f5,a0_0x52dc91._0xb1bc77)](_0x3e9f5e,arguments);return _0x56cd65=null,_0x26732e;}}:function(){};return _0xa640b0=![],_0x4a2f85;};}()),a0_0x91dc23=a0_0x5e9f52(this,function(){var a0_0x53ad58={_0x1325e9:0x1d4,_0x1a4245:0x1d7,_0x15a7fa:0x1d5,_0x660949:'%^!V',_0x43d991:0x1be,_0x251883:0x1c4,_0xaa034a:0x1cc,_0x4af036:0x1c2,_0x423341:'UKmw',_0x54a95b:0x25b,_0x145363:0x255,_0x5f452a:0x255,_0x10c710:0x25c,_0x5eca58:0x1c6,_0x1073cd:0x1d3,_0x13daee:0x1db,_0x56d36a:0x1d4,_0x44c658:'j*4]',_0x4b5039:0x26d,_0x55ba63:'aG[J',_0x8a2e28:0x246,_0x4f9a9f:0x25e,_0x55ed8e:0x254,_0x4b5283:0x358,_0x188a00:0x349,_0x31c41e:0x357,_0x5ecbff:'[jly',_0x551075:0x359,_0x392626:0x35c,_0x560404:0x364,_0x5376df:'k[uR',_0x21f6aa:0x25c,_0x203352:0x256,_0x1b3680:0x25b,_0x5ada6:0x261,_0x32feac:'TY(a',_0x3fda20:0x36c},a0_0x1d845c={_0x16c207:0x2dd},a0_0x134e17={_0x53b784:0x2e1},_0x570cab={};_0x570cab[_0x536238(0x1e2,a0_0x53ad58._0x1325e9,a0_0x53ad58._0x1a4245,a0_0x53ad58._0x15a7fa,a0_0x53ad58._0x660949)]=_0x536238(a0_0x53ad58._0x43d991,a0_0x53ad58._0x251883,a0_0x53ad58._0xaa034a,a0_0x53ad58._0x4af036,'[jly')+_0x434906(a0_0x53ad58._0x423341,-a0_0x53ad58._0x54a95b,-a0_0x53ad58._0x145363,-a0_0x53ad58._0x5f452a,-a0_0x53ad58._0x10c710)+'+$';var _0x45d394=_0x570cab;function _0x536238(_0x3b4254,_0x173ff1,_0x5641a1,_0x49c4d1,_0x17c5a1){return a0_0x5dc7(_0x49c4d1-0x151,_0x17c5a1);}function _0x1ff1b4(_0x1910f8,_0x32d6be,_0x4ed3c9,_0x46e07c,_0x540c96){return a0_0x5dc7(_0x1910f8-a0_0x134e17._0x53b784,_0x32d6be);}function _0x434906(_0x3d752c,_0x2ef320,_0x364f91,_0x5701b7,_0x4659b0){return a0_0x5dc7(_0x4659b0- -a0_0x1d845c._0x16c207,_0x3d752c);}return a0_0x91dc23[_0x536238(a0_0x53ad58._0x5eca58,a0_0x53ad58._0x1073cd,a0_0x53ad58._0x13daee,a0_0x53ad58._0x56d36a,a0_0x53ad58._0x44c658)+_0x434906('w9$Y',-a0_0x53ad58._0x4b5039,-0x266,-a0_0x53ad58._0x54a95b,-0x265)]()[_0x434906(a0_0x53ad58._0x55ba63,-a0_0x53ad58._0x8a2e28,-0x249,-a0_0x53ad58._0x4f9a9f,-a0_0x53ad58._0x55ed8e)+'h'](_0x45d394['crAKO'])['toStr'+'ing']()[_0x1ff1b4(0x354,'EQV3',0x363,a0_0x53ad58._0x4b5283,a0_0x53ad58._0x188a00)+_0x1ff1b4(a0_0x53ad58._0x31c41e,a0_0x53ad58._0x5ecbff,a0_0x53ad58._0x551075,a0_0x53ad58._0x392626,a0_0x53ad58._0x560404)+'r'](a0_0x91dc23)[_0x434906(a0_0x53ad58._0x5376df,-a0_0x53ad58._0x21f6aa,-a0_0x53ad58._0x203352,-a0_0x53ad58._0x1b3680,-a0_0x53ad58._0x5ada6)+'h'](_0x45d394[_0x1ff1b4(0x360,a0_0x53ad58._0x32feac,0x35a,0x36c,a0_0x53ad58._0x3fda20)]);});a0_0x91dc23();import{A as a0_0x2bc7da,B as a0_0x1ed85a,C as a0_0xab7924,D as a0_0x4d8b24,b as a0_0x45543f,c as a0_0x3545e0,d as a0_0x46c7d2,e as a0_0x30df92,f as a0_0x494103,g as a0_0x4c233a,h as a0_0xf4ff24,i as a0_0x56c87b,j as a0_0x4ca8ee,k as a0_0x4ee532,l as a0_0x391b1c,m as a0_0x2a07d4,n as a0_0x391f30,o as a0_0x330dcc,p as a0_0x413f09,q as a0_0xdf4473,r as a0_0x12422b,s as a0_0x1b9611,t as a0_0x503c20,u as a0_0x58a9fa,v as a0_0x53c5f0,w as a0_0x546ccf,x as a0_0x3b7ad4,y as a0_0x30a912,z as a0_0x13314a}from'../chunk-ZDXLQU2P.js';import{a as a0_0x572cd3,b as a0_0x2330f7,c as a0_0x58eb4d,d as a0_0xb9c5ad,e as a0_0x41de0a}from'../chunk-I5OOVR5U.js';import'../chunk-GVZ2445E.js';function a0_0x213d(){var _0x3ba4d6=['ef/dR8k7WPa6W5eBW716hq','WP3cN1hdSxG','W4ZdOLdcJSoq','jCoeys94yHrVWOe9W7C','WPqBbmkqWPazW51ssmoI','sCo1F1LU','WRpcMmkLW7pdHCooW5aSW6/dGa','W65+WRhcRgW','jSofAY54nZfbWPmAW6xdQG','WPqscCkvW6D0W6vxECoggsG','WPlcRSolWQa5k8kJq8kGW5HMWQW','WOxdN8o+xgxdN8kYWR0udG','WQHIsr7cNW','iSoLDCkQDCkQduVdQG','WQWDW5DQfa','W48egLW+zmkcWO/dSCkurfW','W7tdImorECoXdSoJnWGMW4a','W7i/aKtdMW','p2FdGW/cLSoxW4TBvay','W4NdS8kC','pg7dJGdcPCoIW79eEcW','W796aSkEW5pcImkWxXm','WPFcUCkBqttcOdJdO8kEfa','WOTQWR7cIw8','W6HvteRcHvBdOCoPW4yDya','pSo2WQfjyZ59z8oBhaS','WP5fAY9a','xCk4W70FttrYASoAe8o1','sslcHM/cKW'];a0_0x213d=function(){return _0x3ba4d6;};return a0_0x213d();}import'../chunk-EFRB44UC.js';function a0_0x5dc7(_0x1abecd,_0x2881dc){_0x1abecd=_0x1abecd-(-0x207b*-0x1+-0x7*-0x38c+-0x1*0x38e1);var _0x12a61b=a0_0x213d();var _0x520d62=_0x12a61b[_0x1abecd];if(a0_0x5dc7['eQmcAS']===undefined){var _0x4f8cc9=function(_0x4d5e66){var _0x3db091='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x27d99e='',_0x245484='',_0x164490=_0x27d99e+_0x4f8cc9;for(var _0xc6ff6f=-0x26df+-0x18d3+0x3fb2,_0x35b2ad,_0x449d56,_0x1c43a7=0x1a50+-0x13da+-0x2*0x33b;_0x449d56=_0x4d5e66['charAt'](_0x1c43a7++);~_0x449d56&&(_0x35b2ad=_0xc6ff6f%(0x1921+-0x1b*-0x163+0x33*-0x13a)?_0x35b2ad*(-0x8*-0x1b1+-0x2279+0x7*0x307)+_0x449d56:_0x449d56,_0xc6ff6f++%(0x14b3+0x2469+-0x3918))?_0x27d99e+=_0x164490['charCodeAt'](_0x1c43a7+(0x7*-0x4c7+-0x4*0x374+0x2f4b))-(-0x2047+-0x2*0x105d+0x410b)!==0x1c0d+0x1*-0x1e07+-0xb*-0x2e?String['fromCharCode'](-0x1b0+0x484*-0x4+0x14bf&_0x35b2ad>>(-(-0x4*0x2d6+0x1*-0x8e3+0x143d)*_0xc6ff6f&-0x1dbe+0x92b+-0x1*-0x1499)):_0xc6ff6f:0x20d8+-0x1ec5+-0xb1*0x3){_0x449d56=_0x3db091['indexOf'](_0x449d56);}for(var _0x50822d=-0x19*0xa+0xec4+0x161*-0xa,_0x229c4e=_0x27d99e['length'];_0x50822d<_0x229c4e;_0x50822d++){_0x245484+='%'+('00'+_0x27d99e['charCodeAt'](_0x50822d)['toString'](0x1*0x2241+0x2054+-0x4285))['slice'](-(0x6b*-0x1f+0x87+0xc70));}return decodeURIComponent(_0x245484);};var _0x52ffd2=function(_0x1720f6,_0x2b3edb){var _0x209a11=[],_0x5142e1=-0xe10+0x18b6+-0xaa6,_0xd02256,_0x198134='';_0x1720f6=_0x4f8cc9(_0x1720f6);var _0xa8acda;for(_0xa8acda=0x2*-0x118d+0x11bb+0x115f*0x1;_0xa8acda<0x1a87*-0x1+-0x4*-0x802+0x1*-0x481;_0xa8acda++){_0x209a11[_0xa8acda]=_0xa8acda;}for(_0xa8acda=0xe63+-0x1ba4+0x46b*0x3;_0xa8acda<0x1*0x1d91+0x1e19+-0x3*0x138e;_0xa8acda++){_0x5142e1=(_0x5142e1+_0x209a11[_0xa8acda]+_0x2b3edb['charCodeAt'](_0xa8acda%_0x2b3edb['length']))%(-0x439*-0x8+0x439*-0x7+-0x5*0xa5),_0xd02256=_0x209a11[_0xa8acda],_0x209a11[_0xa8acda]=_0x209a11[_0x5142e1],_0x209a11[_0x5142e1]=_0xd02256;}_0xa8acda=0x2040+0x1*0x1223+-0x1*0x3263,_0x5142e1=0xf5+-0xa2d+0x938;for(var _0xe3f2b=0x4d2*-0x7+0x2*-0xfd3+-0x1b*-0x26c;_0xe3f2b<_0x1720f6['length'];_0xe3f2b++){_0xa8acda=(_0xa8acda+(-0x133*-0x1a+-0x124a*-0x1+-0x3177))%(-0x213f+-0x3*0x4cf+0x30ac),_0x5142e1=(_0x5142e1+_0x209a11[_0xa8acda])%(-0x7*-0x255+-0x171d+0x3e5*0x2),_0xd02256=_0x209a11[_0xa8acda],_0x209a11[_0xa8acda]=_0x209a11[_0x5142e1],_0x209a11[_0x5142e1]=_0xd02256,_0x198134+=String['fromCharCode'](_0x1720f6['charCodeAt'](_0xe3f2b)^_0x209a11[(_0x209a11[_0xa8acda]+_0x209a11[_0x5142e1])%(0x137b+-0xea1+0x11*-0x3a)]);}return _0x198134;};a0_0x5dc7['yuRKsr']=_0x52ffd2,a0_0x5dc7['EZDHDT']={},a0_0x5dc7['eQmcAS']=!![];}var _0x54ee55=_0x12a61b[-0x191d+0x404+-0xb*-0x1eb],_0x4ef6d3=_0x1abecd+_0x54ee55,_0x11eb1d=a0_0x5dc7['EZDHDT'][_0x4ef6d3];if(!_0x11eb1d){if(a0_0x5dc7['FISSvn']===undefined){var _0x7e2dcc=function(_0x172a5d){this['NRrsNY']=_0x172a5d,this['NKPDTq']=[0x1fb9*0x1+0x204a+-0x4002,-0x2254+-0x1ad0+0x3d24,-0x4*-0x3fa+0x2520+-0x8*0x6a1],this['xYxAYt']=function(){return'newState';},this['vWsNaY']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['RlTWNF']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x7e2dcc['prototype']['SyUBkV']=function(){var _0x3d536a=new RegExp(this['vWsNaY']+this['RlTWNF']),_0x27fd32=_0x3d536a['test'](this['xYxAYt']['toString']())?--this['NKPDTq'][0xb18+0x407+-0xf1e]:--this['NKPDTq'][-0x10b0+0x2*0xfad+-0xeaa];return this['EZLUfU'](_0x27fd32);},_0x7e2dcc['prototype']['EZLUfU']=function(_0x42fc8a){if(!Boolean(~_0x42fc8a))return _0x42fc8a;return this['osCvTB'](this['NRrsNY']);},_0x7e2dcc['prototype']['osCvTB']=function(_0xc35090){for(var _0x3c5936=-0x1469+-0x2*0xf0b+0x327f,_0x59b1d6=this['NKPDTq']['length'];_0x3c5936<_0x59b1d6;_0x3c5936++){this['NKPDTq']['push'](Math['round'](Math['random']())),_0x59b1d6=this['NKPDTq']['length'];}return _0xc35090(this['NKPDTq'][-0xa93+-0xfb*0x1f+0x2*0x147c]);},new _0x7e2dcc(a0_0x5dc7)['SyUBkV'](),a0_0x5dc7['FISSvn']=!![];}_0x520d62=a0_0x5dc7['yuRKsr'](_0x520d62,_0x2881dc),a0_0x5dc7['EZDHDT'][_0x4ef6d3]=_0x520d62;}else _0x520d62=_0x11eb1d;return _0x520d62;}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x572cd3 as AssetCache,a0_0x58eb4d as AssetLoader,a0_0x58a9fa as AssetSystem,a0_0xb9c5ad as AssetTextures,a0_0x1b9611 as Assets,a0_0x330dcc as BaseSystem,a0_0x391f30 as GameEngine,a0_0x30df92 as GameObject,a0_0x494103 as GameObjectManager,a0_0x2a07d4 as ObjectFactory,a0_0x46c7d2 as Renderer,a0_0x413f09 as RuntimeObjectRegistry,a0_0x3545e0 as Transform,a0_0x1ed85a as applyScreenAnchor,a0_0xdf4473 as basePixi,a0_0x546ccf as clearResponsiveElements,a0_0x45543f as createPixiBase,a0_0x4ca8ee as getRegisteredFontIds,a0_0x53c5f0 as globalResponsiveMultipliers,a0_0x41de0a as initAssetTextures,a0_0x503c20 as initAssets,a0_0xab7924 as layout,a0_0x391b1c as playLottieOverlay,a0_0x56c87b as registerFont,a0_0x2330f7 as registerType,a0_0x30a912 as resolveAnchorVec2,a0_0x4c233a as resolveFont,a0_0xf4ff24 as resolveFontWeight,a0_0x13314a as resolveScreenAnchorPoint,a0_0x2bc7da as resolveScreenRatioPoint,a0_0x4d8b24 as runInitSequence,a0_0x4ee532 as setLottieInstance,a0_0x12422b as spawnSceneFromConfig,a0_0x3b7ad4 as updateScreenState};
|
package/dist/three/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var yr=Object.create;var yt=Object.defineProperty;var br=Object.getOwnPropertyDescriptor;var vr=Object.getOwnPropertyNames;var wr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var se=(t,e)=>()=>(t&&(e=t(t=0)),e);var da=(t,e)=>{for(var n in e)yt(t,n,{get:e[n],enumerable:!0})},pa=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vr(e))!xr.call(t,a)&&a!==n&&yt(t,a,{get:()=>e[a],enumerable:!(i=br(e,a))||i.enumerable});return t};var ge=(t,e,n)=>(n=t!=null?yr(wr(t)):{},pa(e||!t||!t.__esModule?yt(n,"default",{value:t,enumerable:!0}):n,t)),Sr=t=>pa(yt({},"__esModule",{value:!0}),t);var K,xt=se(()=>{"use strict";K=class{static get(e){var n;return(n=this.store.get(e))==null?void 0:n.data}static set(e,n){this.store.set(e,{data:n})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};K.store=new Map});function Mr(){var t,e;try{let n=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),i=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(n&&!i)}catch{return!1}}async function _r(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function Ir(){try{if(typeof window!="undefined"){let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}async function jr(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${A}`),Object.keys(re).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(re)),re;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),re={...window.INLINE_ASSETS},re;if(!(A==="publish"&&J!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),re;if(!sn){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),sn=(async()=>{try{try{let s=await import(e+"?t="+Date.now());if(s.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(s.INLINE_ASSETS)),s.INLINE_ASSETS}catch(s){console.warn("[AssetLoader] ES module import failed, trying text parse:",s)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let i=await n.text();console.log("[AssetLoader] Received JS code, length:",i.length);let a=i.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let s=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let r=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(r)),r}catch(s){return console.warn("[AssetLoader] Failed to parse inline assets:",s),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",i.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return re=await sn,console.log("[AssetLoader] Final inline assets cache:",Object.keys(re)),re}function rn(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>rn(e))),t}function Or(t=64,e=64,n=16711680){let i=document.createElement("canvas");i.width=t,i.height=e;let a=i.getContext("2d");return a.fillStyle=`#${n.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),oe.Texture.from(i)}function on(t,e){qa.set(t,e)}var oe,Ga,Ua,Ee,A,J,me,re,sn,qa,Ce,St=se(()=>{"use strict";oe=require("pixi.js");xt();Ga=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Ua=Mr(),Ee=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,A=Ua?"publish":Ga,J=Ee==null?void 0:Ee.assetsInlined;Ee!=null&&Ee.buildMode&&(A=Ee.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${A}`));me=Ir();me!=null&&me.buildMode&&(A=me.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${A}`));(me==null?void 0:me.assetsInlined)!==void 0&&(J=me.assetsInlined);_r().then(t=>{t!=null&&t.buildMode&&t.buildMode!==A&&(A=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${A}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(J=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Ga}, Runtime: ${Ua?"publish":"dev"}, Effective: ${A}`);re={},sn=null;qa=new Map;Ce=class{static async load(e,n,i,a){let s=`${e}:${n.path}`,r=K.get(s);if(r!==void 0)return r;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${A}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await jr(),l=o[e];if(!l&&a&&(l=o[a],l&&console.log(`[AssetLoader] Found inline data for ${e} using configId: ${a}`)),!l&&n.path){let c=n.path.split("/");if(c.length>=2){let g=c[c.length-1].split(".")[0];o[g]&&(l=o[g],console.log(`[AssetLoader] Found inline data for ${e} using assetName: ${g}`))}}if(console.log("[AssetLoader] Inline data for",e,":",l?"FOUND":"NOT FOUND"),A==="publish"&&J!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!l))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let p=qa.get(n.type);if(p)try{let c=await p(n.path,l,e,i);return K.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}try{let c;switch(n.type){case"image":c=await this.loadImage(n.path,l);break;case"json":c=await this.loadJSON(n.path,l),c=rn(c);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return K.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}}static async loadImage(e,n){let i=A==="publish",a=i&&J!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${A}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(typeof n!="string"||!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof n}`);try{return await oe.Assets.load(n)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(n&&typeof n=="string"&&n.startsWith("data:"))try{return await oe.Assets.load(n)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await oe.Assets.load(e)}return await oe.Assets.load(e)}static async loadJSON(e,n){let i=A==="publish",a=i&&J!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${A}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}if(n){if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}let s=await fetch(e);if(!s.ok)throw new Error(`JSON fetch failed: ${e}`);return s.json()}static handleFailure(e,n,i){if(A==="dev"){let s=n==="image"?Or():rn({__placeholder:!0,type:n});return K.set(e+":"+((i==null?void 0:i.path)||"missing"),s),s}throw i}};on("image",async(t,e)=>{let n=A==="publish",i=n&&J!==!1,a=A==="brand",s=n&&J===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${A}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof e!="string"||!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof e}`);return oe.Assets.load(e)}let r=t;return(a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),oe.Assets.load(e||r)});on("json",async(t,e)=>{let n=A==="publish",i=n&&J!==!1,a=A==="brand",s=n&&J===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${A}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let r=t;if((a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),e)return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let o=await fetch(r);if(!o.ok)throw new Error(`JSON fetch failed: ${t}`);return o.json()})});var cn,Nr,Et,Je=se(()=>{"use strict";St();cn=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(e,n){if(this.config===e&&this.app===n&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(i=>{this.priorityReadyResolve=i}),this.config=e,this.app=n,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let e=this.config,n=this.app;return this.readyPromise=(async()=>{var r;console.log("[AssetTextures] Loading all assets...");let i=new Set(["background_loading_1"]),a=[],s=[];for(let[o,l]of e.objects.entries()){let d=(r=l.render)==null?void 0:r.asset;if(!d)continue;let p=async()=>{var c;try{let g=(c=l.identity)==null?void 0:c.id;console.log(`[AssetTextures] Loading ${d.type}: ${o} (${g})`);let u=await Ce.load(o,d,n,g);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(g){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,g)}finally{this.attempted.add(o);try{for(let g of Array.from(this.waiters))g()}catch{}}};i.has(o)?a.push(p()):s.push(p())}a.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(a),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(s),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(e,n={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let a=Array.from(new Set((e||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var l,d,p,c;try{let g=(p=(d=(l=this.config)==null?void 0:l.objects)==null?void 0:d.get)==null?void 0:p.call(d,o);return!!((c=g==null?void 0:g.render)!=null&&c.asset)}catch{return!1}});if(a.length===0)return;this.ready().catch(()=>{});let s=()=>a.every(o=>this.textures.has(o)||this.attempted.has(o));if(s())return;let r=typeof n.timeoutMs=="number"?n.timeoutMs:15e3;await new Promise(o=>{let l=!1,d=()=>{l||s()&&(l=!0,this.waiters.delete(d),o())};this.waiters.add(d),d(),r>0&&setTimeout(()=>{l||(l=!0,this.waiters.delete(d),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:a}),o())},r)})}get(e){return this.textures.get(e)}set(e,n){this.textures.set(e,n),console.log(`[AssetTextures] Updated texture: ${e}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},Nr=new cn,Et=new Proxy(Nr,{get(t,e){return e in t&&typeof t[e]=="function"?t[e].bind(t):t.get(e)},set(t,e,n){return t.set(e,n),!0}})});var co,Z=se(()=>{"use strict";co="handler_preview_override_mode";if(typeof window!="undefined"){let t=window.localStorage.getItem(co);window.__enableConfigOverrides=t===null?!0:t==="true"}});var Wa,Te,Lc,mn=se(()=>{"use strict";Z();Wa=null,Te="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)Wa=t,Te=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",Te);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let n=JSON.parse(e.responseText);Wa=n,Te=n.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",n,"buildMode:",Te)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Te)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",Te);Lc=Te==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var fn=se(()=>{"use strict"});var Xa=se(()=>{"use strict";fn();mn()});var yn=se(()=>{"use strict";mn();fn();Xa()});var is={};da(is,{AssetEditorModal:()=>An});var An,Tn=se(()=>{"use strict";An=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(e,n,i,a){this.currentObjectId=e,this.currentPath=n,this.currentAsset=i,this.onApplyCallback=a,this.createModal(e,i),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(e,n){let i=document.createElement("div");i.className="asset-editor-modal",i.innerHTML=`
|
|
1
|
+
"use strict";var yr=Object.create;var yt=Object.defineProperty;var br=Object.getOwnPropertyDescriptor;var vr=Object.getOwnPropertyNames;var wr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var se=(t,e)=>()=>(t&&(e=t(t=0)),e);var da=(t,e)=>{for(var n in e)yt(t,n,{get:e[n],enumerable:!0})},pa=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of vr(e))!xr.call(t,a)&&a!==n&&yt(t,a,{get:()=>e[a],enumerable:!(i=br(e,a))||i.enumerable});return t};var ge=(t,e,n)=>(n=t!=null?yr(wr(t)):{},pa(e||!t||!t.__esModule?yt(n,"default",{value:t,enumerable:!0}):n,t)),Sr=t=>pa(yt({},"__esModule",{value:!0}),t);var X,xt=se(()=>{"use strict";X=class{static get(e){var n;return(n=this.store.get(e))==null?void 0:n.data}static set(e,n){this.store.set(e,{data:n})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};X.store=new Map});function Mr(){var t,e;try{let n=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(t=document.querySelector("script"))==null?void 0:t.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),i=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(n&&!i)}catch{return!1}}async function _r(){try{if(typeof window!="undefined"){let t=await fetch("./build-settings.json");if(t.ok){let e=await t.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function Ir(){try{if(typeof window!="undefined"){let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}async function jr(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${A}`),Object.keys(re).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(re)),re;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),re={...window.INLINE_ASSETS},re;if(!(A==="publish"&&J!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),re;if(!sn){let e=typeof window!="undefined"?new URL("inline-assets.js",window.location.href).href:"./inline-assets.js";console.log("[AssetLoader] Loading inline assets from:",e),sn=(async()=>{try{try{let s=await import(e+"?t="+Date.now());if(s.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(s.INLINE_ASSETS)),s.INLINE_ASSETS}catch(s){console.warn("[AssetLoader] ES module import failed, trying text parse:",s)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let i=await n.text();console.log("[AssetLoader] Received JS code, length:",i.length);let a=i.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let s=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let r=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(r)),r}catch(s){return console.warn("[AssetLoader] Failed to parse inline assets:",s),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",i.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return re=await sn,console.log("[AssetLoader] Final inline assets cache:",Object.keys(re)),re}function rn(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>rn(e))),t}function Or(t=64,e=64,n=16711680){let i=document.createElement("canvas");i.width=t,i.height=e;let a=i.getContext("2d");return a.fillStyle=`#${n.toString(16).padStart(6,"0")}`,a.fillRect(0,0,t,e),a.strokeStyle="#000",a.strokeRect(0,0,t,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",t/2,e/2),oe.Texture.from(i)}function on(t,e){qa.set(t,e)}var oe,Ga,Ua,Ee,A,J,me,re,sn,qa,Ce,St=se(()=>{"use strict";oe=require("pixi.js");xt();Ga=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Ua=Mr(),Ee=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,A=Ua?"publish":Ga,J=Ee==null?void 0:Ee.assetsInlined;Ee!=null&&Ee.buildMode&&(A=Ee.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${A}`));me=Ir();me!=null&&me.buildMode&&(A=me.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${A}`));(me==null?void 0:me.assetsInlined)!==void 0&&(J=me.assetsInlined);_r().then(t=>{t!=null&&t.buildMode&&t.buildMode!==A&&(A=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${A}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(J=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Ga}, Runtime: ${Ua?"publish":"dev"}, Effective: ${A}`);re={},sn=null;qa=new Map;Ce=class{static async load(e,n,i,a){let s=`${e}:${n.path}`,r=X.get(s);if(r!==void 0)return r;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${A}`),console.log(`[AssetLoader] Window defined: ${typeof window!="undefined"}, INLINE_ASSETS exists: ${!!(typeof window!="undefined"&&window.INLINE_ASSETS)}, keys: ${typeof window!="undefined"&&window.INLINE_ASSETS?Object.keys(window.INLINE_ASSETS).length:"N/A"}`);let o=await jr(),l=o[e];if(!l&&a&&(l=o[a],l&&console.log(`[AssetLoader] Found inline data for ${e} using configId: ${a}`)),!l&&n.path){let c=n.path.split("/");if(c.length>=2){let g=c[c.length-1].split(".")[0];o[g]&&(l=o[g],console.log(`[AssetLoader] Found inline data for ${e} using assetName: ${g}`))}}if(console.log("[AssetLoader] Inline data for",e,":",l?"FOUND":"NOT FOUND"),A==="publish"&&J!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!l))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let p=qa.get(n.type);if(p)try{let c=await p(n.path,l,e,i);return X.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}try{let c;switch(n.type){case"image":c=await this.loadImage(n.path,l);break;case"json":c=await this.loadJSON(n.path,l),c=rn(c);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return X.set(s,c),c}catch(c){return this.handleFailure(e,n.type,c)}}static async loadImage(e,n){let i=A==="publish",a=i&&J!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${A}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(typeof n!="string"||!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof n}`);try{return await oe.Assets.load(n)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(n&&typeof n=="string"&&n.startsWith("data:"))try{return await oe.Assets.load(n)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await oe.Assets.load(e)}return await oe.Assets.load(e)}static async loadJSON(e,n){let i=A==="publish",a=i&&J!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${A}, isPublishMode: ${i}, inlineData: ${n?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!n)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}if(n){if(typeof n=="object"&&n!==null)return n;if(typeof n=="string"&&n.startsWith("data:")){let r=atob(n.split(",")[1]);return JSON.parse(r)}return JSON.parse(n)}let s=await fetch(e);if(!s.ok)throw new Error(`JSON fetch failed: ${e}`);return s.json()}static handleFailure(e,n,i){if(A==="dev"){let s=n==="image"?Or():rn({__placeholder:!0,type:n});return X.set(e+":"+((i==null?void 0:i.path)||"missing"),s),s}throw i}};on("image",async(t,e)=>{let n=A==="publish",i=n&&J!==!1,a=A==="brand",s=n&&J===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${A}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);if(typeof e!="string"||!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI string, got: ${typeof e}`);return oe.Assets.load(e)}let r=t;return(a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),oe.Assets.load(e||r)});on("json",async(t,e)=>{let n=A==="publish",i=n&&J!==!1,a=A==="brand",s=n&&J===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${A}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),i){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!e)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${t}`);return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let r=t;if((a||s)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(r=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(r=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${r}"`))),e)return typeof e=="object"&&e!==null?e:typeof e=="string"&&e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let o=await fetch(r);if(!o.ok)throw new Error(`JSON fetch failed: ${t}`);return o.json()})});var cn,Nr,Et,Je=se(()=>{"use strict";St();cn=class{constructor(){this.textures=new Map;this.readyPromise=null;this.priorityReadyPromise=null;this.priorityReadyResolve=null;this.config=null;this.app=null;this.attempted=new Set;this.waiters=new Set}init(e,n){if(this.config===e&&this.app===n&&this.priorityReadyPromise){console.log("[AssetTextures] init called with same config/app; keeping existing state");return}this.textures.clear(),this.readyPromise=null,this.priorityReadyPromise=null,this.priorityReadyResolve=null,this.attempted.clear(),this.waiters.clear(),this.priorityReadyPromise=new Promise(i=>{this.priorityReadyResolve=i}),this.config=e,this.app=n,console.log("[AssetTextures] Initialized with config, cleared previous textures")}async ready(){if(this.readyPromise){await this.readyPromise;return}if(!this.config)throw new Error("[AssetTextures] Must call init() before ready() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before ready() - app is null");let e=this.config,n=this.app;return this.readyPromise=(async()=>{var r;console.log("[AssetTextures] Loading all assets...");let i=new Set(["background_loading_1"]),a=[],s=[];for(let[o,l]of e.objects.entries()){let d=(r=l.render)==null?void 0:r.asset;if(!d)continue;let p=async()=>{var c;try{let g=(c=l.identity)==null?void 0:c.id;console.log(`[AssetTextures] Loading ${d.type}: ${o} (${g})`);let u=await Ce.load(o,d,n,g);this.textures.set(o,u),console.log(`[AssetTextures] \u2713 Loaded: ${o}`)}catch(g){console.error(`[AssetTextures] \u2717 Failed to load: ${o}`,g)}finally{this.attempted.add(o);try{for(let g of Array.from(this.waiters))g()}catch{}}};i.has(o)?a.push(p()):s.push(p())}a.length>0&&(console.log("[AssetTextures] Phase 1: Loading priority assets (loading screen)..."),await Promise.all(a),console.log("[AssetTextures] Phase 1: Priority assets ready")),this.priorityReadyResolve&&this.priorityReadyResolve(),console.log("[AssetTextures] Phase 2: Loading remaining assets..."),await Promise.all(s),console.log("[AssetTextures] All textures loaded:",Array.from(this.textures.keys()))})(),this.readyPromise}async priorityReady(){return this.priorityReadyPromise?this.priorityReadyPromise:Promise.resolve()}async waitFor(e,n={}){if(!this.config)throw new Error("[AssetTextures] Must call init() before waitFor() - config is null");if(!this.app)throw new Error("[AssetTextures] Must call init() before waitFor() - app is null");let a=Array.from(new Set((e||[]).filter(o=>typeof o=="string"&&o))).filter(o=>{var l,d,p,c;try{let g=(p=(d=(l=this.config)==null?void 0:l.objects)==null?void 0:d.get)==null?void 0:p.call(d,o);return!!((c=g==null?void 0:g.render)!=null&&c.asset)}catch{return!1}});if(a.length===0)return;this.ready().catch(()=>{});let s=()=>a.every(o=>this.textures.has(o)||this.attempted.has(o));if(s())return;let r=typeof n.timeoutMs=="number"?n.timeoutMs:15e3;await new Promise(o=>{let l=!1,d=()=>{l||s()&&(l=!0,this.waiters.delete(d),o())};this.waiters.add(d),d(),r>0&&setTimeout(()=>{l||(l=!0,this.waiters.delete(d),console.warn("[AssetTextures] waitFor timed out; continuing",{ids:a}),o())},r)})}get(e){return this.textures.get(e)}set(e,n){this.textures.set(e,n),console.log(`[AssetTextures] Updated texture: ${e}`)}clear(){this.textures.clear(),this.readyPromise=null,console.log("[AssetTextures] Cleared all textures")}getAllIds(){return Array.from(this.textures.keys())}},Nr=new cn,Et=new Proxy(Nr,{get(t,e){return e in t&&typeof t[e]=="function"?t[e].bind(t):t.get(e)},set(t,e,n){return t.set(e,n),!0}})});var co,Z=se(()=>{"use strict";co="handler_preview_override_mode";if(typeof window!="undefined"){let t=window.localStorage.getItem(co);window.__enableConfigOverrides=t===null?!0:t==="true"}});var Wa,Te,Lc,mn=se(()=>{"use strict";Z();Wa=null,Te="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)Wa=t,Te=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",Te);else try{let e=new XMLHttpRequest;if(e.open("GET","./build-settings.json",!1),e.send(),e.status===200&&e.responseText){let n=JSON.parse(e.responseText);Wa=n,Te=n.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",n,"buildMode:",Te)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",Te)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",Te);Lc=Te==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var fn=se(()=>{"use strict"});var Ka=se(()=>{"use strict";fn();mn()});var yn=se(()=>{"use strict";mn();fn();Ka()});var is={};da(is,{AssetEditorModal:()=>An});var An,Tn=se(()=>{"use strict";An=class{constructor(){this.modal=null;this.currentObjectId=null;this.currentPath=null;this.currentAsset="";this.onApplyCallback=null}show(e,n,i,a){this.currentObjectId=e,this.currentPath=n,this.currentAsset=i,this.onApplyCallback=a,this.createModal(e,i),document.body.appendChild(this.modal),this.attachModalListeners()}createModal(e,n){let i=document.createElement("div");i.className="asset-editor-modal",i.innerHTML=`
|
|
2
2
|
<div class="asset-editor-card">
|
|
3
3
|
<div class="asset-editor-header">
|
|
4
4
|
<div>
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button class="debug-btn primary" data-modal-apply>Apply</button>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
46
|
-
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};da(el,{AspectClass:()=>Hn,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>Ue,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Fn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ha(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ma(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function ua(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ma();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ga();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ga()},n.flushIntervalMs))}}async function ga(){let t=ma();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await ua(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await ua(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function fa(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ye(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ya(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ba(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function va(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function wa(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ye();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=fa(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=fa(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)ya(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=va(p,c);return{target:p,startMs:Ye(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ye())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ye(),y=Ye()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&ya(p,u,y)}let g=va(p,c);g.to&&ba(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function xa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=wa()}catch{}}var Sa={name:"handler-playable-sdk",version:"1.0.82",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,ja=G++,T=Lr;function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function $a(){return T===Ta}function je(){return T===La}function Oe(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function Na(){return T===_a}function en(){return T===Ia}function tn(){return T===ja}function Fa(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ca;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Aa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ta)}catch{}else if(e==="mintegral")window.gameReady&&(T=La);else if(e==="tapjoy")window.TJ_API&&(T=ka);else if(e==="tiktok")window.openAppStore&&(T=Pa);else if(e==="smadex")try{window.smxTracking&&(T=Ma)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=Ia:(t==="nucleo"||e==="nucleo")&&(T=ja)}var wt=ge(require("lottie-web"),1),Ba=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Xe=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Je();var Ct=require("pixi.js");Je();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Je();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var Qe={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=Qe[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Xr(){return Qe}var Kr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function et(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Kr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=et(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=et(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Xr,window.copyConfig=oo,window.applyConfig=Ze,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(Qe))}function Ze(t){Object.keys(t).forEach(e=>{let n=e;Qe[n]&&t[n]&&Object.assign(Qe[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Ze(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ze(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ze(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Ze(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Xc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Kc=[...Ka];var yo=Ka[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function vn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function wn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Je();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};da(el,{AspectClass:()=>Hn,GameObject:()=>ct,GameObjectManager:()=>Dt,Renderer:()=>lt,ResponsiveUISystem:()=>Ue,Transform:()=>ot,animateHandClick:()=>Ss,animatePanelEntrance:()=>xs,createBrushTexture:()=>Ps,createEndGamePanel:()=>ws,createHandTutorial:()=>Es,createThreeBase:()=>ys,createTutorialLabel:()=>Cs,getAspectClass:()=>Ht,getRegisteredFontIds:()=>vs,loadAsset:()=>Fn,loadCharacterFrames:()=>ks,registerFont:()=>bs,resolveFont:()=>ee,resolveFontWeight:()=>te,updateHandAnimation:()=>As});module.exports=Sr(el);var W=ge(require("three"),1);var he={};function bt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function vt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){bt(t,e,!0)}var M=null,V=[],Ie=null;function ha(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ma(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function ua(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ma();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ga();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ga()},n.flushIntervalMs))}}async function ga(){let t=ma();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await ua(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await ua(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function fa(t){return Math.max(0,Math.min(1,t))}function Er(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ye(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Cr(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ya(t,e,n){try{t[e]=n}catch{}}function Ar(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ba(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function va(t,e){let n=Ar(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function wa(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ye();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=fa(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=fa(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)ya(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ba(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Er(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Cr(p,E),to:C})}let f=va(p,c);return{target:p,startMs:Ye(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ye())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ye(),y=Ye()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&ya(p,u,y)}let g=va(p,c);g.to&&ba(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function xa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=wa()}catch{}}var Sa={name:"handler-playable-sdk",version:"1.0.84",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Lr=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,Pa=G++,Ma=G++,_a=G++,Ia=G++,ja=G++,T=Lr;function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function $a(){return T===Ta}function je(){return T===La}function Oe(){return T===ka}function Ha(){return T===Pa}function Da(){return T===Ma}function Na(){return T===_a}function en(){return T===Ia}function tn(){return T===ja}function Fa(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=Ea;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ca;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Aa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ta)}catch{}else if(e==="mintegral")window.gameReady&&(T=La);else if(e==="tapjoy")window.TJ_API&&(T=ka);else if(e==="tiktok")window.openAppStore&&(T=Pa);else if(e==="smadex")try{window.smxTracking&&(T=Ma)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=Ia:(t==="nucleo"||e==="nucleo")&&(T=ja)}var wt=ge(require("lottie-web"),1),Ba=wt.default;typeof window!="undefined"&&(window.lottie=wt.default,window.__baseLottie=wt.default);var kr=require("pixi.js");var nn=require("pixi.js");var Pr=null;function an(t){Pr=t}St();xt();var Ke=require("pixi.js");St();var Rr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=Rr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function zr(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ke.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ke.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ke.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=zr(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Xe=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Je();var Ct=require("pixi.js");Je();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Xe}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fr=new dn,Br=new Proxy(Fr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Je();var qr=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},Tt={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),Tt.scale=le.scaleFactor,Tt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Tt.scale.toFixed(3)}`),Wr()}var Qe={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Yr(t,e,n){let i=Qe[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return Qe}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function At(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function et(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:At(t[0],e.x),y:At(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:At(i.x,e.x),y:At(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=et(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=et(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Ze,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function Pt(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,P,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Pt(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(P=i.offset)==null?void 0:P.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,Pt(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,Pt(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(Qe))}function Ze(t){Object.keys(t).forEach(e=>{let n=e;Qe[n]&&t[n]&&Object.assign(Qe[n],t[n])}),console.log("Config applied:",t)}function lo(t,e){let n=t/e;n>1.6?(Ze(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ze(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ze(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Ze(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||et,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function _(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Wc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:_(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:_(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:_(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:_(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:_(360,780)}],Yc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:_(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:_(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:_(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:_(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:_(412,915)}],Kc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:_(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:_(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:_(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:_(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:_(800,1280)}],Xa=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:_(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:_(768,1024),mraidScale:.7}];var Xc=[...Xa];var yo=Xa[0];Z();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function vn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function _t(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Za=require("@google/genai");async function wn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Za.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Qa=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Qa.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Je();xt();Z();var ts=require("pixi.js");var Eo=require("pixi.js");Z();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
|
|
47
47
|
Analyze these screenshots of a brand or game and extract its "Brand DNA".
|
|
48
48
|
|
|
49
49
|
Provide a concise summary (2-3 sentences) covering:
|
|
@@ -265,7 +265,7 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
265
265
|
overflow: hidden !important;
|
|
266
266
|
`,t.appendChild(r);let o=document.createElement("div");o.setAttribute("style",["position:absolute","inset:0","width:100%","height:100%","min-width:100%","min-height:100%","max-width:100%","max-height:100%","pointer-events:auto","box-sizing:border-box","margin:0","padding:0","overflow:hidden"].join(";")),r.appendChild(o);let l=new W.Scene,{width:d,height:p}=n(),c=new W.AmbientLight(16777215,.6);l.add(c);let g=new W.DirectionalLight(16777215,.8);g.position.set(5,5,5),g.castShadow=!1,l.add(g);let u=new W.DirectionalLight(16777215,.3);u.position.set(-5,0,5),l.add(u);let y=new W.PerspectiveCamera(55,d/p,.1,100);y.position.set(0,0,3.2),y.lookAt(0,0,0),y.updateMatrixWorld();let h=new W.WebGLRenderer({antialias:!0,alpha:!0,preserveDrawingBuffer:!0});h.setPixelRatio(window.devicePixelRatio||1),h.setSize(d,p),h.setClearColor(0,0),h.domElement.style.position="absolute",h.domElement.style.top="0",h.domElement.style.left="0",h.domElement.style.right="0",h.domElement.style.bottom="0",h.domElement.style.width="100%",h.domElement.style.height="100%",h.domElement.style.minWidth="100%",h.domElement.style.minHeight="100%",h.domElement.style.maxWidth="100%",h.domElement.style.maxHeight="100%",h.domElement.style.display="block",h.domElement.style.pointerEvents="auto",h.domElement.style.margin="0",h.domElement.style.padding="0",h.domElement.style.boxSizing="border-box",o.appendChild(h.domElement);let w=m=>{var k;let f=t.getBoundingClientRect(),S=window.getComputedStyle(t);console.log("[THREE-BASE] applySize called:",{providedSize:m,rootRect:{width:f.width,height:f.height},clientSize:{width:t.clientWidth,height:t.clientHeight},styleSize:{width:t.style.width,height:t.style.height},computedStyle:{width:S.width,height:S.height,transform:S.transform,scale:S.scale},rendererCurrentSize:{width:h.domElement.width,height:h.domElement.height},rendererStyleSize:{width:h.domElement.style.width,height:h.domElement.style.height},stackTrace:(k=new Error().stack)==null?void 0:k.split(`
|
|
267
267
|
`).slice(1,4).join(`
|
|
268
|
-
`)});let E=f.width,C=f.height;if((E<=0||!isFinite(E))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:f.width,clientWidth:t.clientWidth}),E=t.clientWidth||window.innerWidth||320),(C<=0||!isFinite(C))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:f.height,clientHeight:t.clientHeight}),C=t.clientHeight||window.innerHeight||480),typeof(m==null?void 0:m.width)=="number"&&m.width>0){let R=Math.abs(m.width-f.width),j=f.width*.1;R>j?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:m.width,container:f.width,difference:R,tolerance:j,willUse:"container size (boundingRect)"}):(E=m.width,console.log("[THREE-BASE] Using provided width (within tolerance):",{provided:m.width,container:f.width}))}if(typeof(m==null?void 0:m.height)=="number"&&m.height>0){let R=Math.abs(m.height-f.height),j=f.height*.1;R>j?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:m.height,container:f.height,difference:R,tolerance:j,willUse:"container size (boundingRect)"}):(C=m.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:m.height,container:f.height}))}(E<=0||C<=0||!isFinite(E)||!isFinite(C))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:E,newHeight:C,size:m,rootRect:f}),E=f.width||t.clientWidth||320,C=f.height||t.clientHeight||480);let P=Math.floor(E),I=Math.floor(C);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:P,finalHeight:I,aspectRatio:P/I,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(P,I),h.setPixelRatio(window.devicePixelRatio||1),y.aspect=P/I,y.updateProjectionMatrix();let L=t.getBoundingClientRect();console.log("[THREE-BASE] applySize after setting:",{rendererSize:{width:h.domElement.width,height:h.domElement.height},rendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height},containerRect:{width:L.width,height:L.height},cameraAspect:y.aspect,matches:{width:Math.abs(h.domElement.width-L.width)<1,height:Math.abs(h.domElement.height-L.height)<1},sizeDifference:{width:h.domElement.width-L.width,height:h.domElement.height-L.height}})};requestAnimationFrame(()=>{requestAnimationFrame(()=>{w()})});let v=!1;Re.on("pause",()=>{v=!0,document.querySelectorAll("audio").forEach(f=>f.pause())}),Re.on("resume",()=>{v=!1,document.querySelectorAll("audio").forEach(f=>{f.currentTime>0&&!f.ended&&f.play().catch(()=>{})})});let b=new Ue(t,r);return Re.on("resize",({payload:m})=>{console.log("[THREE-BASE] Handler resize event received:",{payload:m,timestamp:Date.now(),rootRect:t.getBoundingClientRect()}),w({width:m==null?void 0:m.width,height:m==null?void 0:m.height}),b.updateLayout()}),window.addEventListener("resize",()=>{console.log("[THREE-BASE] Window resize event received:",{timestamp:Date.now(),windowSize:{width:window.innerWidth,height:window.innerHeight},rootRect:t.getBoundingClientRect()}),w(),b.updateLayout()}),{scene:l,camera:y,renderer:h,uiSystem:b,applySize:w}}var z=ge(require("three"),1),ot=class{constructor(e){var n,i;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(n=e==null?void 0:e.scale)!=null?n:1,this.rotation=(i=e==null?void 0:e.rotation)!=null?i:0}update(e){e.position!==void 0&&(this.position={...e.position}),e.scale!==void 0&&(this.scale=e.scale),e.rotation!==void 0&&(this.rotation=e.rotation)}syncToThree(e){let n=e.position.z,i=n===0||!isFinite(n)?.5:n;e.position.set(this.position.x,this.position.y,i),e.scale.set(this.scale,this.scale,this.scale),e.rotation.z=this.rotation}},lt=class{constructor(e){var n,i,a,s;this.z_index=(n=e==null?void 0:e.z_index)!=null?n:0,this.alpha=(i=e==null?void 0:e.alpha)!=null?i:1,this.visible=(a=e==null?void 0:e.visible)!=null?a:!0,this.tint=(s=e==null?void 0:e.tint)!=null?s:null}update(e){e.z_index!==void 0&&(this.z_index=e.z_index),e.alpha!==void 0&&(this.alpha=e.alpha),e.visible!==void 0&&(this.visible=e.visible),e.tint!==void 0&&(this.tint=e.tint)}syncToThree(e){if(e.renderOrder=this.z_index,e.visible=this.visible,e instanceof z.Mesh&&e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n instanceof z.Material&&(n.opacity=this.alpha,n.transparent=this.alpha<1)}):e.material instanceof z.Material&&(e.material.opacity=this.alpha,e.material.transparent=this.alpha<1)),this.tint!==null&&e instanceof z.Mesh&&e.material){let n=typeof this.tint=="string"?new z.Color(this.tint):new z.Color(this.tint);Array.isArray(e.material)?e.material.forEach(i=>{(i instanceof z.MeshBasicMaterial||i instanceof z.MeshStandardMaterial)&&i.color.copy(n)}):(e.material instanceof z.MeshBasicMaterial||e.material instanceof z.MeshStandardMaterial)&&e.material.color.copy(n)}}},ct=class{constructor(e,n,i,a){this.instanceId=e,this.objectConfig=n,this.threeObject=i,this._config=a,this.transform=new ot(a.transform),this.renderer=new lt(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,n){this.transform.position={x:e,y:n},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToThree(this.threeObject)}},Dt=class{constructor(e){this.objects=new Map;this.config=e}create(e,n){let i=this.config.objects.get(e);if(!i)throw new Error(`Object config not found: ${e}`);let a=new ct(e,i.object_config||e,n,i);return this.objects.set(e,a),a}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[n,i]of this.objects.entries()){let a=e.objects.get(n);a&&i.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var Nt={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function ee(t){let e=Nt[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function te(t){var n;let e=Nt[t];return e&&(n=e.weight)!=null?n:"400"}function bs(t,e){Nt[t]=e}function vs(){return Object.keys(Nt)}var qe=ge(require("three"),1);function Me(t){return{element:t,get alpha(){return parseFloat(t.style.opacity||"1")},set alpha(e){t.style.opacity=e.toString()},get visible(){return t.style.display!=="none"},set visible(e){t.style.display=e?"":"none"},position:{set(e,n){t.style.left=`${e}px`,t.style.top=`${n}px`},get x(){return parseFloat(t.style.left||"0")},get y(){return parseFloat(t.style.top||"0")}},scale:{set(e,n){t.style.transform=`scale(${e})`},get x(){let e=t.style.transform.match(/scale\(([^)]+)\)/);return e?parseFloat(e[1]):1}}}}function ws(t,e,n,i){var ii,ai,si,ri,oi,li,ci,di,pi,ui,gi,hi,mi,fi,yi,bi,vi,wi,xi,Si,Ei,Ci,Ai,Ti,Li,ki,Pi,Mi,_i,Ii,ji,Oi,Ri,zi,$i,Hi,Di,Ni,Fi,Bi,Gi,Ui,qi,Vi,Wi,Yi,Xi,
|
|
268
|
+
`)});let E=f.width,C=f.height;if((E<=0||!isFinite(E))&&(console.warn("[THREE-BASE] Invalid boundingRect.width, using clientWidth fallback",{boundingRectWidth:f.width,clientWidth:t.clientWidth}),E=t.clientWidth||window.innerWidth||320),(C<=0||!isFinite(C))&&(console.warn("[THREE-BASE] Invalid boundingRect.height, using clientHeight fallback",{boundingRectHeight:f.height,clientHeight:t.clientHeight}),C=t.clientHeight||window.innerHeight||480),typeof(m==null?void 0:m.width)=="number"&&m.width>0){let R=Math.abs(m.width-f.width),j=f.width*.1;R>j?console.warn("[THREE-BASE] Provided width ignored (too different from container):",{provided:m.width,container:f.width,difference:R,tolerance:j,willUse:"container size (boundingRect)"}):(E=m.width,console.log("[THREE-BASE] Using provided width (within tolerance):",{provided:m.width,container:f.width}))}if(typeof(m==null?void 0:m.height)=="number"&&m.height>0){let R=Math.abs(m.height-f.height),j=f.height*.1;R>j?console.warn("[THREE-BASE] Provided height ignored (too different from container):",{provided:m.height,container:f.height,difference:R,tolerance:j,willUse:"container size (boundingRect)"}):(C=m.height,console.log("[THREE-BASE] Using provided height (within tolerance):",{provided:m.height,container:f.height}))}(E<=0||C<=0||!isFinite(E)||!isFinite(C))&&(console.warn("[THREE-BASE] Invalid size in applySize, using fallback",{newWidth:E,newHeight:C,size:m,rootRect:f}),E=f.width||t.clientWidth||320,C=f.height||t.clientHeight||480);let P=Math.floor(E),I=Math.floor(C);console.log("[THREE-BASE] applySize setting renderer size:",{finalWidth:P,finalHeight:I,aspectRatio:P/I,beforeRendererSize:{width:h.domElement.width,height:h.domElement.height},beforeRendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height}}),h.setSize(P,I),h.setPixelRatio(window.devicePixelRatio||1),y.aspect=P/I,y.updateProjectionMatrix();let L=t.getBoundingClientRect();console.log("[THREE-BASE] applySize after setting:",{rendererSize:{width:h.domElement.width,height:h.domElement.height},rendererStyle:{width:h.domElement.style.width,height:h.domElement.style.height},containerRect:{width:L.width,height:L.height},cameraAspect:y.aspect,matches:{width:Math.abs(h.domElement.width-L.width)<1,height:Math.abs(h.domElement.height-L.height)<1},sizeDifference:{width:h.domElement.width-L.width,height:h.domElement.height-L.height}})};requestAnimationFrame(()=>{requestAnimationFrame(()=>{w()})});let v=!1;Re.on("pause",()=>{v=!0,document.querySelectorAll("audio").forEach(f=>f.pause())}),Re.on("resume",()=>{v=!1,document.querySelectorAll("audio").forEach(f=>{f.currentTime>0&&!f.ended&&f.play().catch(()=>{})})});let b=new Ue(t,r);return Re.on("resize",({payload:m})=>{console.log("[THREE-BASE] Handler resize event received:",{payload:m,timestamp:Date.now(),rootRect:t.getBoundingClientRect()}),w({width:m==null?void 0:m.width,height:m==null?void 0:m.height}),b.updateLayout()}),window.addEventListener("resize",()=>{console.log("[THREE-BASE] Window resize event received:",{timestamp:Date.now(),windowSize:{width:window.innerWidth,height:window.innerHeight},rootRect:t.getBoundingClientRect()}),w(),b.updateLayout()}),{scene:l,camera:y,renderer:h,uiSystem:b,applySize:w}}var z=ge(require("three"),1),ot=class{constructor(e){var n,i;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(n=e==null?void 0:e.scale)!=null?n:1,this.rotation=(i=e==null?void 0:e.rotation)!=null?i:0}update(e){e.position!==void 0&&(this.position={...e.position}),e.scale!==void 0&&(this.scale=e.scale),e.rotation!==void 0&&(this.rotation=e.rotation)}syncToThree(e){let n=e.position.z,i=n===0||!isFinite(n)?.5:n;e.position.set(this.position.x,this.position.y,i),e.scale.set(this.scale,this.scale,this.scale),e.rotation.z=this.rotation}},lt=class{constructor(e){var n,i,a,s;this.z_index=(n=e==null?void 0:e.z_index)!=null?n:0,this.alpha=(i=e==null?void 0:e.alpha)!=null?i:1,this.visible=(a=e==null?void 0:e.visible)!=null?a:!0,this.tint=(s=e==null?void 0:e.tint)!=null?s:null}update(e){e.z_index!==void 0&&(this.z_index=e.z_index),e.alpha!==void 0&&(this.alpha=e.alpha),e.visible!==void 0&&(this.visible=e.visible),e.tint!==void 0&&(this.tint=e.tint)}syncToThree(e){if(e.renderOrder=this.z_index,e.visible=this.visible,e instanceof z.Mesh&&e.material&&(Array.isArray(e.material)?e.material.forEach(n=>{n instanceof z.Material&&(n.opacity=this.alpha,n.transparent=this.alpha<1)}):e.material instanceof z.Material&&(e.material.opacity=this.alpha,e.material.transparent=this.alpha<1)),this.tint!==null&&e instanceof z.Mesh&&e.material){let n=typeof this.tint=="string"?new z.Color(this.tint):new z.Color(this.tint);Array.isArray(e.material)?e.material.forEach(i=>{(i instanceof z.MeshBasicMaterial||i instanceof z.MeshStandardMaterial)&&i.color.copy(n)}):(e.material instanceof z.MeshBasicMaterial||e.material instanceof z.MeshStandardMaterial)&&e.material.color.copy(n)}}},ct=class{constructor(e,n,i,a){this.instanceId=e,this.objectConfig=n,this.threeObject=i,this._config=a,this.transform=new ot(a.transform),this.renderer=new lt(a.render),this.sync()}sync(){this.transform.syncToThree(this.threeObject),this.renderer.syncToThree(this.threeObject)}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,n){this.transform.position={x:e,y:n},this.transform.syncToThree(this.threeObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToThree(this.threeObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToThree(this.threeObject)}},Dt=class{constructor(e){this.objects=new Map;this.config=e}create(e,n){let i=this.config.objects.get(e);if(!i)throw new Error(`Object config not found: ${e}`);let a=new ct(e,i.object_config||e,n,i);return this.objects.set(e,a),a}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[n,i]of this.objects.entries()){let a=e.objects.get(n);a&&i.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var Nt={"brand.primary":{family:"Arial, sans-serif",weight:"400"},"brand.warning":{family:"Arial Black, Arial, sans-serif",weight:"900"},"brand.heading":{family:"Arial Black, Arial, sans-serif",weight:"800"},"brand.body":{family:"Arial, sans-serif",weight:"400"}};function ee(t){let e=Nt[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function te(t){var n;let e=Nt[t];return e&&(n=e.weight)!=null?n:"400"}function bs(t,e){Nt[t]=e}function vs(){return Object.keys(Nt)}var qe=ge(require("three"),1);function Me(t){return{element:t,get alpha(){return parseFloat(t.style.opacity||"1")},set alpha(e){t.style.opacity=e.toString()},get visible(){return t.style.display!=="none"},set visible(e){t.style.display=e?"":"none"},position:{set(e,n){t.style.left=`${e}px`,t.style.top=`${n}px`},get x(){return parseFloat(t.style.left||"0")},get y(){return parseFloat(t.style.top||"0")}},scale:{set(e,n){t.style.transform=`scale(${e})`},get x(){let e=t.style.transform.match(/scale\(([^)]+)\)/);return e?parseFloat(e[1]):1}}}}function ws(t,e,n,i){var ii,ai,si,ri,oi,li,ci,di,pi,ui,gi,hi,mi,fi,yi,bi,vi,wi,xi,Si,Ei,Ci,Ai,Ti,Li,ki,Pi,Mi,_i,Ii,ji,Oi,Ri,zi,$i,Hi,Di,Ni,Fi,Bi,Gi,Ui,qi,Vi,Wi,Yi,Ki,Xi,Ji,Zi,Qi,ea,ta,na,ia,aa,sa,ra,oa,la,ca;let a=t.objects.get("ui_endgame_1"),s=t.objects.get("ui_endgame_logo_1"),r=t.objects.get("ui_endgame_title_1"),o=t.objects.get("ui_endgame_subtitle_1"),l=t.objects.get("ui_endgame_footer_1"),d=t.objects.get("ui_endgame_cta_1"),p=t.objects.get("ui_endgame_cta_hint_1"),c=t.objects.get("ui_endgame_hand_1"),g=t.engine.runtime||{},u=((ii=a==null?void 0:a.gameplay)==null?void 0:ii.tuning)||{},y=(a==null?void 0:a.render)||{},h=i.getBoundingClientRect(),w=h.width>0?h.width*.9:320,v=h.height>0?h.height*.85:400,b=Math.min((ai=u.panel_width)!=null?ai:320,w),m=Math.min((si=u.panel_height)!=null?si:400,v),f=(ri=u.panel_padding)!=null?ri:32,S=(oi=u.panel_radius)!=null?oi:24,E=y.background_color||u.panel_bg_color||"#1a0a0a",C=y.background_alpha!==void 0&&y.background_alpha!==null?y.background_alpha:(li=u.panel_bg_alpha)!=null?li:.98,P=y.border_color||u.panel_border_color||"#ffffff",I=(ci=u.panel_border_width)!=null?ci:2,L=(di=u.panel_border_alpha)!=null?di:.3,k=document.createElement("div");k.style.cssText=`
|
|
269
269
|
position: absolute;
|
|
270
270
|
width: ${b}px;
|
|
271
271
|
height: ${m}px;
|
|
@@ -284,7 +284,7 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
284
284
|
z-index: 1000;
|
|
285
285
|
box-sizing: border-box;
|
|
286
286
|
padding: ${f}px;
|
|
287
|
-
`,i.appendChild(k);let R=Me(k);R.element=k;let j=((pi=s==null?void 0:s.gameplay)==null?void 0:pi.tuning)||{},be=(s==null?void 0:s.transform)||{},q=(ui=j.logo_size)!=null?ui:56,Y=(gi=be.scale)!=null?gi:1,_e=(mi=(hi=be.offset)==null?void 0:hi.y)!=null?mi:-130,dt=(fi=j.logo_alpha)!=null?fi:1,Ms=new qe.SpriteMaterial({map:n||void 0,transparent:!0,alphaTest:.1}),
|
|
287
|
+
`,i.appendChild(k);let R=Me(k);R.element=k;let j=((pi=s==null?void 0:s.gameplay)==null?void 0:pi.tuning)||{},be=(s==null?void 0:s.transform)||{},q=(ui=j.logo_size)!=null?ui:56,Y=(gi=be.scale)!=null?gi:1,_e=(mi=(hi=be.offset)==null?void 0:hi.y)!=null?mi:-130,dt=(fi=j.logo_alpha)!=null?fi:1,Ms=new qe.SpriteMaterial({map:n||void 0,transparent:!0,alphaTest:.1}),K=new qe.Sprite(Ms);K.position.set(0,_e,0),K.material.opacity=0;let pt=0,ut=0;if(n){let $=n.image;pt=($==null?void 0:$.width)||100,ut=($==null?void 0:$.height)||100}if(pt>0&&ut>0){let $=pt/ut,Xt,Jt;$>1?(Xt=q,Jt=q/$):(Jt=q,Xt=q*$);let mr=Xt/pt*Y,fr=Jt/ut*Y;K.scale.set(mr,fr,1)}else{let $=q/100*Y;K.scale.set($,$,1)}K.targetAlpha=dt,K.baseScaleX=K.scale.x,K.baseScaleY=K.scale.y;let H=r==null?void 0:r.ui,ne=((yi=r==null?void 0:r.gameplay)==null?void 0:yi.tuning)||{},_s=(H==null?void 0:H.text)||"MISSION ACCOMPLISHED",Bn=(H==null?void 0:H.font)||"brand.heading",Bt=(H==null?void 0:H.fontSize)||24,Is=(bi=H==null?void 0:H.letterSpacing)!=null?bi:1,gt=(vi=r==null?void 0:r.render)==null?void 0:vi.tint,js=typeof gt=="string"?gt:gt?`#${gt.toString(16).padStart(6,"0")}`:"#00FF88",Os=b-f*2-30,Rs=ne.font_weight_override?ne.font_weight_override:te(Bn),ve=document.createElement("div");ve.textContent=_s,ve.style.cssText=`
|
|
288
288
|
font-family: ${ee(Bn)};
|
|
289
289
|
font-size: ${Bt}px;
|
|
290
290
|
font-weight: ${Rs};
|
|
@@ -309,10 +309,10 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
309
309
|
position: absolute;
|
|
310
310
|
transform: translate(-50%, -50%);
|
|
311
311
|
white-space: nowrap;
|
|
312
|
-
`;let Wn=Gn+Bt+15,Ns=((Mi=u.subtitle_offset_y)!=null?Mi:Wn+Gt/2)+((_i=qn.animation_start_y_offset)!=null?_i:-10);we.style.top=`${Ns}px`,we.style.left="50%";let Ut=Me(we);Ut.element=we,Ut.animationStartYOffset=(Ii=qn.animation_start_y_offset)!=null?Ii:-10,k.appendChild(we);let ie=l==null?void 0:l.ui,Yn=((ji=l==null?void 0:l.gameplay)==null?void 0:ji.tuning)||{},Fs=(ie==null?void 0:ie.text)||((Oi=g.ui)==null?void 0:Oi.cta_hint)||"Continue the adventure!",
|
|
313
|
-
font-family: ${ee(
|
|
314
|
-
font-size: ${
|
|
315
|
-
font-weight: ${te(
|
|
312
|
+
`;let Wn=Gn+Bt+15,Ns=((Mi=u.subtitle_offset_y)!=null?Mi:Wn+Gt/2)+((_i=qn.animation_start_y_offset)!=null?_i:-10);we.style.top=`${Ns}px`,we.style.left="50%";let Ut=Me(we);Ut.element=we,Ut.animationStartYOffset=(Ii=qn.animation_start_y_offset)!=null?Ii:-10,k.appendChild(we);let ie=l==null?void 0:l.ui,Yn=((ji=l==null?void 0:l.gameplay)==null?void 0:ji.tuning)||{},Fs=(ie==null?void 0:ie.text)||((Oi=g.ui)==null?void 0:Oi.cta_hint)||"Continue the adventure!",Kn=(ie==null?void 0:ie.font)||"brand.body",Xn=(ie==null?void 0:ie.fontSize)||16,mt=(Ri=l==null?void 0:l.render)==null?void 0:Ri.tint,Bs=typeof mt=="string"?mt:mt?`#${mt.toString(16).padStart(6,"0")}`:"#FFFFFF",Gs=(zi=Yn.max_width)!=null?zi:b-f*2,Us=($i=Yn.line_height)!=null?$i:1.4,xe=document.createElement("div");xe.textContent=Fs,xe.style.cssText=`
|
|
313
|
+
font-family: ${ee(Kn)};
|
|
314
|
+
font-size: ${Xn}px;
|
|
315
|
+
font-weight: ${te(Kn)};
|
|
316
316
|
color: ${Bs};
|
|
317
317
|
text-align: center;
|
|
318
318
|
opacity: 0;
|
|
@@ -321,19 +321,19 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
321
321
|
max-width: ${Gs}px;
|
|
322
322
|
line-height: ${Us};
|
|
323
323
|
word-wrap: break-word;
|
|
324
|
-
`;let qs=Wn+Gt+30,Vs=(Hi=u.footer_offset_y)!=null?Hi:qs+
|
|
324
|
+
`;let qs=Wn+Gt+30,Vs=(Hi=u.footer_offset_y)!=null?Hi:qs+Xn/2;xe.style.top=`${Vs}px`,xe.style.left="50%";let qt=Me(xe);qt.element=xe;let Ws=((Di=l==null?void 0:l.render)==null?void 0:Di.alpha)!==void 0&&((Ni=l==null?void 0:l.render)==null?void 0:Ni.alpha)!==null?l.render.alpha:1;qt.targetAlpha=Ws,k.appendChild(xe);let ae=((Fi=d==null?void 0:d.gameplay)==null?void 0:Fi.tuning)||{},N=d==null?void 0:d.ui,Ys=(Bi=ae.button_width)!=null?Bi:260,Jn=(Gi=ae.button_height)!=null?Gi:56,Ks=(Ui=ae.button_radius)!=null?Ui:16,Xs=ae.button_bg_color||((qi=g.theme)==null?void 0:qi.cta_background)||"#ffb43b",Js=(Vi=ae.button_bg_alpha)!=null?Vi:1,Zs=ae.button_border_color||"#ffffff",Qs=(Wi=ae.button_border_width)!=null?Wi:2,il=(Yi=ae.button_border_alpha)!=null?Yi:.2,Vt=(Ki=u.cta_offset_y)!=null?Ki:m*.7,O=document.createElement("button");O.style.cssText=`
|
|
325
325
|
width: ${Ys}px;
|
|
326
326
|
height: ${Jn}px;
|
|
327
|
-
background: ${
|
|
327
|
+
background: ${Xs};
|
|
328
328
|
opacity: ${Js};
|
|
329
329
|
border: ${Qs}px solid ${Zs};
|
|
330
|
-
border-radius: ${
|
|
330
|
+
border-radius: ${Ks}px;
|
|
331
331
|
cursor: pointer;
|
|
332
332
|
opacity: 0;
|
|
333
333
|
position: absolute;
|
|
334
334
|
transform: translate(-50%, -50%);
|
|
335
335
|
box-shadow: inset 0 0 1px rgba(0,0,0,0.15);
|
|
336
|
-
`,O.style.top=`${Vt}px`,O.style.left="50%";let Wt=Me(O);Wt.element=O,Wt.addEventListener=O.addEventListener.bind(O),k.appendChild(O);let er=(N==null?void 0:N.text)||((
|
|
336
|
+
`,O.style.top=`${Vt}px`,O.style.left="50%";let Wt=Me(O);Wt.element=O,Wt.addEventListener=O.addEventListener.bind(O),k.appendChild(O);let er=(N==null?void 0:N.text)||((Xi=g.ui)==null?void 0:Xi.cta_label_end)||"DOWNLOAD",Zn=(N==null?void 0:N.font)||"brand.heading",tr=(N==null?void 0:N.fontSize)||20,nr=ae.button_text_color||((Ji=g.theme)==null?void 0:Ji.cta_text)||"#1a0a0a";O.textContent=er,O.style.fontFamily=ee(Zn),O.style.fontSize=`${tr}px`,O.style.fontWeight=String(te(Zn)),O.style.color=nr,O.style.letterSpacing=`${(Zi=N==null?void 0:N.letterSpacing)!=null?Zi:1}px`;let Qn=Me(O);Qn.element=O;let F=p==null?void 0:p.ui,ei=((Qi=p==null?void 0:p.gameplay)==null?void 0:Qi.tuning)||{},ir=(F==null?void 0:F.text)||"Play the full game",ti=(F==null?void 0:F.font)||"brand.body",ar=(F==null?void 0:F.fontSize)||11,sr=(ea=F==null?void 0:F.letterSpacing)!=null?ea:0,ft=(ta=p==null?void 0:p.render)==null?void 0:ta.tint,rr=typeof ft=="string"?ft:ft?`#${ft.toString(16).padStart(6,"0")}`:"#CCCCCC",Se=document.createElement("div");Se.textContent=ir,Se.style.cssText=`
|
|
337
337
|
font-family: ${ee(ti)};
|
|
338
338
|
font-size: ${ar}px;
|
|
339
339
|
font-weight: ${te(ti)};
|
|
@@ -344,7 +344,7 @@ Style guidelines: ${i.summary}`;this.promptInput.value=a,this.currentPrompt=a}}c
|
|
|
344
344
|
position: absolute;
|
|
345
345
|
transform: translate(-50%, -50%);
|
|
346
346
|
white-space: nowrap;
|
|
347
|
-
`;let or=Vt+Jn/2+20,lr=m-f-10,cr=Math.min(or+((na=ei.animation_start_y_offset)!=null?na:5),lr);Se.style.top=`${cr}px`,Se.style.left="50%";let Yt=Me(Se);Yt.element=Se,Yt.animationStartYOffset=(ia=ei.animation_start_y_offset)!=null?ia:5,k.appendChild(Se);let
|
|
347
|
+
`;let or=Vt+Jn/2+20,lr=m-f-10,cr=Math.min(or+((na=ei.animation_start_y_offset)!=null?na:5),lr);Se.style.top=`${cr}px`,Se.style.left="50%";let Yt=Me(Se);Yt.element=Se,Yt.animationStartYOffset=(ia=ei.animation_start_y_offset)!=null?ia:5,k.appendChild(Se);let Kt=((aa=c==null?void 0:c.gameplay)==null?void 0:aa.tuning)||{},dr=(sa=Kt.hand_offset_x)!=null?sa:50,pr=(ra=Kt.hand_offset_y)!=null?ra:50,ur=(la=(oa=c==null?void 0:c.transform)==null?void 0:oa.scale)!=null?la:.1875,gr=(ca=Kt.hand_scale_multiplier)!=null?ca:2.5,hr=new qe.SpriteMaterial({map:e||void 0,transparent:!0,alphaTest:.1}),We=new qe.Sprite(hr),ni=ur*gr*100;return We.scale.set(ni,ni,1),We.position.set(dr,Vt+pr,0),We.material.opacity=0,We.visible=!1,{panel:R,logo:K,title:Un,subtitle:Ut,footer:qt,ctaButton:Wt,ctaText:Qn,ctaHint:Yt,hand:We}}function xs(t,e,n){var E,C,P,I,L,k,R,j;let i=e.objects.get("ui_endgame_1"),a=((E=i==null?void 0:i.gameplay)==null?void 0:E.tuning)||{},s=(C=a.animation_duration_ms)!=null?C:800,r=(P=a.fade_in_duration_ms)!=null?P:600,o=(I=a.scale_animation_intensity)!=null?I:.1,l=(L=a.logo_animation_delay_ms)!=null?L:100,d=(k=a.title_animation_delay_ms)!=null?k:200,p=(R=a.footer_animation_delay_ms)!=null?R:300,c=(j=a.cta_animation_delay_ms)!=null?j:400,{panel:g,logo:u,title:y,subtitle:h,footer:w,ctaButton:v,ctaText:b,ctaHint:m}=t;g.visible=!0,g.element.style.visibility="visible";let f=Date.now(),S=()=>{let be=Date.now()-f,q=Math.min(be/r,1),Y=1-Math.pow(1-q,3);g.alpha=Y,g.element.style.opacity=Y.toString();let _e=1+o*(1-Y);g.element.style.transform=`translate(-50%, -50%) scale(${_e})`,q<1?requestAnimationFrame(S):(setTimeout(()=>Yo(u,s,e),l),setTimeout(()=>{Ko(y,s),setTimeout(()=>Xo(h,s),50)},d),setTimeout(()=>Jo(w,s),p),setTimeout(()=>{Zo(v,b,s),setTimeout(()=>Qo(m,s),50),n&&n()},c))};S()}function Yo(t,e,n){var g,u,y,h,w;let i=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(u=(((g=i==null?void 0:i.gameplay)==null?void 0:g.tuning)||{}).animation_start_scale)!=null?u:1.2,r=Date.now(),o=t.material.opacity,l=(y=t.targetAlpha)!=null?y:1,d=(h=t.baseScaleX)!=null?h:t.scale.x,p=(w=t.baseScaleY)!=null?w:t.scale.y,c=()=>{let v=Date.now()-r,b=Math.min(v/e,1),m=1-Math.pow(1-b,2);t.material.opacity=o+(l-o)*m;let f=s+(1-s)*m;t.scale.set(d*f,p*f,1),b<1&&requestAnimationFrame(c)};c()}function Ko(t,e){let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=()=>{let r=Date.now()-n,o=Math.min(r/e,1),l=1-Math.pow(1-o,2);t.element.style.opacity=(i+(1-i)*l).toString(),t.element.style.top=`${a-20*(1-l)}px`,o<1&&requestAnimationFrame(s)};s()}function Xo(t,e){var o;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=a-((o=t.animationStartYOffset)!=null?o:-10),r=()=>{let l=Date.now()-n,d=Math.min(l/e,1),p=1-Math.pow(1-d,2);t.element.style.opacity=(i+(1-i)*p).toString(),t.element.style.top=`${a+(s-a)*p}px`,d<1&&requestAnimationFrame(r)};r()}function Jo(t,e){var r;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=(r=t.targetAlpha)!=null?r:1,s=()=>{let o=Date.now()-n,l=Math.min(o/e,1),d=1-Math.pow(1-l,2);t.element.style.opacity=(i+(a-i)*d).toString(),l<1&&requestAnimationFrame(s)};s()}function Zo(t,e,n){let i=Date.now(),a=parseFloat(t.element.style.opacity||"0"),s=()=>{let r=Date.now()-i,o=Math.min(r/n,1),l=1-Math.pow(1-o,2);t.element.style.opacity=(a+(1-a)*l).toString(),e.element.style.opacity=(a+(1-a)*l).toString(),t.element.style.transform=`translate(-50%, -50%) scale(${1+.1*(1-l)})`,o<1&&requestAnimationFrame(s)};s()}function Qo(t,e){var o;let n=Date.now(),i=parseFloat(t.element.style.opacity||"0"),a=parseFloat(t.element.style.top||"0"),s=a-((o=t.animationStartYOffset)!=null?o:5),r=()=>{let l=Date.now()-n,d=Math.min(l/e,1),p=1-Math.pow(1-d,2);t.element.style.opacity=(i+(1-i)*p).toString(),t.element.style.top=`${a+(s-a)*p}px`,d<1&&requestAnimationFrame(r)};r()}function Ss(t,e,n,i){var p,c,g,u;let a=n.objects.get("ui_endgame_hand_1"),s=((p=a==null?void 0:a.gameplay)==null?void 0:p.tuning)||{},r=(c=s.click_animation_duration_ms)!=null?c:600,o=(g=s.click_delay_ms)!=null?g:2e3,l=(u=s.click_repeat_delay_ms)!=null?u:3e3,d=()=>{var C,P;t.visible=!0,t.material.opacity=1;let y=t.position.x,h=t.position.y,w=(C=s.hand_offset_x)!=null?C:50,v=(P=s.hand_offset_y)!=null?P:50,b=e.element.getBoundingClientRect(),m=w,f=v,S=Date.now(),E=()=>{var Y,_e,dt;let I=Date.now()-S,L=Math.min(I/r,1),k=L<.5?2*L*L:1-Math.pow(-2*L+2,2)/2;t.position.set(y+(m-y)*k,h+(f-h)*k,0);let R=(_e=(Y=a==null?void 0:a.transform)==null?void 0:Y.scale)!=null?_e:.1875,j=(dt=s.hand_scale_multiplier)!=null?dt:2.5,be=R*j*100,q=be+be*.2*Math.sin(L*Math.PI);t.scale.set(q,q,1),L<1?requestAnimationFrame(E):(e.element.style.transform="translate(-50%, -50%) scale(0.95)",setTimeout(()=>{e.element.style.transform="translate(-50%, -50%) scale(1)",i()},100),setTimeout(()=>{t.material.opacity=0,setTimeout(()=>{t.position.set(y,h,0),d()},l)},500))};E()};setTimeout(d,o)}var Ft=ge(require("three"),1);function Es(t,e,n){var u,y,h,w,v,b,m;let i=e.objects.get("hand_tutorial_1"),a=((u=i==null?void 0:i.gameplay)==null?void 0:u.tuning)||{},s=(i==null?void 0:i.render)||{},r=(i==null?void 0:i.transform)||{},o=new Ft.SpriteMaterial({map:t||void 0,transparent:!0,alphaTest:.1}),l=new Ft.Sprite(o),d=r.position||{},p=(y=d==null?void 0:d.z)!=null?y:0;l.position.set(n.x+((h=d==null?void 0:d.x)!=null?h:0),n.y+((w=d==null?void 0:d.y)!=null?w:0),p),l.material.opacity=s.alpha!==void 0&&s.alpha!==null?s.alpha:0,l.visible=s.visible!==void 0&&s.visible!==null?s.visible:!1;let c=(v=a.hand_scale_multiplier)!=null?v:2.5,g=(b=r.scale)!=null?b:.1875;return l.scale.set(g*c*100,g*c*100,1),l.renderOrder=(m=s.z_index)!=null?m:99999,l}function Cs(t){var y,h,w,v,b,m,f,S,E;let e=t.objects.get("ui_tutorial_1"),n=e==null?void 0:e.ui,i=(e==null?void 0:e.render)||{},a=((y=t.engine.runtime)==null?void 0:y.ui_styles)||{},s=((h=t.engine.runtime)==null?void 0:h.ui)||{},r=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",o=(n==null?void 0:n.font)||"brand.warning",l=(n==null?void 0:n.fontSize)||a.label_font_size||52,d=(v=n==null?void 0:n.letterSpacing)!=null?v:(w=a.label_letter_spacing)!=null?w:-1,p=(n==null?void 0:n.align)||"center",c=i.tint,g=typeof c=="string"?c:c?`#${c.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",u=document.createElement("div");return u.textContent=r,u.style.cssText=`
|
|
348
348
|
font-family: ${ee(o)};
|
|
349
349
|
font-size: ${l}px;
|
|
350
350
|
font-weight: ${te(o)};
|