@tinkerlandai/indiana-sdk 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/README.md +10 -6
  3. package/README.zh-CN.md +9 -5
  4. package/THIRD_PARTY_NOTICES.md +28 -0
  5. package/dist/{chunk-M3DG6ZCT.js → chunk-2EJSV6BA.js} +1 -1
  6. package/dist/chunk-4K25DELJ.js +1 -0
  7. package/dist/chunk-63BWE27V.js +1 -0
  8. package/dist/chunk-CB63JLGT.js +1 -0
  9. package/dist/{chunk-N6UIDDAX.js → chunk-D7YHFS6B.js} +2 -2
  10. package/dist/chunk-HTRQPMJO.js +11 -0
  11. package/dist/chunk-ISUXYPYL.js +1 -0
  12. package/dist/chunk-QG3WUJG5.js +1 -0
  13. package/dist/chunk-U6S6AZM6.js +1 -0
  14. package/dist/chunk-VVSQKVE7.js +1 -0
  15. package/dist/client-OYRHOMUQ.js +1 -0
  16. package/dist/{configuration-sync-Bnu8s4pc.d.ts → configuration-sync-C2mytNwU.d.ts} +18 -0
  17. package/dist/errors-DrdTlPwf.d.ts +57 -0
  18. package/dist/funnel-runtime-host-NWS3URFA.js +1 -0
  19. package/dist/{funnel-runtime-start-Zbd5ro5r.d.ts → funnel-runtime-start-sZ8ZCNlq.d.ts} +42 -58
  20. package/dist/iam.d.ts +131 -0
  21. package/dist/iam.js +1 -0
  22. package/dist/index.d.ts +41 -4
  23. package/dist/index.js +1 -1
  24. package/dist/native-shell.js +1 -1
  25. package/dist/openrouter.js +1 -1
  26. package/dist/page.d.ts +1 -1
  27. package/dist/page.js +1 -1
  28. package/dist/paywall-4XZ6NDMY.js +1 -0
  29. package/dist/popup.d.ts +2 -5
  30. package/dist/popup.js +3 -14
  31. package/dist/react-native.d.ts +327 -0
  32. package/dist/react-native.js +1 -0
  33. package/dist/server.d.ts +4 -3
  34. package/dist/server.js +1 -1
  35. package/dist/src-WV6GZYWA.js +1 -0
  36. package/dist/visual.d.ts +10 -1
  37. package/dist/visual.js +2 -1
  38. package/package.json +15 -2
  39. package/dist/chunk-BIFEEVQO.js +0 -1
  40. package/dist/chunk-ET4NANGB.js +0 -1
  41. package/dist/chunk-J7M7UH74.js +0 -1
  42. package/dist/chunk-OHDY27EI.js +0 -1
  43. package/dist/chunk-VMLGV5OS.js +0 -11
  44. package/dist/funnel-runtime-host-3STQUS6F.js +0 -1
  45. package/dist/paywall-LBDMGVWZ.js +0 -1
  46. package/dist/src-X6KT6WIH.js +0 -1
  47. package/dist/visual-editor-agent-WW65CMKW.js +0 -1
@@ -1 +0,0 @@
1
- import{a as ne}from"./chunk-6X42DWOM.js";import"./chunk-ET4NANGB.js";import{a as f}from"./chunk-5TEZEOHX.js";import"./chunk-S5TVMQRC.js";import{Gd as Ie,ri as me}from"./chunk-VMLGV5OS.js";import{Gb as Ce}from"./chunk-RMJJOSVZ.js";import"./chunk-OHDY27EI.js";import"./chunk-S2MSIA57.js";function be(b){let q=b.view;if(!q?.paywall)throw new f("INVALID_REQUEST","The current node is not a Paywall");let n=q.paywall.receiptId,Z=q.nodeId,te=q.visit,w=q.paywall.resolution,E=q.paywall.quote,y=q.paywall.operation,O=!1,L=new AbortController,v=q.paywall.purchaseRequestId,k=0,F=q.paywall.selectionGeneration??0,U=q.paywall.canReselect===!0,A=null,j=new Map,V=new Map;function R(t){if(t.purchase&&t.purchase.receiptId!==n)throw new f("INVALID_RESPONSE","Purchase receipt changed");let i=t.run.paywall;return t.purchase??(i?.receiptId===n?i:null)}function C(){if(O)throw new f("IDENTITY_CHANGED","Paywall presentation has closed")}function N(t,i,a){if(C(),i!==k||a!==void 0&&E?.operationId!==a)return!1;let m=F,l=t.run.paywall;if(l?.receiptId===n){if((l.selectionGeneration??0)<F)return!1;if(F=l.selectionGeneration??0,U=l.canReselect===!0,l.resolution.id!==w.id||l.resolution.offering.id!==w.offering.id)throw new f("INVALID_RESPONSE","The pinned Paywall binding changed")}let c=R(t),u=F>m,D=u?c?.quote??null:c?.quote??E,P=c?.operation??(D?.operationId===E?.operationId?y:null);if(D&&P&&D.operationId!==P.operationId)throw new f("INVALID_RESPONSE","Purchase operation changed");return l?.receiptId===n&&(w=l.resolution),(u||D?.operationId!==E?.operationId)&&(k++,l?.receiptId===n&&(v=l.purchaseRequestId)),E=D,(y?.operationId!==P?.operationId||y?.status==="pending"||P?.status==="complete")&&(y=P),!0}function z(t,i,a){return new Promise((m,l)=>{let c=!1,u=()=>{clearTimeout(ie),L.signal.removeEventListener("abort",$)},D=ee=>{c||(c=!0,u(),m(ee))},P=ee=>{c||(c=!0,u(),l(ee))},$=()=>P(new f("IDENTITY_CHANGED","Paywall presentation has closed")),ie=setTimeout(()=>P(new f("COMMAND_PENDING","The purchase command is still pending; retry the original request",202,a)),Math.max(0,i-Date.now()));L.signal.addEventListener("abort",$,{once:!0}),L.signal.aborted&&$(),t.then(D,P)})}function Q(t){return new Promise(i=>{let a=()=>{clearTimeout(m),L.signal.removeEventListener("abort",a),i()},m=setTimeout(a,t);L.signal.addEventListener("abort",a,{once:!0}),L.signal.aborted&&a()})}async function W(t,i,a){C();let m=j.get(t);if(!m){let u=b.pendingCommands?.find(D=>D.requestId===t)??b.pendingCommand;if(u?.operation==="submit"&&u.requestId===t&&u.nodeId===Z&&u.visit===te){i.type==="paywall_quote"&&u.input.type==="paywall_quote"&&u.input.predecessor&&!i.predecessor&&(i={...i,predecessor:u.input.predecessor});let D=me.parse(u),P=me.parse({...u,input:i});if(P.operation!=="submit"||D.operation!=="submit"||JSON.stringify(P.input)!==JSON.stringify(D.input))throw new f("CONFLICT","A restored purchase request cannot change its input");i=P.input,m=D,j.set(t,m)}}if(m){if(JSON.stringify(m.input)!==JSON.stringify(i))throw new f("CONFLICT","A purchase request cannot change its input")}else{let u=b.view;if(!u||u.nodeId!==Z||u.visit!==te||u.paywall?.receiptId!==n)throw new f("PRECONDITION_FAILED","The Paywall visit has changed");m={operation:"submit",requestId:t,nodeId:Z,visit:te,revision:u.revision,input:i},j.set(t,m)}let l=Date.now()+3e4,c=await z(b.submit(m),l,t);for(;c.run.pendingRequest?.requestId===t&&Date.now()<l&&!O&&(await Q(Math.min(1e3,l-Date.now())),!(O||Date.now()>=l));)c=await z(b.resume(t),l,t);if(O)throw new f("IDENTITY_CHANGED","Paywall presentation has closed");if(c.run.pendingRequest?.requestId===t)throw new f("COMMAND_PENDING","The purchase command is still pending; retry the original request",202,t);if(!N(c,a,i.type==="paywall_confirm"||i.type==="paywall_cancel"?i.operationId:void 0))throw new f("PRECONDITION_FAILED","The purchase selection has changed")}async function K(t){if(!E)throw new f("INVALID_REQUEST","A quoted purchase is required");let i=`${t}:${E.operationId}`,a=V.get(i);if(!a){let m=t==="confirm"?"paywall_confirm":"paywall_cancel",l=b.pendingCommands?.find(c=>c.operation==="submit"&&c.input.type===m&&"operationId"in c.input&&c.input.operationId===E.operationId)??b.pendingCommand;a=l?.operation==="submit"&&l.input.type===m&&"operationId"in l.input&&l.input.operationId===E.operationId?l.requestId:crypto.randomUUID(),V.set(i,a)}if(await W(a,{type:t==="confirm"?"paywall_confirm":"paywall_cancel",operationId:E.operationId},k),!y)throw new f("INVALID_RESPONSE","The accepted purchase result is missing");return structuredClone(y)}return{get view(){return structuredClone(w)},get quote(){return E?structuredClone(E):null},get operation(){return y?structuredClone(y):null},get webViewUrl(){return b.webViewUrl},get canReselect(){return U},async refresh(){C();let t=k;return N(await b.get(),t),structuredClone(w)},preview(t){if(v&&v!==t.requestId&&(A||!U))return Promise.reject(new f("COMMAND_PENDING","Retry the original purchase before starting another"));if(v===t.requestId&&A)return A;let i=w.document.buttons[t.actionId],a=i?.type==="checkout"?Ie(i.product,t.selection,w.capabilities):null;if(!a)return Promise.reject(new f("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));let m=v!==t.requestId&&F>0?{operationId:E?.operationId??null,generation:F}:void 0;if(m&&(!U||F<=0))return Promise.reject(new f("COMMAND_PENDING","Original purchase requires authoritative termination"));v!==t.requestId&&k++;let l=k;v=t.requestId;let c=(async()=>{if(await W(t.requestId,{type:"paywall_quote",actionId:t.actionId,productVersionId:a,...m?{predecessor:m}:{},...t.offerId?{offerId:t.offerId}:{},...t.nativeOffer?{nativeOffer:t.nativeOffer}:{}},l),!E)throw new f("INVALID_RESPONSE","The accepted quote is missing");return structuredClone(E)})();return A=c,c.then(()=>{A===c&&(A=null)},u=>{A===c&&(A=null),v===t.requestId&&b.pendingCommand?.requestId!==t.requestId&&u instanceof f&&u.status!==void 0&&u.status<500&&![401,425].includes(u.status)&&(v=null)}),c},confirm:()=>K("confirm"),cancel:()=>K("cancel"),async read(){if(C(),!E)throw new f("INVALID_REQUEST","A quoted purchase is required");let t=E.operationId,i=k,a=b.pendingCommands?.find(u=>u.operation==="submit"&&(u.input.type==="paywall_confirm"||u.input.type==="paywall_cancel")&&u.input.operationId===t)??b.pendingCommand;a?.operation==="submit"&&(a.input.type==="paywall_confirm"||a.input.type==="paywall_cancel")&&a.input.operationId===t&&await b.settle?.(a.requestId);let m=await b.get(void 0,{receiptId:n,operationId:t});C();let l=R(m);if(l?.quote&&l.quote.operationId!==t||l?.operation&&l.operation.operationId!==t)throw new f("INVALID_RESPONSE","Purchase operation changed");let c=N(m,i,t)?y:l?.operation;if(!c)throw new f("INVALID_RESPONSE","The current purchase result is missing");return structuredClone(c)},destroy(){O=!0,L.abort(),j.clear(),V.clear()}}}async function Fe(b,q){let n=q,{mountScreenPreview:Z}=await import("./popup.js"),{showPaywall:te}=await import("./paywall-LBDMGVWZ.js"),w=b.ownerDocument,E=w.activeElement,y=w.createElement("section"),O=w.createElement("div"),L=w.createElement("div"),v=w.createElement("div"),k=w.createElement("button");v.hidden=!0,k.type="button";let F=w.createElement("p"),U=w.createElement("p"),A=w.createElement("button"),j=w.createElement("button"),V=w.createElement("button"),R=w.createElement("dialog");y.dataset.indianaFunnel="",y.setAttribute("aria-busy","false"),y.style.cssText="box-sizing:border-box;width:100%;min-width:0;font:14px/1.5 system-ui,sans-serif;color:#172033;background:#fff",L.style.cssText="display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 20px",F.setAttribute("role","status"),U.setAttribute("role","alert"),U.hidden=!0,A.type=j.type=V.type="button",L.append(A,F,U,V,k,j),y.append(O,v,L),b.append(y);let C=null,N=null,z=null,Q="",W="",K="",t="",i=!1,a=0,m=!1,l="",c=null,u=Promise.resolve(),D=null,P=null,$={},ie=new Map,ee=new Set,se=new Set,ae=new Set,oe=null,H={},g=!1,he,G=0,T=null,re="",le=new Map,ye=e=>e?`${e.id}:${e.nodeId}:${e.visit}:${e.revision}:${e.paywall?.quote?.operationId??""}`:"",J=(e,o=null)=>{i||(P=o,U.textContent=e instanceof Error?e.message:"Request failed",U.hidden=!1,V.hidden=n.client.pendingCommand===null,ne(n.onError,e))};function B(){let e=n.client.view;if(!e)throw new f("INVALID_REQUEST","No current Run is available");return{requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:e.revision}}async function Y(e,o=!1){if(!(a&&!o||i||(g||n.client.view?.recoveryRestricted)&&!o)){a++,y.setAttribute("aria-busy","true"),U.hidden=!0,P=null;try{if(!o&&oe){let r=n.client.view;await oe;let h=n.client.view;if(!r||!h||h.id!==r.id||h.nodeId!==r.nodeId||h.visit!==r.visit||h.stopped||!["running","waiting"].includes(h.status))throw new f("PRECONDITION_FAILED","The screen changed while its display was acknowledged")}if(i)return;let d=await e();i||await X(n.client.view??d.run)}catch(d){J(d,n.client.pendingCommand?.requestId??null)}finally{a=Math.max(0,a-1),y.setAttribute("aria-busy",String(a>0)),i||(V.hidden=n.client.pendingCommand===null,A.disabled=a>0||!!n.client.pendingCommand||!n.client.view?.canBack)}}}function ve(e){if(g||ee.has(e)||se.has(e)||i)return;se.add(e);let o=async()=>{if(g||i||Q!==e){se.delete(e);return}if(a||n.client.pendingCommand){setTimeout(()=>{o()},250);return}let d=(async()=>{let h=n.client.view,p=B();try{await n.client.submit({operation:"shown",...p})}catch(S){if(!(S instanceof f)||S.code!=="CONFLICT"||S.status!==409||n.client.pendingCommand)throw S;await n.client.get();let s=n.client.view;if(i||g||Q!==e||!s||!h||s.id!==h.id||s.source.versionId!==h.source.versionId||s.nodeId!==p.nodeId||s.visit!==p.visit||s.revision<=p.revision||s.stopped||!s.screen||!["running","waiting"].includes(s.status)||n.client.pendingCommand)throw S;await n.client.submit({operation:"shown",...B()})}ee.add(e)})();oe=d;let r=()=>{oe===d&&(oe=null),se.delete(e)};d.then(r,h=>{r(),a||J(h)})};o()}function ue(){c&&clearTimeout(c),!(i||!z||!["running","waiting"].includes(z.status)&&!n.client.pendingCommand)&&(c=setTimeout(()=>{c=null,ge().finally(ue)},z.pendingRequest||n.client.pendingCommand?1500:5e3))}async function ge(){if(!(i||m||a)){if(g){await ce(he);return}m=!0;try{let e=n.client.pendingCommand;e&&n.client.settle&&await n.client.settle(e.requestId);let o=n.client.view,d=$,r=await n.client.get(o?.screen&&Object.keys(d).length?{nodeId:o.nodeId,visit:o.visit,revision:o.revision,components:d}:void 0);!i&&d===$&&await X(n.client.view??r.run)}catch(e){J(e)}finally{m=!1}}}async function Ee(e){let o=n.client.view,d=o?.screen,r=d?.customerData.nodes[e.nodeId];if(i||a||!o||!d||!r)return;if(!["refresh","next","previous","filter","sources_next","sources_previous"].includes(e.action)){let x=C?.document,M=x?Ce(x,e.nodeId):null,we=M?.type==="customer_data"?M.data.outputs?.[e.action]:void 0;we&&d.outputs.includes(we)?await Y(()=>n.client.submit({operation:"submit",...B(),input:{type:"screen",output:we,answers:H,selection:e.value?{[e.nodeId]:e.value}:{}}})):await n.onCustomerDataIntent?.(e,o);return}let p=e.action.startsWith("sources_")?r.resources.find(x=>x.key===e.value):null;if(e.action.startsWith("sources_")&&!p)throw new f("INVALID_REQUEST","Choose a current resource");let S=`${o.visit}:${e.nodeId}:${p?.key??""}`,s=ie.get(S)??[null],I=$[e.nodeId]??{page:1,after:null,filter:"all",...p?{resourceKey:p.key}:{}};if(e.action==="filter"){let x=e.value;if(!x||!(r.source==="offer_history"?["all","issued","reserved","redeemed","expired","revoked"]:["all","purchase","refund","source","usage","debt","settlement"]).includes(x))throw new f("INVALID_REQUEST","Unknown data filter");I={page:1,after:null,filter:x},s.splice(0,s.length,null)}else if(e.action==="next"||e.action==="sources_next"){let x=p?.sources.at(-1),M=p?x?{kind:"ledger",cursor:{at:x.detail[0],id:x.id,type:"source"}}:null:d.dataCursors[e.nodeId];if(!M||!p&&!r.hasNext)return;s[I.page]=M,I={...I,page:I.page+1,after:M}}else if(e.action==="previous"||e.action==="sources_previous"){if(I.page<=1)return;I={...I,page:I.page-1,after:s[I.page-2]??null}}ie.set(S,s),$={...$,[e.nodeId]:I},await Y(()=>n.client.get({nodeId:o.nodeId,visit:o.visit,revision:o.revision,components:$}))}function Re(e){let o=e.screen?.presentation;if(!o||o.type==="inline"){R.open&&R.close(),y.parentElement!==b&&b.append(y);return}y.parentElement!==R&&(R.append(y),b.append(R));let d={sm:420,md:640,lg:900};R.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in o?d[o.size]+"px":"100vw"}`,R.setAttribute("aria-label",C?.document?.name??e.screen?.content.document.name??"Funnel"),R.open||R.showModal()}async function De(e){if(i)return;z=e,P&&n.client.pendingCommand?.requestId!==P&&(U.hidden=!0,P=null);let o=e.locale.startsWith("zh");if(k.textContent=o?"\u56DE\u770B":"History",k.hidden=!n.client.review,A.textContent=g?o?"\u8FD4\u56DE\u5F53\u524D":"Return to current":o?"\u8FD4\u56DE":"Back",j.textContent=o?"\u5173\u95ED":"Close",V.textContent=o?"\u91CD\u8BD5":"Retry",A.disabled=!g&&(a>0||!!n.client.pendingCommand||!e.canBack),V.hidden=n.client.pendingCommand===null,F.textContent=e.pendingRequest?o?"\u6B63\u5728\u5904\u7406":"Processing":e.instruction?.type==="wait"?o?"\u7B49\u5F85\u4E2D":"Waiting":"",l!==`${e.revision}:${e.visit}:${e.status}:${e.stopped}`&&(l=`${e.revision}:${e.visit}:${e.status}:${e.stopped}`,ne(n.onState,structuredClone(e))),e.stopped||n.client.configurationReady===!1){g=!1,G++,T?.destroy(),T=null,v.replaceChildren(),v.hidden=!0,O.hidden=!1,C?.destroy(),C=null,N?.destroy(),N=null,O.replaceChildren(),Q="",W="",t="",R.open&&R.close(),y.hidden=!0,ue();return}if(y.hidden=!1,g){ue();return}if(e.recoveryRestricted){C?.destroy(),C=null,N?.destroy(),N=null,O.replaceChildren(),Q="",F.textContent=o?"\u539F\u8BB0\u5F55\u9700\u8981\u6838\u5BF9\uFF0C\u53EF\u53EA\u8BFB\u56DE\u770B":"Original records require reconciliation; read-only history is available";return}let d=e.screen||e.paywall?`${e.id}:${e.nodeId}:${e.visit}`:"";if(d!==Q&&(C?.destroy(),C=null,N?.destroy(),N=null,O.replaceChildren(),Q=d,W="",t="",H={...e.answers},$={},ie.clear()),Re(e),e.screen){let h=e.screen.content;C||(C=Z(O,{mode:"live",rendererUrl:n.client.webViewUrl,title:h.document.name,onAction(s,_={},I={}){if(g)return;H={...H,...I};let x=Object.fromEntries((e.screen?.inputs??[]).filter(({variable:M})=>Object.hasOwn(H,M)).map(({variable:M})=>[M,H[M]]));Y(()=>n.client.submit({operation:"submit",...B(),input:{type:"screen",output:s,answers:x,selection:_}}))},onAnswers:s=>{g||(H={...H,...s})},onCustomerDataIntent:s=>{g||Ee(s).catch(J)},onEscape:()=>{g||de()},onError:s=>J(new Error(s)),onRendered:()=>ve(d)}));let p={capabilities:e.screen.capabilities,customerData:e.screen.customerData,parameters:e.parameters,serverInput:{bindings:e.screen.inputs,answers:H,values:e.screen.values}},S=JSON.stringify([h,e.locale,p.parameters,e.screen.inputs,e.screen.values]);if(S!==W)C.update(h.document,e.locale,p),W=S,K=JSON.stringify(p.capabilities),t=JSON.stringify(p.customerData);else{let s=JSON.stringify(p.capabilities);s!==K&&(C.updateCapabilities(p.capabilities),K=s),JSON.stringify(p.customerData)!==t&&(C.updateCustomerData(p.customerData),t=JSON.stringify(p.customerData))}await C.ready}else if(e.paywall&&!N){let h=await te(O,{canInteract:()=>!g&&!i&&!n.client.view?.recoveryRestricted,start:async()=>be(n.client),onPurchase:n.onPurchase,onCheckoutUrl:n.onCheckoutUrl,resolveOfferId:n.resolveOfferId,onEvent:n.onEvent,onOpenUrl:p=>n.onOpenUrl?n.onOpenUrl({receiptId:e.paywall.receiptId,url:p,openIn:"same_window"}):w.defaultView?.location.assign(p),onAction:async p=>{if(g)return;let S=await n.client.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:e.nodeId,visit:e.visit,revision:e.revision,input:{type:"screen",output:p,answers:{}}});await X(n.client.view??S.run)},onError:J,onDismiss:()=>{!g&&!i&&n.client.view?.visit===e.visit&&de()}});i?h.host?.destroy():(N=h.host,N?.setSuspended(g)),ve(d)}let r=e.instruction;if(r&&(r.type==="open_url"||r.type==="event")&&!ae.has(r.receiptId)){let h=w.createElement("button");h.type="button",h.textContent=r.type==="open_url"?`${o?"\u524D\u5F80":"Continue to"} ${new URL(r.url).host}`:o?"\u7EE7\u7EED":"Continue",h.onclick=()=>{let p=B(),S=r.type==="open_url"&&!n.onOpenUrl&&r.openIn==="new_window"?Pe(r.url):null;Y(async()=>{let s="success";if(r.type==="open_url")if(n.onOpenUrl)try{s=await n.onOpenUrl({receiptId:r.receiptId,url:r.url,openIn:r.openIn})===!1?"failed":"opened"}catch(I){ne(n.onError,I),s="failed"}else s=r.openIn==="new_window"&&!S?"failed":"opened";if(r.type==="event"){if(!n.onEvent)throw new f("EVENT_HANDLER_REQUIRED","Provide the event handler");await n.onEvent(r.event)}if(i||n.client.view?.nodeId!==p.nodeId||n.client.view.visit!==p.visit)throw new f("PRECONDITION_FAILED","The client action visit changed");let _=await n.client.submit({operation:"submit",...p,input:{type:"client_action",receiptId:r.receiptId,outcome:s}});return ae.add(r.receiptId),r.type==="open_url"&&!n.onOpenUrl&&r.openIn==="same_window"&&w.defaultView?.location.assign(r.url),_})},O.replaceChildren(h)}!e.pendingRequest&&e.status==="completed"&&!ae.has(`complete:${e.id}`)&&(ae.add(`complete:${e.id}`),ne(n.onComplete,structuredClone(e))),ue()}function Pe(e){let o=w.defaultView?.open(e,"_blank")??null;return o&&(o.opener=null),o}function X(e){return u=u.catch(()=>{}).then(()=>De(e)),u}async function ce(e){if(i||!n.client.review)return;g||(re=ye(n.client.view),le.set(re,structuredClone(H))),g=!0,he=e,O.hidden=!0,N?.setSuspended(!0),v.hidden=!1;let o=++G;try{let d=await n.client.review(e);if(i||o!==G||!g)return;if(!d.review)throw new f("INVALID_RESPONSE","Historical projection is missing");T?.destroy(),T=null,v.replaceChildren();let r=d.run.locale.startsWith("zh"),h=w.createElement("p");h.textContent=r?"\u53EA\u8BFB\u56DE\u770B":"Read-only history",v.append(h);for(let[s,_]of d.review.pages.entries()){let I=w.createElement("button");I.type="button",I.textContent=r?`\u7B2C ${s+1} \u9875`:`Page ${s+1}`,I.onclick=()=>{ce(_.receiptId)},v.append(I)}if(d.review.page){let s=d.review.page,_=w.createElement("div");if(_.inert=!0,v.append(_),T=Z(_,{mode:"live",rendererUrl:n.client.webViewUrl,title:s.document.name,onAction:()=>{},onAnswers:()=>{},onCustomerDataIntent:()=>{},onRendered:()=>{},onEscape:()=>{fe()}}),T.update(s.document,d.run.locale,{serverInput:{bindings:s.inputs,answers:s.answers,values:s.values}}),await T.ready,i||o!==G||!g)return}let p=r?{issued:"\u5DF2\u9886\u53D6",reserved:"\u5DF2\u9884\u7559",redeemed:"\u5DF2\u4F7F\u7528",expired:"\u5DF2\u8FC7\u671F",revoked:"\u5DF2\u64A4\u9500",unknown:"\u72B6\u6001\u5F85\u786E\u8BA4"}:{issued:"Issued",reserved:"Reserved",redeemed:"Used",expired:"Expired",revoked:"Revoked",unknown:"Status unconfirmed"},S=r?{pending:"\u5904\u7406\u4E2D",complete:"\u5DF2\u5B8C\u6210",cancelled:"\u5DF2\u53D6\u6D88",failed:"\u5931\u8D25",unknown:"\u72B6\u6001\u5F85\u786E\u8BA4"}:{pending:"Processing",complete:"Completed",cancelled:"Cancelled",failed:"Failed",unknown:"Status unconfirmed"};for(let s of[...d.review.coupons.map((_,I)=>`${r?"\u4F18\u60E0\u5238":"Coupon"} ${I+1}: ${p[_.status]}`),...d.review.purchases.map((_,I)=>`${r?"\u8D2D\u4E70":"Purchase"} ${I+1}: ${S[_.status]}`)]){let _=w.createElement("p");_.textContent=s,v.append(_)}n.client.view&&await X(n.client.view)}catch(d){if(o!==G||i)return;T?.destroy(),T=null,v.replaceChildren(),J(d)}}async function fe(){if(!g||i||!n.client.review)return;let e=++G;try{if(await n.client.review(),i||e!==G)return;g=!1,G++,T?.destroy(),T=null,v.replaceChildren(),v.hidden=!0,O.hidden=!1;let o=n.client.view;ye(o)!==re?(le.set(re,structuredClone(H)),Q="",W=""):(le.delete(re),N?.setSuspended(!1)),o&&await X(o)}catch(o){if(e!==G||i)return;T?.destroy(),T=null,v.replaceChildren(),J(o)}}let Ne=n.client.subscribe(e=>{n.client.configurationReady===!1&&(y.hidden=!0,C?.destroy(),C=null,N?.destroy(),N=null,O.replaceChildren(),Q="",W="",t="",R.open&&R.close()),X(e).catch(J)}),Oe=n.client.subscribeError?.(J);function de(){return D||(i?Promise.resolve():n.client.view&&!["running","waiting"].includes(n.client.view.status)?(pe(),Promise.resolve()):(D=Y(()=>n.client.submit({operation:"close",...B()}),!0).then(()=>{n.client.view?.status==="closed"&&pe()}).finally(()=>{D=null}),D))}function pe(){i||(i=!0,c&&clearTimeout(c),Ne(),Oe?.(),C?.destroy(),G++,T?.destroy(),N?.destroy(),R.close(),R.remove(),y.remove(),E instanceof HTMLElement&&E.isConnected&&E.focus(),ne(n.onDismiss,z?structuredClone(z):null))}A.onclick=()=>{if(g){fe();return}Y(()=>n.client.submit({operation:"back",...B()}))},k.onclick=()=>{ce()},j.onclick=()=>{de()},V.onclick=()=>{Y(()=>n.client.retry())},R.addEventListener("cancel",e=>{e.preventDefault(),de()});try{let e=await n.client.get();await X(n.client.view??e.run)}catch(e){throw pe(),e}return{destroy:pe,refresh:ge,review:ce,exitReview:fe,get unappliedDrafts(){return new Map([...le].map(([e,o])=>[e,structuredClone(o)]))}}}export{Fe as showFunnelRun};
@@ -1 +0,0 @@
1
- import{a as z}from"./chunk-6X42DWOM.js";import"./chunk-ET4NANGB.js";import{a as w}from"./chunk-5TEZEOHX.js";import"./chunk-S5TVMQRC.js";import{Gd as q,_j as j}from"./chunk-VMLGV5OS.js";import{f as $,ja as N}from"./chunk-RMJJOSVZ.js";import"./chunk-OHDY27EI.js";import"./chunk-S2MSIA57.js";async function W(b,n,h){if(n.status!=="complete")throw new w("INVALID_RESPONSE","A verified completed purchase is required");if(await h.onComplete?.(n),!b||!h.check)return;let t=N.parse(await h.check());if(t.internal_feature_id!==b.internal_feature_id||t.quantity!==b.quantity)throw new w("INVALID_RESPONSE","The access requirement changed");t.allowed&&await h.onAccessGranted?.(t)}async function ie(b,n){let h=n.check?N.parse(await n.check()):null;if(h?.allowed)return await n.onAccessGranted?.(h),{check:h,host:null};let t=await n.start(),y=t.view;if(!y)throw new w("INVALID_RESPONSE","Paywall presentation is missing");let{mountScreenPreview:J}=await import("./popup.js"),a=b.ownerDocument,S=new AbortController,v=a.createElement("section"),Q=a.createElement("div"),O=a.createElement("div"),P=a.createElement("p"),c=a.createElement("button"),L=a.createElement("button"),u=a.createElement("dialog"),_=a.activeElement,p=y.document.screen.strings.defaultLocale.startsWith("zh");v.dataset.indianaPaywall="",v.setAttribute("aria-label",y.document.name),v.style.cssText="width:100%;box-sizing:border-box;background:#fff;color:#172033;font:14px/1.5 system-ui,sans-serif",O.style.cssText="display:flex;gap:12px;padding:12px 20px;align-items:center;flex-wrap:wrap",P.setAttribute("role","status"),L.textContent=p?"\u5173\u95ED":"Close",c.textContent=p?"\u91CD\u8BD5":"Retry",c.hidden=!0,O.append(P,c,L),v.append(Q,O);let D=y.document.presentation,A,d=!1,T=!1,f=null,G=!1,m=()=>!G&&n.canInteract?.()!==!1,M=!1,r=null,I=null,U=e=>{P.textContent=e instanceof Error?e.message:p?"\u8BF7\u6C42\u5931\u8D25":"Request failed",z(n.onError,e),c.hidden=r===null};async function k(e){if(!(T||d||!m())){T=!0,c.hidden=!0,P.textContent="";try{await e()}catch(s){d||U(s)}finally{T=!1}}}async function K(e){await W(h,e,n)}async function E(e){if(d)return;if(!m()){r=async()=>E(await t.read()),c.hidden=!1;return}if(P.textContent=e.status,e.status==="complete"){r=null,await K(e);return}if(e.status!=="pending"){if(t.canReselect===!1){P.textContent=p?"\u6B63\u5728\u6838\u5BF9\u539F\u8D2D\u4E70\u7ED3\u679C":"Checking the original purchase result",c.textContent=p?"\u67E5\u8BE2\u7ED3\u679C":"Check result",r=async()=>E(await t.read()),c.hidden=!1;return}c.textContent=p?"\u91CD\u8BD5":"Retry",r=null,f=null;return}let s=Date.now()+6e5,l=2e3;for(;!d&&Date.now()<s;){if(await new Promise(C=>{let R=()=>{clearTimeout(x),C()},x=setTimeout(()=>{S.signal.removeEventListener("abort",R),C()},l);S.signal.addEventListener("abort",R,{once:!0})}),d)return;if(!m()){r=async()=>E(await t.read()),c.hidden=!1;return}let i=await t.read();if(i.status!=="pending"){await E(i);return}l=Math.min(l*1.5,3e4)}r=async()=>E(await t.read()),c.hidden=!1}async function V(){I?.remove(),I=null,r=V;let e=await t.confirm();if(!m()){r=V,c.hidden=!1;return}if(e.status==="pending"){if(e.checkoutUrl)n.onCheckoutUrl?await n.onCheckoutUrl(e.checkoutUrl):a.defaultView?.location.assign(e.checkoutUrl);else if(e.execution||e.nativePurchase){if(!n.onPurchase)throw new w("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await n.onPurchase({operation:e,signal:S.signal})}}r=async()=>E(await t.read()),await E(e)}function X(e){I?.remove();let s=a.createElement("div"),l=a.createElement("button"),i=a.createElement("button"),C=a.createElement("p");C.textContent=e.lines.map(o=>o.productName).join(", ")+" \xB7 "+$(e.charge?.totalMinor??e.catalogAmountMinor-(e.discount?.amountMinor??0),e.currency),l.textContent=p?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",i.textContent=p?"\u53D6\u6D88":"Cancel",l.onclick=()=>{k(V)};let R=async()=>{let o=await t.cancel();d||(s.remove(),I=null,await E(o))};i.onclick=()=>{r=R,k(R)};let x=a.createElement("div");for(let o of e.lines){let B=a.createElement("p");if(B.textContent=`${o.productName} \xB7 ${$(o.catalogAmountMinor,e.currency)}${j(o.interval,p?"zh-CN":"en",o.intervalCount??1)}`,x.append(B),o.trial){let F=a.createElement("p");F.textContent=p?`\u8BD5\u7528 ${o.trial.days} \u5929\uFF1B${o.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${o.trial.days}; ${o.trial.cardRequired?"a payment method is required":"no payment method is required"}`,x.append(F)}}if(!e.charge){let o=a.createElement("p");o.textContent=p?"\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.",x.append(o)}s.append(C,x,l,i),O.prepend(s),I=s,r=null}async function H(){if(!f)return;if(r=H,!M){let s=t.view,l=s?.document.buttons[f.actionId],i=s&&l?.type==="checkout"?q(l.product,f.selection,s.capabilities):null;if(!i)throw new w("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let C=await n.resolveOfferId?.({actionId:f.actionId,productVersionId:i});if(d)return;C!==void 0&&(f.offerId=C),M=!0}if(!m()){c.hidden=!1;return}let e=await t.preview(f);d||X(e)}function g(e="destroy"){d||(d=!0,S.abort(),A?.destroy(),t.destroy(),u.open&&u.close(),u.remove(),v.remove(),_ instanceof HTMLElement&&_.isConnected&&_.focus(),e==="dismiss"&&z(n.onDismiss))}L.onclick=()=>{m()&&g("dismiss")},u.addEventListener("cancel",e=>{e.preventDefault(),m()&&g("dismiss")}),c.onclick=()=>{r&&k(r)};try{if(D.type==="inline")b.append(v);else{let e={sm:420,md:640,lg:900};u.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in D?e[D.size]+"px":"100vw"}`,u.setAttribute("aria-label",y.document.name),u.append(v),b.append(u),m()&&u.showModal()}A=J(Q,{mode:"live",rendererUrl:t.webViewUrl,title:y.document.name,onAction(e,s={}){if(!m())return;let l=t.view,i=l?.document.buttons[e];if(i){if(i.type==="close"){k(async()=>{await n.onAction?.(e),g(n.onAction?"action":"dismiss")});return}if(i.type==="action"){r=async()=>{if(i.action.type==="event"){if(!n.onEvent)throw new w("EVENT_HANDLER_REQUIRED","Provide the event handler");await n.onEvent(i.action.event)}else n.onOpenUrl?await n.onOpenUrl(i.action.url):a.defaultView?.location.assign(i.action.url);await n.onAction?.(e),r=null},k(r);return}if((t.quote||f)&&t.canReselect===!1){r=t.quote?async()=>E(await t.read()):H,k(r);return}if(!l||!q(i.product,s,l.capabilities)){U(new w("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(f&&f.actionId!==e){U(new w("COMMAND_PENDING","Finish the current purchase"));return}f||(f={requestId:crypto.randomUUID(),actionId:e,selection:s},M=!1),k(H)}},onEscape:()=>{m()&&g("dismiss")},onError:e=>U(new Error(e))}),A.update(y.document.screen,y.document.screen.strings.defaultLocale,{capabilities:y.capabilities,serverInput:{bindings:[],answers:{}}}),await A.ready}catch(e){throw g(),e}return{check:h,host:{setSuspended(e){G=e,v.hidden=e,e&&u.open?u.close():!e&&!d&&D.type!=="inline"&&!u.open&&u.showModal()},destroy:g,refresh:async()=>{if(!m()){if(t.view)return t.view;throw new w("PRECONDITION_FAILED","Paywall presentation is suspended")}let e=await t.refresh();return d||A?.updateCapabilities(e.capabilities),e}}}}export{ie as showPaywall};
@@ -1 +0,0 @@
1
- import{$ as Xa,$a as Xb,$b as Cd,$c as Ge,$d as kh,$e as ki,$f as wj,$g as Ck,$h as Cl,$i as Cm,$j as Dn,A as Q,Aa as wb,Ab as Lc,Ac as fe,Ad as nf,Ae as Lh,Af as Ri,Ag as Xj,Ah as bl,Ai as bm,Aj as bn,Ak as co,B as R,Ba as xb,Bb as Mc,Bc as ge,Bd as of,Be as Mh,Bf as Si,Bg as Yj,Bh as cl,Bi as cm,Bj as cn,Bk as lo,C as S,Ca as yb,Cb as Nc,Cc as he,Cd as pf,Ce as Nh,Cf as Ti,Cg as Zj,Ch as dl,Ci as dm,Cj as dn,Ck as mo,D as T,Da as zb,Db as Oc,Dc as ie,Dd as qf,De as Oh,Df as Ui,Dg as _j,Dh as el,Di as em,Dj as en,Dk as no,E as U,Ea as Ab,Eb as Pc,Ec as je,Ed as rf,Ee as Ph,Ef as Vi,Eg as $j,Eh as fl,Ei as fm,Ej as fn,Ek as oo,F as V,Fa as Bb,Fb as Qc,Fc as ke,Fd as uf,Fe as Qh,Ff as Wi,Fg as ak,Fh as gl,Fi as gm,Fj as gn,Fk as po,G as W,Ga as Cb,Gb as Rc,Gc as le,Gd as vf,Ge as Rh,Gf as Xi,Gg as bk,Gh as hl,Gi as hm,Gj as hn,Gk as qo,H as Z,Ha as Db,Hb as Sc,Hc as me,Hd as Sg,He as Sh,Hf as Yi,Hg as ck,Hh as il,Hi as im,Hj as jn,Hk as ro,I as _,Ia as Eb,Ib as Tc,Ic as ne,Id as Tg,Ie as Th,If as Zi,Ig as dk,Ih as jl,Ii as jm,Ij as kn,Ik as so,J as $,Ja as Fb,Jb as ad,Jc as oe,Jd as Ug,Je as Uh,Jf as _i,Jg as ek,Jh as kl,Ji as km,Jj as ln,Jk as to,K as aa,Ka as Gb,Kb as bd,Kc as pe,Kd as Vg,Ke as Vh,Kf as $i,Kg as fk,Kh as ll,Ki as lm,Kj as mn,Kk as uo,L as ba,La as Hb,Lb as cd,Lc as qe,Ld as Wg,Le as Wh,Lf as aj,Lg as gk,Lh as ml,Li as mm,Lj as nn,Lk as vo,M as ca,Ma as Ib,Mb as dd,Mc as re,Md as Xg,Me as Xh,Mf as bj,Mg as hk,Mh as nl,Mi as nm,Mj as on,Mk as wo,N as da,Na as Jb,Nb as ed,Nc as se,Nd as Yg,Ne as Yh,Nf as cj,Ng as ik,Nh as ol,Ni as om,Nj as pn,Nk as xo,O as ea,Oa as Kb,Ob as fd,Oc as te,Od as Zg,Oe as Zh,Of as dj,Og as jk,Oh as pl,Oi as pm,Oj as qn,Ok as yo,P as fa,Pa as Lb,Pb as gd,Pc as ue,Pd as _g,Pe as _h,Pf as ej,Pg as kk,Ph as ql,Pi as qm,Pj as rn,Pk as zo,Q as ga,Qa as Mb,Qb as hd,Qc as ve,Qd as $g,Qe as $h,Qf as fj,Qg as rk,Qh as rl,Qi as rm,Qj as sn,Qk as Ao,R as ha,Ra as Nb,Rb as id,Rc as we,Rd as ah,Re as ai,Rf as gj,Rg as sk,Rh as sl,Ri as sm,Rj as tn,Rk as Bo,S as ia,Sa as Ob,Sb as jd,Sc as xe,Sd as bh,Se as bi,Sf as hj,Sg as tk,Sh as tl,Si as tm,Sj as un,Sk as Co,T as ja,Ta as Pb,Tb as kd,Tc as ye,Td as ch,Te as ci,Tf as ij,Tg as uk,Th as ul,Ti as um,Tj as vn,Tk as Do,U as ka,Ua as Qb,Ub as ld,Uc as ze,Ud as dh,Ue as di,Uf as jj,Ug as vk,Uh as vl,Ui as vm,Uj as wn,Uk as Eo,V as Ra,Va as Rb,Vb as md,Vc as Ae,Vd as eh,Ve as ei,Vf as kj,Vg as wk,Vh as wl,Vi as wm,Vj as xn,Vk as Fo,W as Sa,Wa as Sb,Wb as nd,Wc as Be,Wd as fh,We as fi,Wf as lj,Wg as xk,Wh as xl,Wi as xm,Wj as yn,Wk as Go,X as Ta,Xa as Tb,Xb as yd,Xc as Ce,Xd as gh,Xe as gi,Xf as sj,Xg as yk,Xh as yl,Xi as ym,Xj as zn,Xk as Ho,Y as Ua,Ya as Ub,Yb as zd,Yc as De,Yd as hh,Ye as hi,Yf as tj,Yg as zk,Yh as zl,Yi as zm,Yj as An,Yk as Io,Z as Va,Za as Vb,Zb as Ad,Zc as Ee,Zd as ih,Ze as ii,Zf as uj,Zg as Ak,Zh as Al,Zi as Am,Zj as Bn,_ as Wa,_a as Wb,_b as Bd,_c as Fe,_d as jh,_e as ji,_f as vj,_g as Bk,_h as Bl,_i as Bm,_j as Cn,a,aa as Ya,ab as Yb,ac as Dd,ad as He,ae as lh,af as li,ag as xj,ah as Dk,ai as Dl,aj as Dm,ak as En,b,ba as Za,bb as Zb,bc as Id,bd as Ie,be as mh,bf as mi,bg as yj,bh as Ek,bi as El,bj as Em,bk as Fn,c,ca as _a,cb as _b,cc as Jd,cd as Je,ce as nh,cf as ni,cg as zj,ch as Fk,ci as Fl,cj as Fm,ck as Gn,d,da as $a,db as $b,dc as Kd,dd as Ke,de as oh,df as oi,dg as Aj,dh as Gk,di as Gl,dj as Gm,dk as Hn,e,ea as ab,eb as ac,ec as Ld,ed as Le,ee as ph,ef as pi,eg as Bj,eh as Hk,ei as Hl,ej as Hm,ek as In,f,fa as bb,fb as bc,fc as Md,fd as Me,fe as qh,ff as qi,fg as Cj,fh as Ik,fi as Il,fj as Im,fk as Jn,g,ga as cb,gb as cc,gc as Nd,gd as Ne,ge as rh,gf as ri,gg as Dj,gh as Jk,gi as Jl,gj as Jm,gk as Kn,h,ha as db,hb as dc,hc as Od,hd as Oe,he as sh,hf as si,hg as Ej,hh as Kk,hi as Kl,hj as Km,hk as Ln,i,ia as eb,ib as ec,ic as Pd,id as Pe,ie as th,if as ti,ig as Fj,ih as Lk,ii as Ll,ij as Lm,ik as Mn,j,ja as fb,jb as fc,jc as Qd,jd as Xe,je as uh,jf as ui,jg as Gj,jh as Mk,ji as Ml,jj as Mm,jk as Nn,k,ka as gb,kb as vc,kc as Rd,kd as Ye,ke as vh,kf as vi,kg as Hj,kh as Nk,ki as Nl,kj as Nm,kk as On,l,la as hb,lb as wc,lc as Sd,ld as Ze,le as wh,lf as wi,lg as Ij,lh as Ok,li as Ol,lj as Om,lk as Pn,m,ma as ib,mb as xc,mc as Td,md as _e,me as xh,mf as xi,mg as Jj,mh as Pk,mi as Pl,mj as Pm,mk as Qn,n,na as jb,nb as yc,nc as Ud,nd as $e,ne as yh,nf as yi,ng as Kj,nh as Qk,ni as Ql,nj as Qm,nk as Rn,o,oa as kb,ob as zc,oc as Vd,od as af,oe as zh,of as zi,og as Lj,oh as Rk,oi as Rl,oj as Rm,ok as Sn,p,pa as lb,pb as Ac,pc as Wd,pd as bf,pe as Ah,pf as Ai,pg as Mj,ph as Sk,pi as Sl,pj as Sm,pk as Tn,q,qa as mb,qb as Bc,qc as Xd,qd as cf,qe as Bh,qf as Bi,qg as Nj,qh as Tk,qi as Tl,qj as Tm,qk as Un,r,ra as nb,rb as Cc,rc as Yd,rd as df,re as Ch,rf as Ci,rg as Oj,rh as Uk,ri as Ul,rj as Um,rk as Vn,s,sa as ob,sb as Dc,sc as Zd,sd as ef,se as Dh,sf as Di,sg as Pj,sh as Vk,si as Vl,sj as Vm,sk as Wn,t as z,ta as pb,tb as Ec,tc as _d,td as ff,te as Eh,tf as Ei,tg as Qj,th as Wk,ti as Wl,tj as Wm,tk as Xn,u as A,ua as qb,ub as Fc,uc as $d,ud as gf,ue as Fh,uf as Fi,ug as Rj,uh as Xk,ui as Xl,uj as Xm,uk as Yn,v as B,va as rb,vb as Gc,vc as ae,vd as hf,ve as Gh,vf as Gi,vg as Sj,vh as Yk,vi as Yl,vj as Ym,vk as Zn,w as C,wa as sb,wb as Hc,wc as be,wd as jf,we as Hh,wf as Hi,wg as Tj,wh as Zk,wi as Zl,wj as Zm,wk as _n,x as D,xa as tb,xb as Ic,xc as ce,xd as kf,xe as Ih,xf as Oi,xg as Uj,xh as _k,xi as _l,xj as _m,xk as $n,y as E,ya as ub,yb as Jc,yc as de,yd as lf,ye as Jh,yf as Pi,yg as Vj,yh as $k,yi as $l,yj as $m,yk as ao,z as P,za as vb,zb as Kc,zc as ee,zd as mf,ze as Kh,zf as Qi,zg as Wj,zh as al,zi as am,zj as an,zk as bo}from"./chunk-VMLGV5OS.js";import{$ as xd,$a as ig,A as lc,Aa as Jf,Ab as Jg,B as mc,Ba as Kf,Bb as Kg,C as nc,Ca as Lf,Cb as Lg,D as oc,Da as Mf,Db as Mg,E as pc,Ea as Nf,Eb as Ng,F as qc,Fa as Of,Fb as Og,G as rc,Ga as Pf,Gb as Pg,H as sc,Ha as Qf,Hb as Qg,I as tc,Ia as Rf,Ib as Rg,J as uc,Ja as Sf,Jb as mj,K as Uc,Ka as Tf,Kb as nj,L as Vc,La as Uf,Lb as oj,M as Wc,Ma as Vf,Mb as pj,N as Xc,Na as Wf,Nb as qj,O as Yc,Oa as Xf,Ob as rj,P as Zc,Pa as Yf,Pb as lk,Q as _c,Qa as Zf,Qb as mk,R as $c,Ra as _f,Rb as nk,S as od,Sa as $f,Sb as ok,T as pd,Ta as ag,Tb as pk,U as qd,Ua as bg,Ub as qk,V as rd,Va as cg,W as sd,Wa as dg,X as td,Xa as eg,Y as ud,Ya as fg,Z as vd,Za as gg,_ as wd,_a as hg,a as t,aa as Ed,ab as jg,b as u,ba as Fd,bb as kg,c as v,ca as Gd,cb as lg,d as w,da as Hd,db as mg,e as x,ea as Qe,eb as ng,f as y,fa as Re,fb as og,g as F,ga as Se,gb as pg,h as G,ha as Te,hb as qg,i as H,ia as Ue,ib as rg,j as I,ja as Ve,jb as sg,k as J,ka as We,kb as tg,l as K,la as sf,lb as ug,m as L,ma as tf,mb as vg,n as M,na as wf,nb as wg,o as N,oa as xf,ob as xg,p as O,pa as yf,pb as yg,q as Ma,qa as zf,qb as zg,r as Na,ra as Af,rb as Ag,s as Oa,sa as Bf,sb as Bg,t as Pa,ta as Cf,tb as Cg,u as Qa,ua as Df,ub as Dg,v as gc,va as Ef,vb as Eg,w as hc,wa as Ff,wb as Fg,x as ic,xa as Gf,xb as Gg,y as jc,ya as Hf,yb as Hg,z as kc,za as If,zb as Ig}from"./chunk-RMJJOSVZ.js";import{a as X,b as Y,c as Ii,d as Ji,e as Ki,f as Li,g as Mi,h as Ni,i as eo,j as fo,k as go,l as ho,m as io,n as jo,o as ko}from"./chunk-OHDY27EI.js";import{A as Ia,B as Ja,C as Ka,D as La,a as la,b as ma,c as na,f as oa,g as pa,h as qa,i as ra,j as sa,l as ta,m as ua,n as va,o as wa,p as xa,q as ya,r as za,s as Aa,t as Ba,u as Ca,v as Da,w as Ea,x as Fa,y as Ga,z as Ha}from"./chunk-S2MSIA57.js";export{Yh as CODE_REFERENCE_LIMITS,Pa as COMMON_LOCALES,lo as CONFIGURATION_POLICY,Ra as COUPON_TERM_LOCALES,Hf as CUSTOMER_DATA_SOURCES,Td as CreateInvoiceParamsSchema,Sd as CreateInvoicePreviewSchema,Vm as DEFAULT_AUDIENCE_GROUP,Bk as DEFAULT_FUNNEL_EXECUTION_POLICY,dl as FUNNEL_API_CAPABILITIES,uj as FUNNEL_EXECUTION_LIMITS,sj as FUNNEL_LIMITS,om as FUNNEL_PREVIEW_LIMITS,Ho as FUNNEL_READ_ONLY_OPERATIONS,vj as FUNNEL_RECORDING_LIMITS,xo as FUNNEL_SEGMENT_BYTES,wo as FUNNEL_SEGMENT_LIMIT,dm as FUNNEL_SERVER_KEY_HEADER,ql as FunnelCalculationError,Qd as InvoiceModeParamsSchema,Rd as InvoiceTemplateSchema,Ze as OFFERING_MAX_DEPTH,$e as OFFERING_MAX_ITEMS,_e as OFFERING_MAX_PRODUCTS,Bg as POPUP_WIDTHS,Pd as ReissueInvoiceParamsSchema,Sf as SCREEN_LIMITS,mj as SCREEN_RENDER_PATH,Rf as SCREEN_SCHEMA_VERSION,zj as SCREEN_TEMPLATES,vc as SDK_PROTOCOL_HEADER,xc as SDK_SUPPORT_HEADER,yc as SDK_SUPPORT_POLICY,wc as SDK_VERSION_HEADER,zg as SURFACE_PATHS,zf as SURFACE_VARIABLES,Ec as SdkProtocolError,tj as UNBOUND_PRODUCT_VERSION_ID,jo as VISUAL_EDITOR_PARAM,Cc as addSupportMonths,j as aiCreditSystemConfigSchema,lh as aiMarkupSchema,kh as aiModelIdSchema,mh as aiModelRatesSchema,nh as aiPricingConfigurationSchema,jh as aiTokenPools,w as amountToMinor,Fi as analyticsConfigSchema,Hi as analyticsEventEnabled,lc as apiErrorCatalog,mc as apiErrorCodeForStatus,gc as apiErrorCodeSchema,kj as apiOperations,dj as apiPermissionSchema,on as appResultsSchema,nn as appRevenueSchema,xn as appendScreenTemplate,Vn as applyGrowthReleasePlan,_j as archiveSurfaceTemplateSchema,Ym as audienceCustomerSchema,fn as audienceFunnelUsageSchema,gn as audienceFunnelUsagesSchema,Zm as audienceMembersSchema,Hc as audienceSchema,Xm as audienceWriteSchema,Qm as auditFieldSchema,Tm as auditHistoryCursorSchema,Um as auditHistorySchema,Pm as auditResourceSchema,qb as autoTopupPurchaseLimitSchema,Cb as autoTopupStateSchema,ao as autumnAmountToMinor,Em as autumnCustomerAutoTopupSchema,Jm as autumnCustomerControlsSchema,Lm as autumnCustomerMetadataSchema,Im as autumnCustomerOverageAllowedSchema,Nm as autumnCustomerProductSummarySchema,Mm as autumnCustomerProfileRecordSchema,Fm as autumnCustomerSpendLimitSchema,Hm as autumnCustomerUsageAlertSchema,Gm as autumnCustomerUsageLimitSchema,Km as autumnEntityControlsSchema,bo as autumnMinorToAmount,co as autumnUsageUnitAmountDecimal,eh as balanceAdjustmentCommandSchema,fh as balanceAdjustmentStateSchema,Yc as balanceAllocationSchema,Vc as balanceCommandSchema,bd as balanceGrantCommandSchema,ad as balanceGrantCreateSchema,ed as balanceGrantPageSchema,dd as balanceGrantReadSchema,cd as balanceGrantSchema,$c as balanceOperationSchema,Wc as balancePricingSegmentSchema,_c as balanceQuoteSchema,Xc as balanceReceiptUnitsSchema,Zc as balanceRejectionReasonSchema,Dn as balanceSourceReasonSchema,gh as balanceSourceStateSchema,En as balanceSourceStatusSchema,Gn as balanceSourcesPageSchema,Fn as balanceSourcesQuerySchema,jb as billingAccruedMinorSchema,ib as billingAmountMinorSchema,tb as billingAuthorizationSchema,sb as billingAuthorizationTermsSchema,kb as billingBudgetMinorSchema,Db as billingControlInputSchema,Eb as billingControlsSchema,Mb as billingCouponsSchema,z as billingCurrencies,Fb as billingInvoiceLineSchema,Gb as billingInvoiceSchema,Jb as billingInvoicesSchema,xb as billingLimitSchema,Wj as billingPortalInputSchema,Xj as billingPortalSchema,D as billingSettingsMutationSchema,B as billingSettingsSchema,C as billingSettingsScopeSchema,Bb as billingUsageWindowSchema,eg as borderSchema,kg as buttonNodeSchema,rl as calculateFunnelNode,Kc as campaignInputSchema,Ic as campaignOfferSchema,Lc as campaignSchema,Na as canonicalLocale,Af as capabilityBindingSchema,ob as cashPriceSchema,mb as cashPricingSchema,lb as cashPricingTiersSchema,hb as cashUnitAmountMinorSchema,Oh as claimRewardProductRequestSchema,$h as codeReferenceBranchSchema,fi as codeReferenceConfigRequestSchema,ei as codeReferenceConfigureSchema,li as codeReferenceFeatureSummarySchema,Zh as codeReferenceKeySchema,ai as codeReferencePathSchema,ii as codeReferenceReceiptSchema,_h as codeReferenceRepoSchema,hi as codeReferenceReportSchema,ci as codeReferenceRepositoryInputSchema,di as codeReferenceRepositorySchema,gi as codeReferenceScanConfigSchema,ji as codeReferenceScanSchema,ki as codeReferenceSettingsSchema,mi as codeReferenceSummarySchema,Gd as commerceAccessSchema,Qe as commerceContextSchema,De as commerceCursorSchema,Ee as commerceListQuerySchema,Hd as commerceMoneySchema,zn as commerceProductKind,Fd as commerceProductKindSchema,Ed as commerceProviderSchema,Ea as compileGrowthFeatures,oo as configurationArtifactSchema,uo as configurationDependencies,no as configurationDependenciesSchema,so as configurationDigest,po as configurationFunnelSchema,to as configurationGeneration,ro as configurationJson,mo as configurationScopeSchema,Hb as confirmBillingAdjustmentInputSchema,vb as confirmBillingAuthorizationInputSchema,ic as consoleErrorCodeSchema,tc as consoleErrorResponseSchema,Zn as consoleHasPermission,ne as consoleRefundRequestSchema,Xn as consoleResources,Yn as consoleRolePermissions,Wn as consoleRoleSchema,rg as countdownNodeSchema,Ya as couponAppliesToSchema,bb as couponChangeErrors,qg as couponCodeNodeSchema,tl as couponContentDigestSchema,Wa as couponDiscountSchema,_m as couponDisplaySchema,Ej as couponDistributionBatchSchema,Gj as couponDistributionDetailSchema,Dj as couponDistributionPreviewSchema,Fj as couponDistributionRecipientSchema,Hj as couponDistributionWriteSchema,Xa as couponDurationSchema,Za as couponEligibilitySchema,_a as couponInputSchema,Di as couponRedemptionCommandSchema,Ei as couponRedemptionReceiptSchema,Va as couponStatusSchema,Dm as couponTemplateExample,Bm as couponTemplateKey,eb as couponWindow,bn as createAccountOverviewPage,an as createCreditCenterPage,dn as createCustomerPageTemplates,gj as createCustomerRequestSchema,hj as createCustomerResponseSchema,cn as createMembershipPage,Qh as createReferralCodeRequestSchema,F as creditAmountSchema,qh as creditAnalyticsFilterSchema,sh as creditAnalyticsPageSchema,rh as creditAnalyticsQuerySchema,oh as creditAnalyticsRangeSchema,ph as creditAnalyticsTimezoneSchema,L as creditDimensionSchema,M as creditMultiplierSchema,H as creditPriceAdjustmentSchema,N as creditPricingSchema,J as creditPropertiesSchema,G as creditQuantitySchema,O as creditRateSchema,Ob as creditResetCountSchema,Nb as creditResetSchema,I as creditResourceKeySchema,Pb as creditRolloverSchema,c as creditSchemaItemSchema,id as creditStatementInputSchema,jd as creditStatementSchema,i as creditSystemConfigSchema,K as creditTiersSchema,t as currencies,A as currencyAmountOptionsSchema,v as currencyDecimals,u as currencySchema,lj as currentApiOperations,kd as currentNotificationEventTypeSchema,og as customHtmlNodeSchema,ka as customerActivitySchema,oi as customerAttributesSchema,Wm as customerAudienceSchema,Jf as customerDataConfigSchema,Mf as customerDataIntentSchema,mg as customerDataNodeSchema,ui as customerDataReferenceMessage,ti as customerDataReferenced,si as customerDataSchema,If as customerDataSourceSchema,jj as customerEntitlementsSchema,Bi as customerFiltersSchema,pi as customerFingerprintSchema,pn as customerFunnelDecisionsSchema,zi as customerGetSchema,sd as customerHoldingsSchema,qi as customerInputSchema,wd as customerLedgerEntrySchema,xd as customerLedgerPageSchema,vd as customerLedgerQuerySchema,xi as customerLookupSchema,wi as customerMutationSchema,Lf as customerPageDataSchema,Kf as customerPageNodeStateSchema,Om as customerPageSampleData,Ci as customerPageSchema,yi as customerPatchSchema,ec as customerPlanCreateSchema,fc as customerPlanCreatedSchema,ja as customerPlanSchema,vi as customerProfileSchema,ri as customerReferenceSchema,Vj as customerScheduledChangeCancelSchema,Tj as customerScheduledChangeSchema,Uj as customerScheduledChangesSchema,Mc as customerSchema,ni as customerTagsSchema,Ai as customerUpdateRequestSchema,bi as defaultCodeReferenceMethods,yj as defaultScreenTheme,cb as describeCoupon,_b as diffProductVariant,lg as dividerNodeSchema,Nf as emptyCustomerPageNode,Se as entitlementCheckInputSchema,Te as entitlementCheckReasonSchema,Ve as entitlementCheckResultSchema,Re as entitlementRequirementSchema,ga as entitlementSnapshotSchema,ij as entitlementStatusSchema,X as environmentSchema,Cd as environmentSettingsSchema,oc as errorCodeMatchesStatus,uc as errorMetadata,qc as errorMetadataSchema,nc as errorPolicy,kc as errorReasonSchema,jc as errorRecoverySchema,rc as errorResponseSchema,Pf as escapeHtmlText,pa as evalCondition,sa as evalFeature,Qi as evaluateFeaturesRequestSchema,Si as evaluateFeaturesResultSchema,am as executionSourceSchema,Fo as expandFunnelSegment,Da as experimentConfigurationSchema,Ca as experimentPhaseSchema,Ha as experimentSnapshotSchema,n as featureCollectionSchema,g as featureConfigOverrideSchema,k as featureDefinitionSchema,Oi as featureDeliveryPayloadSchema,a as featureIdSchema,$ as featureInputSchema,f as featureMarkupsOverrideSchema,o as featureOptionsSchema,Ni as featurePayloadSchema,m as featureRecordSchema,aa as featureSchema,_n as featureTypes,$n as featureUpdateBlockers,l as featureUpdateRulesSchema,od as featureUsageReadSchema,pd as featureUsageSetSchema,qd as featureUsageStateSchema,b as featureUsageTypeSchema,p as featureWriteSchema,Hg as fieldValue,cg as fillSchema,rd as financialAmountSchema,ud as financialCursorSchema,td as financialEntryTypeSchema,Pg as findDocumentNode,Og as findNode,Am as formatCouponConditions,Ta as formatCouponDiscount,Sa as formatCouponMoney,Ua as formatCouponTerms,y as formatCurrencyMinor,Cn as formatProductBillingPeriod,db as formatUsd,el as funnelApiBindingSchema,bl as funnelApiProjectionSchema,Wk as funnelBundleDefinitionSchema,_k as funnelBundleLiterals,Zk as funnelBundleResultSchema,Xk as funnelBundleSelectionSchema,gm as funnelCampaignCommandSchema,hm as funnelCampaignStartResponseSchema,fl as funnelCapabilitySchema,Xl as funnelCollectionSchema,Ul as funnelCommandSchema,jm as funnelConfigurationSchema,Cl as funnelConsumedVariables,Eo as funnelContextDelta,em as funnelCredentialCommandSchema,fm as funnelCredentialResponseSchema,Tl as funnelDataQueriesSchema,Sk as funnelDecideShape,Tk as funnelDecisionCommandSchema,Mk as funnelDecisionEvaluationSchema,Qk as funnelDecisionOutputSchema,Uk as funnelDecisionResponseSchema,Rk as funnelDecisionSchema,Pk as funnelDecisionSegmentEvaluationSchema,Vk as funnelDecisionUsedResponseSchema,Ll as funnelDocumentDraftSchema,Pl as funnelDocumentSchema,ik as funnelEvaluationAttributes,Lk as funnelEvaluationInstructionSchema,Jk as funnelEvaluationModeSchema,Kk as funnelEvaluationResultSchema,Ak as funnelExecutionPolicySchema,Il as funnelExecutionStateSchema,hl as funnelExternalPageUrlSchema,zk as funnelExternalTaskSchema,kl as funnelGraphDraftSchema,jl as funnelGraphNodeSchema,ll as funnelGraphSchema,ml as funnelGraphTargets,en as funnelGroupReferenceSchema,$l as funnelInstructionSchema,sl as funnelInvocationId,km as funnelLocalConfigurationSchema,vl as funnelLocalScreenCommandSchema,wl as funnelLocalScreenResponseSchema,Ok as funnelLocalSegmentStepSchema,Io as funnelNodeAcceptsEffect,Gl as funnelNodeInputSchema,El as funnelNodeKindSchema,fk as funnelNodeProjections,Hl as funnelNodeResultSchema,ck as funnelNodeWritesSchema,il as funnelOpenInSchema,Fk as funnelOrchestrationCommandSchema,ok as funnelParametersFromUrl,Sl as funnelPresentationSubmissionSchema,pm as funnelPreviewCommandSchema,sm as funnelPreviewDependencySchema,tm as funnelPreviewJournalSchema,qm as funnelPreviewOutcomeSchema,vm as funnelPreviewRequestSchema,wm as funnelPreviewResponseSchema,rm as funnelPreviewScenarioSchema,ym as funnelPreviewShareWriteSchema,xm as funnelPreviewSnapshotSchema,um as funnelPreviewSourceSchema,$k as funnelProjectionFilterValueSchema,al as funnelProjectionWhereSchema,Rl as funnelPublicationDraftSchema,Nl as funnelPublicationRules,Ql as funnelPublicationSchema,Ol as funnelPublishableDraftSchema,yo as funnelPureNode,Wl as funnelRecordSchema,Fl as funnelResourceReferenceSchema,hn as funnelResultsCursorSchema,jn as funnelResultsQuerySchema,Ik as funnelResultsResponseSchema,kn as funnelResultsSchema,bm as funnelRunViewSchema,cm as funnelRuntimeResponseSchema,_l as funnelRuntimeStatusSchema,zl as funnelScreenReads,yl as funnelScreenTokens,Al as funnelScreenValues,Go as funnelSegmentConfigurationSchema,Nk as funnelSegmentEvaluationInstructionSchema,Do as funnelSegmentHasDynamicHash,zo as funnelSegmentPositionSchema,Bo as funnelSegmentSchema,Ao as funnelSegmentStepSchema,Gk as funnelSignalResponseSchema,zm as funnelStatisticsSchema,Co as funnelStepId,yk as funnelTaskBindingSchema,wk as funnelTaskDataSchema,xk as funnelTaskOutputsSchema,Ck as funnelTaskResponseSchema,Hk as funnelTaskResultsSchema,wn as funnelTemplateDraft,un as funnelTemplateSchema,lm as funnelTopology,im as funnelTopologySchema,Jl as funnelTraceEventSchema,sk as funnelValueBindingSchema,$j as funnelValueDeclarationSchema,dk as funnelValueMatches,rk as funnelValuePathSchema,hk as funnelValueSchema,ak as funnelVariableDeclarationSchema,bk as funnelVariableDeclarationsSchema,xl as funnelVariableRead,ek as funnelVariableValues,wj as funnelVisitAllowed,Dl as funnelWaitKindSchema,Yl as funnelWriteSchema,Ji as gbRuntimeExperimentResultSchema,Ii as gbRuntimeExperimentSchema,Ki as gbRuntimeFeatureRuleSchema,Li as gbRuntimeFeatureSchema,Mi as gbRuntimeSavedGroupsSchema,la as getQueryStringOverride,Un as getRecommendedRolloutData,qa as getStickyBucketAttributes,Mn as growthAttributeSchema,ua as growthAttributesSchema,On as growthCatalogSchema,xa as growthConditionGroupIds,kk as growthConditionPaths,va as growthConditionSchema,Qn as growthDryRunSchema,Rn as growthExperimentInspectionSchema,Fa as growthExperimentStop,Ga as growthFeatureExpiry,za as growthFeatureRuleSchema,Aa as growthFeatureSchema,Ba as growthFeaturesSchema,Sn as growthGroupReferenceCursorSchema,Tn as growthGroupReferencesSchema,wa as growthGroupSchema,Nn as growthNamespaceSchema,Pn as growthResourceWriteSchema,Ka as growthRuleContextSchema,ya as growthSavedGroupsSchema,Ia as growthSnapshotSchema,La as growthSplitResultSchema,Of as htmlVariableErrors,Uf as identifierSchema,jg as imageNodeSchema,bg as imagePositionSchema,$f as insetsSchema,Zi as invoiceCommandSchema,fd as invoiceDetailInputSchema,hd as invoiceDetailSchema,aj as invoiceOperationSchema,gd as invoiceProductItemSchema,me as invoiceRefundsSchema,Yi as invoiceTemplateCommandSchema,Xi as invoiceTemplatePageSchema,Vi as invoiceTemplateValuesSchema,pb as isInvoiceCreditPrice,wf as isProductGroup,yn as isRecurringMembership,Qg as isRtlLocale,Bc as isStableSdkProtocol,na as isURLTargeted,nb as itemBillingCycleSchema,xj as jsonStorageBytes,ta as jsonValueSchema,E as licenseOfferSchema,Ib as listBillingInvoicesInputSchema,Qa as localeLabel,Ma as localeSchema,Ig as localeStatuses,Ng as localizeScreen,zb as manageBillingLimitsInputSchema,yb as manageOveragePolicyInputSchema,$i as managedInvoiceDetailSchema,bj as managedInvoicePageSchema,_i as managedInvoiceSchema,Wi as managedInvoiceTemplateSchema,hc as managementErrorCodeSchema,sc as managementErrorResponseSchema,ag as marginSchema,Oa as matchLocale,jk as matchesGrowthCondition,T as membershipActionSchema,An as membershipBillingCount,U as membershipChangeSchema,V as membershipHoldingSchema,R as membershipRulesSchema,W as membershipStateSchema,S as membershipTimingSchema,Rm as mergeAuditSchema,_ as metadataSchema,h as meteredConfigSchema,x as minorToAmount,e as modelMarkupsSchema,rn as nativeCompletionSchema,Id as nativeCouponStoreOfferLinkWriteSchema,Jd as nativeCouponStoreOfferLinksSchema,Rc as nativeProductBindingSchema,Tc as nativeProductBindingWriteSchema,Sc as nativeProductBindingsPageSchema,qn as nativeProofSchema,Od as nativePurchaseInstructionSchema,sn as nativeReceiptCommandSchema,tn as nativeReceiptResponseSchema,Oe as nativeRestoreCommandSchema,Pe as nativeRestoreResultSchema,Md as nativeStoreOfferForProduct,Kd as nativeStoreOfferSelectionSchema,Ld as nativeStoreOfferSelectionsSchema,Nd as nativeStoreSelectionMatches,ee as nativeSubscriptionUpdatePreviewSchema,fe as nativeSubscriptionUpdateResultSchema,Cj as newBlankSurface,ab as newCouponInput,Gi as newEnvironmentAnalyticsConfig,Zl as newFunnelDocument,Aj as newScreenFromTemplate,Bj as newSurfaceFromTemplate,Tf as nodeIdSchema,Sm as objectAuditSchema,Ml as offerCopyUnscoped,ln as offerFlowInputSchema,mn as offerFlowResultSchema,fb as offerSchema,gb as offerUnavailableReasonSchema,ff as offeringAuthorSchema,kf as offeringCollectionSchema,ef as offeringDocumentSchema,af as offeringItemSchema,bf as offeringItemsSchema,Ye as offeringMetadataSchema,gf as offeringProductEvidenceSchema,Xe as offeringProductIdSchema,cf as offeringProductIds,of as offeringProductOptionSchema,df as offeringProductPaths,qf as offeringPublicationIssues,hf as offeringRecordSchema,nf as offeringSelectorSchema,rf as offeringValueSchema,jf as offeringVersionSchema,pf as offeringWorkspaceSchema,mf as offeringWriteResultSchema,lf as offeringWriteSchema,Uc as overageBehaviorSchema,Ab as overagePolicySchema,Kl as ownedFunnelScreenSchema,Jn as pageExperimentEventSchema,Kn as pageExperimentEventsRequestSchema,Ln as pageExperimentEventsResponseSchema,In as pageExperimentPayloadSchema,Hn as pageExperimentSchema,Zf as paintColorSchema,vo as parsePublicFunnel,pc as parseRetryAfter,qj as parseScreenRenderPath,xe as paymentSetupCommandSchema,ye as paymentSetupReadSchema,Ae as paymentSetupSchema,Ue as paywallCandidateSchema,Ug as paywallClientActionSchema,_g as paywallCollectionSchema,Vg as paywallDocumentDraftSchema,Wg as paywallDocumentSchema,Yg as paywallFlowIssues,bh as paywallLibrarySchema,Xg as paywallProductIssues,uf as paywallProductsSchema,Zg as paywallRecordSchema,We as paywallRequestSchema,dh as paywallResolutionSchema,ch as paywallResolveInputSchema,$g as paywallSummarySchema,ah as paywallWriteSchema,da as planConfigSchema,ea as planInputSchema,ca as planItemSchema,sg as planPickerNodeSchema,fa as planSchema,ha as planVersionSchema,Jc as popupSchema,dc as prepaidAllowanceAmount,r as prepaidPriceAmount,s as prepaidQuantityAmount,Nc as prepaidQuantitySchema,q as prepaidTierPricingSchema,rb as prepareBillingAuthorizationInputSchema,Cm as prepareCouponTemplate,oa as prepareSavedGroups,ub as preparedBillingAuthorizationSchema,Ag as presentationSchema,pg as priceNodeSchema,ba as priceSchema,Sb as productAllowanceSchema,Oc as productBindingSchema,Qc as productBindingWriteSchema,Pc as productBindingsPageSchema,bc as productCollectionSchema,Vb as productConfigurationSchema,Yb as productDefinitionSchema,cc as productEditorOptionsSchema,tf as productGroupingMatches,sf as productGroupingSchema,Ub as productLicenseSchema,Ij as productMigrationBlockReasonSchema,Pj as productMigrationDetailSchema,Jj as productMigrationErrorCodeSchema,Oj as productMigrationItemSchema,Mj as productMigrationItemStatusSchema,Qj as productMigrationListSchema,Kj as productMigrationPreviewSchema,Sj as productMigrationQuerySchema,Lj as productMigrationRunStatusSchema,Nj as productMigrationSchema,Rj as productMigrationWriteSchema,$b as productOptionsSchema,Rb as productPrepaidPriceSchema,Qb as productPricesSchema,ac as productRecordSchema,Sg as productSelectionSchema,Tb as productTrialSchema,Wb as productVariantOverridesSchema,Xb as productVariantSchema,cl as projectFunnelApiOutputs,mm as projectFunnelConfiguration,nm as projectFunnelLocalConfiguration,Bd as projectSettingsSchema,$a as promotionCodeInputSchema,Ac as protocolForSdkVersion,d as providerMarkupsSchema,ul as publicCouponScreenDataSchema,Pi as publicFeatureConfigurationSchema,Jg as publishChecks,Ge as purchaseListItemSchema,Me as purchaseListPageSchema,Wf as radiusSchema,tk as readFunnelValuePath,Nh as redeemRewardRequestSchema,Rh as referralCodeSchema,Th as referralProgramCollectionSchema,Gh as referralProgramInputSchema,Ih as referralProgramRecordSchema,Lh as referralProgramWriteSchema,Ri as remoteFeatureResultSchema,Bl as renameFunnelScreenVariable,Dg as replaceFirstPageRoot,$m as resolveCouponDisplay,Yk as resolveFunnelBundle,gl as resolveFunnelCapabilityInputs,Ek as resolveFunnelTaskInputs,uk as resolveFunnelValueBinding,vk as resolveFunnelValueBindings,Zb as resolveProductVariant,Mg as resolveScreenLocale,Fc as resolveSdkProtocol,fj as responseMetaSchema,wb as revokeBillingAuthorizationInputSchema,Vh as rewardActivityRedemptionSchema,Wh as rewardActivitySchema,Fh as rewardCodeInputSchema,Uh as rewardCodeSchema,Xh as rewardCodeWriteSchema,Sh as rewardCollectionSchema,Ch as rewardConfigurationSchema,Ah as rewardGrantExpirySchema,Bh as rewardGrantSchema,Eh as rewardInputSchema,Dh as rewardKeySchema,Jh as rewardOptionSchema,Ph as rewardProductCheckoutSchema,Hh as rewardRecordSchema,Mh as rewardRedemptionSchema,zh as rewardStatusSchema,yh as rewardTypeSchema,Kh as rewardWriteSchema,ra as runExperiment,Bn as sameMembershipBillingCycle,Zj as saveSurfaceTemplateSchema,Y as scopeSchema,wg as screenActionSchema,mk as screenAnswersSchema,lk as screenDataCursorSchema,Eg as screenDocumentSchema,Xf as screenImageSourceSchema,pk as screenInputBindingsSchema,vg as screenNodeSchema,nk as screenParametersSchema,Tg as screenPresentationSchema,xf as screenProductScopes,yf as screenProductSelections,pj as screenRenderPath,nj as screenRenderPathSchema,rj as screenRenderTags,oj as screenRenderUrlSchema,qk as screenRendererInputSchema,Rg as screenSelections,xg as screenStringsSchema,qo as sdkConfigurationManifestSchema,zc as sdkProtocolRegistry,Gc as sdkProtocolResponseHeaders,zd as seatCommandSchema,yd as seatReadSchema,Ad as seatsStateSchema,ol as selectFunnelCondition,vf as selectedPaywallProduct,Gf as selectedSurfaceValue,Lg as servableLocales,Lb as setBillingCouponsInputSchema,fg as shadowSchema,dg as shapeSchema,_f as sizeSchema,Vf as spaceSchema,ng as spacerNodeSchema,Z as stableKeySchema,tg as stackInteractionSchema,ug as stackNodeSchema,Ja as stickyAssignmentDocumentSchema,Xd as stripeAppendContextSchema,Wd as stripeCouponTermsSchema,Yd as stripePurchaseExecutionSchema,je as stripeRefundExecutionSchema,ze as stripeSetupExecutionSchema,be as stripeSubscriptionUpdateExecutionSchema,ce as stripeSubscriptionUpdatePreviewSchema,de as stripeSubscriptionUpdateResultSchema,ue as stripeTrialExecutionSchema,hg as styleSchema,Ud as subscriptionAttachCommandSchema,Zd as subscriptionAttachQuoteSchema,oe as subscriptionBatchCommandSchema,qe as subscriptionBatchGroupSchema,pe as subscriptionBatchReadSchema,re as subscriptionBatchSchema,$d as subscriptionCarryOptionsSchema,Ne as subscriptionConflictPageSchema,Ie as subscriptionConflictQuerySchema,Ke as subscriptionConflictRetryResultSchema,Je as subscriptionConflictRetrySchema,He as subscriptionConflictSchema,Kb as subscriptionCouponExecutionSchema,cj as subscriptionInvoiceModeSchema,Fe as subscriptionListItemSchema,Le as subscriptionListPageSchema,Vd as subscriptionOperationInputSchema,_d as subscriptionOperationSchema,ie as subscriptionRefundCommandSchema,ke as subscriptionRefundPreviewSchema,le as subscriptionRefundResultSchema,se as subscriptionTrialCommandSchema,we as subscriptionTrialPolicySchema,te as subscriptionTrialReadSchema,ve as subscriptionTrialResultSchema,ae as subscriptionUpdateCommandSchema,ge as subscriptionUpdatePreviewSchema,he as subscriptionUpdateResultSchema,Be as subscriptionVerificationInputSchema,Ce as subscriptionVerificationSchema,Qf as substituteHtmlVariables,Ff as substituteSurfaceVariables,Cf as surfaceDataSchema,yg as surfaceSchema,Yj as surfaceTemplateSchema,Bf as surfaceValueSchema,Df as surfaceVariableNames,Kg as templateChecks,vn as templateScreen,ig as textNodeSchema,gg as textStyleSchema,Yf as themeSchema,ma as toAttributeString,Ti as trackEventsRequestSchema,Ui as trackEventsResultSchema,pl as transitionFunnelGraph,Gg as translatableFields,P as trialPolicySchema,Q as trialRecordSchema,Ef as unknownSurfaceVariables,md as usageAlertNotificationDataSchema,nd as usageAllowanceNotificationDataSchema,uh as usageAnalyticsPageSchema,th as usageAnalyticsQuerySchema,xh as usageBatchPageSchema,wh as usageBatchReadSchema,vh as usageBatchSubmitSchema,hh as usageEntityCommandSchema,ih as usageEntitySchema,ld as usageLimitNotificationDataSchema,nl as validateFunnelGraph,gk as validateFunnelProjections,Dk as validateFunnelTaskData,Vl as validateScreenAnswers,Dc as validateSdkProtocolRegistry,ia as validitySchema,ej as verifiedPrincipalSchema,fo as visualChangeSchema,io as visualExperimentPayloadSchema,ho as visualExperimentSchema,eo as visualMutationSchema,ko as visualSelectedElementSchema,go as visualVariationSchema,Cg as walkDocument,Fg as walkScreen,Dd as workspaceSettingsSchema};
@@ -1 +0,0 @@
1
- import{a as y,c as w}from"./chunk-BIFEEVQO.js";function f(r){return CSS.escape(r)}function b(r){for(let t of["id","data-indiana-id","data-testid"]){let a=r.getAttribute(t);if(!a)continue;let s=t==="id"?`#${f(a)}`:`[${t}="${f(a)}"]`;if(document.querySelectorAll(s).length===1)return s}let c=[];for(let t=r;t&&t!==document.documentElement;t=t.parentElement){let a=t.tagName.toLowerCase(),s=[...t.classList].filter(o=>o.length<80).slice(0,3);s.length&&(a+=s.map(o=>`.${f(o)}`).join(""));let m=t.parentElement?[...t.parentElement.children].filter(o=>o.tagName===t.tagName):[];m.length>1&&(a+=`:nth-of-type(${m.indexOf(t)+1})`),c.unshift(a);let d=c.join(" > ");if(document.querySelectorAll(d).length===1)return d}return c.join(" > ")}function L(r,c={}){let t=window.opener;if(!t||r.expiresAt<=Date.now())return()=>{};let a=!1,s=!1,m=!1,d,o=document.createElement("div");o.setAttribute("data-indiana-editor-highlight",""),o.style.cssText="position:fixed;pointer-events:none;z-index:2147483647;outline:2px solid #6655ee;background:rgba(102,85,238,.1);display:none",document.body.append(o);function l(n,e={}){t.postMessage({channel:"indiana-visual",nonce:r.nonce,type:n,...e},r.origin)}let g=n=>n.composedPath().find(e=>e instanceof Element&&e!==o),h=n=>{if(!s)return;let e=g(n);if(!e)return;let i=e.getBoundingClientRect();Object.assign(o.style,{display:"block",left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`})},E=n=>{if(!s)return;let e=g(n);if(!e)return;n.preventDefault(),n.stopImmediatePropagation(),s=!1,o.style.display="none";let i=b(e),u={selector:i,tag:e.tagName.toLowerCase(),text:(e.textContent??"").slice(0,1e3),href:e.getAttribute("href")??"",src:e.getAttribute("src")??"",matches:document.querySelectorAll(i).length};l("selected",{element:u})};function p(){m||(m=!0,d?.revert(),o.remove(),clearInterval(x),removeEventListener("message",v),removeEventListener("mousemove",h,!0),removeEventListener("click",E,!0),removeEventListener("pagehide",p))}function v(n){if(n.source!==t||n.origin!==r.origin||!n.data||typeof n.data!="object"||!("channel"in n.data)||!("nonce"in n.data)||n.data.channel!=="indiana-visual"||n.data.nonce!==r.nonce||r.expiresAt<=Date.now())return;let e=n.data;if(e.type==="connect"&&(a=!0,l("connected")),!!a){if(e.type==="disconnect"){p();return}if(e.type==="pick"&&(s=!0),e.type==="preview")try{let i=y(e.value);d?.revert(),d=w(i,{allowJs:c.allowJs===!0&&e.allowJs,nonce:c.nonce,onError:u=>l("error",{message:String(u)})}),l("previewed",{matches:i.domMutations.map(u=>({selector:u.selector,count:document.querySelectorAll(u.selector).length}))})}catch(i){l("error",{message:String(i)})}}}addEventListener("message",v),addEventListener("mousemove",h,!0),addEventListener("click",E,!0),addEventListener("pagehide",p);let x=setInterval(()=>{if(t.closed||r.expiresAt<=Date.now()){p();return}a||l("ready")},500);return l("ready"),p}export{L as startVisualEditorAgent,b as visualElementSelector};