@tinkerlandai/longplay-sdk 0.10.27 → 0.10.28

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 (66) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/chunk-2AKQWIK6.js +1 -0
  3. package/dist/chunk-3JQPCIKN.js +1 -0
  4. package/dist/{chunk-FB7X4MFC.js → chunk-4GZKK2RE.js} +1 -1
  5. package/dist/{chunk-WU4SDY27.js → chunk-5KB452HB.js} +1 -1
  6. package/dist/{chunk-VTZHKUZO.js → chunk-5SL2JQU3.js} +1 -1
  7. package/dist/{chunk-2GMWNOOE.js → chunk-6KAADDQL.js} +1 -1
  8. package/dist/{chunk-LI4B43FT.js → chunk-6O4IBSE3.js} +1 -1
  9. package/dist/{chunk-D4CDG535.js → chunk-6YJ3CFPM.js} +1 -1
  10. package/dist/{chunk-5M536ISX.js → chunk-ARIVUZUH.js} +1 -1
  11. package/dist/{chunk-67JOPO63.js → chunk-BSBHQVHH.js} +1 -1
  12. package/dist/{chunk-LHXRT32T.js → chunk-CK4QMCWN.js} +1 -1
  13. package/dist/{chunk-WKH23DZE.js → chunk-CTSSHAV7.js} +1 -1
  14. package/dist/{chunk-TJMODHSS.js → chunk-DVOYXRVB.js} +1 -1
  15. package/dist/{chunk-S4X6YX5D.js → chunk-FCBTTR5W.js} +1 -1
  16. package/dist/{chunk-26YREQNF.js → chunk-FKDUXXGT.js} +1 -1
  17. package/dist/{chunk-2TQEJ6GM.js → chunk-FODM46LT.js} +1 -1
  18. package/dist/{chunk-AEERSTTW.js → chunk-FVM4JJBA.js} +1 -1
  19. package/dist/{chunk-MTKM26F7.js → chunk-GRNHBOSS.js} +1 -1
  20. package/dist/{chunk-SYQMGS6O.js → chunk-IVDXTPNR.js} +2 -2
  21. package/dist/{chunk-XZMM34BS.js → chunk-JOI5ZUBO.js} +1 -1
  22. package/dist/{chunk-VRCN5YLM.js → chunk-JPBLMVZR.js} +1 -1
  23. package/dist/{chunk-EBXWLW4D.js → chunk-LS4XNIXR.js} +1 -1
  24. package/dist/{chunk-DC7UHEC6.js → chunk-NROHBY3P.js} +1 -1
  25. package/dist/{chunk-5OJVM7Q4.js → chunk-O4KXODTJ.js} +1 -1
  26. package/dist/{chunk-MBLWCMAI.js → chunk-O7HHYO3I.js} +1 -1
  27. package/dist/{chunk-G2QO6ZWP.js → chunk-P3PXFIMG.js} +1 -1
  28. package/dist/{chunk-S67P7ZQ6.js → chunk-QE6T6NX6.js} +1 -1
  29. package/dist/chunk-QONPVFRV.js +1 -0
  30. package/dist/{chunk-COMWJEMO.js → chunk-QQ43HZVT.js} +1 -1
  31. package/dist/{chunk-7CFSTOTX.js → chunk-RCUBJJ7K.js} +1 -1
  32. package/dist/{chunk-WCKOWAIL.js → chunk-TEMI3X5X.js} +1 -1
  33. package/dist/{chunk-HWQVZL7I.js → chunk-UIYOW47V.js} +1 -1
  34. package/dist/{chunk-LHOSUSTZ.js → chunk-VGLBSYPV.js} +1 -1
  35. package/dist/{chunk-2ZPCWVFU.js → chunk-W5KG2IWX.js} +1 -1
  36. package/dist/{chunk-ANZB6OLR.js → chunk-WYMP6O5B.js} +1 -1
  37. package/dist/{content-4V7YBP3O.js → content-VNX6YOVO.js} +1 -1
  38. package/dist/{funnel-host-purchase-LJYQF6AX.js → funnel-host-purchase-WRJIUARR.js} +1 -1
  39. package/dist/funnel-runtime-host-CHE2WGKE.js +1 -0
  40. package/dist/index.js +1 -1
  41. package/dist/merchant-bridge-contracts-M3V6MBVB.js +1 -0
  42. package/dist/openrouter.js +1 -1
  43. package/dist/operation-contracts-ROG5DVKX.js +1 -0
  44. package/dist/page.js +1 -1
  45. package/dist/paywall-OATK5XFF.js +1 -0
  46. package/dist/paywall-session-ABEEADOM.js +1 -0
  47. package/dist/popup.d.ts +2 -0
  48. package/dist/popup.js +1 -1
  49. package/dist/react-native.js +1 -1
  50. package/dist/screen-renderer-EHGDVWEV.js +1 -0
  51. package/dist/server.js +1 -1
  52. package/dist/{visual-dom-CAOVBSVC.js → visual-dom-5LUN4AHO.js} +1 -1
  53. package/dist/visual.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/chunk-WPLSGFYT.js +0 -1
  56. package/dist/chunk-XBVJHXSP.js +0 -1
  57. package/dist/chunk-Z6RZQ5KJ.js +0 -1
  58. package/dist/funnel-runtime-host-XWXG4SIU.js +0 -1
  59. package/dist/merchant-bridge-contracts-OL3ME2AL.js +0 -1
  60. package/dist/operation-contracts-NJPUHGUM.js +0 -1
  61. package/dist/paywall-INF4ZZ7J.js +0 -1
  62. package/dist/paywall-session-3JV2JMUI.js +0 -1
  63. package/dist/screen-renderer-ZRSVFBLQ.js +0 -1
  64. /package/dist/{chunk-QENDBHBQ.js → chunk-CILM5XMH.js} +0 -0
  65. /package/dist/{chunk-D6SDVDXZ.js → chunk-OJM6ORHE.js} +0 -0
  66. /package/dist/{chunk-ZGBSTK22.js → chunk-Z43N7U4U.js} +0 -0
@@ -1 +0,0 @@
1
- import{b as Ye,c as Je}from"./chunk-JGG4R75K.js";import{c as He,d as ze,e as Be,f as de,g as Qe,h as Ge,i as je,k as We}from"./chunk-WKH23DZE.js";import{a as qe,c as Ae,d as Ve,g as Fe}from"./chunk-26YREQNF.js";import{b as te}from"./chunk-ANZB6OLR.js";import"./chunk-MTKM26F7.js";import"./chunk-S67P7ZQ6.js";import{c as Y,o as ee,oa as ne,qa as Me}from"./chunk-TJMODHSS.js";import{c as Ie}from"./chunk-G2QO6ZWP.js";import{a as R}from"./chunk-S4X6YX5D.js";import"./chunk-2ZPCWVFU.js";import"./chunk-AEERSTTW.js";import"./chunk-ZGBSTK22.js";import{a as z}from"./chunk-DSPLGTQI.js";import"./chunk-5OJVM7Q4.js";import"./chunk-QENDBHBQ.js";import"./chunk-WOT6VMZA.js";async function Ke(s,n,v){if(n.status!=="complete")throw new R("INVALID_RESPONSE","A verified completed purchase is required");let b=s?ee.parse(s):null;if(await v.onComplete?.(n),!b||!v.check)return;let y=ee.parse(await v.check());if(y.internal_feature_id!==b.internal_feature_id||y.quantity!==b.quantity||b.observation!==void 0&&(y.observation===void 0||y.observation.requirementDigest!==b.observation.requirementDigest||y.observation.authority!==b.observation.authority||Ie(y.observation.subject)!==Ie(b.observation.subject)))throw new R("INVALID_RESPONSE","The access requirement changed");y.allowed&&await v.onAccessGranted?.(y)}var st={none:0,sm:4,md:8,lg:14,full:9999},ct={system:"system-ui,sans-serif",serif:"Georgia,serif",rounded:"ui-rounded,system-ui,sans-serif",mono:"ui-monospace,monospace"};function lt(s){let[n,v,b]=[1,3,5].map(y=>{let x=Number.parseInt(s.slice(y,y+2),16)/255;return x<=.03928?x/12.92:((x+.055)/1.055)**2.4});return .2126*n+.7152*v+.0722*b}function Xe(s){let n=lt(s.primary),v=(n+.05)/.05>1.05/(n+.05)?"#111318":"#FFFFFF",b=`color-mix(in srgb, ${s.text} 22%, ${s.background})`,y=`${st[s.radius]}px`,x=`appearance:none;margin:0;min-height:44px;padding:10px 18px;border:0;border-radius:${y};font:inherit;font-size:15px;font-weight:600;line-height:1.25;cursor:pointer;touch-action:manipulation`;return{root:`width:100%;box-sizing:border-box;background:${s.background};color:${s.text};font:14px/1.5 ${ct[s.font]}`,controls:"display:flex;gap:12px;padding:0 20px 12px;align-items:center;flex-wrap:wrap",message:"flex:1 1 200px;min-width:0;margin:0;font-size:13px",panel:`flex:1 0 100%;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;padding:16px;border:1px solid ${b};border-radius:${y}`,summary:"margin:0;font-size:15px;font-weight:600",terms:"display:flex;flex-direction:column;gap:4px;font-size:13px;opacity:.72",actions:"display:flex;gap:8px;flex-wrap:wrap;margin-top:4px",primary:`${x};background:${s.primary};color:${v}`,secondary:`${x};background:transparent;color:${s.text};box-shadow:inset 0 0 0 1px ${b}`,link:`${x};background:transparent;color:${s.text};opacity:.72;font-weight:500`}}function Re(s){s.style.opacity=s.disabled?".55":"",s.style.cursor=s.disabled?"not-allowed":"pointer"}function Se(s){return Object.entries(s.document.buttons).filter(([,n])=>n.type==="checkout"&&n.product.type==="fixed"&&!te(n.product,{},s.capabilities)).map(([n])=>n)}async function Nt(s,n,v){let b=We(s.ownerDocument),y=()=>{C.finish("dismissed"),b()},x=()=>y(),C=Qe(s,n,"paywall",()=>{y(),z(n.onDismiss)});n.signal?.throwIfAborted(),n.signal?.addEventListener("abort",x,{once:!0});let B=null,L,g,Te;try{if(C.start(!0),C.cancelled)throw new DOMException("Presentation cancelled","AbortError");if(B=n.check?ee.parse(await C.wait(n.check(),de)):null,B?.allowed)return C.finish("skipped"),n.signal?.removeEventListener("abort",x),b(),await n.onAccessGranted?.(B),{check:B,host:null};let[e,t]=await Promise.allSettled([C.wait(import("./screen-renderer-ZRSVFBLQ.js")),C.wait(n.start().then(d=>(C.cancelled&&d.destroy(),d)),de)]);if(e.status==="rejected")throw t.status==="fulfilled"&&t.value.destroy(),e.reason;if(t.status==="rejected")throw t.reason;Te=e.value,L=t.value,n.signal?.throwIfAborted(),L.signal?.throwIfAborted(),L.signal?.addEventListener("abort",x,{once:!0});let a=L.view??await C.wait(L.refresh(),de);if(!a)throw new R("INVALID_RESPONSE","Paywall presentation is missing");L.signal?.throwIfAborted(),g=a}catch(e){throw C.finish("error",e),n.signal?.removeEventListener("abort",x),L?.signal?.removeEventListener("abort",x),L?.destroy(),b(),e}let r=L,{mountScreenPreview:Ze}=Te,u=s.ownerDocument,pe=new AbortController,U=u.createElement("section"),fe=u.createElement("div"),q=u.createElement("div"),m=u.createElement("p"),f=u.createElement("button"),P=u.createElement("button"),w=u.createElement("dialog"),i=g.document.screen.strings.defaultLocale.startsWith("zh"),et=i?"\u6B63\u5728\u5904\u7406\u2026":"Processing\u2026",tt=i?"\u6B63\u5728\u51C6\u5907\u62A5\u4EF7\u2026":"Preparing your price\u2026",O=Xe(g.document.screen.theme);U.dataset.indianaPaywall="",U.setAttribute("aria-label",g.document.name),U.style.cssText=O.root,q.style.cssText=O.controls,m.style.cssText=O.message,m.setAttribute("role","status"),P.style.cssText=O.link,P.textContent=i?"\u5173\u95ED":"Close",f.style.cssText=O.secondary,f.textContent=i?"\u91CD\u8BD5":"Retry",f.hidden=!0,q.append(m,f,P),U.append(fe,q);let Q=g.document.presentation,G,Oe,me=!1,De=JSON.stringify(g.capabilities);function he(e){if(p)return;g=e;let t=JSON.stringify(e.capabilities);t!==De&&(G?.updateCapabilities(e.capabilities,Se(e)),De=t),rt(e)}let S;function Ne(){let e=u.defaultView;S?.responsive&&e&&G?.resizeViewport?.(e.innerHeight,e.innerWidth)}let p=!1,J=!1,E=null,re=!1,Le=!1,V=!1,ye,we=!1,M,j;function nt(){return J||p||M||we?{type:"recover",operationId:r.operation?.operationId??r.quote?.operationId??null,requestId:null}:Ae(r)}let k=()=>!p&&!re&&!M&&n.canInteract?.()!==!1,be=!1,c=null,_=null;function rt(e){J||E||r.quote||r.operation||(m.textContent=Object.values(e.capabilities.plans).some(t=>t.available)?"":i?"\u5F53\u524D\u8D26\u53F7\u6682\u65E0\u53EF\u8D2D\u4E70\u7684\u65B9\u6848\u3002":"No plans are currently available for this account.")}let ge=new Map,ie=e=>qe({quote:r.quote,operation:e,requestId:null,pending:!1,destroyed:p,canReselect:r.canReselect});async function ve(e){let t=e.merchantExecution;if(!(!k()||!e.checkoutUrl||n.checkoutNavigation==="after_confirmation"&&ie(e).type!=="checkout"||t?.type==="purchase"&&!["not_started","pending"].includes(t.paymentStatus)||ge.get(e.operationId)===e.checkoutUrl)){ge.set(e.operationId,e.checkoutUrl);try{n.onCheckoutUrl?await n.onCheckoutUrl(e.checkoutUrl):u.defaultView?.location.assign(e.checkoutUrl)}catch(a){throw ge.delete(e.operationId),a}}}let F=(e,t=!1)=>{if(t){let a=e instanceof R?e.code:void 0;a==="CAPABILITY_UNAVAILABLE"||a==="NOT_CONFIGURED"?(c=null,m.textContent=i?"\u6682\u65F6\u65E0\u6CD5\u4E3A\u6B64\u5957\u9910\u62A5\u4EF7\uFF0C\u4ED8\u6B3E\u5C1A\u672A\u5F00\u59CB\u3002":"Pricing for this plan is unavailable. Payment hasn\u2019t started."):a==="COMMAND_PENDING"?m.textContent=i?"\u4ECD\u5728\u51C6\u5907\u62A5\u4EF7\uFF0C\u8BF7\u91CD\u8BD5\u4EE5\u67E5\u770B\u7ED3\u679C\u3002":"Your price is still being prepared. Retry to check the result.":m.textContent=i?"\u672A\u80FD\u53D6\u5F97\u62A5\u4EF7\uFF0C\u4ED8\u6B3E\u5C1A\u672A\u5F00\u59CB\u3002\u8BF7\u91CD\u8BD5\u3002":"We couldn\u2019t prepare your price. Payment hasn\u2019t started. Try again."}else m.textContent=e instanceof Error?e.message:i?"\u8BF7\u6C42\u5931\u8D25":"Request failed";f.hidden=c===null,t&&m.scrollIntoView?.({block:"nearest"}),z(t&&v?.quoteError?v.quoteError:n.onError,e)},oe=new WeakMap;function ae(e){J=e;for(let t of _?.querySelectorAll("button")??[])e?(oe.set(t,t.disabled),t.disabled=!0):oe.has(t)&&(t.disabled=oe.get(t),oe.delete(t)),Re(t)}function xe(){m.textContent=i?"\u6682\u65F6\u65E0\u6CD5\u64CD\u4F5C\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"This action is unavailable right now. Try again in a moment."}async function it(e){if(n.beforeAction)try{await n.beforeAction()}catch(t){throw c=e,t}}async function $(e){if(J||p)return;if(!k()){xe();return}let t=e===se,a=t?tt:et;ae(!0),f.hidden=!0,m.textContent=a,t&&m.scrollIntoView?.({block:"nearest"});try{if(await it(e),p)return;if(!k()){c=e,f.hidden=!1,xe();return}await e()}catch(d){p||F(d,t)}finally{ae(!1),m.textContent===a&&(m.textContent="")}}async function ot(e){await Ke(B,e,n)}function Ue(e){return Ae(r).type==="recording"||ie(e).type==="recording"}async function I(e,t=n.checkoutNavigation!=="after_confirmation"){if(p)return;if(!k()){c=async()=>I(await r.read()),f.hidden=!1;return}if(m.textContent=Je(e.status,i),Ue(e)){let o=e.merchantExecution?.type==="purchase"&&e.merchantExecution.recordingStatus==="failed";m.textContent=o?i?"\u4ED8\u6B3E\u548C\u5546\u6237\u5904\u7406\u5DF2\u5B8C\u6210\uFF0C\u4F46\u4EA4\u6613\u8BB0\u5F55\u5931\u8D25\u3002\u8BF7\u8054\u7CFB\u5546\u6237\u4FEE\u590D\uFF0C\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"Payment and fulfillment succeeded, but recording failed. Contact the merchant to repair this purchase; do not buy again.":i?"\u4ED8\u6B3E\u548C\u5546\u6237\u5904\u7406\u5DF2\u5B8C\u6210\uFF0C\u6B63\u5728\u786E\u8BA4\u4EA4\u6613\u8BB0\u5F55\u3002\u8BF7\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"Payment and merchant fulfillment are complete. Recording is pending confirmation; do not purchase again.",f.textContent=i?"\u67E5\u8BE2\u8BB0\u5F55":"Check recording",c=async()=>I(await r.read()),f.hidden=!1;return}if(e.problem){let o=e.problem;c=K,f.textContent=i?"\u68C0\u67E5\u5E76\u6062\u590D\u539F\u64CD\u4F5C":"Check and recover original purchase",F(new R(o.code,o.reason==="RESULT_UNKNOWN"?i?"\u4ED8\u6B3E\u7ED3\u679C\u5C1A\u672A\u786E\u5B9A\uFF0C\u8BF7\u6062\u590D\u539F\u64CD\u4F5C\uFF0C\u6682\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"The payment result is unknown. Recover the original purchase before buying again.":o.phase==="fulfillment"?i?"\u4ED8\u6B3E\u5DF2\u8BB0\u5F55\uFF0C\u5546\u6237\u6743\u76CA\u5904\u7406\u9700\u8981\u6838\u5BF9\u3002":"Payment was recorded. Access fulfillment needs attention.":o.code==="CAPABILITY_UNAVAILABLE"?i?"\u5546\u6237\u5C1A\u4E0D\u652F\u6301\u672C\u6B21\u8D2D\u4E70\u6240\u9700\u7684\u5B8C\u6574\u80FD\u529B\uFF0C\u8BF7\u5904\u7406\u540E\u6062\u590D\u539F\u64CD\u4F5C\u3002":"The merchant does not currently support all actions required by this purchase. Recover the original purchase after this is resolved.":o.code==="NOT_CONFIGURED"?i?"\u4ED8\u6B3E\u670D\u52A1\u8FDE\u63A5\u9700\u8981\u5904\u7406\uFF0C\u8BF7\u8054\u7CFB\u5546\u6237\u540E\u6062\u590D\u539F\u64CD\u4F5C\u3002":"The payment connection needs attention. Contact the merchant, then recover the original purchase.":i?"\u539F\u8D2D\u4E70\u64CD\u4F5C\u9700\u8981\u5904\u7406\uFF0C\u8BF7\u67E5\u8BE2\u6216\u6062\u590D\u6B64\u64CD\u4F5C\u3002":"The original purchase needs attention. Check or recover this operation.",void 0,void 0,o));return}if(e.merchantExecution?.type==="purchase"&&e.merchantExecution.paymentStatus==="succeeded"&&!["applied","not_applicable"].includes(e.merchantExecution.fulfillmentStatus)&&(m.textContent=i?"\u4ED8\u6B3E\u5DF2\u8BB0\u5F55\uFF0C\u6B63\u5728\u7B49\u5F85\u5546\u6237\u5B8C\u6210\u5904\u7406\u3002":"Payment was recorded. Waiting for merchant fulfillment."),e.status==="complete"){c=null,await ot(e);return}if(e.status!=="pending"){if(r.canReselect===!1){m.textContent=i?"\u6B63\u5728\u6838\u5BF9\u539F\u8D2D\u4E70\u7ED3\u679C":"Checking the original purchase result",f.textContent=i?"\u67E5\u8BE2\u7ED3\u679C":"Check result",c=async()=>I(await r.read()),f.hidden=!1;return}f.textContent=i?"\u91CD\u8BD5":"Retry",c=null,E=null;return}if(!t&&ie(e).type==="checkout"){m.textContent=i?"\u539F\u4ED8\u6B3E\u5C1A\u672A\u5B8C\u6210\uFF0C\u53EF\u7EE7\u7EED\u539F\u6536\u94F6\u53F0\u3002":"Payment is unfinished. Continue the original checkout.",f.textContent=i?"\u7EE7\u7EED\u4ED8\u6B3E":"Continue checkout",c=async()=>I(await r.read(),!0),f.hidden=!1;return}await ve(e);let a=Date.now()+6e5,d=2e3;me=!0,z(n.onObservationChange,!0);try{for(;!p&&Date.now()<a;){if(await Ye(d,u,pe.signal),p)return;if(!k()){c=async()=>I(await r.read()),f.hidden=!1;return}let o=await r.read();if(!t&&ie(o).type==="checkout"){await I(o,!1);return}if(!o.problem&&o.status==="pending"&&await ve(o),o.status!=="pending"||o.problem||Ue(o)){await I(o);return}d=Math.min(d*1.5,3e4)}}finally{me=!1,z(n.onObservationChange,!1)}c=async()=>I(await r.read()),f.hidden=!1}async function Ce(){let e=await r.read();if(p)return;if(!k()){c=Ce,f.hidden=!1;return}let t=r.quote;if(t&&Fe(e,{operationId:t.operationId,currency:t.currency},"The original purchase operation changed"),t&&e.status==="pending"&&e.quoteFinalized===!1&&!e.confirmedAt&&!e.checkoutUrl&&!e.nativePurchase&&!e.merchantExecution&&!e.problem&&!r.pendingCancellation){_e(t);return}await I(e)}async function K(){_?.remove(),_=null,c=K;let e=await r.confirm();if(!k()){c=K,f.hidden=!1;return}if(e.problem){await I(e);return}if(e.status==="pending"){if(e.checkoutUrl)await ve(e);else if(e.execution&&e.execution.provider!=="merchant"||e.nativePurchase){if(!n.onPurchase)throw new R("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await n.onPurchase({operation:e,signal:pe.signal})}}c=async()=>I(await r.read()),await I(e,!0)}function _e(e){_?.remove();let t=!(Date.parse(e.expiresAt)>Date.now());m.textContent=t?i?"\u6B64\u62A5\u4EF7\u5DF2\u8FC7\u671F\u3002\u8BF7\u5148\u53D6\u6D88\uFF0C\u518D\u91CD\u65B0\u9009\u62E9\u3002":"This quote has expired. Cancel it, then choose again.":"";let a=u.createElement("div"),d=u.createElement("button"),o=u.createElement("button"),N=u.createElement("div"),X=u.createElement("p"),T=e.merchantTerms,ce=T?T.totalMinor:e.charge?.totalMinor??e.catalogAmountMinor-(e.discount?.amountMinor??0),le=i?"zh-CN":"en",ue=T?.subscriptionTerms?.items??[],Z=T?ue.length===1&&ue[0]?.amountMinor===ce&&ue[0]:e.lines.length===1&&e.lines[0]?.catalogAmountMinor===ce&&e.lines[0];X.textContent=e.lines.map(l=>l.productName).join(", ")+" \xB7 "+(ce===null?i?`${Y(T.subtotalMinor-T.discountMinor,e.currency)} + \u5F85\u786E\u8BA4\u7A0E\u8D39`:`${Y(T.subtotalMinor-T.discountMinor,e.currency)} + tax confirmed at checkout`:Y(ce,e.currency)+(Z?ne(Z.interval,le,Z.intervalCount??1):"")),d.textContent=i?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",d.disabled=t,o.textContent=i?"\u53D6\u6D88":"Cancel",a.style.cssText=O.panel,X.style.cssText=O.summary,N.style.cssText=O.actions,d.style.cssText=O.primary,o.style.cssText=O.secondary,Re(d),d.onclick=()=>{$(K)};let $e=async()=>{let l=await r.cancel();p||(a.remove(),_=null,await I(l))};o.onclick=()=>{c=$e,$($e)};let D=u.createElement("div");if(D.style.cssText=O.terms,T){for(let h of ue){if(h===Z)continue;let A=u.createElement("p");A.textContent=Y(h.amountMinor,e.currency)+ne(h.interval,le,h.intervalCount),D.append(A)}let l=T.subscriptionTerms?.trial;if(l){let h=u.createElement("p");h.textContent=i?`\u8BD5\u7528 ${l.days} \u5929\uFF1B${l.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${l.days}; ${l.cardRequired?"a payment method is required":"no payment method is required"}`,D.append(h)}for(let h of[...T.expectedEffects.map(A=>A.description),...T.requiredConsents.map(A=>A.summary)]){let A=u.createElement("p");A.textContent=h,D.append(A)}}else{for(let l of e.lines){if(l!==Z){let h=u.createElement("p");h.textContent=`${l.productName} \xB7 ${Y(l.catalogAmountMinor,e.currency)}${ne(l.interval,le,l.intervalCount??1)}`,D.append(h)}for(let h of l.prepaid??[]){let A=u.createElement("p"),H=r.view?.capabilities.plans[l.productVersionId]?.prepaid?.find(at=>at.internalFeatureId===h.internal_feature_id);A.textContent=`${H?.name??h.internal_feature_id} \xB7 ${h.quantity} ${i?"\u4EFD":"packs"} \xD7 ${h.terms.units}`,H&&(A.textContent+=ne(H.reset==="week"||H.reset==="month"||H.reset==="year"?H.reset:"one_time",le,H.resetCount)),D.append(A)}if(l.trial){let h=u.createElement("p");h.textContent=i?`\u8BD5\u7528 ${l.trial.days} \u5929\uFF1B${l.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${l.trial.days}; ${l.trial.cardRequired?"a payment method is required":"no payment method is required"}`,D.append(h)}}if(!e.charge){let l=u.createElement("p");l.textContent=i?"\u76EE\u5F55\u4EF7\u683C\uFF1B\u6700\u7EC8\u91D1\u989D\u4EE5\u7ED3\u8D26\u65F6\u7A0E\u8D39\u548C\u8BD5\u7528\u89C4\u5219\u4E3A\u51C6\u3002":"Catalog price; the final charge depends on checkout taxes and trial terms.",D.append(l)}}for(let l of D.children)l.style.margin="0";N.append(d,o),a.append(X,...D.childElementCount?[D]:[],N),q.prepend(a),a.scrollIntoView?.({block:"nearest"}),d.focus({preventScroll:!0}),_=a,c=null}async function se(){if(!E)return;if(c=se,!be){let a=r.view,d=a?.document.buttons[E.actionId],o=a&&d?.type==="checkout"?te(d.product,E.selection,a.capabilities):null;if(!o)throw new R("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let N=await n.resolveOfferId?.({actionId:E.actionId,productVersionId:o});if(p)return;N!==void 0&&(E.offerId=N),be=!0}if(!k()){f.hidden=!1;return}let e=await r.preview(E);if(p)return;let t=e.merchantTerms;if(n.confirmOnHostedCheckout&&k()&&e.provider==="merchant"&&e.billingSubscriptionId===null&&t?.request.action==="purchase"&&t.request.mode==="subscription"&&t.subscriptionTerms?.trial===null&&t.requiredConsents.length===0&&Date.parse(e.expiresAt)>Date.now()){try{await K()}catch(a){p||F(a)}return}_e(e)}function W(e="destroy"){p||(p=!0,n.signal?.removeEventListener("abort",x),r.signal?.removeEventListener("abort",x),C.finish("dismissed"),Oe?.(),pe.abort(),S?.destroy(),G?.destroy(),r.destroy(),w.open&&w.close(),w.remove(),U.remove(),b(),e==="dismiss"&&z(n.onDismiss))}y=W;async function Pe(){if(!V||p||re||M==="closing"||!M&&!k())return;if(!v){W("dismiss");return}let e=u.createElement("p");e.setAttribute("role","status"),e.textContent=i?"\u6B63\u5728\u5173\u95ED\u2026":"Closing\u2026",j||(j=u.createElement("div"),j.style.cssText=q.style.cssText,q.replaceWith(j),fe.inert=!0),j.replaceChildren(e,P),M="closing",P.setAttribute("aria-disabled","true"),P.focus({preventScroll:!0});try{await v.dismiss()}catch(t){p||z(n.onError,t)}p||(M="retry",e.textContent=i?"\u672A\u80FD\u786E\u8BA4\u5173\u95ED\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not confirm closure. Try again.",P.textContent=i?"\u91CD\u8BD5\u5173\u95ED":"Retry closing",P.removeAttribute("aria-label"),P.removeAttribute("aria-disabled"))}P.onclick=()=>{Pe()},w.addEventListener("cancel",e=>{e.preventDefault(),Pe()}),f.onclick=()=>{c&&$(c)};function Ee(e){C.finish("error",e),W()}function ke(){if(!(!Le||V||p||re||S&&!k()))try{let e=t=>{ye?.(),S&&(w.showModal(),S.responsive&&w.focus({preventScroll:!0}),!t&&n.loading!=="host"&&ze(w,S.type,S.responsive)),V=!0};v?v.present(()=>C.present(()=>e(!0))):C.present(e)}catch(e){Ee(e),F(e)}}try{if(Q.type==="inline")ye=je(U,s),s.append(U);else{let t={sm:420,md:640,lg:900};w.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in Q?t[Q.size]+"px":"100vw"}`,w.setAttribute("aria-label",g.document.name),P.textContent="\xD7",P.setAttribute("aria-label",i?"\u5173\u95ED":"Close"),Be(P,g.document.screen.theme),w.append(P,U),s.append(w),S=He(w,{...g.document.screen,presentation:Q},Ne),S.latch(),ye=Ge(w)}G=Ze(fe,{mode:"live",rendererUrl:r.webViewUrl,title:g.document.name,hostPresentation:()=>S?.type??Q.type,onResize:t=>{S?.responsive&&S.setContentHeight(t+(j??q).getBoundingClientRect().height)},onAction(t,a={}){if(!V||p||M)return;if(!k()){xe();return}let d=r.view,o=d?.document.buttons[t];if(!o)return;if(o.type==="close"){$(async()=>{await n.onAction?.(t),W(n.onAction?"action":"dismiss")});return}if(o.type==="action"){c=async()=>{if(o.action.type==="event"){if(!n.onEvent)throw new R("EVENT_HANDLER_REQUIRED","Provide the event handler");await n.onEvent(o.action.event)}else n.onOpenUrl?await n.onOpenUrl(o.action.url):u.defaultView?.location.assign(o.action.url);await n.onAction?.(t),c=null},$(c);return}if(_&&r.canReselect===!1){m.textContent=i?"\u8BF7\u5148\u786E\u8BA4\u6216\u53D6\u6D88\u5F53\u524D\u8D2D\u4E70\u3002":"Confirm or cancel the current purchase first.",_.scrollIntoView?.({block:"nearest"}),_.querySelector("button")?.focus({preventScroll:!0});return}if((r.quote||E)&&r.canReselect===!1){c=r.quote?Ce:se,$(c);return}let N=d&&te(o.product,a,d.capabilities);if(!d||!N){F(new R("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(n.onPurchaseIntent){c=null,$(async()=>{let X={actionId:t,productVersionId:N,selection:structuredClone(a),featureQuantities:Me(d.document.screen,N,a,d.capabilities)};we=!0,await n.onPurchaseIntent(X)});return}if(E&&E.actionId!==t){F(new R("COMMAND_PENDING","Finish the current purchase"));return}E||(E={requestId:crypto.randomUUID(),actionId:t,selection:a},be=!1),$(se)},onEscape:()=>{Pe()},onError:t=>{let a=new Error(t);!V&&!p&&Ee(a),F(a)},onRendered:t=>{t&&w.setAttribute("aria-label",t),Le=!0,ke()}}),Ne(),G.update(g.document.screen,g.document.screen.strings.defaultLocale,{capabilities:g.capabilities,unavailableActions:Se(g),serverInput:{bindings:[],answers:{}}}),Oe=r.subscribe?.(he),he(r.view??g),await C.wait(G.ready);let e=r.operation;(r.quote||e&&(e.confirmedAt||e.checkoutUrl||e.status==="complete"))&&(c=Ce,$(c))}catch(e){throw Ee(e),e}return{check:B,host:{get observing(){return me},get recovery(){return nt()},async prepareFallback(){if(J||p||M||we)return{type:"recover",operationId:r.operation?.operationId??r.quote?.operationId??null,requestId:null};ae(!0);try{let e=await Ve(r);return e.type==="native"&&W(),e}finally{ae(!1)}},setSuspended(e){re=e,U.hidden=e,e&&w.open?w.close():!e&&!V?ke():!e&&!p&&V&&Q.type!=="inline"&&!w.open&&w.showModal()},destroy:W,refresh:async()=>{if(!k()){if(r.view)return r.view;throw new R("PRECONDITION_FAILED","Paywall presentation is suspended")}let e=await r.refresh();return he(e),ke(),e}}}}export{Nt as showPaywall};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-67JOPO63.js";import"./chunk-VTZHKUZO.js";import"./chunk-HWQVZL7I.js";import"./chunk-LI4B43FT.js";import"./chunk-LHOSUSTZ.js";import"./chunk-EBXWLW4D.js";import"./chunk-5M536ISX.js";import"./chunk-2GMWNOOE.js";import"./chunk-FB7X4MFC.js";import"./chunk-XZMM34BS.js";import"./chunk-XBVJHXSP.js";import"./chunk-26YREQNF.js";import"./chunk-ANZB6OLR.js";import"./chunk-MBLWCMAI.js";import"./chunk-MTKM26F7.js";import"./chunk-S67P7ZQ6.js";import"./chunk-TJMODHSS.js";import"./chunk-G2QO6ZWP.js";import"./chunk-S4X6YX5D.js";import"./chunk-2ZPCWVFU.js";import"./chunk-3VUPVXAV.js";import"./chunk-AEERSTTW.js";import"./chunk-ZGBSTK22.js";import"./chunk-DSPLGTQI.js";import"./chunk-5OJVM7Q4.js";import"./chunk-QENDBHBQ.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-SYQMGS6O.js";import"./chunk-WKH23DZE.js";import"./chunk-TJMODHSS.js";import"./chunk-G2QO6ZWP.js";import"./chunk-S4X6YX5D.js";import"./chunk-2ZPCWVFU.js";import"./chunk-ZGBSTK22.js";import"./chunk-DSPLGTQI.js";import"./chunk-5OJVM7Q4.js";import"./chunk-QENDBHBQ.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
File without changes
File without changes