@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.
- package/LICENSE +21 -0
- package/README.md +29 -0
- package/dist/adapters/applovin.d.ts +13 -0
- package/dist/adapters/applovin.js +16 -0
- package/dist/adapters/applovin.js.map +1 -0
- package/dist/adapters/browser.d.ts +12 -0
- package/dist/adapters/browser.js +17 -0
- package/dist/adapters/browser.js.map +1 -0
- package/dist/adapters/google.d.ts +12 -0
- package/dist/adapters/google.js +17 -0
- package/dist/adapters/google.js.map +1 -0
- package/dist/adapters/liftoff.d.ts +13 -0
- package/dist/adapters/liftoff.js +47 -0
- package/dist/adapters/liftoff.js.map +1 -0
- package/dist/adapters/meta.d.ts +12 -0
- package/dist/adapters/meta.js +16 -0
- package/dist/adapters/meta.js.map +1 -0
- package/dist/adapters/mintegral.d.ts +13 -0
- package/dist/adapters/mintegral.js +59 -0
- package/dist/adapters/mintegral.js.map +1 -0
- package/dist/adapters/moloco.d.ts +11 -0
- package/dist/adapters/moloco.js +15 -0
- package/dist/adapters/moloco.js.map +1 -0
- package/dist/adapters/unity.d.ts +12 -0
- package/dist/adapters/unity.js +15 -0
- package/dist/adapters/unity.js.map +1 -0
- package/dist/api-BgI_ycxT.js +13 -0
- package/dist/api-BgI_ycxT.js.map +1 -0
- package/dist/assets-BD68MQTL.d.ts +107 -0
- package/dist/assets.d.ts +2 -0
- package/dist/assets.js +8 -0
- package/dist/assets.js.map +1 -0
- package/dist/audio/disabled.d.ts +12 -0
- package/dist/audio/disabled.js +44 -0
- package/dist/audio/disabled.js.map +1 -0
- package/dist/audio/enabled.d.ts +28 -0
- package/dist/audio/enabled.js +426 -0
- package/dist/audio/enabled.js.map +1 -0
- package/dist/audio-CyLjSreN.d.ts +66 -0
- package/dist/categories-BbQSRMmw.js +21 -0
- package/dist/categories-BbQSRMmw.js.map +1 -0
- package/dist/create-adapter-4oub3UeP.js +22 -0
- package/dist/create-adapter-4oub3UeP.js.map +1 -0
- package/dist/create-adapter-ByJx4UTX.js +43 -0
- package/dist/create-adapter-ByJx4UTX.js.map +1 -0
- package/dist/events-C85TpS5f.js +69 -0
- package/dist/events-C85TpS5f.js.map +1 -0
- package/dist/events-CYG_LvaH.js +85 -0
- package/dist/events-CYG_LvaH.js.map +1 -0
- package/dist/host-adapter-vFX6DBcY.d.ts +43 -0
- package/dist/index.d.ts +255 -0
- package/dist/index.js +8876 -0
- package/dist/index.js.map +1 -0
- package/dist/loader-Czz-x3KH.d.ts +61 -0
- package/dist/screen-DXf2FPtL.d.ts +70 -0
- package/dist/shell.d.ts +10 -0
- package/dist/shell.js +11 -0
- package/dist/shell.js.map +1 -0
- package/package.json +75 -0
- package/src/screen/gpu/benchmarks/LICENSE +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["adrenoData","appleIpadData","appleData","intelData","maliTData","maliData","nvidiaData","powervrData","samsungData"],"sources":["../src/audio/resolve-audio-state.ts","../src/lifecycle/create-runtime-state.ts","../src/lifecycle/interaction.ts","../src/loader/builtins/font.ts","../src/loader/builtins/locale.ts","../src/loader/builtins/shader.ts","../src/loader/create-asset-loader.ts","../src/localization/create-localization.ts","../src/screen/gpu/benchmarks/m-adreno.json","../src/screen/gpu/benchmarks/m-apple-ipad.json","../src/screen/gpu/benchmarks/m-apple.json","../src/screen/gpu/benchmarks/m-intel.json","../src/screen/gpu/benchmarks/m-mali-t.json","../src/screen/gpu/benchmarks/m-mali.json","../src/screen/gpu/benchmarks/m-nvidia.json","../src/screen/gpu/benchmarks/m-powervr.json","../src/screen/gpu/benchmarks/m-samsung.json","../src/screen/gpu/load-local-benchmarks.ts","../src/screen/gpu/create-gpu-tier-detector.ts","../src/screen/gpu/resolve-render-policy.ts","../src/screen/measure-safe-area.ts","../src/screen/create-screen.ts","../src/shell/apply-screen-frame.ts","../src/shell/install-interaction-guards.ts","../src/shell/resolve-playable-shell.ts","../src/completion/create-completion-timers.ts","../src/timers/create-inactivity-timer.ts","../src/timers/delay.ts","../src/timers/create-timers.ts","../src/update/constants.ts","../src/update/create-fixed-step-accumulator.ts","../src/update/create-update-channel.ts","../src/update/create-fixed-update.ts","../src/update/create-frame-scheduler.ts","../src/update/create-frame-update.ts","../src/update/create-runtime-updates.ts","../src/lifecycle/create-runtime.ts","../src/playable.ts"],"sourcesContent":["import type { RuntimeAudioState } from '#types/audio.js';\n\n/**\n * Derives whether audio may currently be audible from project and host facts.\n *\n * Audio is allowed only after the project includes audio, the user has\n * interacted, the host considers the ad visible, and host volume is non-zero.\n * The volume remains available even while audio is blocked so a later state\n * transition can restore the host's current value without another update.\n */\nexport function resolveAudioState(\n enabled: boolean,\n interacted: boolean,\n visible: boolean,\n volume: number,\n): RuntimeAudioState {\n return {\n allowed: enabled && interacted && visible && volume > 0,\n volume,\n };\n}\n\n/** Compares the complete public audio state before emitting `audiochange`. */\nexport function hasEqualAudioState(left: RuntimeAudioState, right: RuntimeAudioState): boolean {\n return left.allowed === right.allowed && left.volume === right.volume;\n}\n","import { hasEqualAudioState, resolveAudioState } from '#audio/resolve-audio-state.js';\nimport type { PlayableCompletionReason } from '#types/completion.js';\nimport type { HostSnapshot, HostUpdate } from '#types/host-adapter.js';\nimport type { RuntimeListeners } from '#types/lifecycle.js';\nimport type {\n RuntimeConfig,\n RuntimeEventListener,\n RuntimeEventMap,\n RuntimeState,\n} from '#types/runtime.js';\nimport type { RuntimeOrientation, RuntimeViewport } from '#types/screen.js';\n\n/**\n * Owns normalized runtime state and the public events produced by its changes.\n *\n * Adapters report raw host facts without retaining Replayable state. This\n * controller applies lifecycle policy, suppresses duplicate changes, and emits\n * events only after the corresponding state has been committed. Project audio\n * capability participates in every effective-audio calculation, so a disabled\n * variant can never become allowed through interaction or host updates.\n *\n * For example, initializing from this browser-host snapshot:\n *\n * ```ts\n * {\n * visible: true,\n * volume: 0.5,\n * viewport: { width: 390, height: 844 },\n * }\n * ```\n *\n * produces portrait runtime state with `interacted: false` and therefore\n * `audio: { allowed: false, volume: 0.5 }`. A later first interaction commits\n * `interacted: true`, synchronously emits `interaction`, and only then emits the\n * resulting allowed audio state.\n */\nexport function createRuntimeState(config: RuntimeConfig) {\n const audioEnabled = config.audio;\n const listeners: RuntimeListeners = {\n audiochange: new Set(),\n complete: new Set(),\n interaction: new Set(),\n resize: new Set(),\n visibilitychange: new Set(),\n };\n\n // An SDK may synchronously publish an event while its adapter is registering\n // listeners but before initialize() returns the authoritative first snapshot.\n // Those updates are preserved in arrival order and replayed after that\n // snapshot establishes the state against which they must be applied.\n const pendingHostUpdates: HostUpdate[] = [];\n\n let state: RuntimeState | undefined;\n\n /** Synchronously notifies the current listeners for one committed event. */\n const emit = <Event extends keyof RuntimeEventMap>(\n event: Event,\n value: RuntimeEventMap[Event],\n ): void => {\n for (const listener of listeners[event]) {\n listener(value);\n }\n };\n\n /** Commits changed viewport dimensions and their derived orientation. */\n const applyResize = (viewport: RuntimeViewport): void => {\n const currentState = requireState(state);\n\n if (hasEqualDimensions(currentState.viewport, viewport)) {\n return;\n }\n\n state = {\n ...currentState,\n orientation: deriveOrientation(viewport),\n viewport,\n };\n emit('resize', viewport);\n };\n\n /** Commits host viewability together with its derived effective audio state. */\n const applyVisibility = (visible: boolean): void => {\n const currentState = requireState(state);\n\n if (currentState.visible === visible) {\n return;\n }\n\n // Losing viewability also disables effective audio, even when host volume\n // and the user's interaction state have not changed.\n const audio = resolveAudioState(\n audioEnabled,\n currentState.interacted,\n visible,\n currentState.audio.volume,\n );\n\n state = { ...currentState, audio, visible };\n\n // Visibility listeners suspend or recover the audio context before the\n // following audio event applies its effective volume and muting policy.\n emit('visibilitychange', visible);\n\n if (!hasEqualAudioState(currentState.audio, audio)) {\n emit('audiochange', audio);\n }\n };\n\n /** Commits changed host volume and emits its resulting effective audio state. */\n const applyVolume = (volume: number): void => {\n const currentState = requireState(state);\n\n if (currentState.audio.volume === volume) {\n return;\n }\n\n const audio = resolveAudioState(\n audioEnabled,\n currentState.interacted,\n currentState.visible,\n volume,\n );\n\n state = { ...currentState, audio };\n emit('audiochange', audio);\n };\n\n /** Routes one host update now, or queues it until the first snapshot exists. */\n const applyHostUpdate = (update: HostUpdate): void => {\n if (state === undefined) {\n pendingHostUpdates.push(update);\n return;\n }\n\n switch (update.type) {\n case 'resize':\n applyResize(update.viewport);\n break;\n case 'visibilitychange':\n applyVisibility(update.visible);\n break;\n case 'volumechange':\n applyVolume(update.volume);\n break;\n }\n };\n\n /** Commits Replayable's one-time trusted-interaction transition. */\n const applyFirstInteraction = (): void => {\n const currentState = requireState(state);\n\n if (currentState.interacted) {\n return;\n }\n\n // A trusted first interaction satisfies Replayable's autoplay policy and\n // may therefore change effective audio together with interaction state.\n const audio = resolveAudioState(\n audioEnabled,\n true,\n currentState.visible,\n currentState.audio.volume,\n );\n\n state = { ...currentState, audio, interacted: true };\n\n // Runtime listeners use this event to invoke AudioContext.resume() while\n // the browser still considers the current task a trusted user interaction.\n // Effective audio is emitted afterward so unmuting cannot precede unlock.\n emit('interaction', true);\n\n if (!hasEqualAudioState(currentState.audio, audio)) {\n emit('audiochange', audio);\n }\n };\n\n /** Commits the only terminal outcome and synchronously publishes it. */\n const applyCompletion = (reason: PlayableCompletionReason): void => {\n const currentState = requireState(state);\n\n if (currentState.completion !== undefined) {\n throw new Error(\n `Playable already completed with reason \"${currentState.completion.reason}\".`,\n );\n }\n\n const completion = { reason };\n\n state = { ...currentState, completion };\n emit('complete', completion);\n };\n\n return {\n applyCompletion,\n applyFirstInteraction,\n applyHostUpdate,\n\n get(): RuntimeState {\n return requireState(state);\n },\n\n initialize(snapshot: HostSnapshot): void {\n state = createInitialState(snapshot, audioEnabled);\n\n // Initialization establishes the first real viewport. Publishing it\n // through the normal resize event lets renderer integrations subscribe\n // before ready() without starting runtime initialization themselves.\n emit('resize', snapshot.viewport);\n\n // Replay events captured during adapter initialization against the first\n // complete snapshot so no synchronous host change is lost. splice(0)\n // drains the queue exactly once while preserving its arrival order.\n for (const update of pendingHostUpdates.splice(0)) {\n applyHostUpdate(update);\n }\n },\n\n on<Event extends keyof RuntimeEventMap>(\n event: Event,\n listener: RuntimeEventListener<Event>,\n ): () => void {\n listeners[event].add(listener);\n\n // The returned function gives consumers ownership of subscription cleanup.\n return (): void => {\n listeners[event].delete(listener);\n };\n },\n };\n}\n\n/** Converts the first host snapshot into the complete public runtime state. */\nfunction createInitialState(snapshot: HostSnapshot, audioEnabled: boolean): RuntimeState {\n return {\n audio: resolveAudioState(audioEnabled, false, snapshot.visible, snapshot.volume),\n completion: undefined,\n interacted: false,\n orientation: deriveOrientation(snapshot.viewport),\n visible: snapshot.visible,\n viewport: snapshot.viewport,\n };\n}\n\n/** Derives orientation from the actual ad container rather than the physical screen. */\nfunction deriveOrientation(viewport: RuntimeViewport): RuntimeOrientation {\n return viewport.height >= viewport.width ? 'portrait' : 'landscape';\n}\n\n/** Compares only dimensions because viewport objects are recreated for every host event. */\nfunction hasEqualDimensions(left: RuntimeViewport, right: RuntimeViewport): boolean {\n return left.height === right.height && left.width === right.width;\n}\n\n/** Prevents consumers from reading or invoking runtime behavior before host readiness. */\nfunction requireState(state: RuntimeState | undefined): RuntimeState {\n if (state === undefined) {\n throw new Error('Replayable runtime is not ready.');\n }\n\n return state;\n}\n","/** Reports every trusted browser input that constitutes playable activity. */\nexport function observeUserActivity(listener: () => void): void {\n const handleInteraction = (event: Event): void => {\n if (!event.isTrusted) {\n return;\n }\n\n listener();\n };\n\n document.addEventListener('click', handleInteraction, true);\n document.addEventListener('keydown', handleInteraction, true);\n document.addEventListener('mousedown', handleInteraction, true);\n document.addEventListener('pointerdown', handleInteraction, true);\n document.addEventListener('touchstart', handleInteraction, true);\n}\n","import type { AssetLoadHandler } from '#types/loader.js';\n\n/** Loads one generated WOFF2 file and registers it with the browser. */\nexport const loadFont: AssetLoadHandler<'fonts', FontFace> = async ({ source }) => {\n const font = new FontFace(source.family, `url(${JSON.stringify(source.src)}) format(\"woff2\")`);\n const loadedFont = await font.load();\n\n document.fonts.add(loadedFont);\n\n return loadedFont;\n};\n","import type { LocaleDictionary } from '#types/assets.js';\nimport type { AssetLoadHandler } from '#types/loader.js';\n\n/** Resolves inline or externally emitted fixed-language translations. */\nexport const loadLocale: AssetLoadHandler<'locales', LocaleDictionary> = async ({ source }) => {\n if (typeof source !== 'string') {\n assertLocaleDictionary(source, 'Inline locale');\n\n return source;\n }\n\n const response = await fetch(source);\n\n if (!response.ok) {\n throw new Error(`Unable to load locale ${source}: ${response.status} ${response.statusText}.`);\n }\n\n const dictionary: unknown = await response.json();\n\n assertLocaleDictionary(dictionary, `Locale ${source}`);\n\n return dictionary;\n};\n\n/** Validates translations before exposing them to playable code. */\nfunction assertLocaleDictionary(\n value: unknown,\n description: string,\n): asserts value is LocaleDictionary {\n const valid =\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n Object.values(value).every((translation) => typeof translation === 'string');\n\n if (!valid) {\n throw new Error(`${description} must contain string translation values.`);\n }\n}\n","import type { AssetMode, ShaderAsset } from '#types/assets.js';\nimport type { AssetLoadHandler, LoadedShaderAsset } from '#types/loader.js';\n\n/** Loads one generated WebGL 2 shader pair as engine-neutral GLSL strings. */\nexport const loadShader: AssetLoadHandler<'shaders', LoadedShaderAsset> = async ({\n assetMode,\n source,\n}) => {\n const [frag, vert] = await Promise.all([\n loadShaderSource(source.frag, assetMode),\n loadShaderSource(source.vert, assetMode),\n ]);\n\n return { frag, vert } satisfies LoadedShaderAsset;\n};\n\n/** Returns inline source directly or fetches one emitted shader resource. */\nasync function loadShaderSource(\n source: ShaderAsset['frag'],\n assetMode: AssetMode,\n): Promise<string> {\n if (assetMode === 'inline') {\n return source;\n }\n\n const response = await fetch(source);\n\n if (!response.ok) {\n throw new Error(`Unable to load shader ${source}: ${response.status} ${response.statusText}.`);\n }\n\n return response.text();\n}\n","import { assetCategories } from '#assets/categories.js';\nimport { loadFont } from '#loader/builtins/font.js';\nimport { loadLocale } from '#loader/builtins/locale.js';\nimport { loadShader } from '#loader/builtins/shader.js';\nimport type {\n AssetBundleName,\n AssetCategory,\n AssetMode,\n Assets,\n AssetsInBundle,\n} from '#types/assets.js';\nimport type {\n AssetCacheStorage,\n AssetLoadResult,\n AssetHandler,\n AssetHandlers,\n BundleLoadedListeners,\n AssetLoadedListeners,\n AssetLoadedContext,\n AssetLoadContext,\n AssetLoadHandler,\n AssetLoader,\n BuiltInAssetCategory,\n BuiltInAssetValueByCategory,\n RegisteredAssetCategory,\n} from '#types/loader.js';\n\n/** Creates the runtime loader around one generated assets module. */\nexport function createAssetLoader(assets: Assets, assetMode: AssetMode): AssetLoader {\n const bundleLoads = new Map<AssetBundleName, Promise<void>>();\n const bundleLoadedListeners: BundleLoadedListeners = {};\n const cache: AssetCacheStorage = {};\n const loadedListeners: AssetLoadedListeners = {};\n const handlers: AssetHandlers = {\n fonts: createBuiltInHandler('fonts', loadFont),\n locales: createBuiltInHandler('locales', loadLocale),\n shaders: createBuiltInHandler('shaders', loadShader),\n };\n\n return {\n cache,\n\n load(bundle): Promise<void> {\n const existingLoad = bundleLoads.get(bundle);\n\n if (existingLoad !== undefined) {\n return existingLoad;\n }\n\n // Publish the promise before invoking handlers, which may request this\n // bundle themselves. Success and failure are retained: loading is not a\n // reload API, and retrying partial success could leak native resources.\n const loading = Promise.resolve().then(() => loadAndNotifyBundle(bundle));\n bundleLoads.set(bundle, loading);\n\n return loading;\n },\n\n onBundleLoaded(bundle, listener): () => void {\n const bundleListeners = bundleLoadedListeners[bundle] ?? new Set();\n\n bundleListeners.add(listener);\n bundleLoadedListeners[bundle] = bundleListeners;\n\n return () => {\n bundleListeners.delete(listener);\n };\n },\n\n onLoaded(category, listener): () => void {\n const categoryListeners = loadedListeners[category] ?? new Set();\n\n categoryListeners.add(listener);\n Object.assign(loadedListeners, { [category]: categoryListeners });\n\n return () => {\n categoryListeners.delete(listener);\n };\n },\n\n register(category, handler): () => void {\n return registerHandler(category, handler);\n },\n };\n\n /** Loads one bundle once, including its asynchronous completion observers. */\n async function loadAndNotifyBundle(bundle: AssetBundleName): Promise<void> {\n const bundleAssets = assets[bundle];\n\n if (bundleAssets !== undefined) {\n await loadBundle(bundleAssets);\n }\n\n await notifyBundleLoaded(bundle);\n }\n\n /** Loads every populated category in one generated bundle concurrently. */\n async function loadBundle(bundleAssets: AssetsInBundle): Promise<void> {\n await Promise.all(assetCategories.map((category) => loadCategory(bundleAssets, category)));\n }\n\n /** Adds completion notification to one immutable built-in handler. */\n function createBuiltInHandler<Category extends BuiltInAssetCategory>(\n category: Category,\n handler: AssetLoadHandler<Category, BuiltInAssetValueByCategory[Category]>,\n ): AssetHandler<Category> {\n return {\n async load(context): Promise<AssetLoadResult> {\n const value = await handler(context);\n\n return {\n value,\n notifyLoaded: () => notifyLoaded(category, { ...context, value }),\n };\n },\n };\n }\n\n /** Installs one replaceable integration handler for its registered category. */\n function registerHandler<Category extends RegisteredAssetCategory>(\n category: Category,\n handler: AssetLoadHandler<Category>,\n ): () => void {\n if (handlers[category] !== undefined) {\n throw new Error(`An asset loader handler is already registered for ${category}.`);\n }\n\n const assetHandler: AssetHandler<Category> = {\n async load(context): Promise<AssetLoadResult> {\n return { value: await handler(context) };\n },\n };\n\n Object.assign(handlers, { [category]: assetHandler });\n\n return () => {\n if (handlers[category] === assetHandler) {\n delete handlers[category];\n }\n };\n }\n\n /** Runs one category's built-in, registered, or pass-through loading behavior. */\n // The generic preserves the correlation between a category, its source, and\n // its handler even though it does not appear in the return type.\n // oxlint-disable-next-line typescript/no-unnecessary-type-parameters\n async function loadCategory<Category extends AssetCategory>(\n bundleAssets: AssetsInBundle,\n category: Category,\n ): Promise<void> {\n const categoryAssets = bundleAssets[category];\n\n if (categoryAssets === undefined) {\n return;\n }\n\n await Promise.all(\n Object.entries(categoryAssets).map(async ([id, source]) => {\n const context: AssetLoadContext<Category> = {\n assetMode,\n category,\n id,\n source,\n };\n const handler = handlers[category];\n\n if (handler === undefined) {\n cacheAsset(category, id, source);\n\n return;\n }\n\n const result = await handler.load(context);\n\n cacheAsset(category, id, result.value);\n await result.notifyLoaded?.();\n }),\n );\n }\n\n /** Stores one completed runtime value under its generated category and ID. */\n function cacheAsset(category: AssetCategory, id: string, value: unknown): void {\n // Asset IDs are dictionary keys, including names such as \"__proto__\".\n // A null prototype prevents those names from changing the cache itself.\n const categoryCache: Record<string, unknown> = cache[category] ?? { __proto__: null };\n\n categoryCache[id] = value;\n // Built-in handlers cannot be replaced, so their values retain the fixed\n // category types. Registered handlers and pass-through values stay unknown.\n Object.assign(cache, { [category]: categoryCache });\n }\n\n /** Awaits every observer after all categories in one bundle have loaded. */\n async function notifyBundleLoaded(bundle: AssetBundleName): Promise<void> {\n for (const listener of bundleLoadedListeners[bundle] ?? []) {\n await listener();\n }\n }\n\n /** Awaits every observer registered for one immutable built-in handler. */\n async function notifyLoaded<Category extends BuiltInAssetCategory>(\n category: Category,\n context: AssetLoadedContext<Category>,\n ): Promise<void> {\n for (const listener of loadedListeners[category] ?? []) {\n await listener(context);\n }\n }\n}\n","import type { LocaleDictionary } from '#types/assets.js';\nimport type { AssetLoader } from '#types/loader.js';\nimport type { Localization } from '#types/localization.js';\nimport type { RuntimeLocalizationConfig } from '#types/runtime.js';\n\n/** Retains the generated dictionary when its built-in loader completes. */\nexport function createLocalization(\n config: RuntimeLocalizationConfig,\n loader: AssetLoader,\n): Localization {\n let translations: LocaleDictionary | undefined;\n\n const stopListening = loader.onLoaded('locales', ({ value }) => {\n translations = value;\n stopListening();\n });\n\n return {\n language: config.language,\n\n translate(phrase): string {\n if (translations === undefined) {\n throw new Error('The locale asset must be loaded before translating phrases.');\n }\n\n // Some network test environments lack Object.hasOwn; retain own-key safety.\n const translation = Object.prototype.hasOwnProperty.call(translations, phrase)\n ? translations[phrase]\n : undefined;\n\n if (translation === undefined) {\n throw new Error(\n `Translation ${JSON.stringify(phrase)} was not found in the loaded locale asset.`,\n );\n }\n\n return translation;\n },\n };\n}\n","","","","","","","","","","import type { ModelEntry, ModelEntryScreen } from '@pmndrs/detect-gpu';\n\nimport adrenoData from './benchmarks/m-adreno.json' with { type: 'json' };\nimport appleIpadData from './benchmarks/m-apple-ipad.json' with { type: 'json' };\nimport appleData from './benchmarks/m-apple.json' with { type: 'json' };\nimport intelData from './benchmarks/m-intel.json' with { type: 'json' };\nimport maliTData from './benchmarks/m-mali-t.json' with { type: 'json' };\nimport maliData from './benchmarks/m-mali.json' with { type: 'json' };\nimport nvidiaData from './benchmarks/m-nvidia.json' with { type: 'json' };\nimport powervrData from './benchmarks/m-powervr.json' with { type: 'json' };\nimport samsungData from './benchmarks/m-samsung.json' with { type: 'json' };\n\nconst BENCHMARK_FORMAT_VERSION = '6';\n\n/**\n * Static imports keep every supported mobile dataset inside Replayable's JavaScript bundle.\n * `getGPUTier` supplies one of these exact filenames according to the detected renderer.\n */\nconst benchmarkDataByFilename = {\n 'm-adreno.json': adrenoData,\n 'm-apple-ipad.json': appleIpadData,\n 'm-apple.json': appleData,\n 'm-intel.json': intelData,\n 'm-mali-t.json': maliTData,\n 'm-mali.json': maliData,\n 'm-nvidia.json': nvidiaData,\n 'm-powervr.json': powervrData,\n 'm-samsung.json': samsungData,\n};\n\n/** Loads one bundled benchmark dataset without fetch, URLs, or authored assets. */\nexport function loadLocalBenchmarks(filename: string): Promise<ModelEntry[]> {\n if (!isBenchmarkFilename(filename)) {\n return Promise.reject(new Error(`Unsupported mobile GPU benchmark file: ${filename}`));\n }\n\n return Promise.resolve(parseBenchmarkData(filename, benchmarkDataByFilename[filename]));\n}\n\n/** Removes the dataset marker after confirming its version and entry structure. */\nexport function parseBenchmarkData(filename: string, data: readonly unknown[]): ModelEntry[] {\n const [formatVersion, ...entries] = data;\n\n if (formatVersion !== BENCHMARK_FORMAT_VERSION) {\n throw new Error(\n `Unsupported benchmark format in ${filename}: expected ${BENCHMARK_FORMAT_VERSION}.`,\n );\n }\n\n const modelEntries: ModelEntry[] = [];\n\n for (const entry of entries) {\n if (!isModelEntry(entry)) {\n throw new Error(`Malformed mobile GPU benchmark entry in ${filename}.`);\n }\n\n modelEntries.push(entry);\n }\n\n return modelEntries;\n}\n\n/** Narrows detector-provided strings before indexing the closed dataset map. */\nfunction isBenchmarkFilename(filename: string): filename is keyof typeof benchmarkDataByFilename {\n // Network test environments may lack Object.hasOwn, even with modern targets.\n return Object.prototype.hasOwnProperty.call(benchmarkDataByFilename, filename);\n}\n\n/** Validates the tuple format consumed by `@pmndrs/detect-gpu`. */\nfunction isModelEntry(value: unknown): value is ModelEntry {\n return (\n Array.isArray(value) &&\n value.length === 5 &&\n typeof value[0] === 'string' &&\n typeof value[1] === 'string' &&\n typeof value[2] === 'string' &&\n (value[3] === 0 || value[3] === 1) &&\n Array.isArray(value[4]) &&\n value[4].every(isModelEntryScreen)\n );\n}\n\n/** Validates one benchmark measurement tuple, whose device label may be omitted. */\nfunction isModelEntryScreen(value: unknown): value is ModelEntryScreen {\n return (\n Array.isArray(value) &&\n (value.length === 3 || value.length === 4) &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number' &&\n typeof value[2] === 'number' &&\n (value[3] === undefined || typeof value[3] === 'string')\n );\n}\n","import { getGPUTier } from '@pmndrs/detect-gpu';\n\nimport type { GpuTierDetection, GpuTierDetector } from '#types/gpu.js';\n\nimport { loadLocalBenchmarks } from './load-local-benchmarks.js';\n\nconst MOBILE_USER_AGENT_PATTERN = /Android|iPad|iPhone|iPod/i;\nconst IPAD_USER_AGENT_PATTERN = /iPad/i;\nconst IPAD_DESKTOP_PLATFORM = 'MacIntel';\n\n/**\n * Creates lazy GPU detection without owning a WebGL context.\n *\n * `getGPUTier` creates and releases its intended temporary context internally. Replayable supplies\n * only platform facts and the bundled benchmark loader, ensuring the operation performs no fetch.\n */\nexport function createGpuTierDetector(): GpuTierDetector {\n let detection: Promise<GpuTierDetection> | undefined;\n\n return {\n detect(): Promise<GpuTierDetection> {\n detection ??= detectGpuTier();\n\n return detection;\n },\n };\n}\n\n/** Skips desktop benchmarking and classifies supported mobile platform forms. */\nasync function detectGpuTier(): Promise<GpuTierDetection> {\n const platform = readMobilePlatform(navigator);\n\n if (!platform.mobile) {\n return { device: 'desktop' };\n }\n\n const result = await getGPUTier({\n override: {\n isIpad: platform.ipad,\n isMobile: true,\n loadBenchmarks: loadLocalBenchmarks,\n },\n });\n\n return { device: 'mobile', result };\n}\n\n/** Recognizes mobile user agents and iPads that request their desktop user agent. */\nexport function readMobilePlatform(\n navigatorValue: Pick<Navigator, 'maxTouchPoints' | 'platform' | 'userAgent'>,\n): { readonly ipad: boolean; readonly mobile: boolean } {\n const desktopIpad =\n navigatorValue.platform === IPAD_DESKTOP_PLATFORM && navigatorValue.maxTouchPoints > 1;\n const ipad = IPAD_USER_AGENT_PATTERN.test(navigatorValue.userAgent) || desktopIpad;\n\n return {\n ipad,\n mobile: ipad || MOBILE_USER_AGENT_PATTERN.test(navigatorValue.userAgent),\n };\n}\n","import type { RenderPolicy, GpuTierDetection, GpuTierDetector } from '#types/gpu.js';\n\nconst benchmarkPolicyByTier: Readonly<Record<number, RenderPolicy>> = {\n 0: 'minimal',\n 1: 'reduced',\n 2: 'balanced',\n 3: 'full',\n};\n\n/** Detects and normalizes capability, using a conservative policy when detection throws. */\nexport async function detectRenderPolicy(detector: GpuTierDetector): Promise<RenderPolicy> {\n try {\n return resolveRenderPolicy(await detector.detect());\n } catch {\n return 'reduced';\n }\n}\n\n/** Converts detector-specific output into Replayable's stable named policy. */\nexport function resolveRenderPolicy(detection: unknown): RenderPolicy {\n if (!isGpuTierDetection(detection)) {\n return 'reduced';\n }\n\n if (detection.device === 'desktop') {\n return 'full';\n }\n\n const { result } = detection;\n\n switch (result.type) {\n case 'BLOCKLISTED':\n case 'WEBGL_UNSUPPORTED':\n return 'minimal';\n case 'BENCHMARK':\n return benchmarkPolicyByTier[result.tier] ?? 'reduced';\n case 'BENCHMARK_FETCH_FAILED':\n case 'FALLBACK':\n case 'SSR':\n return 'reduced';\n default:\n return 'reduced';\n }\n}\n\n/** Validates the small detector result surface before policy selection. */\nfunction isGpuTierDetection(value: unknown): value is GpuTierDetection {\n if (typeof value !== 'object' || value === null || !('device' in value)) {\n return false;\n }\n\n if (value.device === 'desktop') {\n return true;\n }\n\n if (value.device !== 'mobile' || !('result' in value)) {\n return false;\n }\n\n const { result } = value;\n\n return (\n typeof result === 'object' &&\n result !== null &&\n 'tier' in result &&\n typeof result.tier === 'number' &&\n 'type' in result &&\n typeof result.type === 'string'\n );\n}\n","import type { RuntimeOrientation, ScreenFrame } from '#types/screen.js';\n\n/**\n * Reads the shell's invisible CSS probe once per screen update, before application\n * resize listeners run. The shared shell combines native insets with Replayable's\n * minimum content margins; applications only consume this cached rectangle.\n * The resulting rectangle is local to the content frame, not device pixels.\n * Backgrounds and renderers continue using the unchanged fullscreen frame.\n */\nexport function measureSafeArea(\n root: HTMLElement,\n frame: ScreenFrame,\n orientation: RuntimeOrientation,\n): ScreenFrame {\n root.dataset.orientation = orientation;\n const style = getComputedStyle(root, '::before');\n const left = readInset(style.paddingLeft);\n const right = readInset(style.paddingRight);\n const top = readInset(style.paddingTop);\n const bottom = readInset(style.paddingBottom);\n\n return {\n x: Math.min(left, frame.width),\n y: Math.min(top, frame.height),\n width: Math.max(0, frame.width - left - right),\n height: Math.max(0, frame.height - top - bottom),\n };\n}\n\n/** Missing shell styles resolve to zero rather than propagating NaN into layout. */\nfunction readInset(value: string): number {\n return Number.parseFloat(value) || 0;\n}\n","import type { GpuTierDetector, RenderPolicy } from '#types/gpu.js';\nimport type {\n RuntimeOrientation,\n RuntimeOrientationConfig,\n RuntimeScreenConfig,\n RuntimeViewport,\n Screen,\n ScreenDesign,\n ScreenFrame,\n} from '#types/screen.js';\n\nimport { createGpuTierDetector } from './gpu/create-gpu-tier-detector.js';\nimport { detectRenderPolicy } from './gpu/resolve-render-policy.js';\nimport { measureSafeArea } from './measure-safe-area.js';\n\n/** Creates the screen state that runtime updates when host dimensions change. */\nexport function createScreen(config: RuntimeScreenConfig, root: HTMLElement): ReplayableScreen {\n return new ReplayableScreen(config, createGpuTierDetector(), root);\n}\n\n/** Owns the latest calculated layout for one playable screen configuration. */\nclass ReplayableScreen implements Screen {\n declare public design: ScreenDesign;\n declare public frame: ScreenFrame;\n declare public safeArea: ScreenFrame;\n declare public orientation: RuntimeOrientation;\n declare public resolution: number;\n declare public scale: number;\n declare public viewport: RuntimeViewport;\n\n private renderPolicy: RenderPolicy | undefined;\n\n public constructor(\n private readonly config: RuntimeScreenConfig,\n private readonly gpuTierDetector: GpuTierDetector,\n private readonly root: HTMLElement,\n ) {}\n\n /** Resolves and caches renderer quality before the host publishes its initial viewport. */\n public async initialize(): Promise<void> {\n this.renderPolicy = await detectRenderPolicy(this.gpuTierDetector);\n }\n\n public readonly update = (viewport: RuntimeViewport): void => {\n if (this.renderPolicy === undefined) {\n throw new Error('Replayable screen must be initialized before it can be updated.');\n }\n\n const orientation = selectOrientation(this.config.orientations, viewport);\n const orientationConfig = this.config.orientations[orientation];\n const frame = createFrame(viewport, orientationConfig);\n\n this.design = {\n width: orientationConfig.width,\n height: orientationConfig.height,\n };\n this.frame = frame;\n this.orientation = orientation;\n this.safeArea = measureSafeArea(this.root, frame, orientation);\n const pixelRatio = clamp(\n window.devicePixelRatio,\n this.config.resolution.pixelRatio.min,\n this.config.resolution.pixelRatio.max,\n );\n\n this.resolution = pixelRatio * this.config.resolution.renderScale[this.renderPolicy];\n this.scale = Math.min(\n frame.width / orientationConfig.width,\n frame.height / orientationConfig.height,\n );\n this.viewport = viewport;\n };\n}\n\n/** Uses viewport orientation when supported, otherwise the enabled alternative. */\nfunction selectOrientation(\n orientations: RuntimeScreenConfig['orientations'],\n viewport: RuntimeViewport,\n): RuntimeOrientation {\n const viewportOrientation: RuntimeOrientation =\n viewport.height >= viewport.width ? 'portrait' : 'landscape';\n\n if (orientations[viewportOrientation].enabled) {\n return viewportOrientation;\n }\n\n if (orientations.portrait.enabled) {\n return 'portrait';\n }\n\n return 'landscape';\n}\n\n/** Creates the largest centered frame allowed by one orientation's ratio range. */\nfunction createFrame(\n viewport: RuntimeViewport,\n orientation: RuntimeOrientationConfig,\n): ScreenFrame {\n const viewportRatio = viewport.width / viewport.height;\n const frameRatio = clamp(viewportRatio, orientation.ratio.min, orientation.ratio.max);\n\n if (viewportRatio > frameRatio) {\n const width = viewport.height * frameRatio;\n\n return {\n x: (viewport.width - width) / 2,\n y: 0,\n width,\n height: viewport.height,\n };\n }\n\n const height = viewport.width / frameRatio;\n\n return {\n x: 0,\n y: (viewport.height - height) / 2,\n width: viewport.width,\n height,\n };\n}\n\n/** Restricts one numeric value to an inclusive range. */\nfunction clamp(value: number, min: number, max: number): number {\n return Math.min(Math.max(value, min), max);\n}\n","import type { ScreenFrame } from '#types/screen.js';\n\n/** Applies the calculated playable frame to its framework-owned container. */\nexport function applyScreenFrame(container: HTMLElement, frame: ScreenFrame): void {\n container.style.left = `${frame.x}px`;\n container.style.top = `${frame.y}px`;\n container.style.width = `${frame.width}px`;\n container.style.height = `${frame.height}px`;\n}\n","/**\n * Prevents browser gestures that interfere with touch-first playable ads.\n *\n * Preventing the default behavior does not stop propagation, so playable input\n * handlers still receive each event.\n */\nexport function installInteractionGuards(root: HTMLElement): void {\n root.addEventListener('contextmenu', preventBrowserBehavior);\n root.addEventListener('selectstart', preventBrowserBehavior);\n root.addEventListener('dragstart', preventBrowserBehavior);\n\n root.addEventListener('touchstart', preventBrowserBehavior, { passive: false });\n root.addEventListener('touchmove', preventBrowserBehavior, { passive: false });\n root.addEventListener('touchend', preventBrowserBehavior, { passive: false });\n}\n\n/** Cancels the browser behavior while allowing the event to keep propagating. */\nfunction preventBrowserBehavior(event: Event): void {\n event.preventDefault();\n}\n","import {\n REPLAYABLE_CONTAINER_ID,\n REPLAYABLE_LOADING_INDICATOR_ID,\n REPLAYABLE_ROOT_ID,\n} from '#shell/index.js';\nimport type { PlayableShell } from '#types/shell.js';\n\n/**\n * Resolves the mount points emitted by Replayable's HTML builder.\n *\n * Keeping this lookup in one place prevents runtime features from independently\n * querying the document or duplicating the framework's element IDs.\n */\nexport function resolvePlayableShell(): PlayableShell {\n return {\n root: requireShellElement(REPLAYABLE_ROOT_ID),\n container: requireShellElement(REPLAYABLE_CONTAINER_ID),\n loadingIndicator: document.getElementById(REPLAYABLE_LOADING_INDICATOR_ID) ?? undefined,\n };\n}\n\n/** Returns one required shell element with an actionable initialization error. */\nfunction requireShellElement(id: string): HTMLElement {\n const element = document.getElementById(id);\n\n if (element === null) {\n throw new Error(`Replayable shell element #${id} was not found.`);\n }\n\n return element;\n}\n","import type {\n CompletionClock,\n CompletionTimerLifecycle,\n RuntimeCompletionConfig,\n} from '#types/completion.js';\nimport type { CompletionTarget, CompletionTimers } from '#types/timers.js';\nimport type { UpdateChannel } from '#types/update.js';\n\n/**\n * Creates the framework-owned duration and inactivity timers for one playable.\n *\n * These are logical clocks, not `setTimeout` calls. They consume visible active\n * time from Replayable's frame scheduler, so neither clock advances while the\n * host reports that the ad is hidden.\n *\n * The clocks have deliberately different policies:\n *\n * - Duration starts when the runtime becomes ready or after the first trusted\n * interaction, depending on the active network profile.\n * - Inactivity always waits for the first trusted interaction and returns to\n * its full configured duration after every later interaction.\n *\n * An interaction may occur while primary assets are still loading. Therefore\n * `start(alreadyInteracted)` receives the current interaction state when runtime\n * readiness is finally reached. If it is `true`, both configured clocks begin\n * immediately rather than waiting for another interaction.\n *\n * When both clocks expire during the same frame, duration wins. This gives one\n * deterministic completion reason without allowing two terminal transitions.\n */\nexport function createCompletionTimers(\n config: RuntimeCompletionConfig,\n activeTime: UpdateChannel<number>,\n target: CompletionTarget,\n): CompletionTimers {\n const durationClock: CompletionClock = {\n remainingSeconds: config.duration,\n running: false,\n };\n const inactivityClock: CompletionClock = {\n remainingSeconds: config.inactivity,\n running: false,\n };\n\n let unsubscribeFromActiveTime: (() => void) | undefined;\n let lifecycle: CompletionTimerLifecycle = 'idle';\n\n return {\n recordActivity,\n recordFirstInteraction,\n start,\n stop,\n };\n\n /** Starts configured clocks when runtime readiness has been reached. */\n function start(alreadyInteracted: boolean): void {\n if (lifecycle !== 'idle') {\n return;\n }\n\n lifecycle = 'active';\n\n if (alreadyInteracted) {\n startDurationClock();\n restartInactivityClock();\n } else if (config.durationStart === 'ready') {\n startDurationClock();\n }\n\n subscribeToActiveTime();\n }\n\n /** Starts the network-gated duration clock after the first interaction. */\n function recordFirstInteraction(): void {\n if (lifecycle !== 'active') {\n return;\n }\n\n if (config.durationStart === 'interaction') {\n startDurationClock();\n subscribeToActiveTime();\n }\n }\n\n /** Starts or resets inactivity after every trusted user activity. */\n function recordActivity(): void {\n if (lifecycle !== 'active') {\n return;\n }\n\n restartInactivityClock();\n subscribeToActiveTime();\n }\n\n /** Permanently releases frame work after the playable has completed. */\n function stop(): void {\n if (lifecycle === 'stopped') {\n return;\n }\n\n lifecycle = 'stopped';\n durationClock.running = false;\n inactivityClock.running = false;\n unsubscribeFromActiveTime?.();\n unsubscribeFromActiveTime = undefined;\n }\n\n /** Starts configured duration without resetting time consumed earlier. */\n function startDurationClock(): void {\n if (durationClock.remainingSeconds !== undefined) {\n durationClock.running = true;\n }\n }\n\n /** Starts or resets inactivity only when that clock was configured. */\n function restartInactivityClock(): void {\n if (config.inactivity === undefined) {\n return;\n }\n\n inactivityClock.remainingSeconds = config.inactivity;\n inactivityClock.running = true;\n }\n\n /** Requests visible frame time only while at least one clock needs it. */\n function subscribeToActiveTime(): void {\n if (!hasRunningClock()) {\n return;\n }\n\n if (unsubscribeFromActiveTime !== undefined) {\n return;\n }\n\n unsubscribeFromActiveTime = activeTime.add(advanceClocks);\n }\n\n /** Advances duration first so it wins when both clocks expire together. */\n function advanceClocks(deltaSeconds: number): void {\n advanceClock(durationClock, deltaSeconds);\n\n if (hasClockExpired(durationClock)) {\n stop();\n target.applyCompletion('duration-timeout');\n return;\n }\n\n advanceClock(inactivityClock, deltaSeconds);\n\n if (hasClockExpired(inactivityClock)) {\n stop();\n target.applyCompletion('inactivity-timeout');\n }\n }\n\n /** Reports whether the shared active-time subscription is currently useful. */\n function hasRunningClock(): boolean {\n return durationClock.running || inactivityClock.running;\n }\n}\n\n/** Subtracts visible elapsed time from one running logical clock. */\nfunction advanceClock(clock: CompletionClock, deltaSeconds: number): void {\n if (!clock.running || clock.remainingSeconds === undefined) {\n return;\n }\n\n clock.remainingSeconds -= deltaSeconds;\n}\n\n/** Reports whether one running logical clock has reached its deadline. */\nfunction hasClockExpired(clock: CompletionClock): boolean {\n return clock.running && clock.remainingSeconds !== undefined && clock.remainingSeconds <= 0;\n}\n","import type { InactivityTimerOptions, ManagedInactivityTimer } from '#types/timers.js';\nimport type { UpdateChannel } from '#types/update.js';\n\n/**\n * Creates one application-owned inactivity timer on Replayable's visible-time\n * clock. The timer begins stopped, consumes frame time only while running, and\n * returns to its full duration after every trusted activity.\n */\nexport function createInactivityTimer(\n options: InactivityTimerOptions,\n activeTime: UpdateChannel<number>,\n activeTimers: Set<ManagedInactivityTimer>,\n): ManagedInactivityTimer {\n const { duration, onTimeout } = options;\n\n if (!Number.isFinite(duration) || duration <= 0) {\n throw new Error('Inactivity timer duration must be a positive finite number of seconds.');\n }\n\n let remainingSeconds = duration;\n let unsubscribeFromActiveTime: (() => void) | undefined;\n\n const timer: ManagedInactivityTimer = {\n resetForActivity,\n restart,\n start,\n stop,\n };\n\n return timer;\n\n /** Starts once without resetting a timer that is already running. */\n function start(): void {\n if (unsubscribeFromActiveTime !== undefined) {\n return;\n }\n\n remainingSeconds = duration;\n activeTimers.add(timer);\n unsubscribeFromActiveTime = activeTime.add(advance);\n }\n\n /** Resets the full duration and starts the timer when necessary. */\n function restart(): void {\n if (unsubscribeFromActiveTime === undefined) {\n start();\n return;\n }\n\n remainingSeconds = duration;\n }\n\n /** Restores the full duration only while this timer is running. */\n function resetForActivity(): void {\n if (unsubscribeFromActiveTime !== undefined) {\n remainingSeconds = duration;\n }\n }\n\n /** Stops the timer and releases its visible-time subscription. */\n function stop(): void {\n if (unsubscribeFromActiveTime === undefined) {\n return;\n }\n\n unsubscribeFromActiveTime();\n unsubscribeFromActiveTime = undefined;\n activeTimers.delete(timer);\n remainingSeconds = duration;\n }\n\n /** Stops before application code runs so `onTimeout` may safely restart it. */\n function advance(deltaSeconds: number): void {\n // A previous callback may stop this timer while the channel still holds\n // its current dispatch snapshot. That final delivery must do no work.\n if (unsubscribeFromActiveTime === undefined) {\n return;\n }\n\n remainingSeconds -= deltaSeconds;\n\n if (remainingSeconds > 0) {\n return;\n }\n\n stop();\n onTimeout();\n }\n}\n","import type { UpdateChannel } from '#types/update.js';\n\n/**\n * Resolves after the requested amount of Replayable active time has elapsed.\n *\n * Unlike a browser timeout, the delay advances only while the host reports the\n * playable as visible. Its temporary clock subscription is removed before the\n * promise resolves, so a completed delay leaves no frame-scheduling work.\n *\n * @example Keep a solved puzzle visible for seven tenths of an active second.\n *\n * await playable.timers.delay(0.7);\n * showEndCard();\n */\nexport function delay(duration: number, activeTime: UpdateChannel<number>): Promise<void> {\n if (!Number.isFinite(duration) || duration < 0) {\n throw new Error('Delay duration must be a non-negative finite number of seconds.');\n }\n\n if (duration === 0) {\n return Promise.resolve();\n }\n\n return new Promise((resolve) => {\n let remaining = duration;\n const removeActiveTimeListener = activeTime.add(advanceDelay);\n\n /** Accumulates visible frame time until this one-shot delay is complete. */\n function advanceDelay(deltaSeconds: number): void {\n remaining -= deltaSeconds;\n\n if (remaining > 0) {\n return;\n }\n\n removeActiveTimeListener();\n resolve();\n }\n });\n}\n","import { createCompletionTimers } from '#completion/create-completion-timers.js';\nimport { createInactivityTimer } from '#timers/create-inactivity-timer.js';\nimport { delay } from '#timers/delay.js';\nimport type { RuntimeCompletionConfig } from '#types/completion.js';\nimport type {\n TimerController,\n CompletionTarget,\n CompletionTimers,\n InactivityTimer,\n InactivityTimerOptions,\n ManagedInactivityTimer,\n PlayableTimers,\n} from '#types/timers.js';\nimport type { UpdateChannel } from '#types/update.js';\n\n/**\n * Creates Replayable's timer subsystem around one shared visible-time clock.\n *\n * The returned public timers begin stopped and subscribe independently while\n * running, so creating a timer has no frame cost. The internal completion\n * factory delegates terminal policy to its dedicated implementation without\n * exposing that policy through `playable.timers`. Trusted activity resets only\n * active inactivity timers; stopped timers retain no elapsed inactivity.\n *\n * @example Display a hint after three inactive seconds.\n *\n * ```ts\n * const hintTimer = playable.timers.createInactivityTimer({\n * duration: 3,\n * onTimeout: showHint,\n * });\n *\n * hintTimer.start();\n * ```\n */\nexport function createTimers(activeTime: UpdateChannel<number>): TimerController {\n const activeTimers = new Set<ManagedInactivityTimer>();\n const timers: PlayableTimers = {\n delay(duration): Promise<void> {\n return delay(duration, activeTime);\n },\n\n createInactivityTimer(options: InactivityTimerOptions): InactivityTimer {\n return createInactivityTimer(options, activeTime, activeTimers);\n },\n };\n\n return {\n timers,\n createCompletion,\n recordActivity,\n };\n\n /** Creates framework-owned completion clocks on the shared visible-time channel. */\n function createCompletion(\n config: RuntimeCompletionConfig,\n target: CompletionTarget,\n ): CompletionTimers {\n return createCompletionTimers(config, activeTime, target);\n }\n\n /** Restores every running public inactivity timer after trusted activity. */\n function recordActivity(): void {\n for (const timer of activeTimers) {\n timer.resetForActivity();\n }\n }\n}\n","/**\n * Duration of every fixed simulation step, measured in seconds.\n *\n * A 60 Hz step matches the conventional update frequency expected by the\n * physics engines that Replayable integrations will drive.\n */\nexport const FIXED_DELTA_SECONDS = 1 / 60;\n\n/**\n * Maximum number of fixed steps that may run during one rendered frame.\n *\n * Limiting catch-up prevents one slow browser frame from creating an unbounded\n * backlog of simulation work—the usual fixed-timestep \"spiral of death.\"\n */\nexport const MAX_FIXED_UPDATES_PER_FRAME = 5;\n\n/**\n * Maximum active gameplay time exposed by one variable update.\n *\n * Keeping this equal to the fixed catch-up budget means rendering and fixed\n * simulation can advance by at most the same 5/60 seconds after a frame stall.\n */\nexport const MAX_UPDATE_DELTA_SECONDS = FIXED_DELTA_SECONDS * MAX_FIXED_UPDATES_PER_FRAME;\n","import type { FixedStepAccumulator, FixedUpdateContext } from '#types/update.js';\nimport { FIXED_DELTA_SECONDS, MAX_FIXED_UPDATES_PER_FRAME } from '#update/constants.js';\n\n// Every callback receives the same immutable-by-contract value. Reusing it\n// avoids allocating an identical context for every simulation step.\nconst FIXED_UPDATE_CONTEXT: FixedUpdateContext = {\n deltaSeconds: FIXED_DELTA_SECONDS,\n};\n\n/**\n * Creates a bounded fixed-timestep accumulator.\n *\n * Rendered frames and simulation steps are intentionally independent. A fast\n * frame may produce no fixed step, while a slow frame may produce several. If\n * more than five steps are due, the accumulator drops the excess complete\n * steps after preserving the fractional progress needed for interpolation.\n *\n * With a 1/60-second fixed step:\n *\n * - a 1/120-second frame adds half a step and invokes no update;\n * - the next 1/120-second frame completes and invokes one update;\n * - a 1/30-second frame normally invokes two updates;\n * - a 200 ms stall owes roughly twelve updates, but invokes at most five and\n * drops the remaining complete debt to prevent a spiral of death.\n */\nexport function createFixedStepAccumulator(): FixedStepAccumulator {\n // Only time not yet represented by a delivered simulation step is retained.\n let accumulatedSeconds = 0;\n\n return {\n advance(deltaSeconds, update): number {\n // Browser frames contribute real elapsed time even when they are faster\n // or slower than the fixed simulation frequency.\n accumulatedSeconds += deltaSeconds;\n\n // Whole fixed intervals are ready for simulation. Any fractional interval\n // remains in accumulatedSeconds and later becomes render interpolation.\n const pendingUpdates = Math.floor(accumulatedSeconds / FIXED_DELTA_SECONDS);\n const panicked = pendingUpdates > MAX_FIXED_UPDATES_PER_FRAME;\n const updatesToRun = Math.min(pendingUpdates, MAX_FIXED_UPDATES_PER_FRAME);\n\n // Reserve every permitted step before invoking consumer code. A callback\n // may remove the final listener, causing its owner to clear this\n // accumulator while the loop is still executing. Subtracting up front\n // prevents that clear from being followed by further negative deductions.\n accumulatedSeconds -= updatesToRun * FIXED_DELTA_SECONDS;\n\n // One slow browser frame may therefore produce several equal simulation\n // updates. All receive 1/60 second rather than a share of the frame delta.\n for (let updateIndex = 0; updateIndex < updatesToRun; updateIndex += 1) {\n update(FIXED_UPDATE_CONTEXT);\n }\n\n // After a panic, accumulatedSeconds still contains the complete steps we\n // deliberately refused to run plus a possible fractional step. Modulo\n // drops only that complete debt and preserves the fraction for smooth\n // rendering. For example, 7.25 remaining steps become 0.25.\n if (panicked) {\n accumulatedSeconds %= FIXED_DELTA_SECONDS;\n }\n\n // Dividing the remaining seconds by one fixed interval normalizes the\n // value for rendering: 0 is a boundary and 0.5 is halfway to the next.\n return accumulatedSeconds / FIXED_DELTA_SECONDS;\n },\n\n clearPendingTime(): void {\n // Completed updates already changed consumer state and cannot be undone;\n // only the not-yet-simulated fractional time is stored here.\n accumulatedSeconds = 0;\n },\n };\n}\n","import type { UpdateListener, UpdateChannelController } from '#types/update.js';\n\n/**\n * Creates a copy-on-write subscription channel optimized for frequent dispatch.\n *\n * Adding and removing are relatively rare, so they replace the retained array.\n * Frame dispatch is frequent, so it iterates the existing array without cloning\n * it. Replacing instead of mutating means an in-progress dispatch keeps a stable\n * snapshot even when one of its listeners changes the channel.\n *\n * For example, if listeners A and B begin a dispatch and A removes B, B still\n * receives that current value. The next dispatch contains only A. Likewise, a\n * listener added by A begins receiving values on the next dispatch.\n *\n * Registering the same function twice follows `EventTarget`-style semantics:\n * the second registration is ignored. Removal functions are idempotent.\n * `onActivityChange` runs only for empty-to-active and active-to-empty\n * transitions, allowing the runtime to reevaluate frame scheduling without\n * reacting to every intermediate listener count.\n */\nexport function createUpdateChannel<Context>(\n onActivityChange: () => void,\n): UpdateChannelController<Context> {\n let listeners: readonly UpdateListener<Context>[] = [];\n\n return {\n add(listener): () => void {\n // Duplicate registration must not produce duplicate updates or a second\n // removal handle for the same logical subscription.\n if (listeners.includes(listener)) {\n return doNothing;\n }\n\n const wasEmpty = listeners.length === 0;\n let subscribed = true;\n\n // Copy-on-write preserves any array currently being dispatched.\n listeners = [...listeners, listener];\n\n // Only the first listener changes scheduler demand from inactive to active.\n if (wasEmpty) {\n onActivityChange();\n }\n\n return (): void => {\n // A caller may safely retain and invoke the removal function repeatedly.\n if (!subscribed) {\n return;\n }\n\n subscribed = false;\n // Copy-on-write also means removal cannot shorten an active iteration.\n listeners = listeners.filter((registeredListener) => registeredListener !== listener);\n\n // Intermediate removals need no scheduler work while another listener remains.\n if (listeners.length === 0) {\n onActivityChange();\n }\n };\n },\n\n dispatch(context): void {\n // `listeners` is evaluated once when iteration starts. Reassignments made\n // by callbacks therefore affect future dispatches, not this snapshot.\n for (const listener of listeners) {\n listener(context);\n }\n },\n\n hasListeners(): boolean {\n return listeners.length > 0;\n },\n };\n}\n\n/** Stable no-op removal result for an ignored duplicate registration. */\nfunction doNothing(): void {}\n","import type { FixedUpdate, FixedUpdateContext } from '#types/update.js';\nimport { createFixedStepAccumulator } from '#update/create-fixed-step-accumulator.js';\nimport { createUpdateChannel } from '#update/create-update-channel.js';\n\n/**\n * Creates the fixed channel together with its bounded timestep accumulator.\n *\n * At 120 rendered frames per second, two ideal calls demonstrate the boundary:\n *\n * 1. `advance(1 / 120)` dispatches nothing and returns `0.5`;\n * 2. `advance(1 / 120)` dispatches one `1 / 60` update and returns `0`.\n *\n * `onActivityChange` runs when the channel gains its first listener or loses its\n * last listener, allowing the runtime to synchronize frame scheduling.\n */\nexport function createFixedUpdate(onActivityChange: () => void): FixedUpdate {\n const accumulator = createFixedStepAccumulator();\n const channel = createUpdateChannel<FixedUpdateContext>(onActivityChange);\n\n return {\n channel,\n\n advance(deltaSeconds): number {\n // Time that passes without a fixed listener must not be remembered. A\n // later subscriber starts from the current frame instead of receiving\n // simulation work accumulated before it existed.\n if (!channel.hasListeners()) {\n accumulator.clearPendingTime();\n return 0;\n }\n\n // The accumulator may invoke dispatch zero, one, or several times. Its\n // return value is the incomplete fraction left after all due fixed steps.\n const interpolation = accumulator.advance(deltaSeconds, dispatch);\n\n // The final listener may remove itself from inside a fixed update. Clear\n // the remaining fraction so resubscribing later cannot continue timing\n // that belonged to a channel with no consumers.\n if (!channel.hasListeners()) {\n accumulator.clearPendingTime();\n return 0;\n }\n\n return interpolation;\n },\n\n clearPendingTime(): void {\n // Visibility pauses call this explicitly even while listeners remain.\n accumulator.clearPendingTime();\n },\n\n hasListeners(): boolean {\n return channel.hasListeners();\n },\n };\n\n /** Keeps the accumulator independent from the channel controller it drives. */\n function dispatch(context: FixedUpdateContext): void {\n channel.dispatch(context);\n }\n}\n","import { cancelFrame, frame, type FrameData } from 'motion';\n\nimport type { FrameUpdateCallback, FrameScheduler } from '#types/update.js';\n\nconst MILLISECONDS_PER_SECOND = 1000;\n\n/**\n * Creates the sole requestAnimationFrame scheduler used by Replayable.\n *\n * Motion's own delta is intentionally ignored because Motion clamps it. The\n * difference between consecutive timestamps retains the real elapsed time\n * required by fixed-step catch-up and panic handling.\n */\nexport function createFrameScheduler(\n update: FrameUpdateCallback,\n postRender: (timestamp: number) => void,\n): FrameScheduler {\n let previousTimestamp = 0;\n let running = false;\n let postRenderPending = false;\n\n return {\n start(): void {\n if (running) {\n return;\n }\n\n running = true;\n frame.update(initializeFrameLoop);\n },\n\n stop(): void {\n if (!running) {\n return;\n }\n\n running = false;\n postRenderPending = false;\n cancelFrame(initializeFrameLoop);\n cancelFrame(updateFrame);\n cancelFrame(deliverPostRender);\n },\n };\n\n /**\n * Establishes a fresh timestamp baseline before persistent delivery begins.\n *\n * This separate first frame ensures time spent stopped—while hidden, not yet\n * ready, or without listeners—never becomes the next frame's delta. The zero\n * update gives variable listeners an initial render opportunity without\n * advancing animation or fixed simulation time.\n */\n function initializeFrameLoop({ timestamp }: FrameData): void {\n if (!running) {\n return;\n }\n previousTimestamp = timestamp;\n frame.update(updateFrame, true);\n update(0);\n if (running) {\n postRenderPending = true;\n frame.postRender(deliverPostRender);\n }\n }\n\n /** Converts Motion's millisecond timestamp into one elapsed duration in seconds. */\n function updateFrame({ timestamp }: FrameData): void {\n if (!running) {\n return;\n }\n const deltaSeconds = (timestamp - previousTimestamp) / MILLISECONDS_PER_SECOND;\n\n previousTimestamp = timestamp;\n update(deltaSeconds);\n if (running) {\n postRenderPending = true;\n frame.postRender(deliverPostRender);\n }\n }\n\n /** Stops also invalidate callbacks already in Motion's processing snapshot. */\n function deliverPostRender({ timestamp }: FrameData): void {\n if (running && postRenderPending) {\n postRenderPending = false;\n postRender(timestamp);\n }\n }\n}\n","import type { FrameUpdate, UpdateContext } from '#types/update.js';\nimport { MAX_UPDATE_DELTA_SECONDS } from '#update/constants.js';\nimport { createUpdateChannel } from '#update/create-update-channel.js';\n\n/**\n * Creates the variable update output independently from frame scheduling.\n *\n * A normal 60 FPS frame exposes roughly `0.0167` seconds. After a 200 ms stall,\n * the exposed delta is capped at five fixed steps—roughly `0.0833` seconds—so\n * visual animation cannot make one extreme jump. Fixed simulation receives the\n * real elapsed duration separately and performs its own bounded catch-up.\n *\n * `fixedInterpolation` is forwarded unchanged because the fixed accumulator,\n * not this channel, owns the remaining simulation fraction.\n * `onActivityChange` notifies the runtime when the first listener appears or the\n * last listener disappears so scheduling remains demand-driven.\n */\nexport function createFrameUpdate(onActivityChange: () => void): FrameUpdate {\n const channel = createUpdateChannel<UpdateContext>(onActivityChange);\n\n return {\n channel,\n\n advance(deltaSeconds, fixedInterpolation): void {\n // Avoid constructing an UpdateContext on frames with no consumers. This\n // path is also used when only fixed simulation has listeners.\n if (!channel.hasListeners()) {\n return;\n }\n\n // `deltaSeconds` is the real time since the previous active browser\n // frame. It can become unusually large when an ad SDK or application\n // task blocks the main thread, garbage collection takes a long time, or\n // the browser delays an otherwise active frame. Passing that full\n // duration to animation code could move an object a large distance in a\n // single frame and make tweens appear to teleport. Hidden time is not a\n // source of large deltas here: visibility changes stop the scheduler,\n // and restarting it establishes a new timestamp baseline.\n //\n // Cap gameplay time to the same five-step budget used by fixed\n // simulation. For example, a 500 ms browser stall is reported to update\n // listeners as roughly 83 ms (`5 * 1/60`) rather than 500 ms. The excess\n // time is intentionally discarded: gameplay briefly slows down instead\n // of attempting an unsafe visual catch-up. Code that needs actual\n // wall-clock time, such as analytics or deadlines, should read\n // `performance.now()` rather than accumulate this clamped value.\n channel.dispatch({\n deltaSeconds: Math.min(deltaSeconds, MAX_UPDATE_DELTA_SECONDS),\n fixedInterpolation,\n });\n },\n\n hasListeners(): boolean {\n return channel.hasListeners();\n },\n };\n}\n","import type { RuntimeUpdates, PostRenderContext } from '#types/update.js';\nimport { createFixedUpdate } from '#update/create-fixed-update.js';\nimport { createFrameScheduler } from '#update/create-frame-scheduler.js';\nimport { createFrameUpdate } from '#update/create-frame-update.js';\nimport { createUpdateChannel } from '#update/create-update-channel.js';\n\n/**\n * Coordinates simulation and post-render delivery around one frame scheduler.\n *\n * Every Motion frame first advances internal lifecycle clocks, then fixed\n * simulation. Fixed interpolation accompanies the single variable update\n * rendered for that browser frame. Frame delivery is demand-driven: it begins\n * only after the runtime is ready, visible, and a timer or update listener\n * requires elapsed time. Post-render listeners also keep frames active and receive\n * the shared timestamp after Motion finishes its render phase.\n *\n * For example, registering a listener before `markReady()` does not start the\n * scheduler. If the host is already visible, `markReady()` starts it. Removing\n * the last listener or calling `setVisible(false)` stops it and discards any\n * partial fixed step so paused time cannot leak into a later frame.\n */\nexport function createRuntimeUpdates(): RuntimeUpdates {\n const activeTime = createUpdateChannel<number>(updateScheduler);\n const fixedUpdate = createFixedUpdate(updateScheduler);\n const frameUpdate = createFrameUpdate(updateScheduler);\n const postRender = createUpdateChannel<PostRenderContext>(updateScheduler);\n const scheduler = createFrameScheduler(handleFrame, handlePostRender);\n\n let ready = false;\n let visible = false;\n\n return {\n activeTime,\n fixedUpdate: fixedUpdate.channel,\n update: frameUpdate.channel,\n postRender,\n\n markReady(): void {\n ready = true;\n updateScheduler();\n },\n\n setVisible(nextVisible): void {\n visible = nextVisible;\n updateScheduler();\n },\n };\n\n /**\n * Advances lifecycle clocks and simulation before the variable frame update.\n *\n * For example, a frame carrying roughly 1/30 second may produce two 1/60\n * fixed updates followed by one variable update. The variable update receives\n * the accumulator's remaining fractional progress for render interpolation.\n */\n function handleFrame(deltaSeconds: number): void {\n activeTime.dispatch(deltaSeconds);\n\n const fixedInterpolation = fixedUpdate.advance(deltaSeconds);\n\n frameUpdate.advance(deltaSeconds, fixedInterpolation);\n }\n\n /** Renderers remain independent; only the shared Motion phase determines ordering. */\n function handlePostRender(timestamp: number): void {\n if (postRender.hasListeners()) {\n postRender.dispatch({ timestamp });\n }\n }\n\n /**\n * Makes scheduler activity match the runtime lifecycle and listener demand.\n *\n * Examples:\n *\n * - ready + visible + an update listener: start or remain running;\n * - not ready, hidden, or no listeners: stop and clear partial fixed time.\n *\n * `FrameScheduler` owns start/stop idempotence, so this function can state the\n * policy directly without tracking another copy of its running state.\n */\n function updateScheduler(): void {\n const hasListeners =\n activeTime.hasListeners() ||\n frameUpdate.hasListeners() ||\n fixedUpdate.hasListeners() ||\n postRender.hasListeners();\n\n if (ready && visible && hasListeners) {\n scheduler.start();\n return;\n }\n\n scheduler.stop();\n fixedUpdate.clearPendingTime();\n }\n}\n","import { createAudio } from '#audio';\nimport { createRuntimeState } from '#lifecycle/create-runtime-state.js';\nimport { observeUserActivity } from '#lifecycle/interaction.js';\nimport { createAssetLoader } from '#loader/create-asset-loader.js';\nimport { createLocalization } from '#localization/create-localization.js';\nimport { createScreen } from '#screen/create-screen.js';\nimport { applyScreenFrame } from '#shell/apply-screen-frame.js';\nimport { installInteractionGuards } from '#shell/install-interaction-guards.js';\nimport { resolvePlayableShell } from '#shell/resolve-playable-shell.js';\nimport { createTimers } from '#timers/create-timers.js';\nimport type { PlayableCompletionReason } from '#types/completion.js';\nimport type { CreateRuntimeOptions } from '#types/lifecycle.js';\nimport type {\n Playable,\n RuntimeEventListener,\n RuntimeEventMap,\n RuntimeState,\n} from '#types/runtime.js';\nimport { createRuntimeUpdates } from '#update/create-runtime-updates.js';\n\n/**\n * Creates the public runtime around one concrete host adapter.\n *\n * Host-specific facts enter through the adapter, the state controller applies\n * Replayable lifecycle policy, and this function owns their shared readiness.\n */\nexport function createRuntime({ adapter, assets, definition }: CreateRuntimeOptions): Playable {\n const { assetMode, config, storeUrl } = definition;\n const shell = resolvePlayableShell();\n const loader = createAssetLoader(assets, assetMode);\n const runtimeState = createRuntimeState(config);\n const screen = createScreen(config.screen, shell.root);\n const localization = createLocalization(config.localization, loader);\n const audio = createAudio(loader);\n const runtimeUpdates = createRuntimeUpdates();\n const timerController = createTimers(runtimeUpdates.activeTime);\n const completionTimers = timerController.createCompletion(config.completion, runtimeState);\n let readiness: Promise<void> | undefined;\n let runtimeReady = false;\n\n installInteractionGuards(shell.root);\n runtimeState.on('audiochange', handleAudioChange);\n runtimeState.on('complete', handleCompletion);\n runtimeState.on('interaction', handleFirstInteraction);\n runtimeState.on('resize', handleResize);\n runtimeState.on('visibilitychange', handleVisibilityChange);\n\n return {\n ready,\n config,\n\n get state(): RuntimeState {\n return requireRuntimeState();\n },\n\n container: shell.container,\n screen,\n loader,\n localization,\n audio,\n timers: timerController.timers,\n\n update: runtimeUpdates.update,\n fixedUpdate: runtimeUpdates.fixedUpdate,\n postRender: runtimeUpdates.postRender,\n on,\n\n complete,\n openStore,\n };\n\n /** Initializes the runtime once and returns the same promise to every caller. */\n function ready(): Promise<void> {\n readiness ??= initializeRuntime();\n\n return readiness;\n }\n\n /** Returns lifecycle state only after runtime initialization has completed. */\n function requireRuntimeState(): RuntimeState {\n if (!runtimeReady) {\n throw new Error('Replayable runtime is not ready. Await playable.ready() first.');\n }\n\n return runtimeState.get();\n }\n\n /** Subscribes to one normalized runtime lifecycle event. */\n function on<Event extends keyof RuntimeEventMap>(\n event: Event,\n listener: RuntimeEventListener<Event>,\n ): () => void {\n return runtimeState.on(event, listener);\n }\n\n /** Commits the playable's terminal outcome after initialization. */\n function complete(reason: PlayableCompletionReason): void {\n if (!runtimeReady) {\n throw new Error('Cannot complete the playable before await playable.ready().');\n }\n\n runtimeState.applyCompletion(reason);\n }\n\n /** Opens the platform-specific store destination through the active host. */\n function openStore(): void {\n adapter.openStore(storeUrl);\n }\n\n /** Resolves host and screen capability concurrently, then loads startup assets. */\n async function initializeRuntime(): Promise<void> {\n const [snapshot] = await Promise.all([\n adapter.initialize(runtimeState.applyHostUpdate),\n screen.initialize(),\n ]);\n\n runtimeUpdates.setVisible(snapshot.visible);\n runtimeState.initialize(snapshot);\n handleAudioChange(runtimeState.get().audio);\n observeUserActivity(handleUserActivity);\n\n await loader.load('primary');\n\n shell.loadingIndicator?.remove();\n runtimeReady = true;\n adapter.notifyReady?.();\n completionTimers.start(runtimeState.get().interacted);\n runtimeUpdates.markReady();\n }\n\n /** Keeps the selected audio implementation aligned with effective runtime state. */\n function handleAudioChange(state: RuntimeState['audio']): void {\n audio.update(state);\n }\n\n /** Stops automatic timer work after either manual or automatic completion. */\n function handleCompletion(): void {\n completionTimers.stop();\n adapter.notifyComplete?.();\n }\n\n /** Applies one-time policies while the first interaction owns user activation. */\n function handleFirstInteraction(): void {\n audio.unlock();\n completionTimers.recordFirstInteraction();\n }\n\n /** Publishes first interaction when necessary and resets activity-driven timers. */\n function handleUserActivity(): void {\n runtimeState.applyFirstInteraction();\n completionTimers.recordActivity();\n timerController.recordActivity();\n }\n\n /** Updates engine-neutral screen state before applying its frame to the DOM shell. */\n function handleResize(viewport: RuntimeState['viewport']): void {\n screen.update(viewport);\n applyScreenFrame(shell.container, screen.frame);\n }\n\n /** Keeps frame scheduling aligned with the host's normalized viewability. */\n function handleVisibilityChange(visible: boolean): void {\n audio.setVisible(visible);\n runtimeUpdates.setVisible(visible);\n }\n}\n","import { createAdapter } from '#adapter';\nimport { assets } from '#assets';\nimport { definition } from '#definition';\nimport { createRuntime } from '#lifecycle/create-runtime.js';\nimport type { Playable } from '#types/runtime.js';\n\n/** Public facade for the playable currently running in the browser. */\nexport const playable: Playable = createRuntime({\n adapter: createAdapter(),\n assets,\n definition,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;AAUA,SAAgB,kBACd,SACA,YACA,SACA,QACmB;CACnB,OAAO;EACL,SAAS,WAAW,cAAc,WAAW,SAAS;EACtD;CACF;AACF;;AAGA,SAAgB,mBAAmB,MAAyB,OAAmC;CAC7F,OAAO,KAAK,YAAY,MAAM,WAAW,KAAK,WAAW,MAAM;AACjE;;;;;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AM,OAAO,KAAK;CACpB;;CAGA,SAAS,mBAAyB;EAChC,iBAAiB,KAAK;EACtB,QAAQ,iBAAiB;CAC3B;;CAGA,SAAS,yBAA+B;EACtC,MAAM,OAAO;EACb,iBAAiB,uBAAuB;CAC1C;;CAGA,SAAS,qBAA2B;EAClC,aAAa,sBAAsB;EACnC,iBAAiB,eAAe;EAChC,gBAAgB,eAAe;CACjC;;CAGA,SAAS,aAAa,UAA0C;EAC9D,OAAO,OAAO,QAAQ;EACtB,iBAAiB,MAAM,WAAW,OAAO,KAAK;CAChD;;CAGA,SAAS,uBAAuB,SAAwB;EACtD,MAAM,WAAW,OAAO;EACxB,eAAe,WAAW,OAAO;CACnC;AACF;;;;AC9JA,MAAa,WAAqB,cAAc;CAC9C,SAAS,cAAc;CACvB;CACA;AACF,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { h as LocaleDictionary, i as AssetSourceByCategory, n as AssetCategory, r as AssetMode, t as AssetBundleName } from "./assets-BD68MQTL.js";
|
|
2
|
+
//#region src/types/loader.d.ts
|
|
3
|
+
/** Categories whose loading behavior is owned by Replayable. */
|
|
4
|
+
type BuiltInAssetCategory = 'fonts' | 'locales' | 'shaders';
|
|
5
|
+
/** Categories whose loading behavior may be supplied by a rendering integration. */
|
|
6
|
+
type RegisteredAssetCategory = Exclude<AssetCategory, BuiltInAssetCategory>;
|
|
7
|
+
/** Shader source pair after both generated files have been loaded as text. */
|
|
8
|
+
interface LoadedShaderAsset {
|
|
9
|
+
readonly frag: string;
|
|
10
|
+
readonly vert: string;
|
|
11
|
+
}
|
|
12
|
+
/** Completed runtime value produced by each immutable built-in handler. */
|
|
13
|
+
interface BuiltInAssetValueByCategory {
|
|
14
|
+
readonly fonts: FontFace;
|
|
15
|
+
readonly locales: LocaleDictionary;
|
|
16
|
+
readonly shaders: LoadedShaderAsset;
|
|
17
|
+
}
|
|
18
|
+
/** One generated asset before category-specific runtime transformation. */
|
|
19
|
+
interface AssetLoadContext<Category extends AssetCategory> {
|
|
20
|
+
/** Build-selected representation used by generated physical files. */
|
|
21
|
+
readonly assetMode: AssetMode;
|
|
22
|
+
readonly category: Category;
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly source: AssetSourceByCategory[Category];
|
|
25
|
+
}
|
|
26
|
+
/** Transforms one category's generated source into its cached runtime value. */
|
|
27
|
+
type AssetLoadHandler<Category extends AssetCategory, Value = unknown> = (context: AssetLoadContext<Category>) => Promise<Value>;
|
|
28
|
+
/** One built-in asset after Replayable's category handler has completed. */
|
|
29
|
+
interface AssetLoadedContext<Category extends BuiltInAssetCategory> extends AssetLoadContext<Category> {
|
|
30
|
+
readonly value: BuiltInAssetValueByCategory[Category];
|
|
31
|
+
}
|
|
32
|
+
/** Observes the completed value produced by one immutable built-in handler. */
|
|
33
|
+
type AssetLoadedListener<Category extends BuiltInAssetCategory> = (context: AssetLoadedContext<Category>) => void | Promise<void>;
|
|
34
|
+
/** Observes completion of one bundle load initiated elsewhere. */
|
|
35
|
+
type AssetBundleLoadedListener = () => void | Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Built-in loaders have fixed return types. Integration-owned categories remain
|
|
38
|
+
* unknown because runtime does not know their renderer-specific objects.
|
|
39
|
+
*/
|
|
40
|
+
type AssetValueByCategory = BuiltInAssetValueByCategory & Record<RegisteredAssetCategory, unknown>;
|
|
41
|
+
/** Completed values by category and ID; unloaded categories and IDs may be absent. */
|
|
42
|
+
type AssetCache = { readonly [Category in AssetCategory]?: Readonly<Record<string, AssetValueByCategory[Category]>>; };
|
|
43
|
+
/** Public contract for loading generated asset bundles into the runtime cache. */
|
|
44
|
+
interface AssetLoader {
|
|
45
|
+
/** Assets that completed their category-specific runtime loading. */
|
|
46
|
+
readonly cache: AssetCache;
|
|
47
|
+
/**
|
|
48
|
+
* Loads a bundle once, including completion observers. Repeated calls share
|
|
49
|
+
* the same promise, including a retained failure; this is not a reload API.
|
|
50
|
+
*/
|
|
51
|
+
load(bundle: AssetBundleName): Promise<void>;
|
|
52
|
+
/** Observes completion after every asset in one bundle has loaded. */
|
|
53
|
+
onBundleLoaded(bundle: AssetBundleName, listener: AssetBundleLoadedListener): () => void;
|
|
54
|
+
/** Observes values produced by Replayable's immutable built-in handlers. */
|
|
55
|
+
onLoaded<Category extends BuiltInAssetCategory>(category: Category, listener: AssetLoadedListener<Category>): () => void;
|
|
56
|
+
/** Installs the exclusive transformation handler for one asset category. */
|
|
57
|
+
register<Category extends RegisteredAssetCategory>(category: Category, handler: AssetLoadHandler<Category>): () => void;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
export { AssetLoadedContext as a, BuiltInAssetCategory as c, RegisteredAssetCategory as d, AssetLoadHandler as i, BuiltInAssetValueByCategory as l, AssetCache as n, AssetLoadedListener as o, AssetLoadContext as r, AssetLoader as s, AssetBundleLoadedListener as t, LoadedShaderAsset as u };
|
|
61
|
+
//# sourceMappingURL=loader-Czz-x3KH.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//#region src/types/screen.d.ts
|
|
2
|
+
/** Inclusive numeric bounds already validated by project configuration. */
|
|
3
|
+
interface RuntimeRange {
|
|
4
|
+
readonly max: number;
|
|
5
|
+
readonly min: number;
|
|
6
|
+
}
|
|
7
|
+
/** One orientation's authored coordinate system and supported viewport ratios. */
|
|
8
|
+
interface RuntimeOrientationConfig {
|
|
9
|
+
readonly enabled: boolean;
|
|
10
|
+
readonly height: number;
|
|
11
|
+
readonly ratio: RuntimeRange;
|
|
12
|
+
readonly width: number;
|
|
13
|
+
}
|
|
14
|
+
/** Render-resolution multipliers ordered from the lowest to highest quality policy. */
|
|
15
|
+
interface RuntimeRenderScaleConfig {
|
|
16
|
+
readonly balanced: number;
|
|
17
|
+
readonly full: number;
|
|
18
|
+
readonly minimal: number;
|
|
19
|
+
readonly reduced: number;
|
|
20
|
+
}
|
|
21
|
+
/** Device-pixel bounds and renderer-quality scaling policy. */
|
|
22
|
+
interface RuntimeResolutionConfig {
|
|
23
|
+
readonly pixelRatio: RuntimeRange;
|
|
24
|
+
readonly renderScale: RuntimeRenderScaleConfig;
|
|
25
|
+
}
|
|
26
|
+
/** Resolved rendering dimensions and resolution policy. */
|
|
27
|
+
interface RuntimeScreenConfig {
|
|
28
|
+
readonly orientations: {
|
|
29
|
+
readonly landscape: RuntimeOrientationConfig;
|
|
30
|
+
readonly portrait: RuntimeOrientationConfig;
|
|
31
|
+
};
|
|
32
|
+
readonly resolution: RuntimeResolutionConfig;
|
|
33
|
+
}
|
|
34
|
+
/** Orientation derived from the current viewport and configured capabilities. */
|
|
35
|
+
type RuntimeOrientation = 'landscape' | 'portrait';
|
|
36
|
+
/** Current dimensions of the ad container in CSS pixels. */
|
|
37
|
+
interface RuntimeViewport {
|
|
38
|
+
readonly width: number;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
}
|
|
41
|
+
/** Authored width and height expressed in playable design units. */
|
|
42
|
+
interface ScreenDesign {
|
|
43
|
+
readonly width: number;
|
|
44
|
+
readonly height: number;
|
|
45
|
+
}
|
|
46
|
+
/** Usable CSS-pixel area after applying the configured aspect-ratio limits. */
|
|
47
|
+
interface ScreenFrame extends RuntimeViewport {
|
|
48
|
+
readonly x: number;
|
|
49
|
+
readonly y: number;
|
|
50
|
+
}
|
|
51
|
+
/** Complete engine-neutral layout snapshot for the current playable viewport. */
|
|
52
|
+
interface Screen {
|
|
53
|
+
/** Authored coordinate system selected for the active orientation. */
|
|
54
|
+
readonly design: ScreenDesign;
|
|
55
|
+
/** Constrained area in which the playable should render. */
|
|
56
|
+
readonly frame: ScreenFrame;
|
|
57
|
+
/** Cached content rectangle in frame-local CSS pixels; never shrinks the canvas. */
|
|
58
|
+
readonly safeArea: ScreenFrame;
|
|
59
|
+
/** Orientation selected from the configured screen capabilities. */
|
|
60
|
+
readonly orientation: RuntimeOrientation;
|
|
61
|
+
/** Device-pixel multiplier to use for renderer resolution. */
|
|
62
|
+
readonly resolution: number;
|
|
63
|
+
/** CSS pixels represented by one authored design unit. */
|
|
64
|
+
readonly scale: number;
|
|
65
|
+
/** Full ad-container dimensions reported by the active host. */
|
|
66
|
+
readonly viewport: RuntimeViewport;
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { RuntimeResolutionConfig as a, Screen as c, RuntimeRenderScaleConfig as i, ScreenDesign as l, RuntimeOrientationConfig as n, RuntimeScreenConfig as o, RuntimeRange as r, RuntimeViewport as s, RuntimeOrientation as t, ScreenFrame as u };
|
|
70
|
+
//# sourceMappingURL=screen-DXf2FPtL.d.ts.map
|
package/dist/shell.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/shell/index.d.ts
|
|
2
|
+
/** ID of the element that owns the full playable viewport. */
|
|
3
|
+
declare const REPLAYABLE_ROOT_ID = "replayable-root";
|
|
4
|
+
/** ID of the element into which playable content is mounted. */
|
|
5
|
+
declare const REPLAYABLE_CONTAINER_ID = "replayable-container";
|
|
6
|
+
/** ID of the transient indicator shown while Replayable initializes. */
|
|
7
|
+
declare const REPLAYABLE_LOADING_INDICATOR_ID = "replayable-loading-indicator";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { REPLAYABLE_CONTAINER_ID, REPLAYABLE_LOADING_INDICATOR_ID, REPLAYABLE_ROOT_ID };
|
|
10
|
+
//# sourceMappingURL=shell.d.ts.map
|
package/dist/shell.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/shell/index.ts
|
|
2
|
+
/** ID of the element that owns the full playable viewport. */
|
|
3
|
+
const REPLAYABLE_ROOT_ID = "replayable-root";
|
|
4
|
+
/** ID of the element into which playable content is mounted. */
|
|
5
|
+
const REPLAYABLE_CONTAINER_ID = "replayable-container";
|
|
6
|
+
/** ID of the transient indicator shown while Replayable initializes. */
|
|
7
|
+
const REPLAYABLE_LOADING_INDICATOR_ID = "replayable-loading-indicator";
|
|
8
|
+
//#endregion
|
|
9
|
+
export { REPLAYABLE_CONTAINER_ID, REPLAYABLE_LOADING_INDICATOR_ID, REPLAYABLE_ROOT_ID };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","names":[],"sources":["../src/shell/index.ts"],"sourcesContent":["/** ID of the element that owns the full playable viewport. */\nexport const REPLAYABLE_ROOT_ID = 'replayable-root';\n\n/** ID of the element into which playable content is mounted. */\nexport const REPLAYABLE_CONTAINER_ID = 'replayable-container';\n\n/** ID of the transient indicator shown while Replayable initializes. */\nexport const REPLAYABLE_LOADING_INDICATOR_ID = 'replayable-loading-indicator';\n"],"mappings":";;AACA,MAAa,qBAAqB;;AAGlC,MAAa,0BAA0B;;AAGvC,MAAa,kCAAkC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@replayablejs/runtime",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"description": "Host lifecycle and network integration for Replayable playable ads",
|
|
5
|
+
"homepage": "https://github.com/replayablejs/replayable#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/replayablejs/replayable/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/replayablejs/replayable.git",
|
|
13
|
+
"directory": "packages/runtime"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src/screen/gpu/benchmarks/LICENSE"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"imports": {
|
|
22
|
+
"#adapters/*": "./src/adapters/*",
|
|
23
|
+
"#assets/*": "./src/assets/*",
|
|
24
|
+
"#audio/*": "./src/audio/*",
|
|
25
|
+
"#completion/*": "./src/completion/*",
|
|
26
|
+
"#fb-playable/*": "./src/fb-playable/*",
|
|
27
|
+
"#lifecycle/*": "./src/lifecycle/*",
|
|
28
|
+
"#localization/*": "./src/localization/*",
|
|
29
|
+
"#loader/*": "./src/loader/*",
|
|
30
|
+
"#mraid/*": "./src/mraid/*",
|
|
31
|
+
"#screen/*": "./src/screen/*",
|
|
32
|
+
"#shell/*": "./src/shell/*",
|
|
33
|
+
"#timers/*": "./src/timers/*",
|
|
34
|
+
"#types/*": "./src/types/*",
|
|
35
|
+
"#update/*": "./src/update/*"
|
|
36
|
+
},
|
|
37
|
+
"exports": {
|
|
38
|
+
".": {
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"default": "./dist/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./assets": {
|
|
43
|
+
"types": "./dist/assets.d.ts",
|
|
44
|
+
"default": "./dist/assets.js"
|
|
45
|
+
},
|
|
46
|
+
"./shell": {
|
|
47
|
+
"types": "./dist/shell.d.ts",
|
|
48
|
+
"default": "./dist/shell.js"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@pmndrs/detect-gpu": "6.0.20",
|
|
56
|
+
"howler": "2.2.4",
|
|
57
|
+
"motion": "13.1.1"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/howler": "2.2.13",
|
|
61
|
+
"tsdown": "0.22.14",
|
|
62
|
+
"typescript": "7.0.2",
|
|
63
|
+
"vitest": "4.1.10"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=24.0.0"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "tsdown",
|
|
70
|
+
"dev": "tsdown --watch",
|
|
71
|
+
"lint": "oxlint --type-aware --max-warnings 0 .",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"typecheck": "tsc --noEmit"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Tim van Scherpenzeel
|
|
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.
|