@tinkerlandai/longplay-sdk 0.10.25 → 0.10.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/THIRD_PARTY_NOTICES.md +26 -0
- package/dist/{ai-usage-B6RepnmH.d.ts → ai-usage-E4c9NSJK.d.ts} +1 -1
- package/dist/{api-C9P338XT.d.ts → api-BpeJkr6U.d.ts} +390 -390
- package/dist/chunk-2KOQBV3Y.js +1 -0
- package/dist/chunk-2MTTK3BT.js +1 -0
- package/dist/chunk-3FPYCF7Z.js +1 -0
- package/dist/chunk-3VUPVXAV.js +1 -0
- package/dist/chunk-5RXU57I5.js +1 -0
- package/dist/chunk-6VY4PZZ6.js +1 -0
- package/dist/chunk-7CFF6SWH.js +1 -0
- package/dist/chunk-B5JHPPR4.js +10 -0
- package/dist/chunk-BZSKOOMM.js +1 -0
- package/dist/chunk-C6JRUYKW.js +1 -0
- package/dist/chunk-CILM5XMH.js +1 -0
- package/dist/chunk-CNIBGSVO.js +1 -0
- package/dist/chunk-CZ3H2X7D.js +1 -0
- package/dist/chunk-DCCM7FYR.js +1 -0
- package/dist/chunk-DCIGO3NJ.js +1 -0
- package/dist/chunk-DOJE7VUR.js +1 -0
- package/dist/{chunk-34I23EKZ.js → chunk-ECMWY3G2.js} +1 -1
- package/dist/chunk-G7NSECIG.js +1 -0
- package/dist/chunk-GIV4FOOW.js +1 -0
- package/dist/chunk-HMRIMJ5W.js +1 -0
- package/dist/chunk-JAKOBECD.js +1 -0
- package/dist/{chunk-O3LZPMS4.js → chunk-KRTX4QEH.js} +1 -1
- package/dist/chunk-LPDUK7HT.js +1 -0
- package/dist/chunk-MRFBMFNK.js +1 -0
- package/dist/chunk-MWDR5FEU.js +1 -0
- package/dist/chunk-MYUYN7ZG.js +1 -0
- package/dist/chunk-NMKZ724L.js +1 -0
- package/dist/chunk-O4KXODTJ.js +17 -0
- package/dist/chunk-ORPOCB2J.js +1 -0
- package/dist/chunk-PMCGTXGH.js +1 -0
- package/dist/{chunk-RKREEPCT.js → chunk-PWQ5BHBJ.js} +1 -1
- package/dist/chunk-SMIO7OG5.js +1 -0
- package/dist/chunk-T4GTAH43.js +1 -0
- package/dist/chunk-UBKD6VMS.js +1 -0
- package/dist/chunk-UHI7SPHK.js +1 -0
- package/dist/chunk-WM27UTWT.js +62 -0
- package/dist/chunk-WOT6VMZA.js +1 -0
- package/dist/{chunk-SJNF6JDJ.js → chunk-X7G7JMZ3.js} +1 -1
- package/dist/chunk-YSNMXK4R.js +1 -0
- package/dist/{configuration-sync-eEFj_oKG.d.ts → configuration-sync-DdTRUv7A.d.ts} +17 -17
- package/dist/content-UDP5VQS4.js +1 -0
- package/dist/funnel-host-purchase-5NLPYJRK.js +1 -0
- package/dist/{funnel-local-client-CSA9XoC4.d.ts → funnel-local-client-DoYVcZ1z.d.ts} +1696 -1696
- package/dist/funnel-node-evaluation-COxXtZEQ.d.ts +1003 -0
- package/dist/{funnel-process-client-RXgS2i-R.d.ts → funnel-process-client-DtXNiFQ-.d.ts} +1736 -1736
- package/dist/funnel-runtime-host-ZWUAGDBU.js +1 -0
- package/dist/index.d.ts +70 -69
- package/dist/index.js +1 -1
- package/dist/merchant-bridge-contracts-N3Q4W6ZU.js +1 -0
- package/dist/native-shell.js +1 -1
- package/dist/openrouter.d.ts +3 -3
- package/dist/openrouter.js +1 -1
- package/dist/operation-contracts-VURXKAFX.js +1 -0
- package/dist/page.d.ts +12 -12
- package/dist/page.js +1 -1
- package/dist/paywall-QQ2MC4KO.js +1 -0
- package/dist/paywall-session-WC2WFWBQ.js +1 -0
- package/dist/popup.d.ts +4 -4
- package/dist/popup.js +1 -1
- package/dist/react-native.d.ts +8 -8
- package/dist/react-native.js +1 -1
- package/dist/screen-renderer-G2EWN3WB.js +1 -0
- package/dist/server.d.ts +1752 -23
- package/dist/server.js +6 -1
- package/dist/visual-dom-5LUN4AHO.js +1 -0
- package/dist/visual.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2KI63SPJ.js +0 -10
- package/dist/chunk-2ZJ5CS5Q.js +0 -1
- package/dist/chunk-5HJMAZ7A.js +0 -1
- package/dist/chunk-7AXCG6NU.js +0 -1
- package/dist/chunk-BB5P5HPS.js +0 -1
- package/dist/chunk-C2BODHNY.js +0 -1
- package/dist/chunk-EIYWDWXP.js +0 -1
- package/dist/chunk-LFFBNGXP.js +0 -1
- package/dist/chunk-MHEYMXGZ.js +0 -17
- package/dist/chunk-ML3BIPM6.js +0 -1
- package/dist/chunk-O4535GJR.js +0 -6
- package/dist/chunk-OEH47Y2L.js +0 -1
- package/dist/chunk-THGLNE4K.js +0 -1
- package/dist/chunk-TUYBXAAK.js +0 -1
- package/dist/chunk-ZX2RWS3T.js +0 -1
- package/dist/content-FD2Q6XD6.js +0 -1
- package/dist/funnel-host-purchase-XW7IF52Y.js +0 -1
- package/dist/funnel-node-evaluation-Cg-4tcAs.d.ts +0 -2731
- package/dist/funnel-runtime-host-I6PJXVRC.js +0 -1
- package/dist/paywall-CGBFHFRU.js +0 -1
- package/dist/screen-renderer-WOMWOEYL.js +0 -1
- package/dist/visual-dom-7IF7ITAK.js +0 -1
- package/dist/{coupon-DyKA-BRG.d.ts → coupon-kfkIVf9n.d.ts} +4 -4
- package/dist/{presentation-loading-D0A9G_kT.d.ts → presentation-loading-iSaRiDP2.d.ts} +3 -3
- package/dist/{screen-DRP7nsrQ.d.ts → screen-CGCJ46b1.d.ts} +3 -3
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a,c as b}from"./chunk-EIYWDWXP.js";import"./chunk-JGG4R75K.js";import"./chunk-ZX2RWS3T.js";import"./chunk-RKREEPCT.js";import"./chunk-5HJMAZ7A.js";import"./chunk-SJNF6JDJ.js";import"./chunk-SLUA7ABW.js";import"./chunk-OEH47Y2L.js";import"./chunk-O4535GJR.js";import"./chunk-DSPLGTQI.js";import"./chunk-MHEYMXGZ.js";export{a as showFunnelRun,b as showObservedFunnelRun};
|
package/dist/paywall-CGBFHFRU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Ye,c as Je}from"./chunk-JGG4R75K.js";import{c as ze,d as He,e as Be,f as de,g as Qe,h as Ge,i as je,k as We}from"./chunk-ZX2RWS3T.js";import{a as qe,c as Ae,d as Ve,g as Fe}from"./chunk-RKREEPCT.js";import"./chunk-5HJMAZ7A.js";import{a as A}from"./chunk-SJNF6JDJ.js";import{Z as ee}from"./chunk-O4535GJR.js";import{a as z}from"./chunk-DSPLGTQI.js";import{La as te,Na as Me,j as Y,o as Ie,z as Z}from"./chunk-MHEYMXGZ.js";async function Ke(s,n,v){if(n.status!=="complete")throw new A("INVALID_RESPONSE","A verified completed purchase is required");let g=s?Z.parse(s):null;if(await v.onComplete?.(n),!g||!v.check)return;let y=Z.parse(await v.check());if(y.internal_feature_id!==g.internal_feature_id||y.quantity!==g.quantity||g.observation!==void 0&&(y.observation===void 0||y.observation.requirementDigest!==g.observation.requirementDigest||y.observation.authority!==g.observation.authority||Ie(y.observation.subject)!==Ie(g.observation.subject)))throw new A("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,g]=[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*g}function Xe(s){let n=lt(s.primary),v=(n+.05)/.05>1.05/(n+.05)?"#111318":"#FFFFFF",g=`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 ${g};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 ${g}`,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"&&!ee(n.product,{},s.capabilities)).map(([n])=>n)}async function Rt(s,n,v){let g=We(s.ownerDocument),y=()=>{C.finish("dismissed"),g()},x=()=>y(),C=Qe(s,n,"paywall",()=>{y(),z(n.onDismiss)});n.signal?.throwIfAborted(),n.signal?.addEventListener("abort",x,{once:!0});let H=null,N,b,Te;try{if(C.start(!0),C.cancelled)throw new DOMException("Presentation cancelled","AbortError");if(H=n.check?Z.parse(await C.wait(n.check(),de)):null,H?.allowed)return C.finish("skipped"),n.signal?.removeEventListener("abort",x),g(),await n.onAccessGranted?.(H),{check:H,host:null};let[e,t]=await Promise.allSettled([C.wait(import("./screen-renderer-WOMWOEYL.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,N=t.value,n.signal?.throwIfAborted(),N.signal?.throwIfAborted(),N.signal?.addEventListener("abort",x,{once:!0});let o=N.view??await C.wait(N.refresh(),de);if(!o)throw new A("INVALID_RESPONSE","Paywall presentation is missing");N.signal?.throwIfAborted(),b=o}catch(e){throw C.finish("error",e),n.signal?.removeEventListener("abort",x),N?.signal?.removeEventListener("abort",x),N?.destroy(),g(),e}let r=N,{mountScreenPreview:Ze}=Te,u=s.ownerDocument,pe=new AbortController,L=u.createElement("section"),fe=u.createElement("div"),M=u.createElement("div"),m=u.createElement("p"),f=u.createElement("button"),P=u.createElement("button"),w=u.createElement("dialog"),i=b.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(b.document.screen.theme);L.dataset.indianaPaywall="",L.setAttribute("aria-label",b.document.name),L.style.cssText=O.root,M.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,M.append(m,f,P),L.append(fe,M);let B=b.document.presentation,Q,Oe,me=!1,De=JSON.stringify(b.capabilities);function he(e){if(p)return;b=e;let t=JSON.stringify(e.capabilities);t!==De&&(Q?.updateCapabilities(e.capabilities,Se(e)),De=t),rt(e)}let R;function Ne(){let e=u.defaultView;R?.responsive&&e&&Q?.resizeViewport?.(e.innerHeight,e.innerWidth)}let p=!1,J=!1,E=null,ne=!1,Le=!1,q=!1,ye,we=!1,$,G;function nt(){return J||p||$||we?{type:"recover",operationId:r.operation?.operationId??r.quote?.operationId??null,requestId:null}:Ae(r)}let S=()=>!p&&!ne&&!$&&n.canInteract?.()!==!1,ge=!1,c=null,U=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 be=new Map,re=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(!(!S()||!e.checkoutUrl||n.checkoutNavigation==="after_confirmation"&&re(e).type!=="checkout"||t?.type==="purchase"&&!["not_started","pending"].includes(t.paymentStatus)||be.get(e.operationId)===e.checkoutUrl)){be.set(e.operationId,e.checkoutUrl);try{n.onCheckoutUrl?await n.onCheckoutUrl(e.checkoutUrl):u.defaultView?.location.assign(e.checkoutUrl)}catch(o){throw be.delete(e.operationId),o}}}let j=(e,t=!1)=>{if(t){let o=e instanceof A?e.code:void 0;o==="CAPABILITY_UNAVAILABLE"||o==="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."):o==="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)},ie=new WeakMap;function ae(e){J=e;for(let t of U?.querySelectorAll("button")??[])e?(ie.set(t,t.disabled),t.disabled=!0):ie.has(t)&&(t.disabled=ie.get(t),ie.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(!S()){xe();return}let t=e===se,o=t?tt:et;ae(!0),f.hidden=!0,m.textContent=o,t&&m.scrollIntoView?.({block:"nearest"});try{if(await it(e),p)return;if(!S()){c=e,f.hidden=!1,xe();return}await e()}catch(d){p||j(d,t)}finally{ae(!1),m.textContent===o&&(m.textContent="")}}async function at(e){await Ke(H,e,n)}function Ue(e){return Ae(r).type==="recording"||re(e).type==="recording"}async function k(e,t=n.checkoutNavigation!=="after_confirmation"){if(p)return;if(!S()){c=async()=>k(await r.read()),f.hidden=!1;return}if(m.textContent=Je(e.status,i),Ue(e)){let a=e.merchantExecution?.type==="purchase"&&e.merchantExecution.recordingStatus==="failed";m.textContent=a?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()=>k(await r.read()),f.hidden=!1;return}if(e.problem){let a=e.problem;c=oe,f.textContent=i?"\u68C0\u67E5\u5E76\u6062\u590D\u539F\u64CD\u4F5C":"Check and recover original purchase",j(new A(a.code,a.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.":a.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.":a.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.":a.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,a));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 at(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()=>k(await r.read()),f.hidden=!1;return}f.textContent=i?"\u91CD\u8BD5":"Retry",c=null,E=null;return}if(!t&&re(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()=>k(await r.read(),!0),f.hidden=!1;return}await ve(e);let o=Date.now()+6e5,d=2e3;me=!0,z(n.onObservationChange,!0);try{for(;!p&&Date.now()<o;){if(await Ye(d,u,pe.signal),p)return;if(!S()){c=async()=>k(await r.read()),f.hidden=!1;return}let a=await r.read();if(!t&&re(a).type==="checkout"){await k(a,!1);return}if(!a.problem&&a.status==="pending"&&await ve(a),a.status!=="pending"||a.problem||Ue(a)){await k(a);return}d=Math.min(d*1.5,3e4)}}finally{me=!1,z(n.onObservationChange,!1)}c=async()=>k(await r.read()),f.hidden=!1}async function Ce(){let e=await r.read();if(p)return;if(!S()){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 k(e)}async function oe(){U?.remove(),U=null,c=oe;let e=await r.confirm();if(!S()){c=oe,f.hidden=!1;return}if(e.problem){await k(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 A("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await n.onPurchase({operation:e,signal:pe.signal})}}c=async()=>k(await r.read()),await k(e,!0)}function _e(e){U?.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 o=u.createElement("div"),d=u.createElement("button"),a=u.createElement("button"),V=u.createElement("div"),K=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??[],X=T?ue.length===1&&ue[0]?.amountMinor===ce&&ue[0]:e.lines.length===1&&e.lines[0]?.catalogAmountMinor===ce&&e.lines[0];K.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)+(X?te(X.interval,le,X.intervalCount??1):"")),d.textContent=i?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",d.disabled=t,a.textContent=i?"\u53D6\u6D88":"Cancel",o.style.cssText=O.panel,K.style.cssText=O.summary,V.style.cssText=O.actions,d.style.cssText=O.primary,a.style.cssText=O.secondary,Re(d),d.onclick=()=>{_(oe)};let $e=async()=>{let l=await r.cancel();p||(o.remove(),U=null,await k(l))};a.onclick=()=>{c=$e,_($e)};let D=u.createElement("div");if(D.style.cssText=O.terms,T){for(let h of ue){if(h===X)continue;let I=u.createElement("p");I.textContent=Y(h.amountMinor,e.currency)+te(h.interval,le,h.intervalCount),D.append(I)}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(I=>I.description),...T.requiredConsents.map(I=>I.summary)]){let I=u.createElement("p");I.textContent=h,D.append(I)}}else{for(let l of e.lines){if(l!==X){let h=u.createElement("p");h.textContent=`${l.productName} \xB7 ${Y(l.catalogAmountMinor,e.currency)}${te(l.interval,le,l.intervalCount??1)}`,D.append(h)}for(let h of l.prepaid??[]){let I=u.createElement("p"),F=r.view?.capabilities.plans[l.productVersionId]?.prepaid?.find(ot=>ot.internalFeatureId===h.internal_feature_id);I.textContent=`${F?.name??h.internal_feature_id} \xB7 ${h.quantity} ${i?"\u4EFD":"packs"} \xD7 ${h.terms.units}`,F&&(I.textContent+=te(F.reset==="week"||F.reset==="month"||F.reset==="year"?F.reset:"one_time",le,F.resetCount)),D.append(I)}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";V.append(d,a),o.append(K,...D.childElementCount?[D]:[],V),M.prepend(o),o.scrollIntoView?.({block:"nearest"}),d.focus({preventScroll:!0}),U=o,c=null}async function se(){if(!E)return;if(c=se,!ge){let t=r.view,o=t?.document.buttons[E.actionId],d=t&&o?.type==="checkout"?ee(o.product,E.selection,t.capabilities):null;if(!d)throw new A("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let a=await n.resolveOfferId?.({actionId:E.actionId,productVersionId:d});if(p)return;a!==void 0&&(E.offerId=a),ge=!0}if(!S()){f.hidden=!1;return}let e=await r.preview(E);p||_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(),R?.destroy(),Q?.destroy(),r.destroy(),w.open&&w.close(),w.remove(),L.remove(),g(),e==="dismiss"&&z(n.onDismiss))}y=W;async function Pe(){if(!q||p||ne||$==="closing"||!$&&!S())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",G||(G=u.createElement("div"),G.style.cssText=M.style.cssText,M.replaceWith(G),fe.inert=!0),G.replaceChildren(e,P),$="closing",P.setAttribute("aria-disabled","true"),P.focus({preventScroll:!0});try{await v.dismiss()}catch(t){p||z(n.onError,t)}p||($="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||q||p||ne||R&&!S()))try{let e=t=>{ye?.(),R&&(w.showModal(),R.responsive&&w.focus({preventScroll:!0}),!t&&n.loading!=="host"&&He(w,R.type,R.responsive)),q=!0};v?v.present(()=>C.present(()=>e(!0))):C.present(e)}catch(e){Ee(e),j(e)}}try{if(B.type==="inline")ye=je(L,s),s.append(L);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 B?t[B.size]+"px":"100vw"}`,w.setAttribute("aria-label",b.document.name),P.textContent="\xD7",P.setAttribute("aria-label",i?"\u5173\u95ED":"Close"),Be(P,b.document.screen.theme),w.append(P,L),s.append(w),R=ze(w,{...b.document.screen,presentation:B},Ne),R.latch(),ye=Ge(w)}Q=Ze(fe,{mode:"live",rendererUrl:r.webViewUrl,title:b.document.name,hostPresentation:()=>R?.type??B.type,onResize:t=>{R?.responsive&&R.setContentHeight(t+(G??M).getBoundingClientRect().height)},onAction(t,o={}){if(!q||p||$)return;if(!S()){xe();return}let d=r.view,a=d?.document.buttons[t];if(!a)return;if(a.type==="close"){_(async()=>{await n.onAction?.(t),W(n.onAction?"action":"dismiss")});return}if(a.type==="action"){c=async()=>{if(a.action.type==="event"){if(!n.onEvent)throw new A("EVENT_HANDLER_REQUIRED","Provide the event handler");await n.onEvent(a.action.event)}else n.onOpenUrl?await n.onOpenUrl(a.action.url):u.defaultView?.location.assign(a.action.url);await n.onAction?.(t),c=null},_(c);return}if(U&&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.",U.scrollIntoView?.({block:"nearest"}),U.querySelector("button")?.focus({preventScroll:!0});return}if((r.quote||E)&&r.canReselect===!1){c=r.quote?Ce:se,_(c);return}let V=d&&ee(a.product,o,d.capabilities);if(!d||!V){j(new A("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(n.onPurchaseIntent){c=null,_(async()=>{let K={actionId:t,productVersionId:V,selection:structuredClone(o),featureQuantities:Me(d.document.screen,V,o,d.capabilities)};we=!0,await n.onPurchaseIntent(K)});return}if(E&&E.actionId!==t){j(new A("COMMAND_PENDING","Finish the current purchase"));return}E||(E={requestId:crypto.randomUUID(),actionId:t,selection:o},ge=!1),_(se)},onEscape:()=>{Pe()},onError:t=>{let o=new Error(t);!q&&!p&&Ee(o),j(o)},onRendered:t=>{t&&w.setAttribute("aria-label",t),Le=!0,ke()}}),Ne(),Q.update(b.document.screen,b.document.screen.strings.defaultLocale,{capabilities:b.capabilities,unavailableActions:Se(b),serverInput:{bindings:[],answers:{}}}),Oe=r.subscribe?.(he),he(r.view??b),await C.wait(Q.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:H,host:{get observing(){return me},get recovery(){return nt()},async prepareFallback(){if(J||p||$||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){ne=e,L.hidden=e,e&&w.open?w.close():!e&&!q?ke():!e&&!p&&q&&B.type!=="inline"&&!w.open&&w.showModal()},destroy:W,refresh:async()=>{if(!S()){if(r.view)return r.view;throw new A("PRECONDITION_FAILED","Paywall presentation is suspended")}let e=await r.refresh();return he(e),ke(),e}}}}export{Rt as showPaywall};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-2KI63SPJ.js";import"./chunk-ZX2RWS3T.js";import"./chunk-SJNF6JDJ.js";import"./chunk-DSPLGTQI.js";import"./chunk-MHEYMXGZ.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a,c as b}from"./chunk-OJM6ORHE.js";import"./chunk-J6KIN4RH.js";export{b as applyVisualVariation,a as safeVisualMutation};
|
|
@@ -94,10 +94,10 @@ declare const offerSchema: z.ZodObject<{
|
|
|
94
94
|
id: z.ZodUUID;
|
|
95
95
|
couponId: z.ZodUUID;
|
|
96
96
|
status: z.ZodEnum<{
|
|
97
|
-
expired: "expired";
|
|
98
97
|
revoked: "revoked";
|
|
99
|
-
|
|
98
|
+
expired: "expired";
|
|
100
99
|
reserved: "reserved";
|
|
100
|
+
issued: "issued";
|
|
101
101
|
redeemed: "redeemed";
|
|
102
102
|
}>;
|
|
103
103
|
issuedAt: z.ZodISODateTime;
|
|
@@ -168,8 +168,8 @@ declare const offerSchema: z.ZodObject<{
|
|
|
168
168
|
scope: z.ZodObject<{
|
|
169
169
|
type: z.ZodEnum<{
|
|
170
170
|
selected: "selected";
|
|
171
|
-
all: "all";
|
|
172
171
|
condition: "condition";
|
|
172
|
+
all: "all";
|
|
173
173
|
}>;
|
|
174
174
|
}, z.core.$strict>;
|
|
175
175
|
}, z.core.$strict>], "type">;
|
|
@@ -179,8 +179,8 @@ type Offer = z.infer<typeof offerSchema>;
|
|
|
179
179
|
/** 领取失败的原因:未生效 / 不在有效期 / 不符合标签 / 不是首购 / 已达每人上限 / 已领完。 */
|
|
180
180
|
declare const offerUnavailableReasonSchema: z.ZodEnum<{
|
|
181
181
|
unavailable: "unavailable";
|
|
182
|
-
inactive: "inactive";
|
|
183
182
|
claim_disabled: "claim_disabled";
|
|
183
|
+
inactive: "inactive";
|
|
184
184
|
outside_window: "outside_window";
|
|
185
185
|
not_targeted: "not_targeted";
|
|
186
186
|
not_first_purchase: "not_first_purchase";
|
|
@@ -393,9 +393,9 @@ declare const customerPageDataSchema: z.ZodObject<{
|
|
|
393
393
|
}>;
|
|
394
394
|
status: z.ZodEnum<{
|
|
395
395
|
error: "error";
|
|
396
|
-
loading: "loading";
|
|
397
|
-
idle: "idle";
|
|
398
396
|
ready: "ready";
|
|
397
|
+
idle: "idle";
|
|
398
|
+
loading: "loading";
|
|
399
399
|
}>;
|
|
400
400
|
stale: z.ZodBoolean;
|
|
401
401
|
preview: z.ZodBoolean;
|
|
@@ -479,12 +479,12 @@ declare const customerDataIntentSchema: z.ZodObject<{
|
|
|
479
479
|
nodeId: z.ZodString;
|
|
480
480
|
action: z.ZodEnum<{
|
|
481
481
|
filter: "filter";
|
|
482
|
+
refresh: "refresh";
|
|
482
483
|
billing_adjustment: "billing_adjustment";
|
|
483
484
|
billing_authorization: "billing_authorization";
|
|
484
485
|
buy_pack: "buy_pack";
|
|
485
486
|
billing_portal: "billing_portal";
|
|
486
487
|
invoice_open: "invoice_open";
|
|
487
|
-
refresh: "refresh";
|
|
488
488
|
next: "next";
|
|
489
489
|
previous: "previous";
|
|
490
490
|
membership_preview: "membership_preview";
|
|
@@ -115,8 +115,8 @@ declare const textNodeSchema: z.ZodObject<{
|
|
|
115
115
|
productField: z.ZodOptional<z.ZodEnum<{
|
|
116
116
|
name: "name";
|
|
117
117
|
period: "period";
|
|
118
|
-
price: "price";
|
|
119
118
|
trial: "trial";
|
|
119
|
+
price: "price";
|
|
120
120
|
}>>;
|
|
121
121
|
feature: z.ZodOptional<z.ZodObject<{
|
|
122
122
|
id: z.ZodUUID;
|
|
@@ -127,8 +127,8 @@ declare const textNodeSchema: z.ZodObject<{
|
|
|
127
127
|
}, z.core.$strict>>;
|
|
128
128
|
text: z.ZodString;
|
|
129
129
|
variant: z.ZodEnum<{
|
|
130
|
-
title: "title";
|
|
131
130
|
body: "body";
|
|
131
|
+
title: "title";
|
|
132
132
|
heading: "heading";
|
|
133
133
|
caption: "caption";
|
|
134
134
|
}>;
|
|
@@ -1965,9 +1965,9 @@ declare const countdownNodeSchema: z.ZodObject<{
|
|
|
1965
1965
|
}>;
|
|
1966
1966
|
at: z.ZodOptional<z.ZodISODateTime>;
|
|
1967
1967
|
granularity: z.ZodEnum<{
|
|
1968
|
+
minute: "minute";
|
|
1968
1969
|
hour: "hour";
|
|
1969
1970
|
day: "day";
|
|
1970
|
-
minute: "minute";
|
|
1971
1971
|
second: "second";
|
|
1972
1972
|
}>;
|
|
1973
1973
|
expired: z.ZodString;
|