handler-playable-sdk 0.3.43 → 0.3.45

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/index.css CHANGED
@@ -163,6 +163,27 @@
163
163
  background: var(--ui-bg);
164
164
  }
165
165
 
166
+ /* Scene Tools Container - Dynamically positioned relative to game preview */
167
+ #scene-tools-container {
168
+ position: absolute;
169
+ /* left, top, and transform will be set dynamically by JavaScript */
170
+ z-index: 60;
171
+ pointer-events: auto;
172
+ transition: left var(--ui-duration-fast) var(--ui-ease),
173
+ top var(--ui-duration-fast) var(--ui-ease);
174
+ }
175
+
176
+ /* Nudge Panel Container - Dynamically positioned relative to game preview */
177
+ #nudge-panel-container {
178
+ position: absolute;
179
+ /* left, top, and transform will be set dynamically by JavaScript */
180
+ z-index: 60;
181
+ pointer-events: auto;
182
+ transition: left var(--ui-duration-fast) var(--ui-ease),
183
+ top var(--ui-duration-fast) var(--ui-ease);
184
+ }
185
+
186
+
166
187
  .preview-container {
167
188
  width: 100%;
168
189
  height: 100%;
@@ -4643,12 +4664,10 @@
4643
4664
 
4644
4665
 
4645
4666
  /* ========== 13-nudge-panel.css ========== */
4646
- /* Nudge Panel - Floating on left side */
4667
+ /* Nudge Panel - Dynamically positioned relative to game preview */
4647
4668
  .nudge-panel {
4648
4669
  position: absolute;
4649
- left: 16px;
4650
- top: 50%;
4651
- transform: translateY(-50%);
4670
+ /* left, top, and transform will be set dynamically by JavaScript */
4652
4671
  width: 180px;
4653
4672
  background: var(--ui-surface);
4654
4673
  border: 1px solid var(--ui-border);
@@ -4656,7 +4675,9 @@
4656
4675
  box-shadow: var(--ui-shadow);
4657
4676
  z-index: 60;
4658
4677
  pointer-events: auto;
4659
- transition: opacity var(--ui-duration-fast) var(--ui-ease);
4678
+ transition: left var(--ui-duration-fast) var(--ui-ease),
4679
+ top var(--ui-duration-fast) var(--ui-ease),
4680
+ opacity var(--ui-duration-fast) var(--ui-ease);
4660
4681
  }
4661
4682
 
4662
4683
  .nudge-panel.hidden {
package/dist/index.d.cts CHANGED
@@ -139,6 +139,7 @@ declare class PreviewShell {
139
139
  private fitToScreen;
140
140
  private applyTransform;
141
141
  private applyFrameDrag;
142
+ private updatePanelPositions;
142
143
  private setupFrameDragging;
143
144
  private setupSpaceKeyListener;
144
145
  private isInputFocused;
package/dist/index.d.ts CHANGED
@@ -139,6 +139,7 @@ declare class PreviewShell {
139
139
  private fitToScreen;
140
140
  private applyTransform;
141
141
  private applyFrameDrag;
142
+ private updatePanelPositions;
142
143
  private setupFrameDragging;
143
144
  private setupSpaceKeyListener;
144
145
  private isInputFocused;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,a}from"./chunk-XSKUGJJF.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
1
+ import{E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,a}from"./chunk-LTJ4LCJ7.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Br={};Xn(Br,{AssetCache:()=>ee,AssetLoader:()=>fe,AssetSystem:()=>Rt,AssetTextures:()=>he,Assets:()=>fa,BaseSystem:()=>ze,GameEngine:()=>It,GameObject:()=>lt,GameObjectManager:()=>De,ObjectFactory:()=>me,Renderer:()=>ot,RuntimeObjectRegistry:()=>Ne,Transform:()=>st,applyScreenAnchor:()=>$t,basePixi:()=>da,clearResponsiveElements:()=>ma,createPixiBase:()=>kt,getRegisteredFontIds:()=>sa,globalResponsiveMultipliers:()=>dt,initAssetTextures:()=>St,initAssets:()=>ha,layout:()=>ya,playLottieOverlay:()=>la,registerFont:()=>ra,registerType:()=>Et,resolveAnchorVec2:()=>pt,resolveFont:()=>ia,resolveFontWeight:()=>aa,resolveScreenAnchorPoint:()=>He,resolveScreenRatioPoint:()=>Be,runInitSequence:()=>va,setLottieInstance:()=>Ct,spawnSceneFromConfig:()=>ua,updateScreenState:()=>Dt});module.exports=Ca(Br);var na=require("pixi.js");var pe={};function bt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function yt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){bt(n,e,!0)}var D=null,K=[],Ce=null;function ei(n){D=n,K=[],Ce!==null&&(clearTimeout(Ce),Ce=null)}function ti(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Zn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=ti();if(e&&t.endpoint){if(K.push(n),K.length>t.maxQueue&&(K=K.slice(K.length-t.maxQueue)),K.length>=t.batchSize){Qn();return}Ce===null&&(Ce=window.setTimeout(()=>{Ce=null,Qn()},t.flushIntervalMs))}}async function Qn(){let n=ti();if(!n.endpoint||K.length===0)return;let e=K.splice(0,n.batchSize);await Zn(n.endpoint,{events:e},n.transport,n.debug),K.length>0&&await Zn(n.endpoint,{events:K.splice(0,n.batchSize)},n.transport,n.debug)}function ni(n){return Math.max(0,Math.min(1,n))}function La(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Xe(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ta(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ii(n,e,t){try{n[e]=t}catch{}}function _a(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ai(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ri(n,e){let t=_a(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function si(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Xe();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=ni(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=ni(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ii(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ai(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=La(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let O of Object.keys(l)){if(f.has(O))continue;let j=l[O];typeof j=="number"&&x.push({key:O,from:Ta(u,O),to:j})}let w=ri(u,l);return{target:u,startMs:Xe(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Xe())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Xe(),m=Xe()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ii(u,g,m)}let p=ri(u,l);p.to&&ai(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function oi(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=si()}catch{}}var li={name:"handler-playable-sdk",version:"0.3.43",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ma=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,bi=V++,yi=V++,vi=V++,M=Ma;function xi(){return M===ci}function wi(){return M===di}function Ei(){return M===pi}function Ai(){return M===ui}function Le(){return M===gi}function Te(){return M===fi}function Si(){return M===hi}function Ci(){return M===mi}function Li(){return M===bi}function Vt(){return M===yi}function Wt(){return M===vi}function Ti(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),M=ci;return}catch{}else if(n==="dapi")try{dapi.isReady(),M=di;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(M=pi)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(M=ui)}catch{}else if(e==="mintegral")window.gameReady&&(M=gi);else if(e==="tapjoy")window.TJ_API&&(M=fi);else if(e==="tiktok")window.openAppStore&&(M=hi);else if(e==="smadex")try{window.smxTracking&&(M=mi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(M=bi)}catch{}else e==="vungle"?M=yi:(n==="nucleo"||e==="nucleo")&&(M=vi)}var vt=mt(require("lottie-web"),1),_i=vt.default;typeof window!="undefined"&&(window.lottie=vt.default,window.__baseLottie=vt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var xs=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],ws=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],Es=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Oi=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var As=[...Oi];var za=Oi[0];ue();var Ga=mt(require("jszip"),1);function Ba(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Fa(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ua(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await Ba(a),s=await Ua(r),o=Fa(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function xt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var Ii=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new Ii.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Ri=require("@google/genai");async function wt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ri.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Xa=require("pixi.js");Je();ue();var Hi=require("pixi.js");var Ja=require("pixi.js");ue();function ar(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function rr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function sr(n){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(s=>{s.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(s=>{s.addEventListener("click",o=>{let c=o.target.dataset.tab;c&&this.switchTab(c)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",s=>{s.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Br={};Xn(Br,{AssetCache:()=>ee,AssetLoader:()=>fe,AssetSystem:()=>Rt,AssetTextures:()=>he,Assets:()=>fa,BaseSystem:()=>ze,GameEngine:()=>It,GameObject:()=>lt,GameObjectManager:()=>De,ObjectFactory:()=>me,Renderer:()=>ot,RuntimeObjectRegistry:()=>Ne,Transform:()=>st,applyScreenAnchor:()=>$t,basePixi:()=>da,clearResponsiveElements:()=>ma,createPixiBase:()=>kt,getRegisteredFontIds:()=>sa,globalResponsiveMultipliers:()=>dt,initAssetTextures:()=>St,initAssets:()=>ha,layout:()=>ya,playLottieOverlay:()=>la,registerFont:()=>ra,registerType:()=>Et,resolveAnchorVec2:()=>pt,resolveFont:()=>ia,resolveFontWeight:()=>aa,resolveScreenAnchorPoint:()=>He,resolveScreenRatioPoint:()=>Be,runInitSequence:()=>va,setLottieInstance:()=>Ct,spawnSceneFromConfig:()=>ua,updateScreenState:()=>Dt});module.exports=Ca(Br);var na=require("pixi.js");var pe={};function bt(n,e,t=!1){pe[n]||(pe[n]=[]),pe[n].push({fn:e,once:t})}function Gt(n,e){if(pe[n]){if(!e){delete pe[n];return}pe[n]=pe[n].filter(t=>t.fn!==e)}}function yt(n,...e){let t=pe[n];if(t)for(let i of[...t])i.fn(...e),i.once&&Gt(n,i.fn)}function q(n,e){bt(n,e,!0)}var D=null,K=[],Ce=null;function ei(n){D=n,K=[],Ce!==null&&(clearTimeout(Ce),Ce=null)}function ti(){var n,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(n=D==null?void 0:D.batchSize)!=null?n:10,flushIntervalMs:(e=D==null?void 0:D.flushIntervalMs)!=null?e:300,maxQueue:(t=D==null?void 0:D.maxQueue)!=null?t:200,debug:!!(D!=null&&D.debug)}}async function Zn(n,e,t,i){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(n,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(n,e){let t=ti();if(e&&t.endpoint){if(K.push(n),K.length>t.maxQueue&&(K=K.slice(K.length-t.maxQueue)),K.length>=t.batchSize){Qn();return}Ce===null&&(Ce=window.setTimeout(()=>{Ce=null,Qn()},t.flushIntervalMs))}}async function Qn(){let n=ti();if(!n.endpoint||K.length===0)return;let e=K.splice(0,n.batchSize);await Zn(n.endpoint,{events:e},n.transport,n.debug),K.length>0&&await Zn(n.endpoint,{events:K.splice(0,n.batchSize)},n.transport,n.debug)}function ni(n){return Math.max(0,Math.min(1,n))}function La(n){let e=String(n!=null?n:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function Xe(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ta(n,e){let t=n==null?void 0:n[e];return typeof t=="number"?t:0}function ii(n,e,t){try{n[e]=t}catch{}}function _a(n){let e=n==null?void 0:n.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ai(n,e){let t=n==null?void 0:n.scale;if(t)try{typeof t.set=="function"?t.set(e.x,e.y):(typeof t.x=="number"&&(t.x=e.x),typeof t.y=="number"&&(t.y=e.y))}catch{}}function ri(n,e){let t=_a(n);if(!t)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:a!=null?a:t.y}}}function si(){let n=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),n.size>0&&i()})},a=u=>{var p;n.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),i()},r=u=>{n.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},s=u=>{u.killed||(u.killed=!0,r(u))},o=()=>{var l,p;let u=Xe();for(let g of Array.from(n)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,A=ni(h),b=g.repeat>=0?g.repeat+1:1,f=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let y=h-f;A=ni(y)}let x=g.ease(A);g.yoyo&&f%2===1&&(x=1-x);for(let y of g.props)ii(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&ai(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(h>=b){s(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),h=La(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,f=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let O of Object.keys(l)){if(f.has(O))continue;let j=l[O];typeof j=="number"&&x.push({key:O,from:Ta(u,O),to:j})}let w=ri(u,l);return{target:u,startMs:Xe(),delayMs:m,durationMs:g,ease:h,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>s(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Xe())},resume:()=>{var h;if(!p.paused)return;let g=(h=p.pauseAtMs)!=null?h:Xe(),m=Xe()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&ii(u,g,m)}let p=ri(u,l);p.to&&ai(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))s(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],h=f=>{if(typeof f=="number")return Math.max(0,f*1e3);let x=typeof f=="string"?f.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=f=>{l.push(f);let x=Math.max(0,(typeof f.vars.duration=="number"?f.vars.duration:.5)*1e3);p=Math.max(p,f.atMs+x)},b={to(f,x,w){return A({kind:"to",target:f,vars:x,atMs:h(w)}),b},fromTo(f,x,w,y){return A({kind:"fromTo",target:f,vars:w,from:x,atMs:h(y)}),b},play(){var f,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(f=w.from)!=null?f:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x:0)}));return b},pause(){for(let f of m)f.pause();return b},kill(){for(let f of m)f.kill();m=[],g=!1}};return u.paused||b.play(),b}};return c}function oi(){if(typeof window=="undefined")return;let n=window;if(!n.gsap)try{n.gsap=si()}catch{}}var li={name:"handler-playable-sdk",version:"0.3.45",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,Ma=V++,ci=V++,di=V++,pi=V++,ui=V++,gi=V++,fi=V++,hi=V++,mi=V++,bi=V++,yi=V++,vi=V++,M=Ma;function xi(){return M===ci}function wi(){return M===di}function Ei(){return M===pi}function Ai(){return M===ui}function Le(){return M===gi}function Te(){return M===fi}function Si(){return M===hi}function Ci(){return M===mi}function Li(){return M===bi}function Vt(){return M===yi}function Wt(){return M===vi}function Ti(){let n=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(n==="mraid")try{mraid.getState(),M=ci;return}catch{}else if(n==="dapi")try{dapi.isReady(),M=di;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(M=pi)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(M=ui)}catch{}else if(e==="mintegral")window.gameReady&&(M=gi);else if(e==="tapjoy")window.TJ_API&&(M=fi);else if(e==="tiktok")window.openAppStore&&(M=hi);else if(e==="smadex")try{window.smxTracking&&(M=mi)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(M=bi)}catch{}else e==="vungle"?M=yi:(n==="nucleo"||e==="nucleo")&&(M=vi)}var vt=mt(require("lottie-web"),1),_i=vt.default;typeof window!="undefined"&&(window.lottie=vt.default,window.__baseLottie=vt.default);Xt();function $(n,e){let t=(a,r)=>r===0?a:t(r,a%r),i=t(n,e);return`${n/i}:${e/i}`}var xs=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],ws=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],Es=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],Oi=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var As=[...Oi];var za=Oi[0];ue();var Ga=mt(require("jszip"),1);function Ba(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function Fa(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function Ua(n){return await new Promise(e=>{let t=new Image;t.onload=()=>e({width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}),t.onerror=()=>e(null),t.src=n})}async function Jt(n){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",n);let i=await fetch(n);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,n),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await Ba(a),s=await Ua(r),o=Fa(r);return console.log("[ImageUtils] Success resolution:",s==null?void 0:s.width,"x",s==null?void 0:s.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:r,width:(e=s==null?void 0:s.width)!=null?e:0,height:(t=s==null?void 0:s.height)!=null?t:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function xt(n,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=n}),i=document.createElement("canvas");i.width=t.width,i.height=t.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),n;a.drawImage(t,0,0);let r=a.getImageData(0,0,i.width,i.height),s=r.data,d=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(l=>({r:s[l.offset],g:s[l.offset+1],b:s[l.offset+2]})),c=0;for(let l=0;l<s.length;l+=4){let p=s[l],g=s[l+1],m=s[l+2],h=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){h=!0;break}h&&(s[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),n}}var Ii=require("@google/genai");async function Zt(n,e,t=[],i={}){var a,r,s,o,d,c,u;try{if(!(n!=null&&n.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let b=0;b<t.length;b++){let f=t[b];if(!f.base64||!f.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(f.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!f.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${f.mimeType}`)}let l=new Ii.GoogleGenAI({apiKey:n}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,f)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${f+1}: ${b.mimeType}, size: ${Math.round(b.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${t.length} images and prompt length: ${e.length}`);let m=await l.models.generateContent({model:p,contents:g}),h="",A=(s=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:s.parts;if(A)for(let b of A)b.text&&(h+=b.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(l){throw console.error("[Gemini] API error:",l),(o=l.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Ri=require("@google/genai");async function wt(n,e,t=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ri.GoogleGenAI({apiKey:n}),r=[{text:e}];t.length>0&&t.forEach((o,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let s=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!s.candidates||!s.candidates[0]||!s.candidates[0].content||!s.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of s.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let d=o.inlineData.data,c=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Xa=require("pixi.js");Je();ue();var Hi=require("pixi.js");var Ja=require("pixi.js");ue();function ar(n){return new Promise((e,t)=>{let i=new FileReader;i.onerror=()=>t(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(n)})}function rr(n){var a;let[e,t]=n.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function sr(n){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering:
@@ -163,6 +163,27 @@
163
163
  background: var(--ui-bg);
164
164
  }
165
165
 
166
+ /* Scene Tools Container - Dynamically positioned relative to game preview */
167
+ #scene-tools-container {
168
+ position: absolute;
169
+ /* left, top, and transform will be set dynamically by JavaScript */
170
+ z-index: 60;
171
+ pointer-events: auto;
172
+ transition: left var(--ui-duration-fast) var(--ui-ease),
173
+ top var(--ui-duration-fast) var(--ui-ease);
174
+ }
175
+
176
+ /* Nudge Panel Container - Dynamically positioned relative to game preview */
177
+ #nudge-panel-container {
178
+ position: absolute;
179
+ /* left, top, and transform will be set dynamically by JavaScript */
180
+ z-index: 60;
181
+ pointer-events: auto;
182
+ transition: left var(--ui-duration-fast) var(--ui-ease),
183
+ top var(--ui-duration-fast) var(--ui-ease);
184
+ }
185
+
186
+
166
187
  .preview-container {
167
188
  width: 100%;
168
189
  height: 100%;
@@ -4643,12 +4664,10 @@
4643
4664
 
4644
4665
 
4645
4666
  /* ========== 13-nudge-panel.css ========== */
4646
- /* Nudge Panel - Floating on left side */
4667
+ /* Nudge Panel - Dynamically positioned relative to game preview */
4647
4668
  .nudge-panel {
4648
4669
  position: absolute;
4649
- left: 16px;
4650
- top: 50%;
4651
- transform: translateY(-50%);
4670
+ /* left, top, and transform will be set dynamically by JavaScript */
4652
4671
  width: 180px;
4653
4672
  background: var(--ui-surface);
4654
4673
  border: 1px solid var(--ui-border);
@@ -4656,7 +4675,9 @@
4656
4675
  box-shadow: var(--ui-shadow);
4657
4676
  z-index: 60;
4658
4677
  pointer-events: auto;
4659
- transition: opacity var(--ui-duration-fast) var(--ui-ease);
4678
+ transition: left var(--ui-duration-fast) var(--ui-ease),
4679
+ top var(--ui-duration-fast) var(--ui-ease),
4680
+ opacity var(--ui-duration-fast) var(--ui-ease);
4660
4681
  }
4661
4682
 
4662
4683
  .nudge-panel.hidden {
@@ -1 +1 @@
1
- (function(_0x85f116,_0x3cbe3d){var a0_0x57f6b3={_0x18bdec:0x1ec,_0x44f34d:'YFbR',_0x1d3a3c:0x202,_0x186f84:0x1f9,_0xa23dd3:0x4d1,_0x2140d5:0x4ce,_0x3d7d27:'LsaF',_0x260917:0x4d2,_0x123724:0x4bf,_0x1df236:0x4c0,_0x122a9c:'96]C',_0x2f2ea7:0x4d0,_0x403d47:'oPyi',_0x1a29bb:0x4d1,_0x152cd7:0x4d8,_0x2b58a4:'7Afb',_0x247917:0x4c2,_0xceb7ff:0x4c9,_0x532498:0x4d7,_0x3a154c:0x4c6,_0x4b0692:0x4c6,_0x4260e1:'GJ5#',_0x1ec50b:0x4d0,_0x40e249:0x4c8,_0x2774c2:0x4c3,_0x1a423c:0x4b3,_0x3b5080:'y##2'},a0_0x40149c={_0x4969a9:0x95},a0_0x37a1f8={_0x3171df:0x35f};function _0x464782(_0x46914f,_0x444251,_0x5b746b,_0x3a1b92,_0x251aa7){return a0_0x231b(_0x251aa7- -0x108,_0x444251);}function _0x2ebb7d(_0x2c440d,_0x131393,_0x5730bf,_0x1da468,_0x30d30f){return a0_0x231b(_0x131393-a0_0x37a1f8._0x3171df,_0x30d30f);}var _0x9af144=_0x85f116();function _0x1c872c(_0x53cdc7,_0x191ad3,_0x37341d,_0x5e9bea,_0x33b443){return a0_0x231b(_0x33b443-a0_0x40149c._0x4969a9,_0x37341d);}while(!![]){try{var _0x2d7cae=parseInt(_0x1c872c(0x1fb,a0_0x57f6b3._0x18bdec,a0_0x57f6b3._0x44f34d,a0_0x57f6b3._0x1d3a3c,a0_0x57f6b3._0x186f84))/(-0x76d+-0x58*0x27+0x14d6)*(-parseInt(_0x2ebb7d(0x4c3,a0_0x57f6b3._0xa23dd3,0x4c2,a0_0x57f6b3._0x2140d5,a0_0x57f6b3._0x3d7d27))/(0xc8e*-0x2+-0xad*0x2b+0x362d))+-parseInt(_0x2ebb7d(a0_0x57f6b3._0x260917,0x4cb,a0_0x57f6b3._0x123724,a0_0x57f6b3._0x1df236,a0_0x57f6b3._0x122a9c))/(0x260+0xe3a*0x1+0x1097*-0x1)*(-parseInt(_0x2ebb7d(a0_0x57f6b3._0x2f2ea7,0x4dc,0x4e1,0x4dd,a0_0x57f6b3._0x403d47))/(-0x2*0x1365+-0x2*-0x267+0x220*0x10))+parseInt(_0x2ebb7d(a0_0x57f6b3._0x1a29bb,a0_0x57f6b3._0x152cd7,0x4e4,0x4dc,a0_0x57f6b3._0x2b58a4))/(-0x1247*-0x1+0x1bb5+-0x2df7)+parseInt(_0x2ebb7d(a0_0x57f6b3._0x247917,a0_0x57f6b3._0xceb7ff,0x4ba,a0_0x57f6b3._0x532498,'GdeP'))/(0x2*-0xdb7+0x5cf*-0x1+0x2143)+parseInt(_0x2ebb7d(0x4c5,a0_0x57f6b3._0x3a154c,a0_0x57f6b3._0x4b0692,0x4bc,a0_0x57f6b3._0x4260e1))/(0x4c4+-0x1f95+0x1ad8)+-parseInt(_0x2ebb7d(0x4c6,a0_0x57f6b3._0x1ec50b,a0_0x57f6b3._0x40e249,a0_0x57f6b3._0x2774c2,'Xvh*'))/(-0x5*-0x2dd+-0x55f+-0x8ea)+-parseInt(_0x2ebb7d(a0_0x57f6b3._0x1a423c,a0_0x57f6b3._0x247917,0x4ce,a0_0x57f6b3._0x2774c2,a0_0x57f6b3._0x3b5080))/(0x1718+-0x1*-0x1883+-0x2f92);if(_0x2d7cae===_0x3cbe3d)break;else _0x9af144['push'](_0x9af144['shift']());}catch(_0x209e46){_0x9af144['push'](_0x9af144['shift']());}}}(a0_0x29af,-0x170f4f*0x1+-0x50dae*0x2+-0x2a859*-0x12));function a0_0x231b(_0x45ff20,_0x5181d0){_0x45ff20=_0x45ff20-(0x1de0+-0x19d1+-0x2ac);var _0x3249f6=a0_0x29af();var _0xdc96e6=_0x3249f6[_0x45ff20];if(a0_0x231b['IeDsGd']===undefined){var _0x15fb86=function(_0x41b2f2){var _0x5220eb='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x52424e='',_0x208d0a='',_0x3581d6=_0x52424e+_0x15fb86;for(var _0x92494a=-0x4eb+0x179*-0x7+0xf3a,_0x74206e,_0x2372b2,_0x235f26=-0x41*0x2d+-0x1*0x10e5+-0x91*-0x32;_0x2372b2=_0x41b2f2['charAt'](_0x235f26++);~_0x2372b2&&(_0x74206e=_0x92494a%(0x206b+0x1019+0x4*-0xc20)?_0x74206e*(0x6*-0x566+-0x14b+0x21ef)+_0x2372b2:_0x2372b2,_0x92494a++%(-0x1ff0+0x772*-0x1+0x2766))?_0x52424e+=_0x3581d6['charCodeAt'](_0x235f26+(-0x2a5*0x1+-0x191*0xb+0x13ea))-(0x10fd+0x3*-0xd5+0x94*-0x19)!==-0x1e4+-0x106b+0x6d*0x2b?String['fromCharCode'](-0x2a+-0x1654+0x35b*0x7&_0x74206e>>(-(0x1841+0xba8+-0x23e7)*_0x92494a&0x71*0x37+0x7c3+-0x2004)):_0x92494a:-0x3*-0xa15+-0x1030+-0x1*0xe0f){_0x2372b2=_0x5220eb['indexOf'](_0x2372b2);}for(var _0x412a02=-0x270f+-0x131+0x1*0x2840,_0x29228b=_0x52424e['length'];_0x412a02<_0x29228b;_0x412a02++){_0x208d0a+='%'+('00'+_0x52424e['charCodeAt'](_0x412a02)['toString'](0x19e3+-0x436+-0x159d))['slice'](-(0xf6*0x1d+0x1f97+-0x3b73));}return decodeURIComponent(_0x208d0a);};var _0x32da82=function(_0x406421,_0x190f74){var _0x164d6b=[],_0x25465c=0x8b9+0x1*0x21d9+-0x2a92,_0x4be023,_0x4d9a8a='';_0x406421=_0x15fb86(_0x406421);var _0x11d129;for(_0x11d129=0x777+-0x23fe*-0x1+-0x5*0x8b1;_0x11d129<0x1887+-0x3a2+-0x1cf*0xb;_0x11d129++){_0x164d6b[_0x11d129]=_0x11d129;}for(_0x11d129=0x17*-0x10f+0x17b+0x16de;_0x11d129<0xe42+0x8*0x2fa+-0x2512;_0x11d129++){_0x25465c=(_0x25465c+_0x164d6b[_0x11d129]+_0x190f74['charCodeAt'](_0x11d129%_0x190f74['length']))%(-0x8*-0xdd+0x23f9+0x29e1*-0x1),_0x4be023=_0x164d6b[_0x11d129],_0x164d6b[_0x11d129]=_0x164d6b[_0x25465c],_0x164d6b[_0x25465c]=_0x4be023;}_0x11d129=-0x59*0x48+0x17e*0x1+0x178a*0x1,_0x25465c=0x1*-0x2383+-0x137*-0x9+0x1*0x1894;for(var _0x319887=0x1ee9+-0xb4b+-0x139e;_0x319887<_0x406421['length'];_0x319887++){_0x11d129=(_0x11d129+(0x74c*-0x2+0xaef*-0x1+-0x4c*-0x56))%(0x2*-0x824+0x1cf7+-0xbaf),_0x25465c=(_0x25465c+_0x164d6b[_0x11d129])%(-0x51*-0x71+0x7b9*-0x3+-0xb96),_0x4be023=_0x164d6b[_0x11d129],_0x164d6b[_0x11d129]=_0x164d6b[_0x25465c],_0x164d6b[_0x25465c]=_0x4be023,_0x4d9a8a+=String['fromCharCode'](_0x406421['charCodeAt'](_0x319887)^_0x164d6b[(_0x164d6b[_0x11d129]+_0x164d6b[_0x25465c])%(-0x1a*0xe8+0x461*-0x4+0x2a14*0x1)]);}return _0x4d9a8a;};a0_0x231b['qSTize']=_0x32da82,a0_0x231b['henvPR']={},a0_0x231b['IeDsGd']=!![];}var _0x121a37=_0x3249f6[-0x2ba*0xd+0x314+0x205e*0x1],_0xe352e5=_0x45ff20+_0x121a37,_0x28991f=a0_0x231b['henvPR'][_0xe352e5];if(!_0x28991f){if(a0_0x231b['MgxoGT']===undefined){var _0x2dfceb=function(_0x1a6796){this['YAoQLI']=_0x1a6796,this['hmhlyS']=[0x1a52+-0x2042+0x5f1,0x26ba+0x1af*-0xc+0x2*-0x943,0x31d*0xb+0x47*-0xd+-0x1ea4],this['cCiLcP']=function(){return'newState';},this['nyYtmW']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['BqSyqP']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x2dfceb['prototype']['nRKEXn']=function(){var _0xa37446=new RegExp(this['nyYtmW']+this['BqSyqP']),_0x1f43be=_0xa37446['test'](this['cCiLcP']['toString']())?--this['hmhlyS'][-0x13d3+-0x76d+-0x1b41*-0x1]:--this['hmhlyS'][-0x16bf+0xc8e*-0x2+-0x2fdb*-0x1];return this['wXbYYK'](_0x1f43be);},_0x2dfceb['prototype']['wXbYYK']=function(_0x3f241a){if(!Boolean(~_0x3f241a))return _0x3f241a;return this['BeVQEl'](this['YAoQLI']);},_0x2dfceb['prototype']['BeVQEl']=function(_0x26155a){for(var _0x50b2de=-0x5*0x81+0x130*0x2+0x25*0x1,_0x21ed30=this['hmhlyS']['length'];_0x50b2de<_0x21ed30;_0x50b2de++){this['hmhlyS']['push'](Math['round'](Math['random']())),_0x21ed30=this['hmhlyS']['length'];}return _0x26155a(this['hmhlyS'][-0x2*0x1365+-0x2*-0x267+0x2d5*0xc]);},new _0x2dfceb(a0_0x231b)['nRKEXn'](),a0_0x231b['MgxoGT']=!![];}_0xdc96e6=a0_0x231b['qSTize'](_0xdc96e6,_0x5181d0),a0_0x231b['henvPR'][_0xe352e5]=_0xdc96e6;}else _0xdc96e6=_0x28991f;return _0xdc96e6;}var a0_0x107814=(function(){var _0x112360=!![];return function(_0x3182a2,_0x314094){var a0_0x586b20={_0x24dc8f:0x3b7,_0x430aa6:0x3c6,_0x1fc0b2:'C4lx',_0x21943d:0x3bc},_0x15f3db=_0x112360?function(){var a0_0x5899b6={_0x32ae23:0x23d};function _0x31c060(_0x82b882,_0x4cbbe6,_0x4d7a96,_0x1ad6eb,_0xeec3b3){return a0_0x231b(_0xeec3b3-a0_0x5899b6._0x32ae23,_0x1ad6eb);}if(_0x314094){var _0x388f0f=_0x314094[_0x31c060(a0_0x586b20._0x24dc8f,0x3be,a0_0x586b20._0x430aa6,a0_0x586b20._0x1fc0b2,a0_0x586b20._0x21943d)](_0x3182a2,arguments);return _0x314094=null,_0x388f0f;}}:function(){};return _0x112360=![],_0x15f3db;};}()),a0_0x2ead86=a0_0x107814(this,function(){var a0_0x160591={_0x14d16c:'!Hrq',_0x4a4e2a:0x181,_0x4777cc:0x183,_0xe9e54b:0x18b,_0x1e517f:0x1f1,_0x5c6514:0x1e0,_0x189b22:'GdeP',_0x5e1eba:0x1ef,_0x53c87a:'C4lx',_0x22e63c:0x182,_0xf0e8f3:0x18b,_0x3e4587:0x19c,_0x298dd1:0x1f2,_0x59a171:0x1dd,_0x4d00f6:'%pR9',_0x511f67:0x1e5,_0x140046:'a(aQ',_0x46ed8d:0x54c,_0x3e5c06:0x20b,_0x2a70e0:'MYaw',_0x5d81b9:0x1f6,_0xb751a5:0x1fe,_0x28818e:0x1e9,_0x1b7d06:'96]C',_0x18aaae:0x1ee,_0x369e3e:0x1f5,_0x18bcc1:0x1f7,_0x38e885:'x3FX',_0x68fec7:0x1f7,_0x2f9c6e:0x541,_0x5a5586:0x53b,_0x5e330c:0x53e,_0x4cd269:0x1e3,_0x14adeb:0x1f0},a0_0x3c3b37={_0x247735:0x3c5},a0_0x194443={_0x564136:0x304},a0_0x10165f={_0x121375:0x80},_0x59b657={};_0x59b657[_0x4092e3(-0x18f,a0_0x160591._0x14d16c,-a0_0x160591._0x4a4e2a,-a0_0x160591._0x4777cc,-a0_0x160591._0xe9e54b)]='(((.+'+_0xf45ef8(a0_0x160591._0x1e517f,a0_0x160591._0x5c6514,a0_0x160591._0x189b22,0x1e6,a0_0x160591._0x5e1eba)+'+$';function _0xf45ef8(_0x472e1b,_0x184f7a,_0x1e1550,_0x20e414,_0x1b6add){return a0_0x231b(_0x1b6add-a0_0x10165f._0x121375,_0x1e1550);}var _0x3f6af4=_0x59b657;function _0x4092e3(_0xe297dc,_0xe038ee,_0x40e96d,_0x169a32,_0x34a3f1){return a0_0x231b(_0xe297dc- -a0_0x194443._0x564136,_0xe038ee);}function _0x511d7e(_0x145344,_0x17eb0e,_0x1d37fd,_0x5f4bcc,_0x58c491){return a0_0x231b(_0x145344-a0_0x3c3b37._0x247735,_0x17eb0e);}return a0_0x2ead86['toStr'+_0x4092e3(-0x18e,a0_0x160591._0x53c87a,-a0_0x160591._0x22e63c,-a0_0x160591._0xf0e8f3,-a0_0x160591._0x3e4587)]()['searc'+'h'](_0xf45ef8(a0_0x160591._0x298dd1,a0_0x160591._0x59a171,a0_0x160591._0x4d00f6,0x1e5,a0_0x160591._0x511f67)+_0x511d7e(0x540,a0_0x160591._0x140046,a0_0x160591._0x46ed8d,0x53f,0x531)+'+$')[_0xf45ef8(0x1f2,a0_0x160591._0x3e5c06,a0_0x160591._0x2a70e0,a0_0x160591._0x5d81b9,a0_0x160591._0xb751a5)+_0xf45ef8(a0_0x160591._0x28818e,0x1f3,a0_0x160591._0x1b7d06,0x1e6,a0_0x160591._0x18aaae)]()[_0xf45ef8(a0_0x160591._0x369e3e,a0_0x160591._0x18bcc1,a0_0x160591._0x38e885,0x206,a0_0x160591._0x68fec7)+'ructo'+'r'](a0_0x2ead86)[_0x511d7e(a0_0x160591._0x2f9c6e,'3heM',a0_0x160591._0x5a5586,a0_0x160591._0x2f9c6e,a0_0x160591._0x5e330c)+'h'](_0x3f6af4[_0xf45ef8(a0_0x160591._0x28818e,a0_0x160591._0x4cd269,'7Afb',0x1e6,a0_0x160591._0x14adeb)]);});function a0_0x29af(){var _0x33d094=['vHraBCke','WPRcTCkluIy','WQvEpCoGWQBdVCkwd8kfW6Sv','W5T1WPe3WOO','aX8Jtmkg','mdK5WPxdTmk9hSouWR7dGYi','WRldPWiCEcFcHG','W5zQr3DO','W4uFW4GwgSo4Ca8qW6RdSa','W7hdSmkKW73cR8o7AmoLBSkFW6pcKmkrWQa','WQTVBmkoWP9EWOC','W7ldSCkHWPBdSSkcnCkvtG','W7RcRYddNCo4W7dcR0vPWPXXEa','kcFdN8knlaTww8khW7RdSSoOW4C','WQTtr0v9iwddQCos','gCoNWOdcRmknW4/dJCkFWPRcKv9YW5/dQW','W7aofW','W6hcSdRdHSoG','WPVdLSklWOZcOa','WRreW5iLWO1LW6yYifFdL8kEkq','pqmLWR8jW5pdPmoZWQRcLX/dQ8kM','gt/dJCkKl8kfrxxdS8kZmCop','F2PAoCkBDfKqzCochW','WOSGW4lcGmoY','cWe0','hvSjW4ef','rGvvWODcWRGakCogBCkKlKS','W4BcNmo+W6VdVSkThg9EW4bNwWm','cSkpCCk5W5ldU8oAjSoMyseBrq'];a0_0x29af=function(){return _0x33d094;};return a0_0x29af();}a0_0x2ead86();import{A as a0_0x38473d,B as a0_0x2823bf,C as a0_0x38cc2b,D as a0_0x5b9eaf,b as a0_0x51d100,c as a0_0x49ca56,d as a0_0x499d66,e as a0_0x394032,f as a0_0x27fa08,g as a0_0x4da045,h as a0_0x2b4120,i as a0_0x37b8b4,j as a0_0x48a59f,k as a0_0x4c8a1c,l as a0_0x163e43,m as a0_0x11f82a,n as a0_0x317ee0,o as a0_0x531b20,p as a0_0x3dda2d,q as a0_0xef3b6e,r as a0_0x132f17,s as a0_0x411770,t as a0_0x4cc084,u as a0_0x2401b8,v as a0_0x365fde,w as a0_0x3ba7ef,x as a0_0x1785d9,y as a0_0x381e56,z as a0_0x5b97a8}from'../chunk-XSKUGJJF.js';import{a as a0_0x36fe38,b as a0_0x25ef78,c as a0_0x1abb6a,d as a0_0x32241f,e as a0_0x57b7ae}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x36fe38 as AssetCache,a0_0x1abb6a as AssetLoader,a0_0x2401b8 as AssetSystem,a0_0x32241f as AssetTextures,a0_0x411770 as Assets,a0_0x531b20 as BaseSystem,a0_0x317ee0 as GameEngine,a0_0x394032 as GameObject,a0_0x27fa08 as GameObjectManager,a0_0x11f82a as ObjectFactory,a0_0x499d66 as Renderer,a0_0x3dda2d as RuntimeObjectRegistry,a0_0x49ca56 as Transform,a0_0x2823bf as applyScreenAnchor,a0_0xef3b6e as basePixi,a0_0x3ba7ef as clearResponsiveElements,a0_0x51d100 as createPixiBase,a0_0x48a59f as getRegisteredFontIds,a0_0x365fde as globalResponsiveMultipliers,a0_0x57b7ae as initAssetTextures,a0_0x4cc084 as initAssets,a0_0x38cc2b as layout,a0_0x163e43 as playLottieOverlay,a0_0x37b8b4 as registerFont,a0_0x25ef78 as registerType,a0_0x381e56 as resolveAnchorVec2,a0_0x4da045 as resolveFont,a0_0x2b4120 as resolveFontWeight,a0_0x5b97a8 as resolveScreenAnchorPoint,a0_0x38473d as resolveScreenRatioPoint,a0_0x5b9eaf as runInitSequence,a0_0x4c8a1c as setLottieInstance,a0_0x132f17 as spawnSceneFromConfig,a0_0x1785d9 as updateScreenState};
1
+ (function(_0x284b5d,_0x3cb51d){var a0_0x2a5f98={_0x44e6db:0x38,_0x2294aa:0x3f,_0x1336f7:0x37,_0x3c491a:0x16f,_0x4888d9:0x16a,_0x2824a8:0x15e,_0x5bf069:0x42,_0x7f1f1d:0x2d,_0x480bb2:0x3b,_0x54d91a:'xh5r',_0x4a467e:0x34,_0x5c2704:0x28,_0x3980ce:0x1f,_0x27be9b:0x2b,_0x44613e:'AH3s',_0x3882c9:0x2a,_0x5db15a:0x2f,_0x2dd20f:0x1e,_0x458902:'4u%a',_0x23c5a6:0x228,_0x1ea68c:'I&zV',_0x5a4594:0x22d,_0x573bd9:0x224,_0x2646dc:0x178,_0x2aa92e:0x181,_0x43062e:0x18e,_0x37f135:0x18d,_0x4c2128:0x237,_0x28ca97:'Rp53',_0x3d3e82:0x23c,_0x241b2d:0x243,_0x56fcd3:'u&DK',_0x2b313a:0x238,_0x5a87bb:0x2a,_0x84ae82:'uk3[',_0x51356d:0x2c},a0_0x2c0909={_0x2cb1ad:0x126},a0_0x5de9b7={_0x4b578d:0x141},a0_0x3e5a4e={_0x1f67b2:0x267};function _0x46d27c(_0xb46cd2,_0x105e18,_0x5d9474,_0x934e,_0x523774){return a0_0x2c78(_0x5d9474- -a0_0x3e5a4e._0x1f67b2,_0x105e18);}function _0x5033e2(_0x3e0d88,_0x50c967,_0x792c10,_0x23a394,_0x21bc74){return a0_0x2c78(_0x23a394-a0_0x5de9b7._0x4b578d,_0x792c10);}var _0x2eb6d0=_0x284b5d();function _0x3c7070(_0x31ba62,_0x5030d1,_0x39c17e,_0x225db7,_0x5da532){return a0_0x2c78(_0x5da532- -a0_0x2c0909._0x2cb1ad,_0x225db7);}while(!![]){try{var _0xbf7480=-parseInt(_0x3c7070(-a0_0x2a5f98._0x44e6db,-a0_0x2a5f98._0x2294aa,-a0_0x2a5f98._0x1336f7,'gpRW',-0x35))/(0x17*0x3e+-0x2327+-0xe*-0x21d)*(-parseInt(_0x46d27c(-a0_0x2a5f98._0x3c491a,'t^)W',-a0_0x2a5f98._0x4888d9,-0x177,-a0_0x2a5f98._0x2824a8))/(-0xf95+0x44e+-0x1*-0xb49))+parseInt(_0x3c7070(-a0_0x2a5f98._0x5bf069,-a0_0x2a5f98._0x7f1f1d,-a0_0x2a5f98._0x480bb2,a0_0x2a5f98._0x54d91a,-a0_0x2a5f98._0x4a467e))/(0x77b*0x5+-0x1*-0x6f5+-0x2c59)+-parseInt(_0x3c7070(-a0_0x2a5f98._0x5c2704,-a0_0x2a5f98._0x3980ce,-a0_0x2a5f98._0x27be9b,a0_0x2a5f98._0x44613e,-a0_0x2a5f98._0x3882c9))/(0xb*0x2b6+-0x2508+0x19*0x4a)+-parseInt(_0x3c7070(-a0_0x2a5f98._0x5db15a,-a0_0x2a5f98._0x2dd20f,-0x32,a0_0x2a5f98._0x458902,-0x26))/(0x24a4+0x55*0x5d+-0x60*0xb4)+parseInt(_0x5033e2(a0_0x2a5f98._0x23c5a6,0x220,a0_0x2a5f98._0x1ea68c,a0_0x2a5f98._0x5a4594,a0_0x2a5f98._0x573bd9))/(0x15b*0x3+0x4bb+-0x8c6*0x1)*(parseInt(_0x46d27c(-a0_0x2a5f98._0x2646dc,'Fqr4',-a0_0x2a5f98._0x2aa92e,-a0_0x2a5f98._0x43062e,-a0_0x2a5f98._0x37f135))/(-0x1f70+0xda1*0x1+0x11d6))+parseInt(_0x5033e2(a0_0x2a5f98._0x4c2128,a0_0x2a5f98._0x5a4594,a0_0x2a5f98._0x28ca97,a0_0x2a5f98._0x3d3e82,a0_0x2a5f98._0x241b2d))/(-0x5da+-0x47*-0x22+-0x38c)+-parseInt(_0x5033e2(0x23c,a0_0x2a5f98._0x241b2d,a0_0x2a5f98._0x56fcd3,a0_0x2a5f98._0x2b313a,a0_0x2a5f98._0x3d3e82))/(-0x1f4b*0x1+-0xadf+-0x115*-0x27)*(-parseInt(_0x3c7070(-a0_0x2a5f98._0x5a87bb,-0x38,-0x34,a0_0x2a5f98._0x84ae82,-a0_0x2a5f98._0x51356d))/(-0x37+0x2*0x8f+-0xdd));if(_0xbf7480===_0x3cb51d)break;else _0x2eb6d0['push'](_0x2eb6d0['shift']());}catch(_0x3aad16){_0x2eb6d0['push'](_0x2eb6d0['shift']());}}}(a0_0x5a69,0x597f+-0x2477e+0x39d84));var a0_0x164435=(function(){var a0_0x4da088={_0x9348da:'gpRW',_0x41961e:0x11,_0x42c240:0x23,_0x165274:0x1a,_0x439118:0x20},_0x2a1090=!![];return function(_0x3c4c4a,_0x3186c2){var a0_0x23a6c5={_0x914384:0xd6},_0x343898=_0x2a1090?function(){function _0x25d4a7(_0x3cad8f,_0x505ccb,_0x4181fc,_0x458266,_0x145997){return a0_0x2c78(_0x458266- -a0_0x23a6c5._0x914384,_0x3cad8f);}if(_0x3186c2){var _0x4edeeb=_0x3186c2[_0x25d4a7(a0_0x4da088._0x9348da,a0_0x4da088._0x41961e,a0_0x4da088._0x42c240,a0_0x4da088._0x165274,a0_0x4da088._0x439118)](_0x3c4c4a,arguments);return _0x3186c2=null,_0x4edeeb;}}:function(){};return _0x2a1090=![],_0x343898;};}()),a0_0x14faf0=a0_0x164435(this,function(){var a0_0x4f17c8={_0x2b0b97:0x194,_0x29f756:'Vf[A',_0x31f160:0x1a4,_0x176933:0x1a2,_0x140d0c:0x1b1,_0x112bea:'Vf[A',_0x464128:0x18e,_0xb1937f:0x194,_0x47770a:0x191,_0x9d5d97:0xbe,_0xc30488:0xc6,_0x3623b8:0x18f,_0x104262:0x196,_0x158c9d:0x19c,_0xeb1aad:0x19c,_0x3a29ea:0xbf,_0x2819bb:0xd4,_0x1e5c65:'kXB%',_0x2b720b:0xcd,_0x1fe80d:0x2aa,_0x329da5:'FehX',_0x2d1565:0x2a8,_0x1f4f87:0x2bb,_0x2b0586:0xce,_0x3d7c98:0xc1,_0x5d2ce8:0xbd,_0x3ac734:'FW01',_0x1f6943:'oj*v',_0x343b88:0x2a7,_0x416e63:0x2b0,_0x481d9d:0x17a,_0x5ad6cf:0x18d,_0x53dafb:0x299,_0x268a98:0x2b8,_0x40adad:0x2ab,_0x1e4dcd:'W72U',_0x23e45d:0x2a1,_0xd4924d:0x298,_0x3d9ba6:0x2ac,_0x324219:0x2a8,_0xd20a38:0x2c8,_0x3e8315:0x2be},a0_0x5d6ab8={_0x4207dc:0x3a0},a0_0x285c49={_0x7be6b0:0x1ba};function _0x47fafb(_0x52cadd,_0x4b4503,_0x2bfffd,_0x1fd4f7,_0x1c0d6e){return a0_0x2c78(_0x1c0d6e- -a0_0x285c49._0x7be6b0,_0x1fd4f7);}var _0x44ea9f={};_0x44ea9f[_0x3a9117(a0_0x4f17c8._0x2b0b97,a0_0x4f17c8._0x29f756,a0_0x4f17c8._0x31f160,a0_0x4f17c8._0x176933,a0_0x4f17c8._0x140d0c)]=_0x3a9117(0x182,a0_0x4f17c8._0x112bea,a0_0x4f17c8._0x464128,a0_0x4f17c8._0xb1937f,a0_0x4f17c8._0x47770a)+_0x47fafb(-a0_0x4f17c8._0x9d5d97,-0xce,-0xcf,'ezN]',-a0_0x4f17c8._0xc30488)+'+$';function _0x3c879c(_0x8c235b,_0x2b4149,_0x3f4074,_0x1ed09a,_0x4bb3dd){return a0_0x2c78(_0x3f4074- -a0_0x5d6ab8._0x4207dc,_0x2b4149);}function _0x3a9117(_0x18f5b1,_0x206d66,_0x624345,_0x20e61b,_0x21fc80){return a0_0x2c78(_0x624345-0xa3,_0x206d66);}var _0x5970c9=_0x44ea9f;return a0_0x14faf0[_0x3a9117(a0_0x4f17c8._0x3623b8,'I&zV',a0_0x4f17c8._0x104262,a0_0x4f17c8._0x158c9d,a0_0x4f17c8._0xeb1aad)+'ing']()[_0x47fafb(-a0_0x4f17c8._0x3a29ea,-0xcc,-a0_0x4f17c8._0x2819bb,a0_0x4f17c8._0x1e5c65,-a0_0x4f17c8._0x2b720b)+'h'](_0x5970c9[_0x3c879c(-a0_0x4f17c8._0x1fe80d,a0_0x4f17c8._0x329da5,-0x2b7,-a0_0x4f17c8._0x2d1565,-a0_0x4f17c8._0x1f4f87)])[_0x47fafb(-a0_0x4f17c8._0x2b0586,-a0_0x4f17c8._0x3d7c98,-a0_0x4f17c8._0x5d2ce8,a0_0x4f17c8._0x3ac734,-0xc5)+_0x3c879c(-0x2a2,a0_0x4f17c8._0x1f6943,-a0_0x4f17c8._0x343b88,-0x2a7,-a0_0x4f17c8._0x416e63)]()[_0x3a9117(a0_0x4f17c8._0x481d9d,'Vf[A',0x188,a0_0x4f17c8._0x5ad6cf,0x179)+_0x3c879c(-a0_0x4f17c8._0x53dafb,'o1Ps',-0x2a8,-0x2ae,-a0_0x4f17c8._0x268a98)+'r'](a0_0x14faf0)['searc'+'h'](_0x3c879c(-a0_0x4f17c8._0x40adad,a0_0x4f17c8._0x1e4dcd,-a0_0x4f17c8._0x23e45d,-a0_0x4f17c8._0xd4924d,-a0_0x4f17c8._0x3d9ba6)+_0x3c879c(-a0_0x4f17c8._0x324219,a0_0x4f17c8._0x1e5c65,-0x2b8,-a0_0x4f17c8._0xd20a38,-a0_0x4f17c8._0x3e8315)+'+$');});a0_0x14faf0();import{A as a0_0x3343c2,B as a0_0x42e7a7,C as a0_0x435083,D as a0_0x22ee86,b as a0_0x4c9f00,c as a0_0x47f37f,d as a0_0x5a27cb,e as a0_0x7811fd,f as a0_0x1fe522,g as a0_0x2b5072,h as a0_0x94a3ea,i as a0_0x3d4c8e,j as a0_0x2f0332,k as a0_0x3f45d8,l as a0_0x2493f9,m as a0_0x32da84,n as a0_0x4bf946,o as a0_0x2ef672,p as a0_0x321350,q as a0_0x3253f0,r as a0_0x112f39,s as a0_0x36da1e,t as a0_0x15de21,u as a0_0x5ab870,v as a0_0x969405,w as a0_0x3516dd,x as a0_0x2dedd7,y as a0_0x516169,z as a0_0x375950}from'../chunk-LTJ4LCJ7.js';import{a as a0_0x342f45,b as a0_0xadfd12,c as a0_0x3887a5,d as a0_0x5d8609,e as a0_0x3c28ea}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';function a0_0x5a69(){var _0x3bc849=['WP7dPH4nFa','WOuXfr1nW5rgW5NdRSku','kCkcCr/dLGxdJSozWPeJhmkfWO4','WOrXW51OEq','W5a5WPuZt8k7BmkjggS','i3VdM3RcQSkQWPJcIW0ZW7Gj','WR9mdXjo','yxFdKg0g','pCoRWQSMoW','W4NcJmkjW4RdLdNcV3i','WQitW4DwW4bwWPVcGmkGW4C','f8oehe45','W7RcUqm','xCkhW6ZcV8kUWPCVWQC','nSkZW6ddGcnIW6ddRwRcJCoqW5ldGq','W7n2t8kdmeddJrujWQLnW7u','DaL9o8kAWRldKSki','q8kLWRC+ddVcGKK','yblcNtvM','W7f4qmoAW7/cVHilEmoxzvhcGa','W6hcUKBdM8kb','ySoXWOpdKJy2CCoHwCkMWRSa','W51EurDwW65rfmk/eCkYWOa','W5tcV3/dI8kL','ySkKcmoeWPzJWPXEWOdcUt4i','W7XQWQZdOCoYmJS','W4tcQfzunG','W4pdOrJdSmoc','WQFdVmkOWRKSfSoNDCkQhq','WP/dUdNcLSo6','W71kjcbqE8oZ'];a0_0x5a69=function(){return _0x3bc849;};return a0_0x5a69();}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';function a0_0x2c78(_0x356ddb,_0x407f74){_0x356ddb=_0x356ddb-(0x11a4+0x1b45+-0x2c05);var _0x5c6881=a0_0x5a69();var _0x5560e7=_0x5c6881[_0x356ddb];if(a0_0x2c78['ldKQAO']===undefined){var _0x1158e3=function(_0x34a6f4){var _0x357620='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x5d2905='',_0x4a5859='',_0xc1cecb=_0x5d2905+_0x1158e3;for(var _0x34866a=0x2301+-0x2a3+0x2*-0x102f,_0x67d4ea,_0x951ec6,_0x405268=0x1f6d*-0x1+0x21a+0x1*0x1d53;_0x951ec6=_0x34a6f4['charAt'](_0x405268++);~_0x951ec6&&(_0x67d4ea=_0x34866a%(-0x1*0x1231+0x2072+0x2d9*-0x5)?_0x67d4ea*(0x4*0x57a+-0x3ab*-0xa+-0x3a56)+_0x951ec6:_0x951ec6,_0x34866a++%(-0x10a+-0x1*-0x6a1+-0x593))?_0x5d2905+=_0xc1cecb['charCodeAt'](_0x405268+(0x2*0x51a+0x6c4+-0x10ee))-(-0xb1*-0x2f+-0x26a8+-0x45*-0x17)!==0x2e3*0x1+0x1751+-0x2b*0x9c?String['fromCharCode'](-0x2c0+0x11*0x115+-0xea6&_0x67d4ea>>(-(0x1*0x19dd+-0x13e3+-0x5f8)*_0x34866a&0x11bb+0x1856+-0x2a0b)):_0x34866a:-0x1b*-0x31+0x8de+0x1*-0xe09){_0x951ec6=_0x357620['indexOf'](_0x951ec6);}for(var _0x2d3458=0x10c7*0x2+0x1587+-0x1*0x3715,_0x58ffe7=_0x5d2905['length'];_0x2d3458<_0x58ffe7;_0x2d3458++){_0x4a5859+='%'+('00'+_0x5d2905['charCodeAt'](_0x2d3458)['toString'](0x1*-0x17d9+0x2494+-0xcab))['slice'](-(-0x20c7*-0x1+0xbf*-0x22+0x1*-0x767));}return decodeURIComponent(_0x4a5859);};var _0x1a4256=function(_0x5b0bf3,_0x2d064c){var _0x288bc7=[],_0x3b322e=0xfbf+-0x55c*-0x3+-0x1fd3*0x1,_0x19be7c,_0x35d2ac='';_0x5b0bf3=_0x1158e3(_0x5b0bf3);var _0x13f321;for(_0x13f321=-0xcf1+-0x1*0x24db+-0x2*-0x18e6;_0x13f321<0x298+0x1*0x172d+-0x18c5;_0x13f321++){_0x288bc7[_0x13f321]=_0x13f321;}for(_0x13f321=-0x1f5*-0x3+-0x1*0x25f4+0x1*0x2015;_0x13f321<0x3af*0x1+-0x6*0x507+0x1*0x1b7b;_0x13f321++){_0x3b322e=(_0x3b322e+_0x288bc7[_0x13f321]+_0x2d064c['charCodeAt'](_0x13f321%_0x2d064c['length']))%(0x3b7*0x1+0x198c+0x5*-0x5a7),_0x19be7c=_0x288bc7[_0x13f321],_0x288bc7[_0x13f321]=_0x288bc7[_0x3b322e],_0x288bc7[_0x3b322e]=_0x19be7c;}_0x13f321=0x1f4f*-0x1+-0x725*0x5+0x4308,_0x3b322e=0x4d*-0x7f+-0x24a5+-0xef8*-0x5;for(var _0x12e7bb=-0x8b*-0x29+-0x1a8+0x19*-0xd3;_0x12e7bb<_0x5b0bf3['length'];_0x12e7bb++){_0x13f321=(_0x13f321+(0x9*-0x269+-0x1f9f+0x3551))%(-0x207f+0x3*-0x2c7+0x29d4),_0x3b322e=(_0x3b322e+_0x288bc7[_0x13f321])%(-0x9*0x67+-0x118d+0x162c),_0x19be7c=_0x288bc7[_0x13f321],_0x288bc7[_0x13f321]=_0x288bc7[_0x3b322e],_0x288bc7[_0x3b322e]=_0x19be7c,_0x35d2ac+=String['fromCharCode'](_0x5b0bf3['charCodeAt'](_0x12e7bb)^_0x288bc7[(_0x288bc7[_0x13f321]+_0x288bc7[_0x3b322e])%(-0x1*0x1c5d+-0x11a5*0x2+0x40a7)]);}return _0x35d2ac;};a0_0x2c78['odxQHK']=_0x1a4256,a0_0x2c78['meBfqk']={},a0_0x2c78['ldKQAO']=!![];}var _0x469992=_0x5c6881[0x7a1+-0x166f+-0x2f6*-0x5],_0x45f4a9=_0x356ddb+_0x469992,_0x4f69fb=a0_0x2c78['meBfqk'][_0x45f4a9];if(!_0x4f69fb){if(a0_0x2c78['oEQFJk']===undefined){var _0x97ea97=function(_0x226b03){this['KpbFhc']=_0x226b03,this['qPJHuI']=[0xa45+-0x12aa*0x1+0x866,0xa36*0x3+0xcb9*0x2+-0x61*0x94,-0x2*0x36d+0x1556+-0x2*0x73e],this['svQtMo']=function(){return'newState';},this['iwkHyZ']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['wfvYjX']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x97ea97['prototype']['WNZISd']=function(){var _0x428a4a=new RegExp(this['iwkHyZ']+this['wfvYjX']),_0x14a3d0=_0x428a4a['test'](this['svQtMo']['toString']())?--this['qPJHuI'][-0x2172+0x17*0x3e+0x1be1]:--this['qPJHuI'][0x1c49+-0xa9*0x1b+-0xa76];return this['SyTcHE'](_0x14a3d0);},_0x97ea97['prototype']['SyTcHE']=function(_0x27c9de){if(!Boolean(~_0x27c9de))return _0x27c9de;return this['YBXVrc'](this['KpbFhc']);},_0x97ea97['prototype']['YBXVrc']=function(_0x44bed4){for(var _0x1258a2=0x2*0x122c+0x8*-0x3+-0x1*0x2440,_0x2f6d61=this['qPJHuI']['length'];_0x1258a2<_0x2f6d61;_0x1258a2++){this['qPJHuI']['push'](Math['round'](Math['random']())),_0x2f6d61=this['qPJHuI']['length'];}return _0x44bed4(this['qPJHuI'][-0x8e+0xb*0x2b6+-0x1d44]);},new _0x97ea97(a0_0x2c78)['WNZISd'](),a0_0x2c78['oEQFJk']=!![];}_0x5560e7=a0_0x2c78['odxQHK'](_0x5560e7,_0x407f74),a0_0x2c78['meBfqk'][_0x45f4a9]=_0x5560e7;}else _0x5560e7=_0x4f69fb;return _0x5560e7;}export{a0_0x342f45 as AssetCache,a0_0x3887a5 as AssetLoader,a0_0x5ab870 as AssetSystem,a0_0x5d8609 as AssetTextures,a0_0x36da1e as Assets,a0_0x2ef672 as BaseSystem,a0_0x4bf946 as GameEngine,a0_0x7811fd as GameObject,a0_0x1fe522 as GameObjectManager,a0_0x32da84 as ObjectFactory,a0_0x5a27cb as Renderer,a0_0x321350 as RuntimeObjectRegistry,a0_0x47f37f as Transform,a0_0x42e7a7 as applyScreenAnchor,a0_0x3253f0 as basePixi,a0_0x3516dd as clearResponsiveElements,a0_0x4c9f00 as createPixiBase,a0_0x2f0332 as getRegisteredFontIds,a0_0x969405 as globalResponsiveMultipliers,a0_0x3c28ea as initAssetTextures,a0_0x15de21 as initAssets,a0_0x435083 as layout,a0_0x2493f9 as playLottieOverlay,a0_0x3d4c8e as registerFont,a0_0xadfd12 as registerType,a0_0x516169 as resolveAnchorVec2,a0_0x2b5072 as resolveFont,a0_0x94a3ea as resolveFontWeight,a0_0x375950 as resolveScreenAnchorPoint,a0_0x3343c2 as resolveScreenRatioPoint,a0_0x22ee86 as runInitSequence,a0_0x3f45d8 as setLottieInstance,a0_0x112f39 as spawnSceneFromConfig,a0_0x2dedd7 as updateScreenState};
@@ -43,7 +43,7 @@
43
43
  <button class="debug-btn primary" data-modal-apply>Apply</button>
44
44
  </div>
45
45
  </div>
46
- `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};ra(Ko,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Sr(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.43",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;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&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&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 Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await Ae.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Hr=new cn,zr=new Proxy(Hr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Br(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Gr(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Gr()}var Ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Ur(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function qr(){return Ze}var Wr={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 Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Wr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}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,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ur,window.getDebugConfig=qr,window.copyConfig=io,window.applyConfig=Je,window.applyConfigForRatio=ao,window.positionAtBottom=qa,window.positionAtTop=Kr,window.positionAtCenter=Xr,window.positionAtLeft=Jr,window.positionAtRight=Zr,window.positionAtBottomLeft=Qr,window.positionAtBottomRight=eo,window.positionAtTopLeft=to,window.positionAtTopRight=no,window.applyPositionContract=Yr,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 Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Vr(t,e){return t*e}function Yr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R: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,r=!1){let o=Vr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Br(t,qa,e,n,i,a,s)}function Kr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Xr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Jr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Zr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function io(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function ao(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Fc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Bc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Gc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var Uc=[...Ka];var go=Ka[0];fe();var vo=ae(require("jszip"),1);function mo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function bo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function yo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await mo(a),r=await yo(s),o=bo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var wo=require("pixi.js");fe();function Lo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Mo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Po(t){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var Ko={};ra(Ko,{AspectClass:()=>In,GameObject:()=>ot,GameObjectManager:()=>$t,Renderer:()=>rt,ResponsiveUISystem:()=>Ge,Transform:()=>st,animateHandClick:()=>xs,animatePanelEntrance:()=>vs,createBrushTexture:()=>_s,createEndGamePanel:()=>ys,createHandTutorial:()=>ws,createThreeBase:()=>fs,createTutorialLabel:()=>Es,getAspectClass:()=>Dt,getRegisteredFontIds:()=>bs,loadAsset:()=>$n,loadCharacterFrames:()=>Ts,registerFont:()=>ms,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Ss});module.exports=xr(Ko);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var P=null,W=[],ke=null;function da(t){P=t,W=[],ke!==null&&(clearTimeout(ke),ke=null)}function pa(){var t,e,n;return{endpoint:(P==null?void 0:P.endpoint)||"",transport:(P==null?void 0:P.transport)||"beacon",batchSize:(t=P==null?void 0:P.batchSize)!=null?t:10,flushIntervalMs:(e=P==null?void 0:P.flushIntervalMs)!=null?e:300,maxQueue:(n=P==null?void 0:P.maxQueue)!=null?n:200,debug:!!(P!=null&&P.debug)}}async function la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}ke===null&&(ke=window.setTimeout(()=>{ke=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function wr(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Er(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Sr(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Sr(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,o(),t.size>0&&i()})},a=p=>{var g;t.add(p);let c=(g=e.get(p.target))!=null?g:new Set;c.add(p),e.set(p.target,c),i()},s=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},r=p=>{p.killed||(p.killed=!0,s(p))},o=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=wr(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:Er(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.45",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,Cr=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,_a=G++,La=G++,Ma=G++,T=Cr;function Pa(){return T===va}function ka(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===_a}function Zt(){return T===La}function Qt(){return T===Ma}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=_a)}catch{}else e==="vungle"?T=La:(t==="nucleo"||e==="nucleo")&&(T=Ma)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Tr=require("pixi.js");var en=require("pixi.js");var _r=null;function tn(t){_r=t}vt();nn();var Ye=require("pixi.js");vt();var Or=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",on=Or;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&&(on=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${on}`))}}catch{}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${on}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Se.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Ye.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){o=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=o==null?void 0:o.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;!n||!e||(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor&&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 Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Dr=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Dr);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await Ae.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Hr=new cn,zr=new Proxy(Hr,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Br(t,e,n,i,a,s,r){pn.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Gr(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),Gr()}var Ze={layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}};function Ur(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function qr(){return Ze}var Wr={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 Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Wr[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),s=(u=i.inset)!=null?u:{},r=(b=i.padding)!=null?b:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((x=s.right)!=null?x:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((y=s.bottom)!=null?y:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},s=(x=i.padding)!=null?x:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((y=a.right)!=null?y:0)+s.x,l=((f=a.top)!=null?f:0)+s.y,d=((m=a.bottom)!=null?m:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*b}}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,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Ur,window.getDebugConfig=qr,window.copyConfig=io,window.applyConfig=Je,window.applyConfigForRatio=ao,window.positionAtBottom=qa,window.positionAtTop=Kr,window.positionAtCenter=Xr,window.positionAtLeft=Jr,window.positionAtRight=Zr,window.positionAtBottomLeft=Qr,window.positionAtBottomRight=eo,window.positionAtTopLeft=to,window.positionAtTopRight=no,window.applyPositionContract=Yr,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 Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Lt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Vr(t,e){return t*e}function Yr(t,e,n,i){var r,o,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,M,R;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),s=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=Lt(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),s=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),s=U(n,(R=(M=i.offset)==null?void 0:M.y)!=null?R: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,r=!1){let o=Vr(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=s?a*le.scaleFactor:a;de(t,d),r&&!pn.find(p=>p.element===t)&&Br(t,qa,e,n,i,a,s)}function Kr(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Xr(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function Jr(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function Zr(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function Qr(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Tt(n,i)),de(t,s)}function eo(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Tt(n,i)),de(t,s)}function to(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Ct(n,i)),de(t,s)}function no(t,e,n,i=.05,a=.05,s=1){ce(t,Lt(e,a),Ct(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function io(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function ao(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function k(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Fc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:k(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:k(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:k(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:k(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:k(360,780)}],Bc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:k(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:k(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:k(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:k(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:k(412,915)}],Gc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:k(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:k(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:k(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:k(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:k(800,1280)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:k(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:k(768,1024),mraidScale:.7}];var Uc=[...Ka];var go=Ka[0];fe();var vo=ae(require("jszip"),1);function mo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function bo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function yo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await mo(a),r=await yo(s),o=bo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Mt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],b=r[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(r=(s=(a=b.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Pt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),s=[{text:e}];n.length>0&&n.forEach((o,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),s.push({inlineData:{mimeType:o.mimeType,data:o.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let r=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:s});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!r.candidates||!r.candidates[0]||!r.candidates[0].content||!r.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let o of r.candidates[0].content.parts)if(o.text)console.log(o.text);else if(o.inlineData){let l=o.inlineData.data,d=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${d};base64,${l}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var xo=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var wo=require("pixi.js");fe();function Lo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Mo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Po(t){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering:
@@ -163,6 +163,27 @@
163
163
  background: var(--ui-bg);
164
164
  }
165
165
 
166
+ /* Scene Tools Container - Dynamically positioned relative to game preview */
167
+ #scene-tools-container {
168
+ position: absolute;
169
+ /* left, top, and transform will be set dynamically by JavaScript */
170
+ z-index: 60;
171
+ pointer-events: auto;
172
+ transition: left var(--ui-duration-fast) var(--ui-ease),
173
+ top var(--ui-duration-fast) var(--ui-ease);
174
+ }
175
+
176
+ /* Nudge Panel Container - Dynamically positioned relative to game preview */
177
+ #nudge-panel-container {
178
+ position: absolute;
179
+ /* left, top, and transform will be set dynamically by JavaScript */
180
+ z-index: 60;
181
+ pointer-events: auto;
182
+ transition: left var(--ui-duration-fast) var(--ui-ease),
183
+ top var(--ui-duration-fast) var(--ui-ease);
184
+ }
185
+
186
+
166
187
  .preview-container {
167
188
  width: 100%;
168
189
  height: 100%;
@@ -4643,12 +4664,10 @@
4643
4664
 
4644
4665
 
4645
4666
  /* ========== 13-nudge-panel.css ========== */
4646
- /* Nudge Panel - Floating on left side */
4667
+ /* Nudge Panel - Dynamically positioned relative to game preview */
4647
4668
  .nudge-panel {
4648
4669
  position: absolute;
4649
- left: 16px;
4650
- top: 50%;
4651
- transform: translateY(-50%);
4670
+ /* left, top, and transform will be set dynamically by JavaScript */
4652
4671
  width: 180px;
4653
4672
  background: var(--ui-surface);
4654
4673
  border: 1px solid var(--ui-border);
@@ -4656,7 +4675,9 @@
4656
4675
  box-shadow: var(--ui-shadow);
4657
4676
  z-index: 60;
4658
4677
  pointer-events: auto;
4659
- transition: opacity var(--ui-duration-fast) var(--ui-ease);
4678
+ transition: left var(--ui-duration-fast) var(--ui-ease),
4679
+ top var(--ui-duration-fast) var(--ui-ease),
4680
+ opacity var(--ui-duration-fast) var(--ui-ease);
4660
4681
  }
4661
4682
 
4662
4683
  .nudge-panel.hidden {