@tinkerlandai/longplay-sdk 0.10.52 → 0.10.54

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 (112) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{ai-usage-gcDQqLb2.d.ts → ai-usage-DBcYB8ix.d.ts} +1 -1
  3. package/dist/{api-D0Qu0isy.d.ts → api-1Tplv-7M.d.ts} +1 -1
  4. package/dist/check-response-MJHH5FWT.js +1 -0
  5. package/dist/{chunk-USM6HOXG.js → chunk-36VNAOG6.js} +1 -1
  6. package/dist/chunk-66TY4EFN.js +1 -0
  7. package/dist/{chunk-PGZZKX5K.js → chunk-6HKQILBV.js} +1 -1
  8. package/dist/{chunk-I643NVMZ.js → chunk-73UFNVEP.js} +1 -1
  9. package/dist/{chunk-UCDQJB53.js → chunk-ADTZEBQF.js} +1 -1
  10. package/dist/chunk-AEQUKR4O.js +1 -0
  11. package/dist/{chunk-5YQZEJBM.js → chunk-ANJPFGFN.js} +1 -1
  12. package/dist/{chunk-XI2NNZBS.js → chunk-BKBWGPNR.js} +1 -1
  13. package/dist/{chunk-7UXQJJFZ.js → chunk-BX2MSRA4.js} +1 -1
  14. package/dist/chunk-C4NXQMSO.js +1 -0
  15. package/dist/{chunk-K644WUOE.js → chunk-CAE4KIZN.js} +1 -1
  16. package/dist/{chunk-3TV3CVNP.js → chunk-CJUODAOF.js} +1 -1
  17. package/dist/{chunk-4CRUNNTC.js → chunk-DXLBEXC6.js} +1 -1
  18. package/dist/{chunk-CJUVMNDB.js → chunk-EACC667P.js} +1 -1
  19. package/dist/{chunk-TSBXPDUQ.js → chunk-GGZG56GR.js} +1 -1
  20. package/dist/{chunk-VPT5MFDG.js → chunk-HMJTABQ5.js} +2 -2
  21. package/dist/{chunk-EDV6ZNPQ.js → chunk-IN32NWRI.js} +1 -1
  22. package/dist/{chunk-2MDJ3JE5.js → chunk-J4RM5GQP.js} +1 -1
  23. package/dist/chunk-JCI5PGY3.js +1 -0
  24. package/dist/{chunk-AFZB2AYU.js → chunk-JJIP6BZL.js} +1 -1
  25. package/dist/{chunk-KXSZTBAG.js → chunk-JXWZS4UM.js} +1 -1
  26. package/dist/{chunk-FAMPOY6L.js → chunk-L64BS65O.js} +1 -1
  27. package/dist/{chunk-VGEH7B6S.js → chunk-LBDLWHBY.js} +1 -1
  28. package/dist/{chunk-AN7CPDBU.js → chunk-LFMAFY3P.js} +1 -1
  29. package/dist/{chunk-3LWZFXLN.js → chunk-LOBZ45T3.js} +1 -1
  30. package/dist/{chunk-CBOIDISB.js → chunk-M4P6TGBU.js} +1 -1
  31. package/dist/chunk-MRL7XUBV.js +1 -0
  32. package/dist/{chunk-XO6GV6O7.js → chunk-MZRDAMFQ.js} +1 -1
  33. package/dist/{chunk-KVIGHX2B.js → chunk-NL7AXMUA.js} +1 -1
  34. package/dist/{chunk-YJRO7NXN.js → chunk-NNJVMJUG.js} +1 -1
  35. package/dist/chunk-OJDO7546.js +1 -0
  36. package/dist/{chunk-RUMGXXVJ.js → chunk-OV46DXRX.js} +1 -1
  37. package/dist/{chunk-LDLS2VL2.js → chunk-OZK47BUU.js} +1 -1
  38. package/dist/{chunk-W3V7DTPC.js → chunk-PB34FLPJ.js} +1 -1
  39. package/dist/{chunk-DJYLJBU2.js → chunk-PPXVRQAG.js} +1 -1
  40. package/dist/{chunk-7Q25R5GL.js → chunk-PVMGYRGE.js} +1 -1
  41. package/dist/chunk-QAGK2SLZ.js +1 -0
  42. package/dist/{chunk-POX2ELNS.js → chunk-QGKROSRD.js} +1 -1
  43. package/dist/{chunk-FKC7TJWM.js → chunk-R2L227PQ.js} +1 -1
  44. package/dist/{chunk-YGOXUDDF.js → chunk-R4BYUK7S.js} +1 -1
  45. package/dist/{chunk-ZVLZLBDA.js → chunk-RJT764B2.js} +1 -1
  46. package/dist/{chunk-BBA64POP.js → chunk-RRZZUIFM.js} +1 -1
  47. package/dist/{chunk-OEUA65JK.js → chunk-S2MSRPR2.js} +1 -1
  48. package/dist/{chunk-PZZLYHKR.js → chunk-SK5JZ7HA.js} +2 -2
  49. package/dist/{chunk-7LHRBNSH.js → chunk-TS26DZNO.js} +1 -1
  50. package/dist/{chunk-NVHRWZIZ.js → chunk-UEKKQHUZ.js} +1 -1
  51. package/dist/{chunk-BYHBBZIO.js → chunk-WE55LJEN.js} +1 -1
  52. package/dist/{chunk-S4YBFFFY.js → chunk-XHZH3E4G.js} +1 -1
  53. package/dist/{chunk-JRHJO4BR.js → chunk-YMRWDMIL.js} +1 -1
  54. package/dist/chunk-ZEU56NVY.js +1 -0
  55. package/dist/{chunk-S6MXUFVF.js → chunk-ZQY7OYHM.js} +1 -1
  56. package/dist/{configuration-sync-DObsuVof.d.ts → configuration-sync-DeWWW5za.d.ts} +1 -1
  57. package/dist/{content-2EEYM7U7.js → content-A4SPKH7N.js} +1 -1
  58. package/dist/funnel-host-purchase-V2TIWGCQ.js +1 -0
  59. package/dist/funnel-host-recovery-paywall-DWKTPDLY.js +1 -0
  60. package/dist/{funnel-local-client-DzRzPX4x.d.ts → funnel-local-client-Fxsyl7rh.d.ts} +26 -26
  61. package/dist/funnel-paywall-prerender-DD7LQXDJ.js +1 -0
  62. package/dist/{funnel-process-client-DGRmy5KN.d.ts → funnel-process-client-D9saqPse.d.ts} +12 -12
  63. package/dist/funnel-route-prediction-ICGW4DPX.js +1 -0
  64. package/dist/funnel-route-source-64LTJZXN.js +1 -0
  65. package/dist/funnel-runtime-host-JG3OAYZ6.js +1 -0
  66. package/dist/index.d.ts +2353 -445
  67. package/dist/index.js +1 -1
  68. package/dist/merchant-bridge-contracts-DEDEIYNU.js +1 -0
  69. package/dist/native-shell.js +1 -1
  70. package/dist/openrouter.d.ts +3 -3
  71. package/dist/openrouter.js +1 -1
  72. package/dist/operation-contracts-RHJJI5NO.js +1 -0
  73. package/dist/page.d.ts +2 -2
  74. package/dist/page.js +1 -1
  75. package/dist/paywall-NM4HMYMK.js +1 -0
  76. package/dist/paywall-content-T2FGNRBR.js +1 -0
  77. package/dist/paywall-session-BAUWSWWR.js +1 -0
  78. package/dist/popup.d.ts +3 -3
  79. package/dist/popup.js +1 -1
  80. package/dist/{presentation-loading-BWUNotNa.d.ts → presentation-loading-sMyRJ21g.d.ts} +4 -2
  81. package/dist/react-native.d.ts +7 -7
  82. package/dist/react-native.js +1 -1
  83. package/dist/screen-renderer-CMFJVI36.js +1 -0
  84. package/dist/server.d.ts +7 -7
  85. package/dist/server.js +1 -1
  86. package/dist/{visual-dom-5LUN4AHO.js → visual-dom-MH3JDJHJ.js} +1 -1
  87. package/dist/visual.js +1 -1
  88. package/package.json +1 -1
  89. package/dist/check-response-AVQ7PY5I.js +0 -1
  90. package/dist/chunk-4OSW2Y67.js +0 -1
  91. package/dist/chunk-EJAF6OGO.js +0 -1
  92. package/dist/chunk-L66EXWTK.js +0 -1
  93. package/dist/chunk-QIY6PCYC.js +0 -1
  94. package/dist/chunk-ZNOVEJLM.js +0 -1
  95. package/dist/chunk-ZY4YDPSI.js +0 -1
  96. package/dist/funnel-host-purchase-UONTZRRJ.js +0 -1
  97. package/dist/funnel-paywall-prerender-AT4BXZIY.js +0 -1
  98. package/dist/funnel-route-prediction-Z3J2HSHI.js +0 -1
  99. package/dist/funnel-route-source-LFE6GSHU.js +0 -1
  100. package/dist/funnel-runtime-host-7ROIR7CU.js +0 -1
  101. package/dist/merchant-bridge-contracts-O6WIWC7T.js +0 -1
  102. package/dist/operation-contracts-H7NKQ373.js +0 -1
  103. package/dist/paywall-25MAYQ4B.js +0 -1
  104. package/dist/paywall-content-7KTEQLRN.js +0 -1
  105. package/dist/paywall-session-7HGW5IKN.js +0 -1
  106. package/dist/screen-renderer-XZWKIJWF.js +0 -1
  107. package/dist/{chunk-PY3AC5KD.js → chunk-5YBTU4KS.js} +0 -0
  108. package/dist/{chunk-CILM5XMH.js → chunk-DLRCJF6U.js} +0 -0
  109. package/dist/{chunk-VPT5MFDG.js.LEGAL.txt → chunk-HMJTABQ5.js.LEGAL.txt} +0 -0
  110. package/dist/{chunk-PZZLYHKR.js.LEGAL.txt → chunk-SK5JZ7HA.js.LEGAL.txt} +0 -0
  111. package/dist/{chunk-OJM6ORHE.js → chunk-VJIONC4S.js} +0 -0
  112. package/dist/{screen-CJepeiBT.d.ts → screen-D2bUmJ4M.d.ts} +1 -1
package/dist/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
1
  import { z } from 'zod';
2
- import { S as ScreenAnswers, P as PresentationLoadingOptions, s as screenInputBindingsSchema, a as SurfaceData, b as PaywallLoadingDocument, C as CustomerDataIntent, c as createPresentationLoading, R as RetainedPurchaseDialog } from './presentation-loading-BWUNotNa.js';
3
- export { d as PresentationState } from './presentation-loading-BWUNotNa.js';
2
+ import { S as ScreenAnswers, P as PresentationLoadingOptions, s as screenInputBindingsSchema, a as SurfaceData, b as PaywallLoadingDocument, C as CustomerDataIntent, c as createPresentationLoading, R as RetainedPurchaseDialog } from './presentation-loading-sMyRJ21g.js';
3
+ export { d as PresentationState } from './presentation-loading-sMyRJ21g.js';
4
4
  import { J as JsonValue } from './growth-rules-B4YYy64R.js';
5
- import { S as StackNode, a as ScreenSelection } from './screen-CJepeiBT.js';
6
- import { C as ConfigurationSync } from './configuration-sync-DObsuVof.js';
7
- export { a as ConfigurationStorage, b as ConfigurationSyncOptions, c as createConfigurationSync } from './configuration-sync-DObsuVof.js';
8
- import { P as PaywallSession, a as PaywallOperation, b as PaywallSubscriptionChange, F as FunnelCommandStorage, s as scopeSchema, c as FunnelStartInput, I as IndianaOptions, S as SessionCredentials, d as FunnelExecutionPolicy, e as PaywallRecovery, f as PaywallQuote, g as FunnelRunController, h as PaywallResolution, i as FunnelRunView, j as IamFunnelEntryDelivery, k as FunnelProcessRunView, l as createPaywallSession$1 } from './funnel-local-client-DzRzPX4x.js';
9
- export { C as CustomerSession, m as FeatureClient, n as FeatureClientOptions, o as FunnelControllerResponse, p as FunnelPendingEntry, q as FunnelPurchaseRecovery, r as FunnelRuntimeResponse, t as FunnelSegmentPrediction, L as LocalFunnelClient, u as LocalFunnelClientOptions, v as LongplayError, w as PaywallPurchaseInput, x as PaywallStartInput, y as PushHost, z as PushJournal, A as createFeatureClient, B as createFunnelRunController, D as createLocalFunnelClient, E as getPaywallRecovery, G as isPaywallOperationComplete, H as isPaywallOperationPending, J as isPaywallUpdateOperation, K as isPaywallUpdateQuote, M as preparePaywallFallback } from './funnel-local-client-DzRzPX4x.js';
5
+ import { S as StackNode, a as ScreenSelection } from './screen-D2bUmJ4M.js';
10
6
  import { C as CouponInput, O as Offer } from './coupon-kfkIVf9n.js';
11
7
  export { a as OfferUnavailableReason } from './coupon-kfkIVf9n.js';
8
+ import { P as PaywallSession, a as PaywallOperation, b as PaywallResolution, c as PaywallSubscriptionChange, F as FunnelCommandStorage, s as scopeSchema, d as FunnelStartInput, I as IndianaOptions, S as SessionCredentials, e as FunnelExecutionPolicy, f as PaywallRecovery, g as PaywallQuote, h as FunnelRunController, i as FunnelRunView, j as IamFunnelEntryDelivery, k as FunnelProcessRunView, l as createPaywallSession$1 } from './funnel-local-client-Fxsyl7rh.js';
9
+ export { C as CustomerSession, m as FeatureClient, n as FeatureClientOptions, o as FunnelControllerResponse, p as FunnelPendingEntry, q as FunnelPurchaseRecovery, r as FunnelRuntimeResponse, t as FunnelSegmentPrediction, L as LocalFunnelClient, u as LocalFunnelClientOptions, v as LongplayError, w as PaywallPurchaseInput, x as PaywallStartInput, y as PushHost, z as PushJournal, A as createFeatureClient, B as createFunnelRunController, D as createLocalFunnelClient, E as getPaywallRecovery, G as isPaywallOperationComplete, H as isPaywallOperationPending, J as isPaywallUpdateOperation, K as isPaywallUpdateQuote, M as preparePaywallFallback } from './funnel-local-client-Fxsyl7rh.js';
12
10
  import { E as EntitlementCheckResult, M as MerchantBridgeManifest } from './funnel-node-evaluation-CRRTh1je.js';
13
11
  export { a as EntitlementCheckInput, b as EntitlementCheckObservation, c as EntitlementRequirement, F as FunnelNodeEvaluationContext, e as evaluateFunnelNode } from './funnel-node-evaluation-CRRTh1je.js';
14
- import { c as createFunnelProcess } from './funnel-process-client-DGRmy5KN.js';
15
- export { F as FunnelProcessAdapter, a as FunnelProcessOptions, b as FunnelResourceSource, I as LongplayFeatureOptions, d as createFunnelClient, e as createLongplay } from './funnel-process-client-DGRmy5KN.js';
16
- import './api-D0Qu0isy.js';
12
+ import { C as ConfigurationSync } from './configuration-sync-DeWWW5za.js';
13
+ export { a as ConfigurationStorage, b as ConfigurationSyncOptions, c as createConfigurationSync } from './configuration-sync-DeWWW5za.js';
14
+ import { c as createFunnelProcess } from './funnel-process-client-D9saqPse.js';
15
+ export { F as FunnelProcessAdapter, a as FunnelProcessOptions, b as FunnelResourceSource, I as LongplayFeatureOptions, d as createFunnelClient, e as createLongplay } from './funnel-process-client-D9saqPse.js';
16
+ import './api-1Tplv-7M.js';
17
17
  import 'zod/v4';
18
18
 
19
19
  /** Opt-in geometry; documents without responsive fields retain their host's legacy sizing. */
@@ -379,35 +379,6 @@ declare function prepareContent$1(container: HTMLElement, options: ContentHostOp
379
379
  updateCapabilities(data: SurfaceData): void;
380
380
  }>;
381
381
 
382
- /**
383
- * The first screen a Run of a Funnel would present for one Customer and Start, computed on this
384
- * device from the Funnel's published route. Nothing is recorded: no Run, exposure, Sticky assignment or
385
- * Coupon. `unavailable` means no prediction could be made (no published route, a paused Funnel,
386
- * unreadable configuration). The Run started at the click still decides; use this for loading
387
- * states and pre-rendering only.
388
- */
389
- type FunnelStartPrediction = {
390
- funnelId: string;
391
- } & (FunnelRoutePrediction | {
392
- type: "unavailable";
393
- reason: string;
394
- versionId?: undefined;
395
- path: [];
396
- });
397
- declare function predictFunnelStart$1(configuration: ConfigurationSync, input: {
398
- funnelId: string;
399
- /** The Customer whose Run it would be: the session's Customer ID. */
400
- customerId: string;
401
- /** The Start parameters the click would send. */
402
- parameters?: Record<string, JsonValue>;
403
- }): Promise<FunnelStartPrediction>;
404
- /**
405
- * The published design of the predicted first Paywall, for a loading state drawn before the Run
406
- * presents. Null when the first screen is not a Paywall or its public file is unavailable.
407
- */
408
- declare function predictedPaywallLoadingDocument$1(configuration: ConfigurationSync, prediction: FunnelStartPrediction): Promise<PaywallLoadingDocument | null>;
409
-
410
- /** Display intent only. The merchant still authorizes any subsequent purchase. */
411
382
  type PaywallPurchaseIntent = {
412
383
  actionId: string;
413
384
  productVersionId: string;
@@ -451,6 +422,8 @@ type PaywallHostOptions = PresentationLoadingOptions & {
451
422
  terminateCheckout?: (operationId: string) => Promise<unknown>;
452
423
  /** Validate the replacement intent before closing the original Checkout. Rejecting preserves the original purchase. */
453
424
  beforeCheckoutReplacement?: (intent: PaywallPurchaseIntent) => void | Promise<void>;
425
+ /** Rebind a recovered Paywall after the original upgrade is conclusively closed. */
426
+ prepareUpgradeReplacement?: (operationId: string, intent: PaywallPurchaseIntent) => Promise<PaywallResolution>;
454
427
  /** The published purchase button confirms the purchase by default. Opt in to a separate SDK quote review. */
455
428
  purchaseConfirmation?: "purchase_button" | "paywall";
456
429
  /** Use hosted confirmation for new subscriptions when the merchant guarantees Checkout collects payment. */
@@ -1758,8 +1731,10 @@ declare function createFunnelPurchaseClient(input: FunnelPurchaseOptions): {
1758
1731
  }): Promise<PaywallResolution>;
1759
1732
  /** Whether the last verified read can restore a pending upgrade's Paywall. */
1760
1733
  readonly canRestoreUpgradePaywall: boolean;
1761
- /** Mounts an accepted upgrade in its authorized Paywall without a live Run. */
1734
+ /** Recovers the pending upgrade for existing callers of the upgrade-specific API. */
1762
1735
  recoverUpgradePaywall(): Promise<PaywallSession | null>;
1736
+ /** Reads the original purchase without starting or submitting another Run. */
1737
+ recoverPurchasePaywall(opened?: OpenPurchasePaywall, originalOperationId?: string): Promise<PaywallSession | null>;
1763
1738
  start(start: FunnelPurchaseStart): Promise<FunnelPurchaseState>;
1764
1739
  refresh: () => Promise<FunnelPurchaseState>;
1765
1740
  confirm: () => Promise<FunnelPurchaseState>;
@@ -1777,8 +1752,239 @@ declare function createFunnelPurchaseClient(input: FunnelPurchaseOptions): {
1777
1752
  subscribe(listener: (state: FunnelPurchaseState) => unknown): () => void;
1778
1753
  destroy: () => void;
1779
1754
  };
1755
+ type OpenPurchasePaywall = {
1756
+ runId: string;
1757
+ receiptId: string;
1758
+ view: PaywallResolution;
1759
+ };
1780
1760
  type FunnelPurchaseClient = ReturnType<typeof createFunnelPurchaseClient>;
1781
1761
 
1762
+ /** Mount an authenticated original purchase inside the merchant's open Paywall dialog. */
1763
+ declare function mountFunnelRecoveryPaywall$1(target: HTMLElement, options: {
1764
+ client: FunnelPurchaseClient;
1765
+ operationId?: string;
1766
+ upgradeReplacement?: Pick<PaywallHostOptions, "beforeCheckoutReplacement" | "resolveOfferId" | "resolveSubscriptionChange"> & {
1767
+ start(): Promise<FunnelPurchaseStart | null>;
1768
+ };
1769
+ signal: AbortSignal;
1770
+ onCheckoutUrl(url: string): unknown;
1771
+ onComplete(): unknown;
1772
+ onDismiss(): void;
1773
+ onError?(error: unknown): void;
1774
+ }): Promise<{
1775
+ document: {
1776
+ name: string;
1777
+ kind: "paywall";
1778
+ presentation: {
1779
+ type: "modal";
1780
+ size: "sm" | "md" | "lg";
1781
+ desktopWidth?: {
1782
+ min: number;
1783
+ max: number;
1784
+ viewport: number;
1785
+ } | undefined;
1786
+ mobile?: "sheet" | "fullscreen" | undefined;
1787
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
1788
+ position?: "center" | "top" | "bottom" | undefined;
1789
+ } | {
1790
+ type: "sheet";
1791
+ size: "sm" | "md" | "lg";
1792
+ desktopWidth?: {
1793
+ min: number;
1794
+ max: number;
1795
+ viewport: number;
1796
+ } | undefined;
1797
+ mobile?: "sheet" | "fullscreen" | undefined;
1798
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
1799
+ } | {
1800
+ type: "fullscreen";
1801
+ } | {
1802
+ type: "inline";
1803
+ };
1804
+ screen: {
1805
+ kind: "screen";
1806
+ schemaVersion: 4;
1807
+ name: string;
1808
+ surface: "popup" | "paywall" | "onboarding" | "page" | "banner";
1809
+ presentation: {
1810
+ type: "modal";
1811
+ size: "sm" | "md" | "lg";
1812
+ desktopWidth?: {
1813
+ min: number;
1814
+ max: number;
1815
+ viewport: number;
1816
+ } | undefined;
1817
+ mobile?: "sheet" | "fullscreen" | undefined;
1818
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
1819
+ position?: "center" | "top" | "bottom" | undefined;
1820
+ } | {
1821
+ type: "sheet";
1822
+ size: "sm" | "md" | "lg";
1823
+ desktopWidth?: {
1824
+ min: number;
1825
+ max: number;
1826
+ viewport: number;
1827
+ } | undefined;
1828
+ mobile?: "sheet" | "fullscreen" | undefined;
1829
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
1830
+ } | {
1831
+ type: "fullscreen";
1832
+ } | {
1833
+ type: "inline";
1834
+ };
1835
+ theme: {
1836
+ primary: string;
1837
+ background: string;
1838
+ text: string;
1839
+ radius: "sm" | "md" | "lg" | "none" | "full";
1840
+ font: "system" | "serif" | "rounded" | "mono";
1841
+ fontAssets?: {
1842
+ family: string;
1843
+ faces: {
1844
+ url: string;
1845
+ weight: number;
1846
+ family?: string | undefined;
1847
+ }[];
1848
+ } | undefined;
1849
+ };
1850
+ pages: {
1851
+ id: string;
1852
+ name: string;
1853
+ root: StackNode;
1854
+ theme?: {
1855
+ primary: string;
1856
+ background: string;
1857
+ text: string;
1858
+ radius: "sm" | "md" | "lg" | "none" | "full";
1859
+ font: "system" | "serif" | "rounded" | "mono";
1860
+ fontAssets?: {
1861
+ family: string;
1862
+ faces: {
1863
+ url: string;
1864
+ weight: number;
1865
+ family?: string | undefined;
1866
+ }[];
1867
+ } | undefined;
1868
+ } | undefined;
1869
+ editorPosition?: {
1870
+ x: number;
1871
+ y: number;
1872
+ } | undefined;
1873
+ }[];
1874
+ strings: {
1875
+ defaultLocale: string;
1876
+ locales: Record<string, Record<string, string>>;
1877
+ };
1878
+ actions: ({
1879
+ type: "navigate";
1880
+ close: false;
1881
+ pageId: string;
1882
+ id: string;
1883
+ event: string;
1884
+ properties: Record<string, string | number | boolean | null>;
1885
+ } | {
1886
+ type: "event";
1887
+ close: boolean;
1888
+ id: string;
1889
+ event: string;
1890
+ properties: Record<string, string | number | boolean | null>;
1891
+ } | {
1892
+ type: "close";
1893
+ close: true;
1894
+ id: string;
1895
+ event: string;
1896
+ properties: Record<string, string | number | boolean | null>;
1897
+ } | {
1898
+ type: "open_url";
1899
+ close: boolean;
1900
+ url: string;
1901
+ id: string;
1902
+ event: string;
1903
+ properties: Record<string, string | number | boolean | null>;
1904
+ } | {
1905
+ type: "claim_offer";
1906
+ close: boolean;
1907
+ couponId: string;
1908
+ id: string;
1909
+ event: string;
1910
+ properties: Record<string, string | number | boolean | null>;
1911
+ })[];
1912
+ initialPageId?: string | undefined;
1913
+ };
1914
+ schemaVersion: 3;
1915
+ products: {
1916
+ items: {
1917
+ productVersionId: string;
1918
+ label: string;
1919
+ }[];
1920
+ defaultProductVersionId: string | null;
1921
+ grouping?: {
1922
+ tiers: {
1923
+ id: string;
1924
+ name: string;
1925
+ }[];
1926
+ assignments: {
1927
+ productVersionId: string;
1928
+ tierId: string;
1929
+ period: "month" | "year";
1930
+ }[];
1931
+ } | undefined;
1932
+ };
1933
+ offeringVersionId: string | null;
1934
+ buttons: Record<string, {
1935
+ type: "checkout";
1936
+ product: {
1937
+ type: "picker";
1938
+ pickerId: string;
1939
+ allowedProductVersionIds: string[];
1940
+ } | {
1941
+ type: "fixed";
1942
+ productVersionId: string;
1943
+ };
1944
+ } | {
1945
+ type: "close";
1946
+ } | {
1947
+ type: "action";
1948
+ action: {
1949
+ type: "event";
1950
+ event: string;
1951
+ } | {
1952
+ type: "open_url";
1953
+ url: string;
1954
+ };
1955
+ }>;
1956
+ };
1957
+ destroy: () => void;
1958
+ } | null>;
1959
+
1960
+ /**
1961
+ * The first screen a Run of a Funnel would present for one Customer and Start, computed on this
1962
+ * device from the Funnel's published route. Nothing is recorded: no Run, exposure, Sticky assignment or
1963
+ * Coupon. `unavailable` means no prediction could be made (no published route, a paused Funnel,
1964
+ * unreadable configuration). The Run started at the click still decides; use this for loading
1965
+ * states and pre-rendering only.
1966
+ */
1967
+ type FunnelStartPrediction = {
1968
+ funnelId: string;
1969
+ } & (FunnelRoutePrediction | {
1970
+ type: "unavailable";
1971
+ reason: string;
1972
+ versionId?: undefined;
1973
+ path: [];
1974
+ });
1975
+ declare function predictFunnelStart$1(configuration: ConfigurationSync, input: {
1976
+ funnelId: string;
1977
+ /** The Customer whose Run it would be: the session's Customer ID. */
1978
+ customerId: string;
1979
+ /** The Start parameters the click would send. */
1980
+ parameters?: Record<string, JsonValue>;
1981
+ }): Promise<FunnelStartPrediction>;
1982
+ /**
1983
+ * The published design of the predicted first Paywall, for a loading state drawn before the Run
1984
+ * presents. Null when the first screen is not a Paywall or its public file is unavailable.
1985
+ */
1986
+ declare function predictedPaywallLoadingDocument$1(configuration: ConfigurationSync, prediction: FunnelStartPrediction): Promise<PaywallLoadingDocument | null>;
1987
+
1782
1988
  type Start = Omit<FunnelPurchaseStart, "requestId">;
1783
1989
  type Commerce = {
1784
1990
  provider: string;
@@ -1909,404 +2115,1925 @@ type FunnelHostOptions = PresentationLoadingOptions & {
1909
2115
  declare function showFunnelRun$1(container: HTMLElement, input: FunnelHostOptions, initialLoading?: ReturnType<typeof createPresentationLoading>): Promise<{
1910
2116
  destroy: () => void;
1911
2117
  refresh: () => Promise<void>;
1912
- retainPurchaseDialog(): {
1913
- dialog: HTMLDialogElement;
1914
- release(): void;
1915
- } | undefined;
1916
- readonly recovery: PaywallRecovery;
1917
- prepareFallback(): Promise<PaywallRecovery>;
1918
- review: (receiptId?: string) => Promise<void>;
1919
- exitReview: () => Promise<void>;
1920
- readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
1921
- }>;
1922
- /** Share an authenticated purchase observation and its current loading lifecycle. */
1923
- declare function showObservedFunnelRun(container: HTMLElement, input: FunnelHostOptions, initialLoading?: ReturnType<typeof createPresentationLoading>): Promise<{
1924
- destroy: () => void;
1925
- refresh: () => Promise<void>;
1926
- retainPurchaseDialog(): {
1927
- dialog: HTMLDialogElement;
1928
- release(): void;
1929
- } | undefined;
1930
- readonly recovery: PaywallRecovery;
1931
- prepareFallback(): Promise<PaywallRecovery>;
1932
- review: (receiptId?: string) => Promise<void>;
1933
- exitReview: () => Promise<void>;
1934
- readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
1935
- }>;
1936
-
1937
- type FunnelPurchaseHostOptions = Omit<FunnelHostOptions, "client" | "checkoutNavigation" | "resolveOfferId" | "resumeCheckout" | "terminateCheckout"> & {
1938
- /**
1939
- * An already available Paywall design for the first frame, such as the predicted first
1940
- * Paywall's (`predictedPaywallLoadingDocument`).
1941
- */
1942
- loadingDocument?: PaywallLoadingDocument;
1943
- client: FunnelPurchaseClient;
1944
- /**
1945
- * Omit to recover only; no new attempt is allocated. A promise (the merchant's own checks still
1946
- * running) shows the loading state at once and starts the Run when it settles; `null`,
1947
- * `undefined` or a rejection ends the presentation without a Run, reported as `skipped`.
1948
- */
1949
- start?: FunnelPurchaseStart | Promise<FunnelPurchaseStart | null | undefined>;
1950
- resolveOfferId?: (purchase: Parameters<NonNullable<FunnelHostOptions["resolveOfferId"]>>[0], attempt: FunnelPurchaseAttempt) => ReturnType<NonNullable<FunnelHostOptions["resolveOfferId"]>>;
1951
- };
1952
- type RunHost = Awaited<ReturnType<typeof showObservedFunnelRun>>;
1953
- type Host = Omit<RunHost, "retainPurchaseDialog">;
1954
- /**
1955
- * Same Controller/Host lifecycle; operation-only or blocked recovery goes to onRecovery. An
1956
- * unpaid original Checkout is recovered inside its Run's Paywall (Continue checkout, or another
1957
- * plan after the original is terminated). A `prepared` Paywall is handed to the SDK: one it
1958
- * cannot use for this Start is released.
1959
- */
1960
- declare function showFunnelPurchase$1(container: HTMLElement, options: FunnelPurchaseHostOptions): Promise<Host | null>;
1961
-
1962
- declare class MerchantBridgeError extends Error {
1963
- readonly code: string;
1964
- readonly status: number;
1965
- readonly retryable: boolean;
1966
- readonly recovery: string;
1967
- constructor(code: string, status?: number, retryable?: boolean, recovery?: string);
1968
- }
1969
- type MerchantBridgeOptions = {
1970
- origin: string;
1971
- manifest: MerchantBridgeManifest;
1972
- scope: Pick<MerchantBridgeManifest, "projectId" | "environmentId" | "environment">;
1973
- /** Native merchant auth/CSRF headers only. Indiana credentials must never go to the merchant. */
1974
- headers?: () => HeadersInit | Promise<HeadersInit>;
1975
- customerId?: string;
1976
- fetch?: typeof globalThis.fetch;
1977
- signal?: AbortSignal;
1978
- timeoutMs?: number;
1979
- };
1980
- /** User-facing standard bridge. No catalog secret, refund authority, automatic charge retry or automatic redirect. */
1981
- declare function createMerchantBridge(options: MerchantBridgeOptions): {
1982
- readPresentation(signal?: AbortSignal): Promise<{
1983
- nativeUserId: string;
1984
- presentation: {
1985
- customerId: string;
1986
- decisionId: string;
1987
- offeringVersionId: string;
1988
- paywallVersionId: string;
1989
- variant: string;
1990
- } | null;
1991
- }>;
1992
- createSession(signal?: AbortSignal): Promise<{
1993
- customerId: string;
1994
- sessionId: string;
1995
- accessToken: string;
1996
- refreshToken: string;
1997
- expiresAt: string;
1998
- refreshExpiresAt: string;
1999
- }>;
2000
- reportPresentation(input: {
2001
- decisionId: string;
2002
- eventId: string;
2003
- }, signal?: AbortSignal): Promise<{
2004
- queued: true;
2005
- }>;
2006
- readCustomerCommerce(signal?: AbortSignal): Promise<{
2007
- customerId: string;
2008
- revision: string;
2009
- observedAt: string;
2010
- subscriptions: {
2011
- merchantSubscriptionId: string;
2012
- merchantProductId: string;
2013
- productVersionId: string | null;
2014
- status: "active" | "cancelled" | "trialing" | "expired" | "past_due";
2015
- currentPeriodStartsAt: string | null;
2016
- currentPeriodEndsAt: string | null;
2017
- cancelAtPeriodEnd: boolean;
2018
- scheduledChange: {
2019
- effectiveAt: string;
2020
- merchantProductId: string;
2021
- } | null;
2022
- }[];
2023
- purchaseHistory: {
2024
- complete: boolean;
2025
- hasPaidPurchase: boolean;
2026
- lastPaidAt: string | null;
2027
- };
2028
- balances: {
2029
- bucketId: string;
2030
- key: string;
2031
- available: string;
2032
- expiresAt: string | null;
2033
- nextResetAt: string | null;
2034
- }[];
2035
- }>;
2036
- executePurchase(operationId: string, signal?: AbortSignal): Promise<{
2037
- type: "purchase";
2038
- merchantOrderId: string | null;
2039
- paymentStatus: "unknown" | "failed" | "pending" | "expired" | "succeeded" | "not_started" | "not_required";
2040
- checkoutUrl: string | null;
2041
- checkoutExpiresAt: string | null;
2042
- operationId: string;
2043
- customerId: string;
2044
- merchantExecutionId: string;
2045
- fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
2046
- recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
2047
- updatedAt: string;
2048
- problem: {
2049
- phase: "execution" | "payment" | "fulfillment" | "recording";
2050
- code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
2051
- recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
2052
- retryable: boolean;
2053
- reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
2054
- } | null;
2055
- pollAfterMs: number | null;
2056
- }>;
2057
- readOperation: (operationId: string, signal?: AbortSignal) => Promise<{
2058
- lookup: "found";
2059
- operationId: string;
2060
- customerId: string;
2061
- execution: {
2062
- type: "purchase";
2063
- merchantOrderId: string | null;
2064
- paymentStatus: "unknown" | "failed" | "pending" | "expired" | "succeeded" | "not_started" | "not_required";
2065
- checkoutUrl: string | null;
2066
- checkoutExpiresAt: string | null;
2067
- operationId: string;
2068
- customerId: string;
2069
- merchantExecutionId: string;
2070
- fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
2071
- recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
2072
- updatedAt: string;
2073
- problem: {
2074
- phase: "execution" | "payment" | "fulfillment" | "recording";
2075
- code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
2076
- recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
2077
- retryable: boolean;
2078
- reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
2079
- } | null;
2080
- pollAfterMs: number | null;
2081
- } | {
2082
- type: "subscription_change";
2083
- status: "unknown" | "failed" | "pending" | "scheduled" | "applied";
2084
- merchantSubscriptionId: string;
2085
- scheduledFor: string | null;
2086
- operationId: string;
2087
- customerId: string;
2088
- merchantExecutionId: string;
2089
- fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
2090
- recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
2091
- updatedAt: string;
2092
- problem: {
2093
- phase: "execution" | "payment" | "fulfillment" | "recording";
2094
- code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
2095
- recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
2096
- retryable: boolean;
2097
- reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
2098
- } | null;
2099
- pollAfterMs: number | null;
2100
- nextAction?: {
2101
- type: "redirect";
2102
- url: string;
2103
- expiresAt: string;
2104
- } | undefined;
2105
- } | {
2106
- type: "refund";
2107
- status: "unknown" | "failed" | "pending" | "succeeded";
2108
- merchantRefundId: string | null;
2109
- operationId: string;
2110
- customerId: string;
2111
- merchantExecutionId: string;
2112
- fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
2113
- recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
2114
- updatedAt: string;
2115
- problem: {
2116
- phase: "execution" | "payment" | "fulfillment" | "recording";
2117
- code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
2118
- recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
2119
- retryable: boolean;
2120
- reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
2121
- } | null;
2122
- pollAfterMs: number | null;
2123
- };
2124
- readAt: string;
2125
- } | {
2126
- lookup: "not_received";
2127
- operationId: string;
2128
- customerId: string;
2129
- execution: null;
2130
- readAt: string;
2131
- }>;
2132
- executeSubscriptionChange(operationId: string, signal?: AbortSignal): Promise<{
2133
- type: "subscription_change";
2134
- status: "unknown" | "failed" | "pending" | "scheduled" | "applied";
2135
- merchantSubscriptionId: string;
2136
- scheduledFor: string | null;
2137
- operationId: string;
2138
- customerId: string;
2139
- merchantExecutionId: string;
2140
- fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
2141
- recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
2142
- updatedAt: string;
2143
- problem: {
2144
- phase: "execution" | "payment" | "fulfillment" | "recording";
2145
- code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
2146
- recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
2147
- retryable: boolean;
2148
- reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
2149
- } | null;
2150
- pollAfterMs: number | null;
2151
- nextAction?: {
2152
- type: "redirect";
2153
- url: string;
2154
- expiresAt: string;
2155
- } | undefined;
2156
- }>;
2157
- /** Logout/account switch aborts outstanding work and drops the bound Customer. */
2158
- reset(): void;
2159
- };
2160
-
2161
- type IamFunnelEntriesOptions = IndianaOptions & {
2162
- scope: NonNullable<IndianaOptions["scope"]>;
2163
- environmentId: string;
2164
- appManifestRelease: string;
2165
- session: NonNullable<IndianaOptions["session"]>;
2166
- container: HTMLElement;
2167
- /** Credential-free original starts survive reloads in this tab. Requires a full Customer session. */
2168
- recoveryStorage?: Storage | false;
2169
- /** Per-tab frequency state. A capped entry requires a full Customer session. */
2170
- deliveryStorage?: Storage;
2171
- host?: Omit<FunnelHostOptions, "client">;
2172
- onStatus?: (status: string, entryId?: string) => void;
2173
- };
2174
- /** Explicitly installed Web presentation host. No source scan or automatic credential creation. */
2175
- declare function createIamFunnelEntries(options: IamFunnelEntriesOptions): {
2176
- start(): Promise<void>;
2177
- refresh: () => Promise<void>;
2178
- retry(): Promise<void>;
2179
- destroy(): void;
2180
- };
2181
-
2182
- /** Uses the accepted Split key. No new bucketing, force override or anonymous exposure. */
2183
- declare function createFunnelPageExperiments(options: {
2184
- client: FunnelRunController;
2185
- appManifestRelease: string;
2186
- onError?: (error: unknown) => void;
2187
- }): {
2188
- start(): Promise<void>;
2189
- refresh: () => Promise<void>;
2190
- destroy(): void;
2191
- };
2192
-
2193
- type EntryDeliveryIdentity = {
2194
- type: "customer" | "guest";
2195
- id: string;
2196
- };
2197
-
2198
- type Entry = IamFunnelEntryDelivery["entries"][number];
2199
- type Process = ReturnType<typeof createFunnelProcess>;
2200
- type IamFunnelProcessEntriesOptions = Pick<IndianaOptions, "baseUrl" | "fetch" | "timeoutMs"> & {
2201
- scope: NonNullable<IndianaOptions["scope"]>;
2202
- environmentId: string;
2203
- appManifestRelease: string;
2204
- container: HTMLElement;
2205
- /** Reuse the backend's durable process handle when recreating this entry after reload. */
2206
- createProcess(entry: Entry): Process;
2207
- host?: Omit<FunnelHostOptions, "client">;
2208
- locale?: string;
2209
- /** Required for session-capped entries. Return the current Customer ID or a per-tab guest ID, never a credential. Update it before syncIdentity(). */
2210
- deliveryIdentity?: () => EntryDeliveryIdentity | undefined;
2211
- deliveryStorage?: Storage;
2212
- onStatus?: (status: string, entryId?: string) => void;
2213
- };
2214
- /** Explicit process-capable IAM host. Merely fetching configuration creates no identity. */
2215
- declare function createIamFunnelProcessEntries(options: IamFunnelProcessEntriesOptions): {
2216
- start(): Promise<void>;
2217
- refresh: () => Promise<void>;
2218
- retry(): Promise<void>;
2219
- syncIdentity(): Promise<FunnelProcessRunView | undefined>;
2220
- detach(): Promise<void>;
2221
- destroy(): void;
2222
- };
2223
-
2224
- declare function showPaywall(container: HTMLElement, options: PaywallHostOptions): Promise<{
2225
- check: {
2226
- internal_feature_id: string;
2227
- name: string;
2228
- kind: "access" | "metered" | "credit";
2229
- quantity: string;
2230
- allowed: boolean;
2231
- reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
2232
- preview: {
2233
- scenario: "feature_flag" | "usage_limit";
2234
- candidates: {
2235
- productId: string;
2236
- productVersionId: string;
2118
+ readonly recoveryPaywall: {
2119
+ view: {
2120
+ id: string;
2121
+ paywallId: string;
2122
+ version: number;
2123
+ document: {
2237
2124
  name: string;
2238
- action: "purchase" | "upgrade" | "addon" | "topup";
2239
- membershipId: string | null;
2240
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2241
- amountMinor: string;
2242
- interval: "free" | "week" | "month" | "year" | "one_time";
2243
- intervalCount: number;
2244
- featureQuantities?: Record<string, number> | undefined;
2245
- }[];
2246
- } | null;
2247
- observation?: {
2248
- subject: {
2249
- scope: {
2250
- projectId: string;
2251
- environmentId: string;
2252
- environment: "sandbox" | "live";
2125
+ kind: "paywall";
2126
+ presentation: {
2127
+ type: "modal";
2128
+ size: "sm" | "md" | "lg";
2129
+ desktopWidth?: {
2130
+ min: number;
2131
+ max: number;
2132
+ viewport: number;
2133
+ } | undefined;
2134
+ mobile?: "sheet" | "fullscreen" | undefined;
2135
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2136
+ position?: "center" | "top" | "bottom" | undefined;
2137
+ } | {
2138
+ type: "sheet";
2139
+ size: "sm" | "md" | "lg";
2140
+ desktopWidth?: {
2141
+ min: number;
2142
+ max: number;
2143
+ viewport: number;
2144
+ } | undefined;
2145
+ mobile?: "sheet" | "fullscreen" | undefined;
2146
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2147
+ } | {
2148
+ type: "fullscreen";
2149
+ } | {
2150
+ type: "inline";
2253
2151
  };
2254
- customerId: string;
2152
+ screen: {
2153
+ kind: "screen";
2154
+ schemaVersion: 4;
2155
+ name: string;
2156
+ surface: "popup" | "paywall" | "onboarding" | "page" | "banner";
2157
+ presentation: {
2158
+ type: "modal";
2159
+ size: "sm" | "md" | "lg";
2160
+ desktopWidth?: {
2161
+ min: number;
2162
+ max: number;
2163
+ viewport: number;
2164
+ } | undefined;
2165
+ mobile?: "sheet" | "fullscreen" | undefined;
2166
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2167
+ position?: "center" | "top" | "bottom" | undefined;
2168
+ } | {
2169
+ type: "sheet";
2170
+ size: "sm" | "md" | "lg";
2171
+ desktopWidth?: {
2172
+ min: number;
2173
+ max: number;
2174
+ viewport: number;
2175
+ } | undefined;
2176
+ mobile?: "sheet" | "fullscreen" | undefined;
2177
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2178
+ } | {
2179
+ type: "fullscreen";
2180
+ } | {
2181
+ type: "inline";
2182
+ };
2183
+ theme: {
2184
+ primary: string;
2185
+ background: string;
2186
+ text: string;
2187
+ radius: "sm" | "md" | "lg" | "none" | "full";
2188
+ font: "system" | "serif" | "rounded" | "mono";
2189
+ fontAssets?: {
2190
+ family: string;
2191
+ faces: {
2192
+ url: string;
2193
+ weight: number;
2194
+ family?: string | undefined;
2195
+ }[];
2196
+ } | undefined;
2197
+ };
2198
+ pages: {
2199
+ id: string;
2200
+ name: string;
2201
+ root: StackNode;
2202
+ theme?: {
2203
+ primary: string;
2204
+ background: string;
2205
+ text: string;
2206
+ radius: "sm" | "md" | "lg" | "none" | "full";
2207
+ font: "system" | "serif" | "rounded" | "mono";
2208
+ fontAssets?: {
2209
+ family: string;
2210
+ faces: {
2211
+ url: string;
2212
+ weight: number;
2213
+ family?: string | undefined;
2214
+ }[];
2215
+ } | undefined;
2216
+ } | undefined;
2217
+ editorPosition?: {
2218
+ x: number;
2219
+ y: number;
2220
+ } | undefined;
2221
+ }[];
2222
+ strings: {
2223
+ defaultLocale: string;
2224
+ locales: Record<string, Record<string, string>>;
2225
+ };
2226
+ actions: ({
2227
+ type: "navigate";
2228
+ close: false;
2229
+ pageId: string;
2230
+ id: string;
2231
+ event: string;
2232
+ properties: Record<string, string | number | boolean | null>;
2233
+ } | {
2234
+ type: "event";
2235
+ close: boolean;
2236
+ id: string;
2237
+ event: string;
2238
+ properties: Record<string, string | number | boolean | null>;
2239
+ } | {
2240
+ type: "close";
2241
+ close: true;
2242
+ id: string;
2243
+ event: string;
2244
+ properties: Record<string, string | number | boolean | null>;
2245
+ } | {
2246
+ type: "open_url";
2247
+ close: boolean;
2248
+ url: string;
2249
+ id: string;
2250
+ event: string;
2251
+ properties: Record<string, string | number | boolean | null>;
2252
+ } | {
2253
+ type: "claim_offer";
2254
+ close: boolean;
2255
+ couponId: string;
2256
+ id: string;
2257
+ event: string;
2258
+ properties: Record<string, string | number | boolean | null>;
2259
+ })[];
2260
+ initialPageId?: string | undefined;
2261
+ };
2262
+ schemaVersion: 3;
2263
+ products: {
2264
+ items: {
2265
+ productVersionId: string;
2266
+ label: string;
2267
+ }[];
2268
+ defaultProductVersionId: string | null;
2269
+ grouping?: {
2270
+ tiers: {
2271
+ id: string;
2272
+ name: string;
2273
+ }[];
2274
+ assignments: {
2275
+ productVersionId: string;
2276
+ tierId: string;
2277
+ period: "month" | "year";
2278
+ }[];
2279
+ } | undefined;
2280
+ };
2281
+ offeringVersionId: string | null;
2282
+ buttons: Record<string, {
2283
+ type: "checkout";
2284
+ product: {
2285
+ type: "picker";
2286
+ pickerId: string;
2287
+ allowedProductVersionIds: string[];
2288
+ } | {
2289
+ type: "fixed";
2290
+ productVersionId: string;
2291
+ };
2292
+ } | {
2293
+ type: "close";
2294
+ } | {
2295
+ type: "action";
2296
+ action: {
2297
+ type: "event";
2298
+ event: string;
2299
+ } | {
2300
+ type: "open_url";
2301
+ url: string;
2302
+ };
2303
+ }>;
2304
+ };
2305
+ offering: {
2306
+ id: string;
2307
+ };
2308
+ capabilities: {
2309
+ nodes: Record<string, {
2310
+ base: {
2311
+ text?: string | undefined;
2312
+ label?: string | undefined;
2313
+ alt?: string | undefined;
2314
+ html?: string | undefined;
2315
+ price?: {
2316
+ current: string;
2317
+ original: string | null;
2318
+ period: string;
2319
+ } | undefined;
2320
+ code?: string | undefined;
2321
+ countdownAt?: string | undefined;
2322
+ planId?: string | undefined;
2323
+ planVersionId?: string | undefined;
2324
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
2325
+ couponId?: string | undefined;
2326
+ offerId?: string | undefined;
2327
+ unavailable?: boolean | undefined;
2328
+ unavailableReason?: string | undefined;
2329
+ missing?: string[] | undefined;
2330
+ };
2331
+ picker?: string | undefined;
2332
+ byPlan?: Record<string, {
2333
+ text?: string | undefined;
2334
+ label?: string | undefined;
2335
+ alt?: string | undefined;
2336
+ html?: string | undefined;
2337
+ price?: {
2338
+ current: string;
2339
+ original: string | null;
2340
+ period: string;
2341
+ } | undefined;
2342
+ code?: string | undefined;
2343
+ countdownAt?: string | undefined;
2344
+ planId?: string | undefined;
2345
+ planVersionId?: string | undefined;
2346
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
2347
+ couponId?: string | undefined;
2348
+ offerId?: string | undefined;
2349
+ unavailable?: boolean | undefined;
2350
+ unavailableReason?: string | undefined;
2351
+ missing?: string[] | undefined;
2352
+ }> | undefined;
2353
+ }>;
2354
+ plans: Record<string, {
2355
+ id: string;
2356
+ versionId: string;
2357
+ available: boolean;
2358
+ name: string;
2359
+ price: string;
2360
+ period: string;
2361
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
2362
+ amountMinor?: number | undefined;
2363
+ interval?: "free" | "week" | "month" | "year" | "one_time" | undefined;
2364
+ intervalCount?: number | undefined;
2365
+ prepaid?: {
2366
+ internalFeatureId: string;
2367
+ name: string;
2368
+ includedAmount: string;
2369
+ reset: "week" | "month" | "year" | "hour" | "day" | "lifetime";
2370
+ resetCount: number;
2371
+ terms: {
2372
+ units: string;
2373
+ prices: {
2374
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2375
+ amountMinor: number;
2376
+ pricing?: {
2377
+ kind: "graduated" | "volume";
2378
+ tiers: {
2379
+ upTo: number | null;
2380
+ unitAmountMinor: number;
2381
+ flatAmountMinor?: number | undefined;
2382
+ }[];
2383
+ } | undefined;
2384
+ }[];
2385
+ minimumQuantity: number;
2386
+ maximumQuantity: number;
2387
+ };
2388
+ }[] | undefined;
2389
+ }>;
2390
+ pickers: Record<string, {
2391
+ options: string[];
2392
+ selected: string | null;
2393
+ }>;
2394
+ diagnostics: {
2395
+ nodeId: string;
2396
+ message: string;
2397
+ }[];
2398
+ paywall?: {
2399
+ internal_feature_id: string;
2400
+ name: string;
2401
+ kind: "access" | "metered" | "credit";
2402
+ quantity: string;
2403
+ allowed: boolean;
2404
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
2405
+ preview: {
2406
+ scenario: "feature_flag" | "usage_limit";
2407
+ candidates: {
2408
+ productId: string;
2409
+ productVersionId: string;
2410
+ name: string;
2411
+ action: "purchase" | "upgrade" | "addon" | "topup";
2412
+ membershipId: string | null;
2413
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2414
+ amountMinor: string;
2415
+ interval: "free" | "week" | "month" | "year" | "one_time";
2416
+ intervalCount: number;
2417
+ featureQuantities?: Record<string, number> | undefined;
2418
+ }[];
2419
+ } | null;
2420
+ observation?: {
2421
+ subject: {
2422
+ scope: {
2423
+ projectId: string;
2424
+ environmentId: string;
2425
+ environment: "sandbox" | "live";
2426
+ };
2427
+ customerId: string;
2428
+ };
2429
+ authority: "longplay" | "merchant";
2430
+ observedAt: string;
2431
+ sourceRevision: string;
2432
+ requirementDigest: string;
2433
+ } | undefined;
2434
+ } | undefined;
2435
+ quantities?: Record<string, {
2436
+ minimum: number;
2437
+ maximum: number;
2438
+ step: number;
2439
+ value: number;
2440
+ label: string;
2441
+ available: boolean;
2442
+ }> | undefined;
2443
+ };
2444
+ check: {
2445
+ internal_feature_id: string;
2446
+ name: string;
2447
+ kind: "access" | "metered" | "credit";
2448
+ quantity: string;
2449
+ allowed: boolean;
2450
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
2451
+ preview: {
2452
+ scenario: "feature_flag" | "usage_limit";
2453
+ candidates: {
2454
+ productId: string;
2455
+ productVersionId: string;
2456
+ name: string;
2457
+ action: "purchase" | "upgrade" | "addon" | "topup";
2458
+ membershipId: string | null;
2459
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2460
+ amountMinor: string;
2461
+ interval: "free" | "week" | "month" | "year" | "one_time";
2462
+ intervalCount: number;
2463
+ featureQuantities?: Record<string, number> | undefined;
2464
+ }[];
2465
+ } | null;
2466
+ observation?: {
2467
+ subject: {
2468
+ scope: {
2469
+ projectId: string;
2470
+ environmentId: string;
2471
+ environment: "sandbox" | "live";
2472
+ };
2473
+ customerId: string;
2474
+ };
2475
+ authority: "longplay" | "merchant";
2476
+ observedAt: string;
2477
+ sourceRevision: string;
2478
+ requirementDigest: string;
2479
+ } | undefined;
2480
+ } | null;
2481
+ content?: {
2482
+ environmentId: string;
2483
+ offeringVersionId: string;
2484
+ artifact: {
2485
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
2486
+ formatVersion: number;
2487
+ url: string;
2488
+ sha256: string;
2489
+ byteLength: number;
2490
+ generation?: string | undefined;
2491
+ };
2492
+ } | undefined;
2493
+ };
2494
+ runId: string;
2495
+ receiptId: string;
2496
+ } | undefined;
2497
+ setPurchaseRecovery(message: string, retry?: () => void): boolean;
2498
+ retainPurchaseDialog(): {
2499
+ dialog: HTMLDialogElement;
2500
+ release(): void;
2501
+ } | undefined;
2502
+ readonly recovery: PaywallRecovery;
2503
+ prepareFallback(): Promise<PaywallRecovery>;
2504
+ review: (receiptId?: string) => Promise<void>;
2505
+ exitReview: () => Promise<void>;
2506
+ readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
2507
+ }>;
2508
+ /** Share an authenticated purchase observation and its current loading lifecycle. */
2509
+ declare function showObservedFunnelRun(container: HTMLElement, input: FunnelHostOptions, initialLoading?: ReturnType<typeof createPresentationLoading>): Promise<{
2510
+ destroy: () => void;
2511
+ refresh: () => Promise<void>;
2512
+ readonly recoveryPaywall: {
2513
+ view: {
2514
+ id: string;
2515
+ paywallId: string;
2516
+ version: number;
2517
+ document: {
2518
+ name: string;
2519
+ kind: "paywall";
2520
+ presentation: {
2521
+ type: "modal";
2522
+ size: "sm" | "md" | "lg";
2523
+ desktopWidth?: {
2524
+ min: number;
2525
+ max: number;
2526
+ viewport: number;
2527
+ } | undefined;
2528
+ mobile?: "sheet" | "fullscreen" | undefined;
2529
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2530
+ position?: "center" | "top" | "bottom" | undefined;
2531
+ } | {
2532
+ type: "sheet";
2533
+ size: "sm" | "md" | "lg";
2534
+ desktopWidth?: {
2535
+ min: number;
2536
+ max: number;
2537
+ viewport: number;
2538
+ } | undefined;
2539
+ mobile?: "sheet" | "fullscreen" | undefined;
2540
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2541
+ } | {
2542
+ type: "fullscreen";
2543
+ } | {
2544
+ type: "inline";
2545
+ };
2546
+ screen: {
2547
+ kind: "screen";
2548
+ schemaVersion: 4;
2549
+ name: string;
2550
+ surface: "popup" | "paywall" | "onboarding" | "page" | "banner";
2551
+ presentation: {
2552
+ type: "modal";
2553
+ size: "sm" | "md" | "lg";
2554
+ desktopWidth?: {
2555
+ min: number;
2556
+ max: number;
2557
+ viewport: number;
2558
+ } | undefined;
2559
+ mobile?: "sheet" | "fullscreen" | undefined;
2560
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2561
+ position?: "center" | "top" | "bottom" | undefined;
2562
+ } | {
2563
+ type: "sheet";
2564
+ size: "sm" | "md" | "lg";
2565
+ desktopWidth?: {
2566
+ min: number;
2567
+ max: number;
2568
+ viewport: number;
2569
+ } | undefined;
2570
+ mobile?: "sheet" | "fullscreen" | undefined;
2571
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
2572
+ } | {
2573
+ type: "fullscreen";
2574
+ } | {
2575
+ type: "inline";
2576
+ };
2577
+ theme: {
2578
+ primary: string;
2579
+ background: string;
2580
+ text: string;
2581
+ radius: "sm" | "md" | "lg" | "none" | "full";
2582
+ font: "system" | "serif" | "rounded" | "mono";
2583
+ fontAssets?: {
2584
+ family: string;
2585
+ faces: {
2586
+ url: string;
2587
+ weight: number;
2588
+ family?: string | undefined;
2589
+ }[];
2590
+ } | undefined;
2591
+ };
2592
+ pages: {
2593
+ id: string;
2594
+ name: string;
2595
+ root: StackNode;
2596
+ theme?: {
2597
+ primary: string;
2598
+ background: string;
2599
+ text: string;
2600
+ radius: "sm" | "md" | "lg" | "none" | "full";
2601
+ font: "system" | "serif" | "rounded" | "mono";
2602
+ fontAssets?: {
2603
+ family: string;
2604
+ faces: {
2605
+ url: string;
2606
+ weight: number;
2607
+ family?: string | undefined;
2608
+ }[];
2609
+ } | undefined;
2610
+ } | undefined;
2611
+ editorPosition?: {
2612
+ x: number;
2613
+ y: number;
2614
+ } | undefined;
2615
+ }[];
2616
+ strings: {
2617
+ defaultLocale: string;
2618
+ locales: Record<string, Record<string, string>>;
2619
+ };
2620
+ actions: ({
2621
+ type: "navigate";
2622
+ close: false;
2623
+ pageId: string;
2624
+ id: string;
2625
+ event: string;
2626
+ properties: Record<string, string | number | boolean | null>;
2627
+ } | {
2628
+ type: "event";
2629
+ close: boolean;
2630
+ id: string;
2631
+ event: string;
2632
+ properties: Record<string, string | number | boolean | null>;
2633
+ } | {
2634
+ type: "close";
2635
+ close: true;
2636
+ id: string;
2637
+ event: string;
2638
+ properties: Record<string, string | number | boolean | null>;
2639
+ } | {
2640
+ type: "open_url";
2641
+ close: boolean;
2642
+ url: string;
2643
+ id: string;
2644
+ event: string;
2645
+ properties: Record<string, string | number | boolean | null>;
2646
+ } | {
2647
+ type: "claim_offer";
2648
+ close: boolean;
2649
+ couponId: string;
2650
+ id: string;
2651
+ event: string;
2652
+ properties: Record<string, string | number | boolean | null>;
2653
+ })[];
2654
+ initialPageId?: string | undefined;
2655
+ };
2656
+ schemaVersion: 3;
2657
+ products: {
2658
+ items: {
2659
+ productVersionId: string;
2660
+ label: string;
2661
+ }[];
2662
+ defaultProductVersionId: string | null;
2663
+ grouping?: {
2664
+ tiers: {
2665
+ id: string;
2666
+ name: string;
2667
+ }[];
2668
+ assignments: {
2669
+ productVersionId: string;
2670
+ tierId: string;
2671
+ period: "month" | "year";
2672
+ }[];
2673
+ } | undefined;
2674
+ };
2675
+ offeringVersionId: string | null;
2676
+ buttons: Record<string, {
2677
+ type: "checkout";
2678
+ product: {
2679
+ type: "picker";
2680
+ pickerId: string;
2681
+ allowedProductVersionIds: string[];
2682
+ } | {
2683
+ type: "fixed";
2684
+ productVersionId: string;
2685
+ };
2686
+ } | {
2687
+ type: "close";
2688
+ } | {
2689
+ type: "action";
2690
+ action: {
2691
+ type: "event";
2692
+ event: string;
2693
+ } | {
2694
+ type: "open_url";
2695
+ url: string;
2696
+ };
2697
+ }>;
2698
+ };
2699
+ offering: {
2700
+ id: string;
2701
+ };
2702
+ capabilities: {
2703
+ nodes: Record<string, {
2704
+ base: {
2705
+ text?: string | undefined;
2706
+ label?: string | undefined;
2707
+ alt?: string | undefined;
2708
+ html?: string | undefined;
2709
+ price?: {
2710
+ current: string;
2711
+ original: string | null;
2712
+ period: string;
2713
+ } | undefined;
2714
+ code?: string | undefined;
2715
+ countdownAt?: string | undefined;
2716
+ planId?: string | undefined;
2717
+ planVersionId?: string | undefined;
2718
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
2719
+ couponId?: string | undefined;
2720
+ offerId?: string | undefined;
2721
+ unavailable?: boolean | undefined;
2722
+ unavailableReason?: string | undefined;
2723
+ missing?: string[] | undefined;
2724
+ };
2725
+ picker?: string | undefined;
2726
+ byPlan?: Record<string, {
2727
+ text?: string | undefined;
2728
+ label?: string | undefined;
2729
+ alt?: string | undefined;
2730
+ html?: string | undefined;
2731
+ price?: {
2732
+ current: string;
2733
+ original: string | null;
2734
+ period: string;
2735
+ } | undefined;
2736
+ code?: string | undefined;
2737
+ countdownAt?: string | undefined;
2738
+ planId?: string | undefined;
2739
+ planVersionId?: string | undefined;
2740
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
2741
+ couponId?: string | undefined;
2742
+ offerId?: string | undefined;
2743
+ unavailable?: boolean | undefined;
2744
+ unavailableReason?: string | undefined;
2745
+ missing?: string[] | undefined;
2746
+ }> | undefined;
2747
+ }>;
2748
+ plans: Record<string, {
2749
+ id: string;
2750
+ versionId: string;
2751
+ available: boolean;
2752
+ name: string;
2753
+ price: string;
2754
+ period: string;
2755
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
2756
+ amountMinor?: number | undefined;
2757
+ interval?: "free" | "week" | "month" | "year" | "one_time" | undefined;
2758
+ intervalCount?: number | undefined;
2759
+ prepaid?: {
2760
+ internalFeatureId: string;
2761
+ name: string;
2762
+ includedAmount: string;
2763
+ reset: "week" | "month" | "year" | "hour" | "day" | "lifetime";
2764
+ resetCount: number;
2765
+ terms: {
2766
+ units: string;
2767
+ prices: {
2768
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2769
+ amountMinor: number;
2770
+ pricing?: {
2771
+ kind: "graduated" | "volume";
2772
+ tiers: {
2773
+ upTo: number | null;
2774
+ unitAmountMinor: number;
2775
+ flatAmountMinor?: number | undefined;
2776
+ }[];
2777
+ } | undefined;
2778
+ }[];
2779
+ minimumQuantity: number;
2780
+ maximumQuantity: number;
2781
+ };
2782
+ }[] | undefined;
2783
+ }>;
2784
+ pickers: Record<string, {
2785
+ options: string[];
2786
+ selected: string | null;
2787
+ }>;
2788
+ diagnostics: {
2789
+ nodeId: string;
2790
+ message: string;
2791
+ }[];
2792
+ paywall?: {
2793
+ internal_feature_id: string;
2794
+ name: string;
2795
+ kind: "access" | "metered" | "credit";
2796
+ quantity: string;
2797
+ allowed: boolean;
2798
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
2799
+ preview: {
2800
+ scenario: "feature_flag" | "usage_limit";
2801
+ candidates: {
2802
+ productId: string;
2803
+ productVersionId: string;
2804
+ name: string;
2805
+ action: "purchase" | "upgrade" | "addon" | "topup";
2806
+ membershipId: string | null;
2807
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2808
+ amountMinor: string;
2809
+ interval: "free" | "week" | "month" | "year" | "one_time";
2810
+ intervalCount: number;
2811
+ featureQuantities?: Record<string, number> | undefined;
2812
+ }[];
2813
+ } | null;
2814
+ observation?: {
2815
+ subject: {
2816
+ scope: {
2817
+ projectId: string;
2818
+ environmentId: string;
2819
+ environment: "sandbox" | "live";
2820
+ };
2821
+ customerId: string;
2822
+ };
2823
+ authority: "longplay" | "merchant";
2824
+ observedAt: string;
2825
+ sourceRevision: string;
2826
+ requirementDigest: string;
2827
+ } | undefined;
2828
+ } | undefined;
2829
+ quantities?: Record<string, {
2830
+ minimum: number;
2831
+ maximum: number;
2832
+ step: number;
2833
+ value: number;
2834
+ label: string;
2835
+ available: boolean;
2836
+ }> | undefined;
2837
+ };
2838
+ check: {
2839
+ internal_feature_id: string;
2840
+ name: string;
2841
+ kind: "access" | "metered" | "credit";
2842
+ quantity: string;
2843
+ allowed: boolean;
2844
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
2845
+ preview: {
2846
+ scenario: "feature_flag" | "usage_limit";
2847
+ candidates: {
2848
+ productId: string;
2849
+ productVersionId: string;
2850
+ name: string;
2851
+ action: "purchase" | "upgrade" | "addon" | "topup";
2852
+ membershipId: string | null;
2853
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2854
+ amountMinor: string;
2855
+ interval: "free" | "week" | "month" | "year" | "one_time";
2856
+ intervalCount: number;
2857
+ featureQuantities?: Record<string, number> | undefined;
2858
+ }[];
2859
+ } | null;
2860
+ observation?: {
2861
+ subject: {
2862
+ scope: {
2863
+ projectId: string;
2864
+ environmentId: string;
2865
+ environment: "sandbox" | "live";
2866
+ };
2867
+ customerId: string;
2868
+ };
2869
+ authority: "longplay" | "merchant";
2870
+ observedAt: string;
2871
+ sourceRevision: string;
2872
+ requirementDigest: string;
2873
+ } | undefined;
2874
+ } | null;
2875
+ content?: {
2876
+ environmentId: string;
2877
+ offeringVersionId: string;
2878
+ artifact: {
2879
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
2880
+ formatVersion: number;
2881
+ url: string;
2882
+ sha256: string;
2883
+ byteLength: number;
2884
+ generation?: string | undefined;
2885
+ };
2886
+ } | undefined;
2887
+ };
2888
+ runId: string;
2889
+ receiptId: string;
2890
+ } | undefined;
2891
+ setPurchaseRecovery(message: string, retry?: () => void): boolean;
2892
+ retainPurchaseDialog(): {
2893
+ dialog: HTMLDialogElement;
2894
+ release(): void;
2895
+ } | undefined;
2896
+ readonly recovery: PaywallRecovery;
2897
+ prepareFallback(): Promise<PaywallRecovery>;
2898
+ review: (receiptId?: string) => Promise<void>;
2899
+ exitReview: () => Promise<void>;
2900
+ readonly unappliedDrafts: Map<string, Record<string, string | boolean | string[]>>;
2901
+ }>;
2902
+
2903
+ type FunnelPurchaseHostOptions = Omit<FunnelHostOptions, "client" | "checkoutNavigation" | "resolveOfferId" | "resumeCheckout" | "terminateCheckout"> & {
2904
+ /**
2905
+ * An already available Paywall design for the first frame, such as the predicted first
2906
+ * Paywall's (`predictedPaywallLoadingDocument`).
2907
+ */
2908
+ loadingDocument?: PaywallLoadingDocument;
2909
+ client: FunnelPurchaseClient;
2910
+ /**
2911
+ * Omit to recover only; no new attempt is allocated. A promise (the merchant's own checks still
2912
+ * running) shows the loading state at once and starts the Run when it settles; `null`,
2913
+ * `undefined` or a rejection ends the presentation without a Run, reported as `skipped`.
2914
+ */
2915
+ start?: FunnelPurchaseStart | Promise<FunnelPurchaseStart | null | undefined>;
2916
+ resolveOfferId?: (purchase: Parameters<NonNullable<FunnelHostOptions["resolveOfferId"]>>[0], attempt: FunnelPurchaseAttempt) => ReturnType<NonNullable<FunnelHostOptions["resolveOfferId"]>>;
2917
+ };
2918
+ type RunHost = Awaited<ReturnType<typeof showObservedFunnelRun>>;
2919
+ type Host = Omit<RunHost, "retainPurchaseDialog" | "recoveryPaywall" | "setPurchaseRecovery">;
2920
+ /**
2921
+ * An open Paywall stays visible while its original purchase is checked. A live Run can
2922
+ * replace a confirmed-unpaid Checkout only after it is terminated. An operation-only recovery
2923
+ * can read or continue the original purchase. An unused pre-rendered Paywall is released.
2924
+ */
2925
+ declare function showFunnelPurchase$1(container: HTMLElement, options: FunnelPurchaseHostOptions): Promise<Host | null>;
2926
+
2927
+ declare class MerchantBridgeError extends Error {
2928
+ readonly code: string;
2929
+ readonly status: number;
2930
+ readonly retryable: boolean;
2931
+ readonly recovery: string;
2932
+ constructor(code: string, status?: number, retryable?: boolean, recovery?: string);
2933
+ }
2934
+ type MerchantBridgeOptions = {
2935
+ origin: string;
2936
+ manifest: MerchantBridgeManifest;
2937
+ scope: Pick<MerchantBridgeManifest, "projectId" | "environmentId" | "environment">;
2938
+ /** Native merchant auth/CSRF headers only. Indiana credentials must never go to the merchant. */
2939
+ headers?: () => HeadersInit | Promise<HeadersInit>;
2940
+ customerId?: string;
2941
+ fetch?: typeof globalThis.fetch;
2942
+ signal?: AbortSignal;
2943
+ timeoutMs?: number;
2944
+ };
2945
+ /** User-facing standard bridge. No catalog secret, refund authority, automatic charge retry or automatic redirect. */
2946
+ declare function createMerchantBridge(options: MerchantBridgeOptions): {
2947
+ readPresentation(signal?: AbortSignal): Promise<{
2948
+ nativeUserId: string;
2949
+ presentation: {
2950
+ customerId: string;
2951
+ decisionId: string;
2952
+ offeringVersionId: string;
2953
+ paywallVersionId: string;
2954
+ variant: string;
2955
+ } | null;
2956
+ }>;
2957
+ createSession(signal?: AbortSignal): Promise<{
2958
+ customerId: string;
2959
+ sessionId: string;
2960
+ accessToken: string;
2961
+ refreshToken: string;
2962
+ expiresAt: string;
2963
+ refreshExpiresAt: string;
2964
+ }>;
2965
+ reportPresentation(input: {
2966
+ decisionId: string;
2967
+ eventId: string;
2968
+ }, signal?: AbortSignal): Promise<{
2969
+ queued: true;
2970
+ }>;
2971
+ readCustomerCommerce(signal?: AbortSignal): Promise<{
2972
+ customerId: string;
2973
+ revision: string;
2974
+ observedAt: string;
2975
+ subscriptions: {
2976
+ merchantSubscriptionId: string;
2977
+ merchantProductId: string;
2978
+ productVersionId: string | null;
2979
+ status: "active" | "cancelled" | "trialing" | "expired" | "past_due";
2980
+ currentPeriodStartsAt: string | null;
2981
+ currentPeriodEndsAt: string | null;
2982
+ cancelAtPeriodEnd: boolean;
2983
+ scheduledChange: {
2984
+ effectiveAt: string;
2985
+ merchantProductId: string;
2986
+ } | null;
2987
+ }[];
2988
+ purchaseHistory: {
2989
+ complete: boolean;
2990
+ hasPaidPurchase: boolean;
2991
+ lastPaidAt: string | null;
2992
+ };
2993
+ balances: {
2994
+ bucketId: string;
2995
+ key: string;
2996
+ available: string;
2997
+ expiresAt: string | null;
2998
+ nextResetAt: string | null;
2999
+ }[];
3000
+ }>;
3001
+ executePurchase(operationId: string, signal?: AbortSignal): Promise<{
3002
+ type: "purchase";
3003
+ merchantOrderId: string | null;
3004
+ paymentStatus: "unknown" | "failed" | "pending" | "expired" | "succeeded" | "not_started" | "not_required";
3005
+ checkoutUrl: string | null;
3006
+ checkoutExpiresAt: string | null;
3007
+ operationId: string;
3008
+ customerId: string;
3009
+ merchantExecutionId: string;
3010
+ fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
3011
+ recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
3012
+ updatedAt: string;
3013
+ problem: {
3014
+ phase: "execution" | "payment" | "fulfillment" | "recording";
3015
+ code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
3016
+ recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
3017
+ retryable: boolean;
3018
+ reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
3019
+ } | null;
3020
+ pollAfterMs: number | null;
3021
+ }>;
3022
+ readOperation: (operationId: string, signal?: AbortSignal) => Promise<{
3023
+ lookup: "found";
3024
+ operationId: string;
3025
+ customerId: string;
3026
+ execution: {
3027
+ type: "purchase";
3028
+ merchantOrderId: string | null;
3029
+ paymentStatus: "unknown" | "failed" | "pending" | "expired" | "succeeded" | "not_started" | "not_required";
3030
+ checkoutUrl: string | null;
3031
+ checkoutExpiresAt: string | null;
3032
+ operationId: string;
3033
+ customerId: string;
3034
+ merchantExecutionId: string;
3035
+ fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
3036
+ recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
3037
+ updatedAt: string;
3038
+ problem: {
3039
+ phase: "execution" | "payment" | "fulfillment" | "recording";
3040
+ code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
3041
+ recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
3042
+ retryable: boolean;
3043
+ reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
3044
+ } | null;
3045
+ pollAfterMs: number | null;
3046
+ } | {
3047
+ type: "subscription_change";
3048
+ status: "unknown" | "failed" | "pending" | "scheduled" | "applied";
3049
+ merchantSubscriptionId: string;
3050
+ scheduledFor: string | null;
3051
+ operationId: string;
3052
+ customerId: string;
3053
+ merchantExecutionId: string;
3054
+ fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
3055
+ recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
3056
+ updatedAt: string;
3057
+ problem: {
3058
+ phase: "execution" | "payment" | "fulfillment" | "recording";
3059
+ code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
3060
+ recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
3061
+ retryable: boolean;
3062
+ reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
3063
+ } | null;
3064
+ pollAfterMs: number | null;
3065
+ nextAction?: {
3066
+ type: "redirect";
3067
+ url: string;
3068
+ expiresAt: string;
3069
+ } | undefined;
3070
+ } | {
3071
+ type: "refund";
3072
+ status: "unknown" | "failed" | "pending" | "succeeded";
3073
+ merchantRefundId: string | null;
3074
+ operationId: string;
3075
+ customerId: string;
3076
+ merchantExecutionId: string;
3077
+ fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
3078
+ recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
3079
+ updatedAt: string;
3080
+ problem: {
3081
+ phase: "execution" | "payment" | "fulfillment" | "recording";
3082
+ code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
3083
+ recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
3084
+ retryable: boolean;
3085
+ reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
3086
+ } | null;
3087
+ pollAfterMs: number | null;
3088
+ };
3089
+ readAt: string;
3090
+ } | {
3091
+ lookup: "not_received";
3092
+ operationId: string;
3093
+ customerId: string;
3094
+ execution: null;
3095
+ readAt: string;
3096
+ }>;
3097
+ executeSubscriptionChange(operationId: string, signal?: AbortSignal): Promise<{
3098
+ type: "subscription_change";
3099
+ status: "unknown" | "failed" | "pending" | "scheduled" | "applied";
3100
+ merchantSubscriptionId: string;
3101
+ scheduledFor: string | null;
3102
+ operationId: string;
3103
+ customerId: string;
3104
+ merchantExecutionId: string;
3105
+ fulfillmentStatus: "failed" | "pending" | "applied" | "not_started" | "not_applicable";
3106
+ recordingStatus: "accepted" | "failed" | "pending" | "not_ready";
3107
+ updatedAt: string;
3108
+ problem: {
3109
+ phase: "execution" | "payment" | "fulfillment" | "recording";
3110
+ code: "INVALID_PROTOCOL_VERSION" | "UNSUPPORTED_PROTOCOL_VERSION" | "PROTOCOL_RETIRED" | "UNAUTHENTICATED" | "FORBIDDEN" | "SCOPE_MISMATCH" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "PAYLOAD_TOO_LARGE" | "RATE_LIMITED" | "SERVICE_UNAVAILABLE" | "NOT_CONFIGURED" | "CAPABILITY_UNAVAILABLE" | "INTERNAL_ERROR";
3111
+ recovery: "fix_request" | "authenticate" | "check_permissions" | "check_scope" | "resolve_conflict" | "reload_state" | "retry_same_request" | "configure_integration" | "check_availability" | "upgrade_sdk" | "recover_operation" | "contact_support";
3112
+ retryable: boolean;
3113
+ reason?: "CAPABILITY_NOT_ENABLED" | "INTEGRATION_MISSING" | "PROVIDER_CREDENTIAL_REJECTED" | "PRICE_BINDING_REQUIRED" | "IDEMPOTENCY_CONFLICT" | "RESULT_UNKNOWN" | "STATE_CHANGED" | "IDENTITY_CONTEXT_CHANGED" | "CUSTOMER_BINDING_CONFLICT" | "RUN_CONTRACT_MISMATCH" | "OPERATION_IN_PROGRESS" | "FUNNEL_VERSION_RETIRED" | "FUNNEL_PAUSED" | undefined;
3114
+ } | null;
3115
+ pollAfterMs: number | null;
3116
+ nextAction?: {
3117
+ type: "redirect";
3118
+ url: string;
3119
+ expiresAt: string;
3120
+ } | undefined;
3121
+ }>;
3122
+ /** Logout/account switch aborts outstanding work and drops the bound Customer. */
3123
+ reset(): void;
3124
+ };
3125
+
3126
+ type IamFunnelEntriesOptions = IndianaOptions & {
3127
+ scope: NonNullable<IndianaOptions["scope"]>;
3128
+ environmentId: string;
3129
+ appManifestRelease: string;
3130
+ session: NonNullable<IndianaOptions["session"]>;
3131
+ container: HTMLElement;
3132
+ /** Credential-free original starts survive reloads in this tab. Requires a full Customer session. */
3133
+ recoveryStorage?: Storage | false;
3134
+ /** Per-tab frequency state. A capped entry requires a full Customer session. */
3135
+ deliveryStorage?: Storage;
3136
+ host?: Omit<FunnelHostOptions, "client">;
3137
+ onStatus?: (status: string, entryId?: string) => void;
3138
+ };
3139
+ /** Explicitly installed Web presentation host. No source scan or automatic credential creation. */
3140
+ declare function createIamFunnelEntries(options: IamFunnelEntriesOptions): {
3141
+ start(): Promise<void>;
3142
+ refresh: () => Promise<void>;
3143
+ retry(): Promise<void>;
3144
+ destroy(): void;
3145
+ };
3146
+
3147
+ /** Uses the accepted Split key. No new bucketing, force override or anonymous exposure. */
3148
+ declare function createFunnelPageExperiments(options: {
3149
+ client: FunnelRunController;
3150
+ appManifestRelease: string;
3151
+ onError?: (error: unknown) => void;
3152
+ }): {
3153
+ start(): Promise<void>;
3154
+ refresh: () => Promise<void>;
3155
+ destroy(): void;
3156
+ };
3157
+
3158
+ type EntryDeliveryIdentity = {
3159
+ type: "customer" | "guest";
3160
+ id: string;
3161
+ };
3162
+
3163
+ type Entry = IamFunnelEntryDelivery["entries"][number];
3164
+ type Process = ReturnType<typeof createFunnelProcess>;
3165
+ type IamFunnelProcessEntriesOptions = Pick<IndianaOptions, "baseUrl" | "fetch" | "timeoutMs"> & {
3166
+ scope: NonNullable<IndianaOptions["scope"]>;
3167
+ environmentId: string;
3168
+ appManifestRelease: string;
3169
+ container: HTMLElement;
3170
+ /** Reuse the backend's durable process handle when recreating this entry after reload. */
3171
+ createProcess(entry: Entry): Process;
3172
+ host?: Omit<FunnelHostOptions, "client">;
3173
+ locale?: string;
3174
+ /** Required for session-capped entries. Return the current Customer ID or a per-tab guest ID, never a credential. Update it before syncIdentity(). */
3175
+ deliveryIdentity?: () => EntryDeliveryIdentity | undefined;
3176
+ deliveryStorage?: Storage;
3177
+ onStatus?: (status: string, entryId?: string) => void;
3178
+ };
3179
+ /** Explicit process-capable IAM host. Merely fetching configuration creates no identity. */
3180
+ declare function createIamFunnelProcessEntries(options: IamFunnelProcessEntriesOptions): {
3181
+ start(): Promise<void>;
3182
+ refresh: () => Promise<void>;
3183
+ retry(): Promise<void>;
3184
+ syncIdentity(): Promise<FunnelProcessRunView | undefined>;
3185
+ detach(): Promise<void>;
3186
+ destroy(): void;
3187
+ };
3188
+
3189
+ declare function showPaywall(container: HTMLElement, options: PaywallHostOptions): Promise<{
3190
+ check: {
3191
+ internal_feature_id: string;
3192
+ name: string;
3193
+ kind: "access" | "metered" | "credit";
3194
+ quantity: string;
3195
+ allowed: boolean;
3196
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
3197
+ preview: {
3198
+ scenario: "feature_flag" | "usage_limit";
3199
+ candidates: {
3200
+ productId: string;
3201
+ productVersionId: string;
3202
+ name: string;
3203
+ action: "purchase" | "upgrade" | "addon" | "topup";
3204
+ membershipId: string | null;
3205
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3206
+ amountMinor: string;
3207
+ interval: "free" | "week" | "month" | "year" | "one_time";
3208
+ intervalCount: number;
3209
+ featureQuantities?: Record<string, number> | undefined;
3210
+ }[];
3211
+ } | null;
3212
+ observation?: {
3213
+ subject: {
3214
+ scope: {
3215
+ projectId: string;
3216
+ environmentId: string;
3217
+ environment: "sandbox" | "live";
3218
+ };
3219
+ customerId: string;
3220
+ };
3221
+ authority: "longplay" | "merchant";
3222
+ observedAt: string;
3223
+ sourceRevision: string;
3224
+ requirementDigest: string;
3225
+ } | undefined;
3226
+ };
3227
+ host: null;
3228
+ } | {
3229
+ check: {
3230
+ internal_feature_id: string;
3231
+ name: string;
3232
+ kind: "access" | "metered" | "credit";
3233
+ quantity: string;
3234
+ allowed: boolean;
3235
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
3236
+ preview: {
3237
+ scenario: "feature_flag" | "usage_limit";
3238
+ candidates: {
3239
+ productId: string;
3240
+ productVersionId: string;
3241
+ name: string;
3242
+ action: "purchase" | "upgrade" | "addon" | "topup";
3243
+ membershipId: string | null;
3244
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3245
+ amountMinor: string;
3246
+ interval: "free" | "week" | "month" | "year" | "one_time";
3247
+ intervalCount: number;
3248
+ featureQuantities?: Record<string, number> | undefined;
3249
+ }[];
3250
+ } | null;
3251
+ observation?: {
3252
+ subject: {
3253
+ scope: {
3254
+ projectId: string;
3255
+ environmentId: string;
3256
+ environment: "sandbox" | "live";
3257
+ };
3258
+ customerId: string;
3259
+ };
3260
+ authority: "longplay" | "merchant";
3261
+ observedAt: string;
3262
+ sourceRevision: string;
3263
+ requirementDigest: string;
3264
+ } | undefined;
3265
+ } | null;
3266
+ host: {
3267
+ readonly currentResolution: {
3268
+ id: string;
3269
+ paywallId: string;
3270
+ version: number;
3271
+ document: {
3272
+ name: string;
3273
+ kind: "paywall";
3274
+ presentation: {
3275
+ type: "modal";
3276
+ size: "sm" | "md" | "lg";
3277
+ desktopWidth?: {
3278
+ min: number;
3279
+ max: number;
3280
+ viewport: number;
3281
+ } | undefined;
3282
+ mobile?: "sheet" | "fullscreen" | undefined;
3283
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3284
+ position?: "center" | "top" | "bottom" | undefined;
3285
+ } | {
3286
+ type: "sheet";
3287
+ size: "sm" | "md" | "lg";
3288
+ desktopWidth?: {
3289
+ min: number;
3290
+ max: number;
3291
+ viewport: number;
3292
+ } | undefined;
3293
+ mobile?: "sheet" | "fullscreen" | undefined;
3294
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3295
+ } | {
3296
+ type: "fullscreen";
3297
+ } | {
3298
+ type: "inline";
3299
+ };
3300
+ screen: {
3301
+ kind: "screen";
3302
+ schemaVersion: 4;
3303
+ name: string;
3304
+ surface: "popup" | "paywall" | "onboarding" | "page" | "banner";
3305
+ presentation: {
3306
+ type: "modal";
3307
+ size: "sm" | "md" | "lg";
3308
+ desktopWidth?: {
3309
+ min: number;
3310
+ max: number;
3311
+ viewport: number;
3312
+ } | undefined;
3313
+ mobile?: "sheet" | "fullscreen" | undefined;
3314
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3315
+ position?: "center" | "top" | "bottom" | undefined;
3316
+ } | {
3317
+ type: "sheet";
3318
+ size: "sm" | "md" | "lg";
3319
+ desktopWidth?: {
3320
+ min: number;
3321
+ max: number;
3322
+ viewport: number;
3323
+ } | undefined;
3324
+ mobile?: "sheet" | "fullscreen" | undefined;
3325
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3326
+ } | {
3327
+ type: "fullscreen";
3328
+ } | {
3329
+ type: "inline";
3330
+ };
3331
+ theme: {
3332
+ primary: string;
3333
+ background: string;
3334
+ text: string;
3335
+ radius: "sm" | "md" | "lg" | "none" | "full";
3336
+ font: "system" | "serif" | "rounded" | "mono";
3337
+ fontAssets?: {
3338
+ family: string;
3339
+ faces: {
3340
+ url: string;
3341
+ weight: number;
3342
+ family?: string | undefined;
3343
+ }[];
3344
+ } | undefined;
3345
+ };
3346
+ pages: {
3347
+ id: string;
3348
+ name: string;
3349
+ root: StackNode;
3350
+ theme?: {
3351
+ primary: string;
3352
+ background: string;
3353
+ text: string;
3354
+ radius: "sm" | "md" | "lg" | "none" | "full";
3355
+ font: "system" | "serif" | "rounded" | "mono";
3356
+ fontAssets?: {
3357
+ family: string;
3358
+ faces: {
3359
+ url: string;
3360
+ weight: number;
3361
+ family?: string | undefined;
3362
+ }[];
3363
+ } | undefined;
3364
+ } | undefined;
3365
+ editorPosition?: {
3366
+ x: number;
3367
+ y: number;
3368
+ } | undefined;
3369
+ }[];
3370
+ strings: {
3371
+ defaultLocale: string;
3372
+ locales: Record<string, Record<string, string>>;
3373
+ };
3374
+ actions: ({
3375
+ type: "navigate";
3376
+ close: false;
3377
+ pageId: string;
3378
+ id: string;
3379
+ event: string;
3380
+ properties: Record<string, string | number | boolean | null>;
3381
+ } | {
3382
+ type: "event";
3383
+ close: boolean;
3384
+ id: string;
3385
+ event: string;
3386
+ properties: Record<string, string | number | boolean | null>;
3387
+ } | {
3388
+ type: "close";
3389
+ close: true;
3390
+ id: string;
3391
+ event: string;
3392
+ properties: Record<string, string | number | boolean | null>;
3393
+ } | {
3394
+ type: "open_url";
3395
+ close: boolean;
3396
+ url: string;
3397
+ id: string;
3398
+ event: string;
3399
+ properties: Record<string, string | number | boolean | null>;
3400
+ } | {
3401
+ type: "claim_offer";
3402
+ close: boolean;
3403
+ couponId: string;
3404
+ id: string;
3405
+ event: string;
3406
+ properties: Record<string, string | number | boolean | null>;
3407
+ })[];
3408
+ initialPageId?: string | undefined;
3409
+ };
3410
+ schemaVersion: 3;
3411
+ products: {
3412
+ items: {
3413
+ productVersionId: string;
3414
+ label: string;
3415
+ }[];
3416
+ defaultProductVersionId: string | null;
3417
+ grouping?: {
3418
+ tiers: {
3419
+ id: string;
3420
+ name: string;
3421
+ }[];
3422
+ assignments: {
3423
+ productVersionId: string;
3424
+ tierId: string;
3425
+ period: "month" | "year";
3426
+ }[];
3427
+ } | undefined;
3428
+ };
3429
+ offeringVersionId: string | null;
3430
+ buttons: Record<string, {
3431
+ type: "checkout";
3432
+ product: {
3433
+ type: "picker";
3434
+ pickerId: string;
3435
+ allowedProductVersionIds: string[];
3436
+ } | {
3437
+ type: "fixed";
3438
+ productVersionId: string;
3439
+ };
3440
+ } | {
3441
+ type: "close";
3442
+ } | {
3443
+ type: "action";
3444
+ action: {
3445
+ type: "event";
3446
+ event: string;
3447
+ } | {
3448
+ type: "open_url";
3449
+ url: string;
3450
+ };
3451
+ }>;
3452
+ };
3453
+ offering: {
3454
+ id: string;
3455
+ };
3456
+ capabilities: {
3457
+ nodes: Record<string, {
3458
+ base: {
3459
+ text?: string | undefined;
3460
+ label?: string | undefined;
3461
+ alt?: string | undefined;
3462
+ html?: string | undefined;
3463
+ price?: {
3464
+ current: string;
3465
+ original: string | null;
3466
+ period: string;
3467
+ } | undefined;
3468
+ code?: string | undefined;
3469
+ countdownAt?: string | undefined;
3470
+ planId?: string | undefined;
3471
+ planVersionId?: string | undefined;
3472
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3473
+ couponId?: string | undefined;
3474
+ offerId?: string | undefined;
3475
+ unavailable?: boolean | undefined;
3476
+ unavailableReason?: string | undefined;
3477
+ missing?: string[] | undefined;
3478
+ };
3479
+ picker?: string | undefined;
3480
+ byPlan?: Record<string, {
3481
+ text?: string | undefined;
3482
+ label?: string | undefined;
3483
+ alt?: string | undefined;
3484
+ html?: string | undefined;
3485
+ price?: {
3486
+ current: string;
3487
+ original: string | null;
3488
+ period: string;
3489
+ } | undefined;
3490
+ code?: string | undefined;
3491
+ countdownAt?: string | undefined;
3492
+ planId?: string | undefined;
3493
+ planVersionId?: string | undefined;
3494
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3495
+ couponId?: string | undefined;
3496
+ offerId?: string | undefined;
3497
+ unavailable?: boolean | undefined;
3498
+ unavailableReason?: string | undefined;
3499
+ missing?: string[] | undefined;
3500
+ }> | undefined;
3501
+ }>;
3502
+ plans: Record<string, {
3503
+ id: string;
3504
+ versionId: string;
3505
+ available: boolean;
3506
+ name: string;
3507
+ price: string;
3508
+ period: string;
3509
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3510
+ amountMinor?: number | undefined;
3511
+ interval?: "free" | "week" | "month" | "year" | "one_time" | undefined;
3512
+ intervalCount?: number | undefined;
3513
+ prepaid?: {
3514
+ internalFeatureId: string;
3515
+ name: string;
3516
+ includedAmount: string;
3517
+ reset: "week" | "month" | "year" | "hour" | "day" | "lifetime";
3518
+ resetCount: number;
3519
+ terms: {
3520
+ units: string;
3521
+ prices: {
3522
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3523
+ amountMinor: number;
3524
+ pricing?: {
3525
+ kind: "graduated" | "volume";
3526
+ tiers: {
3527
+ upTo: number | null;
3528
+ unitAmountMinor: number;
3529
+ flatAmountMinor?: number | undefined;
3530
+ }[];
3531
+ } | undefined;
3532
+ }[];
3533
+ minimumQuantity: number;
3534
+ maximumQuantity: number;
3535
+ };
3536
+ }[] | undefined;
3537
+ }>;
3538
+ pickers: Record<string, {
3539
+ options: string[];
3540
+ selected: string | null;
3541
+ }>;
3542
+ diagnostics: {
3543
+ nodeId: string;
3544
+ message: string;
3545
+ }[];
3546
+ paywall?: {
3547
+ internal_feature_id: string;
3548
+ name: string;
3549
+ kind: "access" | "metered" | "credit";
3550
+ quantity: string;
3551
+ allowed: boolean;
3552
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
3553
+ preview: {
3554
+ scenario: "feature_flag" | "usage_limit";
3555
+ candidates: {
3556
+ productId: string;
3557
+ productVersionId: string;
3558
+ name: string;
3559
+ action: "purchase" | "upgrade" | "addon" | "topup";
3560
+ membershipId: string | null;
3561
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3562
+ amountMinor: string;
3563
+ interval: "free" | "week" | "month" | "year" | "one_time";
3564
+ intervalCount: number;
3565
+ featureQuantities?: Record<string, number> | undefined;
3566
+ }[];
3567
+ } | null;
3568
+ observation?: {
3569
+ subject: {
3570
+ scope: {
3571
+ projectId: string;
3572
+ environmentId: string;
3573
+ environment: "sandbox" | "live";
3574
+ };
3575
+ customerId: string;
3576
+ };
3577
+ authority: "longplay" | "merchant";
3578
+ observedAt: string;
3579
+ sourceRevision: string;
3580
+ requirementDigest: string;
3581
+ } | undefined;
3582
+ } | undefined;
3583
+ quantities?: Record<string, {
3584
+ minimum: number;
3585
+ maximum: number;
3586
+ step: number;
3587
+ value: number;
3588
+ label: string;
3589
+ available: boolean;
3590
+ }> | undefined;
3591
+ };
3592
+ check: {
3593
+ internal_feature_id: string;
3594
+ name: string;
3595
+ kind: "access" | "metered" | "credit";
3596
+ quantity: string;
3597
+ allowed: boolean;
3598
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
3599
+ preview: {
3600
+ scenario: "feature_flag" | "usage_limit";
3601
+ candidates: {
3602
+ productId: string;
3603
+ productVersionId: string;
3604
+ name: string;
3605
+ action: "purchase" | "upgrade" | "addon" | "topup";
3606
+ membershipId: string | null;
3607
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3608
+ amountMinor: string;
3609
+ interval: "free" | "week" | "month" | "year" | "one_time";
3610
+ intervalCount: number;
3611
+ featureQuantities?: Record<string, number> | undefined;
3612
+ }[];
3613
+ } | null;
3614
+ observation?: {
3615
+ subject: {
3616
+ scope: {
3617
+ projectId: string;
3618
+ environmentId: string;
3619
+ environment: "sandbox" | "live";
3620
+ };
3621
+ customerId: string;
3622
+ };
3623
+ authority: "longplay" | "merchant";
3624
+ observedAt: string;
3625
+ sourceRevision: string;
3626
+ requirementDigest: string;
3627
+ } | undefined;
3628
+ } | null;
3629
+ content?: {
3630
+ environmentId: string;
3631
+ offeringVersionId: string;
3632
+ artifact: {
3633
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
3634
+ formatVersion: number;
3635
+ url: string;
3636
+ sha256: string;
3637
+ byteLength: number;
3638
+ generation?: string | undefined;
3639
+ };
3640
+ } | undefined;
3641
+ };
3642
+ setPurchaseRecovery(message: string, retry?: () => void): void;
3643
+ readonly subscriptionUpgradeActive: boolean;
3644
+ readonly observing: boolean;
3645
+ readonly recovery: PaywallRecovery;
3646
+ prepareFallback(): Promise<PaywallRecovery>;
3647
+ setSuspended(value: boolean): void;
3648
+ destroy: (reason?: "destroy" | "dismiss" | "action", retainDialog?: boolean) => void;
3649
+ retainPurchaseDialog(): RetainedPurchaseDialog | undefined;
3650
+ refresh: () => Promise<{
3651
+ id: string;
3652
+ paywallId: string;
3653
+ version: number;
3654
+ document: {
3655
+ name: string;
3656
+ kind: "paywall";
3657
+ presentation: {
3658
+ type: "modal";
3659
+ size: "sm" | "md" | "lg";
3660
+ desktopWidth?: {
3661
+ min: number;
3662
+ max: number;
3663
+ viewport: number;
3664
+ } | undefined;
3665
+ mobile?: "sheet" | "fullscreen" | undefined;
3666
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3667
+ position?: "center" | "top" | "bottom" | undefined;
3668
+ } | {
3669
+ type: "sheet";
3670
+ size: "sm" | "md" | "lg";
3671
+ desktopWidth?: {
3672
+ min: number;
3673
+ max: number;
3674
+ viewport: number;
3675
+ } | undefined;
3676
+ mobile?: "sheet" | "fullscreen" | undefined;
3677
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3678
+ } | {
3679
+ type: "fullscreen";
3680
+ } | {
3681
+ type: "inline";
3682
+ };
3683
+ screen: {
3684
+ kind: "screen";
3685
+ schemaVersion: 4;
3686
+ name: string;
3687
+ surface: "popup" | "paywall" | "onboarding" | "page" | "banner";
3688
+ presentation: {
3689
+ type: "modal";
3690
+ size: "sm" | "md" | "lg";
3691
+ desktopWidth?: {
3692
+ min: number;
3693
+ max: number;
3694
+ viewport: number;
3695
+ } | undefined;
3696
+ mobile?: "sheet" | "fullscreen" | undefined;
3697
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3698
+ position?: "center" | "top" | "bottom" | undefined;
3699
+ } | {
3700
+ type: "sheet";
3701
+ size: "sm" | "md" | "lg";
3702
+ desktopWidth?: {
3703
+ min: number;
3704
+ max: number;
3705
+ viewport: number;
3706
+ } | undefined;
3707
+ mobile?: "sheet" | "fullscreen" | undefined;
3708
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
3709
+ } | {
3710
+ type: "fullscreen";
3711
+ } | {
3712
+ type: "inline";
3713
+ };
3714
+ theme: {
3715
+ primary: string;
3716
+ background: string;
3717
+ text: string;
3718
+ radius: "sm" | "md" | "lg" | "none" | "full";
3719
+ font: "system" | "serif" | "rounded" | "mono";
3720
+ fontAssets?: {
3721
+ family: string;
3722
+ faces: {
3723
+ url: string;
3724
+ weight: number;
3725
+ family?: string | undefined;
3726
+ }[];
3727
+ } | undefined;
3728
+ };
3729
+ pages: {
3730
+ id: string;
3731
+ name: string;
3732
+ root: StackNode;
3733
+ theme?: {
3734
+ primary: string;
3735
+ background: string;
3736
+ text: string;
3737
+ radius: "sm" | "md" | "lg" | "none" | "full";
3738
+ font: "system" | "serif" | "rounded" | "mono";
3739
+ fontAssets?: {
3740
+ family: string;
3741
+ faces: {
3742
+ url: string;
3743
+ weight: number;
3744
+ family?: string | undefined;
3745
+ }[];
3746
+ } | undefined;
3747
+ } | undefined;
3748
+ editorPosition?: {
3749
+ x: number;
3750
+ y: number;
3751
+ } | undefined;
3752
+ }[];
3753
+ strings: {
3754
+ defaultLocale: string;
3755
+ locales: Record<string, Record<string, string>>;
3756
+ };
3757
+ actions: ({
3758
+ type: "navigate";
3759
+ close: false;
3760
+ pageId: string;
3761
+ id: string;
3762
+ event: string;
3763
+ properties: Record<string, string | number | boolean | null>;
3764
+ } | {
3765
+ type: "event";
3766
+ close: boolean;
3767
+ id: string;
3768
+ event: string;
3769
+ properties: Record<string, string | number | boolean | null>;
3770
+ } | {
3771
+ type: "close";
3772
+ close: true;
3773
+ id: string;
3774
+ event: string;
3775
+ properties: Record<string, string | number | boolean | null>;
3776
+ } | {
3777
+ type: "open_url";
3778
+ close: boolean;
3779
+ url: string;
3780
+ id: string;
3781
+ event: string;
3782
+ properties: Record<string, string | number | boolean | null>;
3783
+ } | {
3784
+ type: "claim_offer";
3785
+ close: boolean;
3786
+ couponId: string;
3787
+ id: string;
3788
+ event: string;
3789
+ properties: Record<string, string | number | boolean | null>;
3790
+ })[];
3791
+ initialPageId?: string | undefined;
3792
+ };
3793
+ schemaVersion: 3;
3794
+ products: {
3795
+ items: {
3796
+ productVersionId: string;
3797
+ label: string;
3798
+ }[];
3799
+ defaultProductVersionId: string | null;
3800
+ grouping?: {
3801
+ tiers: {
3802
+ id: string;
3803
+ name: string;
3804
+ }[];
3805
+ assignments: {
3806
+ productVersionId: string;
3807
+ tierId: string;
3808
+ period: "month" | "year";
3809
+ }[];
3810
+ } | undefined;
3811
+ };
3812
+ offeringVersionId: string | null;
3813
+ buttons: Record<string, {
3814
+ type: "checkout";
3815
+ product: {
3816
+ type: "picker";
3817
+ pickerId: string;
3818
+ allowedProductVersionIds: string[];
3819
+ } | {
3820
+ type: "fixed";
3821
+ productVersionId: string;
3822
+ };
3823
+ } | {
3824
+ type: "close";
3825
+ } | {
3826
+ type: "action";
3827
+ action: {
3828
+ type: "event";
3829
+ event: string;
3830
+ } | {
3831
+ type: "open_url";
3832
+ url: string;
3833
+ };
3834
+ }>;
3835
+ };
3836
+ offering: {
3837
+ id: string;
3838
+ };
3839
+ capabilities: {
3840
+ nodes: Record<string, {
3841
+ base: {
3842
+ text?: string | undefined;
3843
+ label?: string | undefined;
3844
+ alt?: string | undefined;
3845
+ html?: string | undefined;
3846
+ price?: {
3847
+ current: string;
3848
+ original: string | null;
3849
+ period: string;
3850
+ } | undefined;
3851
+ code?: string | undefined;
3852
+ countdownAt?: string | undefined;
3853
+ planId?: string | undefined;
3854
+ planVersionId?: string | undefined;
3855
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3856
+ couponId?: string | undefined;
3857
+ offerId?: string | undefined;
3858
+ unavailable?: boolean | undefined;
3859
+ unavailableReason?: string | undefined;
3860
+ missing?: string[] | undefined;
3861
+ };
3862
+ picker?: string | undefined;
3863
+ byPlan?: Record<string, {
3864
+ text?: string | undefined;
3865
+ label?: string | undefined;
3866
+ alt?: string | undefined;
3867
+ html?: string | undefined;
3868
+ price?: {
3869
+ current: string;
3870
+ original: string | null;
3871
+ period: string;
3872
+ } | undefined;
3873
+ code?: string | undefined;
3874
+ countdownAt?: string | undefined;
3875
+ planId?: string | undefined;
3876
+ planVersionId?: string | undefined;
3877
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3878
+ couponId?: string | undefined;
3879
+ offerId?: string | undefined;
3880
+ unavailable?: boolean | undefined;
3881
+ unavailableReason?: string | undefined;
3882
+ missing?: string[] | undefined;
3883
+ }> | undefined;
3884
+ }>;
3885
+ plans: Record<string, {
3886
+ id: string;
3887
+ versionId: string;
3888
+ available: boolean;
3889
+ name: string;
3890
+ price: string;
3891
+ period: string;
3892
+ currency?: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON" | undefined;
3893
+ amountMinor?: number | undefined;
3894
+ interval?: "free" | "week" | "month" | "year" | "one_time" | undefined;
3895
+ intervalCount?: number | undefined;
3896
+ prepaid?: {
3897
+ internalFeatureId: string;
3898
+ name: string;
3899
+ includedAmount: string;
3900
+ reset: "week" | "month" | "year" | "hour" | "day" | "lifetime";
3901
+ resetCount: number;
3902
+ terms: {
3903
+ units: string;
3904
+ prices: {
3905
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3906
+ amountMinor: number;
3907
+ pricing?: {
3908
+ kind: "graduated" | "volume";
3909
+ tiers: {
3910
+ upTo: number | null;
3911
+ unitAmountMinor: number;
3912
+ flatAmountMinor?: number | undefined;
3913
+ }[];
3914
+ } | undefined;
3915
+ }[];
3916
+ minimumQuantity: number;
3917
+ maximumQuantity: number;
3918
+ };
3919
+ }[] | undefined;
3920
+ }>;
3921
+ pickers: Record<string, {
3922
+ options: string[];
3923
+ selected: string | null;
3924
+ }>;
3925
+ diagnostics: {
3926
+ nodeId: string;
3927
+ message: string;
3928
+ }[];
3929
+ paywall?: {
3930
+ internal_feature_id: string;
3931
+ name: string;
3932
+ kind: "access" | "metered" | "credit";
3933
+ quantity: string;
3934
+ allowed: boolean;
3935
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
3936
+ preview: {
3937
+ scenario: "feature_flag" | "usage_limit";
3938
+ candidates: {
3939
+ productId: string;
3940
+ productVersionId: string;
3941
+ name: string;
3942
+ action: "purchase" | "upgrade" | "addon" | "topup";
3943
+ membershipId: string | null;
3944
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3945
+ amountMinor: string;
3946
+ interval: "free" | "week" | "month" | "year" | "one_time";
3947
+ intervalCount: number;
3948
+ featureQuantities?: Record<string, number> | undefined;
3949
+ }[];
3950
+ } | null;
3951
+ observation?: {
3952
+ subject: {
3953
+ scope: {
3954
+ projectId: string;
3955
+ environmentId: string;
3956
+ environment: "sandbox" | "live";
3957
+ };
3958
+ customerId: string;
3959
+ };
3960
+ authority: "longplay" | "merchant";
3961
+ observedAt: string;
3962
+ sourceRevision: string;
3963
+ requirementDigest: string;
3964
+ } | undefined;
3965
+ } | undefined;
3966
+ quantities?: Record<string, {
3967
+ minimum: number;
3968
+ maximum: number;
3969
+ step: number;
3970
+ value: number;
3971
+ label: string;
3972
+ available: boolean;
3973
+ }> | undefined;
2255
3974
  };
2256
- authority: "longplay" | "merchant";
2257
- observedAt: string;
2258
- sourceRevision: string;
2259
- requirementDigest: string;
2260
- } | undefined;
2261
- };
2262
- host: null;
2263
- } | {
2264
- check: {
2265
- internal_feature_id: string;
2266
- name: string;
2267
- kind: "access" | "metered" | "credit";
2268
- quantity: string;
2269
- allowed: boolean;
2270
- reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
2271
- preview: {
2272
- scenario: "feature_flag" | "usage_limit";
2273
- candidates: {
2274
- productId: string;
2275
- productVersionId: string;
3975
+ check: {
3976
+ internal_feature_id: string;
2276
3977
  name: string;
2277
- action: "purchase" | "upgrade" | "addon" | "topup";
2278
- membershipId: string | null;
2279
- currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
2280
- amountMinor: string;
2281
- interval: "free" | "week" | "month" | "year" | "one_time";
2282
- intervalCount: number;
2283
- featureQuantities?: Record<string, number> | undefined;
2284
- }[];
2285
- } | null;
2286
- observation?: {
2287
- subject: {
2288
- scope: {
2289
- projectId: string;
2290
- environmentId: string;
2291
- environment: "sandbox" | "live";
3978
+ kind: "access" | "metered" | "credit";
3979
+ quantity: string;
3980
+ allowed: boolean;
3981
+ reason: "not_entitled" | "insufficient_balance" | "capacity_exceeded" | "limit_exceeded" | "awaiting_topup" | "authorization_required" | "payment_blocked" | "cash_budget_exceeded" | "unavailable" | "authentication_required" | null;
3982
+ preview: {
3983
+ scenario: "feature_flag" | "usage_limit";
3984
+ candidates: {
3985
+ productId: string;
3986
+ productVersionId: string;
3987
+ name: string;
3988
+ action: "purchase" | "upgrade" | "addon" | "topup";
3989
+ membershipId: string | null;
3990
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
3991
+ amountMinor: string;
3992
+ interval: "free" | "week" | "month" | "year" | "one_time";
3993
+ intervalCount: number;
3994
+ featureQuantities?: Record<string, number> | undefined;
3995
+ }[];
3996
+ } | null;
3997
+ observation?: {
3998
+ subject: {
3999
+ scope: {
4000
+ projectId: string;
4001
+ environmentId: string;
4002
+ environment: "sandbox" | "live";
4003
+ };
4004
+ customerId: string;
4005
+ };
4006
+ authority: "longplay" | "merchant";
4007
+ observedAt: string;
4008
+ sourceRevision: string;
4009
+ requirementDigest: string;
4010
+ } | undefined;
4011
+ } | null;
4012
+ content?: {
4013
+ environmentId: string;
4014
+ offeringVersionId: string;
4015
+ artifact: {
4016
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
4017
+ formatVersion: number;
4018
+ url: string;
4019
+ sha256: string;
4020
+ byteLength: number;
4021
+ generation?: string | undefined;
2292
4022
  };
2293
- customerId: string;
2294
- };
2295
- authority: "longplay" | "merchant";
2296
- observedAt: string;
2297
- sourceRevision: string;
2298
- requirementDigest: string;
2299
- } | undefined;
2300
- } | null;
2301
- host: {
2302
- readonly subscriptionUpgradeActive: boolean;
2303
- readonly observing: boolean;
2304
- readonly recovery: PaywallRecovery;
2305
- prepareFallback(): Promise<PaywallRecovery>;
2306
- setSuspended(value: boolean): void;
2307
- destroy: (reason?: "destroy" | "dismiss" | "action", retainDialog?: boolean) => void;
2308
- retainPurchaseDialog(): RetainedPurchaseDialog | undefined;
2309
- refresh: () => Promise<{
4023
+ } | undefined;
4024
+ }>;
4025
+ };
4026
+ }>;
4027
+ /** Load presentation code without starting a session; return the public Paywall factory. */
4028
+ declare function preloadPaywall(): Promise<typeof showPaywall>;
4029
+ declare function createPaywallSession(...args: Parameters<typeof createPaywallSession$1>): Promise<PaywallSession>;
4030
+
4031
+ /** Loading customer API clients does not initialize the UI renderer. */
4032
+ declare function showFunnelRun(...args: Parameters<typeof showFunnelRun$1>): Promise<{
4033
+ destroy: () => void;
4034
+ refresh: () => Promise<void>;
4035
+ readonly recoveryPaywall: {
4036
+ view: {
2310
4037
  id: string;
2311
4038
  paywallId: string;
2312
4039
  version: number;
@@ -2680,17 +4407,11 @@ declare function showPaywall(container: HTMLElement, options: PaywallHostOptions
2680
4407
  generation?: string | undefined;
2681
4408
  };
2682
4409
  } | undefined;
2683
- }>;
2684
- };
2685
- }>;
2686
- /** Load presentation code without starting a session; return the public Paywall factory. */
2687
- declare function preloadPaywall(): Promise<typeof showPaywall>;
2688
- declare function createPaywallSession(...args: Parameters<typeof createPaywallSession$1>): Promise<PaywallSession>;
2689
-
2690
- /** Loading customer API clients does not initialize the UI renderer. */
2691
- declare function showFunnelRun(...args: Parameters<typeof showFunnelRun$1>): Promise<{
2692
- destroy: () => void;
2693
- refresh: () => Promise<void>;
4410
+ };
4411
+ runId: string;
4412
+ receiptId: string;
4413
+ } | undefined;
4414
+ setPurchaseRecovery(message: string, retry?: () => void): boolean;
2694
4415
  retainPurchaseDialog(): {
2695
4416
  dialog: HTMLDialogElement;
2696
4417
  release(): void;
@@ -2737,6 +4458,193 @@ declare function predictFunnelStart(...args: Parameters<typeof predictFunnelStar
2737
4458
  /** The published design of a predicted first Paywall, for a loading state. */
2738
4459
  declare function predictedPaywallLoadingDocument(...args: Parameters<typeof predictedPaywallLoadingDocument$1>): Promise<PaywallLoadingDocument | null>;
2739
4460
 
4461
+ /** Render the original verified purchase within the host’s open dialog. */
4462
+ declare function mountFunnelRecoveryPaywall(...args: Parameters<typeof mountFunnelRecoveryPaywall$1>): Promise<{
4463
+ document: {
4464
+ name: string;
4465
+ kind: "paywall";
4466
+ presentation: {
4467
+ type: "modal";
4468
+ size: "sm" | "md" | "lg";
4469
+ desktopWidth?: {
4470
+ min: number;
4471
+ max: number;
4472
+ viewport: number;
4473
+ } | undefined;
4474
+ mobile?: "sheet" | "fullscreen" | undefined;
4475
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
4476
+ position?: "center" | "top" | "bottom" | undefined;
4477
+ } | {
4478
+ type: "sheet";
4479
+ size: "sm" | "md" | "lg";
4480
+ desktopWidth?: {
4481
+ min: number;
4482
+ max: number;
4483
+ viewport: number;
4484
+ } | undefined;
4485
+ mobile?: "sheet" | "fullscreen" | undefined;
4486
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
4487
+ } | {
4488
+ type: "fullscreen";
4489
+ } | {
4490
+ type: "inline";
4491
+ };
4492
+ screen: {
4493
+ kind: "screen";
4494
+ schemaVersion: 4;
4495
+ name: string;
4496
+ surface: "popup" | "paywall" | "onboarding" | "page" | "banner";
4497
+ presentation: {
4498
+ type: "modal";
4499
+ size: "sm" | "md" | "lg";
4500
+ desktopWidth?: {
4501
+ min: number;
4502
+ max: number;
4503
+ viewport: number;
4504
+ } | undefined;
4505
+ mobile?: "sheet" | "fullscreen" | undefined;
4506
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
4507
+ position?: "center" | "top" | "bottom" | undefined;
4508
+ } | {
4509
+ type: "sheet";
4510
+ size: "sm" | "md" | "lg";
4511
+ desktopWidth?: {
4512
+ min: number;
4513
+ max: number;
4514
+ viewport: number;
4515
+ } | undefined;
4516
+ mobile?: "sheet" | "fullscreen" | undefined;
4517
+ backdrop?: "none" | "scrim" | "dim" | "strong-dim" | "blur" | undefined;
4518
+ } | {
4519
+ type: "fullscreen";
4520
+ } | {
4521
+ type: "inline";
4522
+ };
4523
+ theme: {
4524
+ primary: string;
4525
+ background: string;
4526
+ text: string;
4527
+ radius: "sm" | "md" | "lg" | "none" | "full";
4528
+ font: "system" | "serif" | "rounded" | "mono";
4529
+ fontAssets?: {
4530
+ family: string;
4531
+ faces: {
4532
+ url: string;
4533
+ weight: number;
4534
+ family?: string | undefined;
4535
+ }[];
4536
+ } | undefined;
4537
+ };
4538
+ pages: {
4539
+ id: string;
4540
+ name: string;
4541
+ root: StackNode;
4542
+ theme?: {
4543
+ primary: string;
4544
+ background: string;
4545
+ text: string;
4546
+ radius: "sm" | "md" | "lg" | "none" | "full";
4547
+ font: "system" | "serif" | "rounded" | "mono";
4548
+ fontAssets?: {
4549
+ family: string;
4550
+ faces: {
4551
+ url: string;
4552
+ weight: number;
4553
+ family?: string | undefined;
4554
+ }[];
4555
+ } | undefined;
4556
+ } | undefined;
4557
+ editorPosition?: {
4558
+ x: number;
4559
+ y: number;
4560
+ } | undefined;
4561
+ }[];
4562
+ strings: {
4563
+ defaultLocale: string;
4564
+ locales: Record<string, Record<string, string>>;
4565
+ };
4566
+ actions: ({
4567
+ type: "navigate";
4568
+ close: false;
4569
+ pageId: string;
4570
+ id: string;
4571
+ event: string;
4572
+ properties: Record<string, string | number | boolean | null>;
4573
+ } | {
4574
+ type: "event";
4575
+ close: boolean;
4576
+ id: string;
4577
+ event: string;
4578
+ properties: Record<string, string | number | boolean | null>;
4579
+ } | {
4580
+ type: "close";
4581
+ close: true;
4582
+ id: string;
4583
+ event: string;
4584
+ properties: Record<string, string | number | boolean | null>;
4585
+ } | {
4586
+ type: "open_url";
4587
+ close: boolean;
4588
+ url: string;
4589
+ id: string;
4590
+ event: string;
4591
+ properties: Record<string, string | number | boolean | null>;
4592
+ } | {
4593
+ type: "claim_offer";
4594
+ close: boolean;
4595
+ couponId: string;
4596
+ id: string;
4597
+ event: string;
4598
+ properties: Record<string, string | number | boolean | null>;
4599
+ })[];
4600
+ initialPageId?: string | undefined;
4601
+ };
4602
+ schemaVersion: 3;
4603
+ products: {
4604
+ items: {
4605
+ productVersionId: string;
4606
+ label: string;
4607
+ }[];
4608
+ defaultProductVersionId: string | null;
4609
+ grouping?: {
4610
+ tiers: {
4611
+ id: string;
4612
+ name: string;
4613
+ }[];
4614
+ assignments: {
4615
+ productVersionId: string;
4616
+ tierId: string;
4617
+ period: "month" | "year";
4618
+ }[];
4619
+ } | undefined;
4620
+ };
4621
+ offeringVersionId: string | null;
4622
+ buttons: Record<string, {
4623
+ type: "checkout";
4624
+ product: {
4625
+ type: "picker";
4626
+ pickerId: string;
4627
+ allowedProductVersionIds: string[];
4628
+ } | {
4629
+ type: "fixed";
4630
+ productVersionId: string;
4631
+ };
4632
+ } | {
4633
+ type: "close";
4634
+ } | {
4635
+ type: "action";
4636
+ action: {
4637
+ type: "event";
4638
+ event: string;
4639
+ } | {
4640
+ type: "open_url";
4641
+ url: string;
4642
+ };
4643
+ }>;
4644
+ };
4645
+ destroy: () => void;
4646
+ } | null>;
4647
+
2740
4648
  declare function mountContent(...args: Parameters<typeof mountContent$1>): Promise<{
2741
4649
  destroy: () => void;
2742
4650
  show: () => void;
@@ -2755,4 +4663,4 @@ declare function prepareContent(...args: Parameters<typeof prepareContent$1>): P
2755
4663
  updateCapabilities(data: SurfaceData): void;
2756
4664
  }>;
2757
4665
 
2758
- export { ConfigurationSync, type ContentActionIntent, type ContentHostOptions, EntitlementCheckResult, FunnelCommandStorage, FunnelExecutionPolicy, type FunnelHostOptions, type FunnelPurchaseAttempt, type FunnelPurchaseClient, type FunnelPurchaseEntry, type FunnelPurchaseHostOptions, type FunnelPurchaseOptions, type FunnelPurchaseStart, type FunnelPurchaseState, type FunnelPurchaseStorage, FunnelRunController, type FunnelStartPrediction, type IamFunnelEntriesOptions, type IamFunnelProcessEntriesOptions, IndianaOptions as LongplayOptions, MerchantBridgeError, type MerchantBridgeOptions, Offer, type PaywallHostOptions, PaywallLoadingDocument, PaywallOperation, type PaywallPurchaseIntent, PaywallQuote, PaywallRecovery, PaywallSession, PaywallSubscriptionChange, type PreparedFunnelPurchase, type PreparedState, PresentationLoadingOptions, SessionCredentials, createBrowserFunnelCommandStorage, createBrowserFunnelPurchaseStorage, createFunnelPageExperiments, createFunnelProcess, createFunnelPurchaseClient, createIamFunnelEntries, createIamFunnelProcessEntries, createMerchantBridge, createPaywallSession, formatCouponDiscount, formatCouponMoney, formatCouponTerms, mountContent, predictFunnelStart, predictedPaywallLoadingDocument, preloadFunnelPurchase, preloadPaywall, prepareContent, prerenderFunnelPurchase, showFunnelPurchase, showFunnelRun, showPaywall };
4666
+ export { ConfigurationSync, type ContentActionIntent, type ContentHostOptions, EntitlementCheckResult, FunnelCommandStorage, FunnelExecutionPolicy, type FunnelHostOptions, type FunnelPurchaseAttempt, type FunnelPurchaseClient, type FunnelPurchaseEntry, type FunnelPurchaseHostOptions, type FunnelPurchaseOptions, type FunnelPurchaseStart, type FunnelPurchaseState, type FunnelPurchaseStorage, FunnelRunController, type FunnelStartPrediction, type IamFunnelEntriesOptions, type IamFunnelProcessEntriesOptions, IndianaOptions as LongplayOptions, MerchantBridgeError, type MerchantBridgeOptions, Offer, type PaywallHostOptions, PaywallLoadingDocument, PaywallOperation, type PaywallPurchaseIntent, PaywallQuote, PaywallRecovery, PaywallSession, PaywallSubscriptionChange, type PreparedFunnelPurchase, type PreparedState, PresentationLoadingOptions, SessionCredentials, createBrowserFunnelCommandStorage, createBrowserFunnelPurchaseStorage, createFunnelPageExperiments, createFunnelProcess, createFunnelPurchaseClient, createIamFunnelEntries, createIamFunnelProcessEntries, createMerchantBridge, createPaywallSession, formatCouponDiscount, formatCouponMoney, formatCouponTerms, mountContent, mountFunnelRecoveryPaywall, predictFunnelStart, predictedPaywallLoadingDocument, preloadFunnelPurchase, preloadPaywall, prepareContent, prerenderFunnelPurchase, showFunnelPurchase, showFunnelRun, showPaywall };