handler-playable-sdk 1.0.21 → 1.0.23

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.
Files changed (39) hide show
  1. package/dist/{chunk-KHEZYZMO.js → chunk-EFDKXXPM.js} +27 -27
  2. package/dist/cli/brand-dna.mjs +1 -1
  3. package/dist/cli/canva-import.mjs +1 -1
  4. package/dist/cli/cleanup-assets.mjs +1 -1
  5. package/dist/cli/fix-scales.mjs +1 -1
  6. package/dist/cli/index.js +1 -1
  7. package/dist/cli/screen-helper.mjs +1 -1
  8. package/dist/cli/setup-library.mjs +1 -1
  9. package/dist/cli/student-helper/add-logic.mjs +1 -1
  10. package/dist/cli/student-helper/add-object.mjs +1 -1
  11. package/dist/cli/student-helper/arg-parsing.mjs +1 -1
  12. package/dist/cli/student-helper/asset-registry.mjs +1 -1
  13. package/dist/cli/student-helper/bullet-system.mjs +1 -1
  14. package/dist/cli/student-helper/collectable-system.mjs +1 -1
  15. package/dist/cli/student-helper/constants.mjs +1 -1
  16. package/dist/cli/student-helper/drag-snap-couples.mjs +1 -1
  17. package/dist/cli/student-helper/endgame-screen.mjs +1 -1
  18. package/dist/cli/student-helper/fs-io.mjs +1 -1
  19. package/dist/cli/student-helper/logic-defaults.mjs +1 -1
  20. package/dist/cli/student-helper/print-help.mjs +1 -1
  21. package/dist/cli/student-helper/prompts.mjs +1 -1
  22. package/dist/cli/student-helper/scratch-card.mjs +1 -1
  23. package/dist/cli/student-helper/screen-utils.mjs +1 -1
  24. package/dist/cli/student-helper/snippets.mjs +1 -1
  25. package/dist/cli/student-helper/start-screen.mjs +1 -1
  26. package/dist/cli/student-helper/swerve-collect.mjs +1 -1
  27. package/dist/cli/student-helper/tap-destroy.mjs +1 -1
  28. package/dist/cli/student-helper/template-packs.mjs +1 -1
  29. package/dist/cli/student-helper.mjs +1 -1
  30. package/dist/cli/sync-screens.mjs +1 -1
  31. package/dist/cli/validate-assets.mjs +1 -1
  32. package/dist/cli/validate.mjs +1 -1
  33. package/dist/index.cjs +30 -30
  34. package/dist/index.js +1 -1
  35. package/dist/pixi/index.cjs +1 -1
  36. package/dist/pixi/index.js +1 -1
  37. package/dist/three/index.cjs +1 -1
  38. package/dist/three/index.js +1 -1
  39. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{E as J,F as K,G as L,H as M,I as N,J as O,K as P,L as Q,M as R,N as S,O as T,P as U,Q as V,R as W,S as X,T as Y,U as Z,a}from"./chunk-KHEZYZMO.js";import"./chunk-I5OOVR5U.js";import{a as u,b as v,c as w,d as x,e as y,f as z,g as A,h as B,i as C,j as D,k as E,l as F,m as G,n as H,o as I}from"./chunk-PW2FGMCO.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,p as q,q as r,r as s,s as t}from"./chunk-HVKF2KYL.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{U as COLORS,F as ConfigWatcher,O as DebugPanel,E as DefaultReloadStrategy,Y as Handler,X as PlayableLoadingScreen,P as PreviewShell,V as STROKE_WIDTH,W as THEME,d as applyConfigOverride,e as applyConfigOverrides,r as applyConfigsToDisk,B as applyDefaults,a as baseLottie,T as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,Q as createPreviewShell,o as deepClone,Z as default,L as defaultPreset,K as deviceGroups,J as devicePresets,G as diffConfigs,p as exportConfigsAsJSON,i as getConfigOverrides,q as getConfigStateSummary,b as getOverrideMode,M as getPresetById,N as getPresetsByCategory,w as loadAllObjectConfigs,u as loadComponentSchemas,x as loadEngineConfig,y as loadGamePromptConfig,C as loadObjectCentricConfig,v as loadObjectConfig,z as loadSceneConfig,l as redoLastConfigChange,H as rehydrateObject,h as removeConfigOverride,s as resetToApplied,t as resetToOriginal,S as setBootstrapDependencies,c as setOverrideMode,I as setupHotReload,R as setupLiveEditBridge,D as toLegacyFormat,m as trackObjectCreation,n as trackObjectDeletion,k as undoLastConfigChange,A as validateObjectConfig};
1
+ import{E as J,F as K,G as L,H as M,I as N,J as O,K as P,L as Q,M as R,N as S,O as T,P as U,Q as V,R as W,S as X,T as Y,U as Z,a}from"./chunk-EFDKXXPM.js";import"./chunk-I5OOVR5U.js";import{a as u,b as v,c as w,d as x,e as y,f as z,g as A,h as B,i as C,j as D,k as E,l as F,m as G,n as H,o as I}from"./chunk-PW2FGMCO.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,p as q,q as r,r as s,s as t}from"./chunk-HVKF2KYL.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{U as COLORS,F as ConfigWatcher,O as DebugPanel,E as DefaultReloadStrategy,Y as Handler,X as PlayableLoadingScreen,P as PreviewShell,V as STROKE_WIDTH,W as THEME,d as applyConfigOverride,e as applyConfigOverrides,r as applyConfigsToDisk,B as applyDefaults,a as baseLottie,T as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,Q as createPreviewShell,o as deepClone,Z as default,L as defaultPreset,K as deviceGroups,J as devicePresets,G as diffConfigs,p as exportConfigsAsJSON,i as getConfigOverrides,q as getConfigStateSummary,b as getOverrideMode,M as getPresetById,N as getPresetsByCategory,w as loadAllObjectConfigs,u as loadComponentSchemas,x as loadEngineConfig,y as loadGamePromptConfig,C as loadObjectCentricConfig,v as loadObjectConfig,z as loadSceneConfig,l as redoLastConfigChange,H as rehydrateObject,h as removeConfigOverride,s as resetToApplied,t as resetToOriginal,S as setBootstrapDependencies,c as setOverrideMode,I as setupHotReload,R as setupLiveEditBridge,D as toLegacyFormat,m as trackObjectCreation,n as trackObjectDeletion,k as undoLastConfigChange,A 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=n}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 l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.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 t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,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 rr={};cn(rr,{AssetCache:()=>ie,AssetLoader:()=>Pe,AssetSystem:()=>ri,AssetTextures:()=>Ie,Assets:()=>_a,BaseSystem:()=>st,GameEngine:()=>si,GameObject:()=>It,GameObjectManager:()=>nt,ObjectFactory:()=>be,Renderer:()=>Pt,RuntimeObjectRegistry:()=>rt,Transform:()=>kt,applyScreenAnchor:()=>Ut,basePixi:()=>Pa,clearResponsiveElements:()=>sa,createPixiBase:()=>ni,getRegisteredFontIds:()=>Aa,globalResponsiveMultipliers:()=>Ke,initAssetTextures:()=>Ft,initAssets:()=>Oa,layout:()=>oa,playLottieOverlay:()=>Ta,registerFont:()=>Ca,registerType:()=>Nt,resolveAnchorVec2:()=>Me,resolveFont:()=>Sa,resolveFontWeight:()=>Ea,resolveScreenAnchorPoint:()=>He,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>Ra,setLottieInstance:()=>Jt,spawnSceneFromConfig:()=>Ma,updateScreenState:()=>Gt});module.exports=Ba(rr);var xa=require("pixi.js");var Te={};function _t(i,e,t=!1){Te[i]||(Te[i]=[]),Te[i].push({fn:e,once:t})}function di(i,e){if(Te[i]){if(!e){delete Te[i];return}Te[i]=Te[i].filter(t=>t.fn!==e)}}function Ot(i,...e){let t=Te[i];if(t)for(let n of[...t])n.fn(...e),n.once&&di(i,n.fn)}function Z(i,e){_t(i,e,!0)}var D=null,te=[],qe=null;function gn(i){D=i,te=[],qe!==null&&(clearTimeout(qe),qe=null)}function hn(){var i,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(i=D==null?void 0:D.batchSize)!=null?i: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 pn(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(s){n&&console.warn("[handler.telemetry] fetch failed",s)}}function pi(i,e){let t=hn();if(e&&t.endpoint){if(te.push(i),te.length>t.maxQueue&&(te=te.slice(te.length-t.maxQueue)),te.length>=t.batchSize){un();return}qe===null&&(qe=window.setTimeout(()=>{qe=null,un()},t.flushIntervalMs))}}async function un(){let i=hn();if(!i.endpoint||te.length===0)return;let e=te.splice(0,i.batchSize);await pn(i.endpoint,{events:e},i.transport,i.debug),te.length>0&&await pn(i.endpoint,{events:te.splice(0,i.batchSize)},i.transport,i.debug)}function fn(i){return Math.max(0,Math.min(1,i))}function Ga(i){let e=String(i!=null?i:"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.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function bt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ua(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function mn(i,e,t){try{i[e]=t}catch{}}function qa(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function bn(i,e){let t=i==null?void 0:i.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 yn(i,e){let t=qa(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function vn(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=u=>{var p;i.add(u);let d=(p=e.get(u.target))!=null?p:new Set;d.add(u),e.set(u.target,d),n()},s=u=>{i.delete(u);let d=e.get(u.target);d&&(d.delete(u),d.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var d,p;let u=bt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let f=g.durationMs>0?m/g.durationMs:1,C=fn(f),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let y=f-h;C=fn(y)}let v=g.ease(C);g.yoyo&&h%2===1&&(v=1-v);for(let y of g.props)mn(g.target,y.key,y.from+(y.to-y.from)*v);g.scaleFrom&&g.scaleTo&&bn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(f>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var y;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),m=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Ga(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let I of Object.keys(d)){if(h.has(I))continue;let _=d[I];typeof _=="number"&&v.push({key:I,from:Ua(u,I),to:_})}let w=yn(u,d);return{target:u,startMs:bt(),delayMs:m,durationMs:g,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:C,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(u,d){let p=c(u,d);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=bt())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:bt(),m=bt()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,d,p){return l.set(u,d),l.to(u,p)},set(u,d){if(!u||!d)return;for(let g of Object.keys(d)){let m=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&mn(u,g,m)}let p=yn(u,d);p.to&&bn(u,p.to)},killTweensOf(u){let d=e.get(u);if(d)for(let p of Array.from(d))r(p)},timeline(u={}){let d=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let v=typeof h=="string"?h.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},C=h=>{d.push(h);let v=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+v)},b={to(h,v,w){return C({kind:"to",target:h,vars:v,atMs:f(w)}),b},fromTo(h,v,w,y){return C({kind:"fromTo",target:h,vars:w,from:v,atMs:f(y)}),b},play(){var h,v;if(g)return b;g=!0,m=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(h=w.from)!=null?h:{}),m.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.vars.delay)!=null?v:0)}));return b},pause(){for(let h of m)h.pause();return b},kill(){for(let h of m)h.kill();m=[],g=!1}};return u.paused||b.play(),b}};return l}function wn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=vn()}catch{}}var xn={name:"handler-playable-sdk",version:"1.0.21",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var Q=0,Wa=Q++,Sn=Q++,En=Q++,Cn=Q++,An=Q++,Ln=Q++,Tn=Q++,kn=Q++,Pn=Q++,In=Q++,Mn=Q++,jn=Q++,O=Wa;function _n(){return O===Sn}function On(){return O===En}function Rn(){return O===Cn}function zn(){return O===An}function Ve(){return O===Ln}function We(){return O===Tn}function $n(){return O===kn}function Dn(){return O===Pn}function Nn(){return O===In}function ui(){return O===Mn}function gi(){return O===jn}function Hn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),O=Sn;return}catch{}else if(i==="dapi")try{dapi.isReady(),O=En;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(O=Cn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(O=An)}catch{}else if(e==="mintegral")window.gameReady&&(O=Ln);else if(e==="tapjoy")window.TJ_API&&(O=Tn);else if(e==="tiktok")window.openAppStore&&(O=kn);else if(e==="smadex")try{window.smxTracking&&(O=Pn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(O=In)}catch{}else e==="vungle"?O=Mn:(i==="nucleo"||e==="nucleo")&&(O=jn)}var Rt=ci(require("lottie-web"),1),Fn=Rt.default;typeof window!="undefined"&&(window.lottie=Rt.default,window.__baseLottie=Rt.default);mi();function N(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var Nr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:N(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:N(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:N(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:N(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:N(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:N(360,780)}],Hr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:N(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:N(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:N(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:N(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:N(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:N(412,915)}],Fr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:N(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:N(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:N(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:N(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:N(800,1280)}],qn=[{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:N(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:N(768,1024),mraidScale:.7}];var Br=[...qn];var ts=qn[0];oe();function is(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function ns(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function as(i){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=i})}async function bi(i){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",i);let n=await fetch(i);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,i),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await is(a),r=await as(s),o=ns(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:(t=r==null?void 0:r.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function zt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((d,p)=>{let g=new Image;g.onload=()=>d(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=i}),n=document.createElement("canvas");n.width=t.width,n.height=t.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),i;a.drawImage(t,0,0);let s=a.getImageData(0,0,n.width,n.height),r=s.data,c=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(d=>({r:r[d.offset],g:r[d.offset+1],b:r[d.offset+2]})),l=0;for(let d=0;d<r.length;d+=4){let p=r[d],g=r[d+1],m=r[d+2],f=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(m-C.b,2))<e){f=!0;break}f&&(r[d+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var Yn=require("@google/genai");async function yi(i,e,t=[],n={}){var a,s,r,o,c,l,u;try{if(!(i!=null&&i.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 h=t[b];if(!h.base64||!h.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${h.mimeType}`)}let d=new Yn.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,h)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${h+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 d.models.generateContent({model:p,contents:g}),f="",C=(r=(s=(a=m.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(C)for(let b of C)b.text&&(f+=b.text);if(!f.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${f.length}`),f}catch(d){throw console.error("[Gemini] API error:",d),(o=d.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."):(c=d.message)!=null&&c.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=d.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=d.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):d}}var Kn=require("@google/genai");async function $t(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Kn.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,c)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${c}`),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 c=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${c}`}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 ds=require("pixi.js");yt();Dt();oe();var ta=require("pixi.js");var us=require("pixi.js");oe();function Ss(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Es(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Cs(i){return`
46
+ `,this.modal=n}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 l=o.target.dataset.tab;l&&this.switchTab(l)})});let n=this.modal.querySelector("[data-ai-generate]");n==null||n.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 t=window.__openAiEditor;if(typeof t!="function"){alert("AI Editor not available. Please check your setup.");return}let n="";e==="edit"&&this.currentAsset?n=`Edit this image: ${this.currentObjectId}`:n=`Create an image for: ${this.currentObjectId}`,t(this.currentObjectId||"unknown",n,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 rr={};cn(rr,{AssetCache:()=>ie,AssetLoader:()=>Pe,AssetSystem:()=>ri,AssetTextures:()=>Ie,Assets:()=>_a,BaseSystem:()=>st,GameEngine:()=>si,GameObject:()=>It,GameObjectManager:()=>nt,ObjectFactory:()=>be,Renderer:()=>Pt,RuntimeObjectRegistry:()=>rt,Transform:()=>kt,applyScreenAnchor:()=>Ut,basePixi:()=>Pa,clearResponsiveElements:()=>sa,createPixiBase:()=>ni,getRegisteredFontIds:()=>Aa,globalResponsiveMultipliers:()=>Ke,initAssetTextures:()=>Ft,initAssets:()=>Oa,layout:()=>oa,playLottieOverlay:()=>Ta,registerFont:()=>Ca,registerType:()=>Nt,resolveAnchorVec2:()=>Me,resolveFont:()=>Sa,resolveFontWeight:()=>Ea,resolveScreenAnchorPoint:()=>He,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>Ra,setLottieInstance:()=>Jt,spawnSceneFromConfig:()=>Ma,updateScreenState:()=>Gt});module.exports=Ba(rr);var xa=require("pixi.js");var Te={};function _t(i,e,t=!1){Te[i]||(Te[i]=[]),Te[i].push({fn:e,once:t})}function di(i,e){if(Te[i]){if(!e){delete Te[i];return}Te[i]=Te[i].filter(t=>t.fn!==e)}}function Ot(i,...e){let t=Te[i];if(t)for(let n of[...t])n.fn(...e),n.once&&di(i,n.fn)}function Z(i,e){_t(i,e,!0)}var D=null,te=[],qe=null;function gn(i){D=i,te=[],qe!==null&&(clearTimeout(qe),qe=null)}function hn(){var i,e,t;return{endpoint:(D==null?void 0:D.endpoint)||"",transport:(D==null?void 0:D.transport)||"beacon",batchSize:(i=D==null?void 0:D.batchSize)!=null?i: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 pn(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(s){n&&console.warn("[handler.telemetry] fetch failed",s)}}function pi(i,e){let t=hn();if(e&&t.endpoint){if(te.push(i),te.length>t.maxQueue&&(te=te.slice(te.length-t.maxQueue)),te.length>=t.batchSize){un();return}qe===null&&(qe=window.setTimeout(()=>{qe=null,un()},t.flushIntervalMs))}}async function un(){let i=hn();if(!i.endpoint||te.length===0)return;let e=te.splice(0,i.batchSize);await pn(i.endpoint,{events:e},i.transport,i.debug),te.length>0&&await pn(i.endpoint,{events:te.splice(0,i.batchSize)},i.transport,i.debug)}function fn(i){return Math.max(0,Math.min(1,i))}function Ga(i){let e=String(i!=null?i:"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.]+)\)/),n=t?Number(t[1]):1.8;return a=>1+(n+1)*Math.pow(a-1,3)+n*Math.pow(a-1,2)}return t=>1-(1-t)*(1-t)}function bt(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ua(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function mn(i,e,t){try{i[e]=t}catch{}}function qa(i){let e=i==null?void 0:i.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,n=typeof e.y=="number"?e.y:1;return{x:t,y:n}}function bn(i,e){let t=i==null?void 0:i.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 yn(i,e){let t=qa(i);if(!t)return{from:null,to:null};let n=null,a=null;return typeof e.scale=="number"?(n=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(n=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(n=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),n===null&&a===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:n!=null?n:t.x,y:a!=null?a:t.y}}}function vn(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,o(),i.size>0&&n()})},a=u=>{var p;i.add(u);let d=(p=e.get(u.target))!=null?p:new Set;d.add(u),e.set(u.target,d),n()},s=u=>{i.delete(u);let d=e.get(u.target);d&&(d.delete(u),d.size===0&&e.delete(u.target))},r=u=>{u.killed||(u.killed=!0,s(u))},o=()=>{var d,p;let u=bt();for(let g of Array.from(i)){if(g.killed||g.paused)continue;let m=u-g.startMs-g.delayMs;if(m<0)continue;let f=g.durationMs>0?m/g.durationMs:1,C=fn(f),b=g.repeat>=0?g.repeat+1:1,h=g.repeat>0?Math.min(Math.floor(f),b-1):0;if(g.repeat>0&&f>=1){let y=f-h;C=fn(y)}let v=g.ease(C);g.yoyo&&h%2===1&&(v=1-v);for(let y of g.props)mn(g.target,y.key,y.from+(y.to-y.from)*v);g.scaleFrom&&g.scaleTo&&bn(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(d=g.onUpdate)==null||d.call(g)}catch{}if(f>=b){r(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},c=(u,d,p)=>{var y;let g=Math.max(0,(typeof d.duration=="number"?d.duration:.5)*1e3),m=Math.max(0,(typeof d.delay=="number"?d.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Ga(d.ease),C=typeof d.repeat=="number"?Math.max(0,d.repeat|0):0,b=d.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let I of Object.keys(d)){if(h.has(I))continue;let _=d[I];typeof _=="number"&&v.push({key:I,from:Ua(u,I),to:_})}let w=yn(u,d);return{target:u,startMs:bt(),delayMs:m,durationMs:g,ease:f,props:v,scaleFrom:w.from,scaleTo:w.to,repeat:C,yoyo:b,onUpdate:typeof d.onUpdate=="function"?d.onUpdate:void 0,onComplete:typeof d.onComplete=="function"?d.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},l={to(u,d){let p=c(u,d);return a(p),{kill:()=>r(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=bt())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:bt(),m=bt()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,d,p){return l.set(u,d),l.to(u,p)},set(u,d){if(!u||!d)return;for(let g of Object.keys(d)){let m=d[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&mn(u,g,m)}let p=yn(u,d);p.to&&bn(u,p.to)},killTweensOf(u){let d=e.get(u);if(d)for(let p of Array.from(d))r(p)},timeline(u={}){let d=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let v=typeof h=="string"?h.trim():"";return v.startsWith("+=")?p+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):p},C=h=>{d.push(h);let v=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+v)},b={to(h,v,w){return C({kind:"to",target:h,vars:v,atMs:f(w)}),b},fromTo(h,v,w,y){return C({kind:"fromTo",target:h,vars:w,from:v,atMs:f(y)}),b},play(){var h,v;if(g)return b;g=!0,m=[];for(let w of d)w.kind==="fromTo"&&l.set(w.target,(h=w.from)!=null?h:{}),m.push(l.to(w.target,{...w.vars,delay:w.atMs/1e3+((v=w.vars.delay)!=null?v:0)}));return b},pause(){for(let h of m)h.pause();return b},kill(){for(let h of m)h.kill();m=[],g=!1}};return u.paused||b.play(),b}};return l}function wn(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=vn()}catch{}}var xn={name:"handler-playable-sdk",version:"1.0.23",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var Q=0,Wa=Q++,Sn=Q++,En=Q++,Cn=Q++,An=Q++,Ln=Q++,Tn=Q++,kn=Q++,Pn=Q++,In=Q++,Mn=Q++,jn=Q++,O=Wa;function _n(){return O===Sn}function On(){return O===En}function Rn(){return O===Cn}function zn(){return O===An}function Ve(){return O===Ln}function We(){return O===Tn}function $n(){return O===kn}function Dn(){return O===Pn}function Nn(){return O===In}function ui(){return O===Mn}function gi(){return O===jn}function Hn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),O=Sn;return}catch{}else if(i==="dapi")try{dapi.isReady(),O=En;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(O=Cn)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(O=An)}catch{}else if(e==="mintegral")window.gameReady&&(O=Ln);else if(e==="tapjoy")window.TJ_API&&(O=Tn);else if(e==="tiktok")window.openAppStore&&(O=kn);else if(e==="smadex")try{window.smxTracking&&(O=Pn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(O=In)}catch{}else e==="vungle"?O=Mn:(i==="nucleo"||e==="nucleo")&&(O=jn)}var Rt=ci(require("lottie-web"),1),Fn=Rt.default;typeof window!="undefined"&&(window.lottie=Rt.default,window.__baseLottie=Rt.default);mi();function N(i,e){let t=(a,s)=>s===0?a:t(s,a%s),n=t(i,e);return`${i/n}:${e/n}`}var Nr=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:N(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:N(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:N(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:N(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:N(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:N(360,780)}],Hr=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:N(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:N(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:N(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:N(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:N(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:N(412,915)}],Fr=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:N(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:N(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:N(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:N(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:N(800,1280)}],qn=[{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:N(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:N(768,1024),mraidScale:.7}];var Br=[...qn];var ts=qn[0];oe();function is(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function ns(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}async function as(i){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=i})}async function bi(i){var e,t;try{console.log("[ImageUtils] Fetching image data from URL:",i);let n=await fetch(i);if(!n.ok)return console.warn("[ImageUtils] Fetch failed with status:",n.status,i),null;let a=await n.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await is(a),r=await as(s),o=ns(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:(t=r==null?void 0:r.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function zt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((d,p)=>{let g=new Image;g.onload=()=>d(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=i}),n=document.createElement("canvas");n.width=t.width,n.height=t.height;let a=n.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),i;a.drawImage(t,0,0);let s=a.getImageData(0,0,n.width,n.height),r=s.data,c=[{name:"top-left",offset:0},{name:"top-right",offset:(n.width-1)*4},{name:"bottom-left",offset:(n.height-1)*n.width*4},{name:"bottom-right",offset:((n.height-1)*n.width+(n.width-1))*4}].map(d=>({r:r[d.offset],g:r[d.offset+1],b:r[d.offset+2]})),l=0;for(let d=0;d<r.length;d+=4){let p=r[d],g=r[d+1],m=r[d+2],f=!1;for(let C of c)if(Math.sqrt(Math.pow(p-C.r,2)+Math.pow(g-C.g,2)+Math.pow(m-C.b,2))<e){f=!0;break}f&&(r[d+3]=0,l++)}return console.log(`[ImageUtils] Removed background from ${l} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var Yn=require("@google/genai");async function yi(i,e,t=[],n={}){var a,s,r,o,c,l,u;try{if(!(i!=null&&i.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 h=t[b];if(!h.base64||!h.mimeType)throw new Error(`Image ${b+1} is missing required data`);if(h.base64.length<1e3&&console.warn(`Image ${b+1} data appears very small, may be corrupted`),!h.mimeType.startsWith("image/"))throw new Error(`Image ${b+1} has invalid MIME type: ${h.mimeType}`)}let d=new Yn.GoogleGenAI({apiKey:i}),p="gemini-2.5-flash",g=[e];t.length>0&&t.forEach((b,h)=>{g.push({inlineData:{data:b.base64,mimeType:b.mimeType}}),console.log(`[Gemini] Added image ${h+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 d.models.generateContent({model:p,contents:g}),f="",C=(r=(s=(a=m.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(C)for(let b of C)b.text&&(f+=b.text);if(!f.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${f.length}`),f}catch(d){throw console.error("[Gemini] API error:",d),(o=d.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."):(c=d.message)!=null&&c.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(l=d.message)!=null&&l.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=d.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):d}}var Kn=require("@google/genai");async function $t(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Kn.GoogleGenAI({apiKey:i}),s=[{text:e}];t.length>0&&t.forEach((o,c)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${c}`),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 c=o.inlineData.data,l=o.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${l};base64,${c}`}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 ds=require("pixi.js");yt();Dt();oe();var ta=require("pixi.js");var us=require("pixi.js");oe();function Ss(i){return new Promise((e,t)=>{let n=new FileReader;n.onerror=()=>t(new Error("FileReader failed")),n.onload=()=>e(String(n.result||"")),n.readAsDataURL(i)})}function Es(i){var a;let[e,t]=i.split(","),n=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:t!=null?t:"",mimeType:(a=n==null?void 0:n[1])!=null?a:"image/png"}}function Cs(i){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:
@@ -1 +1 @@
1
- (function(_0x3bce9a,_0xad3904){var a0_0x5827e8={_0x368528:0x33a,_0x13e0f9:0x332,_0x344851:'r*g)',_0x4c1793:0x129,_0x15d551:0x12d,_0x1bf8aa:0x130,_0x1e328b:0x124,_0x24f410:0x20c,_0x2bdc5d:'9H*D',_0x3fc2ad:0x203,_0x175ef3:0x328,_0x16ac4f:'Sf62',_0x30bf8b:0x31c,_0x3198de:0x325,_0x5eb0fb:0x320,_0x12472b:0x32d,_0x7a6a2d:'xpKN',_0x42599e:0x334,_0x36b29e:0x12d,_0x2f3229:0x11a,_0x460cba:0x231,_0x15a5db:0x225,_0x1cb1d1:'qSxa',_0x146c06:0x121,_0x1cb166:0x112,_0x4e6e97:0x116,_0x1e80b1:0x116,_0x46eeb3:0x33c,_0x438296:'XLRV',_0x36c2d0:0x32a,_0x4f5a58:0x322,_0x1ca303:0x12d,_0x5c9b65:0x132,_0x366349:0x201,_0x54fb09:0x210,_0x5b972b:'9d6T',_0x90584c:0x212,_0xf8187a:0x21b},a0_0xd8cf1c={_0x36141f:0x2a0},a0_0x5b1303={_0x167bd1:0x18d};function _0x4a3f9f(_0x5da208,_0x4520d8,_0x331d3d,_0x1c86cd,_0x5187c8){return a0_0x45d2(_0x4520d8-a0_0x5b1303._0x167bd1,_0x331d3d);}function _0x24cca3(_0x25ec53,_0x5db273,_0x643a9b,_0x3a4a84,_0x4bb055){return a0_0x45d2(_0x5db273- -0x1b4,_0x25ec53);}function _0x563cee(_0x38481e,_0xeb6ce3,_0x3b5baf,_0x4f736b,_0x353fd2){return a0_0x45d2(_0xeb6ce3-a0_0xd8cf1c._0x36141f,_0x3b5baf);}var _0xc61f64=_0x3bce9a();while(!![]){try{var _0xd5ccb8=-parseInt(_0x563cee(a0_0x5827e8._0x368528,a0_0x5827e8._0x368528,'XLRV',0x332,a0_0x5827e8._0x13e0f9))/(0xad*-0x2d+-0x1a6d+0x38d7)+-parseInt(_0x24cca3(a0_0x5827e8._0x344851,-a0_0x5827e8._0x4c1793,-a0_0x5827e8._0x15d551,-a0_0x5827e8._0x1bf8aa,-a0_0x5827e8._0x1e328b))/(-0x133c+-0x52d+0x37d*0x7)*(parseInt(_0x4a3f9f(0x20e,a0_0x5827e8._0x24f410,a0_0x5827e8._0x2bdc5d,0x20a,a0_0x5827e8._0x3fc2ad))/(0x554*0x5+-0x6*0x2cf+-0x9c7*0x1))+parseInt(_0x563cee(0x323,a0_0x5827e8._0x175ef3,a0_0x5827e8._0x16ac4f,a0_0x5827e8._0x30bf8b,a0_0x5827e8._0x3198de))/(-0x2160+0x1a94+0x6d0)*(parseInt(_0x563cee(a0_0x5827e8._0x5eb0fb,a0_0x5827e8._0x12472b,a0_0x5827e8._0x7a6a2d,0x324,a0_0x5827e8._0x42599e))/(-0x2*0x95+0x4d4+-0x3*0x137))+-parseInt(_0x24cca3('JD4R',-0x128,-a0_0x5827e8._0x36b29e,-a0_0x5827e8._0x2f3229,-0x136))/(0x7fb+0x1df2*-0x1+0x15fd)+parseInt(_0x4a3f9f(a0_0x5827e8._0x460cba,a0_0x5827e8._0x15a5db,a0_0x5827e8._0x1cb1d1,0x222,0x22b))/(0x151*-0x5+-0x1f21+0x1*0x25bd)*(parseInt(_0x24cca3('IHFW',-a0_0x5827e8._0x146c06,-a0_0x5827e8._0x1cb166,-a0_0x5827e8._0x4e6e97,-a0_0x5827e8._0x1e80b1))/(0xcbc+0x10fe+0xed9*-0x2))+-parseInt(_0x563cee(a0_0x5827e8._0x46eeb3,0x331,a0_0x5827e8._0x438296,a0_0x5827e8._0x36c2d0,a0_0x5827e8._0x4f5a58))/(0x2411+-0x5c2+-0x307*0xa)*(parseInt(_0x24cca3('wtPI',-0x12d,-0x123,-a0_0x5827e8._0x1ca303,-a0_0x5827e8._0x5c9b65))/(0x1cb5+0x44+-0x1cef))+parseInt(_0x4a3f9f(a0_0x5827e8._0x366349,a0_0x5827e8._0x54fb09,a0_0x5827e8._0x5b972b,a0_0x5827e8._0x90584c,a0_0x5827e8._0xf8187a))/(-0x1586*-0x1+0x1*0x127d+-0x27f8*0x1);if(_0xd5ccb8===_0xad3904)break;else _0xc61f64['push'](_0xc61f64['shift']());}catch(_0xb6f3ba){_0xc61f64['push'](_0xc61f64['shift']());}}}(a0_0x3894,0x2*0x3ec78+0x956fb+-0xa4039));function a0_0x45d2(_0x3bf5c6,_0x5793ac){_0x3bf5c6=_0x3bf5c6-(0xf0+-0x1511*-0x1+0x1*-0x1583);var _0x498568=a0_0x3894();var _0x187a1d=_0x498568[_0x3bf5c6];if(a0_0x45d2['KEEsBf']===undefined){var _0x5cce97=function(_0x26d80b){var _0xca2e64='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x2e4426='',_0x35946d='',_0x5eb172=_0x2e4426+_0x5cce97;for(var _0x1df1d9=-0x18a8+0x3fb*0x1+0x14ad,_0x11e381,_0x3e1dbf,_0x220cb0=0x211+0x17d0+0x19e1*-0x1;_0x3e1dbf=_0x26d80b['charAt'](_0x220cb0++);~_0x3e1dbf&&(_0x11e381=_0x1df1d9%(-0x29*0x9b+0xef7+0x9e0)?_0x11e381*(0x1*-0x347+-0x2526+0x10b*0x27)+_0x3e1dbf:_0x3e1dbf,_0x1df1d9++%(0xd9d*-0x2+-0xae4*0x2+-0x5*-0x9ce))?_0x2e4426+=_0x5eb172['charCodeAt'](_0x220cb0+(0x8fa+-0x76*0x41+0x17*0xea))-(0x1*0x8c6+-0x125a+-0x99e*-0x1)!==0x19f5+-0x497*0x2+-0x10c7?String['fromCharCode'](-0x1e1*0x11+0x2686*0x1+-0x596&_0x11e381>>(-(-0x97a+-0x1f46+-0x25*-0x11a)*_0x1df1d9&-0x1*0x2174+-0x200*0xa+0x4a*0xb9)):_0x1df1d9:-0x3cc*-0x1+-0x215b+0x1d8f){_0x3e1dbf=_0xca2e64['indexOf'](_0x3e1dbf);}for(var _0x396e44=0x1b*-0x48+-0x1f18+0x26b0,_0xb23f53=_0x2e4426['length'];_0x396e44<_0xb23f53;_0x396e44++){_0x35946d+='%'+('00'+_0x2e4426['charCodeAt'](_0x396e44)['toString'](0xcf3+-0x1239+0x2ab*0x2))['slice'](-(0x84*-0x13+-0xf09+-0x18d7*-0x1));}return decodeURIComponent(_0x35946d);};var _0x69ea0a=function(_0xc8ba50,_0x46645a){var _0x573372=[],_0x1e874f=-0x31d*-0xb+0x19f6+-0x3c35,_0x27a74a,_0x9b1785='';_0xc8ba50=_0x5cce97(_0xc8ba50);var _0x5cdfdf;for(_0x5cdfdf=0x25fd+-0x720+-0x1edd*0x1;_0x5cdfdf<0xfd8+-0xddf*-0x1+-0x1cb7*0x1;_0x5cdfdf++){_0x573372[_0x5cdfdf]=_0x5cdfdf;}for(_0x5cdfdf=0x24f6+-0x17d*-0x17+-0x4731;_0x5cdfdf<-0x40*-0x3a+0x1fb8+-0x8*0x5a7;_0x5cdfdf++){_0x1e874f=(_0x1e874f+_0x573372[_0x5cdfdf]+_0x46645a['charCodeAt'](_0x5cdfdf%_0x46645a['length']))%(0x12fd+0x13*0xc7+-0x20c2),_0x27a74a=_0x573372[_0x5cdfdf],_0x573372[_0x5cdfdf]=_0x573372[_0x1e874f],_0x573372[_0x1e874f]=_0x27a74a;}_0x5cdfdf=-0xe1e+-0x849+-0x1*-0x1667,_0x1e874f=0x1286+-0x1*0x973+0x65*-0x17;for(var _0x4f6b20=0x1*-0x21bb+0x107d+0x113e;_0x4f6b20<_0xc8ba50['length'];_0x4f6b20++){_0x5cdfdf=(_0x5cdfdf+(-0x9a8+0xbe*0x20+0xe17*-0x1))%(0x40c*-0x4+0x3*-0x14f+0x73*0x2f),_0x1e874f=(_0x1e874f+_0x573372[_0x5cdfdf])%(0x7*-0x1ab+-0x65*-0x52+-0x13ad),_0x27a74a=_0x573372[_0x5cdfdf],_0x573372[_0x5cdfdf]=_0x573372[_0x1e874f],_0x573372[_0x1e874f]=_0x27a74a,_0x9b1785+=String['fromCharCode'](_0xc8ba50['charCodeAt'](_0x4f6b20)^_0x573372[(_0x573372[_0x5cdfdf]+_0x573372[_0x1e874f])%(0x8ef+0xf11*-0x2+0x1633)]);}return _0x9b1785;};a0_0x45d2['EHEyui']=_0x69ea0a,a0_0x45d2['cbVebR']={},a0_0x45d2['KEEsBf']=!![];}var _0x5dd1bd=_0x498568[-0x43c+-0x1d*-0x10d+-0x3*0x8bf],_0x6f4721=_0x3bf5c6+_0x5dd1bd,_0x502073=a0_0x45d2['cbVebR'][_0x6f4721];if(!_0x502073){if(a0_0x45d2['Wrdskb']===undefined){var _0x27ad6b=function(_0x4d6cc3){this['VRRzXL']=_0x4d6cc3,this['tqXEie']=[0x1*0x4c3+-0x64*0xa+-0xda,-0x1b7d+-0xe75+0x2ff*0xe,0x1ae7+0x24a*-0x2+0x1*-0x1653],this['bzqrjZ']=function(){return'newState';},this['yCSzNV']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['gZKIHf']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x27ad6b['prototype']['rUacdH']=function(){var _0x361b1b=new RegExp(this['yCSzNV']+this['gZKIHf']),_0x3f3aae=_0x361b1b['test'](this['bzqrjZ']['toString']())?--this['tqXEie'][0x511*-0x2+-0x1382+0x1*0x1da5]:--this['tqXEie'][-0x107*-0x4+-0x1a82+0x1666];return this['wrAXGR'](_0x3f3aae);},_0x27ad6b['prototype']['wrAXGR']=function(_0x446e17){if(!Boolean(~_0x446e17))return _0x446e17;return this['XtlvCH'](this['VRRzXL']);},_0x27ad6b['prototype']['XtlvCH']=function(_0x18a180){for(var _0x10d130=0x22b+0x140d+-0x1638,_0x314659=this['tqXEie']['length'];_0x10d130<_0x314659;_0x10d130++){this['tqXEie']['push'](Math['round'](Math['random']())),_0x314659=this['tqXEie']['length'];}return _0x18a180(this['tqXEie'][-0x52d+0x10d9*-0x1+-0x2*-0xb03]);},new _0x27ad6b(a0_0x45d2)['rUacdH'](),a0_0x45d2['Wrdskb']=!![];}_0x187a1d=a0_0x45d2['EHEyui'](_0x187a1d,_0x5793ac),a0_0x45d2['cbVebR'][_0x6f4721]=_0x187a1d;}else _0x187a1d=_0x502073;return _0x187a1d;}var a0_0x518ca2=(function(){var a0_0x32ea56={_0x1fd6a4:0x265,_0x19bf91:0x26a,_0x20508c:'sao#'},_0x46dda0=!![];return function(_0x41b797,_0x125c9d){var a0_0x34a48a={_0x11e10f:0x1cc},_0x3fb0a3=_0x46dda0?function(){function _0x4d479e(_0x56f95a,_0xb8db88,_0x3077e9,_0x41e95b,_0x3a8f57){return a0_0x45d2(_0x3077e9-a0_0x34a48a._0x11e10f,_0x3a8f57);}if(_0x125c9d){var _0x43f069=_0x125c9d[_0x4d479e(0x25e,0x264,a0_0x32ea56._0x1fd6a4,a0_0x32ea56._0x19bf91,a0_0x32ea56._0x20508c)](_0x41b797,arguments);return _0x125c9d=null,_0x43f069;}}:function(){};return _0x46dda0=![],_0x3fb0a3;};}()),a0_0x412f91=a0_0x518ca2(this,function(){var a0_0x24cec1={_0x11f23e:0x5b,_0x32d76c:0x58,_0x27f791:0x49,_0x3dc4cc:0x51,_0x4ed5b7:'$Z^O',_0x1afc50:0x85,_0x18578e:0x86,_0x3ed647:'wEwn',_0x36545e:0x80,_0x34cd2b:0x2bb,_0x462f32:0x2a6,_0x24f8e8:0x2b1,_0x39fb75:'73WR',_0x584dc2:0x85,_0x19074a:'gQJ*',_0x3852e8:0x7a,_0x13f136:0x2c2,_0x12059b:0x2b6,_0x475b12:'XznV',_0x32cad5:0x69,_0x16b67e:0x65,_0x1cf28f:'VFo$',_0x97eb3e:0x6b,_0x29ae0d:'qSxa',_0x163ed7:0x84,_0x15bdc9:0x85,_0x1a98a2:0x8f},a0_0x4c161f={_0x1adc34:0x9},a0_0x3f65de={_0x2b1b9b:0x29},a0_0x2cfa7a={_0x19f0d1:0x346};function _0x1024c5(_0x3caaef,_0x1f385f,_0x47c8fb,_0x444415,_0x39582a){return a0_0x45d2(_0x444415- -a0_0x2cfa7a._0x19f0d1,_0x39582a);}function _0x32490c(_0x1bb913,_0x347c74,_0x5bfd18,_0xc96bd3,_0x26d3a6){return a0_0x45d2(_0x347c74- -a0_0x3f65de._0x2b1b9b,_0x26d3a6);}var _0x15f3e1={};_0x15f3e1['xwESt']='(((.+'+_0x32490c(a0_0x24cec1._0x11f23e,a0_0x24cec1._0x32d76c,a0_0x24cec1._0x27f791,a0_0x24cec1._0x3dc4cc,a0_0x24cec1._0x4ed5b7)+'+$';var _0x1e7544=_0x15f3e1;function _0x5bfaab(_0x4d2094,_0x3f9958,_0x26858d,_0x576003,_0x20bda6){return a0_0x45d2(_0x576003- -a0_0x4c161f._0x1adc34,_0x26858d);}return a0_0x412f91[_0x5bfaab(a0_0x24cec1._0x1afc50,a0_0x24cec1._0x18578e,a0_0x24cec1._0x3ed647,a0_0x24cec1._0x36545e,a0_0x24cec1._0x36545e)+_0x1024c5(-0x2a3,-a0_0x24cec1._0x34cd2b,-a0_0x24cec1._0x462f32,-a0_0x24cec1._0x24f8e8,a0_0x24cec1._0x39fb75)]()[_0x5bfaab(0x85,a0_0x24cec1._0x584dc2,a0_0x24cec1._0x19074a,0x77,a0_0x24cec1._0x3852e8)+'h'](_0x1e7544['xwESt'])['toStr'+'ing']()[_0x1024c5(-a0_0x24cec1._0x13f136,-0x2b9,-a0_0x24cec1._0x34cd2b,-a0_0x24cec1._0x12059b,a0_0x24cec1._0x475b12)+_0x32490c(0x6a,a0_0x24cec1._0x32cad5,0x71,a0_0x24cec1._0x16b67e,a0_0x24cec1._0x1cf28f)+'r'](a0_0x412f91)[_0x32490c(0x5c,a0_0x24cec1._0x97eb3e,a0_0x24cec1._0x16b67e,0x66,a0_0x24cec1._0x29ae0d)+'h'](_0x1e7544[_0x5bfaab(0x86,a0_0x24cec1._0x163ed7,'sao#',a0_0x24cec1._0x15bdc9,a0_0x24cec1._0x1a98a2)]);});a0_0x412f91();import{A as a0_0x5acd98,B as a0_0x1025f6,C as a0_0x597c51,D as a0_0x4f5f4b,b as a0_0x3df9a5,c as a0_0x173418,d as a0_0x27979e,e as a0_0x2d846a,f as a0_0x5e0d7a,g as a0_0x26fd92,h as a0_0x1f1b1b,i as a0_0x24d4b8,j as a0_0x402254,k as a0_0xa2885f,l as a0_0x43073c,m as a0_0x409e7c,n as a0_0x240ebd,o as a0_0x444abd,p as a0_0x36ea3e,q as a0_0x476661,r as a0_0x119b6c,s as a0_0x5cccc1,t as a0_0x5977ad,u as a0_0x1ab203,v as a0_0x3c6dd7,w as a0_0xec526f,x as a0_0x91efba,y as a0_0x4162cb,z as a0_0x5666ba}from'../chunk-KHEZYZMO.js';import{a as a0_0x57d7ab,b as a0_0x14f2dd,c as a0_0xe95e53,d as a0_0x3c26f1,e as a0_0x1ad3bc}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';function a0_0x3894(){var _0x2d541b=['W5OlW4SJW7DcE8ok','W4fJWQFcQSoaWPqJW7xdU8k8W6xcJq','Ft/cVvzngw3dG1r7sCkybq','W6hdJeOvWQhcVCkOWRyrWRfycG','W5VdT23dSCkQW4xdUWtcLx5EWPG','wCkTuSoFWR0','WP1eWPzqW4XyrrpcQdZcO8ou','ztjCWQ3dQLNdUW','WR3cHfVcGMVdGH8TWQPiWPy','WOpcMq8/W5/dMGyn','f2hdIJSR','rmoVpSkJmJpcMuW','WPXNWQtdPuS','mgLEgCojW4ZcNCoW','mSoEW5BcJeq','DdVdS8k3wSoZWOjHA8oikcCv','DCkaW4TJfq','WRVdISkG','m8owW7RdRtZdSSkBmbfWWR4','fSkxq8kFWPSoWRFcHK7dNrO8','mCkDW65vj8knfG','dMBdVWqM','mgW8v8kiWRJcUSoVBCoRtmoy','iWeEEeG9p8oPW7hdU8oTCG','WQfWWQf0CGPnbmoxW4JdUCk6WQldNG','gsCXWOa0u8oZWPpdTfKTW4i','E8kWWO0KW6e','mH4hALi','mmkZW7ubWQrhWOa','WORdISo3WPtdNmkOWQCJW6uPlCklWRDq'];a0_0x3894=function(){return _0x2d541b;};return a0_0x3894();}import'../chunk-JXBG6UFL.js';export{a0_0x57d7ab as AssetCache,a0_0xe95e53 as AssetLoader,a0_0x1ab203 as AssetSystem,a0_0x3c26f1 as AssetTextures,a0_0x5cccc1 as Assets,a0_0x444abd as BaseSystem,a0_0x240ebd as GameEngine,a0_0x2d846a as GameObject,a0_0x5e0d7a as GameObjectManager,a0_0x409e7c as ObjectFactory,a0_0x27979e as Renderer,a0_0x36ea3e as RuntimeObjectRegistry,a0_0x173418 as Transform,a0_0x1025f6 as applyScreenAnchor,a0_0x476661 as basePixi,a0_0xec526f as clearResponsiveElements,a0_0x3df9a5 as createPixiBase,a0_0x402254 as getRegisteredFontIds,a0_0x3c6dd7 as globalResponsiveMultipliers,a0_0x1ad3bc as initAssetTextures,a0_0x5977ad as initAssets,a0_0x597c51 as layout,a0_0x43073c as playLottieOverlay,a0_0x24d4b8 as registerFont,a0_0x14f2dd as registerType,a0_0x4162cb as resolveAnchorVec2,a0_0x26fd92 as resolveFont,a0_0x1f1b1b as resolveFontWeight,a0_0x5666ba as resolveScreenAnchorPoint,a0_0x5acd98 as resolveScreenRatioPoint,a0_0x4f5f4b as runInitSequence,a0_0xa2885f as setLottieInstance,a0_0x119b6c as spawnSceneFromConfig,a0_0x91efba as updateScreenState};
1
+ (function(_0x237d0a,_0x32d1d1){var a0_0x222953={_0x3e36d9:0x312,_0x4dbdf6:0x301,_0x31968f:'DH(K',_0x49e7c2:0x30c,_0x998a7e:0x313,_0xeb4d0a:0x309,_0x4ed489:'tJid',_0x123979:0xa4,_0x5f535f:0x93,_0x255c2a:0xa2,_0x36f8ba:0x93,_0x32aeb9:0x3ae,_0x591026:0x3c5,_0x5ed4f1:'cboE',_0x2fefb5:0x3b3,_0x762249:0x318,_0x2af54f:'rooF',_0x3a4908:0x308,_0x56de12:0x3d0,_0xb487f0:0x3c2,_0x29f43f:'bGfu',_0xb13c7f:'Dvlm',_0x461408:0x96,_0x57a1f2:0x92,_0x2f25be:0x9b,_0x694e01:'jq0m',_0x6f2845:0xb0,_0x58689e:0x9d,_0x2ea52e:0xa3,_0x46e368:0x2ee,_0x1c89c8:0x2f5,_0x31cae7:'mdn0',_0x8e1fc:0x2e4,_0x3b9ec3:0x3c3,_0x3519b5:0x3d4,_0x46d951:0xa3,_0x48bc11:0xa9,_0x58077d:0x9a,_0xe72875:0xa0,_0x57fbd6:'v9w$',_0x447ffe:0x9c,_0x22e13f:0xa5,_0x381290:0xa7,_0x1a1f2e:0x98,_0xc58857:'5EU9',_0x479471:0xa2,_0x1ed02c:0xad,_0x427b28:0xac,_0x3eff42:0xb7},a0_0x4cdfed={_0x1e12f4:0x2d6},a0_0x578cad={_0x369992:0x215},a0_0x59ebba={_0x4d3486:0x18d},_0x49f9a5=_0x237d0a();function _0x5bead3(_0xe1af03,_0x23bac5,_0x69cd39,_0x408cda,_0x2153e7){return a0_0x57b5(_0x69cd39- -a0_0x59ebba._0x4d3486,_0xe1af03);}function _0x263f88(_0x477db7,_0x135e4c,_0x5a7fe9,_0x2cf448,_0x30b252){return a0_0x57b5(_0x2cf448-a0_0x578cad._0x369992,_0x5a7fe9);}function _0x78fd92(_0x1fc28b,_0x2f3c3f,_0xd59bf3,_0x1f1973,_0x5f2b94){return a0_0x57b5(_0xd59bf3-a0_0x4cdfed._0x1e12f4,_0x1f1973);}while(!![]){try{var _0x96552e=-parseInt(_0x263f88(a0_0x222953._0x3e36d9,a0_0x222953._0x4dbdf6,a0_0x222953._0x31968f,a0_0x222953._0x49e7c2,0x31a))/(-0x5+0x17ba+-0x17b4)*(parseInt(_0x263f88(a0_0x222953._0x998a7e,a0_0x222953._0xeb4d0a,'GT3E',a0_0x222953._0xeb4d0a,0x300))/(-0x21f1+-0xe37*-0x1+0x3*0x694))+-parseInt(_0x5bead3(a0_0x222953._0x4ed489,-a0_0x222953._0x123979,-a0_0x222953._0x5f535f,-a0_0x222953._0x255c2a,-a0_0x222953._0x36f8ba))/(0x86d+-0x12e7+0xa7d)*(parseInt(_0x78fd92(a0_0x222953._0x32aeb9,a0_0x222953._0x591026,0x3b4,a0_0x222953._0x5ed4f1,a0_0x222953._0x2fefb5))/(0x1a*0x6a+0x16*-0xf1+-0x1a9*-0x6))+parseInt(_0x263f88(0x2f8,a0_0x222953._0x762249,a0_0x222953._0x2af54f,a0_0x222953._0x3a4908,0x30c))/(-0x2659*0x1+0x2bc*-0xd+0x49ea)*(-parseInt(_0x78fd92(a0_0x222953._0x56de12,0x3bb,a0_0x222953._0xb487f0,a0_0x222953._0x29f43f,0x3cd))/(-0x10d*-0x6+-0xecf+0x887))+parseInt(_0x5bead3(a0_0x222953._0xb13c7f,-a0_0x222953._0x461408,-a0_0x222953._0x57a1f2,-a0_0x222953._0x2f25be,-0xa3))/(-0x11f5+-0x11*-0x2+-0x392*-0x5)+-parseInt(_0x5bead3(a0_0x222953._0x694e01,-a0_0x222953._0x6f2845,-a0_0x222953._0x58689e,-0x9a,-a0_0x222953._0x2ea52e))/(0x820+-0x25f8+0x4*0x778)*(-parseInt(_0x263f88(a0_0x222953._0x46e368,a0_0x222953._0x1c89c8,a0_0x222953._0x31cae7,0x2f6,a0_0x222953._0x8e1fc))/(-0xe*-0x23a+0x1024*-0x2+0x125))+parseInt(_0x78fd92(a0_0x222953._0x3b9ec3,0x3d8,a0_0x222953._0x3519b5,a0_0x222953._0x31cae7,0x3c6))/(-0x2242*0x1+0x1134*-0x1+0x3380)*(parseInt(_0x5bead3(a0_0x222953._0x4ed489,-a0_0x222953._0x46d951,-a0_0x222953._0x48bc11,-a0_0x222953._0x58077d,-a0_0x222953._0xe72875))/(-0x8b*0x5+0x32*0xc+-0x2*-0x35))+parseInt(_0x5bead3(a0_0x222953._0x57fbd6,-a0_0x222953._0x447ffe,-a0_0x222953._0x22e13f,-a0_0x222953._0x381290,-a0_0x222953._0x1a1f2e))/(-0x13*0x13+0x15c3+0x17*-0xe2)*(parseInt(_0x5bead3(a0_0x222953._0xc58857,-a0_0x222953._0x479471,-a0_0x222953._0x1ed02c,-a0_0x222953._0x427b28,-a0_0x222953._0x3eff42))/(-0x241*0x7+-0x1ff+-0x15f*-0xd));if(_0x96552e===_0x32d1d1)break;else _0x49f9a5['push'](_0x49f9a5['shift']());}catch(_0xcb8694){_0x49f9a5['push'](_0x49f9a5['shift']());}}}(a0_0x22b5,-0x11e573+-0x5c176+0x2144c8));var a0_0x5abd9f=(function(){var _0x14fbde=!![];return function(_0x2b9523,_0x95b8dd){var a0_0x4ab4c0={_0x375abc:0x3fb,_0x3c20bf:0x3fe,_0x41b579:0x409,_0x2a984f:'1h4a',_0x453259:0x408},a0_0x240860={_0x1c121d:0x323},_0x5b4c53=_0x14fbde?function(){function _0x296d70(_0x2fbfec,_0x465a48,_0x392c9a,_0x1c7b5f,_0x546320){return a0_0x57b5(_0x392c9a-a0_0x240860._0x1c121d,_0x1c7b5f);}if(_0x95b8dd){var _0x369e90=_0x95b8dd[_0x296d70(a0_0x4ab4c0._0x375abc,a0_0x4ab4c0._0x3c20bf,a0_0x4ab4c0._0x41b579,a0_0x4ab4c0._0x2a984f,a0_0x4ab4c0._0x453259)](_0x2b9523,arguments);return _0x95b8dd=null,_0x369e90;}}:function(){};return _0x14fbde=![],_0x5b4c53;};}()),a0_0x91184d=a0_0x5abd9f(this,function(){var a0_0x28e617={_0x30bb8a:0x9b,_0x179d53:0xb6,_0x947153:'&0Lv',_0x2f64f2:0xaa,_0x22e4ac:0x1e,_0x36275c:0x11,_0x226fc8:'GT3E',_0x3a38cf:0x2d,_0x2e3f7b:0x30,_0xa88cae:0xa7,_0xa6f32e:'S8Ze',_0xe37ca9:0x9e,_0x188d5f:0x1ca,_0x2928d0:0x1d0,_0x5c1d11:'Dvlm',_0x448c25:0x95,_0x5c9e69:0x24,_0x223d2a:0x2b,_0x259111:0x15,_0x5d734b:0x32,_0x3b2287:0x1a6,_0x1a926c:'Fvh1',_0xd064a4:0x3b,_0x298384:0x40,_0x15c370:'C!JO',_0x4242ce:0x31,_0x1797f4:0x39,_0x5bda04:0x1c4,_0x358208:0x1c3,_0x295edb:'LHbM',_0x5a326a:0x1d3,_0xe6ec79:0x1ab,_0xc318cc:0x1ad,_0x34c578:'D^AJ',_0x46a7c9:0x19d},a0_0x15e7e3={_0x21a886:0xce},a0_0x377177={_0x43c45e:0x11d},a0_0x518c10={_0x258861:0x53};function _0xab02c7(_0x2dc0ba,_0x53725e,_0x97060e,_0x168bd1,_0x57f239){return a0_0x57b5(_0x57f239- -a0_0x518c10._0x258861,_0x168bd1);}var _0x2e7a75={};function _0x7b722b(_0x1272c1,_0x318e12,_0x3f53ec,_0x210627,_0x106773){return a0_0x57b5(_0x1272c1- -a0_0x377177._0x43c45e,_0x3f53ec);}function _0x3b325d(_0x232e09,_0x2d3fc8,_0x4e696c,_0x1519a5,_0x1e2d86){return a0_0x57b5(_0x232e09-a0_0x15e7e3._0x21a886,_0x4e696c);}_0x2e7a75[_0xab02c7(0xbb,a0_0x28e617._0x30bb8a,a0_0x28e617._0x179d53,a0_0x28e617._0x947153,a0_0x28e617._0x2f64f2)]=_0x7b722b(-a0_0x28e617._0x22e4ac,-a0_0x28e617._0x36275c,a0_0x28e617._0x226fc8,-a0_0x28e617._0x3a38cf,-a0_0x28e617._0x2e3f7b)+_0xab02c7(0xa0,0x9b,a0_0x28e617._0xa88cae,a0_0x28e617._0xa6f32e,a0_0x28e617._0xe37ca9)+'+$';var _0x2d817e=_0x2e7a75;return a0_0x91184d[_0x3b325d(a0_0x28e617._0x188d5f,a0_0x28e617._0x2928d0,a0_0x28e617._0x5c1d11,0x1b8,0x1d6)+'ing']()['searc'+'h'](_0x2d817e[_0xab02c7(0x9b,a0_0x28e617._0x448c25,0x96,'mdn0',0x97)])[_0x7b722b(-a0_0x28e617._0x5c9e69,-a0_0x28e617._0x223d2a,'%[BG',-a0_0x28e617._0x259111,-a0_0x28e617._0x5d734b)+_0x3b325d(0x1b9,a0_0x28e617._0x3b2287,a0_0x28e617._0x1a926c,0x1ac,0x1c5)]()['const'+_0x7b722b(-a0_0x28e617._0xd064a4,-a0_0x28e617._0x298384,a0_0x28e617._0x15c370,-a0_0x28e617._0x4242ce,-a0_0x28e617._0x1797f4)+'r'](a0_0x91184d)[_0x3b325d(a0_0x28e617._0x5bda04,a0_0x28e617._0x358208,a0_0x28e617._0x295edb,0x1b4,a0_0x28e617._0x5a326a)+'h'](_0x2d817e[_0x3b325d(a0_0x28e617._0xe6ec79,a0_0x28e617._0xc318cc,a0_0x28e617._0x34c578,0x1a7,a0_0x28e617._0x46a7c9)]);});a0_0x91184d();import{A as a0_0x2d5f74,B as a0_0x33db53,C as a0_0xc7a63a,D as a0_0x4d5345,b as a0_0x2123bb,c as a0_0x3ad27f,d as a0_0x81f8fe,e as a0_0x479a47,f as a0_0x2e9951,g as a0_0x488cc6,h as a0_0x415990,i as a0_0x19c8d3,j as a0_0x5d5c00,k as a0_0x2f846e,l as a0_0x3f68be,m as a0_0x1ee585,n as a0_0x360537,o as a0_0x59d7d9,p as a0_0x196eaf,q as a0_0x2fe2bd,r as a0_0x136a8c,s as a0_0x28004,t as a0_0x2410f9,u as a0_0x47d30f,v as a0_0x2c6f42,w as a0_0x577153,x as a0_0x5c313d,y as a0_0x4d6aa3,z as a0_0x59a7ce}from'../chunk-EFDKXXPM.js';import{a as a0_0x20d29e,b as a0_0x357561,c as a0_0x3a29f1,d as a0_0x2305ff,e as a0_0x54989e}from'../chunk-I5OOVR5U.js';import'../chunk-PW2FGMCO.js';function a0_0x57b5(_0x410a09,_0x1be563){_0x410a09=_0x410a09-(-0x15c7+0x184d+-0x3*0x8e);var _0x4057a7=a0_0x22b5();var _0x17eeb3=_0x4057a7[_0x410a09];if(a0_0x57b5['uFcHTY']===undefined){var _0x52632c=function(_0x11d11c){var _0x2eed73='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3cd369='',_0x16689e='',_0x4a2e32=_0x3cd369+_0x52632c;for(var _0x43791c=0x20ca+0x18af+-0x3979,_0x56f38e,_0x45880d,_0x4c87fd=0x3bc+-0xcbf+0x301*0x3;_0x45880d=_0x11d11c['charAt'](_0x4c87fd++);~_0x45880d&&(_0x56f38e=_0x43791c%(0x5ab*0x3+0x23fa+-0x34f7)?_0x56f38e*(0x2061+0x1*0x243b+-0x271*0x1c)+_0x45880d:_0x45880d,_0x43791c++%(-0x2*0x238+0x16bf+-0x124b))?_0x3cd369+=_0x4a2e32['charCodeAt'](_0x4c87fd+(-0x14a8+-0xc7*0x17+0x1*0x2693))-(0xc2d+0x1d89*0x1+-0x29ac)!==0x51b+0xda*-0x2+-0x367*0x1?String['fromCharCode'](-0xd9*-0x2+-0x2*-0x24+0xfb*-0x1&_0x56f38e>>(-(0x23*-0x47+-0x1*-0x24b+0x5*0x17c)*_0x43791c&-0x1*-0x152a+-0x2cd+0x3ab*-0x5)):_0x43791c:0x136*0x1+0xddd+-0xe3*0x11){_0x45880d=_0x2eed73['indexOf'](_0x45880d);}for(var _0x99a814=-0x1*0xa36+-0x1d92+0x27c8,_0xe239c=_0x3cd369['length'];_0x99a814<_0xe239c;_0x99a814++){_0x16689e+='%'+('00'+_0x3cd369['charCodeAt'](_0x99a814)['toString'](-0x149*-0xa+-0x25*0xf4+0x167a))['slice'](-(0xd*0x9e+0x113a+-0x193e));}return decodeURIComponent(_0x16689e);};var _0xd1e809=function(_0x44e0b7,_0x43f980){var _0xad5144=[],_0x49e5a3=-0x13*-0x2e+-0x5c5*0x5+-0x1*-0x196f,_0x56aeed,_0x285ab5='';_0x44e0b7=_0x52632c(_0x44e0b7);var _0x376234;for(_0x376234=0x145f+-0x1*-0xe78+-0x9*0x3df;_0x376234<0x530+-0x1145*-0x2+-0x26ba;_0x376234++){_0xad5144[_0x376234]=_0x376234;}for(_0x376234=-0x986+0x2365*-0x1+0x2ceb*0x1;_0x376234<-0x2*0x617+-0x37*-0x16+0x874;_0x376234++){_0x49e5a3=(_0x49e5a3+_0xad5144[_0x376234]+_0x43f980['charCodeAt'](_0x376234%_0x43f980['length']))%(-0x1*0x1f68+0x23bb+-0x353*0x1),_0x56aeed=_0xad5144[_0x376234],_0xad5144[_0x376234]=_0xad5144[_0x49e5a3],_0xad5144[_0x49e5a3]=_0x56aeed;}_0x376234=0x205*-0x5+0x3*-0x88b+0x23ba,_0x49e5a3=0x9d*0x3b+-0x569+-0x25e*0xd;for(var _0x1d9dcf=0xac*0x22+-0x2500*-0x1+0xef6*-0x4;_0x1d9dcf<_0x44e0b7['length'];_0x1d9dcf++){_0x376234=(_0x376234+(-0x6c5+0xa01+-0x33b))%(0x10f*-0x7+0xd3*-0x1+0x314*0x3),_0x49e5a3=(_0x49e5a3+_0xad5144[_0x376234])%(0x9bb+0xb*0x18e+-0x11*0x185),_0x56aeed=_0xad5144[_0x376234],_0xad5144[_0x376234]=_0xad5144[_0x49e5a3],_0xad5144[_0x49e5a3]=_0x56aeed,_0x285ab5+=String['fromCharCode'](_0x44e0b7['charCodeAt'](_0x1d9dcf)^_0xad5144[(_0xad5144[_0x376234]+_0xad5144[_0x49e5a3])%(-0x15e4+-0x2*0xd5d+-0xdb*-0x3a)]);}return _0x285ab5;};a0_0x57b5['MtWMOf']=_0xd1e809,a0_0x57b5['CpNvQK']={},a0_0x57b5['uFcHTY']=!![];}var _0x3a4427=_0x4057a7[-0x1d3*0xb+0xa93+0x97e],_0x39f974=_0x410a09+_0x3a4427,_0x189de2=a0_0x57b5['CpNvQK'][_0x39f974];if(!_0x189de2){if(a0_0x57b5['jmSUrL']===undefined){var _0x4dc88a=function(_0x14d712){this['qwgsGc']=_0x14d712,this['NLkPlo']=[0x464*-0x6+0xf47*-0x2+0x38e7,0x71*0x16+-0x7bd+-0x1f9*0x1,0x1*0x1b25+-0x1*0xd55+-0x374*0x4],this['USernd']=function(){return'newState';},this['wTkQSC']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['rmhjYM']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4dc88a['prototype']['vvFymb']=function(){var _0x236e70=new RegExp(this['wTkQSC']+this['rmhjYM']),_0x159a1b=_0x236e70['test'](this['USernd']['toString']())?--this['NLkPlo'][-0x37e*0x2+0x352+0x1*0x3ab]:--this['NLkPlo'][-0x26c*-0x1+-0x475+0x209];return this['psdInz'](_0x159a1b);},_0x4dc88a['prototype']['psdInz']=function(_0x19c5b6){if(!Boolean(~_0x19c5b6))return _0x19c5b6;return this['XVQCjO'](this['qwgsGc']);},_0x4dc88a['prototype']['XVQCjO']=function(_0x2fd952){for(var _0x18197b=-0x2f7+0x15*0x3e+-0x1*0x21f,_0x36e4e8=this['NLkPlo']['length'];_0x18197b<_0x36e4e8;_0x18197b++){this['NLkPlo']['push'](Math['round'](Math['random']())),_0x36e4e8=this['NLkPlo']['length'];}return _0x2fd952(this['NLkPlo'][0x17ba+-0x1c6e+0x4b4]);},new _0x4dc88a(a0_0x57b5)['vvFymb'](),a0_0x57b5['jmSUrL']=!![];}_0x17eeb3=a0_0x57b5['MtWMOf'](_0x17eeb3,_0x1be563),a0_0x57b5['CpNvQK'][_0x39f974]=_0x17eeb3;}else _0x17eeb3=_0x189de2;return _0x17eeb3;}function a0_0x22b5(){var _0x435d4f=['W5CTWPKMW40','WRvKDCkHW4SQWRS/Ca','zSojBCkMWO1kebKqW588Fa','zSkLW6tcJ8od','qSo5W5GnhsxdQG','Dd86W47dLmk3W7RcOvWjCSkbWRW','nMrAWO/cLW','jb/dP8k2wG','WRdcJmkWxmoRoCkSW7y2W4DpW5a','xCotW7FcNhy','ctddKKuzWOf8xW','f8kjWRhcRCoYWQ/cKMldH1eHa1O','WP7dN8o2iJO','WQJcO8kPW77dOehcQ8kJsCogWPpdSCkI','dtncWPldPmo5zdJdOmonhW','hdrhW7JcPWVcLCkLWRpdRq','WRNcJ8k3w8k/uCkcW7yWW5K','sMJdKSouqq','gLBcQmoCW55RWOzNWPRcVJe','qmkhW5CxlrRdTsS','n8k3eSkWkSkZqmo2WQi','rsmVfmoQ','gJO6cvpdGIK','e8knWRlcQSo+W5/dMMxdH2CD','DmoiWPVdQCkHA8kpWR/cSZy','W6ddRCo1fCky','W5BcRCkm','W4NcRdS6pCo7W4m','CmopWP/dPCoPh8onWPJcLH3dNXFdVG','WRCEcCkZW705WQO','WRbGDSoxWPbuW5GLxJCqld0','FSoOW494je18FmkXW6r6','pcldOeRdIq','W4fAAfObvSoCWO0ZkIi','dtrjWPldPCktkbpdVmoMgYddQa','rmopW6/cGw/dJvyaW60Hfq','n8k2fmofkCkTDmotWPFcIG'];a0_0x22b5=function(){return _0x435d4f;};return a0_0x22b5();}import'../chunk-HVKF2KYL.js';import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0x20d29e as AssetCache,a0_0x3a29f1 as AssetLoader,a0_0x47d30f as AssetSystem,a0_0x2305ff as AssetTextures,a0_0x28004 as Assets,a0_0x59d7d9 as BaseSystem,a0_0x360537 as GameEngine,a0_0x479a47 as GameObject,a0_0x2e9951 as GameObjectManager,a0_0x1ee585 as ObjectFactory,a0_0x81f8fe as Renderer,a0_0x196eaf as RuntimeObjectRegistry,a0_0x3ad27f as Transform,a0_0x33db53 as applyScreenAnchor,a0_0x2fe2bd as basePixi,a0_0x577153 as clearResponsiveElements,a0_0x2123bb as createPixiBase,a0_0x5d5c00 as getRegisteredFontIds,a0_0x2c6f42 as globalResponsiveMultipliers,a0_0x54989e as initAssetTextures,a0_0x2410f9 as initAssets,a0_0xc7a63a as layout,a0_0x3f68be as playLottieOverlay,a0_0x19c8d3 as registerFont,a0_0x357561 as registerType,a0_0x4d6aa3 as resolveAnchorVec2,a0_0x488cc6 as resolveFont,a0_0x415990 as resolveFontWeight,a0_0x59a7ce as resolveScreenAnchorPoint,a0_0x2d5f74 as resolveScreenRatioPoint,a0_0x4d5345 as runInitSequence,a0_0x2f846e as setLottieInstance,a0_0x136a8c as spawnSceneFromConfig,a0_0x5c313d 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 el={};ca(el,{AspectClass:()=>$n,GameObject:()=>dt,GameObjectManager:()=>Dt,Renderer:()=>ct,ResponsiveUISystem:()=>qe,Transform:()=>lt,animateHandClick:()=>Es,animatePanelEntrance:()=>Ss,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>bs,createTutorialLabel:()=>As,getAspectClass:()=>Ht,getRegisteredFontIds:()=>ws,loadAsset:()=>Nn,loadCharacterFrames:()=>_s,registerFont:()=>vs,resolveFont:()=>te,resolveFontWeight:()=>ne,updateHandAnimation:()=>Ts});module.exports=Er(el);var W=ge(require("three"),1);var he={};function vt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function wt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){vt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Cr(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 Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Tr(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 ya(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 ba(t,e){let n=Tr(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 va(){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=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Cr(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Ar(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.21",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,kr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,_a=G++,Ma=G++,Pa=G++,Ia=G++,T=kr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===_a}function Da(){return T===Ma}function en(){return T===Pa}function tn(){return T===Ia}function Na(){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=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Pa:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var xt=ge(require("lottie-web"),1),Fa=xt.default;typeof window!="undefined"&&(window.lottie=xt.default,window.__baseLottie=xt.default);var _r=require("pixi.js");var nn=require("pixi.js");var Mr=null;function an(t){Mr=t}Et();St();var Xe=require("pixi.js");Et();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function $r(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=$r(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=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 Nr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Ze();var At=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Br=new dn,Gr=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qa=require("pixi.js"),Z={width:400,height:600,designWidth:400,scaleFactor:1},et={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*Z.scaleFactor;n(t,Z.width,Z.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),Z.width=t,Z.height=e,Z.scaleFactor=Math.min(t/Z.designWidth,1.15),et.scale=Z.scaleFactor,et.position=1,console.log(`[SCREEN] Global multipliers - scale: ${et.scale.toFixed(3)}`),Wr()}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 Yr(t,e,n){let i=ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return ze}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Tt(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function tt(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Tt(t[0],e.x),y:Tt(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Tt(i.x,e.x),y:Tt(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=tt(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=tt(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,_,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(_=i.offset)==null?void 0:_.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*Z.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(ze))}function Qe(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 lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||tt,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function P(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Vc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Wc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Yc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var Kc=[...Xa];var yo=Xa[0];Q();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Pt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Qa=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Qa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var es=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new es.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");Ze();St();Q();var ns=require("pixi.js");var Eo=require("pixi.js");Q();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
46
+ `,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(r=>{r.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(r=>{r.addEventListener("click",o=>{let d=o.target.dataset.tab;d&&this.switchTab(d)})});let i=this.modal.querySelector("[data-ai-generate]");i==null||i.addEventListener("click",()=>{this.openAiEditor("generate")});let a=this.modal.querySelector("[data-ai-edit]");a==null||a.addEventListener("click",()=>{this.openAiEditor("edit")});let s=this.modal.querySelector("[data-modal-apply]");s==null||s.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",r=>{r.target===this.modal&&this.close()})}switchTab(e){if(!this.modal)return;this.modal.querySelectorAll("[data-tab]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab")===e)}),this.modal.querySelectorAll("[data-tab-panel]").forEach(a=>{a.classList.toggle("active",a.getAttribute("data-tab-panel")===e)})}openAiEditor(e){let n=window.__openAiEditor;if(typeof n!="function"){alert("AI Editor not available. Please check your setup.");return}let i="";e==="edit"&&this.currentAsset?i=`Edit this image: ${this.currentObjectId}`:i=`Create an image for: ${this.currentObjectId}`,n(this.currentObjectId||"unknown",i,this.currentAsset,{path:this.currentPath,onApply:a=>{this.onApplyCallback&&this.onApplyCallback(a),this.close()}})}apply(){this.onApplyCallback&&this.onApplyCallback("library/placeholder.png"),this.close()}close(){this.modal&&this.modal.parentNode&&this.modal.parentNode.removeChild(this.modal),this.modal=null,this.currentObjectId=null,this.currentPath=null,this.onApplyCallback=null}}});var el={};ca(el,{AspectClass:()=>$n,GameObject:()=>dt,GameObjectManager:()=>Dt,Renderer:()=>ct,ResponsiveUISystem:()=>qe,Transform:()=>lt,animateHandClick:()=>Es,animatePanelEntrance:()=>Ss,createBrushTexture:()=>Ms,createEndGamePanel:()=>xs,createHandTutorial:()=>Cs,createThreeBase:()=>bs,createTutorialLabel:()=>As,getAspectClass:()=>Ht,getRegisteredFontIds:()=>ws,loadAsset:()=>Nn,loadCharacterFrames:()=>_s,registerFont:()=>vs,resolveFont:()=>te,resolveFontWeight:()=>ne,updateHandAnimation:()=>Ts});module.exports=Er(el);var W=ge(require("three"),1);var he={};function vt(t,e,n=!1){he[t]||(he[t]=[]),he[t].push({fn:e,once:n})}function Zt(t,e){if(he[t]){if(!e){delete he[t];return}he[t]=he[t].filter(n=>n.fn!==e)}}function wt(t,...e){let n=he[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Zt(t,i.fn)}function B(t,e){vt(t,e,!0)}var M=null,V=[],Ie=null;function ga(t){M=t,V=[],Ie!==null&&(clearTimeout(Ie),Ie=null)}function ha(){var t,e,n;return{endpoint:(M==null?void 0:M.endpoint)||"",transport:(M==null?void 0:M.transport)||"beacon",batchSize:(t=M==null?void 0:M.batchSize)!=null?t:10,flushIntervalMs:(e=M==null?void 0:M.flushIntervalMs)!=null?e:300,maxQueue:(n=M==null?void 0:M.maxQueue)!=null?n:200,debug:!!(M!=null&&M.debug)}}async function pa(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let s=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",s,e);return}catch(s){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",s)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(s){i&&console.warn("[handler.telemetry] fetch failed",s)}}function Qt(t,e){let n=ha();if(e&&n.endpoint){if(V.push(t),V.length>n.maxQueue&&(V=V.slice(V.length-n.maxQueue)),V.length>=n.batchSize){ua();return}Ie===null&&(Ie=window.setTimeout(()=>{Ie=null,ua()},n.flushIntervalMs))}}async function ua(){let t=ha();if(!t.endpoint||V.length===0)return;let e=V.splice(0,t.batchSize);await pa(t.endpoint,{events:e},t.transport,t.debug),V.length>0&&await pa(t.endpoint,{events:V.splice(0,t.batchSize)},t.transport,t.debug)}function ma(t){return Math.max(0,Math.min(1,t))}function Cr(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 Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Ar(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function fa(t,e,n){try{t[e]=n}catch{}}function Tr(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 ya(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 ba(t,e){let n=Tr(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 va(){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=Ke();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let y=p-u.startMs-u.delayMs;if(y<0)continue;let h=u.durationMs>0?y/u.durationMs:1,w=ma(h),v=u.repeat>=0?u.repeat+1:1,b=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let S=h-b;w=ma(S)}let m=u.ease(w);u.yoyo&&b%2===1&&(m=1-m);for(let S of u.props)fa(u.target,S.key,S.from+(S.to-S.from)*m);u.scaleFrom&&u.scaleTo&&ya(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*m,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*m});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){r(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var S;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),y=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((S=g==null?void 0:g.delayMsOverride)!=null?S:0)),h=Cr(c.ease),w=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,b=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),m=[];for(let E of Object.keys(c)){if(b.has(E))continue;let C=c[E];typeof C=="number"&&m.push({key:E,from:Ar(p,E),to:C})}let f=ba(p,c);return{target:p,startMs:Ke(),delayMs:y,durationMs:u,ease:h,props:m,scaleFrom:f.from,scaleTo:f.to,repeat:w,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>r(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ke())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ke(),y=Ke()-u;g.startMs+=y,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let y=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof y=="number"&&fa(p,u,y)}let g=ba(p,c);g.to&&ya(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))r(g)},timeline(p={}){let c=[],g=0,u=!1,y=[],h=b=>{if(typeof b=="number")return Math.max(0,b*1e3);let m=typeof b=="string"?b.trim():"";return m.startsWith("+=")?g+Math.max(0,Number(m.slice(2))*1e3||0):m?Math.max(0,Number(m)*1e3||0):g},w=b=>{c.push(b);let m=Math.max(0,(typeof b.vars.duration=="number"?b.vars.duration:.5)*1e3);g=Math.max(g,b.atMs+m)},v={to(b,m,f){return w({kind:"to",target:b,vars:m,atMs:h(f)}),v},fromTo(b,m,f,S){return w({kind:"fromTo",target:b,vars:f,from:m,atMs:h(S)}),v},play(){var b,m;if(u)return v;u=!0,y=[];for(let f of c)f.kind==="fromTo"&&d.set(f.target,(b=f.from)!=null?b:{}),y.push(d.to(f.target,{...f.vars,delay:f.atMs/1e3+((m=f.vars.delay)!=null?m:0)}));return v},pause(){for(let b of y)b.pause();return v},kill(){for(let b of y)b.kill();y=[],u=!1}};return p.paused||v.play(),v}};return d}function wa(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=va()}catch{}}var xa={name:"handler-playable-sdk",version:"1.0.23",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && mkdir -p dist/cli/student-helper && cp src/cli/student-helper/*.mjs dist/cli/student-helper/ && chmod +x dist/cli/*.mjs dist/cli/student-helper/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web --external jszip && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs dist/cli/student-helper/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,kr=G++,Sa=G++,Ea=G++,Ca=G++,Aa=G++,Ta=G++,La=G++,ka=G++,_a=G++,Ma=G++,Pa=G++,Ia=G++,T=kr;function ja(){return T===Sa}function Oa(){return T===Ea}function Ra(){return T===Ca}function za(){return T===Aa}function je(){return T===Ta}function Oe(){return T===La}function $a(){return T===ka}function Ha(){return T===_a}function Da(){return T===Ma}function en(){return T===Pa}function tn(){return T===Ia}function Na(){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=Sa;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=Ea;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=Ca)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Aa)}catch{}else if(e==="mintegral")window.gameReady&&(T=Ta);else if(e==="tapjoy")window.TJ_API&&(T=La);else if(e==="tiktok")window.openAppStore&&(T=ka);else if(e==="smadex")try{window.smxTracking&&(T=_a)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=Ma)}catch{}else e==="vungle"?T=Pa:(t==="nucleo"||e==="nucleo")&&(T=Ia)}var xt=ge(require("lottie-web"),1),Fa=xt.default;typeof window!="undefined"&&(window.lottie=xt.default,window.__baseLottie=xt.default);var _r=require("pixi.js");var nn=require("pixi.js");var Mr=null;function an(t){Mr=t}Et();St();var Xe=require("pixi.js");Et();var zr=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",ln=zr;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(ln=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${ln}`))}}catch{}function $r(t){var n,i,a,s,r;if(typeof window!="undefined"&&window.resolveAnchorVec2)return window.resolveAnchorVec2(t);let e={center:{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};if(Array.isArray(t))return{x:(n=t[0])!=null?n:.5,y:(i=t[1])!=null?i:.5};if(t&&typeof t=="object"&&"x"in t&&"y"in t)return{x:(a=t.x)!=null?a:.5,y:(s=t.y)!=null?s:.5};if(typeof t=="string"){let o=t.trim().toLowerCase();return(r=e[o])!=null?r:{x:.5,y:.5}}return null}var fe=class{static async create(e,n,i){var l,d,p,c,g,u,y;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${ln}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Xe.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let s=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${s}, type: ${a.type}, path: ${a.path}`);let r=await Ce.load(e,a,i,s);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=r==null?void 0:r.constructor)==null?void 0:p.name}`);let o;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",r,"for object:",e),o=new Xe.Sprite(r),console.log("[ObjectFactory] Created object:",o,"type:",(c=o==null?void 0:o.constructor)==null?void 0:c.name),this.applyTransform(o,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=r==null?void 0:r.constructor)==null?void 0:g.name,r),r&&(((u=r.constructor)==null?void 0:u.name)==="Container"||r instanceof Xe.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],w=!1;for(let v of h)try{let b=await fetch(v);if(b.ok){o=await b.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(y=o==null?void 0:o.constructor)==null?void 0:y.name),w=!0;break}}catch{continue}w||(console.error("[ObjectFactory] Failed to reload JSON from any path"),o=r)}else o=r;else o=r,o&&typeof o=="object"&&("x"in o||"position"in o)&&this.applyTransform(o,n==null?void 0:n.transform,n);return o}static applyTransform(e,n,i){var a,s,r,o;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(s=n.position.y)!=null?s:0):"position"in e&&e.position&&e.position.set((r=n.position.x)!=null?r:0,(o=n.position.y)!=null?o:0)),n.scale!==void 0&&"scale"in e&&e.scale&&(typeof e.scale=="object"&&"set"in e.scale?e.scale.set(n.scale):e.scale=n.scale),n.rotation!==void 0&&"rotation"in e&&(e.rotation=n.rotation),n.anchor&&"anchor"in e&&e.anchor)){let l=$r(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Je=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 Nr=ge(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Nr);Ze();var At=require("pixi.js");Ze();var dn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Je}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async s=>{var o;let r=this.registry.get(s);if(!r){console.warn("[Assets] No config found for object:",s);return}try{let l=await fe.create(s,r,this.app);this.instanceCache.set(s,l),console.log("[Assets] Loaded object:",s,(o=l==null?void 0:l.constructor)==null?void 0:o.name)}catch(l){console.error("[Assets] Failed to load object:",s,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(s=>!this.instanceCache.has(s));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await fe.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Br=new dn,Gr=new Proxy(Br,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Ze();var qa=require("pixi.js"),Z={width:400,height:600,designWidth:400,scaleFactor:1},et={scale:1,position:1},un=[];function Vr(t,e,n,i,a,s,r){un.push({element:t,originalScale:s,positionHelper:e,heightPercent:a}),e(t,n,i,a,s,r,!1)}function Wr(){un.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*Z.scaleFactor;n(t,Z.width,Z.height,i,a,!0,!1)})}function pn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),Z.width=t,Z.height=e,Z.scaleFactor=Math.min(t/Z.designWidth,1.15),et.scale=Z.scaleFactor,et.position=1,console.log(`[SCREEN] Global multipliers - scale: ${et.scale.toFixed(3)}`),Wr()}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 Yr(t,e,n){let i=ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Kr(){return ze}var Xr={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Tt(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function tt(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Tt(t[0],e.x),y:Tt(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Tt(i.x,e.x),y:Tt(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Xr[i])!=null?n:e}return e}function gn(t,e,n,i={}){var u,y,h,w,v,b;let a=tt(n),s=(u=i.inset)!=null?u:{},r=(y=i.padding)!=null?y:{x:0,y:0},o=((h=s.left)!=null?h:0)+r.x,l=((w=s.right)!=null?w:0)+r.x,d=((v=s.top)!=null?v:0)+r.y,p=((b=s.bottom)!=null?b:0)+r.y,c=Math.max(0,t-o-l),g=Math.max(0,e-d-p);return{x:o+c*a.x,y:d+g*a.y}}function hn(t,e,n,i={}){var h,w,v,b,m,f;let a=(h=i.inset)!=null?h:{},s=(w=i.padding)!=null?w:{x:0,y:0},r=((v=a.left)!=null?v:0)+s.x,o=((b=a.right)!=null?b:0)+s.x,l=((m=a.top)!=null?m:0)+s.y,d=((f=a.bottom)!=null?f:0)+s.y,p=Math.max(0,t-r-o),c=Math.max(0,e-l-d),g=tt(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),y=Math.min(Math.max(g.y,0),1);return{x:r+p*u,y:l+c*y}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,pn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),pn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Yr,window.getDebugConfig=Kr,window.copyConfig=oo,window.applyConfig=Qe,window.applyConfigForRatio=lo,window.positionAtBottom=Va,window.positionAtTop=Qr,window.positionAtCenter=eo,window.positionAtLeft=to,window.positionAtRight=no,window.positionAtBottomLeft=io,window.positionAtBottomRight=ao,window.positionAtTopLeft=so,window.positionAtTopRight=ro,window.applyPositionContract=Zr,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Lt(t,e,n=0){return t*e+n}function kt(t,e,n=0){return t*(1-e)+n}function _t(t,e,n=0){return t*e+n}function Mt(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Jr(t,e){return t*e}function Zr(t,e,n,i){var r,o,l,d,p,c,g,u,y,h,w,v,b,m,f,S,E,C,_,I;let a=0,s=0;switch(i.type){case"top":a=U(e,(o=(r=i.offset)==null?void 0:r.x)!=null?o:0),s=Lt(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),s=kt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=_t(e,i.percent,(h=(y=i.offset)==null?void 0:y.x)!=null?h:0),s=U(n,(v=(w=i.offset)==null?void 0:w.y)!=null?v:0);break;case"right":a=Mt(e,i.percent,(m=(b=i.offset)==null?void 0:b.x)!=null?m:0),s=U(n,(S=(f=i.offset)==null?void 0:f.y)!=null?S:0);break;case"center":a=U(e,(C=(E=i.offset)==null?void 0:E.x)!=null?C:0),s=U(n,(I=(_=i.offset)==null?void 0:_.y)!=null?I:0);break}t.position?t.position.set(a,s):(t.x=a,t.y=s),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function Va(t,e,n,i=.2,a=1,s=!0,r=!1){let o=Jr(n,i),l=kt(n,i/2);ce(t,U(e),l);let d=s?a*Z.scaleFactor:a;de(t,d),r&&!un.find(p=>p.element===t)&&Vr(t,Va,e,n,i,a,s)}function Qr(t,e,n,i=.1,a=1){ce(t,U(e),Lt(n,i)),de(t,a)}function eo(t,e,n,i=0,a=0,s=1){ce(t,U(e,i),U(n,a)),de(t,s)}function to(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function no(t,e,n,i=.1,a=1){ce(t,Mt(e,i),U(n)),de(t,a)}function io(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),kt(n,i)),de(t,s)}function ao(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),kt(n,i)),de(t,s)}function so(t,e,n,i=.05,a=.05,s=1){ce(t,_t(e,a),Lt(n,i)),de(t,s)}function ro(t,e,n,i=.05,a=.05,s=1){ce(t,Mt(e,a),Lt(n,i)),de(t,s)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ae={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function oo(t){return t&&Ae[t]?JSON.parse(JSON.stringify(Ae[t])):JSON.parse(JSON.stringify(ze))}function Qe(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 lo(t,e){let n=t/e;n>1.6?(Qe(Ae.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Qe(Ae.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Qe(Ae.square),console.log("Applied SQUARE config for ratio:",n)):(Qe(Ae.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ae,t.resolveAnchorVec2=t.resolveAnchorVec2||tt,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||gn,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||hn}yn();function P(t,e){let n=(a,s)=>s===0?a:n(s,a%s),i=n(t,e);return`${t/i}:${e/i}`}var Vc=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:P(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:P(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:P(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:P(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:P(360,780)}],Wc=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:P(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:P(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:P(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:P(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:P(412,915)}],Yc=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:P(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:P(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:P(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:P(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:P(800,1280)}],Xa=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var Kc=[...Xa];var yo=Xa[0];Q();function bo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function vo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}async function wo(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function bn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let s=await bo(a),r=await wo(s),o=vo(s);return console.log("[ImageUtils] Success resolution:",r==null?void 0:r.width,"x",r==null?void 0:r.height,"mime:",o.mimeType),{base64:o.base64,mimeType:o.mimeType,dataUrl:s,width:(e=r==null?void 0:r.width)!=null?e:0,height:(n=r==null?void 0:r.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function Pt(t,e=30){try{console.log("[ImageUtils] Removing background color...");let n=await new Promise((c,g)=>{let u=new Image;u.onload=()=>c(u),u.onerror=()=>g(new Error("Failed to load image")),u.src=t}),i=document.createElement("canvas");i.width=n.width,i.height=n.height;let a=i.getContext("2d");if(!a)return console.error("[ImageUtils] Failed to get canvas context"),t;a.drawImage(n,0,0);let s=a.getImageData(0,0,i.width,i.height),r=s.data,l=[{name:"top-left",offset:0},{name:"top-right",offset:(i.width-1)*4},{name:"bottom-left",offset:(i.height-1)*i.width*4},{name:"bottom-right",offset:((i.height-1)*i.width+(i.width-1))*4}].map(c=>({r:r[c.offset],g:r[c.offset+1],b:r[c.offset+2]})),d=0;for(let c=0;c<r.length;c+=4){let g=r[c],u=r[c+1],y=r[c+2],h=!1;for(let w of l)if(Math.sqrt(Math.pow(g-w.r,2)+Math.pow(u-w.g,2)+Math.pow(y-w.b,2))<e){h=!0;break}h&&(r[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(s,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Qa=require("@google/genai");async function vn(t,e,n=[],i={}){var a,s,r,o,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let b=n[v];if(!b.base64||!b.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(b.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!b.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${b.mimeType}`)}let c=new Qa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,b)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${b+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let y=await c.models.generateContent({model:g,contents:u}),h="",w=(r=(s=(a=y.candidates)==null?void 0:a[0])==null?void 0:s.content)==null?void 0:r.parts;if(w)for(let v of w)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(o=c.message)!=null&&o.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var es=require("@google/genai");async function It(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new es.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");Ze();St();Q();var ns=require("pixi.js");var Eo=require("pixi.js");Q();function jo(t){return new Promise((e,n)=>{let i=new FileReader;i.onerror=()=>n(new Error("FileReader failed")),i.onload=()=>e(String(i.result||"")),i.readAsDataURL(t)})}function Oo(t){var a;let[e,n]=t.split(","),i=e==null?void 0:e.match(/data:(.*?);base64/);return{base64:n!=null?n:"",mimeType:(a=i==null?void 0:i[1])!=null?a:"image/png"}}function Ro(t){return`
47
47
  Analyze these screenshots of a brand or game and extract its "Brand DNA".
48
48
 
49
49
  Provide a concise summary (2-3 sentences) covering: