handler-playable-sdk 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConfigOverride-6YH2ILBJ.mjs +1 -0
- package/dist/chunk-BDZGKN5O.mjs +1 -0
- package/dist/chunk-GYW3GFXA.mjs +830 -0
- package/dist/chunk-HN7I4BLB.mjs +1 -0
- package/dist/config-QLS2MDB6.mjs +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.mts +388 -2
- package/dist/index.d.ts +388 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/loader-object-centric-C1QteFfG.d.mts +81 -0
- package/dist/loader-object-centric-C1QteFfG.d.ts +81 -0
- package/dist/pixi/index.css +1 -0
- package/dist/pixi/index.d.mts +388 -97
- package/dist/pixi/index.d.ts +388 -97
- package/dist/pixi/index.js +8 -8
- package/dist/pixi/index.mjs +1 -11
- package/dist/three/index.css +1 -0
- package/dist/three/index.js +55 -55
- package/dist/three/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-U4PCKCX6.mjs +0 -17
package/dist/pixi/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var lt=Object.defineProperty;var di=Object.getOwnPropertyDescriptor;var ui=Object.getOwnPropertyNames;var pi=Object.prototype.hasOwnProperty;var fi=(t,e)=>{for(var n in e)lt(t,n,{get:e[n],enumerable:!0})},hi=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ui(e))!pi.call(t,a)&&a!==n&<(t,a,{get:()=>e[a],enumerable:!(s=di(e,a))||s.enumerable});return t};var mi=t=>hi(lt({},"__esModule",{value:!0}),t);var Wi={};fi(Wi,{AssetCache:()=>Q,AssetLoader:()=>Te,GameObject:()=>Ne,GameObjectManager:()=>Ue,ObjectFactory:()=>st,Renderer:()=>De,Transform:()=>Pe,animateHandClick:()=>bs,animatePanelEntrance:()=>_s,createEndGamePanel:()=>gs,createHandTutorial:()=>ws,createPixiBase:()=>hs,createTutorialLabel:()=>xs,getRegisteredFontIds:()=>ys,playLottieOverlay:()=>Ts,registerFont:()=>ms,registerType:()=>nt,resolveFont:()=>X,resolveFontWeight:()=>K,setLottieInstance:()=>As,updateHandAnimation:()=>Ss});module.exports=mi(Wi);var fs=require("pixi.js");var re={};function Ge(t,e,n=!1){re[t]||(re[t]=[]),re[t].push({fn:e,once:n})}function ct(t,e){if(re[t]){if(!e){delete re[t];return}re[t]=re[t].filter(n=>n.fn!==e)}}function Je(t,...e){let n=re[t];if(n)for(let s of[...n])s.fn(...e),s.once&&ct(t,s.fn)}function q(t,e){Ge(t,e,!0)}var je={name:"handler-playable-sdk",version:"0.3.1",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.js"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.mjs",require:"./dist/pixi/index.js"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.mjs",require:"./dist/three/index.js"}},scripts:{build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run obfuscate","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --external lottie-web",obfuscate:"javascript-obfuscator dist/index.js dist/index.mjs dist/pixi/index.js dist/pixi/index.mjs dist/three/index.js dist/three/index.mjs --output dist --options-preset high-obfuscation --compact true --self-defending true",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.js patch","publish:update:minor":"node scripts/publish-and-update.js minor","publish:update:major":"node scripts/publish-and-update.js major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.160.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.160.0",eslint:"^8.57.1","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.160.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2"}};var G=0,gi=G++,Bn=G++,zn=G++,Hn=G++,Wn=G++,Yn=G++,qn=G++,Gn=G++,Jn=G++,jn=G++,Vn=G++,Xn=G++,S=gi;function Kn(){return S===Bn}function Qn(){return S===zn}function Zn(){return S===Hn}function Un(){return S===Wn}function ge(){return S===Yn}function _e(){return S===qn}function es(){return S===Gn}function ts(){return S===Jn}function ns(){return S===jn}function dt(){return S===Vn}function ut(){return S===Xn}function ss(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),S=Bn;return}catch{}else if(t==="dapi")try{dapi.isReady(),S=zn;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(S=Hn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(S=Wn)}catch{}else if(e==="mintegral")window.gameReady&&(S=Yn);else if(e==="tapjoy")window.TJ_API&&(S=qn);else if(e==="tiktok")window.openAppStore&&(S=Gn);else if(e==="smadex")try{window.smxTracking&&(S=Jn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(S=jn)}catch{}else e==="vungle"?S=Vn:(t==="nucleo"||e==="nucleo")&&(S=Xn)}var cs={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},_i=Math.random().toString(36).slice(2),be=null,Le={...cs},ds="web_embed",bi={},pt=!1,Ee=!1,Oe=!1,us=!1,yt=1,ht=0,Qe=!1,ne=!1,Ke="",we=Math.floor(window.innerWidth),xe=Math.floor(window.innerHeight),mt=we>xe,se=!1,Me=!1,is=!1,as=!1,ft=!1,Ve=null;function os(){if(be)return be;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),be=t,t}function Xe(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function ps(t,e){return{event_name:t,ts:Date.now(),session_id:_i,deployment_id:Le.deployment_id,variant_id:Le.variant_id,export_profile_id:Le.profile_id,instance_id:Le.instance_id||"default",env:ds==="mraid"?"mraid":"web",payload:e}}function y(t,e){let n=Xe(t),s=ps(n,e);Je(n,s),n!==t&&Je(t,s)}function Ce(){Ve&&(Ve(we,xe),Ve=null)}function Se(t){yt=t,y("volume",t)}function Ae(t){t&&(us=!0),!Oe&&(Oe=!0,y("pause"),Se(0))}function ke(t){!t&&us||Oe&&(Oe=!1,y("resume"),Se(yt))}function ce(t,e){we=Math.floor(t||window.innerWidth),xe=Math.floor(e||window.innerHeight),mt=we>xe,y("resize",{width:we,height:xe})}function wi(){if(Kn())try{let t=mraid.getMaxSize();ce(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?ke():Ae()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();ce(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();Se(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&Se(n>0?1:0)}),mraid.addEventListener("error",(n,s)=>{console.warn("mraid error:",n,"action:",s)}),Qe=!0,mraid.isViewable()&&mraid.getState()!=="hidden")se=!0,y("boot"),y("view"),y("ready"),ne=!0,Ce();else{let n=()=>{se=!0,y("boot"),y("view"),y("ready"),ne=!0,Ce()};mraid.addEventListener("ready",n)}}catch(t){console.warn("MRAID hook skipped",t)}}function xi(){if(Qn())try{let t=dapi.getScreenSize();ce(t.width,t.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?ke():Ae()}),dapi.addEventListener("adResized",n=>{let s=dapi.getScreenSize();ce(n.width||s.width,n.height||s.height)});let e=dapi.getAudioVolume();if(Se(e?1:0),dapi.addEventListener("audioVolumeChange",n=>Se(n?1:0)),Qe=!0,dapi.isViewable())se=!0,y("boot"),y("view"),y("ready"),ne=!0,Ce();else{let n=()=>{se=!0,y("boot"),y("view"),y("ready"),ne=!0,Ce()};dapi.addEventListener("ready",n)}}catch(t){console.warn("DAPI hook skipped",t)}}function rs(){let t=()=>{se||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(se=!0,y("boot"),y("view"),y("ready"),ne=!0,Ce(),Me&&(Me=!1,le.start()))};window.addEventListener("resize",()=>ce()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(ke(),t()):Ae()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),Qe=!0}function Si(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(is=!0),!(is&&e instanceof MouseEvent)&&(ht+=1,y("interaction",ht))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function Ai(t){var s,a,i,o,r,c,l,u,h,p,d,m;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(s=window.ExitApi)==null||s.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(_e())(i=(a=window.TJ_API)==null?void 0:a.click)==null||i.call(a);else if(Zn())(r=(o=window.FbPlayableAd)==null?void 0:o.onCTAClick)==null||r.call(o);else if(ns())(l=(c=window.ScPlayableAd)==null?void 0:c.onCTAClick)==null||l.call(c);else if(ts())try{(h=(u=window.smxTracking)==null?void 0:u.redirect)==null||h.call(u)}catch(f){console.warn("Smadex redirect failed",f)}else if(Un()){let f=window.ExitApi;f&&typeof f.exit=="function"?f.exit(t||Ke||""):t&&window.open(t)}else ge()?(p=window.install)==null||p.call(window):es()?(d=window.openAppStore)==null||d.call(window):dt()?(m=parent==null?void 0:parent.postMessage)==null||m.call(parent,"download","*"):t&&window.open(t)}function Ti(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=n=>{if(!n)return;let s=new Image;s.src=n};if(t==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;q("view",()=>e(n.mraid_viewable)),q("start",()=>e(n.game_viewable)),q("engagement",()=>e(n.engagement));let s=()=>e(n.complete);q("complete",s),Ge("engagement",a=>{var i;((i=a==null?void 0:a.payload)==null?void 0:i.count)>3&&s()}),q("cta_click",()=>e(n.click))}else if(t==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;q("view",()=>e(n.Ad_Load_Start)),q("start",()=>e(n.Ad_Viewable)),q("engagement",()=>e(n.First_Engagement)),q("complete",()=>e(n.Gameplay_Complete)),q("cta_click",()=>e(n.DSP_Click)),q("start",()=>{[5,10,15,20,25,30].forEach(s=>setTimeout(()=>e(n[`Spent_${s}_Seconds`]),s*1e3))})}}function vi(){if(!_e())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{le.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function ls(){var e,n,s;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(n=t==null?void 0:t.playableFinished)==null||n.call(t),(s=t==null?void 0:t.gameplayFinished)==null||s.call(t)}function Ei(){ge()&&(window.mintGameStart=()=>{ke(!0),ce()},window.mintGameClose=()=>{Ae(!0)})}function Li(){if(!ut())return;let t=window.NUC;!t||!t.trigger||(le.on("cta_click",()=>{var e,n;return(n=(e=t.trigger).convert)==null?void 0:n.call(e,Ke)}),le.on("complete",()=>{var e,n;return(n=(e=t.trigger).tryAgain)==null?void 0:n.call(e)}))}var le={init(t={},e){if(ds=t.profile||"web_embed",bi=t.consent||{},Le={...cs,...t.ids||{}},be=t.rootEl||be,Ke=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(Ve=e),y("init"),document.body.oncontextmenu=()=>!1,os(),Mi(be),ss(),wi(),xi(),!Qe){if(document.readyState==="complete")rs();else if(!as){as=!0;let n=()=>{rs(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Si(),Ti(),vi(),Ei(),Li(),console.log(`%c @handler/playable-sdk %c v${je.version||"0.0.0"} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),se&&!ne&&(y("boot"),y("view"),y("ready"),Me&&(Me=!1,le.start()),ne=!0),ne=se},getRoot(){return os()},get version(){return je.version||"0.0.0"},get maxWidth(){return we},get maxHeight(){return xe},get isLandscape(){return mt},get isReady(){return ne},get isStarted(){return pt},get isPaused(){return Oe},get isFinished(){return Ee},get volume(){return yt},get interactions(){return ht},on(t,e){Ge(Xe(t),e)},off(t,e){ct(Xe(t),e)},start(){var t,e;if(!pt){if(!se){Me=!0;return}if(pt=!0,y("start"),ce(),ge())Ae(),(t=window.gameReady)==null||t.call(window);else if(_e()){let n=window.TJ_API;(e=n==null?void 0:n.setPlayableBuild)==null||e.call(n,{orientation:mt?"landscape":"portrait",buildID:je.version||"dev"})}}},finish(){var t,e;Ee||(Ee=!0,y("complete"),ge()?(t=window.gameEnd)==null||t.call(window):dt()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):_e()&&ls())},install(t){if(!Ee){Ee=!0,_e()?(ls(),setTimeout(()=>le.install(t),300)):(y("complete"),setTimeout(()=>le.install(t),0));return}ft||(ft=!0,setTimeout(()=>ft=!1,500),y("cta_click"),y("conversion"),Ai(t||Ke))},emit(t,e){let n=Xe(t);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let s=ps(n,e);Je(n,s)},retry(){var t,e,n;if(ge())(t=window.gameRetry)==null||t.call(window);else if(ut()){let s=window.NUC;(n=(e=s==null?void 0:s.trigger)==null?void 0:e.tryAgain)==null||n.call(e)}y("engagement",{action:"retry"})},pause(){Ae(!0)},resume(){ke(!0)},resize(t,e){ce(t,e)}},Ze=le;function Mi(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
|
|
1
|
+
"use strict";var gs=Object.create;var Ut=Object.defineProperty;var hs=Object.getOwnPropertyDescriptor;var fs=Object.getOwnPropertyNames;var bs=Object.getPrototypeOf,ms=Object.prototype.hasOwnProperty;var ut=(t,e)=>()=>(t&&(e=t(t=0)),e);var ys=(t,e)=>{for(var n in e)Ut(t,n,{get:e[n],enumerable:!0})},ea=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of fs(e))!ms.call(t,a)&&a!==n&&Ut(t,a,{get:()=>e[a],enumerable:!(i=hs(e,a))||i.enumerable});return t};var Ln=(t,e,n)=>(n=t!=null?gs(bs(t)):{},ea(e||!t||!t.__esModule?Ut(n,"default",{value:t,enumerable:!0}):n,t)),vs=t=>ea(Ut({},"__esModule",{value:!0}),t);var Xt=ut(()=>{"use strict"});var wa,De,ko,kn=ut(()=>{"use strict";Xt();wa=null,De="dev";if(typeof window!="undefined"){let t=window.__BUILD_SETTINGS__;if(t!=null&&t.buildMode)wa=t,De=t.buildMode,console.log("[CONFIG] Loaded inline build settings:",t,"buildMode:",De);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,De=n.buildMode||"dev",console.log("[CONFIG] Loaded build settings:",n,"buildMode:",De)}else console.log("[CONFIG] No build-settings.json found, using default buildMode:",De)}catch(e){console.log("[CONFIG] Failed to load build-settings.json:",e instanceof Error?e.message:String(e))}}console.log("[CONFIG] Final buildMode:",De);ko=De==="dev"||typeof window!="undefined"&&window.location.search.includes("hot-reload")});var In=ut(()=>{"use strict"});var Ea=ut(()=>{"use strict";In();kn()});var On=ut(()=>{"use strict";kn();In();Ea()});var So={};ys(So,{AssetCache:()=>ge,AssetLoader:()=>Ze,AssetSystem:()=>cn,Assets:()=>_e,BaseSystem:()=>et,GameEngine:()=>rn,GameObject:()=>wt,GameObjectManager:()=>Je,ObjectFactory:()=>Fe,Renderer:()=>xt,RuntimeObjectRegistry:()=>tt,SplashScreen:()=>Qe,Transform:()=>vt,animateHandClick:()=>Fa,animatePanelEntrance:()=>za,applyScreenAnchor:()=>pn,basePixi:()=>Xa,clearResponsiveElements:()=>Ja,createEndGamePanel:()=>Da,createHandTutorial:()=>Na,createPixiBase:()=>nn,createTutorialLabel:()=>$a,getRegisteredFontIds:()=>Ba,globalResponsiveMultipliers:()=>Lt,initAssets:()=>ln,layout:()=>Za,playLottieOverlay:()=>qa,registerFont:()=>Ha,registerType:()=>on,resolveAnchorVec2:()=>fn,resolveFont:()=>oe,resolveFontWeight:()=>re,resolveScreenAnchorPoint:()=>bn,resolveScreenRatioPoint:()=>mn,runInitSequence:()=>es,setLottieInstance:()=>Jt,updateHandAnimation:()=>Ga,updateScreenState:()=>un});module.exports=vs(So);var ja=require("pixi.js");var Le={};function Yt(t,e,n=!1){Le[t]||(Le[t]=[]),Le[t].push({fn:e,once:n})}function An(t,e){if(Le[t]){if(!e){delete Le[t];return}Le[t]=Le[t].filter(n=>n.fn!==e)}}function Wt(t,...e){let n=Le[t];if(n)for(let i of[...n])i.fn(...e),i.once&&An(t,i.fn)}function ae(t,e){Yt(t,e,!0)}var se=0,xs=se++,ta=se++,na=se++,ia=se++,aa=se++,sa=se++,oa=se++,ra=se++,la=se++,ca=se++,da=se++,ua=se++,P=xs;function pa(){return P===ta}function ga(){return P===na}function ha(){return P===ia}function fa(){return P===aa}function qe(){return P===sa}function Ue(){return P===oa}function ba(){return P===ra}function ma(){return P===la}function ya(){return P===ca}function Tn(){return P===da}function Mn(){return P===ua}function va(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),P=ta;return}catch{}else if(t==="dapi")try{dapi.isReady(),P=na;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(P=ia)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(P=aa)}catch{}else if(e==="mintegral")window.gameReady&&(P=sa);else if(e==="tapjoy")window.TJ_API&&(P=oa);else if(e==="tiktok")window.openAppStore&&(P=ra);else if(e==="smadex")try{window.smxTracking&&(P=la)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(P=ca)}catch{}else e==="vungle"?P=da:(t==="nucleo"||e==="nucleo")&&(P=ua)}var Vt=Ln(require("lottie-web")),xa=Vt.default;typeof window!="undefined"&&(window.lottie=Vt.default,window.__baseLottie=Vt.default);On();function z(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Ko=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:z(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:z(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:z(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:z(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:z(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:z(360,780)}],Jo=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:z(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:z(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:z(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:z(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:z(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:z(412,915)}],Qo=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:z(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:z(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:z(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:z(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:z(800,1280)}],_a=[{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:z(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:z(768,1024),mraidScale:.7}];var Zo=[..._a];var As=_a[0];var Kt=require("pixi.js");Xt();var Ca=Ln(require("lottie-web"));Jt(xa);typeof window!="undefined"&&!window.lottie&&(window.lottie=Ca.default);On();Xt();var Pn="0.3.1",Ia={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},Rs=Math.random().toString(36).slice(2),Ye=null,ht={...Ia},Oa="web_embed",js={},Rn=!1,gt=!1,bt=!1,Pa=!1,Dn=1,Hn=0,tn=!1,xe=!1,en="",We=Math.floor(window.innerWidth),Ve=Math.floor(window.innerHeight),Bn=We>Ve,we=!1,ft=!1,La=!1,Aa=!1,jn=!1,Qt=null;function Ta(){if(Ye)return Ye;let t=document.createElement("div");return t.id="handler-root",t.setAttribute("data-handler-root","true"),document.body.appendChild(t),Ye=t,t}function Zt(t){switch(t){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return t}}function Ra(t,e){return{event_name:t,ts:Date.now(),session_id:Rs,deployment_id:ht.deployment_id,variant_id:ht.variant_id,export_profile_id:ht.profile_id,instance_id:ht.instance_id||"default",env:Oa==="mraid"?"mraid":"web",payload:e}}function S(t,e){let n=Zt(t),i=Ra(n,e);Wt(n,i),n!==t&&Wt(t,i)}function mt(){Qt&&(Qt(We,Ve),Qt=null)}function Xe(t){Dn=t,S("volume",t)}function Ke(t){t&&(Pa=!0),!bt&&(bt=!0,S("pause"),Xe(0))}function yt(t){!t&&Pa||bt&&(bt=!1,S("resume"),Xe(Dn))}function Te(t,e){We=Math.floor(t||window.innerWidth),Ve=Math.floor(e||window.innerHeight),Bn=We>Ve,S("resize",{width:We,height:Ve})}function Hs(){if(pa())try{let t=mraid.getMaxSize();Te(t.width,t.height);let e=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?yt():Ke()};if(mraid.addEventListener("viewableChange",e),mraid.addEventListener("stateChange",e),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();Te(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();Xe(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&Xe(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),tn=!0,mraid.isViewable()&&mraid.getState()!=="hidden")we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt();else{let n=()=>{we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt()};mraid.addEventListener("ready",n)}}catch(t){console.warn("MRAID hook skipped",t)}}function Bs(){if(ga())try{let t=dapi.getScreenSize();Te(t.width,t.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?yt():Ke()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();Te(n.width||i.width,n.height||i.height)});let e=dapi.getAudioVolume();if(Xe(e?1:0),dapi.addEventListener("audioVolumeChange",n=>Xe(n?1:0)),tn=!0,dapi.isViewable())we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt();else{let n=()=>{we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt()};dapi.addEventListener("ready",n)}}catch(t){console.warn("DAPI hook skipped",t)}}function Ma(){let t=()=>{we||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(we=!0,S("boot"),S("view"),S("ready"),xe=!0,mt(),ft&&(ft=!1,Ae.start()))};window.addEventListener("resize",()=>Te()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(yt(),t()):Ke()}),document.readyState==="complete"||document.readyState==="interactive"?t():window.addEventListener("load",t),tn=!0}function Ds(){let t=e=>{typeof TouchEvent!="undefined"&&e instanceof TouchEvent&&(La=!0),!(La&&e instanceof MouseEvent)&&(Hn+=1,S("interaction",Hn))};document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}function zs(t){var i,a,s,o,r,c,l,u,g,p,d,f;let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(e==="mraid"&&typeof mraid!="undefined")mraid.open(t||"");else if(e==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(Ue())(s=(a=window.TJ_API)==null?void 0:a.click)==null||s.call(a);else if(ha())(r=(o=window.FbPlayableAd)==null?void 0:o.onCTAClick)==null||r.call(o);else if(ya())(l=(c=window.ScPlayableAd)==null?void 0:c.onCTAClick)==null||l.call(c);else if(ma())try{(g=(u=window.smxTracking)==null?void 0:u.redirect)==null||g.call(u)}catch(h){console.warn("Smadex redirect failed",h)}else if(fa()){let h=window.ExitApi;h&&typeof h.exit=="function"?h.exit(t||en||""):t&&window.open(t)}else qe()?(p=window.install)==null||p.call(window):ba()?(d=window.openAppStore)==null||d.call(window):Tn()?(f=parent==null?void 0:parent.postMessage)==null||f.call(parent,"download","*"):t&&window.open(t)}function Fs(){let t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",e=n=>{if(!n)return;let i=new Image;i.src=n};if(t==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;ae("view",()=>e(n.mraid_viewable)),ae("start",()=>e(n.game_viewable)),ae("engagement",()=>e(n.engagement));let i=()=>e(n.complete);ae("complete",i),Yt("engagement",a=>{var s;((s=a==null?void 0:a.payload)==null?void 0:s.count)>3&&i()}),ae("cta_click",()=>e(n.click))}else if(t==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;ae("view",()=>e(n.Ad_Load_Start)),ae("start",()=>e(n.Ad_Viewable)),ae("engagement",()=>e(n.First_Engagement)),ae("complete",()=>e(n.Gameplay_Complete)),ae("cta_click",()=>e(n.DSP_Click)),ae("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>e(n[`Spent_${i}_Seconds`]),i*1e3))})}}function Ns(){if(!Ue())return;let t=window.TJ_API;t&&t.setPlayableAPI&&t.setPlayableAPI({skipAd:()=>{try{Ae.finish()}catch(e){console.warn("Tapjoy skip failed",e)}}})}function ka(){var e,n,i;let t=window.TJ_API;(e=t==null?void 0:t.objectiveComplete)==null||e.call(t),(n=t==null?void 0:t.playableFinished)==null||n.call(t),(i=t==null?void 0:t.gameplayFinished)==null||i.call(t)}function $s(){qe()&&(window.mintGameStart=()=>{yt(!0),Te()},window.mintGameClose=()=>{Ke(!0)})}function Gs(){if(!Mn())return;let t=window.NUC;!t||!t.trigger||(Ae.on("cta_click",()=>{var e,n;return(n=(e=t.trigger).convert)==null?void 0:n.call(e,en)}),Ae.on("complete",()=>{var e,n;return(n=(e=t.trigger).tryAgain)==null?void 0:n.call(e)}))}var Ae={init(t={},e){if(Oa=t.profile||"web_embed",js=t.consent||{},ht={...Ia,...t.ids||{}},Ye=t.rootEl||Ye,en=t.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),e&&(Qt=e),S("init"),document.body.oncontextmenu=()=>!1,Ta(),qs(Ye),va(),Hs(),Bs(),!tn){if(document.readyState==="complete")Ma();else if(!Aa){Aa=!0;let n=()=>{Ma(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Ds(),Fs(),Ns(),$s(),Gs(),console.log(`%c @handler/playable-sdk %c v${Pn} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),we&&!xe&&(S("boot"),S("view"),S("ready"),ft&&(ft=!1,Ae.start()),xe=!0),xe=we},getRoot(){return Ta()},get version(){return Pn},get maxWidth(){return We},get maxHeight(){return Ve},get isLandscape(){return Bn},get isReady(){return xe},get isStarted(){return Rn},get isPaused(){return bt},get isFinished(){return gt},get volume(){return Dn},get interactions(){return Hn},on(t,e){Yt(Zt(t),e)},off(t,e){An(Zt(t),e)},start(){var t,e;if(!Rn){if(!we){ft=!0;return}if(Rn=!0,S("start"),Te(),qe())Ke(),(t=window.gameReady)==null||t.call(window);else if(Ue()){let n=window.TJ_API;(e=n==null?void 0:n.setPlayableBuild)==null||e.call(n,{orientation:Bn?"landscape":"portrait",buildID:Pn})}}},finish(){var t,e;gt||(gt=!0,S("complete"),qe()?(t=window.gameEnd)==null||t.call(window):Tn()?(e=parent==null?void 0:parent.postMessage)==null||e.call(parent,"complete","*"):Ue()&&ka())},install(t){if(!gt){gt=!0,Ue()?(ka(),setTimeout(()=>Ae.install(t),300)):(S("complete"),setTimeout(()=>Ae.install(t),0));return}jn||(jn=!0,setTimeout(()=>jn=!1,500),S("cta_click"),S("conversion"),zs(t||en))},emit(t,e){let n=Zt(t);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${t} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=Ra(n,e);Wt(n,i)},retry(){var t,e,n;if(qe())(t=window.gameRetry)==null||t.call(window);else if(Mn()){let i=window.NUC;(n=(e=i==null?void 0:i.trigger)==null?void 0:e.tryAgain)==null||n.call(e)}S("engagement",{action:"retry"})},pause(){Ke(!0)},resume(){yt(!0)},resize(t,e){Te(t,e)}},pt=Ae;function qs(t){let e=document.createElement("script");e.type="text/javascript",e.textContent=`
|
|
2
2
|
(function(){
|
|
3
3
|
var events = ['touchstart','touchend','mousedown','keydown'];
|
|
4
4
|
function unlock(){
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
}
|
|
15
15
|
events.forEach(function(e){ document.addEventListener(e, unlock, false); });
|
|
16
16
|
})();
|
|
17
|
-
`,t.appendChild(e)}async function hs(t,e={}){let n=new fs.Application;await n.init({resizeTo:t,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let s=i=>{var c,l,u,h,p,d;if(!n.renderer)return;let o=(u=(l=(c=i==null?void 0:i.width)!=null?c:t.clientWidth)!=null?l:window.innerWidth)!=null?u:320,r=(d=(p=(h=i==null?void 0:i.height)!=null?h:t.clientHeight)!=null?p:window.innerHeight)!=null?d:480;n.renderer.resize(o,r)};t.innerHTML="",t.style.position="relative",t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="stretch",t.style.width="100%",t.style.height="100dvh",t.style.minHeight="100vh",t.style.maxWidth="100%",t.style.maxHeight="100%",t.style.boxSizing="border-box",t.style.overflow="hidden",e.background&&(t.style.background=e.background),t.appendChild(n.canvas);let a=document.createElement("div");return a.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),t.appendChild(a),Ze.on("pause",()=>{n.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),Ze.on("resume",()=>{n.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),Ze.on("resize",({payload:i})=>{s({width:i==null?void 0:i.width,height:i==null?void 0:i.height})}),window.addEventListener("resize",()=>s()),requestAnimationFrame(()=>s()),{app:n,stage:n.stage,overlay:a,applySize:s}}var Pe=class{constructor(e){var n,s;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=(s=e==null?void 0:e.rotation)!=null?s: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)}syncToPixi(e){e.position.set(this.position.x,this.position.y),e.scale.set(this.scale),e.rotation=this.rotation}},De=class{constructor(e){var n,s,a,i;this.z_index=(n=e==null?void 0:e.z_index)!=null?n:0,this.alpha=(s=e==null?void 0:e.alpha)!=null?s:1,this.visible=(a=e==null?void 0:e.visible)!=null?a:!0,this.tint=(i=e==null?void 0:e.tint)!=null?i: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)}syncToPixi(e){e.zIndex=this.z_index,e.alpha=this.alpha,e.visible=this.visible,this.tint!==null&&"tint"in e&&(e.tint=this.tint)}},Ne=class{constructor(e,n,s,a){this.instanceId=e,this.objectConfig=n,this.pixiObject=s,this._config=a,this.transform=new Pe(a.transform),this.renderer=new De(a.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject),this.applyAnchor(),this.applyEffectsScale()}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}applyAnchor(){var a,i,o,r;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let e=(i=(a=this._config)==null?void 0:a.render)==null?void 0:i.anchor,n=(r=(o=this._config)==null?void 0:o.transform)==null?void 0:r.anchor,s=e&&typeof e=="object"?e:n&&typeof n=="object"?n:null;s&&typeof s.x=="number"&&typeof s.y=="number"&&this.pixiObject.anchor.set(s.x,s.y)}applyEffectsScale(){var i,o,r;if(!((i=this.pixiObject)!=null&&i.scale))return;let e=(o=this._config)==null?void 0:o.effects,n=typeof(e==null?void 0:e.scale_x)=="number"?e.scale_x:1,s=typeof(e==null?void 0:e.scale_y)=="number"?e.scale_y:1;if(n===1&&s===1)return;let a=(r=this.transform.scale)!=null?r:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(a*n,a*s):(this.pixiObject.scale.x=a*n,this.pixiObject.scale.y=a*s)}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,n){this.transform.position={x:e,y:n},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToPixi(this.pixiObject)}},Ue=class{constructor(e){this.objects=new Map;this.config=e}create(e,n){let s=this.config.objects.get(e);if(!s)throw new Error(`Object config not found: ${e}`);let a=new Ne(e,s.object_config||e,n,s);return this.objects.set(e,a),a}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[n,s]of this.objects.entries()){let a=e.objects.get(n);a&&s.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var et={"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 X(t){let e=et[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function K(t){var n;let e=et[t];return e&&(n=e.weight)!=null?n:"400"}function ms(t,e){et[t]=e}function ys(){return Object.keys(et)}var A=require("pixi.js");function gs(t,e,n){var Ct,kt,Pt,Dt,Nt,It,Ft,$t,Rt,Bt,zt,Ht,Wt,Yt,qt,Gt,Jt,jt,Vt,Xt,Kt,Qt,Zt,Ut,en,tn,nn,sn,an,on,rn,ln,cn,dn,un,pn,fn,hn,mn,yn,gn,_n,bn,wn,xn,Sn,An,Tn,vn,En,Ln,Mn,On,Cn,kn,Pn,Dn,Nn,In,Fn;let s=t.objects.get("ui_endgame_1"),a=t.objects.get("ui_endgame_logo_1"),i=t.objects.get("ui_endgame_title_1"),o=t.objects.get("ui_endgame_subtitle_1"),r=t.objects.get("ui_endgame_footer_1"),c=t.objects.get("ui_endgame_cta_1"),l=t.objects.get("ui_endgame_cta_hint_1"),u=t.objects.get("ui_endgame_hand_1"),h=t.engine.runtime||{},p=new A.Container;p.alpha=0,p.visible=!1;let d=((Ct=s==null?void 0:s.gameplay)==null?void 0:Ct.tuning)||{},m=(s==null?void 0:s.render)||{},f=(kt=d.panel_width)!=null?kt:320,g=(Pt=d.panel_height)!=null?Pt:400,L=(Dt=d.panel_padding)!=null?Dt:32,w=(Nt=d.panel_radius)!=null?Nt:24,T=m.background_color||d.panel_bg_color||"#1a0a0a",E=m.background_alpha!==void 0&&m.background_alpha!==null?m.background_alpha:(It=d.panel_bg_alpha)!=null?It:.98,M=m.border_color||d.panel_border_color||"#ffffff",O=(Ft=d.panel_border_width)!=null?Ft:2,C=($t=d.panel_border_alpha)!=null?$t:.3,v=new A.Graphics;v.roundRect(-f/2,-g/2,f,g,w);let _=T.replace("#","");v.fill({color:parseInt(_,16),alpha:E});let x=M.replace("#","");v.stroke({color:parseInt(x,16),width:O,alpha:C});let D=new A.Graphics;D.roundRect(-f/2+2,-g/2+2,f-4,g-4,w-2),D.stroke({color:16777215,width:1,alpha:.1}),v.addChild(D),p.addChild(v);let B=((Rt=a==null?void 0:a.gameplay)==null?void 0:Rt.tuning)||{},F=(a==null?void 0:a.transform)||{},P=(Bt=B.logo_size)!=null?Bt:56,N=(zt=F.scale)!=null?zt:1,$=(Wt=(Ht=F.offset)==null?void 0:Ht.y)!=null?Wt:-130,ue=(Yt=B.logo_alpha)!=null?Yt:1,k=new A.Sprite(n||A.Texture.EMPTY);k.anchor.set(.5);let J=0,j=0;if(n&&n!==A.Texture.EMPTY){let R=n.frame,te=n.baseTexture;R&&R.width&&R.height?(J=R.width,j=R.height):te&&te.width&&te.height?(J=te.width,j=te.height):n.width&&n.height&&(J=n.width,j=n.height)}if(J>0&&j>0){let R=J/j,te,rt;R>1?(te=P,rt=P/R):(rt=P,te=P*R);let $n=te/J,Rn=rt/j;$n*=N,Rn*=N,k.scale.set($n,Rn)}else{let R=P/100*N;k.scale.set(R)}k.position.set(0,$),k.alpha=0,k.visible=!0,k.targetAlpha=ue,k.baseScaleX=k.scale.x,k.baseScaleY=k.scale.y,p.addChild(k);let I=i==null?void 0:i.ui,z=((qt=i==null?void 0:i.gameplay)==null?void 0:qt.tuning)||{},it=(I==null?void 0:I.text)||"MISSION ACCOMPLISHED",$e=(I==null?void 0:I.font)||"brand.heading",Ms=(I==null?void 0:I.fontSize)||24,Os=(Gt=I==null?void 0:I.letterSpacing)!=null?Gt:1,Re=(Jt=i==null?void 0:i.render)==null?void 0:Jt.tint,Cs=typeof Re=="string"?Re:Re?`#${Re.toString(16).padStart(6,"0")}`:"#00FF88",wt=f-L*2-30,ks=z.font_weight_override?z.font_weight_override:K($e),oe=new A.Text({text:it,style:{fontFamily:X($e),fontSize:Ms,fontWeight:ks,fill:Cs,align:"center",letterSpacing:Os,wordWrap:!1,stroke:{color:z.stroke_color||"#000000",width:(jt=z.stroke_width)!=null?jt:2},dropShadow:{color:z.shadow_color||"#000000",alpha:(Vt=z.shadow_alpha)!=null?Vt:.9,angle:(Xt=z.shadow_angle)!=null?Xt:0,blur:(Kt=z.shadow_blur)!=null?Kt:8,distance:(Qt=z.shadow_distance)!=null?Qt:4}}});if(oe.width>wt){let R=wt/oe.width;oe.scale.set(R)}oe.anchor.set(.5);let xt=(Zt=d.title_offset_y)!=null?Zt:30,Ps=xt+((Ut=z.animation_start_y_offset)!=null?Ut:-20);oe.position.set(0,Ps),oe.alpha=0,p.addChild(oe);let H=o==null?void 0:o.ui,St=((en=o==null?void 0:o.gameplay)==null?void 0:en.tuning)||{},Ds=(H==null?void 0:H.text)||"RESCUE COMPLETE",At=(H==null?void 0:H.font)||"brand.body",Ns=(H==null?void 0:H.fontSize)||11,Is=(tn=H==null?void 0:H.letterSpacing)!=null?tn:.5,Be=(nn=o==null?void 0:o.render)==null?void 0:nn.tint,Fs=typeof Be=="string"?Be:Be?`#${Be.toString(16).padStart(6,"0")}`:"#B0B0B0",he=new A.Text({text:Ds,style:{fontFamily:X(At),fontSize:Ns,fontWeight:K(At),fill:Fs,align:"center",letterSpacing:Is}});he.anchor.set(.5);let $s=xt+20+((sn=St.animation_start_y_offset)!=null?sn:-10);he.position.set(0,$s),he.alpha=0,he.animationStartYOffset=(an=St.animation_start_y_offset)!=null?an:-10,p.addChild(he);let U=r==null?void 0:r.ui,Tt=((on=r==null?void 0:r.gameplay)==null?void 0:on.tuning)||{},Rs=(U==null?void 0:U.text)||((rn=h.ui)==null?void 0:rn.cta_hint)||"Continue the adventure!",vt=(U==null?void 0:U.font)||"brand.body",Bs=(U==null?void 0:U.fontSize)||16,ze=(ln=r==null?void 0:r.render)==null?void 0:ln.tint,zs=typeof ze=="string"?ze:ze?`#${ze.toString(16).padStart(6,"0")}`:"#FFFFFF",Hs=(cn=Tt.max_width)!=null?cn:f-L*2,Ws=(dn=Tt.line_height)!=null?dn:1.4,me=new A.Text({text:Rs,style:{fontFamily:X(vt),fontSize:Bs,fontWeight:K(vt),fill:zs,align:"center",wordWrap:!0,wordWrapWidth:Hs,lineHeight:Ws}});me.anchor.set(.5);let Ys=(un=d.footer_offset_y)!=null?un:120;me.position.set(0,Ys);let qs=((pn=r==null?void 0:r.render)==null?void 0:pn.alpha)!==void 0&&((fn=r==null?void 0:r.render)==null?void 0:fn.alpha)!==null?r.render.alpha:1;me.alpha=0,me.targetAlpha=qs,p.addChild(me);let ee=((hn=c==null?void 0:c.gameplay)==null?void 0:hn.tuning)||{},W=c==null?void 0:c.ui,He=(mn=ee.button_width)!=null?mn:260,We=(yn=ee.button_height)!=null?yn:56,Et=(gn=ee.button_radius)!=null?gn:16,Gs=ee.button_bg_color||((_n=h.theme)==null?void 0:_n.cta_background)||"#ffb43b",Js=(bn=ee.button_bg_alpha)!=null?bn:1,js=ee.button_border_color||"#ffffff",Vs=(wn=ee.button_border_width)!=null?wn:2,Xs=(xn=ee.button_border_alpha)!=null?xn:.2,Ye=(Sn=d.cta_offset_y)!=null?Sn:160,V=new A.Graphics;V.roundRect(-He/2,-We/2,He,We,Et);let Ks=Gs.replace("#","");V.fill({color:parseInt(Ks,16),alpha:Js});let Qs=js.replace("#","");V.stroke({color:parseInt(Qs,16),width:Vs,alpha:Xs});let at=new A.Graphics;at.roundRect(-He/2+2,-We/2+2,He-4,We-4,Et-2),at.stroke({color:0,width:1,alpha:.15}),V.addChild(at),V.position.set(0,Ye),V.alpha=0,V.eventMode="static",V.cursor="pointer",p.addChild(V);let Zs=(W==null?void 0:W.text)||((An=h.ui)==null?void 0:An.cta_label_end)||"DOWNLOAD",Lt=(W==null?void 0:W.font)||"brand.heading",Us=(W==null?void 0:W.fontSize)||20,ei=ee.button_text_color||((Tn=h.theme)==null?void 0:Tn.cta_text)||"#1a0a0a",ve=new A.Text({text:Zs,style:{fontFamily:X(Lt),fontSize:Us,fontWeight:K(Lt),fill:ei,align:"center",letterSpacing:(vn=W==null?void 0:W.letterSpacing)!=null?vn:1}});ve.anchor.set(.5),ve.position.set(0,Ye),ve.alpha=0,p.addChild(ve);let Y=l==null?void 0:l.ui,Mt=((En=l==null?void 0:l.gameplay)==null?void 0:En.tuning)||{},ti=(Y==null?void 0:Y.text)||"Play the full game",Ot=(Y==null?void 0:Y.font)||"brand.body",ni=(Y==null?void 0:Y.fontSize)||11,si=(Ln=Y==null?void 0:Y.letterSpacing)!=null?Ln:0,qe=(Mn=l==null?void 0:l.render)==null?void 0:Mn.tint,ii=typeof qe=="string"?qe:qe?`#${qe.toString(16).padStart(6,"0")}`:"#CCCCCC",ye=new A.Text({text:ti,style:{fontFamily:X(Ot),fontSize:ni,fontWeight:K(Ot),fill:ii,align:"center",letterSpacing:si}});ye.anchor.set(.5);let ai=Ye+35+((On=Mt.animation_start_y_offset)!=null?On:5);ye.position.set(0,ai),ye.alpha=0,ye.animationStartYOffset=(Cn=Mt.animation_start_y_offset)!=null?Cn:5,p.addChild(ye);let ot=((kn=u==null?void 0:u.gameplay)==null?void 0:kn.tuning)||{},oi=(Pn=ot.hand_offset_x)!=null?Pn:50,ri=(Dn=ot.hand_offset_y)!=null?Dn:50,li=(In=(Nn=u==null?void 0:u.transform)==null?void 0:Nn.scale)!=null?In:.1875,ci=(Fn=ot.hand_scale_multiplier)!=null?Fn:2.5,pe=new A.Sprite(e||A.Texture.EMPTY);return pe.anchor.set(.5),pe.scale.set(li*ci),pe.position.set(oi,Ye+ri),pe.alpha=0,pe.visible=!1,p.addChild(pe),{panel:p,logo:k,title:oe,subtitle:he,footer:me,ctaButton:V,ctaText:ve,ctaHint:ye,hand:pe}}function _s(t,e,n){var O,C,v,_,x,D,B,F;let s=e.objects.get("ui_endgame_1"),a=((O=s==null?void 0:s.gameplay)==null?void 0:O.tuning)||{},i=(C=a.animation_duration_ms)!=null?C:800,o=(v=a.fade_in_duration_ms)!=null?v:600,r=(_=a.scale_animation_intensity)!=null?_:.1,c=(x=a.logo_animation_delay_ms)!=null?x:100,l=(D=a.title_animation_delay_ms)!=null?D:200,u=(B=a.footer_animation_delay_ms)!=null?B:300,h=(F=a.cta_animation_delay_ms)!=null?F:400,{panel:p,logo:d,title:m,subtitle:f,footer:g,ctaButton:L,ctaText:w,ctaHint:T}=t;p.visible=!0;let E=Date.now(),M=()=>{let P=Date.now()-E,N=Math.min(P/o,1),$=1-Math.pow(1-N,3);p.alpha=$,p.scale.set(1+r*(1-$)),N<1?requestAnimationFrame(M):(setTimeout(()=>Oi(d,i,e),c),setTimeout(()=>{Ci(m,i),setTimeout(()=>ki(f,i),50)},l),setTimeout(()=>Pi(g,i),u),setTimeout(()=>{Di(L,w,i),setTimeout(()=>Ni(T,i),50),n&&n()},h))};M()}function Oi(t,e,n){var p,d,m,f,g;let s=n==null?void 0:n.objects.get("ui_endgame_logo_1"),i=(d=(((p=s==null?void 0:s.gameplay)==null?void 0:p.tuning)||{}).animation_start_scale)!=null?d:1.2,o=Date.now(),r=t.alpha,c=(m=t.targetAlpha)!=null?m:1,l=(f=t.baseScaleX)!=null?f:t.scale.x,u=(g=t.baseScaleY)!=null?g:t.scale.y,h=()=>{let L=Date.now()-o,w=Math.min(L/e,1),T=1-Math.pow(1-w,2);t.alpha=r+(c-r)*T;let E=i+(1-i)*T;t.scale.set(l*E,u*E),w<1&&requestAnimationFrame(h)};h()}function Ci(t,e){let n=Date.now(),s=t.alpha,a=t.y,i=()=>{let o=Date.now()-n,r=Math.min(o/e,1),c=1-Math.pow(1-r,2);t.alpha=s+(1-s)*c,t.y=a-20*(1-c),r<1&&requestAnimationFrame(i)};i()}function ki(t,e){var r;let n=Date.now(),s=t.alpha,a=t.position.y,i=a-((r=t.animationStartYOffset)!=null?r:-10),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);t.alpha=s+(1-s)*u,t.position.y=a+(i-a)*u,l<1&&requestAnimationFrame(o)};o()}function Pi(t,e){var o;let n=Date.now(),s=t.alpha,a=(o=t.targetAlpha)!=null?o:1,i=()=>{let r=Date.now()-n,c=Math.min(r/e,1),l=1-Math.pow(1-c,2);t.alpha=s+(a-s)*l,c<1&&requestAnimationFrame(i)};i()}function Di(t,e,n){let s=Date.now(),a=t.alpha,i=()=>{let o=Date.now()-s,r=Math.min(o/n,1),c=1-Math.pow(1-r,2);t.alpha=a+(1-a)*c,e.alpha=a+(1-a)*c,t.scale.set(1+.1*(1-c)),r<1&&requestAnimationFrame(i)};i()}function Ni(t,e){var r;let n=Date.now(),s=t.alpha,a=t.position.y,i=a-((r=t.animationStartYOffset)!=null?r:5),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);t.alpha=s+(1-s)*u,t.position.y=a+(i-a)*u,l<1&&requestAnimationFrame(o)};o()}function bs(t,e,n,s){var u,h,p,d;let a=n.objects.get("ui_endgame_hand_1"),i=((u=a==null?void 0:a.gameplay)==null?void 0:u.tuning)||{},o=(h=i.click_animation_duration_ms)!=null?h:600,r=(p=i.click_delay_ms)!=null?p:2e3,c=(d=i.click_repeat_delay_ms)!=null?d:3e3,l=()=>{var O,C;t.visible=!0,t.alpha=1;let m=t.x,f=t.y,g=(O=i.hand_offset_x)!=null?O:50,L=(C=i.hand_offset_y)!=null?C:50,w=e.x+g,T=e.y+L,E=Date.now(),M=()=>{var P,N,$;let v=Date.now()-E,_=Math.min(v/o,1),x=_<.5?2*_*_:1-Math.pow(-2*_+2,2)/2;t.x=m+(w-m)*x,t.y=f+(T-f)*x;let D=(N=(P=a==null?void 0:a.transform)==null?void 0:P.scale)!=null?N:.1875,B=($=i.hand_scale_multiplier)!=null?$:2.5,F=D*B;t.scale.set(F+F*.2*Math.sin(_*Math.PI)),_<1?requestAnimationFrame(M):(e.scale.set(.95),setTimeout(()=>{e.scale.set(1),s()},100),setTimeout(()=>{t.alpha=0,setTimeout(()=>{t.x=m,t.y=f,l()},c)},500))};M()};setTimeout(l,r)}var tt=require("pixi.js");function ws(t,e,n){var h,p,d,m;let s=e.objects.get("hand_tutorial_1")||e.objects.get("hand_1")||Array.from(e.objects.values()).find(f=>{var g;return((g=f==null?void 0:f.identity)==null?void 0:g.id)==="hand.tutorial"}),a=((h=s==null?void 0:s.gameplay)==null?void 0:h.tuning)||{},i=(s==null?void 0:s.render)||{},o=(s==null?void 0:s.transform)||{},r=new tt.Sprite(t),c=i==null?void 0:i.anchor;c&&typeof c.x=="number"&&typeof c.y=="number"?r.anchor.set(c.x,c.y):r.anchor.set(.5),r.alpha=0;let l=(p=a.hand_scale_multiplier)!=null?p:2.5,u=(d=o.scale)!=null?d:.1875;return r.scale.set(u*l),r.zIndex=(m=i.z_index)!=null?m:99999,r}function xs(t){var f,g,L,w,T,E,M,O,C,v;let e=t.objects.get("ui_tutorial_1")||t.objects.get("label_1")||Array.from(t.objects.values()).find(_=>{var x;return["ui.tutorial","label.warning"].includes((x=_==null?void 0:_.identity)==null?void 0:x.id)}),n=e==null?void 0:e.ui,s=(e==null?void 0:e.render)||{},a=((f=t.engine.runtime)==null?void 0:f.ui_styles)||{},i=((g=t.engine.runtime)==null?void 0:g.ui)||{},o=(n==null?void 0:n.text)||i.tutorial_label||i.label_text||"CLEAN!",r=(n==null?void 0:n.font)||"brand.warning",c=(n==null?void 0:n.fontSize)||a.label_font_size||52,l=(w=n==null?void 0:n.letterSpacing)!=null?w:(L=a.label_letter_spacing)!=null?L:-1,u=(n==null?void 0:n.align)||"center",h=s.tint,p=typeof h=="string"?h:h?`#${h.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",d=new tt.Text({text:o,style:{fontFamily:X(r),fontSize:c,fontWeight:K(r),fill:p,align:u,letterSpacing:l,stroke:{color:a.label_stroke||"#8B0000",width:2},dropShadow:{color:a.label_shadow_color||"#000000",alpha:(T=a.label_shadow_alpha)!=null?T:.8,angle:(E=a.label_shadow_angle)!=null?E:0,blur:(M=a.label_shadow_blur)!=null?M:4,distance:(O=a.label_shadow_distance)!=null?O:2}}}),m=s==null?void 0:s.anchor;return m&&typeof m.x=="number"&&typeof m.y=="number"?d.anchor.set(m.x,m.y):d.anchor.set(.5,.5),d.alpha=(C=s.alpha)!=null?C:0,d.visible=(v=s.visible)!=null?v:!0,d}function Ss(t,e,n,s,a){var c,l,u,h,p,d,m,f,g,L,w,T,E,M,O,C,v;let i=a.objects.get("hand_tutorial_1")||a.objects.get("hand_1")||Array.from(a.objects.values()).find(_=>{var x;return((x=_==null?void 0:_.identity)==null?void 0:x.id)==="hand.tutorial"}),o=((c=i==null?void 0:i.gameplay)==null?void 0:c.tuning)||{},r=(i==null?void 0:i.transform)||{};if(!s){let _=(l=o.animation_duration)!=null?l:1.5,x=n%_/_,D=x<.5?2*x*x:-1+(4-2*x)*x,B=(m=(d=(p=(u=r.position)==null?void 0:u.x)!=null?p:(h=r.offset)==null?void 0:h.x)!=null?d:o.start_x_offset)!=null?m:0,F=(T=(w=(L=(f=r.position)==null?void 0:f.y)!=null?L:(g=r.offset)==null?void 0:g.y)!=null?w:o.start_y_offset)!=null?T:0,P=(E=o.x_offset)!=null?E:0,N=(M=o.y_offset)!=null?M:0,$=(O=o.animation_range)!=null?O:40,ue=$*.7,k=$,J=e.x+B+P+ue,j=e.y+F+N+k,I=J+ue,z=j+k;t.x=J+(I-J)*D,t.y=j+(z-j)*D;let it=(C=r.scale)!=null?C:.1875,$e=(v=o.hand_scale_multiplier)!=null?v:2.5;t.scale.set(it*$e)}}var Ie=null;function Ii(){return Ie||(typeof window!="undefined"&&window.lottie?Ie=window.lottie:(console.warn("[LottieOverlay] lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),Ie=null)),Ie}function As(t){Ie=t}function Ts(t,e,n,s){var M,O,C,v,_,x,D,B,F,P,N,$,ue;let a=n.objects.get(t);if(!a)return console.warn(`[LottieOverlay] Object config not found: ${t}`),null;let i=((M=a.effects)==null?void 0:M.lottie)||{},o=a.transform||{},r=a.render||{};if(i.enabled===!1||r.visible===!1)return null;let c=s[t];if(!c||typeof c!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${t}`),null;let l=Ii();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${t}`),null;let u=(O=i.width)!=null?O:300,h=(C=i.height)!=null?C:300,p=(v=o.scale)!=null?v:1,d=(x=(_=o.position)==null?void 0:_.x)!=null?x:0,m=(B=(D=o.position)==null?void 0:D.y)!=null?B:0,f=(F=o.rotation)!=null?F:0,g=(P=r.z_index)!=null?P:100,L=(N=r.alpha)!=null?N:1,w=document.createElement("div");w.style.cssText=`
|
|
17
|
+
`,t.appendChild(e)}async function nn(t,e={}){let n=new ja.Application;await n.init({resizeTo:t,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let i=s=>{var c,l,u,g,p,d;if(!n.renderer)return;let o=(u=(l=(c=s==null?void 0:s.width)!=null?c:t.clientWidth)!=null?l:window.innerWidth)!=null?u:320,r=(d=(p=(g=s==null?void 0:s.height)!=null?g:t.clientHeight)!=null?p:window.innerHeight)!=null?d:480;n.renderer.resize(o,r)};t.innerHTML="",t.style.position="relative",t.style.display="flex",t.style.flexDirection="column",t.style.alignItems="stretch",t.style.width="100%",t.style.height="100dvh",t.style.minHeight="100vh",t.style.maxWidth="100%",t.style.maxHeight="100%",t.style.boxSizing="border-box",t.style.overflow="hidden",e.background&&(t.style.background=e.background),t.appendChild(n.canvas);let a=document.createElement("div");return a.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),t.appendChild(a),pt.on("pause",()=>{n.ticker.stop(),document.querySelectorAll("audio").forEach(o=>o.pause())}),pt.on("resume",()=>{n.ticker.start(),document.querySelectorAll("audio").forEach(o=>{o.currentTime>0&&!o.ended&&o.play().catch(()=>{})})}),pt.on("resize",({payload:s})=>{i({width:s==null?void 0:s.width,height:s==null?void 0:s.height})}),window.addEventListener("resize",()=>i()),requestAnimationFrame(()=>i()),{app:n,stage:n.stage,overlay:a,applySize:i}}var vt=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)}syncToPixi(e){e.position.set(this.position.x,this.position.y),e.scale.set(this.scale),e.rotation=this.rotation}},xt=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)}syncToPixi(e){e.zIndex=this.z_index,e.alpha=this.alpha,e.visible=this.visible,this.tint!==null&&"tint"in e&&(e.tint=this.tint)}},wt=class{constructor(e,n,i,a){this.instanceId=e,this.objectConfig=n,this.pixiObject=i,this._config=a,this.transform=new vt(a.transform),this.renderer=new xt(a.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject),this.applyAnchor(),this.applyEffectsScale()}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}applyAnchor(){var a,s,o,r;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let e=(s=(a=this._config)==null?void 0:a.render)==null?void 0:s.anchor,n=(r=(o=this._config)==null?void 0:o.transform)==null?void 0:r.anchor,i=e&&typeof e=="object"?e:n&&typeof n=="object"?n:null;i&&typeof i.x=="number"&&typeof i.y=="number"&&this.pixiObject.anchor.set(i.x,i.y)}applyEffectsScale(){var s,o,r;if(!((s=this.pixiObject)!=null&&s.scale))return;let e=(o=this._config)==null?void 0:o.effects,n=typeof(e==null?void 0:e.scale_x)=="number"?e.scale_x:1,i=typeof(e==null?void 0:e.scale_y)=="number"?e.scale_y:1;if(n===1&&i===1)return;let a=(r=this.transform.scale)!=null?r:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(a*n,a*i):(this.pixiObject.scale.x=a*n,this.pixiObject.scale.y=a*i)}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,n){this.transform.position={x:e,y:n},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToPixi(this.pixiObject)}},Je=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 wt(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 an={"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 oe(t){let e=an[t];return e?e.family:(console.warn(`Font ID "${t}" not found in registry, using fallback`),"Arial, sans-serif")}function re(t){var n;let e=an[t];return e&&(n=e.weight)!=null?n:"400"}function Ha(t,e){an[t]=e}function Ba(){return Object.keys(an)}var B=require("pixi.js");function Da(t,e,n){var Yn,Wn,Vn,Xn,Kn,Jn,Qn,Zn,ei,ti,ni,ii,ai,si,oi,ri,li,ci,di,ui,pi,gi,hi,fi,bi,mi,yi,vi,xi,wi,Si,Ei,_i,Ci,Li,Ai,Ti,Mi,ki,Ii,Oi,Pi,Ri,ji,Hi,Bi,Di,zi,Fi,Ni,$i,Gi,qi,Ui,Yi,Wi,Vi,Xi,Ki,Ji;let i=t.objects.get("ui_endgame_1"),a=t.objects.get("ui_endgame_logo_1"),s=t.objects.get("ui_endgame_title_1"),o=t.objects.get("ui_endgame_subtitle_1"),r=t.objects.get("ui_endgame_footer_1"),c=t.objects.get("ui_endgame_cta_1"),l=t.objects.get("ui_endgame_cta_hint_1"),u=t.objects.get("ui_endgame_hand_1"),g=t.engine.runtime||{},p=new B.Container;p.alpha=0,p.visible=!1;let d=((Yn=i==null?void 0:i.gameplay)==null?void 0:Yn.tuning)||{},f=(i==null?void 0:i.render)||{},h=(Wn=d.panel_width)!=null?Wn:320,b=(Vn=d.panel_height)!=null?Vn:400,m=(Xn=d.panel_padding)!=null?Xn:32,y=(Kn=d.panel_radius)!=null?Kn:24,_=f.background_color||d.panel_bg_color||"#1a0a0a",C=f.background_alpha!==void 0&&f.background_alpha!==null?f.background_alpha:(Jn=d.panel_bg_alpha)!=null?Jn:.98,v=f.border_color||d.panel_border_color||"#ffffff",I=(Qn=d.panel_border_width)!=null?Qn:2,R=(Zn=d.panel_border_alpha)!=null?Zn:.3,M=new B.Graphics;M.roundRect(-h/2,-b/2,h,b,y);let w=_.replace("#","");M.fill({color:parseInt(w,16),alpha:C});let L=v.replace("#","");M.stroke({color:parseInt(L,16),width:I,alpha:R});let G=new B.Graphics;G.roundRect(-h/2+2,-b/2+2,h-4,b-4,y-2),G.stroke({color:16777215,width:1,alpha:.1}),M.addChild(G),p.addChild(M);let E=((ei=a==null?void 0:a.gameplay)==null?void 0:ei.tuning)||{},j=(a==null?void 0:a.transform)||{},N=(ti=E.logo_size)!=null?ti:56,H=(ni=j.scale)!=null?ni:1,q=(ai=(ii=j.offset)==null?void 0:ii.y)!=null?ai:-130,pe=(si=E.logo_alpha)!=null?si:1,D=new B.Sprite(n||B.Texture.EMPTY);D.anchor.set(.5);let K=0,J=0;if(n&&n!==B.Texture.EMPTY){let Q=n.frame,ve=n.baseTexture;Q&&Q.width&&Q.height?(K=Q.width,J=Q.height):ve&&ve.width&&ve.height?(K=ve.width,J=ve.height):n.width&&n.height&&(K=n.width,J=n.height)}if(K>0&&J>0){let Q=K/J,ve,Cn;Q>1?(ve=N,Cn=N/Q):(Cn=N,ve=N*Q);let Qi=ve/K,Zi=Cn/J;Qi*=H,Zi*=H,D.scale.set(Qi,Zi)}else{let Q=N/100*H;D.scale.set(Q)}D.position.set(0,q),D.alpha=0,D.visible=!0,D.targetAlpha=pe,D.baseScaleX=D.scale.x,D.baseScaleY=D.scale.y,p.addChild(D);let $=s==null?void 0:s.ui,Y=((oi=s==null?void 0:s.gameplay)==null?void 0:oi.tuning)||{},$e=($==null?void 0:$.text)||"MISSION ACCOMPLISHED",ke=($==null?void 0:$.font)||"brand.heading",At=($==null?void 0:$.fontSize)||24,Tt=(ri=$==null?void 0:$.letterSpacing)!=null?ri:1,Ie=(li=s==null?void 0:s.render)==null?void 0:li.tint,Mt=typeof Ie=="string"?Ie:Ie?`#${Ie.toString(16).padStart(6,"0")}`:"#00FF88",it=h-m*2-30,kt=Y.font_weight_override?Y.font_weight_override:re(ke),ce=new B.Text({text:$e,style:{fontFamily:oe(ke),fontSize:At,fontWeight:kt,fill:Mt,align:"center",letterSpacing:Tt,wordWrap:!1,stroke:{color:Y.stroke_color||"#000000",width:(ci=Y.stroke_width)!=null?ci:2},dropShadow:{color:Y.shadow_color||"#000000",alpha:(di=Y.shadow_alpha)!=null?di:.9,angle:(ui=Y.shadow_angle)!=null?ui:0,blur:(pi=Y.shadow_blur)!=null?pi:8,distance:(gi=Y.shadow_distance)!=null?gi:4}}});if(ce.width>it){let Q=it/ce.width;ce.scale.set(Q)}ce.anchor.set(.5);let at=(hi=d.title_offset_y)!=null?hi:30,It=at+((fi=Y.animation_start_y_offset)!=null?fi:-20);ce.position.set(0,It),ce.alpha=0,p.addChild(ce);let W=o==null?void 0:o.ui,st=((bi=o==null?void 0:o.gameplay)==null?void 0:bi.tuning)||{},Ot=(W==null?void 0:W.text)||"RESCUE COMPLETE",ot=(W==null?void 0:W.font)||"brand.body",Pt=(W==null?void 0:W.fontSize)||11,Rt=(mi=W==null?void 0:W.letterSpacing)!=null?mi:.5,Oe=(yi=o==null?void 0:o.render)==null?void 0:yi.tint,jt=typeof Oe=="string"?Oe:Oe?`#${Oe.toString(16).padStart(6,"0")}`:"#B0B0B0",be=new B.Text({text:Ot,style:{fontFamily:oe(ot),fontSize:Pt,fontWeight:re(ot),fill:jt,align:"center",letterSpacing:Rt}});be.anchor.set(.5);let Ht=at+20+((vi=st.animation_start_y_offset)!=null?vi:-10);be.position.set(0,Ht),be.alpha=0,be.animationStartYOffset=(xi=st.animation_start_y_offset)!=null?xi:-10,p.addChild(be);let ee=r==null?void 0:r.ui,rt=((wi=r==null?void 0:r.gameplay)==null?void 0:wi.tuning)||{},Bt=(ee==null?void 0:ee.text)||((Si=g.ui)==null?void 0:Si.cta_hint)||"Continue the adventure!",lt=(ee==null?void 0:ee.font)||"brand.body",Dt=(ee==null?void 0:ee.fontSize)||16,Pe=(Ei=r==null?void 0:r.render)==null?void 0:Ei.tint,zt=typeof Pe=="string"?Pe:Pe?`#${Pe.toString(16).padStart(6,"0")}`:"#FFFFFF",Ft=(_i=rt.max_width)!=null?_i:h-m*2,Nt=(Ci=rt.line_height)!=null?Ci:1.4,me=new B.Text({text:Bt,style:{fontFamily:oe(lt),fontSize:Dt,fontWeight:re(lt),fill:zt,align:"center",wordWrap:!0,wordWrapWidth:Ft,lineHeight:Nt}});me.anchor.set(.5);let $t=(Li=d.footer_offset_y)!=null?Li:120;me.position.set(0,$t);let Gt=((Ai=r==null?void 0:r.render)==null?void 0:Ai.alpha)!==void 0&&((Ti=r==null?void 0:r.render)==null?void 0:Ti.alpha)!==null?r.render.alpha:1;me.alpha=0,me.targetAlpha=Gt,p.addChild(me);let te=((Mi=c==null?void 0:c.gameplay)==null?void 0:Mi.tuning)||{},V=c==null?void 0:c.ui,Re=(ki=te.button_width)!=null?ki:260,A=(Ii=te.button_height)!=null?Ii:56,F=(Oi=te.button_radius)!=null?Oi:16,O=te.button_bg_color||((Pi=g.theme)==null?void 0:Pi.cta_background)||"#ffb43b",x=(Ri=te.button_bg_alpha)!=null?Ri:1,ne=te.button_border_color||"#ffffff",de=(ji=te.button_border_width)!=null?ji:2,je=(Hi=te.button_border_alpha)!=null?Hi:.2,ye=(Bi=d.cta_offset_y)!=null?Bi:160,U=new B.Graphics;U.roundRect(-Re/2,-A/2,Re,A,F);let He=O.replace("#","");U.fill({color:parseInt(He,16),alpha:x});let ct=ne.replace("#","");U.stroke({color:parseInt(ct,16),width:de,alpha:je});let En=new B.Graphics;En.roundRect(-Re/2+2,-A/2+2,Re-4,A-4,F-2),En.stroke({color:0,width:1,alpha:.15}),U.addChild(En),U.position.set(0,ye),U.alpha=0,U.eventMode="static",U.cursor="pointer",p.addChild(U);let ts=(V==null?void 0:V.text)||((Di=g.ui)==null?void 0:Di.cta_label_end)||"DOWNLOAD",Gn=(V==null?void 0:V.font)||"brand.heading",ns=(V==null?void 0:V.fontSize)||20,is=te.button_text_color||((zi=g.theme)==null?void 0:zi.cta_text)||"#1a0a0a",dt=new B.Text({text:ts,style:{fontFamily:oe(Gn),fontSize:ns,fontWeight:re(Gn),fill:is,align:"center",letterSpacing:(Fi=V==null?void 0:V.letterSpacing)!=null?Fi:1}});dt.anchor.set(.5),dt.position.set(0,ye),dt.alpha=0,p.addChild(dt);let ie=l==null?void 0:l.ui,qn=((Ni=l==null?void 0:l.gameplay)==null?void 0:Ni.tuning)||{},as=(ie==null?void 0:ie.text)||"Play the full game",Un=(ie==null?void 0:ie.font)||"brand.body",ss=(ie==null?void 0:ie.fontSize)||11,os=($i=ie==null?void 0:ie.letterSpacing)!=null?$i:0,qt=(Gi=l==null?void 0:l.render)==null?void 0:Gi.tint,rs=typeof qt=="string"?qt:qt?`#${qt.toString(16).padStart(6,"0")}`:"#CCCCCC",Ge=new B.Text({text:as,style:{fontFamily:oe(Un),fontSize:ss,fontWeight:re(Un),fill:rs,align:"center",letterSpacing:os}});Ge.anchor.set(.5);let ls=ye+35+((qi=qn.animation_start_y_offset)!=null?qi:5);Ge.position.set(0,ls),Ge.alpha=0,Ge.animationStartYOffset=(Ui=qn.animation_start_y_offset)!=null?Ui:5,p.addChild(Ge);let _n=((Yi=u==null?void 0:u.gameplay)==null?void 0:Yi.tuning)||{},cs=(Wi=_n.hand_offset_x)!=null?Wi:50,ds=(Vi=_n.hand_offset_y)!=null?Vi:50,us=(Ki=(Xi=u==null?void 0:u.transform)==null?void 0:Xi.scale)!=null?Ki:.1875,ps=(Ji=_n.hand_scale_multiplier)!=null?Ji:2.5,Be=new B.Sprite(e||B.Texture.EMPTY);return Be.anchor.set(.5),Be.scale.set(us*ps),Be.position.set(cs,ye+ds),Be.alpha=0,Be.visible=!1,p.addChild(Be),{panel:p,logo:D,title:ce,subtitle:be,footer:me,ctaButton:U,ctaText:dt,ctaHint:Ge,hand:Be}}function za(t,e,n){var I,R,M,w,L,G,E,j;let i=e.objects.get("ui_endgame_1"),a=((I=i==null?void 0:i.gameplay)==null?void 0:I.tuning)||{},s=(R=a.animation_duration_ms)!=null?R:800,o=(M=a.fade_in_duration_ms)!=null?M:600,r=(w=a.scale_animation_intensity)!=null?w:.1,c=(L=a.logo_animation_delay_ms)!=null?L:100,l=(G=a.title_animation_delay_ms)!=null?G:200,u=(E=a.footer_animation_delay_ms)!=null?E:300,g=(j=a.cta_animation_delay_ms)!=null?j:400,{panel:p,logo:d,title:f,subtitle:h,footer:b,ctaButton:m,ctaText:y,ctaHint:_}=t;p.visible=!0;let C=Date.now(),v=()=>{let N=Date.now()-C,H=Math.min(N/o,1),q=1-Math.pow(1-H,3);p.alpha=q,p.scale.set(1+r*(1-q)),H<1?requestAnimationFrame(v):(setTimeout(()=>Us(d,s,e),c),setTimeout(()=>{Ys(f,s),setTimeout(()=>Ws(h,s),50)},l),setTimeout(()=>Vs(b,s),u),setTimeout(()=>{Xs(m,y,s),setTimeout(()=>Ks(_,s),50),n&&n()},g))};v()}function Us(t,e,n){var p,d,f,h,b;let i=n==null?void 0:n.objects.get("ui_endgame_logo_1"),s=(d=(((p=i==null?void 0:i.gameplay)==null?void 0:p.tuning)||{}).animation_start_scale)!=null?d:1.2,o=Date.now(),r=t.alpha,c=(f=t.targetAlpha)!=null?f:1,l=(h=t.baseScaleX)!=null?h:t.scale.x,u=(b=t.baseScaleY)!=null?b:t.scale.y,g=()=>{let m=Date.now()-o,y=Math.min(m/e,1),_=1-Math.pow(1-y,2);t.alpha=r+(c-r)*_;let C=s+(1-s)*_;t.scale.set(l*C,u*C),y<1&&requestAnimationFrame(g)};g()}function Ys(t,e){let n=Date.now(),i=t.alpha,a=t.y,s=()=>{let o=Date.now()-n,r=Math.min(o/e,1),c=1-Math.pow(1-r,2);t.alpha=i+(1-i)*c,t.y=a-20*(1-c),r<1&&requestAnimationFrame(s)};s()}function Ws(t,e){var r;let n=Date.now(),i=t.alpha,a=t.position.y,s=a-((r=t.animationStartYOffset)!=null?r:-10),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);t.alpha=i+(1-i)*u,t.position.y=a+(s-a)*u,l<1&&requestAnimationFrame(o)};o()}function Vs(t,e){var o;let n=Date.now(),i=t.alpha,a=(o=t.targetAlpha)!=null?o:1,s=()=>{let r=Date.now()-n,c=Math.min(r/e,1),l=1-Math.pow(1-c,2);t.alpha=i+(a-i)*l,c<1&&requestAnimationFrame(s)};s()}function Xs(t,e,n){let i=Date.now(),a=t.alpha,s=()=>{let o=Date.now()-i,r=Math.min(o/n,1),c=1-Math.pow(1-r,2);t.alpha=a+(1-a)*c,e.alpha=a+(1-a)*c,t.scale.set(1+.1*(1-c)),r<1&&requestAnimationFrame(s)};s()}function Ks(t,e){var r;let n=Date.now(),i=t.alpha,a=t.position.y,s=a-((r=t.animationStartYOffset)!=null?r:5),o=()=>{let c=Date.now()-n,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);t.alpha=i+(1-i)*u,t.position.y=a+(s-a)*u,l<1&&requestAnimationFrame(o)};o()}function Fa(t,e,n,i){var u,g,p,d;let a=n.objects.get("ui_endgame_hand_1"),s=((u=a==null?void 0:a.gameplay)==null?void 0:u.tuning)||{},o=(g=s.click_animation_duration_ms)!=null?g:600,r=(p=s.click_delay_ms)!=null?p:2e3,c=(d=s.click_repeat_delay_ms)!=null?d:3e3,l=()=>{var I,R;t.visible=!0,t.alpha=1;let f=t.x,h=t.y,b=(I=s.hand_offset_x)!=null?I:50,m=(R=s.hand_offset_y)!=null?R:50,y=e.x+b,_=e.y+m,C=Date.now(),v=()=>{var N,H,q;let M=Date.now()-C,w=Math.min(M/o,1),L=w<.5?2*w*w:1-Math.pow(-2*w+2,2)/2;t.x=f+(y-f)*L,t.y=h+(_-h)*L;let G=(H=(N=a==null?void 0:a.transform)==null?void 0:N.scale)!=null?H:.1875,E=(q=s.hand_scale_multiplier)!=null?q:2.5,j=G*E;t.scale.set(j+j*.2*Math.sin(w*Math.PI)),w<1?requestAnimationFrame(v):(e.scale.set(.95),setTimeout(()=>{e.scale.set(1),i()},100),setTimeout(()=>{t.alpha=0,setTimeout(()=>{t.x=f,t.y=h,l()},c)},500))};v()};setTimeout(l,r)}var X=require("pixi.js");var St={enabled:!0,show_on_start:!1,background_color:"#120b14",background_alpha:.8,title:"Rope Rescue",subtitle:"Drag the key to save the hero.",button_label:"Start",title_color:"#FFFFFF",subtitle_color:"#D6C9E0",button_bg:"#FFB43B",button_text:"#1A0A0A",button_width:180,button_height:48,button_radius:14,loading_blur:!0,loading_blur_strength:8,loading_overlay_alpha:.35,font_family:"Arial, sans-serif",title_size:28,subtitle_size:14,loading_text:"Y\xFCkleniyor...",loading_text_scale:.6},Qe=class{constructor(e,n,i){this.loadingTime=0;this.tickLoadingHandler=null;var a,s,o;this.app=e,this.stage=n,this.activeConfig=i,this.splashConfig={...St,...(s=(a=i.engine)==null?void 0:a.splash)!=null?s:{}},this.splashEnabled=this.splashConfig.enabled!==!1,this.loadingBlurEnabled=this.splashConfig.loading_blur!==!1,this.loadingBlurStrength=typeof this.splashConfig.loading_blur_strength=="number"?this.splashConfig.loading_blur_strength:8,this.loadingOverlayAlpha=typeof this.splashConfig.loading_overlay_alpha=="number"?this.splashConfig.loading_overlay_alpha:.35,this.splashLayer=new X.Container,this.splashLayer.visible=!1,this.splashLayer.zIndex=1e4,this.splashLayer.eventMode="static",this.splashLayer.cursor="default",this.splashBg=new X.Graphics,this.splashBg.eventMode="static",this.splashTitle=new X.Text(this.splashConfig.title,{fontFamily:this.splashConfig.font_family,fontSize:this.splashConfig.title_size,fill:this.splashConfig.title_color,align:"center"}),this.splashTitle.anchor.set(.5),this.splashSubtitle=new X.Text(this.splashConfig.subtitle,{fontFamily:this.splashConfig.font_family,fontSize:this.splashConfig.subtitle_size,fill:this.splashConfig.subtitle_color,align:"center"}),this.splashSubtitle.anchor.set(.5),this.splashButton=new X.Graphics,this.splashButton.eventMode="static",this.splashButton.cursor="pointer",this.splashButtonText=new X.Text(this.splashConfig.button_label,{fontFamily:this.splashConfig.font_family,fontSize:Math.round(this.splashConfig.subtitle_size+2),fill:this.splashConfig.button_text,align:"center"}),this.splashButtonText.anchor.set(.5),this.splashButton.addChild(this.splashButtonText),this.splashLayer.addChild(this.splashBg,this.splashTitle,this.splashSubtitle,this.splashButton),this.stage.addChild(this.splashLayer),this.loadingLayer=new X.Container,this.loadingLayer.zIndex=10001,this.loadingLayer.eventMode="static",this.loadingBg=new X.Graphics,this.loadingText=new X.Text((o=this.splashConfig.loading_text)!=null?o:St.loading_text,this.resolveLoadingTextStyle(this.splashConfig)),this.loadingText.anchor.set(.5),this.loadingLayer.addChild(this.loadingBg,this.loadingText),this.stage.addChild(this.loadingLayer),this.syncConfig(),this.updateLoadingLayout(),this.setupWindowGlobals(),this.startLoadingAnimation()}resolveLoadingTextStyle(e){var g,p,d,f,h,b,m;let n=this.activeConfig.objects.get("label_1"),i=(g=n==null?void 0:n.ui)!=null?g:{},a=(p=n==null?void 0:n.render)!=null?p:{},s=(d=i.font)!=null?d:"brand.warning",o=(f=i.fontSize)!=null?f:50,r=(h=i.letterSpacing)!=null?h:0,c=(b=a.tint)!=null?b:"#FFF1C1",l=typeof c=="string"?c:`#${c.toString(16).padStart(6,"0")}`,u=typeof e.loading_text_scale=="number"?e.loading_text_scale:St.loading_text_scale;return{fontFamily:oe(s),fontSize:Math.round(o*u),fontWeight:re(s),fill:l,align:(m=i.align)!=null?m:"center",letterSpacing:r}}syncConfig(e){var i,a,s;let n={...St,...(a=e!=null?e:(i=this.activeConfig.engine)==null?void 0:i.splash)!=null?a:{}};if(this.splashConfig=n,this.splashEnabled=n.enabled!==!1,this.loadingBlurEnabled=n.loading_blur!==!1,this.loadingBlurStrength=typeof n.loading_blur_strength=="number"?n.loading_blur_strength:8,this.loadingOverlayAlpha=typeof n.loading_overlay_alpha=="number"?n.loading_overlay_alpha:.35,this.splashTitle.text=n.title,this.splashTitle.style.fontFamily=n.font_family,this.splashTitle.style.fontSize=n.title_size,this.splashTitle.style.fill=n.title_color,this.splashSubtitle.text=n.subtitle,this.splashSubtitle.style.fontFamily=n.font_family,this.splashSubtitle.style.fontSize=n.subtitle_size,this.splashSubtitle.style.fill=n.subtitle_color,this.splashButtonText.text=n.button_label,this.splashButtonText.style.fontFamily=n.font_family,this.splashButtonText.style.fontSize=Math.round(n.subtitle_size+2),this.splashButtonText.style.fill=n.button_text,this.loadingText){let o=this.resolveLoadingTextStyle(n);this.loadingText.text=(s=n.loading_text)!=null?s:St.loading_text,this.loadingText.style.fontFamily=o.fontFamily,this.loadingText.style.fontSize=o.fontSize,this.loadingText.style.fontWeight=o.fontWeight,this.loadingText.style.fill=o.fill,this.loadingText.style.align=o.align,this.loadingText.style.letterSpacing=o.letterSpacing}}updateLayout(e,n){this.updateSplashLayout(e,n),this.loadingBg&&this.updateLoadingLayout()}updateSplashLayout(e,n){this.splashBg.clear().rect(0,0,e,n).fill({color:Number.parseInt(this.splashConfig.background_color.replace("#",""),16),alpha:this.splashConfig.background_alpha});let i=e/2,a=n/2;this.splashTitle.position.set(i,a-48),this.splashSubtitle.position.set(i,a-16);let s=this.splashConfig.button_width,o=this.splashConfig.button_height,r=this.splashConfig.button_radius;this.splashButton.clear().roundRect(-s/2,-o/2,s,o,r).fill({color:Number.parseInt(this.splashConfig.button_bg.replace("#",""),16),alpha:1}),this.splashButton.position.set(i,a+32),this.splashButtonText.position.set(0,0)}updateLoadingLayout(){var i,a;let{width:e,height:n}=this.app.renderer;(i=this.loadingBg)==null||i.clear().rect(0,0,e,n).fill({color:0,alpha:this.loadingOverlayAlpha}),(a=this.loadingText)==null||a.position.set(e/2,n/2)}show(){this.syncConfig(),this.splashEnabled&&(this.updateSplashLayout(this.app.renderer.width,this.app.renderer.height),this.splashLayer.visible=!0)}hide(){this.splashLayer.visible=!1}startLoadingAnimation(){this.tickLoadingHandler=e=>{let n=e.deltaTime;this.loadingTime+=n,this.loadingText&&(this.loadingText.alpha=.6+Math.sin(this.loadingTime*.08)*.4)},this.app.ticker.add(this.tickLoadingHandler)}stopLoadingAnimation(){this.tickLoadingHandler&&(this.app.ticker.remove(this.tickLoadingHandler),this.tickLoadingHandler=null)}destroyLoadingLayer(){this.stopLoadingAnimation(),this.loadingLayer.destroy({children:!0}),this.loadingText=null,this.loadingBg=null}applyLoadingBlur(e){var n;if(this.loadingBlurEnabled&&e){let i=new X.BlurFilter(this.loadingBlurStrength),a=(n=e.filters)!=null?n:null;return e.filters=[...a!=null?a:[],i],a}return null}removeLoadingBlur(e,n){e&&(n?e.filters=n:e.filters=null)}setupWindowGlobals(){if(typeof window=="undefined")return;let e=window;if(e.__updateSplashLayout=(n,i)=>{this.loadingBg&&this.updateLoadingLayout(),this.updateSplashLayout(n,i)},e.__previewShowSplash=()=>this.show(),e.__previewHideSplash=()=>this.hide(),e.__previewUpdateSplash=()=>{this.syncConfig(),this.loadingBg&&this.updateLoadingLayout(),this.updateSplashLayout(this.app.renderer.width,this.app.renderer.height),this.splashEnabled||(this.splashLayer.visible=!1)},!e.__splashScreenListener){let n=i=>{var r;let{width:a,height:s}=(r=i==null?void 0:i.detail)!=null?r:{};if(typeof a!="number"||typeof s!="number")return;let o=window.__updateSplashLayout;typeof o=="function"&&o(a,s)};e.__splashScreenListener=n,window.addEventListener("handler-preview:screen",n)}}getSplashButton(){return this.splashButton}shouldShowOnStart(){return this.splashEnabled&&this.splashConfig.show_on_start}destroy(){this.stopLoadingAnimation(),this.loadingLayer.destroy({children:!0}),this.splashLayer.destroy({children:!0})}};var sn=require("pixi.js");function Na(t,e,n){var g,p,d,f;let i=e.objects.get("hand_tutorial_1")||e.objects.get("hand_1")||Array.from(e.objects.values()).find(h=>{var b;return((b=h==null?void 0:h.identity)==null?void 0:b.id)==="hand.tutorial"}),a=((g=i==null?void 0:i.gameplay)==null?void 0:g.tuning)||{},s=(i==null?void 0:i.render)||{},o=(i==null?void 0:i.transform)||{},r=new sn.Sprite(t),c=s==null?void 0:s.anchor;c&&typeof c.x=="number"&&typeof c.y=="number"?r.anchor.set(c.x,c.y):r.anchor.set(.5),r.alpha=0;let l=(p=a.hand_scale_multiplier)!=null?p:2.5,u=(d=o.scale)!=null?d:.1875;return r.scale.set(u*l),r.zIndex=(f=s.z_index)!=null?f:99999,r}function $a(t){var h,b,m,y,_,C,v,I,R,M;let e=t.objects.get("ui_tutorial_1")||t.objects.get("label_1")||Array.from(t.objects.values()).find(w=>{var L;return["ui.tutorial","label.warning"].includes((L=w==null?void 0:w.identity)==null?void 0:L.id)}),n=e==null?void 0:e.ui,i=(e==null?void 0:e.render)||{},a=((h=t.engine.runtime)==null?void 0:h.ui_styles)||{},s=((b=t.engine.runtime)==null?void 0:b.ui)||{},o=(n==null?void 0:n.text)||s.tutorial_label||s.label_text||"CLEAN!",r=(n==null?void 0:n.font)||"brand.warning",c=(n==null?void 0:n.fontSize)||a.label_font_size||52,l=(y=n==null?void 0:n.letterSpacing)!=null?y:(m=a.label_letter_spacing)!=null?m:-1,u=(n==null?void 0:n.align)||"center",g=i.tint,p=typeof g=="string"?g:g?`#${g.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",d=new sn.Text({text:o,style:{fontFamily:oe(r),fontSize:c,fontWeight:re(r),fill:p,align:u,letterSpacing:l,stroke:{color:a.label_stroke||"#8B0000",width:2},dropShadow:{color:a.label_shadow_color||"#000000",alpha:(_=a.label_shadow_alpha)!=null?_:.8,angle:(C=a.label_shadow_angle)!=null?C:0,blur:(v=a.label_shadow_blur)!=null?v:4,distance:(I=a.label_shadow_distance)!=null?I:2}}}),f=i==null?void 0:i.anchor;return f&&typeof f.x=="number"&&typeof f.y=="number"?d.anchor.set(f.x,f.y):d.anchor.set(.5,.5),d.alpha=(R=i.alpha)!=null?R:0,d.visible=(M=i.visible)!=null?M:!0,d}function Ga(t,e,n,i,a){var c,l,u,g,p,d,f,h,b,m,y,_,C,v,I,R,M;let s=a.objects.get("hand_tutorial_1")||a.objects.get("hand_1")||Array.from(a.objects.values()).find(w=>{var L;return((L=w==null?void 0:w.identity)==null?void 0:L.id)==="hand.tutorial"}),o=((c=s==null?void 0:s.gameplay)==null?void 0:c.tuning)||{},r=(s==null?void 0:s.transform)||{};if(!i){let w=(l=o.animation_duration)!=null?l:1.5,L=n%w/w,G=L<.5?2*L*L:-1+(4-2*L)*L,E=(f=(d=(p=(u=r.position)==null?void 0:u.x)!=null?p:(g=r.offset)==null?void 0:g.x)!=null?d:o.start_x_offset)!=null?f:0,j=(_=(y=(m=(h=r.position)==null?void 0:h.y)!=null?m:(b=r.offset)==null?void 0:b.y)!=null?y:o.start_y_offset)!=null?_:0,N=(C=o.x_offset)!=null?C:0,H=(v=o.y_offset)!=null?v:0,q=(I=o.animation_range)!=null?I:40,pe=q*.7,D=q,K=e.x+E+N+pe,J=e.y+j+H+D,$=K+pe,Y=J+D;t.x=K+($-K)*G,t.y=J+(Y-J)*G;let $e=(R=r.scale)!=null?R:.1875,ke=(M=o.hand_scale_multiplier)!=null?M:2.5;t.scale.set($e*ke)}}var Et=null;function Js(){return Et||(typeof window!="undefined"&&window.lottie?Et=window.lottie:(console.warn("[LottieOverlay] lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),Et=null)),Et}function Jt(t){Et=t}function qa(t,e,n,i){var v,I,R,M,w,L,G,E,j,N,H,q,pe;let a=n.objects.get(t);if(!a)return console.warn(`[LottieOverlay] Object config not found: ${t}`),null;let s=((v=a.effects)==null?void 0:v.lottie)||{},o=a.transform||{},r=a.render||{};if(s.enabled===!1||r.visible===!1)return null;let c=i[t];if(!c||typeof c!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${t}`),null;let l=Js();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${t}`),null;let u=(I=s.width)!=null?I:300,g=(R=s.height)!=null?R:300,p=(M=o.scale)!=null?M:1,d=(L=(w=o.position)==null?void 0:w.x)!=null?L:0,f=(E=(G=o.position)==null?void 0:G.y)!=null?E:0,h=(j=o.rotation)!=null?j:0,b=(N=r.z_index)!=null?N:100,m=(H=r.alpha)!=null?H:1,y=document.createElement("div");y.style.cssText=`
|
|
18
18
|
position: absolute;
|
|
19
|
-
top: calc(50% + ${
|
|
19
|
+
top: calc(50% + ${f}px);
|
|
20
20
|
left: calc(50% + ${d}px);
|
|
21
|
-
transform: translate(-50%, -50%) scale(${p}) rotate(${
|
|
21
|
+
transform: translate(-50%, -50%) scale(${p}) rotate(${h}deg);
|
|
22
22
|
width: ${u}px;
|
|
23
|
-
height: ${
|
|
23
|
+
height: ${g}px;
|
|
24
24
|
pointer-events: none;
|
|
25
|
-
z-index: ${
|
|
26
|
-
opacity: ${
|
|
27
|
-
`,e.appendChild(w);let T=l.loadAnimation({container:w,renderer:i.renderer||"svg",loop:($=i.loop)!=null?$:!1,autoplay:(ue=i.autoplay)!=null?ue:!0,animationData:c});i.speed!==void 0&&T.setSpeed(i.speed);let E=()=>{T.destroy(),w.parentNode&&w.parentNode.removeChild(w)};return i.loop||T.addEventListener("complete",E),{animation:T,cleanup:E}}var ae=require("pixi.js");var Q=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()}};Q.store=new Map;function Fi(){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),s=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(n&&!s)}catch{return!1}}async function $i(){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 Ri(){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}var vs=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Es=Fi(),fe=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,b=Es?"publish":vs,Z=fe==null?void 0:fe.assetsInlined;fe!=null&&fe.buildMode&&(b=fe.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${b}`));var de=Ri();de!=null&&de.buildMode&&(b=de.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${b}`));(de==null?void 0:de.assetsInlined)!==void 0&&(Z=de.assetsInlined);$i().then(t=>{t!=null&&t.buildMode&&t.buildMode!==b&&(b=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${b}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(Z=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${vs}, Runtime: ${Es?"publish":"dev"}, Effective: ${b}`);var ie={},gt=null;async function Bi(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${b}`),Object.keys(ie).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(ie)),ie;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),ie={...window.INLINE_ASSETS},ie;if(!(b==="publish"&&Z!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),ie;if(!gt){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),gt=(async()=>{try{try{let i=await import(e+"?t="+Date.now());if(i.INLINE_ASSETS)return console.log("[AssetLoader] Loaded INLINE_ASSETS via ES module:",Object.keys(i.INLINE_ASSETS)),i.INLINE_ASSETS}catch(i){console.warn("[AssetLoader] ES module import failed, trying text parse:",i)}let n=await fetch(e);if(!n.ok)throw new Error(`HTTP ${n.status}: ${n.statusText}`);let s=await n.text();console.log("[AssetLoader] Received JS code, length:",s.length);let a=s.match(/export\s+const\s+INLINE_ASSETS\s*=\s*({[\s\S]*?});?\s*$/m);if(a)try{let i=a[1];console.log("[AssetLoader] Found INLINE_ASSETS export, parsing...");let o=new Function("return "+i)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(o)),o}catch(i){return console.warn("[AssetLoader] Failed to parse inline assets:",i),{}}else return console.warn("[AssetLoader] INLINE_ASSETS export not found in response"),console.log("[AssetLoader] JS code preview:",s.substring(0,500)),{}}catch(n){return console.warn("[AssetLoader] Failed to load inline assets:",n),{}}})()}return ie=await gt,console.log("[AssetLoader] Final inline assets cache:",Object.keys(ie)),ie}var Ls=new Map;function _t(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>_t(e))),t}function zi(t=64,e=64,n=16711680){let s=document.createElement("canvas");s.width=t,s.height=e;let a=s.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),ae.Texture.from(s)}function nt(t,e){Ls.set(t,e)}var Te=class{static async load(e,n,s){let a=Q.get(e);if(a!==void 0)return a;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${b}`),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 i=await Bi(),o=i[e];if(!o&&n.path){let l=n.path.split("/");if(l.length>=2){let u=l[l.length-1].split(".")[0],h=l[0],p=[`${u}.layer`,`${u}.player`,`${u}.tutorial`,`effects.${u}`,`ui.endgame.${u}`,u];for(let d of p)if(i[d]){o=i[d],console.log(`[AssetLoader] Found inline data for ${e} using derived key: ${d}`);break}}}if(console.log("[AssetLoader] Inline data for",e,":",o?"FOUND":"NOT FOUND"),b==="publish"&&Z!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!o))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let c=Ls.get(n.type);if(c)try{let l=await c(n.path,o,e,s);return Q.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}try{let l;switch(n.type){case"image":l=await this.loadImage(n.path,o);break;case"json":l=await this.loadJSON(n.path,o),l=_t(l);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return Q.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}}static async loadImage(e,n){let s=b==="publish",a=s&&Z!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${b}, isPublishMode: ${s}, 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(!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${n.substring(0,50)}...`);try{return await ae.Assets.load(n)}catch(i){throw console.error("[AssetLoader] Failed to load texture from data URI:",i),i}}if(n&&n.startsWith("data:"))try{return await ae.Assets.load(n)}catch(i){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",i),await ae.Assets.load(e)}return await ae.Assets.load(e)}static async loadJSON(e,n){let s=b==="publish",a=s&&Z!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${b}, isPublishMode: ${s}, 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(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}if(n){if(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}let i=await fetch(e);if(!i.ok)throw new Error(`JSON fetch failed: ${e}`);return i.json()}static handleFailure(e,n,s){if(b==="dev"){let i=n==="image"?zi():_t({__placeholder:!0,type:n});return Q.set(e,i),i}throw s}};nt("image",async(t,e)=>{let n=b==="publish",s=n&&Z!==!1,a=b==="brand",i=n&&Z===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${b}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),s){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(!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${e.substring(0,50)}...`);return ae.Assets.load(e)}let o=t;return(a||i)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(o=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(o=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${o}"`))),ae.Assets.load(e||o)});nt("json",async(t,e)=>{let n=b==="publish",s=n&&Z!==!1,a=b==="brand",i=n&&Z===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${b}, isPublishMode: ${n}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),s){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 e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let o=t;if((a||i)&&t&&!t.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(o=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(o=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${o}"`))),e)return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let r=await fetch(o);if(!r.ok)throw new Error(`JSON fetch failed: ${t}`);return r.json()});var Fe=require("pixi.js");var Hi=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",bt=Hi;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&&(bt=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${bt}`))}}catch{}var st=class{static async create(e,n,s){var r,c,l,u,h,p;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${bt}`);let a=(r=n==null?void 0:n.render)==null?void 0:r.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let d=new Fe.Container;return this.applyTransform(d,n==null?void 0:n.transform),d}console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, type: ${a.type}, path: ${a.path}`);let i=await Te.load(e,a,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(c=i==null?void 0:i.constructor)==null?void 0:c.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",i,"for object:",e),o=new Fe.Sprite(i),console.log("[ObjectFactory] Created object:",o,"type:",(l=o==null?void 0:o.constructor)==null?void 0:l.name),this.applyTransform(o,n==null?void 0:n.transform);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=i==null?void 0:i.constructor)==null?void 0:u.name,i),i&&(((h=i.constructor)==null?void 0:h.name)==="Container"||i instanceof Fe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let d=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],m=!1;for(let f of d)try{let g=await fetch(f);if(g.ok){o=await g.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",f,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),m=!0;break}}catch{continue}m||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=i)}else o=i;else o=i,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform);return o}static applyTransform(e,n){var s,a,i,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(s=n.position.x)!=null?s:0,e.y=(a=n.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((i=n.position.x)!=null?i: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&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};0&&(module.exports={AssetCache,AssetLoader,GameObject,GameObjectManager,ObjectFactory,Renderer,Transform,animateHandClick,animatePanelEntrance,createEndGamePanel,createHandTutorial,createPixiBase,createTutorialLabel,getRegisteredFontIds,playLottieOverlay,registerFont,registerType,resolveFont,resolveFontWeight,setLottieInstance,updateHandAnimation});
|
|
25
|
+
z-index: ${b};
|
|
26
|
+
opacity: ${m};
|
|
27
|
+
`,e.appendChild(y);let _=l.loadAnimation({container:y,renderer:s.renderer||"svg",loop:(q=s.loop)!=null?q:!1,autoplay:(pe=s.autoplay)!=null?pe:!0,animationData:c});s.speed!==void 0&&_.setSpeed(s.speed);let C=()=>{_.destroy(),y.parentNode&&y.parentNode.removeChild(y)};return s.loop||_.addEventListener("complete",C),{animation:_,cleanup:C}}var Ee=require("pixi.js");var ge=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()}};ge.store=new Map;function Qs(){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 Zs(){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 eo(){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}var Ua=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Ya=Qs(),ze=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,k=Ya?"publish":Ua,he=ze==null?void 0:ze.assetsInlined;ze!=null&&ze.buildMode&&(k=ze.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${k}`));var Me=eo();Me!=null&&Me.buildMode&&(k=Me.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${k}`));(Me==null?void 0:Me.assetsInlined)!==void 0&&(he=Me.assetsInlined);Zs().then(t=>{t!=null&&t.buildMode&&t.buildMode!==k&&(k=t.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${k}`)),(t==null?void 0:t.assetsInlined)!==void 0&&(he=t.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${Ua}, Runtime: ${Ya?"publish":"dev"}, Effective: ${k}`);var Se={},zn=null;async function to(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${k}`),Object.keys(Se).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(Se)),Se;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),Se={...window.INLINE_ASSETS},Se;if(!(k==="publish"&&he!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),Se;if(!zn){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),zn=(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 o=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(o)),o}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 Se=await zn,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Se)),Se}var Wa=new Map;function Fn(t){return t===null||typeof t!="object"||(Object.freeze(t),Object.values(t).forEach(e=>Fn(e))),t}function no(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),Ee.Texture.from(i)}function on(t,e){Wa.set(t,e)}var Ze=class{static async load(e,n,i){let a=ge.get(e);if(a!==void 0)return a;console.log(`[AssetLoader] Loading asset: ${e}, type: ${n.type}, Effective mode: ${k}`),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 s=await to(),o=s[e];if(!o&&n.path){let l=n.path.split("/");if(l.length>=2){let u=l[l.length-1].split(".")[0],g=l[0],p=[`${u}.layer`,`${u}.player`,`${u}.tutorial`,`effects.${u}`,`ui.endgame.${u}`,u];for(let d of p)if(s[d]){o=s[d],console.log(`[AssetLoader] Found inline data for ${e} using derived key: ${d}`);break}}}if(console.log("[AssetLoader] Inline data for",e,":",o?"FOUND":"NOT FOUND"),k==="publish"&&he!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!o))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${n.path}`);let c=Wa.get(n.type);if(c)try{let l=await c(n.path,o,e,i);return ge.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}try{let l;switch(n.type){case"image":l=await this.loadImage(n.path,o);break;case"json":l=await this.loadJSON(n.path,o),l=Fn(l);break;default:throw new Error(`Unknown asset type: ${n.type}`)}return ge.set(e,l),l}catch(l){return this.handleFailure(e,n.type,l)}}static async loadImage(e,n){let i=k==="publish",a=i&&he!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${k}, 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(!n.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${n.substring(0,50)}...`);try{return await Ee.Assets.load(n)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(n&&n.startsWith("data:"))try{return await Ee.Assets.load(n)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await Ee.Assets.load(e)}return await Ee.Assets.load(e)}static async loadJSON(e,n){let i=k==="publish",a=i&&he!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${k}, 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(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}return JSON.parse(n)}if(n){if(n.startsWith("data:")){let o=atob(n.split(",")[1]);return JSON.parse(o)}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(k==="dev"){let s=n==="image"?no():Fn({__placeholder:!0,type:n});return ge.set(e,s),s}throw i}};on("image",async(t,e)=>{let n=k==="publish",i=n&&he!==!1,a=k==="brand",s=n&&he===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${k}, 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(!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${e.substring(0,50)}...`);return Ee.Assets.load(e)}let o=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/"]')?(o=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(o=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${o}"`))),Ee.Assets.load(e||o)});on("json",async(t,e)=>{let n=k==="publish",i=n&&he!==!1,a=k==="brand",s=n&&he===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${k}, 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 e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let o=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/"]')?(o=t,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${t}" as-is`)):(o=`assets/${t}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${t}" -> "${o}"`))),e)return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let r=await fetch(o);if(!r.ok)throw new Error(`JSON fetch failed: ${t}`);return r.json()});var _t=require("pixi.js");var io=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Nn=io;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&&(Nn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Nn}`))}}catch{}var Fe=class{static async create(e,n,i){var r,c,l,u,g,p;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${Nn}`);let a=(r=n==null?void 0:n.render)==null?void 0:r.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let d=new _t.Container;return this.applyTransform(d,n==null?void 0:n.transform),d}console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, type: ${a.type}, path: ${a.path}`);let s=await Ze.load(e,a,i);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(c=s==null?void 0:s.constructor)==null?void 0:c.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),o=new _t.Sprite(s),console.log("[ObjectFactory] Created object:",o,"type:",(l=o==null?void 0:o.constructor)==null?void 0:l.name),this.applyTransform(o,n==null?void 0:n.transform);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((g=s.constructor)==null?void 0:g.name)==="Container"||s instanceof _t.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let d=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],f=!1;for(let h of d)try{let b=await fetch(h);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",h,"type:",(p=o==null?void 0:o.constructor)==null?void 0:p.name),f=!0;break}}catch{continue}f||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=s)}else o=s;else o=s,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform);return o}static applyTransform(e,n){var i,a,s,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(i=n.position.x)!=null?i:0,e.y=(a=n.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((s=n.position.x)!=null?s: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&&Array.isArray(n.anchor)&&("set"in e.anchor?e.anchor.set(n.anchor[0],n.anchor[1]):(e.anchor.x=n.anchor[0],e.anchor.y=n.anchor[1])))}};var rn=class{constructor(e,n,i){this.systems=[];this.totalTime=0;this.root=e,this.config=n,this.destinationUrl=i}async init(e){let{app:n,stage:i}=await nn(this.root,{background:e.background_color,text:e.text_color,primary:e.cta_background,cta_text:e.cta_text});this.app=n,this.stage=i,this.gameObjectManager=new Je(this.config),this.stage.eventMode="passive",this.stage.interactive=!1,this.stage.interactiveChildren=!0,this.stage.sortableChildren=!0;let a={app:this.app,stage:this.stage,config:this.config,gameObjectManager:this.gameObjectManager,destinationUrl:this.destinationUrl,root:this.root,engine:this};for(let s of this.systems)s.setContext(a),s.init&&await s.init();return{app:this.app,gameObjectManager:this.gameObjectManager}}registerSystems(e){this.systems.push(...e)}async start(){for(let e of this.systems)e.onStart&&await e.onStart();this.app.ticker.add(this.update.bind(this)),window.addEventListener("handler-preview:screen",e=>{let{width:n,height:i}=e.detail;this.resize(n,i)})}update(e){let n=e.deltaTime/60;this.totalTime+=n;for(let i of this.systems)i.update&&i.update(n,this.totalTime)}resize(e,n){for(let i of this.systems)i.onResize&&i.onResize(e,n)}updateConfig(e){this.config=e;for(let n of this.systems)n.context.config=e,n.onConfigUpdate&&n.onConfigUpdate(e)}destroy(){for(let e of this.systems)e.onDestroy&&e.onDestroy();this.app.ticker.remove(this.update.bind(this)),this.app.destroy(!0,{children:!0,texture:!1})}getApp(){return this.app}getGameObjectManager(){return this.gameObjectManager}getTotalTime(){return this.totalTime}getSystem(e){let n=this.systems.find(i=>i instanceof e);if(!n)throw new Error(`System ${e.name} not found!`);return n}};var et=class{setContext(e){this.context=e}};var tt=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 Va=Ln(require("pixi.js")),Xa=Va;typeof window!="undefined"&&(window.__basePixi=Va);var $n=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new tt}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 r;let o=this.registry.get(s);if(!o){console.warn("[Assets] No config found for object:",s);return}try{let c=await Fe.create(s,o,this.app);this.instanceCache.set(s,c),console.log("[Assets] Loaded object:",s,(r=c==null?void 0:c.constructor)==null?void 0:r.name)}catch(c){console.error("[Assets] Failed to load object:",s,c)}})))};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)}},Ka=new $n,_e=new Proxy(Ka,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});function ln(t,e){Ka.init(t,e)}var nt=require("pixi.js");var cn=class extends et{constructor(){super(...arguments);this.splashScreen=null}async init(){ln(this.context.config,this.context.app),this.splashScreen=new Qe(this.context.app,this.context.stage,this.context.config),this.splashScreen.getSplashButton().on("pointerdown",()=>this.splashScreen.hide());let n=null;try{await _e.reloadObject("background_1");let i=_e.background_1;i&&(i instanceof nt.Sprite||i instanceof nt.Graphics)&&(i.parent||this.context.stage.addChildAt(i,0),n=this.splashScreen.applyLoadingBlur(i))}catch(i){console.warn("[AssetSystem] Background preload failed:",i)}if(await _e.ready(),this.splashScreen){this.splashScreen.stopLoadingAnimation(),this.splashScreen.destroyLoadingLayer();let i=_e.background_1;i&&(i instanceof nt.Sprite||i instanceof nt.Graphics)&&this.splashScreen.removeLoadingBlur(i,n)}console.log("[AssetSystem] All assets preloaded and ready")}async onStart(){this.splashScreen&&this.splashScreen.shouldShowOnStart()&&this.splashScreen.show()}onConfigUpdate(){typeof _e.updateConfig=="function"&&_e.updateConfig(this.context.config)}};var gn=require("pixi.js"),Ce={width:400,height:600,designWidth:400,scaleFactor:1},Lt={scale:1,position:1},hn=[];function ao(t,e,n,i,a,s,o){hn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,o,!1)}function so(){hn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*Ce.scaleFactor;n(t,Ce.width,Ce.height,i,a,!0,!1)})}function Ja(){hn.length=0,console.log("[LAYOUT] Cleared all responsive elements")}function un(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),Ce.width=t,Ce.height=e,Ce.scaleFactor=Math.min(t/Ce.designWidth,1.15),Lt.scale=Ce.scaleFactor,Lt.position=1,console.log(`[SCREEN] Global multipliers - scale: ${Lt.scale.toFixed(3)}`),so()}var T={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},physics:{rope_length:420,gravity:9.8,friction:.1}};function oo(t,e,n){let i=T[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function ro(){return T}var lo={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 dn(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function fn(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:dn(t[0],e.x),y:dn(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:dn(i.x,e.x),y:dn(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=lo[i])!=null?n:e}return e}function bn(t,e,n,i={}){var d,f,h,b,m,y;let a=fn(n),s=(d=i.inset)!=null?d:{},o=(f=i.padding)!=null?f:{x:0,y:0},r=((h=s.left)!=null?h:0)+o.x,c=((b=s.right)!=null?b:0)+o.x,l=((m=s.top)!=null?m:0)+o.y,u=((y=s.bottom)!=null?y:0)+o.y,g=Math.max(0,t-r-c),p=Math.max(0,e-l-u);return{x:r+g*a.x,y:l+p*a.y}}function mn(t,e,n,i={}){var h,b,m,y,_,C;let a=(h=i.inset)!=null?h:{},s=(b=i.padding)!=null?b:{x:0,y:0},o=((m=a.left)!=null?m:0)+s.x,r=((y=a.right)!=null?y:0)+s.x,c=((_=a.top)!=null?_:0)+s.y,l=((C=a.bottom)!=null?C:0)+s.y,u=Math.max(0,t-o-r),g=Math.max(0,e-c-l),p=fn(n,{x:.5,y:.5}),d=Math.min(Math.max(p.x,0),1),f=Math.min(Math.max(p.y,0),1);return{x:o+u*d,y:c+g*f}}function pn(t,e,n,i={}){var u,g,p;if(!t)return;let a=i.positionRatio?mn(e,n,i.positionRatio,{inset:i.inset,padding:i.screenPadding}):bn(e,n,i.anchor,{inset:i.inset,padding:i.screenPadding}),s=(u=i.offset)!=null?u:{x:0,y:0},o=a.x+s.x,r=a.y+s.y;t.anchor&&i.renderAnchor&&t.anchor.set(i.renderAnchor.x,i.renderAnchor.y),ue(t,o,r);let c=(g=i.scale)!=null?g:1,l=(p=i.scaleMultiplier)!=null?p:1;(i.scale!==void 0||i.scaleMultiplier!==void 0)&&fe(t,c*l)}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,un(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),un(window.innerWidth,window.innerHeight),window.updateDebugConfig=oo,window.getDebugConfig=ro,window.copyConfig=xo,window.applyConfig=Ct,window.applyConfigForRatio=wo,window.positionAtBottom=Qa,window.positionAtTop=po,window.positionAtCenter=go,window.positionAtLeft=ho,window.positionAtRight=fo,window.positionAtBottomLeft=bo,window.positionAtBottomRight=mo,window.positionAtTopLeft=yo,window.positionAtTopRight=vo,window.applyPositionContract=uo,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 yn(t,e,n=0){return t*e+n}function vn(t,e,n=0){return t*(1-e)+n}function xn(t,e,n=0){return t*e+n}function wn(t,e,n=0){return t*(1-e)+n}function le(t,e=0){return t/2+e}function co(t,e){return t*e}function uo(t,e,n,i){var o,r,c,l,u,g,p,d,f,h,b,m,y,_,C,v,I,R,M,w;let a=0,s=0;switch(i.type){case"top":a=le(e,(r=(o=i.offset)==null?void 0:o.x)!=null?r:0),s=yn(n,i.percent,(l=(c=i.offset)==null?void 0:c.y)!=null?l:0);break;case"bottom":a=le(e,(g=(u=i.offset)==null?void 0:u.x)!=null?g:0),s=vn(n,i.percent,(d=(p=i.offset)==null?void 0:p.y)!=null?d:0);break;case"left":a=xn(e,i.percent,(h=(f=i.offset)==null?void 0:f.x)!=null?h:0),s=le(n,(m=(b=i.offset)==null?void 0:b.y)!=null?m:0);break;case"right":a=wn(e,i.percent,(_=(y=i.offset)==null?void 0:y.x)!=null?_:0),s=le(n,(v=(C=i.offset)==null?void 0:C.y)!=null?v:0);break;case"center":a=le(e,(R=(I=i.offset)==null?void 0:I.x)!=null?R:0),s=le(n,(w=(M=i.offset)==null?void 0:M.y)!=null?w: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 Qa(t,e,n,i=.2,a=1,s=!0,o=!1){let r=co(n,i),c=vn(n,i/2);ue(t,le(e),c);let l=s?a*Ce.scaleFactor:a;fe(t,l),o&&!hn.find(u=>u.element===t)&&ao(t,Qa,e,n,i,a,s)}function po(t,e,n,i=.1,a=1){ue(t,le(e),yn(n,i)),fe(t,a)}function go(t,e,n,i=0,a=0,s=1){ue(t,le(e,i),le(n,a)),fe(t,s)}function ho(t,e,n,i=.1,a=1){ue(t,xn(e,i),le(n)),fe(t,a)}function fo(t,e,n,i=.1,a=1){ue(t,wn(e,i),le(n)),fe(t,a)}function bo(t,e,n,i=.05,a=.05,s=1){ue(t,xn(e,a),vn(n,i)),fe(t,s)}function mo(t,e,n,i=.05,a=.05,s=1){ue(t,wn(e,a),vn(n,i)),fe(t,s)}function yo(t,e,n,i=.05,a=.05,s=1){ue(t,xn(e,a),yn(n,i)),fe(t,s)}function vo(t,e,n,i=.05,a=.05,s=1){ue(t,wn(e,a),yn(n,i)),fe(t,s)}function ue(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 fe(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 Ne={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},physics:{rope_length:420,gravity:9.8,friction:.1}},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},physics:{rope_length:420,gravity:9.8,friction:.1}},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},physics:{rope_length:380,gravity:9.8,friction:.1}},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},physics:{rope_length:450,gravity:9.8,friction:.1}}};function xo(t){return t&&Ne[t]?JSON.parse(JSON.stringify(Ne[t])):JSON.parse(JSON.stringify(T))}function Ct(t){Object.keys(t).forEach(e=>{let n=e;T[n]&&t[n]&&Object.assign(T[n],t[n])}),console.log("Config applied:",t)}function wo(t,e){let n=t/e;n>1.6?(Ct(Ne.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Ct(Ne.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Ct(Ne.square),console.log("Applied SQUARE config for ratio:",n)):(Ct(Ne.default),console.log("Applied DEFAULT config for ratio:",n))}typeof window!="undefined"&&(window.configPresets=Ne);var Z=null;function Za(t,e,n,i,a,s={}){var q,pe,D,K,J,$,Y,$e,ke,At,Tt,Ie,Mt,it,kt,ce,at,It,W,st,Ot,ot,Pt,Rt,Oe,jt,be,Sn,Ht,ee,rt,Bt,lt,Dt,Pe,zt,Ft,Nt,me,$t,Gt,te,V,Re;let o=(q=s.enableDebugLogs)!=null?q:!1;o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== STARTING LAYOUT CALCULATION ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Screen dimensions:",{width:i.width,height:i.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Time:",n),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Options:",s));let{mainContainer:r,label:c,background:l,backgroundTexture:u,app:g}=t;if(!g||!g.renderer){o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] \u274C No app or renderer, skipping layout");return}o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] App renderer dimensions:",{width:g.renderer.width,height:g.renderer.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] App screen dimensions:",{width:g.screen.width,height:g.screen.height}));let p=i.width,d=i.height;o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Base dimensions:",{baseWidth:p,baseHeight:d});let f=p*T.layout.screen_scale_x,h=d*T.layout.screen_scale_y,b=p/2,m=e.engine.runtime||{},y=m.layout||{};o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug config:",{screen_scale_x:T.layout.screen_scale_x,screen_scale_y:T.layout.screen_scale_y}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Calculated dimensions:",{width:f,height:h,midX:b}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Engine runtime:",m),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Layout config:",y));let _=y.design_width_portrait||400,C=f/_;C=Math.min(C,1.15);let v=C*((pe=T.engine.scale)!=null?pe:1),I=(D=s.skipMainContainerTransform)!=null?D:!1;!I&&r&&r.scale&&(typeof r.scale.set=="function"?r.scale.set(v):(r.scale.x=v,r.scale.y=v));let M=((K=T.physics.rope_length)!=null?K:420)*v,w=p/d>.6,L;w?L=h*.65:L=M+h*.1,!I&&r&&r.position&&(typeof r.position.set=="function"?r.position.set(b+T.layout.position_offset.x,L+T.layout.position_offset.y):(r.position.x=b+T.layout.position_offset.x,r.position.y=L+T.layout.position_offset.y));let G=new Set((J=s.skipInstanceIds)!=null?J:[]);if(a&&(r!=null&&r.toLocal))for(let[A,F]of e.objects.entries()){let O=F==null?void 0:F.transform;if(!O||G.has(A))continue;let x=($=a.get)==null?void 0:$.call(a,A),ne=((Y=x==null?void 0:x.getDisplayObject)==null?void 0:Y.call(x))||(x==null?void 0:x.pixiObject)||x;if(!ne||ne.parent!==r)continue;let de=O.position_ratio!=null?mn(p,d,O.position_ratio):bn(p,d,($e=O.anchor)!=null?$e:"center"),je=r.toLocal(new gn.Point(de.x,de.y)),ye=(ke=O.position)!=null?ke:{x:0,y:0},U=je.x+ye.x,He=je.y+ye.y;typeof(x==null?void 0:x.setPosition)=="function"?x.setPosition(U,He):(ue(ne,U,He),(At=x==null?void 0:x.transform)!=null&&At.position&&(x.transform.position.x=U,x.transform.position.y=He))}if(T.layout.debug_rect_visible){(!Z||Z.parent!==g.stage)&&(Z==null||Z.destroy(),Z=new gn.Graphics,Z.zIndex=9999,g.stage.addChild(Z)),Z.clear();let A=T.layout.debug_rect_scale_x,F=T.layout.debug_rect_scale_y,O=(p-4)*A,x=(d-4)*F,ne=(p-O)/2,de=(d-x)/2;o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== DEBUG RECT POSITIONING ====="),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect calculations:",{baseWidth:p,baseHeight:d,rectW:O,rectH:x,offsetX:ne,offsetY:de}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Debug rect final position:",{x:2+ne,y:2+de,width:O,height:x})),Z.rect(2+ne,2+de,O,x).stroke({width:T.layout.debug_rect_thickness,color:T.layout.debug_rect_color})}else Z&&(Z.destroy(),Z=null);let E=e.objects.get("label_1")||e.objects.get("ui_tutorial_1"),j=e.objects.get("hazard_1"),N=(ce=(kt=(Ie=(Tt=j==null?void 0:j.gameplay)==null?void 0:Tt.rules)==null?void 0:Ie.hazard_height)!=null?kt:(it=(Mt=j==null?void 0:j.gameplay)==null?void 0:Mt.tuning)==null?void 0:it.hazard_height)!=null?ce:0;if(c&&c.position){let A=(at=E==null?void 0:E.render)==null?void 0:at.anchor,F=(W=(It=E==null?void 0:E.transform)==null?void 0:It.anchor)!=null?W:"center",O=(st=E==null?void 0:E.transform)==null?void 0:st.position_ratio,x=((Ot=E==null?void 0:E.transform)==null?void 0:Ot.offset)||{x:0,y:0};pn(c,p,d,{anchor:F,positionRatio:O,offset:{x:x.x*v,y:x.y*v},inset:{bottom:N},renderAnchor:A})}if(c&&c.alpha>0){let A=1+Math.sin(n*T.engine.label_pulse_speed)*T.engine.label_pulse_intensity,F=(Pt=(ot=E==null?void 0:E.transform)==null?void 0:ot.scale)!=null?Pt:1,O=A*v*F;c.scale&&(typeof c.scale.set=="function"?c.scale.set(O):(c.scale.x=O,c.scale.y=O))}if(o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] ===== BACKGROUND POSITIONING ====="),l){o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background object exists:",!!l),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background type:",(Rt=l.constructor)==null?void 0:Rt.name)),l.alpha=((jt=(Oe=m.background)==null?void 0:Oe.alpha)!=null?jt:.98)*T.engine.background_alpha,o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background alpha set to:",l.alpha);let A=e.objects.get("background_1");o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background config:",A);let F=(A==null?void 0:A.transform)||{};o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background transform:",F);let O=F.offset||{x:0,y:0},x=((Sn=(be=m.background)==null?void 0:be.offset_y)!=null?Sn:0)+T.engine.background_offset_y,ne=(ee=(Ht=A==null?void 0:A.render)==null?void 0:Ht.anchor)!=null?ee:{x:.5,y:.5},de=(rt=F.anchor)!=null?rt:"center",je=F.position_ratio;if(o&&console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background positioning params:",{bgOffset:O,bgRuntimeOffsetY:x,bgRenderAnchor:ne,bgScreenAnchor:de,bgPositionRatio:je,baseWidth:p,baseHeight:d,finalScale:v}),pn(l,p,d,{anchor:de,positionRatio:je,offset:{x:O.x*v,y:O.y*v+x},renderAnchor:ne}),o&&(console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background position after applyScreenAnchor:",{x:l.x,y:l.y,scaleX:(Bt=l.scale)==null?void 0:Bt.x,scaleY:(lt=l.scale)==null?void 0:lt.y,anchorX:(Dt=l.anchor)==null?void 0:Dt.x,anchorY:(Pe=l.anchor)==null?void 0:Pe.y,pivotX:(zt=l.pivot)==null?void 0:zt.x,pivotY:(Ft=l.pivot)==null?void 0:Ft.y,width:l.width,height:l.height}),console.log("\u{1F3AF} [LAYOUT_DEBUGS] Background texture dimensions:",{textureWidth:u==null?void 0:u.width,textureHeight:u==null?void 0:u.height})),u){let ye=Math.max(f/u.width,h/u.height),U=(me=(Nt=m.background)==null?void 0:Nt.scale_multiplier)!=null?me:1.05,He=($t=F.scale)!=null?$t:1,ct=ye*U*T.engine.background_scale*He;l.scale&&(typeof l.scale.set=="function"?l.scale.set(ct):(l.scale.x=ct,l.scale.y=ct))}else l&&typeof l.clear=="function"&&(l.clear(),l.rect(-f/2,-h/2,f,h).fill({color:1444375}))}let H=(Gt=window.gameObjectManager)==null?void 0:Gt.get("character_1");if(H){let A=((te=H.getDisplayObject)==null?void 0:te.call(H))||H;A&&A.scale&&(console.log(`[CHARACTER] After layout - Adjusted scale - x: ${((V=A.scale.x)!=null?V:1).toFixed(3)}, y: ${((Re=A.scale.y)!=null?Re:1).toFixed(3)}`),console.log(`[CHARACTER] Layout finalScale: ${v.toFixed(3)}`))}}function es(t){var r,c,l;let{setState:e,updateLabelAlpha:n,updateHandAlpha:i,config:a,states:s}=t,o=((c=(r=a.engine)==null?void 0:r.runtime)==null?void 0:c.timeline)||{};e(s.showHook),setTimeout(()=>{n(1),i(1),e(s.waitInput),console.log("[GAME] \u23F3 Game ready for user input - tutorial shown")},(l=o.tutorial_delay_ms)!=null?l:1500)}0&&(module.exports={AssetCache,AssetLoader,AssetSystem,Assets,BaseSystem,GameEngine,GameObject,GameObjectManager,ObjectFactory,Renderer,RuntimeObjectRegistry,SplashScreen,Transform,animateHandClick,animatePanelEntrance,applyScreenAnchor,basePixi,clearResponsiveElements,createEndGamePanel,createHandTutorial,createPixiBase,createTutorialLabel,getRegisteredFontIds,globalResponsiveMultipliers,initAssets,layout,playLottieOverlay,registerFont,registerType,resolveAnchorVec2,resolveFont,resolveFontWeight,resolveScreenAnchorPoint,resolveScreenRatioPoint,runInitSequence,setLottieInstance,updateHandAnimation,updateScreenState});
|
package/dist/pixi/index.mjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
import{b as be}from"../chunk-U4PCKCX6.mjs";import{Application as Wn}from"pixi.js";async function Hn(n,e={}){let t=new Wn;await t.init({resizeTo:n,autoDensity:!0,resolution:window.devicePixelRatio||1,antialias:!0,backgroundAlpha:0});let o=s=>{var c,l,u,f,p,d;if(!t.renderer)return;let i=(u=(l=(c=s==null?void 0:s.width)!=null?c:n.clientWidth)!=null?l:window.innerWidth)!=null?u:320,r=(d=(p=(f=s==null?void 0:s.height)!=null?f:n.clientHeight)!=null?p:window.innerHeight)!=null?d:480;t.renderer.resize(i,r)};n.innerHTML="",n.style.position="relative",n.style.display="flex",n.style.flexDirection="column",n.style.alignItems="stretch",n.style.width="100%",n.style.height="100dvh",n.style.minHeight="100vh",n.style.maxWidth="100%",n.style.maxHeight="100%",n.style.boxSizing="border-box",n.style.overflow="hidden",e.background&&(n.style.background=e.background),n.appendChild(t.canvas);let a=document.createElement("div");return a.setAttribute("style",["position:absolute","inset:0","display:flex","flex-direction:column","align-items:center","justify-content:flex-start","gap:12px","pointer-events:none","font-family:Arial,sans-serif","padding:20px 16px","padding-bottom:clamp(24px, 6vh, 96px)","box-sizing:border-box","z-index:2"].join(";")),n.appendChild(a),be.on("pause",()=>{t.ticker.stop(),document.querySelectorAll("audio").forEach(i=>i.pause())}),be.on("resume",()=>{t.ticker.start(),document.querySelectorAll("audio").forEach(i=>{i.currentTime>0&&!i.ended&&i.play().catch(()=>{})})}),be.on("resize",({payload:s})=>{o({width:s==null?void 0:s.width,height:s==null?void 0:s.height})}),window.addEventListener("resize",()=>o()),requestAnimationFrame(()=>o()),{app:t,stage:t.stage,overlay:a,applySize:o}}var xe=class{constructor(e){var t,o;this.position=(e==null?void 0:e.position)||{x:0,y:0},this.scale=(t=e==null?void 0:e.scale)!=null?t:1,this.rotation=(o=e==null?void 0:e.rotation)!=null?o: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)}syncToPixi(e){e.position.set(this.position.x,this.position.y),e.scale.set(this.scale),e.rotation=this.rotation}},we=class{constructor(e){var t,o,a,s;this.z_index=(t=e==null?void 0:e.z_index)!=null?t:0,this.alpha=(o=e==null?void 0:e.alpha)!=null?o: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)}syncToPixi(e){e.zIndex=this.z_index,e.alpha=this.alpha,e.visible=this.visible,this.tint!==null&&"tint"in e&&(e.tint=this.tint)}},Se=class{constructor(e,t,o,a){this.instanceId=e,this.objectConfig=t,this.pixiObject=o,this._config=a,this.transform=new xe(a.transform),this.renderer=new we(a.render),this.sync()}sync(){this.transform.syncToPixi(this.pixiObject),this.renderer.syncToPixi(this.pixiObject),this.applyAnchor(),this.applyEffectsScale()}updateConfig(e){this._config=e,e.transform&&this.transform.update(e.transform),e.render&&this.renderer.update(e.render),this.sync()}applyAnchor(){var a,s,i,r;if(!this.pixiObject||!("anchor"in this.pixiObject)||!this.pixiObject.anchor)return;let e=(s=(a=this._config)==null?void 0:a.render)==null?void 0:s.anchor,t=(r=(i=this._config)==null?void 0:i.transform)==null?void 0:r.anchor,o=e&&typeof e=="object"?e:t&&typeof t=="object"?t:null;o&&typeof o.x=="number"&&typeof o.y=="number"&&this.pixiObject.anchor.set(o.x,o.y)}applyEffectsScale(){var s,i,r;if(!((s=this.pixiObject)!=null&&s.scale))return;let e=(i=this._config)==null?void 0:i.effects,t=typeof(e==null?void 0:e.scale_x)=="number"?e.scale_x:1,o=typeof(e==null?void 0:e.scale_y)=="number"?e.scale_y:1;if(t===1&&o===1)return;let a=(r=this.transform.scale)!=null?r:1;typeof this.pixiObject.scale.set=="function"?this.pixiObject.scale.set(a*t,a*o):(this.pixiObject.scale.x=a*t,this.pixiObject.scale.y=a*o)}getComponent(e){return this._config[e]}getPosition(){return{...this.transform.position}}setPosition(e,t){this.transform.position={x:e,y:t},this.transform.syncToPixi(this.pixiObject)}getAlpha(){return this.renderer.alpha}setAlpha(e){this.renderer.alpha=e,this.renderer.syncToPixi(this.pixiObject)}getVisible(){return this.renderer.visible}setVisible(e){this.renderer.visible=e,this.renderer.syncToPixi(this.pixiObject)}},$e=class{constructor(e){this.objects=new Map;this.config=e}create(e,t){let o=this.config.objects.get(e);if(!o)throw new Error(`Object config not found: ${e}`);let a=new Se(e,o.object_config||e,t,o);return this.objects.set(e,a),a}get(e){return this.objects.get(e)}updateConfig(e){this.config=e;for(let[t,o]of this.objects.entries()){let a=e.objects.get(t);a&&o.updateConfig(a)}}getAll(){return Array.from(this.objects.values())}remove(e){this.objects.delete(e)}clear(){this.objects.clear()}};var Ae={"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 V(n){let e=Ae[n];return e?e.family:(console.warn(`Font ID "${n}" not found in registry, using fallback`),"Arial, sans-serif")}function K(n){var t;let e=Ae[n];return e&&(t=e.weight)!=null?t:"400"}function qn(n,e){Ae[n]=e}function Gn(){return Object.keys(Ae)}import{Container as Jn,Graphics as Te,Text as le,Sprite as en,Texture as Fe}from"pixi.js";function Xn(n,e,t){var Je,Xe,Ve,Ke,Qe,Ze,je,Ue,et,tt,nt,st,at,ot,it,rt,lt,ct,dt,ut,pt,ft,ht,yt,mt,gt,_t,bt,xt,wt,St,At,Tt,Et,Lt,vt,Mt,$t,Ft,Nt,Ct,Ot,Pt,Bt,kt,Dt,It,Rt,Yt,zt,Wt,Ht,qt,Gt,Jt,Xt,Vt,Kt,Qt,Zt;let o=n.objects.get("ui_endgame_1"),a=n.objects.get("ui_endgame_logo_1"),s=n.objects.get("ui_endgame_title_1"),i=n.objects.get("ui_endgame_subtitle_1"),r=n.objects.get("ui_endgame_footer_1"),c=n.objects.get("ui_endgame_cta_1"),l=n.objects.get("ui_endgame_cta_hint_1"),u=n.objects.get("ui_endgame_hand_1"),f=n.engine.runtime||{},p=new Jn;p.alpha=0,p.visible=!1;let d=((Je=o==null?void 0:o.gameplay)==null?void 0:Je.tuning)||{},h=(o==null?void 0:o.render)||{},y=(Xe=d.panel_width)!=null?Xe:320,m=(Ve=d.panel_height)!=null?Ve:400,T=(Ke=d.panel_padding)!=null?Ke:32,b=(Qe=d.panel_radius)!=null?Qe:24,w=h.background_color||d.panel_bg_color||"#1a0a0a",A=h.background_alpha!==void 0&&h.background_alpha!==null?h.background_alpha:(Ze=d.panel_bg_alpha)!=null?Ze:.98,E=h.border_color||d.panel_border_color||"#ffffff",L=(je=d.panel_border_width)!=null?je:2,v=(Ue=d.panel_border_alpha)!=null?Ue:.3,S=new Te;S.roundRect(-y/2,-m/2,y,m,b);let g=w.replace("#","");S.fill({color:parseInt(g,16),alpha:A});let x=E.replace("#","");S.stroke({color:parseInt(x,16),width:L,alpha:v});let F=new Te;F.roundRect(-y/2+2,-m/2+2,y-4,m-4,b-2),F.stroke({color:16777215,width:1,alpha:.1}),S.addChild(F),p.addChild(S);let k=((et=a==null?void 0:a.gameplay)==null?void 0:et.tuning)||{},O=(a==null?void 0:a.transform)||{},$=(tt=k.logo_size)!=null?tt:56,N=(nt=O.scale)!=null?nt:1,P=(at=(st=O.offset)==null?void 0:st.y)!=null?at:-130,ee=(ot=k.logo_alpha)!=null?ot:1,M=new en(t||Fe.EMPTY);M.anchor.set(.5);let z=0,W=0;if(t&&t!==Fe.EMPTY){let B=t.frame,X=t.baseTexture;B&&B.width&&B.height?(z=B.width,W=B.height):X&&X.width&&X.height?(z=X.width,W=X.height):t.width&&t.height&&(z=t.width,W=t.height)}if(z>0&&W>0){let B=z/W,X,Me;B>1?(X=$,Me=$/B):(Me=$,X=$*B);let jt=X/z,Ut=Me/W;jt*=N,Ut*=N,M.scale.set(jt,Ut)}else{let B=$/100*N;M.scale.set(B)}M.position.set(0,P),M.alpha=0,M.visible=!0,M.targetAlpha=ee,M.baseScaleX=M.scale.x,M.baseScaleY=M.scale.y,p.addChild(M);let C=s==null?void 0:s.ui,D=((it=s==null?void 0:s.gameplay)==null?void 0:it.tuning)||{},Ee=(C==null?void 0:C.text)||"MISSION ACCOMPLISHED",ue=(C==null?void 0:C.font)||"brand.heading",on=(C==null?void 0:C.fontSize)||24,rn=(rt=C==null?void 0:C.letterSpacing)!=null?rt:1,pe=(lt=s==null?void 0:s.render)==null?void 0:lt.tint,ln=typeof pe=="string"?pe:pe?`#${pe.toString(16).padStart(6,"0")}`:"#00FF88",ke=y-T*2-30,cn=D.font_weight_override?D.font_weight_override:K(ue),j=new le({text:Ee,style:{fontFamily:V(ue),fontSize:on,fontWeight:cn,fill:ln,align:"center",letterSpacing:rn,wordWrap:!1,stroke:{color:D.stroke_color||"#000000",width:(ct=D.stroke_width)!=null?ct:2},dropShadow:{color:D.shadow_color||"#000000",alpha:(dt=D.shadow_alpha)!=null?dt:.9,angle:(ut=D.shadow_angle)!=null?ut:0,blur:(pt=D.shadow_blur)!=null?pt:8,distance:(ft=D.shadow_distance)!=null?ft:4}}});if(j.width>ke){let B=ke/j.width;j.scale.set(B)}j.anchor.set(.5);let De=(ht=d.title_offset_y)!=null?ht:30,dn=De+((yt=D.animation_start_y_offset)!=null?yt:-20);j.position.set(0,dn),j.alpha=0,p.addChild(j);let I=i==null?void 0:i.ui,Ie=((mt=i==null?void 0:i.gameplay)==null?void 0:mt.tuning)||{},un=(I==null?void 0:I.text)||"RESCUE COMPLETE",Re=(I==null?void 0:I.font)||"brand.body",pn=(I==null?void 0:I.fontSize)||11,fn=(gt=I==null?void 0:I.letterSpacing)!=null?gt:.5,fe=(_t=i==null?void 0:i.render)==null?void 0:_t.tint,hn=typeof fe=="string"?fe:fe?`#${fe.toString(16).padStart(6,"0")}`:"#B0B0B0",se=new le({text:un,style:{fontFamily:V(Re),fontSize:pn,fontWeight:K(Re),fill:hn,align:"center",letterSpacing:fn}});se.anchor.set(.5);let yn=De+20+((bt=Ie.animation_start_y_offset)!=null?bt:-10);se.position.set(0,yn),se.alpha=0,se.animationStartYOffset=(xt=Ie.animation_start_y_offset)!=null?xt:-10,p.addChild(se);let G=r==null?void 0:r.ui,Ye=((wt=r==null?void 0:r.gameplay)==null?void 0:wt.tuning)||{},mn=(G==null?void 0:G.text)||((St=f.ui)==null?void 0:St.cta_hint)||"Continue the adventure!",ze=(G==null?void 0:G.font)||"brand.body",gn=(G==null?void 0:G.fontSize)||16,he=(At=r==null?void 0:r.render)==null?void 0:At.tint,_n=typeof he=="string"?he:he?`#${he.toString(16).padStart(6,"0")}`:"#FFFFFF",bn=(Tt=Ye.max_width)!=null?Tt:y-T*2,xn=(Et=Ye.line_height)!=null?Et:1.4,ae=new le({text:mn,style:{fontFamily:V(ze),fontSize:gn,fontWeight:K(ze),fill:_n,align:"center",wordWrap:!0,wordWrapWidth:bn,lineHeight:xn}});ae.anchor.set(.5);let wn=(Lt=d.footer_offset_y)!=null?Lt:120;ae.position.set(0,wn);let Sn=((vt=r==null?void 0:r.render)==null?void 0:vt.alpha)!==void 0&&((Mt=r==null?void 0:r.render)==null?void 0:Mt.alpha)!==null?r.render.alpha:1;ae.alpha=0,ae.targetAlpha=Sn,p.addChild(ae);let J=(($t=c==null?void 0:c.gameplay)==null?void 0:$t.tuning)||{},R=c==null?void 0:c.ui,ye=(Ft=J.button_width)!=null?Ft:260,me=(Nt=J.button_height)!=null?Nt:56,We=(Ct=J.button_radius)!=null?Ct:16,An=J.button_bg_color||((Ot=f.theme)==null?void 0:Ot.cta_background)||"#ffb43b",Tn=(Pt=J.button_bg_alpha)!=null?Pt:1,En=J.button_border_color||"#ffffff",Ln=(Bt=J.button_border_width)!=null?Bt:2,vn=(kt=J.button_border_alpha)!=null?kt:.2,ge=(Dt=d.cta_offset_y)!=null?Dt:160,H=new Te;H.roundRect(-ye/2,-me/2,ye,me,We);let Mn=An.replace("#","");H.fill({color:parseInt(Mn,16),alpha:Tn});let $n=En.replace("#","");H.stroke({color:parseInt($n,16),width:Ln,alpha:vn});let Le=new Te;Le.roundRect(-ye/2+2,-me/2+2,ye-4,me-4,We-2),Le.stroke({color:0,width:1,alpha:.15}),H.addChild(Le),H.position.set(0,ge),H.alpha=0,H.eventMode="static",H.cursor="pointer",p.addChild(H);let Fn=(R==null?void 0:R.text)||((It=f.ui)==null?void 0:It.cta_label_end)||"DOWNLOAD",He=(R==null?void 0:R.font)||"brand.heading",Nn=(R==null?void 0:R.fontSize)||20,Cn=J.button_text_color||((Rt=f.theme)==null?void 0:Rt.cta_text)||"#1a0a0a",re=new le({text:Fn,style:{fontFamily:V(He),fontSize:Nn,fontWeight:K(He),fill:Cn,align:"center",letterSpacing:(Yt=R==null?void 0:R.letterSpacing)!=null?Yt:1}});re.anchor.set(.5),re.position.set(0,ge),re.alpha=0,p.addChild(re);let Y=l==null?void 0:l.ui,qe=((zt=l==null?void 0:l.gameplay)==null?void 0:zt.tuning)||{},On=(Y==null?void 0:Y.text)||"Play the full game",Ge=(Y==null?void 0:Y.font)||"brand.body",Pn=(Y==null?void 0:Y.fontSize)||11,Bn=(Wt=Y==null?void 0:Y.letterSpacing)!=null?Wt:0,_e=(Ht=l==null?void 0:l.render)==null?void 0:Ht.tint,kn=typeof _e=="string"?_e:_e?`#${_e.toString(16).padStart(6,"0")}`:"#CCCCCC",oe=new le({text:On,style:{fontFamily:V(Ge),fontSize:Pn,fontWeight:K(Ge),fill:kn,align:"center",letterSpacing:Bn}});oe.anchor.set(.5);let Dn=ge+35+((qt=qe.animation_start_y_offset)!=null?qt:5);oe.position.set(0,Dn),oe.alpha=0,oe.animationStartYOffset=(Gt=qe.animation_start_y_offset)!=null?Gt:5,p.addChild(oe);let ve=((Jt=u==null?void 0:u.gameplay)==null?void 0:Jt.tuning)||{},In=(Xt=ve.hand_offset_x)!=null?Xt:50,Rn=(Vt=ve.hand_offset_y)!=null?Vt:50,Yn=(Qt=(Kt=u==null?void 0:u.transform)==null?void 0:Kt.scale)!=null?Qt:.1875,zn=(Zt=ve.hand_scale_multiplier)!=null?Zt:2.5,te=new en(e||Fe.EMPTY);return te.anchor.set(.5),te.scale.set(Yn*zn),te.position.set(In,ge+Rn),te.alpha=0,te.visible=!1,p.addChild(te),{panel:p,logo:M,title:j,subtitle:se,footer:ae,ctaButton:H,ctaText:re,ctaHint:oe,hand:te}}function Vn(n,e,t){var L,v,S,g,x,F,k,O;let o=e.objects.get("ui_endgame_1"),a=((L=o==null?void 0:o.gameplay)==null?void 0:L.tuning)||{},s=(v=a.animation_duration_ms)!=null?v:800,i=(S=a.fade_in_duration_ms)!=null?S:600,r=(g=a.scale_animation_intensity)!=null?g:.1,c=(x=a.logo_animation_delay_ms)!=null?x:100,l=(F=a.title_animation_delay_ms)!=null?F:200,u=(k=a.footer_animation_delay_ms)!=null?k:300,f=(O=a.cta_animation_delay_ms)!=null?O:400,{panel:p,logo:d,title:h,subtitle:y,footer:m,ctaButton:T,ctaText:b,ctaHint:w}=n;p.visible=!0;let A=Date.now(),E=()=>{let $=Date.now()-A,N=Math.min($/i,1),P=1-Math.pow(1-N,3);p.alpha=P,p.scale.set(1+r*(1-P)),N<1?requestAnimationFrame(E):(setTimeout(()=>Kn(d,s,e),c),setTimeout(()=>{Qn(h,s),setTimeout(()=>Zn(y,s),50)},l),setTimeout(()=>jn(m,s),u),setTimeout(()=>{Un(T,b,s),setTimeout(()=>es(w,s),50),t&&t()},f))};E()}function Kn(n,e,t){var p,d,h,y,m;let o=t==null?void 0:t.objects.get("ui_endgame_logo_1"),s=(d=(((p=o==null?void 0:o.gameplay)==null?void 0:p.tuning)||{}).animation_start_scale)!=null?d:1.2,i=Date.now(),r=n.alpha,c=(h=n.targetAlpha)!=null?h:1,l=(y=n.baseScaleX)!=null?y:n.scale.x,u=(m=n.baseScaleY)!=null?m:n.scale.y,f=()=>{let T=Date.now()-i,b=Math.min(T/e,1),w=1-Math.pow(1-b,2);n.alpha=r+(c-r)*w;let A=s+(1-s)*w;n.scale.set(l*A,u*A),b<1&&requestAnimationFrame(f)};f()}function Qn(n,e){let t=Date.now(),o=n.alpha,a=n.y,s=()=>{let i=Date.now()-t,r=Math.min(i/e,1),c=1-Math.pow(1-r,2);n.alpha=o+(1-o)*c,n.y=a-20*(1-c),r<1&&requestAnimationFrame(s)};s()}function Zn(n,e){var r;let t=Date.now(),o=n.alpha,a=n.position.y,s=a-((r=n.animationStartYOffset)!=null?r:-10),i=()=>{let c=Date.now()-t,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);n.alpha=o+(1-o)*u,n.position.y=a+(s-a)*u,l<1&&requestAnimationFrame(i)};i()}function jn(n,e){var i;let t=Date.now(),o=n.alpha,a=(i=n.targetAlpha)!=null?i:1,s=()=>{let r=Date.now()-t,c=Math.min(r/e,1),l=1-Math.pow(1-c,2);n.alpha=o+(a-o)*l,c<1&&requestAnimationFrame(s)};s()}function Un(n,e,t){let o=Date.now(),a=n.alpha,s=()=>{let i=Date.now()-o,r=Math.min(i/t,1),c=1-Math.pow(1-r,2);n.alpha=a+(1-a)*c,e.alpha=a+(1-a)*c,n.scale.set(1+.1*(1-c)),r<1&&requestAnimationFrame(s)};s()}function es(n,e){var r;let t=Date.now(),o=n.alpha,a=n.position.y,s=a-((r=n.animationStartYOffset)!=null?r:5),i=()=>{let c=Date.now()-t,l=Math.min(c/e,1),u=1-Math.pow(1-l,2);n.alpha=o+(1-o)*u,n.position.y=a+(s-a)*u,l<1&&requestAnimationFrame(i)};i()}function ts(n,e,t,o){var u,f,p,d;let a=t.objects.get("ui_endgame_hand_1"),s=((u=a==null?void 0:a.gameplay)==null?void 0:u.tuning)||{},i=(f=s.click_animation_duration_ms)!=null?f:600,r=(p=s.click_delay_ms)!=null?p:2e3,c=(d=s.click_repeat_delay_ms)!=null?d:3e3,l=()=>{var L,v;n.visible=!0,n.alpha=1;let h=n.x,y=n.y,m=(L=s.hand_offset_x)!=null?L:50,T=(v=s.hand_offset_y)!=null?v:50,b=e.x+m,w=e.y+T,A=Date.now(),E=()=>{var $,N,P;let S=Date.now()-A,g=Math.min(S/i,1),x=g<.5?2*g*g:1-Math.pow(-2*g+2,2)/2;n.x=h+(b-h)*x,n.y=y+(w-y)*x;let F=(N=($=a==null?void 0:a.transform)==null?void 0:$.scale)!=null?N:.1875,k=(P=s.hand_scale_multiplier)!=null?P:2.5,O=F*k;n.scale.set(O+O*.2*Math.sin(g*Math.PI)),g<1?requestAnimationFrame(E):(e.scale.set(.95),setTimeout(()=>{e.scale.set(1),o()},100),setTimeout(()=>{n.alpha=0,setTimeout(()=>{n.x=h,n.y=y,l()},c)},500))};E()};setTimeout(l,r)}import{Sprite as ns,Text as ss}from"pixi.js";function as(n,e,t){var f,p,d,h;let o=e.objects.get("hand_tutorial_1")||e.objects.get("hand_1")||Array.from(e.objects.values()).find(y=>{var m;return((m=y==null?void 0:y.identity)==null?void 0:m.id)==="hand.tutorial"}),a=((f=o==null?void 0:o.gameplay)==null?void 0:f.tuning)||{},s=(o==null?void 0:o.render)||{},i=(o==null?void 0:o.transform)||{},r=new ns(n),c=s==null?void 0:s.anchor;c&&typeof c.x=="number"&&typeof c.y=="number"?r.anchor.set(c.x,c.y):r.anchor.set(.5),r.alpha=0;let l=(p=a.hand_scale_multiplier)!=null?p:2.5,u=(d=i.scale)!=null?d:.1875;return r.scale.set(u*l),r.zIndex=(h=s.z_index)!=null?h:99999,r}function os(n){var y,m,T,b,w,A,E,L,v,S;let e=n.objects.get("ui_tutorial_1")||n.objects.get("label_1")||Array.from(n.objects.values()).find(g=>{var x;return["ui.tutorial","label.warning"].includes((x=g==null?void 0:g.identity)==null?void 0:x.id)}),t=e==null?void 0:e.ui,o=(e==null?void 0:e.render)||{},a=((y=n.engine.runtime)==null?void 0:y.ui_styles)||{},s=((m=n.engine.runtime)==null?void 0:m.ui)||{},i=(t==null?void 0:t.text)||s.tutorial_label||s.label_text||"CLEAN!",r=(t==null?void 0:t.font)||"brand.warning",c=(t==null?void 0:t.fontSize)||a.label_font_size||52,l=(b=t==null?void 0:t.letterSpacing)!=null?b:(T=a.label_letter_spacing)!=null?T:-1,u=(t==null?void 0:t.align)||"center",f=o.tint,p=typeof f=="string"?f:f?`#${f.toString(16).padStart(6,"0")}`:a.label_fill||"#FFF1C1",d=new ss({text:i,style:{fontFamily:V(r),fontSize:c,fontWeight:K(r),fill:p,align:u,letterSpacing:l,stroke:{color:a.label_stroke||"#8B0000",width:2},dropShadow:{color:a.label_shadow_color||"#000000",alpha:(w=a.label_shadow_alpha)!=null?w:.8,angle:(A=a.label_shadow_angle)!=null?A:0,blur:(E=a.label_shadow_blur)!=null?E:4,distance:(L=a.label_shadow_distance)!=null?L:2}}}),h=o==null?void 0:o.anchor;return h&&typeof h.x=="number"&&typeof h.y=="number"?d.anchor.set(h.x,h.y):d.anchor.set(.5,.5),d.alpha=(v=o.alpha)!=null?v:0,d.visible=(S=o.visible)!=null?S:!0,d}function is(n,e,t,o,a){var c,l,u,f,p,d,h,y,m,T,b,w,A,E,L,v,S;let s=a.objects.get("hand_tutorial_1")||a.objects.get("hand_1")||Array.from(a.objects.values()).find(g=>{var x;return((x=g==null?void 0:g.identity)==null?void 0:x.id)==="hand.tutorial"}),i=((c=s==null?void 0:s.gameplay)==null?void 0:c.tuning)||{},r=(s==null?void 0:s.transform)||{};if(!o){let g=(l=i.animation_duration)!=null?l:1.5,x=t%g/g,F=x<.5?2*x*x:-1+(4-2*x)*x,k=(h=(d=(p=(u=r.position)==null?void 0:u.x)!=null?p:(f=r.offset)==null?void 0:f.x)!=null?d:i.start_x_offset)!=null?h:0,O=(w=(b=(T=(y=r.position)==null?void 0:y.y)!=null?T:(m=r.offset)==null?void 0:m.y)!=null?b:i.start_y_offset)!=null?w:0,$=(A=i.x_offset)!=null?A:0,N=(E=i.y_offset)!=null?E:0,P=(L=i.animation_range)!=null?L:40,ee=P*.7,M=P,z=e.x+k+$+ee,W=e.y+O+N+M,C=z+ee,D=W+M;n.x=z+(C-z)*F,n.y=W+(D-W)*F;let Ee=(v=r.scale)!=null?v:.1875,ue=(S=i.hand_scale_multiplier)!=null?S:2.5;n.scale.set(Ee*ue)}}var ce=null;function rs(){return ce||(typeof window!="undefined"&&window.lottie?ce=window.lottie:(console.warn("[LottieOverlay] lottie-web is not available globally. Make sure it is loaded before using Lottie animations."),ce=null)),ce}function ls(n){ce=n}function cs(n,e,t,o){var E,L,v,S,g,x,F,k,O,$,N,P,ee;let a=t.objects.get(n);if(!a)return console.warn(`[LottieOverlay] Object config not found: ${n}`),null;let s=((E=a.effects)==null?void 0:E.lottie)||{},i=a.transform||{},r=a.render||{};if(s.enabled===!1||r.visible===!1)return null;let c=o[n];if(!c||typeof c!="object")return console.warn(`[LottieOverlay] Asset data not found or invalid for: ${n}`),null;let l=rs();if(!l)return console.warn(`[LottieOverlay] lottie-web is not available. Cannot play animation: ${n}`),null;let u=(L=s.width)!=null?L:300,f=(v=s.height)!=null?v:300,p=(S=i.scale)!=null?S:1,d=(x=(g=i.position)==null?void 0:g.x)!=null?x:0,h=(k=(F=i.position)==null?void 0:F.y)!=null?k:0,y=(O=i.rotation)!=null?O:0,m=($=r.z_index)!=null?$:100,T=(N=r.alpha)!=null?N:1,b=document.createElement("div");b.style.cssText=`
|
|
2
|
-
position: absolute;
|
|
3
|
-
top: calc(50% + ${h}px);
|
|
4
|
-
left: calc(50% + ${d}px);
|
|
5
|
-
transform: translate(-50%, -50%) scale(${p}) rotate(${y}deg);
|
|
6
|
-
width: ${u}px;
|
|
7
|
-
height: ${f}px;
|
|
8
|
-
pointer-events: none;
|
|
9
|
-
z-index: ${m};
|
|
10
|
-
opacity: ${T};
|
|
11
|
-
`,e.appendChild(b);let w=l.loadAnimation({container:b,renderer:s.renderer||"svg",loop:(P=s.loop)!=null?P:!1,autoplay:(ee=s.autoplay)!=null?ee:!0,animationData:c});s.speed!==void 0&&w.setSpeed(s.speed);let A=()=>{w.destroy(),b.parentNode&&b.parentNode.removeChild(b)};return s.loop||w.addEventListener("complete",A),{animation:w,cleanup:A}}import{Assets as ie,Texture as ds}from"pixi.js";var Q=class{static get(e){var t;return(t=this.store.get(e))==null?void 0:t.data}static set(e,t){this.store.set(e,{data:t})}static has(e){return this.store.has(e)}static clear(){this.store.clear()}};Q.store=new Map;function us(){var n,e;try{let t=typeof window!="undefined"&&(document.querySelector('script[src*="inline-assets.js"]')||((e=(n=document.querySelector("script"))==null?void 0:n.textContent)==null?void 0:e.includes("inline-assets.js"))||window.INLINE_ASSETS),o=typeof window!="undefined"&&document.querySelector('link[href*="assets/"], script[src*="assets/"]');return!!(t&&!o)}catch{return!1}}async function ps(){try{if(typeof window!="undefined"){let n=await fetch("./build-settings.json");if(n.ok){let e=await n.json();return console.log("[AssetLoader] Loaded build settings:",e),e}}}catch{}return null}function fs(){try{if(typeof window!="undefined"){let n=new XMLHttpRequest;if(n.open("GET","./build-settings.json",!1),n.send(),n.status===200&&n.responseText){let e=JSON.parse(n.responseText);return console.log("[AssetLoader] Loaded build settings (sync):",e),e}}}catch{}return null}var tn=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",nn=us(),ne=typeof window!="undefined"?window.__BUILD_SETTINGS__:null,_=nn?"publish":tn,q=ne==null?void 0:ne.assetsInlined;ne!=null&&ne.buildMode&&(_=ne.buildMode,console.log(`[AssetLoader] Build mode overridden by inline settings: ${_}`));var U=fs();U!=null&&U.buildMode&&(_=U.buildMode,console.log(`[AssetLoader] Build mode overridden by sync settings: ${_}`));(U==null?void 0:U.assetsInlined)!==void 0&&(q=U.assetsInlined);ps().then(n=>{n!=null&&n.buildMode&&n.buildMode!==_&&(_=n.buildMode,console.log(`[AssetLoader] Build mode overridden by settings: ${_}`)),(n==null?void 0:n.assetsInlined)!==void 0&&(q=n.assetsInlined)}).catch(()=>{});console.log(`[AssetLoader] MODULE LOADED - Compile: ${tn}, Runtime: ${nn?"publish":"dev"}, Effective: ${_}`);var Z={},Ne=null;async function hs(){if(console.log(`[AssetLoader] getInlineAssets() called - Effective mode: ${_}`),Object.keys(Z).length>0)return console.log("[AssetLoader] Returning cached inline assets:",Object.keys(Z)),Z;if(typeof window!="undefined"&&window.INLINE_ASSETS)return console.log("[AssetLoader] Using pre-loaded INLINE_ASSETS from window:",Object.keys(window.INLINE_ASSETS)),Z={...window.INLINE_ASSETS},Z;if(!(_==="publish"&&q!==!1))return console.log("[AssetLoader] Inline assets disabled for this build mode."),Z;if(!Ne){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),Ne=(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 t=await fetch(e);if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);let o=await t.text();console.log("[AssetLoader] Received JS code, length:",o.length);let a=o.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 i=new Function("return "+s)();return console.log("[AssetLoader] Parsed inline assets:",Object.keys(i)),i}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:",o.substring(0,500)),{}}catch(t){return console.warn("[AssetLoader] Failed to load inline assets:",t),{}}})()}return Z=await Ne,console.log("[AssetLoader] Final inline assets cache:",Object.keys(Z)),Z}var sn=new Map;function Ce(n){return n===null||typeof n!="object"||(Object.freeze(n),Object.values(n).forEach(e=>Ce(e))),n}function ys(n=64,e=64,t=16711680){let o=document.createElement("canvas");o.width=n,o.height=e;let a=o.getContext("2d");return a.fillStyle=`#${t.toString(16).padStart(6,"0")}`,a.fillRect(0,0,n,e),a.strokeStyle="#000",a.strokeRect(0,0,n,e),a.fillStyle="#fff",a.font="10px sans-serif",a.textAlign="center",a.fillText("MISSING",n/2,e/2),ds.from(o)}function Oe(n,e){sn.set(n,e)}var de=class{static async load(e,t,o){let a=Q.get(e);if(a!==void 0)return a;console.log(`[AssetLoader] Loading asset: ${e}, type: ${t.type}, Effective mode: ${_}`),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 s=await hs(),i=s[e];if(!i&&t.path){let l=t.path.split("/");if(l.length>=2){let u=l[l.length-1].split(".")[0],f=l[0],p=[`${u}.layer`,`${u}.player`,`${u}.tutorial`,`effects.${u}`,`ui.endgame.${u}`,u];for(let d of p)if(s[d]){i=s[d],console.log(`[AssetLoader] Found inline data for ${e} using derived key: ${d}`);break}}}if(console.log("[AssetLoader] Inline data for",e,":",i?"FOUND":"NOT FOUND"),_==="publish"&&q!==!1&&(console.log("[AssetLoader] \u26A0\uFE0F PUBLISH MODE DETECTED - inline assets are MANDATORY"),!i))throw new Error(`[AssetLoader] PUBLISH MODE: Inline asset required but NOT FOUND for object: ${e}, path: ${t.path}`);let c=sn.get(t.type);if(c)try{let l=await c(t.path,i,e,o);return Q.set(e,l),l}catch(l){return this.handleFailure(e,t.type,l)}try{let l;switch(t.type){case"image":l=await this.loadImage(t.path,i);break;case"json":l=await this.loadJSON(t.path,i),l=Ce(l);break;default:throw new Error(`Unknown asset type: ${t.type}`)}return Q.set(e,l),l}catch(l){return this.handleFailure(e,t.type,l)}}static async loadImage(e,t){let o=_==="publish",a=o&&q!==!1;if(console.log(`[AssetLoader] loadImage - Effective mode: ${_}, isPublishMode: ${o}, inlineData: ${t?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for object. Path: ${e}`);if(!t.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${t.substring(0,50)}...`);try{return await ie.load(t)}catch(s){throw console.error("[AssetLoader] Failed to load texture from data URI:",s),s}}if(t&&t.startsWith("data:"))try{return await ie.load(t)}catch(s){return console.error("[AssetLoader] Failed to load texture from data URI, falling back to path:",s),await ie.load(e)}return await ie.load(e)}static async loadJSON(e,t){let o=_==="publish",a=o&&q!==!1;if(console.log(`[AssetLoader] loadJSON - Effective mode: ${_}, isPublishMode: ${o}, inlineData: ${t?"EXISTS":"MISSING"}`),a){if(console.log("[AssetLoader] PUBLISH MODE ACTIVATED - inline assets are MANDATORY"),!t)throw new Error(`[AssetLoader] Publish mode: inline asset required but not found for path: ${e}`);if(t.startsWith("data:")){let i=atob(t.split(",")[1]);return JSON.parse(i)}return JSON.parse(t)}if(t){if(t.startsWith("data:")){let i=atob(t.split(",")[1]);return JSON.parse(i)}return JSON.parse(t)}let s=await fetch(e);if(!s.ok)throw new Error(`JSON fetch failed: ${e}`);return s.json()}static handleFailure(e,t,o){if(_==="dev"){let s=t==="image"?ys():Ce({__placeholder:!0,type:t});return Q.set(e,s),s}throw o}};Oe("image",async(n,e)=>{let t=_==="publish",o=t&&q!==!1,a=_==="brand",s=t&&q===!1;if(console.log(`[AssetLoader] registerType('image') - Effective mode: ${_}, isPublishMode: ${t}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),o){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: ${n}`);if(!e.startsWith("data:"))throw new Error(`[AssetLoader] Publish mode: inline asset must be data URI, got: ${e.substring(0,50)}...`);return ie.load(e)}let i=n;return(a||s)&&n&&!n.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(i=n,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${n}" as-is`)):(i=`assets/${n}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${n}" -> "${i}"`))),ie.load(e||i)});Oe("json",async(n,e)=>{let t=_==="publish",o=t&&q!==!1,a=_==="brand",s=t&&q===!1;if(console.log(`[AssetLoader] registerType('json') - Effective mode: ${_}, isPublishMode: ${t}, isBrandMode: ${a}, inlineData: ${e?"EXISTS":"MISSING"}`),o){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: ${n}`);return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e)}let i=n;if((a||s)&&n&&!n.startsWith("assets/")&&(typeof window!="undefined"&&!document.querySelector('link[href*="assets/"], script[src*="assets/"]')&&!document.querySelector('link[href*="configs/"], script[src*="configs/"]')?(i=n,console.log(`[AssetLoader] BRAND MODE: flattened build, using path "${n}" as-is`)):(i=`assets/${n}`,console.log(`[AssetLoader] BRAND MODE: transformed path "${n}" -> "${i}"`))),e)return e.startsWith("data:")?JSON.parse(atob(e.split(",")[1])):JSON.parse(e);let r=await fetch(i);if(!r.ok)throw new Error(`JSON fetch failed: ${n}`);return r.json()});import{Sprite as ms,Container as an}from"pixi.js";var gs=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",Pe=gs;if(typeof window!="undefined")try{let n=new XMLHttpRequest;if(n.open("GET","./build-settings.json",!1),n.send(),n.status===200&&n.responseText){let e=JSON.parse(n.responseText);e!=null&&e.buildMode&&(Pe=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${Pe}`))}}catch{}var Be=class{static async create(e,t,o){var r,c,l,u,f,p;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${Pe}`);let a=(r=t==null?void 0:t.render)==null?void 0:r.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let d=new an;return this.applyTransform(d,t==null?void 0:t.transform),d}console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, type: ${a.type}, path: ${a.path}`);let s=await de.load(e,a,o);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(c=s==null?void 0:s.constructor)==null?void 0:c.name}`);let i;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",s,"for object:",e),i=new ms(s),console.log("[ObjectFactory] Created object:",i,"type:",(l=i==null?void 0:i.constructor)==null?void 0:l.name),this.applyTransform(i,t==null?void 0:t.transform);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(u=s==null?void 0:s.constructor)==null?void 0:u.name,s),s&&(((f=s.constructor)==null?void 0:f.name)==="Container"||s instanceof an)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let d=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],h=!1;for(let y of d)try{let m=await fetch(y);if(m.ok){i=await m.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",y,"type:",(p=i==null?void 0:i.constructor)==null?void 0:p.name),h=!0;break}}catch{continue}h||(console.error("[ObjectFactory] Failed to reload JSON from any path"),i=s)}else i=s;else i=s,i&&typeof i=="object"&&("x"in i||"position"in i)&&this.applyTransform(i,t==null?void 0:t.transform);return i}static applyTransform(e,t){var o,a,s,i;!t||!e||(t.position&&("x"in e&&"y"in e?(e.x=(o=t.position.x)!=null?o:0,e.y=(a=t.position.y)!=null?a:0):"position"in e&&e.position&&e.position.set((s=t.position.x)!=null?s:0,(i=t.position.y)!=null?i:0)),t.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(t.scale):e.scale=t.scale),t.rotation!==void 0&&"rotation"in e&&(e.rotation=t.rotation),t.anchor&&"anchor"in e&&e.anchor&&Array.isArray(t.anchor)&&("set"in e.anchor?e.anchor.set(t.anchor[0],t.anchor[1]):(e.anchor.x=t.anchor[0],e.anchor.y=t.anchor[1])))}};export{Q as AssetCache,de as AssetLoader,Se as GameObject,$e as GameObjectManager,Be as ObjectFactory,we as Renderer,xe as Transform,ts as animateHandClick,Vn as animatePanelEntrance,Xn as createEndGamePanel,as as createHandTutorial,Hn as createPixiBase,os as createTutorialLabel,Gn as getRegisteredFontIds,cs as playLottieOverlay,qn as registerFont,Oe as registerType,V as resolveFont,K as resolveFontWeight,ls as setLottieInstance,is as updateHandAnimation};
|
|
1
|
+
import{A as z,B as A,C as B,D as C,E as D,F as E,G as F,H as G,I as H,J as I,K as J,L as K,M as L,b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s,u as t,v as u,w as v,x as w,y as x,z as y}from"../chunk-GYW3GFXA.mjs";import"../chunk-BDZGKN5O.mjs";import"../chunk-HN7I4BLB.mjs";export{s as AssetCache,u as AssetLoader,C as AssetSystem,A as Assets,x as BaseSystem,w as GameEngine,d as GameObject,e as GameObjectManager,v as ObjectFactory,c as Renderer,y as RuntimeObjectRegistry,m as SplashScreen,b as Transform,l as animateHandClick,k as animatePanelEntrance,J as applyScreenAnchor,z as basePixi,E as clearResponsiveElements,j as createEndGamePanel,n as createHandTutorial,a as createPixiBase,o as createTutorialLabel,i as getRegisteredFontIds,D as globalResponsiveMultipliers,B as initAssets,K as layout,r as playLottieOverlay,h as registerFont,t as registerType,G as resolveAnchorVec2,f as resolveFont,g as resolveFontWeight,H as resolveScreenAnchorPoint,I as resolveScreenRatioPoint,L as runInitSequence,q as setLottieInstance,p as updateHandAnimation,F as updateScreenState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--ui-bg: #0f1218;--ui-bg-2: #101520;--ui-surface: #171c25;--ui-surface-2: #1f2530;--ui-border: #2b3544;--ui-text: #e8edf3;--ui-muted: #9aa7b4;--ui-accent: #3dd6c6;--ui-accent-2: #ff9f43;--ui-accent-3: #6f8cff;--ui-danger: #ff5c70;--ui-shadow: 0 18px 40px rgba(5, 10, 18, .45)}.preview-shell{height:100vh;width:100vw;background:radial-gradient(circle at top left,#182033 0%,var(--ui-bg) 45%,#0c1018 100%);color:var(--ui-text);font-family:Avenir Next,Avenir,Futura,Gill Sans,Trebuchet MS,sans-serif;display:flex;flex-direction:column;box-sizing:border-box}.preview-stage{height:100%;display:flex;flex-direction:column}.preview-toolbar{height:54px;background:linear-gradient(135deg,var(--ui-bg-2),#121926 50%,#141b28 100%);border-bottom:1px solid var(--ui-border);display:flex;align-items:center;justify-content:flex-start;padding:0 12px;z-index:10;gap:10px;width:100%;box-sizing:border-box;overflow:hidden;flex-shrink:0}.zoom-controls{display:flex;align-items:center;gap:2px;margin-left:auto;flex-shrink:0}.device-dropdown{flex-shrink:1;min-width:0;max-width:100%}.preview-btn{flex-shrink:0;white-space:nowrap}@media(max-width:768px){.preview-toolbar{padding:0 4px;height:50px;gap:4px}.device-dropdown{font-size:11px;padding:2px 4px;min-width:100px}.preview-btn{padding:3px 6px;font-size:11px}.zoom-label{font-size:11px;min-width:30px}@media(max-width:480px){#refresh-btn,#debug-toggle,#console-toggle{display:none}}}.device-frame{box-shadow:0 0 0 1px #ffffff14,0 18px 40px #0000008c;border-radius:14px;background-color:#000;transition:width .3s ease,height .3s ease;overflow:hidden;position:relative}.console-panel{position:absolute;bottom:0;left:0;right:0;height:200px;background:#10141cf5;border-top:1px solid var(--ui-border);display:flex;flex-direction:column;transition:opacity .3s ease,visibility .3s ease;z-index:100}.console-panel.closed{opacity:0;visibility:hidden;pointer-events:none}.console-msg{font-family:Consolas,Monaco,monospace;font-size:12px;padding:4px 8px;border-bottom:1px solid #333}.console-msg.type-warn{color:#feca57}.preview-toolbar-left{display:flex;align-items:center}.preview-logo{font-weight:700;font-size:13px;color:var(--ui-text);letter-spacing:1.2px;text-transform:uppercase}.preview-toolbar-center,.preview-toolbar-right{display:flex;align-items:center;gap:8px}.view-toggle{display:flex;align-items:center;gap:6px;padding:2px;background:#121826;border:1px solid var(--ui-border);border-radius:999px}.view-toggle-btn{border:none;background:transparent;color:var(--ui-muted);font-size:11px;padding:6px 12px;border-radius:999px;cursor:pointer;transition:all .2s ease}.view-toggle-btn.active{color:var(--ui-text);background:#263146;box-shadow:inset 0 0 0 1px #6f8cff66}.device-selector-wrapper{position:relative}.device-dropdown{background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;padding:6px 10px;font-size:12px;min-width:150px;max-width:100%;cursor:pointer;overflow:hidden;text-overflow:ellipsis}.device-dropdown:focus{outline:none;border-color:var(--ui-accent-3)}.preview-btn{background-color:#202836;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:8px;padding:6px 10px;font-size:12px;cursor:pointer;transition:all .2s ease;display:flex;align-items:center;gap:6px}.preview-btn:hover{background-color:#2a3446;border-color:#3b475c}.preview-btn:active{background-color:#343f55}.preview-btn:disabled,.device-dropdown:disabled{opacity:.5;cursor:not-allowed}.icon-btn{padding:6px;width:30px;height:30px;justify-content:center}@media(max-width:768px){.icon-btn{padding:3px;width:24px;height:24px}.icon-btn svg{width:12px;height:12px}}.icon-btn svg{width:16px;height:16px}.toolbar-divider{width:1px;height:20px;background-color:#555;margin:0 4px}.zoom-label{font-size:12px;color:var(--ui-muted);min-width:35px;text-align:center}.console-toggle{position:relative}.console-badge{background-color:#ff6b6b;color:#fff;font-size:10px;padding:2px 4px;border-radius:8px;margin-left:4px;display:none}.console-badge.has-errors{display:inline-block}.preview-main{flex:1;position:relative;overflow:hidden;background:radial-gradient(circle at 30% 20%,rgba(61,214,198,.1),transparent 45%),radial-gradient(circle at 70% 80%,rgba(111,140,255,.14),transparent 50%),#0e1118}.preview-container{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}.frame-wrapper{display:flex;justify-content:center;align-items:center;transform-origin:center center;transition:transform .2s cubic-bezier(.25,.46,.45,.94);filter:drop-shadow(0 12px 24px rgba(0,0,0,.45))}.game-container{width:100%;height:100%;position:relative}.console-header{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid var(--ui-border);background-color:#141a24}.console-title{font-weight:600;font-size:14px;color:var(--ui-text)}.console-actions{display:flex;gap:8px}.console-action-btn{background-color:transparent;color:var(--ui-muted);border:1px solid var(--ui-border);border-radius:3px;padding:4px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.console-action-btn:hover{background-color:#243041;color:var(--ui-text)}.console-messages{flex:1;overflow-y:auto;padding:4px 0}.console-msg{font-family:Consolas,Monaco,monospace;font-size:12px;padding:4px 12px;border-bottom:1px solid #333;word-wrap:break-word}.console-msg .time{color:#888;margin-right:8px;font-size:11px}.console-msg.type-log{color:#fff}.console-msg.type-info{color:#74c0fc}.console-msg.type-error{color:#ff6b6b;background:#ff00001a}.console-msg.type-warn{color:#feca57;background:#ffc1071a}.debug-overlay{position:absolute;inset:0;z-index:200;pointer-events:none}.debug-overlay.hidden{display:none}.scene-panel{position:absolute;width:320px;max-height:78vh;background:#12161ef5;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);pointer-events:auto;overflow:hidden;box-sizing:border-box}.scene-panel.scene-objects{width:300px}.scene-panel.scene-tools{max-height:46vh}.scene-panel.scene-tools .scene-panel-body{max-height:calc(46vh - 44px)}.customize-panel{width:320px}.customize-list{display:flex;flex-direction:column;gap:8px}.customize-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.customize-row{display:flex;align-items:center;gap:8px;background:#141a24b3;border:1px solid rgba(255,255,255,.05);border-radius:8px;padding:6px 8px}.customize-key{flex:0 0 120px;font-size:11px;color:var(--ui-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.customize-input{flex:1;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:4px 6px;font-size:11px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.customize-actions{display:flex;align-items:center;gap:6px}.customize-icon-btn{width:28px;height:28px;border-radius:8px;border:1px solid rgba(111,140,255,.4);background:#19202ccc;color:var(--ui-text);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.customize-icon-btn svg{width:14px;height:14px;fill:currentColor}.customize-icon-btn.ai{font-size:10px;font-weight:700;letter-spacing:.05em;padding:4px 6px}.customize-file{display:none}.customize-color-field{display:flex;flex-direction:column;gap:6px;padding:8px;border-radius:8px;background:#141a24b3;border:1px solid rgba(255,255,255,.05);font-size:11px;color:var(--ui-muted)}.customize-color-field input[type=color]{width:100%;height:28px;padding:0;border:none;background:transparent}.customize-color-text{background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:4px 6px;font-size:11px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.customize-help{margin-top:6px;font-size:10px;color:var(--ui-muted)}.customize-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.batch-ai-label{font-size:11px;color:var(--ui-muted)}.batch-ai-input,.batch-ai-textarea,.batch-ai-select{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.batch-ai-textarea{min-height:70px;resize:vertical}.batch-ai-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.batch-ai-actions{margin-top:6px}.batch-ai-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.batch-ai-btn.primary{border-color:#bf7eff99;background:#bf7eff33}.batch-ai-file{display:none}.batch-ai-file-name,.batch-ai-status{font-size:11px;color:var(--ui-muted)}.batch-ai-dna{margin-top:8px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.batch-ai-palette{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.batch-ai-swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.2)}.batch-ai-muted{font-size:11px;color:var(--ui-muted)}.batch-ai-asset-list{margin-top:10px;display:flex;flex-direction:column;gap:10px}.batch-ai-item{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;padding:8px;display:flex;flex-direction:column;gap:8px}.batch-ai-item-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.batch-ai-toggle{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--ui-text)}.batch-ai-item-body{display:flex;flex-direction:column;gap:8px}.batch-ai-thumb{width:100%;max-height:140px;object-fit:contain;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#080a0e99}.batch-ai-thumb.hidden{display:none}.batch-ai-item-status{font-size:11px;color:var(--ui-muted)}.batch-ai-item-actions{display:flex;gap:8px;flex-wrap:wrap}.batch-ai-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.brand-dna-label{font-size:11px;color:var(--ui-muted)}.brand-dna-input,.brand-dna-textarea,.brand-dna-select{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.brand-dna-textarea{min-height:70px;resize:vertical}.brand-dna-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.brand-dna-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.brand-dna-btn.primary{border-color:#6f8cff99;background:#6f8cff33}.brand-dna-file{display:none}.brand-dna-file-name,.brand-dna-status{font-size:11px;color:var(--ui-muted)}.brand-dna-meta{margin-top:8px}.brand-dna-prompt{margin:6px 0 0;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;color:var(--ui-text);font-size:11px;white-space:pre-wrap}.brand-dna-output{margin-top:8px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.brand-dna-palette{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.brand-dna-swatch{width:22px;height:22px;border-radius:6px;border:1px solid rgba(255,255,255,.2)}.brand-dna-muted{font-size:11px;color:var(--ui-muted)}.brand-dna-object-list{margin-top:10px;display:flex;flex-direction:column;gap:10px}.brand-dna-object{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016b3;padding:8px;display:flex;flex-direction:column;gap:8px}.brand-dna-object-header{display:flex;align-items:center;justify-content:space-between;gap:8px}.brand-dna-object-title{font-size:11px;color:var(--ui-text);word-break:break-all}.brand-dna-object-status{font-size:11px;color:var(--ui-muted)}.brand-dna-empty{font-size:11px;color:var(--ui-muted);padding:6px 0}.ai-panel{display:flex;flex-direction:column;gap:10px;padding:8px;border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#10141c99}.ai-modal{position:fixed;inset:0;background:#060a10d1;display:flex;align-items:center;justify-content:center;z-index:10080}.ai-modal-card{width:min(760px,92vw);max-height:90vh;overflow:auto;background:#10141cfa;border:1px solid var(--ui-border);border-radius:16px;box-shadow:0 20px 50px #00000073}.ai-modal-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.06)}.ai-modal-actions{display:inline-flex;align-items:center;gap:8px}.ai-modal-title{font-size:14px;font-weight:700;color:var(--ui-text)}.ai-modal-subtitle{font-size:11px;color:var(--ui-muted);margin-top:3px}.ai-modal-close,.ai-modal-gallery{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 12px;font-size:11px;cursor:pointer}.ai-loading{display:none;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;background:linear-gradient(120deg,#58a3ff1a,#ff639424);border:1px solid rgba(88,163,255,.25)}.ai-loading.active{display:flex}.ai-loading-ring{width:26px;height:26px;border-radius:50%;border:3px solid rgba(255,255,255,.15);border-top-color:#58a3ffe6;animation:ai-spin .9s linear infinite}.ai-loading-bar{flex:1;height:8px;border-radius:999px;background:linear-gradient(90deg,#58a3ff33,#ff6394b3,#58a3ff33);background-size:200% 100%;animation:ai-bar 1.4s ease infinite}.ai-loading-text{font-size:11px;color:var(--ui-text)}@keyframes ai-spin{to{transform:rotate(360deg)}}@keyframes ai-bar{0%{background-position:0% 50%}to{background-position:100% 50%}}.ai-label{font-size:11px;color:var(--ui-muted)}.ai-input,.ai-select,.ai-textarea{width:100%;padding:6px 8px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:#0a0e14d9;color:var(--ui-text);font-size:12px}.ai-textarea{min-height:70px;resize:vertical}.ai-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.ai-strength{gap:10px}.ai-strength input[type=range]{flex:1;min-width:160px}.ai-strength-value{font-size:11px;color:var(--ui-text);min-width:20px;text-align:right}.ai-gallery{border-radius:10px;border:1px solid rgba(255,255,255,.06);background:#0c1016a6;padding:8px}.ai-gallery.hidden{display:none}.ai-gallery-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}.ai-gallery-item{border:1px solid rgba(255,255,255,.08);background:#080a0eb3;border-radius:10px;padding:6px;display:flex;flex-direction:column;gap:6px;cursor:pointer;text-align:left}.ai-gallery-item.active{border-color:#6f8cff99;box-shadow:0 0 0 1px #6f8cff40}.ai-gallery-thumb{width:100%;height:70px;object-fit:contain;border-radius:6px;background:#06080cb3;border:1px solid rgba(255,255,255,.08)}.ai-gallery-label{font-size:10px;color:var(--ui-text);word-break:break-all}.ai-gallery-empty{font-size:11px;color:var(--ui-muted)}.ai-btn{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.ai-file{display:none}.ai-file-name{font-size:11px;color:var(--ui-muted)}.ai-toggles label{font-size:11px;color:var(--ui-text);display:inline-flex;align-items:center;gap:6px}.ai-actions .debug-btn{flex:1}.ai-status{font-size:11px;color:var(--ui-muted)}.ai-preview{width:100%;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:#080a0e99;padding:8px;display:flex;justify-content:center;align-items:center;min-height:140px}.ai-preview img{max-width:100%;max-height:220px;object-fit:contain}.asset-preview-modal{position:fixed;inset:0;background:#080a0eb8;display:flex;align-items:center;justify-content:center;z-index:10050}.asset-preview-card{width:min(720px,92vw);max-height:82vh;background:#10141cfa;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);display:flex;flex-direction:column}.asset-preview-header{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.asset-preview-title{font-size:12px;font-weight:600;word-break:break-all}.asset-preview-close{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-preview-meta{padding:0 14px 10px;color:var(--ui-muted);font-size:11px;word-break:break-all;border-bottom:1px solid rgba(255,255,255,.06)}.asset-preview-actions{display:flex;align-items:center;gap:8px}.asset-preview-change,.asset-preview-ai{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-preview-body{padding:12px;overflow:auto;display:flex;align-items:center;justify-content:center}.asset-preview-ai-output{border-top:1px solid rgba(255,255,255,.06);padding:10px 12px 14px}.asset-preview-ai-output.hidden{display:none}.asset-preview-ai-label{font-size:11px;color:var(--ui-muted);margin-bottom:6px}.asset-preview-ai-image{width:100%;max-height:200px;object-fit:contain;border-radius:10px;border:1px solid rgba(255,255,255,.08);background:#080a0e99}.asset-preview-body img{max-width:100%;max-height:60vh;object-fit:contain}.asset-preview-body audio{width:100%}.asset-preview-body pre{width:100%;white-space:pre-wrap;color:var(--ui-text);font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace;font-size:12px}.asset-crop-modal{position:fixed;inset:0;background:#080a0ec7;display:flex;align-items:center;justify-content:center;z-index:10060}.asset-crop-card{width:min(860px,96vw);background:#10141cfa;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);display:flex;flex-direction:column}.asset-crop-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 16px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.asset-crop-title{font-size:13px;font-weight:600}.asset-crop-subtitle{font-size:11px;color:var(--ui-muted);margin-top:2px}.asset-crop-close{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-crop-body{padding:16px;display:flex;justify-content:center;gap:16px;flex-wrap:nowrap;align-items:flex-start}.asset-crop-column{display:flex;flex-direction:column;gap:8px;align-items:center;min-width:0}.asset-crop-label{font-size:11px;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.08em}.asset-crop-canvas{border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#080a0e8c;cursor:grab}.asset-crop-preview{border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#080a0e8c}.asset-crop-canvas:active{cursor:grabbing}.asset-crop-controls{display:flex;align-items:center;gap:12px;padding:0 16px 12px;color:var(--ui-text);font-size:12px}.asset-crop-controls label{min-width:42px}.asset-crop-zoom{flex:1}.asset-crop-zoom-value{min-width:50px;text-align:right;color:var(--ui-muted)}.asset-crop-reset{border:1px solid var(--ui-border);background:#19202ccc;color:var(--ui-text);border-radius:8px;padding:4px 10px;font-size:11px;cursor:pointer}.asset-crop-actions{display:flex;justify-content:flex-end;gap:10px;padding:0 16px 16px}.asset-crop-actions button{border-radius:10px;padding:6px 14px;font-size:12px;border:1px solid var(--ui-border);background:#1c2432d9;color:var(--ui-text);cursor:pointer}.asset-crop-apply{background:var(--ui-accent);border-color:transparent;color:#10151f;font-weight:600}@media(max-width:720px){.customize-grid{grid-template-columns:1fr}}.scene-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;background-color:#181c26f2;color:var(--ui-text);font-size:12px;user-select:none;cursor:move;border-bottom:1px solid rgba(255,255,255,.05)}.scene-panel-actions{display:flex;align-items:center;gap:8px}.scene-panel-action{border:1px solid var(--ui-border);border-radius:6px;background:#1f2633;color:var(--ui-muted);font-size:11px;padding:4px 8px;cursor:pointer}.scene-panel-action:hover{border-color:#ff9f4399;color:var(--ui-text)}.scene-panel-toggle{border:none;background:transparent;color:var(--ui-muted);font-size:14px;cursor:pointer;transition:transform .2s ease}.panel-title{display:flex;align-items:center;gap:8px}.panel-pill{padding:2px 8px;border-radius:999px;background:#3dd6c61f;color:var(--ui-accent);font-size:10px;text-transform:uppercase;letter-spacing:.6px}.panel-accent-blue .panel-pill{background:#6f8cff24;color:var(--ui-accent-3)}.panel-accent-amber .panel-pill{background:#ff9f4329;color:var(--ui-accent-2)}.panel-accent-violet .panel-pill{background:#bf7eff2e;color:#d6b7ff}.panel-title-text{font-weight:700;font-size:12px;letter-spacing:.4px}.panel-accent-teal{border-color:#3dd6c659}.panel-accent-blue{border-color:#6f8cff59}.panel-accent-amber{border-color:#ff9f4366}.panel-accent-violet{border-color:#bf7eff59}.scene-panel-body{padding:12px 14px 16px;overflow-y:auto;max-height:calc(78vh - 44px)}.scene-panel.collapsed .scene-panel-body{display:none}.scene-panel.collapsed .scene-panel-toggle{transform:rotate(-90deg)}.scene-panel-search input{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:6px;padding:6px 8px;font-size:12px}.scene-panel-search input:focus{outline:none;border-color:var(--ui-accent);box-shadow:0 0 0 2px #3dd6c633}.scene-panel-filters{display:flex;gap:6px;margin-top:10px}.filter-chip{border:1px solid rgba(111,140,255,.3);background:#131822b3;color:var(--ui-muted);font-size:11px;border-radius:999px;padding:4px 10px;cursor:pointer;transition:all .2s ease}.filter-chip.active{color:var(--ui-text);border-color:#3dd6c680;background:#3dd6c626}.scene-object-list{margin-top:12px;display:flex;flex-direction:column;gap:12px}.scene-object-group-title{font-size:11px;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px}.scene-object-count{margin-left:6px;padding:2px 6px;border-radius:999px;background:#ffffff14;color:var(--ui-text);font-size:10px}.scene-object-group-items{display:flex;flex-direction:column;gap:6px}.scene-object-item{width:100%;text-align:left;border:1px solid rgba(255,255,255,.06);border-radius:6px;background-color:#191e28e6;color:var(--ui-text);font-size:12px;padding:6px 8px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px}.scene-object-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scene-object-badge{font-size:10px;padding:2px 6px;border-radius:999px;text-transform:uppercase;letter-spacing:.4px;border:1px solid rgba(255,255,255,.1)}.scene-object-badge.ui{background:#3dd6c61f;color:var(--ui-accent)}.scene-object-badge.scene{background:#6f8cff1f;color:var(--ui-accent-3)}.scene-object-item:hover{border-color:#3dd6c680;color:var(--ui-text)}.scene-object-item.selected{border-color:#3dd6c6b3;color:var(--ui-text);box-shadow:inset 0 0 0 1px #3dd6c666}.scene-edit-selected{font-size:12px;color:var(--ui-muted);margin-bottom:10px}.debug-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid #444;background-color:#252525;border-radius:8px 8px 0 0;cursor:move;user-select:none}.debug-tabs{display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid #333;background-color:#1f1f1f}.debug-tab{flex:1;border:1px solid #444;border-radius:6px;background-color:#262626;color:#bfc3c7;font-size:12px;padding:6px 10px;cursor:pointer;transition:all .2s ease}.debug-tab.active{background-color:#323232;color:#fff;border-color:#ffb43b;box-shadow:inset 0 0 0 1px #ffb43b59}.debug-hint{font-size:11px;color:#9aa0a6;margin-bottom:10px}.debug-tab-panel{display:none}.debug-tab-panel.active{display:block}.debug-collapsible{border:1px solid rgba(255,255,255,.08);border-radius:10px;background-color:#151a24d9;overflow:hidden;margin-bottom:12px}.debug-collapsible-header{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background-color:#181e2ae6;border:none;color:var(--ui-text);font-size:12px;cursor:pointer}.debug-collapsible-body{padding:10px 12px}.debug-collapsible-icon{transition:transform .2s ease}.debug-collapsible.collapsed .debug-collapsible-body{display:none}.debug-collapsible.collapsed .debug-collapsible-icon{transform:rotate(-90deg)}.debug-nudge.hidden{display:none}.debug-arrow-pad{display:grid;grid-template-columns:repeat(3,36px);grid-auto-rows:32px;gap:6px;justify-content:center;margin-top:8px}.debug-arrow-btn{border:1px solid #444;border-radius:6px;background-color:#2b2b2b;color:#e7e7e7;font-size:14px;cursor:pointer;transition:all .15s ease}.debug-arrow-btn:hover{border-color:#ffb43b;color:#fff}.debug-arrow-btn:active{transform:translateY(1px)}.debug-arrow-btn[data-nudge=up]{grid-column:2}.debug-arrow-btn[data-nudge=left]{grid-column:1}.debug-arrow-btn[data-nudge=down]{grid-column:2}.debug-arrow-btn[data-nudge=right]{grid-column:3}.debug-info-grid{display:flex;flex-direction:column;gap:8px;padding:8px;border-radius:6px;background-color:#191e28cc;border:1px solid rgba(255,255,255,.08)}.debug-info-row{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px}.debug-info-label{color:#9aa0a6}.debug-info-value{color:#f1f3f5;font-weight:600}.debug-title{font-weight:600;font-size:14px;color:#fff}.debug-actions{display:flex;gap:8px}.debug-action-btn{background-color:transparent;color:#ccc;border:1px solid #555;border-radius:3px;padding:4px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.debug-action-btn:hover{background-color:#444;color:#fff}.debug-content{flex:1;overflow-y:auto;padding:12px 16px}.debug-section{margin-bottom:20px}.panel-section{margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.06)}.panel-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}.panel-section-title{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.6px;color:var(--ui-muted);margin-bottom:8px}.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}@media(max-width:520px){.field-grid{grid-template-columns:1fr}}.debug-section-title{font-size:12px;font-weight:600;color:var(--ui-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:4px}.debug-field{margin-bottom:12px}.debug-field label{display:block;font-size:11px;color:#aaa;margin-bottom:4px;font-weight:500}.debug-field input,.debug-field select{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:4px;padding:6px 8px;font-size:12px;font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace;transition:border-color .2s ease}.debug-field input:focus,.debug-field select:focus{outline:none;border-color:var(--ui-accent-3);box-shadow:0 0 0 2px #6f8cff33}.debug-field input[type=range]{-webkit-appearance:none;appearance:none;height:6px;background:#555;border-radius:3px;outline:none}.debug-field input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:16px;height:16px;border-radius:50%;background:var(--ui-accent-3);cursor:pointer}.debug-field input[type=range]::-moz-range-thumb{width:16px;height:16px;border-radius:50%;background:var(--ui-accent-3);cursor:pointer;border:none}.debug-field input[type=checkbox]{width:auto;margin-right:8px}.debug-field.checkbox-field{display:flex;align-items:center;gap:8px}.debug-field.checkbox-field label{margin-bottom:0;flex:1}.debug-value-display{display:inline-block;margin-left:8px;font-size:11px;color:var(--ui-muted);font-family:JetBrains Mono,SF Mono,Consolas,Monaco,monospace}.debug-btn-group{display:flex;gap:6px;margin-top:8px}.debug-btn{flex:1;background-color:#444;color:#fff;border:1px solid #666;border-radius:4px;padding:6px 8px;font-size:11px;cursor:pointer;transition:all .2s ease}.debug-btn:hover{background-color:#555;border-color:#888}.debug-btn.primary{background-color:#2a5bd7;border-color:#2a5bd7}.debug-btn.primary:hover{background-color:#2147a7;border-color:#2147a7}.debug-btn.danger{background-color:#dc3545;border-color:#dc3545}.debug-btn.danger:hover{background-color:#c82333;border-color:#c82333}.debug-btn.secondary{background-color:#3dd6c61a;border-color:#3dd6c64d;color:#3dd6c6}.debug-btn.secondary:hover{background-color:#3dd6c633;border-color:#3dd6c666}.config-editor{border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:12px;margin-top:8px;background-color:#191e28d9}.debug-select{width:100%;background-color:#1d2430;color:var(--ui-text);border:1px solid var(--ui-border);border-radius:4px;padding:6px 8px;font-size:11px}.debug-select:focus{outline:none;border-color:var(--ui-accent-3);box-shadow:0 0 0 2px #6f8cff33}.debug-select option{background-color:#333;color:#fff}.json-modal{position:fixed;top:0;left:0;width:100%;height:100%;background-color:#000c;z-index:10000;display:flex;align-items:center;justify-content:center}.json-modal-content{background-color:#1e1e1e;border:1px solid #555;border-radius:8px;width:80%;max-width:800px;max-height:80%;display:flex;flex-direction:column}.json-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #444}.json-modal-header h3{margin:0;color:#fff;font-size:16px;font-weight:600}.json-modal-body{flex:1;padding:16px 20px;overflow-y:auto}.json-modal-body pre{margin:0;color:#fff;font-family:Consolas,Monaco,monospace;font-size:12px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word}.debug-toggle{position:relative}.debug-toggle-badge{background-color:#28a745;color:#fff;font-size:10px;padding:2px 4px;border-radius:8px;margin-left:4px;display:none}.debug-toggle-badge.active{display:inline-block}.preview-stage{width:100%;height:100%;display:flex;align-items:center;justify-content:center;position:relative}.preview-stage.hidden{display:none}.compare-grid{width:100%;height:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;padding:8px;box-sizing:border-box}.compare-viewport{display:flex;flex-direction:column;background:#141820e6;border:1px solid rgba(111,140,255,.2);border-radius:14px;box-shadow:var(--ui-shadow);overflow:hidden;position:relative}.compare-viewport.is-active{border-color:#3dd6c699;box-shadow:0 0 0 1px #3dd6c666,var(--ui-shadow)}.compare-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;background:#121720e6;border-bottom:1px solid rgba(255,255,255,.06);color:var(--ui-text)}.compare-title{display:flex;flex-direction:column;gap:2px}.compare-title-text{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase}.compare-meta{font-size:11px;color:var(--ui-muted)}.compare-focus{border:1px solid rgba(111,140,255,.5);background:#1e2638b3;color:var(--ui-text);border-radius:999px;padding:4px 10px;font-size:11px;cursor:pointer}.compare-viewport.is-active .compare-focus{border-color:#3dd6c699;background:#3dd6c62e;color:#e9fff9}.compare-body{position:relative;flex:1;display:flex;align-items:center;justify-content:center;padding:10px;box-sizing:border-box}.compare-slot,.compare-ghost{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.compare-ghost.hidden{display:none}.compare-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--ui-muted);background:#0a0d1259;opacity:0;transition:opacity .2s ease;pointer-events:none}.compare-viewport:not(.is-active) .compare-overlay{opacity:1}.snapshot-canvas{width:100%;height:100%;display:block;background:#000}@media(max-width:1100px){.compare-grid{grid-template-columns:1fr;grid-auto-rows:minmax(0,1fr)}}@media(max-width:720px){.scene-panel.scene-tools{width:calc(100% - 32px);left:16px!important;right:auto}}.panel-resize-handle{position:absolute;top:0;right:0;width:10px;height:100%;cursor:ew-resize}.panel-resize-handle:after{content:"";position:absolute;top:30%;right:3px;width:2px;height:40%;border-radius:2px;background:#ffffff1f}.debug-workbench{position:absolute;width:350px;height:600px;min-width:250px;min-height:200px;background:#12161ef5;border:1px solid var(--ui-border);border-radius:14px;box-shadow:var(--ui-shadow);pointer-events:auto;display:flex;flex-direction:column;overflow:hidden;z-index:1000}.workbench-header{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;background-color:#181c26f2;border-bottom:1px solid rgba(255,255,255,.05);cursor:move;flex-shrink:0}.workbench-tabs{display:flex;background:#0c1018e6;padding:4px;gap:4px;border-bottom:1px solid var(--ui-border);flex-shrink:0;overflow-x:auto}.workbench-tab{flex:1;padding:6px 10px;font-size:11px;font-weight:600;color:var(--ui-muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;transition:all .2s ease;text-align:center}.workbench-tab:hover{background:#ffffff0d;color:var(--ui-text)}.workbench-tab.active{background:#3dd6c61f;color:var(--ui-accent);border-color:#3dd6c64d}.workbench-content{flex:1;overflow-y:auto;padding:0}.workbench-tab-panel{display:none}.workbench-tab-panel.active{display:block}.workbench-resize-handle{position:absolute;bottom:0;right:0;width:16px;height:16px;cursor:nwse-resize;background:linear-gradient(135deg,transparent 50%,var(--ui-border) 50%,var(--ui-border) 75%,transparent 75%,transparent 85%,var(--ui-border) 85%);z-index:10}.workbench-content .scene-panel{position:static;width:100%!important;max-height:none!important;border:none;background:transparent;box-shadow:none;border-radius:0}.workbench-content .scene-panel-header{display:none}.workbench-content .scene-panel-body{max-height:none;padding:12px}.library-panel{border-color:#3dd6c659}.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(80px,1fr));gap:8px;margin-top:12px}.library-item{display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px;border:2px solid transparent;border-radius:8px;cursor:pointer;transition:all .2s ease;background:#191e28cc}.library-item:hover{border-color:#3dd6c680;background:#3dd6c61a}.library-item.selected{border-color:#3dd6c6cc;background:#3dd6c626;box-shadow:0 0 0 1px #3dd6c666}.library-thumbnail{width:60px;height:40px;object-fit:cover;border-radius:4px;border:1px solid rgba(255,255,255,.1)}.library-label{font-size:11px;color:var(--ui-muted);text-align:center;word-break:break-all}.library-selected{font-size:12px;color:var(--ui-text);margin:12px 0;padding:8px;background:#191e28cc;border-radius:6px;border:1px solid rgba(255,255,255,.08)}.library-empty{font-size:11px;color:var(--ui-muted);padding:20px;text-align:center;grid-column:1 / -1}.library-category-tabs{display:flex;background:#0c1018e6;padding:4px;gap:2px;border-bottom:1px solid var(--ui-border);margin-bottom:12px}.library-category-tab{flex:1;padding:6px 8px;font-size:11px;font-weight:600;color:var(--ui-muted);background:transparent;border:1px solid transparent;border-radius:6px;cursor:pointer;white-space:nowrap;text-align:center;transition:all .2s ease}.library-category-tab:hover{background:#ffffff0d;color:var(--ui-text)}.library-category-tab.active{background:#3dd6c61f;color:var(--ui-accent);border-color:#3dd6c64d}
|