handler-playable-sdk 0.2.4 → 0.2.7
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-UVBNGLP3.mjs +17 -0
- package/dist/index.js +1 -17
- package/dist/index.mjs +1 -1
- package/dist/pixi/index.d.mts +111 -23
- package/dist/pixi/index.d.ts +111 -23
- package/dist/pixi/index.js +12 -2
- package/dist/pixi/index.mjs +11 -1
- package/dist/three/index.js +15 -15
- package/dist/three/index.mjs +17 -17
- package/package.json +10 -3
- package/dist/chunk-SXCFRUYM.mjs +0 -17
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var u={};function I(e,t,n=!1){u[e]||(u[e]=[]),u[e].push({fn:t,once:n})}function V(e,t){if(u[e]){if(!t){delete u[e];return}u[e]=u[e].filter(n=>n.fn!==t)}}function P(e,...t){let n=u[e];if(n)for(let i of[...n])i.fn(...t),i.once&&V(e,i.fn)}function a(e,t){I(e,t,!0)}var R={name:"handler-playable-sdk",version:"0.2.7",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.js"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.mjs",require:"./dist/pixi/index.js"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.mjs",require:"./dist/three/index.js"}},scripts:{build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify --external lottie-web && npm run obfuscate","build:dev":"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --external lottie-web",obfuscate:"javascript-obfuscator dist/index.js dist/index.mjs dist/pixi/index.js dist/pixi/index.mjs dist/three/index.js dist/three/index.mjs --output dist --options-preset high-obfuscation --compact true --self-defending true",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.js patch","publish:update:minor":"node scripts/publish-and-update.js minor","publish:update:major":"node scripts/publish-and-update.js major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"lottie-web":"^5.0.0","pixi.js":"^8.0.0",three:"^0.160.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0},"lottie-web":{optional:!0}},devDependencies:{"@types/three":"^0.160.0",eslint:"^8.57.1","javascript-obfuscator":"^5.1.0","pixi.js":"8.8.1",three:"^0.160.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2"}};var s=0,Se=s++,Z=s++,ee=s++,te=s++,ne=s++,ie=s++,oe=s++,re=s++,ae=s++,se=s++,de=s++,le=s++,r=Se;function ce(){return r===Z}function ue(){return r===ee}function pe(){return r===te}function fe(){return r===ne}function g(){return r===ie}function y(){return r===oe}function me(){return r===re}function ge(){return r===ae}function ye(){return r===se}function H(){return r===de}function F(){return r===le}function we(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),r=Z;return}catch{}else if(e==="dapi")try{dapi.isReady(),r=ee;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(r=te)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(r=ne)}catch{}else if(t==="mintegral")window.gameReady&&(r=ie);else if(t==="tapjoy")window.TJ_API&&(r=oe);else if(t==="tiktok")window.openAppStore&&(r=re);else if(t==="smadex")try{window.smxTracking&&(r=ae)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(r=se)}catch{}else t==="vungle"?r=de:(e==="nucleo"||t==="nucleo")&&(r=le)}var Ee={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},Ce=Math.random().toString(36).slice(2),w=null,A={...Ee},Ae="web_embed",De={},G=!1,E=!1,T=!1,ke=!1,B=1,W=0,z=!1,d=!1,N="",h=Math.floor(window.innerWidth),b=Math.floor(window.innerHeight),K=h>b,l=!1,k=!1,he=!1,be=!1,U=!1,j=null;function xe(){if(w)return w;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),w=e,e}function M(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function Te(e,t){return{event_name:e,ts:Date.now(),session_id:Ce,deployment_id:A.deployment_id,variant_id:A.variant_id,export_profile_id:A.profile_id,instance_id:A.instance_id||"default",env:Ae==="mraid"?"mraid":"web",payload:t}}function o(e,t){let n=M(e),i=Te(n,t);P(n,i),n!==e&&P(e,i)}function O(){j&&(j(h,b),j=null)}function x(e){B=e,o("volume",e)}function _(e){e&&(ke=!0),!T&&(T=!0,o("pause"),x(0))}function S(e){!e&&ke||T&&(T=!1,o("resume"),x(B))}function f(e,t){h=Math.floor(e||window.innerWidth),b=Math.floor(t||window.innerHeight),K=h>b,o("resize",{width:h,height:b})}function Le(){if(ce())try{let e=mraid.getMaxSize();f(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?S():_()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();f(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();x(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&x(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),z=!0,mraid.isViewable()&&mraid.getState()!=="hidden")l=!0,o("boot"),o("view"),o("ready"),d=!0,O();else{let n=()=>{l=!0,o("boot"),o("view"),o("ready"),d=!0,O()};mraid.addEventListener("ready",n)}}catch(e){console.warn("MRAID hook skipped",e)}}function Ie(){if(ue())try{let e=dapi.getScreenSize();f(e.width,e.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?S():_()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();f(n.width||i.width,n.height||i.height)});let t=dapi.getAudioVolume();if(x(t?1:0),dapi.addEventListener("audioVolumeChange",n=>x(n?1:0)),z=!0,dapi.isViewable())l=!0,o("boot"),o("view"),o("ready"),d=!0,O();else{let n=()=>{l=!0,o("boot"),o("view"),o("ready"),d=!0,O()};dapi.addEventListener("ready",n)}}catch(e){console.warn("DAPI hook skipped",e)}}function _e(){let e=()=>{l||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(l=!0,o("boot"),o("view"),o("ready"),d=!0,O(),k&&(k=!1,p.start()))};window.addEventListener("resize",()=>f()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(S(),e()):_()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),z=!0}function Pe(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(he=!0),!(he&&t instanceof MouseEvent)&&(W+=1,o("interaction",W))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function Re(e){var i,c,v,C,J,D,q,L,$,X,Y,Q;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(y())(v=(c=window.TJ_API)==null?void 0:c.click)==null||v.call(c);else if(pe())(J=(C=window.FbPlayableAd)==null?void 0:C.onCTAClick)==null||J.call(C);else if(ye())(q=(D=window.ScPlayableAd)==null?void 0:D.onCTAClick)==null||q.call(D);else if(ge())try{($=(L=window.smxTracking)==null?void 0:L.redirect)==null||$.call(L)}catch(m){console.warn("Smadex redirect failed",m)}else if(fe()){let m=window.ExitApi;m&&typeof m.exit=="function"?m.exit(e||N||""):e&&window.open(e)}else g()?(X=window.install)==null||X.call(window):me()?(Y=window.openAppStore)==null||Y.call(window):H()?(Q=parent==null?void 0:parent.postMessage)==null||Q.call(parent,"download","*"):e&&window.open(e)}function je(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=n=>{if(!n)return;let i=new Image;i.src=n};if(e==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;a("view",()=>t(n.mraid_viewable)),a("start",()=>t(n.game_viewable)),a("engagement",()=>t(n.engagement));let i=()=>t(n.complete);a("complete",i),I("engagement",c=>{var v;((v=c==null?void 0:c.payload)==null?void 0:v.count)>3&&i()}),a("cta_click",()=>t(n.click))}else if(e==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;a("view",()=>t(n.Ad_Load_Start)),a("start",()=>t(n.Ad_Viewable)),a("engagement",()=>t(n.First_Engagement)),a("complete",()=>t(n.Gameplay_Complete)),a("cta_click",()=>t(n.DSP_Click)),a("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>t(n[`Spent_${i}_Seconds`]),i*1e3))})}}function Me(){if(!y())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{p.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function ve(){var t,n,i;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(n=e==null?void 0:e.playableFinished)==null||n.call(e),(i=e==null?void 0:e.gameplayFinished)==null||i.call(e)}function Ne(){g()&&(window.mintGameStart=()=>{S(!0),f()},window.mintGameClose=()=>{_(!0)})}function ze(){if(!F())return;let e=window.NUC;!e||!e.trigger||(p.on("cta_click",()=>{var t,n;return(n=(t=e.trigger).convert)==null?void 0:n.call(t,N)}),p.on("complete",()=>{var t,n;return(n=(t=e.trigger).tryAgain)==null?void 0:n.call(t)}))}var p={init(e={},t){if(Ae=e.profile||"web_embed",De=e.consent||{},A={...Ee,...e.ids||{}},w=e.rootEl||w,N=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(j=t),o("init"),document.body.oncontextmenu=()=>!1,xe(),Ve(w),we(),Le(),Ie(),!z){if(document.readyState==="complete")_e();else if(!be){be=!0;let n=()=>{_e(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}Pe(),je(),Me(),Ne(),ze(),console.log(`%c @handler/playable-sdk %c v${R.version||"0.0.0"} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),l&&!d&&(o("boot"),o("view"),o("ready"),k&&(k=!1,p.start()),d=!0),d=l},getRoot(){return xe()},get version(){return R.version||"0.0.0"},get maxWidth(){return h},get maxHeight(){return b},get isLandscape(){return K},get isReady(){return d},get isStarted(){return G},get isPaused(){return T},get isFinished(){return E},get volume(){return B},get interactions(){return W},on(e,t){I(M(e),t)},off(e,t){V(M(e),t)},start(){var e,t;if(!G){if(!l){k=!0;return}if(G=!0,o("start"),f(),g())_(),(e=window.gameReady)==null||e.call(window);else if(y()){let n=window.TJ_API;(t=n==null?void 0:n.setPlayableBuild)==null||t.call(n,{orientation:K?"landscape":"portrait",buildID:R.version||"dev"})}}},finish(){var e,t;E||(E=!0,o("complete"),g()?(e=window.gameEnd)==null||e.call(window):H()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):y()&&ve())},install(e){if(!E){E=!0,y()?(ve(),setTimeout(()=>p.install(e),300)):(o("complete"),setTimeout(()=>p.install(e),0));return}U||(U=!0,setTimeout(()=>U=!1,500),o("cta_click"),o("conversion"),Re(e||N))},emit(e,t){let n=M(e);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=Te(n,t);P(n,i)},retry(){var e,t,n;if(g())(e=window.gameRetry)==null||e.call(window);else if(F()){let i=window.NUC;(n=(t=i==null?void 0:i.trigger)==null?void 0:t.tryAgain)==null||n.call(t)}o("engagement",{action:"retry"})},pause(){_(!0)},resume(){S(!0)},resize(e,t){f(e,t)}},Be=p;function Ve(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
|
|
2
|
+
(function(){
|
|
3
|
+
var events = ['touchstart','touchend','mousedown','keydown'];
|
|
4
|
+
function unlock(){
|
|
5
|
+
if(window.AudioContext && AudioContext.prototype.resume){
|
|
6
|
+
if(!window.__handler_audio_ctx){
|
|
7
|
+
window.__handler_audio_ctx = new AudioContext();
|
|
8
|
+
}
|
|
9
|
+
if(window.__handler_audio_ctx.state === 'suspended'){
|
|
10
|
+
window.__handler_audio_ctx.resume();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
events.forEach(function(e){ document.removeEventListener(e, unlock); });
|
|
14
|
+
}
|
|
15
|
+
events.forEach(function(e){ document.addEventListener(e, unlock, false); });
|
|
16
|
+
})();
|
|
17
|
+
`,e.appendChild(t)}export{p as a,Be as b};
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
"use strict";var V=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Le=(e,t)=>{for(var n in t)V(e,n,{get:t[n],enumerable:!0})},Ie=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ce(t))!De.call(e,a)&&a!==n&&V(e,a,{get:()=>t[a],enumerable:!(i=Se(t,a))||i.enumerable});return e};var Pe=e=>Ie(V({},"__esModule",{value:!0}),e);var qe={};Le(qe,{Handler:()=>u,default:()=>Be});module.exports=Pe(qe);var p={};function I(e,t,n=!1){p[e]||(p[e]=[]),p[e].push({fn:t,once:n})}function H(e,t){if(p[e]){if(!t){delete p[e];return}p[e]=p[e].filter(n=>n.fn!==t)}}function P(e,...t){let n=p[e];if(n)for(let i of[...n])i.fn(...t),i.once&&H(e,i.fn)}function s(e,t){I(e,t,!0)}var R={name:"handler-playable-sdk",version:"0.2.4",description:"Handler Playable SDK v0.1 with contract-aligned surface (root sandbox, canonical event envelope).",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.mjs",require:"./dist/index.js"},"./pixi":{types:"./dist/pixi/index.d.ts",import:"./dist/pixi/index.mjs",require:"./dist/pixi/index.js"},"./three":{types:"./dist/three/index.d.ts",import:"./dist/three/index.mjs",require:"./dist/three/index.js"}},scripts:{build:"tsup src/index.ts src/pixi/index.ts src/three/index.ts --format cjs,esm --dts --clean --minify",lint:"eslint 'src/**/*.{ts,tsx}'",typecheck:"tsc --noEmit",prepublishOnly:"npm run build","publish:update":"node scripts/publish-and-update.js patch","publish:update:minor":"node scripts/publish-and-update.js minor","publish:update:major":"node scripts/publish-and-update.js major"},author:"Handler",license:"MIT",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/HandlerAIGames/handler-playable-sdk.git"},files:["dist","LICENSE","README.md"],peerDependencies:{"pixi.js":"^8.0.0",three:"^0.160.0"},peerDependenciesMeta:{"pixi.js":{optional:!0},three:{optional:!0}},devDependencies:{"@types/three":"^0.160.0",eslint:"^8.57.1","pixi.js":"^8.8.1",three:"^0.160.0","ts-node":"^10.9.2",tsup:"^8.4.0",typescript:"^5.7.2"}};var d=0,Me=d++,ee=d++,te=d++,ne=d++,ie=d++,oe=d++,re=d++,ae=d++,se=d++,de=d++,le=d++,ce=d++,r=Me;function ue(){return r===ee}function pe(){return r===te}function fe(){return r===ne}function me(){return r===ie}function g(){return r===oe}function y(){return r===re}function ge(){return r===ae}function ye(){return r===se}function we(){return r===de}function F(){return r===le}function G(){return r===ce}function he(){let e=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none",t=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed";if(e==="mraid")try{mraid.getState(),r=ee;return}catch{}else if(e==="dapi")try{dapi.isReady(),r=te;return}catch{}if(t==="facebook")try{typeof FbPlayableAd!="undefined"&&(r=ne)}catch{}else if(t==="google")try{typeof ExitApi!="undefined"&&(r=ie)}catch{}else if(t==="mintegral")window.gameReady&&(r=oe);else if(t==="tapjoy")window.TJ_API&&(r=re);else if(t==="tiktok")window.openAppStore&&(r=ae);else if(t==="smadex")try{window.smxTracking&&(r=se)}catch{}else if(t==="snapchat")try{window.ScPlayableAd&&(r=de)}catch{}else t==="vungle"?r=le:(e==="nucleo"||t==="nucleo")&&(r=ce)}var Ae={mechanic_id:"TODO_mechanic_id",variant_id:"TODO_variant_id",deployment_id:"TODO_deployment_id",export_id:"TODO_export_id",profile_id:"TODO_profile_id",instance_id:"default"},je=Math.random().toString(36).slice(2),w=null,A={...Ae},ke="web_embed",Ne={},U=!1,E=!1,T=!1,Te=!1,J=1,K=0,z=!1,l=!1,N="",h=Math.floor(window.innerWidth),b=Math.floor(window.innerHeight),B=h>b,c=!1,k=!1,be=!1,_e=!1,W=!1,M=null;function ve(){if(w)return w;let e=document.createElement("div");return e.id="handler-root",e.setAttribute("data-handler-root","true"),document.body.appendChild(e),w=e,e}function j(e){switch(e){case"interaction":return"engagement";case"finish":return"complete";case"install":return"cta_click";default:return e}}function Oe(e,t){return{event_name:e,ts:Date.now(),session_id:je,deployment_id:A.deployment_id,variant_id:A.variant_id,export_profile_id:A.profile_id,instance_id:A.instance_id||"default",env:ke==="mraid"?"mraid":"web",payload:t}}function o(e,t){let n=j(e),i=Oe(n,t);P(n,i),n!==e&&P(e,i)}function O(){M&&(M(h,b),M=null)}function _(e){J=e,o("volume",e)}function v(e){e&&(Te=!0),!T&&(T=!0,o("pause"),_(0))}function S(e){!e&&Te||T&&(T=!1,o("resume"),_(J))}function f(e,t){h=Math.floor(e||window.innerWidth),b=Math.floor(t||window.innerHeight),B=h>b,o("resize",{width:h,height:b})}function ze(){if(ue())try{let e=mraid.getMaxSize();f(e.width,e.height);let t=()=>{mraid.isViewable()&&mraid.getState()!=="hidden"?S():v()};if(mraid.addEventListener("viewableChange",t),mraid.addEventListener("stateChange",t),mraid.addEventListener("sizeChange",()=>{let n=mraid.getMaxSize();f(n.width,n.height)}),mraid.getAudioVolume){let n=mraid.getAudioVolume();_(n?1:0)}if(mraid.addEventListener("audioVolumeChange",n=>{n!==null&&_(n>0?1:0)}),mraid.addEventListener("error",(n,i)=>{console.warn("mraid error:",n,"action:",i)}),z=!0,mraid.isViewable()&&mraid.getState()!=="hidden")c=!0,o("boot"),o("view"),o("ready"),l=!0,O();else{let n=()=>{c=!0,o("boot"),o("view"),o("ready"),l=!0,O()};mraid.addEventListener("ready",n)}}catch(e){console.warn("MRAID hook skipped",e)}}function Ve(){if(pe())try{let e=dapi.getScreenSize();f(e.width,e.height),dapi.addEventListener("viewableChange",n=>{n.isViewable?S():v()}),dapi.addEventListener("adResized",n=>{let i=dapi.getScreenSize();f(n.width||i.width,n.height||i.height)});let t=dapi.getAudioVolume();if(_(t?1:0),dapi.addEventListener("audioVolumeChange",n=>_(n?1:0)),z=!0,dapi.isViewable())c=!0,o("boot"),o("view"),o("ready"),l=!0,O();else{let n=()=>{c=!0,o("boot"),o("view"),o("ready"),l=!0,O()};dapi.addEventListener("ready",n)}}catch(e){console.warn("DAPI hook skipped",e)}}function xe(){let e=()=>{c||document.visibilityState==="visible"&&(document.readyState==="complete"||document.readyState==="interactive")&&(c=!0,o("boot"),o("view"),o("ready"),l=!0,O(),k&&(k=!1,u.start()))};window.addEventListener("resize",()=>f()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(S(),e()):v()}),document.readyState==="complete"||document.readyState==="interactive"?e():window.addEventListener("load",e),z=!0}function He(){let e=t=>{typeof TouchEvent!="undefined"&&t instanceof TouchEvent&&(be=!0),!(be&&t instanceof MouseEvent)&&(K+=1,o("interaction",K))};document.addEventListener("mousedown",e),document.addEventListener("touchstart",e)}function Fe(e){var i,a,x,C,q,D,$,L,X,Y,Q,Z;let t=typeof AD_PROTOCOL!="undefined"?AD_PROTOCOL:"none";if((typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed")==="google")try{(i=window.ExitApi)==null||i.exit();return}catch{}if(t==="mraid"&&typeof mraid!="undefined")mraid.open(e||"");else if(t==="dapi"&&typeof dapi!="undefined")dapi.openStoreUrl();else if(y())(x=(a=window.TJ_API)==null?void 0:a.click)==null||x.call(a);else if(fe())(q=(C=window.FbPlayableAd)==null?void 0:C.onCTAClick)==null||q.call(C);else if(we())($=(D=window.ScPlayableAd)==null?void 0:D.onCTAClick)==null||$.call(D);else if(ye())try{(X=(L=window.smxTracking)==null?void 0:L.redirect)==null||X.call(L)}catch(m){console.warn("Smadex redirect failed",m)}else if(me()){let m=window.ExitApi;m&&typeof m.exit=="function"?m.exit(e||N||""):e&&window.open(e)}else g()?(Y=window.install)==null||Y.call(window):ge()?(Q=window.openAppStore)==null||Q.call(window):F()?(Z=parent==null?void 0:parent.postMessage)==null||Z.call(parent,"download","*"):e&&window.open(e)}function Ge(){let e=typeof AD_NETWORK!="undefined"?AD_NETWORK:"web_embed",t=n=>{if(!n)return;let i=new Image;i.src=n};if(e==="bigabid"){let n=window.BIGABID_BIDTIMEMACROS;if(!n)return;s("view",()=>t(n.mraid_viewable)),s("start",()=>t(n.game_viewable)),s("engagement",()=>t(n.engagement));let i=()=>t(n.complete);s("complete",i),I("engagement",a=>{var x;((x=a==null?void 0:a.payload)==null?void 0:x.count)>3&&i()}),s("cta_click",()=>t(n.click))}else if(e==="inmobi"){let n=window.INMOBI_DSPMACROS;if(!n)return;s("view",()=>t(n.Ad_Load_Start)),s("start",()=>t(n.Ad_Viewable)),s("engagement",()=>t(n.First_Engagement)),s("complete",()=>t(n.Gameplay_Complete)),s("cta_click",()=>t(n.DSP_Click)),s("start",()=>{[5,10,15,20,25,30].forEach(i=>setTimeout(()=>t(n[`Spent_${i}_Seconds`]),i*1e3))})}}function Ue(){if(!y())return;let e=window.TJ_API;e&&e.setPlayableAPI&&e.setPlayableAPI({skipAd:()=>{try{u.finish()}catch(t){console.warn("Tapjoy skip failed",t)}}})}function Ee(){var t,n,i;let e=window.TJ_API;(t=e==null?void 0:e.objectiveComplete)==null||t.call(e),(n=e==null?void 0:e.playableFinished)==null||n.call(e),(i=e==null?void 0:e.gameplayFinished)==null||i.call(e)}function We(){g()&&(window.mintGameStart=()=>{S(!0),f()},window.mintGameClose=()=>{v(!0)})}function Ke(){if(!G())return;let e=window.NUC;!e||!e.trigger||(u.on("cta_click",()=>{var t,n;return(n=(t=e.trigger).convert)==null?void 0:n.call(t,N)}),u.on("complete",()=>{var t,n;return(n=(t=e.trigger).tryAgain)==null?void 0:n.call(t)}))}var u={init(e={},t){if(ke=e.profile||"web_embed",Ne=e.consent||{},A={...Ae,...e.ids||{}},w=e.rootEl||w,N=e.destinationUrl||(/android/i.test(navigator.userAgent)?"https://play.google.com/store":"https://www.apple.com/app-store/"),t&&(M=t),o("init"),document.body.oncontextmenu=()=>!1,ve(),Je(w),he(),ze(),Ve(),!z){if(document.readyState==="complete")xe();else if(!_e){_e=!0;let n=()=>{xe(),window.removeEventListener("load",n),document.removeEventListener("DOMContentLoaded",n)};window.addEventListener("load",n),document.addEventListener("DOMContentLoaded",n)}}He(),Ge(),Ue(),We(),Ke(),console.log(`%c @handler/playable-sdk %c v${R.version||"0.0.0"} `,"background: #007acc; color: #fff; font-size: 14px; padding: 4px 8px; border-top-left-radius: 4px; border-bottom-left-radius: 4px;","background: #e1e4e8; color: #333; font-size: 14px; padding: 4px 8px; border-top-right-radius: 4px; border-bottom-right-radius: 4px;"),c&&!l&&(o("boot"),o("view"),o("ready"),k&&(k=!1,u.start()),l=!0),l=c},getRoot(){return ve()},get version(){return R.version||"0.0.0"},get maxWidth(){return h},get maxHeight(){return b},get isLandscape(){return B},get isReady(){return l},get isStarted(){return U},get isPaused(){return T},get isFinished(){return E},get volume(){return J},get interactions(){return K},on(e,t){I(j(e),t)},off(e,t){H(j(e),t)},start(){var e,t;if(!U){if(!c){k=!0;return}if(U=!0,o("start"),f(),g())v(),(e=window.gameReady)==null||e.call(window);else if(y()){let n=window.TJ_API;(t=n==null?void 0:n.setPlayableBuild)==null||t.call(n,{orientation:B?"landscape":"portrait",buildID:R.version||"dev"})}}},finish(){var e,t;E||(E=!0,o("complete"),g()?(e=window.gameEnd)==null||e.call(window):F()?(t=parent==null?void 0:parent.postMessage)==null||t.call(parent,"complete","*"):y()&&Ee())},install(e){if(!E){E=!0,y()?(Ee(),setTimeout(()=>u.install(e),300)):(o("complete"),setTimeout(()=>u.install(e),0));return}W||(W=!0,setTimeout(()=>W=!1,500),o("cta_click"),o("conversion"),Fe(e||N))},emit(e,t){let n=j(e);if(!["view","boot","start","engagement","complete","cta_click","conversion","retry","pause","resume","resize","volume","error"].includes(n)&&!n.startsWith("custom."))throw new Error(`Event ${e} must be canonical or namespaced as custom.<mechanic_id>.<event>`);let i=Oe(n,t);P(n,i)},retry(){var e,t,n;if(g())(e=window.gameRetry)==null||e.call(window);else if(G()){let i=window.NUC;(n=(t=i==null?void 0:i.trigger)==null?void 0:t.tryAgain)==null||n.call(t)}o("engagement",{action:"retry"})},pause(){v(!0)},resume(){S(!0)},resize(e,t){f(e,t)}},Be=u;function Je(e){let t=document.createElement("script");t.type="text/javascript",t.textContent=`
|
|
2
|
-
(function(){
|
|
3
|
-
var events = ['touchstart','touchend','mousedown','keydown'];
|
|
4
|
-
function unlock(){
|
|
5
|
-
if(window.AudioContext && AudioContext.prototype.resume){
|
|
6
|
-
if(!window.__handler_audio_ctx){
|
|
7
|
-
window.__handler_audio_ctx = new AudioContext();
|
|
8
|
-
}
|
|
9
|
-
if(window.__handler_audio_ctx.state === 'suspended'){
|
|
10
|
-
window.__handler_audio_ctx.resume();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
events.forEach(function(e){ document.removeEventListener(e, unlock); });
|
|
14
|
-
}
|
|
15
|
-
events.forEach(function(e){ document.addEventListener(e, unlock, false); });
|
|
16
|
-
})();
|
|
17
|
-
`,e.appendChild(t)}0&&(module.exports={Handler});
|
|
1
|
+
const a0_0x5baf15=a0_0x3db0;(function(_0x5557eb,_0x1808ab){const _0x1312ac=a0_0x3db0,_0x54a91f=_0x5557eb();while(!![]){try{const _0x5d99fc=parseInt(_0x1312ac(0x1bc))/0x1+-parseInt(_0x1312ac(0x1e6))/0x2+-parseInt(_0x1312ac(0x1c6))/0x3*(parseInt(_0x1312ac(0x263))/0x4)+-parseInt(_0x1312ac(0x26e))/0x5+-parseInt(_0x1312ac(0x220))/0x6+-parseInt(_0x1312ac(0x25f))/0x7+parseInt(_0x1312ac(0x1fd))/0x8;if(_0x5d99fc===_0x1808ab)break;else _0x54a91f['push'](_0x54a91f['shift']());}catch(_0x467b94){_0x54a91f['push'](_0x54a91f['shift']());}}}(a0_0x358c,0x37dbf));const a0_0x51b87a=(function(){let _0x15ce14=!![];return function(_0x2dbd77,_0x1d57b5){const _0x79970=_0x15ce14?function(){const _0x1b5fd0=a0_0x3db0;if(_0x1d57b5){const _0x93d6c8=_0x1d57b5[_0x1b5fd0(0x1b5)](_0x2dbd77,arguments);return _0x1d57b5=null,_0x93d6c8;}}:function(){};return _0x15ce14=![],_0x79970;};}()),a0_0x3fa554=a0_0x51b87a(this,function(){const _0x555f08=a0_0x3db0;return a0_0x3fa554['toString']()['search'](_0x555f08(0x1e5))[_0x555f08(0x23f)]()[_0x555f08(0x1b7)](a0_0x3fa554)[_0x555f08(0x1fb)]('(((.+)+)+)+$');});a0_0x3fa554();'use strict';var V=Object[a0_0x5baf15(0x25e)],Se=Object[a0_0x5baf15(0x1eb)],Ce=Object['getOwnPropertyNames'],De=Object[a0_0x5baf15(0x238)]['hasOwnProperty'],Le=(_0x2168de,_0x1a5022)=>{for(var _0x143d80 in _0x1a5022)V(_0x2168de,_0x143d80,{'get':_0x1a5022[_0x143d80],'enumerable':!0x0});},Ie=(_0x538657,_0x5783a8,_0x5bfadc,_0x57d390)=>{const _0x5edab2=a0_0x5baf15;if(_0x5783a8&&typeof _0x5783a8==_0x5edab2(0x1f6)||typeof _0x5783a8==_0x5edab2(0x25a)){for(let _0x3e52c2 of Ce(_0x5783a8))!De['call'](_0x538657,_0x3e52c2)&&_0x3e52c2!==_0x5bfadc&&V(_0x538657,_0x3e52c2,{'get':()=>_0x5783a8[_0x3e52c2],'enumerable':!(_0x57d390=Se(_0x5783a8,_0x3e52c2))||_0x57d390[_0x5edab2(0x24e)]});}return _0x538657;},Pe=_0x520d87=>Ie(V({},a0_0x5baf15(0x1ec),{'value':!0x0}),_0x520d87),qe={};Le(qe,{'Handler':()=>u,'default':()=>Be}),module[a0_0x5baf15(0x233)]=Pe(qe);var p={};function I(_0x3a7e9d,_0x457dc8,_0x575eaf=!0x1){const _0x9593f6=a0_0x5baf15;p[_0x3a7e9d]||(p[_0x3a7e9d]=[]),p[_0x3a7e9d][_0x9593f6(0x20c)]({'fn':_0x457dc8,'once':_0x575eaf});}function H(_0xda3e73,_0x173019){const _0x39f3bc=a0_0x5baf15;if(p[_0xda3e73]){if(!_0x173019){delete p[_0xda3e73];return;}p[_0xda3e73]=p[_0xda3e73][_0x39f3bc(0x213)](_0x5384fa=>_0x5384fa['fn']!==_0x173019);}}function P(_0x21d126,..._0x30cc7d){const _0x3a97df=a0_0x5baf15;let _0x1b5296=p[_0x21d126];if(_0x1b5296){for(let _0x3f3295 of[..._0x1b5296])_0x3f3295['fn'](..._0x30cc7d),_0x3f3295[_0x3a97df(0x20b)]&&H(_0x21d126,_0x3f3295['fn']);}}function s(_0x24bbab,_0x4bb7f8){I(_0x24bbab,_0x4bb7f8,!0x0);}var R={'name':a0_0x5baf15(0x1c7),'version':a0_0x5baf15(0x1f8),'description':a0_0x5baf15(0x1fe),'main':a0_0x5baf15(0x23d),'module':a0_0x5baf15(0x1da),'types':a0_0x5baf15(0x215),'exports':{'.':{'types':a0_0x5baf15(0x231),'import':a0_0x5baf15(0x1f4),'require':a0_0x5baf15(0x1dc)},'./pixi':{'types':a0_0x5baf15(0x260),'import':'./dist/pixi/index.mjs','require':a0_0x5baf15(0x1f5)},'./three':{'types':'./dist/three/index.d.ts','import':a0_0x5baf15(0x24b),'require':a0_0x5baf15(0x201)}},'scripts':{'build':'tsup\x20src/index.ts\x20src/pixi/index.ts\x20src/three/index.ts\x20--format\x20cjs,esm\x20--dts\x20--clean\x20--minify\x20--external\x20lottie-web\x20&&\x20npm\x20run\x20obfuscate','build:dev':'tsup\x20src/index.ts\x20src/pixi/index.ts\x20src/three/index.ts\x20--format\x20cjs,esm\x20--dts\x20--clean\x20--external\x20lottie-web','obfuscate':'javascript-obfuscator\x20dist/index.js\x20dist/index.mjs\x20dist/pixi/index.js\x20dist/pixi/index.mjs\x20dist/three/index.js\x20dist/three/index.mjs\x20--output\x20dist\x20--options-preset\x20high-obfuscation\x20--compact\x20true\x20--self-defending\x20true','lint':'eslint\x20\x27src/**/*.{ts,tsx}\x27','typecheck':a0_0x5baf15(0x1c5),'prepublishOnly':a0_0x5baf15(0x209),'publish:update':a0_0x5baf15(0x1f3),'publish:update:minor':a0_0x5baf15(0x26d),'publish:update:major':a0_0x5baf15(0x1df)},'author':a0_0x5baf15(0x261),'license':'MIT','publishConfig':{'access':'public'},'repository':{'type':a0_0x5baf15(0x22e),'url':a0_0x5baf15(0x1bf)},'files':[a0_0x5baf15(0x23e),'LICENSE',a0_0x5baf15(0x1d2)],'peerDependencies':{'lottie-web':a0_0x5baf15(0x22c),'pixi.js':a0_0x5baf15(0x272),'three':'^0.160.0'},'peerDependenciesMeta':{'pixi.js':{'optional':!0x0},'three':{'optional':!0x0},'lottie-web':{'optional':!0x0}},'devDependencies':{'@types/three':a0_0x5baf15(0x1f9),'eslint':a0_0x5baf15(0x1d1),'javascript-obfuscator':a0_0x5baf15(0x24c),'pixi.js':a0_0x5baf15(0x1f7),'three':a0_0x5baf15(0x1f9),'ts-node':'^10.9.2','tsup':'^8.4.0','typescript':a0_0x5baf15(0x1e9)}},d=0x0,je=d++,ee=d++,te=d++,ne=d++,ie=d++,oe=d++,re=d++,ae=d++,se=d++,de=d++,le=d++,ce=d++,r=je;function ue(){return r===ee;}function pe(){return r===te;}function fe(){return r===ne;}function me(){return r===ie;}function g(){return r===oe;}function y(){return r===re;}function ge(){return r===ae;}function a0_0x3db0(_0x2aed4d,_0x5b6bc8){_0x2aed4d=_0x2aed4d-0x1b5;const _0x348b64=a0_0x358c();let _0x3fa554=_0x348b64[_0x2aed4d];return _0x3fa554;}function ye(){return r===se;}function a0_0x358c(){const _0x50a0eb=['true','payload','Ad_Viewable','error','node\x20scripts/publish-and-update.js\x20patch','./dist/index.mjs','./dist/pixi/index.js','object','8.8.1','0.2.7','^0.160.0','getMaxSize','search','google','13167712TQGkPw','Handler\x20Playable\x20SDK\x20v0.1\x20with\x20contract-aligned\x20surface\x20(root\x20sandbox,\x20canonical\x20event\x20envelope).','adResized','web_embed','./dist/three/index.js','destinationUrl','FbPlayableAd','oncontextmenu','NUC','data-handler-root','default','random','npm\x20run\x20build','nucleo','once','push','touchstart','action:','innerHeight','0.0.0','First_Engagement','boot','filter','isViewable','dist/index.d.ts','tapjoy','INMOBI_DSPMACROS','smxTracking','facebook','interactive','getAudioVolume','profile','call','resize','setPlayableBuild','2605458ejHMPz','\x20must\x20be\x20canonical\x20or\x20namespaced\x20as\x20custom.<mechanic_id>.<event>','retry','getState','removeEventListener','volume','Smadex\x20redirect\x20failed','visible','openStoreUrl','ScPlayableAd','pause','addEventListener','^5.0.0','DAPI\x20hook\x20skipped','git','slice','script','./dist/index.d.ts','isReady','exports','visibilityState','none','sizeChange','viewableChange','prototype','MRAID\x20hook\x20skipped','onCTAClick','innerWidth','redirect','dist/index.js','dist','toString','hidden','height','postMessage','createElement','undefined','getScreenSize','mraid','dev','body','gameReady','ids','./dist/three/index.mjs','^5.1.0','forEach','enumerable','userAgent','complete','mintGameStart','readyState','finish','setAttribute','Tapjoy\x20skip\x20failed','DOMContentLoaded','mintegral','view','landscape','function','appendChild','type','TODO_variant_id','defineProperty','2187892KJsoOO','./dist/pixi/index.d.ts','Handler','width','234952ExtVZd','mintGameClose','conversion','background:\x20#e1e4e8;\x20color:\x20#333;\x20font-size:\x2014px;\x20padding:\x204px\x208px;\x20border-top-right-radius:\x204px;\x20border-bottom-right-radius:\x204px;','cta_click','TODO_deployment_id','inmobi','smadex','trigger','profile_id','node\x20scripts/publish-and-update.js\x20minor','1707875ZypTkY','floor','click','resume','^8.0.0','ExitApi','TODO_mechanic_id','apply','ready','constructor','Ad_Load_Start','setPlayableAPI','gameEnd','mousedown','30525JEMCSc','install','tiktok','https://github.com/HandlerAIGames/handler-playable-sdk.git','exit','vungle','dapi','instance_id','TJ_API','tsc\x20--noEmit','6SlamVj','handler-playable-sdk','textContent','version','snapchat','deployment_id','openAppStore','https://play.google.com/store','custom.','mraid_viewable','test','^8.57.1','README.md','includes','open','warn','download','start','div','visibilitychange','dist/index.mjs','engagement','./dist/index.js','Event\x20','startsWith','node\x20scripts/publish-and-update.js\x20major','objectiveComplete','interaction','TODO_export_id','\x0a\x20\x20\x20\x20(function(){\x0a\x20\x20\x20\x20\x20\x20var\x20events\x20=\x20[\x27touchstart\x27,\x27touchend\x27,\x27mousedown\x27,\x27keydown\x27];\x0a\x20\x20\x20\x20\x20\x20function\x20unlock(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20if(window.AudioContext\x20&&\x20AudioContext.prototype.resume){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(!window.__handler_audio_ctx){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.__handler_audio_ctx\x20=\x20new\x20AudioContext();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if(window.__handler_audio_ctx.state\x20===\x20\x27suspended\x27){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.__handler_audio_ctx.resume();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20events.forEach(function(e){\x20document.removeEventListener(e,\x20unlock);\x20});\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20events.forEach(function(e){\x20document.addEventListener(e,\x20unlock,\x20false);\x20});\x0a\x20\x20\x20\x20})();\x0a\x20\x20','load','(((.+)+)+)+$','483680akCumG','handler-root','convert','^5.7.2','bigabid','getOwnPropertyDescriptor','__esModule','audioVolumeChange','Gameplay_Complete'];a0_0x358c=function(){return _0x50a0eb;};return a0_0x358c();}function we(){return r===de;}function F(){return r===le;}function G(){return r===ce;}function he(){const _0x3b7f7=a0_0x5baf15;let _0x5718cd=typeof AD_PROTOCOL!='undefined'?AD_PROTOCOL:_0x3b7f7(0x235),_0x577a0b=typeof AD_NETWORK!=_0x3b7f7(0x244)?AD_NETWORK:_0x3b7f7(0x200);if(_0x5718cd==='mraid')try{mraid[_0x3b7f7(0x223)](),r=ee;return;}catch{}else{if(_0x5718cd===_0x3b7f7(0x1c2))try{dapi[_0x3b7f7(0x232)](),r=te;return;}catch{}}if(_0x577a0b===_0x3b7f7(0x219))try{typeof FbPlayableAd!='undefined'&&(r=ne);}catch{}else{if(_0x577a0b===_0x3b7f7(0x1fc))try{typeof ExitApi!=_0x3b7f7(0x244)&&(r=ie);}catch{}else{if(_0x577a0b===_0x3b7f7(0x257))window[_0x3b7f7(0x249)]&&(r=oe);else{if(_0x577a0b===_0x3b7f7(0x216))window['TJ_API']&&(r=re);else{if(_0x577a0b===_0x3b7f7(0x1be))window[_0x3b7f7(0x1cc)]&&(r=ae);else{if(_0x577a0b===_0x3b7f7(0x26a))try{window[_0x3b7f7(0x218)]&&(r=se);}catch{}else{if(_0x577a0b===_0x3b7f7(0x1ca))try{window[_0x3b7f7(0x229)]&&(r=de);}catch{}else _0x577a0b===_0x3b7f7(0x1c1)?r=le:(_0x5718cd==='nucleo'||_0x577a0b===_0x3b7f7(0x20a))&&(r=ce);}}}}}}}var Ae={'mechanic_id':a0_0x5baf15(0x274),'variant_id':a0_0x5baf15(0x25d),'deployment_id':a0_0x5baf15(0x268),'export_id':a0_0x5baf15(0x1e2),'profile_id':'TODO_profile_id','instance_id':a0_0x5baf15(0x207)},Me=Math[a0_0x5baf15(0x208)]()['toString'](0x24)[a0_0x5baf15(0x22f)](0x2),w=null,A={...Ae},ke=a0_0x5baf15(0x200),Ne={},U=!0x1,E=!0x1,T=!0x1,Te=!0x1,J=0x1,K=0x0,z=!0x1,l=!0x1,N='',h=Math[a0_0x5baf15(0x26f)](window[a0_0x5baf15(0x23b)]),b=Math[a0_0x5baf15(0x26f)](window[a0_0x5baf15(0x20f)]),B=h>b,c=!0x1,k=!0x1,be=!0x1,xe=!0x1,W=!0x1,j=null;function _e(){const _0x2fb34a=a0_0x5baf15;if(w)return w;let _0x48bce1=document[_0x2fb34a(0x243)](_0x2fb34a(0x1d8));return _0x48bce1['id']=_0x2fb34a(0x1e7),_0x48bce1[_0x2fb34a(0x254)](_0x2fb34a(0x206),_0x2fb34a(0x1ef)),document['body']['appendChild'](_0x48bce1),w=_0x48bce1,_0x48bce1;}function M(_0x31d24f){const _0x595e11=a0_0x5baf15;switch(_0x31d24f){case'interaction':return _0x595e11(0x1db);case'finish':return'complete';case'install':return _0x595e11(0x267);default:return _0x31d24f;}}function Oe(_0x1c713d,_0x303a44){const _0x2a1057=a0_0x5baf15;return{'event_name':_0x1c713d,'ts':Date['now'](),'session_id':Me,'deployment_id':A[_0x2a1057(0x1cb)],'variant_id':A['variant_id'],'export_profile_id':A[_0x2a1057(0x26c)],'instance_id':A[_0x2a1057(0x1c3)]||'default','env':ke===_0x2a1057(0x246)?'mraid':'web','payload':_0x303a44};}function o(_0x1ee436,_0x3bb331){let _0x4f21a5=M(_0x1ee436),_0x4f0f3a=Oe(_0x4f21a5,_0x3bb331);P(_0x4f21a5,_0x4f0f3a),_0x4f21a5!==_0x1ee436&&P(_0x1ee436,_0x4f0f3a);}function O(){j&&(j(h,b),j=null);}function x(_0x433929){const _0x2a3cb5=a0_0x5baf15;J=_0x433929,o(_0x2a3cb5(0x225),_0x433929);}function _(_0x51451b){_0x51451b&&(Te=!0x0),!T&&(T=!0x0,o('pause'),x(0x0));}function S(_0x3818b1){const _0x82c247=a0_0x5baf15;!_0x3818b1&&Te||T&&(T=!0x1,o(_0x82c247(0x271)),x(J));}function f(_0x136394,_0x1da159){const _0x48cbfd=a0_0x5baf15;h=Math[_0x48cbfd(0x26f)](_0x136394||window[_0x48cbfd(0x23b)]),b=Math[_0x48cbfd(0x26f)](_0x1da159||window['innerHeight']),B=h>b,o(_0x48cbfd(0x21e),{'width':h,'height':b});}function ze(){const _0x17e236=a0_0x5baf15;if(ue())try{let _0x724243=mraid[_0x17e236(0x1fa)]();f(_0x724243[_0x17e236(0x262)],_0x724243[_0x17e236(0x241)]);let _0x2e6eb3=()=>{const _0x44c391=_0x17e236;mraid['isViewable']()&&mraid['getState']()!==_0x44c391(0x240)?S():_();};if(mraid[_0x17e236(0x22b)](_0x17e236(0x237),_0x2e6eb3),mraid[_0x17e236(0x22b)]('stateChange',_0x2e6eb3),mraid[_0x17e236(0x22b)](_0x17e236(0x236),()=>{const _0x2aef03=_0x17e236;let _0x12eb4a=mraid[_0x2aef03(0x1fa)]();f(_0x12eb4a[_0x2aef03(0x262)],_0x12eb4a[_0x2aef03(0x241)]);}),mraid[_0x17e236(0x21b)]){let _0x2be4c7=mraid[_0x17e236(0x21b)]();x(_0x2be4c7?0x1:0x0);}if(mraid['addEventListener'](_0x17e236(0x1ed),_0xa2f292=>{_0xa2f292!==null&&x(_0xa2f292>0x0?0x1:0x0);}),mraid[_0x17e236(0x22b)](_0x17e236(0x1f2),(_0x5f1408,_0x9d9413)=>{const _0x442323=_0x17e236;console[_0x442323(0x1d5)]('mraid\x20error:',_0x5f1408,_0x442323(0x20e),_0x9d9413);}),z=!0x0,mraid[_0x17e236(0x214)]()&&mraid['getState']()!=='hidden')c=!0x0,o(_0x17e236(0x212)),o(_0x17e236(0x258)),o('ready'),l=!0x0,O();else{let _0x523ee7=()=>{const _0x94599c=_0x17e236;c=!0x0,o(_0x94599c(0x212)),o('view'),o('ready'),l=!0x0,O();};mraid['addEventListener'](_0x17e236(0x1b6),_0x523ee7);}}catch(_0x2aec34){console[_0x17e236(0x1d5)](_0x17e236(0x239),_0x2aec34);}}function Ve(){const _0x2c894b=a0_0x5baf15;if(pe())try{let _0x8f80f0=dapi[_0x2c894b(0x245)]();f(_0x8f80f0[_0x2c894b(0x262)],_0x8f80f0[_0x2c894b(0x241)]),dapi[_0x2c894b(0x22b)]('viewableChange',_0x26a06a=>{const _0x3d120d=_0x2c894b;_0x26a06a[_0x3d120d(0x214)]?S():_();}),dapi[_0x2c894b(0x22b)](_0x2c894b(0x1ff),_0x399230=>{const _0x42df0b=_0x2c894b;let _0x24551d=dapi[_0x42df0b(0x245)]();f(_0x399230[_0x42df0b(0x262)]||_0x24551d['width'],_0x399230[_0x42df0b(0x241)]||_0x24551d[_0x42df0b(0x241)]);});let _0x3442d6=dapi['getAudioVolume']();if(x(_0x3442d6?0x1:0x0),dapi[_0x2c894b(0x22b)](_0x2c894b(0x1ed),_0x180dbc=>x(_0x180dbc?0x1:0x0)),z=!0x0,dapi['isViewable']())c=!0x0,o('boot'),o(_0x2c894b(0x258)),o(_0x2c894b(0x1b6)),l=!0x0,O();else{let _0x4cb379=()=>{const _0x19bea4=_0x2c894b;c=!0x0,o('boot'),o(_0x19bea4(0x258)),o('ready'),l=!0x0,O();};dapi[_0x2c894b(0x22b)]('ready',_0x4cb379);}}catch(_0x4f9b05){console[_0x2c894b(0x1d5)](_0x2c894b(0x22d),_0x4f9b05);}}function ve(){const _0x1b6059=a0_0x5baf15;let _0x30fde1=()=>{const _0x42b210=a0_0x3db0;c||document[_0x42b210(0x234)]===_0x42b210(0x227)&&(document[_0x42b210(0x252)]==='complete'||document['readyState']===_0x42b210(0x21a))&&(c=!0x0,o(_0x42b210(0x212)),o(_0x42b210(0x258)),o(_0x42b210(0x1b6)),l=!0x0,O(),k&&(k=!0x1,u['start']()));};window[_0x1b6059(0x22b)](_0x1b6059(0x21e),()=>f()),document['addEventListener'](_0x1b6059(0x1d9),()=>{const _0x57261b=_0x1b6059;document[_0x57261b(0x234)]===_0x57261b(0x227)?(S(),_0x30fde1()):_();}),document['readyState']===_0x1b6059(0x250)||document['readyState']==='interactive'?_0x30fde1():window['addEventListener'](_0x1b6059(0x1e4),_0x30fde1),z=!0x0;}function He(){const _0xc25483=a0_0x5baf15;let _0x49e39f=_0x5411e5=>{const _0x1a5081=a0_0x3db0;typeof TouchEvent!='undefined'&&_0x5411e5 instanceof TouchEvent&&(be=!0x0),!(be&&_0x5411e5 instanceof MouseEvent)&&(K+=0x1,o(_0x1a5081(0x1e1),K));};document['addEventListener'](_0xc25483(0x1bb),_0x49e39f),document[_0xc25483(0x22b)](_0xc25483(0x20d),_0x49e39f);}function Fe(_0x52fb75){const _0x1dd1e6=a0_0x5baf15;var _0xab7a41,_0xe6a9cf,_0x2e586f,_0x4cec05,_0x4543cd,_0x52481a,_0x2a6a5d,_0x3712b0,_0x4181ab,_0x1fa595,_0x4659b1,_0x3a5eb6;let _0xb3b6c0=typeof AD_PROTOCOL!=_0x1dd1e6(0x244)?AD_PROTOCOL:_0x1dd1e6(0x235);if((typeof AD_NETWORK!=_0x1dd1e6(0x244)?AD_NETWORK:_0x1dd1e6(0x200))===_0x1dd1e6(0x1fc))try{(_0xab7a41=window[_0x1dd1e6(0x273)])==null||_0xab7a41[_0x1dd1e6(0x1c0)]();return;}catch{}if(_0xb3b6c0===_0x1dd1e6(0x246)&&typeof mraid!=_0x1dd1e6(0x244))mraid[_0x1dd1e6(0x1d4)](_0x52fb75||'');else{if(_0xb3b6c0===_0x1dd1e6(0x1c2)&&typeof dapi!=_0x1dd1e6(0x244))dapi[_0x1dd1e6(0x228)]();else{if(y())(_0x2e586f=(_0xe6a9cf=window[_0x1dd1e6(0x1c4)])==null?void 0x0:_0xe6a9cf[_0x1dd1e6(0x270)])==null||_0x2e586f[_0x1dd1e6(0x21d)](_0xe6a9cf);else{if(fe())(_0x4543cd=(_0x4cec05=window[_0x1dd1e6(0x203)])==null?void 0x0:_0x4cec05[_0x1dd1e6(0x23a)])==null||_0x4543cd[_0x1dd1e6(0x21d)](_0x4cec05);else{if(we())(_0x2a6a5d=(_0x52481a=window[_0x1dd1e6(0x229)])==null?void 0x0:_0x52481a[_0x1dd1e6(0x23a)])==null||_0x2a6a5d['call'](_0x52481a);else{if(ye())try{(_0x4181ab=(_0x3712b0=window[_0x1dd1e6(0x218)])==null?void 0x0:_0x3712b0[_0x1dd1e6(0x23c)])==null||_0x4181ab[_0x1dd1e6(0x21d)](_0x3712b0);}catch(_0x2f1a63){console['warn'](_0x1dd1e6(0x226),_0x2f1a63);}else{if(me()){let _0x37aa32=window[_0x1dd1e6(0x273)];_0x37aa32&&typeof _0x37aa32['exit']==_0x1dd1e6(0x25a)?_0x37aa32[_0x1dd1e6(0x1c0)](_0x52fb75||N||''):_0x52fb75&&window[_0x1dd1e6(0x1d4)](_0x52fb75);}else g()?(_0x1fa595=window['install'])==null||_0x1fa595[_0x1dd1e6(0x21d)](window):ge()?(_0x4659b1=window[_0x1dd1e6(0x1cc)])==null||_0x4659b1[_0x1dd1e6(0x21d)](window):F()?(_0x3a5eb6=parent==null?void 0x0:parent[_0x1dd1e6(0x242)])==null||_0x3a5eb6['call'](parent,_0x1dd1e6(0x1d6),'*'):_0x52fb75&&window[_0x1dd1e6(0x1d4)](_0x52fb75);}}}}}}}function Ge(){const _0x509178=a0_0x5baf15;let _0x14fe11=typeof AD_NETWORK!='undefined'?AD_NETWORK:_0x509178(0x200),_0x490dd4=_0x258c92=>{if(!_0x258c92)return;let _0x3fe9f1=new Image();_0x3fe9f1['src']=_0x258c92;};if(_0x14fe11===_0x509178(0x1ea)){let _0x5ee9fc=window['BIGABID_BIDTIMEMACROS'];if(!_0x5ee9fc)return;s(_0x509178(0x258),()=>_0x490dd4(_0x5ee9fc[_0x509178(0x1cf)])),s('start',()=>_0x490dd4(_0x5ee9fc['game_viewable'])),s(_0x509178(0x1db),()=>_0x490dd4(_0x5ee9fc[_0x509178(0x1db)]));let _0x49e17e=()=>_0x490dd4(_0x5ee9fc[_0x509178(0x250)]);s('complete',_0x49e17e),I(_0x509178(0x1db),_0x1d86fc=>{const _0x4bfec9=_0x509178;var _0x1d6438;((_0x1d6438=_0x1d86fc==null?void 0x0:_0x1d86fc[_0x4bfec9(0x1f0)])==null?void 0x0:_0x1d6438['count'])>0x3&&_0x49e17e();}),s(_0x509178(0x267),()=>_0x490dd4(_0x5ee9fc[_0x509178(0x270)]));}else{if(_0x14fe11===_0x509178(0x269)){let _0x71f5af=window[_0x509178(0x217)];if(!_0x71f5af)return;s(_0x509178(0x258),()=>_0x490dd4(_0x71f5af[_0x509178(0x1b8)])),s('start',()=>_0x490dd4(_0x71f5af[_0x509178(0x1f1)])),s('engagement',()=>_0x490dd4(_0x71f5af[_0x509178(0x211)])),s('complete',()=>_0x490dd4(_0x71f5af[_0x509178(0x1ee)])),s('cta_click',()=>_0x490dd4(_0x71f5af['DSP_Click'])),s(_0x509178(0x1d7),()=>{const _0x4ce1ad=_0x509178;[0x5,0xa,0xf,0x14,0x19,0x1e][_0x4ce1ad(0x24d)](_0x5a2e95=>setTimeout(()=>_0x490dd4(_0x71f5af['Spent_'+_0x5a2e95+'_Seconds']),_0x5a2e95*0x3e8));});}}}function Ue(){const _0x3fe7b6=a0_0x5baf15;if(!y())return;let _0x813378=window[_0x3fe7b6(0x1c4)];_0x813378&&_0x813378[_0x3fe7b6(0x1b9)]&&_0x813378[_0x3fe7b6(0x1b9)]({'skipAd':()=>{const _0x1072d0=_0x3fe7b6;try{u[_0x1072d0(0x253)]();}catch(_0x4b2dc5){console[_0x1072d0(0x1d5)](_0x1072d0(0x255),_0x4b2dc5);}}});}function Ee(){const _0x41f662=a0_0x5baf15;var _0x3dcfdc,_0x7bd657,_0x46dacf;let _0x55eb21=window[_0x41f662(0x1c4)];(_0x3dcfdc=_0x55eb21==null?void 0x0:_0x55eb21[_0x41f662(0x1e0)])==null||_0x3dcfdc['call'](_0x55eb21),(_0x7bd657=_0x55eb21==null?void 0x0:_0x55eb21['playableFinished'])==null||_0x7bd657[_0x41f662(0x21d)](_0x55eb21),(_0x46dacf=_0x55eb21==null?void 0x0:_0x55eb21['gameplayFinished'])==null||_0x46dacf[_0x41f662(0x21d)](_0x55eb21);}function We(){const _0x15916c=a0_0x5baf15;g()&&(window[_0x15916c(0x251)]=()=>{S(!0x0),f();},window[_0x15916c(0x264)]=()=>{_(!0x0);});}function Ke(){const _0x2c7b8a=a0_0x5baf15;if(!G())return;let _0xeb897a=window[_0x2c7b8a(0x205)];!_0xeb897a||!_0xeb897a['trigger']||(u['on'](_0x2c7b8a(0x267),()=>{const _0x247531=_0x2c7b8a;var _0x4d9f23,_0x1755c4;return(_0x1755c4=(_0x4d9f23=_0xeb897a[_0x247531(0x26b)])[_0x247531(0x1e8)])==null?void 0x0:_0x1755c4[_0x247531(0x21d)](_0x4d9f23,N);}),u['on'](_0x2c7b8a(0x250),()=>{const _0x32f5a3=_0x2c7b8a;var _0x32f566,_0x2210e8;return(_0x2210e8=(_0x32f566=_0xeb897a[_0x32f5a3(0x26b)])['tryAgain'])==null?void 0x0:_0x2210e8[_0x32f5a3(0x21d)](_0x32f566);}));}var u={'init'(_0x3bb669={},_0x2e68ab){const _0x2e113d=a0_0x5baf15;if(ke=_0x3bb669[_0x2e113d(0x21c)]||'web_embed',Ne=_0x3bb669['consent']||{},A={...Ae,..._0x3bb669[_0x2e113d(0x24a)]||{}},w=_0x3bb669['rootEl']||w,N=_0x3bb669[_0x2e113d(0x202)]||(/android/i[_0x2e113d(0x1d0)](navigator[_0x2e113d(0x24f)])?_0x2e113d(0x1cd):'https://www.apple.com/app-store/'),_0x2e68ab&&(j=_0x2e68ab),o('init'),document[_0x2e113d(0x248)][_0x2e113d(0x204)]=()=>!0x1,_e(),Je(w),he(),ze(),Ve(),!z){if(document[_0x2e113d(0x252)]===_0x2e113d(0x250))ve();else{if(!xe){xe=!0x0;let _0x2bc38d=()=>{const _0x6e7a47=_0x2e113d;ve(),window[_0x6e7a47(0x224)](_0x6e7a47(0x1e4),_0x2bc38d),document['removeEventListener']('DOMContentLoaded',_0x2bc38d);};window['addEventListener'](_0x2e113d(0x1e4),_0x2bc38d),document[_0x2e113d(0x22b)](_0x2e113d(0x256),_0x2bc38d);}}}He(),Ge(),Ue(),We(),Ke(),console['log']('%c\x20@handler/playable-sdk\x20%c\x20v'+(R[_0x2e113d(0x1c9)]||_0x2e113d(0x210))+'\x20','background:\x20#007acc;\x20color:\x20#fff;\x20font-size:\x2014px;\x20padding:\x204px\x208px;\x20border-top-left-radius:\x204px;\x20border-bottom-left-radius:\x204px;',_0x2e113d(0x266)),c&&!l&&(o(_0x2e113d(0x212)),o(_0x2e113d(0x258)),o(_0x2e113d(0x1b6)),k&&(k=!0x1,u['start']()),l=!0x0),l=c;},'getRoot'(){return _e();},get 'version'(){const _0x1ce65b=a0_0x5baf15;return R[_0x1ce65b(0x1c9)]||_0x1ce65b(0x210);},get 'maxWidth'(){return h;},get 'maxHeight'(){return b;},get 'isLandscape'(){return B;},get 'isReady'(){return l;},get 'isStarted'(){return U;},get 'isPaused'(){return T;},get 'isFinished'(){return E;},get 'volume'(){return J;},get 'interactions'(){return K;},'on'(_0x1c8860,_0x6fe695){I(M(_0x1c8860),_0x6fe695);},'off'(_0x409373,_0x48804b){H(M(_0x409373),_0x48804b);},'start'(){const _0x172d44=a0_0x5baf15;var _0x4605b2,_0x3900ec;if(!U){if(!c){k=!0x0;return;}if(U=!0x0,o(_0x172d44(0x1d7)),f(),g())_(),(_0x4605b2=window[_0x172d44(0x249)])==null||_0x4605b2[_0x172d44(0x21d)](window);else{if(y()){let _0x271242=window[_0x172d44(0x1c4)];(_0x3900ec=_0x271242==null?void 0x0:_0x271242[_0x172d44(0x21f)])==null||_0x3900ec['call'](_0x271242,{'orientation':B?_0x172d44(0x259):'portrait','buildID':R[_0x172d44(0x1c9)]||_0x172d44(0x247)});}}}},'finish'(){const _0x4b3f9d=a0_0x5baf15;var _0x10e360,_0x52e5b0;E||(E=!0x0,o('complete'),g()?(_0x10e360=window[_0x4b3f9d(0x1ba)])==null||_0x10e360[_0x4b3f9d(0x21d)](window):F()?(_0x52e5b0=parent==null?void 0x0:parent[_0x4b3f9d(0x242)])==null||_0x52e5b0[_0x4b3f9d(0x21d)](parent,'complete','*'):y()&&Ee());},'install'(_0x3a12bf){const _0x8dda03=a0_0x5baf15;if(!E){E=!0x0,y()?(Ee(),setTimeout(()=>u[_0x8dda03(0x1bd)](_0x3a12bf),0x12c)):(o(_0x8dda03(0x250)),setTimeout(()=>u[_0x8dda03(0x1bd)](_0x3a12bf),0x0));return;}W||(W=!0x0,setTimeout(()=>W=!0x1,0x1f4),o(_0x8dda03(0x267)),o(_0x8dda03(0x265)),Fe(_0x3a12bf||N));},'emit'(_0x3184f6,_0x3b3aaf){const _0x23eb3c=a0_0x5baf15;let _0x2d5f96=M(_0x3184f6);if(![_0x23eb3c(0x258),'boot',_0x23eb3c(0x1d7),_0x23eb3c(0x1db),_0x23eb3c(0x250),_0x23eb3c(0x267),_0x23eb3c(0x265),'retry',_0x23eb3c(0x22a),_0x23eb3c(0x271),_0x23eb3c(0x21e),_0x23eb3c(0x225),_0x23eb3c(0x1f2)][_0x23eb3c(0x1d3)](_0x2d5f96)&&!_0x2d5f96[_0x23eb3c(0x1de)](_0x23eb3c(0x1ce)))throw new Error(_0x23eb3c(0x1dd)+_0x3184f6+_0x23eb3c(0x221));let _0x177147=Oe(_0x2d5f96,_0x3b3aaf);P(_0x2d5f96,_0x177147);},'retry'(){const _0x37850f=a0_0x5baf15;var _0x14d519,_0x5ac4f7,_0x4a674c;if(g())(_0x14d519=window['gameRetry'])==null||_0x14d519[_0x37850f(0x21d)](window);else{if(G()){let _0x4fab3c=window[_0x37850f(0x205)];(_0x4a674c=(_0x5ac4f7=_0x4fab3c==null?void 0x0:_0x4fab3c[_0x37850f(0x26b)])==null?void 0x0:_0x5ac4f7['tryAgain'])==null||_0x4a674c[_0x37850f(0x21d)](_0x5ac4f7);}}o('engagement',{'action':_0x37850f(0x222)});},'pause'(){_(!0x0);},'resume'(){S(!0x0);},'resize'(_0x1d86a7,_0x124b75){f(_0x1d86a7,_0x124b75);}},Be=u;function Je(_0xdcd32f){const _0x33be19=a0_0x5baf15;let _0x461aed=document[_0x33be19(0x243)](_0x33be19(0x230));_0x461aed[_0x33be19(0x25c)]='text/javascript',_0x461aed[_0x33be19(0x1c8)]=_0x33be19(0x1e3),_0xdcd32f[_0x33be19(0x25b)](_0x461aed);}0x0&&(module[a0_0x5baf15(0x233)]={'Handler':Handler});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{a,b}from"./chunk-UVBNGLP3.mjs";export{a as Handler,b as default};
|
package/dist/pixi/index.d.mts
CHANGED
|
@@ -413,42 +413,130 @@ declare function createTutorialLabel(config: ObjectCentricConfig): Text;
|
|
|
413
413
|
declare function updateHandAnimation(hand: Sprite, baseCharacterPos: Point, time: number, isDragging: boolean, config: ObjectCentricConfig): void;
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
|
-
* Handler SDK -
|
|
416
|
+
* Handler SDK - Lottie Overlay Helper
|
|
417
417
|
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
418
|
+
* Manages Lottie animations as DOM overlays with config-driven positioning and styling.
|
|
419
|
+
* Student never touches DOM - this helper handles all overlay lifecycle.
|
|
420
|
+
*
|
|
421
|
+
* RULES:
|
|
422
|
+
* - Overlay creation/cleanup is SDK-controlled
|
|
423
|
+
* - Transform/render/effects params come from object config
|
|
424
|
+
* - Lottie JSON comes from Assets system (inline-safe)
|
|
425
|
+
* - Root sandbox discipline maintained
|
|
420
426
|
*
|
|
421
427
|
* DO NOT EDIT - Handler SDK Core
|
|
422
428
|
*/
|
|
423
429
|
|
|
430
|
+
type AnimationItem = any;
|
|
431
|
+
declare function setLottieInstance(instance: any): void;
|
|
424
432
|
/**
|
|
425
|
-
*
|
|
426
|
-
* Asset path comes from config.assets
|
|
433
|
+
* Play Lottie overlay animation
|
|
427
434
|
*
|
|
428
|
-
* @param
|
|
429
|
-
* @param
|
|
430
|
-
* @param
|
|
431
|
-
* @param
|
|
435
|
+
* @param objectId - Object instance ID (e.g., 'effects_confetti_1')
|
|
436
|
+
* @param root - Root HTML element (from Handler.getRoot())
|
|
437
|
+
* @param config - Object-centric configuration
|
|
438
|
+
* @param Assets - Assets proxy instance (for getting Lottie JSON)
|
|
439
|
+
* @returns Animation item and cleanup function
|
|
432
440
|
*/
|
|
433
|
-
declare function
|
|
441
|
+
declare function playLottieOverlay(objectId: string, root: HTMLElement, config: ObjectCentricConfig, Assets: any): {
|
|
442
|
+
animation: AnimationItem;
|
|
443
|
+
cleanup: () => void;
|
|
444
|
+
} | null;
|
|
445
|
+
|
|
434
446
|
/**
|
|
435
|
-
*
|
|
436
|
-
* Uses config.assets.character_sprite for path
|
|
437
|
-
* Character sheet dimensions come from config (cols: 3, rows: 2)
|
|
447
|
+
* Handler SDK - Object-Centric Asset Loader
|
|
438
448
|
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
449
|
+
* Asset loading system using object-centric approach.
|
|
450
|
+
* Assets are defined in object configs and loaded by object ID.
|
|
451
|
+
*
|
|
452
|
+
* RULES (LOCKED):
|
|
453
|
+
* - INLINE_ASSETS[objectId] key format (NOT path-based)
|
|
454
|
+
* - Cache key = objectId ONLY
|
|
455
|
+
* - SDK does NOT detect dev/build mode
|
|
456
|
+
* - Build mode injected via __BUILD_MODE__ flag
|
|
457
|
+
* - JSON assets are deep-frozen (immutable)
|
|
458
|
+
* - Dev mode: placeholder on missing
|
|
459
|
+
* - Publish mode: runtime throws (build-time must prevent this)
|
|
460
|
+
*
|
|
461
|
+
* DO NOT EDIT - Handler SDK Core
|
|
462
|
+
*/
|
|
463
|
+
type AssetDefinition = {
|
|
464
|
+
type: string;
|
|
465
|
+
path: string;
|
|
466
|
+
};
|
|
467
|
+
type TypeLoader = (path: string, inlineData: string | undefined, objectId: string, app: any) => Promise<any>;
|
|
468
|
+
declare function registerType(type: string, loader: TypeLoader): void;
|
|
469
|
+
declare class AssetLoader {
|
|
470
|
+
static load(objectId: string, assetDef: AssetDefinition, app: any): Promise<any>;
|
|
471
|
+
private static loadImage;
|
|
472
|
+
private static loadJSON;
|
|
473
|
+
private static handleFailure;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Handler SDK - Asset Cache
|
|
478
|
+
*
|
|
479
|
+
* Centralized cache for all asset data (textures, parsed JSON, inline data).
|
|
480
|
+
* Global, long-lived cache that survives scene resets for performance.
|
|
481
|
+
*
|
|
482
|
+
* RULE: NEVER cleared during normal runtime - only for testing/cleanup
|
|
483
|
+
*
|
|
484
|
+
* DO NOT EDIT - Handler SDK Core
|
|
485
|
+
*/
|
|
486
|
+
/**
|
|
487
|
+
* Global asset cache - stores decoded textures, parsed JSON, inline data
|
|
488
|
+
*
|
|
489
|
+
* Rules:
|
|
490
|
+
* - Global and long-lived
|
|
491
|
+
* - Survives scene resets
|
|
492
|
+
* - NEVER cleared during normal runtime
|
|
493
|
+
* - Only clear() for testing/cleanup scenarios
|
|
494
|
+
*/
|
|
495
|
+
declare class AssetCache {
|
|
496
|
+
private static store;
|
|
497
|
+
/**
|
|
498
|
+
* Get cached asset data by ID
|
|
499
|
+
*/
|
|
500
|
+
static get(id: string): any;
|
|
501
|
+
/**
|
|
502
|
+
* Set cached asset data by ID
|
|
503
|
+
*/
|
|
504
|
+
static set(id: string, data: any): void;
|
|
505
|
+
/**
|
|
506
|
+
* Check if asset is cached
|
|
507
|
+
*/
|
|
508
|
+
static has(id: string): boolean;
|
|
509
|
+
/**
|
|
510
|
+
* Clear cache (only for testing/cleanup - NOT used during normal runtime)
|
|
511
|
+
*/
|
|
512
|
+
static clear(): void;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Handler SDK - Object Factory
|
|
517
|
+
*
|
|
518
|
+
* Creates game objects from object configs with asset loading and transform application.
|
|
519
|
+
*
|
|
520
|
+
* DO NOT EDIT - Handler SDK Core
|
|
442
521
|
*/
|
|
443
|
-
|
|
522
|
+
|
|
444
523
|
/**
|
|
445
|
-
* Create
|
|
446
|
-
* Uses config.theme.brush_color for color
|
|
447
|
-
* Brush size comes from config.gameplay.brush
|
|
524
|
+
* Create a game object from object config
|
|
448
525
|
*
|
|
526
|
+
* @param objectId - Object instance ID (e.g., 'character_1')
|
|
527
|
+
* @param objectConfig - Object config from ObjectCentricConfig
|
|
449
528
|
* @param app - PixiJS application instance
|
|
450
|
-
* @
|
|
529
|
+
* @returns Ready-to-use game object (Sprite, Container, etc.)
|
|
451
530
|
*/
|
|
452
|
-
declare
|
|
531
|
+
declare class ObjectFactory {
|
|
532
|
+
/**
|
|
533
|
+
* Create game object from config
|
|
534
|
+
*/
|
|
535
|
+
static create(objectId: string, objectConfig: any, app: any): Promise<Container | Sprite | any>;
|
|
536
|
+
/**
|
|
537
|
+
* Apply transform from config to object
|
|
538
|
+
*/
|
|
539
|
+
private static applyTransform;
|
|
540
|
+
}
|
|
453
541
|
|
|
454
|
-
export { type EndGamePanelElements, GameObject, GameObjectManager, type ObjectCentricConfig, type PixiBaseContext, type PixiTheme, Renderer, Transform, animateHandClick, animatePanelEntrance,
|
|
542
|
+
export { AssetCache, type AssetDefinition, AssetLoader, type EndGamePanelElements, GameObject, GameObjectManager, type ObjectCentricConfig, ObjectFactory, type PixiBaseContext, type PixiTheme, Renderer, Transform, animateHandClick, animatePanelEntrance, createEndGamePanel, createHandTutorial, createPixiBase, createTutorialLabel, getRegisteredFontIds, playLottieOverlay, registerFont, registerType, resolveFont, resolveFontWeight, setLottieInstance, updateHandAnimation };
|
package/dist/pixi/index.d.ts
CHANGED
|
@@ -413,42 +413,130 @@ declare function createTutorialLabel(config: ObjectCentricConfig): Text;
|
|
|
413
413
|
declare function updateHandAnimation(hand: Sprite, baseCharacterPos: Point, time: number, isDragging: boolean, config: ObjectCentricConfig): void;
|
|
414
414
|
|
|
415
415
|
/**
|
|
416
|
-
* Handler SDK -
|
|
416
|
+
* Handler SDK - Lottie Overlay Helper
|
|
417
417
|
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
418
|
+
* Manages Lottie animations as DOM overlays with config-driven positioning and styling.
|
|
419
|
+
* Student never touches DOM - this helper handles all overlay lifecycle.
|
|
420
|
+
*
|
|
421
|
+
* RULES:
|
|
422
|
+
* - Overlay creation/cleanup is SDK-controlled
|
|
423
|
+
* - Transform/render/effects params come from object config
|
|
424
|
+
* - Lottie JSON comes from Assets system (inline-safe)
|
|
425
|
+
* - Root sandbox discipline maintained
|
|
420
426
|
*
|
|
421
427
|
* DO NOT EDIT - Handler SDK Core
|
|
422
428
|
*/
|
|
423
429
|
|
|
430
|
+
type AnimationItem = any;
|
|
431
|
+
declare function setLottieInstance(instance: any): void;
|
|
424
432
|
/**
|
|
425
|
-
*
|
|
426
|
-
* Asset path comes from config.assets
|
|
433
|
+
* Play Lottie overlay animation
|
|
427
434
|
*
|
|
428
|
-
* @param
|
|
429
|
-
* @param
|
|
430
|
-
* @param
|
|
431
|
-
* @param
|
|
435
|
+
* @param objectId - Object instance ID (e.g., 'effects_confetti_1')
|
|
436
|
+
* @param root - Root HTML element (from Handler.getRoot())
|
|
437
|
+
* @param config - Object-centric configuration
|
|
438
|
+
* @param Assets - Assets proxy instance (for getting Lottie JSON)
|
|
439
|
+
* @returns Animation item and cleanup function
|
|
432
440
|
*/
|
|
433
|
-
declare function
|
|
441
|
+
declare function playLottieOverlay(objectId: string, root: HTMLElement, config: ObjectCentricConfig, Assets: any): {
|
|
442
|
+
animation: AnimationItem;
|
|
443
|
+
cleanup: () => void;
|
|
444
|
+
} | null;
|
|
445
|
+
|
|
434
446
|
/**
|
|
435
|
-
*
|
|
436
|
-
* Uses config.assets.character_sprite for path
|
|
437
|
-
* Character sheet dimensions come from config (cols: 3, rows: 2)
|
|
447
|
+
* Handler SDK - Object-Centric Asset Loader
|
|
438
448
|
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
449
|
+
* Asset loading system using object-centric approach.
|
|
450
|
+
* Assets are defined in object configs and loaded by object ID.
|
|
451
|
+
*
|
|
452
|
+
* RULES (LOCKED):
|
|
453
|
+
* - INLINE_ASSETS[objectId] key format (NOT path-based)
|
|
454
|
+
* - Cache key = objectId ONLY
|
|
455
|
+
* - SDK does NOT detect dev/build mode
|
|
456
|
+
* - Build mode injected via __BUILD_MODE__ flag
|
|
457
|
+
* - JSON assets are deep-frozen (immutable)
|
|
458
|
+
* - Dev mode: placeholder on missing
|
|
459
|
+
* - Publish mode: runtime throws (build-time must prevent this)
|
|
460
|
+
*
|
|
461
|
+
* DO NOT EDIT - Handler SDK Core
|
|
462
|
+
*/
|
|
463
|
+
type AssetDefinition = {
|
|
464
|
+
type: string;
|
|
465
|
+
path: string;
|
|
466
|
+
};
|
|
467
|
+
type TypeLoader = (path: string, inlineData: string | undefined, objectId: string, app: any) => Promise<any>;
|
|
468
|
+
declare function registerType(type: string, loader: TypeLoader): void;
|
|
469
|
+
declare class AssetLoader {
|
|
470
|
+
static load(objectId: string, assetDef: AssetDefinition, app: any): Promise<any>;
|
|
471
|
+
private static loadImage;
|
|
472
|
+
private static loadJSON;
|
|
473
|
+
private static handleFailure;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/**
|
|
477
|
+
* Handler SDK - Asset Cache
|
|
478
|
+
*
|
|
479
|
+
* Centralized cache for all asset data (textures, parsed JSON, inline data).
|
|
480
|
+
* Global, long-lived cache that survives scene resets for performance.
|
|
481
|
+
*
|
|
482
|
+
* RULE: NEVER cleared during normal runtime - only for testing/cleanup
|
|
483
|
+
*
|
|
484
|
+
* DO NOT EDIT - Handler SDK Core
|
|
485
|
+
*/
|
|
486
|
+
/**
|
|
487
|
+
* Global asset cache - stores decoded textures, parsed JSON, inline data
|
|
488
|
+
*
|
|
489
|
+
* Rules:
|
|
490
|
+
* - Global and long-lived
|
|
491
|
+
* - Survives scene resets
|
|
492
|
+
* - NEVER cleared during normal runtime
|
|
493
|
+
* - Only clear() for testing/cleanup scenarios
|
|
494
|
+
*/
|
|
495
|
+
declare class AssetCache {
|
|
496
|
+
private static store;
|
|
497
|
+
/**
|
|
498
|
+
* Get cached asset data by ID
|
|
499
|
+
*/
|
|
500
|
+
static get(id: string): any;
|
|
501
|
+
/**
|
|
502
|
+
* Set cached asset data by ID
|
|
503
|
+
*/
|
|
504
|
+
static set(id: string, data: any): void;
|
|
505
|
+
/**
|
|
506
|
+
* Check if asset is cached
|
|
507
|
+
*/
|
|
508
|
+
static has(id: string): boolean;
|
|
509
|
+
/**
|
|
510
|
+
* Clear cache (only for testing/cleanup - NOT used during normal runtime)
|
|
511
|
+
*/
|
|
512
|
+
static clear(): void;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Handler SDK - Object Factory
|
|
517
|
+
*
|
|
518
|
+
* Creates game objects from object configs with asset loading and transform application.
|
|
519
|
+
*
|
|
520
|
+
* DO NOT EDIT - Handler SDK Core
|
|
442
521
|
*/
|
|
443
|
-
|
|
522
|
+
|
|
444
523
|
/**
|
|
445
|
-
* Create
|
|
446
|
-
* Uses config.theme.brush_color for color
|
|
447
|
-
* Brush size comes from config.gameplay.brush
|
|
524
|
+
* Create a game object from object config
|
|
448
525
|
*
|
|
526
|
+
* @param objectId - Object instance ID (e.g., 'character_1')
|
|
527
|
+
* @param objectConfig - Object config from ObjectCentricConfig
|
|
449
528
|
* @param app - PixiJS application instance
|
|
450
|
-
* @
|
|
529
|
+
* @returns Ready-to-use game object (Sprite, Container, etc.)
|
|
451
530
|
*/
|
|
452
|
-
declare
|
|
531
|
+
declare class ObjectFactory {
|
|
532
|
+
/**
|
|
533
|
+
* Create game object from config
|
|
534
|
+
*/
|
|
535
|
+
static create(objectId: string, objectConfig: any, app: any): Promise<Container | Sprite | any>;
|
|
536
|
+
/**
|
|
537
|
+
* Apply transform from config to object
|
|
538
|
+
*/
|
|
539
|
+
private static applyTransform;
|
|
540
|
+
}
|
|
453
541
|
|
|
454
|
-
export { type EndGamePanelElements, GameObject, GameObjectManager, type ObjectCentricConfig, type PixiBaseContext, type PixiTheme, Renderer, Transform, animateHandClick, animatePanelEntrance,
|
|
542
|
+
export { AssetCache, type AssetDefinition, AssetLoader, type EndGamePanelElements, GameObject, GameObjectManager, type ObjectCentricConfig, ObjectFactory, type PixiBaseContext, type PixiTheme, Renderer, Transform, animateHandClick, animatePanelEntrance, createEndGamePanel, createHandTutorial, createPixiBase, createTutorialLabel, getRegisteredFontIds, playLottieOverlay, registerFont, registerType, resolveFont, resolveFontWeight, setLottieInstance, updateHandAnimation };
|