@replayablejs/runtime 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +29 -0
  3. package/dist/adapters/applovin.d.ts +13 -0
  4. package/dist/adapters/applovin.js +16 -0
  5. package/dist/adapters/applovin.js.map +1 -0
  6. package/dist/adapters/browser.d.ts +12 -0
  7. package/dist/adapters/browser.js +17 -0
  8. package/dist/adapters/browser.js.map +1 -0
  9. package/dist/adapters/google.d.ts +12 -0
  10. package/dist/adapters/google.js +17 -0
  11. package/dist/adapters/google.js.map +1 -0
  12. package/dist/adapters/liftoff.d.ts +13 -0
  13. package/dist/adapters/liftoff.js +47 -0
  14. package/dist/adapters/liftoff.js.map +1 -0
  15. package/dist/adapters/meta.d.ts +12 -0
  16. package/dist/adapters/meta.js +16 -0
  17. package/dist/adapters/meta.js.map +1 -0
  18. package/dist/adapters/mintegral.d.ts +13 -0
  19. package/dist/adapters/mintegral.js +59 -0
  20. package/dist/adapters/mintegral.js.map +1 -0
  21. package/dist/adapters/moloco.d.ts +11 -0
  22. package/dist/adapters/moloco.js +15 -0
  23. package/dist/adapters/moloco.js.map +1 -0
  24. package/dist/adapters/unity.d.ts +12 -0
  25. package/dist/adapters/unity.js +15 -0
  26. package/dist/adapters/unity.js.map +1 -0
  27. package/dist/api-BgI_ycxT.js +13 -0
  28. package/dist/api-BgI_ycxT.js.map +1 -0
  29. package/dist/assets-BD68MQTL.d.ts +107 -0
  30. package/dist/assets.d.ts +2 -0
  31. package/dist/assets.js +8 -0
  32. package/dist/assets.js.map +1 -0
  33. package/dist/audio/disabled.d.ts +12 -0
  34. package/dist/audio/disabled.js +44 -0
  35. package/dist/audio/disabled.js.map +1 -0
  36. package/dist/audio/enabled.d.ts +28 -0
  37. package/dist/audio/enabled.js +426 -0
  38. package/dist/audio/enabled.js.map +1 -0
  39. package/dist/audio-CyLjSreN.d.ts +66 -0
  40. package/dist/categories-BbQSRMmw.js +21 -0
  41. package/dist/categories-BbQSRMmw.js.map +1 -0
  42. package/dist/create-adapter-4oub3UeP.js +22 -0
  43. package/dist/create-adapter-4oub3UeP.js.map +1 -0
  44. package/dist/create-adapter-ByJx4UTX.js +43 -0
  45. package/dist/create-adapter-ByJx4UTX.js.map +1 -0
  46. package/dist/events-C85TpS5f.js +69 -0
  47. package/dist/events-C85TpS5f.js.map +1 -0
  48. package/dist/events-CYG_LvaH.js +85 -0
  49. package/dist/events-CYG_LvaH.js.map +1 -0
  50. package/dist/host-adapter-vFX6DBcY.d.ts +43 -0
  51. package/dist/index.d.ts +255 -0
  52. package/dist/index.js +8876 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/loader-Czz-x3KH.d.ts +61 -0
  55. package/dist/screen-DXf2FPtL.d.ts +70 -0
  56. package/dist/shell.d.ts +10 -0
  57. package/dist/shell.js +11 -0
  58. package/dist/shell.js.map +1 -0
  59. package/package.json +75 -0
  60. package/src/screen/gpu/benchmarks/LICENSE +21 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Replayable contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # @replayablejs/runtime
2
+
3
+ Manage host readiness, assets, screen state, audio, updates, completion and store actions.
4
+
5
+ Part of [Replayable](https://github.com/replayablejs/replayable) **0.1.0-alpha.0**.
6
+ APIs may change during the alpha series.
7
+
8
+ ## Install
9
+
10
+ ```sh
11
+ pnpm add @replayablejs/runtime@0.1.0-alpha.0
12
+ ```
13
+
14
+ ## Public surface
15
+
16
+ `playable` and runtime types. Subpaths: `/assets` for generated asset contracts and `/shell` for shell element IDs.
17
+
18
+ [Usage and reference](https://github.com/replayablejs/replayable/blob/main/docs/reference/runtime.md).
19
+ The package manifest defines supported import paths; internal source files are not public APIs.
20
+
21
+ ## Development
22
+
23
+ From the repository root, install with `pnpm install --frozen-lockfile` and build dependencies
24
+ with `pnpm build`. Run `pnpm --filter @replayablejs/runtime test` for this package's tests.
25
+
26
+ ## License
27
+
28
+ Original code is [MIT licensed](https://github.com/replayablejs/replayable/blob/main/LICENSE). Bundled third-party resources retain
29
+ their accompanying license terms.
@@ -0,0 +1,13 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/applovin/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by AppLovin playable ads.
5
+ *
6
+ * AppLovin requires the MRAID 2 lifecycle and mraid.open() for store
7
+ * navigation. Newer containers may expose MRAID 3 signals, which the shared
8
+ * protocol helpers normalize without changing AppLovin's network identity.
9
+ */
10
+ declare function createAdapter(): HostAdapter;
11
+ //#endregion
12
+ export { createAdapter };
13
+ //# sourceMappingURL=applovin.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { t as createMraidHostAdapter } from "../create-adapter-ByJx4UTX.js";
2
+ //#region src/adapters/applovin/index.ts
3
+ /**
4
+ * Creates the host adapter used by AppLovin playable ads.
5
+ *
6
+ * AppLovin requires the MRAID 2 lifecycle and mraid.open() for store
7
+ * navigation. Newer containers may expose MRAID 3 signals, which the shared
8
+ * protocol helpers normalize without changing AppLovin's network identity.
9
+ */
10
+ function createAdapter() {
11
+ return createMraidHostAdapter();
12
+ }
13
+ //#endregion
14
+ export { createAdapter };
15
+
16
+ //# sourceMappingURL=applovin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applovin.js","names":[],"sources":["../../src/adapters/applovin/index.ts"],"sourcesContent":["import { createMraidHostAdapter } from '#mraid/create-adapter.js';\nimport type { HostAdapter } from '#types/host-adapter.js';\n\n/**\n * Creates the host adapter used by AppLovin playable ads.\n *\n * AppLovin requires the MRAID 2 lifecycle and mraid.open() for store\n * navigation. Newer containers may expose MRAID 3 signals, which the shared\n * protocol helpers normalize without changing AppLovin's network identity.\n */\nexport function createAdapter(): HostAdapter {\n return createMraidHostAdapter();\n}\n"],"mappings":";;;;;;;;;AAUA,SAAgB,gBAA6B;CAC3C,OAAO,uBAAuB;AAChC"}
@@ -0,0 +1,12 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/browser/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by local development and ordinary browsers.
5
+ *
6
+ * Preview opens the resolved store URL directly, while its lifecycle behavior
7
+ * comes from the browser adapter shared with browser-based advertising hosts.
8
+ */
9
+ declare function createAdapter(): HostAdapter;
10
+ //#endregion
11
+ export { createAdapter };
12
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { t as createBrowserAdapter } from "../create-adapter-4oub3UeP.js";
2
+ //#region src/adapters/browser/index.ts
3
+ /**
4
+ * Creates the host adapter used by local development and ordinary browsers.
5
+ *
6
+ * Preview opens the resolved store URL directly, while its lifecycle behavior
7
+ * comes from the browser adapter shared with browser-based advertising hosts.
8
+ */
9
+ function createAdapter() {
10
+ return createBrowserAdapter((url) => {
11
+ window.open(url, "_blank", "noopener,noreferrer");
12
+ });
13
+ }
14
+ //#endregion
15
+ export { createAdapter };
16
+
17
+ //# sourceMappingURL=browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.js","names":[],"sources":["../../src/adapters/browser/index.ts"],"sourcesContent":["import type { HostAdapter } from '#types/host-adapter.js';\n\nimport { createBrowserAdapter } from './create-adapter.js';\n\n/**\n * Creates the host adapter used by local development and ordinary browsers.\n *\n * Preview opens the resolved store URL directly, while its lifecycle behavior\n * comes from the browser adapter shared with browser-based advertising hosts.\n */\nexport function createAdapter(): HostAdapter {\n return createBrowserAdapter((url) => {\n window.open(url, '_blank', 'noopener,noreferrer');\n });\n}\n"],"mappings":";;;;;;;;AAUA,SAAgB,gBAA6B;CAC3C,OAAO,sBAAsB,QAAQ;EACnC,OAAO,KAAK,KAAK,UAAU,qBAAqB;CAClD,CAAC;AACH"}
@@ -0,0 +1,12 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/google/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by Google App Campaign playable ads.
5
+ *
6
+ * Google playables use ordinary browser lifecycle signals, while `ExitApi`
7
+ * records the CTA and opens the campaign-owned destination.
8
+ */
9
+ declare function createAdapter(): HostAdapter;
10
+ //#endregion
11
+ export { createAdapter };
12
+ //# sourceMappingURL=google.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { t as createBrowserAdapter } from "../create-adapter-4oub3UeP.js";
2
+ //#region src/adapters/google/index.ts
3
+ /**
4
+ * Creates the host adapter used by Google App Campaign playable ads.
5
+ *
6
+ * Google playables use ordinary browser lifecycle signals, while `ExitApi`
7
+ * records the CTA and opens the campaign-owned destination.
8
+ */
9
+ function createAdapter() {
10
+ return createBrowserAdapter(() => {
11
+ ExitApi.exit();
12
+ });
13
+ }
14
+ //#endregion
15
+ export { createAdapter };
16
+
17
+ //# sourceMappingURL=google.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google.js","names":[],"sources":["../../src/adapters/google/index.ts"],"sourcesContent":["import type { HostAdapter } from '#types/host-adapter.js';\n\nimport { createBrowserAdapter } from '../browser/create-adapter.js';\n\n/** API injected by Google Ads through its network-owned Exit API script. */\ndeclare const ExitApi: {\n exit(): void;\n};\n\n/**\n * Creates the host adapter used by Google App Campaign playable ads.\n *\n * Google playables use ordinary browser lifecycle signals, while `ExitApi`\n * records the CTA and opens the campaign-owned destination.\n */\nexport function createAdapter(): HostAdapter {\n return createBrowserAdapter(() => {\n ExitApi.exit();\n });\n}\n"],"mappings":";;;;;;;;AAeA,SAAgB,gBAA6B;CAC3C,OAAO,2BAA2B;EAChC,QAAQ,KAAK;CACf,CAAC;AACH"}
@@ -0,0 +1,13 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/liftoff/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by Liftoff playable ads.
5
+ *
6
+ * Liftoff exposes the standard MRAID lifecycle and may additionally inject its
7
+ * own ready/open API. The dedicated API owns campaign click attribution when
8
+ * available; MRAID remains the documented fallback.
9
+ */
10
+ declare function createAdapter(): HostAdapter;
11
+ //#endregion
12
+ export { createAdapter };
13
+ //# sourceMappingURL=liftoff.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { i as waitForMraidReady, n as readMraidViewport, r as requireMraid, t as subscribeToMraidUpdates } from "../events-CYG_LvaH.js";
2
+ //#region src/adapters/liftoff/index.ts
3
+ /**
4
+ * Creates the host adapter used by Liftoff playable ads.
5
+ *
6
+ * Liftoff exposes the standard MRAID lifecycle and may additionally inject its
7
+ * own ready/open API. The dedicated API owns campaign click attribution when
8
+ * available; MRAID remains the documented fallback.
9
+ */
10
+ function createAdapter() {
11
+ let activeLiftoff;
12
+ return {
13
+ async initialize(listener) {
14
+ requireMraid();
15
+ await waitForMraidReady();
16
+ const liftoff = window.Liftoff;
17
+ if (liftoff !== void 0) {
18
+ await waitForLiftoffReady(liftoff);
19
+ activeLiftoff = liftoff;
20
+ }
21
+ subscribeToMraidUpdates(listener);
22
+ return {
23
+ visible: mraid.isViewable(),
24
+ viewport: readMraidViewport(),
25
+ volume: 1
26
+ };
27
+ },
28
+ openStore() {
29
+ if (activeLiftoff !== void 0) {
30
+ activeLiftoff.open();
31
+ return;
32
+ }
33
+ requireMraid();
34
+ mraid.open();
35
+ }
36
+ };
37
+ }
38
+ /** Resolves after Liftoff declares its campaign click API safe to call. */
39
+ function waitForLiftoffReady(liftoff) {
40
+ return new Promise((resolve) => {
41
+ liftoff.ready(resolve);
42
+ });
43
+ }
44
+ //#endregion
45
+ export { createAdapter };
46
+
47
+ //# sourceMappingURL=liftoff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liftoff.js","names":[],"sources":["../../src/adapters/liftoff/index.ts"],"sourcesContent":["import { FULL_VOLUME } from '#lifecycle/volume.js';\nimport { readMraidViewport, requireMraid, waitForMraidReady } from '#mraid/api.js';\nimport { subscribeToMraidUpdates } from '#mraid/events.js';\nimport type { HostAdapter, HostSnapshot } from '#types/host-adapter.js';\nimport type { LiftoffApi, LiftoffWindow } from '#types/host-apis.js';\nimport type { MraidApi } from '#types/mraid.js';\n\n/** MRAID SDK object injected by the Liftoff host. */\ndeclare const mraid: MraidApi;\n\n/**\n * Creates the host adapter used by Liftoff playable ads.\n *\n * Liftoff exposes the standard MRAID lifecycle and may additionally inject its\n * own ready/open API. The dedicated API owns campaign click attribution when\n * available; MRAID remains the documented fallback.\n */\nexport function createAdapter(): HostAdapter {\n let activeLiftoff: LiftoffApi | undefined;\n\n return {\n async initialize(listener): Promise<HostSnapshot> {\n requireMraid();\n await waitForMraidReady();\n\n const liftoff = (window as LiftoffWindow).Liftoff;\n\n if (liftoff !== undefined) {\n await waitForLiftoffReady(liftoff);\n activeLiftoff = liftoff;\n }\n\n subscribeToMraidUpdates(listener);\n\n return {\n visible: mraid.isViewable(),\n viewport: readMraidViewport(),\n // MRAID 2 has no initial volume query. MRAID 3 publishes subsequent\n // host volume through the shared audioVolumeChange subscription.\n volume: FULL_VOLUME,\n };\n },\n\n openStore(): void {\n if (activeLiftoff !== undefined) {\n activeLiftoff.open();\n return;\n }\n\n // Liftoff injects the campaign destination and documents an argumentless\n // MRAID call, so the authored store URL is intentionally not forwarded.\n requireMraid();\n mraid.open();\n },\n };\n}\n\n/** Resolves after Liftoff declares its campaign click API safe to call. */\nfunction waitForLiftoffReady(liftoff: LiftoffApi): Promise<void> {\n return new Promise<void>((resolve) => {\n liftoff.ready(resolve);\n });\n}\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,gBAA6B;CAC3C,IAAI;CAEJ,OAAO;EACL,MAAM,WAAW,UAAiC;GAChD,aAAa;GACb,MAAM,kBAAkB;GAExB,MAAM,UAAW,OAAyB;GAE1C,IAAI,YAAY,KAAA,GAAW;IACzB,MAAM,oBAAoB,OAAO;IACjC,gBAAgB;GAClB;GAEA,wBAAwB,QAAQ;GAEhC,OAAO;IACL,SAAS,MAAM,WAAW;IAC1B,UAAU,kBAAkB;IAG5B,QAAA;GACF;EACF;EAEA,YAAkB;GAChB,IAAI,kBAAkB,KAAA,GAAW;IAC/B,cAAc,KAAK;IACnB;GACF;GAIA,aAAa;GACb,MAAM,KAAK;EACb;CACF;AACF;;AAGA,SAAS,oBAAoB,SAAoC;CAC/D,OAAO,IAAI,SAAe,YAAY;EACpC,QAAQ,MAAM,OAAO;CACvB,CAAC;AACH"}
@@ -0,0 +1,12 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/meta/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by Meta playable ads.
5
+ *
6
+ * Meta playables use ordinary browser lifecycle signals, but their campaign
7
+ * owns the store destination and requires this exact CTA API call.
8
+ */
9
+ declare function createAdapter(): HostAdapter;
10
+ //#endregion
11
+ export { createAdapter };
12
+ //# sourceMappingURL=meta.d.ts.map
@@ -0,0 +1,16 @@
1
+ import { t as createBrowserAdapter } from "../create-adapter-4oub3UeP.js";
2
+ import { t as openFbPlayableStore } from "../api-BgI_ycxT.js";
3
+ //#region src/adapters/meta/index.ts
4
+ /**
5
+ * Creates the host adapter used by Meta playable ads.
6
+ *
7
+ * Meta playables use ordinary browser lifecycle signals, but their campaign
8
+ * owns the store destination and requires this exact CTA API call.
9
+ */
10
+ function createAdapter() {
11
+ return createBrowserAdapter(openFbPlayableStore);
12
+ }
13
+ //#endregion
14
+ export { createAdapter };
15
+
16
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","names":[],"sources":["../../src/adapters/meta/index.ts"],"sourcesContent":["import { openFbPlayableStore } from '#fb-playable/api.js';\nimport type { HostAdapter } from '#types/host-adapter.js';\n\nimport { createBrowserAdapter } from '../browser/create-adapter.js';\n\n/**\n * Creates the host adapter used by Meta playable ads.\n *\n * Meta playables use ordinary browser lifecycle signals, but their campaign\n * owns the store destination and requires this exact CTA API call.\n */\nexport function createAdapter(): HostAdapter {\n return createBrowserAdapter(openFbPlayableStore);\n}\n"],"mappings":";;;;;;;;;AAWA,SAAgB,gBAA6B;CAC3C,OAAO,qBAAqB,mBAAmB;AACjD"}
@@ -0,0 +1,13 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/mintegral/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by Mintegral playable ads.
5
+ *
6
+ * Replayable calls install, gameReady, and gameEnd. Mintegral calls the
7
+ * gameStart and gameClose functions installed here, allowing its host lifecycle
8
+ * to control visibility, frame scheduling, timers, and audio through one signal.
9
+ */
10
+ declare function createAdapter(): HostAdapter;
11
+ //#endregion
12
+ export { createAdapter };
13
+ //# sourceMappingURL=mintegral.d.ts.map
@@ -0,0 +1,59 @@
1
+ import { a as waitForDocumentReady, i as readBrowserViewport, r as isDocumentVisible, t as subscribeToBrowserUpdates } from "../events-C85TpS5f.js";
2
+ //#region src/adapters/mintegral/index.ts
3
+ /**
4
+ * Creates the host adapter used by Mintegral playable ads.
5
+ *
6
+ * Replayable calls install, gameReady, and gameEnd. Mintegral calls the
7
+ * gameStart and gameClose functions installed here, allowing its host lifecycle
8
+ * to control visibility, frame scheduling, timers, and audio through one signal.
9
+ */
10
+ function createAdapter() {
11
+ const host = window;
12
+ return {
13
+ async initialize(listener) {
14
+ await waitForDocumentReady();
15
+ let documentVisible = isDocumentVisible();
16
+ let gameStarted = false;
17
+ const publishVisibility = () => {
18
+ listener({
19
+ type: "visibilitychange",
20
+ visible: documentVisible && gameStarted
21
+ });
22
+ };
23
+ host.gameStart = () => {
24
+ gameStarted = true;
25
+ publishVisibility();
26
+ };
27
+ host.gameClose = () => {
28
+ gameStarted = false;
29
+ publishVisibility();
30
+ };
31
+ subscribeToBrowserUpdates((update) => {
32
+ if (update.type === "visibilitychange") {
33
+ documentVisible = update.visible;
34
+ publishVisibility();
35
+ return;
36
+ }
37
+ listener(update);
38
+ });
39
+ return {
40
+ visible: false,
41
+ volume: 1,
42
+ viewport: readBrowserViewport()
43
+ };
44
+ },
45
+ notifyComplete() {
46
+ host.gameEnd?.();
47
+ },
48
+ notifyReady() {
49
+ host.gameReady?.();
50
+ },
51
+ openStore() {
52
+ host.install?.();
53
+ }
54
+ };
55
+ }
56
+ //#endregion
57
+ export { createAdapter };
58
+
59
+ //# sourceMappingURL=mintegral.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mintegral.js","names":[],"sources":["../../src/adapters/mintegral/index.ts"],"sourcesContent":["import {\n isDocumentVisible,\n readBrowserViewport,\n waitForDocumentReady,\n} from '#adapters/browser/api.js';\nimport { subscribeToBrowserUpdates } from '#adapters/browser/events.js';\nimport { FULL_VOLUME } from '#lifecycle/volume.js';\nimport type { HostAdapter, HostSnapshot } from '#types/host-adapter.js';\nimport type { MintegralWindow } from '#types/host-apis.js';\n\n/**\n * Creates the host adapter used by Mintegral playable ads.\n *\n * Replayable calls install, gameReady, and gameEnd. Mintegral calls the\n * gameStart and gameClose functions installed here, allowing its host lifecycle\n * to control visibility, frame scheduling, timers, and audio through one signal.\n */\nexport function createAdapter(): HostAdapter {\n const host = window as MintegralWindow;\n\n return {\n async initialize(listener): Promise<HostSnapshot> {\n await waitForDocumentReady();\n\n let documentVisible = isDocumentVisible();\n let gameStarted = false;\n\n const publishVisibility = (): void => {\n listener({\n type: 'visibilitychange',\n visible: documentVisible && gameStarted,\n });\n };\n\n host.gameStart = (): void => {\n gameStarted = true;\n publishVisibility();\n };\n host.gameClose = (): void => {\n gameStarted = false;\n publishVisibility();\n };\n\n subscribeToBrowserUpdates((update) => {\n if (update.type === 'visibilitychange') {\n documentVisible = update.visible;\n publishVisibility();\n return;\n }\n\n listener(update);\n });\n\n return {\n visible: false,\n volume: FULL_VOLUME,\n viewport: readBrowserViewport(),\n };\n },\n\n notifyComplete(): void {\n host.gameEnd?.();\n },\n\n notifyReady(): void {\n host.gameReady?.();\n },\n\n openStore(): void {\n host.install?.();\n },\n };\n}\n"],"mappings":";;;;;;;;;AAiBA,SAAgB,gBAA6B;CAC3C,MAAM,OAAO;CAEb,OAAO;EACL,MAAM,WAAW,UAAiC;GAChD,MAAM,qBAAqB;GAE3B,IAAI,kBAAkB,kBAAkB;GACxC,IAAI,cAAc;GAElB,MAAM,0BAAgC;IACpC,SAAS;KACP,MAAM;KACN,SAAS,mBAAmB;IAC9B,CAAC;GACH;GAEA,KAAK,kBAAwB;IAC3B,cAAc;IACd,kBAAkB;GACpB;GACA,KAAK,kBAAwB;IAC3B,cAAc;IACd,kBAAkB;GACpB;GAEA,2BAA2B,WAAW;IACpC,IAAI,OAAO,SAAS,oBAAoB;KACtC,kBAAkB,OAAO;KACzB,kBAAkB;KAClB;IACF;IAEA,SAAS,MAAM;GACjB,CAAC;GAED,OAAO;IACL,SAAS;IACT,QAAA;IACA,UAAU,oBAAoB;GAChC;EACF;EAEA,iBAAuB;GACrB,KAAK,UAAU;EACjB;EAEA,cAAoB;GAClB,KAAK,YAAY;EACnB;EAEA,YAAkB;GAChB,KAAK,UAAU;EACjB;CACF;AACF"}
@@ -0,0 +1,11 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/moloco/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by Moloco standalone playables and interactive
5
+ * end cards. Moloco requires the exact FbPlayableAd CTA contract while ordinary
6
+ * browser signals provide viewport and visibility lifecycle state.
7
+ */
8
+ declare function createAdapter(): HostAdapter;
9
+ //#endregion
10
+ export { createAdapter };
11
+ //# sourceMappingURL=moloco.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { t as createBrowserAdapter } from "../create-adapter-4oub3UeP.js";
2
+ import { t as openFbPlayableStore } from "../api-BgI_ycxT.js";
3
+ //#region src/adapters/moloco/index.ts
4
+ /**
5
+ * Creates the host adapter used by Moloco standalone playables and interactive
6
+ * end cards. Moloco requires the exact FbPlayableAd CTA contract while ordinary
7
+ * browser signals provide viewport and visibility lifecycle state.
8
+ */
9
+ function createAdapter() {
10
+ return createBrowserAdapter(openFbPlayableStore);
11
+ }
12
+ //#endregion
13
+ export { createAdapter };
14
+
15
+ //# sourceMappingURL=moloco.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moloco.js","names":[],"sources":["../../src/adapters/moloco/index.ts"],"sourcesContent":["import { openFbPlayableStore } from '#fb-playable/api.js';\nimport type { HostAdapter } from '#types/host-adapter.js';\n\nimport { createBrowserAdapter } from '../browser/create-adapter.js';\n\n/**\n * Creates the host adapter used by Moloco standalone playables and interactive\n * end cards. Moloco requires the exact FbPlayableAd CTA contract while ordinary\n * browser signals provide viewport and visibility lifecycle state.\n */\nexport function createAdapter(): HostAdapter {\n return createBrowserAdapter(openFbPlayableStore);\n}\n"],"mappings":";;;;;;;;AAUA,SAAgB,gBAA6B;CAC3C,OAAO,qBAAqB,mBAAmB;AACjD"}
@@ -0,0 +1,12 @@
1
+ import { t as HostAdapter } from "../host-adapter-vFX6DBcY.js";
2
+ //#region src/adapters/unity/index.d.ts
3
+ /**
4
+ * Creates the host adapter used by Unity playable ads.
5
+ *
6
+ * Unity uses the standard MRAID lifecycle and mraid.open() behavior provided
7
+ * by Replayable's shared, analyzer-visible MRAID adapter.
8
+ */
9
+ declare function createAdapter(): HostAdapter;
10
+ //#endregion
11
+ export { createAdapter };
12
+ //# sourceMappingURL=unity.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { t as createMraidHostAdapter } from "../create-adapter-ByJx4UTX.js";
2
+ //#region src/adapters/unity/index.ts
3
+ /**
4
+ * Creates the host adapter used by Unity playable ads.
5
+ *
6
+ * Unity uses the standard MRAID lifecycle and mraid.open() behavior provided
7
+ * by Replayable's shared, analyzer-visible MRAID adapter.
8
+ */
9
+ function createAdapter() {
10
+ return createMraidHostAdapter();
11
+ }
12
+ //#endregion
13
+ export { createAdapter };
14
+
15
+ //# sourceMappingURL=unity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unity.js","names":[],"sources":["../../src/adapters/unity/index.ts"],"sourcesContent":["import { createMraidHostAdapter } from '#mraid/create-adapter.js';\nimport type { HostAdapter } from '#types/host-adapter.js';\n\n/**\n * Creates the host adapter used by Unity playable ads.\n *\n * Unity uses the standard MRAID lifecycle and mraid.open() behavior provided\n * by Replayable's shared, analyzer-visible MRAID adapter.\n */\nexport function createAdapter(): HostAdapter {\n return createMraidHostAdapter();\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,gBAA6B;CAC3C,OAAO,uBAAuB;AAChC"}
@@ -0,0 +1,13 @@
1
+ //#region src/fb-playable/api.ts
2
+ /**
3
+ * Opens the campaign destination through the exact API required by both Meta
4
+ * and Moloco playable containers.
5
+ */
6
+ function openFbPlayableStore() {
7
+ if (typeof FbPlayableAd === "undefined") throw new Error("The active network requires window.FbPlayableAd.");
8
+ FbPlayableAd.onCTAClick();
9
+ }
10
+ //#endregion
11
+ export { openFbPlayableStore as t };
12
+
13
+ //# sourceMappingURL=api-BgI_ycxT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-BgI_ycxT.js","names":[],"sources":["../src/fb-playable/api.ts"],"sourcesContent":["import type { FbPlayableApi } from '#types/host-apis.js';\n\ndeclare const FbPlayableAd: FbPlayableApi | undefined;\n\n/**\n * Opens the campaign destination through the exact API required by both Meta\n * and Moloco playable containers.\n */\nexport function openFbPlayableStore(): void {\n if (typeof FbPlayableAd === 'undefined') {\n throw new Error('The active network requires window.FbPlayableAd.');\n }\n\n FbPlayableAd.onCTAClick();\n}\n"],"mappings":";;;;;AAQA,SAAgB,sBAA4B;CAC1C,IAAI,OAAO,iBAAiB,aAC1B,MAAM,IAAI,MAAM,kDAAkD;CAGpE,aAAa,WAAW;AAC1B"}
@@ -0,0 +1,107 @@
1
+ //#region src/assets/bundles.d.ts
2
+ /** Runtime bundles supported by a playable, in loading order. */
3
+ declare const assetBundleNames: readonly ['primary', 'secondary'];
4
+ //#endregion
5
+ //#region src/assets/categories.d.ts
6
+ /** Categories produced from one selected source file per logical asset. */
7
+ declare const simpleAssetCategories: readonly ['sprites', 'textures', 'sounds', 'fonts', 'locales'];
8
+ /** Categories assembled from several related source files. */
9
+ declare const groupedAssetCategories: readonly ['atlases', 'spines', 'shaders'];
10
+ /** Every generated asset category understood by the playable runtime. */
11
+ declare const assetCategories: readonly ["sprites", "textures", "sounds", "fonts", "locales", "atlases", "spines", "shaders"];
12
+ //#endregion
13
+ //#region src/types/assets.d.ts
14
+ /** Runtime bundle accepted by the playable asset loader. */
15
+ type AssetBundleName = (typeof assetBundleNames)[number];
16
+ /** Runtime category whose logical asset originates from one source file. */
17
+ type SimpleAssetCategory = (typeof simpleAssetCategories)[number];
18
+ /** Runtime category assembled from several related source files. */
19
+ type GroupedAssetCategory = (typeof groupedAssetCategories)[number];
20
+ /** Any generated asset category understood by the playable runtime. */
21
+ type AssetCategory = (typeof assetCategories)[number];
22
+ /** Build-selected representation of generated physical asset files. */
23
+ type AssetMode = 'inline' | 'resource';
24
+ /** Primitive value supported by a generated JSON asset. */
25
+ type JsonPrimitive = boolean | null | number | string;
26
+ /** Any value that can be represented in a generated JSON asset. */
27
+ type JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];
28
+ /** JSON object imported by the generated assets module. */
29
+ interface JsonObject {
30
+ readonly [key: string]: JsonValue;
31
+ }
32
+ /** One generated atlas sheet and its selected texture file. */
33
+ interface AtlasAsset {
34
+ /** URL of the selected texture encoding. */
35
+ readonly image: string;
36
+ /** Parsed inline atlas layout or URL of an emitted JSON resource. */
37
+ readonly json: JsonObject | string;
38
+ }
39
+ /** Runtime reference to one generated font file. */
40
+ interface FontAsset {
41
+ /** Configured CSS font-family name. */
42
+ readonly family: string;
43
+ /** URL of the generated WOFF2 file. */
44
+ readonly src: string;
45
+ }
46
+ /** Runtime value emitted for one selected sprite or texture file. */
47
+ interface ImageAsset {
48
+ /** Scale applied while processing the source image. */
49
+ readonly scale: number;
50
+ /** URL of the selected encoded file. */
51
+ readonly src: string;
52
+ }
53
+ /** Loaded fixed-language translations keyed by phrase ID. */
54
+ type LocaleDictionary = Readonly<Record<string, string>>;
55
+ /** Parsed inline translations or URL of an emitted fixed-language dictionary. */
56
+ type LocaleAsset = LocaleDictionary | string;
57
+ /** Runtime WebGL 2 shader source pair. */
58
+ interface ShaderAsset {
59
+ /** Inline fragment source or URL selected according to the runtime asset mode. */
60
+ readonly frag: string;
61
+ /** Inline vertex source or URL selected according to the runtime asset mode. */
62
+ readonly vert: string;
63
+ }
64
+ /** Complete runtime Spine export. */
65
+ interface SpineAsset {
66
+ /** Inline Spine atlas description or URL of the emitted text resource. */
67
+ readonly atlas: string;
68
+ /** Generated skeleton representation selected from the authored source. */
69
+ readonly format: 'json' | 'skel';
70
+ /** Selected texture URLs ordered by atlas page index. */
71
+ readonly images: readonly string[];
72
+ /** Generated texture scale restored as Pixi source resolution at load time. */
73
+ readonly scale: number;
74
+ /** Parsed inline JSON skeleton or URL/data URL of a skeleton resource. */
75
+ readonly skel: JsonObject | string;
76
+ }
77
+ /** Runtime assets available inside one generated bundle. */
78
+ interface AssetsInBundle {
79
+ /** Packed sprite sheets keyed by generated sheet ID. */
80
+ readonly atlases?: Readonly<Record<string, AtlasAsset>>;
81
+ /** Subset web fonts keyed by logical asset ID. */
82
+ readonly fonts?: Readonly<Record<string, FontAsset>>;
83
+ /** Inline or externally emitted fixed-language dictionaries keyed by logical asset ID. */
84
+ readonly locales?: Readonly<Record<string, LocaleAsset>>;
85
+ /** WebGL 2 shader pairs keyed by logical asset ID. */
86
+ readonly shaders?: Readonly<Record<string, ShaderAsset>>;
87
+ /** Selected audio-file URLs keyed by logical asset ID. */
88
+ readonly sounds?: Readonly<Record<string, string>>;
89
+ /** Spine skeletons keyed by logical asset ID. */
90
+ readonly spines?: Readonly<Record<string, SpineAsset>>;
91
+ /** Localized 2D images keyed by logical asset ID. */
92
+ readonly sprites?: Readonly<Record<string, ImageAsset>>;
93
+ /** General-purpose or 3D texture images keyed by logical asset ID. */
94
+ readonly textures?: Readonly<Record<string, ImageAsset>>;
95
+ }
96
+ /** Generated source value received by the loader for each asset category. */
97
+ type AssetSourceByCategory = { [Category in AssetCategory]: NonNullable<AssetsInBundle[Category]>[string]; };
98
+ /** Complete generated asset manifest consumed by one playable. */
99
+ interface Assets {
100
+ /** Assets available for initial playable loading. */
101
+ readonly primary: AssetsInBundle;
102
+ /** Optional assets intended for deferred loading. */
103
+ readonly secondary?: AssetsInBundle;
104
+ }
105
+ //#endregion
106
+ export { assetBundleNames as S, SimpleAssetCategory as _, Assets as a, groupedAssetCategories as b, FontAsset as c, JsonObject as d, JsonPrimitive as f, ShaderAsset as g, LocaleDictionary as h, AssetSourceByCategory as i, GroupedAssetCategory as l, LocaleAsset as m, AssetCategory as n, AssetsInBundle as o, JsonValue as p, AssetMode as r, AtlasAsset as s, AssetBundleName as t, ImageAsset as u, SpineAsset as v, simpleAssetCategories as x, assetCategories as y };
107
+ //# sourceMappingURL=assets-BD68MQTL.d.ts.map
@@ -0,0 +1,2 @@
1
+ import { S as assetBundleNames, _ as SimpleAssetCategory, a as Assets, b as groupedAssetCategories, c as FontAsset, d as JsonObject, f as JsonPrimitive, g as ShaderAsset, h as LocaleDictionary, i as AssetSourceByCategory, l as GroupedAssetCategory, m as LocaleAsset, n as AssetCategory, o as AssetsInBundle, p as JsonValue, r as AssetMode, s as AtlasAsset, t as AssetBundleName, u as ImageAsset, v as SpineAsset, x as simpleAssetCategories, y as assetCategories } from "./assets-BD68MQTL.js";
2
+ export { type AssetBundleName, type AssetCategory, type AssetMode, type AssetSourceByCategory, type Assets, type AssetsInBundle, type AtlasAsset, type FontAsset, type GroupedAssetCategory, type ImageAsset, type JsonObject, type JsonPrimitive, type JsonValue, type LocaleAsset, type LocaleDictionary, type ShaderAsset, type SimpleAssetCategory, type SpineAsset, assetBundleNames, assetCategories, groupedAssetCategories, simpleAssetCategories };
package/dist/assets.js ADDED
@@ -0,0 +1,8 @@
1
+ import { n as groupedAssetCategories, r as simpleAssetCategories, t as assetCategories } from "./categories-BbQSRMmw.js";
2
+ //#region src/assets/bundles.ts
3
+ /** Runtime bundles supported by a playable, in loading order. */
4
+ const assetBundleNames = ["primary", "secondary"];
5
+ //#endregion
6
+ export { assetBundleNames, assetCategories, groupedAssetCategories, simpleAssetCategories };
7
+
8
+ //# sourceMappingURL=assets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assets.js","names":[],"sources":["../src/assets/bundles.ts"],"sourcesContent":["/** Runtime bundles supported by a playable, in loading order. */\nexport const assetBundleNames = ['primary', 'secondary'] as const;\n"],"mappings":";;;AACA,MAAa,mBAAmB,CAAC,WAAW,WAAW"}
@@ -0,0 +1,12 @@
1
+ import { t as AudioController } from "../audio-CyLjSreN.js";
2
+ //#region src/audio/disabled.d.ts
3
+ /**
4
+ * Returns the no-op facade used by variants whose audio capability is disabled.
5
+ *
6
+ * Reusing this singleton is safe because both the controller and its returned
7
+ * playback handle are stateless.
8
+ */
9
+ declare function createAudio(): AudioController;
10
+ //#endregion
11
+ export { createAudio };
12
+ //# sourceMappingURL=disabled.d.ts.map
@@ -0,0 +1,44 @@
1
+ //#region src/audio/disabled.ts
2
+ /**
3
+ * Stable handle returned for every disabled managed-playback request.
4
+ *
5
+ * Shared application code may retain this handle and call `stop()` without
6
+ * checking whether the current variant includes audio. It is safe to reuse
7
+ * because the handle contains no playback ID or mutable state.
8
+ */
9
+ const disabledPlayback = { stop() {} };
10
+ /**
11
+ * Complete no-op audio controller selected for an audio-disabled variant.
12
+ *
13
+ * This module deliberately imports no Howler implementation and registers no
14
+ * sound loader. Consequently, disabled builds require neither sound resources
15
+ * nor audio lifecycle work while exposing exactly the same application API.
16
+ * Transient effects, host updates, visibility changes, and unlock attempts are
17
+ * all intentionally ignored.
18
+ */
19
+ const disabledAudio = {
20
+ get muted() {
21
+ return true;
22
+ },
23
+ setMuted() {},
24
+ play() {
25
+ return disabledPlayback;
26
+ },
27
+ playOneShot() {},
28
+ setVisible() {},
29
+ update() {},
30
+ unlock() {}
31
+ };
32
+ /**
33
+ * Returns the no-op facade used by variants whose audio capability is disabled.
34
+ *
35
+ * Reusing this singleton is safe because both the controller and its returned
36
+ * playback handle are stateless.
37
+ */
38
+ function createAudio() {
39
+ return disabledAudio;
40
+ }
41
+ //#endregion
42
+ export { createAudio };
43
+
44
+ //# sourceMappingURL=disabled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disabled.js","names":[],"sources":["../../src/audio/disabled.ts"],"sourcesContent":["import type { AudioController, AudioPlayback } from '#types/audio.js';\n\n/**\n * Stable handle returned for every disabled managed-playback request.\n *\n * Shared application code may retain this handle and call `stop()` without\n * checking whether the current variant includes audio. It is safe to reuse\n * because the handle contains no playback ID or mutable state.\n */\nconst disabledPlayback: AudioPlayback = {\n stop(): void {},\n};\n\n/**\n * Complete no-op audio controller selected for an audio-disabled variant.\n *\n * This module deliberately imports no Howler implementation and registers no\n * sound loader. Consequently, disabled builds require neither sound resources\n * nor audio lifecycle work while exposing exactly the same application API.\n * Transient effects, host updates, visibility changes, and unlock attempts are\n * all intentionally ignored.\n */\nconst disabledAudio: AudioController = {\n get muted(): boolean {\n return true;\n },\n setMuted(): void {},\n play(): AudioPlayback {\n return disabledPlayback;\n },\n playOneShot(): void {},\n setVisible(): void {},\n update(): void {},\n unlock(): void {},\n};\n\n/**\n * Returns the no-op facade used by variants whose audio capability is disabled.\n *\n * Reusing this singleton is safe because both the controller and its returned\n * playback handle are stateless.\n */\nexport function createAudio(): AudioController {\n return disabledAudio;\n}\n"],"mappings":";;;;;;;;AASA,MAAM,mBAAkC,EACtC,OAAa,CAAC,EAChB;;;;;;;;;;AAWA,MAAM,gBAAiC;CACrC,IAAI,QAAiB;EACnB,OAAO;CACT;CACA,WAAiB,CAAC;CAClB,OAAsB;EACpB,OAAO;CACT;CACA,cAAoB,CAAC;CACrB,aAAmB,CAAC;CACpB,SAAe,CAAC;CAChB,SAAe,CAAC;AAClB;;;;;;;AAQA,SAAgB,cAA+B;CAC7C,OAAO;AACT"}