handler-playable-sdk 0.4.57 → 0.4.59
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-A3OUQG23.js → chunk-DI4XTNYK.js} +1 -1
- 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 +1 -1
- package/dist/index.css +17 -2
- package/dist/index.js +1 -1
- package/dist/pixi/index.cjs +1 -1
- package/dist/pixi/index.css +17 -2
- package/dist/pixi/index.js +1 -1
- package/dist/three/index.cjs +1 -1
- package/dist/three/index.css +17 -2
- package/dist/three/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Oi,d as le,e as Ii}from"./chunk-I5OOVR5U.js";import{i as zt}from"./chunk-LV4HGC5G.js";import{c as st,d as jt,e as lt,g as ia,h as ji,j as Di,k as Dt,l as na,m as aa,n as zi,o as ra}from"./chunk-ZLL42OOV.js";import{a as Yr}from"./chunk-JXBG6UFL.js";import{Application as $o}from"pixi.js";var Ce={};function Ht(r,e,t=!1){Ce[r]||(Ce[r]=[]),Ce[r].push({fn:e,once:t})}function Hi(r,e){if(Ce[r]){if(!e){delete Ce[r];return}Ce[r]=Ce[r].filter(t=>t.fn!==e)}}function $t(r,...e){let t=Ce[r];if(t)for(let i of[...t])i.fn(...e),i.once&&Hi(r,i.fn)}function ee(r,e){Ht(r,e,!0)}var G=null,ne=[],Be=null;function la(r){G=r,ne=[],Be!==null&&(clearTimeout(Be),Be=null)}function ca(){var r,e,t;return{endpoint:(G==null?void 0:G.endpoint)||"",transport:(G==null?void 0:G.transport)||"beacon",batchSize:(r=G==null?void 0:G.batchSize)!=null?r:10,flushIntervalMs:(e=G==null?void 0:G.flushIntervalMs)!=null?e:300,maxQueue:(t=G==null?void 0:G.maxQueue)!=null?t:200,debug:!!(G!=null&&G.debug)}}async function oa(r,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(r,new Blob([n],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",a,e);return}catch(a){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(a){i&&console.warn("[handler.telemetry] fetch failed",a)}}function $i(r,e){let t=ca();if(e&&t.endpoint){if(ne.push(r),ne.length>t.maxQueue&&(ne=ne.slice(ne.length-t.maxQueue)),ne.length>=t.batchSize){sa();return}Be===null&&(Be=window.setTimeout(()=>{Be=null,sa()},t.flushIntervalMs))}}async function sa(){let r=ca();if(!r.endpoint||ne.length===0)return;let e=ne.splice(0,r.batchSize);await oa(r.endpoint,{events:e},r.transport,r.debug),ne.length>0&&await oa(r.endpoint,{events:ne.splice(0,r.batchSize)},r.transport,r.debug)}function da(r){return Math.max(0,Math.min(1,r))}function Wr(r){let e=String(r!=null?r:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function ct(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Kr(r,e){let t=r==null?void 0:r[e];return typeof t=="number"?t:0}function pa(r,e,t){try{r[e]=t}catch{}}function Xr(r){let e=r==null?void 0:r.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ua(r,e){let t=r==null?void 0:r.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 ga(r,e){let t=Xr(r);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function ha(){let r=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,s(),r.size>0&&i()})},n=d=>{var u;r.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},a=d=>{r.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},o=d=>{d.killed||(d.killed=!0,a(d))},s=()=>{var p,u;let d=ct();for(let g of Array.from(r)){if(g.killed||g.paused)continue;let m=d-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,f=da(h),b=g.repeat>=0?g.repeat+1:1,y=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let w=h-y;f=da(w)}let v=g.ease(f);g.yoyo&&y%2===1&&(v=1-v);for(let w of g.props)pa(g.target,w.key,w.from+(w.to-w.from)*v);g.scaleFrom&&g.scaleTo&&ua(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(p=g.onUpdate)==null||p.call(g)}catch{}if(h>=b){o(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(d,p,u)=>{var w;let g=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),m=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((w=u==null?void 0:u.delayMsOverride)!=null?w:0)),h=Wr(p.ease),f=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,b=p.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(p)){if(y.has(E))continue;let L=p[E];typeof L=="number"&&v.push({key:E,from:Kr(d,E),to:L})}let x=ga(d,p);return{target:d,startMs:ct(),delayMs:m,durationMs:g,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:f,yoyo:b,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>o(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ct())},resume:()=>{var h;if(!u.paused)return;let g=(h=u.pauseAtMs)!=null?h:ct(),m=ct()-g;u.startMs+=m,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let g of Object.keys(p)){let m=p[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&pa(d,g,m)}let u=ga(d,p);u.to&&ua(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))o(u)},timeline(d={}){let p=[],u=0,g=!1,m=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},f=y=>{p.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,x){return f({kind:"to",target:y,vars:v,atMs:h(x)}),b},fromTo(y,v,x,w){return f({kind:"fromTo",target:y,vars:x,from:v,atMs:h(w)}),b},play(){var y,v;if(g)return b;g=!0,m=[];for(let x of p)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),m.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.vars.delay)!=null?v:0)}));return b},pause(){for(let y of m)y.pause();return b},kill(){for(let y of m)y.kill();m=[],g=!1}};return d.paused||b.play(),b}};return c}function fa(){if(typeof window=="undefined")return;let r=window;if(!r.gsap)try{r.gsap=ha()}catch{}}var ma={name:"handler-playable-sdk",version:"0.4.57",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 te=0,Zr=te++,ba=te++,ya=te++,va=te++,xa=te++,wa=te++,Ea=te++,Sa=te++,Aa=te++,Ca=te++,Ta=te++,La=te++,F=Zr;function ka(){return F===ba}function Pa(){return F===ya}function Ma(){return F===va}function _a(){return F===xa}function Ne(){return F===wa}function Fe(){return F===Ea}function Ra(){return F===Sa}function Oa(){return F===Aa}function Ia(){return F===Ca}function Bi(){return F===Ta}function Ni(){return F===La}function ja(){let r=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(r==="mraid")try{mraid.getState(),F=ba;return}catch{}else if(r==="dapi")try{dapi.isReady(),F=ya;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(F=va)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(F=xa)}catch{}else if(e==="mintegral")window.gameReady&&(F=wa);else if(e==="tapjoy")window.TJ_API&&(F=Ea);else if(e==="tiktok")window.openAppStore&&(F=Sa);else if(e==="smadex")try{window.smxTracking&&(F=Aa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(F=Ca)}catch{}else e==="vungle"?F=Ta:(r==="nucleo"||e==="nucleo")&&(F=La)}import Fi from"lottie-web";var Da=Fi;typeof window!="undefined"&&(window.lottie=Fi,window.__baseLottie=Fi);function q(r,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(r,e);return`${r/i}:${e/i}`}var Is=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:q(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:q(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:q(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:q(360,780)}],js=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:q(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:q(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:q(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:q(412,915)}],Ds=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:q(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:q(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:q(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:q(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:q(800,1280)}],Ui=[{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:q(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:q(768,1024),mraidScale:.7}];var za=[...Ui],Ha=[{category:"playable",label:"Playable Ad",devices:Ui}],Gi=Ui[0];function Ue(r){return za.find(e=>e.id===r)||Gi}function zs(r){return za.filter(e=>e.category===r)}var Bt=class{constructor(){this.root=null;this.listContainer=null;this.searchInput=null;this.selectedId=null;this.options=null;this.retryTimer=null;this.screenFilter="all"}getScreenFilterStorageKey(){return`handler_preview_screen_filter::${typeof window!="undefined"&&window.__HANDLER_PROJECT_ID||"default"}`}render(){return`
|
|
1
|
+
import{c as Oi,d as le,e as Ii}from"./chunk-I5OOVR5U.js";import{i as zt}from"./chunk-LV4HGC5G.js";import{c as st,d as jt,e as lt,g as ia,h as ji,j as Di,k as Dt,l as na,m as aa,n as zi,o as ra}from"./chunk-ZLL42OOV.js";import{a as Yr}from"./chunk-JXBG6UFL.js";import{Application as $o}from"pixi.js";var Ce={};function Ht(r,e,t=!1){Ce[r]||(Ce[r]=[]),Ce[r].push({fn:e,once:t})}function Hi(r,e){if(Ce[r]){if(!e){delete Ce[r];return}Ce[r]=Ce[r].filter(t=>t.fn!==e)}}function $t(r,...e){let t=Ce[r];if(t)for(let i of[...t])i.fn(...e),i.once&&Hi(r,i.fn)}function ee(r,e){Ht(r,e,!0)}var G=null,ne=[],Be=null;function la(r){G=r,ne=[],Be!==null&&(clearTimeout(Be),Be=null)}function ca(){var r,e,t;return{endpoint:(G==null?void 0:G.endpoint)||"",transport:(G==null?void 0:G.transport)||"beacon",batchSize:(r=G==null?void 0:G.batchSize)!=null?r:10,flushIntervalMs:(e=G==null?void 0:G.flushIntervalMs)!=null?e:300,maxQueue:(t=G==null?void 0:G.maxQueue)!=null?t:200,debug:!!(G!=null&&G.debug)}}async function oa(r,e,t,i){let n=JSON.stringify(e);if(t==="beacon"&&typeof navigator!="undefined"&&typeof navigator.sendBeacon=="function")try{let a=navigator.sendBeacon(r,new Blob([n],{type:"application/json"}));i&&console.log("[handler.telemetry] beacon",a,e);return}catch(a){i&&console.warn("[handler.telemetry] beacon failed, fallback to fetch",a)}try{await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}),i&&console.log("[handler.telemetry] fetch",e)}catch(a){i&&console.warn("[handler.telemetry] fetch failed",a)}}function $i(r,e){let t=ca();if(e&&t.endpoint){if(ne.push(r),ne.length>t.maxQueue&&(ne=ne.slice(ne.length-t.maxQueue)),ne.length>=t.batchSize){sa();return}Be===null&&(Be=window.setTimeout(()=>{Be=null,sa()},t.flushIntervalMs))}}async function sa(){let r=ca();if(!r.endpoint||ne.length===0)return;let e=ne.splice(0,r.batchSize);await oa(r.endpoint,{events:e},r.transport,r.debug),ne.length>0&&await oa(r.endpoint,{events:ne.splice(0,r.batchSize)},r.transport,r.debug)}function da(r){return Math.max(0,Math.min(1,r))}function Wr(r){let e=String(r!=null?r:"power2.out");if(e==="linear")return t=>t;if(e==="sine.inOut")return t=>.5-Math.cos(Math.PI*t)/2;if(e==="power2.out"||e==="easeOutQuad")return t=>1-(1-t)*(1-t);if(e.startsWith("back.out")){let t=e.match(/back\.out\(([\d.]+)\)/),i=t?Number(t[1]):1.8;return n=>1+(i+1)*Math.pow(n-1,3)+i*Math.pow(n-1,2)}return t=>1-(1-t)*(1-t)}function ct(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Kr(r,e){let t=r==null?void 0:r[e];return typeof t=="number"?t:0}function pa(r,e,t){try{r[e]=t}catch{}}function Xr(r){let e=r==null?void 0:r.scale;if(!e)return null;let t=typeof e.x=="number"?e.x:1,i=typeof e.y=="number"?e.y:1;return{x:t,y:i}}function ua(r,e){let t=r==null?void 0:r.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 ga(r,e){let t=Xr(r);if(!t)return{from:null,to:null};let i=null,n=null;return typeof e.scale=="number"?(i=e.scale,n=e.scale):e.scale&&typeof e.scale=="object"&&(typeof e.scale.x=="number"&&(i=e.scale.x),typeof e.scale.y=="number"&&(n=e.scale.y)),typeof e.scaleX=="number"&&(i=e.scaleX),typeof e.scaleY=="number"&&(n=e.scaleY),i===null&&n===null?{from:null,to:null}:{from:{x:t.x,y:t.y},to:{x:i!=null?i:t.x,y:n!=null?n:t.y}}}function ha(){let r=new Set,e=new WeakMap,t=null,i=()=>{if(t!=null)return;t=requestAnimationFrame(()=>{t=null,s(),r.size>0&&i()})},n=d=>{var u;r.add(d);let p=(u=e.get(d.target))!=null?u:new Set;p.add(d),e.set(d.target,p),i()},a=d=>{r.delete(d);let p=e.get(d.target);p&&(p.delete(d),p.size===0&&e.delete(d.target))},o=d=>{d.killed||(d.killed=!0,a(d))},s=()=>{var p,u;let d=ct();for(let g of Array.from(r)){if(g.killed||g.paused)continue;let m=d-g.startMs-g.delayMs;if(m<0)continue;let h=g.durationMs>0?m/g.durationMs:1,f=da(h),b=g.repeat>=0?g.repeat+1:1,y=g.repeat>0?Math.min(Math.floor(h),b-1):0;if(g.repeat>0&&h>=1){let w=h-y;f=da(w)}let v=g.ease(f);g.yoyo&&y%2===1&&(v=1-v);for(let w of g.props)pa(g.target,w.key,w.from+(w.to-w.from)*v);g.scaleFrom&&g.scaleTo&&ua(g.target,{x:g.scaleFrom.x+(g.scaleTo.x-g.scaleFrom.x)*v,y:g.scaleFrom.y+(g.scaleTo.y-g.scaleFrom.y)*v});try{(p=g.onUpdate)==null||p.call(g)}catch{}if(h>=b){o(g);try{(u=g.onComplete)==null||u.call(g)}catch{}}}},l=(d,p,u)=>{var w;let g=Math.max(0,(typeof p.duration=="number"?p.duration:.5)*1e3),m=Math.max(0,(typeof p.delay=="number"?p.delay:0)*1e3+((w=u==null?void 0:u.delayMsOverride)!=null?w:0)),h=Wr(p.ease),f=typeof p.repeat=="number"?Math.max(0,p.repeat|0):0,b=p.yoyo===!0,y=new Set(["duration","delay","ease","repeat","yoyo","onUpdate","onComplete","scale","scaleX","scaleY"]),v=[];for(let E of Object.keys(p)){if(y.has(E))continue;let L=p[E];typeof L=="number"&&v.push({key:E,from:Kr(d,E),to:L})}let x=ga(d,p);return{target:d,startMs:ct(),delayMs:m,durationMs:g,ease:h,props:v,scaleFrom:x.from,scaleTo:x.to,repeat:f,yoyo:b,onUpdate:typeof p.onUpdate=="function"?p.onUpdate:void 0,onComplete:typeof p.onComplete=="function"?p.onComplete:void 0,killed:!1,paused:!1,pauseAtMs:null}},c={to(d,p){let u=l(d,p);return n(u),{kill:()=>o(u),pause:()=>{u.paused||(u.paused=!0,u.pauseAtMs=ct())},resume:()=>{var h;if(!u.paused)return;let g=(h=u.pauseAtMs)!=null?h:ct(),m=ct()-g;u.startMs+=m,u.paused=!1,u.pauseAtMs=null},isActive:()=>!u.killed&&!u.paused}},fromTo(d,p,u){return c.set(d,p),c.to(d,u)},set(d,p){if(!d||!p)return;for(let g of Object.keys(p)){let m=p[g];g==="scale"||g==="scaleX"||g==="scaleY"||typeof m=="number"&&pa(d,g,m)}let u=ga(d,p);u.to&&ua(d,u.to)},killTweensOf(d){let p=e.get(d);if(p)for(let u of Array.from(p))o(u)},timeline(d={}){let p=[],u=0,g=!1,m=[],h=y=>{if(typeof y=="number")return Math.max(0,y*1e3);let v=typeof y=="string"?y.trim():"";return v.startsWith("+=")?u+Math.max(0,Number(v.slice(2))*1e3||0):v?Math.max(0,Number(v)*1e3||0):u},f=y=>{p.push(y);let v=Math.max(0,(typeof y.vars.duration=="number"?y.vars.duration:.5)*1e3);u=Math.max(u,y.atMs+v)},b={to(y,v,x){return f({kind:"to",target:y,vars:v,atMs:h(x)}),b},fromTo(y,v,x,w){return f({kind:"fromTo",target:y,vars:x,from:v,atMs:h(w)}),b},play(){var y,v;if(g)return b;g=!0,m=[];for(let x of p)x.kind==="fromTo"&&c.set(x.target,(y=x.from)!=null?y:{}),m.push(c.to(x.target,{...x.vars,delay:x.atMs/1e3+((v=x.vars.delay)!=null?v:0)}));return b},pause(){for(let y of m)y.pause();return b},kill(){for(let y of m)y.kill();m=[],g=!1}};return d.paused||b.play(),b}};return c}function fa(){if(typeof window=="undefined")return;let r=window;if(!r.gsap)try{r.gsap=ha()}catch{}}var ma={name:"handler-playable-sdk",version:"0.4.59",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 te=0,Zr=te++,ba=te++,ya=te++,va=te++,xa=te++,wa=te++,Ea=te++,Sa=te++,Aa=te++,Ca=te++,Ta=te++,La=te++,F=Zr;function ka(){return F===ba}function Pa(){return F===ya}function Ma(){return F===va}function _a(){return F===xa}function Ne(){return F===wa}function Fe(){return F===Ea}function Ra(){return F===Sa}function Oa(){return F===Aa}function Ia(){return F===Ca}function Bi(){return F===Ta}function Ni(){return F===La}function ja(){let r=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(r==="mraid")try{mraid.getState(),F=ba;return}catch{}else if(r==="dapi")try{dapi.isReady(),F=ya;return}catch{}if(e==="facebook")try{typeof FbPlayableAd!="undefined"&&(F=va)}catch{}else if(e==="google")try{typeof ExitApi!="undefined"&&(F=xa)}catch{}else if(e==="mintegral")window.gameReady&&(F=wa);else if(e==="tapjoy")window.TJ_API&&(F=Ea);else if(e==="tiktok")window.openAppStore&&(F=Sa);else if(e==="smadex")try{window.smxTracking&&(F=Aa)}catch{}else if(e==="snapchat")try{window.ScPlayableAd&&(F=Ca)}catch{}else e==="vungle"?F=Ta:(r==="nucleo"||e==="nucleo")&&(F=La)}import Fi from"lottie-web";var Da=Fi;typeof window!="undefined"&&(window.lottie=Fi,window.__baseLottie=Fi);function q(r,e){let t=(n,a)=>a===0?n:t(a,n%a),i=t(r,e);return`${r/i}:${e/i}`}var Is=[{id:"iphone-15-pro-max",label:"iPhone 15 Pro Max",width:430,height:932,category:"iphone",ratio:q(430,932)},{id:"iphone-15-pro",label:"iPhone 15 Pro",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-15",label:"iPhone 15",width:393,height:852,category:"iphone",ratio:q(393,852)},{id:"iphone-14",label:"iPhone 14",width:390,height:844,category:"iphone",ratio:q(390,844)},{id:"iphone-se",label:"iPhone SE",width:375,height:667,category:"iphone",ratio:q(375,667)},{id:"iphone-12-mini",label:"iPhone 12 Mini",width:360,height:780,category:"iphone",ratio:q(360,780)}],js=[{id:"pixel-8-pro",label:"Pixel 8 Pro",width:448,height:998,category:"android",ratio:q(448,998)},{id:"pixel-8",label:"Pixel 8",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24-ultra",label:"Samsung S24 Ultra",width:412,height:915,category:"android",ratio:q(412,915)},{id:"samsung-s24",label:"Samsung S24",width:360,height:780,category:"android",ratio:q(360,780)},{id:"samsung-a54",label:"Samsung A54",width:412,height:915,category:"android",ratio:q(412,915)},{id:"oneplus-12",label:"OnePlus 12",width:412,height:915,category:"android",ratio:q(412,915)}],Ds=[{id:"ipad-pro-12",label:'iPad Pro 12.9"',width:1024,height:1366,category:"tablet",ratio:q(1024,1366)},{id:"ipad-pro-11",label:'iPad Pro 11"',width:834,height:1194,category:"tablet",ratio:q(834,1194)},{id:"ipad-air",label:"iPad Air",width:820,height:1180,category:"tablet",ratio:q(820,1180)},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"tablet",ratio:q(768,1024)},{id:"samsung-tab-s9",label:"Samsung Tab S9",width:800,height:1280,category:"tablet",ratio:q(800,1280)}],Ui=[{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:q(390,844),mraidScale:.7},{id:"ipad-mini",label:"iPad Mini",width:768,height:1024,category:"playable",ratio:q(768,1024),mraidScale:.7}];var za=[...Ui],Ha=[{category:"playable",label:"Playable Ad",devices:Ui}],Gi=Ui[0];function Ue(r){return za.find(e=>e.id===r)||Gi}function zs(r){return za.filter(e=>e.category===r)}var Bt=class{constructor(){this.root=null;this.listContainer=null;this.searchInput=null;this.selectedId=null;this.options=null;this.retryTimer=null;this.screenFilter="all"}getScreenFilterStorageKey(){return`handler_preview_screen_filter::${typeof window!="undefined"&&window.__HANDLER_PROJECT_ID||"default"}`}render(){return`
|
|
2
2
|
<div class="scene-panel scene-objects panel-accent-teal" data-panel="scene-objects">
|
|
3
3
|
<div class="scene-panel-header" data-panel-handle>
|
|
4
4
|
<div class="panel-title">
|