@tinkerlandai/longplay-sdk 0.10.35 → 0.10.37
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 +9 -0
- package/README.md +42 -3
- package/README.zh-CN.md +14 -0
- package/dist/{ai-usage-T62xehqa.d.ts → ai-usage-DXwAGTxT.d.ts} +1 -1
- package/dist/{api-Do-6AyWa.d.ts → api-r6FfVQpg.d.ts} +6 -1
- package/dist/check-response-N22NNTIT.js +1 -0
- package/dist/chunk-2HBIBIOF.js +1 -0
- package/dist/{chunk-73NP72FV.js → chunk-2KJLN65C.js} +1 -1
- package/dist/{chunk-RML52BOR.js → chunk-2VMEDQHT.js} +1 -1
- package/dist/{chunk-CIP5SQ5Y.js → chunk-4KLXQKNO.js} +1 -1
- package/dist/{chunk-FMDC6N4W.js → chunk-6F4JS3RK.js} +1 -1
- package/dist/{chunk-56BYGPQ6.js → chunk-7XDQKZYA.js} +1 -1
- package/dist/{chunk-VEX2FOFZ.js → chunk-AB7GEGZ2.js} +1 -1
- package/dist/{chunk-EM3MGDPG.js → chunk-AHUYZ6IW.js} +1 -1
- package/dist/chunk-AOGDCT4T.js +1 -0
- package/dist/{chunk-EUTWY7A2.js → chunk-CY7OKV7E.js} +1 -1
- package/dist/{chunk-7MNJH5GB.js → chunk-D3OYXTMC.js} +1 -1
- package/dist/chunk-DDLSQSWO.js +10 -0
- package/dist/{chunk-5HJYR6Z4.js → chunk-E7CCHUSO.js} +1 -1
- package/dist/{chunk-BOVN2BE3.js → chunk-ECKVJGXQ.js} +1 -1
- package/dist/chunk-GH6FM44P.js +1 -0
- package/dist/{chunk-TJGIT5CU.js → chunk-HEHLFHW7.js} +1 -1
- package/dist/chunk-HKXFCRVT.js +1 -0
- package/dist/chunk-KFIL73QY.js +1 -0
- package/dist/{chunk-44U3FOBB.js → chunk-LC6UCDWE.js} +1 -1
- package/dist/{chunk-KE26KWIU.js → chunk-LOLMUXHW.js} +1 -1
- package/dist/{chunk-7QL4GF4C.js → chunk-O4KXODTJ.js} +1 -1
- package/dist/{chunk-TLZP7BW6.js → chunk-OCWSWXCW.js} +1 -1
- package/dist/chunk-OQRMAU2B.js +1 -0
- package/dist/{chunk-SXBM3DWK.js → chunk-OX2A3UD2.js} +1 -1
- package/dist/{chunk-LF2UIJYD.js → chunk-PW5PIBSO.js} +1 -1
- package/dist/chunk-Q676H74B.js +1 -0
- package/dist/chunk-RE4OLOOT.js +1 -0
- package/dist/{chunk-CKKIB2HC.js → chunk-S43TYW3V.js} +1 -1
- package/dist/{chunk-U4RSRFZY.js → chunk-T2KWLYCW.js} +1 -1
- package/dist/chunk-TASEZY5T.js +1 -0
- package/dist/{chunk-OX7PA64E.js → chunk-U7NX5ET2.js} +1 -1
- package/dist/{chunk-WZR2XCSJ.js → chunk-UV4H6VCS.js} +1 -1
- package/dist/{chunk-MSK3VZ3A.js → chunk-VIBJNB5B.js} +1 -1
- package/dist/chunk-VLSP3LRH.js +1 -0
- package/dist/{chunk-W6OQTXLL.js → chunk-W74JLL2O.js} +1 -1
- package/dist/chunk-WQ3O5RXN.js +1 -0
- package/dist/chunk-WZMZMJCK.js +1 -0
- package/dist/chunk-XGNXZWZL.js +1 -0
- package/dist/{chunk-VYFSRHXM.js → chunk-XJRDO3NI.js} +1 -1
- package/dist/chunk-YV6UFESO.js +1 -0
- package/dist/{chunk-KPDHY76A.js → chunk-ZYOZSUZS.js} +1 -1
- package/dist/chunk-ZZIBLQCJ.js +1 -0
- package/dist/{configuration-sync-DdTRUv7A.d.ts → configuration-sync-BHrAf-ql.d.ts} +10 -1
- package/dist/content-QNBATPA2.js +1 -0
- package/dist/{funnel-host-purchase-Z7FCJ5CX.js → funnel-host-purchase-FVYPBPET.js} +1 -1
- package/dist/{funnel-local-client-Dz1dTgES.d.ts → funnel-local-client-DR8OpKGU.d.ts} +145 -3
- package/dist/funnel-paywall-prerender-Z7RA4YDY.js +1 -0
- package/dist/{funnel-process-client-D6qjStm2.d.ts → funnel-process-client-C87U4r_G.d.ts} +17 -3
- package/dist/funnel-runtime-host-TJPF3FJS.js +1 -0
- package/dist/index.d.ts +49 -12
- package/dist/index.js +1 -1
- package/dist/merchant-bridge-contracts-67AYXZFI.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-EK4RCUWJ.js +1 -0
- package/dist/page.d.ts +2 -2
- package/dist/page.js +1 -1
- package/dist/paywall-OAVC654P.js +1 -0
- package/dist/paywall-content-75XEM7K3.js +1 -0
- package/dist/paywall-session-U6SPRJRS.js +1 -0
- package/dist/popup.d.ts +4 -4
- package/dist/popup.js +1 -1
- package/dist/{presentation-loading-CFSiS0VX.d.ts → presentation-loading-B_v5XZtM.d.ts} +11 -1
- package/dist/react-native.d.ts +7 -7
- package/dist/react-native.js +1 -1
- package/dist/{screen-CGCJ46b1.d.ts → screen-qUBRsUi9.d.ts} +26 -21
- package/dist/screen-renderer-YIIT742O.js +1 -0
- package/dist/server.d.ts +37 -7
- package/dist/server.js +1 -1
- package/dist/{visual-dom-6DCUZGPB.js → visual-dom-5LUN4AHO.js} +1 -1
- package/dist/visual.js +1 -1
- package/package.json +10 -9
- package/dist/check-response-GZZRWBEA.js +0 -1
- package/dist/chunk-2FE4FTPH.js +0 -1
- package/dist/chunk-BLVBUN2R.js +0 -1
- package/dist/chunk-BQRS7Y4K.js +0 -1
- package/dist/chunk-ETK6GC5P.js +0 -1
- package/dist/chunk-GZRRVHYK.js +0 -1
- package/dist/chunk-PUR5CYWX.js +0 -1
- package/dist/chunk-RNEF4MZW.js +0 -1
- package/dist/chunk-SFHIFCXG.js +0 -1
- package/dist/chunk-TAFALMQN.js +0 -1
- package/dist/chunk-TOTRALYQ.js +0 -10
- package/dist/chunk-UVRT4MY6.js +0 -1
- package/dist/chunk-V7MMTILA.js +0 -1
- package/dist/chunk-V7PFLFHE.js +0 -1
- package/dist/chunk-XUGEOELU.js +0 -1
- package/dist/chunk-YVXLCQGM.js +0 -1
- package/dist/chunk-ZGCKQWQ5.js +0 -1
- package/dist/content-AJDTSI7A.js +0 -1
- package/dist/funnel-paywall-prerender-QHCUZZY3.js +0 -1
- package/dist/funnel-runtime-host-UKSOOA4H.js +0 -1
- package/dist/merchant-bridge-contracts-EAE4HQE4.js +0 -1
- package/dist/operation-contracts-HS4M2UXN.js +0 -1
- package/dist/paywall-VYUBYBUI.js +0 -1
- package/dist/paywall-content-YQAVSO2T.js +0 -1
- package/dist/paywall-session-E5V42XUT.js +0 -1
- package/dist/screen-renderer-R5GH7XLV.js +0 -1
- /package/dist/{chunk-BID4UGWB.js → chunk-CILM5XMH.js} +0 -0
- /package/dist/{chunk-VF6QMMEA.js → chunk-CR2XJ2CX.js} +0 -0
- /package/dist/{chunk-UKMEW5I7.js → chunk-OJM6ORHE.js} +0 -0
package/dist/chunk-V7MMTILA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as r}from"./chunk-VF6QMMEA.js";var I=r.enum(["INVALID_PROTOCOL_VERSION","UNSUPPORTED_PROTOCOL_VERSION","PROTOCOL_RETIRED","UNAUTHENTICATED","FORBIDDEN","SCOPE_MISMATCH","INVALID_REQUEST","NOT_FOUND","CONFLICT","PAYLOAD_TOO_LARGE","RATE_LIMITED","SERVICE_UNAVAILABLE","NOT_CONFIGURED","CAPABILITY_UNAVAILABLE","INTERNAL_ERROR"]),L=r.enum([...I.options,"INVALID_SERVER_RESPONSE","RESPONSE_TOO_LARGE","AMBIGUOUS_AUTHENTICATION","BROWSER_REQUIRED","INVALID_REDIRECT_URI","AUTHORIZATION_UNAVAILABLE","UNREGISTERED_CLIENT","MANAGEMENT_OPERATION_FAILED"]),C=r.enum([...I.options,"stale_revision"]),s=r.enum(["fix_request","authenticate","check_permissions","check_scope","resolve_conflict","reload_state","retry_same_request","configure_integration","check_availability","upgrade_sdk","recover_operation","contact_support"]),c=r.enum(["CAPABILITY_NOT_ENABLED","INTEGRATION_MISSING","PROVIDER_CREDENTIAL_REJECTED","PRICE_BINDING_REQUIRED","IDEMPOTENCY_CONFLICT","RESULT_UNKNOWN","STATE_CHANGED","IDENTITY_CONTEXT_CHANGED","CUSTOMER_BINDING_CONFLICT","RUN_CONTRACT_MISMATCH","OPERATION_IN_PROGRESS","FUNNEL_VERSION_RETIRED","FUNNEL_PAUSED"]),A={INVALID_PROTOCOL_VERSION:{status:400,recovery:"fix_request"},UNSUPPORTED_PROTOCOL_VERSION:{status:400,recovery:"upgrade_sdk"},PROTOCOL_RETIRED:{status:410,recovery:"upgrade_sdk"},UNAUTHENTICATED:{status:401,recovery:"authenticate"},FORBIDDEN:{status:403,recovery:"check_permissions"},SCOPE_MISMATCH:{status:403,recovery:"check_scope"},INVALID_REQUEST:{status:400,recovery:"fix_request"},NOT_FOUND:{status:404,recovery:"fix_request"},CONFLICT:{status:409,recovery:"resolve_conflict"},PAYLOAD_TOO_LARGE:{status:413,recovery:"fix_request"},RATE_LIMITED:{status:429,recovery:"retry_same_request"},SERVICE_UNAVAILABLE:{status:503,recovery:"retry_same_request"},NOT_CONFIGURED:{status:501,recovery:"configure_integration"},CAPABILITY_UNAVAILABLE:{status:501,recovery:"check_availability"},INTERNAL_ERROR:{status:500,recovery:"recover_operation"}};var N={TIMEOUT:"recover_operation",NETWORK_ERROR:"recover_operation",HTTP_ERROR:"recover_operation",INVALID_RESPONSE:"recover_operation",NOT_IDENTIFIED:"authenticate",CUSTOMER_SESSION_REQUIRED:"authenticate",INVALID_TOKEN:"authenticate",INVALID_URL:"fix_request",INVALID_TIMEOUT:"fix_request",SERVER_ONLY:"fix_request",PROTOCOL_MISMATCH:"upgrade_sdk",IDENTITY_CHANGED:"reload_state",INVALID_STATE:"reload_state",EVENT_QUEUE_FULL:"retry_same_request",COMMAND_PENDING:"recover_operation",PURCHASE_PENDING:"recover_operation",DECISION_PENDING:"recover_operation",DECISION_ACCEPTANCE_UNKNOWN:"recover_operation",RUN_RECONCILIATION_REQUIRED:"recover_operation",DECISION_FAILED:"contact_support",COMMAND_STORAGE_CONFLICT:"resolve_conflict",COMMAND_STORAGE_INVALID:"fix_request",PURCHASE_STORAGE_CONFLICT:"resolve_conflict",PURCHASE_STORAGE_INVALID:"recover_operation",EXECUTION_POLICY_REFUSED:"fix_request",CONFIGURATION_UNAVAILABLE:"check_availability",CONFIGURATION_EXPIRED:"reload_state",CONFIGURATION_CHANGED:"reload_state",CONFIGURATION_DISPOSED:"reload_state",UNSUPPORTED_SCHEMA:"upgrade_sdk",FUNNEL_STOPPED:"check_availability",PAYWALL_UNAVAILABLE:"check_availability",EVALUATION_MODE:"reload_state",SERVER_REQUIRED:"fix_request",STICKY_SAVE_FAILED:"retry_same_request",TRANSITION_LIMIT:"resolve_conflict",PRECONDITION_FAILED:"reload_state",PRODUCT_UNAVAILABLE:"fix_request",PURCHASE_HANDLER_REQUIRED:"fix_request",EVENT_HANDLER_REQUIRED:"fix_request",CLOSED:"fix_request",BRIDGE_UNAVAILABLE:"check_availability",INVALID_CONFIGURATION:"fix_request",NATIVE_OPERATION_FAILED:"contact_support",AI_PRICE_UNAVAILABLE:"fix_request",AI_USAGE_UNAVAILABLE:"recover_operation",AI_PROVIDER_ERROR:"check_availability",AI_BALANCE_REJECTED:"resolve_conflict"};function i(e,o){if(e==="CONFLICT"&&o===425)return{retryable:!0,recovery:"retry_same_request"};if(e==="CONFLICT"&&o===412)return{retryable:!1,recovery:"reload_state"};if(e==="INVALID_SERVER_RESPONSE")return{retryable:!1,recovery:"recover_operation"};if(e==="AMBIGUOUS_AUTHENTICATION")return{retryable:!1,recovery:"fix_request"};if(Object.hasOwn(N,e)){let E=N[e];return{retryable:E==="retry_same_request",recovery:E}}let t=I.safeParse(e);return t.success?{retryable:e==="RATE_LIMITED"||e==="SERVICE_UNAVAILABLE",recovery:A[t.data].recovery}:{retryable:!1,recovery:"contact_support"}}function D(e,o){let t=I.safeParse(e);if(t.success)return e==="CONFLICT"?[409,412,425].includes(o):e==="SERVICE_UNAVAILABLE"?[408,502,503,504].includes(o):e==="INVALID_REQUEST"?[400,405,415,422].includes(o):e==="NOT_CONFIGURED"?[501,503].includes(o):A[t.data].status===o;let E={INVALID_SERVER_RESPONSE:[502],RESPONSE_TOO_LARGE:[502],AMBIGUOUS_AUTHENTICATION:[400],BROWSER_REQUIRED:[403],INVALID_REDIRECT_URI:[403],AUTHORIZATION_UNAVAILABLE:[400],UNREGISTERED_CLIENT:[403],MANAGEMENT_OPERATION_FAILED:[400,422,500]};return Object.hasOwn(E,e)&&(E[e]?.includes(o)??!1)}function O(e,o=Date.now()){if(e===null)return;let t=e.trim();if(/^\d+$/.test(t)){let _=Number(t);return Number.isSafeInteger(_)?_:void 0}if(!/^[A-Za-z]{3}, \d{2} [A-Za-z]{3} \d{4} \d{2}:\d{2}:\d{2} GMT$/.test(t))return;let E=Date.parse(t);return Number.isFinite(E)?Math.max(0,Math.ceil((E-o)/1e3)):void 0}var R=r.object({retryable:r.boolean(),recovery:s,reason:c.optional(),retryAfterSeconds:r.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()}),T=r.object({requestId:r.uuid().optional(),error:r.object({code:r.string().regex(/^[A-Z][A-Z0-9_]{0,95}$/),message:r.string(),...R.partial().shape})}),S=r.object({error:T.shape.error.extend({requestId:r.uuid().optional()})}),l=r.object({error:r.string(),code:r.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,95}$/),requestId:r.uuid(),...R.shape});function U(e,o,t={}){let E=i(e,o),_=t.reason==="RESULT_UNKNOWN"?"recover_operation":t.recovery??E.recovery,a=E.retryable&&t.retryable!==!1&&_!=="recover_operation",n=a?O(t.retryAfter??null):void 0;return{...E,retryable:a,recovery:_,...n===void 0?{}:{retryAfterSeconds:n},...t.reason?{reason:t.reason}:{}}}export{I as a,s as b,c,D as d,T as e,U as f};
|
package/dist/chunk-V7PFLFHE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as o}from"./chunk-OX7PA64E.js";function c(e,t){let n=structuredClone(e);for(let[i,r]of Object.entries(n.plans)){let a=t.plans[i];!a||a.versionId!==r.versionId||(a.amountMinor!==void 0&&(r.amountMinor=a.amountMinor),a.interval!==void 0&&(r.interval=a.interval),a.intervalCount!==void 0&&(r.intervalCount=a.intervalCount),a.prepaid!==void 0&&(r.prepaid=structuredClone(a.prepaid)))}return n}var s=class extends o{constructor(n="Plans were updated. Choose again.",i="\u5957\u9910\u5DF2\u66F4\u65B0\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u3002"){super("CONFLICT",n);this.zhMessage=i}zhMessage;customerMessage(n){return n?this.zhMessage:this.message}};function l(e,t){let n=i=>"document"in i?i.offering.id:i.content.offeringVersionId;return e.id===t.id&&n(e)===n(t)&&e.content?.artifact.sha256===t.content?.artifact.sha256}function p(e,t,n){if(e.operationId!==t.operationId||t.currency!==void 0&&e.currency!==t.currency)throw new o("INVALID_RESPONSE",n)}function d(e,t,n){let i=Object.fromEntries((e.lines[0]?.prepaid??[]).map(r=>[r.internal_feature_id,r.quantity]));if(t.featureQuantities&&(Object.keys(i).length!==Object.keys(t.featureQuantities).length||Object.entries(t.featureQuantities).some(([r,a])=>i[r]!==a)))throw new o("INVALID_RESPONSE","The purchase quote changed its selected quantities");if(e.lines.length!==1||e.lines[0].productVersionId!==t.productVersionId||t.currency!==void 0&&e.currency!==t.currency||t.provider!==void 0&&e.provider!==t.provider&&!(t.provider==="stripe"&&e.provider==="merchant"&&e.execution?.provider==="merchant"))throw new o("INVALID_RESPONSE",n)}function f(e,t,n=!1){if(!e||e.operationId!==t?.operationId)return t;let i=e.merchantExecution,r=t.merchantExecution;if(i&&(!r||Date.parse(r.updatedAt)<Date.parse(i.updatedAt))||e.status==="complete"&&t.status!=="complete")return e;let a=t.status===e.status&&i?.recordingStatus!=="accepted"&&r?.recordingStatus==="accepted";return e.status!=="pending"&&(t.status==="pending"||n&&t.status!=="complete"&&!a)?e:t}function y(e){return e.screen.actions.some(t=>t.properties.closeControl==="content"&&e.buttons[t.id]?.type==="close")}export{c as a,s as b,l as c,p as d,d as e,f,y as g};
|
package/dist/chunk-XUGEOELU.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as k}from"./chunk-BQRS7Y4K.js";import{a as M}from"./chunk-DSPLGTQI.js";var z={sm:420,md:640,lg:900},A=767;function pe(e,n,o=()=>!0,c="Close"){let r=e.ownerDocument.defaultView,i=e.ownerDocument.createElement("button");i.type="button",i.setAttribute("aria-label",c),i.style.cssText="position:absolute;inset:0 48px auto;z-index:2;height:24px;border:0;padding:0;background:transparent;touch-action:none;cursor:grab";let d=e.ownerDocument.createElement("span");d.style.cssText="display:block;width:36px;height:4px;border-radius:4px;margin:8px auto 12px;background:currentColor;opacity:.22;pointer-events:none",i.append(d),e.prepend(i);let l,s=0,a=!1,f=()=>{i.hidden=e.dataset.presentation!=="sheet",i.setAttribute("aria-disabled",String(!o()))},v=t=>{f(),!(i.hidden||!o()||t.button!==0)&&(l={y:t.clientY,time:Date.now(),id:t.pointerId},s=0,a=!1,i.setPointerCapture?.(t.pointerId))},y=t=>{!l||t.pointerId!==l.id||(s=Math.max(0,t.clientY-l.y),e.style.transform=`translateY(${s}px)`)},g=t=>{if(!l||t.pointerId!==l.id)return;let u=Math.max(1,Date.now()-l.time),x=t.type!=="pointercancel"&&o()&&(s>120||s>40&&s/u>.5);a=s>6,l=void 0,i.releasePointerCapture?.(t.pointerId),e.style.transform="",x?n():s&&typeof e.animate=="function"&&!r?.matchMedia?.("(prefers-reduced-motion: reduce)").matches&&e.animate([{transform:`translateY(${s}px)`},{transform:"none"}],{duration:200,easing:"cubic-bezier(.2,.8,.2,1)"}),s=0},m=()=>{if(a){a=!1;return}!l&&s===0&&o()&&n()};i.addEventListener("pointerdown",v),i.addEventListener("pointermove",y),i.addEventListener("pointerup",g),i.addEventListener("pointercancel",g),i.addEventListener("click",m);let p=typeof MutationObserver=="function"?new MutationObserver(f):void 0;return p?.observe(e,{attributes:!0,attributeFilter:["data-presentation"]}),r?.addEventListener("resize",f),f(),()=>{p?.disconnect(),r?.removeEventListener("resize",f),i.remove(),e.style.transform=""}}function O(e,n,o=!1){return(e.type==="modal"||e.type==="sheet")&&e.mobile&&o&&n<=A?e.mobile:e.type}function W(e,n,o){let c=e.ownerDocument.defaultView,r=n.presentation,i;if((r.type==="modal"||r.type==="sheet")&&r.backdrop){let t=`lp-backdrop-${crypto.randomUUID()}`,u={none:"transparent",scrim:"#f2f2f2cc",dim:"#0006","strong-dim":"#000000bf",blur:"#0006"};e.dataset.indianaBackdrop=t,i=e.ownerDocument.createElement("style"),i.textContent=`dialog[data-indiana-backdrop="${t}"]::backdrop{background:${u[r.backdrop]};backdrop-filter:${r.backdrop==="blur"?"blur(16px)":"none"}}`,e.append(i)}let d=n.pages?.[0]?.root.style?.shape,l=d?.type==="pill"?"9999px":d?.type==="rect"?typeof d.radius=="number"?`${d.radius}px`:[d.radius.topLeft,d.radius.topRight,d.radius.bottomRight,d.radius.bottomLeft].map(t=>`${t}px`).join(" "):void 0,s=(r.type==="modal"||r.type==="sheet")&&(r.desktopWidth!==void 0||r.mobile!==void 0),a=r.type,f,v,y=!1,g=t=>{y||!Number.isFinite(t)||t<0||(v=t,a!=="fullscreen"&&a!=="inline"&&(e.style.height=`min(${Math.max(t,40)}px, calc(100dvh - ${a==="sheet"?0:32}px))`))},m=()=>{if(!y&&(a=f??O(r,c?.innerWidth??1024,c?.matchMedia?.("(pointer: coarse)").matches===!0),e.dataset.presentation=a,!(!s||r.type!=="modal"&&r.type!=="sheet"))){if(e.style.boxSizing="border-box",e.style.padding="0",e.style.border="0",e.style.overflow="hidden",e.style.outline="none",e.tabIndex=-1,e.style.background=n.theme.background,e.style.color=n.theme.text,a==="fullscreen")e.style.width="100vw",e.style.height="100dvh",e.style.maxWidth="100vw",e.style.maxHeight="100dvh",e.style.margin="0",e.style.borderRadius="0";else{let t=r.mobile==="sheet"&&a==="sheet",u=r.desktopWidth,x=c?.innerWidth??1024;e.style.width=t?`${x}px`:u?`${Math.min(u.max,Math.max(x*u.viewport/100,u.min))}px`:`${k[r.size]}px`,e.style.maxWidth=`${Math.max(0,x-(a==="sheet"?0:32))}px`,e.style.maxHeight=a==="sheet"?"100dvh":"calc(100dvh - 32px)",e.style.margin=a==="sheet"?"auto auto 0":"auto",e.style.borderRadius=l??(a==="sheet"?"16px 16px 0 0":"24px"),e.style.height="",v!==void 0&&g(v)}o?.(a)}},p=s?[c?.matchMedia?.(`(max-width: ${A}px)`),c?.matchMedia?.("(pointer: coarse)")].filter(t=>t!==void 0):[];if(s){c?.addEventListener("resize",m);for(let t of p)t.addEventListener?t.addEventListener("change",m):t.addListener?.(m)}return m(),{responsive:s,get type(){return a},latch(){y||f!==void 0||(m(),f=a)},setContentHeight:g,destroy(){if(!y){y=!0,i?.remove(),delete e.dataset.indianaBackdrop,c?.removeEventListener("resize",m);for(let t of p)t.removeEventListener?t.removeEventListener("change",m):t.removeListener?.(m)}}}}function ue(e,n,o){let{presentation:c}=n,r="size"in c?`${z[c.size]}px`:"100vw";return e.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${r}`,W(e,n,o)}function me(e,n,o=!1){let c=e.ownerDocument.defaultView;if(typeof e.animate!="function"||c?.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let r=o?{duration:300,easing:"cubic-bezier(0.23, 1, 0.32, 1)"}:{duration:240,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)"};e.animate(n==="sheet"?[{transform:"translateY(100%)"},{transform:"none"}]:n==="modal"?[{opacity:0,transform:o?"translateY(12px) scale(0.96)":"translateY(8px) scale(0.98)"},{opacity:1,transform:"none"}]:[{opacity:0},{opacity:1}],r);try{e.animate([{opacity:0},{opacity:1}],{...r,pseudoElement:"::backdrop"})}catch{}}function $(e,n){e.style.cssText=["position:absolute","z-index:1","top:calc(4px + env(safe-area-inset-top, 0px))","inset-inline-end:calc(4px + env(safe-area-inset-right, 0px))","width:44px","height:44px","padding:0","border:0","border-radius:50%","font:400 20px/1 system-ui,sans-serif","cursor:pointer","touch-action:manipulation"].join(";"),e.style.background=`radial-gradient(circle, ${n.background} 0 15px, color-mix(in srgb, ${n.text} 22%, ${n.background}) 15px 16px, transparent 16.5px)`,e.style.color=n.text}var C=new WeakMap;function he(e,n){return C.set(e,n),()=>C.delete(e)}function xe(e){let n=e.defaultView?.HTMLElement,o=e.activeElement;for(let r=0;r<16&&o?.shadowRoot?.activeElement;r++)o=o.shadowRoot.activeElement;let c=o?C.get(o)?.():void 0;return()=>{!o?.isConnected||!n||!(o instanceof n)||(o.focus({preventScroll:!0}),c?.())}}var ge=15e3;function we(e,n,o,c,r){let i=e.ownerDocument,d=new AbortController,l=!1,s=!1,a,f;function v(){f?.(),f=void 0,a?.tagName==="DIALOG"&&a.close?.(),a?.remove(),a=void 0}function y(p,t){s||(s=!0,v(),(p==="dismissed"||p==="error")&&d.abort(t??new DOMException("Presentation cancelled","AbortError")),!(!l&&p!=="ready")&&M(n.onPresentationState,p==="error"?{surface:o,state:p,error:t}:{surface:o,state:p}))}let g=c,m=()=>{s||g()};return{setDismissHandler(p){g=p},get active(){return l&&!s},get cancelled(){return d.signal.aborted},start(p,t,u){if(!(l||s)){if(l=!0,n.loading!=="host"){let x=(t??i.documentElement.lang)||"en",b=p&&u?.presentation?.type!=="inline",S=u!==void 0,h=i.createElement(b?"dialog":"div");a=h,h.dataset.longplayLoading=o;let E=x.startsWith("zh"),I=S?E?"\u6B63\u5728\u52A0\u8F7D\u5957\u9910":"Loading plans":E?"\u6B63\u5728\u52A0\u8F7D":"Loading",R=u?.screen.theme??{background:"Canvas",text:"CanvasText"};h.setAttribute("aria-label",I);let P=i.createElement("div");P.setAttribute("role","status");let L=i.createElement("div");L.setAttribute("aria-hidden","true");let H=()=>{P.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)"};S?P.style.cssText="padding:24px 60px 24px 24px;font:500 16px/1.5 system-ui,sans-serif":H(),P.textContent=I;let w=i.createElement("button");w.type="button",w.textContent="\xD7",w.setAttribute("aria-label",E?"\u53D6\u6D88\u52A0\u8F7D":"Cancel loading"),$(w,R),w.addEventListener("click",m),h.addEventListener("cancel",D=>{D.preventDefault(),m()}),h.append(P,L,w),e.append(h);let T=()=>{if(!s&&b){let D=h;D.showModal?D.showModal():D.open=!0,w.focus({preventScroll:!0})}};u&&r?(f=r(h,L,u,x,()=>{s||(L.style.visibility="",H())}),T()):S?(h.style.cssText=b?"padding:0;border:0;border-radius:24px;background:Canvas;color:CanvasText;width:min(420px,calc(100vw - 32px))":"position:relative;background:Canvas;color:CanvasText;width:100%",T()):(_(h,L,b,o),T())}M(n.onPresentationState,{surface:o,state:"loading",dismiss:m})}},present(p){if(s)return;let t=!!a;v(),p(t),y("ready")},dismiss:m,finish:y,async wait(p,t){let u=d.signal,x,b,S=new Promise((h,E)=>{b=()=>E(u.reason),u.aborted?b():u.addEventListener("abort",b,{once:!0}),t!==void 0&&(x=setTimeout(()=>E(new Error("Presentation data timed out")),t))});try{let h=await Promise.race([S,p]);return u.throwIfAborted(),h}finally{u.removeEventListener("abort",b),clearTimeout(x)}}}}function _(e,n,o,c){e.style.cssText="position:relative;box-sizing:border-box;background:Canvas;color:CanvasText;padding:24px 48px 24px 24px;"+(o?"position:fixed;width:min(480px,calc(100% - 32px));border:0;border-radius:16px;max-height:calc(100dvh - 32px)":"width:100%"),n.style.cssText="display:grid;gap:12px";let r=c==="banner"?[["72%",12],["44%",10]]:[["46%",20],["84%",12],["65%",12],["100%",64]];for(let[i,d]of r){let l=e.ownerDocument.createElement("div");l.style.cssText=`width:${i};height:${d}px;background:currentColor;opacity:.11;border-radius:6px`,n.append(l)}}function F(e){let n={display:"block",position:"fixed",top:"0",left:"0",opacity:"0",pointerEvents:"none",zIndex:"-1"},o=Object.keys(n).map(i=>{let d=i,l=e.style[d];return e.style[d]=n[d],[d,l]}),c=e.inert??!1,r=e.getAttribute("aria-hidden");return e.inert=!0,e.setAttribute("aria-hidden","true"),()=>{for(let[i,d]of o)e.style[i]=d;e.inert=c,r===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r)}}function Se(e,n){let o=e.style.width;e.style.width=`${n.getBoundingClientRect().width||n.ownerDocument.defaultView?.innerWidth||800}px`;let c=F(e);return()=>{c(),e.style.width=o}}export{pe as a,O as b,W as c,ue as d,me as e,$ as f,he as g,xe as h,ge as i,we as j,F as k,Se as l};
|
package/dist/chunk-YVXLCQGM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Z,c as ee}from"./chunk-V7PFLFHE.js";import{a as Y}from"./chunk-OX7PA64E.js";import{a as b}from"./chunk-DSPLGTQI.js";var ue=5*6e4,fe=15e3,re=new WeakMap;function me(r){return re.get(r)}var S=r=>Array.isArray(r)?r.map(S):r&&typeof r=="object"?Object.fromEntries(Object.keys(r).sort().map(n=>[n,S(r[n])])):r,ne=(r,n)=>JSON.stringify(S(r))===JSON.stringify(S(n)),ae=r=>JSON.stringify(S([r.funnelId,r.locale??null,r.parameters??{}])),pe=["onObservationChange","onPurchase","onCheckoutUrl","resumeCheckout","allowNewPurchase","checkoutNavigation","terminateCheckout","confirmOnHostedCheckout","resolveOfferId","onOpenUrl","onEvent","onAction","onComplete","onError"];function he(r,n){let L=e=>structuredClone({funnelId:e.funnelId,locale:e.locale,parameters:e.parameters}),w,V="",T=n.start instanceof Promise?void 0:L(n.start),H=e=>e?.parameters?.commerce,_=n.maxAgeMs??ue,j=new AbortController,d=AbortSignal.any([j.signal,n.client.identitySignal,...n.signal?[n.signal]:[]]),O=()=>t("released","aborted"),a="preparing",J,E=0,y=null,u=null,f=null,p=null,l=null,A=new Set,v=new Map,F,U=new Promise(e=>F=e),N,te=new Promise(e=>N=e);function I(e,o){a!==e&&(a=e,J=o,b(n.onState,e))}function oe(){d.removeEventListener("abort",O),R(),u?.destroy(),u=null,y?.remove(),y=null,f=null}function t(e,o){["adopted","unavailable","released","closed"].includes(a)||(I(e,o),oe(),F(!1),N(null))}let D=e=>`error:${e?.code??e?.name??"unknown"}`,q=r.ownerDocument.defaultView,k=!0,G=null,m=!1,le=e=>e.storageArea===q?.localStorage&&(e.key===null||e.key.startsWith("indiana.funnel.purchases.")),W=e=>{le(e)&&C()},se=n.client.subscribe(()=>C());function R(){k&&(k=!1,q?.removeEventListener("storage",W),se())}let K=()=>k&&(a==="ready"||a==="preparing");function B(e){(a==="ready"||a==="preparing")&&t("unavailable",e)}function C(){if(a==="ready"&&Date.now()-E>=_)return R();m=!0,G??=(async()=>{for(;m&&w&&K();){m=!1;try{await n.client.retained()==="pending"&&B("purchase_pending")}catch(e){d.aborted?t("released","aborted"):B(D(e))}}})().finally(()=>{G=null,m&&w&&K()&&C()})}q?.addEventListener("storage",W),d.addEventListener("abort",O,{once:!0});let X=n.client.findPurchase();X.catch(()=>{});async function P(){let e=await te;if(!e)throw new Y("PURCHASE_PENDING","The purchase did not start; open it again");return e}let ie={get view(){return l?l.view:p},get signal(){return l?.signal??n.client.identitySignal},get quote(){return l?.quote??null},get operation(){return l?.operation??null},webViewUrl:"bundled",get canReselect(){return l?.canReselect},get recovery(){return l?.recovery},get pendingCancellation(){return l?.pendingCancellation},subscribe(e){return v.set(e,l?.subscribe?.(e)??(()=>{})),()=>{v.get(e)?.(),v.delete(e)}},refresh:async()=>l?l.refresh():structuredClone(p),preview:async e=>(await P()).preview(e),confirm:async()=>(await P()).confirm(),cancel:async()=>(await P()).cancel(),read:async()=>(await P()).read(),destroy(){l?.destroy()}},s={options:{},handoff:{}},$={loading:"host",focusAtReveal:!0,signal:n.client.identitySignal,start:async()=>ie,canInteract:()=>s.options.canInteract?s.options.canInteract():!["unavailable","released","closed"].includes(a),async beforeAction(){let e=a!=="adopted",o=p?.capabilities,i=await P();if(e&&!ne(i.view?.capabilities,o))throw new Z;await s.options.beforeAction?.()}};for(let e of pe)Object.defineProperty($,e,{enumerable:!0,get:()=>s.options[e]});function M(){a!=="preparing"||!f||!u||!w||(I("ready"),F(!0))}let ce={present(e){if(s.handoff.present)return s.handoff.present(e);a==="preparing"&&(f=e,E=Date.now(),M())},async dismiss(){if(s.handoff.dismiss)return s.handoff.dismiss();t("closed");for(let e of[...A])b(e)},quoteError(e){s.handoff.quoteError?s.handoff.quoteError(e):b(s.options.onError,e)}};(async()=>{try{let{showPaywall:e}=await import("./paywall-VYUBYBUI.js");if(d.throwIfAborted(),a!=="preparing")return;let o=n.commerce??H(T),i=n.locale??T?.locale;if(!o)return t("unavailable","commerce_missing");if(!i)return t("unavailable","locale_missing");if(p=await n.client.readPaywall({paywallVersionId:n.paywallVersionId,paywallId:n.paywallId,commerce:o,locale:i}),d.throwIfAborted(),a!=="preparing")return;if(Object.values(p.capabilities.plans).some(x=>!x.available))return t("unavailable","plan_unavailable");y=r.ownerDocument.createElement("div"),r.append(y);let h=setTimeout(()=>a==="preparing"&&t("unavailable","timeout"),fe);U.then(()=>clearTimeout(h));let c=await e(y,$,ce);if(!c.host||d.aborted||a!=="preparing"){c.host?.destroy(),t(d.aborted?"released":"unavailable","error");return}u=c.host,M()}catch(e){t(d.aborted?"released":"unavailable",D(e))}})(),Promise.resolve(n.start).then(async e=>{if(!e)return t("unavailable","gated");let o=L(e);if(!ne(H(o),n.commerce??H(o))||n.locale!==void 0&&o.locale!==n.locale)return t("unavailable","start_mismatch");try{let i=await X,h=i==="pending"?"purchase_pending":i==="found"?"original_purchase":i==="blocked"?"purchase_blocked":void 0;if(h)return t("unavailable",h);if(a!=="preparing")return;if(k&&(m=!1,await n.client.retained()==="pending"))return t("unavailable","purchase_pending")}catch(i){return t(d.aborted?"released":"unavailable",D(i))}a==="preparing"&&(w=o,V=ae(o),M(),m&&C())},()=>t("unavailable","gated"));let z={get state(){return a},get reason(){return J},ready:U,get start(){return w},matches:e=>!!w&&ae(e)===V,open(){if(a==="preparing")return"pending";if(a!=="ready"||!f)return!1;if(Date.now()-E>=_)return t("unavailable","expired"),!1;let e=f;return f=null,R(),I("shown"),e(),"shown"},destroy(){j.abort()}};return re.set(z,{onClose(e){return a==="closed"?(b(e),()=>{}):(A.add(e),()=>{A.delete(e)})},claim(){R()},async adopt(e,o){let i=e.paywall?.resolution,h=e.paywall&&!e.paywall.quote&&!e.paywall.operation&&!e.paywall.purchaseRequestId&&!(e.paywall.selectionGeneration??0);if(a!=="shown"||!u||!p||!i||!h||e.source.id!==w?.funnelId||!["running","waiting"].includes(e.status)||!ee(i,p))return null;let c;try{c=await o.start()}catch{return null}if(a!=="shown"||!u)return c.destroy(),null;l=c,s.options=o.options,s.handoff=o.handoff;for(let[g]of v)v.set(g,c.subscribe?.(g)??(()=>{})),c.view&&b(g,structuredClone(c.view));d.removeEventListener("abort",O),I("adopted"),N(c),A.clear();let x=u,de=y;return u=null,y=null,f=null,new Proxy(x,{get(g,Q){return Q==="destroy"?()=>{g.destroy(),de?.remove()}:Reflect.get(g,Q,g)}})},get modal(){return p?.document.presentation.type!=="inline"},get revealable(){return a==="ready"&&!!f&&Date.now()-E<_},release(){t("released")}}),z}export{ue as a,me as b,he as c};
|
package/dist/chunk-ZGCKQWQ5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-VF6QMMEA.js";var c=e.enum(["replace","stack_native"]);export{c as a};
|
package/dist/content-AJDTSI7A.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as ie}from"./chunk-TOTRALYQ.js";import{a as Z,c as ee,e as te,f as ne,h as N,j as re,k as oe,l as se}from"./chunk-XUGEOELU.js";import{b as X}from"./chunk-WZR2XCSJ.js";import{r as V}from"./chunk-PUR5CYWX.js";import"./chunk-TAFALMQN.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-VEX2FOFZ.js";import"./chunk-56BYGPQ6.js";import"./chunk-VYFSRHXM.js";import{$ as K,C as G,H as R,_ as Y,r as $}from"./chunk-BQRS7Y4K.js";import"./chunk-U4RSRFZY.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import{a as p}from"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-EM3MGDPG.js";import{b as u}from"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import{a as h}from"./chunk-DSPLGTQI.js";import"./chunk-WOT6VMZA.js";var z=new WeakMap;function ce(s){let t={string:u.string(),number:u.number().finite(),boolean:u.boolean(),strings:u.array(u.string()),json:R}[s.type];return s.nullable?t.nullable():t}function ae(s,t){let f=u.record(u.string(),R).parse(s);if(Object.keys(f).length>40)throw new p("INVALID_REQUEST","Too many content inputs");for(let[m,r]of Object.entries(f))Y.parse({[m]:r});if(Object.keys(f).some(m=>!Object.hasOwn(t.inputs,m)))throw new p("INVALID_REQUEST","Undeclared content input");for(let[m,r]of Object.entries(t.inputs))if(Object.hasOwn(f,m))ce(r).parse(f[m]);else if(r.required)throw new p("INVALID_REQUEST",`Missing content input ${m}`);return f}async function Ae(s,t){return le(s,t,!1)}async function Se(s,t){return le(s,t,!0)}async function le(s,t,f){t.signal?.throwIfAborted();let m=X.parse(t.content),r=m.document;if(t.closeControl==="content"&&!r.screen.actions.some(e=>e.type==="event"&&e.close))throw new p("INVALID_REQUEST","An authored Close control requires a declared Close action");if(z.has(s))throw new p("CONFLICT","Content is already mounted in this container");let y=ae(t.inputs??{},r.contract),T=new Set(u.array(u.string()).max(40).parse(t.mutableInputs??[]));if(T.size!==(t.mutableInputs?.length??0)||[...T].some(e=>!Object.hasOwn(r.contract.inputs,e)))throw new p("INVALID_REQUEST","Mutable content inputs must name unique declared inputs");for(let e of Object.keys(r.contract.outputs))if(typeof t.actions[e]!="function")throw new p("INVALID_REQUEST",`Missing host handler for ${e}`);let M=K.parse(t.bindings??[]),d=s.ownerDocument,ue=s.clientHeight||d.defaultView?.innerHeight||800,P,w,a,_,x=r.kind==="popup",n=x?d.createElement("dialog"):null,c=d.createElement("div");if(c.dataset.indianaContent=r.kind,c.setAttribute("aria-label",r.name),c.style.cssText="width:100%;min-width:0",n){n.setAttribute("aria-label",r.name);let e=r.screen.presentation;n.style.cssText="box-sizing:border-box;padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto",e.type==="modal"||e.type==="sheet"?(n.style.width=`${$[e.size]}px`,e.type==="sheet"&&(n.style.margin="auto auto 0")):n.style.width="100vw",a=ee(n,r.screen,()=>{w?.resizeViewport(d.defaultView?.innerHeight||800,d.defaultView?.innerWidth||1024)}),n.append(c),s.append(n)}else s.append(c);let i=!1,A=!1,E=!1,S=!1,de=n?oe(n):se(c,s),D=re(s,t,r.kind,()=>{k()&&(b(),h(t.onDismiss))}),q,H,L=new Promise((e,o)=>{q=e,H=o});L.catch(()=>{});let g=null,I=structuredClone(r.screen),W=G(I,[t.locale,...d.defaultView?.navigator.languages??[]]),j=t.capabilities;I.actions=I.actions.map(e=>e.type==="event"?{...e,close:!1}:e);function b(){i||(i=!0,t.signal?.removeEventListener("abort",b),D.finish("dismissed"),H(new Error("Content preparation cancelled")),a?.destroy(),_?.(),w?.destroy(),n?.close(),n?.remove(),c.remove(),z.delete(s),n&&P?.())}let v=()=>{!E||!k()||(b(),h(t.onDismiss))};function k(){try{return t.canDismiss?.()!==!1}catch(e){return h(t.onError,e),!1}}if(n&&t.closeControl!=="content"){let e=d.createElement("button");e.type="button",e.textContent="\xD7",e.setAttribute("aria-label",t.locale?.startsWith("zh")?"\u5173\u95ED":"Close"),ne(e,r.screen.theme),e.addEventListener("click",v),n.prepend(e)}n&&a?.responsive&&(_=Z(n,v,k,t.locale?.startsWith("zh")?"\u5173\u95ED":"Close"),n.addEventListener("click",e=>{if(e.target!==n)return;let o=n.getBoundingClientRect();(e.clientX<o.left||e.clientX>o.right||e.clientY<o.top||e.clientY>o.bottom)&&v()})),n?.addEventListener("cancel",e=>{e.preventDefault(),v()}),n?.addEventListener("keydown",e=>{e.key==="Escape"&&(e.preventDefault(),v())});async function F(){if(i||!E||A||!g)return;let e=g;A=!0,c.setAttribute("aria-busy","true");try{await t.actions[e.actionId](structuredClone(e)),g=null}catch(o){i||h(t.onError,o)}finally{A=!1,i||c.removeAttribute("aria-busy")}}function J(){if(i)throw new p("CONFLICT","Content host has been destroyed");E||!S||(P??=N(d),D.present(e=>{de(),n&&(a?.latch(),n.showModal(),a?.responsive&&n.focus({preventScroll:!0}),!e&&t.loading!=="host"&&te(n,a?.type??r.screen.presentation.type,a?.responsive)),E=!0}))}function U(e){D.finish("error",e),H(e instanceof Error?e:new Error(String(e))),b()}let Q={destroy:b,show:J,get pendingAction(){return g?structuredClone(g):null},retryAction:F,updateInputs(e){if(i)throw new p("CONFLICT","Content host has been destroyed");let o=u.record(u.string(),R).parse(e),C=ae({...y,...o},r.contract);for(let l of Object.keys(o))if(!T.has(l)&&(!Object.hasOwn(y,l)||V(y[l])!==V(C[l])))throw new p("PRECONDITION_FAILED","This content input is frozen; prepare a new presentation");V(y)!==V(C)&&(w?.update(I,W,{capabilities:j,serverInput:{bindings:M,answers:{},values:C}}),y=C)},updateCapabilities(e){if(i)return;let o=structuredClone(e);w?.updateCapabilities(o),j=o}};z.set(s,Q),t.signal?.addEventListener("abort",b,{once:!0});try{if(t.signal?.throwIfAborted(),f||(P=N(d),D.start(x,t.locale??r.screen.strings.defaultLocale),i&&await L),w=ie(c,{mode:"live",rendererUrl:t.rendererUrl,title:r.name,viewportHeight:r.kind==="page"?ue:a?.responsive?d.defaultView?.innerHeight||800:void 0,...a?.responsive?{viewportWidth:d.defaultView?.innerWidth||1024,hostPresentation:()=>a.type}:{},onResize:e=>{i||a?.responsive&&(c.style.height=`${e}px`,c.style.overflow="clip",a.setContentHeight(e))},onRendered:e=>{if(!i&&(e&&n?.setAttribute("aria-label",e),!S))try{S=!0,f||J(),q()}catch(o){U(o),h(t.onError,o)}},onError:e=>{if(i)return;let o=new Error(e);S||U(o),h(t.onError,o)},onEscape:x?v:void 0,onAction:(e,o,C)=>{if(i||!E||A||g)return;let l=r.screen.actions.find(O=>O.id===e),B=r.contract.outputs[e];if(!(l?.type!=="event"||!B)&&!(l.close&&!k()))try{let O=ce(B).parse(Object.hasOwn(l.properties,"value")?l.properties.value:l.properties);g=structuredClone({requestId:crypto.randomUUID(),contentVersionId:m.id,actionId:e,event:l.event,value:O,selection:o??{},answers:C??{},requestedClose:l.close}),F()}catch(O){h(t.onError,O)}}}),w.update(I,W,{capabilities:j,serverInput:{bindings:M,answers:{},values:y}}),await Promise.race([w.ready,L]),f&&await L,i)throw new Error("Content preparation cancelled");return Q}catch(e){throw U(e),e}}export{Ae as mountContent,Se as prepareContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c}from"./chunk-YVXLCQGM.js";import"./chunk-V7PFLFHE.js";import"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-VF6QMMEA.js";import"./chunk-DSPLGTQI.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}from"./chunk-ETK6GC5P.js";import"./chunk-SFHIFCXG.js";import"./chunk-YVXLCQGM.js";import"./chunk-73NP72FV.js";import"./chunk-W32FI2A2.js";import"./chunk-XUGEOELU.js";import"./chunk-TAFALMQN.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-3NCMYTNG.js";import"./chunk-VEX2FOFZ.js";import"./chunk-V7PFLFHE.js";import"./chunk-56BYGPQ6.js";import"./chunk-VYFSRHXM.js";import"./chunk-BQRS7Y4K.js";import"./chunk-U4RSRFZY.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-SLUA7ABW.js";import"./chunk-TLZP7BW6.js";import"./chunk-EM3MGDPG.js";import"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-DSPLGTQI.js";import"./chunk-WOT6VMZA.js";export{a as showFunnelRun,b as showObservedFunnelRun};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as r,O as m,h as e}from"./chunk-CKKIB2HC.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-VYFSRHXM.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import"./chunk-V7MMTILA.js";import"./chunk-VF6QMMEA.js";import"./chunk-BID4UGWB.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-44U3FOBB.js";import"./chunk-WZR2XCSJ.js";import"./chunk-7MNJH5GB.js";import"./chunk-CIP5SQ5Y.js";import"./chunk-CKKIB2HC.js";import"./chunk-BOVN2BE3.js";import"./chunk-PUR5CYWX.js";import"./chunk-TAFALMQN.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-VEX2FOFZ.js";import"./chunk-5HJYR6Z4.js";import"./chunk-VYFSRHXM.js";import"./chunk-BQRS7Y4K.js";import"./chunk-U4RSRFZY.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import"./chunk-V7MMTILA.js";import"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-WOT6VMZA.js";export{o as apiOperations};
|
package/dist/paywall-VYUBYBUI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as gt,c as vt,d as Fe,f as Ct,i as Pt}from"./chunk-SFHIFCXG.js";import{b as Be}from"./chunk-W32FI2A2.js";import{d as pt,e as mt,f as ht,h as je,i as Ae,j as yt,k as wt,l as bt}from"./chunk-XUGEOELU.js";import{a as ct,c as Ve,d as lt,e as ut}from"./chunk-3NCMYTNG.js";import{b as ne}from"./chunk-VEX2FOFZ.js";import{b as He,d as dt,g as ft}from"./chunk-V7PFLFHE.js";import"./chunk-56BYGPQ6.js";import"./chunk-VYFSRHXM.js";import{ba as ye,da as we}from"./chunk-BQRS7Y4K.js";import{c as ce,j as he}from"./chunk-U4RSRFZY.js";import{c as $e}from"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import{a as v}from"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-EM3MGDPG.js";import"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import{a as j}from"./chunk-DSPLGTQI.js";import"./chunk-WOT6VMZA.js";async function kt(T,a,A){if(a.status!=="complete")throw new v("INVALID_RESPONSE","A verified completed purchase is required");let g=T?he.parse(T):null;if(await A.onComplete?.(a),!g||!A.check)return;let D=he.parse(await A.check());if(D.internal_feature_id!==g.internal_feature_id||D.quantity!==g.quantity||g.observation!==void 0&&(D.observation===void 0||D.observation.requirementDigest!==g.observation.requirementDigest||D.observation.authority!==g.observation.authority||$e(D.observation.subject)!==$e(g.observation.subject)))throw new v("INVALID_RESPONSE","The access requirement changed");D.allowed&&await A.onAccessGranted?.(D)}function Qe(T){return Object.entries(T.document.buttons).filter(([,a])=>a.type==="checkout"&&a.product.type==="fixed"&&!ne(a.product,{},T.capabilities)).map(([a])=>a)}function Et(T,a){let A=a.lines[0];if(a.lines.length!==1||!A)return;let g=A.productVersionId,{screen:D,buttons:F}=T.document,E=new Map((A.prepaid??[]).map(d=>[d.internal_feature_id,d.quantity]));function Q(d,f){if(d.hidden)return!1;if(d.type==="plan_picker"&&T.capabilities.pickers[d.id]?.options.includes(g))return f[d.id]=g,!0;if(d.type==="quantity_picker"){let V=E.get(d.internalFeatureId);return V!==void 0&&(!d.bind?.plan||d.bind.plan===g)&&(f[d.id]=V),!1}if(d.type==="button"&&d.action){let V=F[d.action];return V?.type==="checkout"&&V.product.type==="fixed"&&V.product.productVersionId===g}if(d.type!=="stack")return!1;let $=d.interaction,r=d.bind?.plan===g;for(let[V,p]of d.children.entries()){let J={},R=Q(p,J);if($?.type==="toggle"||$?.type==="tabs"){if(!R)continue;return f[d.id]=$.type==="toggle"?V===0:p.id,Object.assign(f,J),!0}Object.assign(f,J),R&&(r=!0,$?.type==="select"&&$.purpose==="product"&&$.pickerId&&p.type==="stack"&&p.bind?.plan===g&&(f[d.id]=p.id,f[$.pickerId]=g))}return r}for(let d of D.pages){let f={__page:d.id};if(Q(d.root,f))return f}}async function dn(T,a,A){let g=a.focusAtReveal?()=>{}:je(T.ownerDocument),D=()=>{E.finish("dismissed"),g()},F=()=>D(),E=yt(T,a,"paywall",()=>{D(),j(a.onDismiss)},gt);a.signal?.throwIfAborted(),a.signal?.addEventListener("abort",F,{once:!0});let Q=null,d,f,$;try{if(E.start(!0,a.loadingDocument?.screen.strings.defaultLocale,a.loadingDocument??null),E.cancelled)throw new DOMException("Presentation cancelled","AbortError");if(Q=a.check?he.parse(await E.wait(a.check(),Ae)):null,Q?.allowed)return E.finish("skipped"),a.signal?.removeEventListener("abort",F),g(),await a.onAccessGranted?.(Q),{check:Q,host:null};let[e,t]=await Promise.allSettled([E.wait(import("./screen-renderer-R5GH7XLV.js")),E.wait(a.start().then(i=>(E.cancelled&&i.destroy(),i)),Ae)]);if(e.status==="rejected")throw t.status==="fulfilled"&&t.value.destroy(),e.reason;if(t.status==="rejected")throw t.reason;$=e.value,d=t.value,a.signal?.throwIfAborted(),d.signal?.throwIfAborted(),d.signal?.addEventListener("abort",F,{once:!0});let n=d.view??await E.wait(d.refresh(),Ae);if(!n)throw new v("INVALID_RESPONSE","Paywall presentation is missing");d.signal?.throwIfAborted(),f=n}catch(e){throw E.finish("error",e),a.signal?.removeEventListener("abort",F),d?.signal?.removeEventListener("abort",F),d?.destroy(),g(),e}let r=d,{mountScreenPreview:V}=$,p=T.ownerDocument,J=new AbortController,R=p.createElement("section"),re=p.createElement("div"),G=p.createElement("div"),l=p.createElement("p"),y=p.createElement("button"),C=p.createElement("button"),x=p.createElement("dialog"),s=f.document.screen.strings.defaultLocale.startsWith("zh"),xt=s?"\u6B63\u5728\u5904\u7406\u2026":"Processing\u2026",It=s?"\u6B63\u5728\u51C6\u5907\u62A5\u4EF7\u2026":"Preparing your price\u2026",O=vt(f.document.screen.theme);R.dataset.indianaPaywall="",R.setAttribute("aria-label",f.document.name),R.style.cssText=O.root,G.style.cssText=O.controls,l.style.cssText=O.message,l.setAttribute("role","status"),C.style.cssText=O.link,C.textContent=s?"\u5173\u95ED":"Close",y.style.cssText=O.secondary,y.textContent=s?"\u91CD\u8BD5":"Retry",y.hidden=!0,G.append(l,y,C),R.append(re,G);let Ge=()=>{let e=K??G,t=[...e.children].every(i=>i===l?!l.textContent:i.hidden),n=[...e.children].some(i=>i===C?!1:i===l?!!l.textContent:!i.hidden);e.style.cssText=t?O.controls.replace(/padding:[^;]+/,"padding:0"):n?`${O.controls};${O.pinned}`:O.controls,Oe()},We=typeof MutationObserver>"u"?void 0:new MutationObserver(Ge);We?.observe(R,{attributes:!0,attributeFilter:["hidden"],characterData:!0,childList:!0,subtree:!0});let be=f.document.presentation,At=Object.entries(f.document.buttons).filter(([,e])=>e.type==="close").map(([e])=>e),U,ze,Re=!1,Ye=JSON.stringify(f.capabilities),Je=e=>Z&&!ue?Object.entries(e.document.buttons).filter(([,t])=>t.type==="checkout").map(([t])=>t):Qe(e);function Se(e){if(h)return;f=e;let t=JSON.stringify(e.capabilities);t!==Ye&&(U?.updateCapabilities(e.capabilities,Je(e)),Ye=t),Tt(e),de()}let P,Te=0;function Oe(){let e=p.defaultView;if(!P?.responsive||!e)return;let t=K??G,n=e.innerHeight-(P.type==="modal"?32:0);t.style.maxHeight=`${Math.max(1,n)}px`,t.style.overflowY="auto",t.style.flexShrink="0",Te=Math.max(1,n-t.getBoundingClientRect().height),U?.resizeViewport?.(Te,e.innerWidth)}let h=!1,Z=!1,k=null,ge=!1,Ke=!1,ee=!1,De,Ne=!1,W,K;function Rt(){return Z||h||W||Ne?{type:"recover",operationId:r.operation?.operationId??r.quote?.operationId??null,requestId:null}:Ve(r)}let I=()=>!h&&!ge&&!W&&a.canInteract?.()!==!1,ie=!1,m=null,z=null,te=()=>a.checkoutNavigation==="after_confirmation"&&!!(a.terminateCheckout||a.resumeCheckout),le={},ue,H=null;function de(){if(!te()||!U?.updateCheckoutControls)return;let e=r.quote,t=!H&&!!e&&!!r.operation&&M(r.operation).type==="checkout",n=Object.entries(f.document.buttons).flatMap(([i,o])=>o.type==="checkout"?[{actionId:i,policy:o}]:[]);U.updateCheckoutControls({actions:n.map(({actionId:i})=>i),resume:t?n.filter(({policy:i})=>Pe(e,f,i.product,le)).map(({actionId:i})=>i):[],resumeLabel:s?"\u7EE7\u7EED\u4ED8\u6B3E":"Continue checkout",busy:ue})}function Xe(){z?.remove(),z=null}async function _e(){if(H)return;if(a.resumeCheckout&&r.operation){await a.resumeCheckout(r.operation.operationId);return}let e=await r.read();if(M(e).type!=="checkout")return N(e,!1);I()&&(ve.delete(e.operationId),await ke(e))}function Ze(){l.textContent=s?"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u4ED8\u6B3E\u9875\u9762\u3002\u8BF7\u91CD\u8BD5\u3002":"Couldn\u2019t open checkout. Try again.",y.hidden=!0}async function et(e=!1){let t=H;if(!t)return;y.hidden=!0;let n=Date.now()+2e4;for(;I();){let i=await r.read();if(i.operationId!==t.operationId)throw new v("PURCHASE_PENDING","The original Checkout changed");if(!I())break;let o=M(i);if(o.type==="native"){H=null,Xe(),k=t.selection,ie=!1,await pe();return}if(o.type==="complete"||o.type==="fulfillment"||o.type==="recording"){H=null,await N(i,!1);return}if(e&&o.type==="checkout"){e=!1;try{await a.terminateCheckout(t.operationId)}catch(u){j(a.onError,u)}}if(Date.now()>=n)break;await Be(1e3,p,J.signal)}h||Ze()}async function St(e,t){H={operationId:e,selection:t};let n=!1;try{await a.terminateCheckout(e)}catch(i){if(i instanceof v&&["CAPABILITY_UNAVAILABLE","NOT_CONFIGURED"].includes(i.code)){H=null,l.textContent=s?"\u8BF7\u7EE7\u7EED\u539F\u8BA2\u5355\uFF0C\u6216\u7B49\u5F85\u5B83\u8FC7\u671F\u540E\u518D\u66F4\u6362\u65B9\u6848\u3002":"Continue your original checkout, or wait for it to expire before changing plans.",j(a.onError,i);return}n=i instanceof v&&(i.status??0)>=500,j(a.onError,i)}I()&&await et(n)}function Tt(e){Z||k||r.quote||r.operation||(l.textContent=Object.values(e.capabilities.plans).some(t=>t.available)?"":s?"\u5F53\u524D\u8D26\u53F7\u6682\u65E0\u53EF\u8D2D\u4E70\u7684\u65B9\u6848\u3002":"No plans are currently available for this account.")}let ve=new Map,Ce=!1;function Pe(e,t,n,i){let o=e.lines.length===1?e.lines[0]:void 0,u=ne(n,i,t.capabilities);if(!o||!u||o.productVersionId!==u)return!1;let _;try{_=we(t.document.screen,u,i,t.capabilities)}catch{return!1}let b=Object.fromEntries((o.prepaid??[]).map(Y=>[Y.internal_feature_id,Y.quantity]));return[...new Set([...Object.keys(_),...Object.keys(b)])].every(Y=>(_[Y]??0)===(b[Y]??0))}let M=e=>ct({quote:r.quote,operation:e,requestId:null,pending:!1,destroyed:h,canReselect:r.canReselect});async function ke(e){let t=e.merchantExecution;if(!(!I()||!e.checkoutUrl||a.checkoutNavigation==="after_confirmation"&&M(e).type!=="checkout"||t?.type==="purchase"&&!["not_started","pending"].includes(t.paymentStatus)||ve.get(e.operationId)===e.checkoutUrl)){ve.set(e.operationId,e.checkoutUrl);try{a.onCheckoutUrl?await a.onCheckoutUrl(e.checkoutUrl):p.defaultView?.location.assign(e.checkoutUrl)}catch(n){throw ve.delete(e.operationId),n}}}let X=(e,t=!1)=>{if(e instanceof He)m=null,l.textContent=e.customerMessage(s);else if(t){let n=e instanceof v?e.code:void 0;n==="CAPABILITY_UNAVAILABLE"||n==="NOT_CONFIGURED"?(m=null,l.textContent=s?"\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."):r.canReselect===!0&&!k?l.textContent=s?"\u672A\u80FD\u53D6\u5F97\u62A5\u4EF7\uFF0C\u4ED8\u6B3E\u5C1A\u672A\u5F00\u59CB\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5957\u9910\u3002":"We couldn\u2019t prepare your price. Payment hasn\u2019t started. Choose a plan again.":n==="COMMAND_PENDING"?l.textContent=s?"\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.":l.textContent=s?"\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 l.textContent=e instanceof v&&(e.code==="NETWORK_ERROR"||e.code==="TIMEOUT")?Ct(e,s):e instanceof v?e.message:s?"\u64CD\u4F5C\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5\u3002":"This action couldn\u2019t be completed. Try again.";y.hidden=m===null,t&&!P?.responsive&&l.scrollIntoView?.({block:"nearest"}),j(t&&A?.quoteError?A.quoteError:a.onError,e)},Ee=new WeakMap;function xe(e){Z=e,y.disabled=e,U?.updateCapabilities?.(f.capabilities,Je(f));for(let t of z?.querySelectorAll("button")??[])e?(Ee.set(t,t.disabled),t.disabled=!0):Ee.has(t)&&(t.disabled=Ee.get(t),Ee.delete(t)),Fe(t)}function Le(){l.textContent=s?"\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 Ot(e){if(a.beforeAction)try{await a.beforeAction()}catch(t){throw t instanceof He?(k=null,ie=!1,m=null):m=e,t}}async function L(e,t){if(Z||h)return;if(!I()){Le();return}let n=e===pe,i=n?It:xt,o=te()&&t!==void 0;ue=o?t:void 0,xe(!0),de(),y.hidden=!0,l.textContent=o?"":i;try{if((e!==_e||!a.resumeCheckout)&&await Ot(e),h)return;if(!I()){m=e,y.hidden=!1,Le();return}await e()}catch(u){h||X(u,n&&!o)}finally{ue=void 0,xe(!1),de(),l.textContent===i&&(l.textContent="")}}async function Dt(e){await kt(Q,e,a)}function tt(e){return Ve(r).type==="recording"||M(e).type==="recording"}function nt(e){let t=e.merchantTerms,n=t?.subscriptionTerms?.items??[],i=t?t.totalMinor:e.charge?.totalMinor??e.catalogAmountMinor-(e.discount?.amountMinor??0),o=t?n.length===1&&n[0]?.amountMinor===i&&n[0]:e.lines.length===1&&e.lines[0]?.catalogAmountMinor===i&&e.lines[0],u=i===null?ce(t.subtotalMinor-t.discountMinor,e.currency)+(s?" + \u5F85\u786E\u8BA4\u7A0E\u8D39":" + tax confirmed at checkout"):ce(i,e.currency)+(o?ye(o.interval,s?"zh-CN":"en",o.intervalCount??1):""),_=e.lines.map(b=>b.productName).join(", ");return{label:_?`${_} \xB7 ${u}`:u,recurring:o}}async function N(e,t=a.checkoutNavigation!=="after_confirmation"){if(h)return;if(!I()){m=async()=>N(await r.read()),y.hidden=!1;return}if(l.textContent=Pt(e.status,s),tt(e)){let o=e.merchantExecution?.type==="purchase"&&e.merchantExecution.recordingStatus==="failed";l.textContent=o?s?"\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.":s?"\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.",y.textContent=s?"\u67E5\u8BE2\u8BB0\u5F55":"Check recording",m=async()=>N(await r.read()),y.hidden=!1;return}if(e.problem){let o=e.problem;m=fe,y.textContent=s?"\u68C0\u67E5\u5E76\u6062\u590D\u539F\u64CD\u4F5C":"Check and recover original purchase",X(new v(o.code,o.reason==="RESULT_UNKNOWN"?s?"\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"?s?"\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"?s?"\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"?s?"\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.":s?"\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)&&(l.textContent=s?"\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"){m=null,await Dt(e);return}if(e.status!=="pending"){if(r.canReselect===!1){l.textContent=s?"\u6B63\u5728\u6838\u5BF9\u539F\u8D2D\u4E70\u7ED3\u679C":"Checking the original purchase result",y.textContent=s?"\u67E5\u8BE2\u7ED3\u679C":"Check result",m=async()=>N(await r.read()),y.hidden=!1;return}e.status==="cancelled"?l.textContent=s?"\u8FD9\u7B14\u8D2D\u4E70\u5DF2\u53D6\u6D88\uFF0C\u53EF\u4EE5\u91CD\u65B0\u9009\u62E9\u65B9\u6848\u3002":"This purchase was cancelled. Choose a plan to start again.":e.status==="failed"&&(l.textContent=s?"\u8FD9\u7B14\u8D2D\u4E70\u672A\u80FD\u5B8C\u6210\uFF0C\u53EF\u4EE5\u91CD\u65B0\u9009\u62E9\u65B9\u6848\u3002":"This purchase didn\u2019t go through. Choose a plan to try again."),y.textContent=s?"\u91CD\u8BD5":"Retry",m=null,k=null;return}if(!t&&M(e).type==="checkout"){if(H){Ze();return}if(te()){l.textContent="",Ce=!1,m=null,de();return}let o=r.quote,u=o?.operationId===e.operationId?nt(o).label:"";l.textContent=Ce?u?s?`${u} \u5C1A\u672A\u4ED8\u6B3E\u3002\u518D\u6B21\u9009\u62E9\u8BE5\u65B9\u6848\u5373\u53EF\u7EE7\u7EED\u4ED8\u6B3E\u3002`:`${u} is still unpaid. Choose it again to continue paying.`:s?"\u4E4B\u524D\u7684\u8D2D\u4E70\u5C1A\u672A\u4ED8\u6B3E\u3002\u518D\u6B21\u9009\u62E9\u8BE5\u65B9\u6848\u5373\u53EF\u7EE7\u7EED\u4ED8\u6B3E\u3002":"Your earlier purchase is still unpaid. Choose that plan again to continue paying.":"",Ce=!1,m=null;return}await ke(e);let n=Date.now()+6e5,i=2e3;Re=!0,j(a.onObservationChange,!0);try{for(;!h&&Date.now()<n;){if(await Be(i,p,J.signal),h)return;if(!I()){m=async()=>N(await r.read()),y.hidden=!1;return}let o=await r.read();if(!t&&M(o).type==="checkout"){await N(o,!1);return}if(!o.problem&&o.status==="pending"&&await ke(o),o.status!=="pending"||o.problem||tt(o)){await N(o);return}i=Math.min(i*1.5,3e4)}}finally{Re=!1,j(a.onObservationChange,!1)}m=async()=>N(await r.read()),y.hidden=!1}async function Ue(e=!1){let t=await r.read();if(h)return;if(!I()){m=()=>Ue(e),y.hidden=!1;return}let n=r.quote;if(n&&dt(t,{operationId:n.operationId,currency:n.currency},"The original purchase operation changed"),n&&t.status==="pending"&&t.quoteFinalized===!1&&!t.confirmedAt&&!t.checkoutUrl&&!t.nativePurchase&&!t.merchantExecution&&!t.problem&&!r.pendingCancellation){rt(n);return}await N(t,e||void 0)}async function fe(){Xe(),m=fe;let e=await r.confirm();if(!I()){m=fe,y.hidden=!1;return}if(e.problem){await N(e);return}if(e.status==="pending"){if(e.checkoutUrl)await ke(e);else if(e.execution&&e.execution.provider!=="merchant"||e.nativePurchase){if(!a.onPurchase)throw new v("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await a.onPurchase({operation:e,signal:J.signal})}}m=async()=>N(await r.read()),await N(e,!0)}function rt(e){z?.remove();let t=!(Date.parse(e.expiresAt)>Date.now());l.textContent=t?s?"\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 n=p.createElement("div"),i=p.createElement("button"),o=p.createElement("button"),u=p.createElement("div"),_=p.createElement("p"),b=e.merchantTerms,oe=s?"zh-CN":"en",Y=b?.subscriptionTerms?.items??[],me=b?b.subscriptionTerms?.trial?.days:e.lines.find(c=>c.trial)?.trial?.days,se=me===void 0?null:b?b.totalMinor:e.charge?e.charge.totalMinor:e.lines.every(c=>c.trial)?0:null,it=(c,w)=>s?`${w} \u5929\u8BD5\u7528\u7ED3\u675F\u540E ${c}`:`Then ${c} after the ${w}-day trial`,{label:Nt,recurring:at}=nt(e),_t=e.lines.map(c=>c.productName).join(", "),ot=se===null?"":`${s?"\u4ECA\u5929\u5E94\u4ED8":"Due today"} ${ce(se,e.currency)}`;_.textContent=ot?[_t,ot].filter(Boolean).join(" \xB7 "):Nt,i.textContent=s?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",i.disabled=t,o.textContent=s?"\u53D6\u6D88":"Cancel",n.style.cssText=O.panel,_.style.cssText=O.summary,u.style.cssText=O.actions,i.style.cssText=O.primary,o.style.cssText=O.secondary,Fe(i),i.onclick=()=>{L(fe)};let st=async()=>{let c=await r.cancel();h||(n.remove(),z=null,await N(c))};o.onclick=()=>{m=st,L(st)};let q=p.createElement("div");if(q.style.cssText=O.terms,b){for(let w of Y){if(se===null&&w===at)continue;let S=p.createElement("p"),B=ce(w.amountMinor,e.currency)+ye(w.interval,oe,w.intervalCount);S.textContent=se!==null&&me!==void 0?it(B,me):B,q.append(S)}let c=b.subscriptionTerms?.trial;if(c){let w=p.createElement("p");w.textContent=s?`\u8BD5\u7528 ${c.days} \u5929\uFF1B${c.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${c.days}; ${c.cardRequired?"a payment method is required":"no payment method is required"}`,q.append(w)}for(let w of[...b.expectedEffects.map(S=>S.description),...b.requiredConsents.map(S=>S.summary)]){let S=p.createElement("p");S.textContent=w,q.append(S)}}else{for(let c of e.lines){if(se!==null||c!==at){let w=p.createElement("p"),S=`${ce(c.catalogAmountMinor,e.currency)}${ye(c.interval,oe,c.intervalCount??1)}`;w.textContent=se!==null&&c.trial?(e.lines.length>1?`${c.productName} \xB7 `:"")+it(S,c.trial.days):`${c.productName} \xB7 ${S}`,q.append(w)}for(let w of c.prepaid??[]){let S=p.createElement("p"),B=r.view?.capabilities.plans[c.productVersionId]?.prepaid?.find(Lt=>Lt.internalFeatureId===w.internal_feature_id);S.textContent=`${B?.name??w.internal_feature_id} \xB7 ${w.quantity} ${s?"\u4EFD":"packs"} \xD7 ${w.terms.units}`,B&&(S.textContent+=ye(B.reset==="week"||B.reset==="month"||B.reset==="year"?B.reset:"one_time",oe,B.resetCount)),q.append(S)}if(c.trial){let w=p.createElement("p");w.textContent=s?`\u8BD5\u7528 ${c.trial.days} \u5929\uFF1B${c.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${c.trial.days}; ${c.trial.cardRequired?"a payment method is required":"no payment method is required"}`,q.append(w)}}if(!e.charge){let c=p.createElement("p");c.textContent=s?"\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.",q.append(c)}}for(let c of q.children)c.style.margin="0";u.append(i,o),n.append(_,...q.childElementCount?[q]:[],u),G.prepend(n),P?.responsive||n.scrollIntoView?.({block:"nearest"}),i.focus({preventScroll:!0}),z=n,m=null}async function pe(){if(!k)return;if(m=pe,!ie){let n=r.view,i=n?.document.buttons[k.actionId],o=n&&i?.type==="checkout"?ne(i.product,k.selection,n.capabilities):null;if(!n||!o)throw new v("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let u=await a.resolveOfferId?.({actionId:k.actionId,productVersionId:o,featureQuantities:we(n.document.screen,o,k.selection,n.capabilities)});if(h)return;u!==void 0&&(k.offerId=u),ie=!0}if(!I()){y.hidden=!1;return}let e;try{e=await r.preview(k)}catch(n){throw r.canReselect===!0&&(k=null,ie=!1,m=null),n}if(h)return;let t=e.merchantTerms;if(a.confirmOnHostedCheckout&&I()&&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()){let n=ue?"":s?"\u6B63\u5728\u6253\u5F00\u6536\u94F6\u53F0\u2026":"Opening checkout\u2026";l.textContent=n;try{await fe()}catch(i){h||X(i)}finally{l.textContent===n&&(l.textContent="")}return}rt(e)}function ae(e="destroy"){h||(h=!0,a.signal?.removeEventListener("abort",F),r.signal?.removeEventListener("abort",F),E.finish("dismissed"),ze?.(),J.abort(),We?.disconnect(),P?.destroy(),U?.destroy(),r.destroy(),x.open&&x.close(),x.remove(),R.remove(),g(),e==="dismiss"&&j(a.onDismiss))}D=ae;async function Ie(){if(!ee||h||ge||W==="closing"||!W&&!I())return;if(!A){ae("dismiss");return}let e=p.createElement("p");e.setAttribute("role","status"),e.textContent=s?"\u6B63\u5728\u5173\u95ED\u2026":"Closing\u2026",K||(K=p.createElement("div"),K.style.cssText=G.style.cssText,G.replaceWith(K),re.inert=!0),C.hidden=!1,K.replaceChildren(e,C),W="closing",C.setAttribute("aria-disabled","true"),C.focus({preventScroll:!0});try{await A.dismiss()}catch(t){h||j(a.onError,t)}h||(W="retry",e.textContent=s?"\u672A\u80FD\u786E\u8BA4\u5173\u95ED\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not confirm closure. Try again.",C.textContent=s?"\u91CD\u8BD5\u5173\u95ED":"Retry closing",C.removeAttribute("aria-label"),C.removeAttribute("aria-disabled"))}C.onclick=()=>{Ie()},x.addEventListener("cancel",e=>{e.preventDefault(),Ie()}),y.onclick=()=>{m&&L(m)};function Me(e){E.finish("error",e),ae()}function qe(){if(!(!Ke||ee||h||ge||P&&!I()))try{let e=t=>{a.focusAtReveal&&(g=je(p)),U?.setHidden?.(!1),De?.(),P&&(x.showModal(),P.responsive&&x.focus({preventScroll:!0}),!t&&a.loading!=="host"&&mt(x,P.type,P.responsive)),ee=!0};A?A.present(()=>E.present(()=>e(!0))):E.present(e)}catch(e){Me(e),X(e)}}try{be.type==="inline"?(Ge(),De=bt(R,T),T.append(R)):(x.setAttribute("aria-label",f.document.name),C.textContent="\xD7",C.setAttribute("aria-label",s?"\u5173\u95ED":"Close"),ht(C,f.document.screen.theme),C.hidden=ft(f.document),x.append(C,R),T.append(x),P=pt(x,{...f.document.screen,presentation:be},Oe),P.latch(),P.responsive&&(R.style.display="flex",R.style.flexDirection="column",R.style.maxHeight="100%",re.style.overflow="clip",re.style.minHeight="0"),De=wt(x)),U=V(re,{mode:"live",rendererUrl:r.webViewUrl,title:f.document.name,closeActions:At,onAuthoredClose(n){W||h||(C.hidden=n)},hostPresentation:()=>P?.type??be.type,reportContentHeight:P?.responsive,onResize:n=>{if(!P?.responsive)return;let i=Math.min(n,Te);re.style.height=`${i}px`,P.setContentHeight(i+(K??G).getBoundingClientRect().height)},onSelection(n){le=n,de()},onAction(n,i={}){if(!ee||h||W)return;let o=r.view,u=o?.document.buttons[n];if(!u)return;if(u.type==="close"&&A&&a.resumeCheckout&&r.operation&<(M(r.operation))){Ie();return}if(Z)return;if(!I()){Le();return}if(u.type==="close"){L(async()=>{await a.onAction?.(n),ae(a.onAction?"action":"dismiss")});return}if(u.type==="action"){m=async()=>{if(u.action.type==="event"){if(!a.onEvent)throw new v("EVENT_HANDLER_REQUIRED","Provide the event handler");await a.onEvent(u.action.event)}else a.onOpenUrl?await a.onOpenUrl(u.action.url):p.defaultView?.location.assign(u.action.url);await a.onAction?.(n),m=null},L(m);return}if(a.allowNewPurchase===!1){te()&&o&&r.quote&&r.operation&&M(r.operation).type==="checkout"&&Pe(r.quote,o,u.product,i)?L(_e,n):l.textContent=s?"\u5F53\u524D\u53EA\u80FD\u7EE7\u7EED\u539F\u8BA2\u5355\u3002":"Only your original checkout is available.";return}if(z&&r.canReselect===!1){l.textContent=s?"\u8BF7\u5148\u786E\u8BA4\u6216\u53D6\u6D88\u5F53\u524D\u8D2D\u4E70\u3002":"Confirm or cancel the current purchase first.",P?.responsive||z.scrollIntoView?.({block:"nearest"}),z.querySelector("button")?.focus({preventScroll:!0});return}if(te()&&H){H.selection.actionId===n&&L(()=>et(!0),n);return}if(te()&&a.terminateCheckout&&o&&r.quote&&r.operation&&r.canReselect===!1&&M(r.operation).type==="checkout"){if(Pe(r.quote,o,u.product,i)){L(_e,n);return}let b=ne(u.product,i,o.capabilities);try{if(!b)throw new v("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");we(o.document.screen,b,i,o.capabilities)}catch(me){X(me);return}let oe=r.operation.operationId,Y={actionId:n,requestId:crypto.randomUUID(),selection:structuredClone(i)};L(()=>St(oe,Y),n);return}if((r.quote||k)&&r.canReselect===!1){let b=!!o&&!!r.quote&&Pe(r.quote,o,u.product,i);Ce=!!r.quote&&!b,m=r.quote?()=>Ue(b):pe,L(m);return}let _=o&&ne(u.product,i,o.capabilities);if(!o||!_){X(new v("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(a.onPurchaseIntent){m=null,L(async()=>{let b={actionId:n,productVersionId:_,selection:structuredClone(i),featureQuantities:we(o.document.screen,_,i,o.capabilities)};Ne=!0,await a.onPurchaseIntent(b)});return}if(k&&k.actionId!==n){X(new v("COMMAND_PENDING","Finish the current purchase"));return}k||(k={requestId:crypto.randomUUID(),actionId:n,selection:structuredClone(i)},ie=!1),L(pe,n)},onEscape:()=>{Ie()},onError:n=>{let i=new Error(n);!ee&&!h&&Me(i),X(i)},onRendered:n=>{n&&x.setAttribute("aria-label",n),Ke=!0,qe()}}),U.setHidden?.(!0),Oe();let e=te()&&!!r.quote&&!!r.operation&&M(r.operation).type==="checkout";le=e?Et(f,r.quote)??{}:{},U.update(f.document.screen,f.document.screen.strings.defaultLocale,{capabilities:f.capabilities,unavailableActions:Qe(f),serverInput:{bindings:[],answers:{}},...Object.keys(le).length?{selection:le}:{}}),ze=r.subscribe?.(Se),Se(r.view??f),await E.wait(U.ready);let t=r.operation;!e&&(r.quote||t&&(t.confirmedAt||t.checkoutUrl||t.status==="complete"))&&(m=()=>Ue(),L(m))}catch(e){throw Me(e),e}return{check:Q,host:{get observing(){return Re},get recovery(){return Rt()},async prepareFallback(){if(Z||h||W||Ne)return{type:"recover",operationId:r.operation?.operationId??r.quote?.operationId??null,requestId:null};xe(!0);try{let e=await ut(r);return e.type==="native"&&ae(),e}finally{xe(!1)}},setSuspended(e){ge=e,R.hidden=e,e&&x.open?x.close():!e&&!ee?qe():!e&&!h&&ee&&be.type!=="inline"&&!x.open&&x.showModal()},destroy:ae,refresh:async()=>{if(!I()){if(r.view)return r.view;throw new v("PRECONDITION_FAILED","Paywall presentation is suspended")}let e=await r.refresh();return Se(e),qe(),e}}}}export{dn as showPaywall};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-W6OQTXLL.js";import"./chunk-BOVN2BE3.js";import"./chunk-PUR5CYWX.js";import"./chunk-TAFALMQN.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-VEX2FOFZ.js";import"./chunk-56BYGPQ6.js";import"./chunk-VYFSRHXM.js";import"./chunk-BQRS7Y4K.js";import"./chunk-U4RSRFZY.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-3VUPVXAV.js";import"./chunk-EM3MGDPG.js";import"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-WOT6VMZA.js";export{a as readPaywallContent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-GZRRVHYK.js";import"./chunk-44U3FOBB.js";import"./chunk-WZR2XCSJ.js";import"./chunk-EUTWY7A2.js";import"./chunk-7MNJH5GB.js";import"./chunk-CIP5SQ5Y.js";import"./chunk-LF2UIJYD.js";import"./chunk-CKKIB2HC.js";import"./chunk-W6OQTXLL.js";import"./chunk-BOVN2BE3.js";import"./chunk-PUR5CYWX.js";import"./chunk-TAFALMQN.js";import"./chunk-ZGCKQWQ5.js";import"./chunk-3NCMYTNG.js";import"./chunk-VEX2FOFZ.js";import"./chunk-V7PFLFHE.js";import"./chunk-5HJYR6Z4.js";import"./chunk-56BYGPQ6.js";import"./chunk-VYFSRHXM.js";import"./chunk-BQRS7Y4K.js";import"./chunk-U4RSRFZY.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-3VUPVXAV.js";import"./chunk-EM3MGDPG.js";import"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-DSPLGTQI.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-TOTRALYQ.js";import"./chunk-XUGEOELU.js";import"./chunk-BQRS7Y4K.js";import"./chunk-U4RSRFZY.js";import"./chunk-KE26KWIU.js";import"./chunk-TJGIT5CU.js";import"./chunk-OX7PA64E.js";import"./chunk-V7MMTILA.js";import"./chunk-VF6QMMEA.js";import"./chunk-7QL4GF4C.js";import"./chunk-BID4UGWB.js";import"./chunk-DSPLGTQI.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
|