handler-playable-sdk 0.3.72 → 0.3.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-RSBYFD7B.js → chunk-UT2KLJ77.js} +42 -46
- package/dist/cli/brand-dna.mjs +1 -1
- package/dist/cli/canva-import.mjs +1 -1
- package/dist/cli/cleanup-assets.mjs +1 -1
- package/dist/cli/fix-scales.mjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/screen-helper.mjs +1 -1
- package/dist/cli/setup-library.mjs +1 -1
- package/dist/cli/student-helper.mjs +1 -1
- package/dist/cli/sync-screens.mjs +1 -1
- package/dist/cli/validate-assets.mjs +1 -1
- package/dist/cli/validate.mjs +1 -1
- package/dist/index.cjs +41 -45
- package/dist/index.css +45 -2
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +1 -1
- package/dist/pixi/index.css +45 -2
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +1 -1
- package/dist/three/index.css +45 -2
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -2830,6 +2830,7 @@
|
|
|
2830
2830
|
|
|
2831
2831
|
.preview-shell.layout-fixed .workbench-header,
|
|
2832
2832
|
.preview-shell.layout-fixed .console-header,
|
|
2833
|
+
.preview-shell.layout-fixed .library-panel .scene-panel-header,
|
|
2833
2834
|
.preview-shell.layout-fixed .workbench-tab[data-tab="library"],
|
|
2834
2835
|
.preview-shell.layout-fixed .workbench-tab-panel[data-tab-panel="library"],
|
|
2835
2836
|
.preview-shell.layout-fixed .console-panel.docked-hidden,
|
|
@@ -2890,19 +2891,29 @@
|
|
|
2890
2891
|
flex: 1;
|
|
2891
2892
|
overflow: hidden;
|
|
2892
2893
|
position: relative;
|
|
2894
|
+
display: flex;
|
|
2895
|
+
gap: 0;
|
|
2893
2896
|
}
|
|
2894
2897
|
|
|
2895
2898
|
.bottom-dock-panel {
|
|
2896
|
-
display:
|
|
2899
|
+
display: flex;
|
|
2900
|
+
flex-direction: column;
|
|
2897
2901
|
height: 100%;
|
|
2902
|
+
flex: 1;
|
|
2903
|
+
border-right: 1px solid var(--ui-border);
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
.bottom-dock-panel:last-child {
|
|
2907
|
+
border-right: none;
|
|
2898
2908
|
}
|
|
2899
2909
|
|
|
2900
2910
|
.bottom-dock-panel.active {
|
|
2901
|
-
display:
|
|
2911
|
+
display: flex;
|
|
2902
2912
|
}
|
|
2903
2913
|
|
|
2904
2914
|
#dock-console-content {
|
|
2905
2915
|
background: var(--ui-bg-1);
|
|
2916
|
+
flex: 1;
|
|
2906
2917
|
}
|
|
2907
2918
|
|
|
2908
2919
|
#dock-console-content .console-messages {
|
|
@@ -2911,6 +2922,18 @@
|
|
|
2911
2922
|
padding: 12px;
|
|
2912
2923
|
}
|
|
2913
2924
|
|
|
2925
|
+
#dock-library-content {
|
|
2926
|
+
flex: 1.5;
|
|
2927
|
+
/* Give library more space */
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
#dock-library-content .library-panel {
|
|
2931
|
+
width: 100% !important;
|
|
2932
|
+
height: 100% !important;
|
|
2933
|
+
border-radius: 0;
|
|
2934
|
+
border: none;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2914
2937
|
.bottom-dock-resize-handle {
|
|
2915
2938
|
position: absolute;
|
|
2916
2939
|
top: 0;
|
|
@@ -2978,7 +3001,10 @@
|
|
|
2978
3001
|
.workbench-content {
|
|
2979
3002
|
flex: 1;
|
|
2980
3003
|
overflow-y: auto;
|
|
3004
|
+
overflow-x: hidden;
|
|
2981
3005
|
padding: var(--space-md);
|
|
3006
|
+
min-width: 0;
|
|
3007
|
+
/* Allow shrinking below content size */
|
|
2982
3008
|
}
|
|
2983
3009
|
|
|
2984
3010
|
.workbench-tab-panel {
|
|
@@ -3529,6 +3555,8 @@
|
|
|
3529
3555
|
.workbench-content .scene-panel {
|
|
3530
3556
|
position: static;
|
|
3531
3557
|
width: 100% !important;
|
|
3558
|
+
min-width: 0 !important;
|
|
3559
|
+
max-width: 100% !important;
|
|
3532
3560
|
max-height: none !important;
|
|
3533
3561
|
|
|
3534
3562
|
/* Preserve “card” styling so embedded panels don't look unstyled */
|
|
@@ -3539,6 +3567,21 @@
|
|
|
3539
3567
|
overflow: hidden;
|
|
3540
3568
|
}
|
|
3541
3569
|
|
|
3570
|
+
/* Specific overrides for panels that have hardcoded widths */
|
|
3571
|
+
.workbench-content .inspector-panel,
|
|
3572
|
+
.workbench-content .library-panel,
|
|
3573
|
+
.workbench-content .ai-tools-panel {
|
|
3574
|
+
width: 100% !important;
|
|
3575
|
+
min-width: 0 !important;
|
|
3576
|
+
max-width: 100% !important;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
.workbench-content .inspector-header,
|
|
3580
|
+
.workbench-content .ai-tabs {
|
|
3581
|
+
margin-left: 0;
|
|
3582
|
+
margin-right: 0;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3542
3585
|
.workbench-content .scene-panel-header {
|
|
3543
3586
|
display: none;
|
|
3544
3587
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,a}from"./chunk-
|
|
1
|
+
import{E as F,F as G,G as H,H as I,I as J,J as K,K as L,L as M,M as N,N as O,O as P,P as Q,Q as R,R as S,S as T,T as U,U as V,a}from"./chunk-UT2KLJ77.js";import"./chunk-I5OOVR5U.js";import{a as q,b as r,c as s,d as t,e as u,f as v,g as w,h as x,i as y,j as z,k as A,l as B,m as C,n as D,o as E}from"./chunk-LV4HGC5G.js";import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l,l as m,m as n,n as o,o as p}from"./chunk-ZLL42OOV.js";import"./chunk-E6WJCS24.js";import"./chunk-JXBG6UFL.js";export{Q as COLORS,B as ConfigWatcher,K as DebugPanel,A as DefaultReloadStrategy,U as Handler,T as PlayableLoadingScreen,L as PreviewShell,R as STROKE_WIDTH,S as THEME,d as applyConfigOverride,e as applyConfigOverrides,n as applyConfigsToDisk,x as applyDefaults,a as baseLottie,P as bootstrap,f as clearConfigOverrides,g as clearConfigOverridesForObject,j as configOverrideManager,M as createPreviewShell,k as deepClone,V as default,H as defaultPreset,G as deviceGroups,F as devicePresets,C as diffConfigs,l as exportConfigsAsJSON,i as getConfigOverrides,m as getConfigStateSummary,b as getOverrideMode,I as getPresetById,J as getPresetsByCategory,s as loadAllObjectConfigs,q as loadComponentSchemas,t as loadEngineConfig,u as loadGamePromptConfig,y as loadObjectCentricConfig,r as loadObjectConfig,v as loadSceneConfig,D as rehydrateObject,h as removeConfigOverride,o as resetToApplied,p as resetToOriginal,O as setBootstrapDependencies,c as setOverrideMode,E as setupHotReload,N as setupLiveEditBridge,z as toLegacyFormat,w as validateObjectConfig};
|
package/dist/pixi/index.cjs
CHANGED
|
@@ -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(o=>{o.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(o=>{o.addEventListener("click",s=>{let c=s.target.dataset.tab;c&&this.switchTab(c)})});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 r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",o=>{o.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 Hr={};Vi(Hr,{AssetCache:()=>Q,AssetLoader:()=>he,AssetSystem:()=>It,AssetTextures:()=>fe,Assets:()=>pa,BaseSystem:()=>He,GameEngine:()=>Ot,GameObject:()=>st,GameObjectManager:()=>$e,ObjectFactory:()=>me,Renderer:()=>ot,RuntimeObjectRegistry:()=>Ne,Transform:()=>rt,applyScreenAnchor:()=>Dt,basePixi:()=>sa,clearResponsiveElements:()=>ga,createPixiBase:()=>Mt,getRegisteredFontIds:()=>na,globalResponsiveMultipliers:()=>ct,initAssetTextures:()=>At,initAssets:()=>ua,layout:()=>fa,playLottieOverlay:()=>ra,registerFont:()=>ia,registerType:()=>wt,resolveAnchorVec2:()=>Ce,resolveFont:()=>ea,resolveFontWeight:()=>ta,resolveScreenAnchorPoint:()=>Be,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>ma,setLottieInstance:()=>St,spawnSceneFromConfig:()=>ca,updateScreenState:()=>Rt});module.exports=Ea(Hr);var Qn=require("pixi.js");var pe={};function mt(i,e,t=!1){pe[i]||(pe[i]=[]),pe[i].push({fn:e,once:t})}function Gt(i,e){if(pe[i]){if(!e){delete pe[i];return}pe[i]=pe[i].filter(t=>t.fn!==e)}}function bt(i,...e){let t=pe[i];if(t)for(let n of[...t])n.fn(...e),n.once&&Gt(i,n.fn)}function q(i,e){mt(i,e,!0)}var D=null,Y=[],Te=null;function Xi(i){D=i,Y=[],Te!==null&&(clearTimeout(Te),Te=null)}function Ji(){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 Yi(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(i,e){let t=Ji();if(e&&t.endpoint){if(Y.push(i),Y.length>t.maxQueue&&(Y=Y.slice(Y.length-t.maxQueue)),Y.length>=t.batchSize){Ki();return}Te===null&&(Te=window.setTimeout(()=>{Te=null,Ki()},t.flushIntervalMs))}}async function Ki(){let i=Ji();if(!i.endpoint||Y.length===0)return;let e=Y.splice(0,i.batchSize);await Yi(i.endpoint,{events:e},i.transport,i.debug),Y.length>0&&await Yi(i.endpoint,{events:Y.splice(0,i.batchSize)},i.transport,i.debug)}function Zi(i){return Math.max(0,Math.min(1,i))}function Aa(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 Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Sa(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function Qi(i,e,t){try{i[e]=t}catch{}}function Ca(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 en(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 tn(i,e){let t=Ca(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 nn(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,s(),i.size>0&&n()})},a=u=>{var p;i.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),n()},r=u=>{i.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},o=u=>{u.killed||(u.killed=!0,r(u))},s=()=>{var l,p;let u=Ke();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,A=Zi(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;A=Zi(y)}let x=g.ease(A);g.yoyo&&h%2===1&&(x=1-x);for(let y of g.props)Qi(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&en(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(f>=b){o(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Aa(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(l)){if(h.has(I))continue;let R=l[I];typeof R=="number"&&x.push({key:I,from:Sa(u,I),to:R})}let w=tn(u,l);return{target:u,startMs:Ke(),delayMs:m,durationMs:g,ease:f,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>o(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ke())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:Ke(),m=Ke()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&Qi(u,g,m)}let p=tn(u,l);p.to&&en(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))o(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=h=>{l.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+x)},b={to(h,x,w){return A({kind:"to",target:h,vars:x,atMs:f(w)}),b},fromTo(h,x,w,y){return A({kind:"fromTo",target:h,vars:w,from:x,atMs:f(y)}),b},play(){var h,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(h=w.from)!=null?h:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x: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 c}function an(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=nn()}catch{}}var rn={name:"handler-playable-sdk",version:"0.3.72",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,La=V++,on=V++,sn=V++,ln=V++,cn=V++,dn=V++,pn=V++,un=V++,gn=V++,hn=V++,fn=V++,mn=V++,P=La;function bn(){return P===on}function yn(){return P===sn}function vn(){return P===ln}function xn(){return P===cn}function Le(){return P===dn}function ke(){return P===pn}function wn(){return P===un}function En(){return P===gn}function An(){return P===hn}function Vt(){return P===fn}function Wt(){return P===mn}function Sn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),P=on;return}catch{}else if(i==="dapi")try{dapi.isReady(),P=sn;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(P=ln)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(P=cn)}catch{}else if(e==="mintegral")window.gameReady&&(P=dn);else if(e==="tapjoy")window.TJ_API&&(P=pn);else if(e==="tiktok")window.openAppStore&&(P=un);else if(e==="smadex")try{window.smxTracking&&(P=gn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(P=hn)}catch{}else e==="vungle"?P=fn:(i==="nucleo"||e==="nucleo")&&(P=mn)}var yt=ft(require("lottie-web"),1),Cn=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);Xt();function $(i,e){let t=(a,r)=>r===0?a:t(r,a%r),n=t(i,e);return`${i/n}:${e/n}`}var vo=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],xo=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],wo=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],_n=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var Eo=[..._n];var Ra=_n[0];ue();var Ba=ft(require("jszip"),1);function za(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 Ha(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 Na(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 Jt(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 r=await za(a),o=await Na(r),s=Ha(r);return console.log("[ImageUtils] Success resolution:",o==null?void 0:o.width,"x",o==null?void 0:o.height,"mime:",s.mimeType),{base64:s.base64,mimeType:s.mimeType,dataUrl:r,width:(e=o==null?void 0:o.width)!=null?e:0,height:(t=o==null?void 0:o.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function vt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=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 r=a.getImageData(0,0,n.width,n.height),o=r.data,d=[{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(l=>({r:o[l.offset],g:o[l.offset+1],b:o[l.offset+2]})),c=0;for(let l=0;l<o.length;l+=4){let p=o[l],g=o[l+1],m=o[l+2],f=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){f=!0;break}f&&(o[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var Mn=require("@google/genai");async function Zt(i,e,t=[],n={}){var a,r,o,s,d,c,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 l=new Mn.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 l.models.generateContent({model:p,contents:g}),f="",A=(o=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:o.parts;if(A)for(let b of A)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(l){throw console.error("[Gemini] API error:",l),(s=l.message)!=null&&s.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Pn=require("@google/genai");async function xt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Pn.GoogleGenAI({apiKey:i}),r=[{text:e}];t.length>0&&t.forEach((s,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:s.mimeType,data:s.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let o=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!o.candidates||!o.candidates[0]||!o.candidates[0].content||!o.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let s of o.candidates[0].content.parts)if(s.text)console.log(s.text);else if(s.inlineData){let d=s.inlineData.data,c=s.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Wa=require("pixi.js");Xe();ue();var $n=require("pixi.js");var Ya=require("pixi.js");ue();function tr(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 ir(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 nr(i){return`
|
|
46
|
+
`,this.modal=n}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(o=>{o.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(o=>{o.addEventListener("click",s=>{let c=s.target.dataset.tab;c&&this.switchTab(c)})});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 r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",o=>{o.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 Hr={};Vi(Hr,{AssetCache:()=>Q,AssetLoader:()=>he,AssetSystem:()=>It,AssetTextures:()=>fe,Assets:()=>pa,BaseSystem:()=>He,GameEngine:()=>Ot,GameObject:()=>st,GameObjectManager:()=>$e,ObjectFactory:()=>me,Renderer:()=>ot,RuntimeObjectRegistry:()=>Ne,Transform:()=>rt,applyScreenAnchor:()=>Dt,basePixi:()=>sa,clearResponsiveElements:()=>ga,createPixiBase:()=>Mt,getRegisteredFontIds:()=>na,globalResponsiveMultipliers:()=>ct,initAssetTextures:()=>At,initAssets:()=>ua,layout:()=>fa,playLottieOverlay:()=>ra,registerFont:()=>ia,registerType:()=>wt,resolveAnchorVec2:()=>Ce,resolveFont:()=>ea,resolveFontWeight:()=>ta,resolveScreenAnchorPoint:()=>Be,resolveScreenRatioPoint:()=>Fe,runInitSequence:()=>ma,setLottieInstance:()=>St,spawnSceneFromConfig:()=>ca,updateScreenState:()=>Rt});module.exports=Ea(Hr);var Qn=require("pixi.js");var pe={};function mt(i,e,t=!1){pe[i]||(pe[i]=[]),pe[i].push({fn:e,once:t})}function Gt(i,e){if(pe[i]){if(!e){delete pe[i];return}pe[i]=pe[i].filter(t=>t.fn!==e)}}function bt(i,...e){let t=pe[i];if(t)for(let n of[...t])n.fn(...e),n.once&&Gt(i,n.fn)}function q(i,e){mt(i,e,!0)}var D=null,Y=[],Te=null;function Xi(i){D=i,Y=[],Te!==null&&(clearTimeout(Te),Te=null)}function Ji(){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 Yi(i,e,t,n){let a=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(i,new Blob([a],{type:"application/json"}));n&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){n&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),n&&console.log("[handler.telemetry] fetch",e)}catch(r){n&&console.warn("[handler.telemetry] fetch failed",r)}}function qt(i,e){let t=Ji();if(e&&t.endpoint){if(Y.push(i),Y.length>t.maxQueue&&(Y=Y.slice(Y.length-t.maxQueue)),Y.length>=t.batchSize){Ki();return}Te===null&&(Te=window.setTimeout(()=>{Te=null,Ki()},t.flushIntervalMs))}}async function Ki(){let i=Ji();if(!i.endpoint||Y.length===0)return;let e=Y.splice(0,i.batchSize);await Yi(i.endpoint,{events:e},i.transport,i.debug),Y.length>0&&await Yi(i.endpoint,{events:Y.splice(0,i.batchSize)},i.transport,i.debug)}function Zi(i){return Math.max(0,Math.min(1,i))}function Aa(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 Ke(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Sa(i,e){let t=i==null?void 0:i[e];return typeof t=="number"?t:0}function Qi(i,e,t){try{i[e]=t}catch{}}function Ca(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 en(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 tn(i,e){let t=Ca(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 nn(){let i=new Set,e=new WeakMap,t=null,n=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,s(),i.size>0&&n()})},a=u=>{var p;i.add(u);let l=(p=e.get(u.target))!=null?p:new Set;l.add(u),e.set(u.target,l),n()},r=u=>{i.delete(u);let l=e.get(u.target);l&&(l.delete(u),l.size===0&&e.delete(u.target))},o=u=>{u.killed||(u.killed=!0,r(u))},s=()=>{var l,p;let u=Ke();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,A=Zi(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;A=Zi(y)}let x=g.ease(A);g.yoyo&&h%2===1&&(x=1-x);for(let y of g.props)Qi(g.target,y.key,y.from+(y.to-y.from)*x);g.scaleFrom&&g.scaleTo&&en(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*x,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*x});try{(l=g.onUpdate)==null||l.call(g)}catch{}if(f>=b){o(g);try{(p=g.onComplete)==null||p.call(g)}catch{}}}},d=(u,l,p)=>{var y;let g=Math.max(0,(typeof l.duration=="number"?l.duration:.5)*1e3),m=Math.max(0,(typeof l.delay=="number"?l.delay:0)*1e3+((y=p==null?void 0:p.delayMsOverride)!=null?y:0)),f=Aa(l.ease),A=typeof l.repeat=="number"?Math.max(0,l.repeat|0):0,b=l.yoyo===!0,h=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),x=[];for(let I of Object.keys(l)){if(h.has(I))continue;let R=l[I];typeof R=="number"&&x.push({key:I,from:Sa(u,I),to:R})}let w=tn(u,l);return{target:u,startMs:Ke(),delayMs:m,durationMs:g,ease:f,props:x,scaleFrom:w.from,scaleTo:w.to,repeat:A,yoyo:b,onUpdate:typeof l.onUpdate=="function"?l.onUpdate:void 0,onComplete:typeof l.onComplete=="function"?l.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(u,l){let p=d(u,l);return a(p),{kill:()=>o(p),pause:()=>{p.paused||(p.paused=!0,p.pauseAtMs=Ke())},resume:()=>{var f;if(!p.paused)return;let g=(f=p.pauseAtMs)!=null?f:Ke(),m=Ke()-g;p.startMs+=m,p.paused=!1,p.pauseAtMs=null},isActive:()=>!p.killed&&!p.paused}},fromTo(u,l,p){return c.set(u,l),c.to(u,p)},set(u,l){if(!u||!l)return;for(let g of Object.keys(l)){let m=l[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&Qi(u,g,m)}let p=tn(u,l);p.to&&en(u,p.to)},killTweensOf(u){let l=e.get(u);if(l)for(let p of Array.from(l))o(p)},timeline(u={}){let l=[],p=0,g=!1,m=[],f=h=>{if(typeof h=="number")return Math.max(0,h*1e3);let x=typeof h=="string"?h.trim():"";return x.startsWith("+=")?p+Math.max(0,Number(x.slice(2))*1e3||0):x?Math.max(0,Number(x)*1e3||0):p},A=h=>{l.push(h);let x=Math.max(0,(typeof h.vars.duration=="number"?h.vars.duration:.5)*1e3);p=Math.max(p,h.atMs+x)},b={to(h,x,w){return A({kind:"to",target:h,vars:x,atMs:f(w)}),b},fromTo(h,x,w,y){return A({kind:"fromTo",target:h,vars:w,from:x,atMs:f(y)}),b},play(){var h,x;if(g)return b;g=!0,m=[];for(let w of l)w.kind==="fromTo"&&c.set(w.target,(h=w.from)!=null?h:{}),m.push(c.to(w.target,{...w.vars,delay:w.atMs/1e3+((x=w.vars.delay)!=null?x: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 c}function an(){if(typeof window=="undefined")return;let i=window;if(!i.gsap)try{i.gsap=nn()}catch{}}var rn={name:"handler-playable-sdk",version:"0.3.74",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var V=0,La=V++,on=V++,sn=V++,ln=V++,cn=V++,dn=V++,pn=V++,un=V++,gn=V++,hn=V++,fn=V++,mn=V++,P=La;function bn(){return P===on}function yn(){return P===sn}function vn(){return P===ln}function xn(){return P===cn}function Le(){return P===dn}function ke(){return P===pn}function wn(){return P===un}function En(){return P===gn}function An(){return P===hn}function Vt(){return P===fn}function Wt(){return P===mn}function Sn(){let i=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(i==="mraid")try{mraid.getState(),P=on;return}catch{}else if(i==="dapi")try{dapi.isReady(),P=sn;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(P=ln)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(P=cn)}catch{}else if(e==="mintegral")window.gameReady&&(P=dn);else if(e==="tapjoy")window.TJ_API&&(P=pn);else if(e==="tiktok")window.openAppStore&&(P=un);else if(e==="smadex")try{window.smxTracking&&(P=gn)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(P=hn)}catch{}else e==="vungle"?P=fn:(i==="nucleo"||e==="nucleo")&&(P=mn)}var yt=ft(require("lottie-web"),1),Cn=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);Xt();function $(i,e){let t=(a,r)=>r===0?a:t(r,a%r),n=t(i,e);return`${i/n}:${e/n}`}var vo=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:$(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:$(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:$(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:$(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:$(360,780)}],xo=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:$(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:$(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:$(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:$(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:$(412,915)}],wo=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:$(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:$(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:$(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:$(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:$(800,1280)}],_n=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:$(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:$(768,1024),mraidScale:.7}];var Eo=[..._n];var Ra=_n[0];ue();var Ba=ft(require("jszip"),1);function za(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 Ha(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 Na(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 Jt(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 r=await za(a),o=await Na(r),s=Ha(r);return console.log("[ImageUtils] Success resolution:",o==null?void 0:o.width,"x",o==null?void 0:o.height,"mime:",s.mimeType),{base64:s.base64,mimeType:s.mimeType,dataUrl:r,width:(e=o==null?void 0:o.width)!=null?e:0,height:(t=o==null?void 0:o.height)!=null?t:0}}catch(n){return console.error("[ImageUtils] Error fetching image data:",n),null}}async function vt(i,e=30){try{console.log("[ImageUtils] Removing background color...");let t=await new Promise((l,p)=>{let g=new Image;g.onload=()=>l(g),g.onerror=()=>p(new Error("Failed to load image")),g.src=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 r=a.getImageData(0,0,n.width,n.height),o=r.data,d=[{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(l=>({r:o[l.offset],g:o[l.offset+1],b:o[l.offset+2]})),c=0;for(let l=0;l<o.length;l+=4){let p=o[l],g=o[l+1],m=o[l+2],f=!1;for(let A of d)if(Math.sqrt(Math.pow(p-A.r,2)+Math.pow(g-A.g,2)+Math.pow(m-A.b,2))<e){f=!0;break}f&&(o[l+3]=0,c++)}return console.log(`[ImageUtils] Removed background from ${c} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),n.toDataURL("image/png")}catch(t){return console.error("[ImageUtils] Error removing background:",t),i}}var Mn=require("@google/genai");async function Zt(i,e,t=[],n={}){var a,r,o,s,d,c,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 l=new Mn.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 l.models.generateContent({model:p,contents:g}),f="",A=(o=(r=(a=m.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:o.parts;if(A)for(let b of A)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(l){throw console.error("[Gemini] API error:",l),(s=l.message)!=null&&s.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(d=l.message)!=null&&d.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(c=l.message)!=null&&c.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(u=l.message)!=null&&u.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):l}}var Pn=require("@google/genai");async function xt(i,e,t=[],n={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Pn.GoogleGenAI({apiKey:i}),r=[{text:e}];t.length>0&&t.forEach((s,d)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${d}`),r.push({inlineData:{mimeType:s.mimeType,data:s.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let o=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!o.candidates||!o.candidates[0]||!o.candidates[0].content||!o.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let s of o.candidates[0].content.parts)if(s.text)console.log(s.text);else if(s.inlineData){let d=s.inlineData.data,c=s.inlineData.mimeType||"image/png";return console.info("[GEMINI-REAL-SDK] Found inline image data in response"),`data:${c};base64,${d}`}throw new Error("Gemini 2.5 Flash Image returned no image data.")}catch(a){throw console.error("[GEMINI-REAL-SDK] Error in generateImageWithGemini25Flash:",JSON.stringify(a,Object.getOwnPropertyNames(a),2)),a}}var Wa=require("pixi.js");Xe();ue();var $n=require("pixi.js");var Ya=require("pixi.js");ue();function tr(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 ir(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 nr(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:
|
package/dist/pixi/index.css
CHANGED
|
@@ -2830,6 +2830,7 @@
|
|
|
2830
2830
|
|
|
2831
2831
|
.preview-shell.layout-fixed .workbench-header,
|
|
2832
2832
|
.preview-shell.layout-fixed .console-header,
|
|
2833
|
+
.preview-shell.layout-fixed .library-panel .scene-panel-header,
|
|
2833
2834
|
.preview-shell.layout-fixed .workbench-tab[data-tab="library"],
|
|
2834
2835
|
.preview-shell.layout-fixed .workbench-tab-panel[data-tab-panel="library"],
|
|
2835
2836
|
.preview-shell.layout-fixed .console-panel.docked-hidden,
|
|
@@ -2890,19 +2891,29 @@
|
|
|
2890
2891
|
flex: 1;
|
|
2891
2892
|
overflow: hidden;
|
|
2892
2893
|
position: relative;
|
|
2894
|
+
display: flex;
|
|
2895
|
+
gap: 0;
|
|
2893
2896
|
}
|
|
2894
2897
|
|
|
2895
2898
|
.bottom-dock-panel {
|
|
2896
|
-
display:
|
|
2899
|
+
display: flex;
|
|
2900
|
+
flex-direction: column;
|
|
2897
2901
|
height: 100%;
|
|
2902
|
+
flex: 1;
|
|
2903
|
+
border-right: 1px solid var(--ui-border);
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2906
|
+
.bottom-dock-panel:last-child {
|
|
2907
|
+
border-right: none;
|
|
2898
2908
|
}
|
|
2899
2909
|
|
|
2900
2910
|
.bottom-dock-panel.active {
|
|
2901
|
-
display:
|
|
2911
|
+
display: flex;
|
|
2902
2912
|
}
|
|
2903
2913
|
|
|
2904
2914
|
#dock-console-content {
|
|
2905
2915
|
background: var(--ui-bg-1);
|
|
2916
|
+
flex: 1;
|
|
2906
2917
|
}
|
|
2907
2918
|
|
|
2908
2919
|
#dock-console-content .console-messages {
|
|
@@ -2911,6 +2922,18 @@
|
|
|
2911
2922
|
padding: 12px;
|
|
2912
2923
|
}
|
|
2913
2924
|
|
|
2925
|
+
#dock-library-content {
|
|
2926
|
+
flex: 1.5;
|
|
2927
|
+
/* Give library more space */
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
#dock-library-content .library-panel {
|
|
2931
|
+
width: 100% !important;
|
|
2932
|
+
height: 100% !important;
|
|
2933
|
+
border-radius: 0;
|
|
2934
|
+
border: none;
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2914
2937
|
.bottom-dock-resize-handle {
|
|
2915
2938
|
position: absolute;
|
|
2916
2939
|
top: 0;
|
|
@@ -2978,7 +3001,10 @@
|
|
|
2978
3001
|
.workbench-content {
|
|
2979
3002
|
flex: 1;
|
|
2980
3003
|
overflow-y: auto;
|
|
3004
|
+
overflow-x: hidden;
|
|
2981
3005
|
padding: var(--space-md);
|
|
3006
|
+
min-width: 0;
|
|
3007
|
+
/* Allow shrinking below content size */
|
|
2982
3008
|
}
|
|
2983
3009
|
|
|
2984
3010
|
.workbench-tab-panel {
|
|
@@ -3529,6 +3555,8 @@
|
|
|
3529
3555
|
.workbench-content .scene-panel {
|
|
3530
3556
|
position: static;
|
|
3531
3557
|
width: 100% !important;
|
|
3558
|
+
min-width: 0 !important;
|
|
3559
|
+
max-width: 100% !important;
|
|
3532
3560
|
max-height: none !important;
|
|
3533
3561
|
|
|
3534
3562
|
/* Preserve “card” styling so embedded panels don't look unstyled */
|
|
@@ -3539,6 +3567,21 @@
|
|
|
3539
3567
|
overflow: hidden;
|
|
3540
3568
|
}
|
|
3541
3569
|
|
|
3570
|
+
/* Specific overrides for panels that have hardcoded widths */
|
|
3571
|
+
.workbench-content .inspector-panel,
|
|
3572
|
+
.workbench-content .library-panel,
|
|
3573
|
+
.workbench-content .ai-tools-panel {
|
|
3574
|
+
width: 100% !important;
|
|
3575
|
+
min-width: 0 !important;
|
|
3576
|
+
max-width: 100% !important;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
.workbench-content .inspector-header,
|
|
3580
|
+
.workbench-content .ai-tabs {
|
|
3581
|
+
margin-left: 0;
|
|
3582
|
+
margin-right: 0;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3542
3585
|
.workbench-content .scene-panel-header {
|
|
3543
3586
|
display: none;
|
|
3544
3587
|
|
package/dist/pixi/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x197573,_0x5a48b2){var a0_0x51553b={_0x2713f2:0x4b3,_0x13e1f4:'^^d[',_0x314913:0x123,_0x3b2be7:'mV#q',_0x3a385b:0x114,_0x15fd37:0x12a,_0x25ffc8:'NUhY',_0x114c91:0x134,_0x552ceb:0x13d,_0x370eeb:'WPGV',_0xaadf39:0x142,_0x55b312:0x12d,_0x49dac4:0x131,_0x31cb63:0x129,_0xb5c969:'KIwb',_0x19e7a0:0x123,_0x3cb851:0x133,_0x12dc83:0x493,_0x4a5367:0x48c,_0x17a0a4:'FH&n',_0x256a54:0x496,_0x1a4a97:0x121,_0x2bea10:'B[Eo',_0x6c3599:0x12f,_0x5c2c69:0x12f,_0x1b6372:0x12a,_0x4deecb:'(4TE',_0x50a84f:0x124,_0x4b0841:0x22,_0x46f17a:0x13,_0x135a07:0x20,_0x3be3cb:0x1d},a0_0x4cd2e6={_0x40338c:0x335},a0_0x44a9e2={_0x2d8ca4:0x297},a0_0x18bb54={_0x5e4d2a:0x192};function _0x253dc0(_0x5961de,_0x44e9ef,_0x1cb290,_0x387073,_0x256843){return a0_0x13c2(_0x256843- -a0_0x18bb54._0x5e4d2a,_0x1cb290);}function _0x507dc7(_0xad982c,_0x1d4af8,_0x1ff364,_0x50adc3,_0x290fab){return a0_0x13c2(_0xad982c- -a0_0x44a9e2._0x2d8ca4,_0x1d4af8);}var _0x826d25=_0x197573();function _0x1f6084(_0xb0cdfd,_0x281c84,_0x24adc3,_0x380503,_0x33b965){return a0_0x13c2(_0xb0cdfd-a0_0x4cd2e6._0x40338c,_0x380503);}while(!![]){try{var _0x5443b6=-parseInt(_0x1f6084(a0_0x51553b._0x2713f2,0x4a9,0x4b8,a0_0x51553b._0x13e1f4,0x4a5))/(-0xbae+-0x53*-0x1+0xb5c)+parseInt(_0x507dc7(-a0_0x51553b._0x314913,a0_0x51553b._0x3b2be7,-0x11f,-a0_0x51553b._0x3a385b,-a0_0x51553b._0x15fd37))/(-0x25d7+-0x1535+-0x1*-0x3b0e)*(parseInt(_0x507dc7(-0x12e,a0_0x51553b._0x25ffc8,-a0_0x51553b._0x114c91,-0x134,-a0_0x51553b._0x552ceb))/(0x45e+-0x87d*0x2+0x3*0x435))+parseInt(_0x507dc7(-0x133,a0_0x51553b._0x370eeb,-a0_0x51553b._0xaadf39,-a0_0x51553b._0x55b312,-a0_0x51553b._0x49dac4))/(-0x16ba+-0xb04+-0x21c2*-0x1)+-parseInt(_0x507dc7(-a0_0x51553b._0x31cb63,a0_0x51553b._0xb5c969,-a0_0x51553b._0x19e7a0,-a0_0x51553b._0x3cb851,-0x132))/(0x160d+0x233d+-0x3945)+parseInt(_0x1f6084(0x49b,a0_0x51553b._0x12dc83,a0_0x51553b._0x4a5367,a0_0x51553b._0x17a0a4,a0_0x51553b._0x256a54))/(-0x1746+0x3d+0x170f)+-parseInt(_0x507dc7(-a0_0x51553b._0x1a4a97,a0_0x51553b._0x2bea10,-a0_0x51553b._0x6c3599,-a0_0x51553b._0x5c2c69,-0x11a))/(-0x666*0x1+-0xeaa*0x1+0x1517)*(-parseInt(_0x507dc7(-a0_0x51553b._0x1b6372,a0_0x51553b._0x4deecb,-0x11e,-a0_0x51553b._0x50a84f,-0x123))/(0x10c9*-0x1+-0xaf3+0x1bc4))+-parseInt(_0x253dc0(-0x12,-a0_0x51553b._0x4b0841,'EIdp',-a0_0x51553b._0x46f17a,-a0_0x51553b._0x135a07))/(0x6c4+0x1271*0x1+0x9*-0x2cc)*(parseInt(_0x253dc0(-a0_0x51553b._0x3be3cb,-0x29,'u7nc',-0x1c,-0x23))/(-0x1594+-0x2293+0x3831));if(_0x5443b6===_0x5a48b2)break;else _0x826d25['push'](_0x826d25['shift']());}catch(_0x4772ca){_0x826d25['push'](_0x826d25['shift']());}}}(a0_0x5a90,-0xae5b5+0x1010c+-0x56*-0x342e));var a0_0x555422=(function(){var _0x5c8014=!![];return function(_0xaec415,_0x749c46){var _0x102b6d=_0x5c8014?function(){if(_0x749c46){var _0xb5997d=_0x749c46['apply'](_0xaec415,arguments);return _0x749c46=null,_0xb5997d;}}:function(){};return _0x5c8014=![],_0x102b6d;};}()),a0_0x8e7450=a0_0x555422(this,function(){var a0_0x3ededb={_0x117ac3:0x168,_0x4235a5:0x169,_0x21ce87:0x16c,_0x3abb81:'B[Eo',_0x235164:0x163,_0x1e6e70:0x1d4,_0x26c443:0x1d0,_0xd3bd4f:'yawL',_0x2f3252:0x1d3,_0x1ee5d4:0x1de,_0x495915:'[Eit',_0x2130f8:0x22f,_0x427acb:0x231,_0x4d62c2:0x232,_0x45db43:0x1e3,_0x3cea05:'WPGV',_0xc9f18a:0x1ee,_0x21bee4:0x21c,_0x24b436:0x21f,_0x100337:0x21d,_0x34f08b:0x225,_0x1b4465:0x17d,_0x1d1d85:0x177,_0x5c744a:'%BxL',_0x276c28:0x215,_0x305ad8:0x227,_0x84835d:0x229,_0x285d19:'dR)C',_0x559616:0x22c,_0x5e2731:0x222,_0x36c6ce:0x22a,_0x325332:0x169,_0x2e99da:0x187,_0x2bbbcb:'NRdG',_0x17aa37:0x170,_0x309c78:0x241,_0x29a77d:0x233,_0x5daabd:0x241,_0x3f5c43:0x22a,_0x9f05d8:0x232,_0x44b1c4:0x229},a0_0x393496={_0x2f5e07:0x2e3},a0_0x528620={_0x1690eb:0x39b},_0x5dea8a={};_0x5dea8a[_0xd95f8c(-a0_0x3ededb._0x117ac3,-a0_0x3ededb._0x4235a5,-a0_0x3ededb._0x21ce87,a0_0x3ededb._0x3abb81,-a0_0x3ededb._0x235164)]=_0x274f74(a0_0x3ededb._0x1e6e70,a0_0x3ededb._0x26c443,a0_0x3ededb._0xd3bd4f,a0_0x3ededb._0x2f3252,a0_0x3ededb._0x1ee5d4)+')+)+)'+'+$';function _0x3cd939(_0x51880,_0x462018,_0x25deec,_0x4a7570,_0x3b276c){return a0_0x13c2(_0x25deec- -a0_0x528620._0x1690eb,_0x51880);}function _0xd95f8c(_0xfa4e72,_0x3dbbc0,_0xb31b13,_0x3a1c3f,_0x149956){return a0_0x13c2(_0xfa4e72- -a0_0x393496._0x2f5e07,_0x3a1c3f);}function _0x274f74(_0x562ab7,_0x3e0a4c,_0x400a84,_0x51c70e,_0x568461){return a0_0x13c2(_0x3e0a4c-0x6e,_0x400a84);}var _0x44fa74=_0x5dea8a;return a0_0x8e7450[_0x3cd939(a0_0x3ededb._0x495915,-a0_0x3ededb._0x2130f8,-a0_0x3ededb._0x427acb,-a0_0x3ededb._0x4d62c2,-a0_0x3ededb._0x4d62c2)+_0x274f74(0x1e5,a0_0x3ededb._0x45db43,a0_0x3ededb._0x3cea05,0x1d9,a0_0x3ededb._0xc9f18a)]()[_0x3cd939('%BxL',-a0_0x3ededb._0x21bee4,-a0_0x3ededb._0x24b436,-a0_0x3ededb._0x100337,-a0_0x3ededb._0x34f08b)+'h'](_0x44fa74[_0xd95f8c(-0x17e,-a0_0x3ededb._0x1b4465,-0x175,'LG9i',-a0_0x3ededb._0x1d1d85)])[_0x3cd939(a0_0x3ededb._0x5c744a,-a0_0x3ededb._0x276c28,-0x224,-a0_0x3ededb._0x305ad8,-a0_0x3ededb._0x84835d)+'ing']()[_0x3cd939(a0_0x3ededb._0x285d19,-a0_0x3ededb._0x559616,-a0_0x3ededb._0x5e2731,-a0_0x3ededb._0x36c6ce,-0x224)+_0xd95f8c(-0x178,-a0_0x3ededb._0x325332,-a0_0x3ededb._0x2e99da,a0_0x3ededb._0x2bbbcb,-a0_0x3ededb._0x17aa37)+'r'](a0_0x8e7450)[_0x3cd939('7!F%',-a0_0x3ededb._0x309c78,-0x238,-a0_0x3ededb._0x29a77d,-a0_0x3ededb._0x5daabd)+'h'](_0x44fa74[_0x3cd939('dR)C',-a0_0x3ededb._0x100337,-a0_0x3ededb._0x3f5c43,-a0_0x3ededb._0x9f05d8,-a0_0x3ededb._0x44b1c4)]);});a0_0x8e7450();import{A as a0_0x23d1f4,B as a0_0x3ba159,C as a0_0x36f290,D as a0_0x58454f,b as a0_0x5841c0,c as a0_0x20bf49,d as a0_0x2a10a8,e as a0_0x57403c,f as a0_0x2d76ce,g as a0_0x2b5c36,h as a0_0x3797ae,i as a0_0x1fec11,j as a0_0x58f043,k as a0_0x271d9b,l as a0_0x9a685,m as a0_0x3519c9,n as a0_0x3c1b76,o as a0_0x30704c,p as a0_0x5d6a5c,q as a0_0x109f5c,r as a0_0x81eec8,s as a0_0x58b331,t as a0_0x1ad07b,u as a0_0x43b745,v as a0_0x255e36,w as a0_0x2205fa,x as a0_0x27a61c,y as a0_0x2b42be,z as a0_0x62160}from'../chunk-RSBYFD7B.js';import{a as a0_0xb09f8e,b as a0_0x38cd90,c as a0_0x3a2152,d as a0_0x3ff201,e as a0_0x4595d1}from'../chunk-I5OOVR5U.js';function a0_0x5a90(){var _0x2a8513=['W7hdMmkPW7SmFMHIkXddQKfc','WRRdRdG6hM14aWNcH8oPaW','FmoaqCktWQNdIurEW5SMW4FcRW','Evn5W7hdOwfLW5SWW6hcSL3cKG','w8kAWRH/W416WPhdKW','zItcU0BcPG','fGisWOlcG8kaW49M','hLqiWRFcPCkaW7i','WOpdJZdcIWhdV8okxComWQpcJde','f8o+W58','D1K9WPrPW5D3uW','fCkWWPHrzW','uSoQW74timoeE3a+WO3cPSod','BbhcG0xcMq','W6hdL8k6W59SWPhdVxPkWO1vW7K','ldSLWQLJ','eSk6WQPxDG','oKNdNGBdMCobW43cMSo3WP56W5a','v8kaWP7cSCkJW4ZcH8oGW4VdOCkeyW','W7pcT8ovF3DhWRddP0KvlW8','uCoNomo9WOS','bSoqW64kWRS','s8kNWOSIzMVdRWxdRbTSWQS','jdpdOJxcUW','WRK1WOz2nmoAbGeQWRhdJX/dNW','WOldU8o6WPHskghcIW','Ef3cHhFdHXBdSWL7yNxdJ8kR','qmk4W57dI8kltSk6','WQCscfOs','W5JcTmk1WRCC'];a0_0x5a90=function(){return _0x2a8513;};return a0_0x5a90();}import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';function a0_0x13c2(_0x1216f9,_0x191d43){_0x1216f9=_0x1216f9-(0x6d9+-0x10f6+0xb7e*0x1);var _0x51ade0=a0_0x5a90();var _0x3ac162=_0x51ade0[_0x1216f9];if(a0_0x13c2['dNiSYv']===undefined){var _0x4a9a08=function(_0x13488e){var _0x2ffa73='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x205928='',_0xc75d0f='',_0x1adf1c=_0x205928+_0x4a9a08;for(var _0x27e128=-0x16e2+-0x2f5*-0x5+0x819,_0x1dca9c,_0x3b7ec0,_0x3ecf8=0xadb+-0x85*0x2e+0xd0b;_0x3b7ec0=_0x13488e['charAt'](_0x3ecf8++);~_0x3b7ec0&&(_0x1dca9c=_0x27e128%(0x1453+-0x39*0x3d+-0x6ba)?_0x1dca9c*(-0xbbf*0x3+-0x654+0x29d1*0x1)+_0x3b7ec0:_0x3b7ec0,_0x27e128++%(-0x2185+-0x106b+-0x31f4*-0x1))?_0x205928+=_0x1adf1c['charCodeAt'](_0x3ecf8+(-0x1701+-0x7ee+0xa53*0x3))-(0xd*-0x2f6+0x1188+0x1500)!==0x1654+0x106c+-0x2*0x1360?String['fromCharCode'](0x3*0x22e+0x3d*-0x6b+-0x4*-0x4fd&_0x1dca9c>>(-(-0x2526+-0x129a+-0x1*-0x37c2)*_0x27e128&-0x21*-0xf4+0xd*-0x18e+-0x2ce*0x4)):_0x27e128:-0x22db+0x1*0x1169+-0x1*-0x1172){_0x3b7ec0=_0x2ffa73['indexOf'](_0x3b7ec0);}for(var _0x51b6b6=-0x2705+0x15fc+0x1109,_0x1d40b8=_0x205928['length'];_0x51b6b6<_0x1d40b8;_0x51b6b6++){_0xc75d0f+='%'+('00'+_0x205928['charCodeAt'](_0x51b6b6)['toString'](-0x1*0x1b05+-0x2635*-0x1+-0xb20))['slice'](-(0x1921+0x2*-0xefd+0x4db*0x1));}return decodeURIComponent(_0xc75d0f);};var _0x1d2205=function(_0x591f2c,_0x1b336e){var _0x225377=[],_0x3b66d4=-0x1*0xc3e+-0x49b+-0x13*-0xe3,_0x5a8778,_0x363f27='';_0x591f2c=_0x4a9a08(_0x591f2c);var _0x16695d;for(_0x16695d=0x21cc+0x1d*-0x3e+-0x1ac6;_0x16695d<0x2577+-0x12*0x16a+-0x1*0xb03;_0x16695d++){_0x225377[_0x16695d]=_0x16695d;}for(_0x16695d=-0xb32+-0x696+0x11c8;_0x16695d<0x8*0xef+-0x1b6*-0x5+-0xf06;_0x16695d++){_0x3b66d4=(_0x3b66d4+_0x225377[_0x16695d]+_0x1b336e['charCodeAt'](_0x16695d%_0x1b336e['length']))%(0xb*-0x259+-0x1dc6+0x3899),_0x5a8778=_0x225377[_0x16695d],_0x225377[_0x16695d]=_0x225377[_0x3b66d4],_0x225377[_0x3b66d4]=_0x5a8778;}_0x16695d=0x1b1e+0x3*0x1dd+-0x20b5,_0x3b66d4=0x1d03+0x2018+-0x3d1b;for(var _0x37f255=-0x2*-0x495+-0xea0+0x576;_0x37f255<_0x591f2c['length'];_0x37f255++){_0x16695d=(_0x16695d+(-0x1*0x13a+-0xc*0x7a+0x6f3))%(0x1976+0x1e2c+-0x36a2),_0x3b66d4=(_0x3b66d4+_0x225377[_0x16695d])%(-0x6b*0x56+-0x2133+-0x4625*-0x1),_0x5a8778=_0x225377[_0x16695d],_0x225377[_0x16695d]=_0x225377[_0x3b66d4],_0x225377[_0x3b66d4]=_0x5a8778,_0x363f27+=String['fromCharCode'](_0x591f2c['charCodeAt'](_0x37f255)^_0x225377[(_0x225377[_0x16695d]+_0x225377[_0x3b66d4])%(-0x22a3+0xb*0x50+0x1*0x2033)]);}return _0x363f27;};a0_0x13c2['ISgsCK']=_0x1d2205,a0_0x13c2['zIVrij']={},a0_0x13c2['dNiSYv']=!![];}var _0x5ab300=_0x51ade0[0x2116+0x9*0x10c+0x1*-0x2a82],_0x156fdb=_0x1216f9+_0x5ab300,_0xa74a83=a0_0x13c2['zIVrij'][_0x156fdb];if(!_0xa74a83){if(a0_0x13c2['UUANZU']===undefined){var _0x4632a9=function(_0x55afd2){this['NsFPYV']=_0x55afd2,this['eNvIiZ']=[0x1*-0xcd5+0x13eb+-0x715,0x35f*-0x5+-0x2f*0xa9+0x2fe2,0x1*-0x57e+-0x69*-0x4f+0x53*-0x53],this['CXUSfK']=function(){return'newState';},this['iqcNpG']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['sydcPp']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x4632a9['prototype']['Gdziel']=function(){var _0x4e775c=new RegExp(this['iqcNpG']+this['sydcPp']),_0x5a81dc=_0x4e775c['test'](this['CXUSfK']['toString']())?--this['eNvIiZ'][0xa6a+-0x7*-0x443+-0x6b5*0x6]:--this['eNvIiZ'][0x25e1+-0x1fc8+-0x619];return this['MPaqFs'](_0x5a81dc);},_0x4632a9['prototype']['MPaqFs']=function(_0x3ebc5e){if(!Boolean(~_0x3ebc5e))return _0x3ebc5e;return this['GhCaxV'](this['NsFPYV']);},_0x4632a9['prototype']['GhCaxV']=function(_0x3ebe5a){for(var _0x155a68=-0x5*0x473+-0x3a*0x95+0x3801,_0x57ddd9=this['eNvIiZ']['length'];_0x155a68<_0x57ddd9;_0x155a68++){this['eNvIiZ']['push'](Math['round'](Math['random']())),_0x57ddd9=this['eNvIiZ']['length'];}return _0x3ebe5a(this['eNvIiZ'][0x2*0x1be+-0x1d72+0x19f6]);},new _0x4632a9(a0_0x13c2)['Gdziel'](),a0_0x13c2['UUANZU']=!![];}_0x3ac162=a0_0x13c2['ISgsCK'](_0x3ac162,_0x191d43),a0_0x13c2['zIVrij'][_0x156fdb]=_0x3ac162;}else _0x3ac162=_0xa74a83;return _0x3ac162;}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0xb09f8e as AssetCache,a0_0x3a2152 as AssetLoader,a0_0x43b745 as AssetSystem,a0_0x3ff201 as AssetTextures,a0_0x58b331 as Assets,a0_0x30704c as BaseSystem,a0_0x3c1b76 as GameEngine,a0_0x57403c as GameObject,a0_0x2d76ce as GameObjectManager,a0_0x3519c9 as ObjectFactory,a0_0x2a10a8 as Renderer,a0_0x5d6a5c as RuntimeObjectRegistry,a0_0x20bf49 as Transform,a0_0x3ba159 as applyScreenAnchor,a0_0x109f5c as basePixi,a0_0x2205fa as clearResponsiveElements,a0_0x5841c0 as createPixiBase,a0_0x58f043 as getRegisteredFontIds,a0_0x255e36 as globalResponsiveMultipliers,a0_0x4595d1 as initAssetTextures,a0_0x1ad07b as initAssets,a0_0x36f290 as layout,a0_0x9a685 as playLottieOverlay,a0_0x1fec11 as registerFont,a0_0x38cd90 as registerType,a0_0x2b42be as resolveAnchorVec2,a0_0x2b5c36 as resolveFont,a0_0x3797ae as resolveFontWeight,a0_0x62160 as resolveScreenAnchorPoint,a0_0x23d1f4 as resolveScreenRatioPoint,a0_0x58454f as runInitSequence,a0_0x271d9b as setLottieInstance,a0_0x81eec8 as spawnSceneFromConfig,a0_0x27a61c as updateScreenState};
|
|
1
|
+
function a0_0x103b(){var _0x42341c=['W6tcKcRdKZO','mSk7WPNcTWe','sCkjW4tcKCkskSorW4hcHKpcSh3cHa','krjEWPZdOgZdPW','W5mKW5b1mSkEW5i','W6OoW70izxxdTW','W6VcOWVdUY/dO3ldU8k/W5rf','WOfmmCkEjSoiAJrofhqcps0','pCoWWQKMW50OW7qhW49eWRJcQ0O','WQhcJSoYW5WzECkIv8kIW74YzCkm','aWtdP2lcPW','qaSmvSkd','WRtdKSoYW4/cPq','W6WSAmoMW7W','W53dHmosvYuHqeFdGSk3keO9','W5pdHSoruIHzlL/dTSk4kq','wCkQW5L7WOpcNN7dUmoWEZZdImkO','W5/cPCkYE8ocptxcG8knF8onp8ov','WPOFWRjlW7ZcJgu','W4JdJcqWCq','cxNdUmofWQJcHb/cMXeYytT+','z8oscCoVW5y','W6RdG8oiWR4zeSopg8k8uSkXW4pdHW','WQP3c8kNWR3cNNhcKmklmSkQiau','WQRdGmkgW4/dH8kIWOu','CtLG','tKxcQCkaySknW7tdJq19mSk9aCox','WPfRWQO','WONcNW4lWRS'];a0_0x103b=function(){return _0x42341c;};return a0_0x103b();}(function(_0x2696c2,_0x3b371b){var a0_0xc7dd58={_0x107622:0x1d3,_0x22a2ff:'ta^o',_0x33a6a5:0x1b8,_0x51abf9:0x1ca,_0x9cbd3c:'ZppS',_0x1039b7:0x1bf,_0x13abb6:0x1b3,_0x3d86da:0x1c5,_0x423260:0x1c0,_0x55feaf:0x1b2,_0x99674a:0x1c6,_0xf7dd02:0x1cf,_0x40d8e6:')nsW',_0x47a471:0x1c2,_0x34376a:0x1b6,_0x43c9c2:0x84,_0x539ad0:0x86,_0x1a2a8d:'#5]l',_0x17e95e:0x8f,_0x39becb:0x17d,_0x3ef2ae:0x179,_0x10f97a:0x183,_0x4126db:'ptPC',_0x33fd9f:0x177,_0x31239b:0x190,_0x4e70ae:0x188,_0x3269e8:0x72,_0x57476e:0x71,_0x23792b:'XYd4',_0x336aa9:0x81,_0x2c6fb3:0x187,_0x286e18:'BwTQ',_0x56c669:0x18b,_0x5bbf87:0x18b,_0xd9fc31:0x75,_0x350b3c:'9*V9',_0xaf332a:0x7a,_0x324aff:0x70},a0_0x406d47={_0x41b5a3:0x1f5},a0_0x604a7={_0x140d9c:0x329},a0_0x500349={_0x30ddca:0x10};function _0x7d71cc(_0x312504,_0x10537f,_0x20f348,_0x2b0a22,_0x5d50a1){return a0_0x7221(_0x312504-a0_0x500349._0x30ddca,_0x10537f);}function _0x2c906(_0x4b8328,_0x68337e,_0x453ba6,_0x1bb304,_0x238047){return a0_0x7221(_0x1bb304- -a0_0x604a7._0x140d9c,_0x453ba6);}var _0xda6136=_0x2696c2();function _0x18f6fb(_0x2235e5,_0x34711e,_0x373589,_0x5609a9,_0x575a7f){return a0_0x7221(_0x5609a9- -a0_0x406d47._0x41b5a3,_0x373589);}while(!![]){try{var _0x49c389=parseInt(_0x2c906(-0x1cb,-a0_0xc7dd58._0x107622,a0_0xc7dd58._0x22a2ff,-0x1c4,-a0_0xc7dd58._0x33a6a5))/(0x5a2+0x22d*-0xd+0x5aa*0x4)*(-parseInt(_0x2c906(-0x1be,-a0_0xc7dd58._0x51abf9,a0_0xc7dd58._0x9cbd3c,-a0_0xc7dd58._0x1039b7,-a0_0xc7dd58._0x13abb6))/(0x23f8*-0x1+-0xf*-0x25f+0x69))+parseInt(_0x2c906(-a0_0xc7dd58._0x3d86da,-0x1b4,'^tP8',-a0_0xc7dd58._0x423260,-a0_0xc7dd58._0x55feaf))/(0x1425*0x1+-0x1d5a+0x938)+parseInt(_0x2c906(-a0_0xc7dd58._0x99674a,-a0_0xc7dd58._0xf7dd02,a0_0xc7dd58._0x40d8e6,-a0_0xc7dd58._0x47a471,-a0_0xc7dd58._0x34376a))/(0x3*0x3d+-0xce8+0x19*0x7d)*(-parseInt(_0x18f6fb(-a0_0xc7dd58._0x43c9c2,-a0_0xc7dd58._0x539ad0,a0_0xc7dd58._0x1a2a8d,-a0_0xc7dd58._0x17e95e,-0x98))/(-0x8*0x4b3+-0x2*0xa59+-0x17*-0x289))+parseInt(_0x7d71cc(0x173,'hVZq',a0_0xc7dd58._0x39becb,0x165,a0_0xc7dd58._0x3ef2ae))/(0x4a*0x86+-0x4a*-0x7+0xed*-0x2c)+parseInt(_0x7d71cc(a0_0xc7dd58._0x10f97a,a0_0xc7dd58._0x4126db,a0_0xc7dd58._0x33fd9f,a0_0xc7dd58._0x31239b,a0_0xc7dd58._0x4e70ae))/(0x1f03*0x1+0x10a2+0x17cf*-0x2)*(parseInt(_0x18f6fb(-a0_0xc7dd58._0x3269e8,-a0_0xc7dd58._0x57476e,a0_0xc7dd58._0x23792b,-0x80,-a0_0xc7dd58._0x336aa9))/(-0x1*-0x10e3+0x25b4+-0x368f))+parseInt(_0x7d71cc(a0_0xc7dd58._0x2c6fb3,a0_0xc7dd58._0x286e18,0x182,a0_0xc7dd58._0x56c669,a0_0xc7dd58._0x5bbf87))/(0x1366+0xbfc+-0x1f59)+-parseInt(_0x18f6fb(-a0_0xc7dd58._0xd9fc31,-0x7d,a0_0xc7dd58._0x350b3c,-a0_0xc7dd58._0xaf332a,-a0_0xc7dd58._0x324aff))/(-0x8bd*-0x1+-0x3d2+-0x4e1);if(_0x49c389===_0x3b371b)break;else _0xda6136['push'](_0xda6136['shift']());}catch(_0x33b42d){_0xda6136['push'](_0xda6136['shift']());}}}(a0_0x103b,-0xee16b+0x1*0xcc3d9+0xc7b64));var a0_0x28b7bf=(function(){var _0x1532c3=!![];return function(_0x2ecef1,_0x3c944){var _0x55c846=_0x1532c3?function(){if(_0x3c944){var _0x16bd89=_0x3c944['apply'](_0x2ecef1,arguments);return _0x3c944=null,_0x16bd89;}}:function(){};return _0x1532c3=![],_0x55c846;};}()),a0_0x1304a4=a0_0x28b7bf(this,function(){var a0_0x2b0fb1={_0x14f9fd:0x1da,_0x168a9a:'3S!I',_0x177c89:0x1e6,_0x2c55ca:0x1e8,_0x56cc7f:0x0,_0x10e39e:'G(H4',_0x80a165:0x3,_0x2bff6f:0xe,_0x51476a:0x1a,_0x4931e5:0x25,_0x2a1268:0x20,_0x29d3f0:'ZJH2',_0xe11708:0x1e0,_0x151f6c:0x1dc,_0x3f491d:'7HUs',_0x11e786:0x1d4,_0x398550:0x1d0,_0x1da5f4:0x1de,_0x4423f7:0x1e5,_0x658333:'m(UC',_0x3593fd:0x1dd,_0x3790fc:0x1e6,_0x9c9701:0x1d3,_0x430fec:'XVko',_0x3d869b:0x1db,_0x5a762c:0x18,_0x3a18d1:0x27,_0x5323f3:0x1e,_0x29019c:'SR*7',_0x271960:0x340,_0x106f85:'WmHd',_0x2180b7:0x343,_0x2e40ee:0x1e3,_0x449ad6:'g@d[',_0x51c174:0x1ef,_0x2917de:0x33e,_0x1ef268:'K0Ae',_0x5548bd:0x339,_0x138112:0x33b,_0x4052c2:0x341},a0_0x463a08={_0x17e06d:0x1d4},a0_0x1ab93c={_0x2a6289:0x162},a0_0x5eeb91={_0x4f4064:0x351},_0x4637aa={};function _0x160246(_0x3b8e36,_0xfc643a,_0xe05e35,_0x2fdccc,_0x2fca1e){return a0_0x7221(_0x2fdccc- -a0_0x5eeb91._0x4f4064,_0xe05e35);}function _0x407f19(_0x50ca3c,_0x5d1765,_0x27fdfe,_0x13933b,_0x51fa73){return a0_0x7221(_0x50ca3c- -a0_0x1ab93c._0x2a6289,_0x51fa73);}_0x4637aa['RIKWH']=_0x160246(-0x1d7,-a0_0x2b0fb1._0x14f9fd,a0_0x2b0fb1._0x168a9a,-a0_0x2b0fb1._0x177c89,-a0_0x2b0fb1._0x2c55ca)+_0x407f19(-0x1,a0_0x2b0fb1._0x56cc7f,0xe,0xe,a0_0x2b0fb1._0x10e39e)+'+$';var _0x35133b=_0x4637aa;function _0x1e3c03(_0x440c0a,_0x8ad20,_0x150bf7,_0x52ff24,_0x13a702){return a0_0x7221(_0x13a702-a0_0x463a08._0x17e06d,_0x8ad20);}return a0_0x1304a4[_0x407f19(0xc,0xe,a0_0x2b0fb1._0x80a165,a0_0x2b0fb1._0x2bff6f,'vK((')+_0x407f19(a0_0x2b0fb1._0x51476a,a0_0x2b0fb1._0x4931e5,a0_0x2b0fb1._0x2a1268,0x1f,a0_0x2b0fb1._0x29d3f0)]()[_0x160246(-a0_0x2b0fb1._0xe11708,-a0_0x2b0fb1._0x151f6c,a0_0x2b0fb1._0x3f491d,-a0_0x2b0fb1._0x11e786,-a0_0x2b0fb1._0x398550)+'h'](_0x160246(-a0_0x2b0fb1._0x1da5f4,-a0_0x2b0fb1._0x4423f7,a0_0x2b0fb1._0x658333,-a0_0x2b0fb1._0x3593fd,-a0_0x2b0fb1._0x3790fc)+')+)+)'+'+$')[_0x160246(-0x1e0,-a0_0x2b0fb1._0x9c9701,a0_0x2b0fb1._0x430fec,-a0_0x2b0fb1._0x3d869b,-a0_0x2b0fb1._0xe11708)+_0x407f19(a0_0x2b0fb1._0x5a762c,0x23,a0_0x2b0fb1._0x3a18d1,a0_0x2b0fb1._0x5323f3,a0_0x2b0fb1._0x29019c)]()[_0x1e3c03(a0_0x2b0fb1._0x271960,a0_0x2b0fb1._0x106f85,a0_0x2b0fb1._0x2180b7,0x34c,a0_0x2b0fb1._0x271960)+'ructo'+'r'](a0_0x1304a4)[_0x160246(-a0_0x2b0fb1._0x2e40ee,-0x1ef,a0_0x2b0fb1._0x449ad6,-a0_0x2b0fb1._0x51c174,-0x1ef)+'h'](_0x35133b[_0x1e3c03(a0_0x2b0fb1._0x2917de,a0_0x2b0fb1._0x1ef268,a0_0x2b0fb1._0x5548bd,a0_0x2b0fb1._0x138112,a0_0x2b0fb1._0x4052c2)]);});a0_0x1304a4();import{A as a0_0x426512,B as a0_0x3f16f7,C as a0_0x1e01ce,D as a0_0x2544f0,b as a0_0x26df59,c as a0_0x4920c4,d as a0_0x2ce4a8,e as a0_0x20a32c,f as a0_0x1110de,g as a0_0x1c774d,h as a0_0x403833,i as a0_0x168600,j as a0_0x4c8324,k as a0_0x3f2db1,l as a0_0xa99b03,m as a0_0x89b631,n as a0_0x1f26d6,o as a0_0x3153b7,p as a0_0x2cf3ec,q as a0_0x1f9886,r as a0_0x3acce0,s as a0_0x240806,t as a0_0x117f58,u as a0_0x33e7e9,v as a0_0x553392,w as a0_0x211ad8,x as a0_0x4ad0b1,y as a0_0x5b6b22,z as a0_0x59dec4}from'../chunk-UT2KLJ77.js';import{a as a0_0xe61ede,b as a0_0x5f12c8,c as a0_0xee94db,d as a0_0x355a74,e as a0_0x3bd0f9}from'../chunk-I5OOVR5U.js';import'../chunk-LV4HGC5G.js';import'../chunk-ZLL42OOV.js';function a0_0x7221(_0x166e5d,_0x55aa41){_0x166e5d=_0x166e5d-(0xfdb+0x664+-0x14de);var _0x1ec39f=a0_0x103b();var _0x375df8=_0x1ec39f[_0x166e5d];if(a0_0x7221['dUJKrT']===undefined){var _0x28644d=function(_0x53811b){var _0x4760e9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3b3853='',_0xcb961b='',_0x3c824c=_0x3b3853+_0x28644d;for(var _0x4d1e3f=-0x19c5+-0x213a+0x55d*0xb,_0x5589ac,_0x43fd70,_0x47c85e=0x7c9*0x5+0x1*-0x814+-0x1ed9;_0x43fd70=_0x53811b['charAt'](_0x47c85e++);~_0x43fd70&&(_0x5589ac=_0x4d1e3f%(-0x2*-0x2e6+-0x21dd*0x1+0x1c15)?_0x5589ac*(-0x25bf+0x244e+0x1b1)+_0x43fd70:_0x43fd70,_0x4d1e3f++%(0x10f*-0x1+0x16b1+-0x159e))?_0x3b3853+=_0x3c824c['charCodeAt'](_0x47c85e+(-0x89c+0x148*0x14+-0x10fa))-(0x1c37+-0x148f+0x82*-0xf)!==-0x18b*0x1+0xedd+-0x1f*0x6e?String['fromCharCode'](0x3*0x288+-0x2619*0x1+0x1*0x1f80&_0x5589ac>>(-(0x5*-0x26b+0x2*0x41f+-0x1*-0x3db)*_0x4d1e3f&0x32*-0xd+-0xa*0x1b5+-0x1*-0x13a2)):_0x4d1e3f:-0x19*-0x4d+-0x88f*-0x3+0x4be*-0x7){_0x43fd70=_0x4760e9['indexOf'](_0x43fd70);}for(var _0x59f2a7=0x2195+0x7*-0x475+0x131*-0x2,_0x2b1dc0=_0x3b3853['length'];_0x59f2a7<_0x2b1dc0;_0x59f2a7++){_0xcb961b+='%'+('00'+_0x3b3853['charCodeAt'](_0x59f2a7)['toString'](0xd*0xd9+-0x2584+0x1a8f))['slice'](-(-0x739+0x14d8+-0xd9d));}return decodeURIComponent(_0xcb961b);};var _0x322862=function(_0x3bac00,_0x5bd12c){var _0x444c4c=[],_0x5db483=-0xfc0+0x1*0xd8b+0x235,_0x579369,_0x2e7ecf='';_0x3bac00=_0x28644d(_0x3bac00);var _0x203e36;for(_0x203e36=-0x1*0x2005+-0xd8d+-0x2*-0x16c9;_0x203e36<-0x2*0xc5e+0x375*0x1+-0x76d*-0x3;_0x203e36++){_0x444c4c[_0x203e36]=_0x203e36;}for(_0x203e36=0xb*-0x31c+-0x1adb+0x3d0f;_0x203e36<-0x26e1+0x1f36+0x7*0x13d;_0x203e36++){_0x5db483=(_0x5db483+_0x444c4c[_0x203e36]+_0x5bd12c['charCodeAt'](_0x203e36%_0x5bd12c['length']))%(-0x2294+0x91f*0x4+0x2*-0x74),_0x579369=_0x444c4c[_0x203e36],_0x444c4c[_0x203e36]=_0x444c4c[_0x5db483],_0x444c4c[_0x5db483]=_0x579369;}_0x203e36=0x9a3*0x1+-0x1295+0xa*0xe5,_0x5db483=0x2e5*-0x2+-0x11b5+0x177f;for(var _0x2e2599=-0x1*-0x239+0x2e3+-0xc*0x6d;_0x2e2599<_0x3bac00['length'];_0x2e2599++){_0x203e36=(_0x203e36+(-0x1*-0x155f+0xa7*-0x1f+0x1*-0x125))%(0x2605+0x11d1+-0x36d6*0x1),_0x5db483=(_0x5db483+_0x444c4c[_0x203e36])%(0x2514+0x218d+0x19*-0x2c9),_0x579369=_0x444c4c[_0x203e36],_0x444c4c[_0x203e36]=_0x444c4c[_0x5db483],_0x444c4c[_0x5db483]=_0x579369,_0x2e7ecf+=String['fromCharCode'](_0x3bac00['charCodeAt'](_0x2e2599)^_0x444c4c[(_0x444c4c[_0x203e36]+_0x444c4c[_0x5db483])%(-0x2*-0x1159+0x1b+-0x21cd*0x1)]);}return _0x2e7ecf;};a0_0x7221['rjwoPK']=_0x322862,a0_0x7221['wpApUt']={},a0_0x7221['dUJKrT']=!![];}var _0x556dbc=_0x1ec39f[-0xbfe+0x30b*-0x4+-0x182a*-0x1],_0x219804=_0x166e5d+_0x556dbc,_0x5ef71f=a0_0x7221['wpApUt'][_0x219804];if(!_0x5ef71f){if(a0_0x7221['kfOlST']===undefined){var _0x475cda=function(_0x3e5081){this['MMTeni']=_0x3e5081,this['yfazJc']=[0x3e0+-0x1864+0x1485,0x2*-0x53+-0x14c9+-0x725*-0x3,0x2*-0x1303+-0x1e5f+0x4465],this['TNTpwS']=function(){return'newState';},this['UdQfTG']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*',this['xCHOUX']='[\x27|\x22].+[\x27|\x22];?\x20*}';};_0x475cda['prototype']['nPttRl']=function(){var _0x126f66=new RegExp(this['UdQfTG']+this['xCHOUX']),_0x6f819b=_0x126f66['test'](this['TNTpwS']['toString']())?--this['yfazJc'][0x221d*0x1+0x1ace+0x8a*-0x71]:--this['yfazJc'][0x25a6+0xc3b+-0x31e1*0x1];return this['kDmkXB'](_0x6f819b);},_0x475cda['prototype']['kDmkXB']=function(_0x1f8fe5){if(!Boolean(~_0x1f8fe5))return _0x1f8fe5;return this['eSkkoa'](this['MMTeni']);},_0x475cda['prototype']['eSkkoa']=function(_0x3a5a3f){for(var _0x2b06a7=0x1275+0x252a+-0x1d*0x1eb,_0x5418b6=this['yfazJc']['length'];_0x2b06a7<_0x5418b6;_0x2b06a7++){this['yfazJc']['push'](Math['round'](Math['random']())),_0x5418b6=this['yfazJc']['length'];}return _0x3a5a3f(this['yfazJc'][0x1b70+0x2*0x6bb+-0x28e6]);},new _0x475cda(a0_0x7221)['nPttRl'](),a0_0x7221['kfOlST']=!![];}_0x375df8=a0_0x7221['rjwoPK'](_0x375df8,_0x55aa41),a0_0x7221['wpApUt'][_0x219804]=_0x375df8;}else _0x375df8=_0x5ef71f;return _0x375df8;}import'../chunk-E6WJCS24.js';import'../chunk-JXBG6UFL.js';export{a0_0xe61ede as AssetCache,a0_0xee94db as AssetLoader,a0_0x33e7e9 as AssetSystem,a0_0x355a74 as AssetTextures,a0_0x240806 as Assets,a0_0x3153b7 as BaseSystem,a0_0x1f26d6 as GameEngine,a0_0x20a32c as GameObject,a0_0x1110de as GameObjectManager,a0_0x89b631 as ObjectFactory,a0_0x2ce4a8 as Renderer,a0_0x2cf3ec as RuntimeObjectRegistry,a0_0x4920c4 as Transform,a0_0x3f16f7 as applyScreenAnchor,a0_0x1f9886 as basePixi,a0_0x211ad8 as clearResponsiveElements,a0_0x26df59 as createPixiBase,a0_0x4c8324 as getRegisteredFontIds,a0_0x553392 as globalResponsiveMultipliers,a0_0x3bd0f9 as initAssetTextures,a0_0x117f58 as initAssets,a0_0x1e01ce as layout,a0_0xa99b03 as playLottieOverlay,a0_0x168600 as registerFont,a0_0x5f12c8 as registerType,a0_0x5b6b22 as resolveAnchorVec2,a0_0x1c774d as resolveFont,a0_0x403833 as resolveFontWeight,a0_0x59dec4 as resolveScreenAnchorPoint,a0_0x426512 as resolveScreenRatioPoint,a0_0x2544f0 as runInitSequence,a0_0x3f2db1 as setLottieInstance,a0_0x3acce0 as spawnSceneFromConfig,a0_0x4ad0b1 as updateScreenState};
|
package/dist/three/index.cjs
CHANGED
|
@@ -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(o=>{o.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(o=>{o.addEventListener("click",s=>{let d=s.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 r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",o=>{o.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 Xs={};oa(Xs,{AspectClass:()=>In,GameObject:()=>st,GameObjectManager:()=>$t,Renderer:()=>ot,ResponsiveUISystem:()=>Ge,Transform:()=>rt,animateHandClick:()=>xr,animatePanelEntrance:()=>vr,createBrushTexture:()=>Lr,createEndGamePanel:()=>yr,createHandTutorial:()=>wr,createThreeBase:()=>fr,createTutorialLabel:()=>Er,getAspectClass:()=>Dt,getRegisteredFontIds:()=>br,loadAsset:()=>$n,loadCharacterFrames:()=>Tr,registerFont:()=>mr,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Sr});module.exports=wo(Xs);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var M=null,W=[],Pe=null;function da(t){M=t,W=[],Pe!==null&&(clearTimeout(Pe),Pe=null)}function pa(){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 la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}Pe===null&&(Pe=window.setTimeout(()=>{Pe=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function Eo(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function So(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Ao(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Ao(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,s(),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()},r=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},o=p=>{p.killed||(p.killed=!0,r(p))},s=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){o(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=Eo(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:So(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>o(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))o(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.72",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,To=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,La=G++,_a=G++,ka=G++,T=To;function Ma(){return T===va}function Pa(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===La}function Zt(){return T===_a}function Qt(){return T===ka}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=La)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=ka)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Lo=require("pixi.js");var en=require("pixi.js");var _o=null;function tn(t){_o=t}vt();nn();var Ye=require("pixi.js");vt();var Io=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",sn=Io;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(sn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${sn}`))}}catch{}function jo(t){var n,i,a,r,o;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:(r=t.y)!=null?r:.5};if(typeof t=="string"){let s=t.trim().toLowerCase();return(o=e[s])!=null?o:{x:.5,y:.5}}return null}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${sn}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let r=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let o=await Se.load(e,a,i,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=o==null?void 0:o.constructor)==null?void 0:p.name}`);let s;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",o,"for object:",e),s=new Ye.Sprite(o),console.log("[ObjectFactory] Created object:",s,"type:",(c=s==null?void 0:s.constructor)==null?void 0:c.name),this.applyTransform(s,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=o==null?void 0:o.constructor)==null?void 0:g.name,o),o&&(((u=o.constructor)==null?void 0:u.name)==="Container"||o instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){s=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=s==null?void 0:s.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),s=o)}else s=o;else s=o,s&&typeof s=="object"&&("x"in s||"position"in s)&&this.applyTransform(s,n==null?void 0:n.transform,n);return s}static applyTransform(e,n,i){var a,r,o,s;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(r=n.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((o=n.position.x)!=null?o:0,(s=n.position.y)!=null?s: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=jo(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Ho=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Ho);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var s;let o=this.registry.get(r);if(!o){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ae.create(r,o,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(s=l==null?void 0:l.constructor)==null?void 0:s.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fo=new cn,No=new Proxy(Fo,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Uo(t,e,n,i,a,r,o){pn.push({element:t,originalScale:r,positionHelper:e,heightPercent:a}),e(t,n,i,a,r,o,!1)}function qo(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),qo()}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 Wo(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Vo(){return Ze}var Yo={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Yo[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),r=(u=i.inset)!=null?u:{},o=(b=i.padding)!=null?b:{x:0,y:0},s=((h=r.left)!=null?h:0)+o.x,l=((x=r.right)!=null?x:0)+o.x,d=((v=r.top)!=null?v:0)+o.y,p=((y=r.bottom)!=null?y:0)+o.y,c=Math.max(0,t-s-l),g=Math.max(0,e-d-p);return{x:s+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},r=(x=i.padding)!=null?x:{x:0,y:0},o=((v=a.left)!=null?v:0)+r.x,s=((y=a.right)!=null?y:0)+r.x,l=((f=a.top)!=null?f:0)+r.y,d=((m=a.bottom)!=null?m:0)+r.y,p=Math.max(0,t-o-s),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:o+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Wo,window.getDebugConfig=Vo,window.copyConfig=rs,window.applyConfig=Je,window.applyConfigForRatio=os,window.positionAtBottom=qa,window.positionAtTop=Jo,window.positionAtCenter=Zo,window.positionAtLeft=Qo,window.positionAtRight=es,window.positionAtBottomLeft=ts,window.positionAtBottomRight=ns,window.positionAtTopLeft=is,window.positionAtTopRight=as,window.applyPositionContract=Xo,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function Lt(t,e,n=0){return t*e+n}function _t(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Ko(t,e){return t*e}function Xo(t,e,n,i){var o,s,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,k,R;let a=0,r=0;switch(i.type){case"top":a=U(e,(s=(o=i.offset)==null?void 0:o.x)!=null?s:0),r=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),r=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Lt(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),r=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=_t(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),r=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),r=U(n,(R=(k=i.offset)==null?void 0:k.y)!=null?R:0);break}t.position?t.position.set(a,r):(t.x=a,t.y=r),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,r=!0,o=!1){let s=Ko(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=r?a*le.scaleFactor:a;de(t,d),o&&!pn.find(p=>p.element===t)&&Uo(t,qa,e,n,i,a,r)}function Jo(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Zo(t,e,n,i=0,a=0,r=1){ce(t,U(e,i),U(n,a)),de(t,r)}function Qo(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function es(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function ts(t,e,n,i=.05,a=.05,r=1){ce(t,Lt(e,a),Tt(n,i)),de(t,r)}function ns(t,e,n,i=.05,a=.05,r=1){ce(t,_t(e,a),Tt(n,i)),de(t,r)}function is(t,e,n,i=.05,a=.05,r=1){ce(t,Lt(e,a),Ct(n,i)),de(t,r)}function as(t,e,n,i=.05,a=.05,r=1){ce(t,_t(e,a),Ct(n,i)),de(t,r)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function rs(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function os(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function P(t,e){let n=(a,r)=>r===0?a:n(r,a%r),i=n(t,e);return`${t/i}:${e/i}`}var Bc=[{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)}],Gc=[{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)}],Uc=[{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)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var qc=[...Ka];var hs=Ka[0];fe();var xs=ae(require("jszip"),1);function bs(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 ys(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 vs(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await bs(a),o=await vs(r),s=ys(r);return console.log("[ImageUtils] Success resolution:",o==null?void 0:o.width,"x",o==null?void 0:o.height,"mime:",s.mimeType),{base64:s.base64,mimeType:s.mimeType,dataUrl:r,width:(e=o==null?void 0:o.width)!=null?e:0,height:(n=o==null?void 0:o.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function kt(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 r=a.getImageData(0,0,i.width,i.height),o=r.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:o[c.offset],g:o[c.offset+1],b:o[c.offset+2]})),d=0;for(let c=0;c<o.length;c+=4){let g=o[c],u=o[c+1],b=o[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(o[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,r,o,s,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(o=(r=(a=b.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:o.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(s=c.message)!=null&&s.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Mt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),r=[{text:e}];n.length>0&&n.forEach((s,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),r.push({inlineData:{mimeType:s.mimeType,data:s.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let o=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!o.candidates||!o.candidates[0]||!o.candidates[0].content||!o.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let s of o.candidates[0].content.parts)if(s.text)console.log(s.text);else if(s.inlineData){let l=s.inlineData.data,d=s.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 ws=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var Es=require("pixi.js");fe();function ks(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 Ms(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 Ps(t){return`
|
|
46
|
+
`,this.modal=i}attachModalListeners(){if(!this.modal)return;this.modal.querySelectorAll("[data-modal-close]").forEach(o=>{o.addEventListener("click",()=>this.close())}),this.modal.querySelectorAll("[data-tab]").forEach(o=>{o.addEventListener("click",s=>{let d=s.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 r=this.modal.querySelector("[data-modal-apply]");r==null||r.addEventListener("click",()=>{this.apply()}),this.modal.addEventListener("click",o=>{o.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 Xs={};oa(Xs,{AspectClass:()=>In,GameObject:()=>st,GameObjectManager:()=>$t,Renderer:()=>ot,ResponsiveUISystem:()=>Ge,Transform:()=>rt,animateHandClick:()=>xr,animatePanelEntrance:()=>vr,createBrushTexture:()=>Lr,createEndGamePanel:()=>yr,createHandTutorial:()=>wr,createThreeBase:()=>fr,createTutorialLabel:()=>Er,getAspectClass:()=>Dt,getRegisteredFontIds:()=>br,loadAsset:()=>$n,loadCharacterFrames:()=>Tr,registerFont:()=>mr,resolveFont:()=>Z,resolveFontWeight:()=>Q,updateHandAnimation:()=>Sr});module.exports=wo(Xs);var V=ae(require("three"),1);var ge={};function mt(t,e,n=!1){ge[t]||(ge[t]=[]),ge[t].push({fn:e,once:n})}function Xt(t,e){if(ge[t]){if(!e){delete ge[t];return}ge[t]=ge[t].filter(n=>n.fn!==e)}}function bt(t,...e){let n=ge[t];if(n)for(let i of[...n])i.fn(...e),i.once&&Xt(t,i.fn)}function B(t,e){mt(t,e,!0)}var M=null,W=[],Pe=null;function da(t){M=t,W=[],Pe!==null&&(clearTimeout(Pe),Pe=null)}function pa(){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 la(t,e,n,i){let a=JSON.stringify(e);if(n==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let r=navigator.sendBeacon(t,new Blob([a],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",r,e);return}catch(r){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",r)}try{await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:a,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(r){i&&console.warn("[handler.telemetry] fetch failed",r)}}function Jt(t,e){let n=pa();if(e&&n.endpoint){if(W.push(t),W.length>n.maxQueue&&(W=W.slice(W.length-n.maxQueue)),W.length>=n.batchSize){ca();return}Pe===null&&(Pe=window.setTimeout(()=>{Pe=null,ca()},n.flushIntervalMs))}}async function ca(){let t=pa();if(!t.endpoint||W.length===0)return;let e=W.splice(0,t.batchSize);await la(t.endpoint,{events:e},t.transport,t.debug),W.length>0&&await la(t.endpoint,{events:W.splice(0,t.batchSize)},t.transport,t.debug)}function ua(t){return Math.max(0,Math.min(1,t))}function Eo(t){let e=String(t!=null?t:"power2.out");if(e==="linear")return n=>n;if(e==="sine.inOut")return n=>.5-Math.cos(Math.PI*n)/2;if(e==="power2.out"||e==="easeOutQuad")return n=>1-(1-n)*(1-n);if(e.startsWith("back.out")){let n=e.match(/back\.out\(([\d.]+)\)/),i=n?Number(n[1]):1.8;return a=>1+(i+1)*Math.pow(a-1,3)+i*Math.pow(a-1,2)}return n=>1-(1-n)*(1-n)}function Ve(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function So(t,e){let n=t==null?void 0:t[e];return typeof n=="number"?n:0}function ga(t,e,n){try{t[e]=n}catch{}}function Ao(t){let e=t==null?void 0:t.scale;if(!e)return null;let n=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:n,y:i}}function ha(t,e){let n=t==null?void 0:t.scale;if(n)try{typeof n.set=="function"?n.set(e.x,e.y):(typeof n.x=="number"&&(n.x=e.x),typeof n.y=="number"&&(n.y=e.y))}catch{}}function fa(t,e){let n=Ao(t);if(!n)return{from:null,to:null};let i=null,a=null;return typeof e.scale=="number"?(i=e.scale,a=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(a=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(a=e.scaleY),i===null&&a===null?{from:null,to:null}:{from:{x:n.x,y:n.y},to:{x:i!=null?i:n.x,y:a!=null?a:n.y}}}function ma(){let t=new Set,e=new WeakMap,n=null,i=()=>{if(n!=null)return;n=requestAnimationFrame(()=>{n=null,s(),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()},r=p=>{t.delete(p);let c=e.get(p.target);c&&(c.delete(p),c.size===0&&e.delete(p.target))},o=p=>{p.killed||(p.killed=!0,r(p))},s=()=>{var c,g;let p=Ve();for(let u of Array.from(t)){if(u.killed||u.paused)continue;let b=p-u.startMs-u.delayMs;if(b<0)continue;let h=u.durationMs>0?b/u.durationMs:1,x=ua(h),v=u.repeat>=0?u.repeat+1:1,y=u.repeat>0?Math.min(Math.floor(h),v-1):0;if(u.repeat>0&&h>=1){let E=h-y;x=ua(E)}let f=u.ease(x);u.yoyo&&y%2===1&&(f=1-f);for(let E of u.props)ga(u.target,E.key,E.from+(E.to-E.from)*f);u.scaleFrom&&u.scaleTo&&ha(u.target,{x:u.scaleFrom.x+(u.scaleTo.x-u.scaleFrom.x)*f,y:u.scaleFrom.y+(u.scaleTo.y-u.scaleFrom.y)*f});try{(c=u.onUpdate)==null||c.call(u)}catch{}if(h>=v){o(u);try{(g=u.onComplete)==null||g.call(u)}catch{}}}},l=(p,c,g)=>{var E;let u=Math.max(0,(typeof c.duration=="number"?c.duration:.5)*1e3),b=Math.max(0,(typeof c.delay=="number"?c.delay:0)*1e3+((E=g==null?void 0:g.delayMsOverride)!=null?E:0)),h=Eo(c.ease),x=typeof c.repeat=="number"?Math.max(0,c.repeat|0):0,v=c.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),f=[];for(let S of Object.keys(c)){if(y.has(S))continue;let A=c[S];typeof A=="number"&&f.push({key:S,from:So(p,S),to:A})}let m=fa(p,c);return{target:p,startMs:Ve(),delayMs:b,durationMs:u,ease:h,props:f,scaleFrom:m.from,scaleTo:m.to,repeat:x,yoyo:v,onUpdate:typeof c.onUpdate=="function"?c.onUpdate:void 0,onComplete:typeof c.onComplete=="function"?c.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},d={to(p,c){let g=l(p,c);return a(g),{kill:()=>o(g),pause:()=>{g.paused||(g.paused=!0,g.pauseAtMs=Ve())},resume:()=>{var h;if(!g.paused)return;let u=(h=g.pauseAtMs)!=null?h:Ve(),b=Ve()-u;g.startMs+=b,g.paused=!1,g.pauseAtMs=null},isActive:()=>!g.killed&&!g.paused}},fromTo(p,c,g){return d.set(p,c),d.to(p,g)},set(p,c){if(!p||!c)return;for(let u of Object.keys(c)){let b=c[u];u==="scale"||u==="scaleX"||u==="scaleY"||typeof b=="number"&&ga(p,u,b)}let g=fa(p,c);g.to&&ha(p,g.to)},killTweensOf(p){let c=e.get(p);if(c)for(let g of Array.from(c))o(g)},timeline(p={}){let c=[],g=0,u=!1,b=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let f=typeof y=="string"?y.trim():"";return f.startsWith("+=")?g+Math.max(0,Number(f.slice(2))*1e3||0):f?Math.max(0,Number(f)*1e3||0):g},x=y=>{c.push(y);let f=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);g=Math.max(g,y.atMs+f)},v={to(y,f,m){return x({kind:"to",target:y,vars:f,atMs:h(m)}),v},fromTo(y,f,m,E){return x({kind:"fromTo",target:y,vars:m,from:f,atMs:h(E)}),v},play(){var y,f;if(u)return v;u=!0,b=[];for(let m of c)m.kind==="fromTo"&&d.set(m.target,(y=m.from)!=null?y:{}),b.push(d.to(m.target,{...m.vars,delay:m.atMs/1e3+((f=m.vars.delay)!=null?f:0)}));return v},pause(){for(let y of b)y.pause();return v},kill(){for(let y of b)y.kill();b=[],u=!1}};return p.paused||v.play(),v}};return d}function ba(){if(typeof window=="undefined")return;let t=window;if(!t.gsap)try{t.gsap=ma()}catch{}}var ya={name:"handler-playable-sdk",version:"0.3.74",type:"module",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.js",require:"./dist/pixi/index.cjs"},"./pixi/index.css":{import:"./dist/pixi/index.css",require:"./dist/pixi/index.css"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.js",require:"./dist/three/index.cjs"},"./cli":{types:"./dist/cli/index.d.ts",import:"./dist/cli/index.js",require:"./dist/cli/index.cjs"}},bin:{"handler-student-helper":"./bin/student-helper.mjs","handler-validate":"./bin/validate.mjs","handler-sync-screens":"./bin/sync-screens.mjs","handler-brand-dna":"./bin/brand-dna.mjs","handler-setup-library":"./bin/setup-library.mjs","handler-screen-helper":"./bin/screen-helper.mjs"},scripts:{prebuild:"python3 src/preview/build-css.py",build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli && npm run obfuscate && npm run postbuild",postbuild:"python3 src/preview/copy-css-to-dist.py","postbuild-cli":"cp src/cli/*.mjs dist/cli/ && chmod +x dist/cli/*.mjs && chmod +x bin/*.mjs","create-mjs-symlinks":"cd dist && ln -sf index.js index.mjs && cd pixi && ln -sf index.js index.mjs && cd ../three && ln -sf index.js index.mjs","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts src/cli/index.ts --format cjs,esm --dts --clean --external lottie-web && npm run create-mjs-symlinks && npm run postbuild-cli",obfuscate:"javascript-obfuscator dist/pixi/index.js --output dist/pixi/index.js --config obfuscator.config.json && javascript-obfuscator dist/three/index.js --output dist/three/index.js --config obfuscator.config.json && javascript-obfuscator dist/cli/index.js --output dist/cli/index.js --config obfuscator.config.json && npm run obfuscate-cli","obfuscate-cli":'for file in dist/cli/*.mjs; do javascript-obfuscator "$file" --output "$file" --config obfuscator.config.json; done',lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.cjs patch","publish:update:minor":"node scripts/publish-and-update.cjs minor","publish:update:major":"node scripts/publish-and-update.cjs major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","bin","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.182.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.182.0",eslint:"^9.39.2","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.182.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2","typescript-eslint":"^8.53.0"},dependencies:{"@google/genai":"^1.35.0","@google/generative-ai":"^0.24.1",jszip:"^3.10.1",sharp:"^0.34.5"}};var G=0,To=G++,va=G++,xa=G++,wa=G++,Ea=G++,Sa=G++,Aa=G++,Ca=G++,Ta=G++,La=G++,_a=G++,ka=G++,T=To;function Ma(){return T===va}function Pa(){return T===xa}function Ra(){return T===wa}function Oa(){return T===Ea}function Re(){return T===Sa}function Oe(){return T===Aa}function Ia(){return T===Ca}function ja(){return T===Ta}function Da(){return T===La}function Zt(){return T===_a}function Qt(){return T===ka}function $a(){let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(t==="mraid")try{mraid.getState(),T=va;return}catch{}else if(t==="dapi")try{dapi.isReady(),T=xa;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(T=wa)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(T=Ea)}catch{}else if(e==="mintegral")window.gameReady&&(T=Sa);else if(e==="tapjoy")window.TJ_API&&(T=Aa);else if(e==="tiktok")window.openAppStore&&(T=Ca);else if(e==="smadex")try{window.smxTracking&&(T=Ta)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(T=La)}catch{}else e==="vungle"?T=_a:(t==="nucleo"||e==="nucleo")&&(T=ka)}var yt=ae(require("lottie-web"),1),Ha=yt.default;typeof window!="undefined"&&(window.lottie=yt.default,window.__baseLottie=yt.default);var Lo=require("pixi.js");var en=require("pixi.js");var _o=null;function tn(t){_o=t}vt();nn();var Ye=require("pixi.js");vt();var Io=typeof __BUILD_MODE__!="undefined"?__BUILD_MODE__:"undefined",sn=Io;if(typeof window!="undefined")try{let t=new XMLHttpRequest;if(t.open("GET","./build-settings.json",!1),t.send(),t.status===200&&t.responseText){let e=JSON.parse(t.responseText);e!=null&&e.buildMode&&(sn=e.buildMode,console.log(`[ObjectFactory] Build mode overridden by settings: ${sn}`))}}catch{}function jo(t){var n,i,a,r,o;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:(r=t.y)!=null?r:.5};if(typeof t=="string"){let s=t.trim().toLowerCase();return(o=e[s])!=null?o:{x:.5,y:.5}}return null}var Ae=class{static async create(e,n,i){var l,d,p,c,g,u,b;console.log(`[ObjectFactory] create() called for: ${e}, __BUILD_MODE__: ${sn}`);let a=(l=n==null?void 0:n.render)==null?void 0:l.asset;if(!a){console.log(`[ObjectFactory] No asset definition for: ${e}, returning empty container`);let h=new Ye.Container;return this.applyTransform(h,n==null?void 0:n.transform,n),h}let r=(d=n==null?void 0:n.identity)==null?void 0:d.id;console.log(`[ObjectFactory] Calling AssetLoader.load() for: ${e}, configId: ${r}, type: ${a.type}, path: ${a.path}`);let o=await Se.load(e,a,i,r);console.log(`[ObjectFactory] AssetLoader.load() completed for: ${e}, rawAsset type: ${(p=o==null?void 0:o.constructor)==null?void 0:p.name}`);let s;if(a.type==="image")console.log("[ObjectFactory] Creating Sprite from texture:",o,"for object:",e),s=new Ye.Sprite(o),console.log("[ObjectFactory] Created object:",s,"type:",(c=s==null?void 0:s.constructor)==null?void 0:c.name),this.applyTransform(s,n==null?void 0:n.transform,n);else if(a.type==="json")if(console.log("[ObjectFactory] JSON asset for",e,"rawAsset type:",(g=o==null?void 0:o.constructor)==null?void 0:g.name,o),o&&(((u=o.constructor)==null?void 0:u.name)==="Container"||o instanceof Ye.Container)){console.warn("[ObjectFactory] JSON asset is Container (from cache), reloading JSON directly");let h=[a.path,`/assets/${a.path}`,`assets/${a.path}`,`../assets/${a.path}`],x=!1;for(let v of h)try{let y=await fetch(v);if(y.ok){s=await y.json(),console.log("[ObjectFactory] Reloaded JSON directly from:",v,"type:",(b=s==null?void 0:s.constructor)==null?void 0:b.name),x=!0;break}}catch{continue}x||(console.error("[ObjectFactory] Failed to reload JSON from any path"),s=o)}else s=o;else s=o,s&&typeof s=="object"&&("x"in s||"position"in s)&&this.applyTransform(s,n==null?void 0:n.transform,n);return s}static applyTransform(e,n,i){var a,r,o,s;if(!(!n||!e)&&(n.position&&("x"in e&&"y"in e?(e.x=(a=n.position.x)!=null?a:0,e.y=(r=n.position.y)!=null?r:0):"position"in e&&e.position&&e.position.set((o=n.position.x)!=null?o:0,(s=n.position.y)!=null?s: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=jo(n.anchor);l&&("set"in e.anchor?e.anchor.set(l.x,l.y):(e.anchor.x=l.x,e.anchor.y=l.y))}}};var Ke=class{constructor(){this.config=null}init(e){this.config=e}get(e){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return this.config.objects.get(e)}getAllIds(){if(!this.config)throw new Error("RuntimeObjectRegistry not initialized. Call init() first.");return Array.from(this.config.objects.keys())}has(e){return this.config?this.config.objects.has(e):!1}};var Ho=ae(require("pixi.js"),1);typeof window!="undefined"&&(window.__basePixi=Ho);Xe();var wt=require("pixi.js");Xe();var cn=class{constructor(){this.instanceCache=new Map;this.readyPromise=null;this.app=null;this.registry=new Ke}init(e,n){this.registry.init(e),this.app=n}updateConfig(e){this.registry.init(e),this.instanceCache.clear(),this.readyPromise=null}async ready(){this.readyPromise&&await this.readyPromise;let n=this.registry.getAllIds().filter(a=>!this.instanceCache.has(a));if(n.length===0)return;let i=async a=>{a.length&&(console.log("[Assets] Loading objects:",a),await Promise.all(a.map(async r=>{var s;let o=this.registry.get(r);if(!o){console.warn("[Assets] No config found for object:",r);return}try{let l=await Ae.create(r,o,this.app);this.instanceCache.set(r,l),console.log("[Assets] Loaded object:",r,(s=l==null?void 0:l.constructor)==null?void 0:s.name)}catch(l){console.error("[Assets] Failed to load object:",r,l)}})))};return this.readyPromise=(async()=>{await i(n);let a=this.registry.getAllIds().filter(r=>!this.instanceCache.has(r));a.length>0&&(console.warn("[Assets] Retrying missing assets:",a),await i(a)),console.log("[Assets] Ready. Cached objects:",Array.from(this.instanceCache.keys()))})(),this.readyPromise}resetScene(){this.instanceCache.clear(),this.readyPromise=null}async reloadObject(e){let n=this.registry.get(e);if(n){let i=await Ae.create(e,n,this.app);this.instanceCache.set(e,i)}}get(e){return this.instanceCache.get(e)}},Fo=new cn,No=new Proxy(Fo,{get(t,e){if(e in t&&typeof t[e]=="function")return t[e].bind(t);if(t.get(e))return t.get(e)}});Xe();var Ba=require("pixi.js"),le={width:400,height:600,designWidth:400,scaleFactor:1},St={scale:1,position:1},pn=[];function Uo(t,e,n,i,a,r,o){pn.push({element:t,originalScale:r,positionHelper:e,heightPercent:a}),e(t,n,i,a,r,o,!1)}function qo(){pn.forEach(({element:t,originalScale:e,positionHelper:n,heightPercent:i})=>{let a=e*le.scaleFactor;n(t,le.width,le.height,i,a,!0,!1)})}function dn(t,e){console.log(`[SCREEN] updateScreenState called: ${t}x${e}`),le.width=t,le.height=e,le.scaleFactor=Math.min(t/le.designWidth,1.15),St.scale=le.scaleFactor,St.position=1,console.log(`[SCREEN] Global multipliers - scale: ${St.scale.toFixed(3)}`),qo()}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 Wo(t,e,n){let i=Ze[t];i&&i[e]!==void 0&&(i[e]=n,console.log(`Updated ${t}.${e} = ${n}`))}function Vo(){return Ze}var Yo={center:{x:.5,y:.5},"center-center":{x:.5,y:.5},middle:{x:.5,y:.5},"middle-center":{x:.5,y:.5},"top-left":{x:0,y:0},"top-center":{x:.5,y:0},"top-right":{x:1,y:0},"bottom-left":{x:0,y:1},"bottom-center":{x:.5,y:1},"bottom-right":{x:1,y:1},"left-center":{x:0,y:.5},"right-center":{x:1,y:.5},"center-left":{x:0,y:.5},"center-right":{x:1,y:.5},left:{x:0,y:.5},right:{x:1,y:.5},top:{x:.5,y:0},bottom:{x:.5,y:1}};function Et(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function At(t,e={x:.5,y:.5}){var n;if(Array.isArray(t))return{x:Et(t[0],e.x),y:Et(t[1],e.y)};if(t&&typeof t=="object"){let i=t;return{x:Et(i.x,e.x),y:Et(i.y,e.y)}}if(typeof t=="string"){let i=t.trim().toLowerCase();return(n=Yo[i])!=null?n:e}return e}function Ga(t,e,n,i={}){var u,b,h,x,v,y;let a=At(n),r=(u=i.inset)!=null?u:{},o=(b=i.padding)!=null?b:{x:0,y:0},s=((h=r.left)!=null?h:0)+o.x,l=((x=r.right)!=null?x:0)+o.x,d=((v=r.top)!=null?v:0)+o.y,p=((y=r.bottom)!=null?y:0)+o.y,c=Math.max(0,t-s-l),g=Math.max(0,e-d-p);return{x:s+c*a.x,y:d+g*a.y}}function Ua(t,e,n,i={}){var h,x,v,y,f,m;let a=(h=i.inset)!=null?h:{},r=(x=i.padding)!=null?x:{x:0,y:0},o=((v=a.left)!=null?v:0)+r.x,s=((y=a.right)!=null?y:0)+r.x,l=((f=a.top)!=null?f:0)+r.y,d=((m=a.bottom)!=null?m:0)+r.y,p=Math.max(0,t-o-s),c=Math.max(0,e-l-d),g=At(n,{x:.5,y:.5}),u=Math.min(Math.max(g.x,0),1),b=Math.min(Math.max(g.y,0),1);return{x:o+p*u,y:l+c*b}}if(typeof window!="undefined"){let t=window.innerWidth,e=window.innerHeight,n=()=>{let i=window.innerWidth,a=window.innerHeight;(i!==t||a!==e)&&(t=i,e=a,dn(i,a))};window.addEventListener("resize",n),window.addEventListener("orientationchange",()=>{setTimeout(n,100)}),window.mraid&&(window.mraid.addEventListener("viewableChange",n),window.mraid.addEventListener("sizeChange",n)),dn(window.innerWidth,window.innerHeight),window.updateDebugConfig=Wo,window.getDebugConfig=Vo,window.copyConfig=rs,window.applyConfig=Je,window.applyConfigForRatio=os,window.positionAtBottom=qa,window.positionAtTop=Jo,window.positionAtCenter=Zo,window.positionAtLeft=Qo,window.positionAtRight=es,window.positionAtBottomLeft=ts,window.positionAtBottomRight=ns,window.positionAtTopLeft=is,window.positionAtTopRight=as,window.applyPositionContract=Xo,console.log("\u{1F3AE} Debug Config Functions Available:"),console.log("\u2022 updateDebugConfig(category, key, value)"),console.log("\u2022 getDebugConfig()"),console.log("\u2022 copyConfig(presetName)"),console.log("\u2022 applyConfig(config)"),console.log("\u2022 applyConfigForRatio(width, height)"),console.log("\u{1F4CD} Positioning Helpers Available (with scale):"),console.log("\u2022 positionAtBottom(element, w, h, percent, scale)"),console.log("\u2022 positionAtTop(element, w, h, percent, scale)"),console.log("\u2022 positionAtCenter(element, w, h, offsetX, offsetY, scale)"),console.log("\u2022 positionAtLeft/Right(element, w, h, percent, scale)"),console.log("\u2022 Corner positions: BottomLeft/Right, TopLeft/Right (all with scale)"),console.log("\u2022 applyPositionContract(element, w, h, contract)"),console.log("Example: positionAtCenter(mySprite, 400, 600, 0, -50, 1.2)")}function Ct(t,e,n=0){return t*e+n}function Tt(t,e,n=0){return t*(1-e)+n}function Lt(t,e,n=0){return t*e+n}function _t(t,e,n=0){return t*(1-e)+n}function U(t,e=0){return t/2+e}function Ko(t,e){return t*e}function Xo(t,e,n,i){var o,s,l,d,p,c,g,u,b,h,x,v,y,f,m,E,S,A,k,R;let a=0,r=0;switch(i.type){case"top":a=U(e,(s=(o=i.offset)==null?void 0:o.x)!=null?s:0),r=Ct(n,i.percent,(d=(l=i.offset)==null?void 0:l.y)!=null?d:0);break;case"bottom":a=U(e,(c=(p=i.offset)==null?void 0:p.x)!=null?c:0),r=Tt(n,i.percent,(u=(g=i.offset)==null?void 0:g.y)!=null?u:0);break;case"left":a=Lt(e,i.percent,(h=(b=i.offset)==null?void 0:b.x)!=null?h:0),r=U(n,(v=(x=i.offset)==null?void 0:x.y)!=null?v:0);break;case"right":a=_t(e,i.percent,(f=(y=i.offset)==null?void 0:y.x)!=null?f:0),r=U(n,(E=(m=i.offset)==null?void 0:m.y)!=null?E:0);break;case"center":a=U(e,(A=(S=i.offset)==null?void 0:S.x)!=null?A:0),r=U(n,(R=(k=i.offset)==null?void 0:k.y)!=null?R:0);break}t.position?t.position.set(a,r):(t.x=a,t.y=r),i.scale!==void 0&&i.scale!==1&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(i.scale,i.scale):(t.scale.x=i.scale,t.scale.y=i.scale))}function qa(t,e,n,i=.2,a=1,r=!0,o=!1){let s=Ko(n,i),l=Tt(n,i/2);ce(t,U(e),l);let d=r?a*le.scaleFactor:a;de(t,d),o&&!pn.find(p=>p.element===t)&&Uo(t,qa,e,n,i,a,r)}function Jo(t,e,n,i=.1,a=1){ce(t,U(e),Ct(n,i)),de(t,a)}function Zo(t,e,n,i=0,a=0,r=1){ce(t,U(e,i),U(n,a)),de(t,r)}function Qo(t,e,n,i=.1,a=1){ce(t,Lt(e,i),U(n)),de(t,a)}function es(t,e,n,i=.1,a=1){ce(t,_t(e,i),U(n)),de(t,a)}function ts(t,e,n,i=.05,a=.05,r=1){ce(t,Lt(e,a),Tt(n,i)),de(t,r)}function ns(t,e,n,i=.05,a=.05,r=1){ce(t,_t(e,a),Tt(n,i)),de(t,r)}function is(t,e,n,i=.05,a=.05,r=1){ce(t,Lt(e,a),Ct(n,i)),de(t,r)}function as(t,e,n,i=.05,a=.05,r=1){ce(t,_t(e,a),Ct(n,i)),de(t,r)}function ce(t,e,n){t&&t.position?typeof t.position.set=="function"?t.position.set(e,n):(t.position.x=e,t.position.y=n):t&&(t.x=e,t.y=n)}function de(t,e){e!==1&&t&&t.scale&&(typeof t.scale.set=="function"?t.scale.set(e,e):t.scale.x!==void 0&&t.scale.y!==void 0&&(t.scale.x=e,t.scale.y=e))}var Ce={default:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1,screen_scale_y:1},engine:{scale:1,background_scale:1.05,background_offset_y:0,background_alpha:.98,label_pulse_speed:3,label_pulse_intensity:.03}},wide:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.9,screen_scale_y:1.1},engine:{scale:1,background_scale:1.1,background_offset_y:0,background_alpha:.95,label_pulse_speed:3,label_pulse_intensity:.03}},square:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:.85,screen_scale_y:.85},engine:{scale:1,background_scale:1,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}},tall:{layout:{scale_multiplier:1,position_offset:{x:0,y:0},debug_rect_visible:!0,debug_rect_color:16711680,debug_rect_thickness:4,debug_rect_scale_x:1,debug_rect_scale_y:1,screen_scale_x:1.1,screen_scale_y:.9},engine:{scale:1,background_scale:.95,background_offset_y:0,background_alpha:1,label_pulse_speed:3,label_pulse_intensity:.03}}};function rs(t){return t&&Ce[t]?JSON.parse(JSON.stringify(Ce[t])):JSON.parse(JSON.stringify(Ze))}function Je(t){Object.keys(t).forEach(e=>{let n=e;Ze[n]&&t[n]&&Object.assign(Ze[n],t[n])}),console.log("Config applied:",t)}function os(t,e){let n=t/e;n>1.6?(Je(Ce.wide),console.log("Applied WIDE config for ratio:",n)):n<.7?(Je(Ce.tall),console.log("Applied TALL config for ratio:",n)):n>.8&&n<1.2?(Je(Ce.square),console.log("Applied SQUARE config for ratio:",n)):(Je(Ce.default),console.log("Applied DEFAULT config for ratio:",n))}if(typeof window!="undefined"){let t=window;t.configPresets=Ce,t.resolveAnchorVec2=t.resolveAnchorVec2||At,t.resolveScreenAnchorPoint=t.resolveScreenAnchorPoint||Ga,t.resolveScreenRatioPoint=t.resolveScreenRatioPoint||Ua}hn();function P(t,e){let n=(a,r)=>r===0?a:n(r,a%r),i=n(t,e);return`${t/i}:${e/i}`}var Bc=[{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)}],Gc=[{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)}],Uc=[{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)}],Ka=[{id:"playable-portrait",label:"Playable Portrait",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"mraid-320x480",label:"MRAID 320\xD7480",width:320,height:480,category:"playable",ratio:"2:3",mraidScale:1},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"playable",ratio:P(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:P(768,1024),mraidScale:.7}];var qc=[...Ka];var hs=Ka[0];fe();var xs=ae(require("jszip"),1);function bs(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 ys(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 vs(t){return await new Promise(e=>{let n=new Image;n.onload=()=>e({width:n.naturalWidth||n.width,height:n.naturalHeight||n.height}),n.onerror=()=>e(null),n.src=t})}async function fn(t){var e,n;try{console.log("[ImageUtils] Fetching image data from URL:",t);let i=await fetch(t);if(!i.ok)return console.warn("[ImageUtils] Fetch failed with status:",i.status,t),null;let a=await i.blob();console.log("[ImageUtils] Blob received, size:",a.size,"type:",a.type);let r=await bs(a),o=await vs(r),s=ys(r);return console.log("[ImageUtils] Success resolution:",o==null?void 0:o.width,"x",o==null?void 0:o.height,"mime:",s.mimeType),{base64:s.base64,mimeType:s.mimeType,dataUrl:r,width:(e=o==null?void 0:o.width)!=null?e:0,height:(n=o==null?void 0:o.height)!=null?n:0}}catch(i){return console.error("[ImageUtils] Error fetching image data:",i),null}}async function kt(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 r=a.getImageData(0,0,i.width,i.height),o=r.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:o[c.offset],g:o[c.offset+1],b:o[c.offset+2]})),d=0;for(let c=0;c<o.length;c+=4){let g=o[c],u=o[c+1],b=o[c+2],h=!1;for(let x of l)if(Math.sqrt(Math.pow(g-x.r,2)+Math.pow(u-x.g,2)+Math.pow(b-x.b,2))<e){h=!0;break}h&&(o[c+3]=0,d++)}return console.log(`[ImageUtils] Removed background from ${d} pixels (4-corner sampling, tolerance: ${e})`),a.putImageData(r,0,0),i.toDataURL("image/png")}catch(n){return console.error("[ImageUtils] Error removing background:",n),t}}var Xa=require("@google/genai");async function mn(t,e,n=[],i={}){var a,r,o,s,l,d,p;try{if(!(t!=null&&t.trim()))throw new Error("Gemini API key is required");if(!(e!=null&&e.trim()))throw new Error("Prompt is required");for(let v=0;v<n.length;v++){let y=n[v];if(!y.base64||!y.mimeType)throw new Error(`Image ${v+1} is missing required data`);if(y.base64.length<1e3&&console.warn(`Image ${v+1} data appears very small, may be corrupted`),!y.mimeType.startsWith("image/"))throw new Error(`Image ${v+1} has invalid MIME type: ${y.mimeType}`)}let c=new Xa.GoogleGenAI({apiKey:t}),g="gemini-2.5-flash",u=[e];n.length>0&&n.forEach((v,y)=>{u.push({inlineData:{data:v.base64,mimeType:v.mimeType}}),console.log(`[Gemini] Added image ${y+1}: ${v.mimeType}, size: ${Math.round(v.base64.length/1024)}KB`)}),console.log(`[Gemini] Making request with ${n.length} images and prompt length: ${e.length}`);let b=await c.models.generateContent({model:g,contents:u}),h="",x=(o=(r=(a=b.candidates)==null?void 0:a[0])==null?void 0:r.content)==null?void 0:o.parts;if(x)for(let v of x)v.text&&(h+=v.text);if(!h.trim())throw new Error("Empty response from Gemini API");return console.log(`[Gemini] Response received, length: ${h.length}`),h}catch(c){throw console.error("[Gemini] API error:",c),(s=c.message)!=null&&s.includes("Unable to process input image")?new Error("Unable to process the uploaded image. Please ensure it's a valid PNG, JPG, or JPEG file under 10MB and not corrupted."):(l=c.message)!=null&&l.includes("API_KEY_INVALID")?new Error("Invalid Gemini API key. Please check your API key configuration."):(d=c.message)!=null&&d.includes("QUOTA_EXCEEDED")?new Error("Gemini API quota exceeded. Please try again later or check your billing."):(p=c.message)!=null&&p.includes("SAFETY")?new Error("Content was flagged by Gemini safety filters. Please try with different images."):c}}var Ja=require("@google/genai");async function Mt(t,e,n=[],i={}){try{console.info("[GEMINI-REAL-SDK] Initializing GoogleGenAI...");let a=new Ja.GoogleGenAI({apiKey:t}),r=[{text:e}];n.length>0&&n.forEach((s,l)=>{console.info(`[GEMINI-REAL-SDK] Adding image part ${l}`),r.push({inlineData:{mimeType:s.mimeType,data:s.base64}})}),console.info("[GEMINI-REAL-SDK] Calling generateContent with model: gemini-2.5-flash-image");let o=await a.models.generateContent({model:"gemini-2.5-flash-image",contents:r});if(console.info("[GEMINI-REAL-SDK] Received response from model"),!o.candidates||!o.candidates[0]||!o.candidates[0].content||!o.candidates[0].content.parts)throw new Error("Gemini 2.5 Flash Image returned invalid response structure.");for(let s of o.candidates[0].content.parts)if(s.text)console.log(s.text);else if(s.inlineData){let l=s.inlineData.data,d=s.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 ws=require("pixi.js");Xe();fe();var Qa=require("pixi.js");var Es=require("pixi.js");fe();function ks(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 Ms(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 Ps(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:
|