@tinkerlandai/longplay-sdk 0.10.66 → 0.10.67

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 (91) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1 -1
  3. package/dist/check-response-754GDUOJ.js +1 -0
  4. package/dist/{chunk-O5YYORDW.js → chunk-26QYDE7V.js} +1 -1
  5. package/dist/{chunk-SAPICYY3.js → chunk-2SSOV3OG.js} +1 -1
  6. package/dist/{chunk-N5HX3K5J.js → chunk-2ZMIM4MO.js} +1 -1
  7. package/dist/{chunk-HT5SLWWG.js → chunk-3454S2FL.js} +1 -1
  8. package/dist/{chunk-AD35L6BX.js → chunk-3NV6NBQB.js} +1 -1
  9. package/dist/{chunk-MNICOIQ6.js → chunk-44ZJPQM6.js} +1 -1
  10. package/dist/{chunk-OT55LG4U.js → chunk-4XHSDZ4N.js} +1 -1
  11. package/dist/{chunk-K675GO7R.js → chunk-57ZXT7AS.js} +1 -1
  12. package/dist/{chunk-RNCUAYLQ.js → chunk-5NCQOJR2.js} +1 -1
  13. package/dist/{chunk-IGE2UMXG.js → chunk-6C3ARFEL.js} +1 -1
  14. package/dist/{chunk-A22QPPNY.js → chunk-6GY2YT3U.js} +1 -1
  15. package/dist/chunk-AY3SB6ZI.js +1 -0
  16. package/dist/{chunk-YA5YKHDE.js → chunk-BLH6AF6U.js} +1 -1
  17. package/dist/{chunk-JBN6ADWQ.js → chunk-CQ5EQNQA.js} +1 -1
  18. package/dist/{chunk-PQ4ISW55.js → chunk-CWBBW6QS.js} +1 -1
  19. package/dist/{chunk-OFG3SGEX.js → chunk-DFSBT7N6.js} +1 -1
  20. package/dist/{chunk-PNX7Y2K3.js → chunk-DXNTXCSI.js} +1 -1
  21. package/dist/{chunk-OKPWZZZW.js → chunk-DZYMD4MJ.js} +1 -1
  22. package/dist/{chunk-FUP5JVDE.js → chunk-ECUGL7AO.js} +1 -1
  23. package/dist/{chunk-56YCOGQZ.js → chunk-EJSTRCBQ.js} +1 -1
  24. package/dist/{chunk-47FCHF3Y.js → chunk-EQ64JD4L.js} +1 -1
  25. package/dist/{chunk-Q523TPZM.js → chunk-JW4MSBYN.js} +1 -1
  26. package/dist/{chunk-7EENIOSJ.js → chunk-KJTHMRSH.js} +1 -1
  27. package/dist/{chunk-KVLOMX2G.js → chunk-LBYMDTGD.js} +1 -1
  28. package/dist/{chunk-7OJIW75D.js → chunk-LUVTP4VU.js} +1 -1
  29. package/dist/chunk-N3S35ZVH.js +1 -0
  30. package/dist/{chunk-74T76RE4.js → chunk-NEW77IDA.js} +1 -1
  31. package/dist/{chunk-G2OLUFYT.js → chunk-NNJ7W4KY.js} +1 -1
  32. package/dist/chunk-P2OZG34H.js +1 -0
  33. package/dist/{chunk-ZWNWVMCH.js → chunk-Q4GG33R5.js} +1 -1
  34. package/dist/{chunk-5WFI36LF.js → chunk-QTXHF27F.js} +1 -1
  35. package/dist/{chunk-ZLSZBGJG.js → chunk-RDMNLOWQ.js} +1 -1
  36. package/dist/{chunk-DCMA7W7N.js → chunk-RMR64P6V.js} +1 -1
  37. package/dist/{chunk-7D5462NE.js → chunk-SFTMGGY4.js} +1 -1
  38. package/dist/{chunk-E3FUZSTM.js → chunk-SGOVJD5P.js} +1 -1
  39. package/dist/{chunk-YUL23NAW.js → chunk-T5SCW4IA.js} +1 -1
  40. package/dist/{chunk-M6MXJHJ5.js → chunk-TDM3ZUZS.js} +1 -1
  41. package/dist/{chunk-XIBJF5E6.js → chunk-TFPLIX5E.js} +1 -1
  42. package/dist/{chunk-TXVLJFZG.js → chunk-ULED3B5P.js} +1 -1
  43. package/dist/{chunk-QPVA644N.js → chunk-USH4WN6W.js} +1 -1
  44. package/dist/{chunk-EYTP23EK.js → chunk-VE2NUFUU.js} +1 -1
  45. package/dist/{chunk-45MWDZ42.js → chunk-VMYLTNDS.js} +1 -1
  46. package/dist/{chunk-3Q3DZEP3.js → chunk-WVTKVQLZ.js} +1 -1
  47. package/dist/{chunk-RHILCVPZ.js → chunk-XAJEVHTU.js} +1 -1
  48. package/dist/{chunk-GE6RSO2C.js → chunk-YDPF2ZZW.js} +1 -1
  49. package/dist/{chunk-C5FSL4XH.js → chunk-YTURNXJA.js} +2 -2
  50. package/dist/{chunk-46USIMCJ.js → chunk-ZRU7WONE.js} +1 -1
  51. package/dist/{content-WWME7E27.js → content-AG3EPSZT.js} +1 -1
  52. package/dist/{funnel-host-purchase-XIGJ7P7M.js → funnel-host-purchase-63Y6YLAW.js} +1 -1
  53. package/dist/{funnel-host-recovery-paywall-POMEY6I2.js → funnel-host-recovery-paywall-IE5C2X7L.js} +1 -1
  54. package/dist/funnel-paywall-copies-A76T5V7B.js +1 -0
  55. package/dist/funnel-paywall-prerender-ZFSTTVBW.js +1 -0
  56. package/dist/funnel-route-prediction-KFUCAJLL.js +1 -0
  57. package/dist/funnel-route-source-WEYKNM2C.js +1 -0
  58. package/dist/funnel-runtime-host-VDWINOKR.js +1 -0
  59. package/dist/index.d.ts +10 -6
  60. package/dist/index.js +1 -1
  61. package/dist/merchant-bridge-contracts-RWNJHBTR.js +1 -0
  62. package/dist/native-shell.js +1 -1
  63. package/dist/openrouter.js +1 -1
  64. package/dist/operation-contracts-NNWS467N.js +1 -0
  65. package/dist/page.js +1 -1
  66. package/dist/paywall-MAJJ2AKD.js +1 -0
  67. package/dist/paywall-content-64XRKMNN.js +1 -0
  68. package/dist/paywall-session-JFAJ3A7C.js +1 -0
  69. package/dist/popup.js +1 -1
  70. package/dist/react-native.js +1 -1
  71. package/dist/screen-renderer-H3FBGJZB.js +1 -0
  72. package/dist/server.js +1 -1
  73. package/dist/visual.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/check-response-WOTPYNDN.js +0 -1
  76. package/dist/chunk-7NKBMAOB.js +0 -1
  77. package/dist/chunk-MUCDKWMP.js +0 -1
  78. package/dist/chunk-MUP7FNNY.js +0 -1
  79. package/dist/funnel-paywall-copies-DUZ3YX67.js +0 -1
  80. package/dist/funnel-paywall-prerender-5NU457SR.js +0 -1
  81. package/dist/funnel-route-prediction-EW3HVH46.js +0 -1
  82. package/dist/funnel-route-source-YVFAFCVG.js +0 -1
  83. package/dist/funnel-runtime-host-J2HWW5IN.js +0 -1
  84. package/dist/merchant-bridge-contracts-PNRVNTCN.js +0 -1
  85. package/dist/operation-contracts-6ORJSGYH.js +0 -1
  86. package/dist/paywall-YRB7LQUS.js +0 -1
  87. package/dist/paywall-content-QLJIOFR3.js +0 -1
  88. package/dist/paywall-session-Q6ZYXUOU.js +0 -1
  89. package/dist/screen-renderer-P6U5UBFX.js +0 -1
  90. /package/dist/{chunk-YLH3AYCK.js → chunk-S7NHVERO.js} +0 -0
  91. /package/dist/{chunk-C5FSL4XH.js.LEGAL.txt → chunk-YTURNXJA.js.LEGAL.txt} +0 -0
@@ -1 +1 @@
1
- import"./chunk-IGE2UMXG.js";import"./chunk-RNCUAYLQ.js";import"./chunk-7D5462NE.js";import"./chunk-7EENIOSJ.js";import{a as i}from"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import{b as A}from"./chunk-YLH3AYCK.js";import"./chunk-WOT6VMZA.js";var c=A.number().int().min(0).max(1e9);function R(e,o){let a=c.parse(e.promptTokens),p=c.parse(e.completionTokens),s=c.parse(e.promptTokensDetails?.cachedTokens??0),t=c.parse(e.promptTokensDetails?.cacheWriteTokens??0),r=c.parse(e.promptTokensDetails?.audioTokens??0),l=c.parse(e.completionTokensDetails?.audioTokens??0),n=c.parse(e.completionTokensDetails?.reasoningTokens??0);if(c.parse(e.totalTokens)!==a+p||s+t+r>a||n+l>p||(e.promptTokensDetails?.videoTokens??0)>0)throw new i("AI_USAGE_UNAVAILABLE","Token pools must conserve usage; video needs an explicit token mapper");return{input:a-s-t-r,output:p-l-(o==="separate"?n:0),cache_read:s,cache_write:t,input_audio:r,output_audio:l,reasoning:o==="separate"?n:0}}function I(e){if(!Number.isFinite(e)||e<0)throw new i("AI_USAGE_UNAVAILABLE","Provider cost must be a nonnegative USD amount");let o=String(e),a=o.includes("e")?e.toFixed(18).replace(/0+$/,"").replace(/\.$/,""):o;if(!/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/.test(a)||Number(a)!==e)throw new i("AI_USAGE_UNAVAILABLE","Provider cost exceeds the supported precision");return a}async function f(e){if(typeof window<"u")throw new i("SERVER_ONLY","OpenRouter accounting requires your backend");if(!["output","separate"].includes(e.reasoning)||!e.modelId||!e.generationId)throw new i("INVALID_REQUEST","Actual model, generation ID and reasoning pricing are required");let o={context:e.context,generationId:e.generationId,modelId:`openrouter/${e.modelId}`,usage:e.usage,tokens:null,quote:null,receipt:null,phase:"captured"};await e.persist(o);let a=e.mapTokens?e.mapTokens(e.usage):R(e.usage,e.reasoning),p=e.usage.cost==null?void 0:I(e.usage.cost),s=e.quote??await e.pricing.quoteTokens({modelId:o.modelId,tokens:a});if(s.pricing.modelId!==o.modelId||Object.keys(a).some(l=>a[l]!==s.tokens[l]))throw new i("INVALID_REQUEST","Saved quote must match the provider model and token pools");await e.persist({...o,tokens:a,quote:s,phase:"quoted"});let t=await e.pricing.trackTokens(e.client,{...e.context,quote:s,providerCostUsd:p,generationId:e.generationId});if(!t.receipt.accepted)throw new i("AI_BALANCE_REJECTED","OpenRouter usage was saved but the balance request was rejected");let r={...o,tokens:a,quote:s,receipt:t,phase:"settled"};return await e.persist(r),r}function T(e){if(typeof window<"u")throw new i("SERVER_ONLY","OpenRouter accounting requires your backend");if(!["output","separate"].includes(e.reasoning))throw new i("INVALID_REQUEST","Reasoning pricing is required");let o=e.openRouter.chat;async function a(t){if(!t.usage||!t.modelId||!t.generationId)throw new i("AI_USAGE_UNAVAILABLE","OpenRouter did not return final usage and the actual model");await f({...e,context:t.context,generationId:t.generationId,modelId:t.modelId.slice(11),usage:t.usage})}let p=async(t,r)=>{let n={context:await e.context(),generationId:null,modelId:null,usage:null,tokens:null,quote:null,receipt:null,phase:"incomplete"},d;try{d=await o.send(t,r)}catch(g){throw await e.persist(n),g}if(!(d instanceof ReadableStream)){if(n={...n,generationId:d.id,modelId:d.model?`openrouter/${d.model}`:null,usage:d.usage??null},!n.usage||!n.modelId)throw await e.persist(n),new i("AI_USAGE_UNAVAILABLE","OpenRouter omitted final accounting");return await a(n),d}let w=d.getReader(),m=!1;return new ReadableStream({async pull(g){try{let{value:u,done:k}=await w.read();if(k){if(m=!0,!n.usage||!n.modelId)throw await e.persist(n),new i("AI_USAGE_UNAVAILABLE","OpenRouter stream ended without final accounting");await a(n),g.close();return}if(u.error)throw new i("AI_PROVIDER_ERROR",u.error.message);u.usage&&(n={...n,generationId:u.id,modelId:u.model?`openrouter/${u.model}`:null,usage:u.usage}),g.enqueue(u)}catch(u){m||(m=!0,await e.persist(n)),await w.cancel(u),g.error(u)}},async cancel(g){m||(m=!0,await e.persist(n)),await w.cancel(g)}})},s=new Proxy(o,{get(t,r){return r==="send"?p:Reflect.get(t,r,t)}});return new Proxy(e.openRouter,{get(t,r){return r==="chat"?s:Reflect.get(t,r,t)}})}export{T as createOpenRouterUsageClient,f as trackOpenRouterUsage};
1
+ import"./chunk-6C3ARFEL.js";import"./chunk-5NCQOJR2.js";import"./chunk-SFTMGGY4.js";import"./chunk-KJTHMRSH.js";import{a as i}from"./chunk-ZRU7WONE.js";import"./chunk-TFPLIX5E.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import{b as A}from"./chunk-S7NHVERO.js";import"./chunk-WOT6VMZA.js";var c=A.number().int().min(0).max(1e9);function R(e,o){let a=c.parse(e.promptTokens),p=c.parse(e.completionTokens),s=c.parse(e.promptTokensDetails?.cachedTokens??0),t=c.parse(e.promptTokensDetails?.cacheWriteTokens??0),r=c.parse(e.promptTokensDetails?.audioTokens??0),l=c.parse(e.completionTokensDetails?.audioTokens??0),n=c.parse(e.completionTokensDetails?.reasoningTokens??0);if(c.parse(e.totalTokens)!==a+p||s+t+r>a||n+l>p||(e.promptTokensDetails?.videoTokens??0)>0)throw new i("AI_USAGE_UNAVAILABLE","Token pools must conserve usage; video needs an explicit token mapper");return{input:a-s-t-r,output:p-l-(o==="separate"?n:0),cache_read:s,cache_write:t,input_audio:r,output_audio:l,reasoning:o==="separate"?n:0}}function I(e){if(!Number.isFinite(e)||e<0)throw new i("AI_USAGE_UNAVAILABLE","Provider cost must be a nonnegative USD amount");let o=String(e),a=o.includes("e")?e.toFixed(18).replace(/0+$/,"").replace(/\.$/,""):o;if(!/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/.test(a)||Number(a)!==e)throw new i("AI_USAGE_UNAVAILABLE","Provider cost exceeds the supported precision");return a}async function f(e){if(typeof window<"u")throw new i("SERVER_ONLY","OpenRouter accounting requires your backend");if(!["output","separate"].includes(e.reasoning)||!e.modelId||!e.generationId)throw new i("INVALID_REQUEST","Actual model, generation ID and reasoning pricing are required");let o={context:e.context,generationId:e.generationId,modelId:`openrouter/${e.modelId}`,usage:e.usage,tokens:null,quote:null,receipt:null,phase:"captured"};await e.persist(o);let a=e.mapTokens?e.mapTokens(e.usage):R(e.usage,e.reasoning),p=e.usage.cost==null?void 0:I(e.usage.cost),s=e.quote??await e.pricing.quoteTokens({modelId:o.modelId,tokens:a});if(s.pricing.modelId!==o.modelId||Object.keys(a).some(l=>a[l]!==s.tokens[l]))throw new i("INVALID_REQUEST","Saved quote must match the provider model and token pools");await e.persist({...o,tokens:a,quote:s,phase:"quoted"});let t=await e.pricing.trackTokens(e.client,{...e.context,quote:s,providerCostUsd:p,generationId:e.generationId});if(!t.receipt.accepted)throw new i("AI_BALANCE_REJECTED","OpenRouter usage was saved but the balance request was rejected");let r={...o,tokens:a,quote:s,receipt:t,phase:"settled"};return await e.persist(r),r}function T(e){if(typeof window<"u")throw new i("SERVER_ONLY","OpenRouter accounting requires your backend");if(!["output","separate"].includes(e.reasoning))throw new i("INVALID_REQUEST","Reasoning pricing is required");let o=e.openRouter.chat;async function a(t){if(!t.usage||!t.modelId||!t.generationId)throw new i("AI_USAGE_UNAVAILABLE","OpenRouter did not return final usage and the actual model");await f({...e,context:t.context,generationId:t.generationId,modelId:t.modelId.slice(11),usage:t.usage})}let p=async(t,r)=>{let n={context:await e.context(),generationId:null,modelId:null,usage:null,tokens:null,quote:null,receipt:null,phase:"incomplete"},d;try{d=await o.send(t,r)}catch(g){throw await e.persist(n),g}if(!(d instanceof ReadableStream)){if(n={...n,generationId:d.id,modelId:d.model?`openrouter/${d.model}`:null,usage:d.usage??null},!n.usage||!n.modelId)throw await e.persist(n),new i("AI_USAGE_UNAVAILABLE","OpenRouter omitted final accounting");return await a(n),d}let w=d.getReader(),m=!1;return new ReadableStream({async pull(g){try{let{value:u,done:k}=await w.read();if(k){if(m=!0,!n.usage||!n.modelId)throw await e.persist(n),new i("AI_USAGE_UNAVAILABLE","OpenRouter stream ended without final accounting");await a(n),g.close();return}if(u.error)throw new i("AI_PROVIDER_ERROR",u.error.message);u.usage&&(n={...n,generationId:u.id,modelId:u.model?`openrouter/${u.model}`:null,usage:u.usage}),g.enqueue(u)}catch(u){m||(m=!0,await e.persist(n)),await w.cancel(u),g.error(u)}},async cancel(g){m||(m=!0,await e.persist(n)),await w.cancel(g)}})},s=new Proxy(o,{get(t,r){return r==="send"?p:Reflect.get(t,r,t)}});return new Proxy(e.openRouter,{get(t,r){return r==="chat"?s:Reflect.get(t,r,t)}})}export{T as createOpenRouterUsageClient,f as trackOpenRouterUsage};
@@ -0,0 +1 @@
1
+ import{e as o}from"./chunk-USH4WN6W.js";import"./chunk-NNJ7W4KY.js";import"./chunk-2SSOV3OG.js";import"./chunk-ULED3B5P.js";import"./chunk-ECUGL7AO.js";import"./chunk-3NV6NBQB.js";import"./chunk-Q4GG33R5.js";import"./chunk-WVTKVQLZ.js";import"./chunk-QTXHF27F.js";import"./chunk-44ZJPQM6.js";import"./chunk-VILB5M4X.js";import"./chunk-5NCQOJR2.js";import"./chunk-KJTHMRSH.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import"./chunk-TFPLIX5E.js";import"./chunk-S7NHVERO.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{o as apiOperations};
package/dist/page.js CHANGED
@@ -1 +1 @@
1
- import{d as o,e as r,f as e,g as f}from"./chunk-C5FSL4XH.js";import"./chunk-MB2U2GWJ.js";import"./chunk-3VUPVXAV.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{f as createPageExperiments,o as mergeQueryStrings,r as pageAttributes,e as readPayload};
1
+ import{d as o,e as r,f as e,g as f}from"./chunk-YTURNXJA.js";import"./chunk-MB2U2GWJ.js";import"./chunk-3VUPVXAV.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{f as createPageExperiments,o as mergeQueryStrings,r as pageAttributes,e as readPayload};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-RDMNLOWQ.js";import"./chunk-6GY2YT3U.js";import"./chunk-W32FI2A2.js";import"./chunk-57ZXT7AS.js";import"./chunk-LBYMDTGD.js";import"./chunk-CQ5EQNQA.js";import"./chunk-Q4GG33R5.js";import"./chunk-WVTKVQLZ.js";import"./chunk-QTXHF27F.js";import"./chunk-VILB5M4X.js";import"./chunk-SFTMGGY4.js";import"./chunk-KJTHMRSH.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import"./chunk-ZRU7WONE.js";import"./chunk-TFPLIX5E.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as showPaywall};
@@ -0,0 +1 @@
1
+ import{b as a}from"./chunk-3454S2FL.js";import"./chunk-ULED3B5P.js";import"./chunk-ECUGL7AO.js";import"./chunk-3NV6NBQB.js";import"./chunk-Q4GG33R5.js";import"./chunk-WVTKVQLZ.js";import"./chunk-QTXHF27F.js";import"./chunk-44ZJPQM6.js";import"./chunk-VILB5M4X.js";import"./chunk-SFTMGGY4.js";import"./chunk-KJTHMRSH.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import"./chunk-ZRU7WONE.js";import"./chunk-TFPLIX5E.js";import"./chunk-3VUPVXAV.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import"./chunk-S7NHVERO.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as readPaywallContent};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-BLH6AF6U.js";import"./chunk-USH4WN6W.js";import"./chunk-NNJ7W4KY.js";import"./chunk-T5SCW4IA.js";import"./chunk-LBYMDTGD.js";import"./chunk-CQ5EQNQA.js";import"./chunk-2SSOV3OG.js";import"./chunk-SGOVJD5P.js";import"./chunk-3454S2FL.js";import"./chunk-ULED3B5P.js";import"./chunk-ECUGL7AO.js";import"./chunk-3NV6NBQB.js";import"./chunk-Q4GG33R5.js";import"./chunk-WVTKVQLZ.js";import"./chunk-QTXHF27F.js";import"./chunk-44ZJPQM6.js";import"./chunk-VILB5M4X.js";import"./chunk-5NCQOJR2.js";import"./chunk-SFTMGGY4.js";import"./chunk-KJTHMRSH.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import"./chunk-ZRU7WONE.js";import"./chunk-TFPLIX5E.js";import"./chunk-3VUPVXAV.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as createPaywallSession};
package/dist/popup.js CHANGED
@@ -1 +1 @@
1
- import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a}from"./chunk-PQ4ISW55.js";import"./chunk-K675GO7R.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{p as formatCustomerDecimal,r as hostedRendererScript,o as hostedRendererShell,f as inspectCustomHtml,a as mountScreenPreview,x as preparePopup,m as prepareScreen,e as sanitizeCustomHtml,t as showPopup};
1
+ import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a}from"./chunk-CWBBW6QS.js";import"./chunk-57ZXT7AS.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import"./chunk-ZRU7WONE.js";import"./chunk-TFPLIX5E.js";import"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{p as formatCustomerDecimal,r as hostedRendererScript,o as hostedRendererShell,f as inspectCustomHtml,a as mountScreenPreview,x as preparePopup,m as prepareScreen,e as sanitizeCustomHtml,t as showPopup};
@@ -1 +1 @@
1
- import{b as S,c as E,d as T}from"./chunk-OFG3SGEX.js";import"./chunk-74T76RE4.js";import{a as A}from"./chunk-YA5YKHDE.js";import{e as P}from"./chunk-QPVA644N.js";import"./chunk-G2OLUFYT.js";import{h as b,i as x,k as L}from"./chunk-M6MXJHJ5.js";import{E as C}from"./chunk-RHILCVPZ.js";import"./chunk-47FCHF3Y.js";import"./chunk-YUL23NAW.js";import"./chunk-KVLOMX2G.js";import"./chunk-JBN6ADWQ.js";import"./chunk-SAPICYY3.js";import"./chunk-E3FUZSTM.js";import"./chunk-HT5SLWWG.js";import"./chunk-TXVLJFZG.js";import"./chunk-FUP5JVDE.js";import"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-PNX7Y2K3.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-RNCUAYLQ.js";import"./chunk-7D5462NE.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import{a as r}from"./chunk-46USIMCJ.js";import{h as R}from"./chunk-XIBJF5E6.js";import"./chunk-3VUPVXAV.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";function k(t,d){let n,a=0,m=-1,l,i=!1,y=()=>{if(i)throw new r("CLOSED","Native host was destroyed");if(!t.nativeModule)throw new r("CAPABILITY_UNAVAILABLE","Link IndianaBridge and supply nativeModule");return t.nativeModule},o=()=>new r("IDENTITY_CHANGED","Customer identity changed during the native operation"),h=d.subscribeIdentity(()=>{a++,m=-1;let e=a;n&&t.nativeModule&&n.then(c=>t.nativeModule.reset(c,e)).catch(()=>{})}),I=t.nativeEvents?.(e=>{!n||!t.nativeModule||typeof e?.requestId!="string"||(async()=>{let c=await n;if(e.instanceId!==c)return;if(e.kind==="credential"){let w=a,f=null;try{if(!i&&e.revision===w){let N=await d.access();!i&&a===w&&(f=N)}}finally{await t.nativeModule.provideCredential(c,e.requestId,f)}return}let s=!1,u=a;try{if(i||e.revision!==u||!t.onNativeAction)throw o();await t.onNativeAction(e.action),s=!i&&a===u}finally{await t.nativeModule.acknowledge(c,e.requestId,s)}})().catch(()=>{})});async function p(e,c={}){let s=y();if(d.snapshot()&&!t.nativeEvents)throw new r("CAPABILITY_UNAVAILABLE","Supply nativeEvents to share credential refresh with the native host");let u=a,w=await d.access();if(i||a!==u)throw o();if(!n){let v=s.create(JSON.stringify({baseUrl:t.baseUrl??"https://api.longplayai.com",scope:t.scope,timeout:(t.timeoutMs??15e3)/1e3,credentialEvents:!!t.nativeEvents}));n=v,v.catch(()=>{n===v&&(n=void 0)})}let f=await n;if(i||a!==u)throw o();if(m!==u){if(!l||l.epoch!==u){let O=(async()=>{if(await s.identify(f,JSON.stringify({revision:u,credentials:w})),i||a!==u)throw await s.reset(f,u),o();m=u})();l={epoch:u,task:O}}let v=l;try{await v.task}finally{l===v&&(l=void 0)}}let N=await s.invoke(f,e,JSON.stringify(c));if(i||a!==u)throw o();try{return JSON.parse(N)}catch{throw new r("INVALID_RESPONSE","Native host returned invalid JSON")}}async function g(e,c){let s=await p(e,c);if(!s||typeof s!="object"||Array.isArray(s)||s.status!=="complete"&&s.status!=="dismissed")throw new r("INVALID_RESPONSE","Native presentation returned an invalid result");return s}return{showFunnel(e){return g("showFunnel",{runToken:e})},showPaywall(e){return g("showPaywall",e)},showContent(e){return g("showContent",e)},purchaseSubscription(e,c){return p("purchaseSubscription",{operationId:e,accepted:c})},switchSubscription(e,c){return p("switchSubscription",{operationId:e,accepted:c})},restorePurchases(){return p("restorePurchases")},manageSubscriptions(e){return p("manageSubscriptions",e?{productId:e}:{})},async dismiss(){a++,m=-1,n&&await y().reset(await n,a)},async destroy(){i||(i=!0,a++,h(),I?.(),n&&t.nativeModule&&await t.nativeModule.destroy(await n))}}}var M=P.trackUsage.request.shape.command,U=P.trackUsage.response;function F(t){let d=R.parse(t.scope),n=S({...t,scope:d}),a={...t,scope:d,session:n.session},m=k(t,n.session),l=0,i=!1;n.subscribeIdentity(()=>{l++});let y=()=>{if(i)throw new r("CLOSED","SDK client was destroyed");let o=n.session.peek();if(!o)throw new r("UNAUTHENTICATED","Identify the Customer first");return o};return{...n,native:m,async destroy(){i||(i=!0,l++,n.destroy(),await m.destroy())},funnel(){return E({...a,customerToken:y()})},resumeFunnel(o){return y(),C({...a,runToken:o})},paywall(o){return A(a,{...o,customerToken:y()})},async trackUsage(o){if(y(),!t.usageReporter)throw new r("INVALID_REQUEST","Configure your authenticated backend usageReporter");let h=M.parse(o),I=l,p;try{p=await t.usageReporter(h)}catch(e){throw I!==l?new r("IDENTITY_CHANGED","Customer identity changed during usage reporting"):e}if(I!==l)throw new r("IDENTITY_CHANGED","Customer identity changed during usage reporting");let g=U.parse(p);if(g.scope.projectId!==d.projectId||g.scope.environment!==d.environment)throw new r("INVALID_RESPONSE","Usage response scope differs");return g}}}export{r as LongplayError,x as createConfigurationSync,b as createFeatureClient,T as createFunnelProcess,L as createLocalFunnelClient,F as createLongplayReactNative};
1
+ import{b as S,c as E,d as T}from"./chunk-DFSBT7N6.js";import"./chunk-NEW77IDA.js";import{a as A}from"./chunk-BLH6AF6U.js";import{e as P}from"./chunk-USH4WN6W.js";import"./chunk-NNJ7W4KY.js";import{h as b,i as x,k as L}from"./chunk-TDM3ZUZS.js";import{E as C}from"./chunk-XAJEVHTU.js";import"./chunk-EQ64JD4L.js";import"./chunk-T5SCW4IA.js";import"./chunk-LBYMDTGD.js";import"./chunk-CQ5EQNQA.js";import"./chunk-2SSOV3OG.js";import"./chunk-SGOVJD5P.js";import"./chunk-3454S2FL.js";import"./chunk-ULED3B5P.js";import"./chunk-ECUGL7AO.js";import"./chunk-3NV6NBQB.js";import"./chunk-Q4GG33R5.js";import"./chunk-WVTKVQLZ.js";import"./chunk-QTXHF27F.js";import"./chunk-DXNTXCSI.js";import"./chunk-44ZJPQM6.js";import"./chunk-VILB5M4X.js";import"./chunk-5NCQOJR2.js";import"./chunk-SFTMGGY4.js";import"./chunk-KJTHMRSH.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import{a as r}from"./chunk-ZRU7WONE.js";import{h as R}from"./chunk-TFPLIX5E.js";import"./chunk-3VUPVXAV.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";function k(t,d){let n,a=0,m=-1,l,i=!1,y=()=>{if(i)throw new r("CLOSED","Native host was destroyed");if(!t.nativeModule)throw new r("CAPABILITY_UNAVAILABLE","Link IndianaBridge and supply nativeModule");return t.nativeModule},o=()=>new r("IDENTITY_CHANGED","Customer identity changed during the native operation"),h=d.subscribeIdentity(()=>{a++,m=-1;let e=a;n&&t.nativeModule&&n.then(c=>t.nativeModule.reset(c,e)).catch(()=>{})}),I=t.nativeEvents?.(e=>{!n||!t.nativeModule||typeof e?.requestId!="string"||(async()=>{let c=await n;if(e.instanceId!==c)return;if(e.kind==="credential"){let w=a,f=null;try{if(!i&&e.revision===w){let N=await d.access();!i&&a===w&&(f=N)}}finally{await t.nativeModule.provideCredential(c,e.requestId,f)}return}let s=!1,u=a;try{if(i||e.revision!==u||!t.onNativeAction)throw o();await t.onNativeAction(e.action),s=!i&&a===u}finally{await t.nativeModule.acknowledge(c,e.requestId,s)}})().catch(()=>{})});async function p(e,c={}){let s=y();if(d.snapshot()&&!t.nativeEvents)throw new r("CAPABILITY_UNAVAILABLE","Supply nativeEvents to share credential refresh with the native host");let u=a,w=await d.access();if(i||a!==u)throw o();if(!n){let v=s.create(JSON.stringify({baseUrl:t.baseUrl??"https://api.longplayai.com",scope:t.scope,timeout:(t.timeoutMs??15e3)/1e3,credentialEvents:!!t.nativeEvents}));n=v,v.catch(()=>{n===v&&(n=void 0)})}let f=await n;if(i||a!==u)throw o();if(m!==u){if(!l||l.epoch!==u){let O=(async()=>{if(await s.identify(f,JSON.stringify({revision:u,credentials:w})),i||a!==u)throw await s.reset(f,u),o();m=u})();l={epoch:u,task:O}}let v=l;try{await v.task}finally{l===v&&(l=void 0)}}let N=await s.invoke(f,e,JSON.stringify(c));if(i||a!==u)throw o();try{return JSON.parse(N)}catch{throw new r("INVALID_RESPONSE","Native host returned invalid JSON")}}async function g(e,c){let s=await p(e,c);if(!s||typeof s!="object"||Array.isArray(s)||s.status!=="complete"&&s.status!=="dismissed")throw new r("INVALID_RESPONSE","Native presentation returned an invalid result");return s}return{showFunnel(e){return g("showFunnel",{runToken:e})},showPaywall(e){return g("showPaywall",e)},showContent(e){return g("showContent",e)},purchaseSubscription(e,c){return p("purchaseSubscription",{operationId:e,accepted:c})},switchSubscription(e,c){return p("switchSubscription",{operationId:e,accepted:c})},restorePurchases(){return p("restorePurchases")},manageSubscriptions(e){return p("manageSubscriptions",e?{productId:e}:{})},async dismiss(){a++,m=-1,n&&await y().reset(await n,a)},async destroy(){i||(i=!0,a++,h(),I?.(),n&&t.nativeModule&&await t.nativeModule.destroy(await n))}}}var M=P.trackUsage.request.shape.command,U=P.trackUsage.response;function F(t){let d=R.parse(t.scope),n=S({...t,scope:d}),a={...t,scope:d,session:n.session},m=k(t,n.session),l=0,i=!1;n.subscribeIdentity(()=>{l++});let y=()=>{if(i)throw new r("CLOSED","SDK client was destroyed");let o=n.session.peek();if(!o)throw new r("UNAUTHENTICATED","Identify the Customer first");return o};return{...n,native:m,async destroy(){i||(i=!0,l++,n.destroy(),await m.destroy())},funnel(){return E({...a,customerToken:y()})},resumeFunnel(o){return y(),C({...a,runToken:o})},paywall(o){return A(a,{...o,customerToken:y()})},async trackUsage(o){if(y(),!t.usageReporter)throw new r("INVALID_REQUEST","Configure your authenticated backend usageReporter");let h=M.parse(o),I=l,p;try{p=await t.usageReporter(h)}catch(e){throw I!==l?new r("IDENTITY_CHANGED","Customer identity changed during usage reporting"):e}if(I!==l)throw new r("IDENTITY_CHANGED","Customer identity changed during usage reporting");let g=U.parse(p);if(g.scope.projectId!==d.projectId||g.scope.environment!==d.environment)throw new r("INVALID_RESPONSE","Usage response scope differs");return g}}}export{r as LongplayError,x as createConfigurationSync,b as createFeatureClient,T as createFunnelProcess,L as createLocalFunnelClient,F as createLongplayReactNative};
@@ -0,0 +1 @@
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-CWBBW6QS.js";import"./chunk-57ZXT7AS.js";import"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import"./chunk-26QYDE7V.js";import"./chunk-DZYMD4MJ.js";import"./chunk-LUVTP4VU.js";import"./chunk-ZRU7WONE.js";import"./chunk-TFPLIX5E.js";import"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{f as formatCustomerDecimal,b as hostedRendererScript,a as hostedRendererShell,d as inspectCustomHtml,i as mountScreenPreview,h as preparePopup,e as prepareScreen,c as sanitizeCustomHtml,g as showPopup};
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as pn}from"./chunk-MUCDKWMP.js";import{a as I}from"./chunk-GE6RSO2C.js";import{a as fn,b as hn,c as gn,d as yn}from"./chunk-IGE2UMXG.js";import{a as xt}from"./chunk-YA5YKHDE.js";import{a as Ue,b as Ve,c as qe,d as He,e as m}from"./chunk-QPVA644N.js";import"./chunk-G2OLUFYT.js";import{a as Te,b as ae,c as yt,d as It,e as wt,f as xe,g as vt,h as Me,i as dn,j as ln,k as mn}from"./chunk-M6MXJHJ5.js";import{B as V,C as N,d as ft,e as ht,k as gt,l as z,m as St,p as Ct,q as Rt,r as bt,s as At,t as Ot,y as pe,z as Tt}from"./chunk-RHILCVPZ.js";import"./chunk-47FCHF3Y.js";import{c as h}from"./chunk-YUL23NAW.js";import"./chunk-KVLOMX2G.js";import"./chunk-JBN6ADWQ.js";import"./chunk-SAPICYY3.js";import{a as Et,b as _e}from"./chunk-E3FUZSTM.js";import"./chunk-HT5SLWWG.js";import"./chunk-TXVLJFZG.js";import{e as at}from"./chunk-FUP5JVDE.js";import{B as pt,C as de,D as Z,E as lt,J as mt,a as et,e as q,j as Re,k as st,l as ct,q as ut,r as dt,s as be,t as Ae}from"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import{A as W,B as oe,C as tt,D as Se,E as ie,G as se,H as Ce,M as j,O as ce,P as nt,R as Ee,S as rt,T as ot,f as Ge,g as je,j as we,r as ze,s as Ke,u as an,v as sn,y as cn,z as X}from"./chunk-5WFI36LF.js";import{b as Oe}from"./chunk-PNX7Y2K3.js";import{e as ve,i as Ze,l as it}from"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-RNCUAYLQ.js";import"./chunk-7D5462NE.js";import{a as Ne,b as Le}from"./chunk-7EENIOSJ.js";import{o as ue}from"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import{i as un,k as $e,l as Qe,m as Je}from"./chunk-O5YYORDW.js";import{c as Ie}from"./chunk-OKPWZZZW.js";import{e as Xe,h as We}from"./chunk-7OJIW75D.js";import{a as c}from"./chunk-46USIMCJ.js";import{h as Y}from"./chunk-XIBJF5E6.js";import"./chunk-3VUPVXAV.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import{b as u}from"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import{a as Ye}from"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";var _t=4,Mt=[...tt,"requirement_checks","native_offers","preparations","benefit_claims","authorizations","business_results","checkout_termination"],In=u.enum(Mt),ee=(e,n)=>u.array(e).max(n).refine(t=>new Set(t).size===t.length,"Declarations must be unique"),ke=u.strictObject({...se.shape,bridgeVersion:u.literal(_t),capabilities:ee(In,Mt.length),checkKinds:ee(u.enum(["access","metered","credit"]),3),preparationActions:ee(u.enum(["purchase","subscription_change","refund"]),3),authorizationKinds:ee(u.enum(["auto_topup"]),1),nextActionTypes:ee(u.enum(["redirect","authenticate"]),2),resultEvents:ee(u.enum(["benefit.claimed","authorization.updated"]),2)}).superRefine((e,n)=>{e.capabilities.includes("catalog")!==(e.catalog!=="none")&&n.addIssue({code:"custom",path:["catalog"],message:"Catalog declaration differs from its capability"}),(e.capabilities.includes("billing_records")!==e.billingEvents.length>0||new Set(e.billingEvents).size!==e.billingEvents.length)&&n.addIssue({code:"custom",path:["billingEvents"],message:"Declare unique supported billing events"});let t=r=>e.capabilities.includes(r),o=(r,a)=>n.addIssue({code:"custom",path:[r],message:a});t("requirement_checks")!==e.checkKinds.length>0&&o("checkKinds","Declare the supported Check kinds"),t("preparations")!==e.preparationActions.length>0&&o("preparationActions","Declare the supported preparation actions"),t("authorizations")!==e.authorizationKinds.length>0&&o("authorizationKinds","Declare the supported authorization kinds"),t("business_results")!==e.resultEvents.length>0&&o("resultEvents","Declare the supported non-financial results");for(let[r,a,s]of[["purchases","purchase","purchase.completed"],["subscription_changes","subscription_change","subscription.change.completed"],["refunds","refund","refund.updated"]])t(r)&&(!t("operation_status")||!t("billing_records")||!t("preparations")||!e.preparationActions.includes(a)||!e.billingEvents.includes(s))&&o("capabilities",`${r} requires preparation, original lookup and its billing result`);t("purchases")&&!e.billingEvents.includes("purchase.closed")&&o("billingEvents","Purchase execution requires its terminal closure result"),t("checkout_termination")&&(!t("operation_status")||!t("billing_records")||!e.billingEvents.includes("purchase.closed"))&&o("capabilities","Checkout termination requires original lookup and purchase.closed"),t("subscription_changes")&&!e.billingEvents.includes("subscription.change.closed")&&o("billingEvents","Subscription change execution requires its terminal closure result");for(let[r,a]of[["benefit_claims","benefit.claimed"],["authorizations","authorization.updated"]])t(r)&&(!t("operation_status")||!t("business_results")||!e.resultEvents.includes(a))&&o("capabilities",`${r} requires original lookup and its non-financial result`)}),K={"bridge.ping":u.strictObject({challenge:u.uuid()}),"bridge.describe":u.strictObject({}),"requirement.check":$e,"operation.prepare":ze,"benefit.claim":Ue,"operation.read":qe,"purchase.terminate":j},wn={"bridge.ping":u.strictObject({challenge:u.uuid()}),"bridge.describe":ke,"requirement.check":Qe,"operation.prepare":Ke,"benefit.claim":Ve,"operation.read":He,"purchase.terminate":j.extend({outcome:u.enum(["requested","already_paid"])})},Gn=u.enum(["bridge.ping","bridge.describe","requirement.check","operation.prepare","benefit.claim","operation.read","purchase.terminate"]);function $(e,n){return u.strictObject({bridgeVersion:u.literal(_t),requestId:u.uuid(),scope:Ce,command:u.literal(e),data:n})}var kt=u.discriminatedUnion("command",[$("bridge.ping",K["bridge.ping"]),$("bridge.describe",K["bridge.describe"]),$("requirement.check",K["requirement.check"]),$("operation.prepare",K["operation.prepare"]),$("benefit.claim",K["benefit.claim"]),$("operation.read",K["operation.read"]),$("purchase.terminate",K["purchase.terminate"])]),Be=u.strictObject({code:u.string().regex(/^MERCHANT_BRIDGE_[A-Z_]+$/),message:u.string().min(1).max(500),retryable:u.boolean(),recovery:u.string().min(1).max(80),effect:u.enum(["none","unknown"])}).refine(e=>e.effect!=="unknown"||!e.retryable&&e.recovery==="recover_operation","Unknown effects require original-operation recovery");function Bt(e){let n={bridgeVersion:u.literal(4),requestId:u.uuid(),scope:Ce,command:u.literal(e)};return u.union([u.strictObject({...n,data:wn[e]}),u.strictObject({...n,error:Be})])}var Pt="X-Indiana-Bridge-Signature",Q="X-Indiana-Bridge-Key-Id";function vn(e){return new TextEncoder().encode(e)}function Dt(e){return Uint8Array.from(atob(e.replaceAll("-","+").replaceAll("_","/")),n=>n.charCodeAt(0))}function Ft(e,n,t,o){return vn(`indiana-merchant-bridge:${o}
1
+ import{a as pn}from"./chunk-P2OZG34H.js";import{a as I}from"./chunk-YDPF2ZZW.js";import{a as fn,b as hn,c as gn,d as yn}from"./chunk-6C3ARFEL.js";import{a as xt}from"./chunk-BLH6AF6U.js";import{a as Ue,b as Ve,c as qe,d as He,e as m}from"./chunk-USH4WN6W.js";import"./chunk-NNJ7W4KY.js";import{a as Te,b as ae,c as yt,d as It,e as wt,f as xe,g as vt,h as Me,i as dn,j as ln,k as mn}from"./chunk-TDM3ZUZS.js";import{B as V,C as N,d as ft,e as ht,k as gt,l as z,m as St,p as Ct,q as Rt,r as bt,s as At,t as Ot,y as pe,z as Tt}from"./chunk-XAJEVHTU.js";import"./chunk-EQ64JD4L.js";import{c as h}from"./chunk-T5SCW4IA.js";import"./chunk-LBYMDTGD.js";import"./chunk-CQ5EQNQA.js";import"./chunk-2SSOV3OG.js";import{a as Et,b as _e}from"./chunk-SGOVJD5P.js";import"./chunk-3454S2FL.js";import"./chunk-ULED3B5P.js";import{e as at}from"./chunk-ECUGL7AO.js";import{B as pt,C as de,D as Z,E as lt,J as mt,a as et,e as q,j as Re,k as st,l as ct,q as ut,r as dt,s as be,t as Ae}from"./chunk-3NV6NBQB.js";import"./chunk-Q4GG33R5.js";import"./chunk-WVTKVQLZ.js";import{A as W,B as oe,C as tt,D as Se,E as ie,G as se,H as Ce,M as j,O as ce,P as nt,R as Ee,S as rt,T as ot,f as Ge,g as je,j as we,r as ze,s as Ke,u as an,v as sn,y as cn,z as X}from"./chunk-QTXHF27F.js";import{b as Oe}from"./chunk-DXNTXCSI.js";import{e as ve,i as Ze,l as it}from"./chunk-44ZJPQM6.js";import"./chunk-VILB5M4X.js";import"./chunk-5NCQOJR2.js";import"./chunk-SFTMGGY4.js";import{a as Ne,b as Le}from"./chunk-KJTHMRSH.js";import{o as ue}from"./chunk-JW4MSBYN.js";import"./chunk-EJSTRCBQ.js";import{i as un,k as $e,l as Qe,m as Je}from"./chunk-26QYDE7V.js";import{c as Ie}from"./chunk-DZYMD4MJ.js";import{e as Xe,h as We}from"./chunk-LUVTP4VU.js";import{a as c}from"./chunk-ZRU7WONE.js";import{h as Y}from"./chunk-TFPLIX5E.js";import"./chunk-3VUPVXAV.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import{b as u}from"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import{a as Ye}from"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";var _t=4,Mt=[...tt,"requirement_checks","native_offers","preparations","benefit_claims","authorizations","business_results","checkout_termination"],In=u.enum(Mt),ee=(e,n)=>u.array(e).max(n).refine(t=>new Set(t).size===t.length,"Declarations must be unique"),ke=u.strictObject({...se.shape,bridgeVersion:u.literal(_t),capabilities:ee(In,Mt.length),checkKinds:ee(u.enum(["access","metered","credit"]),3),preparationActions:ee(u.enum(["purchase","subscription_change","refund"]),3),authorizationKinds:ee(u.enum(["auto_topup"]),1),nextActionTypes:ee(u.enum(["redirect","authenticate"]),2),resultEvents:ee(u.enum(["benefit.claimed","authorization.updated"]),2)}).superRefine((e,n)=>{e.capabilities.includes("catalog")!==(e.catalog!=="none")&&n.addIssue({code:"custom",path:["catalog"],message:"Catalog declaration differs from its capability"}),(e.capabilities.includes("billing_records")!==e.billingEvents.length>0||new Set(e.billingEvents).size!==e.billingEvents.length)&&n.addIssue({code:"custom",path:["billingEvents"],message:"Declare unique supported billing events"});let t=r=>e.capabilities.includes(r),o=(r,a)=>n.addIssue({code:"custom",path:[r],message:a});t("requirement_checks")!==e.checkKinds.length>0&&o("checkKinds","Declare the supported Check kinds"),t("preparations")!==e.preparationActions.length>0&&o("preparationActions","Declare the supported preparation actions"),t("authorizations")!==e.authorizationKinds.length>0&&o("authorizationKinds","Declare the supported authorization kinds"),t("business_results")!==e.resultEvents.length>0&&o("resultEvents","Declare the supported non-financial results");for(let[r,a,s]of[["purchases","purchase","purchase.completed"],["subscription_changes","subscription_change","subscription.change.completed"],["refunds","refund","refund.updated"]])t(r)&&(!t("operation_status")||!t("billing_records")||!t("preparations")||!e.preparationActions.includes(a)||!e.billingEvents.includes(s))&&o("capabilities",`${r} requires preparation, original lookup and its billing result`);t("purchases")&&!e.billingEvents.includes("purchase.closed")&&o("billingEvents","Purchase execution requires its terminal closure result"),t("checkout_termination")&&(!t("operation_status")||!t("billing_records")||!e.billingEvents.includes("purchase.closed"))&&o("capabilities","Checkout termination requires original lookup and purchase.closed"),t("subscription_changes")&&!e.billingEvents.includes("subscription.change.closed")&&o("billingEvents","Subscription change execution requires its terminal closure result");for(let[r,a]of[["benefit_claims","benefit.claimed"],["authorizations","authorization.updated"]])t(r)&&(!t("operation_status")||!t("business_results")||!e.resultEvents.includes(a))&&o("capabilities",`${r} requires original lookup and its non-financial result`)}),K={"bridge.ping":u.strictObject({challenge:u.uuid()}),"bridge.describe":u.strictObject({}),"requirement.check":$e,"operation.prepare":ze,"benefit.claim":Ue,"operation.read":qe,"purchase.terminate":j},wn={"bridge.ping":u.strictObject({challenge:u.uuid()}),"bridge.describe":ke,"requirement.check":Qe,"operation.prepare":Ke,"benefit.claim":Ve,"operation.read":He,"purchase.terminate":j.extend({outcome:u.enum(["requested","already_paid"])})},Gn=u.enum(["bridge.ping","bridge.describe","requirement.check","operation.prepare","benefit.claim","operation.read","purchase.terminate"]);function $(e,n){return u.strictObject({bridgeVersion:u.literal(_t),requestId:u.uuid(),scope:Ce,command:u.literal(e),data:n})}var kt=u.discriminatedUnion("command",[$("bridge.ping",K["bridge.ping"]),$("bridge.describe",K["bridge.describe"]),$("requirement.check",K["requirement.check"]),$("operation.prepare",K["operation.prepare"]),$("benefit.claim",K["benefit.claim"]),$("operation.read",K["operation.read"]),$("purchase.terminate",K["purchase.terminate"])]),Be=u.strictObject({code:u.string().regex(/^MERCHANT_BRIDGE_[A-Z_]+$/),message:u.string().min(1).max(500),retryable:u.boolean(),recovery:u.string().min(1).max(80),effect:u.enum(["none","unknown"])}).refine(e=>e.effect!=="unknown"||!e.retryable&&e.recovery==="recover_operation","Unknown effects require original-operation recovery");function Bt(e){let n={bridgeVersion:u.literal(4),requestId:u.uuid(),scope:Ce,command:u.literal(e)};return u.union([u.strictObject({...n,data:wn[e]}),u.strictObject({...n,error:Be})])}var Pt="X-Indiana-Bridge-Signature",Q="X-Indiana-Bridge-Key-Id";function vn(e){return new TextEncoder().encode(e)}function Dt(e){return Uint8Array.from(atob(e.replaceAll("-","+").replaceAll("_","/")),n=>n.charCodeAt(0))}function Ft(e,n,t,o){return vn(`indiana-merchant-bridge:${o}
2
2
  ${n}
3
3
  POST
4
4
  ${W}
package/dist/visual.js CHANGED
@@ -1 +1 @@
1
- import{a as pe,c as fe}from"./chunk-OJM6ORHE.js";import{b as le}from"./chunk-J6KIN4RH.js";import{a as Ve,b as ce,c as de,d as ue}from"./chunk-SLUA7ABW.js";import{a as J,b as F,c as ge,e as me}from"./chunk-C5FSL4XH.js";import{a as re,b as ae,c as se,d as oe}from"./chunk-MB2U2GWJ.js";import"./chunk-3VUPVXAV.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import{b as o}from"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import{c as te,e as ie,g as M}from"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";var K="indiana-visual-diagnostics-v1",Ae=o.strictObject({environmentId:o.string().uuid(),release:o.string().regex(/^[a-f0-9]{64}$/).nullable(),generation:o.string().regex(/^[a-f0-9]{64}$/).nullable(),publishedGeneration:o.string().regex(/^[a-f0-9]{64}$/).nullable(),checkedAt:o.string().datetime(),origin:o.string().url(),pathname:o.string().max(2048),urlMatches:o.boolean(),stopped:o.boolean(),rows:o.array(o.strictObject({changeId:o.string().regex(/^[a-f0-9]{64}$/),experimentKey:o.string().max(256),variationKey:o.string().max(256),inExperiment:o.boolean(),fingerprint:o.string().regex(/^[a-f0-9]{64}$/),status:o.enum(["inactive","waiting","partial","applied","mismatch","no_changes","unavailable","error"]),total:o.number().int().min(0).max(600),applied:o.number().int().min(0).max(600)})).max(100)});function ye(e){let l=n=>Array.isArray(n)?"["+n.map(l).join(",")+"]":n&&typeof n=="object"?"{"+Object.entries(n).filter(([,c])=>c!==void 0).sort(([c],[y])=>c.localeCompare(y)).map(([c,y])=>JSON.stringify(c)+":"+l(y)).join(",")+"}":JSON.stringify(n);return l({css:e.css,js:e.js,domMutations:e.domMutations,...e.renderGuard?{renderGuard:e.renderGuard}:{}})}function he(e){let l=new URL(e.baseUrl),n=l.origin==="https://api.longplayai.com"||l.origin==="https://api.dev.longplayai.com"?l.hostname.slice(4):void 0,c=e.origins??(n?[`https://console.${n}`]:[]),y=new Set(c.filter(t=>{try{let i=new URL(t);return i.origin===t&&(i.protocol==="https:"||i.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(i.hostname))}catch{return!1}})),v=!1,I=!1,k=0,T=async t=>{if(v||I||!t.source||!y.has(t.origin)||!t.data||typeof t.data!="object")return;let i=t.data;if(!(i.channel!==K||i.type!=="inspect"||i.environmentId!==e.environmentId||typeof i.nonce!="string"||!/^[a-f0-9-]{36}$/i.test(i.nonce)||typeof i.changeId!="string"||!/^[a-f0-9]{64}$/.test(i.changeId)||typeof i.url!="string"||i.url.length>2048||Date.now()-k<250)){try{if(new URL(i.url).origin!==location.origin)return}catch{return}I=!0,k=Date.now();try{let x=await e.inspect(i.changeId,i.url);!v&&x.rows.some(S=>S.changeId===i.changeId)&&t.source.postMessage({channel:K,type:"result",nonce:i.nonce,snapshot:x},t.origin)}finally{I=!1}}},u=t=>{T(t).catch(()=>{})};return window.addEventListener("message",u),()=>{v=!0,window.removeEventListener("message",u)}}var R=e=>!!e&&typeof e=="object"&&!Array.isArray(e),E=(e,l)=>typeof e=="string"&&e.length<=l,Ee=e=>typeof e=="string"&&(["html","class","style","position","href","src","alt","title","id","role","hidden"].includes(e)||/^(aria|data)-[a-z0-9_-]+$/.test(e));function ke(e){if(!R(e)||!E(e.css??"",1e5)||!E(e.js??"",1e5)||!Array.isArray(e.domMutations??[])||Array.isArray(e.domMutations)&&e.domMutations.length>200)throw new Error("Invalid visual variation");let l=e.domMutations??[];for(let n of l)if(!R(n)||!E(n.selector,2048)||!n.selector||!Ee(n.attribute)||!["set","append","remove"].includes(String(n.action))||n.value!==void 0&&!E(n.value,5e4)||n.parentSelector!==void 0&&!E(n.parentSelector,2048)||n.insertBeforeSelector!==void 0&&!E(n.insertBeforeSelector,2048))throw new Error("Invalid visual mutation");return{css:e.css??"",js:e.js??"",domMutations:l,...e.renderGuard===void 0?{}:{renderGuard:le(e.renderGuard)}}}function q(e){if(!R(e)||typeof e.environmentId!="string"||typeof e.trackExposures!="boolean"||!/^[-a-f0-9]{36}$/i.test(e.environmentId)||typeof e.generation!="string"||!/^[a-f0-9]{64}$/.test(e.generation)||!Array.isArray(e.experiments)||e.experiments.length>100||!R(e.savedGroups))throw new Error("Invalid visual experiment payload");let l=e.experiments.map(n=>{if(!R(n)||!["key","changeId"].every(c=>typeof n[c]=="string"&&n[c])||!/^[a-f0-9]{64}$/.test(String(n.changeId))||["namespace","status","groups","url"].some(c=>Object.hasOwn(n,c))||n.hashVersion!==void 0&&n.hashVersion!==2||!Array.isArray(n.variations)||n.variations.length<2||n.variations.length>20||n.urlPatterns!==void 0&&!Array.isArray(n.urlPatterns))throw new Error("Invalid visual experiment");return{...n,variations:n.variations.map(ke)}});return{...e,experiments:l}}var ve=6e4;function qe(e){let l=se(e.baseUrl);if(e.appManifestRelease!==void 0&&!/^[a-f0-9]{64}$/.test(e.appManifestRelease))throw new Error("Invalid IAM manifest digest");if(!/^[0-9a-f-]{36}$/i.test(e.environmentId))throw new Error("Invalid App environment ID");let n=e.fetch??globalThis.fetch.bind(globalThis),c=F(n),y=F(n),v=`${l}/api/v1/visual-experiments/${e.environmentId}`,I=e.appManifestRelease?`${v}?iam=${e.appManifestRelease}`:v,k=re(e.deviceIdCookie??"indiana_did"),T=ae(),u=null,t=!1,i=!1,x="",S={...e.attributes??{}},G,B,D=0,H=-1/0,$,m=new Map,O=new Map,C=new Set,z=ge({endpoint:`${v}/events`,fetch:n,log:e.log,label:"Visual exposure"}),P=z.flush,W,b;function j(){clearTimeout(W),b?.remove(),b=void 0}function Y(s,d){let f=M(s,d);C.has(f)||e.trackExposures===!1||u?.trackExposures===!1||t||(C.add(f),z.push({eventUuid:crypto.randomUUID(),timestamp:new Date().toISOString(),deviceId:k,...T?{sessionId:T}:{},url:location.href,pageTitle:document.title.slice(0,512),experimentKey:s.key,variationKey:d.key}))}function we(s){if(!u||t)return;let d=new Set,f={onExperimentViewed:(r,p)=>{d.add(M(r,p))},url:location.href,attributes:{...me(k,location),...S,indianaAppManifestRelease:e.appManifestRelease??null},savedGroups:te(u.savedGroups),log:e.log},h=new Set;for(let r of u.experiments){if(de(`${e.environmentId}:${r.key}`))continue;let p=r;try{let a=ie(p,f);if(O.set(r.changeId,a),!a.inExperiment)continue;h.add(r.changeId);let w=JSON.stringify([a.key,a.value]),U=m.get(r.changeId);if(U?.signature===w){d.has(M(p,a))&&s.push(()=>{U.applied()&&Y(p,a)});continue}m.get(r.changeId)?.revert(),m.delete(r.changeId);let A=fe(a.value,{requireUniqueTargets:!!e.appManifestRelease&&Array.isArray(r.condition?.$and)&&r.condition.$and.some(g=>g!==null&&typeof g=="object"&&!Array.isArray(g)&&g.indianaAppManifestRelease===e.appManifestRelease),boundVariations:r.variations,allowJs:e.disableJsInjection===!1,nonce:e.nonce,onApplied:()=>{d.has(M(p,a))&&Y(p,a)},onError:g=>e.log?.("Visual experiment stopped",{experiment:r.key,changeId:r.changeId,variation:a.key,error:String(g)}),onTargetStatus:e.log?g=>e.log?.("Visual target status changed",{experiment:r.key,changeId:r.changeId,variation:a.key,...g}):void 0});m.set(r.changeId,{signature:w,revert:A.revert,applied:()=>A.applied,inspect:()=>A.inspect()})}catch(a){e.log?.("Skipping visual experiment",{experiment:r.key,error:String(a)})}}for(let[r,p]of m)h.has(r)||(p.revert(),m.delete(r));j()}let V=()=>{let s=[];pe(()=>we(s));for(let d of s)d()};async function _(){let s=++D,d;try{d=await c.read(I,J)}catch(h){if(t||s!==D)return!1;throw h}let f=q(d);if(f.environmentId.toLowerCase()!==e.environmentId.toLowerCase())throw new Error("Visual payload scope changed");return t||s!==D?!1:(u=f,H=performance.now(),!0)}async function Q(){!await _()||t||(N(),V())}function L(){clearTimeout($),$=setTimeout(()=>{if(document.visibilityState==="hidden")return L();Q().catch(s=>e.log?.("Visual payload refresh failed",{error:String(s)})).finally(()=>{t||L()})},ve)}let X=()=>{t||document.visibilityState==="hidden"||performance.now()-H<ve||(clearTimeout($),Q().catch(s=>e.log?.("Visual payload refresh failed",{error:String(s)})).finally(()=>{t||L()}))},Ie=()=>{x!==location.href&&(x=location.href,V())},Z=()=>{P(!0)},N=()=>{G||t||(G=oe(Ie),addEventListener("pagehide",Z),x=location.href)};async function ee(s,d){let f=location.href,h=u,r=[],p=null;if(!t)try{let a=q(await y.read(I,J));a.environmentId===e.environmentId&&(p=a.generation)}catch{}for(let a of h?.experiments??[]){if(s&&a.changeId!==s)continue;let w=O.get(a.changeId);if(!w)continue;let U=new TextEncoder().encode(ye(w.value)),A=[...new Uint8Array(await crypto.subtle.digest("SHA-256",U))].map(be=>be.toString(16).padStart(2,"0")).join(""),g=m.get(a.changeId)?.inspect()??{status:"inactive",total:0,applied:0};r.push({changeId:a.changeId,experimentKey:a.key,variationKey:w.key,inExperiment:w.inExperiment,fingerprint:A,...g})}return{environmentId:e.environmentId,release:e.appManifestRelease??null,generation:h?.generation??null,publishedGeneration:p,checkedAt:new Date().toISOString(),origin:location.origin,pathname:location.pathname,urlMatches:location.href===f&&(!d||d===f)&&h===u,stopped:t,rows:r}}let ne,xe=ue(()=>{i&&!t&&V()});return{async start(){if(!(i||t)){i=!0,e.appManifestRelease&&(B=ce(e.appManifestRelease)),e.antiFlicker&&(b=document.createElement("style"),e.nonce&&(b.nonce=e.nonce),b.textContent="body { visibility: hidden !important }",document.head.append(b),W=setTimeout(j,Math.min(3e3,Math.max(0,e.antiFlickerTimeout??1e3))));try{if(!await _()||t)return;N(),V()}finally{j(),t||(L(),document.addEventListener("visibilitychange",X),ne=he({environmentId:e.environmentId,baseUrl:l,origins:e.diagnosticsOrigins,inspect:ee}))}}},async refresh(){t||await _()&&(i&&N(),V())},setAttributes(s){S={...s},V()},flush:()=>P(),getDiagnostics:ee,getResults(){return new Map(O)},get generation(){return u?.generation??null},destroy(){t=!0,clearTimeout($),document.removeEventListener("visibilitychange",X),xe(),ne?.(),D++,c.destroy(),y.destroy(),G?.(),B?.destroy(),removeEventListener("pagehide",Z),j();for(let s of m.values())s.revert();m.clear(),P(!0),u=null,O.clear(),C.clear(),S={}}}}export{qe as createVisualExperiments,Ve as loadAppManifestRelease};
1
+ import{a as pe,c as fe}from"./chunk-OJM6ORHE.js";import{b as le}from"./chunk-J6KIN4RH.js";import{a as Ve,b as ce,c as de,d as ue}from"./chunk-SLUA7ABW.js";import{a as J,b as F,c as ge,e as me}from"./chunk-YTURNXJA.js";import{a as re,b as ae,c as se,d as oe}from"./chunk-MB2U2GWJ.js";import"./chunk-3VUPVXAV.js";import"./chunk-VE2NUFUU.js";import"./chunk-5MRSFLQA.js";import{b as o}from"./chunk-S7NHVERO.js";import"./chunk-DSPLGTQI.js";import{c as te,e as ie,g as M}from"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";var K="indiana-visual-diagnostics-v1",Ae=o.strictObject({environmentId:o.string().uuid(),release:o.string().regex(/^[a-f0-9]{64}$/).nullable(),generation:o.string().regex(/^[a-f0-9]{64}$/).nullable(),publishedGeneration:o.string().regex(/^[a-f0-9]{64}$/).nullable(),checkedAt:o.string().datetime(),origin:o.string().url(),pathname:o.string().max(2048),urlMatches:o.boolean(),stopped:o.boolean(),rows:o.array(o.strictObject({changeId:o.string().regex(/^[a-f0-9]{64}$/),experimentKey:o.string().max(256),variationKey:o.string().max(256),inExperiment:o.boolean(),fingerprint:o.string().regex(/^[a-f0-9]{64}$/),status:o.enum(["inactive","waiting","partial","applied","mismatch","no_changes","unavailable","error"]),total:o.number().int().min(0).max(600),applied:o.number().int().min(0).max(600)})).max(100)});function ye(e){let l=n=>Array.isArray(n)?"["+n.map(l).join(",")+"]":n&&typeof n=="object"?"{"+Object.entries(n).filter(([,c])=>c!==void 0).sort(([c],[y])=>c.localeCompare(y)).map(([c,y])=>JSON.stringify(c)+":"+l(y)).join(",")+"}":JSON.stringify(n);return l({css:e.css,js:e.js,domMutations:e.domMutations,...e.renderGuard?{renderGuard:e.renderGuard}:{}})}function he(e){let l=new URL(e.baseUrl),n=l.origin==="https://api.longplayai.com"||l.origin==="https://api.dev.longplayai.com"?l.hostname.slice(4):void 0,c=e.origins??(n?[`https://console.${n}`]:[]),y=new Set(c.filter(t=>{try{let i=new URL(t);return i.origin===t&&(i.protocol==="https:"||i.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(i.hostname))}catch{return!1}})),v=!1,I=!1,k=0,T=async t=>{if(v||I||!t.source||!y.has(t.origin)||!t.data||typeof t.data!="object")return;let i=t.data;if(!(i.channel!==K||i.type!=="inspect"||i.environmentId!==e.environmentId||typeof i.nonce!="string"||!/^[a-f0-9-]{36}$/i.test(i.nonce)||typeof i.changeId!="string"||!/^[a-f0-9]{64}$/.test(i.changeId)||typeof i.url!="string"||i.url.length>2048||Date.now()-k<250)){try{if(new URL(i.url).origin!==location.origin)return}catch{return}I=!0,k=Date.now();try{let x=await e.inspect(i.changeId,i.url);!v&&x.rows.some(S=>S.changeId===i.changeId)&&t.source.postMessage({channel:K,type:"result",nonce:i.nonce,snapshot:x},t.origin)}finally{I=!1}}},u=t=>{T(t).catch(()=>{})};return window.addEventListener("message",u),()=>{v=!0,window.removeEventListener("message",u)}}var R=e=>!!e&&typeof e=="object"&&!Array.isArray(e),E=(e,l)=>typeof e=="string"&&e.length<=l,Ee=e=>typeof e=="string"&&(["html","class","style","position","href","src","alt","title","id","role","hidden"].includes(e)||/^(aria|data)-[a-z0-9_-]+$/.test(e));function ke(e){if(!R(e)||!E(e.css??"",1e5)||!E(e.js??"",1e5)||!Array.isArray(e.domMutations??[])||Array.isArray(e.domMutations)&&e.domMutations.length>200)throw new Error("Invalid visual variation");let l=e.domMutations??[];for(let n of l)if(!R(n)||!E(n.selector,2048)||!n.selector||!Ee(n.attribute)||!["set","append","remove"].includes(String(n.action))||n.value!==void 0&&!E(n.value,5e4)||n.parentSelector!==void 0&&!E(n.parentSelector,2048)||n.insertBeforeSelector!==void 0&&!E(n.insertBeforeSelector,2048))throw new Error("Invalid visual mutation");return{css:e.css??"",js:e.js??"",domMutations:l,...e.renderGuard===void 0?{}:{renderGuard:le(e.renderGuard)}}}function q(e){if(!R(e)||typeof e.environmentId!="string"||typeof e.trackExposures!="boolean"||!/^[-a-f0-9]{36}$/i.test(e.environmentId)||typeof e.generation!="string"||!/^[a-f0-9]{64}$/.test(e.generation)||!Array.isArray(e.experiments)||e.experiments.length>100||!R(e.savedGroups))throw new Error("Invalid visual experiment payload");let l=e.experiments.map(n=>{if(!R(n)||!["key","changeId"].every(c=>typeof n[c]=="string"&&n[c])||!/^[a-f0-9]{64}$/.test(String(n.changeId))||["namespace","status","groups","url"].some(c=>Object.hasOwn(n,c))||n.hashVersion!==void 0&&n.hashVersion!==2||!Array.isArray(n.variations)||n.variations.length<2||n.variations.length>20||n.urlPatterns!==void 0&&!Array.isArray(n.urlPatterns))throw new Error("Invalid visual experiment");return{...n,variations:n.variations.map(ke)}});return{...e,experiments:l}}var ve=6e4;function qe(e){let l=se(e.baseUrl);if(e.appManifestRelease!==void 0&&!/^[a-f0-9]{64}$/.test(e.appManifestRelease))throw new Error("Invalid IAM manifest digest");if(!/^[0-9a-f-]{36}$/i.test(e.environmentId))throw new Error("Invalid App environment ID");let n=e.fetch??globalThis.fetch.bind(globalThis),c=F(n),y=F(n),v=`${l}/api/v1/visual-experiments/${e.environmentId}`,I=e.appManifestRelease?`${v}?iam=${e.appManifestRelease}`:v,k=re(e.deviceIdCookie??"indiana_did"),T=ae(),u=null,t=!1,i=!1,x="",S={...e.attributes??{}},G,B,D=0,H=-1/0,$,m=new Map,O=new Map,C=new Set,z=ge({endpoint:`${v}/events`,fetch:n,log:e.log,label:"Visual exposure"}),P=z.flush,W,b;function j(){clearTimeout(W),b?.remove(),b=void 0}function Y(s,d){let f=M(s,d);C.has(f)||e.trackExposures===!1||u?.trackExposures===!1||t||(C.add(f),z.push({eventUuid:crypto.randomUUID(),timestamp:new Date().toISOString(),deviceId:k,...T?{sessionId:T}:{},url:location.href,pageTitle:document.title.slice(0,512),experimentKey:s.key,variationKey:d.key}))}function we(s){if(!u||t)return;let d=new Set,f={onExperimentViewed:(r,p)=>{d.add(M(r,p))},url:location.href,attributes:{...me(k,location),...S,indianaAppManifestRelease:e.appManifestRelease??null},savedGroups:te(u.savedGroups),log:e.log},h=new Set;for(let r of u.experiments){if(de(`${e.environmentId}:${r.key}`))continue;let p=r;try{let a=ie(p,f);if(O.set(r.changeId,a),!a.inExperiment)continue;h.add(r.changeId);let w=JSON.stringify([a.key,a.value]),U=m.get(r.changeId);if(U?.signature===w){d.has(M(p,a))&&s.push(()=>{U.applied()&&Y(p,a)});continue}m.get(r.changeId)?.revert(),m.delete(r.changeId);let A=fe(a.value,{requireUniqueTargets:!!e.appManifestRelease&&Array.isArray(r.condition?.$and)&&r.condition.$and.some(g=>g!==null&&typeof g=="object"&&!Array.isArray(g)&&g.indianaAppManifestRelease===e.appManifestRelease),boundVariations:r.variations,allowJs:e.disableJsInjection===!1,nonce:e.nonce,onApplied:()=>{d.has(M(p,a))&&Y(p,a)},onError:g=>e.log?.("Visual experiment stopped",{experiment:r.key,changeId:r.changeId,variation:a.key,error:String(g)}),onTargetStatus:e.log?g=>e.log?.("Visual target status changed",{experiment:r.key,changeId:r.changeId,variation:a.key,...g}):void 0});m.set(r.changeId,{signature:w,revert:A.revert,applied:()=>A.applied,inspect:()=>A.inspect()})}catch(a){e.log?.("Skipping visual experiment",{experiment:r.key,error:String(a)})}}for(let[r,p]of m)h.has(r)||(p.revert(),m.delete(r));j()}let V=()=>{let s=[];pe(()=>we(s));for(let d of s)d()};async function _(){let s=++D,d;try{d=await c.read(I,J)}catch(h){if(t||s!==D)return!1;throw h}let f=q(d);if(f.environmentId.toLowerCase()!==e.environmentId.toLowerCase())throw new Error("Visual payload scope changed");return t||s!==D?!1:(u=f,H=performance.now(),!0)}async function Q(){!await _()||t||(N(),V())}function L(){clearTimeout($),$=setTimeout(()=>{if(document.visibilityState==="hidden")return L();Q().catch(s=>e.log?.("Visual payload refresh failed",{error:String(s)})).finally(()=>{t||L()})},ve)}let X=()=>{t||document.visibilityState==="hidden"||performance.now()-H<ve||(clearTimeout($),Q().catch(s=>e.log?.("Visual payload refresh failed",{error:String(s)})).finally(()=>{t||L()}))},Ie=()=>{x!==location.href&&(x=location.href,V())},Z=()=>{P(!0)},N=()=>{G||t||(G=oe(Ie),addEventListener("pagehide",Z),x=location.href)};async function ee(s,d){let f=location.href,h=u,r=[],p=null;if(!t)try{let a=q(await y.read(I,J));a.environmentId===e.environmentId&&(p=a.generation)}catch{}for(let a of h?.experiments??[]){if(s&&a.changeId!==s)continue;let w=O.get(a.changeId);if(!w)continue;let U=new TextEncoder().encode(ye(w.value)),A=[...new Uint8Array(await crypto.subtle.digest("SHA-256",U))].map(be=>be.toString(16).padStart(2,"0")).join(""),g=m.get(a.changeId)?.inspect()??{status:"inactive",total:0,applied:0};r.push({changeId:a.changeId,experimentKey:a.key,variationKey:w.key,inExperiment:w.inExperiment,fingerprint:A,...g})}return{environmentId:e.environmentId,release:e.appManifestRelease??null,generation:h?.generation??null,publishedGeneration:p,checkedAt:new Date().toISOString(),origin:location.origin,pathname:location.pathname,urlMatches:location.href===f&&(!d||d===f)&&h===u,stopped:t,rows:r}}let ne,xe=ue(()=>{i&&!t&&V()});return{async start(){if(!(i||t)){i=!0,e.appManifestRelease&&(B=ce(e.appManifestRelease)),e.antiFlicker&&(b=document.createElement("style"),e.nonce&&(b.nonce=e.nonce),b.textContent="body { visibility: hidden !important }",document.head.append(b),W=setTimeout(j,Math.min(3e3,Math.max(0,e.antiFlickerTimeout??1e3))));try{if(!await _()||t)return;N(),V()}finally{j(),t||(L(),document.addEventListener("visibilitychange",X),ne=he({environmentId:e.environmentId,baseUrl:l,origins:e.diagnosticsOrigins,inspect:ee}))}}},async refresh(){t||await _()&&(i&&N(),V())},setAttributes(s){S={...s},V()},flush:()=>P(),getDiagnostics:ee,getResults(){return new Map(O)},get generation(){return u?.generation??null},destroy(){t=!0,clearTimeout($),document.removeEventListener("visibilitychange",X),xe(),ne?.(),D++,c.destroy(),y.destroy(),G?.(),B?.destroy(),removeEventListener("pagehide",Z),j();for(let s of m.values())s.revert();m.clear(),P(!0),u=null,O.clear(),C.clear(),S={}}}}export{qe as createVisualExperiments,Ve as loadAppManifestRelease};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkerlandai/longplay-sdk",
3
- "version": "0.10.66",
3
+ "version": "0.10.67",
4
4
  "description": "Framework-independent Longplay SDK for customer identity, entitlements, credits, offers and growth surfaces.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-E3FUZSTM.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-YLH3AYCK.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as validateEntitlementCheck,b as validateResourceCheck};
@@ -1 +0,0 @@
1
- import{a as ue,b as fe}from"./chunk-N5HX3K5J.js";import{d as Ee,e as U}from"./chunk-JBN6ADWQ.js";import{a as ke}from"./chunk-46USIMCJ.js";import{a as C}from"./chunk-DSPLGTQI.js";var qe=5*6e4,Le=15e3,_e=new WeakMap;function We(c){return _e.get(c)}var A=c=>Array.isArray(c)?c.map(A):c&&typeof c=="object"?Object.fromEntries(Object.keys(c).sort().map(n=>[n,A(c[n])])):c,O=(c,n)=>JSON.stringify(A(c))===JSON.stringify(A(n)),pe=c=>JSON.stringify(A([c.funnelId,c.locale??null,c.parameters??{}])),Te=["onObservationChange","onPurchase","onCheckoutUrl","resumeCheckout","allowNewPurchase","checkoutNavigation","terminateCheckout","beforeCheckoutReplacement","purchaseConfirmation","confirmOnHostedCheckout","resolveOfferId","prepareSubscriptionChange","resolveSubscriptionChange","onOpenUrl","onEvent","onAction","onComplete","onError"];function Ke(c,n){let we=e=>structuredClone({funnelId:e.funnelId,locale:e.locale,parameters:e.parameters}),g,G="",H=n.start instanceof Promise?void 0:we(n.start),W=e=>e?.parameters?.commerce,K=Promise.resolve(n.start).then(e=>e?we(e):void 0),B=n.maxAgeMs??qe,ye=new AbortController,p=AbortSignal.any([ye.signal,n.client.identitySignal,...n.signal?[n.signal]:[]]),X=()=>d("released","aborted"),r="preparing",me,F,$=()=>{},N=0,P=null,b=null,v=null,w=null,y,z,Q,ge=new Map,m=null,x=new Set,R=new Map,Y,he=new Promise(e=>Y=e),M,be=new Promise(e=>M=e),Z,Ve=new Promise(e=>Z=e);function q(e,a){r!==e&&(r=e,me=a,C(n.onState,e))}function De(){p.removeEventListener("abort",X),L(),b?.destroy(),b=null,P?.remove(),P=null,v=null}function d(e,a){["adopted","unavailable","released","closed"].includes(r)||(q(e,a),De(),Y(!1),M(!1),Z(null))}function _(e){r!=="shown"&&d("unavailable",e)}let f,ee=!1,ne=n.client.paywallCopies,ae,Oe=new Promise(e=>ae=e);function re(e){Oe.then(a=>{a&&ne&&ne.write(a,e).catch(()=>{})})}let te=e=>`error:${e?.code??e?.name??"unknown"}`,oe=c.ownerDocument.defaultView,V=!0,Pe=null,k=!1,He=e=>e.storageArea===oe?.localStorage&&(e.key===null||e.key.startsWith("indiana.funnel.purchases.")),ve=e=>{He(e)&&T()},Fe=n.client.subscribe(()=>T());function L(){V&&(V=!1,oe?.removeEventListener("storage",ve),Fe(),$())}let le=()=>V&&(r==="ready"||r==="preparing");function ie(e){(r==="ready"||r==="preparing")&&d("unavailable",e)}function T(){if(r==="ready"&&Date.now()-N>=B)return L();k=!0,Pe??=(async()=>{for(;k&&g&&le();){k=!1;try{await n.client.retained()==="pending"&&ie("purchase_pending")}catch(e){p.aborted?d("released","aborted"):ie(te(e))}}})().finally(()=>{Pe=null,k&&g&&le()&&T()})}oe?.addEventListener("storage",ve),p.addEventListener("abort",X,{once:!0});let Ie=n.client.findPurchase();Ie.catch(()=>{});let j;function J(e){let a=j?.paywallVersionId??n.paywallVersionId??f?.resolution.id??w?.id,t=JSON.stringify(A([a??null,e])),l=ge.get(t);return l||(l=n.client.readPaywall({paywallVersionId:a,...a?{}:{paywallId:j?.paywallId??n.paywallId},...e}),ge.set(t,l)),l}function E(e,a){let t=Object.values(e.capabilities.plans),l=Object.values(e.document.buttons).some(i=>i.type==="checkout");return l&&t.length===0?!1:a.intent==="subscription_change"&&l?t.some(i=>i.available):t.every(i=>i.available)}function se(e,a){if(w&&!U(e,w))return d("unavailable","paywall_changed"),!1;w=e,Q=a;for(let t of R.keys())C(t,structuredClone(e));return!0}function Se(e,a){if(!(!w||!["preparing","ready","shown"].includes(r))){if(!U(e,w))return _("paywall_changed");if(!E(e,a.commerce))return _("plan_unavailable");se(e,a)}}async function D(){let e=await Ve;if(!e)throw new ke("PURCHASE_PENDING","The purchase did not start; open it again");return e}let Ne={get view(){return m?m.view:w},get signal(){return m?.signal??n.client.identitySignal},get quote(){return m?.quote??null},get operation(){return m?.operation??null},webViewUrl:"bundled",get canReselect(){return m?.canReselect},get recovery(){return m?.recovery},get pendingCancellation(){return m?.pendingCancellation},subscribe(e){return R.set(e,m?.subscribe?.(e)??(()=>{})),()=>{R.get(e)?.(),R.delete(e)}},refresh:async()=>m?m.refresh():structuredClone(w),preview:async e=>(await D()).preview(e),confirm:async()=>(await D()).confirm(),cancel:async()=>(await D()).cancel(),read:async()=>(await D()).read(),destroy(){m?.destroy()}},u={options:{},handoff:{}},Ce={loading:"host",focusAtReveal:!0,signal:n.client.identitySignal,start:async()=>Ne,canInteract:()=>u.options.canInteract?u.options.canInteract():!["unavailable","released","closed"].includes(r),async beforeAction(){let e=r!=="adopted",a=w?.capabilities,t=await D();if(e&&!O(t.view?.capabilities,a))throw new Ee;await u.options.beforeAction?.()}};for(let e of Te)Object.defineProperty(Ce,e,{enumerable:!0,get:()=>u.options[e]});function ce(){r!=="preparing"||!v||!b||!f&&(!g||!O(Q?.commerce,W(g))||Q?.locale!==g.locale)||(q("ready"),Y(!0))}let Ae={present(e){if(u.handoff.present)return u.handoff.present(e);r==="preparing"&&(v=e,N=Date.now(),ce())},async dismiss(){if(u.handoff.dismiss)return u.handoff.dismiss();d("closed");for(let e of[...x])C(e)},async closeAction(e){if(u.handoff.closeAction)return u.handoff.closeAction(e);u.options.onAction?await u.options.onAction(e):await Ae.dismiss()},quoteError(e){u.handoff.quoteError?u.handoff.quoteError(e):C(u.options.onError,e)}};async function xe(){if(n.paywallVersionId||n.paywallId)return{paywallVersionId:n.paywallVersionId,paywallId:n.paywallId};let e=n.configuration;if(!e)return d("unavailable","paywall_missing"),null;let a=await Promise.resolve(n.start).catch(()=>null);if(!a||r!=="preparing")return null;let t=()=>ue(e,{funnelId:a.funnelId,customerId:n.client.customerId,parameters:a.parameters??{}});if(F=await t(),r!=="preparing")return null;let l=F;if(l.type!=="paywall")return d("unavailable",fe(l)??"route"),null;let i=!1;return $=e.subscribe(()=>{i||!le()||(i=!0,t().then(s=>{!(s.type==="unavailable"&&!["funnel_stopped","route_unavailable"].includes(s.reason))&&(s.type!=="paywall"||s.paywallVersionId!==l.paywallVersionId)&&ie("route_changed")}).finally(()=>i=!1))}),V||$(),{paywallVersionId:l.paywallVersionId}}(async()=>{try{let[{showPaywall:e},a]=await Promise.all([import("./paywall-YRB7LQUS.js"),xe()]),t=n.commerce??W(H),l=n.locale??H?.locale,i=a&&t&&l?JSON.stringify(A([a.paywallVersionId??null,a.paywallId??null,{commerce:t,locale:l}])):null;if(ae(i),p.throwIfAborted(),r!=="preparing"||!a)return;if(!t)return d("unavailable","commerce_missing");if(!l)return d("unavailable","locale_missing");j=a;let s={commerce:t,locale:l},h=i?await ne?.read(i).catch(()=>null):null;if(p.throwIfAborted(),r!=="preparing")return;h&&(!H||h.funnelId===H.funnelId)&&E(h.resolution,h.context.commerce)&&(f=h),M(!!f);let o;if(f){let de=f.context;s=de,o=structuredClone(f.resolution),J(de).then(Me=>Se(Me,de),()=>{})}else o=await J(s);if(p.throwIfAborted(),r!=="preparing"||(!E(o,s.commerce)&&n.start instanceof Promise&&!y&&await K,!f&&y&&!O(s,y)&&(s=y,o=await J(s)),p.throwIfAborted(),r!=="preparing"))return;if(!E(o,s.commerce))return d("unavailable","plan_unavailable");if(!se(o,s))return;P=c.ownerDocument.createElement("div"),c.append(P);let S=setTimeout(()=>r==="preparing"&&d("unavailable","timeout"),Le);he.then(()=>clearTimeout(S));let I=await e(P,Ce,Ae);if(!I.host||p.aborted||r!=="preparing"){I.host?.destroy(),d(p.aborted?"released":"unavailable","error");return}b=I.host,ce()}catch(e){d(p.aborted?"released":"unavailable",te(e))}finally{ae(null),M(!1)}})(),K.then(async e=>{let a=s=>{ee||re(null),_(s)};if(!e)return a("gated");let t=e,l=W(t),i=n.commerce??l;if(!O(l&&{...l,intent:void 0},i&&{...i,intent:void 0})||n.locale!==void 0&&t.locale!==n.locale)return a("start_mismatch");if(!l)return a("commerce_missing");y={commerce:l,locale:t.locale},z=t,f&&["preparing","ready","shown"].includes(r)&&(g=t,G=pe(t));try{let s=await Ie,h=s==="pending"?"purchase_pending":s==="found"?"original_purchase":s==="blocked"?"purchase_blocked":void 0;if(h)return a(h);if(!["preparing","ready","shown"].includes(r))return;if(n.configuration&&(n.paywallId||n.paywallVersionId)){let o=await ue(n.configuration,{funnelId:t.funnelId,customerId:n.client.customerId,parameters:t.parameters??{}});p.throwIfAborted();let S=o.type==="unknown"||o.type==="unavailable"&&o.reason!=="funnel_stopped";if(o.type==="paywall"?f?o.paywallId!==f.resolution.paywallId:n.paywallVersionId?o.paywallVersionId!==n.paywallVersionId:o.paywallId!==n.paywallId:!S)return a(fe(o)??"route_changed")}if(V&&(k=!1,await n.client.retained()==="pending"))return a("purchase_pending");if(await be,j||n.paywallId||n.paywallVersionId||w){let o=await J(y);if(p.throwIfAborted(),ee||re(E(o,y.commerce)?{savedAt:Date.now(),funnelId:t.funnelId,context:y,resolution:o}:null),f)Se(o,y);else{if(r!=="preparing")return;if(w){if(!E(o,y.commerce))return d("unavailable","plan_unavailable");if(!se(o,y))return}}}}catch(s){return p.aborted?d("released","aborted"):_(te(s))}["preparing","ready","shown"].includes(r)&&(g=t,G=pe(t),ce(),k&&T())},()=>_("gated"));let Re={get state(){return r},get reason(){return me},ready:he,local:be,get start(){return g},get prediction(){return F?structuredClone(F):void 0},matches:e=>g?pe(e)===G:!!f&&e.funnelId===f.funnelId&&e.locale===f.context.locale,open(){if(r==="preparing")return"pending";if(r!=="ready"||!v)return!1;if(Date.now()-N>=B)return d("unavailable","expired"),!1;let e=v;return v=null,L(),q("shown"),e(),"shown"},destroy(){ye.abort()}};return _e.set(Re,{onClose(e){return r==="closed"?(C(e),()=>{}):(x.add(e),()=>{x.delete(e)})},claim(){L()},remember(e){ee=!0;let a=structuredClone(e);K.then(()=>{!z||!y||re({savedAt:Date.now(),funnelId:z.funnelId,context:y,resolution:a})},()=>{})},async adopt(e,a){let t=e.paywall?.resolution,l=e.paywall&&!e.paywall.quote&&!e.paywall.operation&&!e.paywall.purchaseRequestId&&!(e.paywall.selectionGeneration??0);if(r!=="shown"||!b||!w||!t||!l||e.source.id!==g?.funnelId||e.locale!==g?.locale||!O(e.parameters??{},g?.parameters??{})||!["running","waiting"].includes(e.status)||!U(t,w))return null;let i;try{i=await a.start()}catch{return null}if(r!=="shown"||!b)return i.destroy(),null;m=i,u.options=a.options,u.handoff=a.handoff;for(let[o]of R)R.set(o,i.subscribe?.(o)??(()=>{})),i.view&&C(o,structuredClone(i.view));p.removeEventListener("abort",X),q("adopted"),Z(i),x.clear();let s=b,h=P;return b=null,P=null,v=null,new Proxy(s,{get(o,S){return S==="destroy"?()=>{o.destroy(),h?.remove()}:S==="retainPurchaseDialog"?()=>{let I=o.retainPurchaseDialog();if(I)return{dialog:I.dialog,release(){I.release(),h?.remove()}}}:Reflect.get(o,S,o)}})},retainPurchaseDialog(){if(r!=="shown")return;let e=b?.retainPurchaseDialog();if(!e)return;let a=P;return b=null,P=null,d("released"),{dialog:e.dialog,release(){e.release(),a?.remove()}}},get modal(){return w?.document.presentation.type!=="inline"},get revealable(){return r==="ready"&&!!v&&Date.now()-N<B},release(){d("released")}}),Re}export{qe as a,We as b,Ke as c};
@@ -1 +0,0 @@
1
- import{o as n,r as t}from"./chunk-RHILCVPZ.js";function u(o,e,a){return n(o,e,a,t)}export{u as a};
@@ -1 +0,0 @@
1
- import{b as Jn}from"./chunk-7NKBMAOB.js";import{a as yn}from"./chunk-45MWDZ42.js";import{a as Nn,b as Vn,c as mn,d as wn,e as $e,f as $n,h as Mn,i as xn,j as zn,k as Bn}from"./chunk-A22QPPNY.js";import{a as Gn}from"./chunk-45PGU2HW.js";import{a as On}from"./chunk-W32FI2A2.js";import{c as qn,e as Hn,f as Ln,i as _n,j as He,k as tn,l as Un,m as rn}from"./chunk-K675GO7R.js";import{b as Dn}from"./chunk-47FCHF3Y.js";import{a as fn,d as Sn}from"./chunk-KVLOMX2G.js";import{C as An}from"./chunk-56YCOGQZ.js";import{a as te}from"./chunk-46USIMCJ.js";import{a as Ce}from"./chunk-DSPLGTQI.js";function Qn(i){let b=new Set,N=new Set,n=null;async function p(a,f){let L=!1;for(;!i.stopped&&i.key===a&&i.client.pendingCommand?.requestId===f;){if(!i.client.settle)throw new te("COMMAND_PENDING","The original display acknowledgement is still pending");await i.client.settle(f),L=!0,i.client.pendingCommand?.requestId===f&&await new Promise(S=>setTimeout(S,1500))}i.stopped||i.key!==a||(L&&await i.client.get(),!(i.stopped||i.key!==a)&&b.add(a))}function E(a,f){n=f;let L=()=>{n===f&&(n=null),N.delete(a)};return f.then(L,S=>{L(),i.busy||i.fail(S)}),f}function X(a){if(i.reviewing||b.has(a)||N.has(a)||i.stopped)return;N.add(a);let f=async()=>{if(i.reviewing||i.stopped||i.key!==a||b.has(a)){N.delete(a);return}if(i.busy||i.client.pendingCommand){setTimeout(()=>{f()},250);return}let L=(async()=>{if(i.staleRead){if(await i.staleRead,i.stopped||i.key!==a)return;if(i.client.pendingCommand){setTimeout(()=>{f()},250);return}}let S=i.client.view,le=i.expected(),_=le.requestId;try{await i.client.submit({operation:"shown",...le})}catch(o){if(!(o instanceof te)||o.code!=="CONFLICT"||o.status!==409||i.client.pendingCommand)throw o;await i.client.get();let u=i.client.view;if(i.stopped||i.reviewing||i.key!==a||!u||!S||u.id!==S.id||u.source.versionId!==S.source.versionId||u.nodeId!==le.nodeId||u.visit!==le.visit||u.revision<=le.revision||u.stopped||!u.screen&&(!u.paywall||u.paywall.receiptId!==S.paywall?.receiptId)||!["running","waiting"].includes(u.status)||i.client.pendingCommand)throw o;let P=i.expected();_=P.requestId,await i.client.submit({operation:"shown",...P})}await p(a,_)})();E(a,L)};f()}function g(){if(n)return n;let a=i.client.pendingCommand;if(a?.operation!=="shown")return null;let f=i.key;return N.add(f),E(f,(async()=>{await i.client.retry(),await p(f,a.requestId)})())}return{report:X,settled:g,get inFlight(){return n}}}function Wn(i){let b={},N=new Map;async function n(p){let E=i.client.view,X=E?.screen,g=X?.customerData.nodes[p.nodeId];if(i.stopped||i.busy||!E||!X||!g)return;if(!["refresh","next","previous","filter","sources_next","sources_previous"].includes(p.action)){let o=i.document,u=o?An(o,p.nodeId):null,P=u?.type==="customer_data"?u.data.outputs?.[p.action]:void 0;P&&X.outputs.includes(P)?await i.perform(()=>i.client.submit({operation:"submit",...i.expected(),input:{type:"screen",output:P,answers:i.answers,selection:p.value?{[p.nodeId]:p.value}:{}}})):await i.onIntent?.(p,E);return}let f=p.action.startsWith("sources_")?g.resources.find(o=>o.key===p.value):null;if(p.action.startsWith("sources_")&&!f)throw new te("INVALID_REQUEST","Choose a current resource");let L=`${E.visit}:${p.nodeId}:${f?.key??""}`,S=N.get(L)??[null],_=b[p.nodeId]??{page:1,after:null,filter:"all",...f?{resourceKey:f.key}:{}};if(p.action==="filter"){let o=p.value;if(!o||!(g.source==="offer_history"?["all","issued","reserved","redeemed","expired","revoked"]:["all","purchase","refund","source","usage","debt","settlement"]).includes(o))throw new te("INVALID_REQUEST","Unknown data filter");_={page:1,after:null,filter:o},S.splice(0,S.length,null)}else if(p.action==="next"||p.action==="sources_next"){let o=f?.sources.at(-1),u=f?o?{kind:"ledger",cursor:{at:o.detail[0],id:o.id,type:"source"}}:null:X.dataCursors[p.nodeId];if(!u||!f&&!g.hasNext)return;S[_.page]=u,_={..._,page:_.page+1,after:u}}else if(p.action==="previous"||p.action==="sources_previous"){if(_.page<=1)return;_={..._,page:_.page-1,after:S[_.page-2]??null}}N.set(L,S),b={...b,[p.nodeId]:_},await i.perform(()=>i.client.get({nodeId:E.nodeId,visit:E.visit,revision:E.revision,components:b}))}return{get queries(){return b},intent:n,reset(){b={},N.clear()}}}function jn(i){let{doc:b,holder:N,reviewHolder:n,mountScreenPreview:p}=i,E=!1,X,g=0,a=null,f="",L,S=new Map,le=u=>u?`${u.id}:${u.nodeId}:${u.visit}:${u.revision}:${u.paywall?.quote?.operationId??""}`:"";async function _(u){if(i.stopped||!i.client.review||E&&u===X&&L?.active)return;let P=!E||u!==X;E||(f=le(i.client.view),S.set(f,structuredClone(i.answers))),E=!0,X=u,N.hidden=!0,i.suspend(!0),n.hidden=!1;let c=++g;P&&(L?.finish("dismissed"),a?.destroy(),a=null,n.replaceChildren(),L=tn(n,i.loadingOptions,"funnel",()=>{o()}));let k=P?L:void 0;try{if(k?.start(!1,i.client.view?.locale),c!==g||i.stopped)return;let U=i.client.review(u),j=await(k?.wait(U,He)??U);if(i.stopped||c!==g||!E)return;if(!j.review)throw new te("INVALID_RESPONSE","Historical projection is missing");a?.destroy(),a=null,k||n.replaceChildren();let M=b.createElement("div"),ye=k?rn(M,n):()=>{};n.append(M);let O=j.run.locale.startsWith("zh"),q=i.chrome;M.style.cssText=q.history;let F=b.createElement("p");F.textContent=O?"只读回看":"Read-only history",F.style.cssText=q.historyTitle,M.append(F);let Y=b.createElement("p");Y.style.cssText=q.historyNote,Y.textContent=j.review.pages.length?O?"选择一页查看当时的内容,回看不会改动任何信息。":"Choose a page to see it as it was. Nothing here can be changed.":O?"还没有可回看的页面。":"There are no earlier pages yet.",M.append(Y);let D=j.review.page?.receiptId,Ie=b.createElement("div");Ie.style.cssText=q.historyPages;for(let[T,x]of j.review.pages.entries()){let R=b.createElement("button");R.type="button",R.textContent=O?`第 ${T+1} 页`:`Page ${T+1}`;let J=D!==void 0&&x.receiptId===D;R.style.cssText=J?q.primary:q.secondary,J&&R.setAttribute("aria-current","page"),$e(R,()=>i.chrome.focus),R.onclick=()=>{_(x.receiptId)},Ie.append(R)}if(Ie.childElementCount&&M.append(Ie),j.review.page){let T=j.review.page,x=b.createElement("div");x.inert=!0,x.style.cssText=q.historyPage,M.append(x),a=p(x,{mode:"live",rendererUrl:i.client.webViewUrl,title:T.document.name,onAction:()=>{},onAnswers:()=>{},onCustomerDataIntent:()=>{},onRendered:()=>{c===g&&!i.stopped&&k?.present(ye)},onError:J=>{if(c!==g||i.stopped)return;let Fe=new Error(J);k?.finish("error",Fe),a?.destroy(),a=null,M.remove(),i.fail(Fe)},onEscape:()=>{o()}});let R=a;if(R.update(T.document,j.run.locale,{serverInput:{bindings:T.inputs,answers:T.answers,values:T.values}}),await R.ready,i.stopped||c!==g||!E)return}let Le=O?{issued:"已领取",reserved:"已预留",redeemed:"已使用",expired:"已过期",revoked:"已撤销",unknown:"状态待确认"}:{issued:"Issued",reserved:"Reserved",redeemed:"Used",expired:"Expired",revoked:"Revoked",unknown:"Status unconfirmed"},se=b.createElement("div");se.style.cssText=q.historyRecords;for(let T of[...j.review.coupons.map((x,R)=>`${O?"优惠券":"Coupon"} ${R+1}: ${Le[x.status]}`),...j.review.purchases.map((x,R)=>`${O?"购买":"Purchase"} ${R+1}: ${Bn(x.status,O)}`)]){let x=b.createElement("p");x.textContent=T,x.style.margin="0",se.append(x)}se.childElementCount&&M.append(se),j.review.page||k?.present(ye),i.client.view&&await i.enqueue(i.client.view)}catch(U){if(c!==g||i.stopped)return;k?.finish("error",U),a?.destroy(),a=null,n.replaceChildren(),i.fail(U)}}async function o(){if(!E||i.stopped||!i.client.review)return;let u=++g;L?.finish("dismissed");try{if(await i.client.review(),i.stopped||u!==g)return;E=!1,g++,L?.finish("dismissed"),a?.destroy(),a=null,n.replaceChildren(),n.hidden=!0,N.hidden=!1;let P=i.client.view;le(P)!==f?(S.set(f,structuredClone(i.answers)),i.resetScreen()):(S.delete(f),i.suspend(!1)),P&&await i.enqueue(P)}catch(P){if(u!==g||i.stopped)return;a?.destroy(),a=null,n.replaceChildren(),i.fail(P)}}return{get active(){return E},get receipt(){return X},open:_,exit:o,get drafts(){return new Map([...S].map(([u,P])=>[u,structuredClone(P)]))},stop(){E=!1,g++,L?.finish("dismissed"),a?.destroy(),a=null,n.replaceChildren(),n.hidden=!0,N.hidden=!1}}}var gn=5e3;async function nt(i,b,N){let n=b,p=n.prepared&&Jn(n.prepared),E=()=>{},X;function g(){n.prepared&&n.prepared.state!=="adopted"&&p?.release()}let a=()=>n.prepared?.state==="shown"&&!!p?.modal,f=n.client.identitySignal,L;try{L=await Promise.all([import("./screen-renderer-P6U5UBFX.js"),import("./paywall-YRB7LQUS.js")]),n.signal?.throwIfAborted(),f?.throwIfAborted()}catch(e){throw g(),e}let[{mountScreenPreview:S},{showPaywall:le}]=L,_=(typeof INDIANA_NATIVE_SHELL_BUILD>"u"||!INDIANA_NATIVE_SHELL_BUILD)&&n.appManifestRelease?Gn({client:n.client,appManifestRelease:n.appManifestRelease,onError:n.onError}):void 0;_?.start();let o=i.ownerDocument,u=_n(o),P=!1,c=o.createElement("section"),k=o.createElement("div"),U=o.createElement("div"),j=o.createElement("div"),M=o.createElement("button");j.hidden=!0,M.type="button";let ye=o.createElement("p"),O=o.createElement("p"),q=o.createElement("button"),F=o.createElement("button"),Y=o.createElement("button"),D=o.createElement("dialog"),Ie,Le=!1;c.dataset.indianaFunnel="",c.dataset.longplayCloseOwner="sdk",c.setAttribute("aria-busy","false"),ye.setAttribute("role","status"),O.setAttribute("role","alert"),O.hidden=!0,q.type=F.type=Y.type="button",U.append(q,M,ye,O,Y,F),c.append(k,j,U),i.append(c);let se=Vn,T=mn(se),x="",R=(o.documentElement.lang||"").startsWith("zh"),J,Fe="",Me;for(let e of[q,M,Y,F])$e(e,()=>T.focus);function vn(){let e=R?"关闭":"Close";F.parentElement===D?(F.textContent="×",F.setAttribute("aria-label",e),Ln(F,se)):(F.textContent=e,F.removeAttribute("aria-label"),F.style.cssText=T.link+";margin-inline-start:auto")}function xe(e){let t=e?.screen?.content.document.theme??se,r=JSON.stringify([t.primary,t.background,t.text,t.radius,t.font,F.parentElement===D]);if(r===x)return;x=r,se=t;let v=F.parentElement===D;T=mn(se,v),c.style.cssText=T.root+";min-width:0"+(v?";display:flex;flex-direction:column;min-height:100%":""),U.style.cssText=T.bar+(v?";margin-top:auto":""),U.hidden&&(U.style.display="none"),q.style.cssText=M.style.cssText=T.secondary,Y.style.cssText=T.primary,ye.style.cssText=T.status,O.style.cssText=T.alert,vn(),wn(q)}function be(){U.hidden=q.hidden&&M.hidden&&Y.hidden&&O.hidden&&!ye.textContent&&(F.hidden||F.parentElement!==U),U.style.display=U.hidden?"none":"flex",J?.responsive&&Me!==void 0&&J.setContentHeight(Me+U.getBoundingClientRect().height)}xe();let de=null,h=null,ue=null,ge="",ne="",Pe=!1,ze="",on="",Be="",s=!1,Z=0,Je=!1,hn="",sn=null,an=Promise.resolve(),In=!n.client.view,Ne,A=N,Ge=n.hostPaywallTarget,Te,_e,Qe="",We,ie=!1,Re=null,pe=!1,je=()=>n.client.pendingCommand?.operation==="close",re=null,V=null,ln=On({document:o,run:async()=>{(!h?.observing||n.client.pendingCommand)&&await un()},delay:()=>{if(!oe.pending&&!(s||!ue||!["running","waiting"].includes(ue.status)&&!n.client.pendingCommand)&&!(h?.observing&&!n.client.pendingCommand))return ue.pendingRequest||n.client.pendingCommand?1500:gn},hiddenDelay:()=>!s&&!oe.pending&&n.client.pendingCommand?15e3:void 0}),z=null;function dn(){return V&&n.client.hasDurableJournal===!0&&z?.acknowledged===!0&&z.operationId===V.operationId&&n.client.view?.id===z.runId&&n.client.view?.status==="closed"&&n.client.view.revision===z.revision+1&&!(n.client.pendingCommands?.length??(n.client.pendingCommand?1:0))&&!n.client.pendingPurchase?V:null}function Cn(e){let t=e.run.paywall;if(z&&e.settlement?.requestId===z.requestId&&e.settlement.state==="settled"&&e.settlement.operationId===null&&e.run.id===z.runId&&e.run.status==="closed"&&!e.run.pendingRequest&&e.run.revision===z.revision+1&&e.run.nodeId===z.nodeId&&e.run.visit===z.visit&&t?.receiptId===z.receiptId&&t.selectionGeneration===z.selectionGeneration&&(t.quote?.operationId??null)===z.operationId&&(t.operation?.operationId??t.quote?.operationId??null)===z.operationId){let r=z.operationId===null&&t.selectionGeneration===0&&!t.quote&&!t.operation&&!t.purchaseRequestId,v=fn({quote:t.quote,operation:t.operation,requestId:t.purchaseRequestId,pending:!1,destroyed:!1,canReselect:t.canReselect});(r||t.canReselect===!0&&v.type==="native")&&(z.acknowledged=!0)}}let Ee=null,Ue=new Set,fe={},Ae=!1,K=(e,t=null)=>{s||(e instanceof te&&e.status===409&&e.reason==="STATE_CHANGED"&&e.recovery==="recover_operation"&&ln.destroy(),Ee=t,Ae=!1,O.textContent=$n(e,R),O.hidden=!1,Y.hidden=n.client.pendingCommand===null,be(),Ce(n.onError,e))},oe=Dn({client:n.client,document:o,conceal(){s||(me(),A?.finish("dismissed"),c.hidden=!0,P||(P=!0,u()))},async receive(e){s||await ae(n.client.view??e.run)},failed(e){if(!s){if(!oe.pending){pe=!1;let t=n.client.view;t&&ae(t).then(()=>K(e),K);return}Ke(),c.parentElement!==i&&i.append(c),c.hidden=!1,q.hidden=M.hidden=F.hidden=!0,ye.textContent="",xe(),K(e,n.client.pendingCommand?.requestId??null)}}}),bn=()=>{s||(Ee=null,O.textContent=xn(R),O.hidden=!1,Y.hidden=!0,be())};function ke(){let e=n.client.view;if(!e)throw new te("INVALID_REQUEST","No current Run is available");return{requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:e.revision}}let w=jn({client:n.client,doc:o,holder:k,reviewHolder:j,mountScreenPreview:S,loadingOptions:n,get chrome(){return T},get stopped(){return s},get answers(){return fe},suspend(e){h?.setSuspended(e)},resetScreen(){ge="",ne="",ze=""},enqueue:ae,fail:K}),Ve=Qn({client:n.client,expected:ke,fail:K,get stopped(){return s},get reviewing(){return w.active},get key(){return ge},get busy(){return Z},get staleRead(){return sn}}),Xe=Wn({client:n.client,expected:ke,perform:Se,onIntent:n.onCustomerDataIntent,get stopped(){return s},get busy(){return Z},get document(){return de?.document},get answers(){return fe}}),Ye=e=>`${e.id}:${e.nodeId}:${e.visit}`,De=e=>e&&(e.screen||e.paywall)?Ye(e):"";function ve(){let e=n.client.view;q.disabled=!w.active&&(Z>0||!!n.client.pendingCommand||!e?.canBack||e.stopped||!["running","waiting"].includes(e.status)||!De(e)||ne!==De(e)),q.hidden=!w.active&&!e?.canBack,wn(q);let t=!!h&&!w.active;F.hidden=t&&!A?.active||Le&&!w.active,M.hidden=!n.client.review||!w.active&&!e?.canBack;let r=e?.locale.startsWith("zh");ye.textContent=t?"":Z>0||e?.pendingRequest?r?"正在处理":"Processing":e?.instruction?.type==="wait"?r?"等待中":"Waiting":"",be()}async function Pn(e){if(!e)return;let t=n.client.view;await e;let r=n.client.view;if(!t||!r||r.id!==t.id||r.nodeId!==t.nodeId||r.visit!==t.visit||r.stopped||!["running","waiting"].includes(r.status))throw new te("PRECONDITION_FAILED","The screen changed while its display was acknowledged")}async function Se(e,t=!1,r){if(!((Z||pe||re||V)&&!t||s||w.active&&!t)){Z++,c.setAttribute("aria-busy","true"),O.hidden=!0,Ee=null,Ae=!1,ve();try{if(t||await Pn(Ve.inFlight),s)return;let v=await e();s||await ae(n.client.view??v.run)}catch(v){r?.(v)&&n.client.pendingCommand===null?bn():oe.pending||K(v,n.client.pendingCommand?.requestId??null)}finally{Z=Math.max(0,Z-1),c.setAttribute("aria-busy",String(Z>0)),s||(Y.hidden=n.client.pendingCommand===null,ve())}}}function Oe(){ln.schedule()}async function un(){if(!(s||Je||Z)&&!oe.pending){if(w.active){await w.open(w.receipt);return}Je=!0;try{let e=n.client.pendingCommand;e&&n.client.settle&&await n.client.settle(e.requestId);let t=n.client.view,r=Xe.queries,v=await n.client.get(t?.screen&&Object.keys(r).length?{nodeId:t.nodeId,visit:t.visit,revision:t.revision,components:r}:void 0);Ae&&!s&&(Ae=!1,O.hidden=!0,be()),!s&&r===Xe.queries&&await ae(n.client.view??v.run)}catch(e){K(e),Ae=!s}finally{Je=!1}}}function Ze(e,t,r){if(A?.active){let ee=A;return ee.setDismissHandler(()=>Rn(ee)),ee}let v=tn(i,n,"funnel",()=>Rn(v),Nn);return A=v,v.start(e,t,r),v}function Rn(e){s||ie||(ie=!0,e.finish("dismissed"),me(),c.hidden=!0,n.client.view?he().finally(G):G())}function cn(){clearTimeout(We?.timeout),We=void 0}function me(e){Le=!1,cn(),Te?.abort(),Te=void 0,de?.destroy(),de=null,h?.destroy(),h=null,Ne=void 0,_e?.(),_e=void 0,D.open&&D.close();for(let t of Array.from(k.children))(!e||!t.contains(e))&&t.remove();k.style.cssText="",Me=void 0,ge="",ne="",Pe=!1,ze="",Be=""}function En(){let e=o.defaultView;J?.responsive&&e&&de?.resizeViewport?.(e.innerHeight,e.innerWidth)}function Ke(){J?.destroy(),J=void 0,Fe=""}function en(e){let t=e.screen?.presentation;if(!t||t.type==="inline"){D.open&&D.close(),Ke(),F.parentElement!==U&&U.append(F),c.parentElement!==i&&i.append(c);for(let ee of["flex","display","flex-direction","justify-content"])k.style.removeProperty(ee);xe(e),be();return}c.parentElement!==D&&(D.append(F,c),i.append(D)),k.style.flex="1 0 auto",k.style.display="flex",k.style.flexDirection="column",k.style.justifyContent="center",xe(e);let r=e.screen.content.document,v=JSON.stringify([t,x]);if(v!==Fe){Ke(),Fe=v;let ee={sm:420,md:640,lg:900},we="size"in t&&!t.backdrop?",0 0 0 100vmax #16142566":"";D.style.cssText=`box-sizing:border-box;padding:0;border:0;overflow:auto;background:${se.background};color:${se.text};`+(t.type==="fullscreen"?"width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;margin:0;border-radius:0":`width:${ee[t.size]}px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);box-shadow:0 24px 80px #0003${we};`+(t.type==="sheet"?"margin:auto auto 0;border-radius:14px 14px 0 0":"border-radius:14px")),J=qn(D,{presentation:t,theme:r.theme,pages:r.pages},En),J.latch()}be(),D.setAttribute("aria-label",(Ie?.screen===e.screen?.content.document.name?Ie?.label:void 0)??de?.document?.name??e.screen?.content.document.name??"Funnel")}async function Xn(e){if(s||ie)return;if(oe.observe(),oe.pending){ue=e;return}if(pe&&(je()||["running","waiting"].includes(e.status))||(ue=e,Ee&&n.client.pendingCommand?.requestId!==Ee&&(O.hidden=!0,Ee=null),R=e.locale.startsWith("zh"),M.textContent=R?"回看":"History",q.textContent=w.active?R?"返回当前":"Return to current":R?"返回":"Back",vn(),Y.textContent=R?"重试":"Retry",Y.hidden=n.client.pendingCommand===null,ve(),hn!==`${e.revision}:${e.visit}:${e.status}:${e.stopped}`&&(hn=`${e.revision}:${e.visit}:${e.status}:${e.stopped}`,Ce(n.onState,structuredClone(e))),s||ie))return;if((!e.pendingRequest||pe&&e.status==="closed")&&["closed","ineligible","failed"].includes(e.status)){G();return}if(e.stopped&&a()){G();return}if(e.stopped||n.client.configurationReady===!1){w.stop(),g(),me(),A?.finish("skipped"),c.hidden=!0,Oe();return}if(c.hidden=!1,w.active){Oe();return}if(e.status==="completed"&&h?.subscriptionUpgradeActive){Oe();return}let t=De(e),r=n.client.view;if(r&&r.revision>e.revision&&De(r)!==t)return;let v=!e.instruction&&!e.pendingRequest&&e.nodeType==="screen"&&["running","waiting"].includes(e.status);t!==ge&&(ge&&A?.finish("dismissed"),me(),ge=t,fe={...e.answers},Xe.reset());let ee=Ye(e);if(Qe===ee){c.hidden=!0;return}if(v&&!t){c.hidden=!0;let I=n.prepared?.state==="shown"?null:Ze(!0,e.locale);!s&&!ie&&We?.key!==ee&&(cn(),We={key:ee,timeout:setTimeout(()=>{let l=n.client.view;if(s||!I?.active&&n.prepared?.state!=="shown"||!l||Ye(l)!==ee)return;Qe=ee;let H=new Error("Funnel screen preparation timed out");I?.finish("error",H),g(),me(),K(H)},He)}),Oe();return}cn();let $=I=>{let l=n.client.view;return!s&&!ie&&!Re&&!I.aborted&&n.client.configurationReady!==!1&&!!l&&!l.stopped&&!["closed","ineligible","failed"].includes(l.status)&&(De(l)===t||l.status==="completed"&&h?.subscriptionUpgradeActive===!0)},we=(I,l)=>{$(l)&&(Qe=t,A?.finish("error",I),me(),c.hidden=!0,K(I))};if(t||((e.instruction&&e.instruction.type!=="evaluate_segment"||!["running","waiting"].includes(e.status))&&g(),en(e),e.instruction?.type!=="event"&&e.instruction?.type!=="open_url"&&A?.finish("skipped")),e.screen){Ge=void 0,g();let I=e.screen.content;if(!de){let W=e.screen.presentation.type!=="inline",C=Ze(W,e.locale);if(s||ie)return;let B=(Te=new AbortController).signal;en(e),_e=W?Un(D):rn(c,i),de=S(k,{mode:"live",closeActions:Array.from(new Set([...n.closeActions??[],...I.document.actions.filter(y=>y.type==="event"&&y.close).map(y=>y.id)])),onAuthoredClose(y){$(B)&&(Le=y,ve())},rendererUrl:n.client.webViewUrl,title:I.document.name,...W?{hostPresentation:()=>J?.type??e.screen.presentation.type}:{},onResize:y=>{Me=y,J?.responsive&&J.setContentHeight(y+U.getBoundingClientRect().height)},onAction(y,d={},ce={}){if(w.active||!$(B)||ne!==t)return;fe={...fe,...ce};let pn=e.screen?.inputs??[],Tn=Object.fromEntries(pn.filter(({variable:qe})=>Object.hasOwn(fe,qe)).map(({variable:qe})=>[qe,fe[qe]]));if(zn(pn,Tn).length){bn();return}Se(()=>n.client.submit({operation:"submit",...ke(),input:{type:"screen",output:y,answers:Tn,selection:d}}),!1,qe=>Mn(qe,pn))},onAnswers:y=>{w.active||!$(B)||ne!==t||(fe={...fe,...y})},onCustomerDataIntent:y=>{w.active||!$(B)||ne!==t||Xe.intent(y).catch(K)},onEscape:()=>{!$(B)||ne!==t||w.active||re||V||he()},onError:y=>{let d=new Error(y);ne===t?K(d):we(d,B)},onRendered:y=>{if(!(!$(B)||ne===t))try{C.present(d=>{_e?.(),_e=void 0,y&&(Ie={screen:I.document.name,label:y},D.setAttribute("aria-label",y)),W&&(D.showModal(),P=!1,J?.responsive&&D.focus({preventScroll:!0}),!d&&n.loading!=="host"&&Hn(D,J?.type??e.screen.presentation.type,J?.responsive)),ne=t,Pe=W,ve()}),$(B)&&Ve.report(t)}catch(d){we(d,B)}}}),En()}let l={capabilities:e.screen.capabilities,customerData:e.screen.customerData,parameters:e.parameters,serverInput:{bindings:e.screen.inputs,answers:fe,values:e.screen.values}},H=JSON.stringify([I,e.locale,l.parameters,e.screen.inputs,e.screen.values]);if(H!==ze)de.update(I.document,e.locale,l),ze=H,on=JSON.stringify(l.capabilities),Be=JSON.stringify(l.customerData);else{let W=JSON.stringify(l.capabilities);W!==on&&(de.updateCapabilities(l.capabilities),on=W),JSON.stringify(l.customerData)!==Be&&(de.updateCustomerData(l.customerData),Be=JSON.stringify(l.customerData))}let Q=de;if(Q)try{await(A?.wait(Q.ready)??Q.ready)}catch(W){Te&&we(W,Te.signal)}}else if(e.paywall&&!h){let I=e.paywall.resolution,l="document"in I?I.document:null,H=p,Q=n.mountPaywallControls,W=null,C=(Te=new AbortController).signal,B={loading:"host",signal:C,...Q&&{mountControls:d=>Q(d,e)},canInteract:()=>$(C)&&!w.active&&!re&&!V,beforeAction:async()=>{Z++;try{await Pn(Ve.settled()),O.hidden=!0,Ee=null,Ae=!1,be()}finally{Z=Math.max(0,Z-1)}},start:async()=>{let d=await yn(n.client),ce=X;return X=void 0,d.view&&ce?.(d.view),d},onObservationChange:Oe,onPurchase:n.onPurchase,onCheckoutUrl:n.onCheckoutUrl,resumeCheckout:n.resumeCheckout,allowNewPurchase:n.allowNewPurchase,checkoutNavigation:n.checkoutNavigation,terminateCheckout:n.terminateCheckout,beforeCheckoutReplacement:n.beforeCheckoutReplacement,purchaseConfirmation:n.purchaseConfirmation,confirmOnHostedCheckout:n.confirmOnHostedCheckout,resolveOfferId:n.resolveOfferId,prepareSubscriptionChange:n.prepareSubscriptionChange,resolveSubscriptionChange:n.resolveSubscriptionChange,claimCoupon:n.claimCoupon,onEvent:n.onEvent,onOpenUrl:d=>n.onOpenUrl?n.onOpenUrl({receiptId:e.paywall.receiptId,url:d,openIn:"same_window"}):o.defaultView?.location.assign(d),onAction:async d=>{if(w.active)return;let ce=await n.client.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:n.client.view?.revision??e.revision,input:{type:"screen",output:d,answers:{}}});await ae(n.client.view??ce.run)},onError:d=>{ne===t?K(d):we(d,C)}},y={quoteError:d=>Ce(n.onError,d),present(d){$(C)&&(W?.present(ce=>{d(ce),ne=t,Pe=y.retainedDialog?.dialog.open??!!k.querySelector("dialog[open]"),Pe&&(P=!1),ve()}),$(C)&&Ve.report(t))},async closeAction(d){s||w.active||await oe.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:n.client.view?.revision??e.revision,input:{type:"screen",output:d,answers:{}}})},async dismiss(){if(s||C.aborted||w.active||re||V||!pe&&!$(C))return;pe=!0;let d=n.client.view;if(d?.status==="completed"&&h?.subscriptionUpgradeActive){Ue.add(`complete:${d.id}`),Ce(n.onComplete,structuredClone(d)),G();return}if((n.resumeCheckout||n.terminateCheckout)&&et()){ue=n.client.view,G();return}await he()}};if(H&&Q)g();else if(H){let d=await H.adopt(e,{options:B,handoff:y,start:()=>yn(n.client)});d&&$(C)&&!s?(en(e),h=d,Ne={runId:e.id,receiptId:e.paywall.receiptId},A?.active&&A.present(()=>{}),ne=t,Pe=H.modal,Pe&&(P=!1),ve(),Ve.report(t),w.active&&h.setSuspended(!0)):(d?.destroy(),g(),X=ce=>p?.remember(ce))}if(s||ie)return;if(!h){if(W=Ze(!0,e.locale,l),s||ie)return;(typeof INDIANA_NATIVE_SHELL_BUILD>"u"||!INDIANA_NATIVE_SHELL_BUILD)&&n.loading==="host"&&Ge?.ownerDocument===o&&(y.hostPaywallTarget=Ge),Ge=void 0,en(e);let d=await le(k,B,y).catch(ce=>(we(ce,C),null));!$(C)&&!(pe&&!s&&!C.aborted)?d?.host?.destroy():d&&(h=d.host,h&&(Ne={runId:e.id,receiptId:e.paywall.receiptId}),h?.setSuspended(w.active))}}if(s||ie)return;ve();let m=e.instruction;if(m&&(m.type==="open_url"||m.type==="event")&&!Ue.has(m.receiptId)){let I=o.createElement("button");I.type="button",I.style.cssText=T.primary,$e(I,()=>T.focus),k.style.cssText=T.stage,I.textContent=m.type==="open_url"?`${R?"前往":"Continue to"} ${new URL(m.url).host}`:R?"继续":"Continue",I.onclick=()=>{let l=ke(),H=m.type==="open_url"&&!n.onOpenUrl&&m.openIn==="new_window"?Yn(m.url):null;Se(async()=>{let Q="success";if(m.type==="open_url")if(n.onOpenUrl)try{Q=await n.onOpenUrl({receiptId:m.receiptId,url:m.url,openIn:m.openIn})===!1?"failed":"opened"}catch(C){Ce(n.onError,C),Q="failed"}else Q=m.openIn==="new_window"&&!H?"failed":"opened";if(m.type==="event"){if(!n.onEvent)throw new te("EVENT_HANDLER_REQUIRED","Provide the event handler");await n.onEvent(m.event)}if(s||n.client.view?.nodeId!==l.nodeId||n.client.view.visit!==l.visit)throw new te("PRECONDITION_FAILED","The client action visit changed");let W=await n.client.submit({operation:"submit",...l,input:{type:"client_action",receiptId:m.receiptId,outcome:Q}});return Ue.add(m.receiptId),m.type==="open_url"&&!n.onOpenUrl&&m.openIn==="same_window"&&o.defaultView?.location.assign(m.url),W})},A?.active?A.present(()=>k.replaceChildren(I)):k.replaceChildren(I)}!e.pendingRequest&&e.status==="completed"&&!Ue.has(`complete:${e.id}`)&&(Ue.add(`complete:${e.id}`),Ce(n.onComplete,structuredClone(e))),Oe()}function Yn(e){let t=o.defaultView?.open(e,"_blank")??null;return t&&(t.opener=null),t}function ae(e){return ve(),an=an.catch(()=>{}).then(async()=>{try{await Xn(e)}catch(t){throw A?.active&&(Qe=Ye(e),A.finish("error",t),me(),c.hidden=!0),t}}),an}let Zn=n.client.subscribe(e=>{if(!In){if(e.stopped&&(Pe||a())&&!pe){ue=e,G();return}!pe&&(e.stopped||n.client.configurationReady===!1||ge&&ne!==ge&&(De(e)!==ge||["closed","ineligible","failed"].includes(e.status)))&&(me(),A?.finish("dismissed"),c.hidden=!0),ae(e).catch(K)}}),Kn=n.client.subscribeError?.(e=>{oe.pending||K(e)});function et(){let e=n.client.view,t=e?.paywall;return!!t?.operation&&!!e&&["running","waiting"].includes(e.status)&&Sn(fn({quote:t.quote,operation:t.operation,requestId:t.purchaseRequestId,pending:!1,destroyed:!1,canReselect:t.canReselect}))}function he(e){if(Re)return Re;if(s||!e&&(re||V))return Promise.resolve();let t=!e&&je();return!t&&n.client.view&&!["running","waiting"].includes(n.client.view.status)?(ue=n.client.view,G(),Promise.resolve()):(Re=Se(async()=>{let r=t?await n.client.retry():await(e?n.client.submit.bind(n.client):oe.submit)({operation:"close",...e??ke()});return e&&Cn(r),r},!0).then(()=>{let r=n.client.view;r?.status==="closed"&&!je()&&(ue=r,G())}).finally(()=>{Re=null}),Re)}function G(){kn()}function kn(e){_?.destroy(),!s&&(s=!0,oe.destroy(),E(),g(),n.signal?.removeEventListener("abort",G),f?.removeEventListener("abort",G),A?.finish("dismissed"),ln.destroy(),Zn(),Kn?.(),me(e),Ke(),w.stop(),D.remove(),!e||!c.contains(e)?c.remove():(U.remove(),j.remove()),!e&&!P&&u(),Ce(n.onDismiss,ue?structuredClone(ue):null))}q.onclick=()=>{if(!q.disabled){if(w.active){w.exit();return}Se(()=>n.client.submit({operation:"back",...ke()}))}},M.onclick=()=>{w.open()},F.onclick=()=>{A?.active?A.dismiss():re||he()},Y.onclick=()=>{oe.pending?oe.retry().catch(()=>{}):je()?he():Se(()=>n.client.retry())},D.addEventListener("cancel",e=>{e.preventDefault(),A?.active?A.dismiss():re||he()}),n.signal?.addEventListener("abort",G,{once:!0}),f?.addEventListener("abort",G,{once:!0});let nn=!1;p&&(E=p.onClose(()=>{s||ie||(ie=!0,A?.finish("dismissed"),me(),c.hidden=!0,n.client.view?he().finally(G):nn=!0)}));let Fn={destroy:G,refresh:un,get recoveryPaywall(){if(h&&Ne)return{...Ne,view:h.currentResolution}},setPurchaseRecovery(e,t){return h?.setPurchaseRecovery(e,t),h!==null},retainPurchaseDialog(){let e=h?.retainPurchaseDialog();if(e)return h=null,kn(e.dialog),{dialog:e.dialog,release(){e.release(),c.remove(),P||u()}}},get recovery(){let e=dn();if(e)return e;if(!s&&!Z&&!pe&&!re&&h){let t=h.recovery;if(t.type!=="native")return t}return{type:"recover",operationId:n.client.pendingPurchase?.operationId??n.client.view?.paywall?.quote?.operationId??V?.operationId??null,requestId:n.client.pendingCommand?.requestId??null}},prepareFallback(){if(re)return re;let e=dn();if(e)return Promise.resolve(e);let t=n.client.pendingPurchase?.operationId??n.client.view?.paywall?.quote?.operationId??V?.operationId??null,r=()=>({type:"recover",operationId:t,requestId:n.client.pendingCommand?.requestId??null});if(n.client.hasDurableJournal!==!0){let m=h?.recovery;return Promise.resolve(m&&m.type!=="native"&&m.type!=="cancel"?m:r())}let v=(n.client.pendingCommands??(n.client.pendingCommand?[n.client.pendingCommand]:[])).some(m=>m.operation==="close");if(s&&!(v||V&&n.client.view?.status==="closed")||Z||Je||Re||w.active||!h&&!V&&!v)return Promise.resolve(r());let ee=h,$=(async()=>{try{if(!V&&v){let l=await n.client.retry();return await ae(n.client.view??l.run),r()}if(!V){let l=await ee.prepareFallback();if(l.type!=="native")return l;if(n.client.hasDurableJournal!==!0)return r();V=l}let m=n.client.pendingCommands??(n.client.pendingCommand?[n.client.pendingCommand]:[]);if(m.length){let l=m.find(Q=>Q.operation==="close");if(!l||!z||l.requestId!==z.requestId)return r();let H=await n.client.retry();Cn(H),await ae(n.client.view??H.run)}else{let l=n.client.view,H=l?.paywall;if(!l||!H||H.selectionGeneration===void 0||(H.quote?.operationId??null)!==V.operationId||V.operationId!==null&&H.canReselect!==!0)return r();let Q=H.selectionGeneration,W=await n.client.get();await ae(n.client.view??W.run);let C=n.client.view,B=C?.paywall;if(!C||!B||!["running","waiting"].includes(C.status)||C.stopped||C.id!==l.id||C.nodeId!==l.nodeId||C.visit!==l.visit||B.receiptId!==H.receiptId||B.selectionGeneration!==Q||(B.quote?.operationId??null)!==V.operationId||V.operationId!==null&&B.canReselect!==!0||n.client.pendingPurchase||(n.client.pendingCommands?.length??(n.client.pendingCommand?1:0)))return r();let y=ke();z={runId:C.id,operationId:V.operationId,revision:y.revision,requestId:y.requestId,nodeId:C.nodeId,visit:C.visit,receiptId:B.receiptId,selectionGeneration:Q,acknowledged:!1},await he(y)}let I=dn();return I?(G(),I):r()}catch(m){return K(m),r()}})();re=$;let we=()=>{re===$&&(re=null)};return $.then(we,we),$},review:w.open,exitReview:w.exit,get unappliedDrafts(){return w.drafts}};try{let e=n.client.view;if(e)((n.client.viewAgeMs??gn)>=gn||e.instruction?.type==="evaluate_segment")&&(sn=un().finally(()=>{sn=null})),await ae(e);else{if(c.hidden=!0,s)throw new DOMException("Presentation cancelled","AbortError");let t=nn||n.prepared?.state==="shown"?null:Ze(n.client.view?.screen?.presentation.type!=="inline",n.client.view?.locale);if(s||ie&&!nn)throw new DOMException("Presentation cancelled","AbortError");let r=n.client.get(),v=await(t?t.wait(r,He):tt(r,He));if(In=!1,nn)return s||await he().finally(G),Fn;await ae(n.client.view??v.run)}}catch(e){throw A?.finish("error",e),G(),e}return Fn}function tt(i,b){let N;return Promise.race([i,new Promise((n,p)=>{N=setTimeout(()=>p(new Error("Presentation data timed out")),b)})]).finally(()=>clearTimeout(N))}function Ot(i,b,N){return nt(i,b,N)}export{nt as a,Ot as b};
@@ -1 +0,0 @@
1
- import{d as p}from"./chunk-TXVLJFZG.js";import"./chunk-FUP5JVDE.js";import"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-XIBJF5E6.js";import{a as y}from"./chunk-5MRSFLQA.js";import{b as t}from"./chunk-YLH3AYCK.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";var m=1440*6e4,f=8,g=512*1024,u=t.strictObject({savedAt:t.number().int().nonnegative(),funnelId:t.string().min(1),context:t.strictObject({commerce:t.strictObject({provider:t.string(),currency:t.string(),intent:t.literal("subscription_change").optional()}),locale:t.string()}),resolution:p}),w=t.strictObject({copies:t.record(t.string(),t.unknown())});function h(c){let d=(async()=>{let s=c.storage??globalThis.localStorage;if(!s||!globalThis.crypto?.subtle)return null;let r=new TextEncoder().encode(JSON.stringify([new URL(c.baseUrl??y).href,c.scope.projectId,c.scope.environment,c.customerId])),e=new Uint8Array(await crypto.subtle.digest("SHA-256",r));return{storage:s,key:"indiana.funnel.paywalls.v1."+Array.from(e,o=>o.toString(16).padStart(2,"0")).join("")}})().catch(()=>null);async function l(){let s=await d;if(!s)return null;try{let r=s.storage.getItem(s.key),e=r&&r.length<=g?w.safeParse(JSON.parse(r)):null;return{...s,copies:e?.success?e.data.copies:{}}}catch{return{...s,copies:{}}}}return{async read(s){let r=await l(),e=u.safeParse(r?.copies[s]);if(!e.success)return null;let o=Date.now()-e.data.savedAt;return o>=0&&o<m?e.data:null},async write(s,r){let e=await l();if(!e)return;let o={...e.copies};delete o[s];let i=[...r?[[s,r]]:[],...Object.entries(o).map(([n,a])=>[n,u.safeParse(a)]).flatMap(([n,a])=>a.success?[[n,a.data]]:[]).sort(([,n],[,a])=>a.savedAt-n.savedAt)].slice(0,f);try{for(;i.length;){let n=JSON.stringify({copies:Object.fromEntries(i)});if(n.length<=g){e.storage.setItem(e.key,n);return}i.pop()}e.storage.removeItem(e.key)}catch{}}}}export{m as PAYWALL_COPY_MAX_AGE_MS,h as createPaywallCopies};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-7NKBMAOB.js";import"./chunk-N5HX3K5J.js";import"./chunk-DCMA7W7N.js";import"./chunk-JBN6ADWQ.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-PNX7Y2K3.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-7EENIOSJ.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as PRERENDER_MAX_AGE_MS,b as preparedInternals,c as prerenderFunnelPurchase};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-N5HX3K5J.js";import"./chunk-DCMA7W7N.js";import"./chunk-PNX7Y2K3.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-7OJIW75D.js";import"./chunk-YLH3AYCK.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as predictFunnelStart,c as predictedPaywallLoadingDocument,b as predictionRefusal};
@@ -1 +0,0 @@
1
- import{a as e,b as o,c as n}from"./chunk-DCMA7W7N.js";import"./chunk-PNX7Y2K3.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-7OJIW75D.js";import"./chunk-YLH3AYCK.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{e as FUNNEL_ROUTE_LIMITS,o as funnelRouteSchema,n as projectFunnelRoute};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-MUP7FNNY.js";import"./chunk-7NKBMAOB.js";import"./chunk-45MWDZ42.js";import"./chunk-A22QPPNY.js";import"./chunk-N5HX3K5J.js";import"./chunk-DCMA7W7N.js";import"./chunk-45PGU2HW.js";import"./chunk-AEQUKR4O.js";import"./chunk-W32FI2A2.js";import"./chunk-K675GO7R.js";import"./chunk-47FCHF3Y.js";import"./chunk-KVLOMX2G.js";import"./chunk-JBN6ADWQ.js";import"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-PNX7Y2K3.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-7D5462NE.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-SLUA7ABW.js";import"./chunk-MB2U2GWJ.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as showFunnelRun,b as showObservedFunnelRun};
@@ -1 +0,0 @@
1
- import{P as r,Q as m,j as e}from"./chunk-5WFI36LF.js";import"./chunk-7EENIOSJ.js";import"./chunk-OKPWZZZW.js";import"./chunk-XIBJF5E6.js";import"./chunk-YLH3AYCK.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{m as merchantBridgeCommerceSchema,r as merchantBridgeOperationSchema,e as merchantOperationLookupSchema};
@@ -1 +0,0 @@
1
- import{e as o}from"./chunk-QPVA644N.js";import"./chunk-G2OLUFYT.js";import"./chunk-SAPICYY3.js";import"./chunk-TXVLJFZG.js";import"./chunk-FUP5JVDE.js";import"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-RNCUAYLQ.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-XIBJF5E6.js";import"./chunk-YLH3AYCK.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{o as apiOperations};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-ZLSZBGJG.js";import"./chunk-A22QPPNY.js";import"./chunk-W32FI2A2.js";import"./chunk-K675GO7R.js";import"./chunk-KVLOMX2G.js";import"./chunk-JBN6ADWQ.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-VILB5M4X.js";import"./chunk-7D5462NE.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as showPaywall};
@@ -1 +0,0 @@
1
- import{b as a}from"./chunk-HT5SLWWG.js";import"./chunk-TXVLJFZG.js";import"./chunk-FUP5JVDE.js";import"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-7D5462NE.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-3VUPVXAV.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import"./chunk-YLH3AYCK.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as readPaywallContent};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-YA5YKHDE.js";import"./chunk-QPVA644N.js";import"./chunk-G2OLUFYT.js";import"./chunk-YUL23NAW.js";import"./chunk-KVLOMX2G.js";import"./chunk-JBN6ADWQ.js";import"./chunk-SAPICYY3.js";import"./chunk-E3FUZSTM.js";import"./chunk-HT5SLWWG.js";import"./chunk-TXVLJFZG.js";import"./chunk-FUP5JVDE.js";import"./chunk-AD35L6BX.js";import"./chunk-ZWNWVMCH.js";import"./chunk-3Q3DZEP3.js";import"./chunk-5WFI36LF.js";import"./chunk-MNICOIQ6.js";import"./chunk-VILB5M4X.js";import"./chunk-RNCUAYLQ.js";import"./chunk-7D5462NE.js";import"./chunk-7EENIOSJ.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-3VUPVXAV.js";import"./chunk-EYTP23EK.js";import"./chunk-5MRSFLQA.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as createPaywallSession};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-PQ4ISW55.js";import"./chunk-K675GO7R.js";import"./chunk-Q523TPZM.js";import"./chunk-56YCOGQZ.js";import"./chunk-O5YYORDW.js";import"./chunk-OKPWZZZW.js";import"./chunk-7OJIW75D.js";import"./chunk-46USIMCJ.js";import"./chunk-XIBJF5E6.js";import"./chunk-YLH3AYCK.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{f as formatCustomerDecimal,b as hostedRendererScript,a as hostedRendererShell,d as inspectCustomHtml,i as mountScreenPreview,h as preparePopup,e as prepareScreen,c as sanitizeCustomHtml,g as showPopup};
File without changes