@tinkerlandai/indiana-react-native 0.9.2 → 0.10.1
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/IndianaReactNative.podspec +19 -0
- package/README.md +62 -5
- package/THIRD_PARTY_NOTICES.md +74 -0
- package/android/build.gradle +24 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/ai/tinkerland/indiana/reactnative/IndianaBridgeModule.kt +237 -0
- package/android/src/main/java/ai/tinkerland/indiana/reactnative/IndianaBridgePackage.kt +11 -0
- package/dist/index.cjs +17 -1
- package/dist/index.d.cts +96889 -6007
- package/dist/index.d.ts +96889 -6007
- package/dist/index.js +17 -1
- package/ios/IndianaBridge.m +11 -0
- package/ios/IndianaBridge.swift +275 -0
- package/native-sdk/android/assets/indiana/index.html +268 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/BillingAuthorizationTerms.kt +55 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/BundledWebView.kt +90 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/ContentSession.kt +45 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/ContentView.kt +36 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/CustomerOperations.generated.kt +84 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/CustomerResponseSemantics.kt +197 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/CustomerSemantics.kt +120 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/CustomerSession.kt +106 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/FeatureClient.kt +65 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/FunnelCommandStorage.kt +163 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/FunnelConfigurationRelay.kt +50 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/FunnelSession.kt +208 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/FunnelView.kt +71 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/GeneratedProtocol.kt +16 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/GoogleStorefront.kt +165 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/HTTPTransport.kt +43 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/IndianaClient.kt +526 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/MerchantCommerceSemantics.kt +38 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/NativePendingKeystore.kt +81 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/NativeReceiptRelay.kt +28 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/NativeStoreOffer.kt +24 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/PaywallContent.kt +75 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/PaywallSession.kt +144 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/PaywallView.kt +74 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/Protocol.kt +28 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/PushInstallation.kt +170 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/RendererNavigation.kt +13 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/SDKVersion.kt +6 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/StoreSubscriptionManagement.kt +19 -0
- package/native-sdk/android/java/ai/tinkerland/indiana/WireSchema.kt +76 -0
- package/native-sdk/android/resources/funnel-wire-schemas.json +1 -0
- package/native-sdk/android/resources/indiana-third-party-notices.txt +101 -0
- package/native-sdk/android/resources/renderer-data-url.txt +1 -0
- package/native-sdk/ios/AnalyticsReceipt.swift +10 -0
- package/native-sdk/ios/AppleStorefront.swift +218 -0
- package/native-sdk/ios/BillingAuthorizationTerms.swift +57 -0
- package/native-sdk/ios/BundledWebView.swift +87 -0
- package/native-sdk/ios/ContentSession.swift +48 -0
- package/native-sdk/ios/ContentView.swift +51 -0
- package/native-sdk/ios/CustomerOperations.generated.swift +166 -0
- package/native-sdk/ios/CustomerResponseSemantics.swift +236 -0
- package/native-sdk/ios/CustomerSemantics.swift +145 -0
- package/native-sdk/ios/CustomerSession.swift +129 -0
- package/native-sdk/ios/FeatureClient.swift +86 -0
- package/native-sdk/ios/FunnelCommandStorage.swift +163 -0
- package/native-sdk/ios/FunnelConfigurationRelay.swift +48 -0
- package/native-sdk/ios/FunnelSession.swift +232 -0
- package/native-sdk/ios/FunnelView.swift +125 -0
- package/native-sdk/ios/GeneratedProtocol.swift +16 -0
- package/native-sdk/ios/HTTPTransport.swift +74 -0
- package/native-sdk/ios/IndianaClient.swift +601 -0
- package/native-sdk/ios/MerchantCommerceSemantics.swift +51 -0
- package/native-sdk/ios/NativePendingKeychain.swift +52 -0
- package/native-sdk/ios/NativeReceiptRelay.swift +28 -0
- package/native-sdk/ios/NativeStoreOffer.swift +34 -0
- package/native-sdk/ios/PaywallContent.swift +75 -0
- package/native-sdk/ios/PaywallSession.swift +124 -0
- package/native-sdk/ios/PaywallView.swift +87 -0
- package/native-sdk/ios/Protocol.swift +49 -0
- package/native-sdk/ios/PushInstallation.swift +154 -0
- package/native-sdk/ios/RendererNavigation.swift +8 -0
- package/native-sdk/ios/Resources.swift +15 -0
- package/native-sdk/ios/SDKVersion.swift +4 -0
- package/native-sdk/ios/StoreSubscriptionManagement.swift +11 -0
- package/native-sdk/ios/WebView/THIRD_PARTY_NOTICES.txt +101 -0
- package/native-sdk/ios/WebView/index.html +268 -0
- package/native-sdk/ios/WebView/renderer-data-url.txt +1 -0
- package/native-sdk/ios/WireSchema.swift +107 -0
- package/native-sdk/ios/funnel-wire-schemas.json +1 -0
- package/package.json +8 -3
- package/react-native.config.cjs +12 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'sha256-tijdnxa/lQrsbMb6A4bLKpIoXEOua/9hDMTwY8pyBNk=' 'sha256-UznZYYJO84QL7WE307bb//1369HDvk9x2sY+tHsxToI='; style-src 'unsafe-inline'; img-src https: data:; frame-src data:; connect-src 'none'; font-src 'none'; media-src 'none'; base-uri 'none'; form-action 'none'"></head><body><script>(()=>{var Y6=Object.create;var Ey=Object.defineProperty;var X6=Object.getOwnPropertyDescriptor;var e4=Object.getOwnPropertyNames;var t4=Object.getPrototypeOf,n4=Object.prototype.hasOwnProperty;var x=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var Ua=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ie=(e,t)=>{for(var r in t)Ey(e,r,{get:t[r],enumerable:!0})},r4=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of e4(t))!n4.call(e,o)&&o!==r&&Ey(e,o,{get:()=>t[o],enumerable:!(i=X6(t,o))||i.enumerable});return e};var i4=(e,t,r)=>(r=e!=null?Y6(t4(e)):{},r4(t||!e||!e.__esModule?Ey(r,"default",{value:e,enumerable:!0}):r,e));var ke={};Ie(ke,{BIGINT_FORMAT_RANGES:()=>Kc,CONSTANT_CATCH:()=>Td,Class:()=>Oy,NUMBER_FORMAT_RANGES:()=>Gc,aborted:()=>$n,allowsEval:()=>Ny,assert:()=>u4,assertEqual:()=>o4,assertIs:()=>s4,assertNever:()=>c4,assertNotEqual:()=>a4,assignProp:()=>Sn,attachSchema:()=>Wc,base64ToUint8Array:()=>fP,base64urlToUint8Array:()=>C4,cached:()=>Za,captureStackTrace:()=>Cd,cleanEnum:()=>E4,cleanRegex:()=>Si,clone:()=>xt,cloneDef:()=>p4,codePointLength:()=>zo,constantCatch:()=>Fy,createTransparentProxy:()=>b4,defineLazy:()=>Ty,defineLazyInternal:()=>Ye,derived:()=>R4,esc:()=>Dn,escapeRegex:()=>wr,explicitlyAborted:()=>jy,extend:()=>S4,finalizeIssue:()=>Kn,floatSafeRemainder:()=>qc,getElementAtPath:()=>m4,getEnumValues:()=>Ba,getLengthableOrigin:()=>Qc,getParsedType:()=>y4,getSizableOrigin:()=>Jc,hexToUint8Array:()=>O4,hide:()=>Yc,installLazyProp:()=>j4,isObject:()=>Fo,isPlainObject:()=>vr,issue:()=>Ka,joinValues:()=>kd,jsonStringifyReplacer:()=>qa,members:()=>My,merge:()=>w4,mergeDefs:()=>Mr,normalizeParams:()=>ce,nullish:()=>Ed,numKeys:()=>g4,objectClone:()=>l4,omit:()=>x4,optionalKeys:()=>$y,own:()=>Fi,parsedType:()=>Ly,partial:()=>_4,pick:()=>A4,prefixIssues:()=>Gn,primitiveTypes:()=>Dy,promiseAllObject:()=>f4,propertyKeyTypes:()=>Hc,randomString:()=>h4,rawShape:()=>Ha,required:()=>I4,safeExtend:()=>v4,shallowClone:()=>Zc,sizeCaps:()=>Ga,slugify:()=>Ry,stringifyPrimitive:()=>Pd,toZod:()=>Bc,uint8ArrayToBase64:()=>hP,uint8ArrayToBase64url:()=>P4,uint8ArrayToHex:()=>T4,unwrapMessage:()=>Va});function o4(e){return e}function a4(e){return e}function Bc(){return e=>e}function s4(e){}function c4(e){throw new Error("Unexpected value in exhaustive check")}function u4(e){}function Ba(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,o])=>t.indexOf(+i)===-1).map(([i,o])=>o)}function kd(e,t="|"){return e.map(r=>Pd(r)).join(t)}function qa(e,t){return typeof t=="bigint"?t.toString():t}function Za(e){return new Py(e)}function Ed(e){return e==null}function Si(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function qc(e,t){let r=e/t,i=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<o?0:r-i}function Ty(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==lP)return i===void 0&&(i=lP,i=r()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function l4(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Sn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ha(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function xi(e){return Ha(e._zod.def)??e._zod.def.shape}function dP(e,t,r){Object.defineProperty(e,t,{get(){let i=r();return Sn(this,t,i),i},enumerable:!0,configurable:!0})}function pP(e,t,r){t in e?Sn(e,t,r):e[t]=r}function Mo(e,t,r,i){let o=xi(t);for(let a of r){let s=Object.getOwnPropertyDescriptor(o,a);s.enumerable&&(s.get?dP(e,a,()=>{let c=t._zod.def.shape[a];return i?i(c,a):c}):pP(e,a,i?i(s.value,a):s.value))}}function d4(e,t){for(let r of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,r);i.enumerable&&(i.get?dP(e,r,()=>t[r]):pP(e,r,i.value))}}function Mr(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function p4(e){return Mr(e._zod.def)}function m4(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function f4(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let o={};for(let a=0;a<t.length;a++)o[t[a]]=i[a];return o})}function h4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function Dn(e){return JSON.stringify(e)}function Ry(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Fo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vr(e){if(Fo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Fo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Zc(e){return vr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function g4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function wr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xt(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function ce(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function b4(e){let t;return new Proxy({},{get(r,i,o){return t??(t=e()),Reflect.get(t,i,o)},set(r,i,o,a){return t??(t=e()),Reflect.set(t,i,o,a)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,o){return t??(t=e()),Reflect.defineProperty(t,i,o)}})}function Pd(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $y(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function A4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a={};return Mo(a,e,Od(e,t)),xt(e,Mr(r,{shape:a,checks:[]}))}function Od(e,t){let r=xi(e),i=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&i.push(o)}return i}function x4(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=new Set(Od(e,t)),s={};return Mo(s,e,Reflect.ownKeys(xi(e)).filter(c=>!a.has(c))),xt(e,Mr(r,{shape:s,checks:[]}))}function S4(e,t){if(!vr(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=xi(e);for(let a of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return xt(e,Mr(e._zod.def,{shape:mP(e,t)}))}function mP(e,t){let r={};return Mo(r,e,Reflect.ownKeys(xi(e))),d4(r,t),r}function v4(e,t){if(!vr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return xt(e,Mr(e._zod.def,{shape:mP(e,t)}))}function w4(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Mo(r,e,Reflect.ownKeys(xi(e))),Mo(r,t,Reflect.ownKeys(xi(t)));let i=Mr(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return xt(e,i)}function _4(e,t,r,i="partial"){let a=t._zod.def.checks;if(a&&a.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=r?new Set(Od(t,r)):void 0,u={};return Mo(u,t,Reflect.ownKeys(xi(t)),e&&((l,d)=>c&&!c.has(d)?l:new e({type:"optional",innerType:l}))),xt(t,Mr(t._zod.def,{shape:u,checks:[]}))}function I4(e,t,r){let i=r?new Set(Od(t,r)):void 0,o={};return Mo(o,t,Reflect.ownKeys(xi(t)),(a,s)=>i&&!i.has(s)?a:new e({type:"nonoptional",innerType:a})),xt(t,Mr(t._zod.def,{shape:o}))}function $n(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function jy(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Gn(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Va(e){return typeof e=="string"?e:e?.message}function Ga(e){let t=[];for(let r of e??[]){let i=r._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let o=i.maximum??i.length??i.size;o>=0&&t.push([o,r])}return t}function Wc(e,t,r){var i;for(let o=t;o<e.length;o++)(i=e[o]).schema??(i.schema=r)}function Kn(e,t,r){var i;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let a=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Va(e.inst?._zod.def?.error?.(e))??Va(a?.(e))??Va(t?.error?.(e))??Va(r.customError?.(e))??Va(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=s,t?.reportInput&&(c.input=e.input),c}function Jc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function zo(e){let t=e.length;if(!k4.test(e))return t;let r=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(r--,i++);return r}function Qc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ly(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ka(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function E4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function fP(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function hP(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function C4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return fP(t+r)}function P4(e){return hP(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function O4(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function T4(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function My(e,t){for(let r in t){let i=Object.getOwnPropertyDescriptor(t,r);i.get?Object.defineProperty(e,r,{...i,enumerable:!1}):N4(e,r,i.value)}}function Fi(e,t,r,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function Yc(e,t,r){return Fi(e,t,r,!1)}function R4(e,t){for(let r in e){let i=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Fi(this,r,i(this))},set(o){Fi(this,r,o)}})}return t}function N4(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Fi(this,t,r.bind(this))},set(i){Fi(this,t,i)}})}function D4(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}function Ye(e,t,r){let i=Object.getPrototypeOf(e._zod);if(t in i&&Cy!==e._zod){Cy=void 0;return}Cy=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,$4);let o=Mi;Mi=!1;try{let a=r(this);return Mi?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:a}),Mi=Mi||o,a}catch(a){throw delete this[t],Mi=Mi||o,a}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function j4(e,t,r,i){let o=D4(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let a={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,a),a.value=r(this),Object.defineProperty(this,t,a),a.value},set(a){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:a})}})}function Fy(e){let t=()=>e;return t[Td]=!0,t}var Py,lP,Cd,Ny,y4,Hc,Dy,Gc,Kc,k4,Oy,Cy,Mi,$4,Td,Xt=x(()=>{zi();Py=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};lP=Symbol("evaluating");Cd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Ny=Za(()=>{if(pn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});y4=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Hc=new Set(["string","number","symbol"]),Dy=new Set(["string","number","bigint","boolean","symbol","undefined"]);Gc={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kc={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};k4=/[\uD800-\uDBFF]/;Oy=class{constructor(...t){}};Mi=!1,$4={configurable:!0,get(){Mi=!0}};Td="~constantCatch"});function L4(e){let t=yP;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return yP=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function R(e,t,r,i){let o={};function a(h){this.def=h,this.constr=p,this.traits=new Set}a.prototype=o;let s=r,c=s&&new WeakSet;function u(h,f){if(h._zod){if(h._zod.traits.has(e))return}else{zy.value=new a(f);try{Object.defineProperty(h,"_zod",zy)}finally{zy.value=void 0}}if(h._zod.traits.add(e),t(h,f),c){let g=Object.getPrototypeOf(h),A=h._zod.constr.prototype,C=g;for(;C&&C!==A;)C=Object.getPrototypeOf(C);let w=C??g;c.has(w)||(c.add(w),My(w,s))}let m=p.prototype;for(let g in m)Object.prototype.hasOwnProperty.call(m,g)&&(g in h||(h[g]=m[g].bind(h)))}let l=i?.Parent??Object;class d extends l{}Object.defineProperty(d,"name",{value:e});function p(h){let f=i?.Parent?L4(d):this;u(f,h);let m=f._zod.deferred;if(m){for(let A of m)A();f._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(f),f}return Object.defineProperty(p,"init",{value:u}),Object.defineProperty(p,Symbol.hasInstance,{value:h=>i?.Parent&&h instanceof i.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(p,"name",{value:e}),p}function Bt(e){return e&&Object.assign(pn,e),pn}var gP,Uy,zy,yP,Vy,Wn,Ui,pn,zi=x(()=>{Xt();Uy=Object.freeze({status:"aborted"}),zy={value:void 0,enumerable:!1},yP="captureStackTrace"in Error?Error:null;Vy=Symbol("zod_brand"),Wn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ui=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(gP=globalThis).__zod_globalConfig??(gP.__zod_globalConfig={});pn=globalThis.__zod_globalConfig});function M4(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,qa,2)),e.message}function F4(e){this._zod.message=e}function U4(e,t,r){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0}):e[t]=r()),e[t]}function Xc(e,t=r=>r.message){let r={},i=[];for(let o of e.issues)o.path.length>0?U4(r,o.path[0],()=>[]).push(t(o)):i.push(t(o));return{formErrors:i,fieldErrors:r}}function eu(e,t=r=>r.message){let r={_errors:[]},i=(o,a=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>i({issues:c},[...a,...s.path]));else if(s.code==="invalid_key")i({issues:s.issues},[...a,...s.path]);else if(s.code==="invalid_element")i({issues:s.issues},[...a,...s.path]);else{let c=[...a,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,l=0;for(;l<c.length;){let d=c[l],p=l===c.length-1;if(d==="_errors"){p&&u._errors.push(t(s)),l++;continue}Object.prototype.hasOwnProperty.call(u,d)||Object.defineProperty(u,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let h=u[d];p&&h._errors.push(t(s)),u=h,l++}}}};return i(e),r}function Hy(e,t=r=>r.message){let r={errors:[]},i=(o,a=[])=>{var s;for(let c of o.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...a,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...a,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...a,...c.path]);else{let u=[...a,...c.path];if(u.length===0){r.errors.push(t(c));continue}let l=r,d=0;for(;d<u.length;){let p=u[d],h=d===u.length-1;typeof p=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,p)||Object.defineProperty(l.properties,p,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[p]):(l.items??(l.items=[]),(s=l.items)[p]??(s[p]={errors:[]}),l=l.items[p]),h&&l.errors.push(t(c)),d++}}};return i(e),r}function xP(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Gy(e){let t=[],r=[...e.issues].sort((i,o)=>(i.path??[]).length-(o.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${xP(i.path)}`);return t.join(`
|
|
2
|
+
`)}var z4,qy,bP,AP,Zy,Jn,Ky=x(()=>{zi();Xt();z4={get:M4,set:F4,enumerable:!0,configurable:!0},qy={value:void 0,enumerable:!1},bP=new WeakSet([Object.prototype,Error.prototype]),AP=(e,t)=>{e.name="$ZodError",qy.value=t,Object.defineProperty(e,"issues",qy),qy.value=void 0,Object.defineProperty(e,"message",z4);let r=Object.getPrototypeOf(e);bP.has(r)||(bP.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let i=()=>this.message;return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},Zy=R("$ZodError",AP),Jn=R("$ZodError",AP,void 0,{Parent:Error})});function Rd(e,t){return{callee:t?.callee??e,Err:t?.Err}}function SP(e,t,r){let i;return{success:!1,get error(){return i||(i=new e(t.map(o=>Kn(o,r,Bt()))),t=void 0,r=void 0),i},set error(o){i=o,t=void 0,r=void 0}}}function G4(e,t,r){let i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,a;if(o?(i[H4]=!0,a=o({value:t,issues:[]},i)):a=e._zod.run({value:t,issues:[]},i),a instanceof Promise)throw new Wn;return a.issues.length===0}var Wa,Nd,Ja,Dd,Qa,B4,Ya,q4,Z4,H4,tu,nu,$d,K4,jd,W4,Ld,J4,Md,Q4,Fd,Y4,zd,X4,Ud,eV,Vd,tV,Wy=x(()=>{zi();Ky();Xt();Wa=e=>{let t=(r,i,o,a)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:i,issues:[]},s);if(c instanceof Promise)throw new Wn;if(c.issues.length){let u=new(a?.Err??e)(c.issues.map(l=>Kn(l,s,Bt())));throw Cd(u,a?.callee??t),u}return c.value};return t},Nd=Wa(Jn),Ja=e=>{let t=async(r,i,o,a)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:i,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(a?.Err??e)(c.issues.map(l=>Kn(l,s,Bt())));throw Cd(u,a?.callee??t),u}return c.value};return t},Dd=Ja(Jn),Qa=e=>(t,r,i)=>{let o=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Wn;return a.issues.length?SP(e,a.issues,o):{success:!0,data:a.value}},B4=Qa(Jn);Ya=e=>async(t,r,i)=>{let o=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?SP(e,a.issues,o):{success:!0,data:a.value}},q4=Ya(Jn),Z4=Symbol.for("zod.compile.invalid"),H4=Symbol.for("zod.compile.fallback"),tu=((e,t,r)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==Z4)return!0;if(i.definite===!0&&r===void 0)return!1}return G4(e,t,r)});nu=async(e,t,r)=>{let i=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length===0},$d=e=>{let t=Wa(e),r=(i,o,a,s)=>{let c=a?{...a,direction:"backward"}:{direction:"backward"};return t(i,o,c,Rd(r,s))};return r},K4=$d(Jn),jd=e=>{let t=Wa(e),r=(i,o,a,s)=>t(i,o,a,Rd(r,s));return r},W4=jd(Jn),Ld=e=>{let t=Ja(e),r=async(i,o,a,s)=>{let c=a?{...a,direction:"backward"}:{direction:"backward"};return await t(i,o,c,Rd(r,s))};return r},J4=Ld(Jn),Md=e=>{let t=Ja(e),r=async(i,o,a,s)=>await t(i,o,a,Rd(r,s));return r},Q4=Md(Jn),Fd=e=>(t,r,i)=>{let o=i?{...i,direction:"backward"}:{direction:"backward"};return Qa(e)(t,r,o)},Y4=Fd(Jn),zd=e=>(t,r,i)=>Qa(e)(t,r,i),X4=zd(Jn),Ud=e=>async(t,r,i)=>{let o=i?{...i,direction:"backward"}:{direction:"backward"};return Ya(e)(t,r,o)},eV=Ud(Jn),Vd=e=>async(t,r,i)=>Ya(e)(t,r,i),tV=Vd(Jn)});var _r={};Ie(_r,{anyString:()=>vb,base64:()=>mb,base64url:()=>fb,bigint:()=>_b,boolean:()=>Ib,browserEmail:()=>uV,cidrv4:()=>db,cidrv6:()=>pb,creditCard:()=>Bd,cuid:()=>Qy,cuid2:()=>Yy,currencyCode:()=>bb,date:()=>Ab,datetime:()=>Sb,domain:()=>gb,duration:()=>ib,e164:()=>yb,email:()=>ab,emoji:()=>sb,extendedDuration:()=>nV,guid:()=>ob,hex:()=>Ob,hostname:()=>hb,html5Email:()=>aV,httpProtocol:()=>ru,iban:()=>qd,idnEmail:()=>cV,integer:()=>iu,ipv4:()=>cb,ipv6:()=>ub,ksuid:()=>tb,lowercase:()=>Cb,mac:()=>lb,md5_base64:()=>mV,md5_base64url:()=>fV,md5_hex:()=>pV,nanoid:()=>nb,nanoidOfLength:()=>rb,null:()=>kb,number:()=>vi,rfc5322Email:()=>sV,sha1_base64:()=>gV,sha1_base64url:()=>yV,sha1_hex:()=>hV,sha256_base64:()=>AV,sha256_base64url:()=>xV,sha256_hex:()=>bV,sha384_base64:()=>vV,sha384_base64url:()=>wV,sha384_hex:()=>SV,sha512_base64:()=>IV,sha512_base64url:()=>kV,sha512_hex:()=>_V,string:()=>wb,time:()=>xb,ulid:()=>Xy,undefined:()=>Eb,unicodeEmail:()=>vP,uppercase:()=>Pb,uuid:()=>Uo,uuid4:()=>rV,uuid6:()=>iV,uuid7:()=>oV,xid:()=>eb});function rb(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function sb(){return new RegExp(lV,"u")}function dV(e){return new RegExp(`^${e}$`)}function Jy(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xb(e){return new RegExp(`^${Jy(e)}$`)}function Sb(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Jy({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${r}|${Jy({precision:e.precision})}`:r;return new RegExp(`^${wP}T(?:${i})$`)}function ou(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function au(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Qy,Yy,Xy,eb,tb,nb,ib,nV,ob,Uo,rV,iV,oV,ab,aV,sV,vP,cV,uV,lV,cb,ub,lb,db,pb,mb,fb,hb,gb,ru,yb,Bd,bb,qd,wP,Ab,vb,wb,_b,iu,vi,Ib,kb,Eb,Cb,Pb,Ob,pV,mV,fV,hV,gV,yV,bV,AV,xV,SV,vV,wV,_V,IV,kV,Vo=x(()=>{Xt();Qy=/^[cC][0-9a-z]{6,}$/,Yy=/^[0-9a-z]+$/,Xy=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,eb=/^[0-9a-vA-V]{20}$/,tb=/^[A-Za-z0-9]{27}$/,nb=/^[a-zA-Z0-9_-]{21}$/;ib=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nV=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ob=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Uo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rV=Uo(4),iV=Uo(6),oV=Uo(7),ab=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aV=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,sV=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,vP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cV=vP,uV=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,lV="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";cb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ub=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,lb=e=>{let t=wr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},db=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,pb=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fb=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,hb=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,gb=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,ru=/^https?$/,yb=/^\+[1-9]\d{6,14}$/,Bd=/^\d(?:[ -]?\d){11,18}$/,bb=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,qd=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,wP="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";Ab=dV(wP);vb=/^[\s\S]{0,}$/,wb=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},_b=/^-?\d+n?$/,iu=/^-?\d+$/,vi=/^-?\d+(?:\.\d+)?$/,Ib=/^(?:true|false)$/i,kb=/^null$/i,Eb=/^undefined$/i,Cb=/^[^A-Z]*$/,Pb=/^[^a-z]*$/,Ob=/^[0-9a-fA-F]*$/;pV=/^[0-9a-fA-F]{32}$/,mV=ou(22,"=="),fV=au(22),hV=/^[0-9a-fA-F]{40}$/,gV=ou(27,"="),yV=au(27),bV=/^[0-9a-fA-F]{64}$/,AV=ou(43,"="),xV=au(43),SV=/^[0-9a-fA-F]{96}$/,vV=ou(64,""),wV=au(64),_V=/^[0-9a-fA-F]{128}$/,IV=ou(86,"=="),kV=au(86)});function Hd(e,t,r){e.issues.length&&t.issues.push(...Gn(r,e.issues))}var Ct,Tb,Rb,Zd,Gd,Kd,Nb,Db,$b,jb,Lb,Mb,Fb,zb,Ub,Xa,Vb,Bb,qb,Zb,Hb,Gb,Kb,Wb,Jb,Qb,Wd=x(()=>{zi();Vo();Xt();Ct=R("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Tb=e=>{let t=e.value;return!Ed(t)&&t.size!==void 0},Rb=e=>{let t=e.value;return!Ed(t)&&t.length!==void 0},Zd={number:"number",bigint:"bigint",object:"date"},Gd=R("$ZodCheckLessThan",(e,t)=>{Ct.init(e,t);let r=Zd[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Zd[typeof i.value]??r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Kd=R("$ZodCheckGreaterThan",(e,t)=>{Ct.init(e,t);let r=Zd[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Zd[typeof i.value]??r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Nb=R("$ZodCheckMultipleOf",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):qc(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Db=R("$ZodCheckNumberFormat",(e,t)=>{Ct.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[o,a]=Gc[t.format];e._zod.check=s=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<o&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>a&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),$b=R("$ZodCheckBigIntFormat",(e,t)=>{Ct.init(e,t);let[r,i]=Kc[t.format];e._zod.check=o=>{let a=o.value;a<r&&o.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&o.issues.push({origin:"bigint",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),jb=R("$ZodCheckMaxSize",(e,t)=>{var r;Ct.init(e,t),(r=e._zod.def).when??(r.when=Tb),e._zod.check=i=>{let o=i.value;o.size<=t.maximum||i.issues.push({origin:Jc(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Lb=R("$ZodCheckMinSize",(e,t)=>{var r;Ct.init(e,t),(r=e._zod.def).when??(r.when=Tb),e._zod.check=i=>{let o=i.value;o.size>=t.minimum||i.issues.push({origin:Jc(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Mb=R("$ZodCheckSizeEquals",(e,t)=>{var r;Ct.init(e,t),(r=e._zod.def).when??(r.when=Tb),e._zod.check=i=>{let o=i.value,a=o.size;if(a===t.size)return;let s=a>t.size;i.issues.push({origin:Jc(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Fb=R("$ZodCheckMaxLength",(e,t)=>{var r;Ct.init(e,t),(r=e._zod.def).when??(r.when=Rb),e._zod.check=i=>{let o=i.value,a=o.length;if((typeof o=="string"&&a>t.maximum?zo(o):a)<=t.maximum)return;let c=Qc(o);i.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zb=R("$ZodCheckMinLength",(e,t)=>{var r;Ct.init(e,t),(r=e._zod.def).when??(r.when=Rb),e._zod.check=i=>{let o=i.value,a=o.length;if((typeof o=="string"&&a>=t.minimum&&a<t.minimum*2?zo(o):a)>=t.minimum)return;let c=Qc(o);i.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Ub=R("$ZodCheckLengthEquals",(e,t)=>{var r;Ct.init(e,t),(r=e._zod.def).when??(r.when=Rb),e._zod.check=i=>{let o=i.value,a=o.length,s=typeof o=="string"&&a>=t.length&&a<=t.length*2?zo(o):a;if(s===t.length)return;let c=Qc(o),u=s>t.length;i.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Xa=R("$ZodCheckStringFormat",(e,t)=>{var r,i;Ct.init(e,t),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Vb=R("$ZodCheckRegex",(e,t)=>{Xa.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Bb=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Cb),Xa.init(e,t)}),qb=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pb),Xa.init(e,t)}),Zb=R("$ZodCheckIncludes",(e,t)=>{Ct.init(e,t);let r=wr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${r}`:r);t.pattern=i,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Hb=R("$ZodCheckStartsWith",(e,t)=>{Ct.init(e,t);let r=new RegExp(`^${wr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Gb=R("$ZodCheckEndsWith",(e,t)=>{Ct.init(e,t);let r=new RegExp(`.*${wr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});Kb=R("$ZodCheckProperty",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(o=>Hd(o,r,t.property));Hd(i,r,t.property)}}),Wb=R("$ZodCheckProperties",(e,t)=>{Ct.init(e,t),Yc(e,Symbol.iterator,function*(){yield e});let r;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}r??(r=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=i.value,a;for(let[s,c]of r){let u=c._zod.run({value:o[s],issues:[]},{});u instanceof Promise?(a??(a=[]),a.push(u.then(l=>Hd(l,i,s)))):Hd(u,i,s)}if(a)return Promise.all(a).then(()=>{})}}),Jb=R("$ZodCheckMimeType",(e,t)=>{Ct.init(e,t);let r=new Set(t.mime);e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Qb=R("$ZodCheckOverwrite",(e,t)=>{Ct.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Bo,Jd=x(()=>{Bo=class{constructor(t=[],r={}){this.content=[],this.indent=0,this.args=t,this.closed=r}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
3
|
+
`).filter(s=>s),o=Math.min(...i.map(s=>s.length-s.trimStart().length)),a=i.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of a)this.content.push(s)}compile(){let t=Function,r=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
+
${r.join(`
|
|
5
|
+
`)}
|
|
6
|
+
};`)(...Object.values(this.closed))}}});var Yb,Xb=x(()=>{Yb={major:4,minor:6,patch:6}});async function EV(e,t){let r={async:!0};return zP(await e._zod.run({value:t,issues:[]},r),r)}function tp(e){return{validate:t=>{let r={async:!1};try{let i=e._zod.run({value:t,issues:[]},r);if(!(i instanceof Promise))return zP(i,r)}catch{}return EV(e,t)},vendor:"zod",version:1}}function oA(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function np(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?oA(e)||su:UP(e,t)}function UP(e,t){if(!t.normalize&&t.protocol?.source===ru.source&&!/^https?:\/\//i.test(e))return iA;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??su}return new URL(e)}catch{return su}}function cu(e){return e.replace(CV,"")}function rp(e,t){return t.lastIndex=0,t.test(e.hostname)}function ip(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}function uu(e){return PV.test(e)?oA(`http://[${e}]`):!1}function op(e){let t=e.split("/");if(t.length!==2)return!1;let[r,i]=t;if(!i)return!1;let o=Number(i);return`${o}`!==i||o<0||o>128?!1:uu(r)}function lu(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function sp(e){if(!du.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return lu(r)}function TV(e){let t=e.length,r=1,i=0;for(;t;){let o=e.charCodeAt(--t)-48;r^=1,i+=r?[0,2,4,6,8,1,3,5,7,9][o]:o}return i%10===0}function cp(e){return Bd.test(e)?TV(e.replace(OV,"")):!1}function RV(e){let t=0,r=e.length;for(let i=4;i<r;i++){let o=e.charCodeAt(i);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}for(let i=0;i<4;i++){let o=e.charCodeAt(i);t=(o>=65?t*100+(o-55):t*10+(o-48))%97}return t===1}function up(e){return qd.test(e)?RV(e):!1}function lp(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let o=JSON.parse(atob(i));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function zA(e,t){let r=Ga(e._zod.def.checks);if(!r.length)return;let i=Math.min(...r.map(a=>a[0])),o=e._zod.parse;e._zod.parse=(a,s)=>{let c=t(a.value);if(c>i&&!s?.skipChecks&&s?.direction!=="backward"){for(let[u,l]of Ga(e._zod.def.checks))if(c>u&&l._zod.def.when(a)){let d=a.issues.length;return l._zod.check(a),a.issues[d].continue=!1,Wc(a.issues,d,e),a}}return o(a,s)}}function IP(e,t,r){e.issues.length&&t.issues.push(...Gn(r,e.issues)),t.value[r]=e.value}function ep(e,t,r,i,o,a){let s=r in i,c=a==="optional";if(!(!s&&c&&o==="optional")){if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...Gn(r,e.issues))}if(!s&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?(s||o==="defaulted"&&!c)&&(t.value[r]=void 0):t.value[r]=e.value}}function VP(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),i=r.length?r:jV,o=i.length?[...t,...i]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let a=$y(e.shape);return{...e,allKeys:o,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function BP(e,t,r,i,o,a,s){let c=[],u=o.keySet,l=o.catchall._zod,d=l.def.type,p=l.optin,h=l.optout,f=0;for(let m in t){if(s&&r.issues.length!==f){if($n(r,f))break;f=r.issues.length}if(u.has(m))continue;if(m==="__proto__"){d==="never"&&c.push(m);continue}if(d==="never"){c.push(m);continue}let g=l.run({value:t[m],issues:[]},i);g instanceof Promise?e.push(g.then(A=>ep(A,r,m,t,p,h))):ep(g,r,m,t,p,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>r):r}function kP(e,t,r,i){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let o=e.filter(a=>!$n(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(s=>Kn(s,i,Bt())))}),t)}function EP(e,t,r,i){let o=[];for(let a=0;a<e.length;a++)e[a].issues.length===0&&o.push(a);return o.length===1?(t.value=e[o[0]].value,t):(o.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(s=>Kn(s,i,Bt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:o}),t)}function qA(e,t){let r=e._zod,i=r.bag.optionsMap;i||(i=ZP(r.def),r.bag.optionsMap=i);let o=i.get(t);if(o===null)throw new Error(`Ambiguous discriminator value "${String(t)}"`);return o}function ZP(e){let t=new Map;for(let r of e.options){let i=r._zod.propValues?.[e.discriminator];if(!i||i.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let o of i)if(t.has(o)){if(o!==void 0)throw new Error(`Duplicate discriminator value "${String(o)}"`);t.set(o,null)}else t.set(o,r)}return t}function es(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(vr(e)&&vr(t)){let r=Object.keys(t),i=Object.keys(e).filter(a=>r.indexOf(a)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let a of i){if(a==="__proto__")continue;let s=es(e[a],t[a]);if(!s.valid)return{valid:!1,mergeErrorPath:[a,...s.mergeErrorPath]};o[a]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<e.length;i++){let o=e[i],a=t[i],s=es(o,a);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function CP(e,t,r){let i=new Map,o,a=new Map,s=(l,d)=>{let p;if(l.code==="unrecognized_keys"&&!l.path?.length)o??(o=l),p=l.keys;else if(l.code==="invalid_key"&&l.origin==="record"&&l.path?.length===1){let h=String(l.path[0]);a.has(h)||a.set(h,l),p=[h]}else return!1;for(let h of p)i.has(h)||i.set(h,{}),i.get(h)[d]=!0;return!0};for(let l of t.issues)s(l,"l")||e.issues.push(l);for(let l of r.issues)s(l,"r")||e.issues.push(l);let c=[...i].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(c.length){let l=o?c.filter(d=>o.keys.includes(d)):[];l.length&&e.issues.push({...o,keys:l});for(let d of c)!l.includes(d)&&a.has(d)&&e.issues.push(a.get(d))}let u=es(t.value,r.value);if(!u.valid){if($n(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}function PP(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function OP(e,t,r){e.issues.length&&t.issues.push(...Gn(r,e.issues)),t.value[r]=e.value}function TP(e,t,r,i,o){for(let a=0;a<r.length;a++){let s=e[a],c=a<i.length;if(!c&&a>=o&&r[a]._zod.optin==="optional"){t.value.length=a;break}if(s.issues.length){if(!c&&a>=o){t.value.length=a;break}t.issues.push(...Gn(a,s.issues))}t.value[a]=s.value}for(let a=t.value.length-1;a>=i.length&&(r[a]._zod.optout==="optional"&&t.value[a]===void 0);a--)t.value.length=a;return t}function RP(e,t,r,i,o,a,s){e.issues.length&&(Hc.has(typeof i)?r.issues.push(...Gn(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:a,issues:e.issues.map(c=>Kn(c,s,Bt()))})),t.issues.length&&(Hc.has(typeof i)?r.issues.push(...Gn(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:a,key:i,issues:t.issues.map(c=>Kn(c,s,Bt()))})),r.value.set(e.value,t.value)}function NP(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function DP(e,t){return e.value=t.issues.length?void 0:t.value,e}function $P(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function jP(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function LP(e,t,r,i){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Kn(o,i,Bt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function Qd(e,t,r){return e.issues.some(i=>i.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}function Yd(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let o=t.transform(e.value,e);return o instanceof Promise?o.then(a=>Xd(e,a,t.out,r)):Xd(e,o,t.out,r)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(a=>Xd(e,a,t.in,r)):Xd(e,o,t.in,r)}}function Xd(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}function MP(e){return e.memo||(e.value=Object.freeze(e.value)),e}function LV(e){let t=e._zod.def,r=t.pattern,i=!!t.format?.includes("int"),o,a;for(let c of t.checks??[]){let u=c._zod.def;u.pattern&&(r=u.pattern),i||(i=!!u.format?.includes("int"));let l=u.minimum??u.length,d=u.maximum??u.length;l!==void 0&&(o===void 0||l>o)&&(o=l),d!==void 0&&(a===void 0||d<a)&&(a=d)}if(r)return r.source;if(o!==void 0&&a!==void 0&&o>a)return"(?!)";if(o!==void 0||a!==void 0)return wb({minimum:o,maximum:a}).source;let s=e._zod.pattern;return(i&&s===vi?iu:s)?.source}function eA(e){let t=e._zod.def,r=e._zod.pattern?.source,i=t.innerType??e._zod.innerType;if(i){let o=i._zod.pattern?.source,a=eA(i);return r&&o&&a&&a!==o?r.replace(Si(o),()=>Si(a)):r}if(t.options){let o=t.options.map(eA);if(o.every(Boolean))return`^(${o.map(a=>Si(a)).join("|")})$`}return LV(e)}function FP(e,t,r,i){if(!e){let o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(Ka(o))}}var Ze,zP,qo,St,tA,nA,rA,iA,su,CV,aA,sA,cA,uA,lA,dA,pA,mA,fA,hA,gA,yA,bA,PV,AA,xA,SA,vA,ap,wA,du,_A,IA,OV,kA,EA,CA,PA,dp,OA,pu,pp,TA,RA,NA,DA,$A,jA,LA,MA,FA,NV,DV,$V,UA,jV,qP,VA,mu,BA,ZA,HA,mp,GA,KA,WA,JA,QA,YA,XA,fp,ex,tx,nx,rx,ix,ox,ax,sx,hp,fu,cx,ux,lx,dx,px,hu,mx,ts=x(()=>{Wd();zi();Jd();Wy();Vo();Xt();Xb();Xt();Ze=R("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Yb;let i=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...i??[]]:i?.length?[...i]:[];for(let a of o)for(let s of a._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let a=(c,u,l)=>{if(c.memo)return c;let d=$n(c),p;for(let h of u){if(h._zod.def.when){if(jy(c)||!h._zod.def.when(c))continue}else if(d)continue;let f=c.issues.length,m=h._zod.check(c);if(m instanceof Promise&&l?.async===!1)throw new Wn;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,c.issues.length!==f&&(Wc(c.issues,f,e),d||(d=$n(c,f)))});else{if(c.issues.length===f)continue;Wc(c.issues,f,e),d||(d=$n(c,f))}}return p?p.then(()=>c):c},s=(c,u,l)=>{if($n(c))return c.aborted=!0,c;let d=a(u,o,l);if(d instanceof Promise){if(l.async===!1)throw new Wn;return d.then(p=>e._zod.parse(p,l))}return e._zod.parse(d,l)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let d=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(p=>s(p,c,u)):s(d,c,u)}let l=e._zod.parse(c,u);if(l instanceof Promise){if(u.async===!1)throw new Wn;return l.then(d=>a(d,o,u))}return a(l,o,u)}}},{get"~standard"(){return Yc(this,"~standard",tp(this))},set"~standard"(e){Fi(this,"~standard",e)}}),zP=(e,t)=>e.issues.length?{issues:e.issues.map(r=>Kn(r,t,Bt()))}:{value:e.value};qo=R("$ZodString",(e,t)=>{Ze.init(e,t),e._zod.pattern=t.pattern??vb,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),St=R("$ZodStringFormat",(e,t)=>{Xa.init(e,t),qo.init(e,t)}),tA=R("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ob),St.init(e,t)}),nA=R("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Uo(i))}else t.pattern??(t.pattern=Uo());St.init(e,t)}),rA=R("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ab),St.init(e,t)}),iA=1,su=2;CV=/[\t\n\r]/g;aA=R("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),o=np(i,t);if(o===iA){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===su){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=cu(i);return}t.hostname&&!rp(o,t.hostname)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort}),t.protocol&&!ip(o,t.protocol)&&r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort}),r.value=t.normalize?o.href:cu(i);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),sA=R("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=sb()),St.init(e,t)}),cA=R("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?nb:rb(t.length)),St.init(e,t)}),uA=R("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Qy),St.init(e,t)}),lA=R("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Yy),St.init(e,t)}),dA=R("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Xy),St.init(e,t)}),pA=R("$ZodXID",(e,t)=>{t.pattern??(t.pattern=eb),St.init(e,t)}),mA=R("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=tb),St.init(e,t)}),fA=R("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Sb(t)),St.init(e,t)}),hA=R("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ab),St.init(e,t)}),gA=R("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=xb(t)),St.init(e,t)}),yA=R("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ib),St.init(e,t)}),bA=R("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=cb),St.init(e,t)}),PV=/^[0-9a-fA-F:.]+$/;AA=R("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ub),St.init(e,t),e._zod.check=r=>{uu(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),xA=R("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=lb(t.delimiter)),St.init(e,t)}),SA=R("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=db),St.init(e,t)});vA=R("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=pb),St.init(e,t),e._zod.check=r=>{op(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});ap=/^[0-9a-zA-Z+/]*={0,2}$/,wA=R("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ap),St.init(e,t),e._zod.check=r=>{lu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),du=/^[A-Za-z0-9_-]*$/;_A=R("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=du),St.init(e,t),e._zod.check=r=>{sp(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),IA=R("$ZodE164",(e,t)=>{t.pattern??(t.pattern=yb),St.init(e,t)}),OV=/[- ]/g;kA=R("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=Bd),St.init(e,t),e._zod.check=r=>{cp(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}});EA=R("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=qd),St.init(e,t),e._zod.check=r=>{up(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort})}});CA=R("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=r=>{lp(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),PA=R("$ZodCustomStringFormat",(e,t)=>{St.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),dp=R("$ZodNumber",(e,t)=>{Ze.init(e,t),e._zod.pattern=vi,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}}),OA=R("$ZodNumberFormat",(e,t)=>{Db.init(e,t),dp.init(e,t)}),pu=R("$ZodBoolean",(e,t)=>{Ze.init(e,t),e._zod.pattern=Ib,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),pp=R("$ZodBigInt",(e,t)=>{Ze.init(e,t),e._zod.pattern=_b,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),TA=R("$ZodBigIntFormat",(e,t)=>{$b.init(e,t),pp.init(e,t)}),RA=R("$ZodSymbol",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:e}),r}}),NA=R("$ZodUndefined",(e,t)=>{Ze.init(e,t),e._zod.pattern=Eb,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),r}}),DA=R("$ZodNull",(e,t)=>{Ze.init(e,t),e._zod.pattern=kb,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),$A=R("$ZodAny",(e,t)=>{Ze.init(e,t),e._zod.parse=r=>r}),jA=R("$ZodUnknown",(e,t)=>{Ze.init(e,t),e._zod.parse=r=>r}),LA=R("$ZodNever",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),MA=R("$ZodVoid",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),FA=R("$ZodDate",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,a=o instanceof Date;return a&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...a?{received:"Invalid Date"}:{},inst:e}),r}});NV=e=>Array.isArray(e)?e.length:-1,DV=e=>e instanceof Map?e.size:-1,$V=e=>e instanceof Set?e.size:-1;UA=R("$ZodArray",(e,t)=>{Ze.init(e,t);let r=pn.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),i;i.value=r?r.alloc(e,i,Array(a.length),o):Array(a.length);let s=[],c=o?.abortEarly;for(let u=0;u<a.length;u++){let l=a[u],d=t.element._zod.run({value:l,issues:[]},o);if(d instanceof Promise)s.push(d.then(p=>IP(p,i,u)));else if(IP(d,i,u),c&&d.issues.length!==0&&$n(d))break}return s.length?Promise.all(s).then(()=>i):i},zA(e,NV)});jV=[];qP=R("$ZodObject",(e,t)=>{Ze.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),i=r?.get?r.get.raw:t.shape??{};if(i){let l=()=>{let d={...i};return Object.defineProperty(t,"shape",{value:d}),l.raw=d,d};l.raw=i,Object.defineProperty(t,"shape",{get:l})}let o=Za(()=>VP(t));Ye(e,"propValues",l=>{let d=l.def.shape,p={};for(let h in d){let f=d[h]._zod;if(f.values){Object.prototype.hasOwnProperty.call(p,h)||Sn(p,h,new Set);for(let m of f.values)p[h].add(m);f.optin!==void 0&&p[h].add(void 0)}}return p});let a=Fo,s=t.catchall,c,u=pn.memoizer;u?.attach(e),e._zod.parse=(l,d)=>{c??(c=o.value);let p=l.value;if(!a(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value=u?u.alloc(e,l,{},d):{};let h=[],f=c.shape,m=d?.abortEarly,g=l.issues.length;for(let A of c.allKeys){if(m&&l.issues.length!==g){if($n(l,g))break;g=l.issues.length}if(A==="__proto__")continue;let C=f[A],w=C._zod.optin,E=C._zod.optout,I=C._zod.run({value:p[A],issues:[]},d);I instanceof Promise?h.push(I.then(F=>ep(F,l,A,p,w,E))):ep(I,l,A,p,w,E)}return s?BP(h,p,l,d,o.value,e,m===!0):h.length?Promise.all(h).then(()=>l):l}}),VA=R("$ZodObjectJIT",(e,t)=>{qP.init(e,t);let r=e._zod.parse,i=Za(()=>VP(t)),o=pn.memoizer,a=f=>{let m=i.value,g=m.symbolKeys,A=new Bo(["payload","ctx"],{shape:f,inst:e,memo:o,syms:g}),C=F=>`shape[${F}]._zod.run({ value: input[${F}], issues: [] }, ctx)`,w=(F,L)=>`
|
|
7
|
+
let ${F}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${F}.issues.length; i++) {
|
|
9
|
+
const iss = ${F}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${L}, ...iss.path] : [${L}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${F}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${F}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;A.write("const input = payload.value;");let E=Object.create(null),I=0;for(let F of m.allKeys)E[F]=`key_${I++}`;A.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let F of m.allKeys){if(F==="__proto__")continue;let L=E[F],q=typeof F=="symbol"?`syms[${g.indexOf(F)}]`:Dn(F),H=`${q} in input`,X=f[F],M=X?._zod?.optin,J=M!==void 0,$=X?._zod?.optout==="optional";if(A.write(`const ${L} = ${C(q)};`),J&&$){let D=M==="optional"?`${L}_present`:`${L}.value !== undefined || ${L}_present`;A.write(`
|
|
18
|
+
const ${L}_present = ${H};
|
|
19
|
+
if (!${L}.issues.length || ${L}_present) {
|
|
20
|
+
if (${L}.issues.length) {${w(L,q)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${D}) {
|
|
24
|
+
newResult[${q}] = ${L}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`)}else J?(A.write(`
|
|
29
|
+
if (${L}.issues.length) {${w(L,q)}
|
|
30
|
+
}
|
|
31
|
+
`),M==="defaulted"?A.write(`newResult[${q}] = ${L}.value;`):A.write(`
|
|
32
|
+
if (${L}.value !== undefined || ${H}) {
|
|
33
|
+
newResult[${q}] = ${L}.value;
|
|
34
|
+
}
|
|
35
|
+
`)):A.write(`
|
|
36
|
+
const ${L}_present = ${H};
|
|
37
|
+
if (${L}.issues.length) {${w(L,q)}
|
|
38
|
+
}
|
|
39
|
+
if (!${L}_present && !${L}.issues.length) {
|
|
40
|
+
payload.issues.push({
|
|
41
|
+
code: "invalid_type",
|
|
42
|
+
expected: "nonoptional",
|
|
43
|
+
input: undefined,
|
|
44
|
+
path: [${q}]
|
|
45
|
+
});
|
|
46
|
+
if (ctx && ctx.abortEarly) {
|
|
47
|
+
payload.value = newResult;
|
|
48
|
+
return payload;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (${L}_present) {
|
|
53
|
+
newResult[${q}] = ${L}.value;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
`)}return A.write("payload.value = newResult;"),A.write("return payload;"),A.compile()},s,c=Fo,u=!pn.jitless,d=u&&Ny.value,p=t.catchall,h;e._zod.parse=(f,m)=>{h??(h=i.value);let g=f.value;return c(g)?u&&d&&m?.async===!1&&m.jitless!==!0?(s||(s=a(t.shape)),f=s(f,m),p?BP([],g,f,m,h,e,m?.abortEarly===!0):f):r(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f)}});mu=R("$ZodUnion",(e,t)=>{Ze.init(e,t),Ye(e,"optin",i=>i.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":i.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Ye(e,"optout",i=>i.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ye(e,"values",i=>{if(i.def.options.every(o=>o._zod.values))return new Set(i.def.options.flatMap(o=>Array.from(o._zod.values)))}),Ye(e,"pattern",i=>{if(i.def.options.every(o=>o._zod.pattern)){let o=i.def.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Si(a.source)).join("|")})$`)}});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,o)=>{if(r)return r(i,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(c=>kP(c,i,e,o)):kP(s,i,e,o)}});BA=R("$ZodXor",(e,t)=>{mu.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(i,o)=>{if(r)return r(i,o);let a=!1,s=[];for(let c of t.options){let u=c._zod.run({value:i.value,issues:[]},o);u instanceof Promise?(s.push(u),a=!0):s.push(u)}return a?Promise.all(s).then(c=>EP(c,i,e,o)):EP(s,i,e,o)}});ZA=R("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mu.init(e,t);let r=e._zod.parse;Ye(e,"propValues",o=>{let a={},s=0;for(let c of o.def.options){let u=c._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${o.def.options.indexOf(c)}"`);u[o.def.discriminator]?.has(void 0)&&s++;for(let[l,d]of Object.entries(u)){Object.prototype.hasOwnProperty.call(a,l)||Sn(a,l,new Set);for(let p of d)a[l].add(p)}}return!o.def.unionFallback&&s>1&&a[o.def.discriminator]?.delete(void 0),a}),t.options.forEach((o,a)=>{let s=Ha(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${a}"`)});let i=Za(()=>ZP(t));e._zod.parse=(o,a)=>{let s=o.value;if(!Fo(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let c=s?.[t.discriminator],u=i.value.get(c);return u&&(c!==void 0||a.direction!=="backward")?u._zod.run(o,a):t.unionFallback||a.direction==="backward"?r(o,a):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()).filter(l=>i.value.get(l)!==null),input:s,path:[t.discriminator],inst:e}),o)}}),HA=R("$ZodIntersection",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>{let o=r.value,a=t.left._zod.run({value:o,issues:[]},i),s=t.right._zod.run({value:o,issues:[]},i);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([u,l])=>CP(r,u,l)):CP(r,a,s)}});mp=R("$ZodTuple",(e,t)=>{Ze.init(e,t);let r=t.items,i=pn.memoizer;i?.attach(e),e._zod.parse=(o,a)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=i?i.alloc(e,o,[],a):[];let c=[],u=PP(r,"optin"),l=PP(r,"optout");if(!t.rest){if(s.length<u)return o.issues.push({code:"too_small",minimum:u,inclusive:!0,input:s,inst:e,origin:"array"}),o;s.length>r.length&&o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:s,inst:e,origin:"array"})}let d=new Array(r.length),p=t.rest?a?.abortEarly:void 0,h=!1;for(let f=0;f<r.length;f++){let m=r[f]._zod.run({value:s[f],issues:[]},a);m instanceof Promise?c.push(m.then(g=>{d[f]=g})):(d[f]=m,p&&!h&&m.issues.length&&(h=$n(m)))}if(t.rest&&!h){let f=r.length-1,m=s.slice(r.length),g=o.issues.length;for(let A of m){if(p&&o.issues.length!==g){if($n(o,g))break;g=o.issues.length}f++;let C=t.rest._zod.run({value:A,issues:[]},a);C instanceof Promise?c.push(C.then(w=>OP(w,o,f))):OP(C,o,f)}}return c.length?Promise.all(c).then(()=>TP(d,o,r,s,l)):TP(d,o,r,s,l)}});GA=R("$ZodRecord",(e,t)=>{Ze.init(e,t);let r=pn.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!vr(a))return i.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),i;let s=[],c=t.keyType._zod.values;if(c&&!t.partial){i.value=r?r.alloc(e,i,{},o):{};let u=new Set;for(let d of c)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){if(u.add(typeof d=="number"?d.toString():d),d==="__proto__")continue;let p=t.keyType._zod.run({value:d,issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(p.issues.length){i.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(m=>Kn(m,o,Bt())),input:d,path:[d],inst:e});continue}let h=p.value;if(h==="__proto__")continue;let f=t.valueType._zod.run({value:a[d],issues:[]},o);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...Gn(d,m.issues)),i.value[h]=m.value})):(f.issues.length&&i.issues.push(...Gn(d,f.issues)),i.value[h]=f.value)}let l;for(let d in a)if(!u.has(d))if(t.mode==="loose"){if(d==="__proto__")continue;i.value[d]=a[d]}else l=l??[],l.push(d);l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:l,continue:!0})}else{i.value=r?r.alloc(e,i,{},o):{};let u;for(let l of Reflect.ownKeys(a)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(a,l))continue;let d=t.keyType._zod.run({value:l,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&vi.test(l)&&d.issues.length){let m=t.keyType._zod.run({value:Number(l),issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(d=m)}if(d.issues.length){t.mode==="loose"?i.value[l]=a[l]:c?(u=u??[],u.push(l)):i.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Kn(m,o,Bt())),input:l,path:[l],inst:e});continue}let h=d.value;if(h==="__proto__")continue;let f=t.valueType._zod.run({value:a[l],issues:[]},o);f instanceof Promise?s.push(f.then(m=>{m.issues.length&&i.issues.push(...Gn(l,m.issues)),i.value[h]=m.value})):(f.issues.length&&i.issues.push(...Gn(l,f.issues)),i.value[h]=f.value)}u&&u.length>0&&i.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:u,continue:!0})}return s.length?Promise.all(s).then(()=>i):i}}),KA=R("$ZodMap",(e,t)=>{Ze.init(e,t);let r=pn.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!(a instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:a,inst:e}),i;let s=[];i.value=r?r.alloc(e,i,new Map,o):new Map;let c=o?.abortEarly,u=i.issues.length;for(let[l,d]of a){if(c&&i.issues.length!==u){if($n(i,u))break;u=i.issues.length}let p=t.keyType._zod.run({value:l,issues:[]},o),h=t.valueType._zod.run({value:d,issues:[]},o);p instanceof Promise||h instanceof Promise?s.push(Promise.all([p,h]).then(([f,m])=>{RP(f,m,i,l,a,e,o)})):RP(p,h,i,l,a,e,o)}return s.length?Promise.all(s).then(()=>i):i},zA(e,DV)});WA=R("$ZodSet",(e,t)=>{Ze.init(e,t);let r=pn.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!(a instanceof Set))return i.issues.push({input:a,inst:e,expected:"set",code:"invalid_type"}),i;let s=[];i.value=r?r.alloc(e,i,new Set,o):new Set;let c=o?.abortEarly,u=i.issues.length;for(let l of a){if(c&&i.issues.length!==u){if($n(i,u))break;u=i.issues.length}let d=t.valueType._zod.run({value:l,issues:[]},o);d instanceof Promise?s.push(d.then(p=>NP(p,i))):NP(d,i)}return s.length?Promise.all(s).then(()=>i):i},zA(e,$V)});JA=R("$ZodEnum",(e,t)=>{Ze.init(e,t);let r=Ba(t.entries),i=new Set(r);e._zod.values=i,Ye(e,"pattern",o=>{let a=Ba(o.def.entries).filter(s=>Hc.has(typeof s));return new RegExp(a.length?`^(${a.map(s=>wr(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,a)=>{let s=o.value;return i.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),QA=R("$ZodLiteral",(e,t)=>{Ze.init(e,t);let r=new Set(t.values);e._zod.values=r,Ye(e,"pattern",i=>{let o=i.def.values;return new RegExp(o.length?`^(${o.map(a=>typeof a=="string"?wr(a):a?wr(a.toString()):String(a)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(i,o)=>{let a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),i}}),YA=R("$ZodFile",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:e}),r}}),XA=R("$ZodTransform",(e,t)=>{Ze.init(e,t),e._zod.optin="optional",pn.memoizer?.guard(e),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ui(e.constructor.name);let o=t.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Wn;return r.value=o,r}});fp=R("$ZodOptional",(e,t)=>{Ze.init(e,t),Ye(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ye(e,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Ye(e,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${Si(i.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},i);return o instanceof Promise?o.then(a=>DP(r,a)):DP(r,o)}return t.innerType._zod.run(r,i)}}),ex=R("$ZodExactOptional",(e,t)=>{fp.init(e,t),Ye(e,"values",r=>r.def.innerType._zod.values),Ye(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),tx=R("$ZodNullable",(e,t)=>{Ze.init(e,t),Ye(e,"optin",r=>r.def.innerType._zod.optin),Ye(e,"optout",r=>r.def.innerType._zod.optout),Ye(e,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${Si(i.source)}|null)$`):void 0}),Ye(e,"values",r=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),nx=R("$ZodDefault",(e,t)=>{Ze.init(e,t),e._zod.optin="defaulted",Ye(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(a=>$P(a,t)):$P(o,t)}});rx=R("$ZodPrefault",(e,t)=>{Ze.init(e,t),e._zod.optin="defaulted",Ye(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),ix=R("$ZodNonOptional",(e,t)=>{Ze.init(e,t),Ye(e,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,i)=>{let o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(a=>jP(a,e)):jP(o,e)}});ox=R("$ZodSuccess",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ui("ZodSuccess");let o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(a=>(r.value=a.issues.length===0,r)):(r.value=o.issues.length===0,r)}});ax=R("$ZodCatch",(e,t)=>{Ze.init(e,t),Ye(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ye(e,"optout",r=>r.def.innerType._zod.optout),Ye(e,"values",r=>r.def.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let o=t.innerType._zod.run({value:r.value,issues:[]},i);return o instanceof Promise?o.then(a=>LP(r,a,t,i)):LP(r,o,t,i)}}),sx=R("$ZodNaN",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),hp=R("$ZodPipe",(e,t)=>{Ze.init(e,t),Ye(e,"values",r=>r.def.in._zod.values),Ye(e,"optin",r=>r.def.in._zod.optin),Ye(e,"optout",r=>r.def.out._zod.optout),Ye(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){let a=t.out._zod.run(r,i);return a instanceof Promise?a.then(s=>Qd(s,t.in,i)):Qd(a,t.in,i)}let o=t.in._zod.run(r,i);return o instanceof Promise?o.then(a=>Qd(a,t.out,i)):Qd(o,t.out,i)}});fu=R("$ZodCodec",(e,t)=>{Ze.init(e,t),Ye(e,"values",r=>r.def.in._zod.values),Ye(e,"optin",r=>r.def.in._zod.optin),Ye(e,"optout",r=>r.def.out._zod.optout),Ye(e,"propValues",r=>r.def.in._zod.propValues),e._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let a=t.in._zod.run(r,i);return a instanceof Promise?a.then(s=>Yd(s,t,i)):Yd(a,t,i)}else{let a=t.out._zod.run(r,i);return a instanceof Promise?a.then(s=>Yd(s,t,i)):Yd(a,t,i)}}});cx=R("$ZodPreprocess",(e,t)=>{hp.init(e,t)}),ux=R("$ZodReadonly",(e,t)=>{Ze.init(e,t),Ye(e,"propValues",r=>r.def.innerType._zod.propValues),Ye(e,"values",r=>r.def.innerType._zod.values),Ye(e,"optin",r=>r.def.innerType?._zod?.optin),Ye(e,"optout",r=>r.def.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);let o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(MP):MP(o)}});lx=R("$ZodTemplateLiteral",(e,t)=>{Ze.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let o=eA(i);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);r.push(Si(o))}else if(i===null||Dy.has(typeof i))r.push(wr(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(i,o)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"string",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),i)}),dx=R("$ZodFunction",(e,t)=>(Ze.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return Object.defineProperty(function(...i){let o=e._def.input?Nd(e._def.input,i):i,a=Reflect.apply(r,this,o);return e._def.output?Nd(e._def.output,a):a},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return Object.defineProperty(async function(...i){let o=e._def.input?await Dd(e._def.input,i):i,a=await Reflect.apply(r,this,o);return e._def.output?await Dd(e._def.output,a):a},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let i=e.constructor;return Array.isArray(r[0])?new i({type:"function",input:new mp({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new i({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let i=e.constructor;return new i({type:"function",input:e._def.input,output:r})},e)),px=R("$ZodPromise",(e,t)=>{Ze.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},i))}),hu=R("$ZodLazy",(e,t)=>{Ze.init(e,t),Ty(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Ye(e,"pattern",r=>r.innerType?._zod?.pattern),Ye(e,"propValues",r=>r.innerType?._zod?.propValues),Ye(e,"optin",r=>r.innerType?._zod?.optin??void 0),Ye(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),mx=R("$ZodCustom",(e,t)=>{Ct.init(e,t),Ze.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{let i=r.value,o=t.fn(i);if(o instanceof Promise)return o.then(a=>FP(a,r,i,e));FP(o,r,i,e)}})});function KP(e){return e!==null&&typeof e=="object"}function fx(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}function yu(e,t,r){let i=WP.get(e);if(i!==void 0)return i?gu:ns;if(t.has(e))return gu;t.add(e);let o=ns,a=d=>{if(o!==gu&&d?._zod){let p=yu(d,t,r);p>o&&(o=p)}},s=(d,p)=>{let h=ns;for(let f of Reflect.ownKeys(d)){let m=Object.getOwnPropertyDescriptor(d,f);if(p&&!m.enumerable)continue;let g=m.get?bp:m.value?._zod?yu(m.value,t,r):ns;g>h&&(h=g)}return h},c=d=>{d>o&&(o=d)},u=e._zod.def,l=u.type;switch(l){case"object":{let d=Ha(u);c(d?s(d,!0):bp),a(u.catchall);break}case"array":a(u.element);break;case"tuple":for(let d of u.items)a(d);a(u.rest);break;case"record":case"map":a(u.keyType),a(u.valueType);break;case"set":a(u.valueType);break;case"union":for(let d of u.options)a(d);break;case"intersection":a(u.left),a(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":a(u.innerType);break;case"pipe":a(u.in),a(u.out);break;case"function":a(u.input),a(u.output);break;case"lazy":{let d=u._cachedInner??(r?e._zod.innerType:void 0);c(d?yu(d,t,!1):bp);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let d in u){let p=Object.getOwnPropertyDescriptor(u,d);if(!p||p.get)continue;let h=p.value;if(!(!h||typeof h!="object")){if(h._zod)a(h);else if(Array.isArray(h))for(let f of h)a(f)}}}return t.delete(e),MV(e,o)}function MV(e,t){return t!==bp&&WP.set(e,t===gu),t}function xp(e){return yu(e,new Set,!0)!==ns}function FV(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}function bu(){return zV}function Sp(e,t){let r=e[hx]?.backEdges;return r!==void 0&&KP(t)&&r.has(t)}var Ap,hx,GP,WP,ns,bp,gu,gp,yp,zV,gx=x(()=>{Xt();Ap=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},hx="~memo",GP=[];WP=new WeakMap,ns=0,bp=1,gu=2;yp=[],zV={alloc(e,t,r){let i=gp;if(!i)return r;gp=void 0;let o={value:r,issues:null};return i.set(t.value,o),yp.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,i=(o,a)=>{if(a.direction!=="backward"&&Sp(a,o.value))throw new Ap;return r(o,a)};e._zod.parse=i,e._zod.run===r&&(e._zod.run=i)})},attach(e){var t;let r,i=!1,o,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,l)=>{if(r===void 0){let C=yu(e,new Set,!1);if(C===ns)return e._zod.parse=s,e._zod.run===c&&(e._zod.run=s),s(u,l);C===gu||i?r=!0:i=!0}let d=u.value;if(!KP(d))return s(u,l);let p=l[hx];p||(p={buckets:new WeakMap,backEdges:void 0},l[hx]=p);let h;o===l?h=a:(h=FV(p,e),o=l,a=h);let f=h.get(d);if(f)return u.value=f.value,f.issues?f.issues.length&&u.issues.push(...fx(f.issues)):(u.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(f.value)),u;gp=h;let m=yp.length,g=s(u,l);gp=void 0;let A=yp.length>m?yp.pop():void 0;return g instanceof Promise?g.then(C=>(A&&(A.issues=C.issues.length?fx(C.issues):GP),C)):(A&&(A.issues=g.issues.length?fx(g.issues):GP),g)};e._zod.parse=c,e._zod.run===s&&(e._zod.run=c)})}}});function vp(){return{localeError:UV()}}var UV,yx=x(()=>{Xt();UV=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(a){return e[a]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};function o(a,s){return a==="number"&&typeof s=="number"&&!Number.isFinite(s)?String(s):i[a]??a}return a=>{switch(a.code){case"invalid_type":{let s=o(a.expected),c=Ly(a.input),u=o(c,a.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":return a.values.length===1?`Invalid input: expected ${Pd(a.values[0])}`:`Invalid option: expected one of ${kd(a.values,"|")}`;case"too_big":{let s=a.exact?"exactly ":a.inclusive?"<=":"<",c=t(a.origin);return c?`Too big: expected ${a.origin??"value"} to have ${s}${a.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${a.origin??"value"} to be ${s}${a.maximum.toString()}`}case"too_small":{let s=a.exact?"exactly ":a.inclusive?">=":">",c=t(a.origin);return c?`Too small: expected ${a.origin} to have ${s}${a.minimum.toString()} ${c.unit}`:`Too small: expected ${a.origin} to be ${s}${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??a.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${a.divisor}`;case"unrecognized_keys":return`Unrecognized key${a.keys.length>1?"s":""}: ${kd(a.keys,", ")}`;case"invalid_key":return`Invalid key in ${a.origin}`;case"invalid_union":return a.options&&Array.isArray(a.options)&&a.options.length>0?`Invalid discriminator value. Expected ${a.options.map(c=>`'${c}'`).join(" | ")}`:a.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${a.origin}`;default:return"Invalid input"}}}});var Au={};Ie(Au,{en:()=>vp});var bx=x(()=>{yx()});function _p(){return new wp}var JP,Ax,xx,wp,vn,xu=x(()=>{Ax=Symbol("ZodOutput"),xx=Symbol("ZodInput"),wp=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let i=r[0];return this._map.set(t,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(JP=globalThis).__zod_globalRegistry??(JP.__zod_globalRegistry=_p());vn=globalThis.__zod_globalRegistry});function BV(e,t){try{return kp(e,{assertOnly:!0})}catch{return t}}function _x(e,t){try{let r=kp(e),i=Ip(e,r);return i._zod.bag.validator=BV(e,r),i}catch(r){if(t?.strict)throw r;return e}}function Ip(e,t){if(xp(e))throw new it("a schema whose subtree contains a reference cycle");let r=xt(e),i=e._zod.run,o=i.__originalRun??i,a=(s,c)=>{if(c?.async||c?.direction==="backward"||c?.skipChecks||c?.[QP]||c&&Sp(c,s.value))return o(s,c);let u=t(s.value);return u!==jn?(s.value=u,s):(c&&(c[QP]=!0),o(s,c))};return a.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=a,i.__originalRun||qV(r,e,t),r}function qV(e,t,r){let i=e,o=t;if(typeof o.safeParse=="function"){let a=o.safeParse;i.safeParse=(s,c)=>{let u=r(s);return u!==jn?{success:!0,data:u}:a(s,c)}}if(typeof o.parse=="function"){let a=o.parse;i.parse=(s,c)=>{let u=r(s);return u!==jn?u:a(s,c)}}}function kp(e,t){let r=!0;try{r=xp(e)}catch{}if(r)throw new it("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},o=new Bo(["input"]),a=Mt(o,i,e,"input",!t?.assertOnly);o.write(a===null?"return true;":`return ${a};`);let s=["INVALID",...i.constants.keys()],c=[jn,...i.constants.values()],u=o.content.join(`
|
|
57
|
+
`),l=t?.debug?s.length>0?`// Constants: ${s.join(", ")}
|
|
58
|
+
${u}`:u:"",d=Function,p=`return (input) => {
|
|
59
|
+
${u}
|
|
60
|
+
}`,h;try{h=new d(...s,p)(...c)}catch(f){throw new it(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(h.code=l),h.definite=i.definite,h}function ze(e,t){for(let[i,o]of e.constants)if(o===t)return i;let r=`c${e.constantCounter++}`;return e.constants.set(r,t),r}function Ho(e,t){return e.definite=!1,ze(e,t)}function Ne(e){return`v${e.varCounter++}`}function ZV(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return jn;let i=r;return i.issues.length===0?i.value:jn}function kn(e,t,r,i,o=!0){let a=e.content.length,s=t.constants.size,c=t.constantCounter,u=t.varCounter;try{return Mt(e,t,r,i,o)}catch(l){if(!(l instanceof it)||!l.islandable)throw l;if(e.content.length=a,t.constants.size>s){let d=Array.from(t.constants.keys()).slice(s);for(let p of d)t.constants.delete(p)}return t.constantCounter=c,t.varCounter=u,HV(e,t,r,i)}}function HV(e,t,r,i){t.definite=!1;let o=ze(t,r),a=ze(t,ZV),s=Ne(t);return e.write(`const ${s} = ${a}(${o}, ${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function KV(e,t,r,i){let o=r._zod.def.checks;if(!o||o.length===0)return i;let a=i;for(let s of o){let c=s._zod.def;if(c.when&&!GV.has(c.check))throw new it('check with a custom "when" condition');switch(c.check){case"greater_than":WV(e,t,c,a);break;case"less_than":JV(e,t,c,a);break;case"multiple_of":QV(e,t,c,a);break;case"number_format":rO(e,c,a);break;case"min_length":{let u=Vi(c.minimum,"min_length"),l=Sx(e,t,a,`${a}.length >= ${u} && ${a}.length < ${c.minimum*2}`);e.write(`if (${l} < ${u}) return INVALID;`);break}case"max_length":{let u=Vi(c.maximum,"max_length"),l=Sx(e,t,a,`${a}.length > ${u}`);e.write(`if (${l} > ${u}) return INVALID;`);break}case"length_equals":{let u=Vi(c.length,"length_equals"),l=Sx(e,t,a,`${a}.length >= ${u} && ${a}.length <= ${c.length*2}`);e.write(`if (${l} !== ${u}) return INVALID;`);break}case"min_size":e.write(`if (${a}.size < ${Vi(c.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${a}.size > ${Vi(c.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${a}.size !== ${Vi(c.size,"size_equals")}) return INVALID;`);break;case"string_format":a=iO(e,t,c,a);break;case"custom":a=rB(e,t,s,a);break;case"bigint_format":YV(e,c,a);break;case"mime_type":XV(e,t,c,a);break;case"property":tB(e,t,c,a);break;case"properties":eB(e,t,c,a);break;case"overwrite":{let u=Ne(t);nB(e,t,s,a,u),a=u;break}default:throw new it(`check type ${c.check}`)}}return a}function Sx(e,t,r,i){let o=ze(t,zo),a=Ne(t);return e.write(`const ${a} = typeof ${r} === "string" && ${i} ? ${o}(${r}) : ${r}.length;`),a}function Vi(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new it(`${t} bound of type ${typeof e}`);return`${e}`}function nO(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new it("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new it("comparison check with Invalid Date bound");return ze(e,t)}throw new it(`comparison check bound of type ${typeof t}`)}function WV(e,t,r,i){let o=r.inclusive?"<":"<=";e.write(`if (${i} ${o} ${nO(t,r.value)}) return INVALID;`)}function JV(e,t,r,i){let o=r.inclusive?">":">=";e.write(`if (${i} ${o} ${nO(t,r.value)}) return INVALID;`)}function QV(e,t,r,i){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new it("multiple_of check with a zero divisor");e.write(`if (${i} % ${r.value}n !== 0n) return INVALID;`)}else{let o=ze(t,qc);e.write(`if (${o}(${i}, ${Vi(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function rO(e,t,r){let i=t.format;switch(i){case"safeint":e.write(`if (!Number.isSafeInteger(${r})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${r}) || ${r} < -2147483648 || ${r} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${r}) || ${r} < 0 || ${r} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${r}) || ${r} < -3.4028234663852886e38 || ${r} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${r})) return INVALID;`);break;default:throw new it(`number format ${i}`)}}function YV(e,t,r){let i=t.format;if(i)switch(i){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break;default:throw new it(`bigint format ${i}`)}}function XV(e,t,r,i){let o=r.mime;if(o&&o.length>0){let a=ze(t,new Set(o));e.write(`if (!${a}.has(${i}.type)) return INVALID;`)}}function eB(e,t,r,i){if(r.when)throw new it('check with a custom "when" condition');e.write(`if (${i} == null) return INVALID;`);let o=r.shape;for(let a of Reflect.ownKeys(o)){let s=typeof a=="symbol"?ze(t,a):Dn(a),c=Ne(t);e.write(`const ${c} = ${i}[${s}];`),kn(e,t,o[a],c,!1)}}function tB(e,t,r,i){let o=`${i}[${JSON.stringify(r.property)}]`;Mt(e,t,r.schema,o)}function nB(e,t,r,i,o){let a=r._zod.def.tx;if(!a)throw new it("overwrite check without a transform function");if(Go(a))throw new Fr("z.compile: async overwrite transforms are not supported");let s=ze(t,a);e.write(`const ${o} = ${s}(${i});`)}function vx(){throw new Wn}function Ix(e){this.issues.push(e)}function rB(e,t,r,i){let o=r._zod.def;if(o.fn){if(Go(o.fn))throw new Fr("z.compile: async .refine() predicates are not supported");let a=Ho(t,o.fn),s=ze(t,vx),c=Ne(t);return e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} instanceof Promise) ${s}();`),e.write(`if (!${c}) return INVALID;`),i}if(r._zod.check){if(Go(r._zod.check))throw new Fr("z.compile: async .superRefine() / check functions are not supported");let a=r._zod.check,c=Ho(t,l=>{let d={value:l,issues:[],addIssue:Ix};return a(d)instanceof Promise&&vx(),d.issues.length===0?d.value:jn}),u=Ne(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),u}throw new it("custom check without a predicate or check function")}function iO(e,t,r,i,o=!0){let a=r.format;if(a==="base64"){let l=ze(t,lu);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="base64url"){let l=ze(t,sp);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="jwt"){let l=ze(t,lp),d=ze(t,r.alg??null);return e.write(`if (!${l}(${i}, ${d})) return INVALID;`),i}if(a==="ipv6"){let l=ze(t,uu);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="cidrv6"){let l=ze(t,op);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="credit_card"){let l=ze(t,cp);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="iban"){let l=ze(t,up);return e.write(`if (!${l}(${i})) return INVALID;`),i}let s=r;if(a==="url"||a==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let l=ze(t,np),d=ze(t,r),p=Ne(t),h=Ne(t);if(e.write(`const ${p} = ${i}.trim();`),e.write(`const ${h} = ${l}(${p}, ${d});`),e.write(`if (typeof ${h} === "number") return INVALID;`),s.hostname!==void 0){let g=ze(t,rp);e.write(`if (!${g}(${h}, ${d}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let g=ze(t,ip);e.write(`if (!${g}(${h}, ${d}.protocol)) return INVALID;`)}if(!o)return null;let f=Ne(t),m=s.normalize?`${h}.href`:`${ze(t,cu)}(${p})`;return e.write(`const ${f} = ${m};`),f}let c=r.fn;if(c){if(Go(c))throw new it(`async string format ${a}`);let l=ze(t,c);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(iB.has(a)&&r.pattern){let l=ze(t,r.pattern);return e.write(`${l}.lastIndex = 0;`),e.write(`if (!${l}.test(${i})) return INVALID;`),i}let u=r.format;switch(u){case"regex":throw new it("regex format without a pattern");case"lowercase":e.write(`if (${i} !== ${i}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${i} !== ${i}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${i}.includes(${Dn(r.includes)})) return INVALID;`);break;case"starts_with":{let l=r.prefix;e.write(`if (${i}.slice(0, ${l.length}) !== ${Dn(l)}) return INVALID;`);break}case"ends_with":{let l=r.suffix;e.write(`if (${i}.slice(-${l.length}) !== ${Dn(l)}) return INVALID;`);break}default:throw new it(`string format ${u}`)}return i}function Mt(e,t,r,i,o=!0){let a=r._zod.def,s=a.type;if(a.coerce)throw new it(`coercion (z.coerce.${s}())`);let c=o||!!a.checks?.length,u;switch(s){case"string":u=oB(e,t,r,i,c);break;case"number":u=aB(e,r,i);break;case"boolean":u=sB(e,i);break;case"bigint":u=cB(e,r,i);break;case"symbol":u=uB(e,i);break;case"undefined":u=lB(e,i);break;case"null":u=dB(e,i);break;case"any":case"unknown":u=i;break;case"never":e.write("return INVALID;"),u=i;break;case"void":u=pB(e,i);break;case"nan":u=mB(e,i);break;case"date":u=fB(e,i);break;case"object":u=hB(e,t,r,i,c);break;case"optional":u=gB(e,t,r,i,c);break;case"nullable":u=AB(e,t,r,i,c);break;case"array":u=xB(e,t,r,i,c);break;case"literal":u=SB(e,t,r,i);break;case"enum":u=vB(e,t,r,i);break;case"readonly":{let l=XP(e,t,r,i),d=Ne(t);e.write(`const ${d} = Object.freeze(${l});`),u=d;break}case"success":XP(e,t,r,i),u="true";break;case"default":case"prefault":u=wB(e,t,r,i);break;case"nonoptional":u=_B(e,t,r,i);break;case"tuple":u=IB(e,t,r,i);break;case"union":u=kB(e,t,r,i);break;case"intersection":u=PB(e,t,r,i);break;case"record":u=OB(e,t,r,i);break;case"map":u=RB(e,t,r,i);break;case"set":u=NB(e,t,r,i);break;case"file":u=DB(e,i);break;case"template_literal":u=$B(e,t,r,i);break;case"lazy":u=jB(e,t,r,i);break;case"pipe":u=LB(e,t,r,i);break;case"custom":u=MB(e,t,r,i);break;case"transform":u=UB(e,t,r,i);break;case"catch":u=zB(e,t,r,i);break;default:throw new it(`schema type ${s}`)}return u===null?null:KV(e,t,r,u)}function oB(e,t,r,i,o=!0){e.write(`if (typeof ${i} !== "string") return INVALID;`);let a=r._zod.def;return a.format===void 0?i:iO(e,t,a,i,o)}function aB(e,t,r){e.write(`if (typeof ${r} !== "number" || !Number.isFinite(${r})) return INVALID;`);let i=t._zod.def;return i.check==="number_format"&&i.format&&rO(e,{format:i.format},r),r}function sB(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function cB(e,t,r){e.write(`if (typeof ${r} !== "bigint") return INVALID;`);let i=t._zod.def;if(i.format)switch(i.format){case"int64":e.write(`if (${r} < -9223372036854775808n || ${r} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${r} < 0n || ${r} > 18446744073709551615n) return INVALID;`);break}return r}function uB(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function lB(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function dB(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function pB(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function mB(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function fB(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function hB(e,t,r,i,o=!0){let a=r._zod.def;e.write(`if (typeof ${i} !== "object" || ${i} === null || Array.isArray(${i})) return INVALID;`);let s=a.shape,c=Object.keys(s),u=Object.getOwnPropertySymbols(s),l=u.length?[...c,...u]:c,d=w=>typeof w=="symbol"?ze(t,w):Dn(w),p=w=>typeof w=="symbol"?`[${d(w)}]`:Dn(w),h=s;if(c.includes("__proto__"))throw new it('object shape key "__proto__"');let f=new Map;for(let w of l){let E=h[w],I=d(w),F=Ne(t);if(e.write(`const ${F} = ${i}[${I}];`),E._zod.optin!==void 0){let L=Ne(t);e.write(`let ${L} = (() => {`),e.indented(q=>{let H=kn(q,t,E,F);q.write(`return ${H};`)}),e.write("})();"),E._zod.optout==="optional"?(e.write(`if (${L} === INVALID) {`),e.indented(q=>{q.write(`if (${I} in ${i}) return INVALID;`),q.write(`${L} = undefined;`)}),e.write("}")):e.write(`if (${L} === INVALID) return INVALID;`),f.set(w,L)}else{bB(E)&&e.write(`if (!(${I} in ${i})) return INVALID;`);let L=kn(e,t,E,F,o);L!==null&&f.set(w,L)}}let m=a.catchall,g="none";if(m){let w=m._zod.def.type;if(w==="never"){let E=c.map(I=>`k !== ${Dn(I)}`).join(" && ")||"true";e.write(`for (const k in ${i}) {`),e.indented(I=>{I.write(`if (${E}) return INVALID;`)}),e.write("}")}else(w==="unknown"||w==="any")&&!m._zod.def.checks?.length?g="passthrough":g="schema"}let A=Ne(t),C=l.some(w=>YP(h[w])||wx(h[w]));if(!o){if(g==="schema"){let w=c.length>0?ze(t,new Set(c)):null;e.write(`for (const k in ${i}) {`),e.indented(E=>{E.write('if (k === "__proto__") continue;'),w&&E.write(`if (${w}.has(k)) continue;`);let I=Ne(t);E.write(`const ${I} = ${i}[k];`),kn(E,t,m,I,!1)}),e.write("}")}return null}if(C){e.write(`const ${A} = {};`);for(let w of l){let E=d(w),I=f.get(w);wx(h[w])?e.write(`if (${E} in ${i}) ${A}[${E}] = ${I};`):YP(h[w])?e.write(`if (${I} !== undefined || ${E} in ${i}) ${A}[${E}] = ${I};`):e.write(`${A}[${E}] = ${I};`)}}else{let w=l.map(E=>`${p(E)}: ${f.get(E)}`).join(", ");e.write(`const ${A} = { ${w} };`)}if(g!=="none"){let w=c.length>0?ze(t,new Set(c)):null;e.write(`for (const k in ${i}) {`),e.indented(E=>{if(E.write('if (k === "__proto__") continue;'),w&&E.write(`if (${w}.has(k)) continue;`),g==="passthrough")E.write(`${A}[k] = ${i}[k];`);else{let I=Ne(t);E.write(`const ${I} = ${i}[k];`);let F=kn(E,t,m,I);E.write(`${A}[k] = ${F};`)}}),e.write("}")}return A}function gB(e,t,r,i,o=!0){let a=r._zod.def;if(yB(r))return Mt(e,t,a.innerType,i,o);if(a.innerType._zod.optin==="defaulted"){let c=Ne(t),u=Ne(t);return e.write(`let ${c};`),e.write(`if (${i} === undefined) {`),e.indented(l=>{l.write(`const ${u} = (() => {`),l.indented(d=>{let p=Mt(d,t,a.innerType,i);d.write(`return ${p};`)}),l.write("})();"),l.write(`if (${u} !== INVALID) ${c} = ${u};`)}),e.write("} else {"),e.indented(l=>{let d=Mt(l,t,a.innerType,i);l.write(`${c} = ${d};`)}),e.write("}"),c}let s=o?Ne(t):null;return s&&e.write(`let ${s};`),e.write(`if (${i} !== undefined) {`),e.indented(c=>{let u=Mt(c,t,a.innerType,i,o);s&&u!==null&&c.write(`${s} = ${u};`)}),e.write("}"),s}function yB(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function bB(e){return e._zod.optin===void 0&&Zo(e)}function Zo(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?Zo(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?Zo(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Zo):!0;case"intersection":return!t.left||!t.right?!0:Zo(t.left)&&Zo(t.right);case"pipe":return t.in?Zo(t.in):!0;default:return!0}}function wx(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function YP(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&rs(e)}function rs(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?rs(t.innerType):!0;case"union":return t.options?t.options.some(rs):!0;case"intersection":return!t.left||!t.right||rs(t.left)||rs(t.right);case"pipe":return t.out?rs(t.out):!0;default:return!0}}function AB(e,t,r,i,o=!0){let a=r._zod.def,s=o?Ne(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${i} !== null) {`),e.indented(c=>{let u=Mt(c,t,a.innerType,i,o);s&&u!==null&&c.write(`${s} = ${u};`)}),e.write("}"),s}function kx(e,t,r){for(let[i,o]of Ga(t._zod.def.checks))e.write(`if (${r} > ${Vi(i,o._zod.def.check)}) return INVALID;`)}function xB(e,t,r,i,o=!0){let a=r._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`),kx(e,r,`${i}.length`);let s=o?Ne(t):null,c=Ne(t),u=Ne(t);return s&&e.write(`const ${s} = new Array(${i}.length);`),e.write(`for (let ${c} = 0; ${c} < ${i}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${u} = ${i}[${c}];`);let d=kn(l,t,a.element,u,o);s&&d!==null&&l.write(`${s}[${c}] = ${d};`)}),e.write("}"),s}function SB(e,t,r,i){let a=r._zod.def.values;if(a.length!==1){let c=ze(t,new Set(a));return e.write(`if (!${c}.has(${i})) return INVALID;`),i}let s=a[0];if(typeof s=="number"&&Number.isNaN(s)){let c=ze(t,new Set(a));return e.write(`if (!${c}.has(${i})) return INVALID;`),i}if(typeof s=="string")e.write(`if (${i} !== ${Dn(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${i} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${i} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${i} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${i} !== ${s}n) return INVALID;`);else throw new it(`literal type ${typeof s}`);return i}function vB(e,t,r,i){let o=r._zod.values;if(!o)throw new it("enum schema without enumerated values");let a=ze(t,o);return e.write(`if (!${a}.has(${i})) return INVALID;`),i}function XP(e,t,r,i){let o=r._zod.def;return Mt(e,t,o.innerType,i)}function wB(e,t,r,i){let o=r._zod.def,s=Object.getOwnPropertyDescriptor(r._zod.def,"defaultValue")?()=>r._zod.def.defaultValue:void 0;if(r._zod.def.type==="prefault"){if(!s)return Mt(e,t,o.innerType,i);let u=ze(t,s),l=Ne(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${u}();`),Mt(e,t,o.innerType,l)}let c=Ne(t);if(s){let u=ze(t,s),l=ze(t,Zc);e.write(`let ${c};`),e.write(`if (${i} === undefined) {`),e.indented(d=>{d.write(`${c} = ${l}(${u}());`)}),e.write("} else {"),e.indented(d=>{let p=Mt(d,t,o.innerType,i);d.write(`${c} = ${p} === undefined ? ${l}(${u}()) : ${p};`)}),e.write("}")}else e.write(`let ${c};`),e.write(`if (${i} !== undefined) {`),e.indented(u=>{let l=Mt(u,t,o.innerType,i);u.write(`${c} = ${l};`)}),e.write("}");return c}function _B(e,t,r,i){let o=r._zod.def,a=Mt(e,t,o.innerType,i),s=Ne(t);return e.write(`const ${s} = ${a};`),e.write(`if (${s} === undefined) return INVALID;`),s}function IB(e,t,r,i){let o=r._zod.def,a=o.items,s=o.rest;e.write(`if (!Array.isArray(${i})) return INVALID;`);let c=eO(a,"optin"),u=eO(a,"optout");s?e.write(`if (${i}.length < ${c}) return INVALID;`):e.write(`if (${i}.length < ${c} || ${i}.length > ${a.length}) return INVALID;`);let l=Ne(t);e.write(`const ${l} = [];`);for(let d=0;d<a.length;d++){let p=a[d];if(d>=u)e.write(`if (${l}.length === ${d}) {`),e.indented(h=>{h.write(`if (${d} < ${i}.length) {`),h.indented(f=>{let m=Ne(t);f.write(`const ${m} = ${i}[${d}];`);let g=kn(f,t,p,m);f.write(`${l}[${d}] = ${g};`)}),h.write("} else {"),h.indented(f=>{if(wx(p)){f.write(`${l}.length = ${d};`);return}let m=Ne(t),g=Ne(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(A=>{let C=kn(A,t,p,m);A.write(`return ${C};`)}),f.write("})();"),f.write(`if (${g} === INVALID || ${g} === undefined) ${l}.length = ${d};`),f.write(`else ${l}[${d}] = ${g};`)}),h.write("}")}),e.write("}");else{let h=Ne(t);e.write(`const ${h} = ${i}[${d}];`);let f=kn(e,t,p,h);e.write(`${l}[${d}] = ${f};`)}}if(s){let d=Ne(t),p=Ne(t);e.write(`for (let ${d} = ${a.length}; ${d} < ${i}.length; ${d}++) {`),e.indented(h=>{h.write(`const ${p} = ${i}[${d}];`);let f=kn(h,t,s,p);h.write(`${l}[${d}] = ${f};`)}),e.write("}")}return l}function eO(e,t){for(let r=e.length-1;r>=0;r--)if(!(t==="optin"?e[r]._zod.optin!==void 0:e[r]._zod.optout==="optional"))return r+1;return 0}function kB(e,t,r,i){let o=r._zod.def,a=o.options;if(o.discriminator)return EB(e,t,o,i);if(o.inclusive===!1)throw new it("exclusive unions (z.xor)");if(a.length===0)return e.write("return INVALID;"),i;if(a.length===1)return Mt(e,t,a[0],i);if(a.every(u=>u._zod.def.type==="literal"&&!u._zod.def.checks?.length)){let u=new Set(a.flatMap(d=>d._zod.def.values)),l=ze(t,u);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let c=Ne(t);e.write(`let ${c};`);for(let u=0;u<a.length;u++){let l=a[u];u===0?e.write(`${c} = (() => {`):e.write(`if (${c} === INVALID) ${c} = (() => {`),e.indented(d=>{let p=Mt(d,t,l,i);d.write(`return ${p};`)}),e.write("})();")}return e.write(`if (${c} === INVALID) return INVALID;`),c}function EB(e,t,r,i){if(r.unionFallback)throw new it("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),i;let o=Ne(t),a=Ne(t);e.write(`const ${o} = ${i}?.[${Dn(r.discriminator)}];`),e.write(`let ${a};`);let s=!0,c=new Set;for(let u of r.options){let l=u._zod.propValues?.[r.discriminator];if(!l||l.size===0)throw new it("discriminated union option without static discriminator values");for(let h of l){if(c.has(h))throw new it(`duplicate discriminator value ${String(h)}`);c.add(h)}let d=Array.from(l,h=>CB(t,o,h)),p=s?"if":"else if";e.write(`${p} (${d.join(" || ")}) {`),e.indented(h=>{let f=Mt(h,t,u,i);h.write(`${a} = ${f};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),a}function CB(e,t,r){if(typeof r=="string")return`${t} === ${Dn(r)}`;if(typeof r=="number")return Number.isNaN(r)?`Number.isNaN(${t})`:`${t} === ${r}`;if(typeof r=="boolean")return`${t} === ${r}`;if(r===null)return`${t} === null`;if(r===void 0)return`${t} === undefined`;if(typeof r=="bigint")return`${t} === ${r}n`;if(typeof r=="symbol"){let i=ze(e,r);return`${t} === ${i}`}throw new it(`literal discriminator value ${String(r)}`)}function PB(e,t,r,i){let o=r._zod.def;t.definite=!1;let a=kn(e,t,o.left,i),s=kn(e,t,o.right,i),c=ze(t,es),u=Ne(t);return e.write(`const ${u} = ${c}(${a}, ${s});`),e.write(`if (!${u}.valid) return INVALID;`),`${u}.data`}function OB(e,t,r,i){let o=r._zod.def,a=ze(t,vr);e.write(`if (!${a}(${i})) return INVALID;`);let s=Ne(t),c=Ne(t),u=Ne(t);e.write(`const ${s} = {};`);let l=o,d=l.partial?void 0:o.keyType._zod.values;if(d){let f=[];for(let g of d){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new it(`record key value ${String(g)}`);let A=typeof g=="number"?g.toString():g;if(A==="__proto__")throw new it('record key "__proto__"');f.push(A);let C=ze(t,g),w=Mt(e,t,o.keyType,C),E=Ne(t);e.write(`const ${E} = ${i}[${TB(t,A)}];`);let I=kn(e,t,o.valueType,E);e.write(`${s}[${w}] = ${I};`)}let m=ze(t,new Set(f));return e.write(`for (const ${c} in ${i}) {`),e.indented(g=>{g.write(`if (${m}.has(${c})) continue;`),l.mode==="loose"?g.write(`if (${c} !== "__proto__") ${s}[${c}] = ${i}[${c}];`):g.write("return INVALID;")}),e.write("}"),s}let p=o.keyType._zod.def;if(!(p.type==="string"&&p.format===void 0&&!p.coerce&&(p.checks?.length??0)===0)){let f=o.mode==="loose",m=kp(o.keyType);m.definite===!1&&(t.definite=!1);let g=ze(t,m),A=ze(t,vi),C=Ne(t);return tO(e,t,i,c,w=>{w.write(`let ${C} = ${g}(${c});`),w.write(`if (${C} === INVALID && typeof ${c} === "string" && ${A}.test(${c})) ${C} = ${g}(Number(${c}));`),f?w.write(`if (${C} === INVALID) { ${s}[${c}] = ${i}[${c}]; continue; }`):w.write(`if (${C} === INVALID) return INVALID;`),w.write(`if (${C} === "__proto__") continue;`);let E=Ne(t);w.write(`const ${E} = ${i}[${c}];`);let I=kn(w,t,o.valueType,E);w.write(`${s}[${C}] = ${I};`)}),s}return tO(e,t,i,c,f=>{f.write(`const ${u} = ${i}[${c}];`);let m=kn(f,t,o.valueType,u);f.write(`${s}[${c}] = ${m};`)},"return INVALID;"),s}function tO(e,t,r,i,o,a){let s=ze(t,Object.prototype.propertyIsEnumerable),c=Ne(t),u=Ne(t),l=Ne(t);e.write(`const ${c} = Object.getOwnPropertySymbols(${r});`),e.write(`const ${u} = Object.getOwnPropertyNames(${r});`),e.write(`for (let ${l} = 0; ${l} < ${u}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${i} = ${u}[${l}];`),d.write(`if (${i} === "__proto__" || !${s}.call(${r}, ${i})) continue;`),o(d)}),e.write("}"),e.write(`for (let ${l} = 0; ${l} < ${c}.length; ${l}++) {`),e.indented(d=>{d.write(`const ${i} = ${c}[${l}];`),d.write(`if (!${s}.call(${r}, ${i})) continue;`),a?d.write(a):o(d)}),e.write("}")}function TB(e,t){return typeof t=="string"?Dn(t):ze(e,t)}function RB(e,t,r,i){let o=r._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`),kx(e,r,`${i}.size`);let a=Ne(t),s=Ne(t),c=Ne(t);return e.write(`const ${a} = new Map();`),e.write(`for (const [${s}, ${c}] of ${i}) {`),e.indented(u=>{let l=Mt(u,t,o.keyType,s),d=Mt(u,t,o.valueType,c);u.write(`${a}.set(${l}, ${d});`)}),e.write("}"),a}function NB(e,t,r,i){let o=r._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`),kx(e,r,`${i}.size`);let a=Ne(t),s=Ne(t);return e.write(`const ${a} = new Set();`),e.write(`for (const ${s} of ${i}) {`),e.indented(c=>{let u=Mt(c,t,o.valueType,s);c.write(`${a}.add(${u});`)}),e.write("}"),a}function DB(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function $B(e,t,r,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let a=ze(t,o);e.write(`${a}.lastIndex = 0;`),e.write(`if (!${a}.test(${i})) return INVALID;`)}return i}function jB(e,t,r,i){let o=r._zod.def,a=Ho(t,o.getter),s=ze(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(u=>{u.write(`const inner = ${a}();`),u.write(`${s}.parser = function(input) {`),u.indented(l=>{l.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),l.write("return result.issues.length === 0 ? result.value : INVALID;")}),u.write("};")}),e.write("}");let c=Ne(t);return e.write(`const ${c} = ${s}.parser(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}function LB(e,t,r,i){let o=r._zod.def,a=Mt(e,t,o.in,i);if(o.transform){if(Go(o.transform))throw new Fr("z.compile: async transforms in pipes are not supported");let s=o.transform,u=Ho(t,d=>{let p={value:d,issues:[],addIssue:Ix},h=s(d,p);return h instanceof Promise?jn:p.issues.length===0?h:jn}),l=Ne(t);return e.write(`const ${l} = ${u}(${a});`),e.write(`if (${l} === INVALID) return INVALID;`),Mt(e,t,o.out,l)}else return Mt(e,t,o.out,a)}function Go(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function MB(e,t,r,i){let o=r._zod.def;if(o.fn){if(Go(o.fn))throw new Fr("z.compile: async custom predicates are not supported");let a=Ho(t,o.fn),s=ze(t,vx),c=Ne(t);e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} instanceof Promise) ${s}();`),e.write(`if (!${c}) return INVALID;`)}else throw new it("custom schema without a predicate function");return i}function FB(e,t,r){let i=e._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return jn;let o=i;return o.issues.length===0?o.value:t()}function zB(e,t,r,i){let o=r._zod.def;if(!o.catchValue[Td])throw new it("catch with a callback (only a constant catch value compiles)",!1);let a=Ne(t);e.write(`let ${a} = (() => {`),e.indented(l=>{let d=kn(l,t,o.innerType,i);l.write(`return ${d};`)}),e.write("})();");let s=ze(t,o.innerType),c=Ho(t,o.catchValue),u=ze(t,FB);return e.write(`if (${a} === INVALID) {`),e.indented(l=>{l.write(`${a} = ${u}(${s}, ${c}, ${i});`),l.write(`if (${a} === INVALID) return INVALID;`)}),e.write("}"),a}function UB(e,t,r,i){let o=r._zod.def;if(o.transform){if(Go(o.transform))throw new Fr("z.compile: async transforms are not supported");let a=o.transform,c=Ho(t,l=>{let d={value:l,issues:[],addIssue:Ix},p=a(l,d);return p instanceof Promise?jn:d.issues.length===0?p:jn}),u=Ne(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),u}return i}var jn,QP,Fr,it,GV,iB,oO=x(()=>{zi();Jd();gx();Vo();ts();Xt();jn=Symbol.for("zod.compile.invalid"),QP=Symbol.for("zod.compile.fallback"),Fr=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},it=class extends Error{constructor(t,r=!0){super(`z.compile does not support ${t}; this schema must use the runtime parser`),this.name="ZodCompileUnsupportedError",this.islandable=r}};GV=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);iB=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"])});function Ep(e){return e.checks&&(e.checks=[...e.checks]),e}function Ex(e,t){return new e(Ep({type:"string",...ce(t)}))}function Cx(e,t){return new e(Ep({type:"string",coerce:!0,...ce(t)}))}function Cp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ce(t)})}function Pp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ce(t)})}function Op(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ce(t)})}function Tp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ce(t)})}function Rp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ce(t)})}function Np(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ce(t)})}function Su(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ce(t)})}function Dp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ce(t)})}function $p(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ce(t)})}function jp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ce(t)})}function Lp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ce(t)})}function Mp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ce(t)})}function Fp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ce(t)})}function zp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ce(t)})}function Up(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ce(t)})}function Vp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ce(t)})}function Px(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ce(t)})}function Bp(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ce(t)})}function qp(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ce(t)})}function Zp(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ce(t)})}function Hp(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ce(t)})}function Gp(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ce(t)})}function Ox(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...ce(t)})}function Tx(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...ce(t)})}function Kp(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ce(t)})}function vu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ce(t)})}function wu(e,t){return new e({type:"string",format:"date",check:"string_format",...ce(t)})}function _u(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ce(t)})}function Iu(e,t){return new e({type:"string",format:"duration",check:"string_format",...ce(t)})}function Nx(e,t){return new e(Ep({type:"number",checks:[],...ce(t)}))}function Dx(e,t){return new e(Ep({type:"number",coerce:!0,checks:[],...ce(t)}))}function $x(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ce(t)})}function jx(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ce(t)})}function Lx(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ce(t)})}function Mx(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ce(t)})}function Fx(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ce(t)})}function zx(e,t){return new e({type:"boolean",...ce(t)})}function Ux(e,t){return new e({type:"boolean",coerce:!0,...ce(t)})}function Vx(e,t){return new e({type:"bigint",...ce(t)})}function Bx(e,t){return new e({type:"bigint",coerce:!0,...ce(t)})}function qx(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ce(t)})}function Zx(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ce(t)})}function Hx(e,t){return new e({type:"symbol",...ce(t)})}function Gx(e,t){return new e({type:"undefined",...ce(t)})}function Kx(e,t){return new e({type:"null",...ce(t)})}function Wx(e){return new e({type:"any"})}function Jx(e){return new e({type:"unknown"})}function Qx(e,t){return new e({type:"never",...ce(t)})}function Yx(e,t){return new e({type:"void",...ce(t)})}function Xx(e,t){return new e({type:"date",...ce(t)})}function eS(e,t){return new e({type:"date",coerce:!0,...ce(t)})}function tS(e,t){return new e({type:"nan",...ce(t)})}function oi(e,t){return new Gd({check:"less_than",...ce(t),value:e,inclusive:!1})}function or(e,t){return new Gd({check:"less_than",...ce(t),value:e,inclusive:!0})}function ai(e,t){return new Kd({check:"greater_than",...ce(t),value:e,inclusive:!1})}function ar(e,t){return new Kd({check:"greater_than",...ce(t),value:e,inclusive:!0})}function Wp(e){return ai(0,e)}function Jp(e){return oi(0,e)}function Qp(e){return or(0,e)}function Yp(e){return ar(0,e)}function Bi(e,t){return new Nb({check:"multiple_of",...ce(t),value:e})}function qi(e,t){return new jb({check:"max_size",...ce(t),maximum:e})}function si(e,t){return new Lb({check:"min_size",...ce(t),minimum:e})}function Ko(e,t){return new Mb({check:"size_equals",...ce(t),size:e})}function Wo(e,t){return new Fb({check:"max_length",...ce(t),maximum:e})}function wi(e,t){return new zb({check:"min_length",...ce(t),minimum:e})}function Jo(e,t){return new Ub({check:"length_equals",...ce(t),length:e})}function is(e,t){return new Vb({check:"string_format",format:"regex",...ce(t),pattern:e})}function os(e){return new Bb({check:"string_format",format:"lowercase",...ce(e)})}function as(e){return new qb({check:"string_format",format:"uppercase",...ce(e)})}function ss(e,t){return new Zb({check:"string_format",format:"includes",...ce(t),includes:e})}function cs(e,t){return new Hb({check:"string_format",format:"starts_with",...ce(t),prefix:e})}function us(e,t){return new Gb({check:"string_format",format:"ends_with",...ce(t),suffix:e})}function Xp(e,t,r){return new Kb({check:"property",property:e,schema:t,...ce(r)})}function ls(e,t){return new Wb({check:"properties",shape:e,...ce(t)})}function ds(e,t){return new Jb({check:"mime_type",mime:e,...ce(t)})}function zr(e){return new Qb({check:"overwrite",tx:e})}function ps(e){return zr(t=>t.normalize(e))}function ms(){return zr(e=>e.trim())}function fs(){return zr(e=>e.toLowerCase())}function hs(){return zr(e=>e.toUpperCase())}function gs(){return zr(e=>Ry(e))}function nS(e,t,r){return new e({type:"array",element:t,...ce(r)})}function VB(e,t,r){return new e({type:"union",options:t,...ce(r)})}function BB(e,t,r){return new e({type:"union",options:t,inclusive:!1,...ce(r)})}function qB(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...ce(i)})}function ZB(e,t,r){return new e({type:"intersection",left:t,right:r})}function HB(e,t,r,i){let o=r instanceof Ze,a=o?i:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...ce(a)})}function GB(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...ce(i)})}function KB(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...ce(i)})}function WB(e,t,r){return new e({type:"set",valueType:t,...ce(r)})}function JB(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:i,...ce(r)})}function QB(e,t,r){return new e({type:"enum",entries:t,...ce(r)})}function YB(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ce(r)})}function rS(e,t){return new e({type:"file",...ce(t)})}function XB(e,t){return new e({type:"transform",transform:t})}function e5(e,t){return new e({type:"optional",innerType:t})}function t5(e,t){return new e({type:"nullable",innerType:t})}function n5(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Zc(r)}})}function r5(e,t,r){return new e({type:"nonoptional",innerType:t,...ce(r)})}function i5(e,t){return new e({type:"success",innerType:t})}function o5(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:Fy(r)})}function a5(e,t,r){return new e({type:"pipe",in:t,out:r})}function s5(e,t){return new e({type:"readonly",innerType:t})}function c5(e,t,r){return new e({type:"template_literal",parts:t,...ce(r)})}function u5(e,t){return new e({type:"lazy",getter:t})}function l5(e,t){return new e({type:"promise",innerType:t})}function iS(e,t,r){let i=ce(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function oS(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ce(r)})}function aS(e,t){let r=aO(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(Ka(o,i.value,r._zod.def));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=r),a.continue??(a.continue=!r._zod.def.abort),i.issues.push(Ka(a))}},e(i.value,i)),t);return r}function aO(e,t){let r=new Ct({check:"custom",...ce(t)});return r._zod.check=e,r}function sS(e){let t=new Ct({check:"describe"});return t._zod.onattach=[r=>{let i=vn.get(r)??{};vn.add(r,{...i,description:e})}],t._zod.check=()=>{},t}function cS(e){let t=new Ct({check:"meta"});return t._zod.onattach=[r=>{let i=vn.get(r)??{};vn.add(r,{...i,...e})}],t._zod.check=()=>{},t}function uS(e,t){let r=ce(t),i=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(f=>typeof f=="string"?f.toLowerCase():f),o=o.map(f=>typeof f=="string"?f.toLowerCase():f));let a=new Set(i),s=new Set(o),c=e.Codec??fu,u=e.Boolean??pu,l=e.String??qo,d=new l({type:"string",error:r.error}),p=new u({type:"boolean",error:r.error}),h=new c({type:"pipe",in:d,out:p,transform:((f,m)=>{let g=f;return r.case!=="sensitive"&&(g=g.toLowerCase()),a.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:m.value,inst:h,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?i[0]||"true":o[0]||"false"),error:r.error});return h._zod.bag.truthy=i,h._zod.bag.falsy=o,h._zod.bag.case=r.case??"insensitive",h}function Qo(e,t,r,i={}){let o=ce(i),a={check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:c=>r.test(c),...o};return r instanceof RegExp&&(a.pattern=r),new e(a)}var Rx,sO=x(()=>{Wd();xu();ts();Xt();Rx={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function ku(e,...t){for(let r of t)for(let i of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,i)&&Sn(e,i,r[i]);return e}function Zi(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??vn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function on(e,t,r,i,o){let a=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:i.path,message:o}):t.unrepresentable;if(a==="any")return!1;if(a===void 0||a==="throw")throw new Error(o);return Object.assign(r,a),!0}function vt(e,t,r={path:[],schemaPath:[]}){var i;let o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let h=s.schema,f=t.processors[o.type];if(!f)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);f(e,t,h,d)}let p=e._zod.parent;p&&(s.ref||(s.ref=p),vt(p,t,d),t.seen.get(p).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&ku(s.schema,u),t.io==="input"&&Ln(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function cO(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Hi(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let i=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=i.get(c);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(c,s[0])}}let o=s=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,h=e.external.uri??(m=>m);if(p)return{ref:h(p)};let f=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=f,{defId:f,ref:`${h("__shared")}#/${c}/${cO(f)}`}}let u="#",l=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:l+cO(d)}},a=s=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:l}=o(s);c.def={...c.schema},l&&(c.defId=l);let d=c.schema;for(let p in d)delete d[p];d.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
61
|
+
|
|
62
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){a(s);continue}if(e.external){let l=e.external.registry.get(s[0])?.id;if(t!==s[0]&&l){a(s);continue}}if(e.metadataRegistry.get(s[0])?.id){a(s);continue}if(c.cycle){a(s);continue}c.count>1&&e.reused==="ref"&&a(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function dO(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let i of t){if(!i||typeof i!="object")return;dO(i);let o=Object.keys(i);if(o.length!==1||o[0]!=="type")return;let a=i.type;for(let s of Array.isArray(a)?a:[a]){if(typeof s!="string")return;r.includes(s)||r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}function lO(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function lS(e){let t=[];for(let a of e){if(typeof a!="object"||a.type!=="object")return null;for(let s in a)if(!pO.has(s))return null;t.push(a)}let r={},i=new Set;for(let a of t){for(let s in a.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let l of t){let d=l.properties?.[s]??lO(l);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let u=c.length===1?c[0]:lS(c)??{allOf:c};Sn(r,s,u)}for(let s of a.required??[])i.add(s)}let o={type:"object",properties:r};if(i.size&&(o.required=[...i]),t.every(a=>a.additionalProperties===!1))o.additionalProperties=!1;else{let a=[];for(let s of t){let c=lO(s);c&&!a.some(u=>JSON.stringify(u)===JSON.stringify(c))&&a.push(c)}a.length===1?o.additionalProperties=a[0]:a.length>1&&(o.additionalProperties={allOf:a})}return o}function d5(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of pO)if(o in e)return;let r=t.filter(o=>uO.some(a=>Array.isArray(o[a]))),i=null;if(!r.length)i=lS(t);else{let o=r[0],a=uO.find(u=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter(u=>u!==o),c=o[a].map(u=>lS([...s,u]));if(c.some(u=>!u))return;i={[a]:c}}i&&(delete e.allOf,ku(e,i))}function Gi(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=c=>{let u=e.seen.get(c);if(u.ref===null)return;let l=u.def??u.schema,d={...l},p=u.ref;if(u.ref=null,p){i(p);let f=e.seen.get(p),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):ku(l,m),ku(l,d),c._zod.parent===p)for(let A in l)A==="$ref"||A==="allOf"||A in d||delete l[A];if(m.$ref&&f.def)for(let A in l)A==="$ref"||A==="allOf"||A in f.def&&JSON.stringify(l[A])===JSON.stringify(f.def[A])&&delete l[A]}let h=c._zod.parent;if(h&&h!==p){i(h);let f=e.seen.get(h);if(f?.schema.$ref&&(l.$ref=f.schema.$ref,f.def))for(let m in l)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(l[m])===JSON.stringify(f.def[m])&&delete l[m]}e.override({zodSchema:c,jsonSchema:l,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())i(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())dO(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let l of[u.schema,u.def]){let d=l?.allOf;if(!Array.isArray(d))continue;let p=c.get(d);p?p.push(l):c.set(d,[l])}for(let u of e.intersections)for(let l of c.get(u)??[])d5(l)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}ku(o,r.defId?r.schema:r.def??r.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&o.id===a&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,Sn(s,u.defId,u.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:ys(t,"input",e.processors),output:ys(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Ln(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let i=e._zod.def;if(i.type==="transform")return!0;if(i.type==="array")return Ln(i.element,r);if(i.type==="set")return Ln(i.valueType,r);if(i.type==="lazy")return Ln(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault"||i.type==="catch")return Ln(i.innerType,r);if(i.type==="intersection")return Ln(i.left,r)||Ln(i.right,r);if(i.type==="record"||i.type==="map")return Ln(i.keyType,r)||Ln(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Ln(i.in,r)||Ln(i.out,r);if(i.type==="object"){for(let o in i.shape)if(Ln(i.shape[o],r))return!0;return!1}if(i.type==="union"){for(let o of i.options)if(Ln(o,r))return!0;return!1}if(i.type==="tuple"){for(let o of i.items)if(Ln(o,r))return!0;return!!(i.rest&&Ln(i.rest,r))}return!1}var pO,uO,dS,ys,Eu=x(()=>{xu();Xt();pO=new Set(["type","properties","required","additionalProperties"]),uO=["oneOf","anyOf"];dS=(e,t={})=>r=>{let i=Zi({...r,processors:t});return vt(e,i),Hi(i,e),Gi(i,e)},ys=(e,t,r={})=>i=>{let{libraryOptions:o,target:a}=i??{},s=Zi({...o??{},target:a,io:t,processors:r});return vt(e,s),Hi(s,e),Gi(s,e)}});function an(e){let t={},r=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let a of i)p5[a._zod.def.check]?.(t,a._zod.def);let o=e._zod.bag;o.minimum!==void 0&&bs(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&bs(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&As(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&As(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&yO(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&AO(t,o.mime);for(let a of o.patterns??[])bO(t,a);return t}function Cu(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Cu(t.out):t.type==="catch"?Cu(t.innerType):e._zod.optin}function pS(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let m=e.get(t)?.def;if(!m)return t;let g=pS(e,m,r);return g===m?t:g}for(let m of["anyOf","oneOf"]){let g=t[m];if(!Array.isArray(g))continue;let A=g.map(C=>pS(e,C,r));A.some((C,w)=>C!==g[w])&&(t={...t,[m]:A})}let i=Array.isArray(t.type)?t.type:[t.type],o=!i.includes("string")&&i.some(m=>m==="number"||m==="integer"),a=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!a?.some(m=>typeof m=="number"))return t;let{minimum:s,maximum:c,exclusiveMinimum:u,exclusiveMaximum:l,multipleOf:d,format:p,id:h,...f}=t;return f.enum?f.enum=f.enum.map(m=>typeof m=="number"?String(m):m):typeof f.const=="number"&&(f.const=String(f.const)),o&&(f.type="string",a||(f.pattern=(i.includes("number")?vi:iu).source)),f}function h5(e){let t=new Map;for(let i of e.seen.values())i.def&&!t.has(i.schema)&&t.set(i.schema,i);let r=new Map;for(let i of mS.get(e)??[]){let o=e.seen.get(i),a=(o?.def??o?.schema)?.propertyNames;if(!a||a===!0||r.has(a))continue;let s=pS(t,a,new Set);s!==a&&r.set(a,s)}if(r.size)for(let i of e.seen.values())for(let o of[i.schema,i.def]){let a=o&&r.get(o.propertyNames);a&&(o.propertyNames=a)}}function vO(e,t,r,i,o){let a=!1,s=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(a=!0,null));return a?(on(t,r,i,o,"BigInt defaults cannot be represented in JSON Schema"),qS):JSON.parse(s)}function rm(e,t){if("_idmap"in e){let i=e,o=Zi({...t,processors:em}),a={};for(let u of i._idmap.entries()){let[l,d]=u;vt(d,o)}let s={},c={registry:i,uri:t?.uri,defs:a};o.external=c;for(let u of i._idmap.entries()){let[l,d]=u;Hi(o,d),Sn(s,l,Gi(o,d))}if(Object.keys(a).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:a}}return{schemas:s}}let r=Zi({...t,processors:em});return vt(e,r),Hi(r,e),Gi(r,e)}var bs,As,mO,yO,bO,AO,xO,fO,hO,gO,p5,m5,f5,SO,fS,hS,gS,yS,bS,AS,xS,SS,vS,wS,_S,IS,kS,ES,CS,PS,OS,TS,RS,NS,DS,$S,jS,LS,MS,tm,FS,zS,mS,US,VS,BS,qS,ZS,HS,GS,KS,WS,JS,nm,QS,em,Pu=x(()=>{Vo();ts();Eu();Xt();bs=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},As=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},mO=(e,t)=>{bs(e,"minimum",t),As(e,"maximum",t)},yO=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},bO=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},AO=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},xO=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},fO=(e,t)=>bs(e,"minimum",t.minimum),hO=(e,t)=>As(e,"maximum",t.maximum),gO=e=>(t,r)=>{xO(t,r.format);let[i,o]=e[r.format];bs(t,"minimum",i),As(t,"maximum",o)},p5={greater_than:(e,t)=>bs(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>As(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>yO(e,t.value),number_format:gO(Gc),bigint_format:gO(Kc),min_length:fO,max_length:hO,length_equals:(e,t)=>mO(e,t.length),min_size:fO,max_size:hO,size_equals:(e,t)=>mO(e,t.size),string_format:(e,t)=>{xO(e,t.format),t.pattern&&bO(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>AO(e,t.mime)};m5={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},f5=new Map([[ap,mb],[du,fb]]),SO=e=>f5.get(e)??e,fS=(e,t,r,i)=>{let o=r;o.type="string";let{minimum:a,maximum:s,format:c,patterns:u,contentEncoding:l,laxFormat:d}=an(e);if(typeof a=="number"&&(o.minLength=a),typeof s=="number"&&(o.maxLength=s),c&&(o.format=m5[c]??c,o.format===""&&delete o.format,(c==="time"||d)&&delete o.format),l&&(o.contentEncoding=l),u&&u.size>0){let p=[...u].map(SO);p.length===1?o.pattern=p[0].source:p.length>1&&(o.allOf=[...p.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},hS=(e,t,r,i)=>{let o=r,{minimum:a,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l,isInt:d}=an(e);o.type=d?"integer":"number";let p=typeof l=="number"&&l>=(a??Number.NEGATIVE_INFINITY),h=typeof u=="number"&&u<=(s??Number.POSITIVE_INFINITY),f=t.target==="draft-04"||t.target==="openapi-3.0";if(p?f?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof a=="number"&&(o.minimum=a),h?f?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof s=="number"&&(o.maximum=s),c){let m=new Set;for(let C of c)Number.isFinite(C)&&C!==0?m.add(Math.abs(C)):on(e,t,o,i,`A multipleOf divisor of ${C} cannot be represented in JSON Schema`);let[g,...A]=m;g!==void 0&&(o.multipleOf=g),A.length&&(o.allOf=[...o.allOf??[],...A.map(C=>({multipleOf:C}))])}},gS=(e,t,r,i)=>{r.type="boolean"},yS=(e,t,r,i)=>{on(e,t,r,i,"BigInt cannot be represented in JSON Schema")},bS=(e,t,r,i)=>{on(e,t,r,i,"Symbols cannot be represented in JSON Schema")},AS=(e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},xS=(e,t,r,i)=>{on(e,t,r,i,"Undefined cannot be represented in JSON Schema")},SS=(e,t,r,i)=>{on(e,t,r,i,"Void cannot be represented in JSON Schema")},vS=(e,t,r,i)=>{r.not={}},wS=(e,t,r,i)=>{},_S=(e,t,r,i)=>{},IS=(e,t,r,i)=>{on(e,t,r,i,"Date cannot be represented in JSON Schema")},kS=(e,t,r,i)=>{let o=e._zod.def,a=Ba(o.entries);if(a.length===0){r.not={};return}a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),r.enum=a},ES=(e,t,r,i)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let a=[];for(let s of o.values)if(s===void 0){if(on(e,t,r,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(on(e,t,r,i,"BigInt literals cannot be represented in JSON Schema"))return;a.push(Number(s))}else a.push(s);if(a.length!==0)if(a.length===1){let s=a[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else a.every(s=>typeof s=="number")&&(r.type="number"),a.every(s=>typeof s=="string")&&(r.type="string"),a.every(s=>typeof s=="boolean")&&(r.type="boolean"),a.every(s=>s===null)&&(r.type="null"),r.enum=a},CS=(e,t,r,i)=>{on(e,t,r,i,"NaN cannot be represented in JSON Schema")},PS=(e,t,r,i)=>{let o=r,a=e._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=a.source},OS=(e,t,r,i)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:a,maximum:s,mime:c}=an(e);a!==void 0&&(o.minLength=a),s!==void 0&&(o.maxLength=s),c&&(c.length===0?o.not={}:c.length===1?o.contentMediaType=c[0]:o.anyOf=c.map(u=>({contentMediaType:u})))},TS=(e,t,r,i)=>{r.type="boolean"},RS=(e,t,r,i)=>{on(e,t,r,i,"Custom types cannot be represented in JSON Schema")},NS=(e,t,r,i)=>{on(e,t,r,i,"Function types cannot be represented in JSON Schema")},DS=(e,t,r,i)=>{on(e,t,r,i,"Transforms cannot be represented in JSON Schema")},$S=(e,t,r,i)=>{on(e,t,r,i,"Map cannot be represented in JSON Schema")},jS=(e,t,r,i)=>{on(e,t,r,i,"Set cannot be represented in JSON Schema")},LS=(e,t,r,i)=>{let o=r,a=e._zod.def,{minimum:s,maximum:c}=an(e);typeof s=="number"&&(o.minItems=s),typeof c=="number"&&(o.maxItems=c),o.type="array",o.items=vt(a.element,t,{...i,path:[...i.path,"items"]})};MS=(e,t,r,i)=>{let o=r,a=e._zod.def,s=a.shape;if(Object.getOwnPropertySymbols(s).length&&on(e,t,o,i,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in s)Sn(o.properties,l,vt(s[l],t,{...i,path:[...i.path,"properties",l]}));let u=[];for(let l of Object.keys(s)){let d=a.shape[l];(t.io==="input"?Cu(d)===void 0:d._zod.optout===void 0)&&u.push(l)}u.length>0&&(o.required=u),a.catchall?._zod.def.type==="never"?o.additionalProperties=!1:a.catchall?a.catchall&&(o.additionalProperties=vt(a.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},tm=(e,t,r,i)=>{let o=e._zod.def,a=o.inclusive===!1,s=o.options.map((c,u)=>vt(c,t,{...i,path:[...i.path,a?"oneOf":"anyOf",u]}));a?r.oneOf=s:r.anyOf=s},FS=(e,t,r,i)=>{let o=e._zod.def,a=vt(o.left,t,{...i,path:[...i.path,"allOf",0]}),s=vt(o.right,t,{...i,path:[...i.path,"allOf",1]}),c=l=>"allOf"in l&&Object.keys(l).length===1,u=[...c(a)?a.allOf:[a],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)},zS=(e,t,r,i)=>{let o=r,a=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=a.items.map((g,A)=>vt(g,t,{...i,path:[...i.path,s,A]})),l=a.rest?vt(a.rest,t,{...i,path:[...i.path,c,...t.target==="openapi-3.0"?[a.items.length]:[]]}):null,d=a.items.length;for(;d>0;){let g=a.items[d-1];if(!(t.io==="input"?Cu(g)!==void 0:g._zod.optout==="optional"))break;d--}let p=a.items.length,h=!a.rest;t.target==="draft-2020-12"?(o.prefixItems=u,h?o.items=!1:l&&(o.items=l),d>0&&(o.minItems=d),h&&(o.maxItems=p)):t.target==="openapi-3.0"?(o.items={anyOf:u},l&&o.items.anyOf.push(l),d>0&&(o.minItems=d),h&&(o.maxItems=p)):(o.items=u,h?o.additionalItems=!1:l&&(o.additionalItems=l),d>0&&(o.minItems=d),h&&(o.maxItems=p));let{minimum:f,maximum:m}=an(e);typeof f=="number"&&(o.minItems=f),typeof m=="number"&&(o.maxItems=m)};mS=new WeakMap;US=(e,t,r,i)=>{let o=r,a=e._zod.def;o.type="object";let s=a.keyType,c=an(s).patterns;if(a.mode==="loose"&&c&&c.size>0){let d=vt(a.valueType,t,{...i,path:[...i.path,"patternProperties","*"]});o.patternProperties={};for(let p of c)Sn(o.patternProperties,SO(p).source,d)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=vt(a.keyType,t,{...i,path:[...i.path,"propertyNames"]});let d=mS.get(t);d||(d=[],mS.set(t,d),t.deferred.push(()=>h5(t))),d.push(e)}o.additionalProperties=vt(a.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let u=s._zod.values,l=t.io==="input"&&Cu(a.valueType)!==void 0;if(u&&!a.partial&&!l){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(o.required=d.map(String))}},VS=(e,t,r,i)=>{let o=e._zod.def,a=vt(o.innerType,t,i),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},BS=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType},qS=Symbol();ZS=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType;let s=vO(o.defaultValue,e,t,r,i);s!==qS&&(r.default=s)},HS=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);if(a.ref=o.innerType,t.io!=="input")return;let s=vO(o.defaultValue,e,t,r,i);s!==qS&&(r._prefault=s)},GS=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{on(e,t,r,i,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},KS=(e,t,r,i)=>{let o=e._zod.def,a=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?a?o.out:o.in:o.out;vt(s,t,i);let c=t.seen.get(e);c.ref=s},WS=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType,r.readOnly=!0},JS=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType},nm=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType},QS=(e,t,r,i)=>{let o=e._zod.innerType;vt(o,t,i);let a=t.seen.get(e);a.ref=o},em={string:fS,number:hS,boolean:gS,bigint:yS,symbol:bS,null:AS,undefined:xS,void:SS,never:vS,any:wS,unknown:_S,date:IS,enum:kS,literal:ES,nan:CS,template_literal:PS,file:OS,success:TS,custom:RS,function:NS,transform:DS,map:$S,set:jS,array:LS,object:MS,union:tm,intersection:FS,tuple:zS,record:US,nullable:VS,nonoptional:BS,default:ZS,prefault:HS,catch:GS,pipe:KS,readonly:WS,promise:JS,optional:nm,lazy:QS}});var im,wO=x(()=>{Pu();Eu();im=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Zi({processors:em,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return vt(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Hi(this.ctx,t);let i=Gi(this.ctx,t),{"~standard":o,...a}=i;return a}}});var _O={};var IO=x(()=>{});var _i={};Ie(_i,{$ZodAny:()=>$A,$ZodArray:()=>UA,$ZodAsyncError:()=>Wn,$ZodBase64:()=>wA,$ZodBase64URL:()=>_A,$ZodBigInt:()=>pp,$ZodBigIntFormat:()=>TA,$ZodBoolean:()=>pu,$ZodCIDRv4:()=>SA,$ZodCIDRv6:()=>vA,$ZodCUID:()=>uA,$ZodCUID2:()=>lA,$ZodCatch:()=>ax,$ZodCheck:()=>Ct,$ZodCheckBigIntFormat:()=>$b,$ZodCheckEndsWith:()=>Gb,$ZodCheckGreaterThan:()=>Kd,$ZodCheckIncludes:()=>Zb,$ZodCheckLengthEquals:()=>Ub,$ZodCheckLessThan:()=>Gd,$ZodCheckLowerCase:()=>Bb,$ZodCheckMaxLength:()=>Fb,$ZodCheckMaxSize:()=>jb,$ZodCheckMimeType:()=>Jb,$ZodCheckMinLength:()=>zb,$ZodCheckMinSize:()=>Lb,$ZodCheckMultipleOf:()=>Nb,$ZodCheckNumberFormat:()=>Db,$ZodCheckOverwrite:()=>Qb,$ZodCheckProperties:()=>Wb,$ZodCheckProperty:()=>Kb,$ZodCheckRegex:()=>Vb,$ZodCheckSizeEquals:()=>Mb,$ZodCheckStartsWith:()=>Hb,$ZodCheckStringFormat:()=>Xa,$ZodCheckUpperCase:()=>qb,$ZodCodec:()=>fu,$ZodCreditCard:()=>kA,$ZodCustom:()=>mx,$ZodCustomStringFormat:()=>PA,$ZodCyclicError:()=>Ap,$ZodDate:()=>FA,$ZodDefault:()=>nx,$ZodDiscriminatedUnion:()=>ZA,$ZodE164:()=>IA,$ZodEmail:()=>rA,$ZodEmoji:()=>sA,$ZodEncodeError:()=>Ui,$ZodEnum:()=>JA,$ZodError:()=>Zy,$ZodExactOptional:()=>ex,$ZodFile:()=>YA,$ZodFunction:()=>dx,$ZodGUID:()=>tA,$ZodIBAN:()=>EA,$ZodIPv4:()=>bA,$ZodIPv6:()=>AA,$ZodISODate:()=>hA,$ZodISODateTime:()=>fA,$ZodISODuration:()=>yA,$ZodISOTime:()=>gA,$ZodIntersection:()=>HA,$ZodJWT:()=>CA,$ZodKSUID:()=>mA,$ZodLazy:()=>hu,$ZodLiteral:()=>QA,$ZodMAC:()=>xA,$ZodMap:()=>KA,$ZodNaN:()=>sx,$ZodNanoID:()=>cA,$ZodNever:()=>LA,$ZodNonOptional:()=>ix,$ZodNull:()=>DA,$ZodNullable:()=>tx,$ZodNumber:()=>dp,$ZodNumberFormat:()=>OA,$ZodObject:()=>qP,$ZodObjectJIT:()=>VA,$ZodOptional:()=>fp,$ZodPipe:()=>hp,$ZodPrefault:()=>rx,$ZodPreprocess:()=>cx,$ZodPromise:()=>px,$ZodReadonly:()=>ux,$ZodRealError:()=>Jn,$ZodRecord:()=>GA,$ZodRegistry:()=>wp,$ZodSet:()=>WA,$ZodString:()=>qo,$ZodStringFormat:()=>St,$ZodSuccess:()=>ox,$ZodSymbol:()=>RA,$ZodTemplateLiteral:()=>lx,$ZodTransform:()=>XA,$ZodTuple:()=>mp,$ZodType:()=>Ze,$ZodULID:()=>dA,$ZodURL:()=>aA,$ZodUUID:()=>nA,$ZodUndefined:()=>NA,$ZodUnion:()=>mu,$ZodUnknown:()=>jA,$ZodVoid:()=>MA,$ZodXID:()=>pA,$ZodXor:()=>BA,$brand:()=>Vy,$constructor:()=>R,$input:()=>xx,$output:()=>Ax,Doc:()=>Bo,INVALID:()=>jn,JSONSchema:()=>_O,JSONSchemaGenerator:()=>im,NEVER:()=>Uy,TimePrecision:()=>Rx,URL_BAD_FORMAT:()=>iA,URL_UNPARSEABLE:()=>su,ZodCompileAsyncError:()=>Fr,ZodCompileUnsupportedError:()=>it,_any:()=>Wx,_array:()=>nS,_base64:()=>Zp,_base64url:()=>Hp,_bigint:()=>Vx,_boolean:()=>zx,_catch:()=>o5,_check:()=>aO,_cidrv4:()=>Bp,_cidrv6:()=>qp,_coercedBigint:()=>Bx,_coercedBoolean:()=>Ux,_coercedDate:()=>eS,_coercedNumber:()=>Dx,_coercedString:()=>Cx,_creditCard:()=>Ox,_cuid:()=>jp,_cuid2:()=>Lp,_custom:()=>iS,_date:()=>Xx,_decode:()=>jd,_decodeAsync:()=>Md,_default:()=>n5,_discriminatedUnion:()=>qB,_e164:()=>Gp,_email:()=>Cp,_emoji:()=>Dp,_encode:()=>$d,_encodeAsync:()=>Ld,_endsWith:()=>us,_enum:()=>JB,_file:()=>rS,_float32:()=>jx,_float64:()=>Lx,_gt:()=>ai,_gte:()=>ar,_guid:()=>Pp,_iban:()=>Tx,_includes:()=>ss,_int:()=>$x,_int32:()=>Mx,_int64:()=>qx,_intersection:()=>ZB,_ipv4:()=>Up,_ipv6:()=>Vp,_isoDate:()=>wu,_isoDateTime:()=>vu,_isoDuration:()=>Iu,_isoTime:()=>_u,_jwt:()=>Kp,_ksuid:()=>zp,_lazy:()=>u5,_length:()=>Jo,_literal:()=>YB,_lowercase:()=>os,_lt:()=>oi,_lte:()=>or,_mac:()=>Px,_map:()=>KB,_max:()=>or,_maxLength:()=>Wo,_maxSize:()=>qi,_mime:()=>ds,_min:()=>ar,_minLength:()=>wi,_minSize:()=>si,_multipleOf:()=>Bi,_nan:()=>tS,_nanoid:()=>$p,_nativeEnum:()=>QB,_negative:()=>Jp,_never:()=>Qx,_nonnegative:()=>Yp,_nonoptional:()=>r5,_nonpositive:()=>Qp,_normalize:()=>ps,_null:()=>Kx,_nullable:()=>t5,_number:()=>Nx,_optional:()=>e5,_overwrite:()=>zr,_parse:()=>Wa,_parseAsync:()=>Ja,_pipe:()=>a5,_positive:()=>Wp,_promise:()=>l5,_properties:()=>ls,_property:()=>Xp,_readonly:()=>s5,_record:()=>GB,_refine:()=>oS,_regex:()=>is,_safeDecode:()=>zd,_safeDecodeAsync:()=>Vd,_safeEncode:()=>Fd,_safeEncodeAsync:()=>Ud,_safeParse:()=>Qa,_safeParseAsync:()=>Ya,_set:()=>WB,_size:()=>Ko,_slugify:()=>gs,_startsWith:()=>cs,_string:()=>Ex,_stringFormat:()=>Qo,_stringbool:()=>uS,_success:()=>i5,_superRefine:()=>aS,_symbol:()=>Hx,_templateLiteral:()=>c5,_toLowerCase:()=>fs,_toUpperCase:()=>hs,_transform:()=>XB,_trim:()=>ms,_tuple:()=>HB,_uint32:()=>Fx,_uint64:()=>Zx,_ulid:()=>Mp,_undefined:()=>Gx,_union:()=>VB,_unknown:()=>Jx,_uppercase:()=>as,_url:()=>Su,_uuid:()=>Op,_uuidv4:()=>Tp,_uuidv6:()=>Rp,_uuidv7:()=>Np,_void:()=>Yx,_xid:()=>Fp,_xor:()=>BB,base64Charset:()=>ap,base64urlCharset:()=>du,canParseURL:()=>oA,clone:()=>xt,compile:()=>_x,compileFn:()=>kp,config:()=>Bt,createStandardJSONSchemaMethod:()=>ys,createToJSONSchemaMethod:()=>dS,decode:()=>W4,decodeAsync:()=>Q4,describe:()=>sS,encode:()=>K4,encodeAsync:()=>J4,extractDefs:()=>Hi,finalize:()=>Gi,flattenError:()=>Xc,formatError:()=>eu,getDiscriminatedOption:()=>qA,globalConfig:()=>pn,globalRegistry:()=>vn,handleUnrepresentable:()=>on,initializeContext:()=>Zi,isBackEdge:()=>Sp,isRecursiveSchema:()=>xp,isValidBase64:()=>lu,isValidBase64URL:()=>sp,isValidCIDRv6:()=>op,isValidCreditCard:()=>cp,isValidIBAN:()=>up,isValidIPv6:()=>uu,isValidJWT:()=>lp,locales:()=>Au,memoizer:()=>bu,mergeValues:()=>es,meta:()=>cS,parse:()=>Nd,parseAsync:()=>Dd,parseURLObject:()=>UP,prettifyError:()=>Gy,process:()=>vt,processSchema:()=>vt,regexes:()=>_r,registry:()=>_p,safeDecode:()=>X4,safeDecodeAsync:()=>tV,safeEncode:()=>Y4,safeEncodeAsync:()=>eV,safeParse:()=>B4,safeParseAsync:()=>q4,standardProps:()=>tp,stripTabAndNewline:()=>cu,toDotPath:()=>xP,toJSONSchema:()=>rm,toZod:()=>Bc,treeifyError:()=>Hy,urlHostnameOk:()=>rp,urlProtocolOk:()=>ip,util:()=>ke,validate:()=>tu,validateAsync:()=>nu,validateURL:()=>np,version:()=>Yb,withParser:()=>Ip});var sr=x(()=>{zi();Wy();Ky();ts();gx();Wd();Xb();Xt();Xt();Vo();bx();xu();Jd();oO();sO();Eu();Pu();wO();IO()});var om={};Ie(om,{endsWith:()=>us,gt:()=>ai,gte:()=>ar,includes:()=>ss,length:()=>Jo,lowercase:()=>os,lt:()=>oi,lte:()=>or,maxLength:()=>Wo,maxSize:()=>qi,mime:()=>ds,minLength:()=>wi,minSize:()=>si,multipleOf:()=>Bi,negative:()=>Jp,nonnegative:()=>Yp,nonpositive:()=>Qp,normalize:()=>ps,overwrite:()=>zr,positive:()=>Wp,properties:()=>ls,property:()=>Xp,regex:()=>is,size:()=>Ko,slugify:()=>gs,startsWith:()=>cs,toLowerCase:()=>fs,toUpperCase:()=>hs,trim:()=>ms,uppercase:()=>as});var am=x(()=>{sr()});function sm(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let i=r(this);return Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,t,{value:i,configurable:!0,writable:!0})}})}var kO,EO,YS,Qn,XS=x(()=>{sr();sr();Xt();kO=new WeakSet([Object.prototype,Error.prototype]);EO=(e,t)=>{Zy.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);kO.has(r)||(kO.add(r),sm(r,"format",i=>o=>eu(i,o)),sm(r,"flatten",i=>o=>Xc(i,o)),sm(r,"addIssue",i=>o=>{i.issues.push(o),i.message=JSON.stringify(i.issues,qa,2)}),sm(r,"addIssues",i=>o=>{i.issues.push(...o),i.message=JSON.stringify(i.issues,qa,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},YS=R("ZodError",EO),Qn=R("ZodError",EO,void 0,{Parent:Error})});var ev,tv,nv,rv,iv,ov,av,sv,cv,uv,lv,dv,pv=x(()=>{sr();XS();sr();ev=Wa(Qn),tv=Ja(Qn),nv=Qa(Qn),rv=Ya(Qn),iv=$d(Qn),ov=jd(Qn),av=Ld(Qn),sv=Md(Qn),cv=Fd(Qn),uv=zd(Qn),lv=Ud(Qn),dv=Vd(Qn)});var Es={};Ie(Es,{ZodAny:()=>vv,ZodArray:()=>kv,ZodBase64:()=>_m,ZodBase64URL:()=>Im,ZodBigInt:()=>Is,ZodBigIntFormat:()=>Cm,ZodBoolean:()=>_s,ZodCIDRv4:()=>vm,ZodCIDRv6:()=>wm,ZodCUID:()=>hm,ZodCUID2:()=>gm,ZodCatch:()=>Gv,ZodCodec:()=>Fu,ZodCreditCard:()=>fv,ZodCustom:()=>zu,ZodCustomStringFormat:()=>ta,ZodDate:()=>Nu,ZodDefault:()=>Uv,ZodDiscriminatedUnion:()=>Cv,ZodE164:()=>km,ZodEmail:()=>dm,ZodEmoji:()=>mm,ZodEnum:()=>Ss,ZodExactOptional:()=>Rm,ZodFile:()=>Lv,ZodFunction:()=>r0,ZodGUID:()=>pm,ZodIBAN:()=>hv,ZodIPv4:()=>xm,ZodIPv6:()=>Sm,ZodISODate:()=>Wi,ZodISODateTime:()=>Ki,ZodISODuration:()=>Qi,ZodISOTime:()=>Ji,ZodInstanceOf:()=>a0,ZodIntersection:()=>Pv,ZodJWT:()=>Em,ZodKSUID:()=>Am,ZodLazy:()=>e0,ZodLiteral:()=>jv,ZodMAC:()=>mv,ZodMap:()=>Dv,ZodNaN:()=>Wv,ZodNanoID:()=>fm,ZodNever:()=>_v,ZodNonOptional:()=>Nm,ZodNull:()=>xv,ZodNullable:()=>zv,ZodNumber:()=>ws,ZodNumberFormat:()=>na,ZodObject:()=>$u,ZodOptional:()=>Lu,ZodPipe:()=>Mu,ZodPrefault:()=>Bv,ZodPreprocess:()=>Jv,ZodPromise:()=>n0,ZodReadonly:()=>Qv,ZodRecord:()=>xs,ZodSet:()=>$v,ZodString:()=>vs,ZodStringFormat:()=>_t,ZodSuccess:()=>Hv,ZodSymbol:()=>bv,ZodTemplateLiteral:()=>Xv,ZodTransform:()=>Mv,ZodTuple:()=>Tv,ZodType:()=>Ke,ZodULID:()=>ym,ZodURL:()=>Ru,ZodUUID:()=>ci,ZodUndefined:()=>Av,ZodUnion:()=>ju,ZodUnknown:()=>wv,ZodVoid:()=>Iv,ZodXID:()=>bm,ZodXor:()=>Ev,_ZodString:()=>lm,_default:()=>Vv,_function:()=>LT,any:()=>fT,array:()=>Du,base64:()=>KO,base64url:()=>WO,bigint:()=>uT,boolean:()=>yv,catch:()=>Kv,check:()=>MT,cidrv4:()=>HO,cidrv6:()=>GO,codec:()=>NT,creditCard:()=>QO,cuid:()=>MO,cuid2:()=>FO,currencyCode:()=>rT,custom:()=>FT,date:()=>gT,describe:()=>zT,discriminatedUnion:()=>vT,e164:()=>JO,email:()=>CO,emoji:()=>jO,enum:()=>Om,exactOptional:()=>Fv,file:()=>PT,float32:()=>oT,float64:()=>aT,function:()=>LT,guid:()=>PO,hash:()=>iT,hex:()=>nT,hostname:()=>tT,httpUrl:()=>$O,iban:()=>YO,instanceof:()=>VT,int:()=>cm,int32:()=>sT,int64:()=>lT,intersection:()=>Ov,invertCodec:()=>DT,ipv4:()=>BO,ipv6:()=>ZO,json:()=>qT,jwt:()=>XO,keyof:()=>yT,ksuid:()=>VO,lazy:()=>t0,literal:()=>CT,looseObject:()=>xT,looseRecord:()=>_T,mac:()=>qO,map:()=>IT,meta:()=>UT,nan:()=>RT,nanoid:()=>LO,nativeEnum:()=>ET,never:()=>Pm,nonoptional:()=>Zv,null:()=>Sv,nullable:()=>Tu,nullish:()=>OT,number:()=>gv,object:()=>bT,optional:()=>Xo,partialRecord:()=>wT,pipe:()=>um,prefault:()=>qv,preprocess:()=>ZT,promise:()=>jT,readonly:()=>Yv,record:()=>Nv,refine:()=>i0,set:()=>kT,strictObject:()=>AT,string:()=>Ou,stringFormat:()=>eT,stringbool:()=>BT,success:()=>TT,superRefine:()=>o0,symbol:()=>pT,templateLiteral:()=>$T,transform:()=>Tm,tuple:()=>Rv,uint32:()=>cT,uint64:()=>dT,ulid:()=>zO,undefined:()=>mT,union:()=>ks,unknown:()=>Yo,url:()=>DO,uuid:()=>OO,uuidv4:()=>TO,uuidv6:()=>RO,uuidv7:()=>NO,void:()=>hT,xid:()=>UO,xor:()=>ST});function b5(){pn.localeError||Bt(vp())}function ea(){pn.memoizer||Bt({memoizer:bu()})}function Ou(e){return Ex(vs,e)}function CO(e){return Cp(dm,e)}function PO(e){return Pp(pm,e)}function OO(e){return Op(ci,e)}function TO(e){return Tp(ci,e)}function RO(e){return Rp(ci,e)}function NO(e){return Np(ci,e)}function DO(e){return Su(Ru,e)}function $O(e){return Su(Ru,{protocol:ru,hostname:gb,...ke.normalizeParams(e)})}function jO(e){return Dp(mm,e)}function LO(e){return $p(fm,e)}function MO(e){return jp(hm,e)}function FO(e){return Lp(gm,e)}function zO(e){return Mp(ym,e)}function UO(e){return Fp(bm,e)}function VO(e){return zp(Am,e)}function BO(e){return Up(xm,e)}function qO(e){return Px(mv,e)}function ZO(e){return Vp(Sm,e)}function HO(e){return Bp(vm,e)}function GO(e){return qp(wm,e)}function KO(e){return Zp(_m,e)}function WO(e){return Hp(Im,e)}function JO(e){return Gp(km,e)}function QO(e){return Ox(fv,e)}function YO(e){return Tx(hv,e)}function XO(e){return Kp(Em,e)}function eT(e,t,r={}){return Qo(ta,e,t,r)}function tT(e){return Qo(ta,"hostname",hb,e)}function nT(e){return Qo(ta,"hex",Ob,e)}function rT(e){return Qo(ta,"currency_code",bb,e)}function iT(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,o=_r[i];if(!o)throw new Error(`Unrecognized hash format: ${i}`);return Qo(ta,i,o,t)}function gv(e){return Nx(ws,e)}function cm(e){return $x(na,e)}function oT(e){return jx(na,e)}function aT(e){return Lx(na,e)}function sT(e){return Mx(na,e)}function cT(e){return Fx(na,e)}function yv(e){return zx(_s,e)}function uT(e){return Vx(Is,e)}function lT(e){return qx(Cm,e)}function dT(e){return Zx(Cm,e)}function pT(e){return Hx(bv,e)}function mT(e){return Gx(Av,e)}function Sv(e){return Kx(xv,e)}function fT(){return Wx(vv)}function Yo(){return Jx(wv)}function Pm(e){return Qx(_v,e)}function hT(e){return Yx(Iv,e)}function gT(e){return Xx(Nu,e)}function Du(e,t){return nS(kv,e,t)}function yT(e){let t=e._zod.def.shape;return Om(Object.keys(t))}function bT(e,t){let r={type:"object",shape:e??{},...ke.normalizeParams(t)};return new $u(r)}function AT(e,t){return new $u({type:"object",shape:e,catchall:Pm(),...ke.normalizeParams(t)})}function xT(e,t){return new $u({type:"object",shape:e,catchall:Yo(),...ke.normalizeParams(t)})}function ks(e,t){return new ju({type:"union",options:e,...ke.normalizeParams(t)})}function ST(e,t){return new Ev({type:"union",options:e,inclusive:!1,...ke.normalizeParams(t)})}function vT(e,t,r){return new Cv({type:"union",options:t,discriminator:e,...ke.normalizeParams(r)})}function Ov(e,t){return new Pv({type:"intersection",left:e,right:t})}function Rv(e,t,r){let i=t instanceof Ze,o=i?r:t,a=i?t:null;return new Tv({type:"tuple",items:e,rest:a,...ke.normalizeParams(o)})}function Nv(e,t,r){return!t||!t._zod?new xs({type:"record",keyType:Ou(),valueType:e,...ke.normalizeParams(t)}):new xs({type:"record",keyType:e,valueType:t,...ke.normalizeParams(r)})}function wT(e,t,r){return new xs({type:"record",keyType:e,valueType:t,...ke.normalizeParams(r),partial:!0})}function _T(e,t,r){return new xs({type:"record",keyType:e,valueType:t,mode:"loose",...ke.normalizeParams(r)})}function IT(e,t,r){return new Dv({type:"map",keyType:e,valueType:t,...ke.normalizeParams(r)})}function kT(e,t){return new $v({type:"set",valueType:e,...ke.normalizeParams(t)})}function Om(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Ss({type:"enum",entries:r,...ke.normalizeParams(t)})}function ET(e,t){return new Ss({type:"enum",entries:e,...ke.normalizeParams(t)})}function CT(e,t){return new jv({type:"literal",values:Array.isArray(e)?e:[e],...ke.normalizeParams(t)})}function PT(e){return rS(Lv,e)}function Tm(e){return new Mv({type:"transform",transform:e})}function Xo(e){return new Lu({type:"optional",innerType:e})}function Fv(e){return new Rm({type:"optional",innerType:e})}function Tu(e){return new zv({type:"nullable",innerType:e})}function OT(e){return Xo(Tu(e))}function Vv(e,t){return new Uv({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ke.shallowClone(t)}})}function qv(e,t){return new Bv({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ke.shallowClone(t)}})}function Zv(e,t){return new Nm({type:"nonoptional",innerType:e,...ke.normalizeParams(t)})}function TT(e){return new Hv({type:"success",innerType:e})}function Kv(e,t){return new Gv({type:"catch",innerType:e,catchValue:typeof t=="function"?t:ke.constantCatch(t)})}function RT(e){return tS(Wv,e)}function um(e,t){return new Mu({type:"pipe",in:e,out:t})}function NT(e,t,r){return new Fu({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function DT(e){let t=e._zod.def;return new Fu({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Yv(e){return new Qv({type:"readonly",innerType:e})}function $T(e,t){return new Xv({type:"template_literal",parts:e,...ke.normalizeParams(t)})}function t0(e){return new e0({type:"lazy",getter:e})}function jT(e){return new n0({type:"promise",innerType:e})}function LT(e){return new r0({type:"function",input:Array.isArray(e?.input)?Rv(e?.input):e?.input??Du(Yo()),output:e?.output??Yo()})}function MT(e){let t=new Ct({check:"custom"});return t._zod.check=e,t}function FT(e,t){return iS(zu,e??(()=>!0),t)}function i0(e,t={}){return oS(zu,e,t)}function o0(e,t){return aS(e,t)}function VT(e,t={}){let r=new a0({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...ke.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=i=>{i.value instanceof e||i.issues.push({code:"invalid_type",expected:e.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]})},r}function qT(e){let t=t0(()=>ks([Ou(e),gv(),yv(),Sv(),Du(t),Nv(Ou(),t)]));return t}function ZT(e,t){return new Jv({type:"pipe",in:Tm(e),out:t})}var Ke,lm,vs,_t,Ki,Wi,Ji,Qi,dm,pm,ci,Ru,mm,fm,hm,gm,ym,bm,Am,xm,mv,Sm,vm,wm,_m,Im,km,fv,hv,Em,ta,ws,na,_s,Is,Cm,bv,Av,xv,vv,wv,_v,Iv,Nu,kv,$u,ju,Ev,Cv,Pv,Tv,xs,Dv,$v,Ss,jv,Lv,Mv,Lu,Rm,zv,Uv,Bv,Nm,Hv,Gv,Wv,Mu,Fu,Jv,Qv,Xv,e0,n0,r0,zu,zT,UT,a0,BT,Yi=x(()=>{sr();sr();Pu();Vo();Eu();yx();am();pv();Ke=R("ZodType",(e,t)=>(b5(),Ze.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ke.mergeDefs(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return xt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(i0(e,t))},superRefine(e,t){return this.check(o0(e,t))},overwrite(e){return this.check(zr(e))},optional(){return Xo(this)},exactOptional(){return Fv(this)},nullable(){return Tu(this)},nullish(){return Xo(Tu(this))},nonoptional(e){return Zv(this,e)},array(){return Du(this)},or(e){return ks([this,e])},and(e){return Ov(this,e)},transform(e){return um(this,Tm(e))},default(e){return Vv(this,e)},prefault(e){return qv(this,e)},catch(e){return Kv(this,e)},pipe(e){return um(this,e)},readonly(){return Yv(this)},describe(e){let t=this.clone();return vn.add(t,{description:e}),t},meta(...e){if(e.length===0)return vn.get(this);let t=this.clone();return vn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return ke.hide(this,"~standard",{...tp(this),jsonSchema:{input:ys(this,"input"),output:ys(this,"output")}})},set"~standard"(e){ke.own(this,"~standard",e)},parse:function e(t,r){return ev(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await tv(this,t,r,{callee:e})},safeParse(e,t){return nv(this,e,t)},async safeParseAsync(e,t){return rv(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ke.own(this,"spa",e)},validate(e,t){return tu(this,e,t)},validateAsync(e,t){return nu(this,e,t)},encode:function e(t,r){return iv(this,t,r,{callee:e})},decode:function e(t,r){return ov(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await av(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await sv(this,t,r,{callee:e})},safeEncode(e,t){return cv(this,e,t)},safeDecode(e,t){return uv(this,e,t)},async safeEncodeAsync(e,t){return lv(this,e,t)},async safeDecodeAsync(e,t){return dv(this,e,t)},toJSONSchema(e){return dS(this,{})(e)},get description(){return vn.get(this)?.description},get _def(){return this._zod.def}}),lm=R("_ZodString",(e,t)=>{qo.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>fS(e,r,i,o)},ke.derived({format:e=>an(e).format??null,minLength:e=>an(e).minimum??null,maxLength:e=>an(e).maximum??null},{regex(...e){return this.check(is(...e))},includes(...e){return this.check(ss(...e))},startsWith(...e){return this.check(cs(...e))},endsWith(...e){return this.check(us(...e))},min(...e){return this.check(wi(...e))},max(...e){return this.check(Wo(...e))},length(...e){return this.check(Jo(...e))},nonempty(...e){return this.check(wi(1,...e))},lowercase(e){return this.check(os(e))},uppercase(e){return this.check(as(e))},trim(){return this.check(ms())},normalize(...e){return this.check(ps(...e))},toLowerCase(){return this.check(fs())},toUpperCase(){return this.check(hs())},slugify(){return this.check(gs())}})),vs=R("ZodString",(e,t)=>{qo.init(e,t),lm.init(e,t)},{email(e){return this.check(Cp(dm,e))},url(e){return this.check(Su(Ru,e))},jwt(e){return this.check(Kp(Em,e))},emoji(e){return this.check(Dp(mm,e))},guid(e){return this.check(Pp(pm,e))},uuid(e){return this.check(Op(ci,e))},uuidv4(e){return this.check(Tp(ci,e))},uuidv6(e){return this.check(Rp(ci,e))},uuidv7(e){return this.check(Np(ci,e))},nanoid(e){return this.check($p(fm,e))},cuid(e){return this.check(jp(hm,e))},cuid2(e){return this.check(Lp(gm,e))},ulid(e){return this.check(Mp(ym,e))},base64(e){return this.check(Zp(_m,e))},base64url(e){return this.check(Hp(Im,e))},xid(e){return this.check(Fp(bm,e))},ksuid(e){return this.check(zp(Am,e))},ipv4(e){return this.check(Up(xm,e))},ipv6(e){return this.check(Vp(Sm,e))},cidrv4(e){return this.check(Bp(vm,e))},cidrv6(e){return this.check(qp(wm,e))},e164(e){return this.check(Gp(km,e))},datetime(e){return this.check(vu(Ki,e))},date(e){return this.check(wu(Wi,e))},time(e){return this.check(_u(Ji,e))},duration(e){return this.check(Iu(Qi,e))}});_t=R("ZodStringFormat",(e,t)=>{St.init(e,t),lm.init(e,t)}),Ki=R("ZodISODateTime",(e,t)=>{fA.init(e,t),_t.init(e,t)}),Wi=R("ZodISODate",(e,t)=>{hA.init(e,t),_t.init(e,t)}),Ji=R("ZodISOTime",(e,t)=>{gA.init(e,t),_t.init(e,t)}),Qi=R("ZodISODuration",(e,t)=>{yA.init(e,t),_t.init(e,t)}),dm=R("ZodEmail",(e,t)=>{rA.init(e,t),_t.init(e,t)});pm=R("ZodGUID",(e,t)=>{tA.init(e,t),_t.init(e,t)});ci=R("ZodUUID",(e,t)=>{nA.init(e,t),_t.init(e,t)});Ru=R("ZodURL",(e,t)=>{aA.init(e,t),_t.init(e,t)});mm=R("ZodEmoji",(e,t)=>{sA.init(e,t),_t.init(e,t)});fm=R("ZodNanoID",(e,t)=>{cA.init(e,t),_t.init(e,t)});hm=R("ZodCUID",(e,t)=>{uA.init(e,t),_t.init(e,t)});gm=R("ZodCUID2",(e,t)=>{lA.init(e,t),_t.init(e,t)});ym=R("ZodULID",(e,t)=>{dA.init(e,t),_t.init(e,t)});bm=R("ZodXID",(e,t)=>{pA.init(e,t),_t.init(e,t)});Am=R("ZodKSUID",(e,t)=>{mA.init(e,t),_t.init(e,t)});xm=R("ZodIPv4",(e,t)=>{bA.init(e,t),_t.init(e,t)});mv=R("ZodMAC",(e,t)=>{xA.init(e,t),_t.init(e,t)});Sm=R("ZodIPv6",(e,t)=>{AA.init(e,t),_t.init(e,t)});vm=R("ZodCIDRv4",(e,t)=>{SA.init(e,t),_t.init(e,t)});wm=R("ZodCIDRv6",(e,t)=>{vA.init(e,t),_t.init(e,t)});_m=R("ZodBase64",(e,t)=>{wA.init(e,t),_t.init(e,t)});Im=R("ZodBase64URL",(e,t)=>{_A.init(e,t),_t.init(e,t)});km=R("ZodE164",(e,t)=>{IA.init(e,t),_t.init(e,t)});fv=R("ZodCreditCard",(e,t)=>{kA.init(e,t),_t.init(e,t)});hv=R("ZodIBAN",(e,t)=>{EA.init(e,t),_t.init(e,t)});Em=R("ZodJWT",(e,t)=>{CA.init(e,t),_t.init(e,t)});ta=R("ZodCustomStringFormat",(e,t)=>{PA.init(e,t),_t.init(e,t)});ws=R("ZodNumber",(e,t)=>{dp.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>hS(e,r,i,o),e.isFinite=!0},ke.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=an(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=an(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=an(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>an(e).format??null},{gt(e,t){return this.check(ai(e,t))},gte(e,t){return this.check(ar(e,t))},min(e,t){return this.check(ar(e,t))},lt(e,t){return this.check(oi(e,t))},lte(e,t){return this.check(or(e,t))},max(e,t){return this.check(or(e,t))},int(e){return this.check(cm(e))},safe(e){return this.check(cm(e))},positive(e){return this.check(ai(0,e))},nonnegative(e){return this.check(ar(0,e))},negative(e){return this.check(oi(0,e))},nonpositive(e){return this.check(or(0,e))},multipleOf(e,t){return this.check(Bi(e,t))},step(e,t){return this.check(Bi(e,t))},finite(){return this}}));na=R("ZodNumberFormat",(e,t)=>{OA.init(e,t),ws.init(e,t)});_s=R("ZodBoolean",(e,t)=>{pu.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>gS(e,r,i,o)});Is=R("ZodBigInt",(e,t)=>{pp.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>yS(e,r,i,o)},ke.derived({minValue:e=>an(e).minimum??null,maxValue:e=>an(e).maximum??null,format:e=>an(e).format??null},{gte(e,t){return this.check(ar(e,t))},min(e,t){return this.check(ar(e,t))},gt(e,t){return this.check(ai(e,t))},lt(e,t){return this.check(oi(e,t))},lte(e,t){return this.check(or(e,t))},max(e,t){return this.check(or(e,t))},positive(e){return this.check(ai(BigInt(0),e))},negative(e){return this.check(oi(BigInt(0),e))},nonpositive(e){return this.check(or(BigInt(0),e))},nonnegative(e){return this.check(ar(BigInt(0),e))},multipleOf(e,t){return this.check(Bi(e,t))}}));Cm=R("ZodBigIntFormat",(e,t)=>{TA.init(e,t),Is.init(e,t)});bv=R("ZodSymbol",(e,t)=>{RA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>bS(e,r,i,o)});Av=R("ZodUndefined",(e,t)=>{NA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>xS(e,r,i,o)});xv=R("ZodNull",(e,t)=>{DA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>AS(e,r,i,o)});vv=R("ZodAny",(e,t)=>{$A.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>wS(e,r,i,o)});wv=R("ZodUnknown",(e,t)=>{jA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>_S(e,r,i,o)});_v=R("ZodNever",(e,t)=>{LA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>vS(e,r,i,o)});Iv=R("ZodVoid",(e,t)=>{MA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>SS(e,r,i,o)});Nu=R("ZodDate",(e,t)=>{FA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>IS(e,r,i,o),e.min=(r,i)=>e.check(ar(r,i)),e.max=(r,i)=>e.check(or(r,i))},ke.derived({minDate:e=>{let{minimum:t}=an(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=an(e);return t?new Date(t):null}},{}));kv=R("ZodArray",(e,t)=>{ea(),UA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>LS(e,r,i,o),e.element=t.element},{min(e,t){return this.check(wi(e,t))},nonempty(e){return this.check(wi(1,e))},max(e,t){return this.check(Wo(e,t))},length(e,t){return this.check(Jo(e,t))},unwrap(){return this.element}});$u=R("ZodObject",(e,t)=>{ea(),VA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>MS(e,r,i,o),ke.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Om(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ke.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ke.mergeDefs(this._zod.def,{catchall:Yo()}))},loose(){return this.clone(ke.mergeDefs(this._zod.def,{catchall:Yo()}))},strict(){return this.clone(ke.mergeDefs(this._zod.def,{catchall:Pm()}))},strip(){return this.clone(ke.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return ke.extend(this,e)},safeExtend(e){return ke.safeExtend(this,e)},merge(e){return ke.merge(this,e)},pick(e){return ke.pick(this,e)},omit(e){return ke.omit(this,e)},partial(...e){return ke.partial(Lu,this,e[0])},exactPartial(...e){return ke.partial(Rm,this,e[0],"exactPartial")},required(...e){return ke.required(Nm,this,e[0])}});ju=R("ZodUnion",(e,t)=>{mu.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>tm(e,r,i,o),e.options=t.options});Ev=R("ZodXor",(e,t)=>{ju.init(e,t),BA.init(e,t),e._zod.processJSONSchema=(r,i,o)=>tm(e,r,i,o),e.options=t.options});Cv=R("ZodDiscriminatedUnion",(e,t)=>{ju.init(e,t),ZA.init(e,t)});Pv=R("ZodIntersection",(e,t)=>{HA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>FS(e,r,i,o)});Tv=R("ZodTuple",(e,t)=>{ea(),mp.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>zS(e,r,i,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Lu({type:"optional",innerType:t}))})}});xs=R("ZodRecord",(e,t)=>{ea(),GA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>US(e,r,i,o),e.keyType=t.keyType,e.valueType=t.valueType});Dv=R("ZodMap",(e,t)=>{ea(),KA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>$S(e,r,i,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(si(...r)),e.nonempty=r=>e.check(si(1,r)),e.max=(...r)=>e.check(qi(...r)),e.size=(...r)=>e.check(Ko(...r))});$v=R("ZodSet",(e,t)=>{ea(),WA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>jS(e,r,i,o),e.min=(...r)=>e.check(si(...r)),e.nonempty=r=>e.check(si(1,r)),e.max=(...r)=>e.check(qi(...r)),e.size=(...r)=>e.check(Ko(...r))});Ss=R("ZodEnum",(e,t)=>{JA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(i,o,a)=>kS(e,i,o,a),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(i,o)=>{let a={};for(let s of i)if(r.has(s))a[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ss({...t,checks:[],...ke.normalizeParams(o),entries:a})},e.exclude=(i,o)=>{let a={...t.entries};for(let s of i)if(r.has(s))delete a[s];else throw new Error(`Key ${s} not found in enum`);return new Ss({...t,checks:[],...ke.normalizeParams(o),entries:a})}});jv=R("ZodLiteral",(e,t)=>{QA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ES(e,r,i,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});Lv=R("ZodFile",(e,t)=>{YA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>OS(e,r,i,o),e.min=(r,i)=>e.check(si(r,i)),e.max=(r,i)=>e.check(qi(r,i)),e.mime=(r,i)=>e.check(ds(Array.isArray(r)?r:[r],i))});Mv=R("ZodTransform",(e,t)=>{ea(),XA.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>DS(e,r,i,o),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Ui(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(ke.issue(a,r.value,t));else{let s=a;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=e),r.issues.push(ke.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r)):(r.value=o,r)}});Lu=R("ZodOptional",(e,t)=>{fp.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>nm(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Rm=R("ZodExactOptional",(e,t)=>{ex.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>nm(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});zv=R("ZodNullable",(e,t)=>{tx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>VS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Uv=R("ZodDefault",(e,t)=>{nx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ZS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Bv=R("ZodPrefault",(e,t)=>{rx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>HS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Nm=R("ZodNonOptional",(e,t)=>{ix.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>BS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Hv=R("ZodSuccess",(e,t)=>{ox.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>TS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Gv=R("ZodCatch",(e,t)=>{ax.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>GS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});Wv=R("ZodNaN",(e,t)=>{sx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>CS(e,r,i,o)});Mu=R("ZodPipe",(e,t)=>{hp.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>KS(e,r,i,o),e.in=t.in,e.out=t.out});Fu=R("ZodCodec",(e,t)=>{Mu.init(e,t),fu.init(e,t)});Jv=R("ZodPreprocess",(e,t)=>{Mu.init(e,t),cx.init(e,t)}),Qv=R("ZodReadonly",(e,t)=>{ux.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>WS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Xv=R("ZodTemplateLiteral",(e,t)=>{lx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>PS(e,r,i,o)});e0=R("ZodLazy",(e,t)=>{hu.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>QS(e,r,i,o),e.unwrap=()=>e._zod.def.getter()});n0=R("ZodPromise",(e,t)=>{px.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>JS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});r0=R("ZodFunction",(e,t)=>{dx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>NS(e,r,i,o)});zu=R("ZodCustom",(e,t)=>{mx.init(e,t),Ke.init(e,t),e._zod.processJSONSchema=(r,i,o)=>RS(e,r,i,o)});zT=sS,UT=cS,a0=R("ZodInstanceOf",(e,t)=>{zu.init(e,t)},{properties(e,t){return this.check(ls(e,t))}});BT=(...e)=>uS({Codec:Fu,Boolean:_s,String:vs},...e)});function x5(e){Bt({customError:e})}function S5(){return Bt().customError}var A5,s0,HT=x(()=>{sr();A5={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};s0||(s0={})});var Uu={};Ie(Uu,{ZodISODate:()=>Wi,ZodISODateTime:()=>Ki,ZodISODuration:()=>Qi,ZodISOTime:()=>Ji,date:()=>w5,datetime:()=>v5,duration:()=>I5,time:()=>_5});function v5(e){return vu(Ki,e)}function w5(e){return wu(Wi,e)}function _5(e){return _u(Ji,e)}function I5(e){return Iu(Qi,e)}var Dm=x(()=>{sr();Yi();Yi()});function E5(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function GT(e,t){return e.map((r,i)=>i<t?r:r.optional())}function C5(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function P5(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let i=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let o=r[1]===void 0?void 0:C5(r[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function O5(e,t){return Ae.transform(i=>i).check(i=>{let o=i.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let a=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&a.length<t.minProperties&&i.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&a.length>t.maxProperties&&i.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let s of a){let c=t.keySchema.safeParse(s);c.success||i.issues.push({code:"invalid_key",origin:"record",issues:c.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function c0(e,t){if(e===null)return"z";let r=typeof e;if(r!=="object"){if(r==="number"&&Number.isNaN(e))return null;let i=String(e);return`${r[0]}${i.length}:${i}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let a=[];for(let s of e){let c=c0(s,t);if(c===null)return null;a.push(c)}return`a${a.length}:[${a.join(",")}]`}let i=Object.keys(e).sort(),o=[];for(let a of i){let s=c0(e[a],t);if(s===null)return null;o.push(`${a.length}:${a}=${s}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}function Vu(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Vu):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>T5.has(t)?Vu(r):!R5.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(Vu))}function KT(e){return e===1?"element":"elements"}function N5(e,t){return Ae.transform(i=>i).check(i=>{let o=i.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let a=new Map;for(let s=0;s<o.length;s++){let c=c0(o[s],new Set);if(c===null)continue;let u=a.get(c);if(u===void 0){a.set(c,s);continue}i.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${u}`,input:o,path:[s],continue:!0})}}if(t.containsSchema){let a=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,c=0;for(let u of o)if(t.containsSchema.safeParse(u).success&&++c>=s)break;c<a&&i.issues.push({code:"custom",message:`Array must contain at least ${a} matching ${KT(a)}; found ${c}`,input:o,continue:!0}),t.maxContains!==void 0&&c>t.maxContains&&i.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${KT(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}function WT(e,t){if(e!==!1)return e===void 0||e===!0?Ae.any():Mn(e,t)}function JT(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return Ae.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return Ae.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let a=P5(o,t),s=Mn(a,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return Ae.null();if(o.length===0)return Ae.never();if(o.length===1)return Ae.literal(o[0]);if(o.every(s=>typeof s=="string"))return Ae.enum(o);let a=o.map(s=>Ae.literal(s));return a.length<2?a[0]:Ae.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return Ae.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(a=>{let s={...e,type:a};return JT(s,t)});return o.length===0?Ae.never():o.length===1?o[0]:Ae.union(o)}if(!r)return Ae.any();let i;switch(r){case"string":{let o=Ae.string();if(e.format){let a=e.format;a==="email"?o=o.check(Ae.email()):a==="uri"||a==="uri-reference"?o=o.check(Ae.url()):a==="uuid"||a==="guid"?o=o.check(Ae.uuid()):a==="date-time"?o=o.check(Ae.iso.datetime({offset:!0})):a==="date"?o=o.check(Ae.iso.date()):a==="time"?o=o.check(Ae.regex(D5)):a==="duration"?o=o.check(Ae.iso.duration()):a==="hostname"?o=o.check(Ae.hostname()):a==="ipv4"?o=o.check(Ae.ipv4()):a==="ipv6"?o=o.check(Ae.ipv6()):a==="mac"?o=o.check(Ae.mac()):a==="cidr"?o=o.check(Ae.cidrv4()):a==="cidr-v6"?o=o.check(Ae.cidrv6()):a==="base64"?o=o.check(Ae.base64()):a==="base64url"?o=o.check(Ae.base64url()):a==="e164"?o=o.check(Ae.e164()):a==="credit_card"?o=o.check(Ae.creditCard()):a==="iban"?o=o.check(Ae.iban()):a==="jwt"?o=o.check(Ae.jwt()):a==="emoji"?o=o.check(Ae.emoji()):a==="nanoid"?o=o.check(Ae.nanoid()):a==="cuid"?o=o.check(Ae.cuid()):a==="cuid2"?o=o.check(Ae.cuid2()):a==="ulid"?o=o.check(Ae.ulid()):a==="xid"?o=o.check(Ae.xid()):a==="ksuid"&&(o=o.check(Ae.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),i=o;break}case"number":case"integer":{let o=r==="integer"?Ae.number().int():Ae.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),i=o;break}case"boolean":{i=Ae.boolean();break}case"null":{i=Ae.null();break}case"object":{let o={},a=e.properties||{},s=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?Mn(e.additionalProperties,t):void 0;for(let[p,h]of Object.entries(a)){let f=Mn(h,t);Sn(o,p,s.has(p)?f:f.optional())}if(e.patternProperties){let p=e.patternProperties,h=Object.keys(p),f=[];for(let g of h){let A=Mn(p[g],t),C=Ae.string().regex(new RegExp(g));f.push(Ae.looseRecord(C,A))}let m=[];if(Object.keys(o).length>0&&m.push(Ae.object(o).passthrough()),m.push(...f),m.length===0)i=Ae.object({}).passthrough();else if(m.length===1)i=m[0];else{let g=Ae.intersection(m[0],m[1]);for(let A=2;A<m.length;A++)g=Ae.intersection(g,m[A]);i=g}if(e.additionalProperties===!1){let g=Object.keys(o),A=h.map(w=>new RegExp(w)),C=i;i=i.check(w=>{if(!vr(w.value))return;let E=[];for(let I of Object.keys(w.value))g.includes(I)||A.some(F=>F.test(I))||E.push(I);E.length&&w.issues.push({code:"unrecognized_keys",keys:E,input:w.value,inst:C})})}}else{let p=Ae.object(o);e.additionalProperties===!1?i=p.strict():c?i=p.catchall(c):i=p.passthrough()}let u=e.propertyNames!==void 0&&e.propertyNames!==!0,l=typeof e.minProperties=="number"?e.minProperties:void 0,d=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(u||l!==void 0||d!==void 0){let p;if(u){let h=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;p=Mn(h,t)}i=O5(i,{keySchema:p,minProperties:l,maxProperties:d})}break}case"array":{let o=e.prefixItems,a=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,c=o.map(p=>Mn(p,t)),u=GT(c,s),l=Array.isArray(a)?void 0:WT(a,t),d=Ae.tuple(u);i=l?d.rest(l):d,typeof e.minItems=="number"&&(i=i.check(Ae.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(Ae.maxLength(e.maxItems)))}else if(Array.isArray(a)){let s=typeof e.minItems=="number"?e.minItems:0,c=a.map(p=>Mn(p,t)),u=GT(c,s),l=WT(e.additionalItems,t),d=Ae.tuple(u);i=l?d.rest(l):d,typeof e.minItems=="number"&&(i=i.check(Ae.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(Ae.maxLength(e.maxItems)))}else if(a!==void 0){let s=Mn(a,t),c=Ae.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),i=c}else i=Ae.array(Ae.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=N5(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?Mn(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${r}`)}return i}function Mn(e,t){if(typeof e=="boolean")return e?Ae.any():Ae.never();let r=JT(e,t),i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let c=e.anyOf.map(l=>Mn(l,t)),u=Ae.union(c);r=i?Ae.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>Mn(l,t)),u=Ae.xor(c);r=i?Ae.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:Ae.any();else{let c=i?r:Mn(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=Ae.intersection(c,Mn(e.allOf[l],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=Ae.nullable(r)),e.readOnly===!0&&(r=Ae.readonly(r)),e.default!==void 0&&(r=r.default(e.default));let o={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let c of a)c in e&&(o[c]=e[c]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let c of s)c in e&&(o[c]=e[c]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Vu(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let c of["minProperties","maxProperties"])e[c]!==void 0&&(o[c]=e[c])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Vu(e.contains)&&(o.contains=e.contains);for(let c of["uniqueItems","minContains","maxContains"])e[c]!==void 0&&(o[c]=e[c])}for(let c of Object.keys(e))k5.has(c)||Sn(o,c,e[c]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function QT(e,t){if(typeof e=="boolean")return e?Ae.any():Ae.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=E5(r,t?.defaultTarget),o=r.$defs||r.definitions||{},a={version:i,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??vn};return Mn(r,a)}var Ae,k5,T5,R5,D5,YT=x(()=>{xu();Xt();am();Dm();Yi();Ae={...Es,...om,iso:Uu},k5=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);T5=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),R5=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);D5=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function Bu(e,t){let r=typeof t=="function"?t:(s,c)=>{let u=t[s._zod.def.type];return u?u(s,c):s},i=new Map;function o(s){let c=i.get(s);if(c===XT)return new hu({type:"lazy",getter:()=>i.get(s)});if(c!==void 0)return c;i.set(s,XT);let u=a(s),l=r(u,u!==s);return i.set(s,l),l}function a(s){let c=s._zod.def,u=c.type;switch(u){case"object":{let l=c.shape,d=Object.keys(l),p=!1,h={};for(let m of d){let g=o(l[m]);g!==l[m]&&(p=!0),h[m]=g}let f=c.catchall;return c.catchall&&(f=o(c.catchall),f!==c.catchall&&(p=!0)),p?xt(s,{...c,shape:h,catchall:f}):s}case"array":{let l=o(c.element);return l===c.element?s:xt(s,{...c,element:l})}case"tuple":{let l=c.items,d=!1,p=[];for(let f of l){let m=o(f);m!==f&&(d=!0),p.push(m)}let h=c.rest;return c.rest&&(h=o(c.rest),h!==c.rest&&(d=!0)),d?xt(s,{...c,items:p,rest:h}):s}case"record":case"map":{let l=o(c.keyType),d=o(c.valueType);return l===c.keyType&&d===c.valueType?s:xt(s,{...c,keyType:l,valueType:d})}case"set":{let l=o(c.valueType);return l===c.valueType?s:xt(s,{...c,valueType:l})}case"union":{let l=c.options,d=!1,p=[];for(let h of l){let f=o(h);f!==h&&(d=!0),p.push(f)}return d?xt(s,{...c,options:p}):s}case"intersection":{let l=o(c.left),d=o(c.right);return l===c.left&&d===c.right?s:xt(s,{...c,left:l,right:d})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let l=o(c.innerType);return l===c.innerType?s:xt(s,{...c,innerType:l})}case"pipe":{let l=o(c.in),d=o(c.out);return l===c.in&&d===c.out?s:xt(s,{...c,in:l,out:d})}case"function":{let l=o(c.input),d=o(c.output);return l===c.input&&d===c.output?s:xt(s,{...c,input:l,output:d})}case"lazy":{let l=c.getter,{_cachedInner:d,...p}=c;return xt(s,{...p,getter:()=>o(l())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return o(e)}var XT,u0=x(()=>{ts();Xt();XT=Symbol("z.visit/resolving")});function eR(e){return Bu(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:ks(r.options)}})}var tR=x(()=>{u0();Yi()});function $5(e,t){if(!t?.length)return e;let r=e._zod.def;return xt(e,Mr(r,{checks:[...r.checks??[],...t]}),{parent:!0})}function nR(e){return $5(e.out,e.checks)}function j5(e){return e.in._zod.traits.has("$ZodTransform")?nR(e):e.in}function rR(e){return Bu(e,{pipe:t=>j5(t._zod.def),default:(t,r)=>r?Xo(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function iR(e){return Bu(e,{pipe:t=>nR(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var oR=x(()=>{Xt();u0();Yi()});var l0={};Ie(l0,{bigint:()=>z5,boolean:()=>F5,date:()=>U5,number:()=>M5,string:()=>L5});function L5(e){return Cx(vs,e)}function M5(e){return Dx(ws,e)}function F5(e){return Ux(_s,e)}function z5(e){return Bx(Is,e)}function U5(e){return eS(Nu,e)}var aR=x(()=>{sr();Yi()});var n={};Ie(n,{$brand:()=>Vy,$input:()=>xx,$output:()=>Ax,INVALID:()=>jn,NEVER:()=>Uy,TimePrecision:()=>Rx,ZodAny:()=>vv,ZodArray:()=>kv,ZodBase64:()=>_m,ZodBase64URL:()=>Im,ZodBigInt:()=>Is,ZodBigIntFormat:()=>Cm,ZodBoolean:()=>_s,ZodCIDRv4:()=>vm,ZodCIDRv6:()=>wm,ZodCUID:()=>hm,ZodCUID2:()=>gm,ZodCatch:()=>Gv,ZodCodec:()=>Fu,ZodCompileAsyncError:()=>Fr,ZodCompileUnsupportedError:()=>it,ZodCreditCard:()=>fv,ZodCustom:()=>zu,ZodCustomStringFormat:()=>ta,ZodDate:()=>Nu,ZodDefault:()=>Uv,ZodDiscriminatedUnion:()=>Cv,ZodE164:()=>km,ZodEmail:()=>dm,ZodEmoji:()=>mm,ZodEnum:()=>Ss,ZodError:()=>YS,ZodExactOptional:()=>Rm,ZodFile:()=>Lv,ZodFirstPartyTypeKind:()=>s0,ZodFunction:()=>r0,ZodGUID:()=>pm,ZodIBAN:()=>hv,ZodIPv4:()=>xm,ZodIPv6:()=>Sm,ZodISODate:()=>Wi,ZodISODateTime:()=>Ki,ZodISODuration:()=>Qi,ZodISOTime:()=>Ji,ZodInstanceOf:()=>a0,ZodIntersection:()=>Pv,ZodIssueCode:()=>A5,ZodJWT:()=>Em,ZodKSUID:()=>Am,ZodLazy:()=>e0,ZodLiteral:()=>jv,ZodMAC:()=>mv,ZodMap:()=>Dv,ZodNaN:()=>Wv,ZodNanoID:()=>fm,ZodNever:()=>_v,ZodNonOptional:()=>Nm,ZodNull:()=>xv,ZodNullable:()=>zv,ZodNumber:()=>ws,ZodNumberFormat:()=>na,ZodObject:()=>$u,ZodOptional:()=>Lu,ZodPipe:()=>Mu,ZodPrefault:()=>Bv,ZodPreprocess:()=>Jv,ZodPromise:()=>n0,ZodReadonly:()=>Qv,ZodRealError:()=>Qn,ZodRecord:()=>xs,ZodSet:()=>$v,ZodString:()=>vs,ZodStringFormat:()=>_t,ZodSuccess:()=>Hv,ZodSymbol:()=>bv,ZodTemplateLiteral:()=>Xv,ZodTransform:()=>Mv,ZodTuple:()=>Tv,ZodType:()=>Ke,ZodULID:()=>ym,ZodURL:()=>Ru,ZodUUID:()=>ci,ZodUndefined:()=>Av,ZodUnion:()=>ju,ZodUnknown:()=>wv,ZodVoid:()=>Iv,ZodXID:()=>bm,ZodXor:()=>Ev,_ZodString:()=>lm,_default:()=>Vv,_function:()=>LT,any:()=>fT,array:()=>Du,base64:()=>KO,base64url:()=>WO,bigint:()=>uT,boolean:()=>yv,catch:()=>Kv,check:()=>MT,cidrv4:()=>HO,cidrv6:()=>GO,clone:()=>xt,codec:()=>NT,coerce:()=>l0,compile:()=>_x,config:()=>Bt,core:()=>_i,creditCard:()=>QO,cuid:()=>MO,cuid2:()=>FO,currencyCode:()=>rT,custom:()=>FT,date:()=>gT,decode:()=>ov,decodeAsync:()=>sv,deepPartial:()=>eR,describe:()=>zT,discriminatedUnion:()=>vT,e164:()=>JO,email:()=>CO,emoji:()=>jO,encode:()=>iv,encodeAsync:()=>av,endsWith:()=>us,enum:()=>Om,exactOptional:()=>Fv,file:()=>PT,flattenError:()=>Xc,float32:()=>oT,float64:()=>aT,formatError:()=>eu,fromJSONSchema:()=>QT,function:()=>LT,getDiscriminatedOption:()=>qA,getErrorMap:()=>S5,globalRegistry:()=>vn,gt:()=>ai,gte:()=>ar,guid:()=>PO,hash:()=>iT,hex:()=>nT,hostname:()=>tT,httpUrl:()=>$O,iban:()=>YO,includes:()=>ss,input:()=>rR,instanceof:()=>VT,int:()=>cm,int32:()=>sT,int64:()=>lT,intersection:()=>Ov,invertCodec:()=>DT,ipv4:()=>BO,ipv6:()=>ZO,iso:()=>Uu,json:()=>qT,jwt:()=>XO,keyof:()=>yT,ksuid:()=>VO,lazy:()=>t0,length:()=>Jo,literal:()=>CT,locales:()=>Au,looseObject:()=>xT,looseRecord:()=>_T,lowercase:()=>os,lt:()=>oi,lte:()=>or,mac:()=>qO,map:()=>IT,maxLength:()=>Wo,maxSize:()=>qi,memoizer:()=>bu,meta:()=>UT,mime:()=>ds,minLength:()=>wi,minSize:()=>si,multipleOf:()=>Bi,nan:()=>RT,nanoid:()=>LO,nativeEnum:()=>ET,negative:()=>Jp,never:()=>Pm,nonnegative:()=>Yp,nonoptional:()=>Zv,nonpositive:()=>Qp,normalize:()=>ps,null:()=>Sv,nullable:()=>Tu,nullish:()=>OT,number:()=>gv,object:()=>bT,optional:()=>Xo,output:()=>iR,overwrite:()=>zr,parse:()=>ev,parseAsync:()=>tv,partialRecord:()=>wT,pipe:()=>um,positive:()=>Wp,prefault:()=>qv,preprocess:()=>ZT,prettifyError:()=>Gy,promise:()=>jT,properties:()=>ls,property:()=>Xp,readonly:()=>Yv,record:()=>Nv,refine:()=>i0,regex:()=>is,regexes:()=>_r,registry:()=>_p,safeDecode:()=>uv,safeDecodeAsync:()=>dv,safeEncode:()=>cv,safeEncodeAsync:()=>lv,safeParse:()=>nv,safeParseAsync:()=>rv,set:()=>kT,setErrorMap:()=>x5,size:()=>Ko,slugify:()=>gs,startsWith:()=>cs,strictObject:()=>AT,string:()=>Ou,stringFormat:()=>eT,stringbool:()=>BT,success:()=>TT,superRefine:()=>o0,symbol:()=>pT,templateLiteral:()=>$T,toJSONSchema:()=>rm,toLowerCase:()=>fs,toUpperCase:()=>hs,toZod:()=>Bc,transform:()=>Tm,treeifyError:()=>Hy,trim:()=>ms,tuple:()=>Rv,uint32:()=>cT,uint64:()=>dT,ulid:()=>zO,undefined:()=>mT,union:()=>ks,unknown:()=>Yo,uppercase:()=>as,url:()=>DO,util:()=>ke,uuid:()=>OO,uuidv4:()=>TO,uuidv6:()=>RO,uuidv7:()=>NO,validate:()=>tu,validateAsync:()=>nu,void:()=>hT,withParser:()=>Ip,xid:()=>UO,xor:()=>ST});var qu=x(()=>{sr();Yi();am();XS();pv();HT();sr();Pu();YT();tR();oR();bx();Dm();Dm();aR()});var ee=x(()=>{qu();qu()});var V5,yt,cr=x(()=>{"use strict";ee();V5=n.enum(["sandbox","live"]),yt=n.object({projectId:n.string().min(1),environment:V5}).strict()});var Zu,sR,cR,$m,d0,uR,lR,rte,p0,ite,ote,jm,m0,ate,f0=x(()=>{"use strict";ee();Zu=n.number().int().min(1).max(Number.MAX_SAFE_INTEGER),sR=n.enum(["unknown","denied","provisional","granted"]),cR=n.enum(["ios","android"]),$m=n.strictObject({installationId:n.uuid(),publicKey:n.string().regex(/^[A-Za-z0-9_-]{80,200}$/),issuedAt:n.iso.datetime({offset:!0}),signature:n.string().regex(/^[A-Za-z0-9_-]{86}$/)}),d0=n.string().regex(/^[a-f0-9]{64}$/),uR=$m.extend({sequence:Zu,platform:cR,credentialDigest:d0}),lR=$m.extend({credentialDigest:d0}),rte=$m.extend({sequence:Zu,platform:cR}),p0=$m.extend({sequence:Zu,credentialDigest:d0,connectionId:n.uuid().nullable(),kind:n.enum(["fcm_token","apns_token"]).nullable(),token:n.string().regex(/^[\x21-\x7e]{16,4096}$/).nullable(),permission:sR}),ite=p0.extend({challenge:n.string().regex(/^[A-Za-z0-9_-]{100,3500}$/)}),ote=n.strictObject({requested:n.literal(!0),expiresAt:n.iso.datetime({offset:!0})}),jm=n.strictObject({installationId:n.uuid(),bound:n.boolean(),identitySeq:Zu,bindingGeneration:Zu,addressSeq:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER),addressRevision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER),connectionId:n.uuid().nullable(),addressStatus:n.enum(["active","invalid"]).nullable(),permission:sR}),m0=n.strictObject({channel:n.enum(["email","sms","voice","push"]),state:n.enum(["unknown","allowed","denied"]),revision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER),updatedAt:n.iso.datetime({offset:!0}).nullable()}),ate=n.strictObject({state:n.enum(["allowed","denied"]),revision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER-1)})});function H5(e,t){if(e==="CONFLICT"&&t===425)return{retryable:!0,recovery:"retry_same_request"};if(e==="CONFLICT"&&t===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(dR,e)){let i=dR[e];return{retryable:i==="retry_same_request",recovery:i}}let r=h0.safeParse(e);return r.success?{retryable:e==="RATE_LIMITED"||e==="SERVICE_UNAVAILABLE",recovery:Z5[r.data].recovery}:{retryable:!1,recovery:"contact_support"}}function G5(e,t=Date.now()){if(e===null)return;let r=e.trim();if(/^\d+$/.test(r)){let o=Number(r);return Number.isSafeInteger(o)?o:void 0}if(!/^[A-Za-z]{3}, \d{2} [A-Za-z]{3} \d{4} \d{2}:\d{2}:\d{2} GMT$/.test(r))return;let i=Date.parse(r);return Number.isFinite(i)?Math.max(0,Math.ceil((i-t)/1e3)):void 0}function mR(e,t,r={}){let i=H5(e,t),o=r.reason==="RESULT_UNKNOWN"?"recover_operation":r.recovery??i.recovery,a=i.retryable&&r.retryable!==!1&&o!=="recover_operation",s=a?G5(r.retryAfter??null):void 0;return{...i,retryable:a,recovery:o,...s===void 0?{}:{retryAfterSeconds:s},...r.reason?{reason:r.reason}:{}}}var h0,ute,lte,B5,q5,Z5,dR,pR,K5,dte,pte,g0=x(()=>{"use strict";ee();h0=n.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"]),ute=n.enum([...h0.options,"INVALID_SERVER_RESPONSE","RESPONSE_TOO_LARGE","AMBIGUOUS_AUTHENTICATION","BROWSER_REQUIRED","INVALID_REDIRECT_URI","AUTHORIZATION_UNAVAILABLE","UNREGISTERED_CLIENT","MANAGEMENT_OPERATION_FAILED"]),lte=n.enum([...h0.options,"stale_revision"]),B5=n.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"]),q5=n.enum(["CAPABILITY_NOT_ENABLED","INTEGRATION_MISSING","PROVIDER_CREDENTIAL_REJECTED","PRICE_BINDING_REQUIRED","IDEMPOTENCY_CONFLICT","RESULT_UNKNOWN","STATE_CHANGED","OPERATION_IN_PROGRESS","FUNNEL_VERSION_RETIRED"]),Z5={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"}},dR={TIMEOUT:"recover_operation",NETWORK_ERROR:"recover_operation",HTTP_ERROR:"recover_operation",INVALID_RESPONSE:"recover_operation",NOT_IDENTIFIED:"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",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",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"};pR=n.object({retryable:n.boolean(),recovery:B5,reason:q5.optional(),retryAfterSeconds:n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()}),K5=n.object({requestId:n.uuid().optional(),error:n.object({code:n.string().regex(/^[A-Z][A-Z0-9_]{0,95}$/),message:n.string(),...pR.partial().shape})}),dte=n.object({error:K5.shape.error.extend({requestId:n.uuid().optional()})}),pte=n.object({error:n.string(),code:n.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,95}$/),requestId:n.uuid(),...pR.shape})});var fR=x(()=>{"use strict"});function y0(e){let t=Oe.parse(e.toUpperCase());return["JPY","KRW","VND"].includes(t)?0:2}function Cs(e,t,r="en",i={}){let o=Oe.parse(t.toUpperCase());return new Intl.NumberFormat(r,{style:"currency",currency:o,...i}).format(e/10**y0(o))}var Lm,Oe,qt=x(()=>{"use strict";ee();Lm=["USD","EUR","CNY","GBP","JPY","CAD","AUD","NZD","CHF","HKD","SGD","KRW","INR","BRL","MXN","TWD","THB","IDR","MYR","PHP","VND","ZAR","AED","SAR","SEK","NOK","DKK","PLN","CZK","HUF","ILS","TRY","RON"],Oe=n.enum(Lm)});var gR,hR,W5,Ate,b0=x(()=>{"use strict";ee();qt();gR=n.partialRecord(n.enum(Lm),n.number().int().min(1).max(1e8)),hR=n.strictObject({currency:n.enum(Lm),automaticTax:n.boolean()}),W5=n.strictObject({projectId:n.uuid(),environmentId:n.uuid()}),Ate=W5.extend({settings:hR,expected:hR})});var ra,wte,Mm=x(()=>{"use strict";ee();qt();ra=n.string().trim().min(1).max(64).regex(/^[a-z][a-z0-9_]*$/,"ID \u4F7F\u7528\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF\uFF0C\u5E76\u4EE5\u5B57\u6BCD\u5F00\u5934"),wte=n.object({amountCents:n.number().int().min(0).max(1e8),currency:Oe,interval:n.enum(["free","month","year"]),currencyOptions:n.partialRecord(Oe,n.number().int().min(1).max(1e8)).optional()}).refine(e=>e.interval==="free"?e.amountCents===0:e.amountCents>0,"\u514D\u8D39\u5957\u9910\u91D1\u989D\u5FC5\u987B\u4E3A 0\uFF0C\u4ED8\u8D39\u91D1\u989D\u5FC5\u987B\u5927\u4E8E 0").refine(e=>!e.currencyOptions||!Object.hasOwn(e.currencyOptions,e.currency)&&(e.interval!=="free"||Object.keys(e.currencyOptions).length===0),"\u9644\u52A0\u5E01\u79CD\u4E0D\u80FD\u91CD\u590D\u9ED8\u8BA4\u5E01\u79CD\uFF1B\u514D\u8D39\u5957\u9910\u4E0D\u8BBE\u7F6E\u9644\u52A0\u4EF7\u683C")});var yR=x(()=>{qu();qu()});var Hu=x(()=>{yR()});var bR,AR=x(()=>{"use strict";Hu();bR=n.registry()});var Fm,xR,J5,Q5,Gu,Y5,X5,e3,t3,n3,r3,SR,A0,Ps,i3,Xi,x0,Ku,vR,o3,a3,wR,_R,S0,zm,Wu,Um,IR,s3,Vm,Bm,v0,kR,c3,u3,w0,ER,l3,CR,_0,PR,I0,d3,Ju,p3,m3,f3,OR,h3,g3,y3,b3,A3,x3,qm,S3,v3,w3,_3,I3,TR,k3,E3,C3,P3,k0,O3,T3,RR,R3,N3,NR,D3,DR,$3,j3,Zm,$R,L3,M3,F3,z3,U3,jR,E0,V3,B3,Nte,q3,LR,MR,FR,zR,Z3,H3,Hm,G3,C0,K3,UR,W3,J3,Q3,Y3,X3,VR,Gm,BR,qR,e9,t9,ZR,n9,P0,r9,O0,HR,GR,i9,o9,a9,Dte,s9,KR,c9,WR,u9,l9,JR,QR,$te,jte,YR,XR,d9,eN,p9,m9,tN,f9,h9,g9,y9,b9,A9,x9,Lte,T0,R0,N0,S9,v9,w9,_9,D0,I9,nN,k9,Mte,E9,rN,C9,iN,P9,O9,T9,R9,N9,oN,D9,Km,$9,j9,L9,Qu,aN,M9,sN,F9,Wm,z9,cN,U9,V9,uN,lN,B9,Fte,dN,$0,pN,j0,zte,q9,Ute,L0,Vte,mN,Z9,Bte,qte,fN=x(()=>{"use strict";Hu();AR();({AppEnv:Fm}=(()=>{var e;return(function(t){t.Sandbox="sandbox",t.Live="live"})(e||(e={})),{AppEnv:e}})()),{IGNORE_PAST_DUE_DESCRIPTION:xR}={IGNORE_PAST_DUE_DESCRIPTION:"If true, entitlements attached to this plan will still reset on schedule even when the customer's product is in a past_due state."},{PurchaseLimitInterval:J5}=(()=>{var e;return(function(t){t.Hour="hour",t.Day="day",t.Week="week",t.Month="month"})(e||(e={})),{PurchaseLimitInterval:e}})(),{SpendLimitType:Q5}=(e=>({SpendLimitType:e.enum(["absolute","usage_percentage"])}))(n),{ResetInterval:Gu}=(()=>{var e;return(function(t){t.OneOff="one_off",t.Minute="minute",t.Hour="hour",t.Day="day",t.Week="week",t.Month="month",t.Quarter="quarter",t.SemiAnnual="semi_annual",t.Year="year"})(e||(e={})),{ResetInterval:e}})(),{USAGE_LIMIT_ANCHORS:Y5}={USAGE_LIMIT_ANCHORS:["billing_cycle","utc"]},{USAGE_LIMIT_FILTER_MAX_KEY_LENGTH:X5}={USAGE_LIMIT_FILTER_MAX_KEY_LENGTH:64},{USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH:e3}={USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH:128},{USAGE_LIMIT_FILTER_MAX_KEYS:t3}={USAGE_LIMIT_FILTER_MAX_KEYS:4},{UsageAlertThresholdType:n3}=(e=>({UsageAlertThresholdType:e.enum(["usage","usage_percentage","remaining","remaining_percentage"])}))(n),{BALANCE_BASES:r3}={BALANCE_BASES:["balance","included","recurring"]},{DEFAULT_USAGE_ALERT_BASIS:SR}={DEFAULT_USAGE_ALERT_BASIS:"balance"},{DbOverageAllowedSchema:A0}=(e=>({DbOverageAllowedSchema:e.object({feature_id:e.string().meta({description:"The feature ID this overage allowed control applies to."}),enabled:e.boolean().default(!1).meta({description:"Whether overage is allowed for this feature."})})}))(n),{ProductMetadataSchema:Ps}=(e=>({ProductMetadataSchema:e.record(e.string(),e.any())}))(n),{findDuplicate:i3}={findDuplicate:t=>{let r=new Set;for(let i of t){if(r.has(i))return i;r.add(i)}}},{BillingInterval:Xi}=(()=>{var e;return(function(t){t.OneOff="one_off",t.Week="week",t.Month="month",t.Quarter="quarter",t.SemiAnnual="semi_annual",t.Year="year"})(e||(e={})),{BillingInterval:e}})(),{DisplaySchema:x0}=(e=>({DisplaySchema:e.object({primary_text:e.string().meta({description:"Main display text (e.g. '$10' or '100 messages')."}),secondary_text:e.string().optional().meta({description:"Secondary display text (e.g. 'per month' or 'then $0.5 per 100')."})})}))(n),{withSpecDefault:Ku}=(e=>({withSpecDefault:({schema:r,defaultValue:i,description:o})=>(e.add(r,{description:o,default:i}),r)}))(bR),{COMMON:vR}={COMMON:["usd","eur","gbp","cad","aud","jpy","chf","cny","inr"]},{STRIPE_PRESENTMENT_CURRENCIES:o3}={STRIPE_PRESENTMENT_CURRENCIES:["usd","aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bif","bmd","bnd","bob","brl","bsd","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cve","czk","djf","dkk","dop","dzd","egp","etb","eur","fjd","fkp","gbp","gel","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","isk","jmd","jpy","kes","kgs","khr","kmf","krw","kyd","kzt","lak","lbp","lkr","lrd","lsl","mad","mdl","mga","mkd","mmk","mnt","mop","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sek","sgd","shp","sle","sos","srd","std","szl","thb","tjs","top","try","ttd","twd","tzs","uah","ugx","uyu","uzs","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw"]},{COMMON_SET:a3}=(e=>({COMMON_SET:new Set(e)}))(vR),{hasNoDuplicateCurrencies:wR}={hasNoDuplicateCurrencies:t=>{let r=new Set;for(let{currency:i}of t){let o=i.toLowerCase();if(r.has(o))return!1;r.add(o)}return!0}},{DUPLICATE_CURRENCY_MESSAGE:_R}={DUPLICATE_CURRENCY_MESSAGE:"Each currency may appear at most once in additional_currencies."},{IncludedUsageParamsSchema:S0}=(e=>({IncludedUsageParamsSchema:e.number().max(1e13,{error:"Included usage cannot exceed 10 trillion; use unlimited usage instead"})}))(n),{Infinite:zm}={Infinite:"inf"},{TierBehavior:Wu}=(()=>{var e;return(function(t){t.Graduated="graduated",t.VolumeBased="volume"})(e||(e={})),{TierBehavior:e}})(),{BillingMethod:Um}=(()=>{var e;return(function(t){t.Prepaid="prepaid",t.UsageBased="usage_based"})(e||(e={})),{BillingMethod:e}})(),{AllocatedBilling:IR}=(()=>{var e;return(function(t){t.Arrear="arrear",t.ProratedLegacy="prorated_legacy"})(e||(e={})),{AllocatedBilling:e}})(),{PLAN_ITEM_PRICE_DESCRIPTION:s3}={PLAN_ITEM_PRICE_DESCRIPTION:"Pricing for usage beyond included units. Omit for free features."},{OnIncrease:Vm}=(()=>{var e;return(function(t){t.BillImmediately="bill_immediately",t.ProrateImmediately="prorate_immediately",t.ProrateNextCycle="prorate_next_cycle",t.BillNextCycle="bill_next_cycle"})(e||(e={})),{OnIncrease:e}})(),{OnDecrease:Bm}=(()=>{var e;return(function(t){t.Prorate="prorate",t.ProrateImmediately="prorate_immediately",t.ProrateNextCycle="prorate_next_cycle",t.None="none",t.NoProrations="no_prorations"})(e||(e={})),{OnDecrease:e}})(),{RolloverExpiryDurationType:v0}=(()=>{var e;return(function(t){t.Month="month",t.Forever="forever"})(e||(e={})),{RolloverExpiryDurationType:e}})(),{EntitlementDuration:kR}=(()=>{var e;return(function(t){t.Day="day",t.Week="week",t.Month="month",t.Year="year"})(e||(e={})),{EntitlementDuration:e}})(),{CREDIT_DIMENSION_NAME_MAX_LENGTH:c3}={CREDIT_DIMENSION_NAME_MAX_LENGTH:64},{USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:u3}={USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:"::"},{CreditMatchSchema:w0}=(e=>({CreditMatchSchema:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()]).transform(String).pipe(e.string()))}))(n),{ApiCreditTierSchema:ER}=(e=>({ApiCreditTierSchema:e.object({to:e.union([e.number().positive(),e.enum(["inf"])]).meta({description:"Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'."}),credit_cost:e.number().min(0).meta({description:"Credits consumed per billing-unit group within this tier."})})}))(n),{VIOLATION_MESSAGES:l3}={VIOLATION_MESSAGES:{non_final_infinity:"Only the final tier may use an 'inf' boundary.",not_increasing:"Tier boundaries must be strictly increasing.",final_not_infinity:"The final tier must use an 'inf' boundary."}},{MarkupEntrySchema:CR}=(e=>({MarkupEntrySchema:e.object({markup:e.number().min(-100)})}))(n),{ModelMarkupsSchema:_0}=((e,t)=>({ModelMarkupsSchema:e.record(e.string().regex(/.+\/.+/,'Model keys are "<provider>/<model>", e.g. "openai/gpt-4o" or "custom/my-model".'),t.extend({markup:e.number().min(-100).optional(),input_cost:e.number().min(0).optional(),output_cost:e.number().min(0).optional()})).nullish()}))(n,CR),{additionalCurrencyPlanItemIssues:PR}={additionalCurrencyPlanItemIssues:t=>{if(!t)return[];let r=[];t.additional_currencies&&t.additional_currencies.length>0&&(typeof t.amount!="number"||(t.tiers?.length??0)>0)&&r.push("price.additional_currencies requires a flat 'amount'; tiered prices carry per-currency amounts on each tier.");let i=t.tiers;if(i&&i.length>0){let o=s=>(s.additional_currencies??[]).map(c=>c.currency.toLowerCase()),a=new Set(i.flatMap(o));a.size>0&&(i.every(c=>{let u=new Set(o(c));return u.size===a.size&&[...a].every(l=>u.has(l))})||r.push("Each additional currency must be present on every tier or none."))}return r}},{PlanItemFilterSchema:I0}=((e,t,r,i,o)=>({PlanItemFilterSchema:e.object({feature_id:e.string().optional().meta({description:"Match items linked to this feature."}),billing_method:e.enum(t).optional().meta({description:"Match items with this billing method (prepaid or usage_based)."}),interval:e.union([e.enum(r),e.enum(i)]).optional().meta({description:"Match items with this interval. Accepts either a BillingInterval (price-side) or a ResetInterval (reset-side, includes day/hour/minute) so price-less items keyed by reset.interval can be disambiguated."}),interval_count:e.number().int().positive().optional().meta({description:"Match items with this interval_count. Disambiguates between items that share an interval but differ in count."}),included:o.optional().meta({description:"Match items whose grant equals this included usage. Omitted is a wildcard."})}).refine(s=>s.feature_id!==void 0||s.billing_method!==void 0||s.interval!==void 0||s.interval_count!==void 0,{message:"PlanItemFilter must have at least one field set."}).meta({title:"PlanItemFilter",description:"Filter for matching plan items. All provided fields must match (AND)."})}))(n,Um,Xi,Gu,S0),{UpdatePlanItemParamsV1Schema:d3}=((e,t,r)=>({UpdatePlanItemParamsV1Schema:e.object({filter:t.meta({description:"Filter selecting which existing plan item(s) to update. Same shape as remove_items filters."}),included:e.number().nonnegative().optional().meta({description:"Override the matched item's included usage / allowance. Existing usage carries forward."}),interval:e.enum(r).optional().meta({description:"Override the matched item's reset interval. Use 'one_off' for non-resetting balances."})}).meta({title:"UpdatePlanItem",description:"Deprecated. Use remove_items and add_items to replace plan items.",deprecated:!0})}))(n,I0,Gu),{FreeTrialDuration:Ju}=(()=>{var e;return(function(t){t.Day="day",t.Month="month",t.Year="year"})(e||(e={})),{FreeTrialDuration:e}})(),{laneParam:p3}=((e,t)=>({laneParam:({schema:i,description:o})=>e({schema:t.array(i).optional(),defaultValue:[],description:o})}))(Ku,n),{findDuplicateInControls:m3}={findDuplicateInControls:({controlKey:t,controls:r,rule:i})=>{let o=new Set;for(let[a,s]of r.entries()){let c=i.identityOf(s);if(c!==void 0){if(o.has(c))return{code:"custom",message:i.message,input:s[i.field],path:[t,a,i.field]};o.add(c)}}}},{featureIdIdentity:f3}={featureIdIdentity:t=>t.feature_id||void 0},{usageLimitFilterKey:OR}={usageLimitFilterKey:t=>t?.properties?Object.entries(t.properties).map(([r,i])=>[r,String(i)]).sort(([r],[i])=>r.localeCompare(i)).map(([r,i])=>`${r}=${i}`).join("&"):""},{usageAlertIdentity:h3}=((e,t)=>({usageAlertIdentity:i=>[i.feature_id??"",i.basis??e,t(i.filter),i.threshold_type,i.threshold].join("|")}))(SR,OR),{RemovePlanLicenseSchema:g3}=(e=>({RemovePlanLicenseSchema:e.object({license_plan_id:e.string()})}))(n),{ApiStripePriceProcessorSchema:y3}=(e=>({ApiStripePriceProcessorSchema:e.object({price_id:e.string().meta({description:"Stripe price ID. For prepaid with included > 0 this is the V2 price."})})}))(n),{ApiFeatureType:b3}=(()=>{var e;return(function(t){t.Static="static",t.Boolean="boolean",t.SingleUsage="single_use",t.ContinuousUse="continuous_use",t.CreditSystem="credit_system",t.AiCreditSystem="ai_credit_system"})(e||(e={})),{ApiFeatureType:e}})(),{ApiStripePlanProcessorSchema:A3}=(e=>({ApiStripePlanProcessorSchema:e.object({product_id:e.string().meta({description:"Stripe product ID this plan is billed under."}),additional_product_ids:e.array(e.string()).optional().meta({description:"Extra Stripe product IDs aliased to this plan."})})}))(n),{ApiRevenueCatProductSchema:x3}=(e=>({ApiRevenueCatProductSchema:e.object({product_id:e.string().meta({description:"RevenueCat product ID that grants this plan when purchased."}),feature_quantities:e.array(e.object({feature_id:e.string(),quantity:e.number().nonnegative().optional()})).optional().meta({description:"Prepaid quantities granted when this specific RevenueCat product is purchased, in feature units."})})}))(n),{TrialOnEnd:qm}={TrialOnEnd:["bill","revert"]},{EligibilityStatus:S3}=(()=>{var e;return(function(t){t.Active="active",t.Scheduled="scheduled"})(e||(e={})),{EligibilityStatus:e}})(),{AttachAction:v3}=(()=>{var e;return(function(t){t.Activate="activate",t.Upgrade="upgrade",t.Downgrade="downgrade",t.None="none",t.Purchase="purchase"})(e||(e={})),{AttachAction:e}})(),{AttachScenario:w3}=(()=>{var e;return(function(t){t.Scheduled="scheduled",t.Active="active",t.New="new",t.Renew="renew",t.Upgrade="upgrade",t.UpdatePrepaidQuantity="update_prepaid_quantity",t.Downgrade="downgrade",t.Cancel="cancel",t.Expired="expired",t.PastDue="past_due"})(e||(e={})),{AttachScenario:e}})(),{UsageWindowDimensionSchema:_3}=(e=>({UsageWindowDimensionSchema:e.enum(["balance","metered_feature"])}))(n),{UsageWindowScopeSchema:I3}=(e=>({UsageWindowScopeSchema:e.enum(["customer","entity"])}))(n),{EntInterval:TR}=(()=>{var e;return(function(t){t.Lifetime="lifetime",t.Minute="minute",t.Hour="hour",t.Day="day",t.Week="week",t.Month="month",t.Quarter="quarter",t.SemiAnnual="semi_annual",t.Year="year"})(e||(e={})),{EntInterval:e}})(),{FeatureType:k3}=(()=>{var e;return(function(t){t.Boolean="boolean",t.Metered="metered",t.CreditSystem="credit_system",t.AiCreditSystem="ai_credit_system"})(e||(e={})),{FeatureType:e}})(),{FeatureStripeMeterSchema:E3}=(e=>({FeatureStripeMeterSchema:e.object({id:e.string(),event_name:e.string()})}))(n),{FreeTrialSchema:C3}=((e,t,r)=>({FreeTrialSchema:e.object({id:e.string(),duration:e.enum(t),length:e.number(),unique_fingerprint:e.boolean(),created_at:e.number(),internal_product_id:e.string(),is_custom:e.boolean(),card_required:e.boolean(),on_end:e.enum(r).nullish()})}))(n,Ju,qm),{BillingType:P3}=(()=>{var e;return(function(t){t.OneOff="one_off",t.FixedCycle="fixed_cycle",t.UsageBelowThreshold="usage_below_threshold",t.UsageInAdvance="usage_in_advance",t.UsageInArrear="usage_in_arrear",t.InArrearProrated="in_arrear_prorated"})(e||(e={})),{BillingType:e}})(),{UsageTierSchema:k0}=((e,t)=>({UsageTierSchema:e.object({to:e.number().or(e.literal(t)),amount:e.number().optional(),flat_amount:e.number().optional()}).refine(i=>i.amount!==void 0||i.flat_amount!==void 0,{message:"Either amount or flat_amount, or both must be defined",path:["amount","flat_amount"]}).transform(i=>({...i,amount:i.amount??0})).pipe(e.object({to:e.number().or(e.literal(t)),amount:e.number(),flat_amount:e.number().optional()}))}))(n,zm),{IgnoredFixedPriceMetadataSchema:O3}=(e=>({IgnoredFixedPriceMetadataSchema:e.preprocess(r=>typeof r=="string"?null:r,e.null().or(e.undefined()))}))(n),{BillWhen:T3}=(()=>{var e;return(function(t){t.InAdvance="in_advance",t.StartOfPeriod="start_of_period",t.EndOfPeriod="end_of_period"})(e||(e={})),{BillWhen:e}})(),{AllocatedBillingBehavior:RR}=(()=>{var e;return(function(t){t.Arrear="arrear",t.Prorated="prorated"})(e||(e={})),{AllocatedBillingBehavior:e}})(),{ProrationConfigSchema:R3}=((e,t,r)=>({ProrationConfigSchema:e.object({on_increase:e.nativeEnum(t).default(t.ProrateImmediately),on_decrease:e.nativeEnum(r).default(r.ProrateImmediately)})}))(n,Vm,Bm),{AllowanceType:N3}=(()=>{var e;return(function(t){t.Fixed="fixed",t.Unlimited="unlimited",t.None="none"})(e||(e={})),{AllowanceType:e}})(),{RolloverConfigSchema:NR}=((e,t)=>({RolloverConfigSchema:e.object({max:e.number().nullable().optional(),max_percentage:e.number().nullable().optional(),duration:e.enum(t).default(t.Month),length:e.number()})}))(n,v0),{CreditDimensionBaseSchema:D3}=((e,t)=>({CreditDimensionBaseSchema:e.object({match:t,priority:e.number().int().optional()})}))(n,w0),{flatCreditRateShape:DR}=(e=>({flatCreditRateShape:{credit_amount:e.number(),tier_behavior:e.never().optional(),tiers:e.never().optional()}}))(n),{CreditTierSchema:$3}=(e=>({CreditTierSchema:e.object({to:e.union([e.number(),e.literal("inf")]),credit_amount:e.number()})}))(n),{CreditMultiplierSchema:j3}=((e,t)=>({CreditMultiplierSchema:e.object({match:t,factor:e.number().positive().optional(),add:e.number().optional()}).refine(i=>i.factor!==void 0||i.add!==void 0,{message:"A multiplier needs a factor or an add"})}))(n,w0),{idRegex:Zm}={idRegex:/^[a-zA-Z0-9_-]+$/},{descriptions:$R}={descriptions:{id:"The ID of the product. Used to identify the product in other API calls like checkout or update product.",name:"The name of the product",description:"The description of the product",is_add_on:"Whether the product is an add-on. Add-on products can be attached multiple times and don't to through upgrade / downgrade flows.",is_default:"Whether the product is the default product. Default products are enabled by default for new customers.",group:"Product group which this product belongs to. Products within a group have upgrade / downgrade logic when the customer moves between them.",items:"Array of product items that define the product's features and pricing",free_trial:"Free trial configuration for this product, if available",metadata:"Arbitrary key-value metadata for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Metadata is shared across all versions of a plan.",archived:"Archive this product using this flag. Archived products are hidden on the dashboard."}},{ProductItemType:L3}=(()=>{var e;return(function(t){t.Feature="feature",t.FeaturePrice="priced_feature",t.Price="price"})(e||(e={})),{ProductItemType:e}})(),{ProductItemFeatureType:M3}=(()=>{var e;return(function(t){t.SingleUse="single_use",t.ContinuousUse="continuous_use",t.Boolean="boolean",t.Static="static"})(e||(e={})),{ProductItemFeatureType:e}})(),{ProductItemInterval:F3}=(()=>{var e;return(function(t){t.Minute="minute",t.Hour="hour",t.Day="day",t.Week="week",t.Month="month",t.Quarter="quarter",t.SemiAnnual="semi_annual",t.Year="year"})(e||(e={})),{ProductItemInterval:e}})(),{UsageModel:z3}=(()=>{var e;return(function(t){t.Prepaid="prepaid",t.PayPerUse="pay_per_use"})(e||(e={})),{UsageModel:e}})(),{TierInfinite:U3}={TierInfinite:"inf"},{CreateFreeTrialSchema:jR}=((e,t,r)=>({CreateFreeTrialSchema:e.object({length:e.string().or(e.number()).transform(o=>Number(o)).refine(o=>o>0,{message:"Free trial length must be greater than 0"}),unique_fingerprint:e.boolean().default(!1),duration:e.enum(t).default(t.Day),card_required:e.boolean().default(!0),on_end:e.enum(r).nullish()})}))(n,Ju,qm),{ProductConfigParamsSchema:E0}=((e,t,r)=>({ProductConfigParamsSchema:e.object({ignore_past_due:t({schema:e.boolean().optional(),defaultValue:!1,description:r})})}))(n,Ku,xR),{CREATE_PRODUCT_EXAMPLE:V3}={CREATE_PRODUCT_EXAMPLE:{id:"Pro Product",name:"Pro Plan",is_add_on:!1,is_default:!1,items:[{price:20,interval:"month"},{feature_id:"messages",included_usage:1e3,price:.5,interval:"month",usage_model:"pay_per_use"}],free_trial:{duration:"day",length:7,unique_fingerprint:!1,card_required:!0}}},{ApiFreeTrialSchema:B3}=((e,t,r)=>({ApiFreeTrialSchema:e.object({duration:e.enum(t).meta({description:"The duration type of the free trial"}),length:e.number().meta({description:"The length of the duration type specified"}),unique_fingerprint:e.boolean().meta({description:"Whether the free trial is limited to one per customer fingerprint"}),card_required:e.boolean().meta({description:"Whether the free trial requires a card. If false, the customer can attach the product without going through a checkout flow or having a card on file."}),on_end:e.enum(r).nullish().meta({description:"Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan."}),trial_available:e.boolean().default(!0).nullish().meta({description:"Used in customer context. Whether the free trial is available for the customer if they were to attach the product."})})}))(n,Ju,qm),{CreateProductSchema:Nte}=(e=>({CreateProductSchema:e.object({id:e.string(),name:e.string().min(1,"Product name cannot be empty").default("Untitled Product"),is_add_on:e.boolean().default(!1),is_default:e.boolean().default(!1),version:e.number().optional().default(1),group:e.string().optional().default("")})}))(n),{isUsageLimitBasisAlert:q3}={isUsageLimitBasisAlert:t=>t.basis==="usage_limit"},{PromoCodeSchema:LR}=(e=>({PromoCodeSchema:e.object({code:e.string(),global_max_redemption:e.number().positive().optional(),first_time_transaction:e.boolean().optional(),max_redemptions:e.number().positive().optional()})}))(n),{RewardType:MR}=(()=>{var e;return(function(t){t.PercentageDiscount="percentage_discount",t.FixedDiscount="fixed_discount",t.FreeProduct="free_product",t.InvoiceCredits="invoice_credits",t.FeatureGrant="feature_grant"})(e||(e={})),{RewardType:e}})(),{CouponDurationType:FR}=(()=>{var e;return(function(t){t.OneOff="one_off",t.Months="months",t.Forever="forever"})(e||(e={})),{CouponDurationType:e}})(),{FreeProductConfigSchema:zR}=((e,t)=>({FreeProductConfigSchema:e.object({duration_type:e.nativeEnum(t),duration_value:e.number()})}))(n,FR),{RewardTriggerEvent:Z3}=(()=>{var e;return(function(t){t.CustomerCreation="customer_creation",t.Checkout="checkout"})(e||(e={})),{RewardTriggerEvent:e}})(),{RewardReceivedBy:H3}=(()=>{var e;return(function(t){t.Referrer="referrer",t.All="all"})(e||(e={})),{RewardReceivedBy:e}})(),{ProductConfigSchema:Hm}=((e,t)=>({ProductConfigSchema:e.object({ignore_past_due:e.boolean().default(!1).meta({description:t})})}))(n,xR),{PurchaseLimitIntervalEnum:G3}=((e,t)=>({PurchaseLimitIntervalEnum:e.enum(t)}))(n,J5),{DbSpendLimitSchema:C0}=((e,t)=>({DbSpendLimitSchema:e.object({feature_id:e.string().optional().meta({description:"Optional feature ID this spend limit applies to."}),enabled:e.boolean().default(!1).meta({description:"Whether the overage spend limit is enabled."}),limit_type:t.optional().meta({description:"How overage_limit is interpreted: an absolute overage cap (default) or a percentage of the main-plan allowance."}),overage_limit:e.number().min(0).optional().meta({description:"Overage cap for the feature: absolute units, or a percent (e.g. 120) when limit_type is usage_percentage."}),skip_overage_billing:e.boolean().optional().meta({description:"When true, overage for this feature is not posted to Stripe. Usage tracking and balance resets still behave normally."})}).refine(i=>i.overage_limit===void 0&&i.skip_overage_billing===void 0||i.feature_id!==void 0,{message:"feature_id is required when overage_limit or skip_overage_billing is provided",path:["feature_id"]})}))(n,Q5),{USAGE_LIMIT_INTERVALS:K3}=(e=>({USAGE_LIMIT_INTERVALS:[e.Day,e.Week,e.Month,e.Year]}))(Gu),{UsageLimitAnchorSchema:UR}=((e,t)=>({UsageLimitAnchorSchema:e.enum(t)}))(n,Y5),{UsageLimitFilterValueSchema:W3}=((e,t)=>({UsageLimitFilterValueSchema:e.union([e.string().min(1).max(t),e.number(),e.boolean()]).transform(String).pipe(e.string())}))(n,e3),{USAGE_ALERT_BASES:J3}=(e=>({USAGE_ALERT_BASES:[...e,"usage_limit"]}))(r3),{licensePatchIssues:Q3}=(e=>({licensePatchIssues:({upsertLicenses:r=[]})=>{let i=e(r.map(o=>o.license_plan_id));return i===void 0?[]:[{message:`Duplicate license ${i} in upsert_licenses`,path:["upsert_licenses"]}]}}))(i3),{BasePriceSchema:Y3}=((e,t,r)=>({BasePriceSchema:e.object({amount:e.number().meta({description:"Base price amount for the plan, in major currency units (e.g. dollars)."}),interval:e.enum(t).meta({description:"Billing interval (e.g. 'month', 'year')."}),interval_count:e.number().optional().meta({description:"Number of intervals per billing cycle. Defaults to 1."}),display:r.optional().meta({description:"Display text for showing this price in pricing pages."})})}))(n,Xi,x0),{CURRENCY_CODES:X3}=((e,t,r)=>({CURRENCY_CODES:[...e,...t.filter(o=>!r.has(o)).sort()]}))(vR,o3,a3),{AllocatedBillingFieldSchema:VR}=((e,t)=>({AllocatedBillingFieldSchema:e.enum(t).optional().meta({internal:!0,description:"How an allocated usage_based price bills mid-cycle quantity changes. 'arrear' (default) bills at period end. 'prorated_legacy' is only returned for prices still on the legacy immediate-proration behavior; omit it to migrate the price to 'arrear'."})}))(n,IR),{EntitlementExpirySchema:Gm}=((e,t)=>({EntitlementExpirySchema:e.object({duration:e.enum(t),length:e.number()})}))(n,kR),{CreditDimensionNameSchema:BR}=((e,t,r)=>({CreditDimensionNameSchema:e.string().min(1).max(t).refine(o=>!o.includes(r),{message:`Dimension names cannot contain "${r}"`})}))(n,c3,u3),{ApiCreditMatchSchema:qR}=(e=>({ApiCreditMatchSchema:e.meta({description:"Event properties this entry applies to. Every key must equal the tracked property, compared as strings."})}))(w0),{findCreditTierViolations:e9}=(e=>({findCreditTierViolations:r=>{let i=[],o=(s,c)=>i.push({index:s,reason:c,message:e[c]}),a=0;for(let[s,c]of r.entries()){let u=s===r.length-1;if(c==="inf"){u||o(s,"non_final_infinity");continue}(!Number.isFinite(c)||c<=a)&&o(s,"not_increasing"),a=c,u&&o(s,"final_not_infinity")}return i}}))(l3),{ApiCreditMultiplierSchema:t9}=((e,t)=>({ApiCreditMultiplierSchema:e.object({match:t,factor:e.number().positive().optional().meta({description:"Multiplies the matched rate. All matching multipliers stack."}),add:e.number().optional().meta({description:"Added to the rate after every factor is applied, in credits per billing-unit group."})}).strict().refine(i=>i.factor!==void 0||i.add!==void 0,{message:"A multiplier needs a factor or an add."})}))(n,qR),{ProviderMarkupsSchema:ZR}=((e,t)=>({ProviderMarkupsSchema:e.record(e.string(),t).nullish()}))(n,CR),{planItemParamsIssues:n9}=((e,t,r,i,o)=>({planItemParamsIssues:s=>{let c=[],u=s.reset?.interval,l=s.price?.interval,d=s.reset?.interval_count??1,p=s.price?.interval_count??1;if(u&&l&&(String(u)!==String(l)||d!==p)&&s.price?.billing_method!==e.Prepaid&&c.push({message:"reset.interval and price.interval can only differ for prepaid prices.",input:s}),s.threshold_billing&&(!s.price||s.unlimited)&&c.push({message:"threshold_billing requires a finite usage-based price",input:s.threshold_billing}),s.expiry&&(s.price?.billing_method===e.Prepaid&&String(s.price.interval)===String(t.OneOff)||c.push({message:"expiry is only supported on one-off prepaid items. Recurring items are already bounded by their reset cadence.",input:s.expiry}),s.entity_feature_id&&c.push({message:"expiry is not supported on entity-scoped items; each entity's balance would have to expire on its own clock.",input:s.expiry}),s.pooled&&c.push({message:"expiry is not supported on pooled items; pooled balances have no per-purchase lifetime.",input:s.expiry}),s.expiry.length<=0&&c.push({message:"expiry.length must be greater than 0",input:s.expiry})),s.price){s.threshold_billing&&s.price.billing_method!==e.UsageBased&&c.push({message:"threshold_billing requires a finite usage-based price",input:s.threshold_billing});let{amount:f,tiers:m}=s.price;s.threshold_billing&&m?.length&&c.push({message:"threshold_billing currently requires a flat usage price",input:s.threshold_billing});let g=s.price.billing_method===e.UsageBased&&s.price.allocated_billing===r.ProratedLegacy;s.proration&&s.price.billing_method!==e.Prepaid&&!g&&c.push({message:"proration is only supported for prepaid or legacy allocated prices.",input:s.proration});let A=typeof f=="number",C=Array.isArray(m)&&m.length>0;A||C?A&&C&&c.push({message:"'amount' and 'tiers' cannot both be defined in 'price'.",input:s.price}):c.push({message:"If 'price' is present, either 'amount' or 'tiers' must be defined.",input:s.price})}if(s.price?.tiers){let f=s.price.tiers.some(m=>m.flat_amount&&m.flat_amount>0);f&&s.price.tier_behavior!==i.VolumeBased&&c.push({message:"flat_amount on tiers is only supported for volume-based pricing.",input:s.price}),f&&s.price.tiers.length<=1&&c.push({message:"flat_amount is not supported on single-tier pricing.",input:s.price}),s.price.tiers.some(m=>m.flat_amount!=null&&m.flat_amount<0)&&c.push({message:"flat_amount must be 0 or greater.",input:s.price}),s.price?.tier_behavior===i.VolumeBased&&s.price?.billing_method!==e.Prepaid&&c.push({message:"volume-based pricing is only supported for prepaid features.",input:s.price}),s.price?.tiers.length===0?c.push({message:"tiers cannot be empty.",input:s.price}):s.included&&typeof s.price?.tiers[0].to=="number"&&s.price?.tiers[0].to<=s.included&&c.push({message:"tiers[0].to must be greater than included.",input:s.price})}for(let f of o(s.price))c.push({message:f,input:s.price});return c}}))(Um,Xi,IR,Wu,PR),{FreeTrialParamsV1Schema:P0}=((e,t,r)=>({FreeTrialParamsV1Schema:e.object({duration_length:e.number().meta({description:"Number of duration_type periods the trial lasts."}),duration_type:e.enum(t).default(t.Month).meta({description:"Unit of time for the trial ('day', 'month', 'year')."}),card_required:e.boolean().default(!1).meta({description:"If true, a payment method is required to start the trial and the customer is charged when it ends. Defaults to false."}),on_end:r({schema:e.enum(["bill","revert"]).optional(),defaultValue:"bill",description:"Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan."})}).meta({title:"FreeTrialParams",description:"Free trial configuration for a plan."})}))(n,Ju,Ku),{duplicateCheck:r9}=(e=>({duplicateCheck:({controlKey:r,...i})=>o=>e({controlKey:r,controls:o[r]??[],rule:i})}))(m3),{usageLimitIdentity:O0}=(e=>({usageLimitIdentity:r=>`${r.feature_id}|${e(r.filter)}`}))(OR),{ApiPriceProcessorsSchema:HR}=((e,t)=>({ApiPriceProcessorsSchema:e.object({stripe:t.nullish()}).meta({"x-atmn-mapping":!0})}))(n,y3),{ApiFeatureV0Schema:GR}=((e,t)=>({ApiFeatureV0Schema:e.object({id:e.string().meta({description:"The ID of the feature, used to refer to it in other API calls like /track or /check."}),name:e.string().nullish().meta({description:"The name of the feature."}),type:e.enum(t).meta({description:"The type of the feature"}),display:e.object({singular:e.string().meta({description:"The singular display name for the feature."}),plural:e.string().meta({description:"The plural display name for the feature."})}).nullish().meta({description:"Singular and plural display names for the feature."}),credit_schema:e.array(e.object({metered_feature_id:e.string().meta({description:"The ID of the metered feature (should be a single_use feature)."}),credit_cost:e.number().meta({description:"The credit cost of the metered feature."})})).nullish().meta({description:"Credit cost schema for credit system features."}),archived:e.boolean().nullish().meta({description:"Whether or not the feature is archived."})})}))(n,b3),{ApiRevenueCatPlanProcessorSchema:i9}=((e,t)=>({ApiRevenueCatPlanProcessorSchema:e.object({products:e.array(t).meta({description:"Every RevenueCat product that maps to this plan. Replaces the current set."})})}))(n,x3),{ApiFreeTrialV2Schema:o9}=((e,t,r)=>({ApiFreeTrialV2Schema:e.object({duration_length:e.number().meta({description:"Number of duration_type periods the trial lasts."}),duration_type:e.enum(t).meta({description:"Unit of time for the trial duration ('day', 'month', 'year')."}),card_required:e.boolean().meta({description:"Whether a payment method is required to start the trial. If true, customer will be charged after trial ends."}),on_end:e.enum(r).nullish().meta({description:"Behavior when the trial ends. 'bill' charges the customer (default). 'revert' expires the trial and restores the customer's previous plan."})})}))(n,Ju,qm),{CustomerEligibilitySchema:a9}=((e,t,r,i)=>({CustomerEligibilitySchema:e.object({object:e.literal("customer_eligibility").optional().meta({internal:!0}),trial_available:e.boolean().optional().meta({description:"Whether the trial on this plan is available to this customer. For example, if the customer used the trial in the past, this will be false."}),status:e.enum(t).optional().meta({description:"The customer's current status with this plan. 'active' if attached, 'scheduled' if pending activation."}),canceling:e.boolean().optional().meta({description:"Whether the customer's active instance of this plan is set to cancel."}),trialing:e.boolean().optional().meta({description:"Whether the customer is currently on a free trial of this plan."}),attach_action:e.enum(r).meta({description:"The action that would occur if this plan were attached to the customer."}),scenario:e.enum(i).optional().meta({description:"Legacy attach scenario. Internal use only.",internal:!0})})}))(n,S3,v3,w3),{UsageWindowLimitSchema:Dte}=((e,t,r,i,o)=>({UsageWindowLimitSchema:e.object({feature_id:e.string(),internal_feature_id:e.string(),internal_customer_id:e.string(),key:e.string(),dimension_type:t,dimension_feature_id:e.string().nullable(),scope_type:r,entity_id:e.string().nullable(),internal_entity_id:e.string().nullable(),filter_key:e.string().nullable(),filter_properties:e.record(e.string(),e.string()).nullable(),interval:e.enum(i),window_start_at:e.number(),window_end_at:e.number(),limit:e.number(),anchor_customer_entitlement_id:e.string().nullable(),anchor_mode:o.default("billing_cycle"),new_window_id:e.string().optional()})}))(n,_3,I3,TR,UR),{FeatureSchema:s9}=((e,t,r,i,o)=>({FeatureSchema:e.object({internal_id:e.string(),org_id:e.string(),created_at:e.number().nullable(),env:e.nativeEnum(t),id:e.string().nonempty("Features must have an ID"),name:e.string().nonempty("Features must have a name"),type:e.nativeEnum(r,{message:"Features must have a type"}),config:e.any(),display:e.object({singular:e.string().optional(),plural:e.string().optional()}).nullish(),archived:e.boolean(),event_names:e.array(e.string()).default([]),model_markups:i.nullish(),stripe_meter:o.nullish(),stripe_product_id:e.string().nullish()})}))(n,Fm,k3,_0,E3),{PriceCurrencyConfigSchema:KR}=((e,t)=>({PriceCurrencyConfigSchema:e.object({amount:e.number().nullish(),usage_tiers:e.array(t).nullish(),stripe_price_id:e.string().nullish(),stripe_empty_price_id:e.string().nullish(),stripe_placeholder_price_id:e.string().nullish(),stripe_prepaid_price_v2_id:e.string().nullish()})}))(n,k0),{UsagePriceConfigSchema:c9}=((e,t,r,i,o,a)=>({UsagePriceConfigSchema:e.object({threshold_billing:e.object({threshold:e.number().finite().positive()}).nullish(),type:e.string(),bill_when:e.nativeEnum(t),billing_units:e.number().nullish(),internal_feature_id:e.string(),feature_id:e.string(),usage_tiers:e.array(r),interval:e.enum(i),interval_count:e.number().optional(),base_currency:e.string().nullish(),currencies:e.record(e.string(),o).nullish(),stripe_meter_id:e.string().nullish(),stripe_price_id:e.string().nullish(),stripe_empty_price_id:e.string().nullish(),stripe_product_id:e.string().nullish(),stripe_placeholder_price_id:e.string().nullish(),stripe_event_name:e.string().nullish(),stripe_prepaid_price_v2_id:e.string().nullish(),should_prorate:e.boolean().optional(),allocated_billing_behavior:e.enum(a).optional()})}))(n,T3,k0,Xi,KR,RR),{graduatedCreditRateShape:WR}=((e,t)=>({graduatedCreditRateShape:{credit_amount:e.never().optional(),tier_behavior:e.literal("graduated"),tiers:e.array(t)}}))(n,$3),{FeatureMarkupsOverrideSchema:u9}=((e,t,r)=>({FeatureMarkupsOverrideSchema:e.strictObject({default_markup:e.number().min(-100).optional(),provider_markups:t,model_markups:r})}))(n,ZR,_0),{usageAlertTargetLimitIdentity:l9}=(e=>({usageAlertTargetLimitIdentity:r=>e({feature_id:r.feature_id??"",filter:r.filter})}))(O0),{DiscountConfigSchema:JR}=((e,t)=>({DiscountConfigSchema:e.object({discount_value:e.number(),duration_type:e.nativeEnum(t),duration_value:e.number(),should_rollover:e.boolean().optional(),apply_to_all:e.boolean().optional(),price_ids:e.array(e.string()).optional(),product_ids:e.array(e.string()).optional()})}))(n,FR),{RewardEntitlementSchema:QR}=((e,t)=>({RewardEntitlementSchema:e.object({internal_feature_id:e.string().min(1),allowance:e.number().nonnegative().optional(),expiry:t.optional()})}))(n,Gm),{UpdateRewardSchema:$te}=((e,t,r,i,o,a)=>({UpdateRewardSchema:e.object({name:e.string().nullish(),promo_codes:e.array(t).optional(),id:e.string().optional(),type:e.nativeEnum(r).optional(),discount_config:i.nullish(),free_product_config:o.nullish(),free_product_id:e.string().nullish(),entitlements:e.array(a).nullish()})}))(n,LR,MR,JR,zR,QR),{CreateRewardProgram:jte}=((e,t,r)=>({CreateRewardProgram:e.object({id:e.string(),when:e.enum(t),product_ids:e.array(e.string()).optional(),exclude_trial:e.boolean().optional(),internal_reward_id:e.string(),max_redemptions:e.number().optional(),received_by:e.enum(r)})}))(n,Z3,H3),{AutoTopupPurchaseLimitSchema:YR}=((e,t)=>({AutoTopupPurchaseLimitSchema:e.object({interval:t.meta({description:"The time interval for the purchase limit window."}),interval_count:e.number().min(1).default(1).meta({description:"Number of intervals in the purchase limit window."}),limit:e.number().min(1).meta({description:"Maximum number of auto top-ups allowed within the interval."})})}))(n,G3),{UsageLimitFilterSchema:XR}=((e,t,r,i)=>({UsageLimitFilterSchema:e.object({properties:e.record(e.string().min(1).max(t),r).meta({description:"Event property equality conditions. A usage event counts toward this cap only when every listed property matches (AND)."}).check(a=>{let s=Object.keys(a.value).length;(s<1||s>i)&&a.issues.push({code:"custom",message:`filter.properties must have between 1 and ${i} keys`,input:a.value})})})}))(n,X5,W3,t3),{UsageAlertBasisSchema:d9}=((e,t)=>({UsageAlertBasisSchema:e.enum(t)}))(n,J3),{refineCustomizePlanV1Schema:eN}=(e=>({refineCustomizePlanV1Schema:(r,{includeItems:i=!0,includeFreeTrial:o=!0,includeUpdateItems:a=!0,includeLicenses:s=!0}={})=>{let c=["price",i&&"items","add_items","remove_items",a&&"update_items",o&&"free_trial","billing_controls",s&&"upsert_licenses",s&&"remove_licenses"].filter(Boolean),u=l=>l==="update_items"?"deprecated update_items":l;return r.refine(l=>c.some(d=>l[d]!==void 0),{message:`When using customize, at least one of ${c.map(u).join(", ")} must be provided`}).superRefine((l,d)=>{if(s)for(let p of e({upsertLicenses:l.upsert_licenses}))d.addIssue({code:"custom",...p})}).refine(l=>!(l.items!==void 0&&(l.add_items!==void 0||l.remove_items!==void 0||a&&l.update_items!==void 0)),{message:`customize.items (PUT-style) cannot be combined with ${["add_items","remove_items",a?"deprecated update_items":null].filter(Boolean).join(" / ")} (PATCH-style); pick one approach`})}}))(Q3),{SUPPORTED_SET:p9}=(e=>({SUPPORTED_SET:new Set(e)}))(X3),{ApiCreditDimensionBaseSchema:m9}=((e,t)=>({ApiCreditDimensionBaseSchema:e.object({match:t,priority:e.number().int().optional().meta({description:"Breaks ties between dimensions that match the same number of keys. Higher wins."})})}))(n,qR),{refineGraduatedTiers:tN}=(e=>({refineGraduatedTiers:(r,i)=>{let o=e(r.tiers.map(a=>a.to));for(let{index:a,message:s}of o)i.addIssue({code:"custom",message:s,path:["tiers",a,"to"]})}}))(e9),{ApiFeatureMarkupsOverrideSchema:f9}=((e,t,r)=>({ApiFeatureMarkupsOverrideSchema:e.strictObject({default_markup:e.number().min(-100).optional().meta({description:"Default percentage markup for customers on this plan. Use -100 to make usage free."}),provider_markups:t.meta({description:"Per-provider markup percentages for customers on this plan."}),model_markups:r.meta({description:"Per-model markup overrides for customers on this plan."})})}))(n,ZR,_0),{AutoTopupPurchaseLimitParamsSchema:h9}=((e,t)=>({AutoTopupPurchaseLimitParamsSchema:e.extend({count:t.number().min(0).optional().meta({description:"Set the current window's consumed auto top-up count. Omit to leave runtime state unchanged."})})}))(YR,n),{DUPLICATE_CHECKS:g9}=((e,t,r,i)=>({DUPLICATE_CHECKS:[e({controlKey:"auto_topups",identityOf:t,field:"feature_id",message:"Only one auto top-up entry is allowed per feature_id"}),e({controlKey:"spend_limits",identityOf:t,field:"feature_id",message:"Only one spend limit entry is allowed per feature_id"}),e({controlKey:"usage_limits",identityOf:r,field:"feature_id",message:"Only one usage limit entry is allowed per feature_id and filter"}),e({controlKey:"usage_alerts",identityOf:i,field:"threshold",message:"Only one usage alert entry is allowed per feature_id, basis, filter, threshold_type and threshold"}),e({controlKey:"overage_allowed",identityOf:t,field:"feature_id",message:"Only one overage_allowed entry is allowed per feature_id"})]}))(r9,f3,O0,h3),{ApiPlanProcessorsSchema:y9}=((e,t,r)=>({ApiPlanProcessorsSchema:e.object({stripe:t.nullish(),revenuecat:r.nullish()}).meta({"x-atmn-mapping":!0})}))(n,A3,i9),{FixedPriceConfigSchema:b9}=((e,t,r,i,o)=>({FixedPriceConfigSchema:e.object({type:e.string(),amount:e.number().min(0),interval:e.enum(t),interval_count:e.number().optional(),base_currency:e.string().nullish(),currencies:e.record(e.string(),r).nullish(),billing_units:e.number().nullish(),usage_tiers:e.array(i).nullish(),stripe_price_id:e.string().nullish(),stripe_empty_price_id:e.string().nullish(),stripe_product_id:e.string().nullish(),feature_id:o,internal_feature_id:o})}))(n,Xi,KR,k0,O3),{CreditDimensionSchema:A9}=((e,t,r,i)=>({CreditDimensionSchema:e.union([t.extend(r),t.extend(i)])}))(n,D3,DR,WR),{filterUnresolvableUsageLimitAlerts:x9}=((e,t,r)=>({filterUnresolvableUsageLimitAlerts:({usageAlerts:o,usageLimitLists:a})=>{let s=new Set(a.flatMap(c=>(c??[]).map(e)));return o.flatMap((c,u)=>t(c)&&!s.has(r(c))?[{index:u,usageAlert:c}]:[])}}))(O0,q3,l9),{CreateRewardSchema:Lte}=((e,t,r,i,o,a)=>({CreateRewardSchema:e.object({name:e.string(),promo_codes:e.array(t),id:e.string(),type:e.nativeEnum(r).nullish(),discount_config:i.nullish(),free_product_config:o.nullish(),free_product_id:e.string().nullish(),entitlements:e.array(a).nullish()}).refine(c=>c.type!==r.FeatureGrant?!0:c.entitlements&&c.entitlements.length>0,{message:"Feature grant rewards require at least one entitlement"}).refine(c=>c.type!==r.FeatureGrant?!0:c.promo_codes.some(u=>u.code.length>0),{message:"Feature grant rewards require at least one promo code"})}))(n,LR,MR,JR,zR,QR),{AutoTopupSchema:T0}=((e,t)=>({AutoTopupSchema:e.object({feature_id:e.string().meta({description:"The ID of the feature (credit balance) to auto top-up."}),enabled:e.boolean().default(!1).meta({description:"Whether auto top-up is enabled."}),threshold:e.number().meta({description:"When the balance drops below this threshold, an auto top-up will be purchased."}),quantity:e.number().min(1).meta({description:"Amount of credits to add per auto top-up."}),purchase_limit:t.optional().meta({description:"Optional rate limit to cap how often auto top-ups occur."}),invoice_mode:e.boolean().optional().meta({description:"When true, auto top-up creates a send_invoice invoice instead of auto-charging."})})}))(n,YR),{DbUsageLimitSchema:R0}=((e,t,r,i)=>({DbUsageLimitSchema:e.object({feature_id:e.string().meta({description:"The feature this usage limit applies to."}),enabled:e.boolean().default(!0).meta({description:"Whether this usage limit is enabled."}),limit:e.number().min(0).meta({description:"Maximum units allowed per interval."}),interval:e.enum(t).meta({description:"Interval for the cap, aligned to the customer's billing cycle."}),anchor:r.optional().meta({description:"Window alignment. 'billing_cycle' phases the interval to the customer's renewal time; 'utc' aligns to the UTC calendar."}),filter:i.optional().meta({description:"When set, only usage from events whose properties match counts toward this cap. Omit to count all usage of the feature."})})}))(n,K3,UR,XR),{DbUsageAlertSchema:N0}=((e,t,r,i,o)=>({DbUsageAlertSchema:e.object({feature_id:e.string().optional().meta({description:"The feature ID this alert applies to."}),enabled:e.boolean().default(!0).meta({description:"Whether this usage alert is enabled."}),threshold:e.number().min(0).meta({description:"The threshold value that triggers the alert. For usage or remaining, this is an absolute count. For usage_percentage or remaining_percentage, this is a percentage (0-100)."}),threshold_type:t.meta({description:"Whether the threshold is an absolute count or a percentage of the usage allowance or remaining balance."}),basis:r.default(i).meta({description:"What 100% means. balance: every grant on the feature. included: the plan allowance only. recurring: grants that reset. usage_limit: the cap of the usage limit with the same feature and filter."}),filter:o.optional().meta({description:"Only valid with basis usage_limit. Points the alert at the usage limit carrying the same filter."}),name:e.string().optional().meta({description:"Optional user-defined label to distinguish multiple alerts on the same feature."})}).check(s=>{let{feature_id:c,threshold_type:u,threshold:l,basis:d,filter:p}=s.value;u==="remaining_percentage"&&l>100&&s.issues.push({code:"custom",input:l,path:["threshold"],message:"Threshold must be between 0 and 100 for remaining_percentage"}),d==="usage_limit"&&!c&&s.issues.push({code:"custom",input:c,path:["feature_id"],message:"feature_id is required when basis is usage_limit"}),p&&d!=="usage_limit"&&s.issues.push({code:"custom",input:p,path:["filter"],message:"filter is only valid when basis is usage_limit"})})}))(n,n3,d9,SR,XR),{isValidCurrencyCode:S9}=(e=>({isValidCurrencyCode:r=>!!r&&e.has(r.toLowerCase())}))(p9),{ApiCreditDimensionSchema:v9}=((e,t,r,i)=>({ApiCreditDimensionSchema:e.union([t.extend({tier_behavior:e.literal("graduated"),tiers:e.array(r).min(1)}).strict().superRefine(i),t.extend({credit_cost:e.number().min(0).meta({description:"Credits consumed per billing-unit group when this dimension matches."})}).strict()])}))(n,m9,ER,tN),{AutoTopupParamsSchema:w9}=((e,t)=>({AutoTopupParamsSchema:e.extend({purchase_limit:t.optional().meta({description:"Optional rate limit to cap how often auto top-ups occur. Pass count to set the current window's consumed top-ups."})})}))(T0,h9),{findDuplicateBillingControlIssue:_9}=(e=>({findDuplicateBillingControlIssue:r=>{for(let i of e){let o=i(r);if(o)return o}}}))(g9),{CustomerBillingControlsSchema:D0}=((e,t,r,i,o,a)=>({CustomerBillingControlsSchema:e.object({auto_topups:e.array(t).optional().meta({description:"List of auto top-up configurations per feature."}),spend_limits:e.array(r).optional().meta({description:"List of overage spend limits per feature (caps overage spend)."}),usage_limits:e.array(i).optional().meta({description:"List of hard usage caps per feature (max units per interval)."}),usage_alerts:e.array(o).optional().meta({description:"List of usage alert configurations per feature."}),overage_allowed:e.array(a).optional().meta({description:"List of overage allowed controls per feature. When enabled, usage can exceed balance."})})}))(n,T0,C0,R0,N0,A0),{PriceSchema:I9}=((e,t,r,i,o,a)=>({PriceSchema:e.object({id:e.string(),internal_product_id:e.string().nullable(),org_id:e.string().optional(),created_at:e.number().optional(),billing_type:e.nativeEnum(t).nullish(),tier_behavior:e.nativeEnum(r).nullish(),is_custom:e.boolean().optional(),config:i.or(o),entitlement_id:e.string().nullish(),proration_config:a.nullable()})}))(n,P3,Wu,b9,c9,R3),{CreditSchemaItemBaseSchema:nN}=((e,t,r,i)=>({CreditSchemaItemBaseSchema:e.object({metered_feature_id:e.string(),feature_amount:e.number().optional(),dimensions:e.record(t,r).optional(),multipliers:e.record(t,i).optional()})}))(n,BR,A9,j3),{GraduatedCreditSchemaItemSchema:k9}=((e,t)=>({GraduatedCreditSchemaItemSchema:e.extend(t)}))(nN,WR),{UpdateProductSchema:Mte}=((e,t,r)=>({UpdateProductSchema:e.object({id:e.string().nullish(),name:e.string().min(1,"Product name cannot be empty").optional(),description:e.string().nullish(),is_add_on:e.boolean().optional(),is_default:e.boolean().optional(),group:e.string().nullish(),archived:e.boolean().optional(),config:t.partial().optional(),billing_controls:r.optional()})}))(n,Hm,D0),{DbBillingControlsSchema:E9}=((e,t,r,i,o,a)=>({DbBillingControlsSchema:e.object({auto_topups:e.array(t).nullish(),spend_limits:e.array(r).nullish(),usage_limits:e.array(i).nullish(),usage_alerts:e.array(o).nullish(),overage_allowed:e.array(a).nullish()})}))(n,T0,C0,R0,N0,A0),{CurrencyCodeSchema:rN}=((e,t)=>({CurrencyCodeSchema:e.string().refine(t,"must be a Stripe-supported currency code").meta({description:"Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp')."})}))(n,S9),{AdditionalCurrencyTierSchema:C9}=((e,t)=>({AdditionalCurrencyTierSchema:e.object({currency:t,amount:e.number().optional().meta({description:"Per-unit amount for this tier in this currency."}),flat_amount:e.number().optional().meta({description:"Flat amount for this tier in this currency, if the tier uses one."})}).refine(i=>i.amount!==void 0||i.flat_amount!==void 0,{message:"Either amount or flat_amount, or both must be defined",path:["amount","flat_amount"]})}))(n,rN),{ApiCreditSchemaItemBaseSchema:iN}=((e,t,r,i)=>({ApiCreditSchemaItemBaseSchema:e.object({metered_feature_id:e.string().nonempty().meta({description:"ID of the metered feature that draws from this credit system."}),billing_units:e.number().positive().optional().meta({description:"Number of metered-feature units priced together. Defaults to one when omitted."}),dimensions:e.record(t,r).optional().meta({description:"Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies."}),multipliers:e.record(t,i).optional().meta({description:"Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed."})})}))(n,BR,v9,t9),{ApiFlatCreditSchemaItemSchema:P9}=((e,t)=>({ApiFlatCreditSchemaItemSchema:e.extend({credit_cost:t.number().min(0).meta({description:"Credits consumed per billing-unit group."})}).strict()}))(iN,n),{rejectDuplicateBillingControls:O9}=(e=>({rejectDuplicateBillingControls:r=>{let i=e(r.value);i&&r.issues.push(i)}}))(_9),{FlatCreditSchemaItemSchema:T9}=((e,t)=>({FlatCreditSchemaItemSchema:e.extend(t)}))(nN,DR),{ProductSchema:R9}=((e,t,r,i,o)=>({ProductSchema:e.object({id:e.string(),name:e.string().min(1,"Product name cannot be empty"),description:e.string().nullable(),is_add_on:e.boolean(),is_default:e.boolean(),version:e.number(),version_slug:e.string().nullable().default(null),active:e.boolean().default(!1),deleted_at:e.number().nullable().default(null),previous_version_slug:e.string().nullable().default(null),group:e.string(),env:e.enum(t),internal_id:e.string(),org_id:e.string(),created_at:e.number(),processor:e.object({type:e.string(),id:e.string(),additional_ids:e.array(e.string()).optional()}).nullish(),base_variant_id:e.string().nullable(),base_internal_product_id:e.string().nullish(),archived:e.boolean().default(!1),config:r.default(()=>({ignore_past_due:!1})),...i.shape,metadata:o.default(()=>({}))})}))(n,Fm,Hm,E9,Ps),{AdditionalCurrencyPriceSchema:N9}=((e,t)=>({AdditionalCurrencyPriceSchema:e.object({currency:t,amount:e.number().meta({description:"Price amount in this currency. Set explicitly per currency, not converted from the base amount."})})}))(n,rN),{AdditionalCurrencyTierArraySchema:oN}=((e,t,r,i)=>({AdditionalCurrencyTierArraySchema:e.array(t).refine(r,{message:i})}))(n,C9,wR,_R),{ApiGraduatedCreditSchemaItemSchema:D9}=((e,t,r,i)=>({ApiGraduatedCreditSchemaItemSchema:e.extend({tier_behavior:t.literal("graduated"),tiers:t.array(r).min(1)}).strict().superRefine(i)}))(iN,n,ER,tN),{CustomerBillingControlsParamsSchema:Km}=((e,t,r,i,o,a,s,c)=>({CustomerBillingControlsParamsSchema:e.object({auto_topups:t({schema:r,description:"List of auto top-up configurations per feature."}),spend_limits:t({schema:i,description:"List of overage spend limits per feature (caps overage spend)."}),usage_limits:t({schema:o,description:"List of hard usage caps per feature (max units per interval)."}),usage_alerts:t({schema:a,description:"List of usage alert configurations per feature."}),overage_allowed:t({schema:s,description:"List of overage allowed controls per feature. When enabled, usage can exceed balance."})}).check(c)}))(n,p3,w9,C0,R0,N0,A0,O9),{CreditSchemaItemSchema:$9}=((e,t,r)=>({CreditSchemaItemSchema:e.union([t,r])}))(n,T9,k9),{PriceTierSchema:j9}=((e,t,r)=>({PriceTierSchema:e.object({to:e.number().or(e.literal(t)).meta({description:"The maximum amount of usage for this tier.",example:100}),amount:e.number().optional().meta({description:"The price of the product item for this tier.",example:10}),flat_amount:e.number().optional().meta({description:"A flat fee charged for this tier, in addition to the per-unit amount."}),additional_currencies:r.nullish().meta({description:"Per-currency amounts for this tier. Boundaries ('to') are shared across currencies."})}).refine(o=>o.amount!=null||o.flat_amount!=null,{message:"Either amount or flat_amount, or both must be defined",path:["amount","flat_amount"]}).transform(o=>({...o,amount:o.amount??0}))}))(n,U3,oN),{PlanBillingControlsParamsSchema:L9}=((e,t)=>({PlanBillingControlsParamsSchema:e.check(i=>{let o=t({usageAlerts:i.value.usage_alerts??[],usageLimitLists:[i.value.usage_limits??[]]});for(let{index:a,usageAlert:s}of o)i.issues.push({code:"custom",message:`No usage limit on this plan matches the usage_limit alert for feature ${s.feature_id}`,input:s,path:["usage_alerts",a,"basis"]})})}))(Km,x9),{AdditionalCurrencyPriceArraySchema:Qu}=((e,t,r,i)=>({AdditionalCurrencyPriceArraySchema:e.array(t).refine(r,{message:i})}))(n,N9,wR,_R),{ApiUsageTierWithCurrenciesSchema:aN}=((e,t,r)=>({ApiUsageTierWithCurrenciesSchema:e.object({to:e.number().or(e.literal(t)),amount:e.number().optional(),flat_amount:e.number().optional(),additional_currencies:r.optional().meta({description:"Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies."})}).refine(o=>o.amount!==void 0||o.flat_amount!==void 0,{message:"Either amount or flat_amount, or both must be defined",path:["amount","flat_amount"]}).transform(o=>({...o,amount:o.amount??0})).pipe(e.object({to:e.number().or(e.literal(t)),amount:e.number(),flat_amount:e.number().optional(),additional_currencies:r.optional()}))}))(n,zm,oN),{ApiCreditSchemaItemSchema:M9}=((e,t,r)=>({ApiCreditSchemaItemSchema:e.union([t,r])}))(n,D9,P9),{FeatureConfigOverrideSchema:sN}=((e,t,r)=>({FeatureConfigOverrideSchema:e.strictObject({schema:e.array(t).optional(),markups:r.optional()})}))(n,$9,u9),{ProductItemConfigSchema:F9}=((e,t,r,i,o,a,s)=>({ProductItemConfigSchema:e.object({threshold_billing:e.object({threshold:e.number().finite().positive()}).nullish().meta({description:"Bills this many feature units when outstanding overage reaches it."}),allocated_billing_behavior:e.enum(t).nullish(),on_increase:e.enum(r).nullish(),on_decrease:e.enum(i).nullish(),rollover:o.nullish(),expiry:a.nullish(),feature_override:s.nullish()})}))(n,RR,Vm,Bm,NR,Gm,sN),{BasePriceParamsSchema:Wm}=((e,t,r,i)=>({BasePriceParamsSchema:e.omit({display:!0}).extend({interval_count:t({schema:r.number().optional(),defaultValue:1,description:"Number of intervals per billing cycle. Defaults to 1."}),additional_currencies:i.optional().meta({description:"Base price amounts in additional currencies. The base 'amount' is in the org's default currency."}),base_currency:r.string().optional().meta({internal:!0}),entitlement_id:r.string().optional().meta({internal:!0}),price_id:r.string().optional().meta({internal:!0}),stripe_price_id:r.string().optional().meta({description:"Stripe price id this base price is billed under. Set by sync flows to capture the actual Stripe price when it differs from the catalog default.",internal:!0})}).meta({title:"BasePrice",description:"Base price configuration for a plan."})}))(Y3,Ku,n,Qu),{PlanItemPriceParamsSchema:z9}=((e,t,r,i,o,a,s)=>({PlanItemPriceParamsSchema:e.object({stripe_price_id:e.string().nullish().transform(u=>u??void 0).meta({description:"Stripe price id this feature price is billed under. Set by sync flows to preserve an existing Stripe price.",internal:!0}).optional(),amount:e.number().optional().meta({description:"Price per billing_units after included usage. Either 'amount' or 'tiers' is required."}),additional_currencies:t.optional().meta({description:"Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'."}),tiers:e.array(r).optional().meta({description:"Tiered pricing. Either 'amount' or 'tiers' is required."}),tier_behavior:e.enum(i).optional(),interval:e.enum(o).meta({description:"Billing interval. For consumable features, should match reset.interval."}),interval_count:e.number().default(1).optional().meta({description:"Number of intervals per billing cycle. Defaults to 1."}),billing_units:e.number().default(1).optional().meta({description:"Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200)."}),billing_method:e.enum(a).meta({description:"'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go."}),allocated_billing:s,max_purchase:e.number().nullish().meta({description:"Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit."})})}))(n,Qu,aN,Wu,Xi,Um,VR),{ApiFeatureOverrideSchema:cN}=((e,t,r)=>({ApiFeatureOverrideSchema:e.strictObject({credit_schema:e.array(t).optional().meta({description:"For credit system features: replaces the feature's credit_schema entirely for customers on this plan."}),markups:r.optional().meta({description:"For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's."})})}))(n,M9,f9),{ApiPlanItemV1Schema:U9}=((e,t,r,i,o,a,s,c,u,l,d,p,h,f,m,g,A)=>({ApiPlanItemV1Schema:e.object({threshold_billing:e.object({threshold:e.number().finite().positive()}).nullish().meta({description:"Bills this many feature units when outstanding overage reaches it."}),feature_id:e.string().meta({description:"The ID of the feature this item configures."}),feature:t.optional().meta({description:"The full feature object if expanded."}),included:e.number().meta({description:"Number of free units included. For consumable features, balance resets to this number each interval."}),unlimited:e.boolean().meta({description:"Whether the customer has unlimited access to this feature."}),pooled:e.boolean().default(!1).optional().meta({description:"Whether entity-level grants contribute to a shared customer balance."}),reset:e.object({interval:e.enum(r).meta({description:"The interval at which the feature balance resets (e.g. 'month', 'year'). For consumable features, usage resets to 0 and included units are restored."}),interval_count:e.number().optional().meta({description:"Number of intervals between resets. Defaults to 1."})}).nullable().meta({description:"Reset configuration for consumable features. Null for non-consumable features like seats where usage persists across billing cycles."}),price:e.object({amount:e.number().optional().meta({description:"Price per billing_units after included usage is consumed. Mutually exclusive with tiers."}),additional_currencies:i.optional().meta({description:"Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers' (tiered prices carry per-currency amounts on each tier)."}),tiers:e.array(o).optional().meta({description:"Tiered pricing configuration. Each tier's 'to' INCLUDES the included amount. Either 'tiers' or 'amount' is required."}),tier_behavior:e.enum(a).optional(),interval:e.enum(s).meta({description:"Billing interval for this price. For consumable features, should match reset.interval."}),interval_count:e.number().optional().meta({description:"Number of intervals per billing cycle. Defaults to 1."}),billing_units:e.number().meta({description:"Number of units per price increment. Usage is rounded UP to the nearest billing_units when billed (e.g. billing_units=100 means 101 usage rounds to 200)."}),billing_method:e.enum(c).meta({description:"'prepaid' for features like seats where customers pay upfront, 'usage_based' for pay-as-you-go after included usage."}),allocated_billing:u,max_purchase:e.number().nullable().meta({description:"Maximum units a customer can purchase beyond included. E.g. if included=100 and max_purchase=300, customer can use up to 400 total before usage is capped. Null for no limit."}),processors:l.optional().meta({description:"Payment processors this item price is connected to. Omitted when unset."})}).nullable().meta({description:"Pricing configuration for usage beyond included units. Null if feature is entirely free."}),display:d.optional().meta({description:"Display text for showing this item in pricing pages."}),rollover:e.object({max:e.number().nullable().meta({description:"Maximum rollover units. Null for unlimited rollover."}),max_percentage:e.number().nullable().optional().meta({description:"Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max."}),expiry_duration_type:e.enum(p).meta({description:"When rolled over units expire."}),expiry_duration_length:e.number().optional().meta({description:"Number of periods before expiry."})}).optional().meta({description:"Rollover configuration for unused units. If set, unused included units roll over to the next period."}),proration:e.object({on_increase:e.enum(h).optional().meta({description:"How to handle billing when quantity increases mid-cycle."}),on_decrease:e.enum(f).optional().meta({description:"How to handle credits when quantity decreases mid-cycle."})}).optional().meta({internal:!0}),expiry:m.nullish().meta({description:"Purchased units expire this long after each purchase. One-off prepaid consumable items only."}),feature_override:g.optional().meta({description:"Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema)."}),entity_feature_id:e.string().optional().meta({internal:!0}),mapping_identity:e.string().optional().meta({internal:!0}),entitlement_id:e.string().optional().meta({internal:!0}),price_id:e.string().optional().meta({internal:!0})}).check(w=>{let E=w.value.reset?.interval,I=w.value.price?.interval,F=w.value.reset?.interval_count??1,L=w.value.price?.interval_count??1;if(E&&I&&(String(E)!==String(I)||F!==L)&&w.value.price?.billing_method!==c.Prepaid&&w.issues.push({code:"custom",message:"reset.interval and price.interval can only differ for prepaid prices.",input:w.value}),w.value!==void 0&&w.value.price!==void 0&&w.value.price!==null){w.value.price.amount&&w.value.price.tiers&&w.value.price.tiers.length>0&&w.issues.push({code:"custom",message:"Price amount and tiers are mutually exclusive.",input:w.value});for(let H of A(w.value.price))w.issues.push({code:"custom",message:H,input:w.value.price})}})}))(n,GR,Gu,Qu,aN,Wu,Xi,Um,VR,HR,x0,v0,Vm,Bm,Gm,cN,PR),{EntitlementSchema:V9}=((e,t,r,i,o,a)=>({EntitlementSchema:e.object({id:e.string(),created_at:e.number(),internal_feature_id:e.string(),internal_product_id:e.string().nullable(),internal_reward_id:e.string().nullish(),is_custom:e.boolean().default(!1),allowance_type:e.nativeEnum(t).optional().nullable(),allowance:e.number().nullish(),interval:e.nativeEnum(r).optional().nullable(),interval_count:e.number().default(1),carry_from_previous:e.boolean().default(!1).optional(),entity_feature_id:e.string().nullish(),pooled:e.boolean().default(!1).optional(),org_id:e.string().optional(),feature_id:e.string().optional(),usage_limit:e.number().nullable().optional().default(null),expiry_duration:e.nativeEnum(i).nullish(),expiry_length:e.number().nullish(),rollover:o.nullish(),feature_override:a.nullish()})}))(n,N3,TR,kR,NR,sN),{ProductItemSchema:uN}=((e,t,r,i,o,a,s,c,u,l,d)=>({ProductItemSchema:e.object({type:e.enum(t).nullish().meta({description:"The type of the product item."}),feature_id:e.string().nullish().meta({description:"The feature ID of the product item. Should be null for fixed price items."}),feature_type:e.enum(r).nullish().meta({internal:!0}),feature:i.nullish().meta({internal:!0}),included_usage:e.union([e.number(),e.literal(o)]).nullish().meta({description:"The amount of usage included for this feature (per interval)."}),interval:e.preprocess(h=>{if(h==="")throw new Error("Interval cannot be empty.");return h},e.enum(a).nullish()).meta({description:"The reset or billing interval of the product item. If null, feature will have no reset date, and if there's a price, it will be billed one-off."}),interval_count:e.number().nullish().meta({description:"Interval count of the feature."}),entity_feature_id:e.string().nullish().meta({description:"The feature ID of the entity (like seats) to track sub-balances for."}),pooled:e.boolean().default(!1).optional().meta({description:"Whether entity-level grants contribute to a shared customer balance."}),usage_model:e.enum(s).nullish().meta({description:"Whether the feature should be prepaid upfront or billed for how much they use end of billing period."}),price:e.number().nullish().meta({description:"The price of the product item. Should be null if tiered pricing is set."}),tiers:e.array(c).nullish().meta({description:"Tiered pricing for the product item. Not applicable for fixed price items."}),base_currency:e.string().nullish().meta({internal:!0}),additional_currencies:u.nullish().meta({description:"Amounts in additional currencies for a flat-priced item. Tiered items carry per-currency amounts on each tier."}),billing_units:e.number().nullish().meta({description:"The billing units of the product item (eg $1 for 30 credits)."}),tier_behavior:e.enum(l).nullish().meta({description:"The type of tiered pricing: graduated or volume-based."}),reset_usage_when_enabled:e.boolean().nullish().meta({description:"Whether the usage should be reset when the product is enabled."}),display:e.object({primary_text:e.string(),secondary_text:e.string().nullish()}).nullish().meta({internal:!0}),usage_limit:e.number().nullish().meta({internal:!0}),config:d.nullish().meta({internal:!0}),created_at:e.number().nullish().meta({internal:!0}),entitlement_id:e.string().nullish().meta({internal:!0}),price_id:e.string().nullish().meta({internal:!0}),stripe_price_id:e.string().nullish().meta({internal:!0}),stripe_prepaid_price_v2_id:e.string().nullish().meta({internal:!0}),price_interval:e.enum(a).nullish().meta({internal:!0}),price_interval_count:e.number().nullish().meta({internal:!0}),price_config:e.any().nullish().meta({internal:!0}),_uid:e.string().nullish().meta({internal:!0})})}))(n,L3,M3,GR,zm,F3,z3,j9,Qu,Wu,F9),{ProductV2Schema:lN}=((e,t,r,i,o,a,s)=>({ProductV2Schema:e.object({internal_id:e.string().nullish(),id:e.string(),name:e.string(),description:e.string().nullish(),is_add_on:e.boolean(),is_default:e.boolean(),version:e.number().default(1),version_slug:e.string().nullable().optional(),active:e.boolean().optional(),group:e.string().nullable(),env:e.nativeEnum(t),free_trial:r.nullish(),items:e.array(i),created_at:e.number(),stripe_id:e.string().nullish(),archived:e.boolean().default(!1).nullish(),base_internal_product_id:e.string().nullish(),base_id:e.string().nullish(),config:o.partial().optional(),billing_controls:a.optional(),metadata:s.optional()})}))(n,Fm,B3,uN,Hm,D0,Ps),{PlanItemParamsObjectSchema:B9}=((e,t,r,i,o,a,s,c,u,l,d)=>({PlanItemParamsObjectSchema:e.object({threshold_billing:e.object({threshold:e.number().finite().positive()}).nullish().meta({description:"Bills this many feature units when outstanding overage reaches it."}),feature_id:e.string().meta({description:"The ID of the feature to configure."}),included:t.optional().meta({description:"Number of free units included. Balance resets to this each interval for consumable features."}),unlimited:e.boolean().optional().meta({description:"If true, customer has unlimited access to this feature."}),pooled:e.boolean().default(!1).optional().meta({description:"Whether entity-level grants contribute to a shared customer balance."}),reset:e.object({interval:e.enum(r).meta({description:"Interval at which balance resets (e.g. 'month', 'year'). For consumable features only."}),interval_count:i({schema:e.number().optional(),defaultValue:1,description:"Number of intervals between resets. Defaults to 1."})}).optional().meta({description:"Reset configuration for consumable features. Omit for non-consumable features like seats."}),price:o.optional().meta({description:a}),proration:e.object({on_increase:e.enum(s).meta({description:"Billing behavior when quantity increases mid-cycle."}),on_decrease:e.enum(c).meta({description:"Credit behavior when quantity decreases mid-cycle."})}).optional().meta({description:"Proration settings for prepaid features. Controls mid-cycle quantity change billing."}),rollover:e.object({max:e.number().optional().meta({description:"Max rollover units. Omit for unlimited rollover."}),max_percentage:e.number().optional().meta({description:"Maximum rollover as a percentage (0-100) of included + prepaid grant. Mutually exclusive with max."}),expiry_duration_type:e.enum(u).meta({description:"When rolled over units expire."}),expiry_duration_length:e.number().optional().meta({description:"Number of periods before expiry."})}).optional().meta({description:"Rollover config for unused units. If set, unused included units carry over."}),expiry:l.optional().meta({description:"Purchased units expire this long after each purchase. One-off prepaid consumable items only."}),feature_override:d.optional().meta({description:"Overrides fields of this item's feature for customers on this plan (e.g. a credit system's credit_schema)."}),entity_feature_id:e.string().optional().meta({internal:!0}),entitlement_id:e.string().optional().meta({internal:!0}),price_id:e.string().optional().meta({internal:!0})})}))(n,S0,Gu,Ku,z9,s3,Vm,Bm,v0,Gm,cN),{FullProductWithoutLicensesSchema:Fte}=((e,t,r,i,o,a)=>({FullProductWithoutLicensesSchema:e.extend({description:t.string().nullable().optional().default(null),prices:t.array(r),entitlements:t.array(i.extend({feature:o})),free_trial:a.nullish(),free_trials:t.array(a).nullish(),free_trial_ids:t.array(t.string()).nullish()})}))(R9,n,I9,V9,s9,C3),{CreateProductItemParamsSchema:dN}=((e,t,r,i)=>({CreateProductItemParamsSchema:e.extend({included_usage:t.or(r.literal(i)).nullish()})}))(uN,S0,n,zm),{CreatePlanItemParamsV1Schema:$0}=((e,t)=>({CreatePlanItemParamsV1Schema:e.check(i=>{for(let{message:o,input:a}of t(i.value))i.issues.push({code:"custom",message:o,input:a})}).meta({title:"PlanItem",description:"Configuration for a feature item in a plan, including usage limits, pricing, and rollover settings."})}))(B9,n9),{LicenseCustomizeSchema:pN}=((e,t,r,i)=>({LicenseCustomizeSchema:e.object({price:t.nullable().optional(),add_items:e.array(r).optional(),remove_items:e.array(i).optional()})}))(n,Wm,$0,I0),{PlanLicenseParamsSchema:j0}=((e,t)=>({PlanLicenseParamsSchema:e.object({license_plan_id:e.string(),version_slug:e.string().optional(),included:e.number().int().min(0).optional(),prepaid_only:e.boolean().optional(),customize:t.nullish(),metadata:e.record(e.string(),e.unknown()).optional()})}))(n,pN),{UpdateProductV2ParamsSchema:zte}=((e,t,r,i,o,a,s,c,u)=>({UpdateProductV2ParamsSchema:e.object({id:e.string().nonempty().regex(t).optional().meta({description:r.id}),name:e.string().refine(d=>d.length>0,{message:"name must be a non-empty string"}).optional().meta({description:r.name}),is_add_on:e.boolean().optional().meta({description:r.is_add_on}),is_default:e.boolean().optional().meta({description:r.is_default}),base_plan_id:e.string().nonempty().regex(t).nullable().optional().meta({description:"The base plan this plan should be linked to as a variant. Set to null to detach it from its base plan."}),description:e.string().nullish().optional().meta({description:r.description}),group:e.string().nonempty().nullable().optional().meta({description:r.group}),archived:e.boolean().optional().meta({description:r.archived}),items:e.array(i).optional(),licenses:e.array(o).optional().meta({internal:!0,description:"Plans offered as assignable licenses under this plan. The full set replaces existing links."}),free_trial:a.nullish().meta({description:r.free_trial}),config:s.optional().meta({description:"Miscellaneous product-level configuration flags."}),billing_controls:c.optional().meta({description:"Plan-level billing controls used as customer defaults."}),metadata:u.optional().meta({description:r.metadata})})}))(n,Zm,$R,dN,j0,jR,E0,Km,Ps),{CreatePlanParamsV1Schema:q9}=((e,t,r,i,o,a,s,c,u)=>({CreatePlanParamsV1Schema:e.object({id:e.string().nonempty().regex(t).meta({description:"Unique identifier for the plan."}),group:e.string().default("").meta({description:"Group identifier for organizing related plans. Plans in the same group are mutually exclusive."}),name:e.string().nonempty().meta({description:"Display name of the plan."}),description:e.string().nullable().default(null).meta({description:"Optional description of the plan."}),add_on:e.boolean().default(!1).meta({description:"If true, this plan can be attached alongside other plans. Otherwise, attaching replaces existing plans in the same group."}),auto_enable:e.boolean().default(!1).meta({description:"If true, plan is automatically attached when a customer is created. Use for free tiers."}),price:r.optional().meta({description:"Base recurring price for the plan. Omit for free or usage-only plans."}),items:e.array(i).optional().meta({description:"Feature configurations for this plan. Each item defines included units, pricing, and reset behavior."}),licenses:e.array(o).optional().meta({internal:!0,description:"Plans offered as assignable licenses under this plan. The full set replaces existing links."}),free_trial:a.optional().meta({description:"Free trial configuration. Customers can try this plan before being charged."}),config:s.optional().meta({description:"Miscellaneous plan-level configuration flags."}),billing_controls:c.optional().meta({description:"Plan-level billing controls used as customer defaults."}),metadata:u.optional().meta({description:"Arbitrary key-value metadata defined by you for your own use (e.g. UI copy, feature highlights). Values can be any JSON-serializable value. Shared across all versions of the plan."}),create_in_stripe:e.boolean().default(!0).meta({internal:!0})})}))(n,Zm,Wm,$0,j0,P0,E0,L9,Ps),{UpdatePlanParamsV1Schema:Ute}=((e,t,r,i,o)=>({UpdatePlanParamsV1Schema:e.partial().extend({group:e.shape.group.removeDefault().optional(),version:t.number().optional(),archived:t.boolean().default(!1).optional(),price:r.nullable().optional().meta({description:"The price of the plan. Set to null to remove the base price."}),free_trial:i.nullable().optional().meta({description:"The free trial of the plan. Set to null to remove the free trial."}),base_plan_id:t.string().nonempty().regex(o).nullable().optional().meta({description:"The base plan this plan should be linked to as a variant. Set to null to detach it from its base plan."})})}))(q9,n,Wm,P0,Zm),{CustomizePlanLicenseSchema:L0}=((e,t)=>({CustomizePlanLicenseSchema:e.object({license_plan_id:e.string(),version_slug:e.string().optional(),included:e.number().int().min(0).optional(),prepaid_only:e.boolean().optional(),customize:t.nullish(),metadata:e.record(e.string(),e.unknown()).optional()})}))(n,pN),{CreateProductV2ParamsSchema:Vte}=((e,t,r,i,o,a,s,c,u,l)=>({CreateProductV2ParamsSchema:e.object({id:e.string().nonempty().regex(t).meta({description:r.id}),name:e.string().refine(p=>p.length>0,{message:"name must be a non-empty string"}).meta({description:r.name}),description:e.string().nullish().meta({description:r.description}),is_add_on:e.boolean().default(!1).meta({description:r.is_add_on}),is_default:e.boolean().default(!1).meta({description:r.is_default}),group:e.string().nullable().default("").meta({description:r.group}),items:e.array(i).optional().meta({description:r.items}),licenses:e.array(o).optional().meta({internal:!0,description:"Plans offered as assignable licenses under this plan. The full set replaces existing links."}),free_trial:a.nullish().default(null).meta({description:r.free_trial}),config:s.optional().meta({description:"Miscellaneous product-level configuration flags."}),billing_controls:c.optional().meta({description:"Plan-level billing controls used as customer defaults."}),metadata:u.optional().meta({description:r.metadata}),create_in_stripe:e.boolean().optional().meta({internal:!0}),archived:e.boolean().optional().meta({internal:!0}),base_internal_product_id:e.string().nullable().optional().meta({internal:!0})}).meta({examples:[l]})}))(n,Zm,$R,dN,j0,jR,E0,Km,Ps,V3),{CustomizePlanV1BaseSchema:mN}=((e,t,r,i,o,a,s,c,u)=>({CustomizePlanV1BaseSchema:e.object({price:t.nullable().optional().meta({description:"Override the base price of the plan. Pass null to remove the base price."}),items:e.array(r).optional().meta({description:"Override the items in the plan (PUT-style \u2014 replaces all existing items). Mutually exclusive with add_items / remove_items / deprecated update_items."}),add_items:e.array(r).optional().meta({description:"Items to add to the plan."}),remove_items:e.array(i).optional().meta({description:"Filters selecting items to remove from the plan."}),update_items:e.array(o).optional().meta({description:"Deprecated. Use remove_items and add_items to replace matched plan items.",internal:!0,deprecated:!0}),free_trial:a.nullable().optional().meta({description:"Override the plan's default free trial. Pass an object to set a custom trial, or null to remove the trial entirely."}),billing_controls:s.optional().meta({description:"Override the plan's billing controls (auto top-ups, spend limits, usage limits, usage alerts, overage allowed) for this customer."}),upsert_licenses:e.array(c).optional().meta({description:"License links to add or override for this customer, keyed by license_plan_id. Omitted fields inherit the plan catalog link (included defaults to 1 when the license is not in the catalog). A bare entry restores the license to pure catalog inheritance."}),remove_licenses:e.array(u).optional().meta({description:"License links to drop, keyed by license_plan_id. Parallel to remove_items."})})}))(n,Wm,$0,I0,d3,P0,Km,L0,g3),{VariantCustomizeSchema:Z9}=((e,t)=>({VariantCustomizeSchema:e(t.omit({items:!0}).strict(),{includeItems:!1,includeLicenses:!0})}))(eN,mN),{DiffedCustomizePlanV1Schema:Bte}=((e,t)=>({DiffedCustomizePlanV1Schema:e(t.omit({items:!0}),{includeItems:!1,includeLicenses:!0})}))(eN,mN),{ApiPlanV1Schema:qte}=((e,t,r,i,o,a,s,c,u,l,d,p,h,f)=>({ApiPlanV1Schema:e.object({id:e.string().meta({description:"Unique identifier for the plan."}),internal_id:e.string().nullable().optional().meta({description:"Stable row id. Survives renames of plan_id and version_slug, so config files address rows by it.",internal:!0}),name:e.string().meta({description:"Display name of the plan."}),description:e.string().nullable().meta({description:"Optional description of the plan."}),group:e.string().nullable().meta({description:"Group identifier for organizing related plans. Plans in the same group are mutually exclusive."}),version:e.number().meta({description:"Version number of the plan. Incremented when plan configuration changes."}),version_slug:e.string().nullable().optional().meta({description:"User-facing version identity. Defaults to v{n} when the version is minted."}),active:e.boolean().optional().meta({description:"Whether this is the active version of the plan. At most one version is active."}),add_on:e.boolean().meta({description:"Whether this is an add-on plan that can be attached alongside a main plan."}),auto_enable:e.boolean().meta({description:"If true, this plan is automatically attached when a customer is created. Used for free plans."}),price:e.object({amount:e.number().meta({description:"Base price amount for the plan, in major currency units (e.g. dollars)."}),additional_currencies:t.optional().meta({description:"Base price amounts in additional currencies. The base 'amount' is in the org's default currency."}),interval:e.enum(r).meta({description:"Billing interval (e.g. 'month', 'year')."}),interval_count:e.number().optional().meta({description:"Number of intervals per billing cycle. Defaults to 1."}),entitlement_id:e.string().optional().meta({internal:!0}),price_id:e.string().optional().meta({internal:!0}),display:i.optional().meta({description:"Display text for showing this price in pricing pages."}),processors:o.optional().meta({description:"Payment processors this base price is connected to. Omitted when unset."})}).nullable().meta({description:"Base recurring price for the plan. Null for free plans or usage-only plans."}),items:e.array(a).meta({description:"Feature configurations included in this plan. Each item defines included units, pricing, and reset behavior for a feature."}),processors:s.optional().meta({description:"Payment processors this plan is connected to. Omitted when unset."}),free_trial:c.optional().meta({description:"Free trial configuration. If set, new customers can try this plan before being charged."}),created_at:e.number().meta({description:"Unix timestamp (ms) when the plan was created."}),env:e.enum(u).meta({description:"Environment this plan belongs to ('sandbox' or 'live')."}),archived:e.boolean().meta({description:"Whether the plan is archived. Archived plans cannot be attached to new customers."}),config:l.meta({description:"Miscellaneous plan-level configuration flags."}),billing_controls:d.optional().meta({description:"Plan-level billing controls used as customer defaults."}),metadata:p.meta({description:"Arbitrary key-value metadata defined by you for your own use. Shared across all versions of the plan."}),customer_eligibility:h.optional(),base_variant_id:e.string().nullable().meta({description:"Deprecated. Use variant_details.base_plan_id instead. If this is a variant, the ID of the base plan it was created from.",deprecated:!0}),variant_details:e.object({base_plan_id:e.string().meta({description:"The ID of the base plan this variant was derived from."}),customize:f.optional().meta({description:"The customization that transforms the base plan into this variant."})}).optional().meta({description:"Details about how this variant relates to its latest base plan."})})}))(n,Qu,Xi,x0,HR,U9,y9,o9,Fm,Hm,D0,Ps,a9,Z9)});var H9,yN,M0,hN,bN,AN,G9,K9,gN,F0,Qm,xN,Ym,W9,z0,J9,SN,U0,Jm,V0,Gte,Q9,Y9,vN,Kte,wN,Wte,Xm=x(()=>{"use strict";ee();H9=n.string().min(1).regex(/^[a-zA-Z0-9_-]+$/),yN=n.enum(["single_use","continuous_use"]),M0=n.record(n.string(),n.union([n.string(),n.number(),n.boolean()]).transform(String).pipe(n.string())),hN=n.string().min(1).max(64).refine(e=>!e.includes("::")),bN={credit_amount:n.number(),tier_behavior:n.never().optional(),tiers:n.never().optional()},AN={credit_amount:n.never().optional(),tier_behavior:n.literal("graduated"),tiers:n.array(n.strictObject({to:n.union([n.number(),n.literal("inf")]),credit_amount:n.number()}))},G9=n.union([n.strictObject({match:M0,priority:n.number().int().optional(),...bN}),n.strictObject({match:M0,priority:n.number().int().optional(),...AN})]),K9=n.strictObject({match:M0,factor:n.number().positive().optional(),add:n.number().optional()}).refine(e=>e.factor!==void 0||e.add!==void 0),gN={metered_feature_id:n.string(),feature_amount:n.number().optional(),dimensions:n.record(hN,G9).optional(),multipliers:n.record(hN,K9).optional()},F0=n.union([n.strictObject({...gN,...bN}),n.strictObject({...gN,...AN})]),Qm=n.number().min(-100),xN=n.record(n.string(),n.strictObject({markup:Qm})).nullish(),Ym=n.record(n.string().regex(/.+\/.+/),n.strictObject({markup:Qm.optional(),input_cost:n.number().min(0).optional(),output_cost:n.number().min(0).optional()})).nullish(),W9=n.strictObject({default_markup:Qm.optional(),provider_markups:xN,model_markups:Ym}),z0=n.strictObject({schema:n.array(F0).optional(),markups:W9.optional()}),J9=n.strictObject({filters:n.array(n.strictObject({property:n.string(),operator:n.string(),value:n.array(n.string())})),aggregate:n.strictObject({type:n.string(),property:n.string().nullable()}),usage_type:yN}),SN=n.strictObject({schema:n.array(F0).min(1).refine(e=>new Set(e.map(t=>t.metered_feature_id)).size===e.length,"Credit rates must name each metered feature once"),invoice_credit:n.boolean().optional(),usage_type:yN.default("single_use").overwrite(()=>"single_use"),default_markup:Qm.optional(),provider_markups:xN}),U0=SN.safeExtend({schema:n.array(F0).length(0)}),Jm={id:H9,name:n.string().min(1),display:n.strictObject({singular:n.string().optional(),plural:n.string().optional()}).nullish(),event_names:n.array(n.string()).default([]),model_markups:Ym,stripe_meter:n.strictObject({id:n.string(),event_name:n.string()}).nullish(),stripe_product_id:n.string().nullish()},V0=e=>n.discriminatedUnion("type",[n.strictObject({...Jm,...e,type:n.literal("boolean"),config:n.null()}),n.strictObject({...Jm,...e,type:n.literal("metered"),config:J9}),n.strictObject({...Jm,...e,type:n.literal("credit_system"),config:SN}),n.strictObject({...Jm,...e,type:n.literal("ai_credit_system"),config:U0})]),Gte=V0({}),Q9=n.strictObject({id:n.boolean(),type:n.boolean(),usage_type:n.boolean()}),Y9={internal_id:n.uuid(),org_id:n.uuid(),created_at:n.number(),env:n.enum(["sandbox","live"]),archived:n.boolean(),project_id:n.uuid(),environment_id:n.uuid(),revision:n.number().int().nonnegative(),update_rules:Q9},vN=V0(Y9),Kte=n.strictObject({rows:n.array(vN).max(200),nextCursor:n.uuid().nullable()}),wN=n.strictObject({features:n.array(vN).max(500),limited:n.boolean()}),Wte=n.union([V0({action:n.literal("save"),internal_id:n.uuid().nullable(),revision:n.number().int().nonnegative()}),n.strictObject({action:n.enum(["archive","restore","delete"]),internal_id:n.uuid(),revision:n.number().int().nonnegative()})])});var Fn,De,ef,B0,_N,ia,IN,en,kN,Os,EN,X9,eq,tq,Yte,wn=x(()=>{"use strict";ee();Fn=n.string().regex(/^(0|[1-9]\d{0,12})(\.\d{1,12})?$/),De=n.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/).transform(e=>e.includes(".")?e.replace(/0+$/,"").replace(/\.$/,""):e),ef=n.string().regex(/^-?(0|[1-9]\d{0,11})(\.\d{1,6})?$/).transform(e=>{let t=e.includes(".")?e.replace(/0+$/,"").replace(/\.$/,""):e;return t==="-0"?"0":t}),B0=De.refine(e=>/[1-9]/.test(e),"\u6570\u91CF\u5FC5\u987B\u5927\u4E8E 0"),_N=n.string().min(1).max(64),ia=n.string().min(1).regex(/^[a-zA-Z0-9_-]+$/),IN=n.string().min(1).max(64).refine(e=>!e.includes("::"),"Dimension IDs cannot contain ::"),en=n.record(_N,n.union([n.string().max(120),n.number().finite(),n.boolean()])).refine(e=>Object.keys(e).length<=16,"\u6700\u591A 16 \u4E2A\u8BA1\u4EF7\u5C5E\u6027").transform(e=>Object.fromEntries(Object.entries(e).map(([t,r])=>[t,String(r)]))),kN=n.record(_N,n.union([n.string().max(120),n.number().finite(),n.boolean()]).transform(String)).refine(e=>Object.keys(e).length<=8,"\u5339\u914D\u6761\u4EF6\u6700\u591A 8 \u4E2A\u5C5E\u6027"),Os=e=>{let t=e.startsWith("-");t&&(e=e.slice(1));let[r,i=""]=e.split(".");if(r===void 0||r==="")throw new Error("Invalid decimal value");let o=BigInt(r)*BigInt("1000000")+BigInt(i.padEnd(6,"0"));return t?-o:o},EN=n.array(n.object({upTo:B0.nullable(),cost:De}).strict()).min(1).max(12).refine(e=>e.at(-1)?.upTo===null&&e.slice(0,-1).every((t,r)=>{let i=e[r-1]?.upTo;return t.upTo!==null&&(r===0||i!=null&&Os(t.upTo)>Os(i))}),"\u9636\u68AF\u4E0A\u9650\u5FC5\u987B\u9012\u589E\uFF0C\u6700\u540E\u4E00\u6863\u4E3A\u65E0\u9650"),X9=n.object({key:IN,match:kN,priority:n.number().int().default(0),cost:De.optional(),tiers:EN.optional()}).strict().refine(e=>e.cost!==void 0||e.tiers!==void 0,"\u7EF4\u5EA6\u9700\u8981\u6307\u5B9A\u5355\u4EF7\u6216\u9636\u68AF"),eq=n.object({key:IN,match:kN,factor:B0.optional(),add:ef.optional()}).strict().refine(e=>e.factor!==void 0||e.add!==void 0,"A multiplier needs a factor or an add").transform(e=>({...e,factor:e.factor??"1",add:e.add??"0"})),tq=n.object({units:B0.default("1"),cost:De,tiers:EN.optional(),dimensions:n.array(X9).max(12).optional(),multipliers:n.array(eq).max(4).optional()}).strict().superRefine((e,t)=>{let r=e.dimensions??[],i=e.multipliers??[];(new Set(r.map(s=>s.key)).size!==r.length||new Set(i.map(s=>s.key)).size!==i.length)&&t.addIssue({code:"custom",message:"\u7EF4\u5EA6\u548C\u500D\u7387\u7684 ID \u4E0D\u80FD\u91CD\u590D"});for(let[s,c]of r.entries())for(let u of r.slice(s+1))Object.keys(c.match).length===Object.keys(u.match).length&&c.priority===u.priority&&!Object.keys(c.match).some(l=>u.match[l]!==void 0&&u.match[l]!==c.match[l])&&t.addIssue({code:"custom",message:"\u7EF4\u5EA6\u53EF\u80FD\u540C\u65F6\u5339\u914D\uFF0C\u8BF7\u8C03\u6574\u4F18\u5148\u7EA7"});let o=[e.cost,...(e.tiers??[]).map(s=>s.cost),...r.flatMap(s=>[...s.cost===void 0?[]:[s.cost],...(s.tiers??[]).map(c=>c.cost)])],a=Os(e.units);for(let s of o)for(let c=0;c<1<<i.length;c++){let u=i.filter((m,g)=>c&1<<g);if(u.some((m,g)=>u.slice(g+1).some(A=>Object.keys(m.match).some(C=>A.match[C]!==void 0&&A.match[C]!==m.match[C]))))continue;let l=Os(s),d=BigInt("1"),p=BigInt("0");for(let[m,g]of i.entries())c&1<<m&&(l*=Os(g.factor??"1"),d*=BigInt("1000000"),p+=Os(g.add??"0"));let h=(l+p*d)*BigInt("1000000"),f=d*a;(h<BigInt("0")||h%f!==BigInt("0")||h/f>BigInt("999999999999999999"))&&t.addIssue({code:"custom",message:"\u6BCF\u4E2A\u4E1A\u52A1\u5355\u4F4D\u7684\u6700\u7EC8\u5355\u4EF7\u5FC5\u987B\u975E\u8D1F\u3001\u5728\u8303\u56F4\u5185\u4E14\u80FD\u7CBE\u786E\u8868\u793A\u4E3A\u6700\u591A 6 \u4F4D\u5C0F\u6570"})}}),Yte=tq.safeExtend({featureKey:ia})});function q0(e,t){if(!Number.isInteger(t)||t<0||t>1e4)throw new Error("Invalid purchased pack quantity");let r=e.pricing?Yu.parse(e.pricing):void 0;if(t===0)return 0;let i=0n,o=0;if(!r)i=BigInt(e.amountMinor)*BigInt(t);else for(let a of r.tiers){let s=a.upTo??1e4;if(r.kind==="volume"){if(t<=s){i=BigInt(t)*BigInt(a.unitAmountMinor)+BigInt(a.flatAmountMinor??0);break}}else t>o&&(i+=BigInt(Math.min(t,s)-o)*BigInt(a.unitAmountMinor));o=s}if(i>200000000n)throw new Error("Purchased price exceeds the payment amount limit");return Number(i)}function Ts(e){return q0({amountMinor:e.unitAmountMinor,...e.pricing?{pricing:e.pricing}:{}},e.quantity)}var CN,Yu,Rs=x(()=>{"use strict";ee();CN=n.number().int().min(0).max(1e8),Yu=n.strictObject({kind:n.enum(["graduated","volume"]),tiers:n.array(n.strictObject({upTo:n.number().int().min(1).max(1e4).nullable(),unitAmountMinor:CN,flatAmountMinor:CN.optional()})).min(1).max(12)}).refine(e=>e.tiers.at(-1)?.upTo===null&&e.tiers.slice(0,-1).every((t,r)=>{let i=e.tiers[r-1]?.upTo;return t.upTo!==null&&(r===0||i!=null&&t.upTo>i)}),"Tier ceilings must increase and end unbounded").refine(e=>!e.tiers.some(t=>(t.flatAmountMinor??0)>0)||e.kind==="volume"&&e.tiers.length>1,"Tier flat fees require volume pricing with multiple tiers")});function PN(e){if(!/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/.test(e))throw new Error("Invalid quantity");let[t,r=""]=e.split(".");if(t===void 0||t==="")throw new Error("Invalid decimal value");return BigInt(t)*1000000n+BigInt(r.padEnd(6,"0"))}function Ds(e,t,r){if(!Number.isSafeInteger(r)||r<0||r>1e4)throw new Error("Invalid purchased quantity");let i=PN(e)+PN(t)*BigInt(r);if(i>999999999999999999n)throw new Error("Purchased allowance exceeds the ledger quantity limit");let o=(i%1000000n).toString().padStart(6,"0").replace(/0+$/,"");return(i/1000000n).toString()+(o?"."+o:"")}var nq,Ns,Xu=x(()=>{"use strict";ee();qt();wn();Rs();nq=De.refine(e=>/[1-9]/.test(e)),Ns=n.strictObject({units:nq,prices:n.array(n.strictObject({currency:Oe,amountMinor:n.number().int().min(0).max(1e8),pricing:Yu.optional()})).min(1).max(20).refine(e=>new Set(e.map(t=>t.currency)).size===e.length,"Currencies must be unique").refine(e=>e.every(t=>!t.pricing||t.amountMinor===0),"Tiered prices specify their rates in tiers"),minimumQuantity:n.number().int().min(0).max(1e4),maximumQuantity:n.number().int().min(0).max(1e4)}).refine(e=>e.maximumQuantity>=e.minimumQuantity,"Purchased quantity must fit its published bounds").refine(e=>{try{for(let t of e.prices)for(let r of[e.maximumQuantity,...t.pricing?.tiers.flatMap(i=>i.upTo===null?[]:[i.upTo,i.upTo+1])??[]])r<=e.maximumQuantity&&q0({amountMinor:t.amountMinor,...t.pricing===void 0?{}:{pricing:t.pricing}},r);return!0}catch{return!1}},"Every purchasable quantity must fit the payment amount limit")});var ON=x(()=>{"use strict"});function TN(e){let t=2166136261,r=e.length;for(let i=0;i<r;i++)t^=e.charCodeAt(i),t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24);return t>>>0}function tf(e,t,r){return r===2?TN(TN(e+t)+"")%1e4/1e4:null}function rq(e){return e<=0?[]:new Array(e).fill(1/e)}function nf(e,t){return e>=t[0]&&e<t[1]}function RN(e,t){for(let[r,i]of t.entries())if(nf(e,i))return r;return-1}function NN(e,t,r){t=t===void 0?1:t,t<0?t=0:t>1&&(t=1);let i=rq(e);r=r||i,r.length!==e&&(r=i);let o=r.reduce((c,u)=>u+c,0);(o<.99||o>1.01)&&(r=i);let a=0,s=t;return r.map(c=>{let u=a;return a+=c,[u,u+s*c]})}function DN(e,t,r){if(!t)return null;let i=t.split("?")[1];if(!i)return null;let a=i.replace(/#.*/,"").split("&").map(s=>s.split("=",2)).filter(([s])=>s===e).map(([,s])=>s===void 0?NaN:parseInt(s))[0];return a!==void 0&&a>=0&&a<r?a:null}function $N(e){try{return e()}catch{return!1}}function el(e){return typeof e=="string"?e:JSON.stringify(e)}function ur(e){typeof e=="number"&&(e=e+""),(!e||typeof e!="string")&&(e="0");let t=e.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return t.length===3&&t.push("~"),t.map(r=>r.match(/^[0-9]+$/)?r.padStart(5," "):r).join("-")}var rf=x(()=>{"use strict"});function jN(e){try{let t=e.replace(/([^\\])\//g,"$1\\/");return new RegExp(t)}catch{return}}function tl(e,t){if(!t.length)return!1;let r=!1,i=!1;for(let o of t){let a=aq(e,o.type,o.pattern);if(o.include===!1){if(a)return!1}else r=!0,a&&(i=!0)}return i||!r}function iq(e,t,r){try{let i=t.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return r&&(i="\\/?"+i.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+i+"$","i").test(e)}catch{return!1}}function oq(e,t){try{let r=new URL(t.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),i=[[e.host,r.host,!1],[e.pathname,r.pathname,!0]];return r.hash&&i.push([e.hash,r.hash,!1]),r.searchParams.forEach((o,a)=>{i.push([e.searchParams.get(a)||"",o,!1])}),!i.some(o=>!iq(o[0],o[1],o[2]))}catch{return!1}}function aq(e,t,r){try{let i=new URL(e,"https://_");if(t==="regex"){let o=jN(r);return o?o.test(i.href)||o.test(i.href.substring(i.origin.length)):!1}else if(t==="simple")return oq(i,r);return!1}catch{return!1}}var Z0=x(()=>{"use strict"});function H0(e){for(let r of["namespace","status","url","groups"])if(Object.hasOwn(e,r))throw new TypeError(`Retired experiment field: ${r}`);let t=e;if(t.hashVersion!==void 0&&t.hashVersion!==2)throw new TypeError("Only hash version 2 is supported");if(t.filters?.some(r=>r.hashVersion!==2))throw new TypeError("Only hash version 2 is supported")}function of(e){for(let t of Object.values(e)){if(Array.isArray(t))throw new TypeError("Saved groups require typed list or condition entries");if(t&&Object.hasOwn(t,"useEmptyListGroup"))throw new TypeError("Retired saved group field: useEmptyListGroup")}}function LN(e){for(let t of["overrides","groups"])if(Object.hasOwn(e,t))throw new TypeError(`Retired evaluation context field: ${t}`);of(e.savedGroups??{})}var af=x(()=>{"use strict"});function MN(e,t,r,i){let o=sq(r),a=cq(r);e.setUint32(t,i?a:o,i),e.setUint32(t+4,i?o:a,i)}var sq,cq,FN=x(()=>{sq=e=>e/2**32|0,cq=e=>e>>>0});function zN(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function uq(e,t=""){if(typeof e!="number")throw new TypeError(G0(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(G0(t)+"expected integer >= 0, got "+e);return e}function sf(e,t,r=""){if(zN(e)&&(t===void 0||e.length===t))return e;t!==void 0&&uq(t,"length");let i=zN(e),o=t!==void 0?` of length ${t}`:"",a=i?`length=${e.length}`:`type=${typeof e}`,s=G0(r)+"expected Uint8Array"+o+", got "+a;throw i?new RangeError(s):new TypeError(s)}function K0(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function VN(e,t){sf(e,void 0,"output");let r=t.outputLen;if(!(e.length>=r))throw new RangeError('"output" expected length >= '+r)}function W0(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function cf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Ur(e,t){return e<<32-t|e>>>t}function $s(e){if(sf(e),dq)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=pq[e[r]];return t}function mq(e,t,r="opts"){return UN(e,"defaults"),t!==void 0&&UN(t,r),Object.assign(Object.create(null),e,t)}function BN(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=mq({},t,"info");let r=(o,a)=>e(a).update(o).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=o=>e(o),Object.assign(r,t),Object.freeze(r)}var G0,lq,UN,dq,pq,qN,js=x(()=>{G0=e=>e?`"${e}" `:"";lq=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},UN=(e,t)=>{lq(e,t);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)throw new TypeError(`"${t}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${t}.__proto__" is not allowed`)};dq=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",pq=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));qN=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})});function ZN(e,t,r){return e&t^~e&r}function HN(e,t,r){return e&t^e&r^t&r}var uf,GN,KN=x(()=>{FN();js();uf=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,r,i,o){this.blockLen=t,this.outputLen=r,this.padOffset=i,this.isLE=o,this.buffer=new Uint8Array(t),this.view=cf(this.buffer)}update(t){K0(this),sf(t);let{view:r,buffer:i,blockLen:o}=this,a=t.length,s=!1;for(let c=0;c<a;){let u=Math.min(o-this.pos,a-c);if(u===o){let l=cf(t);for(;o<=a-c;c+=o)this.process(l,c);s=!0;continue}i.set(c===0&&u===a?t:t.subarray(c,c+u),this.pos),this.pos+=u,c+=u,this.pos===o&&(this.process(r,0),this.pos=0,s=!0)}return this.length+=t.length,s&&this.roundClean(),this}digestInto(t){K0(this),VN(t,this),this.finished=!0;let{buffer:r,view:i,blockLen:o,isLE:a}=this,{pos:s}=this;r[s++]=128,r.fill(0,s),this.padOffset>o-s&&(this.process(i,0),r.fill(0)),MN(i,o-8,this.length*8,a),this.process(i,0),this.roundClean();let c=t===r?i:cf(t),u=this.outputLen,l=u/4,d=this.get();if(u%4||l>d.length)throw new Error("invalid outputLen");for(let p=0;p<l;p++)c.setUint32(4*p,d[p],a)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let i=t.slice(0,r);return this.destroy(),i}_cloneIntoMeta(t){let{buffer:r,length:i,finished:o,destroyed:a,pos:s}=this;return t.destroyed=a,t.finished=o,t.length=i,t.pos=s,s&&t.buffer.set(r),t}clone(){return this._cloneInto()}},GN=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var fq,eo,J0,Q0,Ls,lf=x(()=>{KN();js();fq=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),eo=new Uint32Array(64),J0=class extends uf{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,r){super(64,t,8,!1),this.A=r[0]|0,this.B=r[1]|0,this.C=r[2]|0,this.D=r[3]|0,this.E=r[4]|0,this.F=r[5]|0,this.G=r[6]|0,this.H=r[7]|0}get(){let{A:t,B:r,C:i,D:o,E:a,F:s,G:c,H:u}=this;return[t,r,i,o,a,s,c,u]}set(t,r,i,o,a,s,c,u){this.A=t|0,this.B=r|0,this.C=i|0,this.D=o|0,this.E=a|0,this.F=s|0,this.G=c|0,this.H=u|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,r){for(let p=0;p<16;p++,r+=4)eo[p]=t.getUint32(r,!1);for(let p=16;p<64;p++){let h=eo[p-15],f=eo[p-2],m=Ur(h,7)^Ur(h,18)^h>>>3,g=Ur(f,17)^Ur(f,19)^f>>>10;eo[p]=g+eo[p-7]+m+eo[p-16]|0}let{A:i,B:o,C:a,D:s,E:c,F:u,G:l,H:d}=this;for(let p=0;p<64;p++){let h=Ur(c,6)^Ur(c,11)^Ur(c,25),f=d+h+ZN(c,u,l)+fq[p]+eo[p]|0,g=(Ur(i,2)^Ur(i,13)^Ur(i,22))+HN(i,o,a)|0;d=l,l=u,u=c,c=s+f|0,s=a,a=o,o=i,i=f+g|0}i=i+this.A|0,o=o+this.B|0,a=a+this.C|0,s=s+this.D|0,c=c+this.E|0,u=u+this.F|0,l=l+this.G|0,d=d+this.H|0,this.set(i,o,a,s,c,u,l,d)}roundClean(){W0(eo)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),W0(this.buffer)}},Q0=class extends J0{constructor(){super(32,GN)}},Ls=BN(()=>new Q0,qN(1))});function hq(e){return $s(Ls(new TextEncoder().encode(String(e))))}function nD(e){let t=JN.get(e);return t||(t=new Set(e),JN.set(e,t)),t}function gq(e){let t=QN.get(e);return t||(t=new Set(e.map(df)),QN.set(e,t)),t}function Ms(e){of(e);for(let t of Object.values(e)){let r=t?.type==="list"||t?.type==="hashed"?t.values:null;r&&r.length>=Y0&&nD(r)}return e}function Yn(e,t,r,i){r=r||{},i||of(r),i=i||new Set;for(let[o,a]of Object.entries(t))switch(o){case"$or":if(!tD(e,a,r,i))return!1;break;case"$nor":if(tD(e,a,r,i))return!1;break;case"$and":if(!Sq(e,a,r,i))return!1;break;case"$not":if(Yn(e,a,r,i))return!1;break;case"$savedGroup":if(!yq(e,a,r,i))return!1;break;default:if(!nl(a,rD(e,o),r,!1,i))return!1}return!0}function yq(e,t,r,i){if(!t||typeof t!="object"||Array.isArray(t))return!1;let{id:o,attributeKey:a}=t;if(typeof o!="string"||i.has(o)||a!==void 0&&typeof a!="string")return!1;let s=r[o];if(!s||Array.isArray(s)||typeof s!="object")return!1;let c=new Set(i).add(o);if(s.type==="list"||s.type==="hashed"){let u=a??s.attributeKey;if(typeof u!="string"||!Array.isArray(s.values))return!1;let l=rD(e,u);return oa(s.type==="hashed"?pf(l):l,s.values)}return s.type==="condition"?!s.condition||typeof s.condition!="object"?!1:Yn(e,s.condition,r,c):!1}function rD(e,t){let r=t.split("."),i=e;for(let o of r)if(i&&typeof i=="object"&&o in i)i=i[o];else return null;return i}function YN(e,t=!1){let r=`${e}${t?"/i":""}`,i=WN.get(r);return i||(i=new RegExp(e.replace(/([^\\])\//g,"$1\\/"),t?"i":void 0),WN.set(r,i)),i}function nl(e,t,r,i=!1,o=new Set){if(typeof e=="string")return i?String(t).toLowerCase()===e.toLowerCase():t+""===e;if(typeof e=="number")return t*1===e;if(typeof e=="boolean")return t!==null&&!!t===e;if(e===null)return t===null;if(Array.isArray(e)||!iD(e))return JSON.stringify(t)===JSON.stringify(e);let a=e;for(let s in a)if(!xq(s,t,a[s],r,o))return!1;return!0}function iD(e){let t=Object.keys(e);return t.length>0&&t.filter(r=>r[0]==="$").length===t.length}function bq(e){if(e===null)return"null";if(Array.isArray(e))return"array";let t=typeof e;return["string","number","boolean","object","undefined"].includes(t)?t:"unknown"}function Aq(e,t,r,i){if(!Array.isArray(e))return!1;let o=iD(t)?a=>nl(t,a,r,!1,i):a=>Yn(a,t,r,i);for(let a=0;a<e.length;a++)if((e[a]??null)!==null&&o(e[a]))return!0;return!1}function oa(e,t,r=!1){if(r){let o;if(t.length>=Y0){let a=gq(t);o=s=>{let c=df(s);return!(typeof c=="number"&&Number.isNaN(c))&&a.has(c)}}else o=a=>t.some(s=>df(a)===df(s));return Array.isArray(e)?e.some(a=>o(a)):o(e)}let i=t.length>=Y0?(o=>a=>o.has(a))(nD(t)):o=>t.includes(o);return Array.isArray(e)?e.some(o=>i(o)):i(e)}function XN(e){return e===void 0?[]:e&&typeof e=="object"&&(e.type==="list"||e.type==="hashed")&&Array.isArray(e.values)?e.values:null}function eD(e,t,r,i=!1,o=new Set){if(!Array.isArray(e))return!1;for(let a=0;a<t.length;a++){let s=!1;for(let c=0;c<e.length;c++)if(nl(t[a],e[c],r,i,o)){s=!0;break}if(!s)return!1}return!0}function xq(e,t,r,i,o=new Set){let a=t,s=r;switch(e){case"$veq":return ur(t)===ur(r);case"$vne":return ur(t)!==ur(r);case"$vgt":return ur(t)>ur(r);case"$vgte":return ur(t)>=ur(r);case"$vlt":return ur(t)<ur(r);case"$vlte":return ur(t)<=ur(r);case"$eq":return t===r;case"$ne":return t!==r;case"$lt":return a<s;case"$lte":return a<=s;case"$gt":return a>s;case"$gte":return a>=s;case"$exists":return r?t!=null:t==null;case"$in":return Array.isArray(r)?oa(t,r):!1;case"$ini":return Array.isArray(r)?oa(t,r,!0):!1;case"$inGroup":{let c=i[r],u=XN(c);return u===null?!1:oa(c?.type==="hashed"?pf(t):t,u)}case"$notInGroup":{let c=i[r],u=XN(c);return u===null?!1:!oa(c?.type==="hashed"?pf(t):t,u)}case"$nin":return Array.isArray(r)?!oa(t,r):!1;case"$nini":return Array.isArray(r)?!oa(t,r,!0):!1;case"$not":return!nl(r,t,i,!1,o);case"$size":return Array.isArray(t)?nl(r,t.length,i,!1,o):!1;case"$elemMatch":return Aq(t,r,i,o);case"$all":return Array.isArray(r)?eD(t,r,i,!1,o):!1;case"$alli":return Array.isArray(r)?eD(t,r,i,!0,o):!1;case"$regex":try{return YN(r).test(t)}catch{return!1}case"$regexi":try{return YN(r,!0).test(t)}catch{return!1}case"$type":return bq(t)===r;default:return!1}}function tD(e,t,r,i){if(!t.length)return!0;for(let o of t)if(Yn(e,o,r,i))return!0;return!1}function Sq(e,t,r,i){for(let o of t)if(!Yn(e,o,r,i))return!1;return!0}var WN,Y0,JN,QN,pf,df,X0=x(()=>{"use strict";af();rf();lf();js();WN=new Map,Y0=32,JN=new WeakMap,QN=new WeakMap;pf=e=>Array.isArray(e)?e.map(pf):typeof e=="string"||typeof e=="number"?hq(e):null,df=e=>typeof e=="string"?e.toLowerCase():e});function ew(e){return LN(e),{context:e,stack:{evaluatedFeatures:new Set}}}function tw(e){return{...e.attributes,...e.attributeOverrides}}function to(e,t,r){let i=t||"id",o="",a=tw(e);return a[i]&&(o=a[i]),!o&&r&&(a[r]&&(o=a[r]),o&&(i=r)),{hashAttribute:i,hashValue:o}}function It(e,t,r){e.context.log?.(t,r)}var nw=x(()=>{"use strict";af()});function mf(e,t){return t=t||0,`${e}__${t}`}function rw(e,t){return`${e}||${t}`}function vq(e,t,r){let i=e.stickyBucketAssignmentDocs;if(!i)return{};let{hashAttribute:o,hashValue:a}=to(e,t),s=rw(o,el(a)),{hashAttribute:c,hashValue:u}=to(e,r),l=u?rw(c,el(u)):null,d={};return l&&i[l]&&Object.assign(d,i[l].assignments||{}),i[s]&&Object.assign(d,i[s].assignments||{}),d}function oD({context:e,expKey:t,expBucketVersion:r,expHashAttribute:i,expFallbackAttribute:o,expMinBucketVersion:a,expMeta:s}){r=r||0,a=a||0,i=i||"id",s=s||[];let c=mf(t,r),u=vq(e,i,o);if(a>0)for(let p=0;p<a;p++){let h=mf(t,p);if(u[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let l=u[c];if(l===void 0)return{variation:-1};let d=s.findIndex(p=>p.key===l);return d<0?{variation:-1}:{variation:d}}function aD(e,t,r,i){let o=rw(t,r),a=e.stickyBucketAssignmentDocs,s=a&&a[o]?a[o].assignments||{}:{},c={...s,...i},u=JSON.stringify(s)!==JSON.stringify(c);return{key:o,doc:{attributeName:t,attributeValue:r,assignments:c},changed:u}}var sD=x(()=>{"use strict";nw();rf()});function cD(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var uD=x(()=>{"use strict"});function ff(e,t){let r=ew(t),i=dD(e,null,r);return t.onExperimentEval?.(e,i),i}function Ii(e,t){return ow(e,ew(t))}function wq(e){return e.forcedVariations||{}}function lD(e,t,r){let{context:i}=e;if(i.trackedExperiments){let o=fD(t,r);if(i.trackedExperiments.has(o))return;i.trackedExperiments.add(o)}iw(()=>i.onExperimentViewed?.(t,r))}function _q(e,t,r){let{context:i}=e;if(i.trackedFeatureUsage){let o=JSON.stringify(r.value);if(i.trackedFeatureUsage[t]===o)return;i.trackedFeatureUsage[t]=o}iw(()=>i.onFeatureUsage?.(t,r))}function iw(e){try{let t=e();t&&typeof t.catch=="function"&&t.catch(()=>{})}catch{}}function ow(e,t){let{context:r}=t;if(t.stack.evaluatedFeatures.has(e))return It(t,`evalFeature: circular dependency detected: ${t.stack.id} -> ${e}`,{from:t.stack.id,to:e}),no(t,e,null,"cyclicPrerequisite");t.stack.evaluatedFeatures.add(e),t.stack.id=e;let i=r.features?.[e];for(let a of i?.rules??[])H0(a);let o=r.forcedFeatureValues;if(o&&o.has(e))return It(t,"Global override",{id:e,value:o.get(e)}),no(t,e,o.get(e),"override");if(!i)return It(t,"Unknown feature",{id:e}),no(t,e,null,"unknownFeature");if(i.rules){let a=new Set(t.stack.evaluatedFeatures);e:for(let s of i.rules){if(s.parentConditions)for(let l of s.parentConditions){t.stack.evaluatedFeatures=new Set(a);let d=ow(l.id,t);if(d.source==="cyclicPrerequisite")return no(t,e,null,"cyclicPrerequisite");let p={value:d.value};if(!Yn(p,l.condition||{},r.savedGroups||{})){if(l.gate)return It(t,"Feature blocked by prerequisite",{id:e,rule:s}),no(t,e,null,"prerequisite");It(t,"Skip rule because prerequisite evaluation fails",{id:e,rule:s});continue e}}if(s.filters&&mD(s.filters,t)){It(t,"Skip rule because of filters",{id:e,rule:s});continue}if("force"in s){if(s.condition&&!pD(s.condition,t)){It(t,"Skip rule because of condition ff",{id:e,rule:s});continue}if(!Iq(t,s.seed||e,s.hashAttribute,r.saveStickyBucketAssignmentDoc&&!s.disableStickyBucketing?s.fallbackAttribute:void 0,s.range,s.coverage,s.hashVersion)){It(t,"Skip rule because user not included in rollout",{id:e,rule:s});continue}return It(t,"Force value from rule",{id:e,rule:s}),s.tracks&&s.tracks.forEach(l=>{lD(t,l.experiment,l.result)}),no(t,e,s.force,"force",s.id)}if(!s.variations){It(t,"Skip invalid rule",{id:e,rule:s});continue}let c={variations:s.variations,key:s.key||e};"coverage"in s&&(c.coverage=s.coverage),s.weights&&(c.weights=s.weights),s.hashAttribute&&(c.hashAttribute=s.hashAttribute),s.fallbackAttribute&&(c.fallbackAttribute=s.fallbackAttribute),s.disableStickyBucketing&&(c.disableStickyBucketing=s.disableStickyBucketing),s.bucketVersion!==void 0&&(c.bucketVersion=s.bucketVersion),s.minBucketVersion!==void 0&&(c.minBucketVersion=s.minBucketVersion),s.meta&&(c.meta=s.meta),s.ranges&&(c.ranges=s.ranges),s.name&&(c.name=s.name),s.phase&&(c.phase=s.phase),s.seed&&(c.seed=s.seed),s.hashVersion&&(c.hashVersion=s.hashVersion),s.filters&&(c.filters=s.filters),s.condition&&(c.condition=s.condition);let u=dD(c,e,t);if(r.onExperimentEval?.(c,u),u.inExperiment&&!u.passthrough)return no(t,e,u.value,"experiment",s.id,c,u)}}return It(t,"Use default value",{id:e,value:i.defaultValue}),no(t,e,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function dD(e,t,r){let{context:i}=r;H0(e);let o=e.key,a=e.variations.length;if(a<2)return It(r,"Invalid experiment",{id:o}),mn(r,e,-1,!1,t);if(i.enabled===!1)return It(r,"Context disabled",{id:o}),mn(r,e,-1,!1,t);if(e.urlPatterns&&!tl(i.url||"",e.urlPatterns))return It(r,"Skip because of url targeting",{id:o}),mn(r,e,-1,!1,t);let s=DN(o,i.url||"",a);if(s!==null)return It(r,"Force via querystring",{id:o,variation:s}),mn(r,e,s,!1,t);let u=wq(i)[o];if(u!==void 0)return It(r,"Force via dev tools",{id:o,variation:u}),mn(r,e,u,!1,t);if(e.active===!1)return It(r,"Skip because inactive",{id:o}),mn(r,e,-1,!1,t);let{hashAttribute:l,hashValue:d}=to(i,e.hashAttribute,i.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0);if(!d)return It(r,"Skip because missing hashAttribute",{id:o}),mn(r,e,-1,!1,t);let p=-1,h=!1,f=!1;if(i.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{variation:A,versionIsBlocked:C}=oD(cD({context:i,expKey:e.key,expBucketVersion:e.bucketVersion,expHashAttribute:e.hashAttribute,expFallbackAttribute:e.fallbackAttribute,expMinBucketVersion:e.minBucketVersion,expMeta:e.meta}));h=A>=0,p=A,f=!!C}if(!h){if(e.filters&&mD(e.filters,r))return It(r,"Skip because of filters",{id:o}),mn(r,e,-1,!1,t);if(e.include&&!$N(e.include))return It(r,"Skip because of include function",{id:o}),mn(r,e,-1,!1,t);if(e.condition&&!pD(e.condition,r))return It(r,"Skip because of condition exp",{id:o}),mn(r,e,-1,!1,t);if(e.parentConditions){let A=new Set(r.stack.evaluatedFeatures);for(let C of e.parentConditions){r.stack.evaluatedFeatures=new Set(A);let w=ow(C.id,r);if(w.source==="cyclicPrerequisite")return mn(r,e,-1,!1,t);let E={value:w.value};if(!Yn(E,C.condition||{},i.savedGroups||{}))return It(r,"Skip because prerequisite evaluation fails",{id:o}),mn(r,e,-1,!1,t)}}}let m=tf(e.seed||o,d,e.hashVersion??2);if(m===null)return It(r,"Skip because of invalid hash version",{id:o}),mn(r,e,-1,!1,t);if(!h){let A=e.ranges||NN(a,e.coverage===void 0?1:e.coverage,e.weights);p=RN(m,A)}if(f)return It(r,"Skip because sticky bucket version is blocked",{id:o}),mn(r,e,-1,!1,t,void 0,!0);if(p<0)return It(r,"Skip because of coverage",{id:o}),mn(r,e,-1,!1,t);if("force"in e)return It(r,"Force variation",{id:o,variation:e.force}),mn(r,e,e.force===void 0?-1:e.force,!1,t);if(i.qaMode)return It(r,"Skip because QA mode",{id:o}),mn(r,e,-1,!1,t);let g=mn(r,e,p,!0,t,m,h);if(i.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{changed:A,key:C,doc:w}=aD(i,l,el(d),{[mf(e.key,e.bucketVersion)]:g.key});if(A){i.stickyBucketAssignmentDocs=i.stickyBucketAssignmentDocs||{},i.stickyBucketAssignmentDocs[C]=w;let E=i.saveStickyBucketAssignmentDoc;iw(()=>E(w))}}return lD(r,e,g),It(r,"In experiment",{id:o,variation:g.variationId}),g}function no(e,t,r,i,o,a,s){let c={value:r,on:!!r,off:!r,source:i,ruleId:o||""};return a&&(c.experiment=a),s&&(c.experimentResult=s),i!=="override"&&_q(e,t,c),c}function pD(e,t){return Yn(tw(t.context),e,t.context.savedGroups||{})}function mD(e,t){return e.some(r=>{let{hashValue:i}=to(t.context,r.attribute);if(!i)return!0;let o=tf(r.seed,i,r.hashVersion||2);return o===null?!0:!r.ranges.some(a=>nf(o,a))})}function Iq(e,t,r,i,o,a,s){if(!o&&a===void 0)return!0;if(!o&&a===0)return!1;let{hashValue:c}=to(e.context,r,i);if(!c)return!1;let u=tf(t,c,s??2);return u===null?!1:o?nf(u,o):a!==void 0?u<=a:!0}function mn(e,t,r,i,o,a,s){let c=!0;(r<0||r>=t.variations.length)&&(r=0,c=!1);let{hashAttribute:u,hashValue:l}=to(e.context,t.hashAttribute,e.context.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0),d=t.meta?.[r]??{},p=t.variations[0];for(let[f,m]of t.variations.entries())if(f===r){p=m;break}let h={key:d.key||""+r,featureId:o,inExperiment:c,hashUsed:i,variationId:r,value:p,hashAttribute:u,hashValue:l,stickyBucketUsed:!!s};return d.name&&(h.name=d.name),a!==void 0&&(h.bucket=a),d.passthrough&&(h.passthrough=d.passthrough),h}function fD(e,t){return t.hashAttribute+t.hashValue+e.key+t.variationId}var hD=x(()=>{"use strict";uD();af();X0();nw();rf();sD();Z0()});var rl=x(()=>{"use strict";ON();Z0();X0();hD();});function ki(e){let t=new Set;function r(i){if(Array.isArray(i))i.forEach(r);else if(i&&typeof i=="object")for(let[o,a]of Object.entries(i))o==="$savedGroup"&&a&&typeof a=="object"&&!Array.isArray(a)&&typeof a.id=="string"?t.add(a.id):["$inGroup","$notInGroup"].includes(o)&&typeof a=="string"?t.add(a):["$eq","$ne","$in","$nin","$ini","$nini"].includes(o)||r(a)}return r(e),[...t]}var Te,tn,kq,zn,Eq,Cq,sw,gD,Pq,aw,Oq,Tq,Gne,Rq,Nq,Dq,$q,il,Kne,Wne,Zt=x(()=>{"use strict";ee();rl();Te=n.json().superRefine((e,t)=>{let r=0;function i(o,a){if(++r>1e4||a>20){t.addIssue({code:"custom",message:"JSON exceeds its depth or node budget"});return}if(typeof o=="string"&&(o.includes("\0")||/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(o))&&t.addIssue({code:"custom",message:"JSON text must contain valid Unicode without NUL"}),Array.isArray(o))o.forEach(s=>i(s,a+1));else if(o&&typeof o=="object")for(let[s,c]of Object.entries(o))(s.includes("\0")||/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(s)||["__proto__","prototype","constructor"].includes(s))&&t.addIssue({code:"custom",message:"Reserved JSON property"}),i(c,a+1)}i(e,0),new TextEncoder().encode(JSON.stringify(e)).byteLength>65536&&t.addIssue({code:"custom",message:"JSON exceeds 64 KiB"})}),tn=n.record(n.string().min(1).max(128),Te).superRefine((e,t)=>{(!Te.safeParse(e).success||Object.keys(e).length>128||new TextEncoder().encode(JSON.stringify(e)).byteLength>65536||["__proto__","constructor","prototype"].some(r=>Object.hasOwn(e,r)))&&t.addIssue({code:"custom",message:"Attribute document exceeds its budget or uses a reserved key"})}),kq=new Set(["$in","$ini","$inGroup","$nin","$nini","$notInGroup","$gt","$gte","$lt","$lte","$regex","$regexi","$ne","$eq","$size","$elemMatch","$all","$alli","$not","$type","$exists","$vgt","$vgte","$vlt","$vlte","$vne","$veq","$and","$or","$nor","$savedGroup"]),zn=tn.superRefine((e,t)=>{function r(i){if(Array.isArray(i))i.forEach(r);else if(i&&typeof i=="object")for(let[o,a]of Object.entries(i)){if(o==="$savedGroup"&&!n.strictObject({id:n.uuid(),attributeKey:n.string().min(1).max(128).optional()}).safeParse(a).success&&t.addIssue({code:"custom",message:"Saved groups use v2 object references"}),!o.startsWith("$")&&o.split(".").some(s=>["__proto__","prototype","constructor"].includes(s))&&t.addIssue({code:"custom",message:"Reserved attribute path"}),o.startsWith("$")&&!kq.has(o)&&t.addIssue({code:"custom",message:`Unknown GrowthBook operator: ${o}`}),["$regex","$regexi"].includes(o)&&typeof a=="string"){(/\(\?[<!=]|\\[0-9]|\\k</.test(a)||[...a.matchAll(/\{(\d+)(?:,(\d*))?\}/g)].some(s=>Number(s[1])>255||Number(s[2]||0)>255)||o==="$regexi"&&/[^\x00-\x7f]/.test(a.replace(/\\u([0-9a-f]{4})/gi,(s,c)=>String.fromCharCode(Number.parseInt(c,16)))))&&t.addIssue({code:"custom",message:"Regex is outside the shared TS/SQL subset"});try{new RegExp(a)}catch{t.addIssue({code:"custom",message:"Invalid regular expression"})}}r(a)}}typeof e.source=="string"&&["all","any","group","parameter","answer","attribute","result"].includes(e.source)&&("operator"in e||"predicates"in e||"groupId"in e)&&t.addIssue({code:"custom",message:"Obsolete condition protocol"}),r(e)}),Eq=n.discriminatedUnion("type",[n.strictObject({type:n.literal("condition"),condition:zn}),n.strictObject({type:n.literal("list"),attributeKey:n.string().min(1).max(128),values:n.array(n.union([n.string(),n.number().finite()])).max(1e5)})]).refine(e=>e.type!=="list"||new TextEncoder().encode(JSON.stringify(e.values)).byteLength<=1048576,"Saved group list exceeds 1 MiB");Cq=n.record(n.uuid(),Eq).superRefine((e,t)=>{let r=new Set,i=new Set;function o(a){if(r.has(a)){t.addIssue({code:"custom",message:"Cyclic saved group dependency"});return}if(i.has(a))return;let s=e[a];if(!s){t.addIssue({code:"custom",message:"Missing saved group dependency"});return}r.add(a),s.type==="condition"&&ki(s.condition).forEach(o),r.delete(a),i.add(a)}Object.keys(e).forEach(o)}),sw=n.tuple([n.number().min(0).max(1),n.number().min(0).max(1)]).refine(([e,t])=>e<=t),gD=n.strictObject({attribute:n.string().optional(),seed:n.string().min(1),hashVersion:n.literal(2),ranges:n.array(sw).min(1).max(100)}),Pq=n.strictObject({id:n.string().min(1).max(128),condition:zn,gate:n.boolean().optional()}),aw={id:n.string().max(128).optional(),condition:zn.optional(),parentConditions:n.array(Pq).max(50).optional(),filters:n.array(gD).max(20).optional()},Oq=n.union([n.strictObject({...aw}),n.strictObject({...aw,force:Te,coverage:n.number().min(0).max(1).optional(),range:sw.optional(),seed:n.string().min(1).optional(),hashAttribute:n.string().optional(),hashVersion:n.literal(2).optional()}),n.strictObject({...aw,type:n.literal("experiment-ref"),experimentId:n.uuid(),values:n.record(n.string().min(1),Te),meta:n.record(n.string().min(1),n.strictObject({passthrough:n.boolean()})).optional()})]),Tq=n.strictObject({defaultValue:Te,rules:n.array(Oq).max(100)}),Gne=n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/),Tq).superRefine((e,t)=>{Object.keys(e).length>100&&t.addIssue({code:"custom",message:"Too many Features"});let r=new Set,i=new Set;function o(a){if(r.has(a)){t.addIssue({code:"custom",message:`Cyclic Feature dependency: ${a}`});return}if(i.has(a))return;let s=e[a];if(!s){t.addIssue({code:"custom",message:`Unknown prerequisite Feature: ${a}`});return}r.add(a);for(let c of s.rules)for(let u of c.parentConditions??[])o(u.id);r.delete(a),i.add(a)}Object.keys(e).forEach(o)}),Rq=n.strictObject({name:n.string().max(80),reason:n.string().max(500),dateStarted:n.iso.datetime({offset:!0}),dateEnded:n.iso.datetime({offset:!0}).nullable(),coverage:n.number().min(0).max(1),variationWeights:n.array(n.number().min(0).max(1)).min(2).max(20).refine(e=>Math.abs(e.reduce((t,r)=>t+r,0)-1)<=.01),condition:zn,savedGroups:n.array(n.strictObject({match:n.enum(["any","all","none"]),ids:n.array(n.uuid()).min(1)})).max(50),namespace:n.strictObject({id:n.uuid(),ranges:n.array(sw).min(1)}).nullable(),seed:n.string().min(1).max(128)}),Nq=n.strictObject({key:n.string().min(1).max(128),name:n.string().min(1).max(80),hypothesis:n.string().max(2e3),status:n.enum(["draft","running","stopped"]),hashAttribute:n.string().min(1).max(128),fallbackAttribute:n.string().max(128).nullable(),hashVersion:n.literal(2),disableStickyBucketing:n.boolean(),bucketVersion:n.number().int().min(0).max(1e3),minBucketVersion:n.number().int().min(0).max(1e3),variations:n.array(n.strictObject({id:n.string().min(1),key:n.string().min(1),name:n.string().max(80),description:n.string().max(500)})).min(2).max(20),phases:n.array(Rq).min(1).max(100),releasedVariationId:n.string().nullable(),excludeFromPayload:n.boolean(),statusSchedule:n.strictObject({startAt:n.iso.datetime({offset:!0}).nullable(),stopAt:n.iso.datetime({offset:!0}).nullable(),stopAfter:n.strictObject({value:n.number().int().positive().max(36500),unit:n.enum(["hours","days"])}).nullable().optional()}).nullable()}).superRefine((e,t)=>{(e.minBucketVersion>e.bucketVersion||e.statusSchedule?.stopAt&&e.statusSchedule?.stopAfter||e.phases.some((r,i)=>{if(i===0)return!1;let o=e.phases[i-1];return!o?.dateEnded||Date.parse(r.dateStarted)<Date.parse(o.dateStarted)||Date.parse(o.dateEnded)>Date.parse(r.dateStarted)})||new Set(e.variations.map(r=>r.key)).size!==e.variations.length||new Set(e.variations.map(r=>r.id)).size!==e.variations.length||e.releasedVariationId!==null&&!e.variations.some(r=>r.id===e.releasedVariationId)||e.statusSchedule?.startAt&&e.statusSchedule?.stopAt&&Date.parse(e.statusSchedule.startAt)>=Date.parse(e.statusSchedule.stopAt)||e.phases.some(r=>r.dateEnded&&Date.parse(r.dateStarted)>=Date.parse(r.dateEnded)||r.namespace?.ranges.some(([i,o],a,s)=>i>=o||s.some(([c,u],l)=>l!==a&&i<u&&c<o)))||e.phases.some(r=>r.variationWeights.length!==e.variations.length))&&t.addIssue({code:"custom",message:"Invalid experiment versions, variation keys or weights"})}),Dq=Nq.safeExtend({filters:n.array(gD).optional()}),$q=n.strictObject({experiments:n.record(n.uuid(),Dq),savedGroups:Cq}),il=n.strictObject({attributeName:n.string(),attributeValue:n.string(),assignments:n.record(n.string(),n.string())}),Kne=n.strictObject({snapshot:$q,attributes:tn,results:tn,stickyBucketAssignmentDocs:n.record(n.string(),il)}),Wne=n.strictObject({variantKey:n.string().nullable(),bucketVersion:n.number().int().min(0),source:n.enum(["unknownFeature","defaultValue","force","override","experiment","prerequisite","cyclicPrerequisite"]),bucket:n.number().min(0).max(1).optional(),stickyBucketUsed:n.boolean().optional(),hashUsed:n.boolean().optional()})});function ro(e){let t=new Set,r=a=>a!==null&&typeof a=="object"&&!Array.isArray(a);function i(a,s){if(r(a))for(let[c,u]of Object.entries(a))c==="$elemMatch"?o(u,s):c==="$not"?i(u,s):c==="$all"&&Array.isArray(u)&&u.forEach(l=>i(l,s))}function o(a,s=""){if(r(a)){for(let[c,u]of Object.entries(a))if(["$and","$or","$nor"].includes(c)&&Array.isArray(u))u.forEach(l=>o(l,s));else if(c==="$not")o(u,s);else if(c==="$savedGroup"&&r(u))typeof u.attributeKey=="string"&&t.add(u.attributeKey);else if(!c.startsWith("$")){let l=s?`${s}.${c}`:c;t.add(l),i(u,l)}}}return o(e),[...t]}var cw=x(()=>{"use strict"});function uw(e,t={},r=new Set){if(ro(e).some(yD))return!0;for(let i of ki(e)){if(r.has(i))continue;r.add(i);let o=t[i];if(o?.type==="list"&&yD(o.attributeKey)||o?.type==="condition"&&uw(o.condition,t,r))return!0}return!1}var jq,Lq,Mq,tre,bD,nre,rre,ire,yD,hf=x(()=>{"use strict";ee();Zt();cw();jq=n.enum(["active","inactive"]),Lq=n.preprocess((e,t)=>{let r=0;function i(o,a){if(!(++r>1e4||a>20)){if(Array.isArray(o))o.forEach(s=>i(s,a+1));else if(o&&typeof o=="object")for(let[s,c]of Object.entries(o))["__proto__","constructor","prototype"].includes(s)&&t.addIssue({code:"custom",message:"Reserved merchandise attribute"}),i(c,a+1)}}return i(e,0),e},tn),Mq=n.strictObject({id:n.string().trim().min(1).max(255),name:n.string().trim().min(1).max(255),status:jq,metadata:Lq}),tre=Mq.extend({internal_id:n.uuid(),project_id:n.uuid(),environment_id:n.uuid(),created_at:n.iso.datetime({offset:!0}),updated_at:n.iso.datetime({offset:!0})}),bD=n.union([n.strictObject({id:n.string().trim().min(1).max(255)}),n.strictObject({internalId:n.uuid()})]),nre=n.enum(["customer","merchandise","context"]),rre=n.enum(["system","stored","request"]),ire=n.enum(["customer","merchandise","mixed"]),yD=e=>e==="merchandiseId"||e==="merchandise"||e.startsWith("merchandise.")});function SD(e){if(typeof e!="string")return null;try{let t=Intl.getCanonicalLocales(e.trim().replaceAll("_","-"))[0];if(!t)return null;let{language:r,script:i,region:o}=new Intl.Locale(t),a=[r,i,o].filter(Boolean).join("-");return xD.test(a)?a:null}catch{return null}}function AD(e){let[t,r,i]=e.split("-");if(t!=="zh")return`${t}-${new Intl.Locale(e).maximize().script??""}`;let o=r?.length===4?r:void 0,a=r?.length===4?i:r;return o?`zh-${o}`:a&&Fq.has(a)?"zh-Hant":"zh-Hans"}function lw(e,t,r){let i=t.map(o=>({code:Un.parse(o),normalized:o}));for(let o of e){let a=SD(o);if(!a)continue;let s=i.find(d=>d.normalized===a);if(s)return s.code;let c=AD(a),u=i.filter(d=>AD(d.normalized)===c),l=u.find(d=>!d.normalized.includes("-")||d.normalized===c)??u[0];if(l)return l.code}return r}var xD,Un,Fq,Fs=x(()=>{"use strict";ee();xD=/^[a-z]{2,3}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$/,Un=n.string().max(16).regex(xD,"\u8BED\u8A00\u4EE3\u7801\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u4F8B\u5982 zh-CN\u3001en").refine(e=>{try{return Intl.getCanonicalLocales(e)[0]===e}catch{return!1}},"\u6301\u4E45\u5316\u8BED\u8A00\u4EE3\u7801\u5FC5\u987B\u4F7F\u7528\u89C4\u8303\u5199\u6CD5");Fq=new Set(["TW","HK","MO"])});var vD=x(()=>{"use strict"});var mre,io,lr,wD,zq,dw,Uq,fre,hre,ol,_D,oo=x(()=>{"use strict";ee();hf();Zt();qt();mre=n.enum(["draft","active","paused","archived"]),io=n.discriminatedUnion("type",[n.object({type:n.literal("percent"),percentOff:n.number().int().min(1).max(100)}).strict(),n.object({type:n.literal("amount"),amountOffCents:n.number().int().min(1).max(1e8),currency:Oe}).strict()]),lr=n.discriminatedUnion("type",[n.object({type:n.literal("once")}).strict(),n.object({type:n.literal("repeating"),months:n.number().int().min(1).max(36)}).strict(),n.object({type:n.literal("forever")}).strict()]),wD=[n.object({type:n.literal("all")}).strict(),n.object({type:n.literal("plans"),planIds:n.array(n.uuid()).min(1).max(50).refine(e=>new Set(e).size===e.length,"\u5957\u9910\u4E0D\u80FD\u91CD\u590D")}).strict()],zq=n.discriminatedUnion("type",[...wD,n.strictObject({type:n.literal("merchandise"),scope:n.discriminatedUnion("type",[n.strictObject({type:n.literal("all")}),n.strictObject({type:n.literal("selected"),merchandiseIds:n.array(n.uuid()).min(1).max(1e3).refine(e=>new Set(e).size===e.length,"Duplicate merchandise")}),n.strictObject({type:n.literal("condition"),condition:zn})])})]),dw=n.discriminatedUnion("type",[...wD,n.strictObject({type:n.literal("merchandise"),scope:n.strictObject({type:n.enum(["all","selected","condition"])})})]),Uq=n.strictObject({firstPurchaseOnly:n.boolean(),condition:zn}),fre=n.object({name:n.string().trim().min(1).max(80),description:n.string().max(500),discount:io,duration:lr,appliesTo:zq,eligibility:Uq,selfClaimEnabled:n.boolean().default(!1),startsAt:n.iso.datetime().nullable(),endsAt:n.iso.datetime().nullable(),totalLimit:n.number().int().min(1).max(1e6).nullable(),perCustomerLimit:n.number().int().min(1).max(10),grantWindowHours:n.number().int().min(1).max(2160)}).strict().refine(e=>!e.startsAt||!e.endsAt||Date.parse(e.endsAt)>Date.parse(e.startsAt),{message:"\u7ED3\u675F\u65F6\u95F4\u5FC5\u987B\u665A\u4E8E\u5F00\u59CB\u65F6\u95F4",path:["endsAt"]}).refine(e=>!uw(e.eligibility.condition),{message:"Customer eligibility cannot read merchandise; use merchandise applicability",path:["eligibility","condition"]}).refine(e=>e.appliesTo.type!=="merchandise"||e.duration.type==="once",{message:"Merchandise Coupons apply to one purchase",path:["duration"]}).refine(e=>e.appliesTo.type!=="merchandise"||!e.eligibility.firstPurchaseOnly,{message:"Merchant purchase eligibility requires trusted targeting attributes",path:["eligibility","firstPurchaseOnly"]}),hre=n.object({code:n.string().trim().transform(e=>e.toUpperCase()).pipe(n.string().regex(/^[A-Z0-9][A-Z0-9_-]{2,31}$/,"\u4F18\u60E0\u7801\u53EA\u80FD\u7528 3\u201332 \u4F4D\u5B57\u6BCD\u3001\u6570\u5B57\u3001- \u548C _\uFF0C\u4EE5\u5B57\u6BCD\u6216\u6570\u5B57\u5F00\u5934")),maxRedemptions:n.number().int().min(1).max(1e6).nullable(),expiresAt:n.iso.datetime().nullable(),firstPurchaseOnly:n.boolean(),minimumAmountCents:n.number().int().min(1).max(1e8).nullable(),minimumAmountCurrency:Oe.nullable()}).strict().refine(e=>e.minimumAmountCents===null==(e.minimumAmountCurrency===null),"Minimum amount requires its currency"),ol=n.object({id:n.uuid(),couponId:n.uuid(),status:n.enum(["issued","reserved","redeemed","revoked","expired"]),issuedAt:n.iso.datetime(),expiresAt:n.iso.datetime(),coupon:n.object({name:n.string(),discount:io,duration:lr,appliesTo:dw}).strict()}).strict(),_D=n.enum(["claim_disabled","unavailable","inactive","outside_window","not_targeted","not_first_purchase","limit_reached","sold_out"])});function OD(e){return e.pricing.kind==="flat"&&aa(e.pricing.units)>0n&&aa(e.pricing.unitAmountMinor)===aa(e.pricing.units)*BigInt(10**y0(e.currency))}var PD,pw,zs,Vq,al,Ei,En,aa,Bq,qq,Zq,ao,ID,TD,RD,kD,ND,gf,DD,$D,jD,LD,Hq,ED,Gq,MD,Kq,Wq,Jq,FD,mw,Qq,sl,zD,UD,VD,CD,Yq,BD,qD,cl=x(()=>{"use strict";ee();oo();qt();wn();PD=n.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/),pw=n.string().regex(/^(0|[1-9]\d{0,14})$/),zs=n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,30})?$/),Vq=n.string().regex(/^(?:[1-9]\d{0,7}|1\d{8}|200000000)$/),al=Vq,Ei=De.refine(e=>/[1-9]/.test(e)),En=n.iso.datetime({offset:!0}),aa=e=>{let[t,r=""]=e.split(".");if(t===void 0||t==="")throw new Error("Invalid decimal value");return BigInt(t)*1000000n+BigInt(r.padEnd(6,"0"))},Bq=n.array(n.object({upTo:Ei.nullable(),unitAmountMinor:PD,flatAmountMinor:n.number().int().min(0).max(1e8).optional()}).strict()).min(1).max(12).refine(e=>{try{return e.at(-1)?.upTo===null&&e.slice(0,-1).every((t,r)=>{let i=e[r-1]?.upTo;return t.upTo!==null&&(r===0||i!=null&&aa(t.upTo)>aa(i))})}catch{return!1}},"Tier ceilings must increase and the final tier must be unbounded"),qq=n.discriminatedUnion("kind",[n.object({kind:n.literal("flat"),units:Ei,unitAmountMinor:PD}).strict(),n.object({kind:n.enum(["graduated","volume"]),units:Ei,tiers:Bq}).strict()]).refine(e=>e.kind==="flat"||!e.tiers.some(t=>(t.flatAmountMinor??0)>0)||e.kind==="volume"&&e.tiers.length>1,"Tier flat fees require volume pricing with multiple tiers"),Zq=n.strictObject({interval:n.enum(["month","year"]),count:n.number().int().min(1).max(12),anchor:n.enum(["membership","calendar"])}),ao=n.object({currency:Oe,pricing:qq,billingCycle:Zq.optional()}).strict().refine(e=>e.pricing.kind!=="volume"||e.pricing.tiers.length===1,"Multiple volume tiers require prepaid billing");ID={requestId:n.uuid(),productVersionId:n.uuid(),internal_feature_id:n.uuid(),currency:Oe},TD=n.strictObject({interval:n.enum(["hour","day","week","month"]),intervalCount:n.number().int().min(1).max(12),limit:n.number().int().min(1).max(1e6)}),RD=n.discriminatedUnion("kind",[n.object({...ID,kind:n.literal("auto_topup"),threshold:ef,quantity:Ei.refine(e=>Number(e)>=1,"AutoTopup quantity must be at least 1"),purchaseLimit:TD.optional()}).strict(),n.object({...ID,kind:n.literal("postpaid"),maxAmountMinorPerPeriod:al,maxOutstandingMinor:al}).strict()]),kD={productVersionId:n.uuid(),internal_feature_id:n.uuid(),currency:Oe},ND=n.discriminatedUnion("kind",[n.object({...kD,kind:n.literal("auto_topup"),threshold:ef,quantity:Ei.refine(e=>Number(e)>=1,"AutoTopup quantity must be at least 1"),purchaseLimit:TD.optional(),purchaseAmountMinor:al,purchaseUnits:Ei}).strict(),n.object({...kD,kind:n.literal("postpaid"),maxAmountMinorPerPeriod:al,maxOutstandingMinor:al,cashPrice:ao}).strict().refine(e=>e.cashPrice.currency===e.currency,"Currency must match")]),gf=n.object({id:n.uuid(),terms:ND,status:n.enum(["prepared","active","revoked","blocked"]),createdAt:En,acceptedAt:En.nullable(),effectiveAt:En.nullable(),revokedAt:En.nullable()}).strict().refine(e=>(e.status==="prepared"?e.acceptedAt===null:!0)&&(e.status==="active"?e.acceptedAt!==null&&e.effectiveAt!==null:!0)&&(e.status==="revoked"?e.revokedAt!==null:e.revokedAt===null),"Authorization consent and revocation must be explicit"),DD=n.object({authorizationId:n.uuid(),terms:ND,setupUrl:n.url().nullable()}).strict(),$D=n.object({authorizationId:n.uuid(),accepted:n.literal(!0)}).strict(),jD=n.object({authorizationId:n.uuid(),requestId:n.uuid()}).strict(),LD=n.object({internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),interval:n.enum(["day","week","month","year"]),anchor:n.enum(["billing_cycle","utc"]).optional(),basis:n.enum(["usage","credits"]),filter:en.optional(),limit:De.nullable(),thresholds:n.array(n.number().positive().max(1)).max(8),includedThresholds:n.array(n.number().positive().max(1)).max(8).optional(),absoluteThresholds:n.array(Ei).max(8).optional()}).strict().refine(e=>e.thresholds.every((t,r)=>{let i=e.thresholds[r-1];return r===0||i!==void 0&&t>i})&&(e.includedThresholds??[]).every((t,r,i)=>{let o=i[r-1];return r===0||o!==void 0&&t>o})&&(e.absoluteThresholds??[]).every((t,r,i)=>{let o=i[r-1];return r===0||o!==void 0&&aa(t)>aa(o)}),"Notification thresholds must increase"),Hq=LD.safeExtend({requestId:n.uuid()}),ED={control:n.literal("overage"),requestId:n.uuid(),internal_feature_id:n.uuid(),entityId:n.uuid().nullable()},Gq=n.discriminatedUnion("action",[n.strictObject({...ED,action:n.literal("set"),allowed:n.boolean().nullable(),overageLimit:De.nullable(),skipOverageBilling:n.boolean()}),n.strictObject({...ED,action:n.literal("remove")})]),MD=n.union([Hq,Gq]),Kq=n.strictObject({internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),allowed:n.boolean().nullable(),overageLimit:De.nullable(),skipOverageBilling:n.boolean(),interval:n.enum(["day","week","month","year"]),startsAt:En,endsAt:En,used:n.string().regex(/^(0|[1-9]\d{0,23})(\.\d{1,6})?$/),reserved:n.string().regex(/^(0|[1-9]\d{0,23})(\.\d{1,6})?$/),remaining:n.string().regex(/^-?(0|[1-9]\d{0,23})(\.\d{1,6})?$/).nullable()}),Wq=n.object({internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),interval:n.enum(["day","week","month","year"]),anchor:n.enum(["billing_cycle","utc"]).optional(),basis:n.enum(["usage","credits"]),filter:en.optional(),startsAt:En,endsAt:En,used:Fn,reserved:Fn,limit:De.nullable(),thresholds:n.array(n.number().positive().max(1)).max(8),notifiedThresholds:n.array(n.number().positive().max(1)).max(1024),includedThresholds:n.array(n.number().positive().max(1)).max(8).optional(),includedAllowance:n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,12})?$/).optional(),notifiedIncludedThresholds:n.array(n.number().positive().max(1)).max(1024).optional(),absoluteThresholds:n.array(Ei).max(8).optional(),notifiedAbsoluteThresholds:n.array(Ei).max(1024).optional()}).strict().refine(e=>e.basis!=="usage"||De.safeParse(e.used).success&&De.safeParse(e.reserved).success,"Usage counters retain six decimals; credit costs retain twelve"),Jq=n.object({authorizationId:n.uuid(),status:n.enum(["idle","pending","blocked"]),taskId:n.uuid().nullable(),invoiceId:n.uuid().nullable(),hostedInvoiceUrl:n.url().nullable(),purchaseCount:n.number().int().nonnegative(),purchaseWindowEndsAt:En.nullable(),attemptCount:n.number().int().nonnegative(),failedAttemptCount:n.number().int().nonnegative(),suspendedAt:En.nullable(),nextAttemptAt:En.nullable(),failureReason:n.string().min(1).max(240).nullable()}).strict(),FD=n.object({internal_feature_id:n.uuid().optional(),entityId:n.uuid().optional()}).strict(),mw=n.object({authorizations:n.array(gf).max(100),limits:n.array(LD).max(100),overages:n.array(Kq).max(100).optional(),windows:n.array(Wq).max(200),autoTopups:n.array(Jq).max(100),limited:n.boolean()}).strict(),Qq=n.object({id:n.uuid(),internal_feature_id:n.uuid(),productVersionId:n.uuid(),authorizationId:n.uuid(),entityId:n.uuid().nullable(),units:De,amountMinor:zs,cashPrice:ao}).strict(),sl=n.object({id:n.uuid(),sourceKind:n.enum(["product","usage","manual"]),providerInvoiceId:n.string().min(1).max(240).nullable(),status:n.enum(["accruing","open","pending","paid","failed","void"]),currency:Oe,startsAt:En.nullable(),endsAt:En.nullable(),amountMinor:n.string().regex(/^-?(0|[1-9]\d{0,14})$/),grossAmountMinor:n.string().regex(/^-?(0|[1-9]\d{0,14})$/),discountMinor:pw,paidAmountMinor:pw,refundedAmountMinor:pw,createdAt:En,hostedInvoiceUrl:n.url().nullable(),adjustment:n.object({originalInvoiceId:n.uuid(),amountMinor:n.string().regex(/^-?(0|[1-9]\d{0,8})$/).refine(e=>e!=="-0"&&/^-?(0|[1-9]\d{0,8})$/.test(e)&&BigInt(e)>=-200000000n&&BigInt(e)<=200000000n,"Invoice adjustment exceeds the bounded minor amount"),acceptedAt:En.nullable()}).strict().nullable(),lines:n.array(Qq).max(100),linesLimited:n.boolean()}).strict(),zD=n.object({invoiceId:n.uuid(),accepted:n.literal(!0)}).strict(),UD=n.object({after:n.uuid().nullable(),limit:n.number().int().min(1).max(100)}).strict(),VD=n.object({rows:n.array(sl).max(100),nextCursor:n.uuid().nullable()}).strict(),CD=n.strictObject({id:n.string(),coupon:n.string(),start:n.number().nonnegative(),end:n.number().nullable()}),Yq=n.strictObject({subscriptionId:n.string(),customerId:n.string(),accountId:n.string(),sourceItems:n.array(n.strictObject({id:n.string(),price_id:n.string(),quantity:n.number().int(),discounts:n.array(CD).optional()})).max(100),items:n.array(n.strictObject({id:n.string(),price:n.string(),quantity:n.number().int(),discounts:n.array(n.strictObject({coupon:n.string().optional(),terms:n.strictObject({id:n.string(),name:n.string().optional(),percent_off:n.number().optional(),amount_off:n.number().optional(),currency:n.string().optional(),duration:n.enum(["once","forever","repeating"]),duration_in_months:n.number().optional()}).optional(),discount:n.string().optional(),receipt:CD.optional()})).max(20)})).max(100)}),BD=n.strictObject({membershipId:n.uuid(),requestId:n.uuid(),grantIds:n.array(n.uuid()).max(20).refine(e=>new Set(e).size===e.length,"Duplicate Coupon grants")}),qD=n.strictObject({membershipId:n.uuid(),operationId:n.uuid(),status:n.enum(["pending","effective"]),execution:Yq.nullable(),grants:n.array(n.strictObject({id:n.uuid(),couponId:n.uuid(),name:n.string(),discount:io,duration:lr,startedAt:En.nullable()})).max(20)})});var ul,ll,sa,yf=x(()=>{"use strict";ee();wn();ul=n.enum(["minute","hour","day","week","month","quarter","semi_annual","year","lifetime"]),ll=n.number().int().min(1).max(1e3),sa=n.object({cap:De.refine(e=>/[1-9]/.test(e)).nullable(),capPercentage:n.number().positive().max(1e4).nullable(),cycles:n.number().int().min(1).max(1200).nullable()}).strict().refine(e=>e.cap===null||e.capPercentage===null,"Choose a fixed or percentage cap")});var fw,Xq,bf,e8,hw,ZD,HD,GD,t8,n8,Dre,$re,r8,jre,Lre,KD=x(()=>{"use strict";fN();Xm();Xu();ee();Mm();qt();cl();yf();wn();fw={key:ra,name:n.string().trim().min(1).max(80),description:n.string().trim().max(240)},Xq=De.refine(e=>/[1-9]/.test(e)),bf=n.array(n.object({currency:Oe,amountMinor:n.number().int().min(0).max(1e8)}).strict()).min(1).max(20).refine(e=>new Set(e.map(t=>t.currency)).size===e.length,"Currencies must be unique"),e8=n.discriminatedUnion("kind",[n.object({kind:n.literal("access"),internal_feature_id:n.uuid()}).strict(),n.object({kind:n.literal("metered"),internal_feature_id:n.uuid(),usageUnit:n.enum(["count","micro_usd"]),amount:De.nullable(),reset:ul,resetCount:ll,pooled:n.boolean(),rollover:sa.nullable().optional(),cashPrice:ao.nullable().optional(),prepaidPrice:Ns.optional(),feature_override:z0.nullish()}).strict().refine(e=>!e.cashPrice||e.amount!==null,"Cash pricing requires a finite prepaid allowance").refine(e=>!e.rollover||e.amount!==null&&e.reset!=="lifetime","Rollover requires a finite recurring consumable allowance").refine(e=>!e.prepaidPrice||e.amount!==null,"Purchased quantities require a finite included allowance").refine(e=>{if(!e.prepaidPrice||e.amount===null)return!0;try{return Ds(e.amount,e.prepaidPrice.units,e.prepaidPrice.maximumQuantity),!0}catch{return!1}},"The maximum purchased allowance must fit the quantity ledger"),n.object({kind:n.literal("credit"),internal_feature_id:n.uuid(),amount:De,reset:ul,resetCount:ll,rollover:sa.nullable(),pooled:n.boolean(),feature_override:z0.nullish(),cashPrice:ao.nullable().optional()}).strict().refine(e=>!e.cashPrice||e.reset!=="lifetime"&&!e.rollover&&!e.pooled&&OD(e.cashPrice),"Itemized invoice credits require a recurring, unpooled allowance without rollover priced at one currency unit per credit").refine(e=>!e.rollover||e.reset!=="lifetime","Rollover requires a recurring allowance")]),hw=n.array(e8).max(100).refine(e=>new Set(e.map(t=>t.internal_feature_id)).size===e.length,"An entitlement can be granted once per product"),ZD=n.object({days:n.number().int().min(1).max(730),cardRequired:n.boolean(),allowances:hw}).strict().refine(e=>e.allowances.every(t=>t.kind==="access"||!t.cashPrice&&(t.kind!=="metered"||!t.prepaidPrice)),"Trial allowances do not charge cash overages or purchased quantities"),HD=n.object({key:ra,internal_feature_id:n.uuid(),productVersionId:n.uuid(),includedQuantity:n.number().int().min(0).max(1e4),maximumQuantity:n.number().int().min(0).max(1e4),prices:bf,pooled_internal_feature_ids:n.array(n.uuid()).max(100),requireAssignment:n.boolean()}).strict().refine(e=>e.maximumQuantity>=e.includedQuantity,"Capacity cannot be less than included seats").refine(e=>new Set(e.pooled_internal_feature_ids).size===e.pooled_internal_feature_ids.length,"Shared entitlements must be unique"),GD=n.discriminatedUnion("kind",[n.object({...fw,kind:n.literal("membership"),groupId:n.uuid(),membershipType:n.enum(["main","addon"]),interval:n.enum(["free","week","month","year","one_time"]),intervalCount:n.number().int().min(1).max(156).optional(),prices:bf,allowances:hw,trial:ZD.nullable(),licenses:n.array(HD).max(20).refine(e=>new Set(e.map(t=>t.key)).size===e.length,"License keys must be unique")}).strict().refine(e=>e.interval==="free"?e.prices.every(t=>t.amountMinor===0):e.prices.every(t=>e.interval==="one_time"?t.amountMinor>0||e.allowances.some(r=>r.kind==="metered"&&r.prepaidPrice?.prices.some(i=>i.currency===t.currency&&i.amountMinor>0)):t.amountMinor>=0),"Prices must match the billing interval").refine(e=>e.interval!=="one_time"||e.trial===null,"Lifetime plans cannot have a subscription trial").refine(e=>e.intervalCount===void 0||(e.interval==="week"||e.interval==="month"||e.interval==="year")&&e.intervalCount<=(e.interval==="year"?3:e.interval==="month"?36:156),"Recurring billing intervals cannot exceed three years").refine(e=>e.allowances.every(t=>t.kind!=="metered"||!t.prepaidPrice||e.interval!=="free"&&t.prepaidPrice.prices.length===e.prices.length&&t.prepaidPrice.prices.every(r=>e.prices.some(i=>i.currency===r.currency))),"Purchased features require a paid plan and all its published currencies"),n.object({...fw,kind:n.literal("topup"),interval:n.literal("one_time"),prices:bf,internal_feature_id:n.uuid(),amount:Xq,expiresDays:n.number().int().min(1).max(3660).nullable()}).strict().refine(e=>e.prices.every(t=>t.amountMinor>0),"A topup must have a positive price")]),t8=n.object({interval:n.enum(["free","week","month","year","one_time"]).optional(),intervalCount:n.number().int().min(1).max(156).nullable().optional(),prices:bf.optional(),allowances:n.object({upsert:hw,remove:n.array(n.uuid()).max(100)}).strict().refine(e=>new Set(e.remove).size===e.remove.length&&e.upsert.every(t=>!e.remove.includes(t.internal_feature_id)),"An allowance cannot be removed and replaced together").optional(),trial:ZD.nullable().optional(),licenses:n.array(HD).max(20).optional()}).strict(),n8=n.object({...fw,kind:n.literal("variant"),baseProductVersionId:n.uuid(),overrides:t8}).strict(),Dre=n.union([GD,n8]),$re=n.object({products:n.array(n.object({id:n.uuid(),productId:n.string().min(1),name:n.string(),kind:n.enum(["membership","topup"]),version:n.number().int().positive()}).strict()).max(500),limited:n.boolean()}).strict(),r8=lN.and(n.object({internal_id:n.uuid(),revision:n.number().int().nonnegative(),licenses:n.array(L0)})),jre=n.strictObject({rows:n.array(r8).max(200),nextCursor:n.uuid().nullable()}),Lre=n.object({groups:n.array(n.object({id:n.uuid(),name:n.string(),defaultProductVersionId:n.uuid().nullable()}).strict()).max(500),features:wN.shape.features,products:n.array(n.object({id:n.uuid(),productId:n.uuid(),version:n.number().int().positive(),configuration:GD,baseProductVersionId:n.uuid().nullable()}).strict()).max(500),limited:n.boolean()}).strict()});var WD,gw=x(()=>{"use strict";Rs();ee();Xu();WD=n.strictObject({itemKey:n.string().regex(/^paid:feature:[a-f0-9]{8}-[a-f0-9]{4}-[1-8][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/),internal_feature_id:n.uuid(),includedAmount:n.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/),quantity:n.number().int().min(0).max(1e4),terms:Ns,pricing:Yu.optional(),unitAmountMinor:n.number().int().min(0).max(1e8),productId:n.string().min(1).max(255).nullable(),priceId:n.string().min(1).max(255).nullable()}).superRefine((e,t)=>{(e.quantity<e.terms.minimumQuantity||e.quantity>e.terms.maximumQuantity||e.productId===null!=(e.priceId===null)||e.quantity>0&&(e.pricing||e.unitAmountMinor>0)&&e.priceId===null)&&t.addIssue({code:"custom",message:"Purchased quantities need their published bounds and immutable price binding"});try{Ds(e.includedAmount,e.terms.units,e.quantity),Ts({quantity:e.quantity,unitAmountMinor:e.unitAmountMinor,...e.pricing===void 0?{}:{pricing:e.pricing}})}catch{t.addIssue({code:"custom",message:"Purchased allowance exceeds the ledger quantity limit"})}})});function JD(e,t){let r=e.reduce((i,o)=>i+dr(o.units,12),0n)-dr(t,12);return e.some(i=>i.funding==="balance")?r>=-100n&&r<=100n:r===0n}var ca,dl,Af,dr,pl,ml,yw,ua,QD,xf,YD,fl,Us=x(()=>{"use strict";ee();wn();ca=De.refine(e=>/[1-9]/.test(e),"Quantity must be positive"),dl=n.string().min(1).max(120),Af=n.enum(["cap","overflow"]),dr=(e,t)=>{let[r,i=""]=e.split(".");if(r===void 0||r==="")throw new Error("Invalid decimal value");return BigInt(r)*10n**BigInt(t)+BigInt(i.padEnd(t,"0"))},pl=e=>{try{return e()}catch{return!1}},ml=n.discriminatedUnion("operation",[n.object({operation:n.literal("quote"),overageBehavior:Af.optional(),internal_feature_id:n.uuid(),entityId:n.uuid().optional(),quantity:ca,properties:en}).strict(),n.object({operation:n.literal("consume"),overageBehavior:Af.optional(),occurredAt:n.iso.datetime({offset:!0}).optional(),internal_feature_id:n.uuid(),entityId:n.uuid().optional(),quantity:De,properties:en,idempotencyKey:dl}).strict(),n.object({operation:n.literal("reserve"),occurredAt:n.iso.datetime({offset:!0}).optional(),internal_feature_id:n.uuid(),entityId:n.uuid().optional(),quantity:ca,properties:en,idempotencyKey:dl,expiresInSeconds:n.number().int().min(1).max(86400)}).strict(),n.object({operation:n.literal("confirm"),operationId:n.uuid(),quantity:ca,properties:en.optional(),idempotencyKey:dl}).strict(),n.object({operation:n.literal("refund"),operationId:n.uuid(),quantity:ca,idempotencyKey:dl}).strict(),n.object({operation:n.literal("release"),operationId:n.uuid(),idempotencyKey:dl}).strict()]),yw=n.object({internal_credit_feature_id:n.uuid().nullable(),internal_metered_feature_id:n.uuid(),dimension:n.string().min(1).max(64),counterKey:n.string().min(1).max(240),cycleStart:n.iso.datetime({offset:!0}),unitCost:De,units:ca,amount:Fn,tier:n.number().int().min(1).max(12).nullable()}).strict(),ua=n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,12})?$/);QD=n.discriminatedUnion("funding",[n.strictObject({funding:n.literal("balance"),sourceId:n.uuid(),rolloverId:n.uuid().nullable(),units:ua.refine(e=>/[1-9]/.test(e)),amount:Fn}),n.strictObject({funding:n.literal("unbilled"),units:ua.refine(e=>/[1-9]/.test(e))}),n.object({funding:n.literal("prepaid"),sourceId:n.uuid(),units:ca,amount:Fn,pricing:n.array(yw).min(1).max(12)}).strict().refine(e=>pl(()=>e.pricing.reduce((t,r)=>t+dr(r.units,6),0n)===dr(e.units,6)&&e.pricing.reduce((t,r)=>t+dr(r.amount,12),0n)===dr(e.amount,12)&&e.pricing.every(t=>dr(t.unitCost,6)*dr(t.units,6)===dr(t.amount,12))),"Frozen pricing must conserve allocated units and amounts"),n.object({funding:n.literal("postpaid"),invoiceLineId:n.uuid().nullable(),units:ca,authorizationId:n.uuid()}).strict()]),xf=n.enum(["unavailable","insufficient_balance","limit_exceeded","awaiting_topup","authorization_required","payment_blocked","cash_budget_exceeded"]),YD=n.object({allowed:n.boolean(),internal_feature_id:n.uuid(),quantity:De,requestedQuantity:De.optional(),overageBehavior:Af.optional(),reason:xf.nullable(),allocations:n.array(QD).max(500)}).strict().refine(e=>pl(()=>e.allowed?e.reason===null&&JD(e.allocations,e.quantity):e.reason!==null&&e.allocations.length===0),"A quote must conserve its accepted units").refine(e=>pl(()=>e.overageBehavior===void 0?e.requestedQuantity===void 0&&/[1-9]/.test(e.quantity):e.requestedQuantity!==void 0&&dr(e.requestedQuantity,6)>=dr(e.quantity,6)&&(e.overageBehavior==="cap"||e.requestedQuantity===e.quantity)),"Explicit overage behavior must retain the requested quantity"),fl=n.object({id:n.uuid(),internal_feature_id:n.uuid(),kind:n.enum(["consume","reserve","confirm","refund","release","expire"]),originalId:n.uuid().nullable(),quantity:De,requestedQuantity:De.optional(),overageBehavior:Af.optional(),accepted:n.boolean(),reason:n.enum([...xf.options,"expired"]).nullable(),createdAt:n.iso.datetime({offset:!0}),reservationStatus:n.enum(["pending","confirmed","released","expired"]).nullable(),expiresAt:n.iso.datetime({offset:!0}).nullable(),allocations:n.array(QD).max(500)}).strict().refine(e=>pl(()=>e.accepted?e.reason===null&&JD(e.allocations,e.quantity):e.reason!==null&&e.allocations.length===0),"An operation must conserve its requested units").refine(e=>pl(()=>e.overageBehavior===void 0?e.requestedQuantity===void 0:e.kind==="consume"&&e.requestedQuantity!==void 0&&dr(e.requestedQuantity,6)>=dr(e.quantity,6)&&(e.overageBehavior==="cap"||e.requestedQuantity===e.quantity)),"Overage metadata belongs to consumption and preserves requested units").refine(e=>/[1-9]/.test(e.quantity)||e.kind==="consume","Only consumption can record a zero cost event").refine(e=>e.allocations.every(t=>t.funding!=="postpaid"||t.invoiceLineId!==null),"Accepted operations must reference persisted invoice lines").refine(e=>e.originalId!==null===["confirm","refund","release","expire"].includes(e.kind)&&e.expiresAt!==null==(e.reservationStatus!==null)&&(e.kind!=="reserve"||!e.accepted||e.reservationStatus!==null),"Operation provenance and reservation state must be explicit")});var la,XD,e$,i8,t$,bw,n$,r$,Aw=x(()=>{"use strict";ee();wn();yf();la=n.iso.datetime({offset:!0}),XD=De.refine(e=>/[1-9]/.test(e)),e$=n.strictObject({interval:ul.exclude(["lifetime"]),count:ll}),i8=n.strictObject({action:n.literal("create"),requestId:n.uuid(),internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),amount:XD.nullable(),expiresAt:la.nullable(),reset:e$.nullable(),rollover:sa.nullable(),nextResetAt:la.nullable()}).refine(e=>e.amount!==null||e.reset===null&&e.rollover===null,"Unlimited grants cannot reset or roll over").refine(e=>!e.rollover||e.reset!==null,"Rollover requires a recurring grant").refine(e=>e.nextResetAt===null||e.reset!==null&&(e.expiresAt===null||Date.parse(e.nextResetAt)<Date.parse(e.expiresAt)),"The first reset needs a reset interval and must precede expiry"),t$=n.discriminatedUnion("action",[i8,n.strictObject({action:n.literal("update"),requestId:n.uuid(),grantId:n.uuid(),revision:n.number().int().nonnegative(),amount:XD.nullable(),expiresAt:la.nullable(),rollover:sa.nullable(),nextResetAt:la.nullable()}),n.strictObject({action:n.enum(["add","subtract","set_remaining"]),requestId:n.uuid(),grantId:n.uuid(),revision:n.number().int().nonnegative(),amount:De}),n.strictObject({action:n.literal("revoke"),requestId:n.uuid(),grantId:n.uuid(),revision:n.number().int().nonnegative()})]),bw=n.strictObject({id:n.uuid(),internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),amount:De.nullable(),reset:e$.nullable(),rollover:sa.nullable(),nextResetAt:la.nullable(),startsAt:la,expiresAt:la.nullable(),revision:n.number().int().nonnegative(),revoked:n.boolean(),available:Fn,held:Fn,spent:Fn}),n$=n.strictObject({customerId:n.uuid(),after:n.uuid().nullable(),limit:n.number().int().min(1).max(100)}),r$=n.strictObject({rows:n.array(bw).max(100),nextCursor:n.uuid().nullable()})});var ui,i$,o8,o$,a8,xw,a$,Sw=x(()=>{"use strict";ee();cl();wn();Us();ui=n.iso.datetime({offset:!0}),i$=n.strictObject({invoiceId:n.uuid(),after:n.string().min(1).max(180).nullable(),limit:n.number().int().min(1).max(100)}),o8=n.strictObject({kind:n.literal("product"),key:n.string(),productVersionId:n.uuid(),productName:n.string(),itemKey:n.string(),entityId:n.uuid().nullable(),quantity:n.number().positive(),subtotalMinor:n.string().regex(/^-?\d+$/),discountMinor:n.string().regex(/^\d+$/),taxMinor:n.string().regex(/^-?\d+$/).nullable(),totalMinor:n.string().regex(/^-?\d+$/),startsAt:ui.nullable(),endsAt:ui.nullable(),providerLineId:n.string().nullable(),providerItemId:n.string()}),o$=n.strictObject({invoice:sl,items:n.array(n.discriminatedUnion("kind",[o8,n.strictObject({kind:n.literal("invoice_credit"),key:n.string(),internal_feature_id:n.uuid(),internal_credit_feature_id:n.uuid(),name:n.string(),units:De,reserved:De,amountMinor:zs,grossAmountMinor:zs,creditsAppliedMinor:zs,properties:en,cashPrice:ao,providerItemId:n.string().nullable(),creditProviderItemId:n.string().nullable()}),n.strictObject({kind:n.literal("usage"),key:n.string(),internal_feature_id:n.uuid(),name:n.string(),units:De,reserved:De,amountMinor:zs,cashPrice:ao})])).max(100),nextCursor:n.string().min(1).max(180).nullable()}),a8=n.string().regex(/^-?(0|[1-9]\d{0,17})(\.\d{1,12})?$/).refine(e=>!/^\-0(?:\.0+)?$/.test(e)),xw=n.strictObject({from:ui,to:ui,entityId:n.uuid().optional(),snapshotAt:ui.nullable(),after:n.strictObject({at:ui,id:n.uuid(),position:n.number().int().nonnegative()}).nullable(),limit:n.number().int().min(1).max(100)}).refine(e=>Date.parse(e.from)<Date.parse(e.to)&&Date.parse(e.to)-Date.parse(e.from)<=366*864e5,"Statement range must be positive and at most 366 days").refine(e=>e.after===null||e.snapshotAt!==null,"A cursor requires the original snapshot time"),a$=n.strictObject({customerId:n.uuid(),entityId:n.uuid().nullable(),from:ui,to:ui,snapshotAt:ui,totals:n.array(n.strictObject({internal_credit_feature_id:n.uuid(),name:n.string(),consumed:Fn,refunded:Fn,net:a8})).max(1e3),rows:n.array(n.strictObject({operationId:n.uuid(),position:n.number().int().nonnegative(),kind:n.enum(["consume","confirm","refund"]),originalId:n.uuid().nullable(),occurredAt:ui,internal_feature_id:n.uuid(),entitlementName:n.string(),sourceId:n.uuid(),internal_credit_feature_id:n.uuid(),creditName:n.string(),units:ua,amount:Fn,pricing:n.array(yw).max(12),properties:en})).max(100),nextCursor:xw.shape.after})});var s8,c8,Sf,s$,hl,vf=x(()=>{"use strict";ee();wn();s8=n.string().max(40).regex(/^(0|[1-9]\d*)(\.\d{1,12})?$/),c8=n.string().max(41).regex(/^-?(0|[1-9]\d*)(\.\d{1,12})?$/),Sf=n.strictObject({internal_feature_id:n.uuid(),entityId:n.uuid().nullable()}),s$=Sf.extend({quantity:De,expectedRevision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER),idempotencyKey:n.string().min(1).max(120),properties:en.refine(e=>Object.keys(e).length<=13&&!Object.keys(e).some(t=>t.startsWith("usage_")),"Usage accounting reserves three properties")}).strict(),hl=Sf.extend({operationId:n.uuid().nullable(),usage:De,capacity:s8.nullable(),remaining:c8.nullable(),withinLimit:n.boolean(),revision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER),updatedAt:n.iso.datetime({offset:!0}).nullable()}).strict().superRefine((e,t)=>{let r=i=>{let o=i.startsWith("-"),[a,s=""]=(o?i.slice(1):i).split(".");if(a===void 0||a==="")throw new Error("Invalid decimal value");return(o?-1n:1n)*(BigInt(a)*10n**12n+BigInt(s.padEnd(12,"0")))};(e.capacity===null!=(e.remaining===null)||(e.capacity===null?!e.withinLimit:e.remaining===null||r(e.remaining)!==r(e.capacity)-r(e.usage)||e.withinLimit!==r(e.remaining)>=0n)||e.revision===0!=(e.operationId===null)||e.operationId===null!=(e.updatedAt===null))&&t.addIssue({code:"custom",message:"Absolute usage must conserve capacity and its immutable revision"})})});var Cn,Vr,u8,gl,c$,u$,wf,l$,Vs,l8,d$,yl=x(()=>{"use strict";ee();qt();wn();Us();vf();Cn=n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,12})?$/),Vr=n.iso.datetime({offset:!0}),u8=n.enum(["access","metered","credit"]),gl={internal_feature_id:n.uuid(),key:ia,name:n.string().min(1).max(120),kind:u8},c$=n.object({customerId:n.uuid(),snapshotAt:Vr,memberships:n.array(n.object({id:n.uuid(),productId:n.string().min(1).max(255),productVersionId:n.uuid(),billingProductVersionId:n.uuid(),version:n.number().int().positive(),key:n.string().min(1).max(64),name:n.string().min(1).max(120),groupId:n.string().max(255).nullable(),membershipType:n.enum(["main","addon"]),status:n.enum(["trial","active","past_due","ended","expired","trialing","paused","pending","scheduled","unknown"]),cancelAtPeriodEnd:n.boolean(),accessEnabled:n.boolean(),renewalChange:n.object({productVersionId:n.uuid(),name:n.string().min(1).max(120),version:n.number().int().positive(),effectiveAt:Vr,benefitsAppliedAt:Vr.nullable(),timing:n.enum(["immediate","renewal"]),changeKind:n.enum(["plan","seats","quantity"]),feature:n.strictObject({internal_feature_id:n.uuid(),name:n.string().min(1).max(80),fromQuantity:n.number().int().min(0).max(1e4),toQuantity:n.number().int().min(0).max(1e4)}).optional(),seat:n.object({key:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),fromQuantity:n.number().int().min(0).max(1e4),toQuantity:n.number().int().min(0).max(1e4)}).strict().nullable(),status:n.enum(["prepared","quoted","confirmed","pending","scheduled"])}).strict().refine(e=>e.changeKind==="seats"==(e.seat!==null)&&e.changeKind==="quantity"==(e.feature!==void 0),"Quantity changes require their fixed component identities and quantities").nullable(),period:n.object({phase:n.enum(["paid","trial"]),startsAt:Vr,endsAt:Vr.nullable()}).strict().nullable()}).strict()).max(100),membershipsLimited:n.boolean(),balances:n.array(n.object({...gl,usageType:n.enum(["consumable","non_consumable"]).nullable(),accessible:n.boolean(),unlimited:n.boolean(),available:Cn,held:Cn,debt:Cn,nextExpiresAt:Vr.nullable(),usage:hl.nullable()}).strict().refine(e=>e.kind==="metered"==(e.usageType!==null)&&(e.accessible||e.available==="0"&&e.held==="0")&&(e.usageType==="non_consumable"?e.usage!==null&&e.usage.internal_feature_id===e.internal_feature_id&&e.unlimited===(e.usage.capacity===null)&&e.available===(e.usage.remaining===null||e.usage.remaining.startsWith("-")?"0":e.usage.remaining)&&e.held==="0"&&e.debt==="0":e.usage===null),"Balances must expose their actual spendable or non-consumable state")).max(500),balancesLimited:n.boolean()}).strict(),u$=n.enum(["source","usage","transaction","invoice","debt","settlement"]),wf=n.object({at:Vr,id:n.uuid(),type:u$}).strict(),l$=n.object({type:u$.nullable(),resourceKey:ia.optional(),kind:n.enum(["purchase","refund"]).optional(),topup:n.boolean().optional(),from:n.iso.date().nullable(),to:n.iso.date().nullable(),after:wf.nullable(),limit:n.number().int().min(1).max(50)}).strict().refine(e=>!e.from||!e.to||e.from<=e.to,"Date range is reversed"),Vs={id:n.uuid(),occurredAt:Vr},l8=n.discriminatedUnion("type",[n.strictObject({...Vs,type:n.literal("invoice"),status:n.string().min(1).max(80),paid:Cn,refunded:Cn,currency:Oe,externalId:n.string().nullable()}),n.object({...Vs,...gl,type:n.literal("source"),reason:n.enum(["membership","trial","topup","manual","rollover","upgrade_carry","seat"]),quantity:Cn,unlimited:n.boolean(),status:n.enum(["scheduled","active","expired","revoked","unavailable"]),startsAt:Vr,expiresAt:Vr.nullable(),orderId:n.uuid().nullable(),parentSourceId:n.uuid().nullable()}).strict(),n.object({...Vs,type:n.literal("usage"),internal_feature_id:n.uuid(),name:n.string().min(1).max(120),kind:n.enum(["consume","set_usage","reserve","confirm","refund","release","expire"]),originalId:n.uuid().nullable(),quantity:De,accepted:n.boolean(),reason:n.enum([...xf.options,"expired"]).nullable(),properties:en,reservationStatus:n.enum(["pending","confirmed","released","expired"]).nullable(),expiresAt:Vr.nullable(),charges:n.array(n.discriminatedUnion("funding",[n.strictObject({funding:n.literal("balance"),sourceId:n.uuid(),rolloverId:n.uuid().nullable(),units:ua,amount:Cn}),n.strictObject({funding:n.literal("unbilled"),units:ua}),n.object({...gl,funding:n.literal("prepaid"),amount:Cn}).strict(),n.object({funding:n.literal("postpaid"),invoiceId:n.uuid(),invoiceLineId:n.uuid(),authorizationId:n.uuid(),units:De,currency:Oe}).strict()])).max(500)}).strict().refine(e=>(e.kind==="set_usage"||e.kind==="consume"&&e.quantity==="0"?e.accepted&&e.reason===null&&e.charges.length===0&&e.reservationStatus===null:e.accepted?e.reason===null&&e.charges.length>0:e.reason!==null&&e.charges.length===0)&&e.originalId!==null===["confirm","refund","release","expire"].includes(e.kind)&&e.expiresAt!==null==(e.reservationStatus!==null),"Usage facts must retain their original outcome and receipt"),n.object({...Vs,type:n.literal("transaction"),purpose:n.enum(["product","invoice"]),productVersionId:n.uuid().nullable(),productName:n.string().min(1).max(120).nullable(),productVersion:n.number().int().positive().nullable(),invoiceId:n.uuid().nullable(),orderId:n.uuid(),originalId:n.uuid().nullable(),kind:n.enum(["purchase","refund"]),amountMinor:n.number().int().nonnegative().max(2e8).nullable(),currency:Oe.nullable()}).strict().refine(e=>e.currency===null==(e.amountMinor===null)&&(e.purpose==="product"?e.productVersionId!==null&&e.productName!==null&&e.productVersion!==null&&e.invoiceId===null:e.productVersionId===null&&e.productName===null&&e.productVersion===null&&e.invoiceId!==null)&&e.kind==="refund"==(e.originalId!==null)&&(e.kind!=="refund"||e.amountMinor===null||e.amountMinor>0),"Payment fact provenance is incomplete"),n.object({...Vs,...gl,type:n.literal("debt"),sourceId:n.uuid(),transactionId:n.uuid(),amount:Cn}).strict(),n.object({...Vs,...gl,type:n.literal("settlement"),sourceId:n.uuid(),debtId:n.uuid(),kind:n.enum(["payment","usage_refund","payment_return"]),amount:Cn}).strict()]),d$=n.object({customerId:n.uuid(),rows:n.array(l8).max(50),nextCursor:wf.nullable()}).strict().refine(e=>new Set(e.rows.map(t=>t.type+t.id)).size===e.rows.length,"A page cannot repeat a fact").refine(e=>{let t=e.rows.at(-1);return!e.nextCursor||!!(t&&t.id===e.nextCursor.id&&t.type===e.nextCursor.type&&t.occurredAt===e.nextCursor.at)},"Cursor must name the final displayed fact")});var m$,f$,bl,vw,ww,p$,_w,Iw=x(()=>{"use strict";ee();m$=n.object({customerId:n.uuid()}).strict(),f$=n.discriminatedUnion("action",[n.object({customerId:n.uuid(),requestId:n.uuid(),action:n.literal("assign"),poolId:n.uuid(),memberCustomerId:n.uuid()}).strict(),n.strictObject({customerId:n.uuid(),requestId:n.uuid(),action:n.literal("assign_entity"),poolId:n.uuid(),entityId:n.uuid()}),n.object({customerId:n.uuid(),requestId:n.uuid(),action:n.literal("release"),poolId:n.uuid(),slotId:n.uuid()}).strict()]),bl=n.number().int().nonnegative(),vw=n.iso.datetime({offset:!0}),ww=n.strictObject({internalId:n.uuid(),id:n.string(),name:n.string().nullable(),version:n.number().int().positive()}),p$=n.enum(["active","past_due"]),_w=n.strictObject({customerId:n.uuid(),licenses:n.array(n.strictObject({id:n.uuid(),linkId:n.uuid(),parent:n.strictObject({customerProductId:n.uuid(),status:p$,product:ww}),product:ww,planLicense:n.strictObject({id:n.uuid(),prepaidOnly:n.boolean(),isCustom:n.boolean()}).nullable(),granted:bl,included:bl,paidQuantity:bl,usage:bl,remaining:bl,createdAt:vw}).refine(e=>e.granted===e.included+e.paidQuantity&&e.granted===e.usage+e.remaining,"Granted seats are included plus paid, and usage plus remaining")).max(2e3),assignments:n.array(n.strictObject({id:n.uuid(),linkId:n.uuid(),status:p$,product:ww,entity:n.strictObject({internalId:n.uuid(),id:n.string().nullable(),name:n.string().nullable()}).nullable(),beneficiary:n.strictObject({internalId:n.uuid(),id:n.string().nullable(),name:n.string().nullable()}).nullable(),startedAt:vw.nullable(),endedAt:vw.nullable()}).refine(e=>e.entity!==null||e.beneficiary!==null,"A seat assignment has a holder")).max(1e4),limited:n.boolean()})});var so,_f,Bs=x(()=>{"use strict";ee();so=/^gg_ct_[A-Za-z0-9_-]{32,128}$/,_f=n.object({customerId:n.uuid(),sessionId:n.uuid(),accessToken:n.string().regex(/^gg_ct_[A-Za-z0-9_-]{43}$/),refreshToken:n.string().regex(/^gg_rt_[A-Za-z0-9_-]{43}$/),expiresAt:n.iso.datetime(),refreshExpiresAt:n.iso.datetime()})});var Al,hie,gie,d8,p8,m8,f8,h8,g8,y8,h$,g$,b8,A8,yie,y$,b$,A$,bie,kw=x(()=>{"use strict";ee();Al=n.enum(["email","sms","voice","push"]),hie=n.enum(["resend","twilio","fcm","apns"]),gie=n.string().regex(/^\+[1-9]\d{1,14}$/),d8=n.enum(["email_recipient","sms_segment","voice_second","push_device"]),p8=n.string().trim().min(1).max(200).refine(e=>!/[\r\n\0]/.test(e),"Invalid email header"),m8=n.strictObject({subject:p8,html:n.string().min(1).max(131072).optional(),text:n.string().min(1).max(65536).optional()}).refine(e=>e.html!==void 0||e.text!==void 0,{message:"Email requires HTML or text content"}),f8=n.strictObject({body:n.string().min(1).max(1600).refine(e=>e.trim().length>0)}),h8=n.strictObject({text:n.string().trim().min(1).max(4e3),language:n.string().regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/).max(35),maxDurationSeconds:n.number().int().min(1).max(900)}),g8=n.record(n.string().min(1).max(64),n.string().max(256)).refine(e=>Object.keys(e).length<=20&&Object.keys(e).every(t=>!/^(?:indiana_|google\.|gcm\.)/i.test(t)&&t!=="aps"),"Push data contains reserved fields or too many entries"),y8=n.strictObject({title:n.string().trim().min(1).max(200),body:n.string().trim().min(1).max(2e3),url:n.url().max(2048).refine(e=>!/^(?:javascript|data|file|vbscript):/i.test(e)).optional(),data:g8.optional()}).refine(e=>new TextEncoder().encode(JSON.stringify(e)).length<=3072,"Push content exceeds the provider payload budget"),h$=n.discriminatedUnion("channel",[n.strictObject({channel:n.literal("email"),content:m8}),n.strictObject({channel:n.literal("sms"),content:f8}),n.strictObject({channel:n.literal("voice"),content:h8}),n.strictObject({channel:n.literal("push"),content:y8})]),g$=n.strictObject({requestId:n.uuid(),customerId:n.uuid(),connectionId:n.uuid().optional(),message:h$,expiresAt:n.iso.datetime({offset:!0})}),b8=n.array(n.uuid()).min(1).max(1e4).refine(e=>new Set(e).size===e.length,"Duplicate Customer"),A8=n.discriminatedUnion("kind",[n.strictObject({kind:n.literal("all")}),n.strictObject({kind:n.literal("customers"),customerIds:b8})]),yie=n.strictObject({name:n.string().trim().min(1).max(120),connectionId:n.uuid().optional(),message:h$,audience:A8,frequencyLimit:n.number().int().min(1).max(100)}),y$=n.strictObject({requestId:n.uuid(),channel:Al,state:n.enum(["allowed","denied"]),expectedRevision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER-1)}),b$=n.enum(["queued","leased","dispatching","accepted","unknown","retry","skipped","failed","canceled"]),A$=n.enum(["accepted","sent","delivered","delayed","bounced","complained","unsubscribed","opened","clicked","ringing","answered","completed","busy","no_answer","failed","cost_finalized"]),bie=n.strictObject({meter:d8,estimatedUnits:n.string().regex(/^(0|[1-9]\d{0,11})$/),observedUnits:n.string().regex(/^(0|[1-9]\d{0,11})$/).nullable()})});var xl,Ew=x(()=>{"use strict";ee();Xu();xl=n.strictObject({internalFeatureId:n.uuid(),name:n.string().min(1).max(120),includedAmount:n.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/),reset:n.enum(["hour","day","week","month","year","lifetime"]),resetCount:n.number().int().min(1).max(100),terms:Ns})});var x$,S$,_ie,Iie,If=x(()=>{"use strict";ee();x$=n.enum(["stripe","apple","google"]),S$=n.enum(["membership","credit_pack","lifetime"]),_ie=n.enum(["active","grace","suspended","inactive","revoked"]),Iie=n.strictObject({currency:n.string().regex(/^[A-Z]{3}$/),micros:n.string().regex(/^(0|[1-9][0-9]{0,29})$/)})});var qs,Sl=x(()=>{"use strict";ee();If();qt();qs=n.object({provider:x$,currency:Oe}).strict()});var co,v$,x8,Cw,Br,$ie,Zs=x(()=>{"use strict";ee();wn();qt();Sl();co=n.strictObject({internal_feature_id:n.uuid(),quantity:De.refine(e=>/[1-9]/.test(e)),properties:en,entityId:n.uuid().optional()}),v$=n.strictObject({requirement:co,commerce:qs.optional(),paywallId:n.uuid().optional()}),x8=n.enum(["not_entitled","insufficient_balance","capacity_exceeded","limit_exceeded","awaiting_topup","authorization_required","payment_blocked","cash_budget_exceeded","unavailable","authentication_required"]),Cw=n.strictObject({productId:n.string().min(1),productVersionId:n.string().min(1),name:n.string().min(1).max(120),action:n.enum(["purchase","upgrade","addon","topup"]),membershipId:n.string().min(1).nullable(),currency:Oe,amountMinor:n.string().regex(/^(0|[1-9]\d{0,8})$/),interval:n.enum(["free","week","month","year","one_time"]),intervalCount:n.number().int().min(1).max(156)}),Br=n.strictObject({internal_feature_id:n.string().min(1),name:n.string().min(1).max(120),kind:n.enum(["access","metered","credit"]),quantity:De,allowed:n.boolean(),reason:x8.nullable(),preview:n.strictObject({scenario:n.enum(["feature_flag","usage_limit"]),candidates:n.array(Cw).max(20)}).nullable()}).superRefine((e,t)=>{(e.allowed!==(e.reason===null)||e.allowed&&e.preview!==null||new Set(e.preview?.candidates.map(r=>r.productVersionId)).size!==(e.preview?.candidates.length??0)||e.preview?.candidates.some(r=>r.action==="upgrade"!=(r.membershipId!==null)))&&t.addIssue({code:"custom",message:"Invalid access recommendation"})}),$ie=n.strictObject({paywallId:n.uuid(),requirement:co})});function Cf(e){return[...e.matchAll(/\{\{\s*([^{}]+?)\s*\}\}/g)].flatMap(t=>t[1]===void 0?[]:[t[1].trim()])}function Pw(e){let t=Cf(e).filter(i=>!S8.includes(i)&&!/^variables\.[A-Za-z0-9_][A-Za-z0-9_.:-]*$/.test(i)),r=e.replace(/\{\{\s*[^{}]+?\s*\}\}/g,"");return(r.includes("{{")||r.includes("}}"))&&t.push("\u65E0\u6548\u53D8\u91CF\u8BED\u6CD5"),[...new Set(t)]}var S8,Ef,kf,Hs,uo=x(()=>{"use strict";ee();Ew();qt();Zs();S8=["plan.name","plan.price","plan.period","plan.price_per_month","trial.headline","trial.terms","offer.headline","offer.name","offer.description","offer.eligibility","offer.validity","offer.terms","offer.discount","offer.price","offer.original_price","offer.months","offer.code","offer.ends_at","offer.expires_at","paywall.feature","paywall.message","paywall.action"],Ef=n.object({plan:n.string().min(1).max(200).optional(),coupon:n.uuid().optional(),promotionCode:n.uuid().optional(),picker:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/).optional()}).strict(),kf=n.object({text:n.string().optional(),label:n.string().optional(),alt:n.string().optional(),html:n.string().max(32768).optional(),price:n.object({current:n.string(),original:n.string().nullable(),period:n.string()}).optional(),code:n.string().optional(),countdownAt:n.iso.datetime().optional(),planId:n.string().min(1).max(200).optional(),planVersionId:n.string().min(1).max(200).optional(),currency:Oe.optional(),couponId:n.uuid().optional(),offerId:n.uuid().optional(),unavailable:n.boolean().optional(),unavailableReason:n.string().optional(),missing:n.array(n.string()).optional()}).strict(),Hs=n.object({paywall:Br.optional(),nodes:n.record(n.string(),n.object({base:kf,picker:n.string().optional(),byPlan:n.record(n.string(),kf).optional()}).strict()),plans:n.record(n.string(),n.object({id:n.string().min(1).max(200),versionId:n.string().min(1).max(200),available:n.boolean(),name:n.string(),price:n.string(),period:n.string(),currency:Oe.optional(),amountMinor:n.number().int().nonnegative().optional(),interval:n.enum(["free","week","month","year","one_time"]).optional(),intervalCount:n.number().int().positive().optional(),prepaid:n.array(xl).max(100).optional()}).strict()),pickers:n.record(n.string(),n.object({options:n.array(n.string().min(1).max(200)).max(20),selected:n.string().min(1).max(200).nullable()}).strict()),quantities:n.record(n.string(),n.strictObject({minimum:n.number().int().nonnegative(),maximum:n.number().int().nonnegative(),step:n.number().int().positive(),value:n.number().int().nonnegative(),label:n.string(),available:n.boolean()})).optional(),diagnostics:n.array(n.object({nodeId:n.string(),message:n.string()}).strict())}).strict()});function w$(e){return e.type==="stack"&&e.interaction?.type==="select"&&e.interaction.purpose==="product"&&!!e.interaction.pickerId}function Pf(e){let t={};function r(i){if(w$(i)){let o=t[i.interaction.pickerId]??={ids:[],defaultId:null};for(let s of i.children){let c=s.type==="stack"?s.bind?.plan:void 0;c&&!o.ids.includes(c)&&o.ids.push(c)}let a=i.children[i.interaction.defaultIndex];!o.defaultId&&a?.type==="stack"&&(o.defaultId=a.bind?.plan??null)}i.type==="stack"&&i.children.forEach(r)}return e.pages.forEach(i=>r(i.root)),t}function _$(e,t,r){let i={};function o(u){if(u.hidden)return;if(u.type==="plan_picker"){let p=r.pickers[u.id];i[u.id]={ids:p?.options??[],defaults:p?.selected?[p.selected]:[],remembered:[]};return}if(u.type!=="stack")return;let l=u.children.filter(p=>!p.hidden),d=u.interaction;if(w$(u)){let p=i[u.interaction.pickerId]??={ids:[],defaults:[],remembered:[]},h=r.pickers[u.interaction.pickerId]?.options??[];for(let m of l){let g=m.type==="stack"?m.bind?.plan:void 0;g&&h.includes(g)&&!p.ids.includes(g)&&p.ids.push(g),g&&m.id===t[u.id]&&p.remembered.push(g)}let f=u.children[u.interaction.defaultIndex];f?.type==="stack"&&!f.hidden&&f.bind?.plan&&p.defaults.push(f.bind.plan)}if(d?.type==="tabs"){let p=l.find(h=>h.id===t[u.id])??u.children[d.defaultIndex];p&&o(p)}else if(d?.type==="toggle"){let p=typeof t[u.id]=="boolean"?t[u.id]:d.defaultEnabled,h=u.children[p?0:1];h&&o(h)}else l.forEach(o)}let a=typeof t.__page=="string"?t.__page:e.initialPageId??e.pages[0]?.id,s=e.pages.find(u=>u.id===a);s&&o(s.root);let c={};for(let[u,l]of Object.entries(i)){let d=t[u],p=l.remembered[0]??(l.ids.includes(r.pickers[u]?.selected??"")?r.pickers[u]?.selected:l.defaults[0]);c[u]=typeof d=="string"?l.ids.includes(d)?d:"":p&&l.ids.includes(p)?p:""}for(let u of Object.keys(Pf(e)))c[u]??="";return c}var Of=x(()=>{"use strict"});function Rf(e,t){return e.assignments.length===t.length&&e.assignments.every(r=>t.includes(r.productVersionId))}var I$,Tf,vl=x(()=>{"use strict";ee();I$=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),Tf=n.strictObject({tiers:n.array(n.strictObject({id:I$,name:n.string().trim().min(1).max(80)})).min(1).max(8),assignments:n.array(n.strictObject({productVersionId:n.string().min(1).max(200),tierId:I$,period:n.enum(["month","year"])})).max(20)}).superRefine((e,t)=>{let r=e.tiers.map(i=>i.id);(new Set(r).size!==r.length||new Set(e.assignments.map(i=>i.productVersionId)).size!==e.assignments.length||new Set(e.assignments.map(i=>`${i.tierId}:${i.period}`)).size!==e.assignments.length||e.assignments.some(i=>!r.includes(i.tierId)))&&t.addIssue({code:"custom",message:"Each product and tier/period cell must have one unambiguous assignment"})})});var v8,k$,E$,sn,C$,w8,_8,Gs,Ow,wl=x(()=>{"use strict";ee();wn();v8=["credit_balance","credit_transactions","membership","billing","billing_controls","customer_plans","credit_packs","credit_pack_orders","offer_history"],k$=n.enum(v8),E$=n.object({source:k$,layout:n.enum(["full","compact"]),resourceKey:ia.optional(),pageSize:n.number().int().min(1).max(50),showSources:n.boolean(),allowPurchase:n.boolean(),outputs:n.object({billing_adjustment:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/).optional(),billing_authorization:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/).optional(),buy_pack:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/).optional(),billing_portal:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/).optional(),cancel_membership:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/).optional(),resume_membership:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/).optional()}).strict().optional()}).strict().superRefine((e,t)=>{(e.outputs?.billing_authorization||e.outputs?.billing_adjustment)&&e.source!=="billing_controls"&&t.addIssue({code:"custom",message:"Payment authorization routes belong to the billing controls component."}),e.resourceKey&&!["credit_balance","credit_transactions"].includes(e.source)&&t.addIssue({code:"custom",message:"\u8FD9\u4E2A\u6570\u636E\u6E90\u4E0D\u80FD\u7ED1\u5B9A\u79EF\u5206\u8D44\u6E90\u3002"}),e.showSources&&e.source!=="credit_balance"&&t.addIssue({code:"custom",message:"\u53EA\u6709\u79EF\u5206\u4F59\u989D\u53EF\u4EE5\u5C55\u5F00\u6765\u6E90\u3002"}),e.allowPurchase&&!["credit_packs","customer_plans","membership"].includes(e.source)&&t.addIssue({code:"custom",message:"\u53EA\u6709\u79EF\u5206\u5305\u3001\u5957\u9910\u4E0E\u4F1A\u5458\u7EC4\u4EF6\u53EF\u4EE5\u542F\u7528\u4EA4\u6613\u3002"})}),sn=n.string().max(2e3),C$=n.object({id:n.string().max(100),label:sn,detail:n.array(sn).max(12),value:sn.optional(),status:sn.optional(),facts:n.array(n.object({label:sn,value:sn}).strict()).max(1e3),purchaseId:n.uuid().optional(),invoiceUrl:n.url().max(2048).refine(e=>{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}).optional(),billingActions:n.array(n.strictObject({action:n.literal("invoice_open"),label:sn})).max(1).optional(),membershipActions:n.array(n.object({value:n.string().max(100),label:sn}).strict()).max(3).optional()}).strict(),w8=n.object({key:ia,name:sn,spendable:sn,reserved:sn,available:sn,expiry:sn.nullable(),sources:n.array(C$).max(50),sourceCount:n.number().int().nonnegative(),sourcePage:n.number().int().positive(),hasNextSources:n.boolean(),hasPreviousSources:n.boolean()}).strict(),_8=n.object({source:k$,status:n.enum(["idle","loading","ready","error"]),stale:n.boolean(),preview:n.boolean(),errorCode:n.string().max(80).optional(),errorMessage:sn.optional(),resources:n.array(w8).max(500),rows:n.array(C$).max(50),hasNext:n.boolean(),hasPrevious:n.boolean(),page:n.number().int().positive(),filter:n.string().max(40),updatedAt:n.iso.datetime().optional(),buyingId:n.uuid().optional(),membershipBusy:n.boolean().optional(),billingBusy:n.boolean().optional(),membershipReview:n.object({title:sn,note:sn,facts:n.array(n.object({label:sn,value:sn}).strict()).max(100)}).strict().optional(),membershipResult:sn.optional()}).strict(),Gs=n.object({nodes:n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),_8)}).strict(),Ow=n.object({nodeId:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),action:n.enum(["refresh","next","previous","filter","buy_pack","billing_portal","billing_authorization","billing_adjustment","invoice_open","membership_preview","membership_confirm","membership_dismiss","sources_next","sources_previous"]),value:n.string().max(100).optional()}).strict()});function Nf(e){let t=Pw(e).map(r=>`\u672A\u77E5\u53D8\u91CF\uFF1A${r}`);for(let r=0;r<e.length;r++){if(e[r]!=="<"||!/[A-Za-z!/?{]/.test(e[r+1]??""))continue;let i=r;if(e.startsWith("\x3c!--",r)){let o=e.indexOf("-->",r+4);r=o<0?e.length:o+2}else{let o="";for(r++;r<e.length;r++){let a=e[r];if(o)a===o&&(o="");else if(a==='"'||a==="'")o=a;else if(a===">")break}}/\{\{|\}\}/.test(e.slice(i,r+1))&&t.push("\u53D8\u91CF\u53EA\u80FD\u653E\u5728 HTML \u6587\u5B57\u4E2D\uFF0C\u4E0D\u80FD\u653E\u5165\u6807\u7B7E\u3001\u5C5E\u6027\u6216\u6CE8\u91CA")}return[...new Set(t)]}var Tw=x(()=>{"use strict";uo()});function cn(e,t){for(let r of e.pages)lo(r.root,t)}function lo(e,t,r=1,i=null){if(t(e,r,i)!==!1&&e.type==="stack")for(let o of e.children)lo(o,t,r+1,e)}function Cl(e){let t=[],r=new Set;return cn(e,i=>{let o=(a,s,c)=>{r.has(a)||(r.add(a),t.push({key:a,nodeId:i.id,nodeType:i.type,field:s,required:c}))};i.type==="stack"&&i.interaction&&o(i.interaction.label,"label",!0),i.fallback&&o(i.fallback,"text",!0),i.type==="text"&&o(i.text,"text",!0),i.type==="customer_data"&&o(i.title,"title",!0),(i.type==="plan_picker"||i.type==="quantity_picker"||i.type==="coupon_code")&&o(i.label,"label",!0),i.type==="plan_picker"&&i.grouping&&(o(i.grouping.monthLabel,"label",!0),o(i.grouping.yearLabel,"label",!0),o(i.grouping.unavailableLabel,"text",!0)),i.type==="countdown"&&o(i.expired,"text",!0),i.type==="button"&&o(i.label,"label",!0),i.type==="image"&&(o(`image:${i.id}`,"src",!1),o(i.alt,"alt",!1)),i.type==="custom_html"&&o(`html:${i.id}`,"html",!0)}),t}function e7(e,t,r){if(t.field==="html"){let i;return cn(e,o=>{o.id===t.nodeId&&o.type==="custom_html"&&(i=o.html[r])}),i}if(t.field==="src"){let i=Pn(e,t.nodeId);return i?.type==="image"?i.localizedSrc?.[r]??(r===e.strings.defaultLocale?i.src:void 0):void 0}return e.strings.locales[r]?.[t.key]}function Ci(e){let t=Cl(e).filter(i=>i.required);return Object.keys(e.strings.locales).sort((i,o)=>i===e.strings.defaultLocale?-1:o===e.strings.defaultLocale?1:0).map(i=>{let o=t.filter(a=>!e7(e,a,i)?.trim()).map(a=>a.key);return{locale:i,total:t.length,filled:t.length-o.length,missing:o,complete:o.length===0}})}function t7(e){return Ci(e).filter(t=>t.complete||t.locale===e.strings.defaultLocale).map(t=>t.locale)}function Pl(e,t){return lw(t,t7(e),e.strings.defaultLocale)}function Dw(e,t){let r=e.strings.locales[t]??{},i=e.strings.locales[e.strings.defaultLocale]??{},o={};for(let s of Cl(e)){if(s.field==="html"||s.field==="src")continue;let c=r[s.key]?.trim()?r[s.key]:i[s.key];c!==void 0&&(o[s.key]=c)}let a=s=>{if(s.type==="stack")return{...s,children:s.children.map(a)};if(s.type==="custom_html"){let c=s.html[t]?.trim()?s.html[t]:s.html[e.strings.defaultLocale];return{...s,html:c===void 0?{}:{[t]:c}}}if(s.type==="image"){let{localizedSrc:c,...u}=s;return{...u,src:c?.[t]??c?.[e.strings.defaultLocale]??s.src}}return s};return{...e,pages:e.pages.map(s=>({...s,root:a(s.root)})),strings:{defaultLocale:t,locales:{[t]:o}}}}function n7(e,t){let r=null;return lo(e,i=>{if(r)return!1;i.id===t&&(r=i)}),r}function Pn(e,t){for(let r of e.pages){let i=n7(r.root,t);if(i)return i}return null}function $f(e,t,r){let i={};if(!t||typeof t!="object"||Array.isArray(t))return i;let o=t;if(cn(e,a=>{if(a.type==="quantity_picker"){let c=o[a.id];typeof c=="number"&&Number.isSafeInteger(c)&&c>=a.minimumQuantity&&c<=a.maximumQuantity&&(c-a.minimumQuantity)%a.step===0&&(i[a.id]=c);return}if(a.type==="plan_picker"){let c=o[a.id];typeof c=="string"&&(i[a.id]=r?.pickers[a.id]?.options.includes(c)?c:"");return}if(a.type!=="stack"||!a.interaction)return;let s=Object.hasOwn(o,a.id)?o[a.id]:void 0;["select","tabs"].includes(a.interaction.type)&&typeof s=="string"&&a.children.some(c=>c.id===s)&&(i[a.id]=s),a.interaction.type==="toggle"&&typeof s=="boolean"&&(i[a.id]=s)}),e.surface==="paywall"&&typeof o.__page=="string"&&e.pages.some(a=>a.id===o.__page)&&(i.__page=o.__page),r){let a={...i};for(let[s,c]of Object.entries(o))(typeof c=="string"||typeof c=="boolean")&&(a[s]=c);Object.assign(i,_$(e,a,r))}return i}var I8,fn,Il,ut,k8,E8,Rw,T$,kl,P$,El,st,O$,C8,P8,R$,O8,T8,R8,N8,D8,da,Xn,$8,j8,L8,M8,F8,z8,U8,V8,B8,q8,Z8,H8,G8,qr,N$,K8,W8,_l,J8,Q8,Nw,Y8,Df,X8,un,Ir=x(()=>{"use strict";uo();ee();Of();vl();wl();Fs();I8=4,fn={nodes:150,depth:8,children:50,locales:20,actions:40,pages:10,stringLength:2e3,customHtml:32768,customCss:16384,documentBytes:2e5},Il=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),ut=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),k8=n.enum(["none","xs","sm","md","lg","xl"]),E8=n.enum(["none","sm","md","lg","full"]),Rw=n.string().regex(/^#[0-9a-fA-F]{6}$/),T$=n.string().max(2048).refine(e=>{try{let t=new URL(e);return t.protocol==="https:"&&t.hostname.length>0}catch{return!1}},"\u53EA\u652F\u6301 https \u94FE\u63A5"),kl=n.union([T$,n.string().max(32768).regex(/^data:image\/svg\+xml;base64,[A-Za-z0-9+/]+={0,2}$/),n.string().max(131072).regex(/^data:image\/jpeg;base64,\/9j\/[A-Za-z0-9+/]+={0,2}$/),n.string().max(131072).regex(/^data:image\/png;base64,iVBORw0KGgo[A-Za-z0-9+/]+={0,2}$/)]),P$=n.object({primary:Rw,background:Rw,text:Rw,radius:E8,font:n.enum(["system","serif","rounded","mono"])}).strict(),El=n.union([n.enum(["primary","text","muted","background","surface"]),n.string().regex(/^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/)]),st=(e,t)=>n.number().int().min(e).max(t),O$=n.union([n.enum(["fit","fill"]),st(1,1200)]),C8=n.object({top:st(0,200),right:st(0,200),bottom:st(0,200),left:st(0,200)}).strict(),P8=n.object({top:st(-100,200),right:st(-100,200),bottom:st(-100,200),left:st(-100,200)}).strict(),R$=n.object({x:st(0,100),y:st(0,100)}).strict(),O8=n.discriminatedUnion("type",[n.object({type:n.literal("color"),color:El}).strict(),n.object({type:n.literal("linear"),angle:st(0,360),stops:n.array(n.object({color:El,at:st(0,100)}).strict()).min(2).max(4)}).strict(),n.object({type:n.literal("image"),src:kl,fit:n.enum(["cover","contain"]),position:R$.optional()}).strict()]),T8=n.discriminatedUnion("type",[n.object({type:n.literal("rect"),radius:n.union([st(0,200),n.object({topLeft:st(0,200),topRight:st(0,200),bottomRight:st(0,200),bottomLeft:st(0,200)}).strict()])}).strict(),n.object({type:n.literal("pill")}).strict()]),R8=n.object({width:st(0,12),color:El,style:n.enum(["solid","dashed"])}).strict(),N8=n.object({x:st(-40,40),y:st(-40,40),blur:st(0,80),spread:st(-20,40),color:El}).strict(),D8=n.object({font:n.enum(["system","serif","rounded","mono"]),size:st(8,96),weight:n.number().int().min(100).max(900).multipleOf(100),lineHeight:n.number().min(.8).max(3),letterSpacing:n.number().min(-5).max(20),color:El,align:n.enum(["start","center","end"]),italic:n.boolean(),decoration:n.enum(["none","underline","line-through"]),transform:n.enum(["none","uppercase"])}).strict().partial(),da=n.object({width:O$,height:O$,padding:C8,margin:P8,gap:st(0,120),grow:n.union([n.boolean(),n.number().min(0).max(12)]),background:O8,opacity:n.number().min(0).max(1),clipContent:n.boolean(),shape:T8,border:R8,shadow:N8,text:D8}).strict().partial(),Xn={id:Il,name:n.string().trim().min(1).max(60).optional(),hidden:n.boolean().optional(),style:da.optional(),fallback:ut.optional()},$8=n.object({...Xn,type:n.literal("text"),productField:n.enum(["name","price","trial","period"]).optional(),feature:n.object({id:n.uuid(),field:n.enum(["name","allowance"])}).strict().optional(),text:ut,variant:n.enum(["title","heading","body","caption"])}).strict(),j8=n.object({...Xn,type:n.literal("image"),src:kl,localizedSrc:n.record(Un,kl).optional(),alt:ut,aspect:n.enum(["auto","1:1","4:3","16:9","3:1"]),fit:n.enum(["cover","contain"]),position:R$.optional()}).strict(),L8=n.object({...Xn,type:n.literal("button"),label:ut,variant:n.enum(["primary","secondary","link"]),action:ut,purpose:n.enum(["purchase","navigation","close"]).optional(),bind:Ef.optional()}).strict(),M8=n.object({...Xn,type:n.literal("divider")}).strict(),F8=n.object({...Xn,type:n.literal("customer_data"),title:ut,data:E$}).strict(),z8=n.object({...Xn,type:n.literal("spacer"),size:k8}).strict(),U8=n.object({...Xn,type:n.literal("custom_html"),html:n.record(Un,n.string().max(fn.customHtml)),css:n.string().max(fn.customCss)}).strict(),V8=n.object({...Xn,type:n.literal("price"),fallback:ut,parts:n.object({current:da.optional(),original:da.optional(),period:da.optional()}).strict().optional()}).strict(),B8=n.object({...Xn,type:n.literal("coupon_code"),label:ut,fallback:ut}).strict(),q8=n.object({...Xn,type:n.literal("countdown"),source:n.enum(["offer.ends_at","offer.expires_at","fixed"]),at:n.iso.datetime().optional(),granularity:n.enum(["day","hour","minute","second"]),expired:ut,fallback:ut}).strict().refine(e=>e.source!=="fixed"||!!e.at,"\u56FA\u5B9A\u5012\u8BA1\u65F6\u9700\u8981\u7ED3\u675F\u65F6\u95F4"),Z8=n.object({...Xn,type:n.literal("plan_picker"),label:ut,fallback:ut,planIds:n.array(n.string().min(1).max(200)).min(1).max(20).refine(e=>new Set(e).size===e.length,"\u5957\u9910\u4E0D\u80FD\u91CD\u590D").optional(),defaultPlan:n.string().min(1).max(200).optional(),grouping:Tf.safeExtend({monthLabel:ut,yearLabel:ut,unavailableLabel:ut}).optional(),states:n.object({selected:da.optional()}).strict().optional()}).strict().superRefine((e,t)=>{e.grouping&&(!e.planIds||!Rf(e.grouping,e.planIds))&&t.addIssue({code:"custom",message:"Grouped picker assignments must match its product allowlist"})}),H8=n.object({...Xn,type:n.literal("quantity_picker"),bind:Ef.optional(),label:ut,fallback:ut,internalFeatureId:n.uuid(),minimumQuantity:st(0,1e4),maximumQuantity:st(0,1e4),defaultQuantity:st(0,1e4),step:st(1,1e4)}).strict().refine(e=>e.minimumQuantity<=e.defaultQuantity&&e.defaultQuantity<=e.maximumQuantity&&(e.defaultQuantity-e.minimumQuantity)%e.step===0,"Quantity controls require a Product binding and valid bounds"),G8=n.discriminatedUnion("type",[n.object({type:n.literal("input"),label:ut,keyboard:n.enum(["text","email","tel","url"]),maxLength:st(1,500)}).strict(),n.object({type:n.literal("multiselect"),label:ut,min:st(0,50),max:st(1,50)}).strict(),n.object({type:n.literal("select"),label:ut,defaultIndex:st(0,49),purpose:n.enum(["option","product","tier"]).optional(),pickerId:Il.optional(),selectedStyle:da.optional()}).strict(),n.object({type:n.literal("tabs"),label:ut,defaultIndex:st(0,49),purpose:n.literal("tier").optional()}).strict(),n.object({type:n.literal("toggle"),label:ut,defaultEnabled:n.boolean()}).strict(),n.object({type:n.literal("carousel"),label:ut}).strict()]),qr={...Xn,type:n.literal("stack"),direction:n.enum(["vertical","horizontal","overlay"]),align:n.enum(["start","center","end","stretch"]),justify:n.enum(["start","center","end","between"]),productSlot:n.object({index:st(0,19),period:n.enum(["month","year"]).optional(),requireBinding:n.boolean().optional()}).strict().optional(),interaction:G8.optional(),states:n.object({selected:da.optional()}).strict().optional(),purpose:n.literal("benefits").optional(),purchaseAction:ut.optional(),buttonVariant:n.enum(["primary","secondary","link"]).optional(),bind:Ef.optional()},N$=n.lazy(()=>n.object({...Xn,type:qr.type,direction:qr.direction,align:qr.align,justify:qr.justify,children:n.array(K8).max(fn.children),productSlot:qr.productSlot,interaction:qr.interaction,states:qr.states,purpose:qr.purpose,purchaseAction:qr.purchaseAction,buttonVariant:qr.buttonVariant,bind:qr.bind}).strict()),K8=n.lazy(()=>n.union([N$,$8,j8,L8,M8,z8,U8,V8,B8,q8,Z8,H8,F8])),W8=n.union([n.string().max(500),n.number().finite(),n.boolean(),n.null()]),_l={id:ut,event:ut,properties:n.record(ut,W8).refine(e=>Object.keys(e).length<=20,"\u6700\u591A 20 \u4E2A\u53C2\u6570")},J8=n.discriminatedUnion("type",[n.object({..._l,type:n.literal("navigate"),close:n.literal(!1),pageId:Il}).strict(),n.object({..._l,type:n.literal("event"),close:n.boolean()}).strict(),n.object({..._l,type:n.literal("close"),close:n.literal(!0)}).strict(),n.object({..._l,type:n.literal("open_url"),close:n.boolean(),url:T$}).strict(),n.object({..._l,type:n.literal("claim_offer"),close:n.boolean(),couponId:n.uuid()}).strict()]),Q8=n.object({defaultLocale:Un,locales:n.record(Un,n.record(ut,n.string().max(fn.stringLength)))}).strict(),Nw=n.enum(["popup","paywall","onboarding","page","banner"]),Y8=n.discriminatedUnion("type",[n.object({type:n.literal("modal"),size:n.enum(["sm","md","lg"])}).strict(),n.object({type:n.literal("sheet"),size:n.enum(["sm","md","lg"])}).strict(),n.object({type:n.literal("fullscreen")}).strict(),n.object({type:n.literal("inline")}).strict()]),Df={sm:360,md:420,lg:560},X8=n.object({kind:n.literal("screen"),schemaVersion:n.literal(I8),name:n.string().trim().min(1).max(80),surface:Nw,initialPageId:Il.optional(),presentation:Y8,theme:P$,pages:n.array(n.object({id:Il,name:n.string().trim().min(1).max(60),root:N$,theme:P$.optional(),editorPosition:n.object({x:n.number().finite().min(-1e5).max(1e5),y:n.number().finite().min(-1e5).max(1e5)}).strict().optional()}).strict()).min(1).max(fn.pages),strings:Q8,actions:n.array(J8).max(fn.actions)}).strict();un=X8.superRefine((e,t)=>{let r=fn;e.surface!=="paywall"&&e.pages.length!==1&&t.addIssue({code:"custom",message:"Only a Paywall can contain multiple screens"}),e.initialPageId&&!e.pages.some(d=>d.id===e.initialPageId)&&t.addIssue({code:"custom",message:"Initial screen does not exist"});for(let d of e.actions)d.type==="navigate"&&(e.surface!=="paywall"||!e.pages.some(p=>p.id===d.pageId))&&t.addIssue({code:"custom",message:"Navigation screen does not exist"});e.pages.length>r.pages&&t.addIssue({code:"custom",message:`\u9875\u9762\u6700\u591A ${r.pages} \u4E2A`}),e.actions.length>r.actions&&t.addIssue({code:"custom",message:`\u52A8\u4F5C\u6700\u591A ${r.actions} \u4E2A`});let i=d=>t.addIssue({code:"custom",message:d}),o=Object.keys(e.strings.locales);o.includes(e.strings.defaultLocale)||i("\u9ED8\u8BA4\u8BED\u8A00\u5FC5\u987B\u5728\u8BED\u8A00\u5217\u8868\u91CC"),o.length>fn.locales&&i(`\u6700\u591A ${fn.locales} \u79CD\u8BED\u8A00`);let a=new Set;for(let d of e.actions)a.has(d.id)&&i(`\u52A8\u4F5C\u6807\u8BC6\u91CD\u590D\uFF1A${d.id}`),a.add(d.id);let s=new Set;for(let d of e.pages)["next","back"].includes(d.id)&&i(`\u9875\u9762 id \u4E0D\u80FD\u4F7F\u7528\u4FDD\u7559\u540D\u79F0\uFF1A${d.id}`),s.has(d.id)&&i(`\u9875\u9762 id \u91CD\u590D\uFF1A${d.id}`),s.add(d.id);let c=new Set,u=0,l=!1;cn(e,(d,p)=>{if(u++,p>fn.depth&&(l=!0),c.has(d.id)&&i(`\u7EC4\u4EF6 id \u91CD\u590D\uFF1A${d.id}`),c.add(d.id),d.type==="button"&&!a.has(d.action)&&i(`\u6309\u94AE ${d.id} \u5F15\u7528\u7684\u52A8\u4F5C\u4E0D\u5B58\u5728\uFF1A${d.action}`),d.type==="custom_html")for(let h of Object.keys(d.html))o.includes(h)||i(`\u81EA\u5B9A\u4E49 HTML ${d.id} \u542B\u6709\u672A\u542F\u7528\u7684\u8BED\u8A00\uFF1A${h}`);if(d.type==="image")for(let h of Object.keys(d.localizedSrc??{}))o.includes(h)||i(`\u56FE\u7247 ${d.id} \u542B\u6709\u672A\u542F\u7528\u7684\u8BED\u8A00\uFF1A${h}`)}),u>r.nodes&&i(`\u7EC4\u4EF6\u6700\u591A ${r.nodes} \u4E2A`),l&&i(`\u5C42\u7EA7\u6700\u591A ${fn.depth} \u5C42`)})});function kr(e,t){return e?t===null?e.nullable:e.enum&&(typeof t!="string"||!e.enum.includes(t))?!1:e.type==="array"?Array.isArray(t)&&t.length<=100&&!!e.items&&t.every(r=>kr(e.items,r)):["offering_version","reward","paywall_version"].includes(e.type)?typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===2&&t.type===e.type&&n.uuid().safeParse(t.id).success:e.type==="json"||(e.type==="strings"?Array.isArray(t)&&t.every(r=>typeof r=="string"):typeof t===e.type):!1}function Lw(e,t){return e.nullable&&!t.nullable?!1:t.type==="json"?!0:e.type!==t.type||t.enum&&(!e.enum||e.enum.some(r=>!t.enum.includes(r)))?!1:e.type!=="array"||!!e.items&&!!t.items&&Lw(e.items,t.items)}function jf(e,t){let r={};for(let[i,o]of Object.entries(e)){let a=o.source,s=a.type==="input"?t.answers:a.type==="node"?t.results??{}:a.type==="parameter"?t.parameters:t.attributes,c=a.type==="parameter"||a.type==="attribute"?a.key:i,u=Object.hasOwn(s,c),l=s[c];if(a.type==="attribute"&&c.includes(".")&&(!u||c.startsWith("merchandise."))){l=s,u=!0;for(let d of c.split(".")){if(!l||typeof l!="object"||!Object.hasOwn(l,d)||Array.isArray(l)&&(!/^(0|[1-9]\d*)$/.test(d)||Number(d)>=l.length)){u=!1;break}l=l[d]}}if(!(!u||l===void 0)){if(!kr(o,l))throw new Error(`Invalid variable value: ${i}`);r[i]=l}}return r}function Js(e,t){let r={};for(let[i,o]of Object.entries(e.writes??{})){if(!Object.hasOwn(t,i))throw new Error(`Node output is missing: ${i}`);if(Object.hasOwn(r,o))throw new Error("Node outputs cannot overwrite one another");r[o]=t[i]}return r}function D$(e,t,r){let i=new Set(Object.values(t.writes??{}));for(let[o,a]of Object.entries(r))if(!i.has(o)||e[o]?.source.type!=="node"||!kr(e[o],a))throw new Error(`Invalid node variable write: ${o}`);if(i.size!==Object.keys(r).length)throw new Error("Node output is incomplete")}var Wt,$w,Ks,Ws,ioe,jw,Zr=x(()=>{"use strict";ee();Wt=n.string().min(1).max(255).regex(/^[A-Za-z0-9_][A-Za-z0-9_.:-]*$/).refine(e=>e.split(".").every(t=>t.length>0&&!["__proto__","constructor","prototype"].includes(t)),"Reserved or empty variable path"),$w=n.strictObject({type:n.enum(["string","number","boolean","strings","json","offering_version","reward","paywall_version"]),nullable:n.boolean(),enum:n.array(n.string().max(255)).min(1).max(100).optional()}),Ks=$w.extend({type:n.enum([...$w.shape.type.options,"array"]),items:$w.optional()}).superRefine((e,t)=>{(e.type==="array"!=!!e.items||e.enum&&e.type!=="string"||e.items?.enum&&e.items.type!=="string")&&t.addIssue({code:"custom",message:"Array requires items; only strings support enum"})}),Ws=Ks.safeExtend({source:n.discriminatedUnion("type",[n.strictObject({type:n.literal("input")}),n.strictObject({type:n.literal("node")}),n.strictObject({type:n.enum(["parameter","attribute"]),key:Wt})])}),ioe=n.record(Wt,Ws),jw=n.record(Wt,Wt).refine(e=>Object.keys(e).length<=20)});function $$(e,t){if(!t)return e;for(let r of Hr.parse(t).split(".")){if(Array.isArray(e)){if(!/^(0|[1-9]\d*)$/.test(r)||Number(r)>=e.length)return;e=e[Number(r)];continue}if(e===null||typeof e!="object"||!Object.hasOwn(e,r))return;e=Reflect.get(e,r)}return e}function Mw(e,t){if(e.source==="literal")return structuredClone(e.value);let r=jf(t.declarations,t);if(!Object.hasOwn(r,e.key))throw new Error("Capability input is missing");return structuredClone(Te.parse($$(r[e.key],e.path)))}var Hr,li,Pi=x(()=>{"use strict";ee();Zt();Zr();Hr=n.string().min(1).max(255).regex(/^[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+){0,9}$/).refine(e=>e.split(".").every(t=>!["__proto__","constructor","prototype"].includes(t)),"Reserved value path"),li=n.discriminatedUnion("source",[n.strictObject({source:n.literal("literal"),value:Te}),n.strictObject({source:n.literal("variable"),key:n.string().min(1).max(255),path:Hr.optional()})])});function Fw(e,t){let r=[...t].sort((o,a)=>a.length-o.length).find(o=>e===o||e.startsWith(o+"."));if(!r)return null;let i=e===r?void 0:e.slice(r.length+1);return i&&!Hr.safeParse(i).success?null:{key:r,path:i}}function zw(e){let t=Object.values(e.strings.locales).flatMap(r=>Object.values(r));return cn(e,r=>{r.type==="custom_html"&&t.push(...Object.values(r.html))}),[...new Set(t.flatMap(Cf))]}function Lf(e){return zw(e).filter(t=>t.startsWith("variables.")).map(t=>t.slice(10))}var Mf=x(()=>{"use strict";Ir();uo();Pi()});function pr(e){let t=JSON.stringify(e);if(t===void 0)throw new TypeError("A JSON value is required");let r=new TextEncoder().encode(t).length,i=!1;for(let o=0;o<t.length;o++){let a=t.charAt(o);if(i)a==="\\"?o++:a==='"'&&(i=!1);else if(a==='"')i=!0;else if(a===":"||a===",")r++;else if(a==="-"||a>="0"&&a<="9"){let s=o;for(;o+1<t.length&&/[0-9.eE+-]/.test(t.charAt(o+1));)o++;let c=t.slice(s,o+1);if(!/[eE]/.test(c))continue;let[u="",l]=c.split(/[eE]/),d=u.replace(/^-/,""),p=d.replace(".","").length,h=(d.includes(".")?d.indexOf("."):p)+Number(l),f=h<=0?2-h+p:h>=p?h:p+1;r+=f+(u.startsWith("-")?1:0)-c.length}}return r}var Qs=x(()=>{"use strict"});function a7(e,t){if(e===null)return t.nullable;switch(t.type){case"json":return!0;case"string":return typeof e=="string";case"number":return typeof e=="number"&&Number.isFinite(e);case"boolean":return typeof e=="boolean";case"strings":return Array.isArray(e)&&e.every(r=>typeof r=="string")}}var po,r7,j$,i7,o7,Ff,s7,L$,Aoe,xoe,pa,Soe,voe,Uw=x(()=>{"use strict";ee();Ir();Mf();Qs();po=n.enum(["page","popup","banner"]),r7=3e5,j$=n.strictObject({type:n.enum(["string","number","boolean","strings","json"]),nullable:n.boolean()}),i7=n.strictObject({inputs:n.record(ut,j$.extend({required:n.boolean()})).refine(e=>Object.keys(e).length<=40,"Too many content inputs"),outputs:n.record(ut,j$).refine(e=>Object.keys(e).length<=40,"Too many content outputs")}),o7=n.strictObject({kind:po,schemaVersion:n.literal(1),name:n.string().trim().min(1).max(80),screen:un,contract:i7}),Ff=o7.superRefine((e,t)=>{let r=(o,a)=>t.addIssue({code:"custom",message:o,path:a});e.screen.surface!==e.kind&&r("Content surface must match its domain",["screen","surface"]),e.screen.name!==e.name&&r("Content has one editable name",["screen","name"]),e.kind==="banner"&&e.screen.presentation.type!=="inline"&&r("Banner requires an inline container",["screen","presentation"]),e.kind!=="banner"&&e.screen.presentation.type==="inline"&&r("Inline presentation belongs to Banner",["screen","presentation"]),e.screen.actions.some(o=>o.type!=="event"&&o.type!=="navigate")&&r("Content actions must emit host intents or navigate locally",["screen","actions"]);let i=new Set(e.screen.actions.filter(o=>o.type==="event").map(o=>o.id));(Object.keys(e.contract.outputs).some(o=>!i.has(o))||[...i].some(o=>!Object.hasOwn(e.contract.outputs,o)))&&r("Every event needs exactly one output declaration",["contract","outputs"]),pr(e)>r7&&r("Content document exceeds its byte budget",[])});s7=Ff.superRefine((e,t)=>{for(let r of Lf(e.screen))Object.keys(e.contract.inputs).some(i=>r===i||r.startsWith(i+"."))||t.addIssue({code:"custom",path:["contract","inputs"],message:"Declare every reusable input read"});for(let r of e.screen.actions){if(r.type!=="event")continue;let i=e.contract.outputs[r.id],o=Object.hasOwn(r.properties,"value")?r.properties.value:r.properties;i&&!a7(o,i)&&t.addIssue({code:"custom",path:["contract","outputs",r.id],message:"Action value differs from its declared type"})}Ci(e.screen).some(r=>!r.complete)&&t.addIssue({code:"custom",path:["screen","strings"],message:"Content needs complete localized copy"})}),L$=n.strictObject({id:n.uuid(),kind:po,projectId:n.uuid(),environmentId:n.uuid(),name:n.string(),revision:n.number().int().nonnegative(),status:n.enum(["draft","published","archived"]),publishedVersionId:n.uuid().nullable(),createdAt:n.iso.datetime({offset:!0}),updatedAt:n.iso.datetime({offset:!0})}),Aoe=L$.extend({draft:Ff}),xoe=n.strictObject({rows:n.array(L$).max(200),nextCursor:n.uuid().nullable()}),pa=n.strictObject({id:n.uuid(),kind:po,resourceId:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),version:n.number().int().positive(),sourceRevision:n.number().int().nonnegative(),document:s7,createdAt:n.iso.datetime({offset:!0})}),Soe=pa.omit({document:!0}),voe=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),kind:po,id:n.uuid(),document:Ff}),n.strictObject({action:n.literal("save"),kind:po,id:n.uuid(),revision:n.number().int().nonnegative(),document:Ff}),n.strictObject({action:n.enum(["publish","archive"]),kind:po,id:n.uuid(),revision:n.number().int().nonnegative()})]).superRefine((e,t)=>{"document"in e&&e.document.kind!==e.kind&&t.addIssue({code:"custom",path:["document","kind"],message:"Content cannot change domain"})})});var Ys,Vw=x(()=>{"use strict";ee();Ys={funnelId:n.uuid().optional(),funnelVersionId:n.uuid().optional()}});var Eoe,Coe,Xs,Poe,Bw=x(()=>{"use strict";ee();Eoe=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),couponId:n.uuid(),productBindingId:n.uuid(),storeOfferId:n.string().min(1).max(255).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/).nullable(),storeOfferType:n.enum(["introductory","promotional"])}),n.strictObject({action:n.literal("set_enabled"),id:n.uuid(),revision:n.number().int().nonnegative(),enabled:n.boolean()})]),Coe=n.array(n.strictObject({id:n.uuid(),couponId:n.uuid(),productBindingId:n.uuid(),storeOfferId:n.string().min(1).max(255).nullable(),storeOfferType:n.enum(["introductory","promotional"]),enabled:n.boolean(),revision:n.number().int().nonnegative()})).max(500),Xs=n.strictObject({offerKind:n.enum(["none","introductory","promotional"]),offerId:n.string().min(1).max(255).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/).nullable(),discountMinor:n.number().int().min(0).max(1e8),trialDays:n.number().int().min(1).max(730).nullable()}).superRefine((e,t)=>{(e.offerKind==="none"&&(e.offerId!==null||e.discountMinor!==0||e.trialDays!==null)||e.trialDays!==null&&e.discountMinor!==0)&&t.addIssue({code:"custom",message:"Select one store purchase option with its exact terms"})}),Poe=n.record(n.uuid(),Xs).refine(e=>Object.keys(e).length<=20,"At most 20 native store selections")});var qw,Zw=x(()=>{"use strict";ee();qt();If();qw=n.object({type:n.literal("native_purchase"),receiptId:n.uuid(),orderId:n.uuid(),productVersionId:n.uuid(),provider:n.enum(["apple","google"]),productId:n.string().min(1).max(255),productKind:S$,replacement:n.strictObject({sourceOrderId:n.uuid(),sourceProductId:n.string().min(1).max(255),policy:n.enum(["apple_store","google_full_price"]),sourceAccountTokens:n.array(n.uuid()).max(50)}).nullable(),appAccountToken:n.uuid().optional(),obfuscatedAccountId:n.string().min(1).max(64).optional(),obfuscatedProfileId:n.uuid().optional(),basePlanId:n.string().min(1).max(255).optional(),offerId:n.string().min(1).max(255).optional(),offerKind:n.enum(["none","introductory","promotional"]),currency:Oe,catalogAmountMinor:n.number().int().nonnegative().max(1e8),discountMinor:n.number().int().nonnegative().max(1e8),trialDays:n.number().int().min(1).max(730).nullable(),seatBundle:n.array(n.strictObject({key:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/),quantity:n.number().int().min(1).max(1e4)})).max(20),applePromotionalOffer:n.strictObject({offerId:n.string().min(1).max(255),keyId:n.string().min(1).max(255),nonce:n.uuid(),signature:n.string().min(1).max(1024),timestamp:n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).nullable()}).strict().superRefine((e,t)=>{let r=e.provider==="apple";(e.replacement!==null&&(e.productKind!=="membership"||e.offerKind!=="none"||e.trialDays!==null||e.replacement.policy!==(r?"apple_store":"google_full_price"))||e.productKind!=="membership"&&(e.trialDays!==null||e.offerKind!=="none"||e.basePlanId!==void 0)||!r&&e.productKind==="membership"&&e.basePlanId===void 0||e.discountMinor>e.catalogAmountMinor||new Set(e.seatBundle.map(o=>o.key)).size!==e.seatBundle.length||e.trialDays!==null&&(e.discountMinor!==0||e.offerKind==="none")||e.offerKind==="none"&&e.discountMinor!==0||(r?!e.appAccountToken||e.obfuscatedAccountId!==void 0||e.obfuscatedProfileId!==void 0||e.basePlanId!==void 0||e.offerKind==="promotional"!=(e.applePromotionalOffer!==null)||e.offerKind==="promotional"!=(e.offerId!==void 0)||e.applePromotionalOffer!==null&&e.applePromotionalOffer.offerId!==e.offerId:e.appAccountToken!==void 0||!e.obfuscatedAccountId||!e.obfuscatedProfileId||e.applePromotionalOffer!==null||e.offerKind==="none"!=(e.offerId===void 0)))&&t.addIssue({code:"custom",message:"Native purchase terms must match the accepted store selection"})})});var c7,M$,u7,l7,F$,d7,p7,z$,U$,m7,f7,h7,V$,g7,y7,b7,A7,B$,x7,q$,S7,v7,Z$,w7,_7,I7,Hw,ma,k7,E7,C7,H$,P7,O7,G$,T7,R7,N7,K$,Gw,D7,$7,W$,j7,L7,M7,J$,F7,Q$,z7,U7,V7,B7,Y$,q7,Z7,H7,G7,K7,X$,W7,J7,Q7,Y7,X7,ec,zf=x(()=>{"use strict";Hu();Hu();c7=n.registry(),{BillingInterval:M$}=(()=>{var e;return(function(t){t.OneOff="one_off",t.Week="week",t.Month="month",t.Quarter="quarter",t.SemiAnnual="semi_annual",t.Year="year"})(e||(e={})),{BillingInterval:e}})(),{DisplaySchema:u7}=(e=>({DisplaySchema:e.object({primary_text:e.string().meta({description:"Main display text (e.g. '$10' or '100 messages')."}),secondary_text:e.string().optional().meta({description:"Secondary display text (e.g. 'per month' or 'then $0.5 per 100')."})})}))(n),{withSpecDefault:l7}=(e=>({withSpecDefault:({schema:r,defaultValue:i,description:o})=>(e.add(r,{description:o,default:i}),r)}))(c7),{COMMON:F$}={COMMON:["usd","eur","gbp","cad","aud","jpy","chf","cny","inr"]},{STRIPE_PRESENTMENT_CURRENCIES:d7}={STRIPE_PRESENTMENT_CURRENCIES:["usd","aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bif","bmd","bnd","bob","brl","bsd","bwp","byn","bzd","cad","cdf","chf","clp","cny","cop","crc","cve","czk","djf","dkk","dop","dzd","egp","etb","eur","fjd","fkp","gbp","gel","gip","gmd","gnf","gtq","gyd","hkd","hnl","htg","huf","idr","ils","inr","isk","jmd","jpy","kes","kgs","khr","kmf","krw","kyd","kzt","lak","lbp","lkr","lrd","lsl","mad","mdl","mga","mkd","mmk","mnt","mop","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sek","sgd","shp","sle","sos","srd","std","szl","thb","tjs","top","try","ttd","twd","tzs","uah","ugx","uyu","uzs","vnd","vuv","wst","xaf","xcd","xcg","xof","xpf","yer","zar","zmw"]},{COMMON_SET:p7}=(e=>({COMMON_SET:new Set(e)}))(F$),{hasNoDuplicateCurrencies:z$}={hasNoDuplicateCurrencies:t=>{let r=new Set;for(let{currency:i}of t){let o=i.toLowerCase();if(r.has(o))return!1;r.add(o)}return!0}},{DUPLICATE_CURRENCY_MESSAGE:U$}={DUPLICATE_CURRENCY_MESSAGE:"Each currency may appear at most once in additional_currencies."},{ApiStripePriceProcessorSchema:m7}=(e=>({ApiStripePriceProcessorSchema:e.object({price_id:e.string().meta({description:"Stripe price ID. For prepaid with included > 0 this is the V2 price."})})}))(n),{Infinite:f7}={Infinite:"inf"},{TierBehavior:h7}=(()=>{var e;return(function(t){t.Graduated="graduated",t.VolumeBased="volume"})(e||(e={})),{TierBehavior:e}})(),{BillingMethod:V$}=(()=>{var e;return(function(t){t.Prepaid="prepaid",t.UsageBased="usage_based"})(e||(e={})),{BillingMethod:e}})(),{AllocatedBilling:g7}=(()=>{var e;return(function(t){t.Arrear="arrear",t.ProratedLegacy="prorated_legacy"})(e||(e={})),{AllocatedBilling:e}})(),{CREDIT_DIMENSION_NAME_MAX_LENGTH:y7}={CREDIT_DIMENSION_NAME_MAX_LENGTH:64},{USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:b7}={USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:"::"},{CreditMatchSchema:A7}=(e=>({CreditMatchSchema:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()]).transform(String).pipe(e.string()))}))(n),{ApiCreditTierSchema:B$}=(e=>({ApiCreditTierSchema:e.object({to:e.union([e.number().positive(),e.enum(["inf"])]).meta({description:"Inclusive upper usage boundary for this graduated tier. The final tier must be 'inf'."}),credit_cost:e.number().min(0).meta({description:"Credits consumed per billing-unit group within this tier."})})}))(n),{VIOLATION_MESSAGES:x7}={VIOLATION_MESSAGES:{non_final_infinity:"Only the final tier may use an 'inf' boundary.",not_increasing:"Tier boundaries must be strictly increasing.",final_not_infinity:"The final tier must use an 'inf' boundary."}},{MarkupEntrySchema:q$}=(e=>({MarkupEntrySchema:e.object({markup:e.number().min(-100)})}))(n),{ModelMarkupsSchema:S7}=((e,t)=>({ModelMarkupsSchema:e.record(e.string().regex(/.+\/.+/,'Model keys are "<provider>/<model>", e.g. "openai/gpt-4o" or "custom/my-model".'),t.extend({markup:e.number().min(-100).optional(),input_cost:e.number().min(0).optional(),output_cost:e.number().min(0).optional()})).nullish()}))(n,q$),{InvoiceUsageEntrySchema:v7}=(e=>({InvoiceUsageEntrySchema:e.object({feature_id:e.string().meta({description:"The metered feature whose units are being converted."}),quantity:e.number().nonnegative().meta({description:"Billable units of the metered feature. Converted to the credit-system feature through its rate card."}),properties:e.record(e.string(),e.unknown()).optional().meta({description:"Event properties used to pick the rate card dimension and multipliers."})}).strict()}))(n),{AttachDiscountSchema:Z$}=(e=>({AttachDiscountSchema:e.object({reward_id:e.string().optional().meta({description:"The ID of the reward to apply as a discount."}),promotion_code:e.string().optional().meta({description:"The promotion code to apply as a discount."})}).refine(r=>r.reward_id||r.promotion_code,{message:"Either reward_id or promotion_code must be provided."}).meta({title:"AttachDiscount",description:"A discount to apply. Can be either a reward ID or a promotion code."})}))(n),{CustomLineItemSchema:w7}=(e=>({CustomLineItemSchema:e.object({amount:e.number().meta({description:"Amount in dollars for this line item (e.g. 10.50). Can be negative for credits."}),description:e.string().meta({description:"Description for the line item."})})}))(n),{UnixMsTimestampSchema:_7}=(e=>({UnixMsTimestampSchema:e.number().int().safe().nonnegative()}))(n),{CreateInvoicePreviewLineSchema:I7}=(e=>({CreateInvoicePreviewLineSchema:e.object({plan_id:e.string().nullable(),feature_id:e.string().nullable(),description:e.string(),amount:e.number(),amount_after_discounts:e.number(),quantity:e.number().nullable(),prorated:e.boolean(),period_start:e.number().nullable(),period_end:e.number().nullable()})}))(n),{ReissueInvoiceParamsSchema:Hw}=(e=>({ReissueInvoiceParamsSchema:e.object({invoice_id:e.string().meta({description:"The Autumn invoice ID to void and replace.",example:"inv_2b3c4d5e6f7g8h"}),invoice_template_id:e.string().optional().meta({description:"ID of an invoice template (configured in billing settings) whose footer and memo are applied to the replacement invoice."}),net_terms_days:e.number().int().positive().optional().meta({description:"Number of days the customer has to pay the replacement invoice. Defaults to the original invoice's due date; required when that date has already passed."}),update_customer_email:e.email().optional().meta({description:"Updates the customer's billing email before the replacement is issued, so Stripe sends the new invoice to this address."})})}))(n),{InvoiceModeParamsSchema:ma}=(e=>({InvoiceModeParamsSchema:e.object({enabled:e.boolean().meta({description:"When true, creates an invoice and sends it to the customer instead of charging their card immediately. Uses Stripe's send_invoice collection method."}),enable_plan_immediately:e.boolean().default(!1).meta({description:"If true, enables the plan immediately even though the invoice is not paid yet."}),finalize:e.boolean().default(!0).meta({description:"If true, finalizes the invoice so it can be sent to the customer. If false, keeps it as a draft for manual review."}),invoice_template_id:e.string().optional().meta({description:"ID of an invoice template (configured in billing settings) whose footer (e.g. bank details) is applied to the invoice."}),net_terms_days:e.number().int().positive().optional().meta({description:"Number of days the customer has to pay the invoice before it is due (Stripe days_until_due)."})}).meta({title:"InvoiceMode",description:"Invoice mode configuration. Creates an invoice instead of charging the card immediately."})}))(n),{InvoiceTemplateSchema:k7}=(e=>({InvoiceTemplateSchema:e.object({id:e.string().meta({description:"Unique identifier for the invoice template."}),name:e.string().meta({description:"User-defined name to distinguish this template when sending an invoice."}),footer:e.string().optional().meta({description:"Footer text rendered on the invoice, typically bank details so customers can pay directly."}),memo:e.string().optional().meta({description:"Memo shown near the top of the invoice (Stripe invoice description), e.g. a contact line for payment questions."}),net_terms_days:e.number().int().positive().optional().meta({description:"Default number of days the customer has to pay before the invoice is due. Overridable when sending."}),created_at:e.number().optional().meta({description:"Timestamp (ms) when the template was created."})})}))(n),{BasePriceSchema:E7}=((e,t,r)=>({BasePriceSchema:e.object({amount:e.number().meta({description:"Base price amount for the plan, in major currency units (e.g. dollars)."}),interval:e.enum(t).meta({description:"Billing interval (e.g. 'month', 'year')."}),interval_count:e.number().optional().meta({description:"Number of intervals per billing cycle. Defaults to 1."}),display:r.optional().meta({description:"Display text for showing this price in pricing pages."})})}))(n,M$,u7),{CURRENCY_CODES:C7}=((e,t,r)=>({CURRENCY_CODES:[...e,...t.filter(o=>!r.has(o)).sort()]}))(F$,d7,p7),{ApiPriceProcessorsSchema:H$}=((e,t)=>({ApiPriceProcessorsSchema:e.object({stripe:t.nullish()}).meta({"x-atmn-mapping":!0})}))(n,m7),{AllocatedBillingFieldSchema:P7}=((e,t)=>({AllocatedBillingFieldSchema:e.enum(t).optional().meta({internal:!0,description:"How an allocated usage_based price bills mid-cycle quantity changes. 'arrear' (default) bills at period end. 'prorated_legacy' is only returned for prices still on the legacy immediate-proration behavior; omit it to migrate the price to 'arrear'."})}))(n,g7),{CreditDimensionNameSchema:O7}=((e,t,r)=>({CreditDimensionNameSchema:e.string().min(1).max(t).refine(o=>!o.includes(r),{message:`Dimension names cannot contain "${r}"`})}))(n,y7,b7),{ApiCreditMatchSchema:G$}=(e=>({ApiCreditMatchSchema:e.meta({description:"Event properties this entry applies to. Every key must equal the tracked property, compared as strings."})}))(A7),{findCreditTierViolations:T7}=(e=>({findCreditTierViolations:r=>{let i=[],o=(s,c)=>i.push({index:s,reason:c,message:e[c]}),a=0;for(let[s,c]of r.entries()){let u=s===r.length-1;if(c==="inf"){u||o(s,"non_final_infinity");continue}(!Number.isFinite(c)||c<=a)&&o(s,"not_increasing"),a=c,u&&o(s,"final_not_infinity")}return i}}))(x7),{ApiCreditMultiplierSchema:R7}=((e,t)=>({ApiCreditMultiplierSchema:e.object({match:t,factor:e.number().positive().optional().meta({description:"Multiplies the matched rate. All matching multipliers stack."}),add:e.number().optional().meta({description:"Added to the rate after every factor is applied, in credits per billing-unit group."})}).strict().refine(i=>i.factor!==void 0||i.add!==void 0,{message:"A multiplier needs a factor or an add."})}))(n,G$),{ProviderMarkupsSchema:N7}=((e,t)=>({ProviderMarkupsSchema:e.record(e.string(),t).nullish()}))(n,q$),{InvoiceFeatureQuantitySchema:K$}=((e,t,r)=>({InvoiceFeatureQuantitySchema:e.object({feature_id:e.string().meta({description:"The feature to bill."}),billing_behavior:e.enum(t).meta({description:"Which of the feature's prices to use: 'prepaid' or 'usage_based'."}),quantity:e.number().nonnegative().optional().meta({description:"Billable feature units in total, exclusive of any included usage. Not per seat or per entity. For a credit-system feature this is the number of credits."}),usage:e.array(r).optional().meta({description:"For credit-system features: billable units of the source features, converted through the credit rate card. Mutually exclusive with quantity."}),prorate:e.boolean().optional().meta({description:"Whether to prorate this line against period_start / period_end. Defaults to true for prepaid and false for usage-based."})}).strict().refine(o=>o.quantity!==void 0!=(o.usage!==void 0),{message:"Provide exactly one of quantity or usage."})}))(n,V$,v7),{CreateInvoicePreviewSchema:Gw}=((e,t)=>({CreateInvoicePreviewSchema:e.object({currency:e.string(),lines:e.array(t),subtotal:e.number(),discount_total:e.number(),tax:e.object({total:e.number(),amount_inclusive:e.number(),amount_exclusive:e.number(),status:e.enum(["complete","incomplete"])}).nullable(),total:e.number(),due_date:e.number().nullable()})}))(n,I7),{SUPPORTED_SET:D7}=(e=>({SUPPORTED_SET:new Set(e)}))(C7),{ApiCreditDimensionBaseSchema:$7}=((e,t)=>({ApiCreditDimensionBaseSchema:e.object({match:t,priority:e.number().int().optional().meta({description:"Breaks ties between dimensions that match the same number of keys. Higher wins."})})}))(n,G$),{refineGraduatedTiers:W$}=(e=>({refineGraduatedTiers:(r,i)=>{let o=e(r.tiers.map(a=>a.to));for(let{index:a,message:s}of o)i.addIssue({code:"custom",message:s,path:["tiers",a,"to"]})}}))(T7),{ApiFeatureMarkupsOverrideSchema:j7}=((e,t,r)=>({ApiFeatureMarkupsOverrideSchema:e.strictObject({default_markup:e.number().min(-100).optional().meta({description:"Default percentage markup for customers on this plan. Use -100 to make usage free."}),provider_markups:t.meta({description:"Per-provider markup percentages for customers on this plan."}),model_markups:r.meta({description:"Per-model markup overrides for customers on this plan."})})}))(n,N7,S7),{isValidCurrencyCode:L7}=(e=>({isValidCurrencyCode:r=>!!r&&e.has(r.toLowerCase())}))(D7),{ApiCreditDimensionSchema:M7}=((e,t,r,i)=>({ApiCreditDimensionSchema:e.union([t.extend({tier_behavior:e.literal("graduated"),tiers:e.array(r).min(1)}).strict().superRefine(i),t.extend({credit_cost:e.number().min(0).meta({description:"Credits consumed per billing-unit group when this dimension matches."})}).strict()])}))(n,$7,B$,W$),{CurrencyCodeSchema:J$}=((e,t)=>({CurrencyCodeSchema:e.string().refine(t,"must be a Stripe-supported currency code").meta({description:"Three-letter Stripe-supported currency code (e.g. 'eur', 'gbp')."})}))(n,L7),{AdditionalCurrencyTierSchema:F7}=((e,t)=>({AdditionalCurrencyTierSchema:e.object({currency:t,amount:e.number().optional().meta({description:"Per-unit amount for this tier in this currency."}),flat_amount:e.number().optional().meta({description:"Flat amount for this tier in this currency, if the tier uses one."})}).refine(i=>i.amount!==void 0||i.flat_amount!==void 0,{message:"Either amount or flat_amount, or both must be defined",path:["amount","flat_amount"]})}))(n,J$),{ApiCreditSchemaItemBaseSchema:Q$}=((e,t,r,i)=>({ApiCreditSchemaItemBaseSchema:e.object({metered_feature_id:e.string().nonempty().meta({description:"ID of the metered feature that draws from this credit system."}),billing_units:e.number().positive().optional().meta({description:"Number of metered-feature units priced together. Defaults to one when omitted."}),dimensions:e.record(t,r).optional().meta({description:"Named rates chosen by event properties. The most specific match sets the rate; with no match the item's own rate applies."}),multipliers:e.record(t,i).optional().meta({description:"Named adjustments chosen by event properties. Every match applies: factors multiply, then adds are summed."})})}))(n,O7,M7,R7),{ApiFlatCreditSchemaItemSchema:z7}=((e,t)=>({ApiFlatCreditSchemaItemSchema:e.extend({credit_cost:t.number().min(0).meta({description:"Credits consumed per billing-unit group."})}).strict()}))(Q$,n),{AdditionalCurrencyPriceSchema:U7}=((e,t)=>({AdditionalCurrencyPriceSchema:e.object({currency:t,amount:e.number().meta({description:"Price amount in this currency. Set explicitly per currency, not converted from the base amount."})})}))(n,J$),{AdditionalCurrencyTierArraySchema:V7}=((e,t,r,i)=>({AdditionalCurrencyTierArraySchema:e.array(t).refine(r,{message:i})}))(n,F7,z$,U$),{ApiGraduatedCreditSchemaItemSchema:B7}=((e,t,r,i)=>({ApiGraduatedCreditSchemaItemSchema:e.extend({tier_behavior:t.literal("graduated"),tiers:t.array(r).min(1)}).strict().superRefine(i)}))(Q$,n,B$,W$),{AdditionalCurrencyPriceArraySchema:Y$}=((e,t,r,i)=>({AdditionalCurrencyPriceArraySchema:e.array(t).refine(r,{message:i})}))(n,U7,z$,U$),{ApiUsageTierWithCurrenciesSchema:q7}=((e,t,r)=>({ApiUsageTierWithCurrenciesSchema:e.object({to:e.number().or(e.literal(t)),amount:e.number().optional(),flat_amount:e.number().optional(),additional_currencies:r.optional().meta({description:"Per-currency amounts for this tier. Tier boundaries ('to') are shared across all currencies."})}).refine(o=>o.amount!==void 0||o.flat_amount!==void 0,{message:"Either amount or flat_amount, or both must be defined",path:["amount","flat_amount"]}).transform(o=>({...o,amount:o.amount??0})).pipe(e.object({to:e.number().or(e.literal(t)),amount:e.number(),flat_amount:e.number().optional(),additional_currencies:r.optional()}))}))(n,f7,V7),{ApiCreditSchemaItemSchema:Z7}=((e,t,r)=>({ApiCreditSchemaItemSchema:e.union([t,r])}))(n,B7,z7),{BasePriceParamsSchema:H7}=((e,t,r,i)=>({BasePriceParamsSchema:e.omit({display:!0}).extend({interval_count:t({schema:r.number().optional(),defaultValue:1,description:"Number of intervals per billing cycle. Defaults to 1."}),additional_currencies:i.optional().meta({description:"Base price amounts in additional currencies. The base 'amount' is in the org's default currency."}),base_currency:r.string().optional().meta({internal:!0}),entitlement_id:r.string().optional().meta({internal:!0}),price_id:r.string().optional().meta({internal:!0}),stripe_price_id:r.string().optional().meta({description:"Stripe price id this base price is billed under. Set by sync flows to capture the actual Stripe price when it differs from the catalog default.",internal:!0})}).meta({title:"BasePrice",description:"Base price configuration for a plan."})}))(E7,l7,n,Y$),{PlanItemPriceParamsSchema:G7}=((e,t,r,i,o,a,s)=>({PlanItemPriceParamsSchema:e.object({stripe_price_id:e.string().nullish().transform(u=>u??void 0).meta({description:"Stripe price id this feature price is billed under. Set by sync flows to preserve an existing Stripe price.",internal:!0}).optional(),amount:e.number().optional().meta({description:"Price per billing_units after included usage. Either 'amount' or 'tiers' is required."}),additional_currencies:t.optional().meta({description:"Amounts in additional currencies for this flat price. The base 'amount' is in the org's default currency. Only valid with 'amount', not 'tiers'."}),tiers:e.array(r).optional().meta({description:"Tiered pricing. Either 'amount' or 'tiers' is required."}),tier_behavior:e.enum(i).optional(),interval:e.enum(o).meta({description:"Billing interval. For consumable features, should match reset.interval."}),interval_count:e.number().default(1).optional().meta({description:"Number of intervals per billing cycle. Defaults to 1."}),billing_units:e.number().default(1).optional().meta({description:"Units per price increment. Usage is rounded UP when billed (e.g. billing_units=100 means 101 rounds to 200)."}),billing_method:e.enum(a).meta({description:"'prepaid' for upfront payment (seats), 'usage_based' for pay-as-you-go."}),allocated_billing:s,max_purchase:e.number().nullish().meta({description:"Max units purchasable beyond included. E.g. included=100, max_purchase=300 allows 400 total. Null for no limit."})})}))(n,Y$,q7,h7,M$,V$,P7),{ApiFeatureOverrideSchema:K7}=((e,t,r)=>({ApiFeatureOverrideSchema:e.strictObject({credit_schema:e.array(t).optional().meta({description:"For credit system features: replaces the feature's credit_schema entirely for customers on this plan."}),markups:r.optional().meta({description:"For AI credit system features: replaces the feature's markup chain entirely for customers on this plan. An unset level means no markup at that level rather than inheriting the feature's."})})}))(n,Z7,j7),{InvoiceBasePriceParamsSchema:X$}=((e,t)=>({InvoiceBasePriceParamsSchema:e.pick({amount:!0,interval:!0,interval_count:!0}).extend({processors:t.optional().meta({description:"Bill this line under an existing Stripe price instead of an inline one."})}).strict()}))(H7,H$),{InvoiceItemPriceParamsSchema:W7}=((e,t)=>({InvoiceItemPriceParamsSchema:e.pick({amount:!0,tiers:!0,tier_behavior:!0,interval:!0,interval_count:!0,billing_units:!0,billing_method:!0}).extend({processors:t.optional().meta({description:"Bill this line under an existing Stripe price instead of an inline one."})}).strict()}))(G7,H$),{InvoiceLicenseQuantitySchema:J7}=((e,t,r)=>({InvoiceLicenseQuantitySchema:e.object({license_plan_id:e.string().meta({description:"The license plan linked to the parent plan."}),quantity:e.number().int().nonnegative().meta({description:"Billable seats, exclusive of any included seats."}),customize:e.object({price:t.nullable().optional()}).strict().optional().meta({description:"Override the license's per-seat price on this invoice."}),feature_quantities:e.array(r).optional().meta({description:"Feature charges priced through the license plan."}),prorate:e.boolean().optional().meta({description:"Whether to prorate seat charges against period_start / period_end. Defaults to true."})}).strict()}))(n,X$,K$),{InvoiceCustomizeItemSchema:Q7}=((e,t,r)=>({InvoiceCustomizeItemSchema:e.object({feature_id:e.string().meta({description:"The feature whose pricing is overridden on this invoice."}),price:t.optional().meta({description:"Pricing to use for this feature on this invoice."}),feature_override:r.pick({credit_schema:!0}).strict().optional().meta({description:"For credit-system features: a credit rate card to use when converting `usage` on this invoice."})}).strict()}))(n,W7,K7),{InvoiceCustomizeSchema:Y7}=((e,t,r)=>({InvoiceCustomizeSchema:e.object({price:t.nullable().optional().meta({description:"Override the plan's base price for this invoice. Pass null or an amount of 0 to omit the base price line."}),items:e.array(r).optional().meta({description:"Override feature pricing for this invoice. Only pricing fields are accepted; grants, resets and rollovers are not part of an invoice."})}).strict().meta({title:"InvoiceCustomize",description:"Pricing overrides applied to this invoice only. The catalog and the customer's plan are not changed."})}))(n,X$,Q7),{InvoicePlanParamsSchema:X7}=((e,t,r,i,o)=>({InvoicePlanParamsSchema:e.object({plan_id:e.string().meta({description:"The catalog plan (or variant) whose pricing to use."}),version:e.number().optional().meta({description:"Plan version. Defaults to the active version."}),customize:t.optional(),feature_quantities:e.array(r).optional(),license_quantities:e.array(i).optional(),discounts:e.array(o).optional().meta({description:"Discounts applied only to this plan's lines."}),prorate:e.boolean().optional().meta({description:"Whether to prorate the base price against period_start / period_end. Defaults to true."})}).strict()}))(n,Y7,K$,J7,Z$),{CreateInvoiceParamsSchema:ec}=((e,t,r,i,o)=>({CreateInvoiceParamsSchema:e.object({customer_id:e.string().meta({description:"The customer to invoice."}),plans:e.array(t).optional(),custom_line_items:e.array(r).optional().meta({description:"Charges that are not tied to any plan or feature."}),discounts:e.array(i).optional().meta({description:"Discounts applied to the whole invoice."}),invoice_template_id:e.string().optional().meta({description:"ID of an invoice template whose footer, memo and default payment terms are applied."}),net_terms_days:e.number().int().positive().optional().meta({description:"Days until the invoice is due. Defaults to the template's terms, then the org default."}),tax_rate_id:e.string().optional().meta({description:"Stripe tax rate ID (txr_...) applied to every line."}),period_start:o.optional().meta({description:"Start of the period being invoiced, in milliseconds. Prorated lines are charged for period_start \u2192 period_end against one price interval starting at period_start."}),period_end:o.optional().meta({description:"End of the period being invoiced, in milliseconds."}),preview:e.boolean().optional().meta({description:"If true, returns the calculated lines and totals without creating an invoice."})}).strict().refine(s=>s.period_start===void 0==(s.period_end===void 0),{message:"period_start and period_end must be provided together."}).refine(s=>s.period_start===void 0||s.period_end===void 0||s.period_end>s.period_start,{message:"period_end must be after period_start."})}))(n,X7,w7,Z$,_7)});var nj,ha,hn,eZ,rj,tZ,nZ,ij,ga,mo,Vf,oj,Uf,ej,tj,aj,Kw,rZ,iZ,oZ,sj,Ww,Ol,fa,cj,uj,lj,Bf,Goe,Koe,Tl=x(()=>{"use strict";Rs();Zw();Bw();ee();oo();qt();gw();Mm();zf();nj=n.strictObject({requestId:n.uuid(),predecessorOperationId:n.uuid().optional(),invoiceMode:ma.optional(),entityId:n.uuid().optional(),billingSubscriptionId:n.uuid().optional(),newBillingSubscription:n.literal(!0).optional(),offerId:n.uuid().optional(),nativeOffer:Xs.optional(),plans:n.array(n.strictObject({productVersionId:n.uuid(),seatQuantities:n.record(ra,n.number().int().min(0).max(1e4)).optional(),featureQuantities:n.record(n.uuid(),n.number().int().min(0).max(1e4)).refine(e=>Object.keys(e).length<=100,"At most 100 feature quantities").optional()})).min(1).max(20).refine(e=>new Set(e.map(t=>t.productVersionId)).size===e.length,"Plan versions must be unique"),provider:n.enum(["stripe","apple","google"]),currency:Oe}).refine(e=>!e.offerId||!e.billingSubscriptionId&&(e.provider==="stripe"||e.nativeOffer!==void 0),"Held offers apply to new purchases; existing subscriptions use billing coupons").refine(e=>!e.nativeOffer||e.provider!=="stripe"&&e.plans.length===1,"A store selection applies to exactly one native SKU").refine(e=>!e.newBillingSubscription||e.provider==="stripe"&&!e.billingSubscriptionId,"A new billing subscription requires Stripe and no existing subscription target").refine(e=>!e.invoiceMode?.enabled||e.provider==="stripe"&&!e.entityId,"Invoice mode requires a Stripe subscription without an Entity target"),ha=n.strictObject({operationId:n.uuid()}),hn=n.number().int().min(0).max(1e8),eZ=n.strictObject({lineId:n.uuid(),productVersionId:n.uuid(),productName:n.string().min(1).max(80),interval:n.enum(["free","week","month","year","one_time"]),intervalCount:n.number().int().min(1).max(156).optional(),baseAmountMinor:hn,seats:n.array(n.strictObject({key:ra,quantity:n.number().int().min(0).max(1e4),includedQuantity:n.number().int().min(0).max(1e4),maximumQuantity:n.number().int().min(0).max(1e4),unitAmountMinor:hn})).max(20),prepaid:n.array(WD).max(100).optional(),catalogAmountMinor:hn,trial:n.strictObject({days:n.number().int().min(1).max(730),cardRequired:n.boolean()}).nullable()}).refine(e=>new Set(e.seats.map(t=>t.key)).size===e.seats.length&&e.seats.every(t=>t.quantity>=t.includedQuantity&&t.quantity<=t.maximumQuantity)&&e.baseAmountMinor+e.seats.reduce((t,r)=>t+r.unitAmountMinor*(r.quantity-r.includedQuantity),0)+(e.prepaid??[]).reduce((t,r)=>t+Ts({quantity:r.quantity,unitAmountMinor:r.unitAmountMinor,...r.pricing===void 0?{}:{pricing:r.pricing}}),0)===e.catalogAmountMinor,"Quote must retain its published base price and component quantities"),rj=n.string().regex(/^[A-Za-z0-9_-]{1,200}$/),tZ=n.strictObject({id:rj,name:n.string().min(1).max(40),percent_off:n.number().gt(0).max(100).optional(),amount_off:n.number().int().positive().optional(),currency:n.string().regex(/^[a-z]{3}$/).optional(),duration:n.enum(["once","repeating","forever"]),duration_in_months:n.number().int().min(1).max(36).optional()}).refine(e=>e.percent_off===void 0!=(e.amount_off===void 0)&&e.amount_off===void 0==(e.currency===void 0)&&e.duration==="repeating"==(e.duration_in_months!==void 0),"A Stripe coupon has one percentage or amount and months only when repeating"),nZ=n.strictObject({subscriptionId:n.string().regex(/^sub_[A-Za-z0-9]+$/),customerId:n.string().regex(/^cus_[A-Za-z0-9]+$/),sourceItems:n.array(n.strictObject({id:n.string(),price_id:n.string(),quantity:n.number().int().nonnegative(),discounts:n.array(n.strictObject({id:n.string(),coupon:n.string(),start:n.number(),end:n.number().nullable()})).optional()})).min(1).max(100),prorationDate:n.number().int().nonnegative(),amountMinor:n.number().int().positive(),periodStartMs:n.number(),periodEndMs:n.number()}),ij=n.strictObject({invoiceMode:ma.optional(),append:nZ.optional(),provider:n.literal("stripe"),executor:n.enum(["indiana","merchant"]),accountId:n.string().regex(/^acct_[A-Za-z0-9]+$/),mode:n.enum(["payment","subscription"]),lineItems:n.array(n.strictObject({price:n.string().regex(/^price_[A-Za-z0-9]+$/).nullable(),quantity:n.number().int().min(1).max(1e4),priceId:n.uuid(),productName:n.string().min(1).max(80),amountMinor:n.number().int().min(0).max(1e8),currency:n.string().regex(/^[a-z]{3}$/),interval:n.enum(["week","month","year","one_off"]),intervalCount:n.number().int().min(1).max(52),slot:n.enum(["stripe_price_id","stripe_empty_price_id"]),tiers:n.strictObject({mode:n.enum(["graduated","volume"]),tiers:n.array(n.strictObject({upTo:n.number().int().min(1).max(1e6).nullable(),unitAmountMinor:n.number().int().min(0).max(1e8),flatAmountMinor:n.number().int().min(0).max(1e8).optional()})).min(2).max(12)}).nullable()})).min(1).max(100),discounts:n.array(n.strictObject({coupon:rj,terms:tZ})).max(1),trialPeriodDays:n.number().int().min(1).max(730).nullable(),metadata:n.strictObject({grooveCheckoutId:n.uuid(),grooveCustomerId:n.uuid()}),expiresAt:n.iso.datetime({offset:!0})}),ga=n.strictObject({operationId:n.uuid(),entityId:n.uuid().nullable(),billingSubscriptionId:n.uuid().nullable(),discount:n.strictObject({offerId:n.uuid(),couponId:n.uuid(),discount:io,duration:lr,amountMinor:hn,allocations:n.array(n.strictObject({productVersionId:n.uuid(),amountMinor:hn})).min(1).max(20),expiresAt:n.iso.datetime({offset:!0})}).nullable(),charge:n.strictObject({effectiveAt:n.iso.datetime({offset:!0}),periodEndsAt:n.iso.datetime({offset:!0}),debitMinor:hn,discountMinor:hn,taxMinor:hn,totalMinor:hn}).nullable(),expiresAt:n.iso.datetime({offset:!0}),provider:n.enum(["stripe","apple","google"]),nativeOffer:Xs.optional(),currency:Oe,lines:n.array(eZ).min(1).max(20),catalogAmountMinor:hn,automaticTax:n.boolean(),execution:ij.nullable()}).refine(e=>e.provider==="stripe"?e.lines[0]?.trial?.cardRequired===!1&&!e.execution?.invoiceMode?.enabled?e.execution===null&&e.discount===null:e.execution!==null&&e.execution.metadata.grooveCheckoutId===e.operationId&&Date.parse(e.execution.expiresAt)<=Date.parse(e.expiresAt)&&e.execution.mode===(e.lines.some(t=>!["one_time","free"].includes(t.interval))?"subscription":"payment")&&e.execution.trialPeriodDays===(e.lines[0]?.trial?.days??null)&&(e.execution.executor==="indiana"||e.execution.lineItems.every(t=>t.price!==null))&&e.execution.discounts.every(t=>t.coupon===t.terms.id)&&e.execution.discounts.length===(e.discount?1:0)&&e.execution.discounts.every(t=>e.discount!==null&&(t.coupon===e.discount.couponId||e.discount.discount.type==="amount"&&t.coupon===`${e.discount.couponId}_credit_${e.discount.offerId}_${t.terms.amount_off}`&&t.terms.amount_off===e.discount.discount.amountOffCents&&t.terms.currency?.toUpperCase()===e.currency&&t.terms.duration==="once")):e.execution===null,"Stripe execution must carry the quote identity, expiry, mode, trial and held coupon").refine(e=>(!e.discount||!e.billingSubscriptionId&&(e.provider==="stripe"||e.discount.duration.type==="once")&&e.discount.amountMinor<=e.catalogAmountMinor&&e.discount.allocations.length===e.lines.length&&e.discount.allocations.every((t,r)=>{let i=e.lines[r];return i!==void 0&&t.productVersionId===i.productVersionId&&t.amountMinor<=i.catalogAmountMinor})&&e.discount.allocations.reduce((t,r)=>t+r.amountMinor,0)===e.discount.amountMinor)&&(e.provider==="stripe"?e.nativeOffer===void 0:e.nativeOffer!==void 0&&e.lines.length===1&&e.nativeOffer.discountMinor<=e.catalogAmountMinor&&e.nativeOffer.trialDays===(e.lines[0]?.trial?.days??null)&&(!e.discount||e.nativeOffer.discountMinor===e.discount.amountMinor))&&(!e.charge||e.billingSubscriptionId!==null&&e.charge.totalMinor===e.charge.debitMinor-e.charge.discountMinor+e.charge.taxMinor&&e.charge.discountMinor<=e.charge.debitMinor&&Date.parse(e.charge.periodEndsAt)>Date.parse(e.charge.effectiveAt))&&new Set(e.lines.map(t=>t.lineId)).size===e.lines.length&&e.lines.reduce((t,r)=>t+r.catalogAmountMinor,0)===e.catalogAmountMinor,"Quote lines must conserve the catalog amount"),mo=n.strictObject({operationId:n.uuid(),orderId:n.uuid(),append:n.boolean().optional(),invoiceMode:n.boolean().optional(),status:n.enum(["pending","complete","cancelled","failed"]),executor:n.enum(["indiana","merchant"]),checkoutUrl:n.url().refine(e=>new URL(e).protocol==="https:").nullable(),execution:ij.nullable(),currency:Oe,catalogAmountMinor:hn,taxMinor:hn,totalMinor:n.number().int().min(0).max(2e8).nullable(),quoteFinalized:n.boolean(),nativePurchase:qw.nullable()}).refine(e=>(e.checkoutUrl===null||e.executor==="indiana")&&(e.execution===null||e.executor==="merchant"),"Only Indiana-executed purchases carry a Checkout URL and only record-only purchases carry execution instructions"),Vf=n.strictObject({enabled:n.literal(!0),featureIds:n.array(n.uuid()).min(1).max(100).refine(e=>new Set(e).size===e.length,"Feature IDs must be unique").optional()}),oj=n.strictObject({requestId:n.uuid(),invoiceMode:ma.optional(),membershipId:n.uuid(),carryOverBalances:Vf.optional(),carryOverUsages:Vf.optional(),membershipIds:n.array(n.uuid()).min(1).max(20).optional(),prorationBehavior:n.enum(["prorate_immediately","none","bill_difference"]).optional(),timing:n.enum(["immediate","renewal","store"]),change:n.discriminatedUnion("type",[n.strictObject({type:n.literal("plan"),productVersionId:n.uuid()}),n.strictObject({type:n.literal("seats"),licenseKey:ra,quantity:n.number().int().min(0).max(1e4)}),n.strictObject({type:n.literal("quantity"),internal_feature_id:n.uuid(),quantity:n.number().int().min(0).max(1e4)}),n.strictObject({type:n.literal("cancel")}),n.strictObject({type:n.literal("uncancel")}),n.strictObject({type:n.literal("billing_cycle"),billingCycleAnchor:n.union([n.literal("now"),n.number().int().positive().max(0xe677d21fdbff)])})])}).refine(e=>e.timing!=="store"||e.change.type==="plan","Store timing applies to a native plan replacement").refine(e=>e.change.type!=="billing_cycle"||e.timing===(e.change.billingCycleAnchor==="now"?"immediate":"renewal"),"Use immediate for now and renewal for a future millisecond anchor").refine(e=>!e.membershipIds||["cancel","uncancel"].includes(e.change.type)&&e.membershipIds.includes(e.membershipId)&&new Set(e.membershipIds).size===e.membershipIds.length,"Grouped actions require unique cancel/uncancel targets including the primary membership").refine(e=>!e.carryOverBalances&&!e.carryOverUsages||e.change.type==="plan"&&e.timing==="immediate","Carry applies only to immediate upgrades").refine(e=>!e.prorationBehavior||e.change.type==="quantity","prorationBehavior applies to prepaid quantity changes"),Uf=n.string().regex(/^price_[A-Za-z0-9]+$/),ej=n.strictObject({grooveUpdateId:n.uuid(),grooveCustomerId:n.uuid()}),tj=n.strictObject({price:Uf.nullable(),priceId:n.uuid().optional(),quantity:n.number().int().min(0).max(1e4)}),aj=n.strictObject({provider:n.literal("stripe"),invoiceMode:ma.optional(),executor:n.enum(["indiana","merchant"]),accountId:n.string().regex(/^acct_[A-Za-z0-9]+$/),subscriptionId:n.string().regex(/^sub_[A-Za-z0-9]+$/),action:n.enum(["update","cancel","schedule","release"]),update:n.strictObject({items:n.array(tj).max(20),remove:n.array(Uf).max(20),restoreItems:n.array(n.strictObject({price:Uf,quantity:n.number().int().min(0).max(1e4)})).min(1).max(20).optional(),prorationBehavior:n.enum(["always_invoice","create_prorations","none"]).optional(),prorationDate:n.number().int().positive().optional(),paymentBehavior:n.literal("error_if_incomplete").optional(),cancelAtPeriodEnd:n.boolean().optional(),clearCancelAt:n.literal(!0).optional(),billingCycleAnchorNow:n.literal(!0).optional(),metadata:ej}).nullable(),cancel:n.strictObject({prorate:n.literal(!1),invoiceNow:n.literal(!1)}).nullable(),schedule:n.strictObject({currentItems:n.array(n.strictObject({price:Uf,quantity:n.number().int().min(0).max(1e4)})).max(20),nextItems:n.array(tj).min(1).max(20),switchAt:n.number().int().positive(),interval:n.enum(["week","month","year"]),intervalCount:n.number().int().min(1).max(52),resetBillingCycleAnchor:n.literal(!0).optional(),metadata:ej}).nullable(),release:n.strictObject({schedule:n.string().regex(/^sub_sched_[A-Za-z0-9]+$/)}).nullable(),expiresAt:n.iso.datetime({offset:!0})}).refine(e=>["update","cancel","schedule","release"].every(t=>e[t]!==null==(e.action===t))&&(e.executor==="indiana"||[...e.update?.items??[],...e.schedule?.nextItems??[]].every(t=>t.price!==null)),"Stripe update execution carries exactly its action, with bound Prices for the merchant"),Kw=n.strictObject({carryOverBalances:Vf.optional(),carryOverUsages:Vf.optional(),operationId:n.uuid(),membershipId:n.uuid(),productVersionId:n.uuid(),timing:n.enum(["immediate","renewal"]),effectiveAt:n.iso.datetime({offset:!0}),expiresAt:n.iso.datetime({offset:!0}),currency:Oe,creditMinor:hn,debitMinor:hn,discountMinor:hn,taxMinor:hn,totalMinor:hn,retainedProductVersionIds:n.array(n.uuid()).max(19),execution:aj}),rZ=n.strictObject({operationId:n.uuid(),invoiceMode:n.boolean().optional(),membershipId:n.uuid(),productVersionId:n.uuid(),status:n.enum(["prepared","quoted","confirmed","pending","scheduled","effective","cancelled","failed"]),timing:n.enum(["immediate","renewal"]),effectiveAt:n.iso.datetime({offset:!0}),checkoutUrl:n.url().refine(e=>new URL(e).protocol==="https:").nullable(),executor:n.enum(["indiana","merchant"]),execution:aj.nullable()}).refine(e=>e.execution===null||e.executor==="merchant","Only record-only changes carry execution instructions"),iZ=n.strictObject({operationId:n.uuid(),membershipId:n.uuid(),productVersionId:n.uuid(),timing:n.literal("store"),effectiveAt:n.null(),expiresAt:n.iso.datetime({offset:!0}),currency:Oe,creditMinor:n.null(),debitMinor:n.null(),discountMinor:n.null(),taxMinor:n.null(),totalMinor:n.null(),retainedProductVersionIds:n.array(n.uuid()).max(19),store:n.strictObject({provider:n.enum(["apple","google"]),productId:n.string().min(1).max(255),catalogAmountMinor:hn,policy:n.enum(["apple_store","google_full_price"])})}),oZ=n.strictObject({operationId:n.uuid(),membershipId:n.uuid(),productVersionId:n.uuid(),status:n.enum(["prepared","pending","effective","cancelled","failed"]),timing:n.literal("store"),effectiveAt:n.iso.datetime({offset:!0}).nullable(),checkoutUrl:n.null(),nativePurchase:qw.nullable()}),sj=n.union([Kw,iZ]),Ww=n.union([rZ,oZ]),Ol=n.number().int().positive().max(2e8),fa=n.number().int().min(0).max(2e8),cj=n.strictObject({requestId:n.uuid(),invoiceId:n.uuid(),mode:n.enum(["full","partial"]),amountMinor:Ol.optional(),entitlementAction:n.enum(["retain","revoke"])}).refine(e=>e.mode==="partial"==(e.amountMinor!==void 0),"A partial refund states amountMinor; a full refund refunds the remaining amount"),uj=n.strictObject({provider:n.literal("stripe"),executor:n.enum(["indiana","merchant"]),accountId:n.string().regex(/^acct_[A-Za-z0-9]+$/),invoice:n.string().regex(/^in_[A-Za-z0-9]+$/),amountMinor:Ol,currency:n.string().regex(/^[a-z]{3}$/),metadata:n.strictObject({indianaRefundId:n.uuid()}),idempotencyKey:n.string().regex(/^indiana-refund-[0-9a-f-]{36}$/),cancelSubscriptions:n.array(n.string().regex(/^sub_[A-Za-z0-9]+$/)).max(20)}),lj=n.strictObject({operationId:n.uuid(),invoiceId:n.uuid(),providerInvoiceId:n.string().regex(/^in_[A-Za-z0-9]+$/),currency:Oe,paidMinor:fa,refundedMinor:fa,pendingMinor:fa,amountMinor:Ol,mode:n.enum(["full","partial"]),entitlementAction:n.enum(["retain","revoke"]),revokes:n.strictObject({customerProductIds:n.array(n.uuid()).max(100),subscriptionIds:n.array(n.string().regex(/^sub_[A-Za-z0-9]+$/)).max(20)}),execution:uj,expiresAt:n.iso.datetime({offset:!0})}).refine(e=>e.amountMinor<=e.paidMinor-e.refundedMinor-e.pendingMinor&&e.execution.amountMinor===e.amountMinor&&e.execution.invoice===e.providerInvoiceId&&e.execution.metadata.indianaRefundId===e.operationId&&e.execution.currency===e.currency.toLowerCase()&&(e.entitlementAction==="revoke"||e.revokes.customerProductIds.length===0&&e.revokes.subscriptionIds.length===0),"Refund quote must stay within the refundable amount and match its execution"),Bf=n.strictObject({operationId:n.uuid(),invoiceId:n.uuid(),providerInvoiceId:n.string().regex(/^in_[A-Za-z0-9]+$/),status:n.enum(["quoted","pending","succeeded","failed","expired"]),executor:n.enum(["indiana","merchant"]),currency:Oe,amountMinor:Ol,mode:n.enum(["full","partial"]),entitlementAction:n.enum(["retain","revoke"]),refundId:n.string().regex(/^(re|pyr)_[A-Za-z0-9]+$/).nullable(),execution:uj.nullable(),failureReason:n.string().min(1).max(200).nullable(),createdAt:n.iso.datetime({offset:!0}),completedAt:n.iso.datetime({offset:!0}).nullable()}).refine(e=>(e.execution===null||e.executor==="merchant"&&e.status==="quoted")&&(e.status!=="succeeded"||e.refundId!==null),"Only quoted record-only refunds carry instructions; a succeeded refund names its Stripe refund"),Goe=n.strictObject({invoiceId:n.uuid(),currency:Oe,paidMinor:fa,refundedMinor:fa,pendingMinor:fa,refundableMinor:fa,executor:n.enum(["indiana","merchant"]).nullable(),canRefund:n.boolean(),operations:n.array(Bf).max(50)}).refine(e=>e.operations.every(t=>t.invoiceId===e.invoiceId),"Refund operations belong to the invoice"),Koe=n.strictObject({requestId:n.uuid(),mode:n.enum(["full","partial"]),amountMinor:Ol.optional(),entitlementAction:n.enum(["retain","revoke"])}).refine(e=>e.mode==="partial"==(e.amountMinor!==void 0),"A partial refund states amountMinor; a full refund refunds the remaining amount")});var dj,qf,aZ,Rl,Jw=x(()=>{"use strict";ee();Tl();dj=n.strictObject({requestId:n.uuid(),targets:n.array(n.strictObject({membershipId:n.uuid(),action:n.enum(["cancel","uncancel"]),timing:n.enum(["immediate","renewal"])}).refine(e=>e.action!=="uncancel"||e.timing==="immediate","Restoration is immediate")).min(1).max(100)}).refine(e=>new Set(e.targets.map(t=>t.membershipId)).size===e.targets.length,"Duplicate batch target"),qf=n.strictObject({batchId:n.uuid()}),aZ=n.strictObject({operationId:n.uuid(),membershipIds:n.array(n.uuid()).min(1).max(20),provider:n.enum(["stripe","apple","google"]),action:n.enum(["cancel","uncancel"]),timing:n.enum(["immediate","renewal"]),status:n.enum(["prepared","confirmed","pending","scheduled","effective","cancelled","failed","store_action_required"]),quote:Kw.nullable(),managementUrl:n.url().nullable(),failureCode:n.enum(["provider_unavailable","invalid_evidence","pending_payment"]).nullable()}),Rl=n.strictObject({batchId:n.uuid(),ready:n.boolean(),status:n.enum(["prepared","cancelled","expired","pending","partial","effective","action_required"]),createdAt:n.iso.datetime({offset:!0}),acceptedAt:n.iso.datetime({offset:!0}).nullable(),groups:n.array(aZ).min(1).max(100)})});var sZ,Qw,Zf,pj,mj,cZ,Yw,eae,Xw=x(()=>{"use strict";ee();sZ=n.string().trim().min(1).max(240),Qw={requestId:n.uuid(),reason:sZ},Zf=n.discriminatedUnion("action",[n.strictObject({...Qw,action:n.literal("start"),productVersionId:n.uuid(),entityId:n.uuid().optional(),days:n.number().int().min(1).max(730).optional()}),n.strictObject({...Qw,action:n.literal("extend"),membershipId:n.uuid(),days:n.number().int().min(1).max(730)}),n.strictObject({...Qw,action:n.literal("end"),membershipId:n.uuid()})]),pj=n.strictObject({operationId:n.uuid()}),mj=n.iso.datetime({offset:!0}),cZ=n.strictObject({provider:n.literal("stripe"),executor:n.enum(["indiana","merchant"]),accountId:n.string().regex(/^acct_[A-Za-z0-9]+$/),subscriptionId:n.string().regex(/^sub_[A-Za-z0-9]+$/),trialEnd:n.union([n.literal("now"),mj]),prorationBehavior:n.literal("none")}),Yw=n.strictObject({operationId:n.uuid(),action:n.enum(["start","extend","end"]),status:n.enum(["pending","effective"]),managedBy:n.enum(["indiana","stripe"]),membershipIds:n.array(n.uuid()).min(1).max(20),endsAt:mj.nullable(),execution:cZ.nullable()}).refine(e=>e.execution!==null==(e.managedBy==="stripe"&&e.status==="pending")&&e.action==="end"==(e.endsAt===null)&&(e.action!=="start"||e.managedBy==="indiana")&&(e.execution===null||e.execution.trialEnd==="now"==(e.action==="end")),"Only a pending Stripe trial change carries execution instructions"),eae=n.strictObject({groupId:n.uuid(),productVersionId:n.uuid(),enabled:n.boolean()})});var fj,hj,uZ,e_,t_=x(()=>{"use strict";ee();qt();fj=n.strictObject({requestId:n.uuid(),currency:Oe,makeDefault:n.boolean()}),hj=n.strictObject({setupId:n.uuid()}),uZ=n.strictObject({provider:n.literal("stripe"),executor:n.literal("merchant"),accountId:n.string().regex(/^acct_[A-Za-z0-9]+$/),mode:n.literal("setup"),currency:n.string().regex(/^[a-z]{3}$/),customer:n.string().regex(/^cus_[A-Za-z0-9]+$/).nullable(),clientReferenceId:n.uuid(),metadata:n.strictObject({grooveProjectId:n.uuid(),grooveEnvironmentId:n.uuid(),grooveCustomerId:n.uuid(),groovePaymentSetupId:n.uuid()}),setDefaultPaymentMethod:n.boolean(),expiresAt:n.iso.datetime({offset:!0})}),e_=n.strictObject({id:n.uuid(),provider:n.literal("stripe"),status:n.enum(["prepared","complete","expired"]),currency:Oe,makeDefault:n.boolean(),url:n.url().nullable(),createdAt:n.iso.datetime({offset:!0}),expiresAt:n.iso.datetime({offset:!0}),completedAt:n.iso.datetime({offset:!0}).nullable(),execution:uZ.nullable()})});var gj,yj,bj,n_=x(()=>{"use strict";ee();gj=n.union([n.string(),n.number(),n.boolean(),n.null()]),yj=n.strictObject({customerId:n.uuid()}),bj=n.strictObject({customerId:n.uuid(),provider:n.literal("stripe"),checkedAt:n.iso.datetime({offset:!0}),status:n.enum(["consistent","drifted","incomplete"]),checkedSubscriptions:n.number().int().nonnegative(),differences:n.array(n.strictObject({subscriptionId:n.string().startsWith("sub_"),itemId:n.string().nullable(),field:n.enum(["subscription","status","currency","cancelAtPeriodEnd","item","price","product","quantity","periodStart","periodEnd","trialEnd","evidence"]),expected:gj,actual:gj})).max(1e4)})});var Hf,Gf,Kf,r_,lZ,dZ,pZ,Aj,xj,Sj,vj,wj,_j,i_=x(()=>{"use strict";ee();qt();Hf=n.iso.datetime({offset:!0}),Gf=n.strictObject({createdAt:Hf,id:n.uuid()}),Kf=n.strictObject({customerId:n.uuid().optional(),entityId:n.uuid().optional(),productId:n.string().min(1).max(256).optional(),provider:n.enum(["stripe","apple","google","free"]).optional(),status:n.enum(["trial","active","past_due","ended","refunded"]).optional(),cursor:Gf.optional(),limit:n.number().int().min(1).max(100).optional()}),r_={id:n.uuid(),customerId:n.uuid(),entityId:n.uuid().nullable(),productId:n.string().min(1).max(256),productVersionId:n.uuid(),name:n.string().min(1).max(120),provider:n.enum(["stripe","apple","google","free"]),createdAt:Hf},lZ=n.strictObject({...r_,status:n.enum(["trial","active","past_due","ended"]),cancelAtPeriodEnd:n.boolean(),billingSubscriptionId:n.uuid().nullable()}),dZ=n.strictObject({...r_,status:n.enum(["active","ended","refunded"]),orderId:n.uuid().nullable(),transactionId:n.uuid().nullable(),currency:Oe.nullable(),amountMinor:n.string().regex(/^(0|[1-9]\d{0,17})$/).nullable()}),pZ=n.strictObject({...r_,status:n.enum(["blocked","resolved"]),conflict:n.strictObject({detectedAt:Hf,blockingMembershipIds:n.array(n.uuid()).min(1).max(100),transactionId:n.uuid()}),resolvedAt:Hf.nullable()}),Aj=Kf.extend({status:n.enum(["blocked","resolved"]).optional()}),xj=n.strictObject({customerId:n.uuid(),orderId:n.uuid()}),Sj=n.strictObject({orderId:n.uuid(),status:n.enum(["blocked","resolved"])}),vj=n.strictObject({items:n.array(lZ).max(100),nextCursor:Gf.nullable()}),wj=n.strictObject({items:n.array(dZ).max(100),nextCursor:Gf.nullable()}),_j=n.strictObject({items:n.array(pZ).max(100),nextCursor:Gf.nullable()})});var Ij,kj,o_=x(()=>{"use strict";ee();qt();Ij=n.union([n.strictObject({intent:n.literal("read"),requestId:n.uuid(),purchaseIntentId:n.uuid()}),n.strictObject({requestId:n.uuid(),provider:n.literal("apple"),purchaseIntentId:n.uuid(),productId:n.string().min(1).max(255).optional(),signedTransaction:n.string().min(1).max(131072)}),n.strictObject({requestId:n.uuid(),provider:n.literal("google"),purchaseIntentId:n.uuid(),productId:n.string().min(1).max(255).optional(),purchaseToken:n.string().min(1).max(16384)})]),kj=n.strictObject({requestId:n.uuid(),orderId:n.uuid(),purchaseIntentId:n.uuid(),status:n.enum(["created","pending","trialing","paid","cancelled","failed"]),currency:Oe,refunded:n.boolean(),completion:n.strictObject({transactionIds:n.array(n.string().min(1).max(255)).min(1).max(50).refine(e=>new Set(e).size===e.length),membership:n.boolean()}).nullable()})});function c_(e){return e.items.flatMap(t=>t.type==="product"?[t.productId]:c_(t))}function vZ(e){let t=[];c_(e).length||t.push("Select at least one Product before publishing");function r(i){for(let o of i)o.type==="group"&&(o.items.length||t.push("Every published group requires a Product"),r(o.items))}return r(e.items),t}var s_,mZ,fZ,Nl,hZ,a_,Ej,gZ,yZ,bZ,tc,AZ,Cj,Pj,xZ,fae,hae,Oj,SZ,gae,Wf=x(()=>{"use strict";ee();s_=n.uuid().refine(e=>e===e.toLowerCase(),"Product references require canonical lowercase UUIDs"),mZ=n.record(n.string(),n.json()).refine(e=>Array.from(JSON.stringify(e)).length<=4e3,"Offering metadata exceeds 4000 characters"),fZ=3,Nl=20,hZ=fZ*Nl,a_=n.strictObject({type:n.literal("product"),productId:s_}),Ej={type:n.literal("group"),key:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),name:n.string().trim().min(1).max(80)},gZ=n.discriminatedUnion("type",[a_,n.strictObject({...Ej,items:n.array(a_).max(Nl)})]),yZ=n.discriminatedUnion("type",[a_,n.strictObject({...Ej,items:n.array(gZ).max(Nl)})]),bZ=n.array(yZ).max(Nl).superRefine((e,t)=>{let r=new Set,i=new Set,o=0;function a(s){for(let c of s){o++;let u=c.type==="product"?r:i,l=c.type==="product"?c.productId:c.key;u.has(l)&&t.addIssue({code:"custom",message:c.type==="product"?"Duplicate Offering Product reference":"Duplicate Offering group key"}),u.add(l),c.type==="group"&&a(c.items)}}a(e),(r.size>Nl||o>hZ)&&t.addIssue({code:"custom",message:"Offering item limit exceeded"})});tc=n.strictObject({lookupKey:n.string().trim().min(1).max(200),displayName:n.string().trim().min(1).max(1500),items:bZ,metadata:mZ}),AZ=n.strictObject({product:n.record(n.string(),n.json()),prices:n.array(n.record(n.string(),n.json())),entitlements:n.array(n.record(n.string(),n.json())),freeTrials:n.array(n.record(n.string(),n.json())),licenses:n.array(n.record(n.string(),n.json()))}),Cj=tc.extend({id:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),state:n.enum(["active","archived"]),isCurrent:n.boolean(),revision:n.number().int().nonnegative(),publishedVersionId:n.uuid().nullable(),createdAt:n.iso.datetime({offset:!0})}).superRefine((e,t)=>{e.isCurrent&&(e.state!=="active"||!e.publishedVersionId)&&t.addIssue({code:"custom",message:"Current Offering must be active and published"})}),Pj=n.strictObject({id:n.uuid(),offeringId:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),version:n.number().int().positive(),document:tc,productEvidence:n.record(s_,AZ),createdAt:n.iso.datetime({offset:!0})}).superRefine((e,t)=>{let r=c_(e.document);(!r.length||vZ(e.document).length>0||Object.keys(e.productEvidence).length!==r.length||r.some(i=>!Object.hasOwn(e.productEvidence,i)))&&t.addIssue({code:"custom",message:"Published Offering requires evidence for every Product"})}),xZ=n.strictObject({rows:n.array(Cj).max(200),versions:n.array(Pj).max(500)}),fae=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),document:tc}),n.strictObject({action:n.literal("save"),id:n.uuid(),revision:n.number().int().nonnegative(),document:tc}),n.strictObject({action:n.enum(["publish","set_current","archive","restore"]),id:n.uuid(),revision:n.number().int().nonnegative()})]),hae=n.strictObject({record:Cj,version:Pj.nullable()}),Oj=n.discriminatedUnion("type",[n.strictObject({type:n.literal("current")}),n.strictObject({type:n.literal("id"),id:n.uuid()}),n.strictObject({type:n.literal("lookup_key"),lookupKey:n.string().min(1).max(200)}),n.strictObject({type:n.literal("version"),versionId:n.uuid()})]),SZ=n.strictObject({internalId:s_,id:n.string(),name:n.string().nullable(),version:n.number().int().positive(),archived:n.boolean()}),gae=xZ.extend({products:n.array(SZ).max(500),pagination:n.strictObject({rows:n.string().nullable(),versions:n.string().nullable(),products:n.string().nullable()}).optional()})});var Tj,u_=x(()=>{"use strict";ee();Wf();Tj=n.strictObject({id:n.uuid(),offeringId:n.uuid(),version:n.number().int().positive(),document:tc})});function ya(e,t,r){let i=e.type==="fixed"?e.productVersionId:t[e.pickerId];return typeof i!="string"||!Object.values(r.plans).some(o=>o.versionId===i&&o.available)||e.type==="picker"&&(!e.allowedProductVersionIds.includes(i)||!r.pickers[e.pickerId]?.options.includes(i))?null:i}var Jf,Qf=x(()=>{"use strict";ee();vl();Jf=n.strictObject({items:n.array(n.strictObject({productVersionId:n.string().min(1).max(200),label:n.string().trim().max(40)})).max(20).refine(e=>new Set(e.map(t=>t.productVersionId)).size===e.length,"Duplicate Paywall Product"),defaultProductVersionId:n.string().min(1).max(200).nullable(),grouping:Tf.optional()})});var wZ,Yf,Oi,nc=x(()=>{"use strict";ee();wZ=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),Yf=n.discriminatedUnion("type",[n.object({type:n.literal("fixed"),productVersionId:n.string().min(1).max(200)}).strict(),n.object({type:n.literal("picker"),pickerId:wZ,allowedProductVersionIds:n.array(n.string().min(1).max(200)).min(1).max(20)}).strict().refine(e=>new Set(e.allowedProductVersionIds).size===e.allowedProductVersionIds.length,"Product choices must be unique")]),Oi=n.discriminatedUnion("type",[n.object({type:n.literal("modal"),size:n.enum(["sm","md","lg"])}).strict(),n.object({type:n.literal("sheet"),size:n.enum(["sm","md","lg"])}).strict(),n.object({type:n.literal("fullscreen")}).strict(),n.object({type:n.literal("inline")}).strict()])});function kZ(e){let t=e.products.items.map(a=>a.productVersionId),r=Pf(e.screen),i=new Set,o=[];(!t.length||!e.products.defaultProductVersionId||!t.includes(e.products.defaultProductVersionId))&&o.push("products"),e.offeringVersionId||o.push("offering"),e.products.grouping&&(!Rf(e.products.grouping,t)||e.products.grouping.tiers.some(a=>!e.products.grouping.assignments.some(s=>s.tierId===a.id)))&&o.push("grouping");for(let a of Object.values(e.buttons))if(a.type==="checkout"){let s=a.product;if(s.type==="fixed")i.add(s.productVersionId);else{s.allowedProductVersionIds.forEach(l=>i.add(l));let c=!1,u=r[s.pickerId];u&&(c=!0,(s.allowedProductVersionIds.some(l=>!u.ids.includes(l))||u.ids.some(l=>!s.allowedProductVersionIds.includes(l)))&&o.push("picker")),cn(e.screen,l=>{if(l.id!==s.pickerId||l.type!=="plan_picker")return;c=!0,(JSON.stringify(l.planIds)!==JSON.stringify(t)||JSON.stringify(s.allowedProductVersionIds)!==JSON.stringify(t)||l.defaultPlan!==e.products.defaultProductVersionId)&&o.push("picker");let d=l.grouping?{tiers:l.grouping.tiers,assignments:l.grouping.assignments}:void 0;JSON.stringify(d)!==JSON.stringify(e.products.grouping)&&o.push("grouping")}),c||o.push("picker")}}return(!i.size||[...i].some(a=>!t.includes(a)))&&o.push("purchase"),cn(e.screen,a=>{a.type==="stack"&&a.productSlot&&!a.bind?.plan&&o.push(`productBinding:${a.id}`),(a.type==="stack"||a.type==="button")&&a.bind?.plan&&!t.includes(a.bind.plan)&&o.push("binding"),a.type==="plan_picker"&&(!a.planIds?.length||a.planIds.some(s=>!t.includes(s)))&&o.push("binding")}),[...new Set(o)]}function EZ(e){let t=[],r=e.screen.pages.at(-1),i=new Map;for(let c of e.screen.pages)i.set(c.id,[]),lo(c.root,u=>{let l=u.type==="button"?u.action:u.type==="stack"?u.purchaseAction:void 0;if(l){let d=e.screen.actions.find(h=>h.id===l);d?.type==="navigate"&&i.get(c.id).push(d.pageId);let p=e.buttons[l];c.id!==r.id&&p&&p.type!=="close"&&t.push(`purchaseScreen:${u.id}`)}c.id!==r.id&&(u.type==="plan_picker"||u.type==="stack"&&u.productSlot)&&t.push(`packageScreen:${u.id}`)});let o=new Set;function a(c){if(!o.has(c)){o.add(c);for(let u of i.get(c)??[])a(u)}}let s=e.screen.initialPageId??e.screen.pages[0]?.id;s?a(s):t.push("initialPage");for(let c of e.screen.pages)o.has(c.id)||t.push(`unreachableScreen:${c.id}`);return[...new Set(t)]}var l_,_Z,IZ,rc,Nae,Rj,Dae,$ae,jae,Lae,Xf=x(()=>{"use strict";ee();Qf();Of();vl();Ir();Zs();nc();l_=n.discriminatedUnion("type",[n.strictObject({type:n.literal("event"),event:n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/)}),n.strictObject({type:n.literal("open_url"),url:n.url().refine(e=>new URL(e).protocol==="https:")})]),_Z=un,IZ=n.discriminatedUnion("type",[n.object({type:n.literal("checkout"),product:Yf}).strict(),n.object({type:n.literal("close")}).strict(),n.object({type:n.literal("action"),action:l_}).strict()]),rc=n.object({schemaVersion:n.literal(3),kind:n.literal("paywall"),name:n.string().trim().min(1).max(80),presentation:Oi,requirement:co.optional(),products:Jf,offeringVersionId:n.uuid().nullable(),offeringId:n.uuid(),screen:_Z,buttons:n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),IZ)}).strict(),Nae=rc.superRefine((e,t)=>{(e.screen.surface!=="paywall"||e.screen.actions.some(i=>!["event","navigate"].includes(i.type)||i.close))&&t.addIssue({code:"custom",message:"Paywall screen is incomplete"});for(let i of EZ(e))t.addIssue({code:"custom",message:i});for(let i of kZ(e))t.addIssue({code:"custom",message:i});Ci(e.screen).some(i=>!i.complete)&&t.addIssue({code:"custom",message:"Paywall needs complete local content"}),(Object.keys(e.buttons).length!==e.screen.actions.filter(i=>i.type!=="navigate").length||e.screen.actions.some(i=>i.type!=="navigate"&&!Object.hasOwn(e.buttons,i.id)))&&t.addIssue({code:"custom",message:"Paywall buttons require matching node policies"}),Object.values(e.buttons).some(i=>i.type==="checkout")||t.addIssue({code:"custom",message:"A paywall requires a purchase or membership change button"})});Rj=n.object({id:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),revision:n.number().int().nonnegative(),state:n.enum(["active","archived"]),publishedVersionId:n.uuid().nullable(),updatedAt:n.iso.datetime({offset:!0}),draft:rc}).strict(),Dae=n.object({rows:n.array(Rj).max(200),nextCursor:n.uuid().nullable()}).strict(),$ae=Rj.omit({draft:!0}).extend({name:n.string(),productCount:n.number().int().nonnegative()}).strict(),jae=n.discriminatedUnion("action",[n.object({action:n.literal("save"),id:n.uuid().nullable(),revision:n.number().int().nonnegative(),document:rc}).strict(),n.object({action:n.enum(["publish","archive"]),id:n.uuid(),revision:n.number().int().nonnegative()}).strict()]),Lae=n.object({paywalls:n.array(n.object({id:n.uuid(),paywallId:n.uuid(),version:n.number().int().positive(),name:n.string().min(1).max(80),presentation:Oi,buttons:rc.shape.buttons}).strict()).max(500),limited:n.boolean()}).strict()});var fo,CZ,Nj,ic=x(()=>{"use strict";ee();Fs();uo();fo=n.string().regex(/^[a-f0-9]{64}$/),CZ=kf.pick({text:!0,label:!0,alt:!0,html:!0,couponId:!0,countdownAt:!0,missing:!0}),Nj=n.strictObject({couponDigests:n.record(n.uuid(),fo),variables:n.record(Un,n.record(n.uuid(),n.partialRecord(n.enum(["offer.name","offer.description","offer.headline","offer.eligibility","offer.validity","offer.terms","offer.discount","offer.months","offer.ends_at"]),n.string()))),locales:n.record(Un,Hs.extend({nodes:n.record(n.string(),n.strictObject({base:CZ})),plans:n.object({}).strict(),pickers:n.object({}).strict()}).omit({paywall:!0}))})});function Dj(e,t){return t==="Experiment Viewed"?e.experimentViewsEnabled:t==="Feature Evaluated"?e.featureUsageEnabled:e.eventsEnabled}var d_,qae,p_=x(()=>{"use strict";ee();d_=n.strictObject({eventsEnabled:n.boolean(),experimentViewsEnabled:n.boolean(),featureUsageEnabled:n.boolean()}),qae=Object.freeze({eventsEnabled:!0,experimentViewsEnabled:!0,featureUsageEnabled:!0})});var m_,PZ,OZ,TZ,$j,oc,f_,RZ,NZ,Dl,Er,ac=x(()=>{"use strict";ee();cr();Zt();m_=n.tuple([n.number().min(0).max(1),n.number().min(0).max(1)]).refine(([e,t])=>e<=t),PZ=n.strictObject({attribute:n.string().optional(),seed:n.string(),hashVersion:n.literal(2),ranges:n.array(m_).max(100)}),OZ=n.strictObject({id:n.string().min(1).max(255),condition:zn,gate:n.boolean().optional()}),TZ=n.strictObject({key:n.string().optional(),name:n.string().optional(),passthrough:n.boolean().optional()}),$j={condition:zn.optional(),parentConditions:n.array(OZ).max(100).optional(),weights:n.array(n.number().min(0).max(1)).max(20).optional(),coverage:n.number().min(0).max(1).optional(),hashAttribute:n.string().optional(),fallbackAttribute:n.string().optional(),hashVersion:n.literal(2).optional(),disableStickyBucketing:n.boolean().optional(),bucketVersion:n.number().int().nonnegative().optional(),minBucketVersion:n.number().int().nonnegative().optional(),filters:n.array(PZ).max(100).optional(),ranges:n.array(m_).max(20).optional(),meta:n.array(TZ).max(20).optional(),seed:n.string().optional(),name:n.string().optional(),phase:n.string().optional()},oc=n.strictObject({...$j,key:n.string().min(1).max(255),variations:n.tuple([Te,Te]).rest(Te).refine(e=>e.length<=20),urlPatterns:n.array(n.strictObject({include:n.boolean(),type:n.enum(["regex","simple"]),pattern:n.string()})).max(100).optional(),force:n.number().int().nonnegative().optional(),active:n.boolean().optional(),persistQueryString:n.boolean().optional()}),f_=n.strictObject({value:Te,variationId:n.number().int(),key:n.string(),name:n.string().optional(),bucket:n.number().optional(),passthrough:n.boolean().optional(),inExperiment:n.boolean(),hashUsed:n.boolean().optional(),hashAttribute:n.string(),hashValue:n.string(),featureId:n.string().nullable(),stickyBucketUsed:n.boolean().optional()}),RZ=n.strictObject({...$j,id:n.string().max(255).optional(),force:Te.optional(),variations:n.array(Te).min(2).max(20).optional(),key:n.string().optional(),range:m_.optional(),tracks:n.array(n.strictObject({experiment:oc,result:f_})).max(100).optional()}),NZ=n.strictObject({defaultValue:Te.optional(),rules:n.array(RZ).max(500).optional()}),Dl=n.record(n.string(),n.union([n.strictObject({type:n.literal("hashed"),attributeKey:n.string(),values:n.array(n.string().regex(/^[a-f0-9]{64}$/))}),n.strictObject({type:n.literal("list"),attributeKey:n.string(),values:n.array(n.union([n.string(),n.number()]))}),n.strictObject({type:n.literal("condition"),condition:zn})])),Er=n.strictObject({scope:yt,generation:n.string().regex(/^[a-f0-9]{64}$/),evaluatedAt:n.iso.datetime({offset:!0}),expiresAt:n.iso.datetime({offset:!0}).nullable(),features:n.record(n.string(),NZ),savedGroups:Dl,experiments:n.record(n.uuid(),oc)})});var $l,h_,jj,g_,eh,Lj,Mj,th=x(()=>{"use strict";ee();p_();Zt();ac();hf();$l=Er.extend({analyticsConfig:d_,remoteFeatures:n.array(n.string().min(1).max(255)).max(500)}),h_=$l.omit({evaluatedAt:!0,expiresAt:!0}).superRefine((e,t)=>{for(let r of e.remoteFeatures)Object.hasOwn(e.features,r)&&t.addIssue({code:"custom",path:["features",r],message:"Remote Feature definitions cannot be public"});for(let[r,i]of Object.entries(e.savedGroups))i.type==="list"&&t.addIssue({code:"custom",path:["savedGroups",r],message:"Raw Saved Group lists cannot be public"})}),jj=n.strictObject({attributes:tn,features:n.array(n.string().min(1).max(255)).max(500).optional(),customerId:n.uuid().optional()}),g_=n.strictObject({value:Te,source:n.enum(["unknownFeature","defaultValue","force","override","experiment","prerequisite","cyclicPrerequisite"]),on:n.boolean(),off:n.boolean(),ruleId:n.string(),experimentResult:f_.optional()}),eh=n.strictObject({generation:Er.shape.generation,evaluatedAt:Er.shape.evaluatedAt,expiresAt:Er.shape.expiresAt,features:n.record(n.string(),g_),merchandiseContext:n.strictObject({merchandiseId:n.uuid(),merchandise:tn}).optional()}),Lj=n.strictObject({customerId:n.uuid().optional(),events:n.array(n.strictObject({eventUuid:n.uuid(),timestamp:n.iso.datetime({offset:!0}),name:n.string().min(1).max(255),merchandise:bD.optional(),properties:n.record(n.string(),Te).default({}),deviceId:n.string().min(1).max(255).optional(),sessionId:n.string().min(1).max(255).optional()})).min(1).max(100)}),Mj=n.strictObject({inserted:n.number().int().nonnegative(),duplicates:n.number().int().nonnegative(),rejected:n.number().int().nonnegative(),skipped:n.number().int().nonnegative(),analyticsConfig:d_})});function y_(e,t=[]){let r=[];cn(e,o=>{o.hidden&&r.push("Hidden components must not be delivered"),t.includes(o.type)&&r.push(`Node type ${o.type} cannot be delivered`)});let i=new Set(Cl(e).map(o=>o.key));for(let[o,a]of Object.entries(e.strings.locales))for(let s of Object.keys(a))i.has(s)||r.push(`Unused string ${s} must not be delivered (${o})`);return r}function Fj(e){return e.hidden?null:e.type!=="stack"?e:{...e,children:e.children.flatMap(t=>Fj(t)??[])}}function DZ(e){let t=e.pages.map(o=>{let a=Fj(o.root);return a?.type==="stack"?{...o,root:a}:{...o,root:{type:"stack",id:o.root.id,...o.root.name===void 0?{}:{name:o.root.name},direction:"vertical",align:"stretch",justify:"start",children:[]}}}),r=new Set(Cl({pages:t}).map(o=>o.key)),i=Object.fromEntries(Object.entries(e.strings.locales).map(([o,a])=>[o,Object.fromEntries(Object.entries(a).filter(([s])=>r.has(s)))]));return{...e,pages:t,strings:{...e.strings,locales:i}}}function zj(e,t=[]){let r=un.parse(structuredClone(DZ(e))),i=a=>a.type!=="stack"||a.interaction!==void 0||a.children.some(i);for(let a of r.pages)if(!i(a.root))throw new Error(`Page ${a.id} has no visible content`);let o=y_(r,t);if(o.length)throw new Error(o.join("; "));return r}var nh=x(()=>{"use strict";Ir()});var rh,Uj,ih=x(()=>{"use strict";ee();rh=n.strictObject({schemaVersion:n.literal(1),renderKey:n.string().min(1).max(256),routeTemplate:n.string().startsWith("/").max(2048),selectors:n.array(n.string().regex(/^[a-z][a-z0-9-]*\[(?:id|data-testid|data-test|data-qa|data-indiana-id)="(?:[^"\\\x00-\x1f\x7f]|\\["\\])*"\]$/).max(512)),present:n.array(n.number().int().min(0)).min(1),absent:n.array(n.number().int().min(0))}).superRefine((e,t)=>{let r=[...e.present,...e.absent];(new Set(e.selectors).size!==e.selectors.length||new Set(r).size!==r.length||r.length!==e.selectors.length||r.some(i=>i>=e.selectors.length))&&t.addIssue({code:"custom",message:"Incomplete or ambiguous render signature"})}),Uj=n.strictObject({renderKey:n.string().min(1).max(256),routeKey:n.string().min(1).max(256),stateKey:n.string().min(1).max(256),documentKey:n.string().min(1).max(256),documentHash:n.string().regex(/^[a-f0-9]{64}$/),compositionKey:n.string().min(1).max(256),entryMode:n.enum(["hard","soft"]),match:n.strictObject({present:n.array(n.number().int().min(0)),absent:n.array(n.number().int().min(0))})})});var $Z,b_,jZ,Vj,Bj=x(()=>{"use strict";ee();$Z=["enterprise-internal-indiana-test","tinkerland-indiana-prod"],b_="[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}",jZ=n.string().regex(new RegExp(`^${b_}/${b_}/${b_}/manifest\\.json$`)),Vj=n.strictObject({kind:n.literal("gcs-resumable"),url:n.url(),bucket:n.enum($Z),objectKey:jZ,byteLength:n.number().int().positive(),expiresAt:n.iso.datetime()}).superRefine((e,t)=>{let r=new URL(e.url),i=r.searchParams,o=["uploadType","upload_id","name","upload_protocol","ifGenerationMatch"];(r.origin!=="https://storage.googleapis.com"||r.username||r.password||r.hash||r.pathname!==`/upload/storage/v1/b/${e.bucket}/o`||[...i.keys()].some(a=>!o.includes(a)||i.getAll(a).length!==1)||i.get("uploadType")!=="resumable"||!/^[A-Za-z0-9_-]{1,4096}$/.test(i.get("upload_id")??"")||i.has("name")&&i.get("name")!==`app-manifests/${e.objectKey}`||i.has("upload_protocol")&&i.get("upload_protocol")!=="resumable"||i.has("ifGenerationMatch")&&i.get("ifGenerationMatch")!=="0")&&t.addIssue({code:"custom",message:"Invalid IAM upload capability"})})});var Ht,mr,oh,qj,Zj,LZ,jl,x_,dse,S_,MZ,pse,A_,mse,fse,hse,gse,yse,bse,ah=x(()=>{"use strict";ee();ih();Bj();Ht=n.string().min(1).max(256),mr=n.string().regex(/^[a-f0-9]{64}$/),oh=n.strictObject({versionId:n.uuid(),manifestDigest:mr,sourceGraphDigest:mr,pageKey:Ht,stateKey:Ht,documentKey:Ht,documentHash:mr,elementKey:Ht.optional(),nodeId:Ht.optional(),contentHash:mr.optional(),renderKey:Ht.optional()}),qj=n.strictObject({pageKey:Ht,documentKey:Ht,expectedDocumentHash:mr,renderKey:Ht.optional(),nodeId:Ht,elementKey:Ht,expectedContentHash:mr,property:n.enum(["text","fontSize","color"]),value:n.union([n.string().max(4e3),n.number().finite()])}),Zj=n.strictObject({versionId:n.uuid(),manifestDigest:mr,sourceGraphDigest:mr,pageKey:Ht,stateKey:Ht,documentKey:Ht,documentHash:mr,renderKey:Ht.optional(),patches:n.array(qj.omit({pageKey:!0,documentKey:!0,expectedDocumentHash:!0,renderKey:!0})).min(1).max(200)}),LZ=/^[a-z][a-z0-9-]{0,39}$/,jl=n.string().regex(LZ),x_=n.enum(["web","ios","android"]),dse=n.discriminatedUnion("action",[n.strictObject({action:n.literal("register"),requestId:n.uuid(),client:jl,platform:x_,label:n.string().trim().min(1).max(100),sha256:mr,bytes:n.number().int().min(1),transferBytes:n.number().int().min(1)}),n.strictObject({action:n.literal("complete"),versionId:n.uuid()}),n.strictObject({action:n.literal("current"),versionId:n.uuid(),expectedCurrent:n.uuid().nullable()}),n.strictObject({action:n.literal("delivery"),enabled:n.boolean()}),n.strictObject({action:n.literal("changes"),versionId:n.uuid(),experimentId:n.uuid(),variationId:Ht,changesetId:n.uuid().nullable(),expectedRevision:mr.nullable(),editorUrl:n.string().url().max(2048),patches:n.array(qj).max(200)})]),S_=n.strictObject({id:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),clientKey:jl,platform:x_,label:n.string(),sha256:mr,bytes:n.number().int().positive(),objectKey:n.string(),state:n.enum(["uploading","ready","rejected"]),isCurrent:n.boolean(),revision:n.number().int().nonnegative(),createdAt:n.string(),expiresAt:n.string(),readyAt:n.string().nullable(),summary:n.record(n.string(),n.json()),routeTree:n.json().nullable(),validation:n.record(n.string(),n.json())}),MZ=n.strictObject({key:jl,platform:x_,currentId:n.uuid().nullable()}),pse=n.strictObject({rows:n.array(S_).max(100),nextCursor:n.uuid().nullable(),clients:n.array(MZ).max(20)}),A_=n.strictObject({storedBytes:n.number().int().nonnegative(),reservedBytes:n.number().int().nonnegative(),chargedBytes:n.number().int().nonnegative(),versions:n.number().int().nonnegative(),objects:n.number().int().nonnegative(),orphanObjects:n.number().int().nonnegative(),missingReadyObjects:n.number().int().nonnegative(),unknownObjectSizes:n.number().int().nonnegative(),byteLimit:n.number().int().positive(),versionLimit:n.number().int().positive(),remainingBytes:n.number().int().nonnegative()}),mse=n.strictObject({asOf:n.iso.datetime({offset:!0}),reclamation:n.literal("manual-review-required"),buckets:n.strictObject({source:A_,runtime:A_,previews:A_})}),fse=n.strictObject({version:S_,actorId:n.uuid(),claims:n.record(n.string(),n.json())}),hse=n.strictObject({version:S_,upload:Vj.nullable()}),gse=n.object({format:n.literal("indiana-route-state-index"),schemaVersion:n.literal(3),routes:n.array(n.object({routeKey:Ht,path:n.string(),documentKey:Ht,documentHash:mr,initialStateKey:Ht,initialRenderKey:Ht})),renders:n.array(Uj)}).loose().superRefine((e,t)=>{(!e.renders||e.routes.some(r=>!e.renders?.some(i=>i.renderKey===r.initialRenderKey&&i.routeKey===r.routeKey&&i.documentKey===r.documentKey&&i.stateKey===r.initialStateKey&&i.documentHash===r.documentHash&&i.entryMode==="hard")))&&t.addIssue({code:"custom",message:"Incomplete render catalog"})}),yse=n.strictObject({rows:n.array(n.object({id:n.uuid(),name:n.string(),status:n.string(),variations:n.array(n.object({id:Ht,key:Ht,name:n.string().optional()}).loose())}).loose()),limited:n.boolean()}),bse=n.strictObject({enabled:n.boolean(),allowedOrigins:n.array(n.string())})});var Hj,Gj=x(()=>{"use strict";ee();ah();Hj=n.strictObject({id:n.uuid(),name:n.string().trim().min(1).max(80),client:jl,source:oh,event:n.enum(["screen_enter","button_click"]),cooldownSeconds:n.number().int().min(0).max(2592e3),behavior:n.literal("observe")}).superRefine((e,t)=>{e.event==="button_click"&&(!e.source.nodeId||!e.source.elementKey)&&t.addIssue({code:"custom",path:["source"],message:"Choose a uniquely bound button"})})});function w_(e){return FZ.some(t=>e===t||e.startsWith(t+"."))}function __(e){let t={};for(let[i,o]of Object.entries(jf(e.declarations,e))){let a=i.split(".");if(a.some(u=>["__proto__","constructor","prototype"].includes(u)))throw new Error("Reserved result path");let s=t;for(let u of a.slice(0,-1)){Object.hasOwn(s,u)||(s[u]={});let l=s[u];if(!l||typeof l!="object"||Array.isArray(l))throw new Error("Ambiguous result path");s=l}let c=a.at(-1);if(c===void 0)throw new Error("Empty result path");s[c]=o}return{...Object.fromEntries(Object.entries(e.attributes).filter(([i])=>!w_(i))),variables:t}}var v_,FZ,sc=x(()=>{"use strict";Zt();Zr();cw();v_=Te,FZ=["parameters","answers","results","variables"]});function I_(e,t=0){return t>20?!0:!!e&&typeof e=="object"&&(Array.isArray(e)?e.some(r=>I_(r,t+1)):Object.entries(e).some(([r,i])=>["__proto__","constructor","prototype"].includes(r)||UZ.test(r)||I_(i,t+1)))}var sh,zZ,Gr,UZ,VZ,Vn,Kj,cc,k_,ho=x(()=>{"use strict";ee();Zt();yl();sh=n.discriminatedUnion("kind",[n.object({kind:n.literal("ledger"),cursor:wf}).strict(),n.object({kind:n.literal("billing"),cursor:n.uuid()}).strict()]),zZ=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),Gr=n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),n.union([n.string().max(500),n.boolean(),n.array(n.string().max(500)).max(50)])).refine(e=>Object.keys(e).length<=40,"Too many answers"),UZ=/^(?:api_?key|authorization|password|(?:customer|run|visitor|access|purchase)_?token|client_?secret|signed_?transaction|raw_?proof)$/i;VZ=/gg_(?:sk|ct|fr|fv|gc)_[A-Za-z0-9_-]{20,}/,Vn=n.record(zZ,Te).refine(e=>Object.keys(e).length<=20,"Too many parameters").refine(e=>!I_(e)&&!VZ.test(JSON.stringify(e)),"Credentials cannot be screen parameters"),Kj=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),cc=n.array(n.object({variable:Kj,componentId:Kj,required:n.boolean()}).strict()).max(40).refine(e=>new Set(e.map(t=>t.variable)).size===e.length&&new Set(e.map(t=>t.componentId)).size===e.length,"Input bindings must be unique"),k_=n.object({bindings:cc,answers:Gr,values:n.record(n.string(),Te).optional()}).strict()});var ch,E_=x(()=>{"use strict";ee();ch=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/)});var C_,Wj,Jj,P_,BZ,Qj,Yj,Fse,zse,Use,qZ,Vse,uh=x(()=>{"use strict";ee();sc();ho();E_();cr();Pi();C_=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),Wj=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,128}$/),Jj=Vn.refine(e=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=8192,"Task data exceeds 8 KiB"),P_=n.record(C_,n.enum(["string","number","boolean","strings"])).refine(e=>Object.keys(e).length<=20,"Too many output fields"),BZ=li,Qj=n.strictObject({type:n.literal("external_task"),endpointId:n.uuid(),taskKey:C_,inputs:n.record(C_,BZ).refine(e=>Object.keys(e).length<=20),outputs:P_}),Yj=n.strictObject({maxAttempts:n.number().int().min(1).max(5),retryDelaySeconds:n.number().int().min(1).max(30),backoff:n.enum(["fixed","exponential"]),requestTimeoutSeconds:n.number().int().min(1).max(10),timeoutSeconds:n.number().int().min(1).max(300)}).refine(e=>e.requestTimeoutSeconds<=e.timeoutSeconds,"Request timeout exceeds action deadline"),Fse=n.strictObject({outcome:n.enum(["success","failure"]),data:Jj}),zse=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("signal"),runId:n.uuid(),nodeId:Wj,eventName:ch,eventId:n.uuid(),data:Jj}),n.strictObject({operation:n.literal("read_results"),runId:n.uuid()})]),Use=n.strictObject({scope:yt,runId:n.uuid(),eventId:n.uuid(),accepted:n.boolean()}),qZ=n.record(Wj,v_),Vse=n.strictObject({scope:yt,runId:n.uuid(),results:qZ})});var Kr,Xj,lh=x(()=>{"use strict";Kr={flowNodes:500,logicNodes:480,pages:100,components:1500,actions:250,questions:40,documentBytes:1e6,conditionDepth:3,conditionChildren:20,conditionPredicates:100},Xj="00000000-0000-0000-0000-000000000000"});var Kse,O_,eL,tL,T_,nL,rL,dh=x(()=>{"use strict";ee();Zt();ho();Kse=n.enum(["local","remote"]),O_=n.strictObject({port:n.string().regex(/^[a-zA-Z0-9_.:-]{1,128}$/),value:Te.optional(),sticky:n.array(n.strictObject({expected:il.nullable(),next:il})).max(100),exposures:n.array(Te).max(100),features:n.array(Te).max(100)}),eL=n.strictObject({type:n.literal("evaluate"),receiptId:n.uuid(),environmentId:n.uuid(),policyRevision:n.number().int().nonnegative(),attributes:tn,sticky:n.record(n.string(),il)}),tL=eL.extend({runId:n.uuid(),versionId:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative()}),T_=eL.omit({type:!0,receiptId:!0}).extend({type:n.literal("evaluate_segment")}),nL=n.strictObject({nodeId:n.string().min(1).max(64),result:O_}),rL=T_.extend({runId:n.uuid(),versionId:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),parameters:Vn,answers:Gr,variables:n.record(n.string(),Te)})});var R_,uc,ph,mh,fh,hh,iL,oL,lc,dc,ba,Aa,pc,aL,ZZ,HZ,N_,sL,cL,uL,xa=x(()=>{"use strict";ee();Zt();R_=n.array(n.string().trim().min(1).max(40).refine(e=>!e.includes(","),"\u6807\u7B7E\u4E0D\u80FD\u5305\u542B\u9017\u53F7")).max(20).refine(e=>new Set(e).size===e.length,"\u6807\u7B7E\u4E0D\u80FD\u91CD\u590D"),uc=n.intersection(tn,n.looseObject({tags:R_.optional()})).refine(e=>!["id","externalUserId","createdAt","ageDays","subscription","parameters","answers","results"].some(t=>Object.hasOwn(e,t)),"Reserved customer attribute"),ph=n.string().trim().max(80),mh=n.string().regex(/^\+[1-9]\d{1,14}$/).nullable(),fh=n.union([n.email().max(254),n.literal("")]),hh=n.string().trim().min(1).max(255).refine(e=>!/\p{Cc}/u.test(e),"Fingerprint must not contain control characters"),iL=n.string().trim().min(1).max(255).refine(e=>!e.startsWith("gg_guest_"),"Reserved guest identity namespace"),oL=n.object({externalUserId:iL.optional(),name:ph.default(""),email:fh.default(""),phone:mh.optional(),attributes:uc.default({})}).strict().refine(e=>e.externalUserId!==void 0||e.email!=="","\u8BF7\u63D0\u4F9B\u4E1A\u52A1\u7528\u6237 ID \u6216\u90AE\u7BB1"),lc=n.discriminatedUnion("type",[n.strictObject({type:n.literal("id"),value:n.uuid()}),n.strictObject({type:n.literal("externalUserId"),value:iL})]),dc=n.strictObject({name:ph.optional(),email:fh.optional(),phone:mh.optional(),attributes:uc.optional(),fingerprint:hh.optional()}),ba=e=>!e.customerData||e.customer?.type==="externalUserId",Aa="customerData requires an externalUserId customer",pc=n.object({id:n.uuid(),externalUserId:n.string().min(1).max(255).nullable(),name:ph,email:fh,phone:mh.optional(),attributes:uc,createdAt:n.iso.datetime()}).strict(),aL=n.object({customer:pc,changed:n.boolean(),replayed:n.boolean()}).strict(),ZZ=n.discriminatedUnion("type",[n.object({type:n.literal("id"),value:n.uuid()}).strict(),n.object({type:n.literal("externalUserId"),value:n.string().trim().min(1).max(255)}).strict()]),HZ=n.object({name:ph.optional(),email:fh.optional(),phone:mh.optional(),attributes:uc.refine(e=>!Object.hasOwn(e,"tags"),"Use incremental tagChanges").optional(),removeAttributes:n.array(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,127}$/)).max(128).refine(e=>!e.includes("tags")).optional(),tagChanges:n.strictObject({add:R_,remove:R_}).optional()}).strict().refine(e=>Object.keys(e).length>0,"\u8BF7\u63D0\u4F9B\u9700\u8981\u4FEE\u6539\u7684\u5B57\u6BB5"),N_=n.object({lookup:ZZ}).strict(),sL=N_.extend({requestId:n.uuid(),patch:HZ}).strict(),cL=n.object({search:n.string().trim().max(200).default(""),tag:n.string().trim().max(40).default(""),planId:n.string().max(200).default(""),versionId:n.string().max(200).default(""),holdingStatus:n.enum(["","active","scheduled","expired","unavailable","none"]).default(""),membershipStatus:n.enum(["","active","trial","past_due","ended"]).default(""),createdFrom:n.union([n.iso.datetime(),n.literal("")]).default(""),createdUntil:n.union([n.iso.datetime(),n.literal("")]).default(""),offset:n.coerce.number().int().min(0).max(1e5).default(0),limit:n.coerce.number().int().min(1).max(100).default(50)}).strict(),uL=n.object({customers:pc.array(),hasMore:n.boolean(),total:n.number().int().nonnegative().nullable(),evaluatedAt:n.iso.datetime()}).strict()});var Ll,GZ,D_,ace,sce,cce,Ml=x(()=>{"use strict";ee();Zr();Pi();dh();cr();Zt();xa();Ll=n.discriminatedUnion("type",[n.strictObject({type:n.literal("literal"),value:Te}),n.strictObject({type:n.literal("variable"),key:Wt,path:Hr.optional()}),n.strictObject({type:n.literal("feature"),featureKey:n.string().min(1).max(128)})]),GZ=n.strictObject({requestId:n.uuid(),decisionId:n.uuid(),customerId:n.uuid(),externalUserId:n.string().min(1).max(255).nullable(),versionId:n.uuid(),receiptId:n.uuid(),value:Te}),D_={funnelId:n.uuid(),requestId:n.uuid(),customer:lc,customerData:dc.optional(),attributes:tn.refine(e=>!["parameters","answers","results","variables"].some(t=>Object.hasOwn(e,t)),"parameters, answers, results and variables are reserved flow namespaces")},ace=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("decide"),...D_}).refine(ba,Aa),n.strictObject({operation:n.literal("read_decision"),decisionId:n.uuid()}),n.strictObject({operation:n.literal("evaluate_decision"),decisionId:n.uuid(),requestId:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),receiptId:n.uuid(),policyRevision:n.number().int().nonnegative(),generation:n.string().min(1).max(256),result:O_}),n.strictObject({operation:n.literal("feature_config"),funnelId:n.uuid()}),n.strictObject({operation:n.literal("commit_decision_segment"),decisionId:n.uuid(),requestId:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),policyRevision:n.number().int().nonnegative(),generation:n.string().min(1).max(256),steps:n.array(nL).max(32),boundary:n.strictObject({nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative()}).optional()}),n.strictObject({operation:n.literal("segment_configuration"),funnelId:n.uuid(),versionId:n.uuid()}),n.strictObject({operation:n.literal("configuration"),funnelId:n.uuid(),versionId:n.uuid().optional()}),n.strictObject({operation:n.literal("local_configuration"),funnelId:n.uuid()}),n.strictObject({operation:n.literal("report_used"),decisionId:n.uuid(),eventId:n.uuid(),occurredAt:n.iso.datetime({offset:!0}),reference:n.string().min(1).max(128).optional()})]),sce=n.strictObject({scope:yt,decisionId:n.uuid(),requestId:n.uuid(),status:n.enum(["pending","completed","failed"]),decision:GZ.nullable(),evaluation:n.discriminatedUnion("type",[tL,rL]).optional()}).refine(e=>e.status==="completed"==(e.decision!==null)&&(!e.decision||e.decision.decisionId===e.decisionId&&e.decision.requestId===e.requestId),"Completed decisions carry their committed result"),cce=n.strictObject({scope:yt,decisionId:n.uuid(),eventId:n.uuid(),source:n.literal("caller_reported")})});var lL,KZ,fce,hce,$_=x(()=>{"use strict";ee();Zt();oo();Pi();lL=n.strictObject({type:n.literal("bundle"),paywall:li.optional(),offering:li.optional(),coupons:li,data:li}),KZ=e=>n.strictObject({type:n.literal(e),id:n.uuid()}),fce=n.strictObject({type:n.literal("bundle"),paywallVersionId:n.uuid().optional(),offeringVersionId:n.uuid().optional(),couponIds:n.array(n.uuid()).max(20).refine(e=>new Set(e).size===e.length),data:Te}),hce=n.strictObject({type:n.literal("bundle"),offering:KZ("offering_version").nullable(),paywall:n.strictObject({versionId:n.uuid(),paywallId:n.uuid(),offeringVersionId:n.uuid()}).nullable(),coupons:n.array(ol).max(20),data:Te})});var dL,WZ,JZ,pL,j_=x(()=>{"use strict";ee();Pi();dL=n.union([n.string(),n.number().finite(),n.boolean(),n.null()]),WZ=n.union([dL,n.array(dL).min(1).max(20)]),JZ=n.record(Hr,WZ).refine(e=>Object.keys(e).length<=10),pL=n.strictObject({path:Hr,type:n.enum(["string","number","boolean","strings"]),nullable:n.boolean().optional(),aggregation:n.enum(["count","exists"]).optional(),where:JZ.optional()}).superRefine((e,t)=>{(e.aggregation==="count"&&e.type!=="number"||e.aggregation==="exists"&&e.type!=="boolean"||!e.aggregation&&e.where)&&t.addIssue({code:"custom",message:"Collection summaries require their matching type"})})});var QZ,mL,YZ,fL,L_=x(()=>{"use strict";ee();uh();Pi();j_();QZ=["sendMessage","checkEntitlement","resolveOffering","readHoldings","readLedger","readBillingInvoice","readCreditStatement","previewAttach","attach","readSubscriptionOperation","previewUpdate","update","readSubscriptionUpdate","setupPayment","readPaymentSetup","verifySubscriptions","previewRefund","refund","readRefund","restoreNativePurchase","readBillingControls","prepareBillingAuthorization","confirmBillingAuthorization","setBillingCoupons","revokeBillingAuthorization","listBillingInvoices","confirmBillingAdjustment","manageBillingLimits","readSeats","manageSeat","quoteBalance","mutateBalance","trackUsage","readUsage","setUsage","adjustBalance","readBalanceSource","manageBalanceGrant","listBalanceGrants","manageUsageEntity","readUsageAnalytics","readCreditAnalytics","submitUsageBatch","readUsageBatch","redeemCoupon","listOffers","grantOffer","redeemReward","createReferralCode","claimRewardProduct"],mL=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),YZ=li,fL=n.discriminatedUnion("type",[Qj,n.strictObject({type:n.literal("claim_offer"),coupon:li}),n.strictObject({type:n.literal("event"),event:mL}),n.strictObject({type:n.literal("api"),operation:n.enum(QZ),inputs:n.record(Hr,YZ).refine(e=>Object.keys(e).length<=40),outputs:n.record(mL,pL).refine(e=>Object.keys(e).length<=20)})])});function gh(e){switch(e.type){case"entry":case"feature":case"offering":case"coupon":case"coupons":return[e.next];case"screen":return Object.values(e.outputs);case"condition":return[...e.cases.map(t=>t.target),e.default];case"split":return[...Object.values(e.routes),e.notParticipating];case"action":return[e.success,e.cancel,e.unavailable,e.failure];case"external_page":return[e.opened,e.failed];case"end":case"output":return[];case"wait":return e.wait.type==="duration"?[e.wait.elapsed]:[e.wait.received,e.wait.timeout]}}function nH(e,t){let r=[],i=new Map(e.nodes.map(d=>[d.id,d])),o=(d,p,h)=>{r.push(d),t?.({message:d,reason:p,path:h?["nodes",e.nodes.indexOf(h)]:[]})};i.size!==e.nodes.length&&o("Node identifiers must be unique","uniqueNodes"),(i.get(e.entry)?.type!=="entry"||e.nodes.filter(d=>d.type==="entry").length!==1)&&o("A flow has exactly one entry node","entry"),(e.nodes.filter(d=>d.type==="screen").length>Kr.pages||e.nodes.filter(d=>!["screen","entry","end","output"].includes(d.type)).length>Kr.logicNodes)&&o("Flow node limit exceeded","budget");let a=new Set;for(let d of e.nodes){for(let p of gh(d))p===e.entry&&o("An entry cannot be a transition target","entryTarget",d),i.has(p)||o(`Missing target ${p}`,"missingTarget",d);d.type==="screen"&&(a.has(d.screenId)&&o("Every screen has exactly one node owner","screenOwner",d),a.add(d.screenId))}let s=new Set,c=new Set,u=new Set;function l(d){if(s.has(d)){o("Flow edges must not form a cycle","cycle",i.get(d));return}if(!(c.has(d)||!i.has(d))){s.add(d),u.add(d);for(let p of gh(i.get(d)))l(p);s.delete(d),c.add(d)}}l(e.entry);for(let d of e.nodes)u.has(d.id)||o("Every node must be reachable from Entry","unreachable",d);return[...new Set(r)]}var $t,XZ,fr,eH,M_,F_,tH,z_,mc,Fl=x(()=>{"use strict";ee();ah();Gj();uh();E_();lh();Ml();$_();L_();nc();Zt();Zr();sc();$t=ch,XZ=n.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/),fr={id:$t,name:n.string().trim().min(1).max(80),position:n.strictObject({x:n.number().finite(),y:n.number().finite()}).optional()},eH={success:$t,cancel:$t,unavailable:$t,failure:$t},M_=n.url().max(2048).refine(e=>{try{return new URL(e).protocol==="https:"}catch{return!1}},{message:"External pages require HTTPS"}),F_=n.enum(["same_window","new_window"]),tH=n.discriminatedUnion("type",[n.strictObject({...fr,type:n.literal("entry"),next:$t,triggers:n.array(Hj).max(20).refine(e=>new Set(e.map(t=>t.id)).size===e.length,"Entry trigger IDs must be unique").optional()}),n.strictObject({...fr,type:n.literal("screen"),screenId:$t,presentation:Oi,outputs:n.record($t,$t),offering:n.discriminatedUnion("source",[n.strictObject({source:n.literal("variable"),key:Wt}),n.strictObject({source:n.literal("fixed"),versionId:n.uuid()})]).optional()}),n.strictObject({...fr,type:n.literal("offering"),configuration:n.discriminatedUnion("source",[n.strictObject({source:n.literal("fixed"),versionId:n.uuid()}),n.strictObject({source:n.literal("feature"),featureKey:n.string().min(1).max(128)})]),writes:n.strictObject({value:Wt}),next:$t}),n.strictObject({...fr,type:n.literal("coupon"),couponId:n.uuid(),writes:n.strictObject({value:Wt}),next:$t}),n.strictObject({...fr,type:n.literal("coupons"),couponIds:n.array(n.uuid()).max(20).refine(e=>new Set(e).size===e.length),writes:n.strictObject({value:Wt}),next:$t}),n.strictObject({...fr,type:n.literal("output"),value:n.discriminatedUnion("type",[...Ll.options,lL,n.strictObject({type:n.literal("selection"),screenId:$t,offeringKey:Wt})])}),n.strictObject({...fr,type:n.literal("condition"),cases:n.array(n.strictObject({condition:zn,target:$t})).min(1).max(50),default:$t}),n.strictObject({...fr,type:n.literal("feature"),featureKey:n.string().min(1).max(128),writes:n.strictObject({value:Wt}),next:$t}),n.strictObject({...fr,type:n.literal("split"),experimentId:n.uuid(),applyPageExperiment:n.literal(!0).optional(),routes:n.record(XZ,$t).refine(e=>Object.keys(e).length>=2&&Object.keys(e).length<=20),notParticipating:$t}),n.strictObject({...fr,type:n.literal("action"),...eH,execution:Yj,action:fL,writes:jw.optional()}),n.strictObject({...fr,type:n.literal("external_page"),appManifest:oh.optional(),url:M_,openIn:F_,opened:$t,failed:$t}),n.strictObject({...fr,type:n.literal("end"),outcome:n.enum(["completed","closed","ineligible","failed"]),output:Ll.optional()}),n.strictObject({...fr,type:n.literal("wait"),writes:jw.optional(),wait:n.discriminatedUnion("type",[n.strictObject({type:n.literal("duration"),delaySeconds:n.number().int().min(1).max(2592e3),elapsed:$t}),n.strictObject({type:n.literal("event"),eventName:$t,outputs:P_,timeoutSeconds:n.number().int().min(1).max(2592e3),received:$t,timeout:$t})])})]),z_=n.strictObject({version:n.literal(5),entry:$t,nodes:n.array(tH).min(1).max(Kr.flowNodes)}),mc=z_.superRefine((e,t)=>{nH(e,r=>t.addIssue({code:"custom",message:r.message,path:r.path,params:{reason:r.reason}}))})});var U_,V_=x(()=>{"use strict";U_={maxTransitions:1e4,runTimeoutSeconds:2592e3}});function hL(e,t,r){let i=[...t].sort((c,u)=>u.length-c.length),o=new Set,a=(c,u=!1)=>{let l=i.find(d=>c===d||u&&c.startsWith(d+"."));o.add(l??c)};if(e.type==="condition"){let c=r?.startsWith("case_")?Number(r.slice(5)):e.cases.length-1;for(let u of e.cases.slice(0,c+1))for(let l of ro(u.condition))l.startsWith("variables.")&&a(l.slice(10),!0)}if(e.type==="screen"&&e.offering?.source==="variable"&&a(e.offering.key),e.type==="action"&&(e.action.type==="api"||e.action.type==="external_task"))for(let c of Object.values(e.action.inputs))c.source==="variable"&&a(c.key);e.type==="action"&&e.action.type==="claim_offer"&&e.action.coupon.source==="variable"&&a(e.action.coupon.key);let s=e.type==="output"?e.value:e.type==="end"?e.output:null;if(s?.type==="variable"&&a(s.key),s?.type==="bundle")for(let c of[s.paywall,s.offering,s.coupons,s.data])c?.source==="variable"&&a(c.key);return s?.type==="selection"&&a(s.offeringKey),[...o]}var B_=x(()=>{"use strict";sc()});var fc,yh,Hce,Z_,zl,Ul,gL,Gce,Sa,q_,Kce,Vl=x(()=>{"use strict";ee();Zt();Qs();fc=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/),yh=e=>n.record(n.string(),Te).refine(t=>pr(t)<=e,"Funnel evidence exceeds its byte budget"),Hce=n.enum(["local_segment","evaluation","presentation","timer","event","operation"]),Z_=n.enum(["entry","presentation","decision","configuration","capability","wait","terminal"]),zl=n.discriminatedUnion("type",[n.strictObject({type:n.literal("flag"),key:n.string().min(1).max(128)}),n.strictObject({type:n.literal("experiment"),id:n.uuid()}),n.strictObject({type:n.literal("saved_group"),id:n.uuid()}),n.strictObject({type:n.literal("config"),key:n.string().min(1).max(128)}),n.strictObject({type:n.literal("constant"),key:n.string().min(1).max(128)}),n.strictObject({type:n.literal("paywall_version"),id:n.uuid()}),n.strictObject({type:n.literal("offering_version"),id:n.uuid()}),n.strictObject({type:n.literal("reward"),id:n.uuid()})]),Ul=n.strictObject({schemaVersion:n.literal(1),kind:Z_,selector:zl.nullable(),context:yh(131072),contract:n.strictObject({version:n.number().int().positive(),evaluator:n.string().min(1).max(128),policyRevision:n.number().int().nonnegative()})}).refine(e=>pr(e)<=131072,"Node input exceeds its byte budget"),gL=n.strictObject({schemaVersion:n.literal(1),kind:Z_,outcome:n.enum(["success","cancel","failure","unavailable","elapsed","received","timeout","not_participating"]),data:yh(131072),route:n.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/).nullable(),evidence:yh(131072)}).refine(e=>pr(e)<=131072,"Node result exceeds its byte budget"),Gce=n.strictObject({schemaVersion:n.literal(1),operations:n.record(fc,n.strictObject({attempts:n.number().int().nonnegative(),maxAttempts:n.number().int().min(1).max(5),deadlineAt:n.iso.datetime({offset:!0}),retryAt:n.iso.datetime({offset:!0}).nullable(),error:n.string().regex(/^[a-z_]{1,64}$/).nullable(),reference:n.strictObject({type:fc,id:n.uuid()}).nullable()}))}).refine(e=>pr(e)<=65536,"Execution state exceeds its byte budget"),Sa={receiptId:n.uuid()},q_=n.iso.datetime({offset:!0}),Kce=n.discriminatedUnion("type",[n.strictObject({type:n.literal("node_entered"),details:n.strictObject({kind:Z_})}),n.strictObject({type:n.literal("presentation_shown"),details:n.strictObject({...Sa,source:n.literal("client"),occurredAt:q_.optional()})}),n.strictObject({type:n.literal("decision_accepted"),details:n.strictObject(Sa)}),n.strictObject({type:n.literal("signal_received"),details:n.strictObject({signalId:n.uuid(),nodeId:fc,eventName:fc,data:yh(8192),source:n.literal("server"),occurredAt:q_})}),n.strictObject({type:n.literal("signal_consumed"),details:n.strictObject({...Sa,signalId:n.uuid()})}),n.strictObject({type:n.literal("wait_elapsed"),details:n.strictObject(Sa)}),n.strictObject({type:n.literal("wait_timeout"),details:n.strictObject(Sa)}),n.strictObject({type:n.literal("operation_completed"),details:n.strictObject({...Sa,operation:fc,reference:n.strictObject({type:fc,id:n.uuid()}).nullable()})}),n.strictObject({type:n.literal("execution_recovered"),details:n.strictObject({generation:n.number().int().positive(),reason:n.enum(["interrupted","expired_lease","delivery_failed"])})}),n.strictObject({type:n.literal("execution_failed"),details:n.strictObject({generation:n.number().int().positive(),code:n.string().regex(/^[a-z_]{1,64}$/)})}),n.strictObject({type:n.literal("run_completed"),details:n.strictObject({outcome:n.enum(["completed","ineligible","failed"])})}),n.strictObject({type:n.literal("run_closed"),details:n.strictObject({source:n.enum(["client","server","expiry"])})}),n.strictObject({type:n.literal("treatment_used"),details:n.strictObject({...Sa,source:n.enum(["client","server"]),occurredAt:q_,reference:n.string().min(1).max(128).optional()})})])});function iH(e,t){let r=!1,i=(o,a)=>{let s=o.type==="stack"||o.type==="button"?o.bind?.coupon??a:a;o.type==="text"&&Object.values(e.strings.locales).some(c=>c[o.text]?.includes("{{offer."))&&!(s&&t(s))&&(r=!0),o.type==="stack"&&o.children.forEach(c=>i(c,s))};for(let o of e.pages)i(o.root);return r}function Ah(e){return Array.isArray(e)?e.some(Ah):!e||typeof e!="object"?!1:Object.entries(e).some(([t,r])=>t==="productVersionId"?r===Xj:Ah(r))}function oH(e){let t=[],r=new Set(Object.values(e.references).flatMap(i=>i.type==="reward"?[i.id]:[]));for(let[i,o]of e.screens.entries()){if(o.type!=="owned")continue;let a;try{a=zj(o.document)}catch(s){t.push({message:s instanceof Error?s.message:"Screen cannot be delivered",reason:"screen",path:["screens",i,"document"]});continue}for(let[s,c]of e.inputs.entries())c.screenId===o.id&&!Pn(a,c.componentId)&&t.push({message:`Local Funnel input ${c.variable} targets hidden component ${c.componentId} on screen ${c.screenId}`,reason:"inputBinding",path:["inputs",s]})}for(let[i,o]of e.graph.nodes.entries()){let a=["graph","nodes",i],s=o.type==="screen"?e.screens.find(c=>c.id===o.screenId):void 0;s?.type==="owned"&&(s.document.actions.some(c=>typeof c.properties.templateKey=="string"&&c.properties.templateKey.startsWith("popup-coupon-"))&&t.push({message:"Funnel screens claim Coupons through a Claim Coupon step",reason:"coupon",path:a}),iH(s.document,c=>r.has(c))&&t.push({message:"Offer copy shows the Coupon of a Claim Coupon step",reason:"coupon",path:a})),(o.type==="output"&&o.value.type==="literal"&&Ah(o.value.value)||o.type==="end"&&o.output?.type==="literal"&&Ah(o.output.value))&&t.push({message:"Checkout outputs require a Product Version",reason:"product",path:a})}return t}function bL(e,t){for(let{message:r,reason:i,path:o}of oH(e))t.addIssue({code:"custom",message:r,path:o,params:{reason:i}})}function AL(e,t){let r=(f,m,g=[])=>t.addIssue({code:"custom",message:f,path:g,params:{reason:m}}),i=Object.values(e.references),o=new Map(e.screens.map(f=>[f.id,f])),a=(f,m)=>i.some(g=>g.type===f&&("id"in g?g.id:g.key)===m);o.size!==e.screens.length&&r("Screen identifiers must be unique","uniqueScreens");let s=e.graph.nodes.filter(f=>f.type==="screen");(s.length!==o.size||s.some(f=>!o.has(f.screenId)))&&r("Every screen belongs to exactly one presentation node","screenOwner");let c=new Map,u=Object.keys(e.variables);u.some(f=>u.some(m=>f!==m&&m.startsWith(f+".")))&&r("Variable paths must not overlap","variable");function l(f,m){Object.hasOwn(e.variables,f)||r("Every produced variable needs a declaration","variable",["graph","nodes",e.graph.nodes.indexOf(m)]);let g=c.get(f)??new Set;g.add(m.id),c.set(f,g)}for(let[f,m]of e.graph.nodes.entries()){let g=["graph","nodes",f],A=m.type==="feature"?m.featureKey:m.type==="offering"&&m.configuration.source==="feature"?m.configuration.featureKey:m.type==="output"&&m.value.type==="feature"?m.value.featureKey:m.type==="end"&&m.output?.type==="feature"?m.output.featureKey:null;A&&!a("flag",A)&&r("Flag selectors require an explicit GB resource reference","feature",g);let C=m.type==="feature"||m.type==="offering"||m.type==="coupon"||m.type==="coupons"||m.type==="action"&&m.action.type==="api"?["value"]:m.type==="action"&&m.action.type==="external_task"?Object.keys(m.action.outputs):m.type==="wait"&&m.wait.type==="event"?Object.keys(m.wait.outputs):[],w="writes"in m?m.writes??{}:{};(C.length!==Object.keys(w).length||C.some(I=>!Object.hasOwn(w,I))||new Set(Object.values(w)).size!==Object.values(w).length)&&r("Node writes must map every named output exactly once","variable",g);for(let[I,F]of Object.entries(w)){l(F,m);let L=e.variables[F],q=m.type==="offering"?"offering_version":m.type==="coupon"?"reward":m.type==="action"&&m.action.type==="api"?"json":m.type==="action"&&m.action.type==="external_task"?m.action.outputs[I]:m.type==="wait"&&m.wait.type==="event"?m.wait.outputs[I]:void 0;(L?.source.type!=="node"||q&&L.type!==q)&&r("Node writer source or output type does not match declaration","variable",g)}if(m.type==="coupons"){let I=e.variables[m.writes.value];(I?.type!=="array"||I.items?.type!=="reward"||I.items.nullable||I.nullable)&&r("Coupons output requires a non-null Reward array","variable",g);for(let F of m.couponIds)a("reward",F)||r("Coupons require Reward references","coupon",g)}if(m.type==="split"&&!a("experiment",m.experimentId)&&r("Experiment selectors require a GB resource reference","experiment",g),m.type==="coupon"&&!a("reward",m.couponId)&&r("Coupon selectors require a Reward reference","coupon",g),m.type==="action"&&m.action.type==="claim_offer"&&m.action.coupon.source==="literal"){let I=m.action.coupon.value;(!I||typeof I!="object"||Array.isArray(I)||I.type!=="reward"||typeof I.id!="string"||Object.keys(I).length!==2||!a("reward",I.id))&&r("Coupon claims require a Reward reference","coupon",g)}if(m.type==="offering"&&m.configuration.source==="fixed"&&!a("offering_version",m.configuration.versionId)&&r("Offering selectors require an explicit Version reference","offering",g),m.type==="screen"&&m.offering?.source==="variable"&&e.variables[m.offering.key]?.type!=="offering_version"&&r("Screen Offering variable must be an Offering reference","offering",g),m.type==="action"&&m.action.type==="claim_offer"&&m.action.coupon.source==="variable"&&(e.variables[m.action.coupon.key]?.type!=="reward"||m.action.coupon.path)&&r("Coupon variable must be a complete Reward reference","coupon",g),m.type==="screen"){let I=o.get(m.screenId);if(m.offering?.source==="fixed"&&!a("offering_version",m.offering.versionId)&&r("Screen Offering requires an explicit Version reference","offering",g),I?.type==="paywall"&&m.offering&&r("Paywall owns its fixed Offering Version","offering",g),I?.type==="paywall"&&!a("paywall_version",I.paywallVersionId)&&r("Paywall screens require an explicit Version reference","paywall",g),I?.type==="owned"){let F=I.document.pages[0];if(!F){r("Owned screen requires a page","screen",g);continue}Ci(I.document).some(q=>!q.complete)&&r("Owned screens require complete local content","translations",g);let L=new Set(I.document.actions.map(q=>q.id));(L.size!==Object.keys(m.outputs).length||Object.keys(m.outputs).some(q=>!L.has(q)))&&r("Every screen action requires exactly one outcome route","buttonOutputs",g),lo(F.root,q=>{!m.offering&&(q.type==="plan_picker"||(q.type==="stack"||q.type==="button")&&q.bind?.plan||q.type==="customer_data"&&["customer_plans","credit_packs"].includes(q.data.source))&&r("Product presentation requires an Offering Version","offering",g),q.type==="customer_data"&&Object.values(q.data.outputs??{}).some(H=>H!==void 0&&!L.has(H))&&r("Customer components require declared screen outcomes","componentOutput",g)})}}m.type==="end"&&["completed","ineligible"].includes(m.outcome)&&!m.output&&r("Completed and ineligible ends require a declared output","output",g),m.type==="end"&&m.output?.type==="literal"&&!kr(e.outputSchema,m.output.value)&&r("Terminal output does not match outputSchema","output",g),m.type==="output"&&m.value.type==="literal"&&!kr(e.outputSchema,m.value.value)&&r("Terminal output does not match outputSchema","output",g);let E=m.type==="output"?m.value:m.type==="end"?m.output:void 0;if(E?.type==="variable"&&!E.path){let I=e.variables[E.key];I&&!Lw(I,e.outputSchema)&&r("Variable output does not match outputSchema","output",g)}if(m.type==="screen"){let I=o.get(m.screenId);if(I?.type==="owned")for(let F of zw(I.document))(/^(input|params)\./.test(F)||F.startsWith("variables.")&&!Fw(F.slice(10),u))&&r("Screen values must reference registered variables","variable",g)}if(m.type==="condition")for(let I of m.cases){for(let F of ki(I.condition))a("saved_group",F)||r("Conditions require explicit Saved Group references","savedGroup",g);for(let F of ro(I.condition))F.startsWith("variables.")||r("Funnel conditions read registered variables only","variable",g)}if(m.type==="output"&&m.value.type==="bundle"){e.outputSchema.type!=="json"&&r("Bundle output requires a JSON outputSchema","output",g);for(let[I,F]of[["paywall","paywall_version"],["offering","offering_version"],["coupons","reward"]]){let L=m.value[I];if(L)if(L.source==="literal"){let q=I==="coupons"?L.value:[L.value];(!Array.isArray(q)||q.length>20||q.some(H=>!kr({type:F,nullable:!1},H)||!a(F,H.id))||I==="coupons"&&new Set(q.map(H=>H.id)).size!==q.length)&&r("Bundle requires distinct scoped resource references",I==="coupons"?"coupon":I==="paywall"?"paywall":"offering",[...g,"value",I])}else{let q=e.variables[L.key];(L.path||!q||q.nullable||(I==="coupons"?q.type!=="array"||q.items?.type!=="reward"||q.items.nullable:q.type!==F))&&r("Bundle binding type does not match its slot","output",g)}}}}for(let[f,m]of e.graph.nodes.entries()){let g=m.type==="screen"?o.get(m.screenId):void 0,A=[...hL(m,u),...g?.type==="owned"?Lf(g.document).map(C=>Fw(C,u)?.key??C):[]];for(let C of new Set(A)){let F=function(L){if(L===m.id)return!0;if(I.has(L))return!1;I.add(L);let q=e.graph.nodes.find(X=>X.id===L);return q?(E.has(L)?q.type==="action"?[q.cancel,q.unavailable,q.failure]:q.type==="wait"&&q.wait.type==="event"?[q.wait.timeout]:[]:gh(q)).some(F):!1};var h=F;if(!Object.hasOwn(e.variables,C)){r("Consumed variable is undeclared","variable",["graph","nodes",f]);continue}let w=e.variables[C];if(m.type==="screen"&&w.source.type==="input"&&e.inputs.some(L=>L.screenId===m.screenId&&L.variable===C)||w.source.type==="parameter"||w.source.type==="attribute")continue;let E=w.source.type==="input"?new Set(e.inputs.filter(L=>L.variable===C&&L.required).flatMap(L=>s.filter(q=>q.screenId===L.screenId).map(q=>q.id))):c.get(C)??new Set,I=new Set;(!E.size||F(e.graph.entry))&&r("Every path must produce the consumed variable","resultReference",["graph","nodes",f])}}(new Set(e.inputs.map(f=>f.variable)).size!==e.inputs.length||new Set(e.inputs.map(f=>`${f.screenId}:${f.componentId}`)).size!==e.inputs.length)&&r("Input keys and component bindings must be unique","inputKeys");for(let[f,m]of e.inputs.entries()){e.variables[m.variable]?.source.type!=="input"&&r("Input binding requires a registered input variable","inputBinding",["inputs",f]);let g=o.get(m.screenId),A=g?.type==="owned"?Pn(g.document,m.componentId):null;if((A?.type!=="stack"||!A.interaction||!["input","toggle","select","multiselect","tabs"].includes(A.interaction.type))&&r("Input requires an interactive control on its owned screen","inputBinding",["inputs",f]),A?.type==="stack"&&A.interaction){let C=A.interaction.type==="toggle"?"boolean":A.interaction.type==="multiselect"?"strings":"string";e.variables[m.variable]?.type!==C&&r("Input variable type does not match component","inputBinding",["inputs",f]);let w=e.variables[m.variable]?.enum;w&&!A.children.filter(E=>!E.hidden).every(E=>w.includes(E.id))&&r("Input choices must match the variable enum","inputBinding",["inputs",f])}}for(let[f,m]of Object.entries(e.variables))m.enum&&m.type!=="string"&&r("Only string variables support enum","variable",["variables",f]),m.source.type==="input"&&!e.inputs.some(g=>g.variable===f)&&r("Input variable requires a component binding","inputBinding",["variables",f]);let d=0,p=0;for(let f of e.screens)if(f.type==="owned"){for(let m of f.document.pages)lo(m.root,()=>{d++});p+=f.document.actions.length}(d>Kr.components||p>Kr.actions||pr(e)>Kr.documentBytes)&&r("Funnel document exceeds its budget","budget")}var Cr,rH,H_,yL,aH,go,sH,mue,bh,Bl,cH,uH,hc,gc=x(()=>{"use strict";ee();Bs();nh();ic();Bw();Ir();Fl();lh();V_();Qs();Zr();Mf();Zr();B_();Vl();xa();Zt();ho();Cr=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),rH=n.discriminatedUnion("type",[n.strictObject({id:Cr,type:n.literal("owned"),publicData:Nj.optional(),document:un.refine(e=>["page","popup","onboarding"].includes(e.surface)&&e.pages.length===1&&e.actions.every(t=>t.type==="event"&&!t.close),"A Funnel owns one Page or Popup per screen and emits outputs; Paywall owns its purchase policies")}),n.strictObject({id:Cr,type:n.literal("paywall"),paywallVersionId:n.uuid()})]),H_={kind:n.literal("funnel"),schemaVersion:n.literal(4),screens:n.array(rH).max(Kr.pages),references:n.record(Cr,zl).refine(e=>Object.keys(e).length<=500),inputs:n.array(n.strictObject({variable:Cr,screenId:Cr,componentId:Cr,required:n.boolean()})).max(Kr.questions),variables:n.record(Wt,Ws).refine(e=>Object.keys(e).length<=Kr.logicNodes),outputSchema:Ks,execution:n.strictObject({runTimeoutSeconds:n.number().int().min(1).max(U_.runTimeoutSeconds),maxTransitions:n.number().int().min(1).max(U_.maxTransitions)})},yL=n.strictObject({...H_,graph:z_});aH=n.strictObject({...H_,graph:mc}).superRefine(AL),go=n.strictObject({...H_,graph:mc,displayName:n.string().trim().min(1).max(80)}).superRefine(AL),sH=go.superRefine(bL),mue=aH.superRefine(bL),bh=n.string().regex(so),Bl={requestId:n.uuid(),nodeId:Cr,visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),customerToken:bh.optional()},cH=n.discriminatedUnion("type",[n.strictObject({type:n.literal("screen"),output:Cr,answers:Gr,selection:n.record(Cr,n.union([n.string().max(200),n.boolean(),n.number().int().min(0).max(1e4)])).optional()}),n.strictObject({type:n.literal("paywall_quote"),featureQuantities:n.record(n.uuid(),n.number().int().min(0).max(1e4)).refine(e=>Object.keys(e).length<=100).optional(),actionId:Cr,productVersionId:n.uuid(),offerId:n.uuid().optional(),nativeOffer:Xs.optional(),predecessor:n.strictObject({operationId:n.uuid().nullable(),generation:n.number().int().positive()}).optional()}),n.strictObject({type:n.literal("paywall_confirm"),operationId:n.uuid()}),n.strictObject({type:n.literal("paywall_cancel"),operationId:n.uuid()}),n.strictObject({type:n.literal("client_action"),receiptId:n.uuid(),outcome:n.enum(["success","cancel","failure","opened","failed"])})]),uH=n.object({nodeId:Cr,visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),components:n.record(Cr,n.object({resourceKey:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/).optional(),page:n.number().int().min(1).max(1e5),after:sh.nullable(),filter:n.enum(["all","purchase","refund","source","usage","debt","settlement","issued","reserved","redeemed","expired","revoked"])}).strict()).refine(e=>Object.keys(e).length<=150)}).strict(),hc=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("start"),funnelId:n.uuid(),requestId:n.uuid(),customer:lc.optional(),customerData:dc.optional(),locale:n.string().min(1).max(35),parameters:Vn}).refine(ba,Aa),n.strictObject({operation:n.literal("get"),settlementRequestId:n.uuid().optional(),data:uH.optional(),purchase:n.strictObject({receiptId:n.uuid(),operationId:n.uuid()}).optional(),customerToken:bh.optional()}),n.strictObject({operation:n.literal("resume"),requestId:n.uuid(),customerToken:bh.optional()}),n.strictObject({operation:n.literal("submit"),...Bl,input:cH}),n.strictObject({operation:n.literal("back"),...Bl}),n.strictObject({operation:n.literal("shown"),...Bl}),n.strictObject({operation:n.literal("close"),...Bl}),n.strictObject({operation:n.literal("commit_segment"),...Bl,policyRevision:n.number().int().nonnegative(),generation:n.string().min(1).max(256)}),n.strictObject({operation:n.literal("review"),receiptId:n.uuid().optional(),customerToken:bh.optional()})])});function xh(e,t){let r=new Set,i=new Set,o=new Set,a=[],s=new Map,c=new Map,u=new Map;function l(m){for(let g of ki(m))d(g)}function d(m){if(o.has(m)||!Object.hasOwn(t.savedGroups,m))return;let g=t.savedGroups[m];g&&(o.add(m),u.set(m,g),a.push(()=>{!Array.isArray(g)&&g.type==="condition"&&l(g.condition)}))}function p(m){for(let g of["hashAttribute","fallbackAttribute"])if(m[g]!==void 0&&w_(m[g]))throw new Error(`Funnel GB ${g} uses a reserved flow namespace`);l(m.condition);for(let g of m.parentConditions??[])h(g.id),l(g.condition)}function h(m,g=!1){let A=Object.hasOwn(t.features,m)?t.features[m]:void 0;if(!A){if(g)throw new Error("Required GB Feature is unavailable");return}r.has(m)||(r.add(m),s.set(m,A),a.push(()=>{for(let C of A.rules??[]){p(C);for(let w of C.tracks??[])p(w.experiment)}}))}function f(m){let g=Object.hasOwn(t.experiments,m)?t.experiments[m]:void 0;if(!g)throw new Error("Required GB Experiment is unavailable");i.has(m)||(i.add(m),c.set(m,g),a.push(()=>p(g)))}for(let m of e.graph.nodes){m.type==="feature"&&h(m.featureKey,!0),m.type==="split"&&f(m.experimentId),m.type==="condition"&&m.cases.forEach(A=>l(A.condition)),m.type==="offering"&&m.configuration.source==="feature"&&h(m.configuration.featureKey,!0);let g=m.type==="output"?m.value:m.type==="end"?m.output:null;g?.type==="feature"&&h(g.featureKey,!0)}for(let m of a)m();return{...t,features:Object.fromEntries(s),experiments:Object.fromEntries(c),savedGroups:Object.fromEntries(u)}}var G_=x(()=>{"use strict";Zt();sc()});function ql(e,t,r=1){if(e==="free")return"";if(e==="one_time")return t.startsWith("zh")?" \xB7 \u4E00\u6B21\u4ED8\u6B3E":" \xB7 one-time";let i=t.split("-")[0]??"en",o={zh:["/\u6708","/\u5E74"],en:["/month","/year"],ja:["/\u6708","/\u5E74"],ko:["/\uC6D4","/\uB144"],es:["/mes","/a\xF1o"],fr:["/mois","/an"],de:["/Monat","/Jahr"],pt:["/m\xEAs","/ano"],it:["/mese","/anno"],ar:["/\u0634\u0647\u0631","/\u0633\u0646\u0629"]},a={zh:"\u5468",en:"week",ja:"\u9031",ko:"\uC8FC",es:"semana",fr:"semaine",de:"Woche",pt:"semana",it:"settimana",ar:"\u0623\u0633\u0628\u0648\u0639"},s=e==="week"?`/${a[i]??a.en}`:(o[i]??o.en)[e==="month"?0:1];return r===1?s:`/${r} ${s.slice(1)}${i==="en"?"s":""}`}var K_=x(()=>{"use strict"});function xL(e,t){let r=[],i={};cn(e,o=>{if(o.hidden)return!1;if(o.type!=="quantity_picker")return;let a=o.bind?.plan?[o.bind.plan]:[];o.bind?.picker&&cn(e,s=>{if(s.type==="plan_picker"&&s.id===o.bind?.picker&&a.push(...s.planIds??[]),s.type==="stack"&&s.interaction?.type==="select"&&s.interaction.pickerId===o.bind?.picker)for(let c of s.children)c.type==="stack"&&c.bind?.plan&&a.push(c.bind.plan)}),a.length||r.push(`Quantity control ${o.id} needs a Product binding`);for(let s of new Set(a)){let c=t[s]?.prepaid?.find(l=>l.internalFeatureId===o.internalFeatureId)?.terms,u=i[s]??=new Set;(!c||u.has(o.internalFeatureId)||o.minimumQuantity<c.minimumQuantity||o.maximumQuantity>c.maximumQuantity)&&r.push(`Quantity control ${o.id} must match its Product's prepaid Feature and bounds`),u.add(o.internalFeatureId)}});for(let[o,a]of Object.entries(t))for(let s of a.prepaid??[])i[o]?.has(s.internalFeatureId)||r.push(`Product ${o} needs a quantity control for ${s.internalFeatureId}`);return r}function yc(e,t,r,i){let o=i.plans[t];if(!o?.available)throw new Error("Selected Product is unavailable");let a={};if(cn(e,s=>{if(s.hidden)return!1;if(s.type!=="quantity_picker"||s.hidden||(s.bind?.plan??(s.bind?.picker?r[s.bind.picker]:void 0))!==t)return;let u=o.prepaid?.find(d=>d.internalFeatureId===s.internalFeatureId)?.terms,l=r[s.id];if(!u||typeof l!="number"||!Number.isSafeInteger(l)||l<Math.max(u.minimumQuantity,s.minimumQuantity)||l>Math.min(u.maximumQuantity,s.maximumQuantity)||(l-s.minimumQuantity)%s.step!==0||a[s.internalFeatureId]!==void 0)throw new Error("Choose a valid quantity for each prepaid Feature");a[s.internalFeatureId]=l}),(o.prepaid??[]).some(s=>a[s.internalFeatureId]===void 0))throw new Error("Choose a quantity for each prepaid Feature");return a}function lH(e,t,r){let i=e.terms.prices.find(o=>o.currency===t);if(!i||r<e.terms.minimumQuantity||r>e.terms.maximumQuantity)throw new Error("Quantity or currency is unavailable");return{amountMinor:Ts({quantity:r,unitAmountMinor:i.amountMinor,...i.pricing?{pricing:i.pricing}:{}}),allowance:Ds(e.includedAmount,e.terms.units,r)}}function Zl(e,t,r,i){let o=!1;if(cn(e,c=>{c.type==="quantity_picker"&&(o=!0)}),!o)return t;let a=structuredClone(t);a.quantities={};let s=new Map;cn(e,c=>{if(c.hidden)return!1;if(c.type!=="quantity_picker")return;let u=c.bind?.plan??(c.bind?.picker?r[c.bind.picker]??a.pickers[c.bind.picker]?.selected:void 0),l=typeof u=="string"?a.plans[u]:void 0,d=l?.prepaid?.find(w=>w.internalFeatureId===c.internalFeatureId),p=Math.max(c.minimumQuantity,d?.terms.minimumQuantity??0),h=Math.min(c.maximumQuantity,d?.terms.maximumQuantity??0),f=r[c.id]??c.defaultQuantity,m=typeof f=="number"&&Number.isSafeInteger(f)?f:c.defaultQuantity,g=!!d&&!!l?.available&&m>=p&&m<=h&&(m-c.minimumQuantity)%c.step===0,A=a.quantities[c.id]={minimum:p,maximum:Math.max(p,h),step:c.step,value:m,label:"",available:g};if(!g||!d||!l?.currency||l.amountMinor===void 0)return;let C=lH(d,l.currency,m);A.label=`${new Intl.NumberFormat(i).format(Number(C.allowance))} ${d.name}${["week","month","year"].includes(d.reset)?ql(d.reset,i,d.resetCount):d.reset==="lifetime"?"":` / ${d.resetCount} ${d.reset}`}`,s.set(String(u),(s.get(String(u))??l.amountMinor)+C.amountMinor)});for(let[c,u]of s){let l=a.plans[c];if(!l?.currency)continue;let d=Cs(u,l.currency,i);l.price=d;for(let[p,h]of Object.entries(a.nodes)){let f=Pn(e,p),m=g=>{if(g.price&&(g.price={...g.price,current:d,original:null}),f?.type==="text"){let A=e.strings.locales[i]?.[f.text]??e.strings.locales[e.strings.defaultLocale]?.[f.text];A?.includes("{{plan.price")&&(g.text=A.replace(/\{\{\s*plan.price\s*\}\}/g,d).replace(/\{\{\s*plan.price_per_month\s*\}\}/g,Cs(Math.round(u/((l.interval==="year"?12:1)*(l.intervalCount??1))),l.currency,i)))}};h.byPlan?.[c]&&m(h.byPlan[c]),(h.base.planVersionId===c||f&&"bind"in f&&f.bind?.plan===c)&&m(h.base)}}return a}var Sh=x(()=>{"use strict";Xu();Rs();Ir();qt();K_();Ew()});var SL,W_=x(()=>{"use strict";ee();Fs();SL=n.object({defaultLocale:Un,locales:n.record(Un,n.object({name:n.string().max(80),description:n.string().max(500)}).strict())}).strict().superRefine((e,t)=>{let r=Object.keys(e.locales);(!r.length||r.length>20||!e.locales[e.defaultLocale])&&t.addIssue({code:"custom",message:"Invalid content languages"}),new TextEncoder().encode(JSON.stringify(e)).length>5e4&&t.addIssue({code:"custom",message:"Content exceeds 50 KB"})})});var dH,pH,vL,vh,mH,fH,hH,gH,yH,bH,wL,_L,J_=x(()=>{"use strict";ee();Sh();qt();ic();oo();W_();Xf();Qf();nh();Ir();nc();dH=["customer_data","coupon_code"],pH=n.string().min(1).max(255).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),vL=n.string().min(1).max(255).regex(/^[a-z0-9][a-z0-9-]*$/),vh=(e,t)=>new Set(e.map(t)).size===e.length,mH=n.strictObject({currency:Oe,amountMinor:n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}),fH=n.strictObject({featureId:n.uuid(),name:n.string().trim().min(1).max(120),allowance:n.string().max(40).nullable(),access:n.boolean()}),hH=n.strictObject({stripe:n.strictObject({prices:n.array(mH).min(1).max(50)}).optional(),apple:n.strictObject({productIds:n.array(pH).min(1).max(10)}).optional(),google:n.strictObject({products:n.array(n.strictObject({productId:vL,basePlanId:vL.nullable()})).min(1).max(10)}).optional()}).superRefine((e,t)=>{(e.stripe&&!vh(e.stripe.prices,r=>r.currency)||e.apple&&!vh(e.apple.productIds,r=>r)||e.google&&!vh(e.google.products,r=>`${r.productId}:${r.basePlanId}`))&&t.addIssue({code:"custom",message:"Duplicate channel entry"})}),gH=n.strictObject({name:n.string().trim().min(1).max(80),interval:n.enum(["free","week","month","year","one_time"]),intervalCount:n.number().int().min(1).max(100),trial:n.strictObject({days:n.number().int().min(1).max(730),cardRequired:n.boolean()}).nullable(),benefits:n.array(fH).max(50).refine(e=>vh(e,t=>t.featureId),"Duplicate benefit"),channels:hH,prepaid:n.array(xl).max(100).optional()}),yH=n.strictObject({digest:fo,content:n.strictObject({discount:io,duration:lr,appliesTo:dw,displayCopy:SL.nullable(),firstPurchaseOnly:n.boolean(),qualificationRequired:n.boolean(),startsAt:n.iso.datetime().nullable(),endsAt:n.iso.datetime().nullable(),grantWindowHours:n.number().int().positive(),perCustomerLimit:n.number().int().positive()})}),bH=n.discriminatedUnion("type",[n.strictObject({type:n.literal("checkout"),product:Yf}),n.strictObject({type:n.literal("close")}),n.strictObject({type:n.literal("action"),action:l_})]),wL=n.strictObject({kind:n.literal("paywall"),formatVersion:n.literal(1),name:n.string().trim().min(1).max(80),offeringVersionId:n.uuid(),presentation:Oi,screen:un,products:Jf,catalog:n.record(n.uuid(),gH),buttons:n.record(ut,bH),coupons:n.record(n.uuid(),yH)}).superRefine((e,t)=>{let r=g=>t.addIssue({code:"custom",message:g}),{screen:i}=e;xL(i,e.catalog).forEach(r),i.surface!=="paywall"&&r("Screen must be a Paywall"),y_(i,dH).forEach(r),Ci(i).some(g=>!g.complete)&&r("Every published locale must be complete");let o=new Set,a=new Set,s=new Set;cn(i,g=>{let A="bind"in g?g.bind:void 0;A?.promotionCode&&r("Promotion codes must not be published"),A?.plan&&o.add(A.plan),A?.coupon&&a.add(A.coupon),g.type==="plan_picker"&&(g.planIds?.forEach(C=>o.add(C)),g.defaultPlan&&o.add(g.defaultPlan)),g.type==="text"&&g.feature&&s.add(g.feature.id)});let c=e.products.items.map(g=>g.productVersionId),u=Object.keys(e.catalog);(c.length!==u.length||c.some(g=>!Object.hasOwn(e.catalog,g)))&&r("Catalog must contain exactly the displayed Products");let l=new Set(c);e.products.defaultProductVersionId!==null&&!l.has(e.products.defaultProductVersionId)&&r("Default Product must be displayed");for(let g of o)l.has(g)||r("Screen references a Product that is not displayed");for(let g of Object.values(e.catalog))!g.channels.stripe&&!g.channels.apple&&!g.channels.google&&r("A displayed Product needs at least one sales channel");let d=new Set(Object.values(e.catalog).flatMap(g=>g.benefits.map(A=>A.featureId)));for(let g of s)d.has(g)||r("Feature text must read a displayed benefit");let p=i.actions.filter(g=>g.type!=="navigate");i.actions.some(g=>g.type!=="event"&&g.type!=="navigate")&&r("Paywall actions are events or navigation"),(Object.keys(e.buttons).length!==p.length||p.some(g=>!Object.hasOwn(e.buttons,g.id)))&&r("Buttons must match the screen's actions");let f=!1;for(let g of Object.values(e.buttons)){if(g.type!=="checkout")continue;f=!0,(g.product.type==="fixed"?[g.product.productVersionId]:g.product.allowedProductVersionIds).some(C=>!l.has(C))&&r("Checkout may only sell displayed Products")}f||r("A Paywall needs a checkout button");let m=Object.keys(e.coupons);(m.length!==a.size||m.some(g=>!a.has(g)))&&r("Coupons must be exactly the bound Coupons")}),_L=n.strictObject({state:n.enum(["published","archived"]),controlRevision:n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),currentVersionId:n.uuid(),versions:n.record(n.uuid(),n.strictObject({version:n.number().int().positive(),artifact:n.string().min(1),sourceDigest:n.string().regex(/^[a-f0-9]{64}$/)}))}).refine(e=>Object.keys(e.versions).length>0,"Reviewed Paywall Versions are required")});function _n(e){if(Array.isArray(e))return`[${e.map(_n).join(",")}]`;if(e!==null&&typeof e=="object")return`{${Object.entries(e).sort(([r],[i])=>r<i?-1:r>i?1:0).map(([r,i])=>`${JSON.stringify(r)}:${_n(i)}`).join(",")}}`;let t=JSON.stringify(e);if(t===void 0)throw new Error("Configuration must contain JSON values");return t}function nI(e){return $s(Ls(typeof e=="string"?new TextEncoder().encode(e):e))}function kL(e){return nI(_n(e))}function EL(e,t){for(let s of Object.values(e.references))if(s.type==="flag"&&(!Object.hasOwn(t.features,s.key)||t.remoteFeatures.includes(s.key))||s.type==="experiment"&&!Object.hasOwn(t.experiments,s.id)||s.type==="saved_group"&&!Object.hasOwn(t.savedGroups,s.id))throw new Error("Funnel dependency is absent from GB public delivery");let r=xh(e,{...t,evaluatedAt:new Date(0).toISOString(),expiresAt:null}),i=new Set(t.remoteFeatures);for(let s of e.graph.nodes){let c=s.type==="feature"?s.featureKey:s.type==="end"&&s.output?.type==="feature"?s.output.featureKey:s.type==="output"&&s.value.type==="feature"?s.value.featureKey:void 0;if(!c)continue;let u=r.features[c],l=s.type==="feature"?e.variables[s.writes.value]:e.outputSchema;if(!u||!l)throw new Error("Required public Feature declaration is unavailable");if([u.defaultValue,...(u.rules??[]).flatMap(p=>[...Object.hasOwn(p,"force")?[p.force]:[],...p.variations??[],...(p.tracks??[]).flatMap(h=>h.experiment.variations)])].some(p=>p===void 0||!kr(l,p)))throw new Error("GB Feature values violate the Funnel type contract")}let o=new Set,a=s=>{for(let c of ki(s)){if(o.has(c))continue;let u=t.savedGroups[c];if(!u)throw new Error("Required public Saved Group is unavailable");o.add(c),!Array.isArray(u)&&u.type==="condition"&&a(u.condition)}};for(let s of e.graph.nodes)if(s.type==="condition")for(let c of s.cases)a(c.condition);for(let s of Object.values(r.features))for(let c of s.rules??[]){a(c.condition);for(let u of[...c.parentConditions??[],...(c.tracks??[]).flatMap(l=>l.experiment.parentConditions??[])]){if(i.has(u.id)||!t.features[u.id])throw new Error("Local Funnel requires public Local prerequisites");a(u.condition)}for(let u of c.tracks??[])a(u.experiment.condition)}for(let s of Object.values(r.experiments)){a(s.condition);for(let c of s.parentConditions??[]){if(i.has(c.id)||!t.features[c.id])throw new Error("Local Funnel requires public Local prerequisites");a(c.condition)}}for(let s of e.graph.nodes)if(s.type==="split"){let c=r.experiments[s.experimentId];if(!c)throw new Error("Local Funnel requires a public Experiment");for(let u=0;u<c.variations.length;u++){let l=c.meta?.[u]?.key??String(u);if(!s.routes[l])throw new Error("Experiment variation has no declared Funnel route")}}return IL.parse({features:Object.keys(r.features).sort(),experiments:Object.fromEntries(Object.entries(r.experiments).map(([s,c])=>[s,c.variations.map((u,l)=>c.meta?.[l]?.key??String(l))])),savedGroups:[...o].sort()})}function CL(e){return go.parse(e)}var Pr,Q_,Y_,X_,IL,eI,AH,tI,rI=x(()=>{"use strict";ee();lf();js();cr();ic();th();gc();G_();Zt();J_();Pr={manifestCdnSeconds:15,maxControlAgeMs:6e4,initializationMs:5e3,maxArtifactBytes:1048576,maxManifestBytes:524288,maxCacheBytes:32*1048576,retentionMs:7*864e5},Q_=n.string().regex(/^[a-f0-9]{64}$/),Y_=n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),X_=yt.extend({environmentId:n.uuid()}),IL=n.strictObject({features:n.array(n.string()).max(500),experiments:n.record(n.uuid(),n.array(n.string()).max(20)),savedGroups:n.array(n.string()).max(1e3)}),eI=n.strictObject({kind:n.enum(["funnel","paywall","gb_features","gb_page_experiments"]),formatVersion:n.number().int().positive(),url:n.string().min(1).max(2048),sha256:Q_,byteLength:n.number().int().positive().max(Pr.maxArtifactBytes),generation:Q_.optional()}),AH=n.strictObject({state:n.enum(["active","paused","archived"]),controlRevision:Y_,evaluationMode:n.enum(["local","remote"]),evaluationRevision:Y_,currentVersionId:n.uuid(),versions:n.record(n.uuid(),n.strictObject({artifact:n.string(),dependencies:IL,definitionDigest:fo.optional(),couponDigests:n.record(n.uuid(),fo).optional()}))}),tI=n.strictObject({kind:n.literal("sdk_configuration"),schemaVersion:n.literal(1),scope:X_,revision:Y_,generation:Q_,policy:n.strictObject({refreshIntervalSeconds:n.number().positive().max(15),maxControlAgeSeconds:n.number().positive().max(60)}),gb:n.strictObject({features:n.string().nullable(),pageExperiments:n.string().nullable()}),artifacts:n.record(n.string(),eI),funnels:n.record(n.uuid(),AH),paywalls:n.record(n.uuid(),_L).optional()}).superRefine((e,t)=>{let r=(i,o)=>{i!==null&&e.artifacts[i]?.kind!==o&&t.addIssue({code:"custom",message:"Missing or wrong-kind configuration artifact"})};r(e.gb.features,"gb_features"),r(e.gb.pageExperiments,"gb_page_experiments");for(let i of Object.values(e.paywalls??{}))for(let o of Object.values(i.versions))r(o.artifact,"paywall");for(let i of Object.values(e.funnels)){i.evaluationMode==="remote"&&Object.keys(i.versions).length&&t.addIssue({code:"custom",message:"Remote Funnel graphs cannot be public"}),i.evaluationMode==="local"&&!i.versions[i.currentVersionId]&&t.addIssue({code:"custom",message:"Current Funnel Version is not retained"});for(let o of Object.values(i.versions))r(o.artifact,"funnel")}})});var PL,yo,Hl,wh=x(()=>{"use strict";Vw();ee();Sl();Zs();Xf();rI();uo();PL=n.strictObject({...Ys,selector:n.discriminatedUnion("type",[n.strictObject({type:n.literal("paywall"),paywallId:n.uuid()}),n.strictObject({type:n.literal("version"),versionId:n.uuid()})]),customerId:n.uuid().optional(),commerce:qs,locale:n.string().min(1).max(35),requirement:co.optional()}),yo=n.strictObject({id:n.uuid(),paywallId:n.uuid(),version:n.number().int().positive(),document:rc.omit({requirement:!0,offeringId:!0}),offering:n.strictObject({id:n.uuid()}),content:n.strictObject({environmentId:n.uuid(),offeringVersionId:n.uuid(),artifact:eI.refine(e=>e.kind==="paywall"&&e.formatVersion===1)}).optional(),capabilities:Hs,check:Br.nullable()}).superRefine((e,t)=>{let r=new Set(e.document.products.items.map(i=>i.productVersionId));(e.document.offeringVersionId!==e.offering.id||Object.values(e.capabilities.plans).some(i=>!r.has(i.versionId)))&&t.addIssue({code:"custom",message:"Paywall resolution must preserve the exact Offering Version and displayed Product subset"})}),Hl=n.strictObject(yo.shape).omit({document:!0,offering:!0}).extend({content:yo.shape.content.unwrap()})});var OL,TL,iI,RL,oI=x(()=>{"use strict";ee();wn();yl();OL={requestId:n.uuid(),sourceId:n.uuid(),expectedAvailable:Cn},TL=n.discriminatedUnion("action",[n.strictObject({...OL,action:n.enum(["add","subtract","set_remaining"]),amount:De}),n.strictObject({...OL,action:n.literal("edit"),granted:De,expiresAt:n.iso.datetime({offset:!0}).nullable(),nextResetAt:n.iso.datetime({offset:!0}).nullable(),expectedRevision:n.number().int().nonnegative()})]),iI=n.strictObject({sourceId:n.uuid(),available:Cn,held:Cn,spent:Cn,adjustmentGrantId:n.uuid().nullable()}),RL=iI.extend({granted:Cn,expiresAt:n.iso.datetime({offset:!0}).nullable(),nextResetAt:n.iso.datetime({offset:!0}).nullable(),revision:n.number().int().nonnegative()})});var NL,DL,aI=x(()=>{"use strict";ee();NL=n.discriminatedUnion("action",[n.object({action:n.literal("upsert"),externalId:n.string().min(1).max(128),name:n.string().trim().min(1).max(80)}).strict(),n.object({action:n.literal("archive"),entityId:n.uuid()}).strict()]),DL=n.object({id:n.uuid(),externalId:n.string().min(1).max(128),name:n.string().min(1).max(80),archived:n.boolean()}).strict()});var jL,$L,sI,va,xH,cI,fle,uI=x(()=>{"use strict";ee();jL=["input","output","cache_read","cache_write","reasoning","input_audio","output_audio"],$L=n.string().regex(/.+\/.+/),sI=n.number().min(-100),va=n.string().regex(/^(0|[1-9]\d{0,5})(\.\d{1,12})?$/),xH=n.strictObject({input:va,output:va,cache_read:va.optional(),cache_write:va.optional(),reasoning:va.optional(),input_audio:va.optional(),output_audio:va.optional()}),cI=(e,t)=>n.record(e,t).refine(r=>Object.keys(r).length<=100,"At most 100 AI overrides"),fle=n.strictObject({defaultMarkup:sI,providerMarkups:cI(n.string().min(1),sI),modelMarkups:cI($L,sI),customModels:cI($L,xH.partial())})});var wa,bo,SH,LL,vH,_a,ML,_h=x(()=>{"use strict";ee();wa=n.iso.datetime({offset:!0}),bo=n.string().regex(/^-?(0|[1-9]\d{0,23})(\.\d{1,12})?$/),SH=n.discriminatedUnion("kind",[n.object({kind:n.literal("absolute"),from:wa,to:wa}).strict(),n.object({kind:n.literal("last_days"),days:n.union([n.literal(1),n.literal(7),n.literal(30),n.literal(90)])}).strict(),n.object({kind:n.literal("billing_cycles"),membershipId:n.uuid(),count:n.number().int().min(1).max(12),includeCurrent:n.boolean()}).strict()]),LL=n.string().max(100).refine(e=>{if(e!=="UTC"&&!/^[A-Za-z_]+(?:\/[A-Za-z0-9_+\-]+)+$/.test(e))return!1;try{return new Intl.DateTimeFormat("en",{timeZone:e}),!0}catch{return!1}},"Use an IANA timezone"),vH=n.object({key:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/),values:n.array(n.string().max(120)).min(1).max(20).refine(e=>new Set(e).size===e.length)}).strict(),_a=n.object({range:SH,timezone:LL,filterBy:n.array(vH).max(5).refine(e=>new Set(e.map(t=>t.key)).size===e.length),interval:n.enum(["hour","day","week","month"]),internal_feature_id:n.uuid().nullable(),entityId:n.uuid().nullable(),topN:n.number().int().min(1).max(50).nullable(),groupBy:n.union([n.enum(["customer","entity","entitlement","source","resource","dimension","plan"]),n.string().regex(/^properties\.[a-z][a-z0-9_]{0,63}$/)]),after:n.object({bucket:wa,group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid(),resourceId:n.uuid()}).strict().nullable(),limit:n.number().int().min(1).max(100)}).strict().superRefine((e,t)=>{if(e.range.kind!=="absolute"){e.interval==="hour"&&e.range.kind==="last_days"&&e.range.days>31&&t.addIssue({code:"custom",message:"Hourly reports are bounded to 31 days"});return}let r=Date.parse(e.range.to)-Date.parse(e.range.from);(r<=0||r>366*864e5||e.interval==="hour"&&r>31*864e5)&&t.addIssue({code:"custom",message:"Reporting range must be positive and bounded (31 days hourly, 366 days otherwise)"})}),ML=n.object({from:wa,to:wa,interval:n.enum(["hour","day","week","month"]),timezone:LL,rows:n.array(n.object({bucket:wa,group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid(),resourceId:n.uuid(),consumedUnits:bo,refundedUnits:bo,reservedUnits:bo,charged:bo,refunded:bo,reserved:bo,netUnits:bo,netCharged:bo}).strict()).max(100),nextCursor:n.object({bucket:wa,group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid(),resourceId:n.uuid()}).strict().nullable()}).strict()});var bc,FL,lI,zL,UL,dI=x(()=>{"use strict";ee();uI();_h();bc=n.string().regex(/^(0|[1-9]\d{0,29})$/),FL=n.string().regex(/^(0|[1-9]\d{0,29})(\.\d{1,18})?$/),lI=n.strictObject({bucket:n.iso.datetime({offset:!0}),group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid()}),zL=n.strictObject({..._a.shape,groupBy:n.union([n.enum(["customer","entity","entitlement"]),n.string().regex(/^properties\.[a-z][a-z0-9_]{0,63}$/)]),after:lI.nullable()}).superRefine((e,t)=>{let r=_a.safeParse({...e,after:null});if(!r.success)for(let i of r.error.issues)t.addIssue({code:"custom",path:i.path,message:i.message})}),UL=n.strictObject({from:n.iso.datetime({offset:!0}),to:n.iso.datetime({offset:!0}),interval:_a.shape.interval,timezone:_a.shape.timezone,rows:n.array(n.strictObject({...lI.shape,eventCount:bc,units:FL,tokenEventCount:bc,tokens:n.strictObject(Object.fromEntries(jL.map(e=>[e,bc]))),totalTokens:bc,providerCostEventCount:bc,providerCostUsd:FL,invalidTelemetryEventCount:bc})).max(100),nextCursor:lI.nullable()})});var VL,BL,qL,pI=x(()=>{"use strict";ee();Us();VL=n.object({requestId:n.uuid(),items:n.array(n.object({customerId:n.uuid(),command:ml.options[1]}).strict()).min(1).max(1e3)}).strict().refine(e=>new Set(e.items.map(t=>t.customerId+":"+t.command.idempotencyKey)).size===e.items.length,"Each logical event must appear once in a batch"),BL=n.object({batchId:n.uuid(),after:n.number().int().min(-1).max(999),limit:n.number().int().min(1).max(100)}).strict(),qL=n.object({batchId:n.uuid(),status:n.enum(["queued","complete"]),total:n.number().int().min(1).max(1e3),processed:n.number().int().min(0).max(1e3),items:n.array(n.object({position:n.number().int().min(0).max(999),customerId:n.uuid(),idempotencyKey:n.string().min(1).max(120),status:n.enum(["queued","accepted","rejected","failed"]),receipt:fl.nullable(),errorCode:n.enum(["invalid_request","forbidden","conflict","internal_error"]).nullable()}).strict().refine(e=>e.status==="queued"?e.receipt===null&&e.errorCode===null:e.status==="failed"?e.receipt===null&&e.errorCode!==null:e.receipt!==null&&e.errorCode===null&&e.receipt.accepted===(e.status==="accepted"))).max(100),nextAfter:n.number().int().min(0).max(999).nullable()}).strict()});var wH,ZL,HL,GL,_H,IH,kH,EH,KL,WL,mI,JL,QL,CH,PH,Cle,Ple,Ole,YL,XL,e2,OH,t2,n2,r2,Tle,Rle,TH,RH,Nle,Dle,fI=x(()=>{"use strict";ee();qt();oo();wH=n.enum(["percentage_discount","fixed_discount","free_product","invoice_credits","feature_grant"]),ZL=n.enum(["draft","active","paused","archived"]),HL=n.string().min(1).max(256),GL=n.array(HL).max(50).refine(e=>new Set(e).size===e.length,"Duplicate products"),_H=n.strictObject({duration:n.enum(["day","week","month","year"]),length:n.number().int().min(1).max(3660)}),IH=n.strictObject({internal_feature_id:n.uuid(),allowance:n.number().nonnegative().max(1e15).nullable(),expiry:_H.nullable()}),kH=n.discriminatedUnion("type",[n.strictObject({type:n.literal("feature_grant"),grants:n.array(IH).min(1).max(100).refine(e=>new Set(e.map(t=>t.internal_feature_id)).size===e.length,"Duplicate entitlement grants")}),n.strictObject({type:n.literal("free_product"),productId:HL,duration:lr}),n.strictObject({type:n.literal("invoice_credits"),amount:n.number().positive().max(1e8),duration:lr,rollover:n.boolean(),productIds:GL})]),EH=n.string().regex(/^[a-zA-Z0-9_-]{1,64}$/),KL=n.object({key:EH,name:n.string().trim().min(1).max(80),configuration:kH}).strict(),WL=n.string().regex(/^[A-Z0-9][A-Z0-9_-]{2,31}$/),mI=n.object({code:WL,maxUses:n.number().int().min(1).max(1e6).nullable(),firstPurchaseOnly:n.boolean()}).strict(),JL=n.object({key:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/),name:n.string().trim().min(1).max(80),rewardId:n.uuid(),redeemOn:n.enum(["customer_creation","checkout"]),receivedBy:n.enum(["referrer","all"]),maxRedemptions:n.number().int().min(1).max(1e6).nullable(),productIds:GL,excludeTrial:n.boolean()}).strict().refine(e=>e.redeemOn==="checkout"||e.productIds.length===0&&!e.excludeTrial,"Purchase restrictions require checkout trigger"),QL={id:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),revision:n.number().int().nonnegative(),status:ZL,createdAt:n.iso.datetime({offset:!0}),updatedAt:n.iso.datetime({offset:!0})},CH=KL.extend(QL).strict(),PH=JL.safeExtend(QL).strict(),Cle=n.strictObject({id:n.uuid(),key:n.string(),name:n.string(),type:wH,status:ZL}),Ple=n.discriminatedUnion("action",[n.object({action:n.literal("save"),id:n.uuid().nullable(),revision:n.number().int().nonnegative(),input:KL}).strict(),n.object({action:n.enum(["activate","pause","resume","archive","delete"]),id:n.uuid(),revision:n.number().int().nonnegative()}).strict()]),Ole=n.discriminatedUnion("action",[n.object({action:n.literal("save"),id:n.uuid().nullable(),revision:n.number().int().nonnegative(),input:JL}).strict(),n.object({action:n.enum(["activate","pause","resume","archive","delete"]),id:n.uuid(),revision:n.number().int().nonnegative()}).strict()]),YL=n.object({id:n.uuid(),rewardId:n.uuid(),programId:n.uuid().nullable(),customerId:n.uuid(),referrerId:n.uuid().nullable(),status:n.enum(["pending","applied","unavailable"]),result:n.record(n.string(),n.unknown()).nullable(),createdAt:n.iso.datetime({offset:!0})}).strict(),XL=n.object({code:WL,requestId:n.uuid()}).strict(),e2=n.strictObject({redemptionId:n.uuid(),currency:Oe,requestId:n.uuid(),accepted:n.literal(!0)}),OH=n.strictObject({type:n.literal("checkout"),orderId:n.uuid(),productVersionId:n.uuid(),currency:Oe,duration:lr,renewalAmountMinor:n.number().int().positive().max(1e8),status:n.enum(["created","pending","trialing","paid","cancelled","failed"]),url:n.url().nullable()}),t2=n.discriminatedUnion("type",[OH,n.strictObject({type:n.literal("subscription"),operationId:n.uuid(),membershipId:n.uuid(),productVersionId:n.uuid(),currency:Oe,duration:lr,renewalAmountMinor:n.number().int().positive().max(1e8),status:n.enum(["pending","running","applied","failed"])})]),n2=n.object({programId:n.uuid(),requestId:n.uuid()}).strict(),r2=n.object({id:n.uuid(),programId:n.uuid(),code:mI.shape.code,createdAt:n.iso.datetime({offset:!0})}).strict(),Tle=n.object({rows:n.array(CH).max(100),nextCursor:n.uuid().nullable()}).strict(),Rle=n.object({rows:n.array(PH).max(100),nextCursor:n.uuid().nullable()}).strict(),TH=mI.extend({id:n.uuid(),redemptions:n.number().int().nonnegative()}).strict(),RH=n.strictObject({id:n.uuid(),programId:n.uuid().nullable(),customerId:n.uuid().nullable(),referrerId:n.uuid().nullable(),code:n.string().nullable(),status:n.enum(["pending","triggered","applied"]),createdAt:n.iso.datetime({offset:!0})}),Nle=n.object({codes:n.array(TH).max(100),redemptions:n.array(RH).max(100),customers:n.record(n.uuid(),n.string()),codesCursor:n.uuid().nullable(),redemptionsCursor:n.uuid().nullable()}).strict(),Dle=n.discriminatedUnion("action",[n.object({action:n.literal("create"),rewardId:n.uuid(),revision:n.number().int().nonnegative(),input:mI}).strict(),n.object({action:n.literal("remove"),rewardId:n.uuid(),revision:n.number().int().nonnegative(),codeId:n.uuid()}).strict()])});var di,Gl,hI,NH,Kl,DH,i2,o2,a2,Lle,s2,$H,c2,jH,gI,yI,LH,MH,FH,Mle,bI=x(()=>{"use strict";ee();di={repositories:20,branches:4,keys:2e3,references:1e4,referencesPerKey:2e3,reportBytes:1048576,files:1e4,sourceBytes:1e8},Gl=e=>new Set(e).size===e.length,hI=n.string().regex(/^[a-zA-Z0-9_.:|-]{1,256}$/),NH=n.string().max(512).regex(/^[\w.-]+(?:\/[\w.-]+){1,5}$/).refine(e=>!e.split("/").some(t=>t==="."||t==="..")),Kl=n.string().min(1).max(200).regex(/^[a-zA-Z0-9_./-]+$/).refine(e=>!e.includes("..")&&!e.endsWith(".")&&!e.split("/").some(t=>!t||t.startsWith(".")||t.endsWith(".lock"))),DH=n.string().min(1).max(512).refine(e=>!/[\\\u0000-\u001f\u007f]/.test(e)&&!e.startsWith("/")&&!e.split("/").some(t=>!t||t==="."||t==="..")),i2=n.string().min(1).max(256).regex(/^[a-zA-Z0-9_./*?-]+$/).refine(e=>!e.startsWith("/")&&!e.split("/").some(t=>!t||t==="."||t==="..")),o2=n.strictObject({id:n.uuid(),repo:NH,platform:n.enum(["github","gitlab","bitbucket"]),branches:n.array(Kl).min(1).max(4).refine(Gl),workflow:n.string().regex(/^\.github\/workflows\/[a-zA-Z0-9_-]+\.ya?ml$/),keyIds:n.array(n.uuid()).min(1).max(4).refine(Gl),include:n.array(i2).min(1).max(16),exclude:n.array(i2).max(16),methods:n.array(n.string().regex(/^[a-zA-Z_$][\w$]{0,63}$/)).min(1).max(32).refine(Gl),maxAgeHours:n.number().int().min(1).max(720)}),a2=o2.extend({revision:n.number().int().positive()}),Lle=n.strictObject({repository:o2,expectedRevision:n.number().int().min(0)}).refine(({repository:e})=>e.platform==="gitlab"||e.repo.split("/").length===2,{path:["repository","repo"]}),s2=n.strictObject({repositoryId:n.uuid(),branch:Kl}),$H=n.array(hI).max(di.keys).refine(Gl),c2=n.strictObject({repository:a2.omit({keyIds:!0}),branch:Kl,keys:$H,keySetHash:n.string().regex(/^[a-f0-9]{64}$/)}),jH=n.strictObject({filePath:DH,startingLineNumber:n.number().int().min(1).max(1e7)}),gI=n.strictObject({protocol:n.literal(1),repositoryId:n.uuid(),branch:Kl,workflow:n.string().max(200),configurationRevision:n.number().int().positive(),keySetHash:n.string().regex(/^[a-f0-9]{64}$/),commit:n.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),scanId:n.uuid(),runNumber:n.number().int().min(1).max(Number.MAX_SAFE_INTEGER),runAttempt:n.number().int().min(1).max(1e4),scannerVersion:n.literal("1"),scannedAt:n.iso.datetime({offset:!0}),coverage:n.strictObject({complete:n.literal(!0),files:n.number().int().min(0).max(di.files),sourceBytes:n.number().int().min(0).max(di.sourceBytes),unresolvedCalls:n.number().int().min(0).max(1e6),unsupportedFiles:n.number().int().min(0).max(di.files)}),features:n.array(n.strictObject({key:hI,refs:n.array(jH).max(di.referencesPerKey)})).max(di.keys)}).superRefine((e,t)=>{Gl(e.features.map(r=>r.key))||t.addIssue({code:"custom",path:["features"],message:"Duplicate feature"}),e.features.reduce((r,i)=>r+i.refs.length,0)>di.references&&t.addIssue({code:"custom",path:["features"],message:"Reference budget exceeded"})}),yI=n.strictObject({scanId:n.uuid(),commit:n.string(),receivedAt:n.string(),references:n.number().int().nonnegative(),removedReferences:n.number().int().nonnegative()}),LH=yI.extend({repositoryId:n.uuid(),branch:Kl,workflow:n.string(),digest:n.string(),configurationRevision:n.number().int().positive(),runNumber:n.number().int().positive(),runAttempt:n.number().int().positive(),scannedAt:n.string(),keySetHash:n.string(),coverage:gI.shape.coverage}),MH=n.strictObject({repositories:n.array(a2).max(di.repositories),scans:n.array(LH).max(di.repositories*di.branches)}),FH=n.strictObject({key:hI,references:n.number().int().nonnegative(),coveredTargets:n.number().int().nonnegative(),expiredTargets:n.number().int().nonnegative(),uncertainTargets:n.number().int().nonnegative()}),Mle=n.strictObject({available:n.boolean().default(!0),settings:MH,expectedTargets:n.number().int().min(0).max(80),features:n.array(FH).max(2001),truncated:n.boolean()})});var l2,d2,p2,m2,u2,f2,AI=x(()=>{"use strict";ee();l2={customerId:n.uuid(),eventId:n.string().trim().min(1).max(200),grantId:n.uuid(),occurredAt:n.iso.datetime({offset:!0})},d2=n.strictObject({...l2,productVersionId:n.uuid(),subscriptionId:n.string().trim().min(1).max(255)}),p2=n.strictObject({...l2,merchandiseId:n.uuid()}),m2=n.union([d2,p2]),u2={id:n.uuid(),couponId:n.uuid(),status:n.literal("redeemed"),source:n.literal("merchant"),recordedAt:n.iso.datetime({offset:!0})},f2=n.union([d2.extend(u2),p2.extend(u2)])});var xI,zH,h2,qle,g2,SI,y2,Wl,b2,vI=x(()=>{"use strict";ee();zf();zf();xI=n.strictObject({name:n.string().trim().min(1).max(255),memo:n.string().max(1e4).nullable().optional(),footer:n.string().max(1e4).nullable().optional(),net_terms_days:n.number().int().positive().nullable().optional()}),zH=xI.extend({id:n.string().min(1).max(255),created_at:n.number().nullable()}),h2=n.strictObject({items:n.array(zH).max(50),nextCursor:n.uuid().nullable()}),qle=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),requestId:n.uuid(),values:xI}),n.strictObject({action:n.literal("update"),id:n.string().min(1).max(255),values:xI}),n.strictObject({action:n.literal("delete"),id:n.string().min(1).max(255)})]),g2=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),requestId:n.uuid(),params:ec}),n.strictObject({action:n.enum(["finalize","send","pay","void"]),requestId:n.uuid(),invoiceId:n.uuid()}),n.strictObject({action:n.literal("reissue"),requestId:n.uuid(),invoiceId:n.uuid(),params:Hw})]),SI=n.strictObject({id:n.uuid(),customerId:n.uuid(),providerInvoiceId:n.string().nullable(),status:n.enum(["draft","open","paid","void","uncollectible"]),currency:n.string(),totalMinor:n.string().regex(/^-?\d+$/),paidMinor:n.string().regex(/^\d+$/),refundedMinor:n.string().regex(/^\d+$/),hostedInvoiceUrl:n.url().nullable(),createdAt:n.number(),collectionMethod:n.enum(["send_invoice","charge_automatically"]).nullable()}),y2=SI.extend({lines:n.array(n.strictObject({id:n.uuid(),description:n.string(),amountMinor:n.string().regex(/^-?\d+$/),netAmountMinor:n.string().regex(/^-?\d+$/),quantity:n.number().nullable(),periodStart:n.number().nullable(),periodEnd:n.number().nullable()})).max(1e3)}),Wl=n.strictObject({taskId:n.uuid(),status:n.enum(["ready","running","done","dead"]),invoice:SI.nullable(),errorCode:n.string().nullable()}),b2=n.strictObject({items:n.array(SI).max(50),nextCursor:n.uuid().nullable(),operations:n.array(Wl).max(50),operationsLimited:n.boolean()})});function x2(){return le.extend({offer:ol.nullable(),reason:_D.nullable()})}var UH,A2,Dde,le,VH,BH,ae,$de,S2=x(()=>{"use strict";Bs();kw();Uw();Vw();wn();wn();Jw();Xw();t_();n_();i_();o_();Xm();Zs();Wf();u_();wh();Sl();oI();vf();aI();Aw();dI();_h();pI();fI();Us();yl();Iw();cl();ee();f0();bI();Sw();Tl();cr();xa();oo();AI();th();vI();UH=n.enum(["customers:read","customers:write","entitlements:read","content:read","sessions:create","funnels:run","offers:resolve","offers:grant","billing:read","billing:write","credits:read","credits:consume","credits:manage","features:read","events:write","messaging:write","code-references:read","code-references:write","app-manifests:write"]),A2={scope:yt,permissions:n.array(UH),expiresAt:n.iso.datetime().nullable()},Dde=n.discriminatedUnion("kind",[n.object({...A2,kind:n.literal("server"),keyId:n.string().min(1)}),n.object({...A2,kind:n.literal("customer"),customerId:n.string().min(1),identityKind:n.enum(["identified","guest"]),expiresAt:n.iso.datetime()})]),le=n.object({requestId:n.uuid(),scope:yt}).strict(),VH=oL.safeExtend({fingerprint:hh.optional()}).strict(),BH=le.extend({customer:pc,created:n.boolean()});ae={sendMessage:{method:"POST",path:"messaging/send",permission:"messaging:write",audience:"server",request:g$,response:le.extend({message:n.object({messageId:n.uuid(),channel:Al,acceptedAt:n.iso.datetime({offset:!0}),status:n.enum(["accepted","sending","completed","canceled"]),replayed:n.boolean()})})},readMessage:{method:"POST",path:"messaging/read",permission:"messaging:write",audience:"server",request:n.strictObject({messageId:n.uuid()}),response:le.extend({message:n.object({id:n.uuid(),channel:Al,status:n.enum(["accepted","sending","completed","canceled"]),deliveries:n.array(n.object({id:n.uuid(),status:b$,attempts:n.number().int().nonnegative(),receipts:n.array(n.object({kind:A$,occurredAt:n.iso.datetime({offset:!0}).nullable()}))}))})})},bindPushInstallation:{method:"POST",path:"push/installations/bind",permission:"messaging:write",audience:"customer",request:uR,response:le.extend({installation:jm})},readPushInstallation:{method:"POST",path:"push/installations/read",permission:"messaging:write",audience:"customer",request:lR,response:le.extend({installation:jm})},updatePushAddress:{method:"POST",path:"push/installations/address",permission:"messaging:write",audience:"customer",request:p0,response:le.extend({installation:jm})},readMessagingPreference:{method:"POST",path:"messaging/preferences/read",permission:"messaging:write",audience:"customer",request:n.strictObject({channel:Al}),response:le.extend({preference:m0})},setMessagingPreference:{method:"POST",path:"messaging/preferences/set",permission:"messaging:write",audience:"customer",request:y$,response:le.extend({preference:m0})},listInvoiceTemplates:{method:"POST",path:"invoices/templates",permission:"billing:read",audience:"server",request:n.strictObject({cursor:n.uuid().optional()}),response:le.extend({templates:h2})},previewInvoice:{method:"POST",path:"invoices/preview",permission:"billing:write",audience:"server",request:n.strictObject({customerId:n.uuid(),params:ec}),response:le.extend({preview:Gw})},createInvoice:{method:"POST",path:"invoices/create",permission:"billing:write",audience:"server",request:n.strictObject({customerId:n.uuid(),requestId:n.uuid(),params:ec}).refine(e=>e.params.preview!==!0,"Use previewInvoice for a side-effect-free preview"),response:le.extend({operation:Wl})},manageInvoice:{method:"POST",path:"invoices/manage",permission:"billing:write",audience:"server",request:n.strictObject({customerId:n.uuid(),command:g2}).refine(e=>e.command.action!=="create"||e.command.params.preview!==!0,"Use previewInvoice for a side-effect-free preview"),response:le.extend({operation:Wl})},readInvoiceOperation:{method:"POST",path:"invoices/operations/read",permission:"billing:read",audience:"server",request:n.strictObject({customerId:n.uuid(),taskId:n.uuid()}),response:le.extend({operation:Wl})},listInvoices:{method:"POST",path:"invoices/list",permission:"billing:read",audience:"server",request:n.strictObject({customerId:n.uuid(),cursor:n.uuid().optional()}),response:le.extend({invoices:b2})},getInvoice:{method:"POST",path:"invoices/read",permission:"billing:read",audience:"server",request:n.strictObject({customerId:n.uuid(),invoiceId:n.uuid()}),response:le.extend({invoice:y2})},getCodeReferenceConfig:{method:"POST",path:"code-references/config",permission:"code-references:read",audience:"server",request:s2,response:le.extend({config:c2})},submitCodeReferences:{method:"POST",path:"code-references",permission:"code-references:write",audience:"server",request:gI,response:le.extend({receipt:yI})},getFeatures:{method:"GET",path:"features",permission:"features:read",audience:"mixed",request:n.strictObject({}),response:le.extend({payload:$l})},evaluateFeatures:{method:"POST",path:"features/evaluate",permission:"features:read",audience:"mixed",request:jj,response:le.merge(eh)},trackEvents:{method:"POST",path:"events",permission:"events:write",audience:"mixed",request:Lj,response:le.merge(Mj)},readBalanceSource:{method:"POST",path:"balances/source/read",permission:"credits:read",audience:"server",request:n.strictObject({customerId:n.uuid(),sourceId:n.uuid()}),response:le.extend({balance:RL})},adjustBalance:{method:"POST",path:"balances/source/adjust",permission:"credits:manage",audience:"server",request:n.strictObject({customerId:n.uuid(),command:TL}),response:le.extend({balance:iI})},readAiPricing:{method:"POST",path:"ai/pricing/read",permission:"credits:read",audience:"server",request:n.strictObject({internal_feature_id:n.uuid(),customerId:n.uuid().optional(),entityId:n.uuid().optional()}).refine(e=>!e.entityId||!!e.customerId,"Entity pricing requires a customer"),response:le.extend({internal_feature_id:n.uuid(),config:U0,model_markups:Ym})},readUsage:{method:"POST",path:"usage/read",permission:"credits:read",audience:"server",request:n.strictObject({customerId:n.uuid(),query:Sf}),response:le.extend({usage:hl})},setUsage:{method:"POST",path:"usage/set",permission:"credits:manage",audience:"server",request:n.strictObject({customerId:n.uuid(),command:s$}),response:le.extend({usage:hl})},manageBalanceGrant:{method:"POST",path:"balances/grants/manage",permission:"credits:manage",audience:"server",request:n.strictObject({customerId:n.uuid(),command:t$}),response:le.extend({grant:bw})},listBalanceGrants:{method:"POST",path:"balances/grants/list",permission:"credits:read",audience:"server",request:n$,response:le.extend({grants:r$})},restoreNativePurchase:{method:"POST",path:"subscriptions/native/restore",permission:"billing:write",audience:"mixed",request:n.union(Ij.options.map(e=>e.extend({customerId:n.uuid().optional(),customerToken:n.string().regex(so).optional()}))),response:le.extend({operation:kj})},setupPayment:{method:"POST",path:"billing/setup-payment",permission:"billing:write",audience:"mixed",request:fj.extend({customerId:n.uuid().optional()}),response:le.extend({setup:e_})},readPaymentSetup:{method:"POST",path:"billing/payment-setup",permission:"billing:read",audience:"mixed",request:hj.extend({customerId:n.uuid().optional()}),response:le.extend({setup:e_})},previewSubscriptionBatch:{method:"POST",path:"subscriptions/batches/preview",permission:"billing:write",audience:"server",request:dj.safeExtend({customerId:n.uuid()}),response:le.extend({batch:Rl})},confirmSubscriptionBatch:{method:"POST",path:"subscriptions/batches/confirm",permission:"billing:write",audience:"server",request:qf.extend({customerId:n.uuid()}),response:le.extend({batch:Rl})},readSubscriptionBatch:{method:"POST",path:"subscriptions/batches/read",permission:"billing:read",audience:"server",request:qf.extend({customerId:n.uuid()}),response:le.extend({batch:Rl})},abandonSubscriptionBatch:{method:"POST",path:"subscriptions/batches/abandon",permission:"billing:write",audience:"server",request:qf.extend({customerId:n.uuid()}),response:le.extend({batch:Rl})},manageSubscriptionTrial:{method:"POST",path:"subscriptions/trials/manage",permission:"billing:write",audience:"server",request:n.discriminatedUnion("action",[Zf.options[0].extend({customerId:n.uuid()}),Zf.options[1].extend({customerId:n.uuid()}),Zf.options[2].extend({customerId:n.uuid()})]),response:le.extend({trial:Yw})},readSubscriptionTrial:{method:"POST",path:"subscriptions/trials/read",permission:"billing:read",audience:"server",request:pj.extend({customerId:n.uuid()}),response:le.extend({trial:Yw})},listSubscriptions:{method:"POST",path:"subscriptions/list",permission:"billing:read",audience:"server",request:Kf,response:le.extend({subscriptions:vj})},listPurchases:{method:"POST",path:"purchases/list",permission:"billing:read",audience:"server",request:Kf,response:le.extend({purchases:wj})},listSubscriptionConflicts:{method:"POST",path:"subscriptions/conflicts/list",permission:"billing:read",audience:"server",request:Aj,response:le.extend({conflicts:_j})},retrySubscriptionConflict:{method:"POST",path:"subscriptions/conflicts/retry",permission:"billing:write",audience:"server",request:xj,response:le.extend({resolution:Sj})},verifySubscriptions:{method:"POST",path:"subscriptions/verify",permission:"billing:read",audience:"server",request:yj,response:le.extend({verification:bj})},previewAttach:{method:"POST",path:"subscriptions/preview-attach",permission:"billing:read",audience:"mixed",request:nj.safeExtend({...Ys,customerId:n.uuid().optional()}),response:le.extend({quote:ga})},attach:{method:"POST",path:"subscriptions/attach",permission:"billing:write",audience:"mixed",request:ha.extend({customerId:n.uuid().optional(),intent:n.enum(["confirm","cancel"]).optional()}),response:le.extend({operation:mo})},readSubscriptionOperation:{method:"POST",path:"subscriptions/operations/read",permission:"billing:read",audience:"mixed",request:ha.extend({customerId:n.uuid().optional()}),response:le.extend({operation:mo})},previewUpdate:{method:"POST",path:"subscriptions/preview-update",permission:"billing:read",audience:"mixed",request:oj.safeExtend({customerId:n.uuid().optional()}),response:le.extend({quote:sj})},update:{method:"POST",path:"subscriptions/update",permission:"billing:write",audience:"mixed",request:ha.extend({customerId:n.uuid().optional(),intent:n.enum(["confirm","cancel"]).optional()}),response:le.extend({operation:Ww})},readSubscriptionUpdate:{method:"POST",path:"subscriptions/updates/read",permission:"billing:read",audience:"mixed",request:ha.extend({customerId:n.uuid().optional()}),response:le.extend({operation:Ww})},previewRefund:{method:"POST",path:"subscriptions/refunds/preview",permission:"billing:read",audience:"server",request:cj.safeExtend({customerId:n.uuid()}),response:le.extend({quote:lj})},refund:{method:"POST",path:"subscriptions/refunds/confirm",permission:"billing:write",audience:"server",request:ha.extend({customerId:n.uuid()}),response:le.extend({operation:Bf})},readRefund:{method:"POST",path:"subscriptions/refunds/read",permission:"billing:read",audience:"server",request:ha.extend({customerId:n.uuid()}),response:le.extend({operation:Bf})},readBillingControls:{method:"POST",path:"billing/controls/read",permission:"billing:read",audience:"customer",request:FD,response:le.extend({controls:mw})},prepareBillingAuthorization:{method:"POST",path:"billing/authorizations/prepare",permission:"billing:write",audience:"customer",request:RD,response:le.extend({prepared:DD})},confirmBillingAuthorization:{method:"POST",path:"billing/authorizations/confirm",permission:"billing:write",audience:"customer",request:$D,response:le.extend({authorization:gf})},setBillingCoupons:{method:"POST",path:"billing/coupons",permission:"billing:write",audience:"customer",request:BD,response:le.extend({coupons:qD})},revokeBillingAuthorization:{method:"POST",path:"billing/authorizations/revoke",permission:"billing:write",audience:"customer",request:jD,response:le.extend({authorization:gf})},listBillingInvoices:{method:"POST",path:"billing/invoices/read",permission:"billing:read",audience:"customer",request:UD,response:le.extend({invoices:VD})},confirmBillingAdjustment:{method:"POST",path:"billing/invoices/confirm-adjustment",permission:"billing:write",audience:"customer",request:zD,response:le.extend({invoice:sl})},manageBillingLimits:{method:"POST",path:"billing/controls/manage",permission:"billing:write",audience:"server",request:n.object({customerId:n.uuid(),command:MD}).strict(),response:le.extend({controls:mw})},manageUsageEntity:{method:"POST",path:"usage/entities",permission:"credits:manage",audience:"server",request:n.object({customerId:n.uuid(),command:NL}).strict(),response:le.extend({entity:DL})},readUsageAnalytics:{method:"POST",path:"usage/analytics",permission:"credits:read",audience:"server",request:n.strictObject({customerId:n.uuid().nullable(),query:zL}),response:le.extend({analytics:UL})},readCreditAnalytics:{method:"POST",path:"credits/analytics",permission:"credits:read",audience:"server",request:n.object({customerId:n.uuid().nullable(),query:_a}).strict(),response:le.extend({analytics:ML})},submitUsageBatch:{method:"POST",path:"usage/batch",permission:"credits:consume",audience:"server",request:VL,response:le.extend({batchId:n.uuid()})},readUsageBatch:{method:"POST",path:"usage/batch/read",permission:"credits:read",audience:"server",request:BL,response:le.extend({batch:qL})},checkEntitlement:{method:"POST",path:"entitlements/check",permission:"entitlements:read",audience:"mixed",request:v$.extend({customerId:n.string().min(1).optional()}),response:le.extend({check:Br})},resolveContent:{method:"POST",path:"content/resolve",permission:"content:read",audience:"mixed",request:n.strictObject({kind:po,selector:n.discriminatedUnion("type",[n.strictObject({type:n.literal("resource"),id:n.uuid()}),n.strictObject({type:n.literal("version"),id:n.uuid()})]),customerId:n.string().min(1).optional()}),response:le.extend({content:pa})},resolvePaywall:{method:"POST",path:"paywalls/resolve",permission:"entitlements:read",audience:"mixed",request:PL,response:le.extend({paywall:Hl})},resolveOffering:{method:"POST",path:"offerings/resolve",permission:"entitlements:read",audience:"mixed",request:n.strictObject({...Ys,selector:Oj,customerId:n.string().min(1).optional(),commerce:qs,requirement:co.optional()}),response:le.extend({offering:Tj,candidates:n.array(Cw).max(20),availability:n.array(n.strictObject({productVersionId:n.uuid(),available:n.boolean(),reason:n.enum(["platform_binding_missing","commercial_runtime_pending","commerce_not_configured","currency_mismatch","product_unavailable","already_attached","attach_in_progress","already_scheduled","subscription_change_required","purchase_conflict"]).nullable()})).max(20),check:Br.nullable()})},readHoldings:{method:"POST",path:"customer-holdings",permission:"entitlements:read",audience:"mixed",request:n.object({customerId:n.uuid().optional(),entityId:n.uuid().optional()}).strict(),response:le.extend({holdings:c$})},readLedger:{method:"POST",path:"customer-ledger",permission:"credits:read",audience:"mixed",request:n.object({customerId:n.uuid().optional(),query:l$}).strict(),response:le.extend({ledger:d$})},readBillingInvoice:{method:"POST",path:"billing/invoices/detail",permission:"billing:read",audience:"mixed",request:i$.extend({customerId:n.uuid().optional()}),response:le.extend({detail:o$})},readCreditStatement:{method:"POST",path:"credit-statements/read",permission:"credits:read",audience:"mixed",request:xw.safeExtend({customerId:n.uuid().optional()}),response:le.extend({statement:a$})},quoteBalance:{method:"POST",path:"balances/quote",permission:"credits:read",audience:"mixed",request:n.object({customerId:n.uuid().optional(),command:ml.options[0]}).strict(),response:le.extend({quote:YD})},trackUsage:{method:"POST",path:"usage/track",permission:"credits:consume",audience:"server",request:n.strictObject({customerId:n.uuid(),command:n.union([n.strictObject({eventName:n.string().min(1),quantity:De.optional(),properties:en.optional(),entityId:n.uuid().optional(),idempotencyKey:n.string().min(1).max(120)}),n.strictObject({internal_feature_id:n.uuid(),quantity:De.optional(),properties:en.optional(),entityId:n.uuid().optional(),idempotencyKey:n.string().min(1).max(120)})])}),response:le.extend({receipts:n.array(fl).min(1)})},mutateBalance:{method:"POST",path:"balances/execute",permission:"credits:consume",audience:"server",request:n.object({customerId:n.uuid(),command:ml.refine(e=>e.operation!=="quote","Use the quote endpoint for a read")}).strict(),response:le.extend({receipt:fl})},redeemReward:{method:"POST",path:"rewards/redeem",permission:"offers:resolve",audience:"customer",request:XL,response:le.extend({redemption:YL})},createReferralCode:{method:"POST",path:"rewards/referral-code",permission:"offers:resolve",audience:"customer",request:n2,response:le.extend({referralCode:r2})},claimRewardProduct:{method:"POST",path:"rewards/product/claim",permission:"offers:resolve",audience:"customer",request:e2,response:le.extend({checkout:t2})},readSeats:{method:"POST",path:"seats/list",permission:"customers:read",audience:"server",request:m$,response:le.extend({seats:_w})},manageSeat:{method:"POST",path:"seats/manage",permission:"billing:write",audience:"server",request:f$,response:le.extend({seats:_w})},createCustomer:{method:"POST",path:"customers",permission:"customers:write",audience:"server",request:VH,response:BH},getCustomer:{method:"POST",path:"customers/get",permission:"customers:read",audience:"server",request:N_,response:le.extend({customer:pc})},listCustomers:{method:"POST",path:"customers/list",permission:"customers:read",audience:"server",request:cL,response:le.extend(uL.shape)},updateCustomer:{method:"POST",path:"customers/update",permission:"customers:write",audience:"server",request:sL,response:le.extend(aL.shape)},createSession:{method:"POST",path:"customer-sessions",permission:"sessions:create",audience:"server",request:n.object({customerId:n.uuid()}).strict(),response:le.extend(_f.shape)},refreshSession:{method:"POST",path:"customer-sessions/refresh",permission:"sessions:create",audience:"refresh",request:n.strictObject({}),response:le.extend(_f.shape)},revokeSessions:{method:"POST",path:"customer-sessions/revoke",permission:"sessions:create",audience:"server",request:n.strictObject({customerId:n.uuid(),sessionId:n.uuid().optional()}),response:le.extend({revoked:n.number().int().nonnegative()})},createGuestCustomer:{method:"POST",path:"customers/guests",permission:"sessions:create",audience:"server",request:n.strictObject({guestToken:n.string().regex(/^gg_gc_[A-Za-z0-9_-]{43}$/),fingerprint:hh.optional()}),response:le.extend({customerId:n.uuid(),guestToken:n.string().regex(/^gg_gc_[A-Za-z0-9_-]{43}$/),guestExpiresAt:n.iso.datetime()})},resumeGuestSession:{method:"POST",path:"customers/guests/session",permission:"sessions:create",audience:"server",request:n.strictObject({guestToken:n.string().regex(/^gg_gc_[A-Za-z0-9_-]{43}$/)}),response:le.extend(_f.shape)},claimGuestCustomer:{method:"POST",path:"customers/guests/claim",permission:"customers:write",audience:"server",request:n.strictObject({guestToken:n.string().regex(/^gg_gc_[A-Za-z0-9_-]{43}$/),externalUserId:n.string().trim().min(1).max(255).refine(e=>!e.startsWith("gg_guest_")),requestId:n.uuid()}),response:le.extend({customer:pc,switched:n.boolean(),replayed:n.boolean()})},redeemCoupon:{method:"POST",path:"offers/redeem",permission:"offers:resolve",audience:"customer",request:n.strictObject({code:n.string().regex(/^[A-Z0-9][A-Z0-9_-]{2,31}$/),requestId:n.uuid()}),response:x2()},listOffers:{method:"GET",path:"offers",permission:"offers:resolve",audience:"customer",request:n.object({}).strict(),response:le.extend({offers:n.array(ol)})},grantOffer:{method:"POST",path:"offers/grant",permission:"offers:grant",audience:"mixed",customerPermission:"offers:resolve",request:n.object({customerId:n.string().min(1).max(255).optional(),couponId:n.uuid(),...Ys,requestId:n.uuid(),couponContentDigest:n.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),response:x2()},recordCouponRedemption:{method:"POST",path:"offers/redemptions",permission:"billing:write",audience:"server",request:m2,response:le.extend({receipt:f2})}},$de={sendMessage:ae.sendMessage,readMessage:ae.readMessage,bindPushInstallation:ae.bindPushInstallation,readPushInstallation:ae.readPushInstallation,updatePushAddress:ae.updatePushAddress,readMessagingPreference:ae.readMessagingPreference,setMessagingPreference:ae.setMessagingPreference,listInvoiceTemplates:ae.listInvoiceTemplates,previewInvoice:ae.previewInvoice,createInvoice:ae.createInvoice,manageInvoice:ae.manageInvoice,readInvoiceOperation:ae.readInvoiceOperation,listInvoices:ae.listInvoices,getInvoice:ae.getInvoice,getCodeReferenceConfig:ae.getCodeReferenceConfig,submitCodeReferences:ae.submitCodeReferences,getFeatures:ae.getFeatures,evaluateFeatures:ae.evaluateFeatures,trackEvents:ae.trackEvents,setupPayment:ae.setupPayment,readPaymentSetup:ae.readPaymentSetup,previewSubscriptionBatch:ae.previewSubscriptionBatch,confirmSubscriptionBatch:ae.confirmSubscriptionBatch,readSubscriptionBatch:ae.readSubscriptionBatch,abandonSubscriptionBatch:ae.abandonSubscriptionBatch,manageSubscriptionTrial:ae.manageSubscriptionTrial,readSubscriptionTrial:ae.readSubscriptionTrial,listSubscriptions:ae.listSubscriptions,listPurchases:ae.listPurchases,listSubscriptionConflicts:ae.listSubscriptionConflicts,retrySubscriptionConflict:ae.retrySubscriptionConflict,readAiPricing:ae.readAiPricing,readUsage:ae.readUsage,setUsage:ae.setUsage,previewRefund:ae.previewRefund,refund:ae.refund,readRefund:ae.readRefund,previewUpdate:ae.previewUpdate,update:ae.update,readSubscriptionUpdate:ae.readSubscriptionUpdate,restoreNativePurchase:ae.restoreNativePurchase,verifySubscriptions:ae.verifySubscriptions,previewAttach:ae.previewAttach,attach:ae.attach,readSubscriptionOperation:ae.readSubscriptionOperation,manageBalanceGrant:ae.manageBalanceGrant,readBalanceSource:ae.readBalanceSource,adjustBalance:ae.adjustBalance,listBalanceGrants:ae.listBalanceGrants,readBillingControls:ae.readBillingControls,prepareBillingAuthorization:ae.prepareBillingAuthorization,confirmBillingAuthorization:ae.confirmBillingAuthorization,setBillingCoupons:ae.setBillingCoupons,revokeBillingAuthorization:ae.revokeBillingAuthorization,listBillingInvoices:ae.listBillingInvoices,confirmBillingAdjustment:ae.confirmBillingAdjustment,manageBillingLimits:ae.manageBillingLimits,createCustomer:ae.createCustomer,getCustomer:ae.getCustomer,listCustomers:ae.listCustomers,updateCustomer:ae.updateCustomer,createSession:ae.createSession,refreshSession:ae.refreshSession,revokeSessions:ae.revokeSessions,createGuestCustomer:ae.createGuestCustomer,resumeGuestSession:ae.resumeGuestSession,claimGuestCustomer:ae.claimGuestCustomer,checkEntitlement:ae.checkEntitlement,resolveOffering:ae.resolveOffering,resolveContent:ae.resolveContent,resolvePaywall:ae.resolvePaywall,readHoldings:ae.readHoldings,readLedger:ae.readLedger,readBillingInvoice:ae.readBillingInvoice,readCreditStatement:ae.readCreditStatement,quoteBalance:ae.quoteBalance,trackUsage:ae.trackUsage,mutateBalance:ae.mutateBalance,manageUsageEntity:ae.manageUsageEntity,readUsageAnalytics:ae.readUsageAnalytics,readCreditAnalytics:ae.readCreditAnalytics,submitUsageBatch:ae.submitUsageBatch,readUsageBatch:ae.readUsageBatch,listOffers:ae.listOffers,grantOffer:ae.grantOffer,recordCouponRedemption:ae.recordCouponRedemption,redeemCoupon:ae.redeemCoupon,redeemReward:ae.redeemReward,createReferralCode:ae.createReferralCode,claimRewardProduct:ae.claimRewardProduct,readSeats:ae.readSeats,manageSeat:ae.manageSeat}});var v2=x(()=>{"use strict"});var Fde,wI,_I=x(()=>{"use strict";ee();wn();Fde=n.object({days:n.number().int().min(1).max(730),cardRequired:n.boolean(),featureAllowances:n.record(n.uuid(),n.number().int().min(0).max(1e9)),creditAmounts:n.record(n.uuid(),De)}).strict(),wI=n.object({id:n.uuid(),planVersionId:n.uuid(),slot:n.string(),cardRequired:n.boolean(),status:n.enum(["pending","active","converted","canceled","expired","failed"]),startsAt:n.iso.datetime().nullable(),endsAt:n.iso.datetime().nullable(),createdAt:n.iso.datetime()}).strict()});var Bde,qH,ZH,w2,HH,qde,_2=x(()=>{"use strict";ee();_I();Bde=n.object({group:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/).default("main"),kind:n.enum(["main","addon"]).default("main")}).strict(),qH=n.enum(["immediate","end_of_cycle"]),ZH=n.enum(["attach","change","cancel","resume","cancel_change"]),w2=n.object({id:n.uuid(),subscriptionId:n.uuid().nullable(),targetPlanVersionId:n.uuid().nullable(),action:ZH,timing:qH,status:n.enum(["preparing","payment_pending","scheduled","completed","canceled","failed"]),effectiveAt:n.iso.datetime().nullable(),createdAt:n.iso.datetime()}),HH=n.object({id:n.uuid(),planVersionId:n.uuid(),planId:n.uuid(),basePlanId:n.uuid().nullable(),name:n.string(),group:n.string(),kind:n.enum(["main","addon"]),source:n.enum(["subscription","assignment","license","apple","google"]),status:n.string(),accessEnabled:n.boolean(),startsAt:n.iso.datetime().nullable(),endsAt:n.iso.datetime().nullable(),cancelAtPeriodEnd:n.boolean(),scheduledChange:w2.nullable(),trial:wI.nullable().optional()}),qde=n.object({customerId:n.uuid(),evaluatedAt:n.iso.datetime(),holdings:n.array(HH),changes:n.array(w2),trials:n.array(wI).optional()})});var I2,GH,Kde,Wde,Jde,k2=x(()=>{"use strict";ee();Ir();I2=n.union([kl,n.string().max(200).regex(/^\/template-covers\/[a-z0-9-]+-[a-f0-9]{16}\.webp$/)]),GH=n.strictObject({thumbnail:I2,full:I2}),Kde=n.object({id:n.uuid(),key:n.string().nullable(),label:n.string().min(1).max(80),description:n.string().max(300),category:n.string().min(1).max(40),tags:n.array(n.string().max(30)).max(10),surface:Nw,source:n.enum(["official","private"]),cover_image:GH.nullable().default(null),document:un,revision:n.number().int().positive(),archived_at:n.string().nullable(),created_at:n.string()}).strict(),Wde=n.object({projectId:n.uuid(),environmentId:n.uuid(),label:n.string().trim().min(1).max(80),description:n.string().trim().max(300),category:n.string().trim().min(1).max(40),document:un}).strict(),Jde=n.object({projectId:n.uuid(),environmentId:n.uuid(),id:n.uuid(),revision:n.number().int().positive()}).strict()});function II(e,t,r){let i={},o,a,s,c="next",u;switch(e.type){case"entry":u=e.next;break;case"condition":{let l=e.cases.findIndex(d=>Yn(t.attributes??{},d.condition,t.savedGroups??{}));c=l<0?"default":`case:${l}`,u=l<0?e.default:e.cases[l].target;break}case"feature":if(!Object.hasOwn(t.features??{},e.featureKey))throw new Jl("Required GB Feature is unavailable");o=Ii(e.featureKey,t),s=o.value,Object.assign(i,Js(e,{value:s})),u=e.next;break;case"split":{let l=r[e.experimentId];if(!l)throw new Jl("Required GB Experiment is unavailable");if(a=ff(l,t),s=a.value,c=a.inExperiment&&!a.passthrough&&typeof s=="string"?s:"notParticipating",u=c==="notParticipating"?e.notParticipating:e.routes[c],!u)throw new Jl("Experiment Variation has no published route");break}case"offering":{let l=e.configuration.source==="fixed"?e.configuration.versionId:Ii(e.configuration.featureKey,t).value;s={type:"offering_version",id:n.uuid().parse(l)},Object.assign(i,Js(e,{value:s})),u=e.next;break}case"coupon":case"coupons":s=e.type==="coupons"?e.couponIds.map(l=>({type:"reward",id:l})):{type:"reward",id:e.couponId},Object.assign(i,Js(e,{value:s})),u=e.next;break}return{port:c,target:u,projections:i,...s===void 0?{}:{value:s},...o?{feature:o}:{},...a?{experiment:a}:{}}}function E2(e,t,r){n.uuid().parse(e),n.number().int().nonnegative().parse(t);let i=$s(Ls(new TextEncoder().encode(JSON.stringify([e,t,r])))).slice(0,32);return`${i.slice(0,8)}-${i.slice(8,12)}-5${i.slice(13,16)}-a${i.slice(17,20)}-${i.slice(20)}`}var Jl,kI=x(()=>{"use strict";Zr();ee();lf();js();rl();Jl=class extends Error{constructor(t){super(t),this.name="FunnelCalculationError"}}});var C2,cpe,upe,P2=x(()=>{"use strict";ee();cr();Fs();ic();C2=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),cpe=n.strictObject({operation:n.literal("resolve_screen"),funnelId:n.uuid(),versionId:n.uuid(),screenId:C2,locale:Un,customerId:n.uuid().optional()}),upe=n.strictObject({scope:yt,funnelId:n.uuid(),versionId:n.uuid(),screenId:C2,locale:Un,coupons:n.record(n.uuid(),n.strictObject({available:n.boolean(),offer:n.strictObject({id:n.uuid(),expiresAt:n.iso.datetime()}).nullable()})),couponDigests:n.record(n.uuid(),fo)})});var Ao,CI,KH,WH,JH,QH,EI,Ql,O2,Ih=x(()=>{"use strict";ee();dh();Zr();Fl();cr();uo();wl();Ir();nc();ho();Zt();wh();Tl();Ao=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),CI=n.enum(["running","waiting","completed","closed","ineligible","failed"]),KH=n.discriminatedUnion("type",[T_,n.strictObject({type:n.literal("wait"),receiptId:n.uuid(),kind:n.enum(["timer","event","operation"]),deadline:n.iso.datetime({offset:!0}).nullable(),eventName:Ao.optional()}),n.strictObject({type:n.literal("open_url"),receiptId:n.uuid(),url:M_,openIn:F_}),n.strictObject({type:n.literal("event"),receiptId:n.uuid(),event:Ao})]),WH=n.strictObject({type:n.literal("funnel"),id:n.uuid(),versionId:n.uuid()}),JH={id:Ao,presentation:Oi,outputs:n.array(Ao).max(250),inputs:cc,values:n.record(n.string(),Te).optional(),offeringKey:Wt.optional(),capabilities:Hs,customerData:Gs,dataCursors:n.record(Ao,sh.nullable())},QH=n.strictObject({...JH,content:n.strictObject({type:n.literal("document"),document:un})}),EI=n.strictObject({id:n.uuid(),source:WH,revision:n.number().int().nonnegative(),visit:n.number().int().nonnegative(),nodeId:Ao,nodeType:n.enum(["entry","screen","condition","split","feature","action","external_page","wait","end","offering","coupon","coupons","output"]),status:CI,stopped:n.boolean(),canBack:n.boolean(),authenticated:n.boolean(),locale:n.string().min(1).max(35),answers:Gr,parameters:Vn,variables:n.record(n.string(),Te),output:Te.nullable(),screen:QH.nullable(),paywall:n.strictObject({receiptId:n.uuid(),resolution:n.union([yo,Hl]),quote:ga.nullable(),operation:mo.nullable(),purchaseRequestId:n.uuid().nullable(),selectionGeneration:n.number().int().nonnegative().optional(),canReselect:n.boolean().optional()}).nullable(),instruction:KH.nullable(),pendingRequest:n.strictObject({requestId:n.uuid(),authenticationRequired:n.boolean()}).nullable(),runExpiresAt:n.iso.datetime({offset:!0}),credentialExpiresAt:n.iso.datetime({offset:!0}).nullable()}),Ql=n.strictObject({scope:yt,run:EI,settlement:n.strictObject({requestId:n.uuid(),state:n.enum(["pending","unknown","settled"]),operationId:n.uuid().nullable(),receiptId:n.uuid().nullable().optional()}).optional(),purchase:n.strictObject({receiptId:n.uuid(),quote:ga.nullable(),operation:mo.nullable(),canReselect:n.boolean().optional()}).optional(),review:n.strictObject({activeOperationId:n.uuid().nullable(),pages:n.array(n.strictObject({receiptId:n.uuid(),nodeId:Ao,visit:n.number().int().nonnegative()})).max(100),page:n.strictObject({receiptId:n.uuid(),nodeId:Ao,visit:n.number().int().nonnegative(),document:un,answers:Gr,inputs:cc,values:n.record(n.string(),Te).optional()}).nullable(),coupons:n.array(n.strictObject({grantId:n.uuid(),status:n.enum(["issued","reserved","redeemed","expired","revoked","unknown"]),expiresAt:n.string().nullable()})).max(100),purchases:n.array(n.strictObject({receiptId:n.uuid(),operationId:n.uuid(),status:n.enum(["pending","complete","cancelled","failed","unknown"])})).max(100)}).optional(),runToken:n.string().regex(/^gg_fr_[A-Za-z0-9_-]{43}$/).optional(),customerId:n.uuid().optional()}),O2=Ql.extend({run:EI.extend({paywall:EI.shape.paywall.unwrap().extend({resolution:Hl}).nullable()})})});var Cpe,T2,R2,PI=x(()=>{"use strict";ee();Ih();Cpe=n.strictObject({operation:n.literal("renew_run"),runId:n.uuid(),customerId:n.uuid()}),T2=Ql.refine(e=>!!e.runToken,"Renewal returns a credential"),R2=O2.refine(e=>!!e.runToken,"Renewal returns a credential")});var jpe,YH,Lpe,N2=x(()=>{"use strict";ee();Ml();PI();cr();ho();xa();jpe=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("campaign_decide"),...D_}).refine(ba,Aa),n.strictObject({operation:n.literal("campaign_start"),funnelId:n.uuid(),requestId:n.uuid(),customer:lc,customerData:dc.optional(),locale:n.string().min(1).max(35),parameters:Vn,cooldownSeconds:n.number().int().min(1).max(2592e3)}).refine(ba,Aa)]),YH=n.union([n.strictObject({scope:yt,suppressed:n.literal(!0),reason:n.enum(["frequency","in_progress"]),retryAt:n.iso.datetime({offset:!0})}),T2]),Lpe=n.union([YH.options[0],R2])});function eG(e){return $2.parse({entry:e.graph.entry,nodes:e.graph.nodes.map(t=>{let r={},i={};switch(t.type){case"entry":case"feature":case"offering":case"coupon":case"coupons":r.next=t.next;break;case"screen":Object.assign(r,t.outputs),i.screenId=t.screenId;{let a=e.screens.find(s=>s.id===t.screenId);a?.type==="paywall"&&(i.paywallVersionId=a.paywallVersionId)}break;case"condition":t.cases.forEach((a,s)=>{r[`case:${s}`]=a.target}),r.default=t.default;break;case"split":Object.assign(r,t.routes),r.notParticipating=t.notParticipating,i.experimentId=t.experimentId;break;case"action":for(let a of["success","cancel","unavailable","failure"])r[a]=t[a];t.action.type==="claim_offer"&&t.action.coupon.source==="literal"&&t.action.coupon.value&&typeof t.action.coupon.value=="object"&&!Array.isArray(t.action.coupon.value)&&(i.couponId=n.uuid().parse(t.action.coupon.value.id));break;case"external_page":r.opened=t.opened,r.failed=t.failed;break;case"wait":t.wait.type==="duration"?r.elapsed=t.wait.elapsed:(r.received=t.wait.received,r.timeout=t.wait.timeout);break;case"end":case"output":break}t.type==="feature"&&(i.featureKey=t.featureKey),t.type==="offering"&&t.configuration.source==="feature"&&(i.featureKey=t.configuration.featureKey);let o=t.type==="output"?t.value:t.type==="end"?t.output:void 0;return o?.type==="feature"&&(i.featureKey=o.featureKey),t.type==="coupon"&&(i.couponId=t.couponId),t.type==="coupons"&&(i.couponIds=t.couponIds),t.type==="offering"&&t.configuration.source==="fixed"&&(i.offeringVersionId=t.configuration.versionId),{id:t.id,type:t.type,outputs:r,resources:i,writes:"writes"in t?t.writes??{}:{}}})})}function OI(e){let t=go.parse(e.document),r=e.evaluationMode==="local"?Er.parse(e.payload):null;if(r&&(r.scope.projectId!==e.scope.projectId||r.scope.environment!==e.scope.environment))throw new Error("GB payload belongs to another App or environment");let i={scope:e.scope,funnelId:e.funnelId,versionId:e.versionId,evaluationRevision:e.evaluationRevision,evaluationMode:e.evaluationMode,expiresAt:r?.expiresAt??null,topology:eG(t)};return xc.parse(e.evaluationMode==="remote"?i:{...i,growth:xh(t,r),conditions:Object.fromEntries(t.graph.nodes.filter(o=>o.type==="condition").map(o=>[o.id,o.cases.map((a,s)=>({condition:a.condition,port:`case:${s}`}))]))})}function j2(e){let t=OI(e);if(t.evaluationMode!=="local")throw new Error("Remote Funnel cannot disclose local rules");let r=go.parse(e.document);return XH.parse({...t,evaluation:{maxTransitions:r.execution.maxTransitions,variables:r.variables,outputSchema:r.outputSchema,terminals:Object.fromEntries(r.graph.nodes.flatMap(i=>{let o=i.type==="end"?i.output:i.type==="output"?i.value:void 0;return i.type!=="end"&&i.type!=="output"?[]:o&&o.type!=="literal"&&o.type!=="feature"&&o.type!=="variable"?[]:[[i.id,{outcome:i.type==="end"?i.outcome:"completed",output:o??null}]]}))}})}var Ac,$2,D2,xc,XH,kh=x(()=>{"use strict";ee();cr();gc();Ml();Zr();ac();Zt();G_();Ac=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),$2=n.strictObject({entry:Ac,nodes:n.array(n.strictObject({id:Ac,type:n.enum(["entry","screen","condition","split","feature","action","external_page","wait","end","offering","coupon","coupons","output"]),outputs:n.record(n.string(),Ac),writes:n.record(Wt,Wt),resources:n.strictObject({screenId:Ac.optional(),paywallVersionId:n.uuid().optional(),couponId:n.uuid().optional(),couponIds:n.array(n.uuid()).max(20).optional(),experimentId:n.uuid().optional(),featureKey:n.string().optional(),offeringVersionId:n.uuid().optional()})})).min(1).max(500)}),D2={scope:yt,funnelId:n.uuid(),versionId:n.uuid(),evaluationRevision:n.number().int().nonnegative(),expiresAt:n.iso.datetime({offset:!0}).nullable(),topology:$2},xc=n.discriminatedUnion("evaluationMode",[n.strictObject({...D2,evaluationMode:n.literal("local"),growth:Er,conditions:n.record(Ac,n.array(n.strictObject({condition:zn,port:n.string()})))}),n.strictObject({...D2,evaluationMode:n.literal("remote")})]),XH=xc.options[0].extend({evaluation:n.strictObject({maxTransitions:n.number().int().min(1).max(1e4),variables:n.record(Wt,Ws),outputSchema:Ks,terminals:n.record(Ac,n.strictObject({outcome:n.enum(["completed","closed","ineligible","failed"]),output:Ll.nullable()}))})})});function F2(e,t){for(let[r,i]of e.screens.entries())(i.type==="page"&&i.pageVersionId===null||i.type==="popup"&&i.popupVersionId===null)&&t.addIssue({code:"custom",path:["screens",r],message:"Publish the referenced content first",params:{reason:"content"}})}var Eh,tG,Ype,L2,M2,Xpe,eme,z2=x(()=>{"use strict";ee();gc();Vl();Fl();Eh=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),tG=n.discriminatedUnion("type",[n.strictObject({type:n.literal("page_version"),id:n.uuid()}),n.strictObject({type:n.literal("popup_version"),id:n.uuid()}),n.strictObject({type:n.literal("banner_version"),id:n.uuid()})]),Ype=n.strictObject({type:n.literal("banner_version"),id:n.uuid()}),L2=e=>e==="page"?n.strictObject({id:Eh,type:n.literal("page"),pageId:n.uuid(),pageVersionId:n.uuid().nullable()}):n.strictObject({id:Eh,type:n.literal("popup"),popupId:n.uuid(),popupVersionId:n.uuid().nullable()}),M2=yL.omit({schemaVersion:!0,screens:!0,references:!0}).extend({schemaVersion:n.literal(5),screens:n.array(n.discriminatedUnion("type",[L2("page"),L2("popup"),n.strictObject({id:Eh,type:n.literal("paywall"),paywallVersionId:n.uuid()})])).max(100),references:n.record(Eh,n.union([zl,tG])).refine(e=>Object.keys(e).length<=500)});Xpe=M2.extend({graph:mc}).superRefine(F2),eme=M2.extend({displayName:n.string().trim().min(1).max(80),graph:mc}).superRefine(F2)});var U2=x(()=>{"use strict"});var rme,ime,V2=x(()=>{"use strict";rme=new Set(`@\xA3$\xA5\xE8\xE9\xF9\xEC\xF2\xC7
|
|
63
|
+
\xD8\xF8\r\xC5\xE5\u0394_\u03A6\u0393\u039B\u03A9\u03A0\u03A8\u03A3\u0398\u039E\xC6\xE6\xDF\xC9 !"#\xA4%&'()*+,-./0123456789:;<=>?\xA1ABCDEFGHIJKLMNOPQRSTUVWXYZ\xC4\xD6\xD1\xDC\xA7\xBFabcdefghijklmnopqrstuvwxyz\xE4\xF6\xF1\xFC\xE0`),ime=new Set("\f^{}\\[~]|\u20AC")});var Or,xo,B2,nG,rG,iG,oG,aG,sG,cme,cG,ume,lme,q2=x(()=>{"use strict";ee();xa();Or=n.string().min(1).max(255),xo=n.number().finite().nonnegative(),B2=n.strictObject({properties:n.record(n.string().min(1).max(64),n.union([n.string().min(1).max(128),n.number().finite(),n.boolean()]).transform(String).pipe(n.string())).refine(e=>Object.keys(e).length>=1&&Object.keys(e).length<=4)}),nG=n.strictObject({feature_id:Or,enabled:n.boolean().default(!1),threshold:n.number().finite(),quantity:n.number().finite().min(1),purchase_limit:n.strictObject({interval:n.enum(["hour","day","week","month"]),interval_count:n.number().finite().min(1).default(1),limit:n.number().finite().min(1)}).optional(),invoice_mode:n.boolean().optional()}),rG=n.strictObject({feature_id:Or.optional(),enabled:n.boolean().default(!1),limit_type:n.enum(["absolute","usage_percentage"]).optional(),overage_limit:xo.optional(),skip_overage_billing:n.boolean().optional()}).refine(e=>e.overage_limit===void 0&&e.skip_overage_billing===void 0||e.feature_id!==void 0,"A feature is required for overage limits and billing controls"),iG=n.strictObject({feature_id:Or,enabled:n.boolean().default(!0),limit:xo,interval:n.enum(["day","week","month","year"]),anchor:n.enum(["billing_cycle","utc"]).optional(),filter:B2.optional()}),oG=n.strictObject({feature_id:Or.optional(),enabled:n.boolean().default(!0),threshold:xo,threshold_type:n.enum(["usage","usage_percentage","remaining","remaining_percentage"]),basis:n.enum(["balance","included","recurring","usage_limit"]).default("balance"),filter:B2.optional(),name:n.string().optional()}).refine(e=>e.threshold_type!=="remaining_percentage"||e.threshold<=100,"Remaining percentage cannot exceed 100").refine(e=>e.basis!=="usage_limit"||e.feature_id!==void 0,"Usage-limit alerts require a feature").refine(e=>e.filter===void 0||e.basis==="usage_limit","Filters apply only to usage-limit alerts"),aG=n.strictObject({feature_id:Or,enabled:n.boolean().default(!1)}),sG=n.strictObject({auto_topups:n.array(nG).nullable(),spend_limits:n.array(rG).nullable(),usage_limits:n.array(iG).nullable(),usage_alerts:n.array(oG).nullable(),overage_allowed:n.array(aG).nullable()}),cme=sG.omit({auto_topups:!0}),cG=uc,ume=n.strictObject({internal_id:n.uuid(),id:Or.nullable(),project_id:n.uuid(),environment_id:n.uuid(),name:n.string().max(80).nullable(),email:n.string().max(254).nullable(),metadata:cG.nullable(),created_at:n.number().finite().nonnegative().max(864e13)}),lme=n.strictObject({id:Or,internal_product_id:Or,product_id:Or.nullable(),status:n.enum(["scheduled","pending","active","past_due","expired","unknown","trialing","paused"]),canceled_at:xo.nullable(),free_trial_id:Or.nullable(),trial_ends_at:xo.nullable(),starts_at:xo.nullable(),access_starts_at:xo.nullable(),ended_at:xo.nullable(),product:n.strictObject({internal_id:Or,id:Or,name:n.string(),version:n.number().int().positive(),is_add_on:n.boolean()})})});var uG,Z2,hme,H2=x(()=>{"use strict";ee();qt();b0();uG=n.string().regex(/^[a-z][a-z0-9_]{0,63}$/),Z2=n.number().int().min(0).max(1e4),hme=n.object({key:uG,featureId:n.uuid(),planVersionId:n.uuid(),includedQuantity:Z2,maximumQuantity:Z2,unitAmountCents:n.number().int().min(0).max(1e8),currency:Oe,currencyOptions:gR.optional(),stripePriceId:n.string().regex(/^price_[A-Za-z0-9]+$/).nullable(),pooledResources:n.array(n.string().regex(/^(?:[a-z][a-z0-9_]{0,63}|pool:[0-9a-f-]{36})$/)).max(100),requireAssignment:n.boolean()}).strict().refine(e=>!e.currencyOptions||!Object.hasOwn(e.currencyOptions,e.currency),"Additional prices cannot repeat the default currency").refine(e=>e.maximumQuantity>=e.includedQuantity,"\u6700\u5927\u5E2D\u4F4D\u6570\u4E0D\u80FD\u5C0F\u4E8E\u5305\u542B\u5E2D\u4F4D\u6570").refine(e=>new Set(e.pooledResources).size===e.pooledResources.length,"\u5171\u4EAB\u6765\u6E90\u4E0D\u80FD\u91CD\u590D")});var On,G2,xme,Sme,K2=x(()=>{"use strict";ee();qt();Ih();On=n.number().int().nonnegative(),G2=n.strictObject({at:n.iso.datetime({offset:!0}),id:n.uuid()}),xme=n.strictObject({versionId:n.uuid().nullable(),from:n.iso.datetime({offset:!0}).nullable(),to:n.iso.datetime({offset:!0}).nullable(),after:G2.nullable()}).refine(e=>!e.from||!e.to||Date.parse(e.from)<Date.parse(e.to),"Time range must increase"),Sme=n.strictObject({funnelId:n.uuid(),snapshotAt:n.iso.datetime({offset:!0}),versions:n.array(n.strictObject({id:n.uuid(),version:n.number().int().positive(),createdAt:n.iso.datetime({offset:!0})})).max(100),versionsLimited:n.boolean(),overall:n.strictObject({started:On,completed:On,closed:On,failed:On,waiting:On,paid:On}),decisions:n.strictObject({queries:On,completed:On,reportedUsed:On,pending:On,failed:On}),revenue:n.array(n.strictObject({currency:Oe,grossMinor:n.string().regex(/^\d+$/),refundMinor:n.string().regex(/^\d+$/),netMinor:n.string().regex(/^-?\d+$/)})).max(100),nodes:n.array(n.strictObject({versionId:n.uuid(),nodeId:n.string(),visits:On,completed:On,shown:On,waiting:On})).max(1e4),recentRuns:n.array(n.strictObject({id:n.uuid(),versionId:n.uuid(),customerId:n.uuid(),status:CI,nodeId:n.string(),visit:On,createdAt:n.iso.datetime({offset:!0}),updatedAt:n.iso.datetime({offset:!0})})).max(100),nextCursor:G2.nullable()})});var W2,J2,TI=x(()=>{"use strict";ee();W2=n.discriminatedUnion("provider",[n.strictObject({provider:n.literal("apple"),orderId:n.uuid(),receiptId:n.uuid(),signedTransaction:n.string().min(1).max(131072)}),n.strictObject({provider:n.literal("google"),orderId:n.uuid(),receiptId:n.uuid(),purchaseToken:n.string().min(1).max(16384)})]),J2=n.strictObject({orderId:n.uuid(),receiptId:n.uuid(),transactionIds:n.array(n.string().min(1).max(255)).min(1).max(50),membership:n.boolean()})});var Pme,Ome,Q2=x(()=>{"use strict";ee();cr();TI();Bs();Pme=n.strictObject({operation:n.literal("native_receipt"),requestId:n.uuid(),customerToken:n.string().regex(so),orderId:n.uuid(),receiptId:n.uuid(),nativeEvidence:W2.nullable()}).refine(e=>e.nativeEvidence===null||e.nativeEvidence.orderId===e.orderId&&e.nativeEvidence.receiptId===e.receiptId,"Evidence must use this current order receipt"),Ome=n.strictObject({scope:yt,requestId:n.uuid(),orderId:n.uuid(),receiptId:n.uuid(),orderStatus:n.enum(["created","pending","trialing","paid","cancelled","failed"]),refunded:n.boolean(),nativeCompletion:J2.optional()})});var Y2,lG,X2,dG,Dme,$me,eM=x(()=>{"use strict";ee();ac();Y2=n.string().regex(/^[a-f0-9]{64}$/),lG=oc.omit({variations:!0,active:!0}).extend({changeId:Y2,variations:n.array(n.strictObject({urlRedirect:n.string().max(2048)})).min(2).max(20)}),X2=n.strictObject({environmentId:n.uuid(),trackExposures:n.boolean(),generation:Y2,experiments:n.array(lG).max(100),savedGroups:Dl}),dG=n.strictObject({eventUuid:n.uuid(),timestamp:n.iso.datetime({offset:!0}).optional(),deviceId:n.string().min(1).max(128),sessionId:n.string().min(1).max(128).optional(),url:n.url().max(2048),pageTitle:n.string().max(512).optional(),experimentKey:n.string().min(1).max(255),variationKey:n.string().min(1).max(64)}),Dme=n.strictObject({events:n.array(dG).min(1).max(20)}),$me=n.strictObject({inserted:n.number().int().nonnegative(),duplicates:n.number().int().nonnegative(),skipped:n.number().int().nonnegative(),rejected:n.array(n.strictObject({index:n.number().int().nonnegative(),reason:n.string()}))})});var pG,mG,RI,fG,tM,NI=x(()=>{"use strict";ee();ah();ih();ac();pG=n.strictObject({selector:n.string().min(1).max(2048),action:n.enum(["set","append","remove"]),attribute:n.string().min(1).max(128).refine(e=>["html","class","style","position","href","src","alt","title","id","role","hidden"].includes(e)||/^(aria|data)-[a-z0-9_-]+$/.test(e)),value:n.string().max(5e4).optional(),parentSelector:n.string().max(2048).optional(),insertBeforeSelector:n.string().max(2048).optional()}),mG=n.strictObject({variation:n.string().min(1).max(128),description:n.string().max(2e3).default(""),css:n.string().max(1e5).default(""),js:n.string().max(1e5).default(""),domMutations:n.array(pG).max(200).default([]),iam:Zj.optional(),renderGuard:rh.optional()}),RI=mG.omit({variation:!0,description:!0,iam:!0}),fG=oc.omit({variations:!0,active:!0}).extend({changeId:n.string().regex(/^[a-f0-9]{64}$/),variations:n.tuple([RI,RI]).rest(RI).refine(e=>e.length<=20)}),tM=n.strictObject({trackExposures:n.boolean(),environmentId:n.uuid(),generation:n.string().regex(/^[a-f0-9]{64}$/),experiments:n.array(fG).max(100),savedGroups:Dl})});var nM=x(()=>{"use strict"});function jI(e){if(["entry","condition","feature","split","offering","coupon","coupons"].includes(e.type))return!0;if(e.type!=="end"&&e.type!=="output")return!1;let t=e.type==="end"?e.output:e.value;return t?.type!=="bundle"&&t?.type!=="selection"}var $I,hG,gG,DI,yG,Gme,LI=x(()=>{"use strict";ee();Zt();Qs();Vl();$I=32,hG=522240;gG=n.strictObject({nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative()}),DI=n.record(n.string(),Te),yG=n.strictObject({id:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),input:n.strictObject({schemaVersion:Ul.shape.schemaVersion,kind:Ul.shape.kind,selector:Ul.shape.selector,contract:Ul.shape.contract}),context:DI,removed:n.array(n.string()).max(100),attributes:DI,removedAttributes:n.array(n.string()).max(100),result:gL,offeringVersionId:n.uuid().nullable(),events:n.strictObject({entered:n.string().regex(/^[1-9][0-9]{0,18}$/),decision:n.string().regex(/^[1-9][0-9]{0,18}$/).nullable()})}),Gme=n.strictObject({schemaVersion:n.literal(1),mode:n.enum(["local","remote"]),versionId:n.uuid(),generation:n.number().int().positive(),base:gG,context:DI,steps:n.array(yG).min(1).max($I)}).refine(e=>pr(e)<=hG,"Segment exceeds its byte budget")});function AG(e,t=rM){let r=new Map(e.topology.nodes.map(s=>[s.id,s])),i=Ms(e.growth.savedGroups),o=bG(e.growth);function a(s,c){if(!Object.hasOwn(e.growth.features,s))throw t("INVALID_RESPONSE","Required GB Feature is unavailable");return Ii(s,c).value}return{nodes:r,savedGroups:i,features:o.features,feature:a,evaluate(s,c){let u=r.get(s);if(!u)throw t("NOT_FOUND","Funnel node is unavailable");let l,d;if(u.type==="condition"){let h=e.conditions[u.id];if(!h)throw t("INVALID_RESPONSE","Local condition rules are unavailable");l=II({id:u.id,name:u.id,type:"condition",cases:h.map(f=>({condition:f.condition,target:u.outputs[f.port]})),default:u.outputs.default},c,o.experiments).port}else if(u.type==="feature"){if(!u.resources.featureKey)throw t("INVALID_RESPONSE","Feature reference is unavailable");d=a(u.resources.featureKey,c),l="next"}else if(u.type==="split"){if(!(u.resources.experimentId?e.growth.experiments[u.resources.experimentId]:void 0))throw t("INVALID_RESPONSE","Experiment reference is unavailable");let f=II({id:u.id,name:u.id,type:"split",experimentId:u.resources.experimentId,routes:u.outputs,notParticipating:u.outputs.notParticipating},c,o.experiments);d=f.value,l=f.port}else if(["offering","end","output"].includes(u.type)&&u.resources.featureKey)d=a(u.resources.featureKey,c),l=u.type==="offering"?"next":"value";else throw t("SERVER_REQUIRED","This node is driven by the authoritative Funnel runtime");let p=u.outputs[l]??(l==="value"?u.id:void 0);if(!p)throw t("INVALID_RESPONSE","Evaluated node exit is unavailable");return{nodeId:s,port:l,target:p,...d===void 0?{}:{value:d}}}}}function xG(e,t){let r=xc.parse(e);if(r.evaluationMode!=="local")throw t("EVALUATION_MODE","Remote nodes are evaluated by Grow");let i=r.expiresAt?Date.parse(r.expiresAt):null,o=()=>{if(i!==null&&i<=Date.now())throw t("CONFIGURATION_EXPIRED","Refresh local rules at the scheduled transition")};o();let a=AG(r,t);return(s,c)=>(o(),SG(a,s,c))}function SG(e,t,r){let i=tn.parse(r.attributes??{}),{saveStickyBucketAssignmentDoc:o,onFeatureUsage:a,onExperimentViewed:s}=r,c={attributes:i,...o?{saveStickyBucketAssignmentDoc:u=>o(structuredClone(u))}:{},...a?{onFeatureUsage:(u,l)=>a(u,structuredClone(l))}:{},...s?{onExperimentViewed:(u,l)=>s(structuredClone(u),structuredClone(l))}:{},features:e.features,savedGroups:e.savedGroups,...r.stickyBucketAssignmentDocs?{stickyBucketAssignmentDocs:structuredClone(r.stickyBucketAssignmentDocs)}:{}};return e.evaluate(t,c)}function vG(e,t,r){let i=[],o=[],a=[],s=e(t,{...r.attributes?{attributes:r.attributes}:{},stickyBucketAssignmentDocs:r.sticky,saveStickyBucketAssignmentDoc(c){let u=i.findIndex(p=>p.next.attributeName===c.attributeName&&p.next.attributeValue===c.attributeValue),l=c.attributeName+"||"+c.attributeValue,d={expected:r.sticky[l]??null,next:c};u<0?i.push(d):i[u]=d},onExperimentViewed(c,u){u.inExperiment&&u.hashUsed&&!u.passthrough&&o.push(Te.parse({key:c.key,variationId:u.variationId,keyUsed:u.key,hashAttribute:u.hashAttribute,hashValue:u.hashValue}))},onFeatureUsage(c,u){a.push(Te.parse({feature:c,value:u.value,source:u.source,...u.ruleId?{ruleId:u.ruleId}:{}}))}});return{port:s.port,...s.value===void 0?{}:{value:s.value},sticky:i,exposures:o,features:a}}function iM(e,t,r,i=rM){let o=r,a=new Map(t.graph.nodes.map(g=>[g.id,g])),s=structuredClone(r.variables),c=structuredClone(o.sticky),u=[],l=r.nodeId,d=r.visit,p=!1,h,f=g=>(h??=xG(e,i),vG(h,g,{attributes:__({declarations:t.variables,attributes:o.attributes,parameters:r.parameters,answers:r.answers,results:s,savedGroups:{}}),sticky:c}));for(let g=0;g<$I;g++){let A=a.get(l);if(!A||!jI(A))break;if(d>=t.execution.maxTransitions&&(d>t.execution.maxTransitions||A.type!=="end"&&A.type!=="output")){if(!u.length)throw i("TRANSITION_LIMIT","Local Funnel transition budget exceeded");break}let C,w;if(["condition","feature","split"].includes(A.type)||A.type==="offering"&&A.configuration.source==="feature")C=f(A.id),A.type==="offering"&&(C.value={type:"offering_version",id:String(C.value)}),A.type==="condition"?w=C.port==="default"?A.default:A.cases[Number(C.port.slice(5))]?.target:A.type==="split"?w=C.port==="notParticipating"?A.notParticipating:A.routes[C.port]:(A.type==="feature"||A.type==="offering")&&(w=A.next);else if(C={port:"next",sticky:[],exposures:[],features:[]},(A.type==="entry"||A.type==="coupon"||A.type==="coupons")&&(w=A.next),A.type==="offering"&&A.configuration.source==="fixed"&&(C.value={type:"offering_version",id:A.configuration.versionId},w=A.next),A.type==="end"||A.type==="output"){let I=A.type==="end"?A.output:A.value;if(C=I?.type==="feature"?f(A.id):{...C,port:"value",value:I?.type==="literal"?I.value:I?.type==="variable"?Mw({source:"variable",key:I.key,...I.path?{path:I.path}:{}},{declarations:t.variables,answers:r.answers,results:s,parameters:r.parameters,attributes:o.attributes,savedGroups:{}}):null},I&&(C.value===void 0||!kr(t.outputSchema,C.value)))throw i("INVALID_RESPONSE","Local terminal violates its declared output")}let E=[...u,{nodeId:l,result:C}];if(pr({steps:E})>6e4){if(!u.length)throw i("INVALID_REQUEST","Local step exceeds its command budget");break}if(u.push({nodeId:l,result:C}),A.type==="feature"||A.type==="offering"||A.type==="coupon"||A.type==="coupons"){let I=A.type==="coupons"?A.couponIds.map(L=>({type:"reward",id:L})):A.type==="coupon"?{type:"reward",id:A.couponId}:C.value;if(I===void 0)throw i("INVALID_RESPONSE","Node output is missing");let F=Js(A,{value:I});D$(t.variables,A,F),Object.assign(s,F)}for(let I of C.sticky)c[`${I.next.attributeName}||${I.next.attributeValue}`]=structuredClone(I.next);if(A.type==="end"||A.type==="output"){p=!0;break}if(!w)throw i("INVALID_RESPONSE","Local pure exit is unavailable");l=w,d++}let m=a.get(l);return{steps:u,...!p&&m&&!jI(m)?{boundary:{nodeId:l,visit:d}}:{}}}var MI,rM,bG,oM=x(()=>{"use strict";rl();Zt();kI();kh();sc();Pi();Zr();Qs();LI();MI=class extends Error{constructor(r,i){super(i);this.code=r;this.name="FunnelLocalCalculationError"}code},rM=(e,t)=>new MI(e,t),bG=e=>({experiments:e.experiments,features:e.features})});var cfe,aM=x(()=>{"use strict";ee();gc();kh();cfe=n.strictObject({document:go,configuration:xc.options[0]})});var Ch,wG,hfe,gfe,yfe,bfe,_G,Afe,xfe,sM=x(()=>{"use strict";ee();ih();cr();NI();Bs();Ch=n.string().regex(/^[a-f0-9]{64}$/),wG=n.strictObject({release:Ch,render:rh,button:n.strictObject({selector:n.string().min(1).max(512),elementKey:n.string().min(1).max(256),tag:n.enum(["button","a","input"])}).nullable()}),hfe=n.strictObject({scope:yt.extend({environmentId:n.uuid()}),release:Ch,validatedAt:n.iso.datetime({offset:!0}),validUntil:n.iso.datetime({offset:!0}),entries:n.array(n.strictObject({id:n.uuid(),funnelId:n.uuid(),versionId:n.uuid(),event:n.enum(["screen_enter","button_click"]),target:wG})).max(4e3)}),gfe=n.strictObject({operation:n.literal("entry_start"),funnelId:n.uuid(),versionId:n.uuid(),entryId:n.uuid(),release:Ch,requestId:n.uuid(),locale:n.string().min(1).max(35).default("en")}),yfe=n.strictObject({scope:yt,suppressed:n.literal(!0),reason:n.enum(["frequency","in_progress"]),retryAt:n.iso.datetime({offset:!0}).nullable()}),bfe=n.strictObject({experimentId:n.uuid(),splitNodeId:n.string().min(1).max(128)}),_G=n.strictObject({experimentId:n.uuid(),experimentKey:n.string().min(1).max(128),variationKey:n.string().min(1).max(128),inExperiment:n.boolean(),generation:n.string().min(1).max(256)}),Afe=n.strictObject({operation:n.literal("page_experiments"),release:Ch,usedReceiptIds:n.array(n.uuid()).max(20).default([]),customerToken:n.string().regex(so).optional()}),xfe=n.strictObject({scope:yt,runId:n.uuid(),assignments:n.array(_G.extend({receiptId:n.uuid()})).max(20),payload:tM})});var gn=x(()=>{"use strict";cr();f0();g0();fR();qt();b0();Mm();KD();gw();Us();Aw();cl();Sw();yl();Iw();S2();v2();Fs();Ir();lh();V_();oo();AI();vD();wn();_2();_I();k2();Fl();kI();P2();gc();Ih();Ml();$_();N2();kh();dh();PI();Sl();nc();Xf();Uw();z2();wh();Qf();Sh();Wf();Of();Zs();uo();ic();Tw();U2();xa();kw();V2();q2();wl();W_();H2();If();ho();Vl();L_();Pi();j_();fI();K2();yf();_h();dI();pI();aI();Q2();TI();Tl();uh();vf();oI();uI();Zw();o_();K_();n_();i_();t_();Xw();Jw();Rs();Zt();ac();th();p_();eM();vl();Xm();u_();B_();NI();bI();vI();rI();J_();nh();nM();LI();oM();aM();Mf();hf();Bs();sM()});function At(e){return typeof e=="string"?e:String(e)}function kG(e){return e.replace(IG,"$1\uFFFD")}function VI(e,t){if(typeof e!="object"||e==null){let r="";throw r+="The provided value is not an object",new TypeError(r)}return e}function gM(e){if(e!=null&&(typeof e=="object"||typeof e=="function")){let t=e[Symbol.iterator];if(t==null)return;if(typeof t!="function")throw new TypeError("The provided value is not iterable");let r=t.call(e);if(!r||typeof r!="object")throw new TypeError("Result of the Symbol.iterator method is not an object");return r}}function cM(e){let t;if(Array.isArray(e)){let r=e.map(At);if(r.length===2)return r}else if((t=gM(e))!=null){let r=VI(t.next()),i=VI(t.next());if(!r.done&&!i.done)return[At(r.value),At(i.value)]}throw new TypeError("Each query pair must be an iterable [name, value] tuple")}function pi(e){return`%${uM[e>>4&15]}${uM[15&e]}`}function yM(e,t,r=!1){return e>=55296&&e<=57343&&(e=65533),e<=127?r&&e===32?"+":t(e)?pi(e):String.fromCharCode(e):e<=2047?pi(192|e>>6)+pi(128|63&e):e<=65535?pi(224|e>>12)+pi(128|e>>6&63)+pi(128|63&e):pi(240|e>>18)+pi(128|e>>12&63)+pi(128|e>>6&63)+pi(128|63&e)}function BI(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:-1}function qI(e,t=!1){let r=0;for(;r<e.length;r++){let i=e.charCodeAt(r);if(i===37||t&&i===43)break}return r===e.length?e:(t?e.replace(/\+/g," "):e).replace(EG,i=>{try{return decodeURIComponent(i)}catch{return"\uFFFD".repeat(i.length/3)}})}function ed(e){return e<=31||e>126}function CG(e){switch(e){case 32:case 34:case 60:case 62:case 96:return!0;default:return ed(e)}}function QI(e){switch(e){case 32:case 34:case 35:case 60:case 62:return!0;default:return ed(e)}}function PG(e){return QI(e)||e===39}function ZI(e){switch(e){case 63:case 94:case 96:case 123:case 125:return!0;default:return QI(e)}}function Nh(e){switch(e){case 47:case 58:case 59:case 61:case 64:case 91:case 92:case 93:case 124:return!0;default:return ZI(e)}}function lM(e){switch(e){case 33:case 39:case 40:case 41:case 126:return!0;default:return(function(r){switch(r){case 36:case 37:case 38:case 43:case 44:return!0;default:return Nh(r)}})(e)}}function bM(e,t){return yM(e=e||0,t)}function mi(e,t,r=!1){let i=0;for(;i<e.length;i++){let a=e.charCodeAt(i);if(a>=128||r&&a===32||t(a))break}if(i===e.length)return e;let o=e.slice(0,i);for(;i<e.length;i++){let a=e.charCodeAt(i),s=a;if(a>=55296&&a<=56319&&i+1<e.length){let c=e.charCodeAt(i+1);c>=56320&&c<=57343&&(s=(a-55296<<10)+c-56320+65536,i++)}o+=yM(s,t,r)}return o}function YI(e){let t=[],r=0,i=0;for(;i<=e.length;){if(i=e.indexOf("&",r),i<0&&(i=e.length),i!==r){let o=e.slice(r,i),a=o.indexOf("=");a<0&&(a=o.length),t.push([qI(o.slice(0,a),!0),qI(o.slice(a+1),!0)])}if(r=i+1,i===e.length)break}return t}function HI(e){let t="";for(let r=0;r<e.length;r++){let i=mi(e[r][0],lM,!0),o=mi(e[r][1],lM,!0);t+=r!==0?`&${i}=${o}`:`${i}=${o}`}return t}function DG(e){for(let t=0;t<e.length;t++){let r=e.codePointAt(t);if(r>65535&&t++,r<=32||r===37||r===127||r>=55296&&r<=57343||r>=128&&r<=159||r>=64976&&r<=65007||!(65534&~r)||r===65533)return!0}return!1}function MG(e,t){return t===931||t===1010||t===120531||t===120589||t===120647||t===120705||t===120763?"\u03C3":t>=5112&&t<=5117?String.fromCodePoint(t-8):t>=43888&&t<=43967?String.fromCodePoint(t-38864):t>=93856&&t<=93880?String.fromCodePoint(t+27):t===837||t===890||t>=8064&&t<=8111||t>=8114&&t<=8188?e.normalize("NFD").replace(/\u0345/g,"\u03B9").normalize("NFC").toLowerCase():""}function AM(e,t){for(let r=0;r<e.length;r+=2)if(t>=e[r]&&t<=e[r+1])return!0;return!1}function Yl(e,t){let[r,i,o]=e,a=t>>8;for(let u=0;u<r.length;u+=2)if(a>=r[u]&&a<=r[u+1])return!0;let s=i.indexOf(a);if(s<0)return!1;let c=255&t;return!!(o[32*s+(c>>3)]&1<<(7&c))}function FG(e){let t=Array.from(e,r=>r.codePointAt(0));for(let r=0;r<t.length;r++){let i=t[r];if(i!==8204&&i!==8205||r>0&&AM(NG,t[r-1]))continue;if(i===8205)return!1;let o=r-1;for(;o>=0&&Yl(dM,t[o]);)o--;let a=r+1;for(;a<t.length&&Yl(dM,t[a]);)a++;if(!(o>=0&&a<t.length&&Yl(jG,t[o])&&Yl(LG,t[a])))return!1}return!0}function VG(e){return!zG.test(e)||!UG.test(e)}function pM(e){return String.fromCharCode(e+22+75*+(e<26))}function KG(e,t,r){let i=0;for(e=r?Math.floor(e/qG):e>>1,e+=Math.floor(e/t);e>(So-Oh)*GI>>1;i+=So)e=Math.floor(e/(So-Oh));return Math.floor(i+(So-Oh+1)*e/(e+BG))}function WG(e){let t=Array.from(e,u=>u.codePointAt(0)),r="",i=0;for(let u=0;u<t.length;u++){let l=t[u];l<128&&(r+=String.fromCharCode(l),i++)}let o=i;o&&(r+="-");let a=HG,s=0,c=ZG;for(;i<t.length;){let u=GG;for(let l=0;l<t.length;l++){let d=t[l];d>=a&&d<u&&(u=d)}s+=(u-a)*(i+1),a=u;for(let l=0;l<t.length;l++){let d=t[l];if(d<a&&s++,d===a){let p=s;for(let h=So;;h+=So){let f=h<=c?Oh:h>=c+GI?GI:h-c;if(p<f)break;r+=pM(f+(p-f)%(So-f)),p=Math.floor((p-f)/(So-f))}r+=pM(p),c=KG(s,i+1,i===o),s=0,i++}}s++,a++}return r}function FI(e){let t=10;if(e.length>=2&&e[0]==="0"&&(e[1]==="x"||e[1]==="X"))e=e.slice(2),t=16;else if(e.length>=2&&e[0]==="0")e=e.slice(1),t=8;else if(e==="")return-1;let r=0;for(let i=0;i<e.length;i++){let o=BI(e.charCodeAt(i));if(o>=t||o<0)return-1;r=r*t+o}return r}function mM(e){switch(e){case".":case"%2e":case"%2E":return!0;default:return!1}}function xM(e,t){return(e>=65&&e<=90||e>=97&&e<=122)&&(t===58||t===124)}function SM(e){return e.length===2&&xM(e.codePointAt(0),e.codePointAt(1))}function fM(e){return e.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u)!==-1}function zt(e){switch(e){case"ftp":case"http":case"https":case"ws":case"wss":case"file":return!0;default:return!1}}function vM(e){switch(e){case"ftp":return 21;case"http":case"ws":return 80;case"https":case"wss":return 443;default:return null}}function KI(e,t){if(e[0]==="[")return e[e.length-1]==="]"?(function(i){let o=[0,0,0,0,0,0,0,0],a=null,s=0,c=0,u=Array.from(i,l=>l.codePointAt(0));if(u[c]===58){if(u[c+1]!==58)return null;c+=2,s++,a=s}for(;c<u.length;){if(s===8)return null;if(u[c]===58){if(a!==null)return null;c++,s++,a=s;continue}let l=0,d=0,p=0;for(;p<4&&(l=BI(u[c]))>=0;)d=(d<<4)+l,c++,p++;if(u[c]===46){if(p===0||s>6)return null;c-=p;let h=0;for(;u[c]!==void 0;){let f=0;if(h>0)if(u[c]===46&&h<4)c++;else return null;if(u[c]==null||u[c]<48||u[c]>57)return null;for(;u[c]>=48&&u[c]<=57;){if(f=10*f+BI(u[c]),f>255)return null;c++}o[s]=256*o[s]+f,h++,h%2==0&&s++}if(h!==4)return null;break}else if(u[c]===58){if(u[++c]===void 0)return null}else if(u[c]!==void 0)return null;o[s]=d,s++}if(a!==null){let l=s-a;for(s=7;s!==0&&l>0;){let d=o[a+l-1];o[a+l-1]=o[s],o[s]=d,s--,l--}}else if(a===null&&s!==8)return null;return o})(e.substring(1,e.length-1)):null;if(t)return(function(i){return fM(i)?null:mi(i,ed)})(e);{let r=(function(o){let a=!1,s=!1;for(let u=0;u<o.length;u++){let l=o.charCodeAt(u);if(l<=32||l===37||l===127)return null;if(l>=128){a=!0;break}l>=65&&l<=90&&(s=!0)}if(!a)return o!==""?s?o.toLowerCase():o:null;if((function(l){for(let d of l){let p=d.codePointAt(0);if(/[\p{Cn}\p{Co}\p{Cs}\p{Noncharacter_Code_Point}]/u.test(d)&&!AM(OG,p)||Yl($G,p))return!0}return!1})(o))return null;let c=(o=(function(l){let d="";for(let p of l){let h=p.codePointAt(0);if(h!==8204&&h!==8205&&/\p{Default_Ignorable_Code_Point}/u.test(p))continue;let f=MG(p,h);if(f){d+=f;continue}let m=TG.indexOf(h);d+=m<0?p:RG[m]}return d})(o).normalize("NFKC").replace(/[\u3002\uff0e\uff61]/g,".").toLowerCase()).split(".");for(let u=0;u<c.length;u++){let l=c[u];if(l==="")continue;let d=/[^\0-\x7f]/.test(l);if(DG(l)||d&&(/^\p{Mark}/u.test(l)||!FG(l)||!VG(l)||l.startsWith("xn--")))return null;d&&(c[u]=`xn--${WG(l)}`)}return(o=c.join("."))!==""?o:null})(e.indexOf("%")===-1?e:qI(e));return r===null||fM(r)?null:(function(o){let a=o.length,s=o.lastIndexOf(".",a-2)+1;if(o.charCodeAt(a-1)===46&&a--,a<=s)return!1;if(FI(o.slice(s,a))>=0)return!0;for(;s<a;s++){let c=o.charCodeAt(s);if(c<48||c>57)return!1}return!0})(r)?(function(o){let a=o.split("."),s=a.length;if(a[s-1]||s--,s>4)return null;let c=0;for(let l=0;l<s-1;l++){let d=FI(a[l]);if(d<0||d>255)return null;c+=d*(1<<8*(3-l))}let u=FI(a[s-1]);return u<0||u>=256**(5-s)?null:(c+=u,c)})(r):r}}function WI(e){return typeof e=="number"?(function(r){let o="";return o+=`${(r>>>24&255).toString(10)}.`,o+=`${(r>>>16&255).toString(10)}.`,o+=`${(r>>>8&255).toString(10)}.`,o+=(r&255).toString(10),o})(e):Array.isArray(e)?`[${(function(r){let i=(function(c){let u=-1,l=-1,d=1,p=0;for(let h=0;h<c.length;++h)c[h]!==0?(p>d&&(u=l,d=p),l=-1,p=0):(l===-1&&(l=h),++p);return p>d?l:u})(r),o="",a=!1;for(let s=0;s<=7;++s)if(!(a&&r[s]===0)){if(a&&(a=!1),i===s){o+=s===0?"::":":",a=!0;continue}o+=r[s].toString(16),s!==7&&(o+=":")}return o})(e)}]`:e}function wM(e){e.path.length>0&&(e.path.length!==1||e.scheme!=="file"||!(function(r){return/^[A-Za-z]:$/u.test(r)})(e.path[0]))&&e.path.pop()}function _M(e){return e.username!==""||e.password!==""}function zI(e){return e.host===null||e.host===""||e.scheme==="file"}function hr(e,t,r,i){t||(e=(function(s){let c=0,u=s.length;for(;c<u&&!(s.charCodeAt(c)>32);++c);for(;u>c&&!(s.charCodeAt(u-1)>32);--u);return s.substring(c,u)})(e)),e=(function(s){let c=0;for(;c<s.length;c++){let l=s.charCodeAt(c);if(l===9||l===10||l===13)break}if(c===s.length)return s;let u=s.slice(0,c);for(;c<s.length;c++){let l=s.charCodeAt(c);l!==9&&l!==10&&l!==13&&(u+=s[c])}return u})(e),B=0,te=e,He="",ht=r||null,re=t||{scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,opaquePath:!1},Th=!1,Rh=!1,Ia=!1,Ut=i||0;let o=JG;switch(i){case 3:case 4:o=Dh;break;case 5:o=ek;break;case 6:o=ka;break;case 7:o=vo;break;case 8:o=fi}return o(ye(e,B))!==1?re:null}function we(e,t){return B+=B===e?Wr(t):1,B<=te.length}function ye(e,t){return t<e.length?e.codePointAt(t):void 0}function Wr(e){return e!=null&&e>65535?2:1}function IM(e){return e==null?"":e<=65535?String.fromCharCode(e):String.fromCodePoint(e)}function EM(e,t){let r=e.length-t;if(r<2)return!1;if(xM(ye(e,t),ye(e,t+1))){if(r===2)return!0;{let i=ye(e,t+2);return i===47||i===92||i===63||i===35}}else return!1}function JI(e){if(e.opaquePath)return e.path[0];{let t="";for(let r of e.path)t+=`/${r}`;return t}}function PM(e){switch(e.scheme){case"blob":{let t=hr(JI(e),null,null,0);return t===null||t.scheme!=="http"&&t.scheme!=="https"?"null":PM(t)}case"ftp":case"http":case"https":case"ws":case"wss":return(function(r){let i=`${r.scheme}://`;return i+=r.host,r.port!==null&&(i+=`:${r.port}`),i})(e);default:return"null"}}function UI(e,t){t?e[Nt].list=YI(t):e[Nt].list.length=0,e[Nt].serialized=t==null}function Ph(e){if(e.url){let t=HI(e.list);(function(i,o){i[bt].url.query=o})(e.url,t||null),e.serialized=!0}}var IG,uM,EG,OG,TG,RG,NG,$G,jG,LG,dM,zG,UG,So,Oh,GI,BG,qG,ZG,HG,GG,B,te,He,ht,re,Th,Rh,Ia,Ut,JG,QG,kM,YG,XG,XI,hM,eK,jh,Sc,Dh,ek,tk,tK,nk,ka,Jr,CM,vo,fi,bt,wo,Nt,nK,rK,Xl,$h,rk=x(()=>{IG=/[\ud800-\udbff](?![\udc00-\udfff])|(^|[^\ud800-\udbff])[\udc00-\udfff]/g;uM="0123456789ABCDEF",EG=/(?:%[0-9A-Fa-f]{2})+/g;OG=[2191,2191,3164,3164,3292,3292,6863,6877,6880,6891,8385,8385,11158,11158,42958,42959,42962,42962,42964,42964,42993,42993,64451,64466,64912,64913,64968,64974,67904,67929,69317,69319,69328,69336,69370,69371,72544,72551,73136,73179,73184,73193,93856,93880,93883,93907,94194,94198,100344,100351,101641,101662,101760,101874,118010,118012,118458,118480,118496,118512,124608,124638,124640,124661,124670,124671,128728,128728,128887,128890,129232,129240,129620,129623,129674,129674,129678,129678,129736,129736,129741,129741,129770,129770,129775,129775,130042,130042,177978,177983,183970,183981,205744,210041],TG=[7296,7297,7298,7299,7300,7301,7302,7303,7304,42958,42962,42964,42993],RG=["\u0432","\u0434","\u043E","\u0441","\u0442","\u0442","\u044A","\u0463","\uA64B","\uA7CF","\uA7D3","\uA7D5","s"],NG=[2381,2381,2509,2509,2637,2637,2765,2765,2893,2893,3021,3021,3149,3149,3277,3277,3387,3388,3405,3405,3530,3530,3642,3642,3770,3770,3972,3972,4153,4154,5908,5909,5940,5940,6098,6098,6752,6752,6980,6980,7082,7083,7154,7155,11647,11647,43014,43014,43052,43052,43204,43204,43347,43347,43456,43456,43766,43766,44013,44013,68159,68159,69702,69702,69744,69744,69759,69759,69817,69817,69939,69940,70080,70080,70197,70197,70378,70378,70477,70477,70606,70608,70722,70722,70850,70850,71103,71103,71231,71231,71350,71350,71467,71467,71737,71737,71997,71998,72160,72160,72244,72244,72263,72263,72345,72345,72767,72767,73028,73029,73111,73111,73537,73538,90415,90415];[$G,jG,LG,dM]=[[[],"0,6,7,8,m,w,10,1b,1d,1f,72,73,7k,8k,dt,2rk","AAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAA/AAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAADAAABwfwAAAAAAAMADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAhAAAAQAAAAAAAAQCAAABAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgACAAAAAAAAAAAAAAAAD//wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAP///////////////wAAAAAAAAAAAAAAAAAAAAA="],[[],"6,7,8,o,4o,7e,7f,7h,7i,7j,dl","AAAAAEF9+P/+BwAAAMAA//8AAPz/////BlADAAAAAJwAAPz///8AAADA//H/5+X8AAAAAAAAAAAA/P///wcAAAAAAAAAAAAAPv0vAD0BAABA/gAA/5/5/f8BAAAAAAAAgAAAAP//////////////AYD/////BQAAAAAAAAAAAAAAAAAAAAAAAP///////wcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8g+N8B+AAAAAAAAAAAAAAAAAAAAAAAAP//AwAAYAAAAAAAAAAAAAD/////CwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANgAAAAAAAAAAAAAAAAA//8fAB4AAAD//wMAAAAAAH3/HgwAAAAAAAD//////////w8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="],[[],"6,7,8,o,4o,7e,7f,7h,7i,7j,dl","AAAAAP3////+BwAAAMDu//////////////8vAADAAJwAAP3///8AAADg////////AAAAAAAAAAAA/P///wcAAAAAAAAAAAAA////Ab0H//9H/gAA/9////8BAAAAAAAAgAAAAP//////////////AYD/////BQAAAAAAAAAAAAAAAAAAAAAAAP///////wcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL/G//8T+AAAAAAAAAAAAAAAAAAAAAAAAP//AwAAfgAAAAAAAAAAAAD+////DwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANwAAAAAAAAAAAAAAAAA//8fAB4AAAD//wMAAAAAAH3/Hg4AAAAAAAD//////////w8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="],[[],"0,3,4,5,6,7,8,9,a,b,c,d,e,f,g,j,n,o,p,q,r,s,t,w,18,19,1c,4m,4o,4p,4q,4r,6z,72,73,75,76,77,7e,7h,7i,7j,7k,7l,7m,7n,7o,7p,7q,7r,7s,7t,7u,7v,7w,7x,7y,7z,8k,9t,a2,a3,a7,cc,cv,cx,cy,d6,dc,dd,de,dg,dh,di,dk,dl,2rk,2rl","AAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAD//////////////////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD4AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/v////+/tgAAAAAAAAAAAP8XAAAAAAD4//8AAAEAAAAAAAAAAAAAAMCfnz0AAACAAgAAAP///wcAAAAAAAAAAAAAwP8BAAAAAAAA+A8gAADA++8+AAAAAAAOAAAAAAAAgP8AAAAAAPz///v///8HAAAAAAAAFP4h/gAMAAAAAgAAAAAAABAeIAAADAAAQAYAAAAAAAAQhjkCAAAAIwAGAAAAAAAAEL4hAAAMAAD8AgAAAAAAAJAeIGAADAAAAAQAAAAAAAAAASAAAAAAAAARAAAAAAAA0ME9YAAMAAAAAgAAAAAAAJBAMAAADAAAAAMAAAAAAAAYHiAAAAwAAAACAAAAAAAAAAAEXAAAAAAAAAAAAAAA8geAfwAAAAAAAAAAAAAAAPIfAH8AAAAAAAAAAAADAACgAgAAAAAAAP5/3+D//v///x9AAAAAAAAAAAAAAAAA4P1mAAAAwwEAHgBkIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAMAAAADAAAAAwAAAAAAAAAsD9A/g8gAAAAAAC4AAAAAAAAAAAAAAAAAABgAAAAAAIAAAAAAAAAAAAAAAAAAIcBBA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAJAAAAAAAAQH/lH/ifAAAAAAAA//////8//w8AAA8AAAAAANAXBAAAAAD4DwADAAAAPDsAAAAAAABAowMAAAAAAADwzwAAAAAAAAAAAAAAAAAAAAAAAAD3//0hEAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//////////wDIAAAAfAAAAAAAAB/8AAAAAAAAAAAAAAAA/////wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAwAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAA/////wAAAAAAPAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAID3PwAAAMAAAAAAAAAAAAAAAwBECAAAYBAAAAAAAAAAAAAAAAAAAAAAAAAwAAAA//8DgAAAAADAPwAAgP8DAAAAAAAHAAAAAADIMwAAAAAgAAAAAAAAAAB+ZgAIEAAAAAAAEAAAAAAAAJ3BAgAAAAAwQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICEAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//8AAP//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAMAHAAAAAAAAAAAAAAAAAAAAAG7wAAAAAACHAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAPAAAAAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAA/AAAAAAAAAAAwP8BAAAAAAA8AAAAAAAAAAAAAAAAAAAAAgAAAAAAAP9/AAAAAAAZgAMAAAAAAHgGBAAAAAAAAAAHAAAAgO8fAAAAAAAAAAgAAwAAAAAAwH8AngAAAAAAAAAAAAAAgNNAAgAAAAAAAAAAAAAAAAAAAAAAAID4BwAAAwAAAAAAABgBAAAAwB8fAAAAAAAAAAD4AUAFAAYAAAAAAAAAAAAA/1wAAEAAAAAAAAAAAAAA+IUNAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8sAEAADAAAAAAAAAAAAAA+KcBAAAAAAAAAAAAAAAAKL8AAAAAAAAAAAAAAACgvA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgP8GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFgIAAAAAAAAAAAAAAAAAAAAAADwDAEAAAD+BwAAAAD4eYAAfg4AAAAAAPx/AwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf78AAAAAAAAAAAAA/P///G0AAAAAAAAAAAAAAAAAAAB+tL8AAAAAAAAAAACjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAwAAAAAAwAcFAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//4H/PwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMD/4wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHwAAAAAAAAB/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAcAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAPAAAAAAAAAAAAAAD//////z///38AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAD+P/nDwAAADwAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///////9/+P//////HyAAEAAA+P7/AAAAAAAAAAAAAH////nbBwAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASMAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfwAAAAAAAAAAAAAAAADwDwAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAA////////////////AAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////////wAA"]].map(function([t,r,i]){return[t,r.split(",").map(o=>parseInt(o,36)),Uint8Array.from(atob(i),o=>o.charCodeAt(0))]});zG=/(?![\p{Mark}\p{Decimal_Number}])[\p{Script=Arabic}\p{Script=Hebrew}]/u,UG=/\p{Script=Latin}/u;So=36,Oh=1,GI=26,BG=38,qG=700,ZG=72,HG=128,GG=2147483647;B=0,te="",He="",ht=null,Th=!1,Rh=!1,Ia=!1;JG=e=>{let t=B;if(e!=null&&(e>=65&&e<=90||e>=97&&e<=122)){let r=B+1;for(e=te.charCodeAt(r);e===43||e===45||e===46||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57;)r++,e=te.charCodeAt(r);return He=te.slice(B,r).toLowerCase(),B=r,QG(r<te.length?e:void 0)}else return Ut?1:(--B,we(t,e)?kM(ye(te,B)):0)},QG=e=>{let t=B;if(e===58){if(Ut){if(zt(re.scheme)!==zt(He))return 0;if((_M(re)||re.port!==null)&&He==="file")return 0;if(re.scheme==="file"&&re.host==="")return 0}return re.scheme=He,Ut?(re.port===vM(re.scheme)&&(re.port=null),0):(He="",re.scheme==="file"?we(t,e)?tk(ye(te,B)):0:zt(re.scheme)&&ht!==null&&ht.scheme===re.scheme?we(t,e)?YG(ye(te,B)):0:zt(re.scheme)?we(t,e)?eK(ye(te,B)):0:ye(te,B+1)===47?(B++,we(t,e)?XG(ye(te,B)):0):(re.path=[""],re.opaquePath=!0,we(t,e)?CM(ye(te,B)):0))}else return Ut?1:(He="",B=-1,we(t,e)?kM(ye(te,B)):0)},kM=e=>{let t=B;return ht===null||ht.opaquePath&&e!==35?1:ht.opaquePath&&e===35?(re.scheme=ht.scheme,re.path=ht.path.slice(),re.opaquePath=ht.opaquePath,re.query=ht.query,re.fragment="",we(t,e)?fi(ye(te,B)):0):ht.scheme==="file"?(B--,we(t,e)?tk(ye(te,B)):0):(B--,we(t,e)?XI(ye(te,B)):0)},YG=e=>{let t=B;return e===47&&ye(te,B+1)===47?(++B,we(t,e)?jh(ye(te,B)):0):(B--,we(t,e)?XI(ye(te,B)):0)},XG=e=>{let t=B;return e===47?we(t,e)?Sc(ye(te,B)):0:(B--,we(t,e)?Jr(ye(te,B)):0)},XI=e=>{let t=B;return re.scheme=ht.scheme,e===47||zt(re.scheme)&&e===92?we(t,e)?hM(ye(te,B)):0:(re.username=ht.username,re.password=ht.password,re.host=ht.host,re.port=ht.port,re.path=ht.path.slice(),re.query=ht.query,e===63?(re.query="",we(t,e)?vo(ye(te,B)):0):e===35?(re.fragment="",we(t,e)?fi(ye(te,B)):0):e!=null?(re.query=null,re.path.pop(),B--,we(t,e)?Jr(ye(te,B)):0):we(t,e)?XI(ye(te,B)):0)},hM=e=>{let t=B;return zt(re.scheme)&&(e===47||e===92)?we(t,e)?jh(ye(te,B)):0:e===47?we(t,e)?Sc(ye(te,B)):0:(re.username=ht.username,re.password=ht.password,re.host=ht.host,re.port=ht.port,B--,we(t,e)?Jr(ye(te,B)):0)},eK=e=>{let t=B;return e===47&&ye(te,B+1)===47?B++:B--,we(t,e)?jh(ye(te,B)):0},jh=e=>{let t=B;return e!==47&&e!==92?(B--,we(t,e)?Sc(ye(te,B)):0):we(t,e)?jh(ye(te,B)):0},Sc=e=>{let t=B;if(e!=null&&e!==64&&e!==35&&e!==47&&e!==63&&(e!==92||!zt(re.scheme))){let r=B+Wr(e);for(;r<te.length;){let i=ye(te,r);if(i==null||i===64||i===35||i===47||i===63||i===92&&zt(re.scheme))break;r+=Wr(i)}return He+=te.slice(B,r),B=r-1,we(t,e)?Sc(ye(te,B)):0}if(e===64){Th&&(He=`%40${He}`),Th=!0;for(let r=0;r<He.length;r++){let i=He.codePointAt(r);if(i===58&&!Rh){Rh=!0;continue}let o=bM(i,Nh);Rh?re.password+=o:re.username+=o,i!=null&&i>65535&&r++}return He="",we(t,e)?Sc(ye(te,B)):0}else return e==null||e===35||e===47||e===63||e===92&&zt(re.scheme)?Th&&He===""?1:(B-=He.length+1,He="",we(t,e)?Dh(ye(te,B)):0):(He+=IM(e),we(t,e)?Sc(ye(te,B)):0)},Dh=e=>{let t=B;if(Ut&&re.scheme==="file")return B--,we(t,e)?nk(ye(te,B)):0;if(e!=null&&e!==58&&e!==35&&e!==47&&e!==63&&(e!==92||!zt(re.scheme))){let r=B+Wr(e);for(e===91?Ia=!0:e===93&&(Ia=!1);r<te.length;){let i=ye(te,r);if(i==null||!Ia&&i===58||i===35||i===47||i===63||i===92&&zt(re.scheme))break;i===91?Ia=!0:i===93&&(Ia=!1),r+=Wr(i)}return He+=te.slice(B,r),B=r-1,we(t,e)?Dh(ye(te,B)):0}else if(e===58&&!Ia){if(He===""||Ut===4)return 1;let r=KI(He,!zt(re.scheme));return r===null?1:(re.host=WI(r),He="",we(t,e)?ek(ye(te,B)):0)}else if(e==null||e===35||e===47||e===63||e===92&&zt(re.scheme)){if(B--,zt(re.scheme)&&He==="")return 1;if(Ut&&He===""&&(_M(re)||re.port!==null))return 1;let r=KI(He,!zt(re.scheme));return r===null?1:(re.host=WI(r),He="",Ut?0:we(t,e)?ka(ye(te,B)):0)}else return He+=IM(e),we(t,e)?Dh(ye(te,B)):0},ek=e=>{let t=B;if(e!=null&&e>=48&&e<=57){let r=B+1;for(;r<te.length;){let i=te.charCodeAt(r);if(i<48||i>57)break;r++}return He+=te.slice(B,r),B=r-1,we(t,e)?ek(ye(te,B)):0}else if(Ut||e==null||e===35||e===47||e===63||e===92&&zt(re.scheme)){if(He!==""){let r=parseInt(He,10);if(r>65535)return 1;if(re.port=r===vM(re.scheme)?null:r,He="",Ut)return 0}return Ut?1:(B--,we(t,e)?ka(ye(te,B)):0)}else return 1};tk=e=>{let t=B;return re.scheme="file",re.host="",e===47||e===92?we(t,e)?tK(ye(te,B)):0:ht?.scheme==="file"?(re.host=ht.host,re.path=ht.path.slice(),re.opaquePath=ht.opaquePath,re.query=ht.query,e===63?(re.query="",we(t,e)?vo(ye(te,B)):0):e===35?(re.fragment="",we(t,e)?fi(ye(te,B)):0):e!=null?(re.query=null,EM(te,B)?re.path=[]:wM(re),B--,we(t,e)?Jr(ye(te,B)):0):we(t,e)?tk(ye(te,B)):0):(B--,we(t,e)?Jr(ye(te,B)):0)},tK=e=>{let t=B;return e===47||e===92?we(t,e)?nk(ye(te,B)):0:(ht!==null&&ht.scheme==="file"&&(!EM(te,B)&&(function(i){if(i.length===2){let o=i.codePointAt(0),a=i.codePointAt(1);return(o>=65&&o<=90||o>=97&&o<=122)&&a===58}else return!1})(ht.path[0])&&re.path.push(ht.path[0]),re.host=ht.host),B--,we(t,e)?Jr(ye(te,B)):0)},nk=e=>{let t=B;if(e!=null&&e!==47&&e!==92&&e!==63&&e!==35){let r=B+Wr(e);for(;r<te.length;){let i=ye(te,r);if(i==null||i===47||i===92||i===63||i===35)break;r+=Wr(i)}return He+=te.slice(B,r),B=r-1,we(t,e)?nk(ye(te,B)):0}else if(e==null||e===47||e===92||e===63||e===35){if(B--,!Ut&&SM(He))return we(t,e)?Jr(ye(te,B)):0;if(He==="")return re.host="",Ut?0:we(t,e)?ka(ye(te,B)):0;{let r=KI(He,!zt(re.scheme));return r===null?1:(r==="localhost"&&(r=""),re.host=WI(r),He="",Ut?0:we(t,e)?ka(ye(te,B)):0)}}return 1},ka=e=>{let t=B;return zt(re.scheme)?(e!==92&&e!==47&&B--,we(t,e)?Jr(ye(te,B)):0):!Ut&&e===63?(re.query="",we(t,e)?vo(ye(te,B)):0):!Ut&&e===35?(re.fragment="",we(t,e)?fi(ye(te,B)):0):e!=null?(e!==47&&B--,we(t,e)?Jr(ye(te,B)):0):(Ut&&re.host===null&&re.path.push(""),we(t,e)?ka(ye(te,B)):0)},Jr=e=>{let t=B;if(e!=null&&e!==47&&(!zt(re.scheme)||e!==92)&&(Ut||e!==63&&e!==35)){let r=B+Wr(e);for(;r<te.length;){let i=ye(te,r);if(i==null||i===47||zt(re.scheme)&&i===92||!Ut&&(i===63||i===35))break;r+=Wr(i)}He+=mi(te.slice(B,r),ZI),B=r,e=ye(te,r)}if(e==null||e===47||zt(re.scheme)&&e===92||!Ut&&(e===63||e===35)){let r=zt(re.scheme)&&e===92;return(function(o){switch(o){case"..":case"%2e.":case"%2E.":case".%2e":case".%2E":case"%2e%2e":case"%2E%2e":case"%2e%2E":case"%2E%2E":return!0;default:return!1}})(He)?(wM(re),e!==47&&!r&&re.path.push("")):mM(He)&&e!==47&&!r?re.path.push(""):mM(He)||(re.scheme==="file"&&re.path.length===0&&SM(He)&&(He=`${He[0]}:`),re.path.push(He)),He="",e===63?(re.query="",we(t,e)?vo(ye(te,B)):0):e===35?(re.fragment="",we(t,e)?fi(ye(te,B)):0):we(t,e)?Jr(ye(te,B)):0}else return He+=bM(e,ZI),we(t,e)?Jr(ye(te,B)):0},CM=e=>{let t=B;if(e===63)return re.query="",we(t,e)?vo(ye(te,B)):0;if(e===35)return re.fragment="",we(t,e)?fi(ye(te,B)):0;if(e!=null){let r=B+Wr(e);for(;r<te.length;){let o=ye(te,r);if(o===63||o===35)break;r+=Wr(o)}let i=te.slice(B,r);if(r<te.length&&i.charCodeAt(i.length-1)===32?re.path[0]+=mi(i.slice(0,-1),ed)+"%20":re.path[0]+=mi(i,ed),B=r,(e=ye(te,r))===63)return re.query="",we(t,e)?vo(ye(te,B)):0;if(e===35)return re.fragment="",we(t,e)?fi(ye(te,B)):0}return we(t,e)?CM(ye(te,B)):0},vo=e=>{let t=B,r=B;if(e!=null){if(Ut)r=te.length;else{let o=te.indexOf("#",B);r=o===-1?te.length:o}let i=zt(re.scheme)?PG:QI;re.query+=mi(te.slice(B,r),i)}return B=r,ye(te,r)===35&&!Ut?(re.fragment="",we(t,e)?fi(ye(te,B)):0):we(t,e)?vo(ye(te,B)):0},fi=e=>{let t=B;return e!=null&&(re.fragment+=mi(te.slice(B),CG),B=te.length),we(t,e)?fi(ye(te,B)):0};bt=Symbol("URLImpl"),wo=class e{constructor(t,r){if(t===void 0&&r===void 0)throw new TypeError('The "url" argument must be specified.');t=At(t),r!=null&&(r=At(r));let i=null;if(r!=null&&(i=hr(r,null,null,0),i==null))throw new TypeError(`Invalid base URL: ${r}`);let o=hr(t,null,i,0);if(o==null)throw new TypeError(`Invalid URL: ${t}`);this[bt]={url:o,query:null}}static createObjectURL(t){throw new TypeError("URL.createObjetURL is unsupported")}static revokeObjectURL(t){}static parse(t,r){t=At(t),r!==void 0&&(r=At(r));try{return new e(t,r)}catch{return null}}static canParse(t,r){t=At(t),r!==void 0&&(r=At(r));let i=null;return r!=null&&(i=hr(r,null,null,0),i==null)?!1:hr(t,null,i,0)!=null}get href(){return(function(r){let i=`${r.scheme}:`;return r.host!==null&&(i+="//",(r.username!==""||r.password!=="")&&(i+=r.username,r.password!==""&&(i+=`:${r.password}`),i+="@"),i+=r.host,r.port!==null&&(i+=`:${r.port}`)),r.host===null&&!r.opaquePath&&r.path.length>1&&r.path[0]===""&&(i+="/."),i+=JI(r),r.query!==null&&(i+=`?${r.query}`),r.fragment!==null&&(i+=`#${r.fragment}`),i})(this[bt].url)}set href(t){let r=hr(t=At(t),null,null,0);if(r==null)throw new TypeError(`Invalid URL: ${t}`);this[bt].url=r,this[bt].query&&UI(this[bt].query,r.query)}get origin(){return PM(this[bt].url)}get protocol(){return`${this[bt].url.scheme}:`}set protocol(t){hr(`${t=At(t)}:`,this[bt].url,null,2)}get username(){return this[bt].url.username}set username(t){t=At(t),zI(this[bt].url)||(function(i,o){i.username=mi(o,Nh)})(this[bt].url,t)}get password(){return this[bt].url.password}set password(t){t=At(t),zI(this[bt].url)||(function(i,o){i.password=mi(o,Nh)})(this[bt].url,t)}get host(){let{url:t}=this[bt];return t.host==null?"":t.port==null?t.host:`${t.host}:${t.port}`}set host(t){t=At(t),this[bt].url.opaquePath||hr(t,this[bt].url,null,3)}get hostname(){let{url:t}=this[bt];return t.host!=null?t.host:""}set hostname(t){t=At(t),this[bt].url.opaquePath||hr(t,this[bt].url,null,4)}get port(){let{url:t}=this[bt];return t.port!=null?`${t.port}`:""}set port(t){t=At(t);let{url:r}=this[bt];zI(r)||(t?hr(t,r,null,5):r.port=null)}get pathname(){return JI(this[bt].url)}set pathname(t){t=At(t);let{url:r}=this[bt];r.opaquePath||(r.path=[],hr(t,r,null,6))}get search(){let{url:t}=this[bt];return t.query?`?${t.query}`:""}set search(t){t=At(t);let{url:r,query:i}=this[bt];if(!t)r.query=null,i&&UI(i,null);else{let o=t[0]==="?"?t.substring(1):t;r.query="",hr(o,r,null,7),i&&UI(i,r.query)}}get searchParams(){let t=this[bt],r=t.query;return r==null&&(r=t.query=(function(o,a){let s=new $h;return s[Nt].url=o,s[Nt].serialized=a==null,a&&(s[Nt].list=YI(a)),s})(this,t.url.query)),r}get hash(){let{url:t}=this[bt];return t.fragment?`#${t.fragment}`:""}set hash(t){t=At(t);let{url:r}=this[bt];if(!t)r.fragment=null;else{let i=t[0]==="#"?t.substring(1):t;r.fragment="",hr(i,r,null,8)}}toJSON(){return this.href}toString(){return this.href}};Object.defineProperty(wo.prototype,Symbol.toStringTag,{value:"URL",configurable:!0});Nt=Symbol("URLSearchParamsImpl"),nK=Symbol.dispose||Symbol.for("dispose");rK=typeof Iterator<"u"?Iterator:Object,Xl=class extends rK{constructor(t,r){super(),this[Nt]={ptr:t,map:r,index:0}}next(){let t=this[Nt];return t.index<t.ptr.list.length?{value:t.map(t.ptr.list[t.index++]),done:!1}:{value:void 0,done:!0}}[Symbol.iterator](){return this}[nK](){}},$h=class{constructor(t){let r=this[Nt]={list:[],url:null,serialized:!0},i;if(Array.isArray(t))for(let o=0;o<t.length;o++)r.list.push(cM(t[o]));else if((i=gM(t))!=null){let o;for(;!(o=VI(i.next())).done;)r.list.push(cM(o.value))}else if((typeof t=="object"||typeof t=="function")&&t!=null){let o=Object.keys(t);for(let a=0;a<o.length;a++){let s=o[a],c=kG(s),u=At(t[s]),l=r.list.find(d=>d[0]===c);l?l[1]=u:r.list.push([c,u])}}else if(t!==void 0){let o=At(t);o=o[0]==="?"?o.substring(1):o,r.list=YI(o)}}get size(){return this[Nt].list.length}append(t,r){t=At(t),r=At(r),this[Nt].list.push([t,r]);let i=this[Nt];i.url&&i.serialized?(function(a,s){let c=a[bt].url;c.query=c.query?`${c.query}&${s}`:s})(i.url,HI([[t,r]])):Ph(i)}delete(t,r){t=At(t),r=r!=null?At(r):void 0;let{list:i}=this[Nt],o=0;for(;o<i.length;)i[o][0]===t&&(r==null||i[o][1]===r)?i.splice(o,1):o++;Ph(this[Nt])}get(t){t=At(t);let{list:r}=this[Nt];for(let i=0;i<r.length;i++)if(r[i][0]===t)return r[i][1];return null}getAll(t){t=At(t);let r=[],{list:i}=this[Nt];for(let o=0;o<i.length;o++)i[o][0]===t&&r.push(i[o][1]);return r}has(t,r){t=At(t),r=r!=null?At(r):void 0;let{list:i}=this[Nt];for(let o=0;o<i.length;o++)if(i[o][0]===t&&(r==null||i[o][1]===r))return!0;return!1}set(t,r){t=At(t),r=At(r);let{list:i}=this[Nt],o=!1,a=!1,s=0;for(;s<i.length;)i[s][0]===t?o?(i.splice(s,1),a=!0):(o=!0,i[s][1]!==r&&(i[s][1]=r,a=!0),s++):s++;o||(i.push([t,r]),a=!0),a&&Ph(this[Nt])}sort(){this[Nt].list.sort((t,r)=>t[0]<r[0]?-1:t[0]>r[0]?1:0),Ph(this[Nt])}forEach(t,r){if(typeof t!="function")throw new TypeError('The "callback" argument must be of type function');let{list:i}=this[Nt];for(let o=0;o<i.length;o++)t.call(r,i[o][1],i[o][0],this)}entries(){return new Xl(this[Nt],t=>t)}keys(){return new Xl(this[Nt],t=>t[0])}values(){return new Xl(this[Nt],t=>t[1])}toString(){return HI(this[Nt].list)}[Symbol.iterator](){return this.entries()}};Object.defineProperty($h.prototype,Symbol.toStringTag,{value:"URLSearchParams",configurable:!0})});var K,_o=x(()=>{"use strict";g0();K=class extends Error{constructor(r,i,o,a,s){super(i);this.code=r;this.status=o;this.requestId=a;this.name="IndianaError",this.reason=s?.reason;let c=mR(r,o??0,{...s,retryAfter:s?.retryAfterSeconds===void 0?void 0:String(s.retryAfterSeconds)});this.retryable=c.retryable,this.recovery=c.recovery,this.retryAfterSeconds=c.retryAfterSeconds}code;status;requestId;retryable;recovery;retryAfterSeconds;reason}});var OM,TM=x(()=>{"use strict";OM="https://api.tinker.cash"});var gr=x(()=>{"use strict";rk();_o()});function rt(e,...t){try{Promise.resolve(e?.(...t)).catch(()=>{})}catch{}}var Ea=x(()=>{"use strict"});var ik=x(()=>{"use strict";Ir();ho();wl();Tw();Sh()});var ok,zM=x(()=>{"use strict";ok={tag:"0a3fc81c4311ccdb0f8dd7f7afff09170ce4ca4338ef9d17d626aba3d21e5366",csp:"default-src 'none'; script-src 'sha256-UznZYYJO84QL7WE307bb//1369HDvk9x2sY+tHsxToI='; style-src 'unsafe-inline'; img-src https: data:; connect-src 'none'; font-src 'none'; media-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'",html:'<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src \'none\'; script-src \'sha256-UznZYYJO84QL7WE307bb//1369HDvk9x2sY+tHsxToI=\'; style-src \'unsafe-inline\'; img-src https: data:; connect-src \'none\'; font-src \'none\'; media-src \'none\'; frame-src \'none\'; base-uri \'none\'; form-action \'none\'"></head><body><script>(() => {\n try {\n const input = JSON.parse(decodeURIComponent(location.hash.slice(1)));\n if (!input || !/^[a-f0-9-]{36}$/.test(input.channel) || input.mode !== "live" || !Number.isInteger(input.hostDepth) || input.hostDepth < 1 || input.hostDepth > 16) return;\n const origin = new URL(input.parentOrigin);\n if (!["https:", "http:"].includes(origin.protocol) || origin.origin !== input.parentOrigin) return;\n const boot = { channel: input.channel, parentOrigin: origin.origin, hostDepth: input.hostDepth, mode: "live" };\n (function ct(y){function C(e){return e.type==="stack"&&e.interaction?.type==="select"&&e.interaction.purpose==="product"&&!!e.interaction.pickerId}function O(e){let a={};function t(r){if(C(r)){let n=a[r.interaction.pickerId]??={ids:[],defaultId:null};for(let i of r.children){let l=i.type==="stack"?i.bind?.plan:void 0;l&&!n.ids.includes(l)&&n.ids.push(l)}let s=r.children[r.interaction.defaultIndex];!n.defaultId&&s?.type==="stack"&&(n.defaultId=s.bind?.plan??null)}r.type==="stack"&&r.children.forEach(t)}return e.pages.forEach(r=>t(r.root)),a}function pe(e,a,t){let r={};function n(d){if(d.hidden)return;if(d.type==="plan_picker"){let o=t.pickers[d.id];r[d.id]={ids:o?.options??[],defaults:o?.selected?[o.selected]:[],remembered:[]};return}if(d.type!=="stack")return;let p=d.children.filter(o=>!o.hidden),f=d.interaction;if(C(d)){let o=r[d.interaction.pickerId]??={ids:[],defaults:[],remembered:[]},c=t.pickers[d.interaction.pickerId]?.options??[];for(let m of p){let w=m.type==="stack"?m.bind?.plan:void 0;w&&c.includes(w)&&!o.ids.includes(w)&&o.ids.push(w),w&&m.id===a[d.id]&&o.remembered.push(w)}let u=d.children[d.interaction.defaultIndex];u?.type==="stack"&&!u.hidden&&u.bind?.plan&&o.defaults.push(u.bind.plan)}if(f?.type==="tabs"){let o=p.find(c=>c.id===a[d.id])??d.children[f.defaultIndex];o&&n(o)}else if(f?.type==="toggle"){let o=typeof a[d.id]=="boolean"?a[d.id]:f.defaultEnabled,c=d.children[o?0:1];c&&n(c)}else p.forEach(n)}let s=typeof a.__page=="string"?a.__page:e.initialPageId??e.pages[0]?.id,i=e.pages.find(d=>d.id===s);i&&n(i.root);let l={};for(let[d,p]of Object.entries(r)){let f=a[d],o=p.remembered[0]??(p.ids.includes(t.pickers[d]?.selected??"")?t.pickers[d]?.selected:p.defaults[0]);l[d]=typeof f=="string"?p.ids.includes(f)?f:"":o&&p.ids.includes(o)?o:""}for(let d of Object.keys(O(e)))l[d]??="";return l}let F=window;for(let e=0;e<y.hostDepth;e++)F=F.parent;let ut=window,gt={none:0,xs:4,sm:8,md:12,lg:20,xl:32},ft={none:0,sm:4,md:8,lg:14,full:9999},Y={system:\'system-ui,-apple-system,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif\',serif:\'Georgia,"Times New Roman","Songti SC","Noto Serif CJK SC",serif\',rounded:\'ui-rounded,"SF Pro Rounded","Hiragino Maru Gothic ProN",system-ui,sans-serif\',mono:"ui-monospace,SFMono-Regular,Menlo,Consolas,monospace"},Be={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"},qe={start:"flex-start",center:"center",end:"flex-end",between:"space-between"},mt={start:"start",center:"center",end:"end",between:"stretch"},ht={start:"start",center:"center",end:"end",stretch:"stretch"},Ue={"1:1":"1 / 1","4:3":"4 / 3","16:9":"16 / 9","3:1":"3 / 1"},yt=`\n*,*::before,*::after{box-sizing:border-box}\nhtml,body{margin:0;padding:0;background:transparent}\nbody{font-family:var(--g-font);color:var(--g-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}\n#g-card{background:var(--g-bg);min-height:1px}\n#g-card[data-g-presentation=fullscreen]{min-height:100vh;display:flex;flex-direction:column}\n#g-card[data-g-presentation=fullscreen]>[data-g-node]{flex:1 0 auto}\n[hidden]{display:none!important}\n.g-stack{display:flex;min-width:0}\n.g-empty{min-height:48px;outline:1px dashed #c9cfee;outline-offset:-1px;background:#eef0fa44}\n.g-empty::after{content:attr(data-g-editor-placeholder);font-size:12px;color:#737b8e;align-self:center;margin:auto;pointer-events:none}\n.g-v{flex-direction:column}\n.g-h{flex-direction:row;flex-wrap:wrap}\n.g-o{display:grid;grid-template-columns:minmax(0,1fr)}\n/* Each authored overlay layer paints as a unit in document order. */\n.g-o>*{grid-area:1/1;min-width:0;isolation:isolate}\n.g-text{margin:0;white-space:pre-line;overflow-wrap:anywhere;min-width:0}\n.g-title{font-size:26px;line-height:1.2;font-weight:700;letter-spacing:-.01em}\n.g-heading{font-size:20px;line-height:1.3;font-weight:650}\n.g-body{font-size:15px;line-height:1.6}\n.g-caption{font-size:12px;line-height:1.5;letter-spacing:.02em}\n.g-btn{appearance:none;border:0;margin:0;font:inherit;font-size:15px;font-weight:600;line-height:1.25;padding:12px 18px;border-radius:var(--g-radius);cursor:pointer;min-height:44px;text-align:center;overflow-wrap:anywhere}\n.g-btn-primary{background:var(--g-primary);color:var(--g-on-primary)}\n.g-btn.g-stack .g-text{color:inherit}\n.g-btn-primary:hover{filter:brightness(1.06)}\n.g-btn-secondary{background:transparent;color:var(--g-text);box-shadow:inset 0 0 0 1px var(--g-border)}\n.g-btn-secondary:hover{background:var(--g-surface)}\n.g-btn-link{background:transparent;color:var(--g-muted);padding:8px 12px;min-height:36px;font-weight:500}\n.g-btn-link:hover{color:var(--g-text)}\n.g-btn:focus-visible{outline:3px solid var(--g-focus);outline-offset:2px}\n.g-img{display:block;width:100%;overflow:hidden}\n.g-img img{display:block;width:100%;height:auto}\n.g-img[data-aspect] img{height:100%}\n.g-divider{border:0;border-top:1px solid var(--g-border);margin:0;align-self:stretch}\n.g-custom{display:block;min-width:0}\n.g-missing{opacity:.45}\n.g-box{position:absolute;pointer-events:none;z-index:2147483646;border:1px solid var(--g-edit);border-radius:2px;display:none}\n.g-box[data-kind=select]{border-width:2px}\n.g-box span{position:absolute;left:-2px;bottom:100%;margin-bottom:2px;padding:1px 6px;font:500 11px/16px system-ui,sans-serif;color:#fff;background:var(--g-edit);border-radius:3px;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}\n.g-box[data-below] span{bottom:auto;top:100%;margin:2px 0 0}\n[data-g-editor] .g-btn{cursor:default}\n.g-data{--g-data-ink:var(--g-text);--g-data-muted:var(--g-muted);--g-data-line:var(--g-border);--g-data-surface:var(--g-surface);width:100%;min-width:0;color:var(--g-data-ink);font-variant-numeric:tabular-nums;container-type:inline-size;container-name:customer-data}\n.g-data-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}\n.g-data-heading{display:flex;align-items:center;gap:10px;font-size:18px;line-height:1.35;font-weight:600;margin:0;letter-spacing:-.025em}\n.g-data-icon{display:block;width:18px;height:18px;flex:none}\n.g-data-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}\n.g-data-button,.g-data-select{font:500 13px/1.4 var(--g-font);color:var(--g-data-ink);background:transparent;border:1px solid color-mix(in srgb,var(--g-data-ink) 52%,transparent);border-radius:6px;min-height:36px;padding:7px 10px;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}\n.g-data-button:hover{background:var(--g-data-surface)}\n.g-data-button:focus-visible,.g-data-select:focus-visible,.g-data-sources>summary:focus-visible{outline:3px solid var(--g-data-ink);outline-offset:3px}\n.g-data-button:disabled,.g-data-select:disabled{opacity:.4;cursor:default}\n.g-data-refresh{border-color:transparent;width:32px;min-height:32px;display:grid;place-items:center;padding:6px;color:var(--g-data-muted)}\n.g-data-refresh:hover{color:var(--g-data-ink)}\n.g-data-refreshing .g-data-icon{animation:g-data-spin 1.2s linear infinite}\n@keyframes g-data-spin{to{transform:rotate(360deg)}}\n.g-data-buy{background:var(--g-primary);color:var(--g-on-primary);border-color:transparent;min-height:40px;font-size:13px;font-weight:600}\n.g-data-buy:hover{background:var(--g-primary);filter:brightness(.95);transform:translateY(-1px)}\n.g-data[data-preview=true] .g-data-buy:disabled{opacity:.8}\n.g-data-note{font-size:13px;line-height:1.6;color:var(--g-data-muted);margin:12px 0;overflow-wrap:anywhere}\n.g-data-error{padding:12px 0;border-block:1px solid var(--g-data-line);color:var(--g-data-ink);font-size:13px;line-height:1.6}\n.g-data-resource+.g-data-resource{border-top:1px solid var(--g-data-line);padding-top:24px;margin-top:24px}\n.g-data-name{font-size:12px;color:var(--g-data-muted);font-weight:500;margin:0 0 10px}\n.g-data-balance{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:18px}\n.g-data-number{font-family:var(--g-data-number-font,var(--g-font));font-size:var(--g-data-number-size,clamp(44px,7vw,72px));font-weight:var(--g-data-number-weight,500);line-height:1.08;letter-spacing:-.055em;overflow-wrap:anywhere;max-width:100%}\n.g-data-fraction{font-size:22px;letter-spacing:-.025em;color:var(--g-data-muted)}\n.g-data-unit{font-size:13px;color:var(--g-data-muted)}\n.g-data-facts{display:flex;gap:24px;flex-wrap:wrap;font-size:13px;line-height:1.6;color:var(--g-data-muted)}\n.g-data-facts strong{font-weight:600;color:var(--g-data-ink);margin-inline-start:6px}\n.g-data-expiry{margin-inline-start:auto;font-size:12px}\n.g-data-resource-label{font-size:12px;letter-spacing:0;color:var(--g-data-muted);padding-inline-start:10px;border-inline-start:1px solid var(--g-data-line);font-weight:400}\n.g-data-sources{margin-top:20px;border-top:1px solid var(--g-data-line);padding-top:12px}\n.g-data-sources>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;font-weight:500;cursor:pointer;line-height:1.5;list-style:none;border-radius:3px;padding:6px 0}\n.g-data-sources>summary::-webkit-details-marker{display:none}\n.g-data-sources>summary>.g-data-icon{width:16px;height:16px;transition:transform .18s}\n.g-data-sources[open]>summary>.g-data-icon{transform:rotate(180deg)}\n.g-data-sources[open]>.g-data-list{animation:g-data-reveal .18s ease-out}\n@keyframes g-data-reveal{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}\n.g-data-list{list-style:none;padding:0;margin:0;border-top:1px solid var(--g-data-line)}\n.g-data-row{display:grid;grid-template-columns:minmax(120px,1.5fr) minmax(80px,.75fr) minmax(90px,1fr);column-gap:20px;row-gap:10px;align-items:start;padding:18px 0;border-bottom:1px solid var(--g-data-line);min-width:0}\n.g-data-row-no-value,.g-data-row-no-status{grid-template-columns:minmax(0,1fr) auto;column-gap:16px}\n.g-data-row-no-value .g-data-row-status{text-align:end}\n.g-data-row-main{display:flex;align-items:flex-start;gap:12px;min-width:0}\n.g-data-row-copy{min-width:0}\n.g-data-row-mark{display:grid;place-items:center;width:34px;height:34px;flex:none;background:var(--g-data-surface);color:var(--g-data-muted);border:1px solid var(--g-data-line);border-radius:50%}\n.g-data-row-mark .g-data-icon{width:16px;height:16px}\n.g-data-row-label{font-size:15px;font-weight:600;line-height:1.5;overflow-wrap:anywhere;margin:0}\n.g-data-row-detail{font-size:13px;line-height:1.65;color:var(--g-data-muted);margin-top:4px;overflow-wrap:anywhere}\n.g-data-row-status{font-size:12px;line-height:1.6;color:var(--g-data-muted);padding:4px 8px;border-radius:4px;background:var(--g-data-surface);width:fit-content;justify-self:end;overflow-wrap:anywhere}\n.g-data-row-value{font-size:15px;font-weight:650;text-align:end;line-height:1.5;overflow-wrap:anywhere}\n.g-data-row-extra{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}\n.g-data-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;font-size:12px;color:var(--g-data-muted)}\n.g-data-empty{display:flex;align-items:center;gap:10px;padding:28px 0;border-block:1px solid var(--g-data-line);font-size:13px;line-height:1.6;color:var(--g-data-muted)}\n.g-data-empty>.g-data-icon{width:20px;height:20px;opacity:.65}\n.g-data-skeleton{padding-block:8px;animation:g-data-reveal .18s ease-out}\n.g-data-skeleton-line{display:block;background:var(--g-data-line);border-radius:4px;animation:g-data-pulse 1.4s ease-in-out infinite}\n.g-data-skeleton-value{width:42%;height:var(--g-data-number-size,64px);margin:4px 0 22px}\n.g-data-skeleton-meta{width:65%;height:12px;margin-bottom:20px}\n.g-data-skeleton-row{display:flex;justify-content:space-between;gap:24px;padding:20px 0;border-block-end:1px solid var(--g-data-line)}\n.g-data-skeleton-row>.g-data-skeleton-line:first-child{width:52%;height:14px}\n.g-data-skeleton-row>.g-data-skeleton-line:last-child{width:18%;height:14px}\n.g-data[data-layout=compact] .g-data-skeleton-value{height:var(--g-data-number-size,34px);margin-bottom:16px}\n.g-data-recovery{margin:12px 0}\n.g-data-live-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}\n@keyframes g-data-pulse{50%{opacity:.4}}\n.g-data-updated{font-size:11px;margin-bottom:0}\n.g-data-preview{font-size:11px;color:var(--g-data-muted);border:1px solid var(--g-data-line);border-radius:4px;padding:3px 6px;white-space:nowrap}\n.g-data[data-source=credit_balance] .g-data-heading{font-size:15px;font-weight:500;letter-spacing:0}\n.g-data[data-source=credit_balance] .g-data-header{margin-bottom:18px}\n.g-data[data-source=credit_balance] .g-data-updated{margin:0;font-size:11px;color:var(--g-data-muted)}\n.g-data[data-source=credit_balance] .g-data-sources>summary{max-width:100%}\n.g-data-table-head{display:grid;grid-template-columns:minmax(0,1fr) 92px minmax(120px,.45fr);gap:16px;padding:10px 0;font-size:12px;color:var(--g-data-muted);border-block:1px solid var(--g-data-line)}\n.g-data-table-head>span:not(:first-child){text-align:end}\n.g-data[data-source=credit_transactions] .g-data-list{border-top:0}\n.g-data[data-source=credit_transactions] .g-data-row{grid-template-columns:minmax(0,1fr) 92px minmax(120px,.45fr);gap:16px;padding:18px 0;align-items:center;transition:background .15s}\n.g-data[data-source=credit_transactions] .g-data-row:hover{background:var(--g-data-surface)}\n.g-data[data-source=credit_transactions] .g-data-row-status{grid-column:2;grid-row:1}\n.g-data[data-source=credit_transactions] .g-data-row-extra{grid-column:3;grid-row:1;justify-content:flex-end}\n.g-data[data-source=credit_transactions] .g-data-facts{flex-direction:column;align-items:flex-end;gap:8px}\n.g-data[data-source=credit_transactions] .g-data-facts>span{display:flex;flex-direction:column-reverse;align-items:flex-end;font-size:12px}\n.g-data[data-source=credit_transactions] .g-data-facts strong{font-size:15px;margin-inline-start:0;font-weight:600}\n.g-data[data-source=credit_packs] .g-data-row{border:0;padding:16px 0;grid-template-columns:minmax(0,1fr) auto}\n.g-data[data-source=credit_packs] .g-data-list{border:0}\n.g-data[data-source=credit_packs] .g-data-row+.g-data-row{border-top:1px solid var(--g-data-line)}\n.g-data[data-source=credit_packs] .g-data-row-value{font-size:22px;letter-spacing:-.04em}\n.g-data[data-source=credit_packs] .g-data-row-extra{display:block}\n.g-data[data-source=credit_packs] .g-data-buy{width:100%;margin-top:2px}\n.g-data[data-source=credit_packs] .g-data-header{margin-bottom:4px}\n.g-data[data-layout=compact] .g-data-header{margin-bottom:10px}\n.g-data[data-layout=compact] .g-data-heading{font-size:14px;color:var(--g-data-muted);letter-spacing:0;font-weight:500}\n.g-data[data-layout=compact] .g-data-number{font-size:var(--g-data-number-size,34px)}\n.g-data[data-layout=compact] .g-data-row{padding:10px 0;column-gap:12px}\n.g-data[data-layout=compact] .g-data-row{grid-template-columns:minmax(0,1fr) auto}\n.g-data[data-layout=compact] .g-data-row-status{grid-column:1;grid-row:2;justify-self:start}\n.g-data[data-layout=compact] .g-data-row-value{grid-column:2;grid-row:1}\n.g-data[data-layout=compact] .g-data-updated{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}\n.g-data[data-source=credit_transactions][data-layout=compact] .g-data-table-head{display:none}\n.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row{grid-template-columns:minmax(0,1fr) 92px minmax(120px,.45fr);gap:16px;padding:14px 0}\n.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-status{grid-column:2;grid-row:1}\n.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-extra{grid-column:3;grid-row:1;justify-content:flex-end}\n.g-data[data-source=membership][data-layout=compact] .g-data-list{border:0}\n.g-data[data-source=membership][data-layout=compact] .g-data-row{padding:0;border:0}\n.g-data[data-source=membership][data-layout=compact] .g-data-row-status{grid-column:2;grid-row:1;justify-self:end}\n.g-data[data-source=membership][data-layout=compact] .g-data-header{margin-bottom:6px}\n.g-data[data-source=membership][data-layout=full] .g-data-heading{font-size:14px;font-weight:500;color:var(--g-data-muted)}\n.g-data[data-source=membership][data-layout=full] .g-data-list{border-top:0}\n.g-data[data-source=membership][data-layout=full] .g-data-row{padding:12px 0 22px;column-gap:24px}\n.g-data[data-source=membership][data-layout=full] .g-data-row-label{font-family:var(--g-data-display-font,var(--g-font));font-size:var(--g-data-display-size,30px);font-weight:var(--g-data-display-weight,600);letter-spacing:-.035em;line-height:1.25}\n.g-data[data-source=membership][data-layout=full] .g-data-row-detail{font-size:13px;margin-top:12px}\n.g-data[data-source=membership][data-layout=full] .g-data-row-status{font-size:12px;padding:5px 9px}\n.g-data[data-source=customer_plans][data-layout=full] .g-data-row{padding:24px 0;grid-template-columns:minmax(0,1fr) 140px 180px;gap:24px;align-items:center}\n.g-data[data-source=customer_plans][data-layout=full] .g-data-row-label{font-family:var(--g-data-display-font,var(--g-font));font-size:22px;font-weight:600}\n.g-data[data-source=customer_plans][data-layout=full] .g-data-row-value{font-size:24px;font-weight:500;letter-spacing:-.035em}\n.g-data[data-source=customer_plans][data-layout=full] .g-data-row-status{font-size:12px;padding:5px 9px}\n@container customer-data (min-width:600px){\n .g-data[data-source=credit_packs][data-layout=full]>.g-data-list,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:24px;border:0}\n .g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr;gap:20px;padding:24px;border:1px solid var(--g-data-line);border-radius:14px;align-items:start;align-content:start;transition:border-color .16s,background .16s}\n .g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row:hover{border-color:var(--g-data-ink);background:var(--g-data-surface)}\n .g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row{padding:24px 0;border:0;border-top:1px solid var(--g-data-ink);border-radius:0}\n .g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-main,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-main{grid-column:1;grid-row:1}\n .g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-value,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-value{grid-column:1;grid-row:2;text-align:start;font-size:30px;line-height:1.3;letter-spacing:-.035em;font-weight:500}\n .g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-extra{grid-column:1;grid-row:3;align-self:end}\n .g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-status{grid-column:1;grid-row:3;justify-self:start;align-self:end}\n .g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-extra{grid-column:1;grid-row:auto}\n .g-data[data-source=credit_packs][data-layout=full] .g-data-header,.g-data[data-source=customer_plans][data-layout=full] .g-data-header{margin-bottom:20px}\n .g-data[data-source=credit_packs][data-layout=full] .g-data-buy{min-height:44px;border-radius:8px}\n}\n@media(max-width:560px){.g-data[data-source=customer_plans][data-layout=full] .g-data-row{grid-template-columns:minmax(0,1fr) auto;gap:12px}.g-data[data-source=customer_plans][data-layout=full] .g-data-row-value{font-size:20px}.g-data[data-source=membership][data-layout=full] .g-data-row-label{font-size:var(--g-data-display-size,24px)}}\n@media(max-width:560px){.g-data-header{gap:10px}.g-data-controls{gap:6px}.g-data-row{grid-template-columns:minmax(0,1fr) auto;column-gap:12px}.g-data-row-status{grid-column:1;grid-row:2}.g-data-row-value{grid-column:2;grid-row:1}.g-data-row-extra{grid-column:1/-1}.g-data-facts{gap:12px}.g-data-button,.g-data-select{min-height:40px;padding:8px 10px}.g-data-refresh{width:40px;padding:10px}.g-data-sources>summary{min-height:36px}.g-data-table-head{display:none}.g-data[data-source=credit_transactions] .g-data-row{grid-template-columns:minmax(0,1fr) minmax(95px,.45fr);gap:12px}.g-data[data-source=credit_transactions] .g-data-row-status{grid-column:1;grid-row:2;margin-inline-start:46px;justify-self:start}.g-data[data-source=credit_transactions] .g-data-row-extra{grid-column:2;grid-row:1/3}.g-data[data-source=membership][data-layout=compact] .g-data-row-status{grid-column:2;grid-row:1}}\n@media(max-width:560px){.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row{grid-template-columns:minmax(0,1fr) minmax(95px,.45fr);gap:12px}.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-status{grid-column:1;grid-row:2;margin-inline-start:46px;justify-self:start}.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-extra{grid-column:2;grid-row:1/3}}\n@media(max-width:560px){.g-data[data-source=membership] .g-data-row-no-value .g-data-row-status{grid-column:2;grid-row:1;align-self:start;justify-self:end}}\n@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}\n`;function X(){return Object.create(null)}let k=null,$,Ae=new Set,E,ee,Z=new Map,le=new Map,_e=new Map,te=new Map,ue=0,H=new Map,ge=new WeakMap,ae=0,re=0,fe,B=null,h=X(),ie=X(),G=X(),P="",Je=!1,Ne=-1,Ie=!1,Ve="",me=null,Le=null,he=null,I=document.createElement("div");I.id="g-card";let ye=document.createElement("div"),ce=document.createElement("div");ye.className=ce.className="g-box",ce.dataset.kind="select",ye.append(document.createElement("span")),ce.append(document.createElement("span"));function N(e){let a={...e,channel:y.channel};try{F.postMessage(a,y.parentOrigin)}catch{}}function Te(e){let a=parseInt(e.slice(1),16);return[a>>16&255,a>>8&255,a&255]}function be(e,a,t){let r=Te(e),n=Te(a),s=r.map((i,l)=>Math.round(i*t+n[l]*(1-t)));return`rgb(${s[0]},${s[1]},${s[2]})`}function bt(e){let[a,t,r]=Te(e).map(n=>{let s=n/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*a+.7152*t+.0722*r}function ne(e){return typeof e!="string"?"":e.startsWith("#")?e:`var(--g-${e==="background"?"bg":e})`}function xt(e){let a=e.theme,t=document.documentElement.style,r=bt(a.primary),n=(r+.05)/.05>1.05/(r+.05)?"#111318":"#FFFFFF";t.setProperty("--g-primary",a.primary),t.setProperty("--g-on-primary",n),t.setProperty("--g-bg",a.background),t.setProperty("--g-text",a.text),t.setProperty("--g-muted",be(a.text,a.background,.62)),t.setProperty("--g-surface",be(a.text,a.background,.05)),t.setProperty("--g-border",be(a.text,a.background,.16)),t.setProperty("--g-focus",be(a.primary,a.background,.45)),t.setProperty("--g-radius",`${ft[a.radius]??8}px`),t.setProperty("--g-font",Y[a.font]??Y.system),t.setProperty("--g-edit","#2C3C96")}function _(e){let a=k?.strings.locales[P]?.[e];return a&&a.trim()?{value:a,missing:!1}:{value:k?.strings.locales[k.strings.defaultLocale]?.[e]??"",missing:!0}}function q(e){let a=E?.nodes[e];if(!a)return;let t=a.picker?h[a.picker]??E?.pickers[a.picker]?.selected:void 0;if(!(a.picker&&typeof t=="string"&&!E?.pickers[a.picker]?.options.includes(t)))return typeof t=="string"?a.byPlan?.[t]??a.base:a.base}function K(){return{...k?.surface==="paywall"&&B?{__page:B}:{},...Object.fromEntries(Object.entries(h).filter(e=>!Array.isArray(e[1])))}}function Me(e){return $&&Object.hasOwn($.answers,e)&&$.bindings.some(a=>a.variable===e)?$.answers[e]:$?.values?.[e]}function Ke(e){let a=te.get(e);if(a)return a;let t=[...new Set([...e.matchAll(/\\{\\{\\s*variables\\.([^{}]+?)\\s*\\}\\}/g)].map(r=>r[1].trim()))];if(e.length<=1e6)for(te.set(e,t),ue+=e.length;te.size>128||ue>1e6;){let r=te.keys().next().value;te.delete(r),ue-=r.length}return t}function $e(e){let a=e.html[P];return q(e.id)?.html??E?.nodes[e.id]?.base.html??(a&&a.trim()?a:e.html[k?.strings.defaultLocale??""]??"")}function We(){te.clear(),ue=0;let e=[],a=[],t=l=>{if(!l.hidden){if(l.type==="stack")l.children.forEach(t);else if(l.type==="custom_html"){e.push($e(l));let d=E?.nodes[l.id];for(let p of[d?.base,...Object.values(d?.byPlan??{})])p?.html!==void 0&&a.push(p.html)}}},r=B??k?.initialPageId,n=k?.pages??[],s=new Set;for(let l of[...n.filter(d=>d.id===r),...n.filter(d=>d.id!==r)]){e.length=a.length=0,t(l.root);for(let d of[...e,...a])s.add(d)}let i=new Set([...s].map(ze));for(let[l,d]of H)i.has(l)||Ye(l,d);for(let l of s)Ke(l),!H.has(ze(l))&&(H.size>=32||re+500>4e3||ae+l.length+2>262144||Re(l,!0))}function ze(e){return(y.mode==="live"&&$?"b:":"s:")+e}function Ye(e,a){H.delete(e),ae-=e.length,re-=a.elements}function Re(e,a=!1){let t=ze(e),r=H.get(t);if(r)return H.delete(t),H.set(t,r),r;let n="data-indiana-html-binding";for(;e.includes(n);)n+="-next";let s=[],i=y.mode==="live"&&!!$,l=/\\{\\{\\s*variables\\.([^{}]+?)\\s*\\}\\}/g,d=i?e.replace(l,(u,m)=>(s.push(m.trim()),`<span ${n}="${s.length-1}"></span>`)):e,p=document.createElement("template");p.innerHTML=`<div>${d}</div>`;let f=p.content.firstElementChild,o=[];for(let u of f.querySelectorAll(`[${n}]`)){let m=document.createTextNode(""),w=s[Number(u.getAttribute(n))];u.replaceWith(m);let S=[];for(let v=m;v!==f;){let L=v.parentNode;S.unshift(Array.prototype.indexOf.call(L.childNodes,v)),v=L}o.push({path:S,variable:w})}let c={key:t,content:f,inUse:!1,bindings:o,unresolved:(i?e.replace(l,""):e).includes("{{"),elements:f.getElementsByTagName("*").length};if(t.length<=262144&&c.elements<=4e3){if(!a)for(;H.size>=32||ae+t.length>262144||re+c.elements>4e3;){let[u,m]=H.entries().next().value;Ye(u,m)}H.size<32&&ae+t.length<=262144&&re+c.elements<=4e3&&(H.set(t,c),ae+=t.length,re+=c.elements)}return c}function Ce(e){let a=e.template;if(a?.content===e.body&&H.get(a.key)===a){for(let t of e.bindings)t.node.data="";a.inUse=!1,e.parked=!0}e.template=null}function Ze(e,a){let t=ge.get(e),r=$e(a),n=y.mode==="live"&&!!$,s=t.source!==r||t.bound!==n,i;s&&(Ce(t),i=Re(r),t.source=r,t.bound=n,t.unresolved=i.unresolved,t.variables=[...new Set(i.bindings.map(o=>o.variable))]);let l=new Map,d=t.unresolved;if(n)for(let o of t.variables){let c=Me(o);if(c==null){d=!0;continue}let u=String(typeof c=="object"?JSON.stringify(c):c).replace(/\\r\\n?/g,`\n`);u.includes("{{")&&(d=!0),l.set(o,u)}if(d&&y.mode==="live"){if(Ce(t),t.parked){let c=document.createElement("div");t.body.replaceWith(c),t.body=c,t.parked=!1}let o=_(a.fallback??"").value.replace(/\\r\\n?/g,`\n`);(!t.fallback||t.body.textContent!==o)&&(t.body.textContent=o),t.fallback=!0,t.bindings=[]}else if(s||t.fallback||!t.initialized){i??=Re(r);let o=!i.inUse,c=o?i.content:i.content.cloneNode(!0);t.bindings=i.bindings.map(({path:u,variable:m})=>{let w=c;for(let S of u)w=w.childNodes[S];return{node:w,variable:m}});for(let u of t.bindings)u.node.data=l.get(u.variable);t.body.replaceWith(c),t.body=c,t.parked=!1,o&&H.get(i.key)===i?(i.inUse=!0,t.template=i):t.template=null;for(let u of t.body.querySelectorAll("img"))u.addEventListener("load",ke);t.fallback=!1,t.initialized=!0}else for(let o of t.bindings){let c=l.get(o.variable);o.node.data!==c&&(o.node.data=c)}let p=q(a.id),f=a.html[P];e.classList.toggle("g-missing",y.mode==="editor"&&(!!p?.missing?.length||!p&&r.includes("{{")||!(f&&f.trim())))}function se(e,a,t){let r=q(e.id),n=r?.[a],s=n!==void 0?{value:n,missing:!!r?.missing?.length}:_(t);if(y.mode==="live"&&$){let i=!1,l=s.value.replace(/\\{\\{\\s*variables\\.([^{}]+?)\\s*\\}\\}/g,(d,p)=>{p=p.trim();let f=Me(p);return f==null||f===""||Array.isArray(f)&&!f.length?(i=!0,""):Array.isArray(f)?f.join(", "):String(f)});if(i)return{value:e.fallback?_(e.fallback).value:"",missing:!0};if(!l.includes("{{"))return{value:l,missing:s.missing}}return n!==void 0?s:s.value.includes("{{")&&y.mode==="live"?{value:e.fallback?_(e.fallback).value:"",missing:!0}:{value:s.value,missing:s.missing||s.value.includes("{{")}}function wt(e){if(e.name)return e.name;let a=y.editorMessages?.nodeTypes?.[e.type];return y.mode==="editor"&&typeof a=="string"?a:{stack:"\\u5BB9\\u5668",text:"\\u6587\\u672C",image:"\\u56FE\\u7247",button:"\\u6309\\u94AE",divider:"\\u5206\\u9694\\u7EBF",spacer:"\\u7559\\u767D",custom_html:"\\u81EA\\u5B9A\\u4E49 HTML",price:"\\u4EF7\\u683C",coupon_code:"\\u4F18\\u60E0\\u7801",countdown:"\\u5012\\u8BA1\\u65F6",plan_picker:"\\u771F\\u5B9E\\u5957\\u9910\\u9009\\u62E9"}[e.type]??e.type}function vt(e,a){if(a.type==="color")e.background="none",e.backgroundColor=ne(a.color);else if(a.type==="linear"){let t=a.stops.map(r=>`${ne(r.color)} ${Number(r.at)}%`).join(",");e.backgroundColor="transparent",e.backgroundImage=`linear-gradient(${Number(a.angle)}deg,${t})`}else if(a.type==="image"&&typeof a.src=="string"){let t=/^data:image\\/(?:svg\\+xml|jpeg|png);base64,[A-Za-z0-9+/]+={0,2}$/.test(a.src)?a.src:a.src.replace(/[^A-Za-z0-9\\-._~:/?#[\\]@!$&*+;=%]/gu,n=>n.length===1&&n.charCodeAt(0)<128?`%${n.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`:encodeURIComponent(n));e.backgroundImage=`url("${t}")`;let r=a.position;e.backgroundPosition=r?`${r.x}% ${r.y}%`:"center",e.backgroundSize=a.fit==="contain"?"contain":"cover",e.backgroundRepeat="no-repeat"}}function Ge(e){return`${Number(e.top)}px ${Number(e.right)}px ${Number(e.bottom)}px ${Number(e.left)}px`}function Qe(e,a,t,r,n){if(a===void 0)return;let s=r?.direction??"vertical",i=s!=="overlay"&&t==="width"==(s==="horizontal"),l=t==="width"?"minWidth":"minHeight";a==="fill"?s==="overlay"?(e.style[t]="100%",e.style[t==="width"?"justifySelf":"alignSelf"]="stretch"):i?(e.style.flex="1 1 0",e.style[l]="0"):(e.style.alignSelf="stretch",e.style[t]="auto"):a==="fit"?(e.style[t]="fit-content",t==="width"&&(e.style.maxWidth="100%"),!i&&s!=="overlay"&&(!r||r.align==="stretch")&&(e.style.alignSelf=n==="center"?"center":n==="end"?"flex-end":"flex-start")):typeof a=="number"&&(e.style[t]=`${a}px`,t==="width"&&(e.style.maxWidth="100%"),i&&(e.style.flex="0 0 auto"))}function oe(e,a,t){let r=a.style,n=r.text??{},s=e.style;if(a.type==="customer_data"&&(n.font&&s.setProperty("--g-data-display-font",Y[String(n.font)]??Y.system),a.data.source==="membership"&&(typeof n.size=="number"&&s.setProperty("--g-data-display-size",`clamp(${Math.min(n.size,28)}px, ${n.size/12}vw, ${n.size}px)`),typeof n.weight=="number"&&s.setProperty("--g-data-display-weight",String(n.weight)))),a.type==="customer_data"&&a.data.source==="credit_balance"&&(typeof n.size=="number"&&s.setProperty("--g-data-number-size",`clamp(${Math.min(n.size,48)}px, ${n.size/10}vw, ${n.size}px)`),n.font&&s.setProperty("--g-data-number-font",Y[String(n.font)]??Y.system),typeof n.weight=="number"&&s.setProperty("--g-data-number-weight",String(n.weight))),a.type==="customer_data"&&n.color){let p=ne(n.color);s.setProperty("--g-data-ink",p),s.setProperty("--g-data-muted",`color-mix(in srgb, ${p} 72%, transparent)`),s.setProperty("--g-data-line",`color-mix(in srgb, ${p} 20%, transparent)`),s.setProperty("--g-data-surface",`color-mix(in srgb, ${p} 8%, transparent)`)}r.padding&&(s.padding=Ge(r.padding)),r.margin&&(s.margin=Ge(r.margin)),typeof r.gap=="number"&&a.type==="stack"&&(s.gap=`${r.gap}px`),r.background&&vt(s,r.background),typeof r.opacity=="number"&&(s.opacity=String(r.opacity));let i=r.shape;if(i?.type==="pill")s.borderRadius="9999px";else if(i?.type==="rect"){let p=i.radius;s.borderRadius=typeof p=="number"?`${p}px`:`${Number(p.topLeft)}px ${Number(p.topRight)}px ${Number(p.bottomRight)}px ${Number(p.bottomLeft)}px`}(r.clipContent===!0||r.clipContent!==!1&&i&&(r.background||a.type==="image"))&&(s.overflow="hidden");let l=r.border;l&&(s.border=Number(l.width)>0?`${Number(l.width)}px ${l.style==="dashed"?"dashed":"solid"} ${ne(l.color)}`:"0");let d=r.shadow;d&&(s.boxShadow=`${Number(d.x)}px ${Number(d.y)}px ${Number(d.blur)}px ${Number(d.spread)}px ${ne(d.color)}`),["text","button","price","coupon_code","countdown","plan_picker"].includes(a.type)&&(n.font&&(s.fontFamily=Y[String(n.font)]??""),typeof n.size=="number"&&(s.fontSize=`${n.size}px`),typeof n.weight=="number"&&(s.fontWeight=String(n.weight)),typeof n.lineHeight=="number"&&(s.lineHeight=String(n.lineHeight)),typeof n.letterSpacing=="number"&&(s.letterSpacing=`${n.letterSpacing}px`),n.color&&(s.color=ne(n.color)),n.align&&(s.textAlign=String(n.align)),n.italic&&(s.fontStyle="italic"),n.decoration&&(s.textDecoration=String(n.decoration)),n.transform&&(s.textTransform=String(n.transform))),Qe(e,r.width,"width",t,n.align),Qe(e,r.height,"height",t,n.align),t?.direction==="horizontal"&&r.grow!==void 0&&(s.flexGrow=String(r.grow===!0?1:r.grow===!1?0:r.grow))}function xe(e,a){if($){let t=$.bindings.find(r=>r.componentId===e);if(!t)return;$.answers[t.variable]=a,Ae.add(e),N({type:"answers",answers:Xe()}),U();return}}function Xe(){let e={};for(let a of $?.bindings??[]){let t=h[a.componentId];t!==void 0&&typeof t!="number"&&(e[a.variable]=t)}return e}function kt(e){let a=document.createElement("section");a.className="g-data",a.dataset.layout=e.data.layout,a.dataset.source=e.data.source;let t=ee?.nodes[e.id];a.dataset.status=t?.status??"idle",a.dataset.preview=String(!!t?.preview);let r=t?.status==="loading",n=P.startsWith("zh"),s=(g,b)=>n?g:b;a.setAttribute("aria-busy",String(!!r));let i=(g,b,T)=>{let x=document.createElement(g);return x.className=b,T!==void 0&&(x.textContent=T),x},l=g=>{let b=document.createElementNS("http://www.w3.org/2000/svg","svg");b.setAttribute("viewBox","0 0 24 24"),b.setAttribute("fill","none"),b.setAttribute("stroke","currentColor"),b.setAttribute("stroke-width","1.7"),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round"),b.setAttribute("aria-hidden","true"),b.classList.add("g-data-icon");let T={refresh:["M20 7v5h-5","M4 17v-5h5","M6.1 7a7 7 0 0 1 11.5-1.5L20 8M4 16l2.4 2.5A7 7 0 0 0 18 17"],down:["M7 7l10 10M7 17h10V7"],up:["M7 17L17 7M7 7h10v10"],chevron:["M6 9l6 6 6-6"],empty:["M4 8l8-4 8 4v10l-8 4-8-4V8Z","M4 8l8 4 8-4M12 12v10"],credit:["M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z","M12 7v10M8 12h8"]};for(let x of T[g]){let A=document.createElementNS("http://www.w3.org/2000/svg","path");A.setAttribute("d",x),b.append(A)}return b},d=(g,b,T,x=!1,A=b)=>{let z=i("button","g-data-button",g);return z.type="button",z.disabled=x||!!r&&b!=="refresh"||!!t?.preview||y.mode!=="live",r&&b==="refresh"&&z.setAttribute("aria-disabled","true"),z.dataset.gDataFocus=`${e.id}:${A}:${T??""}`,z.addEventListener("click",j=>{!j.isTrusted||z.disabled||r||N({type:"customer-data-intent",intent:{nodeId:e.id,action:b,...T?{value:T}:{}}})}),z},p=i("div","g-data-header"),f=i("h2","g-data-heading",_(e.title).value);f.id=`g-data-title-${e.id}`,a.setAttribute("aria-labelledby",f.id);let o=i("div","g-data-controls"),c=[],u=g=>{g.hidden||(g.type==="customer_data"&&c.push(g),g.type==="stack"&&g.children.forEach(u))},m=k?.pages[0];m&&u(m.root);let w=c.every(g=>ee?.nodes[g.id]?.preview),S=c.find(g=>g.data.source==="credit_balance")??c[0];t?.preview&&(!w||S?.id===e.id)&&o.append(i("span","g-data-preview",s("\\u793A\\u4F8B\\u6570\\u636E","Sample data")));let v=r?s("\\u66F4\\u65B0\\u4E2D\\u2026","Updating\\u2026"):s("\\u5237\\u65B0","Refresh"),L=d(v,"refresh");if(L.replaceChildren(l("refresh")),L.setAttribute("aria-label",v),L.title=v,L.classList.add("g-data-refresh"),r&&L.classList.add("g-data-refreshing"),o.append(L),e.data.source==="billing"&&e.data.outputs?.billing_portal&&o.append(d(t?.billingBusy?s("\\u6B63\\u5728\\u51C6\\u5907\\u2026","Preparing\\u2026"):s("\\u7BA1\\u7406\\u652F\\u4ED8\\u65B9\\u5F0F","Manage payment method"),"billing_portal",void 0,!!t?.billingBusy||t?.status!=="ready")),e.data.source==="credit_balance"&&(f.prepend(l("credit")),t?.resources.length===1&&f.append(i("span","g-data-resource-label",t.resources[0].name)),t?.updatedAt)){let g=i("time","g-data-updated",`${s("\\u66F4\\u65B0\\u4E8E","Updated")} ${new Intl.DateTimeFormat(P,{timeStyle:"short"}).format(new Date(t.updatedAt))}`);g.dateTime=t.updatedAt,g.title=new Intl.DateTimeFormat(P,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t.updatedAt)),o.prepend(g)}if(p.append(f,o),a.append(p),!t||t.source!==e.data.source)return a.append(i("p","g-data-empty",s("\\u8FDE\\u63A5\\u5BA2\\u6237\\u6570\\u636E\\u540E\\u663E\\u793A\\u6B64\\u5185\\u5BB9\\u3002","Connect customer data to display this content."))),a;if(t.errorMessage){let g=i("div","g-data-error",t.errorMessage);g.setAttribute("role","alert"),a.append(g);let b=i("div","g-data-recovery");b.append(d(s("\\u91CD\\u8BD5","Retry"),"refresh")),a.append(b)}if(t.membershipResult){let g=i("p","g-data-note",t.membershipResult);g.setAttribute("role","status"),a.append(g)}if(t.membershipReview){let g=t.membershipReview,b=i("section","g-data-resource");b.dataset.gDataReview="",b.setAttribute("aria-label",g.title),b.setAttribute("aria-busy",String(!!t.membershipBusy));let T=i("h3","g-data-row-label",g.title);T.tabIndex=-1,b.append(T);let x=i("dl","g-data-facts");for(let z of g.facts){let j=i("div","");j.append(i("dt","",z.label),i("dd","",z.value)),x.append(j)}b.append(x,i("p","g-data-note",g.note));let A=i("div","g-data-controls");A.append(d(s("\\u8FD4\\u56DE","Back"),"membership_dismiss",void 0,!!t.membershipBusy),d(t.membershipBusy?s("\\u6B63\\u5728\\u5904\\u7406\\u2026","Processing\\u2026"):s("\\u786E\\u8BA4","Confirm"),"membership_confirm",void 0,!!t.membershipBusy)),b.append(A),a.append(b)}if(t.stale&&(t.resources.length||t.rows.length)&&a.append(i("p",r?"g-data-live-status":"g-data-note",r?s("\\u6B63\\u5728\\u66F4\\u65B0\\u8D26\\u6237\\u6570\\u636E\\u3002","Updating account data."):s("\\u663E\\u793A\\u4E0A\\u6B21\\u8BFB\\u53D6\\u7684\\u7ED3\\u679C\\uFF0C\\u6B63\\u5728\\u7B49\\u5F85\\u66F4\\u65B0\\u3002","Showing the last result while awaiting an update."))),r&&!t.resources.length&&!t.rows.length){let g=i("div","g-data-skeleton");if(g.setAttribute("aria-hidden","true"),e.data.source==="credit_balance")g.append(i("span","g-data-skeleton-line g-data-skeleton-value"),i("span","g-data-skeleton-line g-data-skeleton-meta"));else{let T=Math.min(e.data.pageSize,e.data.layout==="compact"?2:4);for(let x=0;x<T;x++){let A=i("div","g-data-skeleton-row");A.append(i("span","g-data-skeleton-line"),i("span","g-data-skeleton-line")),g.append(A)}}let b=i("p","g-data-live-status",s("\\u6B63\\u5728\\u8BFB\\u53D6\\u8D26\\u6237\\u6570\\u636E\\u2026","Loading account data\\u2026"));return b.setAttribute("role","status"),a.append(g,b),a}let R={credit_transactions:[["all","\\u5168\\u90E8\\u8BB0\\u5F55","All activity"],["consume","\\u6D88\\u8D39","Usage"],["reserve","\\u9884\\u6263","Reserved"],["confirm","\\u786E\\u8BA4\\u6263\\u8D39","Confirmed"],["release","\\u91CA\\u653E","Released"],["refund","\\u9000\\u56DE","Refund"]],credit_pack_orders:[["all","\\u5168\\u90E8\\u8BA2\\u5355","All orders"],["pending","\\u7B49\\u5F85\\u4ED8\\u6B3E","Pending"],["paid","\\u5DF2\\u4ED8\\u6B3E","Paid"],["expired","\\u5DF2\\u8FC7\\u671F","Expired"],["refunded","\\u5DF2\\u9000\\u6B3E","Refunded"],["disputed","\\u4E89\\u8BAE\\u4E2D","Disputed"]],offer_history:[["all","\\u5168\\u90E8\\u8BB0\\u5F55","All offers"],["issued","\\u672A\\u4F7F\\u7528","Unused"],["reserved","\\u4ED8\\u6B3E\\u5904\\u7406\\u4E2D","Payment pending"],["redeemed","\\u5DF2\\u4F7F\\u7528","Redeemed"],["expired","\\u5DF2\\u5230\\u671F","Expired"],["revoked","\\u5DF2\\u4F5C\\u5E9F","Revoked"]]};if(R[e.data.source]){let g=i("select","g-data-select");g.setAttribute("aria-label",s("\\u7B5B\\u9009\\u8BB0\\u5F55","Filter records")),g.dataset.gDataFocus=`${e.id}:filter`,g.disabled=!!r||t.preview||y.mode!=="live";for(let[b,T,x]of R[e.data.source]){let A=document.createElement("option");A.value=b,A.textContent=s(T,x),g.append(A)}g.value=t.filter,g.addEventListener("change",()=>{!g.disabled&&y.mode==="live"&&N({type:"customer-data-intent",intent:{nodeId:e.id,action:"filter",value:g.value}})}),o.prepend(g)}let ot=(g,b=!1)=>{let T=i("ul","g-data-list");if(e.data.source==="credit_transactions"&&g.length&&!b){let x=i("div","g-data-table-head");x.setAttribute("aria-hidden","true"),x.append(i("span","",s("\\u8BB0\\u5F55","Record")),i("span","",s("\\u7C7B\\u578B","Type")),i("span","",s("\\u79EF\\u5206","Credits"))),a.append(x)}for(let x of g){let A=i("li","g-data-row"),z=i("div","g-data-row-main"),j=i("div","g-data-row-copy");j.append(i("p","g-data-row-label",x.label));for(let M of x.detail)M!==x.status&&j.append(i("div","g-data-row-detail",M));if(e.data.source==="credit_transactions"&&!b){let M=i("span","g-data-row-mark");M.append(l(["Refund","\\u9000\\u56DE"].includes(x.status??"")?"up":"down")),z.append(M)}if(z.append(j),A.append(z),x.status?A.append(i("div","g-data-row-status",x.status)):A.classList.add("g-data-row-no-status"),x.value?A.append(i("div","g-data-row-value",x.value)):A.classList.add("g-data-row-no-value"),x.facts.length||x.purchaseId||x.membershipActions?.length||x.billingActions?.length){let M=i("div","g-data-row-extra"),V=i("div","g-data-facts"),W=(D,Ee)=>{for(let dt of D){let lt=i("span","",dt.label);lt.append(i("strong","",dt.value)),Ee.append(lt)}};if(W(x.facts.slice(0,3),V),x.facts.length>3){let D=i("details","g-data-sources");D.dataset.gDataSources=`facts:${x.id}`,D.append(i("summary","",`${e.data.source==="billing"?s("\\u8D26\\u5355\\u8BE6\\u60C5","Invoice details"):e.data.source==="offer_history"?s("\\u4F18\\u60E0\\u5238\\u660E\\u7EC6","Coupon details"):s("\\u5168\\u90E8\\u6263\\u8D39\\u660E\\u7EC6","All allocations")} \\xB7 ${x.facts.length}`));let Ee=i("div","g-data-facts");W(x.facts.slice(3),Ee),D.append(Ee),V.append(D)}if(M.append(V),!b)for(let D of x.billingActions??[])M.append(d(D.label,D.action,x.id,!!t.billingBusy));if(x.purchaseId&&e.data.allowPurchase&&!b){let D=d(t.buyingId===x.purchaseId?s("\\u6B63\\u5728\\u51C6\\u5907\\u2026","Preparing\\u2026"):s("\\u8D2D\\u4E70\\u79EF\\u5206","Buy credits"),"buy_pack",x.purchaseId,!!t.preview||!!t.buyingId);D.classList.add("g-data-buy"),M.append(D)}if(e.data.allowPurchase&&!b)for(let D of x.membershipActions??[])M.append(d(D.label,"membership_preview",D.value,!!t.preview||!!t.membershipBusy||!!t.membershipReview));A.append(M)}T.append(A)}return T};for(let g of t.resources){let b=i("article","g-data-resource");b.setAttribute("aria-label",g.name),t.resources.length>1&&b.append(i("p","g-data-name",g.name));let T=i("div","g-data-balance"),x=new Intl.NumberFormat(P).formatToParts(1.1).find(M=>M.type==="decimal")?.value??".",A=g.spendable.lastIndexOf(x),z=i("strong","g-data-number",A<0?g.spendable:g.spendable.slice(0,A));A>=0&&z.append(i("span","g-data-fraction",g.spendable.slice(A))),T.append(z,i("span","g-data-unit",s("\\u53EF\\u7528\\u79EF\\u5206","Spendable credits"))),b.append(T);let j=i("div","g-data-facts");for(let[M,V]of[[s("\\u4F59\\u989D","Balance"),g.available],[s("\\u51BB\\u7ED3","Reserved"),g.reserved]]){let W=i("span","",M);W.append(i("strong","",V)),j.append(W)}if(g.expiry&&j.append(i("span","g-data-expiry",`${s("\\u6700\\u8FD1\\u5230\\u671F","Next expiry")} \\xB7 ${g.expiry}`)),b.append(j),e.data.showSources&&g.sourceCount){let M=i("details","g-data-sources");if(M.dataset.gDataSources=g.key,M.append(i("summary","",`${s("\\u79EF\\u5206\\u6765\\u6E90","Credit sources")} \\xB7 ${g.sourceCount}`),ot(g.sources,!0)),M.querySelector("summary")?.append(l("chevron")),g.hasNextSources||g.hasPreviousSources){let V=i("div","g-data-footer");V.append(i("span","",`${s("\\u7B2C","Page")} ${g.sourcePage}`));let W=i("div","g-data-controls");W.append(d(s("\\u4E0A\\u4E00\\u9875","Previous"),"sources_previous",g.key,!g.hasPreviousSources),d(s("\\u4E0B\\u4E00\\u9875","Next"),"sources_next",g.key,!g.hasNextSources)),V.append(W),M.append(V)}b.append(M)}a.append(b)}if(t.rows.length&&a.append(ot(t.rows)),e.data.source==="billing_controls"&&(e.data.outputs?.billing_authorization||e.data.outputs?.billing_adjustment)){let g=i("div","g-data-controls");e.data.outputs?.billing_authorization&&g.append(d(s("\\u8BBE\\u7F6E\\u81EA\\u52A8\\u4ED8\\u6B3E\\u6388\\u6743","Set up payment authorization"),"billing_authorization")),e.data.outputs?.billing_adjustment&&g.append(d(s("\\u67E5\\u770B\\u5F85\\u786E\\u8BA4\\u8865\\u6B3E","Review pending adjustment"),"billing_adjustment")),a.append(g)}if(!t.rows.length&&!t.resources.length&&t.status!=="error"){let g=i("p","g-data-empty",r?s("\\u6B63\\u5728\\u8BFB\\u53D6\\u8D26\\u6237\\u6570\\u636E\\u2026","Loading account data\\u2026"):t.status==="idle"?s("\\u767B\\u5F55\\u540E\\u67E5\\u770B\\u4F60\\u7684\\u8D26\\u6237\\u6570\\u636E\\u3002","Sign in to view your account data."):t.filter!=="all"?s("\\u6CA1\\u6709\\u7B26\\u5408\\u7B5B\\u9009\\u6761\\u4EF6\\u7684\\u8BB0\\u5F55\\u3002","No records match this filter."):e.data.source==="credit_pack_orders"?s("\\u6682\\u65E0\\u8D2D\\u4E70\\u8BB0\\u5F55","No purchases yet"):e.data.source==="credit_balance"?s("\\u6682\\u65E0\\u79EF\\u5206\\u6765\\u6E90","No credit balances yet"):e.data.source==="membership"?s("\\u6682\\u65E0\\u4F1A\\u5458\\u65B9\\u6848","No memberships yet"):e.data.source==="customer_plans"?s("\\u6682\\u65E0\\u53EF\\u9009\\u5957\\u9910","No plans available"):e.data.source==="credit_packs"?s("\\u6682\\u65E0\\u53EF\\u8D2D\\u4E70\\u7684\\u79EF\\u5206\\u5305","No credit packs available"):e.data.source==="billing_controls"?s("\\u5C1A\\u672A\\u8BBE\\u7F6E\\u7528\\u91CF\\u9650\\u5236\\u6216\\u81EA\\u52A8\\u4ED8\\u6B3E\\u6388\\u6743","No usage limits or payment authorizations configured"):e.data.source==="offer_history"?s("\\u6682\\u65E0\\u4F18\\u60E0\\u8BB0\\u5F55","No offers yet"):e.data.source==="billing"?s("\\u6682\\u65E0\\u8D26\\u5355","No invoices yet"):s("\\u8FD9\\u91CC\\u8FD8\\u6CA1\\u6709\\u8BB0\\u5F55\\u3002","There are no records yet."));g.prepend(l("empty")),g.setAttribute("role","status"),a.append(g)}if(t.hasNext||t.hasPrevious){let g=i("div","g-data-footer");g.append(i("span","",`${s("\\u7B2C","Page")} ${t.page}`));let b=i("div","g-data-controls");b.append(d(s("\\u4E0A\\u4E00\\u9875","Previous"),"previous",void 0,!t.hasPrevious),d(s("\\u4E0B\\u4E00\\u9875","Next"),"next",void 0,!t.hasNext)),g.append(b),a.append(g)}return t.updatedAt&&e.data.source!=="credit_balance"&&a.append(i("p","g-data-note g-data-updated",`${s("\\u6570\\u636E\\u66F4\\u65B0\\u4E8E","Updated")} ${new Intl.DateTimeFormat(P,{dateStyle:"medium",timeStyle:"short"}).format(new Date(t.updatedAt))}`)),a}let Q=new Map,Pe=new Map,et=e=>{let a=e.target;for(let t of Q.keys())a&&!J(t)?.contains(a)&&Q.delete(t)};document.addEventListener("focusin",et),document.addEventListener("pointerdown",et);function St(e){let a=ee;if(ee=e,!k)return;let t=(n,s)=>{if(n.type==="stack"){n.children.forEach(m=>t(m,n));return}if(n.type!=="customer_data"||JSON.stringify(a?.nodes[n.id])===JSON.stringify(e.nodes[n.id]))return;let i=J(n.id);if(!i)return;let l=document.activeElement;l&&i.contains(l)&&l.dataset.gDataFocus&&Q.set(n.id,l.dataset.gDataFocus);let d=new Set([...i.querySelectorAll("details[data-g-data-sources]")].filter(m=>m.open).map(m=>m.dataset.gDataSources)),p=we(n,s);if(!p)return;for(let m of p.querySelectorAll("details[data-g-data-sources]"))m.open=d.has(m.dataset.gDataSources);let f=i.scrollTop;i.replaceWith(p),p.scrollTop=f;let o=!!e.nodes[n.id]?.membershipReview&&!a?.nodes[n.id]?.membershipReview,c=!e.nodes[n.id]?.membershipReview&&!!a?.nodes[n.id]?.membershipReview;o&&Q.get(n.id)&&Pe.set(n.id,Q.get(n.id));let u=c?Pe.get(n.id):Q.get(n.id);u&&[...p.querySelectorAll("[data-g-data-focus]")].find(m=>m.dataset.gDataFocus===u)?.focus({preventScroll:!0}),o&&p.querySelector("[data-g-data-review] h3")?.focus({preventScroll:!0}),c&&Pe.delete(n.id),p.animate&&e.nodes[n.id]?.status==="ready"&&!window.matchMedia("(prefers-reduced-motion:reduce)").matches&&p.animate([{opacity:.7},{opacity:1}],{duration:140,easing:"ease-out"})},r=k.pages.find(n=>n.id===B)??k.pages[0];t(r.root,null),de()}function we(e,a){if(e.hidden)return null;let t;if(e.type==="customer_data")t=kt(e);else if(e.type==="stack"){t=document.createElement(e.purchaseAction?"button":"div"),e.purchaseAction&&(t.type="button",t.dataset.gAction=e.purchaseAction),t.className=`${e.purchaseAction?`g-btn g-btn-${e.buttonVariant??"primary"} `:""}g-stack ${e.direction==="horizontal"?"g-h":e.direction==="overlay"?"g-o":"g-v"}`,e.direction==="overlay"?(t.style.alignItems=ht[e.align]??"stretch",t.style.justifyItems=mt[e.justify]??"stretch"):(t.style.alignItems=Be[e.align]??"stretch",t.style.justifyContent=qe[e.justify]??"flex-start");for(let r of e.children){let n=we(r,e);n&&t.append(n)}if(e.interaction&&Et(t,e),e.purchaseAction&&y.mode==="live"){let r=E?.nodes[e.id],n=r?.picker;n&&(t.disabled=!E?.pickers[n]?.options.includes(String(h[n]??""))),q(e.id)?.unavailable&&(t.disabled=!0)}y.mode==="editor"&&!t.childElementCount&&(t.classList.add("g-empty"),t.dataset.gEditorPlaceholder=y.editorMessages?.emptyContainer??"\\u62D6\\u5165\\u7EC4\\u4EF6")}else if(e.type==="text"){let r=e.variant==="title"?"h1":e.variant==="heading"?"h2":"p";t=document.createElement(r),t.className=`g-text g-${e.variant}`;let n=se(e,"text",e.text);t.textContent=n.value,n.missing&&y.mode==="editor"&&t.classList.add("g-missing")}else if(e.type==="button"){t=document.createElement("button"),t.type="button",t.className=`g-btn g-btn-${e.variant}`;let r=se(e,"label",e.label);t.textContent=r.value,r.missing&&y.mode==="editor"&&t.classList.add("g-missing"),t.dataset.gAction=e.action;let n=E?.nodes[e.id]?.picker;if(n&&y.mode==="live"){let s=n,i=E?.pickers[s],l=h[s]??i?.selected;t.disabled=!i?.options.includes(String(l)),t.disabled&&t.setAttribute("aria-disabled","true")}y.mode==="live"&&q(e.id)?.unavailable&&(t.disabled=!0,t.setAttribute("aria-disabled","true")),y.mode==="editor"&&(t.tabIndex=-1)}else if(e.type==="image"){t=document.createElement("div"),t.className="g-img",Ue[e.aspect]&&(t.dataset.aspect=e.aspect,t.style.aspectRatio=Ue[e.aspect]);let r=document.createElement("img");r.src=e.localizedSrc?.[P]??e.localizedSrc?.[k.strings.defaultLocale]??e.src,r.alt=se(e,"alt",e.alt).value,r.referrerPolicy="no-referrer",r.decoding="async",r.style.objectFit=e.fit,e.position&&(r.style.objectPosition=`${e.position.x}% ${e.position.y}%`),r.addEventListener("load",ke),t.append(r)}else if(e.type==="price"){t=document.createElement("div"),t.className="g-price",t.style.cssText="display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-variant-numeric:tabular-nums";let r=q(e.id);if(!r?.price)t.textContent=r?.text??_(e.fallback).value,y.mode==="editor"&&t.classList.add("g-missing");else for(let n of["current","original","period"]){let s=r.price[n];if(!s)continue;let i=document.createElement(n==="original"?"s":"span");i.textContent=s,n==="original"&&(i.style.opacity=".6"),e.parts?.[n]&&oe(i,{type:"text",id:e.id,text:e.fallback,variant:"body",style:e.parts[n]},null),t.append(i)}}else if(e.type==="coupon_code"){t=document.createElement("div"),t.style.cssText="display:flex;align-items:center;gap:12px;flex-wrap:wrap";let r=q(e.id);if(r?.code){let n=document.createElement("code");n.textContent=r.code;let s=document.createElement("button");s.type="button",s.className="g-btn g-btn-secondary",s.textContent=_(e.label).value,s.addEventListener("click",i=>{y.mode!=="editor"&&(i.stopPropagation(),N({type:"copy",nodeId:e.id}))}),t.append(n,s)}else t.textContent=r?.text??_(e.fallback).value,y.mode==="editor"&&t.classList.add("g-missing")}else if(e.type==="countdown"){t=document.createElement("span"),t.setAttribute("role","timer"),t.style.fontVariantNumeric="tabular-nums";let r=q(e.id),n=r?.countdownAt?Date.parse(r.countdownAt):NaN,s=e.granularity==="second"?void 0:new Intl.NumberFormat(P,{style:"unit",unit:e.granularity,unitDisplay:"short"});!Number.isFinite(n)&&y.mode==="editor"&&t.classList.add("g-missing");let i=()=>{if(!Number.isFinite(n)){t.textContent=r?.text??_(e.fallback).value;return}let l=Math.max(0,Math.ceil((n-Date.now())/1e3));if(!l){t.textContent=_(e.expired).value;let o=Z.get(e.id);o!==void 0&&clearInterval(o),Z.delete(e.id);return}let d=e.granularity,p=d==="day"?86400:d==="hour"?3600:d==="minute"?60:1,f=s?s.format(Math.ceil(l/p)):[Math.floor(l/86400),Math.floor(l/3600)%24,Math.floor(l/60)%60,l%60].map(o=>String(o).padStart(2,"0")).join(":");t.textContent!==f&&(t.textContent=f)};i(),Number.isFinite(n)&&n>Date.now()&&Z.set(e.id,setInterval(i,1e3))}else if(e.type==="quantity_picker"){t=document.createElement("div");let r=E?.quantities?.[e.id],n=document.createElement("label");n.textContent=_(e.label).value;let s=document.createElement("input");s.type="range",s.id=`quantity-${e.id}`,n.htmlFor=s.id,s.min=String(r?.minimum??e.minimumQuantity),s.max=String(r?.maximum??e.maximumQuantity),s.step=String(e.step),s.value=String(typeof h[e.id]=="number"?h[e.id]:e.defaultQuantity),h[e.id]=Number(s.value),s.disabled=y.mode!=="editor"&&!r?.available,s.style.cssText="width:100%;accent-color:var(--g-primary)";let i=document.createElement("output");i.textContent=r?.label||_(e.fallback).value,s.setAttribute("aria-valuetext",r?.label??String(s.value)),s.oninput=()=>{h[e.id]=Number(s.value),N({type:"selection",selection:K()})},t.append(n,s,i)}else if(e.type==="plan_picker"){t=document.createElement("div"),t.setAttribute("role",e.grouping?"group":"radiogroup"),t.setAttribute("aria-label",_(e.label).value),t.style.cssText="display:flex;flex-direction:column;gap:8px";let r=E?.pickers[e.id],n=e.grouping;if(!r?.options.length)t.textContent=_(e.fallback).value,y.mode==="editor"&&t.classList.add("g-missing");else{let s=typeof h[e.id]=="string"?String(h[e.id]):r.selected,i=G[e.id];if(n){if(!i){let S=n.assignments.find(v=>v.productVersionId===s);i={period:S?.period??"month",tierId:S?.tierId??n.tiers[0].id},G[e.id]=i}let o=n.assignments.find(S=>S.tierId===i.tierId&&S.period===i.period);s=o&&r.options.includes(o.productVersionId)?o.productVersionId:"";let c=document.createElement("div");c.setAttribute("role","radiogroup"),c.setAttribute("aria-label",`${_(n.monthLabel).value} / ${_(n.yearLabel).value}`),c.style.cssText="display:flex;gap:4px;padding:4px;border:1px solid var(--g-border);border-radius:10px";let u=["month","year"],m=u.filter(S=>n.assignments.some(v=>v.period===S&&r.options.includes(v.productVersionId))),w=S=>{i.period=S;let v=n.assignments.find(L=>L.tierId===i.tierId&&L.period===S);h[e.id]=v&&r.options.includes(v.productVersionId)?v.productVersionId:"",U(),N({type:"selection",selection:K()}),J(e.id)?.querySelector(`[data-product-period="${S}"]`)?.focus()};for(let S of u){let v=document.createElement("button");v.type="button",v.className=`g-btn g-btn-${S===i.period?"primary":"secondary"}`,v.style.cssText="flex:1;min-width:0;min-height:40px",v.dataset.productPeriod=S,v.setAttribute("role","radio"),v.setAttribute("aria-checked",String(S===i.period)),v.textContent=_(S==="month"?n.monthLabel:n.yearLabel).value,v.disabled=!m.includes(S),v.tabIndex=y.mode==="editor"||v.disabled?-1:S===i.period||!m.includes(i.period)&&S===m[0]?0:-1,v.addEventListener("click",L=>{y.mode!=="editor"&&(L.stopPropagation(),w(S))}),v.addEventListener("keydown",L=>{if(y.mode==="editor"||!m.length)return;let R;["ArrowRight","ArrowDown"].includes(L.key)?R=(m.indexOf(S)+1)%m.length:["ArrowLeft","ArrowUp"].includes(L.key)?R=(m.indexOf(S)-1+m.length)%m.length:L.key==="Home"?R=0:L.key==="End"&&(R=m.length-1),R!==void 0&&(L.preventDefault(),w(m[R]))}),c.append(v)}t.append(c)}h[e.id]=s??"";let l=n?n.tiers.map(o=>({tier:o,id:n.assignments.find(c=>c.tierId===o.id&&c.period===i.period)?.productVersionId})):r.options.map(o=>({id:o,tier:void 0})),d=l.filter(o=>o.id&&r.options.includes(o.id)),p=n?document.createElement("div"):t;n&&(p.setAttribute("role","radiogroup"),p.setAttribute("aria-label",_(e.label).value),p.style.cssText="display:flex;flex-direction:column;gap:8px",t.append(p));let f=o=>{!o.id||!r.options.includes(o.id)||(n&&o.tier&&(i.tierId=o.tier.id),h[e.id]=o.id,U(),N({type:"selection",selection:K()}),J(e.id)?.querySelector(`[data-plan-id="${o.id}"]`)?.focus())};for(let o of l){let c=o.id?E.plans[o.id]:void 0,u=!!c&&r.options.includes(o.id),m=document.createElement("button");m.type="button",m.className="g-btn g-btn-secondary",m.style.cssText="width:100%;text-align:start;min-height:44px",m.setAttribute("role","radio");let w=n?o.tier?.id===i.tierId:o.id===s;m.setAttribute("aria-checked",String(w)),m.disabled=!u,m.tabIndex=y.mode==="editor"||!u?-1:w||!s&&o===d[0]?0:-1,o.id&&(m.dataset.planId=o.id),o.tier&&(m.dataset.productTier=o.tier.id);let S=o.id?E.nodes[e.id]?.byPlan?.[o.id]?.price:void 0;m.textContent=u?`${o.tier?.name??c.name} \\xB7 ${S?.current??c.price}${S?.period??c.period}`:`${o.tier?.name??""} \\xB7 ${_(n?.unavailableLabel??e.fallback).value}`,w&&(m.style.borderColor="var(--g-primary)",m.style.boxShadow="inset 0 0 0 1px var(--g-primary)",e.states?.selected&&oe(m,{type:"text",id:e.id,text:e.label,variant:"body",style:e.states.selected},null)),m.addEventListener("click",v=>{y.mode==="editor"||!u||(v.stopPropagation(),f(o))}),m.addEventListener("keydown",v=>{if(y.mode==="editor"||!d.length)return;let L=d.indexOf(o),R;["ArrowRight","ArrowDown"].includes(v.key)?R=(L+1)%d.length:["ArrowLeft","ArrowUp"].includes(v.key)?R=(L-1+d.length)%d.length:v.key==="Home"?R=0:v.key==="End"&&(R=d.length-1),R!==void 0&&(v.preventDefault(),f(d[R]))}),p.append(m)}if(n&&!s){let o=document.createElement("p");o.setAttribute("role","status"),o.textContent=_(n.unavailableLabel).value,t.append(o)}}}else if(e.type==="divider")t=document.createElement("hr"),t.className="g-divider";else if(e.type==="spacer")t=document.createElement("div"),t.setAttribute("aria-hidden","true"),t.style.flex="0 0 auto",t.style.width=t.style.height=`${gt[e.size]??0}px`;else if(e.type==="custom_html"){t=document.createElement("div"),t.className="g-custom";let r=t.attachShadow({mode:"open"}),n=document.createElement("style"),s="@media(prefers-reduced-motion:reduce){:host,:host::before,:host::after,*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}";n.textContent=`:host{display:block}${s}@layer indiana-accessibility{${s}}${e.css}`;let i=document.createElement("div");r.append(n,i),ge.set(t,{body:i,source:null,bound:!1,unresolved:!1,variables:[],bindings:[],fallback:!1,initialized:!1,template:null,parked:!1}),Ze(t,e)}else return null;return e.style&&oe(t,e,a),t.dataset.gNode=e.id,t.dataset.gLabel=wt(e),_e.set(e.id,t),t}function Et(e,a){let t=a.interaction,r=[...e.children];e.setAttribute("aria-label",_(t.label).value);let n=$?.bindings.find(i=>i.componentId===a.id),s=n?{id:n.variable,source:n.componentId,required:n.required}:void 0;if(s){let i=document.createElement("p");i.className="g-text g-body",i.textContent=_(t.label).value+(s.required?" *":""),e.prepend(i),s.required&&e.setAttribute("aria-required","true")}if(t.type==="input"){let i=document.createElement("input");i.type=t.keyboard,i.maxLength=t.maxLength,i.autocomplete="off",i.setAttribute("aria-label",_(t.label).value),i.setAttribute("aria-required",String(!!s?.required)),i.value=typeof h[a.id]=="string"?String(h[a.id]):"",i.style.cssText="box-sizing:border-box;width:100%;min-height:44px;padding:10px 14px;border:1px solid var(--g-border);border-radius:8px;background:var(--g-surface);color:var(--g-text);font:inherit",i.disabled=y.mode!=="live",i.addEventListener("input",()=>{h[a.id]=i.value,xe(a.id,i.value)}),e.append(i);return}if(!(y.mode!=="live"||!r.length&&t.type!=="toggle")){if(t.type==="multiselect"){e.setAttribute("role","group"),e.dataset.gMin=String(t.min);let i=a.children.filter(p=>!p.hidden),l=new Set(Array.isArray(h[a.id])?h[a.id]:[]),d=()=>r.forEach((p,f)=>{let o=l.has(i[f].id);p.setAttribute("aria-checked",String(o)),p.setAttribute("aria-disabled",String(!o&&l.size>=t.max)),p.style.outline=o?"2px solid var(--g-primary)":"",p.style.outlineOffset="-2px"});r.forEach((p,f)=>{p.setAttribute("role","checkbox"),p.tabIndex=0,p.setAttribute("aria-label",p.textContent?.trim()||String(f+1)),p.style.cursor="pointer";let o=()=>{let c=i[f].id;if(l.has(c))l.delete(c);else if(l.size<t.max)l.add(c);else return;let u=i.filter(m=>l.has(m.id)).map(m=>m.id);h[a.id]=u,d(),xe(a.id,u)};p.addEventListener("click",c=>{c.stopPropagation(),o()}),p.addEventListener("keydown",c=>{[" ","Enter"].includes(c.key)&&(c.preventDefault(),c.stopPropagation(),o())})}),d();return}if(t.type==="select"){e.setAttribute("role","radiogroup");let i=a.children.filter(f=>!f.hidden),l=C(a)?a.interaction.pickerId:void 0,d=i.findIndex(f=>l?f.type==="stack"&&f.bind?.plan===h[l]:f.id===h[a.id]);!l&&d<0&&!s?.required&&(d=Math.min(t.defaultIndex,r.length-1));let p=(f,o=!1,c=!0)=>{if(l&&c&&f>=0){let u=i[f],m=u.type==="stack"?u.bind?.plan:void 0;if(!m||!E?.pickers[l]?.options.includes(m))return;h[a.id]=u.id,h[l]=m,U(),N({type:"selection",selection:K()}),o&&I.querySelector(`[data-g-node="${u.id}"]`)?.focus({preventScroll:!0});return}d=f,f>=0&&(h[a.id]=i[f].id),c&&f>=0&&xe(a.id,i[f].id),r.forEach((u,m)=>{u.setAttribute("aria-checked",String(m===f)),u.tabIndex=m===(f<0?0:f)?0:-1,u.style.cssText="";let w=i[m];w.type==="stack"&&(u.style.alignItems=Be[w.align]??"stretch",u.style.justifyContent=qe[w.justify]??"flex-start"),w.style&&oe(u,w,a),m===f&&(t.selectedStyle&&oe(u,{...w,style:t.selectedStyle},a),w.type==="stack"&&w.states?.selected&&oe(u,{...w,style:w.states.selected},a),!t.selectedStyle?.border&&!(w.type==="stack"&&w.states?.selected?.border)&&(u.style.outline="2px solid var(--g-primary)",u.style.outlineOffset="-2px")),u.style.cursor="pointer"}),o&&f>=0&&r[f].focus()};r.forEach((f,o)=>{if(f.setAttribute("role","radio"),l){let c=i[o],u=c.type==="stack"?c.bind?.plan:void 0;f.setAttribute("aria-disabled",String(!u||!E?.pickers[l]?.options.includes(u)))}f.setAttribute("aria-label",f.textContent?.trim()||String(o+1)),f.addEventListener("click",c=>{c.stopPropagation(),p(o)}),f.addEventListener("keydown",c=>{let u=c.key;if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"," ","Enter"].includes(u))return;c.preventDefault(),c.stopPropagation();let m=d<0?o:d;p(u==="Home"?0:u==="End"?r.length-1:u==="ArrowRight"||u==="ArrowDown"?(m+1)%r.length:u==="ArrowLeft"||u==="ArrowUp"?(m+r.length-1)%r.length:o,!0)})}),p(d,!1,!1)}else if(t.type==="tabs"){let i=a.children.filter(o=>!o.hidden),l=document.createElement("div");l.setAttribute("role","tablist"),l.setAttribute("aria-label",_(t.label).value),l.style.cssText="display:flex;gap:4px;padding:4px;border:1px solid var(--g-border);border-radius:12px";let d=r.map((o,c)=>{let u=document.createElement("button");return u.type="button",u.setAttribute("role","tab"),u.textContent=De(i[c])||String(c+1),u.style.cssText="flex:1;min-width:0;min-height:44px;padding:8px 16px;border:0;border-radius:8px;font:inherit;cursor:pointer",o.id=`g-${a.id}-${i[c].id}`,o.setAttribute("role","tabpanel"),u.setAttribute("aria-controls",o.id),l.append(u),u}),p=(o,c=!1,u=!1)=>{if(h[a.id]=i[o].id,u&&k&&Object.keys(O(k)).length){for(let m of Object.keys(O(k)))delete h[m];U(),N({type:"selection",selection:K()}),c&&I.querySelector(`[data-g-node="${a.id}"] [role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0});return}r.forEach((m,w)=>{m.hidden=w!==o,d[w].setAttribute("aria-selected",String(w===o)),d[w].tabIndex=w===o?0:-1,d[w].style.background=w===o?"var(--g-primary)":"transparent",d[w].style.color=w===o?"var(--g-on-primary)":"var(--g-text)"}),c&&d[o].focus(),de()};d.forEach((o,c)=>{o.addEventListener("click",u=>{u.stopPropagation(),p(c,!1,!0)}),o.addEventListener("keydown",u=>{["ArrowLeft","ArrowRight","Home","End"].includes(u.key)&&(u.preventDefault(),u.stopPropagation(),p(u.key==="Home"?0:u.key==="End"?r.length-1:(c+(u.key==="ArrowRight"?1:r.length-1))%r.length,!0,!0))})}),e.prepend(l);let f=i.findIndex(o=>o.id===h[a.id]);p(f>=0?f:Math.min(t.defaultIndex,r.length-1))}else if(t.type==="toggle"){let i=document.createElement("button");i.type="button",i.setAttribute("role","switch"),i.className="g-btn g-btn-secondary",i.style.cssText="display:flex;align-items:center;justify-content:space-between;gap:16px;color:var(--g-text)";let l=document.createElement("span");l.textContent=_(t.label).value;let d=document.createElement("span");d.setAttribute("aria-hidden","true"),d.style.cssText="position:relative;display:block;flex:none;width:44px;height:24px;border-radius:12px;background:var(--g-border)";let p=document.createElement("span");p.style.cssText="position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003",d.append(p),i.append(l,d);let f=(o,c=!1)=>{if(h[a.id]=o,c&&k&&Object.keys(O(k)).length){for(let u of Object.keys(O(k)))delete h[u];U(),N({type:"selection",selection:K()}),I.querySelector(`[data-g-node="${a.id}"] [role="switch"]`)?.focus({preventScroll:!0});return}i.setAttribute("aria-checked",String(o)),d.style.background=o?"var(--g-primary)":"var(--g-border)",p.style.left=o?"23px":"3px",p.style.background=o?"var(--g-on-primary)":"#FFFFFF",r.forEach((u,m)=>u.hidden=m!==(o?0:1)),de()};i.addEventListener("click",o=>{o.stopPropagation(),f(!h[a.id],!0),xe(a.id,!!h[a.id])}),e.prepend(i),f(typeof h[a.id]=="boolean"?h[a.id]:t.defaultEnabled)}else{e.setAttribute("role","region"),e.setAttribute("aria-roledescription","carousel");let i=document.createElement("div");i.style.cssText="display:flex;align-items:center;justify-content:center;gap:10px";let l=document.createElement("button"),d=document.createElement("button"),p=document.createElement("span"),f=P.startsWith("zh");l.textContent="\\u2190",d.textContent="\\u2192",l.setAttribute("aria-label",f?"\\u4E0A\\u4E00\\u6761\\u8BC4\\u4EF7":"Previous review"),d.setAttribute("aria-label",f?"\\u4E0B\\u4E00\\u6761\\u8BC4\\u4EF7":"Next review");for(let c of[l,d])c.type="button",c.className="g-btn g-btn-secondary",c.style.color="var(--g-text)";p.setAttribute("aria-live","polite");let o=c=>{ie[a.id]=c,r.forEach((u,m)=>u.hidden=m!==c),p.textContent=`${c+1} / ${r.length}`,de()};l.addEventListener("click",c=>{c.stopPropagation(),o((ie[a.id]+r.length-1)%r.length)}),d.addEventListener("click",c=>{c.stopPropagation(),o((ie[a.id]+1)%r.length)}),i.append(l,p,d),e.append(i),o(ie[a.id]??0)}}}function De(e){if(e.hidden)return"";if(e.type==="text"&&(e.variant==="title"||e.variant==="heading"))return _(e.text).value;if(e.type==="stack")for(let a of e.children){let t=De(a);if(t)return t}return""}function tt(e){return e.type==="stack"&&!e.interaction&&!e.purchaseAction}function ve(e){let a=[],t=r=>{let n=E?.nodes[r.id];if(a.push(r.id,q(r.id)),n?.picker&&a.push(h[n.picker],E?.pickers[n.picker]),r.type==="text")a.push(se(r,"text",r.text));else if(r.type==="button")a.push(se(r,"label",r.label));else if(r.type==="image")a.push(se(r,"alt",r.alt));else if(r.type==="custom_html"){let s=$e(r);a.push(s,y.mode==="live"&&$?Ke(s).map(i=>[i,Me(i)]):void 0)}else if(r.type==="customer_data")a.push(ee?.nodes[r.id]);else if(r.type==="plan_picker"){let s=E?.pickers[r.id];a.push(h[r.id],G[r.id],s,n,s?.options.map(i=>E?.plans[i]))}else r.type==="stack"&&(r.interaction?.type!=="input"&&a.push(h[r.id],ie[r.id]),C(r)&&a.push(h[r.interaction.pickerId],E?.pickers[r.interaction.pickerId]),r.children.forEach(t))};return t(e),JSON.stringify(a)}function at(e){e.hidden||(tt(e)?e.children.forEach(at):le.set(e.id,ve(e)))}function He(e){if(e.type==="custom_html"){let t=J(e.id),r=t&&ge.get(t);r&&Ce(r)}let a=Z.get(e.id);a!==void 0&&clearInterval(a),Z.delete(e.id),e.type==="stack"&&e.children.forEach(He)}function rt(e,a){if(e.hidden)return;if(tt(e)){e.children.forEach(n=>rt(n,e));return}if(le.get(e.id)===ve(e))return;let t=J(e.id);if(!t)return;if(e.type==="custom_html"&&ge.has(t)){Ze(t,e),le.set(e.id,ve(e));return}He(e);let r=we(e,a);r&&(t.replaceWith(r),le.set(e.id,ve(e)))}function At(){let e=document.activeElement;if(!(e instanceof HTMLElement)||!I.contains(e))return;let a=e.closest("[data-g-node]");if(!a)return;let t=[];for(let r=e;r!==a;){let n=r.parentElement;if(!n)return;t.unshift(Array.prototype.indexOf.call(n.children,r)),r=n}return{active:e,nodeId:a.dataset.gNode,path:t,identity:["productPeriod","planId","productTier","gDataFocus"].map(r=>[r,e.dataset[r]]).find(([,r])=>r!==void 0),selection:e instanceof HTMLInputElement&&e.selectionStart!==null?{start:e.selectionStart,end:e.selectionEnd,direction:e.selectionDirection}:void 0}}function _t(e){if(!e||e.active.isConnected)return;let a=J(e.nodeId);if(!a)return;let t=a;if(e.identity){let[r,n]=e.identity;t=[...a.querySelectorAll("*")].find(s=>s.dataset[r]===n)}else for(let r of e.path)t=t?.children[r];!t||t.hasAttribute("disabled")||(t.focus({preventScroll:!0}),e.selection&&t instanceof HTMLInputElement&&["text","search","tel","url","password"].includes(t.type)&&t.setSelectionRange(e.selection.start,e.selection.end,e.selection.direction??void 0))}function U(e=!1){if(!k)return;let a=e?void 0:At(),t=k.pages.find(n=>n.id===(B??k.initialPageId))??k.pages[0];if(B=t.id,E){let n={},s=i=>{i.type==="stack"&&i.children.forEach(s),i.type==="plan_picker"&&typeof h[i.id]=="string"&&h[i.id]!==""&&(n[i.id]=String(h[i.id]))};s(t.root),Object.assign(h,pe({...k,pages:[t]},K(),E)),Object.assign(h,n)}let r=n=>{if(n.type==="stack"&&n.children.forEach(r),n.type!=="plan_picker"||!n.grouping)return;let s=n.grouping,i=E?.pickers[n.id],l=G[n.id];if(!l){let p=s.assignments.find(f=>f.productVersionId===(h[n.id]??i?.selected));l={period:p?.period??"month",tierId:p?.tierId??s.tiers[0].id},G[n.id]=l}let d=s.assignments.find(p=>p.tierId===l.tierId&&p.period===l.period);h[n.id]=d&&i?.options.includes(d.productVersionId)?d.productVersionId:""};if(r(t.root),e||fe!==t){fe&&He(fe.root),Z.forEach(i=>clearInterval(i)),Z.clear(),le.clear(),_e.clear(),I.style.cssText="",xt(t.theme?{...k,theme:t.theme}:k);let n=P.split("-")[0];document.documentElement.lang=P,document.documentElement.dir=["ar","he","fa","ur"].includes(n)?"rtl":"ltr",I.dataset.gPresentation=k.presentation.type;let s=we(t.root,null);I.replaceChildren(...s?[s]:[]),fe=t,at(t.root)}else rt(t.root,null);if(_t(a),I.dataset.gPage=t.id,y.mode==="live"&&N({type:"page",pageId:t.id}),Je)de();else{Oe(),je();let n=Math.ceil(I.getBoundingClientRect().height);Je=!0,Ne=n,N({type:"rendered",height:n,label:De(t.root)||k.name})}}function de(){let e=Math.ceil(I.getBoundingClientRect().height);e!==Ne&&(Ne=e,N({type:"resize",height:e})),Oe(),je()}function ke(){Ie||(Ie=!0,window.requestAnimationFrame(()=>{Ie=!1,de()}))}function je(){if(y.mode!=="editor")return;let e=[];for(let t of I.querySelectorAll("[data-g-node]")){let r=t.getBoundingClientRect();!r.width||!r.height||e.push({id:t.dataset.gNode,x:r.x,y:r.y,width:r.width,height:r.height})}let a=JSON.stringify(e);a!==Ve&&(Ve=a,N({type:"layout",nodes:e}))}function J(e){if(!e||!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(e))return null;let a=_e.get(e);return a?.isConnected?a:null}function it(e,a){let t=J(a);if(!t){e.style.display="none";return}let r=t.getBoundingClientRect();e.style.display="block",e.style.left=`${r.left+window.scrollX}px`,e.style.top=`${r.top+window.scrollY}px`,e.style.width=`${r.width}px`,e.style.height=`${r.height}px`,e.toggleAttribute("data-below",r.top<20),e.firstChild.textContent=t.dataset.gLabel??""}function Oe(){y.mode==="editor"&&(it(ce,Le),it(ye,me&&me!==Le?me:null))}function Se(e){for(let a of e.composedPath()){if(a instanceof HTMLElement&&a.dataset.gNode)return a.dataset.gNode;if(a===I)break}return null}function Nt(e){if(e.isTrusted){if(y.mode==="editor"){e.preventDefault(),e.stopPropagation(),N({type:"select",id:Se(e)});return}for(let a of e.composedPath()){if(!(a instanceof HTMLElement))continue;let t=a.dataset.gAction??(a.tagName==="BUTTON"?a.getAttribute("data-grow-action"):null);if(t&&!a.disabled){e.preventDefault();let r=k?.actions.find(n=>n.id===t);if(r?.type==="navigate"){if(B=r.pageId,k)for(let s of Object.keys(O(k)))delete h[s];U();let n=I.querySelector("h1,h2")??I;n===I&&(I.setAttribute("role","group"),I.setAttribute("aria-label",k?.pages.find(s=>s.id===B)?.name??k?.name??"Page")),n.tabIndex=-1,n.focus({preventScroll:!0});return}N({type:"action",actionId:t,nodeId:Se(e)??void 0,...Object.keys(h).length?{selection:K()}:{},...$?{answers:Xe()}:{}});return}if(a===I)return}}}function nt(e){let a=e;if(!(!a||a.channel!==y.channel))try{if(a.type==="render"){let t=a.doc;if(!t||t.kind!=="screen"||t.schemaVersion!==4||Object.hasOwn(t,"funnel")||!t.pages?.length||t.pages.length>(t.surface==="paywall"?10:1)||t.pages.some(r=>Object.hasOwn(r,"source"))||t.actions?.some(r=>!["event","close","open_url","claim_offer",...t.surface==="paywall"?["navigate"]:[]].includes(r.type)))throw new Error("Unsupported screen document; use the current Funnel runtime for flows");H.clear(),ae=re=0,k=t,B=null,P=String(a.locale),Ae=new Set,$=a.serverInput,h=X(),G=X(),E=a.capabilities,ee=a.customerData,Q.clear();for(let[r,n]of Object.entries(E?.pickers??{}))n.selected&&(h[r]=n.selected);if(a.selection&&typeof a.selection=="object"&&!Array.isArray(a.selection)){let r=a.selection,n=i=>{let l=r[i.id];if(i.type==="quantity_picker"&&typeof l=="number"&&(h[i.id]=l),i.type==="plan_picker"&&typeof l=="string"&&i.planIds?.includes(l)&&(h[i.id]=l),i.type==="stack"){if(i.interaction?.type==="toggle"&&typeof l=="boolean"&&(h[i.id]=l),i.interaction&&["select","tabs"].includes(i.interaction.type)&&typeof l=="string"&&i.children.some(d=>d.id===l)&&(h[i.id]=l),C(i)){let d=r[i.interaction.pickerId];typeof d=="string"&&i.children.some(p=>p.type==="stack"&&p.bind?.plan===d)&&(h[i.interaction.pickerId]=d)}i.children.forEach(n)}};k.pages.forEach(i=>n(i.root));let s=r.__page;typeof s=="string"&&k.pages.some(i=>i.id===s)&&(B=s)}for(let r of $?.bindings??[])Object.hasOwn($.answers,r.variable)&&(h[r.componentId]=$.answers[r.variable],Ae.add(r.componentId));ie=X(),P=String(a.locale),We(),U(!0)}else if(a.type==="capabilities"){E=a.capabilities;for(let[t,r]of Object.entries(E.quantities??{})){let n=J(t),s=n?.querySelector(\'input[type="range"]\');if(s){s.min=String(r.minimum),s.max=String(r.maximum),s.disabled=!r.available,s.setAttribute("aria-valuetext",r.label);let i=n?.querySelector("output");i&&(i.textContent=r.label)}}We();for(let[t,r]of Object.entries(E.pickers))!G[t]&&(h[t]===void 0||h[t]==="")&&(h[t]=r.selected??"");U()}else a.type==="customer-data"?St(a.data):a.type==="restore-action-focus"&&y.mode==="live"?[...I.querySelectorAll("button[data-g-node]")].find(t=>t.dataset.gNode===a.nodeId&&!t.disabled)?.focus({preventScroll:!0}):a.type==="highlight"&&y.mode==="editor"&&(me=a.hoverId??null,Le=a.selectedId??null,Oe())}catch(t){N({type:"error",message:t instanceof Error?t.message:"render failed"})}}let st=document.createElement("style");if(st.textContent=yt,document.head.append(st),document.body.append(I),y.mode==="editor"){document.body.dataset.gEditor="",document.body.append(ye,ce),document.addEventListener("mouseover",a=>{let t=Se(a);t!==he&&(he=t,N({type:"hover",id:t}))}),document.documentElement.addEventListener("mouseleave",()=>{he!==null&&(he=null,N({type:"hover",id:null}))}),document.addEventListener("dblclick",a=>{let t=Se(a);t&&a.isTrusted&&N({type:"edit",id:t})}),document.addEventListener("click",a=>{I.contains(a.target)||N({type:"select",id:null})});let e=(a,t)=>{if(!a.isTrusted)return;let r=a.metaKey||a.ctrlKey,n=a.key;(n===" "||t==="down"&&(["Delete","Backspace","Escape"].includes(n)||r&&/^[zysdcvg0=+-]$/i.test(n)))&&((r||n===" ")&&a.preventDefault(),N({type:"key",key:{key:n,phase:t,meta:a.metaKey,ctrl:a.ctrlKey,shift:a.shiftKey,alt:a.altKey}}))};document.addEventListener("keydown",a=>e(a,"down")),document.addEventListener("keyup",a=>e(a,"up")),document.addEventListener("wheel",a=>{!a.isTrusted||!(a.ctrlKey||a.metaKey)||(a.preventDefault(),N({type:"zoom",delta:a.deltaY}))},{passive:!1})}I.addEventListener("click",Nt),document.addEventListener("keydown",e=>{e.key==="Escape"&&e.isTrusted&&N({type:"escape"})}),typeof ResizeObserver=="function"&&new ResizeObserver(ke).observe(I),window.addEventListener("resize",ke),y.mode==="editor"&&window.addEventListener("scroll",je),window.addEventListener("message",e=>{e.source===F&&nt(e.data)}),ut.__indianaReceive=nt,N({type:"ready"})})(boot);\n } catch { /* No valid host bridge: leave the public shell empty. */ }\n })();<\/script></body></html>'}});var UM=x(()=>{"use strict";zM()});function VM(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function aK(e){if(Array.isArray(e))return e}function sK(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,c=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(u=(i=a.call(r)).done)&&(c.push(i.value),c.length!==t);u=!0);}catch(d){l=!0,o=d}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(l)throw o}}return c}}function cK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
64
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uK(e,t){return aK(e)||sK(e,t)||lK(e,t)||cK()}function lK(e,t){if(e){if(typeof e=="string")return VM(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?VM(e,t):void 0}}function nn(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return pk(e,t,i)}}function AK(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return mk(e,r)}}function dt(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:od;if(BM&&BM(e,null),!wc(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let a=r(o);a!==o&&(dK(t)||(t[i]=a),o=a)}e[o]=!0}return e}function xK(e){for(let t=0;t<e.length;t++)er(e,t)||(e[t]=null);return e}function br(e){let t=vc(null);for(let i of rF(e)){var r=uK(i,2);let o=r[0],a=r[1];er(e,o)&&(wc(a)?t[o]=xK(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=br(a):t[o]=a)}return t}function SK(e){switch(typeof e){case"string":return e;case"number":return yK(e);case"boolean":return bK(e);case"bigint":return GM?GM(e):"0";case"symbol":return KM?KM(e):"Symbol()";case"undefined":return id(e);case"function":case"object":{if(e===null)return id(e);let t=e,r=Tr(t,"toString");if(typeof r=="function"){let i=r(t);return typeof i=="string"?i:id(i)}return id(e)}default:return id(e)}}function Tr(e,t){for(;e!==null;){let i=mK(e,t);if(i){if(i.get)return nn(i.get);if(typeof i.value=="function")return nn(i.value)}e=pK(e)}function r(){return null}return r}function vK(e){try{return Tn(e,""),!0}catch{return!1}}function aF(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MK(),t=ue=>aF(ue);if(t.version="3.4.15",t.removed=[],!e||!e.document||e.document.nodeType!==yr.document||!e.Element)return t.isSupported=!1,t;let r=e.document,i=r,o=i.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,s=e.Node,c=e.Element,u=e.NodeFilter,l=e.NamedNodeMap;l===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let d=e.DOMParser,p=e.trustedTypes,h=c.prototype,f=Tr(h,"cloneNode"),m=Tr(h,"remove"),g=Tr(h,"removeAttributeNode"),A=Tr(h,"nextSibling"),C=Tr(h,"childNodes"),w=Tr(h,"parentNode"),E=Tr(h,"shadowRoot"),I=Tr(h,"attributes"),F=s&&s.prototype?Tr(s.prototype,"nodeType"):null,L=s&&s.prototype?Tr(s.prototype,"nodeName"):null,q=s&&s.prototype?Tr(s.prototype,"ownerDocument"):null,H=function(v){return F?F(v):v.nodeType},X=function(v){return L?L(v):v.nodeName};if(typeof a=="function"){let ue=r.createElement("template");ue.content&&ue.content.ownerDocument&&(r=ue.content.ownerDocument)}let M,J="",$,D=!1,U=0,Q=function(){if(U>0)throw Ca('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},N=function(v){Q(),U++;try{return M.createHTML(v)}finally{U--}},O=function(v){Q(),U++;try{return M.createScriptURL(v)}finally{U--}},z=function(){return D||($=FK(p,o),D=!0),$},V=r,de=V.implementation,je=V.createNodeIterator,Ge=V.createDocumentFragment,Pe=V.getElementsByTagName,pt=i.importNode,Ve=nF();t.isSupported=typeof rF=="function"&&typeof w=="function"&&de&&de.createHTMLDocument!==void 0;let ot=IK,qe=kK,wt=EK,Kt=CK,tt=PK,Sr=OK,be=TK,he=NK,Se=XM,me=null,_e=dt({},[...WM,...sk,...ck,...uk,...JM]),Ee=null,Ue=dt({},[...QM,...lk,...YM,...Lh]),Y=Object.seal(vc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Re=null,Je=null,Le=Object.seal(vc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ct=!0,lt=!0,In=!1,Pt=!0,Dt=!1,Ot=!0,Dr=!1,ti=!1,Oo=null,To=null,ni=!1,$r=!1,Ro=!1,ja=!1,ri=!0,La=!1,Dc="user-content-",$c=!0,Di=!1,$i={},ii=null,jc=dt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),No=null,Lc=dt({},["audio","video","img","source","image","track"]),Ma=null,Mc=dt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fa="http://www.w3.org/1998/Math/MathML",za="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml",rr=Yt,ji=!1,Do=null,jr=dt({},[Fa,za,Yt],ak),Fc=ln(["mi","mo","mn","ms","mtext"]),$o=dt({},Fc),jo=ln(["annotation-xml"]),zc=dt({},jo),wd=dt({},["title","style","font","a","script"]),Li=null,y=["application/xhtml+xml","text/html"],S="text/html",b=null,_=null,P=r.createElement("form"),T=function(v){return v instanceof RegExp||v instanceof Function},k=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_&&_===v)return;(!v||typeof v!="object")&&(v={}),v=br(v),Li=y.indexOf(v.PARSER_MEDIA_TYPE)===-1?S:v.PARSER_MEDIA_TYPE,b=Li==="application/xhtml+xml"?ak:od,me=Io(v,"ALLOWED_TAGS",_e,{transform:b}),Ee=Io(v,"ALLOWED_ATTR",Ue,{transform:b}),Do=Io(v,"ALLOWED_NAMESPACES",jr,{transform:ak}),Ma=Io(v,"ADD_URI_SAFE_ATTR",Mc,{transform:b,base:Mc}),No=Io(v,"ADD_DATA_URI_TAGS",Lc,{transform:b,base:Lc}),ii=Io(v,"FORBID_CONTENTS",jc,{transform:b}),Re=Io(v,"FORBID_TAGS",br({}),{transform:b}),Je=Io(v,"FORBID_ATTR",br({}),{transform:b}),$i=er(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?br(v.USE_PROFILES):v.USE_PROFILES:!1,ct=v.ALLOW_ARIA_ATTR!==!1,lt=v.ALLOW_DATA_ATTR!==!1,In=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Dt=v.SAFE_FOR_TEMPLATES||!1,Ot=v.SAFE_FOR_XML!==!1,Dr=v.WHOLE_DOCUMENT||!1,$r=v.RETURN_DOM||!1,Ro=v.RETURN_DOM_FRAGMENT||!1,ja=v.RETURN_TRUSTED_TYPE||!1,ni=v.FORCE_BODY||!1,ri=v.SANITIZE_DOM!==!1,La=v.SANITIZE_NAMED_PROPS||!1,$c=v.KEEP_CONTENT!==!1,Di=v.IN_PLACE||!1,Se=vK(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:XM,rr=typeof v.NAMESPACE=="string"?v.NAMESPACE:Yt,$o=dk(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>dt({},Fc)),zc=dk(v,"HTML_INTEGRATION_POINTS",()=>dt({},jo));let j=dk(v,"CUSTOM_ELEMENT_HANDLING",()=>vc(null));if(Y=vc(null),er(j,"tagNameCheck")&&T(j.tagNameCheck)&&(Y.tagNameCheck=j.tagNameCheck),er(j,"attributeNameCheck")&&T(j.attributeNameCheck)&&(Y.attributeNameCheck=j.attributeNameCheck),er(j,"allowCustomizedBuiltInElements")&&typeof j.allowCustomizedBuiltInElements=="boolean"&&(Y.allowCustomizedBuiltInElements=j.allowCustomizedBuiltInElements),yn(Y),Dt&&(lt=!1),Ro&&($r=!0),$i&&(me=dt({},JM),Ee=vc(null),$i.html===!0&&(dt(me,WM),dt(Ee,QM)),$i.svg===!0&&(dt(me,sk),dt(Ee,lk),dt(Ee,Lh)),$i.svgFilters===!0&&(dt(me,ck),dt(Ee,lk),dt(Ee,Lh)),$i.mathMl===!0&&(dt(me,uk),dt(Ee,YM),dt(Ee,Lh))),Le.tagCheck=null,Le.attributeCheck=null,er(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?Le.tagCheck=v.ADD_TAGS:wc(v.ADD_TAGS)&&(me===_e&&(me=br(me)),dt(me,v.ADD_TAGS,b))),er(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?Le.attributeCheck=v.ADD_ATTR:wc(v.ADD_ATTR)&&(Ee===Ue&&(Ee=br(Ee)),dt(Ee,v.ADD_ATTR,b))),er(v,"ADD_FORBID_CONTENTS")&&wc(v.ADD_FORBID_CONTENTS)&&(ii===jc&&(ii=br(ii)),dt(ii,v.ADD_FORBID_CONTENTS,b)),$c&&(me["#text"]=!0),Dr&&dt(me,["html","head","body"]),me.table&&(dt(me,["tbody"]),delete Re.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ca('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ca('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let ne=M;M=v.TRUSTED_TYPES_POLICY;try{J=N("")}catch(ve){throw M=ne,ve}}else v.TRUSTED_TYPES_POLICY===null?(M=void 0,J=""):(M===void 0&&(M=z()),M&&typeof J=="string"&&(J=N("")));ln&&ln(v),_=v},W=dt({},[...sk,...ck,...wK]),G=dt({},[...uk,..._K]),se=function(v,j,ne){return j.namespaceURI===Yt?v==="svg":j.namespaceURI===Fa?v==="svg"&&(ne==="annotation-xml"||$o[ne]):!!W[v]},fe=function(v,j,ne){return j.namespaceURI===Yt?v==="math":j.namespaceURI===za?v==="math"&&zc[ne]:!!G[v]},Z=function(v,j,ne){return j.namespaceURI===za&&!zc[ne]||j.namespaceURI===Fa&&!$o[ne]?!1:!G[v]&&(wd[v]||!W[v])},ie=function(v){let j=w(v);(!j||!j.tagName)&&(j={namespaceURI:rr,tagName:"template"});let ne=od(v.tagName),ve=od(j.tagName);return Do[v.namespaceURI]?v.namespaceURI===za?se(ne,j,ve):v.namespaceURI===Fa?fe(ne,j,ve):v.namespaceURI===Yt?Z(ne,j,ve):!!(Li==="application/xhtml+xml"&&Do[v.namespaceURI]):!1},oe=function(v){nd(t.removed,{element:v});try{w(v).removeChild(v)}catch{if(m(v),!w(v))throw Ca("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ge=function(v,j,ne){try{g(v,j)}catch{try{v.removeAttribute(ne)}catch{}}},Me=function(v){Et(v);let j=C(v);if(j){let ve=[];Pa(j,Ce=>{nd(ve,Ce)}),Pa(ve,Ce=>{try{m(Ce)}catch{}})}let ne=I(v);if(ne)for(let ve=ne.length-1;ve>=0;--ve){let Ce=ne[ve],Be=Ce&&Ce.name;typeof Be=="string"&&ge(v,Ce,Be)}},nt=function(v,j,ne){if(!ne)try{ne=j.getAttributeNode(v)}catch{ne=null}nd(t.removed,{attribute:ne||null,from:j});try{ne?g(j,ne):j.removeAttribute(v)}catch{try{j.removeAttribute(v)}catch{}}if(v==="is")if($r||Ro)try{oe(j)}catch{}else try{j.setAttribute(v,"")}catch{}},Qe=function(v){let j=I(v);if(j)for(let ne=j.length-1;ne>=0;--ne){let ve=j[ne],Ce=ve&&ve.name;typeof Ce!="string"||Ee[b(Ce)]||ge(v,ve,Ce)}},Et=function(v){let j=[v];for(;j.length>0;){let ne=j.pop();H(ne)===yr.element&&Qe(ne);let Ce=C(ne);if(Ce)for(let Be=Ce.length-1;Be>=0;--Be)j.push(Ce[Be])}},rn=function(v,j){return Ot?v==="patchsrc"?!0:v==="for"&&j!=="label"&&j!=="output":!1},_d=function(v){if(!Ot)return;let j=[v];for(;j.length>0;){let ne=j.pop(),ve=H(ne);if(ve===yr.processingInstruction||ve===yr.comment&&Tn(tF,ne.data)){try{m(ne)}catch{}continue}if(ve===yr.element){let Be=ne,Rt=b(X(ne));try{Be.hasAttribute&&Be.hasAttribute("patchsrc")&&Be.removeAttribute("patchsrc"),Be.hasAttribute&&Be.hasAttribute("for")&&rn("for",Rt)&&Be.removeAttribute("for")}catch{}}let Ce=C(ne);if(Ce)for(let Be=Ce.length-1;Be>=0;--Be)j.push(Ce[Be])}},pe=function(v){let j=null,ne=null;if(ni)v="<remove></remove>"+v;else{let Be=ZM(v,/^[\r\n\t ]+/);ne=Be&&Be[0]}Li==="application/xhtml+xml"&&rr===Yt&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");let ve=M?N(v):v;if(rr===Yt)try{j=new d().parseFromString(ve,Li)}catch{}if(!j||!j.documentElement){j=de.createDocument(rr,"template",null);try{j.documentElement.innerHTML=ji?J:ve}catch{}}let Ce=j.body||j.documentElement;return v&&ne&&Ce.insertBefore(r.createTextNode(ne),Ce.childNodes[0]||null),rr===Yt?Pe.call(j,Dr?"html":"body")[0]:Dr?j.documentElement:Ce},$e=function(v){let j=q?q(v):v.ownerDocument;return je.call(j||v,v,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Tt=function(v){return v=rd(v,ot," "),v=rd(v,qe," "),v=rd(v,wt," "),v},Fe=function(v){var j;v.normalize();let ne=q?q(v):v.ownerDocument,ve=je.call(ne||v,v,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null),Ce=ve.nextNode();for(;Ce;)Ce.data=Tt(Ce.data),Ce=ve.nextNode();let Be=(j=v.querySelectorAll)===null||j===void 0?void 0:j.call(v,"template");Be&&Pa(Be,Rt=>{Lt(Rt.content)&&Fe(Rt.content)})},mt=function(v){let j=L?L(v):null;return typeof j!="string"||b(j)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==I(v)||typeof v.removeAttribute!="function"||typeof v.removeAttributeNode!="function"||typeof v.getAttributeNode!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==F(v)||v.childNodes!==C(v)},Lt=function(v){if(!F||typeof v!="object"||v===null)return!1;try{return F(v)===yr.documentFragment}catch{return!1}},dn=function(v){if(!F||typeof v!="object"||v===null)return!1;try{return typeof F(v)=="number"}catch{return!1}};function ft(ue,v,j){ue.length!==0&&Pa(ue,ne=>{ne.call(t,v,j,_)})}let Lr=function(v,j){return!!(Ot&&v.hasChildNodes()&&!dn(v.firstElementChild)&&Tn(eF,v.textContent)&&Tn(eF,v.innerHTML)||Ot&&v.namespaceURI===Yt&&jK[j]&&(dn(v.firstElementChild)||typeof v.textContent=="string"&&Tn(LK[j],v.textContent))||v.nodeType===yr.processingInstruction||Ot&&v.nodeType===yr.comment&&Tn(tF,v.data))},ir=function(v,j){if(v instanceof RegExp)return Tn(v,j);if(v instanceof Function){for(var ne=arguments.length,ve=new Array(ne>2?ne-2:0),Ce=2;Ce<ne;Ce++)ve[Ce-2]=arguments[Ce];return!!v(j,...ve)}return!1},xn=function(v,j,ne){if(!Re[j]&&sP(j)&&ir(Y.tagNameCheck,j))return!1;if($c&&!ii[j]){let ve=w(v),Ce=C(v);if(Ce&&ve){let Be=Ce.length;for(let Rt=Be-1;Rt>=0;--Rt){let Ft=v===ne?f(Ce[Rt],!0):Ce[Rt];ve.insertBefore(Ft,A(v))}}}return oe(v),!0},Lo=function(v,j,ne,ve){return v.length===0?j:j===ne||j===ve?br(j):j},Uc=function(v,j){return v===j||w(v)!==null?!1:(Di&&Et(v),!0)},Vc=function(v,j){if(ft(Ve.beforeSanitizeElements,v,null),Uc(v,j))return!0;if(mt(v))return oe(v),!0;let ne=b(X(v));if(me=Lo(Ve.uponSanitizeElement,me,_e,Oo),ft(Ve.uponSanitizeElement,v,{tagName:ne,allowedTags:me}),Uc(v,j))return!0;if(Lr(v,ne))return oe(v),!0;if(Re[ne]||!(Le.tagCheck instanceof Function&&Le.tagCheck(ne))&&!me[ne]){let Ce=xn(v,ne,j);return Ce===!1&&ft(Ve.afterSanitizeElements,v,null),Ce}if(H(v)===yr.element&&!ie(v)||(ne==="noscript"||ne==="noembed"||ne==="noframes")&&Tn(DK,v.innerHTML))return oe(v),!0;if(Dt&&v.nodeType===yr.text){let Ce=Tt(v.textContent);v.textContent!==Ce&&(nd(t.removed,{element:v.cloneNode()}),v.textContent=Ce)}return ft(Ve.afterSanitizeElements,v,null),!1},aP=function(v,j,ne){if(Je[j]||rn(j,v)||ri&&(j==="id"||j==="name")&&(ne in r||ne in P))return!1;let ve=Ee[j]||Le.attributeCheck instanceof Function&&Le.attributeCheck(j,v);return lt&&Tn(Kt,j)||ct&&Tn(tt,j)?!0:ve?Ma[j]||Tn(Se,rd(ne,be,""))||(j==="src"||j==="xlink:href"||j==="href")&&v!=="script"&&HM(ne,"data:")===0&&No[v]||In&&!Tn(Sr,rd(ne,be,""))?!0:!ne:sP(v)&&ir(Y.tagNameCheck,v)&&ir(Y.attributeNameCheck,j,v)||j==="is"&&Y.allowCustomizedBuiltInElements&&ir(Y.tagNameCheck,ne)},W6=dt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),sP=function(v){return!W6[od(v)]&&Tn(he,v)},J6=function(v,j,ne,ve){if(M&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!ne)switch(p.getAttributeType(v,j)){case"TrustedHTML":return N(ve);case"TrustedScriptURL":return O(ve)}return ve},Q6=function(v,j,ne,ve){try{return ne?v.setAttributeNS(ne,j,ve):v.setAttribute(j,ve),mt(v)?(oe(v),!1):!0}catch{return nt(j,v),!1}},cP=function(v){ft(Ve.beforeSanitizeAttributes,v,null);let j=v.attributes;if(!j||mt(v))return;Ee=Lo(Ve.uponSanitizeAttribute,Ee,Ue,To);let ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ee,forceKeepAttr:void 0},ve=j.length,Ce=b(v.nodeName);for(;ve--;){let Be=j[ve],Rt=Be.name,Ft=Be.namespaceURI,Zn=Be.value,Hn=b(Rt),ky=Zn,Nn=Rt==="value"?ky:gK(ky),uP=!1;if(ne.attrName=Hn,ne.attrValue=Nn,ne.keepAttr=!0,ne.forceKeepAttr=void 0,ft(Ve.uponSanitizeAttribute,v,ne),Nn=ne.attrValue,La&&(Hn==="id"||Hn==="name")&&HM(Nn,Dc)!==0&&(nt(Rt,v,Be),Nn=Dc+Nn,uP=!0),Ot&&Tn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nn)){nt(Rt,v,Be);continue}if(Hn==="attributename"&&ZM(Nn,"href")){nt(Rt,v,Be);continue}if(!ne.forceKeepAttr){if(!ne.keepAttr){nt(Rt,v,Be);continue}if(!Pt&&Tn($K,Nn)){nt(Rt,v,Be);continue}if(Dt&&(Nn=Tt(Nn)),!aP(Ce,Hn,Nn)){nt(Rt,v,Be);continue}Nn=J6(Ce,Hn,Ft,Nn),Nn!==ky&&Q6(v,Rt,Ft,Nn)&&uP&&qM(t.removed)}}ft(Ve.afterSanitizeAttributes,v,null)},Id=function(v){let j=null,ne=$e(v);for(ft(Ve.beforeSanitizeShadowDOM,v,null);j=ne.nextNode();)if(ft(Ve.uponSanitizeShadowNode,j,null),Vc(j,v),cP(j),Lt(j.content)&&Id(j.content),H(j)===yr.element){let ve=E(j);Lt(ve)&&(Iy(ve),Id(ve))}ft(Ve.afterSanitizeShadowDOM,v,null)},Iy=function(v){let j=[{node:v,shadow:null}];for(;j.length>0;){let ne=j.pop();if(ne.shadow){Id(ne.shadow);continue}let ve=ne.node,Be=H(ve)===yr.element,Rt=C(ve);if(Rt)for(let Ft=Rt.length-1;Ft>=0;--Ft)j.push({node:Rt[Ft],shadow:null});if(Be){let Ft=L?L(ve):null;if(typeof Ft=="string"&&b(Ft)==="template"){let Zn=ve.content;Lt(Zn)&&j.push({node:Zn,shadow:null})}}if(Be){let Ft=E(ve);Lt(Ft)&&j.push({node:null,shadow:Ft},{node:Ft,shadow:null})}}};return t.sanitize=function(ue){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j=null,ne=null,ve=null,Ce=null;if(ji=!ue,ji&&(ue="\x3c!-->"),typeof ue!="string"&&!dn(ue)&&(ue=SK(ue),typeof ue!="string"))throw Ca("dirty is not a string, aborting");if(!t.isSupported)return ue;ti?(me=Oo,Ee=To):k(v),(Ve.uponSanitizeElement.length>0||Ve.uponSanitizeAttribute.length>0)&&(me=br(me)),Ve.uponSanitizeAttribute.length>0&&(Ee=br(Ee)),t.removed=[];let Be=Di&&typeof ue!="string"&&dn(ue);if(Be){_d(ue);let Zn=X(ue);if(typeof Zn=="string"){let Hn=b(Zn);if(!me[Hn]||Re[Hn])throw Me(ue),Ca("root node is forbidden and cannot be sanitized in-place")}if(mt(ue))throw Me(ue),Ca("root node is clobbered and cannot be sanitized in-place");try{Iy(ue)}catch(Hn){throw Me(ue),Hn}}else if(dn(ue))j=pe("\x3c!---->"),ne=j.ownerDocument.importNode(ue,!0),ne.nodeType===yr.element&&ne.nodeName==="BODY"||ne.nodeName==="HTML"?j=ne:j.appendChild(ne),Iy(j);else{if(!$r&&!Dt&&!Dr&&ue.indexOf("<")===-1)return M&&ja?N(ue):ue;if(j=pe(ue),!j)return $r?null:ja?J:""}j&&ni&&oe(j.firstChild);let Rt=Be?ue:j;try{let Zn=$e(Rt);for(;ve=Zn.nextNode();)Vc(ve,Rt),cP(ve),Lt(ve.content)&&Id(ve.content)}catch(Zn){throw Be&&(Me(ue),Pa(t.removed,Hn=>{Hn.element&&Et(Hn.element)})),Zn}if(Be)return Pa(t.removed,Zn=>{Zn.element&&Et(Zn.element)}),Dt&&Fe(ue),ue;if($r){if(Dt&&Fe(j),Ro)for(Ce=Ge.call(j.ownerDocument);j.firstChild;)Ce.appendChild(j.firstChild);else Ce=j;return(Ee.shadowroot||Ee.shadowrootmode)&&(Ce=pt.call(i,Ce,!0)),Ce}let Ft=Dr?j.outerHTML:j.innerHTML;return Dr&&me["!doctype"]&&j.ownerDocument&&j.ownerDocument.doctype&&j.ownerDocument.doctype.name&&Tn(RK,j.ownerDocument.doctype.name)&&(Ft="<!DOCTYPE "+j.ownerDocument.doctype.name+`>
|
|
65
|
+
`+Ft),Dt&&(Ft=Tt(Ft)),M&&ja?N(Ft):Ft},t.setConfig=function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(ue),ti=!0,Oo=me,To=Ee},t.clearConfig=function(){_=null,ti=!1,Oo=null,To=null,M=$,J=""},t.isValidAttribute=function(ue,v,j){_||k({});let ne=b(ue),ve=b(v);return aP(ne,ve,j)},t.addHook=function(ue,v){typeof v=="function"&&er(Ve,ue)&&nd(Ve[ue],v)},t.removeHook=function(ue,v){if(er(Ve,ue)){if(v!==void 0){let j=fK(Ve[ue],v);return j===-1?void 0:hK(Ve[ue],j,1)[0]}return qM(Ve[ue])}},t.removeHooks=function(ue){er(Ve,ue)&&(Ve[ue]=[])},t.removeAllHooks=function(){Ve=nF()},t}var rF,BM,dK,pK,mK,ln,yn,vc,iF,pk,mk,Pa,fK,qM,nd,hK,wc,od,ak,ZM,rd,HM,gK,yK,bK,GM,KM,er,id,Tn,Ca,WM,sk,ck,wK,uk,_K,JM,QM,lk,YM,Lh,IK,kK,EK,CK,PK,XM,OK,TK,RK,NK,eF,tF,DK,$K,yr,oF,jK,LK,MK,FK,nF,Io,dk,Mh,fk=x(()=>{rF=Object.entries,BM=Object.setPrototypeOf,dK=Object.isFrozen,pK=Object.getPrototypeOf,mK=Object.getOwnPropertyDescriptor,ln=Object.freeze,yn=Object.seal,vc=Object.create,iF=typeof Reflect<"u"&&Reflect,pk=iF.apply,mk=iF.construct;ln||(ln=function(t){return t});yn||(yn=function(t){return t});pk||(pk=function(t,r){for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];return t.apply(r,o)});mk||(mk=function(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return new t(...i)});Pa=nn(Array.prototype.forEach),fK=nn(Array.prototype.lastIndexOf),qM=nn(Array.prototype.pop),nd=nn(Array.prototype.push),hK=nn(Array.prototype.splice),wc=Array.isArray,od=nn(String.prototype.toLowerCase),ak=nn(String.prototype.toString),ZM=nn(String.prototype.match),rd=nn(String.prototype.replace),HM=nn(String.prototype.indexOf),gK=nn(String.prototype.trim),yK=nn(Number.prototype.toString),bK=nn(Boolean.prototype.toString),GM=typeof BigInt>"u"?null:nn(BigInt.prototype.toString),KM=typeof Symbol>"u"?null:nn(Symbol.prototype.toString),er=nn(Object.prototype.hasOwnProperty),id=nn(Object.prototype.toString),Tn=nn(RegExp.prototype.test),Ca=AK(TypeError);WM=ln(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sk=ln(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ck=ln(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),wK=ln(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),uk=ln(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),_K=ln(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),JM=ln(["#text"]),QM=ln(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),lk=ln(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),YM=ln(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Lh=ln(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IK=yn(/{{[\w\W]*|^[\w\W]*}}/g),kK=yn(/<%[\w\W]*|^[\w\W]*%>/g),EK=yn(/\${[\w\W]*/g),CK=yn(/^data-[\-\w.\u00B7-\uFFFF]+$/),PK=yn(/^aria-[\-\w]+$/),XM=yn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),OK=yn(/^(?:\w+script|data):/i),TK=yn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),RK=yn(/^html$/i),NK=yn(/^[a-z][.\w]*(-[.\w]+)+$/i),eF=yn(/<[/\w!]/g),tF=yn(/<[/\w]/g),DK=yn(/<\/no(script|embed|frames)/i),$K=yn(/\/>/i),yr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},oF=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],jK=ln(dt({},oF)),LK=(function(){let e={};return Pa(oF,t=>{e[t]=yn(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),ln(e)})(),MK=function(){return typeof window>"u"?null:window},FK=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(i=r.getAttribute(o));let a="dompurify"+(i?"#"+i:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},nF=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Io=function(t,r,i,o){return er(t,r)&&wc(t[r])?dt(o.base?br(o.base):{},t[r],o.transform):i},dk=function(t,r,i){let o=er(t,r)?t[r]:void 0;return o&&typeof o=="object"?br(o):i()};Mh=aF()});var _c,ad,sF=x(()=>{_c=null,ad=class e{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(t,r){let i;return _c!==null?(i=_c,_c=_c.cursor,i.prev=t,i.next=r,i.cursor=this.cursor):i={prev:t,next:r,cursor:this.cursor},this.cursor=i,i}releaseCursor(){let{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=_c,_c=t}updateCursors(t,r,i,o){let{cursor:a}=this;for(;a!==null;)a.prev===t&&(a.prev=r),a.next===i&&(a.next=o),a=a.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let r=this.head;r!==null;r=r.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let r=null;this.head=null;for(let i of t){let o=e.createItem(i);r!==null?r.next=o:this.head=o,o.prev=r,r=o}return this.tail=r,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,r=this){let i=this.allocateCursor(null,this.head);for(;i.next!==null;){let o=i.next;i.next=o.next,t.call(r,o.data,o,this)}this.releaseCursor()}forEachRight(t,r=this){let i=this.allocateCursor(this.tail,null);for(;i.prev!==null;){let o=i.prev;i.prev=o.prev,t.call(r,o.data,o,this)}this.releaseCursor()}reduce(t,r,i=this){let o=this.allocateCursor(null,this.head),a=r,s;for(;o.next!==null;)s=o.next,o.next=s.next,a=t.call(i,a,s.data,s,this);return this.releaseCursor(),a}reduceRight(t,r,i=this){let o=this.allocateCursor(this.tail,null),a=r,s;for(;o.prev!==null;)s=o.prev,o.prev=s.prev,a=t.call(i,a,s.data,s,this);return this.releaseCursor(),a}some(t,r=this){for(let i=this.head;i!==null;i=i.next)if(t.call(r,i.data,i,this))return!0;return!1}map(t,r=this){let i=new e;for(let o=this.head;o!==null;o=o.next)i.appendData(t.call(r,o.data,o,this));return i}filter(t,r=this){let i=new e;for(let o=this.head;o!==null;o=o.next)t.call(r,o.data,o,this)&&i.appendData(o.data);return i}nextUntil(t,r,i=this){if(t===null)return;let o=this.allocateCursor(null,t);for(;o.next!==null;){let a=o.next;if(o.next=a.next,r.call(i,a.data,a,this))break}this.releaseCursor()}prevUntil(t,r,i=this){if(t===null)return;let o=this.allocateCursor(t,null);for(;o.prev!==null;){let a=o.prev;if(o.prev=a.prev,r.call(i,a.data,a,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let r of this)t.appendData(r);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(e.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(e.createItem(t))}insert(t,r=null){if(r!==null)if(this.updateCursors(r.prev,t,r,t),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=t,r.prev=t,t.next=r,this.updateCursors(null,t)}else r.prev.next=t,t.prev=r.prev,r.prev=t,t.next=r;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,r){return this.insert(e.createItem(t),r)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(e.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,r){return t.head===null?this:(r!=null?(this.updateCursors(r.prev,t.tail,r,t.head),r.prev!==null?(r.prev.next=t.head,t.head.prev=r.prev):this.head=t.head,r.prev=t.tail,t.tail.next=r):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,r){"head"in r?this.insertList(r,t):this.insert(r,t),this.remove(t)}}});function cF(e,t){let r=Object.create(SyntaxError.prototype),i=new Error;return Object.assign(r,{name:e,message:t,get stack(){return(i.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
|
|
66
|
+
`)}})}var uF=x(()=>{});function pF({source:e,line:t,column:r,baseLine:i,baseColumn:o},a){function s(m,g){return l.slice(m,g).map((A,C)=>String(m+C+1).padStart(h)+" |"+A).join(`
|
|
67
|
+
`)}let c=`
|
|
68
|
+
`.repeat(Math.max(i-1,0)),u=" ".repeat(Math.max(o-1,0)),l=(c+u+e).split(/\r\n?|\n|\f/),d=Math.max(1,t-a)-1,p=Math.min(t+a,l.length+1),h=Math.max(4,String(p).length)+1,f=0;r+=(dF.length-1)*(l[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>hk&&(f=r-lF+3,r=lF-2);for(let m=d;m<=p;m++)m>=0&&m<l.length&&(l[m]=l[m].replace(/\t/g,dF),l[m]=(f>0&&l[m].length>f?"\u2026":"")+l[m].substr(f,hk-2)+(l[m].length>f+hk-1?"\u2026":""));return[s(d,t),new Array(r+h+2).join("-")+"^",s(t,p)].filter(Boolean).join(`
|
|
69
|
+
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function gk(e,t,r,i,o,a=1,s=1){return Object.assign(cF("SyntaxError",e),{source:t,offset:r,line:i,column:o,sourceFragment(u){return pF({source:t,line:i,column:o,baseLine:a,baseColumn:s},isNaN(u)?0:u)},get formattedMessage(){return`Parse error: ${e}
|
|
70
|
+
`+pF({source:t,line:i,column:o,baseLine:a,baseColumn:s},2)}})}var hk,lF,dF,mF=x(()=>{uF();hk=100,lF=60,dF=" "});var yk=x(()=>{});function Bn(e){return e>=48&&e<=57}function hi(e){return Bn(e)||e>=65&&e<=70||e>=97&&e<=102}function zh(e){return e>=65&&e<=90}function UK(e){return e>=97&&e<=122}function VK(e){return zh(e)||UK(e)}function BK(e){return e>=128}function Fh(e){return VK(e)||BK(e)||e===95}function Uh(e){return Fh(e)||Bn(e)||e===45}function qK(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function sd(e){return e===10||e===13||e===12}function gi(e){return sd(e)||e===32||e===9}function tr(e,t){return!(e!==92||sd(t)||t===0)}function Vh(e,t,r){return e===45?Fh(t)||t===45||tr(t,r):Fh(e)?!0:e===92?tr(e,t):!1}function Bh(e,t,r){return e===43||e===45?Bn(t)?2:t===46&&Bn(r)?3:0:e===46?Bn(t)?2:0:Bn(e)?1:0}function qh(e){return e===65279||e===65534?1:0}function Hh(e){return e<128?bk[e]:Zh}var bk,ZK,cd,Ak,Zh,xk,ud=x(()=>{bk=new Array(128),ZK=128,cd=130,Ak=131,Zh=132,xk=133;for(let e=0;e<bk.length;e++)bk[e]=gi(e)&&cd||Bn(e)&&Ak||Fh(e)&&Zh||qK(e)&&xk||e||ZK});function Ic(e,t){return t<e.length?e.charCodeAt(t):0}function Gh(e,t,r){return r===13&&Ic(e,t+1)===10?2:1}function vk(e,t,r){let i=e.charCodeAt(t);return zh(i)&&(i=i|32),i===r}function Oa(e,t,r,i){if(r-t!==i.length||t<0||r>e.length)return!1;for(let o=t;o<r;o++){let a=i.charCodeAt(o-t),s=e.charCodeAt(o);if(zh(s)&&(s=s|32),s!==a)return!1}return!0}function fF(e,t){for(;t>=0&&gi(e.charCodeAt(t));t--);return t+1}function ld(e,t){for(;t<e.length&&gi(e.charCodeAt(t));t++);return t}function Sk(e,t){for(;t<e.length&&Bn(e.charCodeAt(t));t++);return t}function Ti(e,t){if(t+=2,hi(Ic(e,t-1))){for(let i=Math.min(e.length,t+5);t<i&&hi(Ic(e,t));t++);let r=Ic(e,t);gi(r)&&(t+=Gh(e,t,r))}return t}function dd(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!Uh(r)){if(tr(r,Ic(e,t+1))){t=Ti(e,t)-1;continue}break}}return t}function Kh(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),Bn(r)&&(t=Sk(e,t+1),r=e.charCodeAt(t)),r===46&&Bn(e.charCodeAt(t+1))&&(t+=2,t=Sk(e,t)),vk(e,t,101)){let i=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(i=1,r=e.charCodeAt(t+2)),Bn(r)&&(t=Sk(e,t+1+i+1))}return t}function Wh(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}tr(r,Ic(e,t+1))&&(t=Ti(e,t))}return t}function Jh(e){if(e.length===1&&!hi(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var Qh=x(()=>{ud()});var kc,wk=x(()=>{kc=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"]});function Ec(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var _k=x(()=>{});function yF(e){let t=e.source,r=t.length,i=t.length>0?qh(t.charCodeAt(0)):0,o=Ec(e.lines,r),a=Ec(e.columns,r),s=e.startLine,c=e.startColumn;for(let u=i;u<r;u++){let l=t.charCodeAt(u);o[u]=s,a[u]=c++,(l===hF||l===gF||l===HK)&&(l===gF&&u+1<r&&t.charCodeAt(u+1)===hF&&(u++,o[u]=s,a[u]=c),s++,c=1)}o[r]=s,a[r]=c,e.lines=o,e.columns=a,e.computed=!0}var hF,HK,gF,Yh,bF=x(()=>{_k();ud();hF=10,HK=12,gF=13;Yh=class{constructor(t,r,i,o){this.setSource(t,r,i,o),this.lines=null,this.columns=null}setSource(t="",r=0,i=1,o=1){this.source=t,this.startOffset=r,this.startLine=i,this.startColumn=o,this.computed=!1}getLocation(t,r){return this.computed||yF(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,i){return this.computed||yF(this),{source:i,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}}});function AF(e,t,r){return e<t?t:e>r?r:e}var Qr,Yr,md,eg,ko,Xr,Xh,xF=x(()=>{_k();Qh();wk();Qr=16777215,Yr=24,md=1,eg=2,ko=new Uint8Array(32);ko[2]=22;ko[21]=22;ko[19]=20;ko[23]=24;Xr=new Uint8Array(32);Xr[2]=md;Xr[21]=md;Xr[19]=md;Xr[23]=md;Xr[22]=eg;Xr[20]=eg;Xr[24]=eg;Xh=class{constructor(t,r){this.setSource(t,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",r=()=>{}){t=String(t||"");let i=t.length,o=Ec(this.offsetAndType,t.length+1),a=Ec(this.balance,t.length+1),s=0,c=-1,u=0,l=t.length;this.offsetAndType=null,this.balance=null,a.fill(0),r(t,(d,p,h)=>{let f=s++;if(o[f]=d<<Yr|h,c===-1&&(c=p),a[f]=l,d===u){let m=a[l];a[l]=f,l=m,u=ko[o[m]>>Yr]}else this.isBlockOpenerTokenType(d)&&(l=f,u=ko[d])}),o[s]=0<<Yr|i,a[s]=s;for(let d=0;d<s;d++){let p=a[d];if(p<=d){let h=a[p];h!==d&&(a[d]=h)}else p>s&&(a[d]=s)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=s,this.offsetAndType=o,this.balance=a,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>Yr:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let i=this.offsetAndType[r]>>Yr;if(i!==13&&i!==25&&t--===0)return i}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&Qr:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let i=this.offsetAndType[r]>>Yr;if(i!==13&&i!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?Oa(this.source,this.offsetAndType[t-1]&Qr,this.offsetAndType[t]&Qr,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&Qr:this.offsetAndType[this.tokenCount]&Qr:this.firstCharOffset}getTokenEnd(t){return t===this.tokenIndex?this.tokenEnd:this.offsetAndType[AF(t,0,this.tokenCount)]&Qr}getTokenType(t){return t===this.tokenIndex?this.tokenType:this.offsetAndType[AF(t,0,this.tokenCount)]>>Yr}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBlockOpenerTokenType(t){return Xr[t]===md}isBlockCloserTokenType(t){return Xr[t]===eg}getBlockTokenPairIndex(t){let r=this.getTokenType(t);if(Xr[r]===1){let i=this.balance[t],o=this.getTokenType(i);return ko[r]===o?i:-1}else if(Xr[r]===2){let i=this.balance[t],o=this.getTokenType(i);return ko[o]===r?i:-1}return-1}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===t:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let r=this.tokenIndex+t;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&Qr,r=this.offsetAndType[r],this.tokenType=r>>Yr,this.tokenEnd=r&Qr):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>Yr,this.tokenEnd=t&Qr):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let i=t,o=0,a=0;e:for(;i<this.tokenCount;i++){if(o=this.balance[i],o<t)break e;switch(a=i>0?this.offsetAndType[i-1]&Qr:this.firstCharOffset,r(this.source.charCodeAt(a))){case 1:break e;case 2:i++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[i]>>Yr)&&(i=o)}}this.skip(i-this.tokenIndex)}forEachToken(t){for(let r=0,i=this.firstCharOffset;r<this.tokenCount;r++){let o=i,a=this.offsetAndType[r],s=a&Qr,c=a>>Yr;i=s,t(c,o,s,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,i,o,a)=>{t[a]={idx:a,type:kc[r],chunk:this.source.substring(i,o),balance:this.balance[a]}}),t}}});function tg(e,t){function r(p){return p<c?e.charCodeAt(p):0}function i(){if(l=Kh(e,l),Vh(r(l),r(l+1),r(l+2))){d=12,l=dd(e,l);return}if(r(l)===37){d=11,l++;return}d=10}function o(){let p=l;if(l=dd(e,l),Oa(e,p,l,"url")&&r(l)===40){if(l=ld(e,l+1),r(l)===34||r(l)===39){d=2,l=p+4;return}s();return}if(r(l)===40){d=2,l++;return}d=1}function a(p){for(p||(p=r(l++)),d=5;l<e.length;l++){let h=e.charCodeAt(l);switch(Hh(h)){case p:l++;return;case cd:if(sd(h)){l+=Gh(e,l,h),d=6;return}break;case 92:if(l===e.length-1)break;let f=r(l+1);sd(f)?l+=Gh(e,l+1,f):tr(h,f)&&(l=Ti(e,l)-1);break}}}function s(){for(d=7,l=ld(e,l);l<e.length;l++){let p=e.charCodeAt(l);switch(Hh(p)){case 41:l++;return;case cd:if(l=ld(e,l),r(l)===41||l>=e.length){l<e.length&&l++;return}l=Wh(e,l),d=8;return;case 34:case 39:case 40:case xk:l=Wh(e,l),d=8;return;case 92:if(tr(p,r(l+1))){l=Ti(e,l)-1;break}l=Wh(e,l),d=8;return}}}e=String(e||"");let c=e.length,u=qh(r(0)),l=u,d;for(;l<c;){let p=e.charCodeAt(l);switch(Hh(p)){case cd:d=13,l=ld(e,l+1);break;case 34:a();break;case 35:Uh(r(l+1))||tr(r(l+1),r(l+2))?(d=4,l=dd(e,l+1)):(d=9,l++);break;case 39:a();break;case 40:d=21,l++;break;case 41:d=22,l++;break;case 43:Bh(p,r(l+1),r(l+2))?i():(d=9,l++);break;case 44:d=18,l++;break;case 45:Bh(p,r(l+1),r(l+2))?i():r(l+1)===45&&r(l+2)===62?(d=15,l=l+3):Vh(p,r(l+1),r(l+2))?o():(d=9,l++);break;case 46:Bh(p,r(l+1),r(l+2))?i():(d=9,l++);break;case 47:r(l+1)===42?(d=25,l=e.indexOf("*/",l+2),l=l===-1?e.length:l+2):(d=9,l++);break;case 58:d=16,l++;break;case 59:d=17,l++;break;case 60:r(l+1)===33&&r(l+2)===45&&r(l+3)===45?(d=14,l=l+4):(d=9,l++);break;case 64:Vh(r(l+1),r(l+2),r(l+3))?(d=3,l=dd(e,l+1)):(d=9,l++);break;case 91:d=19,l++;break;case 92:tr(p,r(l+1))?o():(d=9,l++);break;case 93:d=20,l++;break;case 123:d=23,l++;break;case 125:d=24,l++;break;case Ak:i();break;case Zh:o();break;default:d=9,l++}t(d,u,u=l)}}var Ra=x(()=>{ud();Qh();yk();yk();wk();ud();Qh();bF();xF()});function SF(e){let t=this.createList(),r=!1,i={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let o=e.getNode.call(this,i);if(o===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,i),r=!1),t.push(o)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,i),t}var vF=x(()=>{});function QK(e){return function(){return this[e]()}}function Ek(e){let t=Object.create(null);for(let r of Object.keys(e)){let i=e[r],o=i.parse||i;o&&(t[r]=o)}return t}function YK(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Ek(e.atrule),pseudo:Ek(e.pseudo),node:Ek(e.node)};for(let[r,i]of Object.entries(e.parseContext))switch(typeof i){case"function":t.context[r]=i;break;case"string":t.context[r]=QK(i);break}return{config:t,...t,...t.node}}function IF(e){let t="",r="<unknown>",i=!1,o=Oc,a=!1,s=new Yh,c=Object.assign(new Xh,YK(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:SF,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(d){return d===wF?1:0},consumeUntilLeftCurlyBracketOrSemicolon(d){return d===wF||d===kk?1:0},consumeUntilExclamationMarkOrSemicolon(d){return d===GK||d===kk?1:0},consumeUntilSemicolonIncluded(d){return d===kk?2:0},createList:Oc,createSingleNodeList:Oc,getFirstListNode:Oc,getLastListNode:Oc,parseWithFallback(d,p){let h=this.tokenIndex;try{return d.call(this)}catch(f){if(a)throw f;this.skip(h-this.tokenIndex);let m=p.call(this);return a=!0,o(f,m),a=!1,m}},lookupNonWSType(d){let p;do if(p=this.lookupType(d++),p!==13&&p!==25)return p;while(p!==_F);return _F},charCodeAt(d){return d>=0&&d<t.length?t.charCodeAt(d):0},substring(d,p){return t.substring(d,p)},substrToCursor(d){return this.source.substring(d,this.tokenStart)},cmpChar(d,p){return vk(t,d,p)},cmpStr(d,p,h){return Oa(t,d,p,h)},consume(d){let p=this.tokenStart;return this.eat(d),this.substrToCursor(p)},consumeFunctionName(){let d=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),d},consumeNumber(d){let p=t.substring(this.tokenStart,Kh(t,this.tokenStart));return this.eat(d),p},eat(d){if(this.tokenType!==d){let p=kc[d].slice(0,-6).replace(/-/g," ").replace(/^./,m=>m.toUpperCase()),h=`${/[[\](){}]/.test(p)?`"${p}"`:p} is expected`,f=this.tokenStart;switch(d){case 1:this.tokenType===2||this.tokenType===7?(f=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case 4:this.isDelim(KK)&&(this.next(),f++,h="Name is expected");break;case 11:this.tokenType===10&&(f=this.tokenEnd,h="Percent sign is expected");break}this.error(h,f)}this.next()},eatIdent(d){(this.tokenType!==1||this.lookupValue(0,d)===!1)&&this.error(`Identifier "${d}" is expected`),this.next()},eatDelim(d){this.isDelim(d)||this.error(`Delim "${String.fromCharCode(d)}" is expected`),this.next()},getLocation(d,p){return i?s.getLocationRange(d,p,r):null},getLocationFromList(d){if(i){let p=this.getFirstListNode(d),h=this.getLastListNode(d);return s.getLocationRange(p!==null?p.loc.start.offset-s.startOffset:this.tokenStart,h!==null?h.loc.end.offset-s.startOffset:this.tokenStart,r)}return null},error(d,p){let h=typeof p<"u"&&p<t.length?s.getLocation(p):this.eof?s.getLocation(fF(t,t.length-1)):s.getLocation(this.tokenStart);throw new gk(d||"Unexpected input",t,h.offset,h.line,h.column,s.startLine,s.startColumn)}}),u=()=>({filename:r,source:t,tokenCount:c.tokenCount,getTokenType:d=>c.getTokenType(d),getTokenTypeName:d=>kc[c.getTokenType(d)],getTokenStart:d=>c.getTokenStart(d),getTokenEnd:d=>c.getTokenEnd(d),getTokenValue:d=>c.source.substring(c.getTokenStart(d),c.getTokenEnd(d)),substring:(d,p)=>c.source.substring(d,p),balance:c.balance.subarray(0,c.tokenCount+1),isBlockOpenerTokenType:c.isBlockOpenerTokenType,isBlockCloserTokenType:c.isBlockCloserTokenType,getBlockTokenPairIndex:d=>c.getBlockTokenPairIndex(d),getLocation:d=>s.getLocation(d,r),getRangeLocation:(d,p)=>s.getLocationRange(d,p,r)});return Object.assign(function(d,p){t=d,p=p||{},c.setSource(t,tg),s.setSource(t,p.offset,p.line,p.column),r=p.filename||"<unknown>",i=!!p.positions,o=typeof p.onParseError=="function"?p.onParseError:Oc,a=!1,c.parseAtrulePrelude="parseAtrulePrelude"in p?!!p.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in p?!!p.parseRulePrelude:!0,c.parseValue="parseValue"in p?!!p.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in p?!!p.parseCustomProperty:!1;let{context:h="default",list:f=!0,onComment:m,onToken:g}=p;if(!(h in c.context))throw new Error("Unknown context `"+h+"`");Object.assign(c,f?JK:WK),Array.isArray(g)?c.forEachToken((C,w,E)=>{g.push({type:C,start:w,end:E})}):typeof g=="function"&&c.forEachToken(g.bind(u())),typeof m=="function"&&c.forEachToken((C,w,E)=>{if(C===25){let I=c.getLocation(w,E),F=Oa(t,E-2,E,"*/")?t.slice(w+2,E-2):t.slice(w+2,E);m(F,I)}});let A=c.context[h].call(c,p);return c.eof||c.error(),A},{SyntaxError:gk,config:c.config})}var Oc,GK,KK,kk,wF,_F,WK,JK,kF=x(()=>{sF();mF();Ra();vF();Oc=()=>{},GK=33,KK=35,kk=59,wF=123,_F=0,WK={createList(){return[]},createSingleNodeList(e){return[e]},getFirstListNode(e){return e&&e[0]||null},getLastListNode(e){return e&&e.length>0?e[e.length-1]:null}},JK={createList(){return new ad},createSingleNodeList(e){return new ad().appendData(e)},getFirstListNode(e){return e&&e.first},getLastListNode(e){return e&&e.last}}});function fd(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,rW)&&this.cmpChar(this.tokenStart+1,EF)?this.UnicodeRange():this.Identifier();case 9:{let t=this.charCodeAt(this.tokenStart);if(t===nW||t===eW||t===EF||t===tW)return this.Operator();t===XK&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var XK,eW,EF,tW,nW,rW,Ck=x(()=>{XK=35,eW=42,EF=43,tW=45,nW=47,rW=117});var CF,PF=x(()=>{Ck();CF={getNode:fd}});function pW(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function mW(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===OF&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case sW:case uW:case dW:case cW:return this.Combinator();case OF:return this.ClassSelector();case aW:case lW:return this.TypeSelector();case iW:return this.IdSelector();case oW:return this.NestingSelector()}break}}}var iW,oW,aW,sW,cW,OF,uW,lW,dW,TF,RF=x(()=>{iW=35,oW=38,aW=42,sW=43,cW=47,OF=46,uW=62,lW=124,dW=126;TF={onWhiteSpace:pW,getNode:mW}});function NF(){return this.createSingleNodeList(this.Raw(null,!1))}var DF=x(()=>{});function $F(){let e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());let t=this.tokenIndex,r=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(r.type==="Value"&&r.children.isEmpty){for(let i=t-this.tokenIndex;i<=0;i++)if(this.lookupType(i)===13){r.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(r)}return e}var jF=x(()=>{});function LF(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var MF,FF=x(()=>{Ck();DF();jF();MF={getNode:fd,onWhiteSpace(e,t){LF(e)&&(e.value=" "+e.value),LF(t.last)&&(t.last.value+=" ")},expression:NF,var:$F}});var Pk={};Ie(Pk,{AtrulePrelude:()=>CF,Selector:()=>TF,Value:()=>MF});var zF=x(()=>{PF();RF();FF()});var fW,UF,VF=x(()=>{fW=new Set(["none","and","not","or"]),UF={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);fW.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}}});var BF,qF=x(()=>{BF={parse:{prelude:null,block(){return this.Block(!0)}}}});function Ok(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},t||(()=>this.Raw(null,!0)))}var ZF,HF,GF=x(()=>{ZF={layer(){this.skipSC();let e=this.createList(),t=Ok.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=Ok.call(this,this.Declaration,()=>Ok.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},HF={parse:{prelude(){let e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,ZF)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,ZF)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}}});var KF,WF=x(()=>{KF={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}}});var JF,QF=x(()=>{JF={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}}});var YF,XF=x(()=>{YF={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var ez,tz=x(()=>{ez={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var nz,rz=x(()=>{nz={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}}});var iz,oz=x(()=>{iz={parse:{prelude:null,block(e=!1){return this.Block(e)}}}});var az,sz=x(()=>{az={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}});var cz,uz=x(()=>{VF();qF();GF();WF();QF();XF();tz();rz();oz();sz();cz={container:UF,"font-face":BF,import:HF,layer:KF,media:JF,nest:YF,page:ez,scope:nz,"starting-style":iz,supports:az}});function lz(){let e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var dz=x(()=>{});var Na,Tk,hW,gW,ng,pz,mz=x(()=>{dz();Na={parse(){return this.createSingleNodeList(this.SelectorList())}},Tk={parse(){return this.createSingleNodeList(this.Selector())}},hW={parse(){return this.createSingleNodeList(this.Identifier())}},gW={parse:lz},ng={parse(){return this.createSingleNodeList(this.Nth())}},pz={dir:hW,has:Na,lang:gW,matches:Na,is:Na,"-moz-any":Na,"-webkit-any":Na,where:Na,not:Na,"nth-child":ng,"nth-last-child":ng,"nth-last-of-type":ng,"nth-of-type":ng,slotted:Tk,host:Tk,"host-context":Tk}});var $k={};Ie($k,{generate:()=>Dk,name:()=>bW,parse:()=>Nk,structure:()=>AW});function ig(e,t){let r=this.tokenStart+e,i=this.charCodeAt(r);for((i===Ai||i===xr)&&(t&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)Bn(this.charCodeAt(r))||this.error("Integer is expected",r)}function Tc(e){return ig.call(this,0,e)}function Co(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let r="";switch(t){case rg:r="N is expected";break;case xr:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+e)}}function Rk(){let e=0,t=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++e);if(r!==10)if(this.isDelim(Ai,e)||this.isDelim(xr,e)){t=this.isDelim(Ai,e)?Ai:xr;do r=this.lookupType(++e);while(r===13||r===25);r!==10&&(this.skip(e),Tc.call(this,Da))}else return null;return e>0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==Ai&&r!==xr&&this.error("Number sign is expected")),Tc.call(this,t!==0),t===xr?"-"+this.consume(10):this.consume(10)}function Nk(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)Tc.call(this,yW),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,xr))switch(t="-1",Co.call(this,1,rg),this.tokenEnd-this.tokenStart){case 2:this.next(),r=Rk.call(this);break;case 3:Co.call(this,2,xr),this.next(),this.skipSC(),Tc.call(this,Da),r="-"+this.consume(10);break;default:Co.call(this,2,xr),ig.call(this,3,Da),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Ai)&&this.lookupType(1)===1){let i=0;switch(t="1",this.isDelim(Ai)&&(i=1,this.next()),Co.call(this,0,rg),this.tokenEnd-this.tokenStart){case 1:this.next(),r=Rk.call(this);break;case 2:Co.call(this,1,xr),this.next(),this.skipSC(),Tc.call(this,Da),r="-"+this.consume(10);break;default:Co.call(this,1,xr),ig.call(this,2,Da),this.next(),r=this.substrToCursor(e+i+1)}}else if(this.tokenType===12){let i=this.charCodeAt(this.tokenStart),o=i===Ai||i===xr,a=this.tokenStart+o;for(;a<this.tokenEnd&&Bn(this.charCodeAt(a));a++);a===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Co.call(this,a-this.tokenStart,rg),t=this.substring(e,a),a+1===this.tokenEnd?(this.next(),r=Rk.call(this)):(Co.call(this,a-this.tokenStart+1,xr),a+2===this.tokenEnd?(this.next(),this.skipSC(),Tc.call(this,Da),r="-"+this.consume(10)):(ig.call(this,a-this.tokenStart+2,Da),this.next(),r=this.substrToCursor(a+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Ai&&(t=t.substr(1)),r!==null&&r.charCodeAt(0)===Ai&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:r}}function Dk(e){if(e.a){let t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){let r=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+r)}else this.tokenize(t)}else this.tokenize(e.b)}var Ai,xr,rg,Da,yW,bW,AW,og=x(()=>{Ra();Ai=43,xr=45,rg=110,Da=!0,yW=!1;bW="AnPlusB",AW={a:[String,null],b:[String,null]}});var Mk={};Ie(Mk,{generate:()=>Lk,name:()=>SW,parse:()=>jk,structure:()=>wW,walkContext:()=>vW});function fz(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function xW(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}function jk(e=!1){let t=this.tokenStart,r,i,o=null,a=null;switch(this.eat(3),r=this.substrToCursor(t+1),i=r.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?o=this.parseWithFallback(this.AtrulePrelude.bind(this,r,e),fz):o=fz.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,i)&&typeof this.atrule[i].block=="function"?a=this.atrule[i].block.call(this,e):a=this.Block(xW.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:r,prelude:o,block:a}}function Lk(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var SW,vW,wW,ag=x(()=>{SW="Atrule",vW="atrule",wW={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]}});var Uk={};Ie(Uk,{generate:()=>zk,name:()=>_W,parse:()=>Fk,structure:()=>kW,walkContext:()=>IW});function Fk(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function zk(e){this.children(e)}var _W,IW,kW,sg=x(()=>{_W="AtrulePrelude",IW="atrulePrelude",kW={children:[[]]}});var Zk={};Ie(Zk,{generate:()=>qk,name:()=>RW,parse:()=>Bk,structure:()=>NW});function OW(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(hz)?(t=!0,this.next()):this.isDelim(Vk)||this.eat(1),this.isDelim(Vk)?this.charCodeAt(this.tokenStart+1)!==cg?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function TW(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==cg&&t!==PW&&t!==CW&&t!==EW&&t!==hz&&t!==Vk&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==cg&&(this.isDelim(cg)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}function Bk(){let e=this.tokenStart,t,r=null,i=null,o=null;return this.eat(19),this.skipSC(),t=OW.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=TW.call(this),this.skipSC(),i=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:r,value:i,flags:o}}function qk(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}var EW,hz,cg,CW,Vk,PW,RW,NW,ug=x(()=>{EW=36,hz=42,cg=61,CW=94,Vk=124,PW=126;RW="AttributeSelector",NW={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]}});var Kk={};Ie(Kk,{generate:()=>Gk,name:()=>jW,parse:()=>Hk,structure:()=>MW,walkContext:()=>LW});function bz(){return this.Raw(null,!0)}function gz(){return this.parseWithFallback(this.Rule,bz)}function yz(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function $W(){if(this.tokenType===17)return yz.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,yz);return this.tokenType===17&&this.next(),e}function Hk(e){let t=e?$W:gz,r=this.tokenStart,i=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:i.push(this.parseWithFallback(this.Atrule.bind(this,e),bz));break;default:e&&this.isDelim(DW)?i.push(gz.call(this)):i.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(r,this.tokenStart),children:i}}function Gk(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var DW,jW,LW,MW,lg=x(()=>{DW=38;jW="Block",LW="block",MW={children:[["Atrule","Rule","Declaration"]]}});var Qk={};Ie(Qk,{generate:()=>Jk,name:()=>FW,parse:()=>Wk,structure:()=>zW});function Wk(e,t){let r=this.tokenStart,i=null;return this.eat(19),i=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(r,this.tokenStart),children:i}}function Jk(e){this.token(9,"["),this.children(e),this.token(9,"]")}var FW,zW,dg=x(()=>{FW="Brackets",zW={children:[[]]}});var eE={};Ie(eE,{generate:()=>Xk,name:()=>UW,parse:()=>Yk,structure:()=>VW});function Yk(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Xk(){this.token(15,"-->")}var UW,VW,pg=x(()=>{UW="CDC",VW=[]});var rE={};Ie(rE,{generate:()=>nE,name:()=>BW,parse:()=>tE,structure:()=>qW});function tE(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function nE(){this.token(14,"\x3c!--")}var BW,qW,mg=x(()=>{BW="CDO",qW=[]});var aE={};Ie(aE,{generate:()=>oE,name:()=>HW,parse:()=>iE,structure:()=>GW});function iE(){return this.eatDelim(ZW),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function oE(e){this.token(9,"."),this.token(1,e.name)}var ZW,HW,GW,fg=x(()=>{ZW=46,HW="ClassSelector",GW={name:String}});var uE={};Ie(uE,{generate:()=>cE,name:()=>QW,parse:()=>sE,structure:()=>YW});function sE(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case WW:case KW:case JW:this.next();break;case Az:this.next(),this.eatIdent("deep"),this.eatDelim(Az);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function cE(e){this.tokenize(e.name)}var KW,Az,WW,JW,QW,YW,hg=x(()=>{KW=43,Az=47,WW=62,JW=126,QW="Combinator",YW={name:String}});var pE={};Ie(pE,{generate:()=>dE,name:()=>tJ,parse:()=>lE,structure:()=>nJ});function lE(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===XW&&this.charCodeAt(t-1)===eJ&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function dE(e){this.token(25,"/*"+e.value+"*/")}var XW,eJ,tJ,nJ,gg=x(()=>{XW=42,eJ=47,tJ="Comment",nJ={value:String}});var hE={};Ie(hE,{generate:()=>fE,name:()=>iJ,parse:()=>mE,structure:()=>oJ});function xz(e){return this.lookupTypeNonSC(1)===1&&rJ.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}function mE(e="media"){let t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t.push(this.Identifier());break;case 21:{let r=this.parseWithFallback(()=>aJ[e].call(this,e),()=>null);r||(r=this.parseWithFallback(()=>{this.eat(21);let i=this.Condition(e);return this.eat(22),i},()=>this.GeneralEnclosed(e))),t.push(r);break}case 2:{let r=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);r||(r=this.GeneralEnclosed(e)),t.push(r);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function fE(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}var rJ,iJ,oJ,aJ,yg=x(()=>{rJ=new Set([16,22,0]),iJ="Condition",oJ={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};aJ={media:xz,container:xz,supports(){return this.SupportsDeclaration()}}});function vz(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Sz&&e.charCodeAt(t+1)===Sz}var Sz,wz=x(()=>{Sz=45});var bE={};Ie(bE,{generate:()=>yE,name:()=>hJ,parse:()=>gE,structure:()=>yJ,walkContext:()=>gJ});function pJ(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function mJ(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function fJ(){let e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(Iz)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}function gE(){let e=this.tokenStart,t=this.tokenIndex,r=bJ.call(this),i=vz(r),o=i?this.parseCustomProperty:this.parseValue,a=i?mJ:pJ,s=!1,c;this.skipSC(),this.eat(16);let u=this.tokenIndex;if(i||this.skipSC(),o?c=this.parseWithFallback(fJ,a):c=a.call(this,this.tokenIndex),i&&c.type==="Value"&&c.children.isEmpty){for(let l=u-this.tokenIndex;l<=0;l++)if(this.lookupType(l)===13){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(Iz)&&(s=AJ.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:s,property:r,value:c}}function yE(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function bJ(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case lJ:case cJ:case dJ:case sJ:case uJ:this.next();break;case _z:this.next(),this.isDelim(_z)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function AJ(){this.eat(9),this.skipSC();let e=this.consume(1);return e==="important"?!0:e}var Iz,sJ,cJ,uJ,lJ,dJ,_z,hJ,gJ,yJ,bg=x(()=>{wz();Iz=33,sJ=35,cJ=36,uJ=38,lJ=42,dJ=43,_z=47;hJ="Declaration",gJ="declaration",yJ={important:[Boolean,String],property:String,value:["Value","Raw"]}});var vE={};Ie(vE,{generate:()=>SE,name:()=>SJ,parse:()=>xE,structure:()=>vJ});function AE(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function xE(){let e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),AE));break;default:this.isDelim(xJ)?e.push(this.parseWithFallback(this.Rule,AE)):e.push(this.parseWithFallback(this.Declaration,AE))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function SE(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var xJ,SJ,vJ,Ag=x(()=>{xJ=38;SJ="DeclarationList",vJ={children:[["Declaration","Atrule","Rule"]]}});var IE={};Ie(IE,{generate:()=>_E,name:()=>wJ,parse:()=>wE,structure:()=>_J});function wE(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function _E(e){this.token(12,e.value+e.unit)}var wJ,_J,xg=x(()=>{wJ="Dimension",_J={value:String,unit:String}});var CE={};Ie(CE,{generate:()=>EE,name:()=>kJ,parse:()=>kE,structure:()=>EJ});function kE(e){let t=this.tokenStart,r,i=null;if(this.eat(21),this.skipSC(),r=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?i=this.Ratio():i=this.Number();break;case 12:i=this.Dimension();break;case 1:i=this.Identifier();break;case 2:i=this.parseWithFallback(()=>{let o=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(IJ)&&this.error(),o},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(22),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:r,value:i}}function EE(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var IJ,kJ,EJ,Sg=x(()=>{IJ=47,kJ="Feature",EJ={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]}});var TE={};Ie(TE,{generate:()=>OE,name:()=>CJ,parse:()=>PE,structure:()=>PJ});function OJ(e,t){let i=(this.features[e]||{})[t];return typeof i!="function"&&this.error(`Unknown feature ${t}()`),i}function PE(e="unknown"){let t=this.tokenStart,r=this.consumeFunctionName(),i=OJ.call(this,e,r.toLowerCase());this.skipSC();let o=this.parseWithFallback(()=>{let a=this.tokenIndex,s=i.call(this);return this.eof===!1&&this.isBalanceEdge(a)===!1&&this.error(),s},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:r,value:o}}function OE(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}var CJ,PJ,vg=x(()=>{CJ="FeatureFunction",PJ={kind:String,feature:String,value:["Declaration","Selector"]}});var $E={};Ie($E,{generate:()=>DE,name:()=>NJ,parse:()=>NE,structure:()=>DJ});function RE(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(kz,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(kz)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function Cz(e){if(this.skipSC(),this.isDelim(TJ)||this.isDelim(RJ)){let t=this.source[this.tokenStart];return this.next(),this.isDelim(Ez)?(this.next(),t+"="):t}if(this.isDelim(Ez))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function NE(e="unknown"){let t=this.tokenStart;this.skipSC(),this.eat(21);let r=RE.call(this),i=Cz.call(this,r.type==="Identifier"),o=RE.call(this),a=null,s=null;return this.lookupNonWSType(0)!==22&&(a=Cz.call(this),s=RE.call(this)),this.skipSC(),this.eat(22),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:r,leftComparison:i,middle:o,rightComparison:a,right:s}}function DE(e){this.token(21,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,")")}var kz,TJ,Ez,RJ,NJ,DJ,wg=x(()=>{kz=47,TJ=60,Ez=61,RJ=62,NJ="FeatureRange",DJ={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]}});var ME={};Ie(ME,{generate:()=>LE,name:()=>$J,parse:()=>jE,structure:()=>LJ,walkContext:()=>jJ});function jE(e,t){let r=this.tokenStart,i=this.consumeFunctionName(),o=i.toLowerCase(),a;return a=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(r,this.tokenStart),name:i,children:a}}function LE(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var $J,jJ,LJ,_g=x(()=>{$J="Function",jJ="function",LJ={name:String,children:[[]]}});var UE={};Ie(UE,{generate:()=>zE,name:()=>MJ,parse:()=>FE,structure:()=>FJ});function FE(e){let t=this.tokenStart,r=null;this.tokenType===2?r=this.consumeFunctionName():this.eat(21);let i=this.parseWithFallback(()=>{let o=this.tokenIndex,a=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),a},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:r,children:i}}function zE(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}var MJ,FJ,Ig=x(()=>{MJ="GeneralEnclosed",FJ={kind:String,function:[String,null],children:[[]]}});var qE={};Ie(qE,{generate:()=>BE,name:()=>UJ,parse:()=>VE,structure:()=>VJ,xxx:()=>zJ});function VE(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function BE(e){this.token(4,"#"+e.value)}var zJ,UJ,VJ,kg=x(()=>{zJ="XXX",UJ="Hash",VJ={value:String}});var GE={};Ie(GE,{generate:()=>HE,name:()=>BJ,parse:()=>ZE,structure:()=>qJ});function ZE(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function HE(e){this.token(1,e.name)}var BJ,qJ,Eg=x(()=>{BJ="Identifier",qJ={name:String}});var JE={};Ie(JE,{generate:()=>WE,name:()=>ZJ,parse:()=>KE,structure:()=>HJ});function KE(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function WE(e){this.token(9,"#"+e.name)}var ZJ,HJ,Cg=x(()=>{ZJ="IdSelector",HJ={name:String}});var XE={};Ie(XE,{generate:()=>YE,name:()=>KJ,parse:()=>QE,structure:()=>WJ});function QE(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(GJ);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function YE(e){this.tokenize(e.name)}var GJ,KJ,WJ,Pg=x(()=>{GJ=46,KJ="Layer",WJ={name:String}});var nC={};Ie(nC,{generate:()=>tC,name:()=>JJ,parse:()=>eC,structure:()=>QJ});function eC(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function tC(e){this.children(e,()=>this.token(18,","))}var JJ,QJ,Og=x(()=>{JJ="LayerList",QJ={children:[["Layer"]]}});var oC={};Ie(oC,{generate:()=>iC,name:()=>YJ,parse:()=>rC,structure:()=>XJ});function rC(){let e=this.tokenStart,t=null,r=null,i=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let o=this.consume(1),a=o.toLowerCase();switch(a==="not"||a==="only"?(this.skipSC(),t=a,r=this.consume(1)):r=o,this.lookupTypeNonSC(0)){case 1:{this.skipSC(),this.eatIdent("and"),i=this.Condition("media");break}case 23:case 17:case 18:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case 21:case 2:{i=this.Condition("media");break}case 23:case 17:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:r,condition:i}}function iC(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}var YJ,XJ,Tg=x(()=>{YJ="MediaQuery",XJ={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]}});var cC={};Ie(cC,{generate:()=>sC,name:()=>eQ,parse:()=>aC,structure:()=>tQ});function aC(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function sC(e){this.children(e,()=>this.token(18,","))}var eQ,tQ,Rg=x(()=>{eQ="MediaQueryList",tQ={children:[["MediaQuery"]]}});var dC={};Ie(dC,{generate:()=>lC,name:()=>rQ,parse:()=>uC,structure:()=>iQ});function uC(){let e=this.tokenStart;return this.eatDelim(nQ),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function lC(){this.token(9,"&")}var nQ,rQ,iQ,Ng=x(()=>{nQ=38,rQ="NestingSelector",iQ={}});var fC={};Ie(fC,{generate:()=>mC,name:()=>oQ,parse:()=>pC,structure:()=>aQ});function pC(){this.skipSC();let e=this.tokenStart,t=e,r=null,i;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?i=this.Identifier():i=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:i,selector:r}}function mC(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var oQ,aQ,Dg=x(()=>{oQ="Nth",aQ={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}});var yC={};Ie(yC,{generate:()=>gC,name:()=>sQ,parse:()=>hC,structure:()=>cQ});function hC(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function gC(e){this.token(10,e.value)}var sQ,cQ,$g=x(()=>{sQ="Number",cQ={value:String}});var xC={};Ie(xC,{generate:()=>AC,name:()=>uQ,parse:()=>bC,structure:()=>lQ});function bC(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function AC(e){this.tokenize(e.value)}var uQ,lQ,jg=x(()=>{uQ="Operator",lQ={value:String}});var wC={};Ie(wC,{generate:()=>vC,name:()=>dQ,parse:()=>SC,structure:()=>pQ});function SC(e,t){let r=this.tokenStart,i=null;return this.eat(21),i=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(r,this.tokenStart),children:i}}function vC(e){this.token(21,"("),this.children(e),this.token(22,")")}var dQ,pQ,Lg=x(()=>{dQ="Parentheses",pQ={children:[[]]}});var kC={};Ie(kC,{generate:()=>IC,name:()=>mQ,parse:()=>_C,structure:()=>fQ});function _C(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function IC(e){this.token(11,e.value+"%")}var mQ,fQ,Mg=x(()=>{mQ="Percentage",fQ={value:String}});var PC={};Ie(PC,{generate:()=>CC,name:()=>hQ,parse:()=>EC,structure:()=>yQ,walkContext:()=>gQ});function EC(){let e=this.tokenStart,t=null,r,i;return this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),i=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function CC(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var hQ,gQ,yQ,Fg=x(()=>{hQ="PseudoClassSelector",gQ="function",yQ={name:String,children:[["Raw"],null]}});var RC={};Ie(RC,{generate:()=>TC,name:()=>bQ,parse:()=>OC,structure:()=>xQ,walkContext:()=>AQ});function OC(){let e=this.tokenStart,t=null,r,i;return this.eat(16),this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),i=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,i)?(this.skipSC(),t=this.pseudo[i].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function TC(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var bQ,AQ,xQ,zg=x(()=>{bQ="PseudoElementSelector",AQ="function",xQ={name:String,children:[["Raw"],null]}});var $C={};Ie($C,{generate:()=>DC,name:()=>SQ,parse:()=>NC,structure:()=>vQ});function Oz(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}function NC(){let e=this.tokenStart,t=Oz.call(this),r=null;return this.skipSC(),this.isDelim(Pz)&&(this.eatDelim(Pz),r=Oz.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:r}}function DC(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}var Pz,SQ,vQ,Ug=x(()=>{Pz=47;SQ="Ratio",vQ={left:["Number","Function"],right:["Number","Function",null]}});var MC={};Ie(MC,{generate:()=>LC,name:()=>_Q,parse:()=>jC,structure:()=>IQ});function wQ(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function jC(e,t){let r=this.getTokenStart(this.tokenIndex),i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>r?i=wQ.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(r,i),value:this.substring(r,i)}}function LC(e){this.tokenize(e.value)}var _Q,IQ,Vg=x(()=>{_Q="Raw",IQ={value:String}});var UC={};Ie(UC,{generate:()=>zC,name:()=>EQ,parse:()=>FC,structure:()=>PQ,walkContext:()=>CQ});function Tz(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function kQ(){let e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}function FC(){let e=this.tokenIndex,t=this.tokenStart,r,i;return this.parseRulePrelude?r=this.parseWithFallback(kQ,Tz):r=Tz.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:r,block:i}}function zC(e){this.node(e.prelude),this.node(e.block)}var EQ,CQ,PQ,Bg=x(()=>{EQ="Rule",CQ="rule",PQ={prelude:["SelectorList","Raw"],block:["Block"]}});var qC={};Ie(qC,{generate:()=>BC,name:()=>OQ,parse:()=>VC,structure:()=>TQ});function VC(){let e=null,t=null;this.skipSC();let r=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(21),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:"Scope",loc:this.getLocation(r,this.tokenStart),root:e,limit:t}}function BC(e){e.root&&(this.token(21,"("),this.node(e.root),this.token(22,")")),e.limit&&(this.token(1,"to"),this.token(21,"("),this.node(e.limit),this.token(22,")"))}var OQ,TQ,qg=x(()=>{OQ="Scope",TQ={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}});var GC={};Ie(GC,{generate:()=>HC,name:()=>RQ,parse:()=>ZC,structure:()=>NQ});function ZC(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function HC(e){this.children(e)}var RQ,NQ,Zg=x(()=>{RQ="Selector",NQ={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}});var JC={};Ie(JC,{generate:()=>WC,name:()=>DQ,parse:()=>KC,structure:()=>jQ,walkContext:()=>$Q});function KC(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function WC(e){this.children(e,()=>this.token(18,","))}var DQ,$Q,jQ,Hg=x(()=>{DQ="SelectorList",$Q="selector",jQ={children:[["Selector","Raw"]]}});function Gg(e){let t=e.length,r=e.charCodeAt(0),i=r===Rz||r===Nz?1:0,o=i===1&&t>1&&e.charCodeAt(t-1)===r?t-2:t-1,a="";for(let s=i;s<=o;s++){let c=e.charCodeAt(s);if(c===QC){if(s===o){s!==t-1&&(a=e.substr(s+1));break}if(c=e.charCodeAt(++s),tr(QC,c)){let u=s-1,l=Ti(e,u);s=l-1,a+=Jh(e.substring(u+1,l))}else c===13&&e.charCodeAt(s+1)===10&&s++}else a+=e[s]}return a}function Dz(e,t){let r=t?"'":'"',i=t?Nz:Rz,o="",a=!1;for(let s=0;s<e.length;s++){let c=e.charCodeAt(s);if(c===0){o+="\uFFFD";continue}if(c<=31||c===127){o+="\\"+c.toString(16),a=!0;continue}c===i||c===QC?(o+="\\"+e.charAt(s),a=!1):(a&&(hi(c)||gi(c))&&(o+=" "),o+=e.charAt(s),a=!1)}return r+o+r}var QC,Rz,Nz,YC=x(()=>{Ra();QC=92,Rz=34,Nz=39});var t1={};Ie(t1,{generate:()=>e1,name:()=>MQ,parse:()=>XC,structure:()=>FQ});function XC(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Gg(this.consume(5))}}function e1(e){this.token(5,Dz(e.value))}var MQ,FQ,Kg=x(()=>{YC();MQ="String",FQ={value:String}});var i1={};Ie(i1,{generate:()=>r1,name:()=>UQ,parse:()=>n1,structure:()=>BQ,walkContext:()=>VQ});function $z(){return this.Raw(null,!1)}function n1(){let e=this.tokenStart,t=this.createList(),r;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==zQ){this.next();continue}r=this.Comment();break;case 14:r=this.CDO();break;case 15:r=this.CDC();break;case 3:r=this.parseWithFallback(this.Atrule,$z);break;default:r=this.parseWithFallback(this.Rule,$z)}t.push(r)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function r1(e){this.children(e)}var zQ,UQ,VQ,BQ,Wg=x(()=>{zQ=33;UQ="StyleSheet",VQ="stylesheet",BQ={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]}});var s1={};Ie(s1,{generate:()=>a1,name:()=>qQ,parse:()=>o1,structure:()=>ZQ});function o1(){let e=this.tokenStart;this.eat(21),this.skipSC();let t=this.Declaration();return this.eof||this.eat(22),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function a1(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var qQ,ZQ,Jg=x(()=>{qQ="SupportsDeclaration",ZQ={declaration:"Declaration"}});var d1={};Ie(d1,{generate:()=>l1,name:()=>GQ,parse:()=>u1,structure:()=>KQ});function c1(){this.tokenType!==1&&this.isDelim(HQ)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function u1(){let e=this.tokenStart;return this.isDelim(jz)?(this.next(),c1.call(this)):(c1.call(this),this.isDelim(jz)&&(this.next(),c1.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function l1(e){this.tokenize(e.name)}var HQ,jz,GQ,KQ,Qg=x(()=>{HQ=42,jz=124;GQ="TypeSelector",KQ={name:String}});var h1={};Ie(h1,{generate:()=>f1,name:()=>QQ,parse:()=>m1,structure:()=>YQ});function hd(e,t){let r=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){let o=this.charCodeAt(i);if(o===Mz&&t&&r!==0)return hd.call(this,e+r+1,!1),-1;hi(o)||this.error(t&&r!==0?"Hyphen minus"+(r<6?" or hex digit":"")+" is expected":r<6?"Hex digit is expected":"Unexpected input",i),++r>6&&this.error("Too many hex digits",i)}return this.next(),r}function Yg(e){let t=0;for(;this.isDelim(p1);)++t>e&&this.error("Too many question marks"),this.next()}function WQ(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===Lz?"Plus sign":"Hyphen minus")+" is expected")}function JQ(){let e=0;switch(this.tokenType){case 10:if(e=hd.call(this,1,!0),this.isDelim(p1)){Yg.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){WQ.call(this,Mz),hd.call(this,1,!1);break}break;case 12:e=hd.call(this,1,!0),e>0&&Yg.call(this,6-e);break;default:if(this.eatDelim(Lz),this.tokenType===1){e=hd.call(this,0,!0),e>0&&Yg.call(this,6-e);break}if(this.isDelim(p1)){this.next(),Yg.call(this,5);break}this.error("Hex digit or question mark is expected")}}function m1(){let e=this.tokenStart;return this.eatIdent("u"),JQ.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function f1(e){this.tokenize(e.value)}var Lz,Mz,p1,QQ,YQ,Xg=x(()=>{Ra();Lz=43,Mz=45,p1=63;QQ="UnicodeRange",YQ={value:String}});function zz(e){let t=e.length,r=4,i=e.charCodeAt(t-1)===Fz?t-2:t-1,o="";for(;r<i&&gi(e.charCodeAt(r));)r++;for(;r<i&&gi(e.charCodeAt(i));)i--;for(let a=r;a<=i;a++){let s=e.charCodeAt(a);if(s===g1){if(a===i){a!==t-1&&(o=e.substr(a+1));break}if(s=e.charCodeAt(++a),tr(g1,s)){let c=a-1,u=Ti(e,c);a=u-1,o+=Jh(e.substring(c+1,u))}else s===13&&e.charCodeAt(a+1)===10&&a++}else o+=e[a]}return o}function Uz(e){let t="",r=!1;for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);if(o===0){t+="\uFFFD";continue}if(o<=31||o===127){t+="\\"+o.toString(16),r=!0;continue}o===XQ||o===g1||o===eY||o===tY||o===nY||o===Fz?(t+="\\"+e.charAt(i),r=!1):(r&&hi(o)&&(t+=" "),t+=e.charAt(i),r=!1)}return"url("+t+")"}var XQ,g1,eY,tY,nY,Fz,Vz=x(()=>{Ra();XQ=32,g1=92,eY=34,tY=39,nY=40,Fz=41});var A1={};Ie(A1,{generate:()=>b1,name:()=>iY,parse:()=>y1,structure:()=>oY});function y1(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=zz(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Gg(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function b1(e){this.token(7,Uz(e.value))}var iY,oY,ey=x(()=>{Vz();YC();iY="Url",oY={value:String}});var v1={};Ie(v1,{generate:()=>S1,name:()=>aY,parse:()=>x1,structure:()=>sY});function x1(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function S1(e){this.children(e)}var aY,sY,ty=x(()=>{aY="Value",sY={children:[[]]}});var I1={};Ie(I1,{generate:()=>_1,name:()=>uY,parse:()=>w1,structure:()=>lY});function w1(){return this.eat(13),cY}function _1(e){this.token(13,e.value)}var cY,uY,lY,ny=x(()=>{cY=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),uY="WhiteSpace",lY={value:String}});var k1={};Ie(k1,{AnPlusB:()=>Nk,Atrule:()=>jk,AtrulePrelude:()=>Fk,AttributeSelector:()=>Bk,Block:()=>Hk,Brackets:()=>Wk,CDC:()=>Yk,CDO:()=>tE,ClassSelector:()=>iE,Combinator:()=>sE,Comment:()=>lE,Condition:()=>mE,Declaration:()=>gE,DeclarationList:()=>xE,Dimension:()=>wE,Feature:()=>kE,FeatureFunction:()=>PE,FeatureRange:()=>NE,Function:()=>jE,GeneralEnclosed:()=>FE,Hash:()=>VE,IdSelector:()=>KE,Identifier:()=>ZE,Layer:()=>QE,LayerList:()=>eC,MediaQuery:()=>rC,MediaQueryList:()=>aC,NestingSelector:()=>uC,Nth:()=>pC,Number:()=>hC,Operator:()=>bC,Parentheses:()=>SC,Percentage:()=>_C,PseudoClassSelector:()=>EC,PseudoElementSelector:()=>OC,Ratio:()=>NC,Raw:()=>jC,Rule:()=>FC,Scope:()=>VC,Selector:()=>ZC,SelectorList:()=>KC,String:()=>XC,StyleSheet:()=>n1,SupportsDeclaration:()=>o1,TypeSelector:()=>u1,UnicodeRange:()=>m1,Url:()=>y1,Value:()=>x1,WhiteSpace:()=>w1});var Bz=x(()=>{og();ag();sg();ug();lg();dg();pg();mg();fg();hg();gg();yg();bg();Ag();xg();Sg();vg();wg();_g();Ig();kg();Eg();Cg();Pg();Og();Tg();Rg();Ng();Dg();$g();jg();Lg();Mg();Fg();zg();Ug();Vg();Bg();qg();Zg();Hg();Kg();Wg();Jg();Qg();Xg();ey();ty();ny()});var qz,Zz=x(()=>{zF();uz();mz();Bz();qz={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:Pk,atrule:cz,pseudo:pz,node:k1}});var E1,Hz=x(()=>{kF();Zz();E1=IF(qz)});var Kz=Ua(C1=>{var Gz="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");C1.encode=function(e){if(0<=e&&e<Gz.length)return Gz[e];throw new TypeError("Must be between 0 and 63: "+e)};C1.decode=function(e){var t=65,r=90,i=97,o=122,a=48,s=57,c=43,u=47,l=26,d=52;return t<=e&&e<=r?e-t:i<=e&&e<=o?e-i+l:a<=e&&e<=s?e-a+d:e==c?62:e==u?63:-1}});var Xz=Ua(O1=>{var Wz=Kz(),P1=5,Jz=1<<P1,Qz=Jz-1,Yz=Jz;function dY(e){return e<0?(-e<<1)+1:(e<<1)+0}function pY(e){var t=(e&1)===1,r=e>>1;return t?-r:r}O1.encode=function(t){var r="",i,o=dY(t);do i=o&Qz,o>>>=P1,o>0&&(i|=Yz),r+=Wz.encode(i);while(o>0);return r};O1.decode=function(t,r,i){var o=t.length,a=0,s=0,c,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Wz.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&Yz),u&=Qz,a=a+(u<<s),s+=P1}while(c);i.value=pY(a),i.rest=r}});var ry=Ua(An=>{function mY(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}An.getArg=mY;var eU=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,fY=/^data:.+\,.+$/;function gd(e){var t=e.match(eU);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}An.urlParse=gd;function Rc(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}An.urlGenerate=Rc;var hY=32;function gY(e){var t=[];return function(r){for(var i=0;i<t.length;i++)if(t[i].input===r){var o=t[0];return t[0]=t[i],t[i]=o,t[0].result}var a=e(r);return t.unshift({input:r,result:a}),t.length>hY&&t.pop(),a}}var T1=gY(function(t){var r=t,i=gd(t);if(i){if(!i.path)return t;r=i.path}for(var o=An.isAbsolute(r),a=[],s=0,c=0;;)if(s=c,c=r.indexOf("/",s),c===-1){a.push(r.slice(s));break}else for(a.push(r.slice(s,c));c<r.length&&r[c]==="/";)c++;for(var u,l=0,c=a.length-1;c>=0;c--)u=a[c],u==="."?a.splice(c,1):u===".."?l++:l>0&&(u===""?(a.splice(c+1,l),l=0):(a.splice(c,2),l--));return r=a.join("/"),r===""&&(r=o?"/":"."),i?(i.path=r,Rc(i)):r});An.normalize=T1;function tU(e,t){e===""&&(e="."),t===""&&(t=".");var r=gd(t),i=gd(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),Rc(r);if(r||t.match(fY))return t;if(i&&!i.host&&!i.path)return i.host=t,Rc(i);var o=t.charAt(0)==="/"?t:T1(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=o,Rc(i)):o}An.join=tU;An.isAbsolute=function(e){return e.charAt(0)==="/"||eU.test(e)};function yY(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var i=e.lastIndexOf("/");if(i<0||(e=e.slice(0,i),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}An.relative=yY;var nU=(function(){var e=Object.create(null);return!("__proto__"in e)})();function rU(e){return e}function bY(e){return iU(e)?"$"+e:e}An.toSetString=nU?rU:bY;function AY(e){return iU(e)?e.slice(1):e}An.fromSetString=nU?rU:AY;function iU(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function xY(e,t,r){var i=Ri(e.source,t.source);return i!==0||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0||r)||(i=e.generatedColumn-t.generatedColumn,i!==0)||(i=e.generatedLine-t.generatedLine,i!==0)?i:Ri(e.name,t.name)}An.compareByOriginalPositions=xY;function SY(e,t,r){var i;return i=e.originalLine-t.originalLine,i!==0||(i=e.originalColumn-t.originalColumn,i!==0||r)||(i=e.generatedColumn-t.generatedColumn,i!==0)||(i=e.generatedLine-t.generatedLine,i!==0)?i:Ri(e.name,t.name)}An.compareByOriginalPositionsNoSource=SY;function vY(e,t,r){var i=e.generatedLine-t.generatedLine;return i!==0||(i=e.generatedColumn-t.generatedColumn,i!==0||r)||(i=Ri(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:Ri(e.name,t.name)}An.compareByGeneratedPositionsDeflated=vY;function wY(e,t,r){var i=e.generatedColumn-t.generatedColumn;return i!==0||r||(i=Ri(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:Ri(e.name,t.name)}An.compareByGeneratedPositionsDeflatedNoLine=wY;function Ri(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function _Y(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=Ri(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:Ri(e.name,t.name)}An.compareByGeneratedPositionsInflated=_Y;function IY(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}An.parseSourceMapInput=IY;function kY(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var i=gd(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var o=i.path.lastIndexOf("/");o>=0&&(i.path=i.path.substring(0,o+1))}t=tU(Rc(i),t)}return T1(t)}An.computeSourceURL=kY});var aU=Ua(oU=>{var R1=ry(),N1=Object.prototype.hasOwnProperty,$a=typeof Map<"u";function Ni(){this._array=[],this._set=$a?new Map:Object.create(null)}Ni.fromArray=function(t,r){for(var i=new Ni,o=0,a=t.length;o<a;o++)i.add(t[o],r);return i};Ni.prototype.size=function(){return $a?this._set.size:Object.getOwnPropertyNames(this._set).length};Ni.prototype.add=function(t,r){var i=$a?t:R1.toSetString(t),o=$a?this.has(t):N1.call(this._set,i),a=this._array.length;(!o||r)&&this._array.push(t),o||($a?this._set.set(t,a):this._set[i]=a)};Ni.prototype.has=function(t){if($a)return this._set.has(t);var r=R1.toSetString(t);return N1.call(this._set,r)};Ni.prototype.indexOf=function(t){if($a){var r=this._set.get(t);if(r>=0)return r}else{var i=R1.toSetString(t);if(N1.call(this._set,i))return this._set[i]}throw new Error('"'+t+'" is not in the set.')};Ni.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Ni.prototype.toArray=function(){return this._array.slice()};oU.ArraySet=Ni});var uU=Ua(cU=>{var sU=ry();function EY(e,t){var r=e.generatedLine,i=t.generatedLine,o=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=o||sU.compareByGeneratedPositionsInflated(e,t)<=0}function iy(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}iy.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};iy.prototype.add=function(t){EY(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};iy.prototype.toArray=function(){return this._sorted||(this._array.sort(sU.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};cU.MappingList=iy});var dU=Ua(lU=>{var yd=Xz(),Qt=ry(),oy=aU().ArraySet,CY=uU().MappingList;function Nr(e){e||(e={}),this._file=Qt.getArg(e,"file",null),this._sourceRoot=Qt.getArg(e,"sourceRoot",null),this._skipValidation=Qt.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=Qt.getArg(e,"ignoreInvalidMapping",!1),this._sources=new oy,this._names=new oy,this._mappings=new CY,this._sourcesContents=null}Nr.prototype._version=3;Nr.fromSourceMap=function(t,r){var i=t.sourceRoot,o=new Nr(Object.assign(r||{},{file:t.file,sourceRoot:i}));return t.eachMapping(function(a){var s={generated:{line:a.generatedLine,column:a.generatedColumn}};a.source!=null&&(s.source=a.source,i!=null&&(s.source=Qt.relative(i,s.source)),s.original={line:a.originalLine,column:a.originalColumn},a.name!=null&&(s.name=a.name)),o.addMapping(s)}),t.sources.forEach(function(a){var s=a;i!==null&&(s=Qt.relative(i,a)),o._sources.has(s)||o._sources.add(s);var c=t.sourceContentFor(a);c!=null&&o.setSourceContent(a,c)}),o};Nr.prototype.addMapping=function(t){var r=Qt.getArg(t,"generated"),i=Qt.getArg(t,"original",null),o=Qt.getArg(t,"source",null),a=Qt.getArg(t,"name",null);!this._skipValidation&&this._validateMapping(r,i,o,a)===!1||(o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:o,name:a}))};Nr.prototype.setSourceContent=function(t,r){var i=t;this._sourceRoot!=null&&(i=Qt.relative(this._sourceRoot,i)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Qt.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[Qt.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Nr.prototype.applySourceMap=function(t,r,i){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var a=this._sourceRoot;a!=null&&(o=Qt.relative(a,o));var s=new oy,c=new oy;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var l=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});l.source!=null&&(u.source=l.source,i!=null&&(u.source=Qt.join(i,u.source)),a!=null&&(u.source=Qt.relative(a,u.source)),u.originalLine=l.line,u.originalColumn=l.column,l.name!=null&&(u.name=l.name))}var d=u.source;d!=null&&!s.has(d)&&s.add(d);var p=u.name;p!=null&&!c.has(p)&&c.add(p)},this),this._sources=s,this._names=c,t.sources.forEach(function(u){var l=t.sourceContentFor(u);l!=null&&(i!=null&&(u=Qt.join(i,u)),a!=null&&(u=Qt.relative(a,u)),this.setSourceContent(u,l))},this)};Nr.prototype._validateMapping=function(t,r,i,o){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var a="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(a),!1;throw new Error(a)}if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!i&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&i)return;var a="Invalid mapping: "+JSON.stringify({generated:t,source:i,original:r,name:o});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(a),!1;throw new Error(a)}};Nr.prototype._serializeMappings=function(){for(var t=0,r=1,i=0,o=0,a=0,s=0,c="",u,l,d,p,h=this._mappings.toArray(),f=0,m=h.length;f<m;f++){if(l=h[f],u="",l.generatedLine!==r)for(t=0;l.generatedLine!==r;)u+=";",r++;else if(f>0){if(!Qt.compareByGeneratedPositionsInflated(l,h[f-1]))continue;u+=","}u+=yd.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),u+=yd.encode(p-s),s=p,u+=yd.encode(l.originalLine-1-o),o=l.originalLine-1,u+=yd.encode(l.originalColumn-i),i=l.originalColumn,l.name!=null&&(d=this._names.indexOf(l.name),u+=yd.encode(d-a),a=d)),c+=u}return c};Nr.prototype._generateSourcesContent=function(t,r){return t.map(function(i){if(!this._sourcesContents)return null;r!=null&&(i=Qt.relative(r,i));var o=Qt.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};Nr.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Nr.prototype.toString=function(){return JSON.stringify(this.toJSON())};lU.SourceMapGenerator=Nr});function fU(e){let t=new mU.SourceMapGenerator,r={line:1,column:0},i={line:0,column:0},o={line:1,column:0},a={generated:o},s=1,c=0,u=!1,l=e.node;e.node=function(h){if(h.loc&&h.loc.start&&pU.has(h.type)){let f=h.loc.start.line,m=h.loc.start.column-1;(i.line!==f||i.column!==m)&&(i.line=f,i.column=m,r.line=s,r.column=c,u&&(u=!1,(r.line!==o.line||r.column!==o.column)&&t.addMapping(a)),u=!0,t.addMapping({source:h.loc.source,original:i,generated:r}))}l.call(this,h),u&&pU.has(h.type)&&(o.line=s,o.column=c)};let d=e.emit;e.emit=function(h,f,m){for(let g=0;g<h.length;g++)h.charCodeAt(g)===10?(s++,c=0):c++;d(h,f,m)};let p=e.result;return e.result=function(){return u&&t.addMapping(a),{css:p(),map:t}},e}var mU,pU,hU=x(()=>{mU=i4(dU(),1),pU=new Set(["Atrule","Selector","Declaration"])});var ay={};Ie(ay,{safe:()=>$1,spec:()=>RY});function yU(e){let t=new Set(e.map(([r,i])=>D1(r)<<16|D1(i)));return function(r,i,o){let a=D1(i,o),s=o.charCodeAt(0),c=s===OY&&i!==1&&i!==2&&i!==15||s===PY?t.has((r&65534)<<16|s<<7):t.has((r&65534)<<16|a);return a|c}}var PY,OY,D1,gU,TY,RY,$1,bU=x(()=>{PY=43,OY=45,D1=(e,t)=>(e===9&&(e=t),typeof e=="string"&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),gU=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],TY=gU.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);RY=yU(gU),$1=yU(TY)});function DY(e,t){if(typeof t=="function"){let r=null;e.children.forEach(i=>{r!==null&&t.call(this,r),this.node(i),r=i});return}e.children.forEach(this.node,this)}function AU(e){let t=new Map;for(let[r,i]of Object.entries(e.node))typeof(i.generate||i)=="function"&&t.set(r,i.generate||i);return function(r,i){let o="",a=0,s={node(u){if(t.has(u.type))t.get(u.type).call(c,u);else throw new Error("Unknown node type: "+u.type)},tokenBefore:$1,token(u,l,d){a=this.tokenBefore(a,u,l),!d&&a&1&&this.emit(" ",13,!0),this.emit(l,u,!1),u===9&&l.charCodeAt(0)===NY&&this.emit(`
|
|
71
|
+
`,13,!0)},emit(u){o+=u},result(){return o}};i&&(typeof i.decorator=="function"&&(s=i.decorator(s)),i.sourceMap&&(s=fU(s)),i.mode in ay&&(s.tokenBefore=ay[i.mode]));let c={node:u=>s.node(u),children:DY,token:(u,l)=>s.token(u,l),tokenize:u=>tg(u,(l,d,p)=>{s.token(l,u.slice(d,p),d!==0)})};return s.node(r),s.result()}}var NY,xU=x(()=>{Ra();hU();bU();NY=92});var j1={};Ie(j1,{AnPlusB:()=>Dk,Atrule:()=>Lk,AtrulePrelude:()=>zk,AttributeSelector:()=>qk,Block:()=>Gk,Brackets:()=>Jk,CDC:()=>Xk,CDO:()=>nE,ClassSelector:()=>oE,Combinator:()=>cE,Comment:()=>dE,Condition:()=>fE,Declaration:()=>yE,DeclarationList:()=>SE,Dimension:()=>_E,Feature:()=>EE,FeatureFunction:()=>OE,FeatureRange:()=>DE,Function:()=>LE,GeneralEnclosed:()=>zE,Hash:()=>BE,IdSelector:()=>WE,Identifier:()=>HE,Layer:()=>YE,LayerList:()=>tC,MediaQuery:()=>iC,MediaQueryList:()=>sC,NestingSelector:()=>lC,Nth:()=>mC,Number:()=>gC,Operator:()=>AC,Parentheses:()=>vC,Percentage:()=>IC,PseudoClassSelector:()=>CC,PseudoElementSelector:()=>TC,Ratio:()=>DC,Raw:()=>LC,Rule:()=>zC,Scope:()=>BC,Selector:()=>HC,SelectorList:()=>WC,String:()=>e1,StyleSheet:()=>r1,SupportsDeclaration:()=>a1,TypeSelector:()=>l1,UnicodeRange:()=>f1,Url:()=>b1,Value:()=>S1,WhiteSpace:()=>_1});var SU=x(()=>{og();ag();sg();ug();lg();dg();pg();mg();fg();hg();gg();yg();bg();Ag();xg();Sg();vg();wg();_g();Ig();kg();Eg();Cg();Pg();Og();Tg();Rg();Ng();Dg();$g();jg();Lg();Mg();Fg();zg();Ug();Vg();Bg();qg();Zg();Hg();Kg();Wg();Jg();Qg();Xg();ey();ty();ny()});var vU,wU=x(()=>{SU();vU={node:j1}});var _U,IU=x(()=>{xU();wU();_U=AU(vU)});function kU(e){return typeof e=="function"?e:bd}function EU(e,t){return function(r,i,o){r.type===t&&e.call(this,r,i,o)}}function $Y(e,t){let r=t.structure,i=[];for(let o in r){if(L1.call(r,o)===!1)continue;let a=r[o],s={name:o,type:!1,nullable:!1};Array.isArray(a)||(a=[a]);for(let c of a)c===null?s.nullable=!0:typeof c=="string"?s.type="node":Array.isArray(c)&&(s.type="list");s.type&&i.push(s)}return i.length?{context:t.walkContext,fields:i}:null}function jY(e){let t={};for(let r in e.node)if(L1.call(e.node,r)){let i=e.node[r];if(!i.structure)throw new Error("Missed `structure` field in `"+r+"` node type definition");t[r]=$Y(r,i)}return t}function CU(e,t){let r=e.fields.slice(),i=e.context,o=typeof i=="string";return t&&r.reverse(),function(a,s,c,u){let l;o&&(l=s[i],s[i]=a);for(let d of r){let p=a[d.name];if(!d.nullable||p){if(d.type==="list"){if(t?p.reduceRight(u,!1):p.reduce(u,!1))return!0}else if(c(p))return!0}}o&&(s[i]=l)}}function PU({StyleSheet:e,Atrule:t,Rule:r,Block:i,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:r,Block:i},Rule:{StyleSheet:e,Atrule:t,Rule:r,Block:i},Declaration:{StyleSheet:e,Atrule:t,Rule:r,Block:i,DeclarationList:o}}}function OU(e){let t=jY(e),r={},i={},o=Symbol("break-walk"),a=Symbol("skip-node");for(let l in t)L1.call(t,l)&&t[l]!==null&&(r[l]=CU(t[l],!1),i[l]=CU(t[l],!0));let s=PU(r),c=PU(i),u=function(l,d){function p(C,w,E){let I=h.call(A,C,w,E);return I===o?!0:I===a?!1:!!(m.hasOwnProperty(C.type)&&m[C.type](C,A,p,g)||f.call(A,C,w,E)===o)}let h=bd,f=bd,m=r,g=(C,w,E,I)=>C||p(w,E,I),A={break:o,skip:a,root:l,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof d=="function")h=d;else if(d&&(h=kU(d.enter),f=kU(d.leave),d.reverse&&(m=i),d.visit)){if(s.hasOwnProperty(d.visit))m=d.reverse?c[d.visit]:s[d.visit];else if(!t.hasOwnProperty(d.visit))throw new Error("Bad value `"+d.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=EU(h,d.visit),f=EU(f,d.visit)}if(h===bd&&f===bd)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(l)};return u.break=o,u.skip=a,u.find=function(l,d){let p=null;return u(l,function(h,f,m){if(d.call(this,h,f,m))return p=h,o}),p},u.findLast=function(l,d){let p=null;return u(l,{reverse:!0,enter(h,f,m){if(d.call(this,h,f,m))return p=h,o}}),p},u.findAll=function(l,d){let p=[];return u(l,function(h,f,m){d.call(this,h,f,m)&&p.push(h)}),p},u}var L1,bd,TU=x(()=>{({hasOwnProperty:L1}=Object.prototype),bd=function(){}});var M1={};Ie(M1,{AnPlusB:()=>$k,Atrule:()=>Mk,AtrulePrelude:()=>Uk,AttributeSelector:()=>Zk,Block:()=>Kk,Brackets:()=>Qk,CDC:()=>eE,CDO:()=>rE,ClassSelector:()=>aE,Combinator:()=>uE,Comment:()=>pE,Condition:()=>hE,Declaration:()=>bE,DeclarationList:()=>vE,Dimension:()=>IE,Feature:()=>CE,FeatureFunction:()=>TE,FeatureRange:()=>$E,Function:()=>ME,GeneralEnclosed:()=>UE,Hash:()=>qE,IdSelector:()=>JE,Identifier:()=>GE,Layer:()=>XE,LayerList:()=>nC,MediaQuery:()=>oC,MediaQueryList:()=>cC,NestingSelector:()=>dC,Nth:()=>fC,Number:()=>yC,Operator:()=>xC,Parentheses:()=>wC,Percentage:()=>kC,PseudoClassSelector:()=>PC,PseudoElementSelector:()=>RC,Ratio:()=>$C,Raw:()=>MC,Rule:()=>UC,Scope:()=>qC,Selector:()=>GC,SelectorList:()=>JC,String:()=>t1,StyleSheet:()=>i1,SupportsDeclaration:()=>s1,TypeSelector:()=>d1,UnicodeRange:()=>h1,Url:()=>A1,Value:()=>v1,WhiteSpace:()=>I1});var RU=x(()=>{og();ag();sg();ug();lg();dg();pg();mg();fg();hg();gg();yg();bg();Ag();xg();Sg();vg();wg();_g();Ig();kg();Eg();Cg();Pg();Og();Tg();Rg();Ng();Dg();$g();jg();Lg();Mg();Fg();zg();Ug();Vg();Bg();qg();Zg();Hg();Kg();Wg();Jg();Qg();Xg();ey();ty();ny()});var NU,DU=x(()=>{RU();NU={node:M1}});var F1,$U=x(()=>{TU();DU();F1=OU(NU)});function jU(e){let t=0;return e.trim()&&F1(E1(e),()=>{t++}),t}function LU(e){if(!e.trim())return"";if(/[\\<]/.test(e))throw new Error("CSS \u6682\u4E0D\u652F\u6301\u53CD\u659C\u6760\u8F6C\u4E49\u6216 HTML \u6807\u7B7E\u3002");let t=E1(e,{onParseError:i=>{throw Object.assign(new Error("CSS \u683C\u5F0F\u4E0D\u6B63\u786E\u3002"),{offset:i.offset})}}),r=0;return F1(t,i=>{if(++r>5e3)throw new Error("CSS \u8FC7\u4E8E\u590D\u6742\u3002");if(i.type==="Raw"||i.type==="Url"||i.type==="Atrule"&&!["media","supports","keyframes"].includes(i.name.toLowerCase())||i.type==="Function"&&["image-set","-webkit-image-set","image","src","paint"].includes(i.name.toLowerCase()))throw new Error("CSS \u4E0D\u652F\u6301\u5916\u90E8\u8D44\u6E90\u3001\u5BFC\u5165\u6216\u672A\u77E5\u8BED\u6CD5\uFF1B\u56FE\u7247\u8BF7\u4F7F\u7528 HTML img \u6807\u7B7E\u3002")}),_U(t)}var MU=x(()=>{"use strict";Hz();IU();$U()});function LY(e){return LU(e)}function BU(e,t,r,i){if(!e.trim())return{html:"",elements:0};let o=Nf(e);if(o.length)throw new Error(o[0]);let a=Mh(r),s=a.sanitize(e,{ALLOWED_TAGS:["main","section","article","header","footer","div","span","p","h1","h2","h3","h4","strong","em","b","i","small","br","hr","ul","ol","li","button","img"],ALLOWED_ATTR:["class","alt","src","width","height","title","type","disabled","data-grow-action","aria-label"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1,ADD_URI_SAFE_ATTR:["data-grow-action"],ALLOWED_URI_REGEXP:/^https:\/\//i,RETURN_DOM:!0});if(!(s instanceof r.Element))throw new Error("\u65E0\u6CD5\u89E3\u6790 HTML\u3002");if(i){let l=new Set;for(let d of a.removed){let p="element"in d?d.element.nodeName.toLowerCase():void 0,h="attribute"in d?d.attribute?.name:void 0;if(!p&&!h)continue;let f=h?/<[^>]+>/g:new RegExp(`<\\s*${p}\\b[^>]*>`,"gi"),m=[...e.matchAll(f)].find(C=>!l.has(`${h??p}:${C.index}`)&&(!h||new RegExp(`\\b${h}\\s*=`,"i").test(C[0])));if(!m)continue;let g=m.index;l.add(`${h??p}:${g}`);let A=h==="style"?"\u5185\u8054\u6837\u5F0F\u4E0D\u4FDD\u7559\uFF0C\u8BF7\u5199\u5728 CSS \u4E2D\u3002":h?.startsWith("on")?"\u811A\u672C\u4E8B\u4EF6\u4E0D\u5141\u8BB8\uFF0C\u8BF7\u4F7F\u7528\u52A8\u4F5C\u6309\u94AE\u3002":h==="src"?"\u56FE\u7247\u53EA\u652F\u6301 https \u5730\u5740\u3002":"\u8FD9\u4E2A\u5C5E\u6027\u4E0D\u5728\u5141\u8BB8\u7684\u5E03\u5C40\u3001\u56FE\u7247\u4E0E\u52A8\u4F5C\u5C5E\u6027\u4E2D\u3002";i.push({language:"html",from:g,to:g+m[0].length,severity:"warning",message:h?`\u5DF2\u79FB\u9664\u5C5E\u6027 ${h}\uFF1A${A}`:`\u5DF2\u79FB\u9664 <${p}>\uFF1A\u8FD9\u4E2A\u6807\u7B7E\u4E0D\u5728\u5141\u8BB8\u7684\u6392\u7248\u6807\u7B7E\u4E2D\u3002`})}}let c=Nf(s.innerHTML);if(c.length)throw new Error(c[0]);let u=s.querySelectorAll("*").length;if(u>500)throw new Error("HTML \u6700\u591A\u652F\u6301 500 \u4E2A\u5143\u7D20\u3002");for(let l of s.querySelectorAll("[data-grow-action]")){let d=l.getAttribute("data-grow-action");if(l.tagName!=="BUTTON"||!t.includes(d))throw new Error(`\u81EA\u5B9A\u4E49 HTML \u91CC\u7684\u6309\u94AE ${d.slice(0,64)} \u6CA1\u6709\u5BF9\u5E94\u7684\u52A8\u4F5C\uFF0C\u8BF7\u5148\u5728\u300C\u70B9\u51FB\u52A8\u4F5C\u300D\u91CC\u6DFB\u52A0\uFF0C\u5E76\u4F7F\u7528 button \u5143\u7D20\u3002`)}if(!s.textContent?.trim()&&!s.querySelector("img"))throw new Error("\u81EA\u5B9A\u4E49 HTML \u6E05\u6D17\u540E\u6CA1\u6709\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002");return{html:s.innerHTML,elements:u}}function qU(e,t,r,i){let o=r.document;if(!o)throw new Error("A content document is required");let a=UU.get(r)??new Map;UU.set(r,a);let s=(l,d)=>{let p=a.get(l);if(p!==void 0)return p;let h=d();a.set(l,h);let f=[...a.keys()].reduce((m,g)=>m+g.length,0);for(;a.size>64||f>256e3;){let m=a.keys().next().value;a.delete(m),f-=m.length}return h},c=l=>{let d=i?.get(l);return d!==void 0&&t?d:s(`html:${l}`,()=>{if(d!==void 0)return d;let p=o.createElement("div");return p.innerHTML=l,p.querySelectorAll("*").length})},u=l=>s(`css:${l}`,()=>jU(l));for(let l of e.pages){let d=0,p=0,h=f=>{if(f.hidden||(f.type==="stack"&&f.children.forEach(h),f.type!=="custom_html"))return;let m=t?.nodes[f.id],g=[...Object.values(f.html),m?.base.html??"",...Object.values(m?.byPlan??{}).map(A=>A.html??"")];if(d+=Math.max(0,...g.map(c)),p+=u(f.css),d>FU)throw new Error(`Page custom HTML exceeds ${FU} elements`);if(p>zU)throw new Error(`Page custom CSS exceeds ${zU} syntax nodes`)};h(l.root)}}function MY(e,t,r){let i=z1.get(t);i||z1.set(t,i=new WeakMap);let o=JSON.stringify(r),a=i.get(e);return(!a||a.actions!==o)&&(a={actions:o,entries:new Map,characters:0},i.set(e,a)),a}function ZU(e){let t={};return{prepare:(r,i)=>FY(r,i,e,t),destroy:()=>z1.get(e)?.delete(t)}}function FY(e,t,r,i=t){if(!e)return;let o={},a=t.actions.map(d=>d.id),s=MY(i,r,a),c=new Map,u=Date.now();for(let[d,p]of s.entries)p.expires>u||(s.entries.delete(d),s.characters-=d.length+p.html.length);for(let[d,p]of Object.entries(e.nodes)){let h,f=m=>{if(m.html===void 0)return m;if(h??=Pn(t,d)?.type==="custom_html",!h)throw new Error("HTML \u5546\u54C1\u6570\u636E\u53EA\u80FD\u7528\u4E8E\u81EA\u5B9A\u4E49 HTML \u7EC4\u4EF6");let g=s.entries.get(m.html);if(g)s.entries.delete(m.html),s.entries.set(m.html,g);else{let{html:A,elements:C}=BU(m.html,a,r);g={html:A,elements:C,expires:u+6e4};let w=m.html.length+A.length;if(w<=1e6)for(s.entries.set(m.html,g),s.characters+=w;s.entries.size>128||s.characters>1e6;){let[E,I]=s.entries.entries().next().value;s.entries.delete(E),s.characters-=E.length+I.html.length}}return c.set(g.html,g.elements),{...m,html:g.html}};o[d]={...p,base:f(p.base),...p.byPlan?{byPlan:Object.fromEntries(Object.entries(p.byPlan).map(([m,g])=>[m,f(g)]))}:{}}}let l={...e,nodes:o};return qU(t,l,r,c),l}function HU(e,t){let r=un.parse(e),i=JSON.stringify(r),o=VU.get(t);o||(o=new Map,VU.set(t,o));let a=Date.now();for(let[w,E]of o)E.expires<=a&&o.delete(w);let s=o.get(i);if(s)return o.delete(i),o.set(i,s),JSON.parse(s.json);let c=r.actions.map(w=>w.id),u=new Map,l=new Map,d=new Map,p=w=>{let E=u.get(w);if(E===void 0){let I=BU(w,c,t);E=I.html,l.set(E,I.elements),u.set(w,E)}return E},h=w=>{if(w.type==="stack")return{...w,children:w.children.map(h)};if(w.type!=="custom_html")return w;let E={};for(let[F,L]of Object.entries(w.html))E[F]=p(L);let I=d.get(w.css);return I===void 0&&(I=LY(w.css),d.set(w.css,I)),{...w,html:E,css:I}},f={...r,pages:r.pages.map(w=>({...w,root:h(w.root)}))};qU(f,void 0,t,l);let m=JSON.stringify(f),g=new TextEncoder,A=g.encode(m).length;if(A>fn.documentBytes)throw new Error(`\u754C\u9762\u5185\u5BB9\u8FC7\u5927\uFF08\u4E0A\u9650 ${fn.documentBytes/1e3} KB\uFF09\u3002`);let C=g.encode(i).length;if(C<=fn.documentBytes){o.set(i,{json:m,bytes:C+A,expires:a+6e4});let w=[...o.values()].reduce((E,I)=>E+I.bytes,0);for(;o.size>16||w>2*1024*1024;){let[E,I]=o.entries().next().value;o.delete(E),w-=I.bytes}}return f}var FU,zU,UU,z1,VU,GU=x(()=>{"use strict";fk();MU();ik();FU=2e3,zU=1e4,UU=new WeakMap;z1=new WeakMap;VU=new WeakMap});function zY(e){function t(y){return y.type==="stack"&&y.interaction?.type==="select"&&y.interaction.purpose==="product"&&!!y.interaction.pickerId}function r(y){let S={};function b(_){if(t(_)){let P=S[_.interaction.pickerId]??={ids:[],defaultId:null};for(let k of _.children){let W=k.type==="stack"?k.bind?.plan:void 0;W&&!P.ids.includes(W)&&P.ids.push(W)}let T=_.children[_.interaction.defaultIndex];!P.defaultId&&T?.type==="stack"&&(P.defaultId=T.bind?.plan??null)}_.type==="stack"&&_.children.forEach(b)}return y.pages.forEach(_=>b(_.root)),S}function i(y,S,b){let _={};function P(G){if(G.hidden)return;if(G.type==="plan_picker"){let Z=b.pickers[G.id];_[G.id]={ids:Z?.options??[],defaults:Z?.selected?[Z.selected]:[],remembered:[]};return}if(G.type!=="stack")return;let se=G.children.filter(Z=>!Z.hidden),fe=G.interaction;if(t(G)){let Z=_[G.interaction.pickerId]??={ids:[],defaults:[],remembered:[]},ie=b.pickers[G.interaction.pickerId]?.options??[];for(let ge of se){let Me=ge.type==="stack"?ge.bind?.plan:void 0;Me&&ie.includes(Me)&&!Z.ids.includes(Me)&&Z.ids.push(Me),Me&&ge.id===S[G.id]&&Z.remembered.push(Me)}let oe=G.children[G.interaction.defaultIndex];oe?.type==="stack"&&!oe.hidden&&oe.bind?.plan&&Z.defaults.push(oe.bind.plan)}if(fe?.type==="tabs"){let Z=se.find(ie=>ie.id===S[G.id])??G.children[fe.defaultIndex];Z&&P(Z)}else if(fe?.type==="toggle"){let Z=typeof S[G.id]=="boolean"?S[G.id]:fe.defaultEnabled,ie=G.children[Z?0:1];ie&&P(ie)}else se.forEach(P)}let T=typeof S.__page=="string"?S.__page:y.initialPageId??y.pages[0]?.id,k=y.pages.find(G=>G.id===T);k&&P(k.root);let W={};for(let[G,se]of Object.entries(_)){let fe=S[G],Z=se.remembered[0]??(se.ids.includes(b.pickers[G]?.selected??"")?b.pickers[G]?.selected:se.defaults[0]);W[G]=typeof fe=="string"?se.ids.includes(fe)?fe:"":Z&&se.ids.includes(Z)?Z:""}for(let G of Object.keys(r(y)))W[G]??="";return W}let o=window;for(let y=0;y<e.hostDepth;y++)o=o.parent;let a=window,s={none:0,xs:4,sm:8,md:12,lg:20,xl:32},c={none:0,sm:4,md:8,lg:14,full:9999},u={system:'system-ui,-apple-system,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif',serif:'Georgia,"Times New Roman","Songti SC","Noto Serif CJK SC",serif',rounded:'ui-rounded,"SF Pro Rounded","Hiragino Maru Gothic ProN",system-ui,sans-serif',mono:"ui-monospace,SFMono-Regular,Menlo,Consolas,monospace"},l={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"},d={start:"flex-start",center:"center",end:"flex-end",between:"space-between"},p={start:"start",center:"center",end:"end",between:"stretch"},h={start:"start",center:"center",end:"end",stretch:"stretch"},f={"1:1":"1 / 1","4:3":"4 / 3","16:9":"16 / 9","3:1":"3 / 1"},m=`
|
|
72
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
73
|
+
html,body{margin:0;padding:0;background:transparent}
|
|
74
|
+
body{font-family:var(--g-font);color:var(--g-text);-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
|
|
75
|
+
#g-card{background:var(--g-bg);min-height:1px}
|
|
76
|
+
#g-card[data-g-presentation=fullscreen]{min-height:100vh;display:flex;flex-direction:column}
|
|
77
|
+
#g-card[data-g-presentation=fullscreen]>[data-g-node]{flex:1 0 auto}
|
|
78
|
+
[hidden]{display:none!important}
|
|
79
|
+
.g-stack{display:flex;min-width:0}
|
|
80
|
+
.g-empty{min-height:48px;outline:1px dashed #c9cfee;outline-offset:-1px;background:#eef0fa44}
|
|
81
|
+
.g-empty::after{content:attr(data-g-editor-placeholder);font-size:12px;color:#737b8e;align-self:center;margin:auto;pointer-events:none}
|
|
82
|
+
.g-v{flex-direction:column}
|
|
83
|
+
.g-h{flex-direction:row;flex-wrap:wrap}
|
|
84
|
+
.g-o{display:grid;grid-template-columns:minmax(0,1fr)}
|
|
85
|
+
/* Each authored overlay layer paints as a unit in document order. */
|
|
86
|
+
.g-o>*{grid-area:1/1;min-width:0;isolation:isolate}
|
|
87
|
+
.g-text{margin:0;white-space:pre-line;overflow-wrap:anywhere;min-width:0}
|
|
88
|
+
.g-title{font-size:26px;line-height:1.2;font-weight:700;letter-spacing:-.01em}
|
|
89
|
+
.g-heading{font-size:20px;line-height:1.3;font-weight:650}
|
|
90
|
+
.g-body{font-size:15px;line-height:1.6}
|
|
91
|
+
.g-caption{font-size:12px;line-height:1.5;letter-spacing:.02em}
|
|
92
|
+
.g-btn{appearance:none;border:0;margin:0;font:inherit;font-size:15px;font-weight:600;line-height:1.25;padding:12px 18px;border-radius:var(--g-radius);cursor:pointer;min-height:44px;text-align:center;overflow-wrap:anywhere}
|
|
93
|
+
.g-btn-primary{background:var(--g-primary);color:var(--g-on-primary)}
|
|
94
|
+
.g-btn.g-stack .g-text{color:inherit}
|
|
95
|
+
.g-btn-primary:hover{filter:brightness(1.06)}
|
|
96
|
+
.g-btn-secondary{background:transparent;color:var(--g-text);box-shadow:inset 0 0 0 1px var(--g-border)}
|
|
97
|
+
.g-btn-secondary:hover{background:var(--g-surface)}
|
|
98
|
+
.g-btn-link{background:transparent;color:var(--g-muted);padding:8px 12px;min-height:36px;font-weight:500}
|
|
99
|
+
.g-btn-link:hover{color:var(--g-text)}
|
|
100
|
+
.g-btn:focus-visible{outline:3px solid var(--g-focus);outline-offset:2px}
|
|
101
|
+
.g-img{display:block;width:100%;overflow:hidden}
|
|
102
|
+
.g-img img{display:block;width:100%;height:auto}
|
|
103
|
+
.g-img[data-aspect] img{height:100%}
|
|
104
|
+
.g-divider{border:0;border-top:1px solid var(--g-border);margin:0;align-self:stretch}
|
|
105
|
+
.g-custom{display:block;min-width:0}
|
|
106
|
+
.g-missing{opacity:.45}
|
|
107
|
+
.g-box{position:absolute;pointer-events:none;z-index:2147483646;border:1px solid var(--g-edit);border-radius:2px;display:none}
|
|
108
|
+
.g-box[data-kind=select]{border-width:2px}
|
|
109
|
+
.g-box span{position:absolute;left:-2px;bottom:100%;margin-bottom:2px;padding:1px 6px;font:500 11px/16px system-ui,sans-serif;color:#fff;background:var(--g-edit);border-radius:3px;white-space:nowrap;max-width:240px;overflow:hidden;text-overflow:ellipsis}
|
|
110
|
+
.g-box[data-below] span{bottom:auto;top:100%;margin:2px 0 0}
|
|
111
|
+
[data-g-editor] .g-btn{cursor:default}
|
|
112
|
+
.g-data{--g-data-ink:var(--g-text);--g-data-muted:var(--g-muted);--g-data-line:var(--g-border);--g-data-surface:var(--g-surface);width:100%;min-width:0;color:var(--g-data-ink);font-variant-numeric:tabular-nums;container-type:inline-size;container-name:customer-data}
|
|
113
|
+
.g-data-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
|
|
114
|
+
.g-data-heading{display:flex;align-items:center;gap:10px;font-size:18px;line-height:1.35;font-weight:600;margin:0;letter-spacing:-.025em}
|
|
115
|
+
.g-data-icon{display:block;width:18px;height:18px;flex:none}
|
|
116
|
+
.g-data-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
|
|
117
|
+
.g-data-button,.g-data-select{font:500 13px/1.4 var(--g-font);color:var(--g-data-ink);background:transparent;border:1px solid color-mix(in srgb,var(--g-data-ink) 52%,transparent);border-radius:6px;min-height:36px;padding:7px 10px;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
|
|
118
|
+
.g-data-button:hover{background:var(--g-data-surface)}
|
|
119
|
+
.g-data-button:focus-visible,.g-data-select:focus-visible,.g-data-sources>summary:focus-visible{outline:3px solid var(--g-data-ink);outline-offset:3px}
|
|
120
|
+
.g-data-button:disabled,.g-data-select:disabled{opacity:.4;cursor:default}
|
|
121
|
+
.g-data-refresh{border-color:transparent;width:32px;min-height:32px;display:grid;place-items:center;padding:6px;color:var(--g-data-muted)}
|
|
122
|
+
.g-data-refresh:hover{color:var(--g-data-ink)}
|
|
123
|
+
.g-data-refreshing .g-data-icon{animation:g-data-spin 1.2s linear infinite}
|
|
124
|
+
@keyframes g-data-spin{to{transform:rotate(360deg)}}
|
|
125
|
+
.g-data-buy{background:var(--g-primary);color:var(--g-on-primary);border-color:transparent;min-height:40px;font-size:13px;font-weight:600}
|
|
126
|
+
.g-data-buy:hover{background:var(--g-primary);filter:brightness(.95);transform:translateY(-1px)}
|
|
127
|
+
.g-data[data-preview=true] .g-data-buy:disabled{opacity:.8}
|
|
128
|
+
.g-data-note{font-size:13px;line-height:1.6;color:var(--g-data-muted);margin:12px 0;overflow-wrap:anywhere}
|
|
129
|
+
.g-data-error{padding:12px 0;border-block:1px solid var(--g-data-line);color:var(--g-data-ink);font-size:13px;line-height:1.6}
|
|
130
|
+
.g-data-resource+.g-data-resource{border-top:1px solid var(--g-data-line);padding-top:24px;margin-top:24px}
|
|
131
|
+
.g-data-name{font-size:12px;color:var(--g-data-muted);font-weight:500;margin:0 0 10px}
|
|
132
|
+
.g-data-balance{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:18px}
|
|
133
|
+
.g-data-number{font-family:var(--g-data-number-font,var(--g-font));font-size:var(--g-data-number-size,clamp(44px,7vw,72px));font-weight:var(--g-data-number-weight,500);line-height:1.08;letter-spacing:-.055em;overflow-wrap:anywhere;max-width:100%}
|
|
134
|
+
.g-data-fraction{font-size:22px;letter-spacing:-.025em;color:var(--g-data-muted)}
|
|
135
|
+
.g-data-unit{font-size:13px;color:var(--g-data-muted)}
|
|
136
|
+
.g-data-facts{display:flex;gap:24px;flex-wrap:wrap;font-size:13px;line-height:1.6;color:var(--g-data-muted)}
|
|
137
|
+
.g-data-facts strong{font-weight:600;color:var(--g-data-ink);margin-inline-start:6px}
|
|
138
|
+
.g-data-expiry{margin-inline-start:auto;font-size:12px}
|
|
139
|
+
.g-data-resource-label{font-size:12px;letter-spacing:0;color:var(--g-data-muted);padding-inline-start:10px;border-inline-start:1px solid var(--g-data-line);font-weight:400}
|
|
140
|
+
.g-data-sources{margin-top:20px;border-top:1px solid var(--g-data-line);padding-top:12px}
|
|
141
|
+
.g-data-sources>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;font-weight:500;cursor:pointer;line-height:1.5;list-style:none;border-radius:3px;padding:6px 0}
|
|
142
|
+
.g-data-sources>summary::-webkit-details-marker{display:none}
|
|
143
|
+
.g-data-sources>summary>.g-data-icon{width:16px;height:16px;transition:transform .18s}
|
|
144
|
+
.g-data-sources[open]>summary>.g-data-icon{transform:rotate(180deg)}
|
|
145
|
+
.g-data-sources[open]>.g-data-list{animation:g-data-reveal .18s ease-out}
|
|
146
|
+
@keyframes g-data-reveal{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}
|
|
147
|
+
.g-data-list{list-style:none;padding:0;margin:0;border-top:1px solid var(--g-data-line)}
|
|
148
|
+
.g-data-row{display:grid;grid-template-columns:minmax(120px,1.5fr) minmax(80px,.75fr) minmax(90px,1fr);column-gap:20px;row-gap:10px;align-items:start;padding:18px 0;border-bottom:1px solid var(--g-data-line);min-width:0}
|
|
149
|
+
.g-data-row-no-value,.g-data-row-no-status{grid-template-columns:minmax(0,1fr) auto;column-gap:16px}
|
|
150
|
+
.g-data-row-no-value .g-data-row-status{text-align:end}
|
|
151
|
+
.g-data-row-main{display:flex;align-items:flex-start;gap:12px;min-width:0}
|
|
152
|
+
.g-data-row-copy{min-width:0}
|
|
153
|
+
.g-data-row-mark{display:grid;place-items:center;width:34px;height:34px;flex:none;background:var(--g-data-surface);color:var(--g-data-muted);border:1px solid var(--g-data-line);border-radius:50%}
|
|
154
|
+
.g-data-row-mark .g-data-icon{width:16px;height:16px}
|
|
155
|
+
.g-data-row-label{font-size:15px;font-weight:600;line-height:1.5;overflow-wrap:anywhere;margin:0}
|
|
156
|
+
.g-data-row-detail{font-size:13px;line-height:1.65;color:var(--g-data-muted);margin-top:4px;overflow-wrap:anywhere}
|
|
157
|
+
.g-data-row-status{font-size:12px;line-height:1.6;color:var(--g-data-muted);padding:4px 8px;border-radius:4px;background:var(--g-data-surface);width:fit-content;justify-self:end;overflow-wrap:anywhere}
|
|
158
|
+
.g-data-row-value{font-size:15px;font-weight:650;text-align:end;line-height:1.5;overflow-wrap:anywhere}
|
|
159
|
+
.g-data-row-extra{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
|
|
160
|
+
.g-data-footer{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;font-size:12px;color:var(--g-data-muted)}
|
|
161
|
+
.g-data-empty{display:flex;align-items:center;gap:10px;padding:28px 0;border-block:1px solid var(--g-data-line);font-size:13px;line-height:1.6;color:var(--g-data-muted)}
|
|
162
|
+
.g-data-empty>.g-data-icon{width:20px;height:20px;opacity:.65}
|
|
163
|
+
.g-data-skeleton{padding-block:8px;animation:g-data-reveal .18s ease-out}
|
|
164
|
+
.g-data-skeleton-line{display:block;background:var(--g-data-line);border-radius:4px;animation:g-data-pulse 1.4s ease-in-out infinite}
|
|
165
|
+
.g-data-skeleton-value{width:42%;height:var(--g-data-number-size,64px);margin:4px 0 22px}
|
|
166
|
+
.g-data-skeleton-meta{width:65%;height:12px;margin-bottom:20px}
|
|
167
|
+
.g-data-skeleton-row{display:flex;justify-content:space-between;gap:24px;padding:20px 0;border-block-end:1px solid var(--g-data-line)}
|
|
168
|
+
.g-data-skeleton-row>.g-data-skeleton-line:first-child{width:52%;height:14px}
|
|
169
|
+
.g-data-skeleton-row>.g-data-skeleton-line:last-child{width:18%;height:14px}
|
|
170
|
+
.g-data[data-layout=compact] .g-data-skeleton-value{height:var(--g-data-number-size,34px);margin-bottom:16px}
|
|
171
|
+
.g-data-recovery{margin:12px 0}
|
|
172
|
+
.g-data-live-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
173
|
+
@keyframes g-data-pulse{50%{opacity:.4}}
|
|
174
|
+
.g-data-updated{font-size:11px;margin-bottom:0}
|
|
175
|
+
.g-data-preview{font-size:11px;color:var(--g-data-muted);border:1px solid var(--g-data-line);border-radius:4px;padding:3px 6px;white-space:nowrap}
|
|
176
|
+
.g-data[data-source=credit_balance] .g-data-heading{font-size:15px;font-weight:500;letter-spacing:0}
|
|
177
|
+
.g-data[data-source=credit_balance] .g-data-header{margin-bottom:18px}
|
|
178
|
+
.g-data[data-source=credit_balance] .g-data-updated{margin:0;font-size:11px;color:var(--g-data-muted)}
|
|
179
|
+
.g-data[data-source=credit_balance] .g-data-sources>summary{max-width:100%}
|
|
180
|
+
.g-data-table-head{display:grid;grid-template-columns:minmax(0,1fr) 92px minmax(120px,.45fr);gap:16px;padding:10px 0;font-size:12px;color:var(--g-data-muted);border-block:1px solid var(--g-data-line)}
|
|
181
|
+
.g-data-table-head>span:not(:first-child){text-align:end}
|
|
182
|
+
.g-data[data-source=credit_transactions] .g-data-list{border-top:0}
|
|
183
|
+
.g-data[data-source=credit_transactions] .g-data-row{grid-template-columns:minmax(0,1fr) 92px minmax(120px,.45fr);gap:16px;padding:18px 0;align-items:center;transition:background .15s}
|
|
184
|
+
.g-data[data-source=credit_transactions] .g-data-row:hover{background:var(--g-data-surface)}
|
|
185
|
+
.g-data[data-source=credit_transactions] .g-data-row-status{grid-column:2;grid-row:1}
|
|
186
|
+
.g-data[data-source=credit_transactions] .g-data-row-extra{grid-column:3;grid-row:1;justify-content:flex-end}
|
|
187
|
+
.g-data[data-source=credit_transactions] .g-data-facts{flex-direction:column;align-items:flex-end;gap:8px}
|
|
188
|
+
.g-data[data-source=credit_transactions] .g-data-facts>span{display:flex;flex-direction:column-reverse;align-items:flex-end;font-size:12px}
|
|
189
|
+
.g-data[data-source=credit_transactions] .g-data-facts strong{font-size:15px;margin-inline-start:0;font-weight:600}
|
|
190
|
+
.g-data[data-source=credit_packs] .g-data-row{border:0;padding:16px 0;grid-template-columns:minmax(0,1fr) auto}
|
|
191
|
+
.g-data[data-source=credit_packs] .g-data-list{border:0}
|
|
192
|
+
.g-data[data-source=credit_packs] .g-data-row+.g-data-row{border-top:1px solid var(--g-data-line)}
|
|
193
|
+
.g-data[data-source=credit_packs] .g-data-row-value{font-size:22px;letter-spacing:-.04em}
|
|
194
|
+
.g-data[data-source=credit_packs] .g-data-row-extra{display:block}
|
|
195
|
+
.g-data[data-source=credit_packs] .g-data-buy{width:100%;margin-top:2px}
|
|
196
|
+
.g-data[data-source=credit_packs] .g-data-header{margin-bottom:4px}
|
|
197
|
+
.g-data[data-layout=compact] .g-data-header{margin-bottom:10px}
|
|
198
|
+
.g-data[data-layout=compact] .g-data-heading{font-size:14px;color:var(--g-data-muted);letter-spacing:0;font-weight:500}
|
|
199
|
+
.g-data[data-layout=compact] .g-data-number{font-size:var(--g-data-number-size,34px)}
|
|
200
|
+
.g-data[data-layout=compact] .g-data-row{padding:10px 0;column-gap:12px}
|
|
201
|
+
.g-data[data-layout=compact] .g-data-row{grid-template-columns:minmax(0,1fr) auto}
|
|
202
|
+
.g-data[data-layout=compact] .g-data-row-status{grid-column:1;grid-row:2;justify-self:start}
|
|
203
|
+
.g-data[data-layout=compact] .g-data-row-value{grid-column:2;grid-row:1}
|
|
204
|
+
.g-data[data-layout=compact] .g-data-updated{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
205
|
+
.g-data[data-source=credit_transactions][data-layout=compact] .g-data-table-head{display:none}
|
|
206
|
+
.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row{grid-template-columns:minmax(0,1fr) 92px minmax(120px,.45fr);gap:16px;padding:14px 0}
|
|
207
|
+
.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-status{grid-column:2;grid-row:1}
|
|
208
|
+
.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-extra{grid-column:3;grid-row:1;justify-content:flex-end}
|
|
209
|
+
.g-data[data-source=membership][data-layout=compact] .g-data-list{border:0}
|
|
210
|
+
.g-data[data-source=membership][data-layout=compact] .g-data-row{padding:0;border:0}
|
|
211
|
+
.g-data[data-source=membership][data-layout=compact] .g-data-row-status{grid-column:2;grid-row:1;justify-self:end}
|
|
212
|
+
.g-data[data-source=membership][data-layout=compact] .g-data-header{margin-bottom:6px}
|
|
213
|
+
.g-data[data-source=membership][data-layout=full] .g-data-heading{font-size:14px;font-weight:500;color:var(--g-data-muted)}
|
|
214
|
+
.g-data[data-source=membership][data-layout=full] .g-data-list{border-top:0}
|
|
215
|
+
.g-data[data-source=membership][data-layout=full] .g-data-row{padding:12px 0 22px;column-gap:24px}
|
|
216
|
+
.g-data[data-source=membership][data-layout=full] .g-data-row-label{font-family:var(--g-data-display-font,var(--g-font));font-size:var(--g-data-display-size,30px);font-weight:var(--g-data-display-weight,600);letter-spacing:-.035em;line-height:1.25}
|
|
217
|
+
.g-data[data-source=membership][data-layout=full] .g-data-row-detail{font-size:13px;margin-top:12px}
|
|
218
|
+
.g-data[data-source=membership][data-layout=full] .g-data-row-status{font-size:12px;padding:5px 9px}
|
|
219
|
+
.g-data[data-source=customer_plans][data-layout=full] .g-data-row{padding:24px 0;grid-template-columns:minmax(0,1fr) 140px 180px;gap:24px;align-items:center}
|
|
220
|
+
.g-data[data-source=customer_plans][data-layout=full] .g-data-row-label{font-family:var(--g-data-display-font,var(--g-font));font-size:22px;font-weight:600}
|
|
221
|
+
.g-data[data-source=customer_plans][data-layout=full] .g-data-row-value{font-size:24px;font-weight:500;letter-spacing:-.035em}
|
|
222
|
+
.g-data[data-source=customer_plans][data-layout=full] .g-data-row-status{font-size:12px;padding:5px 9px}
|
|
223
|
+
@container customer-data (min-width:600px){
|
|
224
|
+
.g-data[data-source=credit_packs][data-layout=full]>.g-data-list,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:24px;border:0}
|
|
225
|
+
.g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr;gap:20px;padding:24px;border:1px solid var(--g-data-line);border-radius:14px;align-items:start;align-content:start;transition:border-color .16s,background .16s}
|
|
226
|
+
.g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row:hover{border-color:var(--g-data-ink);background:var(--g-data-surface)}
|
|
227
|
+
.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row{padding:24px 0;border:0;border-top:1px solid var(--g-data-ink);border-radius:0}
|
|
228
|
+
.g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-main,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-main{grid-column:1;grid-row:1}
|
|
229
|
+
.g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-value,.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-value{grid-column:1;grid-row:2;text-align:start;font-size:30px;line-height:1.3;letter-spacing:-.035em;font-weight:500}
|
|
230
|
+
.g-data[data-source=credit_packs][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-extra{grid-column:1;grid-row:3;align-self:end}
|
|
231
|
+
.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-status{grid-column:1;grid-row:3;justify-self:start;align-self:end}
|
|
232
|
+
.g-data[data-source=customer_plans][data-layout=full]>.g-data-list>.g-data-row>.g-data-row-extra{grid-column:1;grid-row:auto}
|
|
233
|
+
.g-data[data-source=credit_packs][data-layout=full] .g-data-header,.g-data[data-source=customer_plans][data-layout=full] .g-data-header{margin-bottom:20px}
|
|
234
|
+
.g-data[data-source=credit_packs][data-layout=full] .g-data-buy{min-height:44px;border-radius:8px}
|
|
235
|
+
}
|
|
236
|
+
@media(max-width:560px){.g-data[data-source=customer_plans][data-layout=full] .g-data-row{grid-template-columns:minmax(0,1fr) auto;gap:12px}.g-data[data-source=customer_plans][data-layout=full] .g-data-row-value{font-size:20px}.g-data[data-source=membership][data-layout=full] .g-data-row-label{font-size:var(--g-data-display-size,24px)}}
|
|
237
|
+
@media(max-width:560px){.g-data-header{gap:10px}.g-data-controls{gap:6px}.g-data-row{grid-template-columns:minmax(0,1fr) auto;column-gap:12px}.g-data-row-status{grid-column:1;grid-row:2}.g-data-row-value{grid-column:2;grid-row:1}.g-data-row-extra{grid-column:1/-1}.g-data-facts{gap:12px}.g-data-button,.g-data-select{min-height:40px;padding:8px 10px}.g-data-refresh{width:40px;padding:10px}.g-data-sources>summary{min-height:36px}.g-data-table-head{display:none}.g-data[data-source=credit_transactions] .g-data-row{grid-template-columns:minmax(0,1fr) minmax(95px,.45fr);gap:12px}.g-data[data-source=credit_transactions] .g-data-row-status{grid-column:1;grid-row:2;margin-inline-start:46px;justify-self:start}.g-data[data-source=credit_transactions] .g-data-row-extra{grid-column:2;grid-row:1/3}.g-data[data-source=membership][data-layout=compact] .g-data-row-status{grid-column:2;grid-row:1}}
|
|
238
|
+
@media(max-width:560px){.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row{grid-template-columns:minmax(0,1fr) minmax(95px,.45fr);gap:12px}.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-status{grid-column:1;grid-row:2;margin-inline-start:46px;justify-self:start}.g-data[data-source=credit_transactions][data-layout=compact] .g-data-row-extra{grid-column:2;grid-row:1/3}}
|
|
239
|
+
@media(max-width:560px){.g-data[data-source=membership] .g-data-row-no-value .g-data-row-status{grid-column:2;grid-row:1;align-self:start;justify-self:end}}
|
|
240
|
+
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
|
|
241
|
+
`;function g(){return Object.create(null)}let A=null,C,w=new Set,E,I,F=new Map,L=new Map,q=new Map,H=new Map,X=0,M=new Map,J=new WeakMap,$=0,D=0,U,Q=null,N=g(),O=g(),z=g(),V="",de=!1,je=-1,Ge=!1,Pe="",pt=null,Ve=null,ot=null,qe=document.createElement("div");qe.id="g-card";let wt=document.createElement("div"),Kt=document.createElement("div");wt.className=Kt.className="g-box",Kt.dataset.kind="select",wt.append(document.createElement("span")),Kt.append(document.createElement("span"));function tt(y){let S={...y,channel:e.channel};try{o.postMessage(S,e.parentOrigin)}catch{}}function Sr(y){let S=parseInt(y.slice(1),16);return[S>>16&255,S>>8&255,S&255]}function be(y,S,b){let _=Sr(y),P=Sr(S),T=_.map((k,W)=>Math.round(k*b+P[W]*(1-b)));return`rgb(${T[0]},${T[1]},${T[2]})`}function he(y){let[S,b,_]=Sr(y).map(P=>{let T=P/255;return T<=.03928?T/12.92:((T+.055)/1.055)**2.4});return .2126*S+.7152*b+.0722*_}function Se(y){return typeof y!="string"?"":y.startsWith("#")?y:`var(--g-${y==="background"?"bg":y})`}function me(y){let S=y.theme,b=document.documentElement.style,_=he(S.primary),P=(_+.05)/.05>1.05/(_+.05)?"#111318":"#FFFFFF";b.setProperty("--g-primary",S.primary),b.setProperty("--g-on-primary",P),b.setProperty("--g-bg",S.background),b.setProperty("--g-text",S.text),b.setProperty("--g-muted",be(S.text,S.background,.62)),b.setProperty("--g-surface",be(S.text,S.background,.05)),b.setProperty("--g-border",be(S.text,S.background,.16)),b.setProperty("--g-focus",be(S.primary,S.background,.45)),b.setProperty("--g-radius",`${c[S.radius]??8}px`),b.setProperty("--g-font",u[S.font]??u.system),b.setProperty("--g-edit","#2C3C96")}function _e(y){let S=A?.strings.locales[V]?.[y];return S&&S.trim()?{value:S,missing:!1}:{value:A?.strings.locales[A.strings.defaultLocale]?.[y]??"",missing:!0}}function Ee(y){let S=E?.nodes[y];if(!S)return;let b=S.picker?N[S.picker]??E?.pickers[S.picker]?.selected:void 0;if(!(S.picker&&typeof b=="string"&&!E?.pickers[S.picker]?.options.includes(b)))return typeof b=="string"?S.byPlan?.[b]??S.base:S.base}function Ue(){return{...A?.surface==="paywall"&&Q?{__page:Q}:{},...Object.fromEntries(Object.entries(N).filter(y=>!Array.isArray(y[1])))}}function Y(y){return C&&Object.hasOwn(C.answers,y)&&C.bindings.some(S=>S.variable===y)?C.answers[y]:C?.values?.[y]}function Re(y){let S=H.get(y);if(S)return S;let b=[...new Set([...y.matchAll(/\{\{\s*variables\.([^{}]+?)\s*\}\}/g)].map(_=>_[1].trim()))];if(y.length<=1e6)for(H.set(y,b),X+=y.length;H.size>128||X>1e6;){let _=H.keys().next().value;H.delete(_),X-=_.length}return b}function Je(y){let S=y.html[V];return Ee(y.id)?.html??E?.nodes[y.id]?.base.html??(S&&S.trim()?S:y.html[A?.strings.defaultLocale??""]??"")}function Le(){H.clear(),X=0;let y=[],S=[],b=W=>{if(!W.hidden){if(W.type==="stack")W.children.forEach(b);else if(W.type==="custom_html"){y.push(Je(W));let G=E?.nodes[W.id];for(let se of[G?.base,...Object.values(G?.byPlan??{})])se?.html!==void 0&&S.push(se.html)}}},_=Q??A?.initialPageId,P=A?.pages??[],T=new Set;for(let W of[...P.filter(G=>G.id===_),...P.filter(G=>G.id!==_)]){y.length=S.length=0,b(W.root);for(let G of[...y,...S])T.add(G)}let k=new Set([...T].map(ct));for(let[W,G]of M)k.has(W)||lt(W,G);for(let W of T)Re(W),!M.has(ct(W))&&(M.size>=32||D+500>4e3||$+W.length+2>262144||In(W,!0))}function ct(y){return(e.mode==="live"&&C?"b:":"s:")+y}function lt(y,S){M.delete(y),$-=y.length,D-=S.elements}function In(y,S=!1){let b=ct(y),_=M.get(b);if(_)return M.delete(b),M.set(b,_),_;let P="data-indiana-html-binding";for(;y.includes(P);)P+="-next";let T=[],k=e.mode==="live"&&!!C,W=/\{\{\s*variables\.([^{}]+?)\s*\}\}/g,G=k?y.replace(W,(oe,ge)=>(T.push(ge.trim()),`<span ${P}="${T.length-1}"></span>`)):y,se=document.createElement("template");se.innerHTML=`<div>${G}</div>`;let fe=se.content.firstElementChild,Z=[];for(let oe of fe.querySelectorAll(`[${P}]`)){let ge=document.createTextNode(""),Me=T[Number(oe.getAttribute(P))];oe.replaceWith(ge);let nt=[];for(let Qe=ge;Qe!==fe;){let Et=Qe.parentNode;nt.unshift(Array.prototype.indexOf.call(Et.childNodes,Qe)),Qe=Et}Z.push({path:nt,variable:Me})}let ie={key:b,content:fe,inUse:!1,bindings:Z,unresolved:(k?y.replace(W,""):y).includes("{{"),elements:fe.getElementsByTagName("*").length};if(b.length<=262144&&ie.elements<=4e3){if(!S)for(;M.size>=32||$+b.length>262144||D+ie.elements>4e3;){let[oe,ge]=M.entries().next().value;lt(oe,ge)}M.size<32&&$+b.length<=262144&&D+ie.elements<=4e3&&(M.set(b,ie),$+=b.length,D+=ie.elements)}return ie}function Pt(y){let S=y.template;if(S?.content===y.body&&M.get(S.key)===S){for(let b of y.bindings)b.node.data="";S.inUse=!1,y.parked=!0}y.template=null}function Dt(y,S){let b=J.get(y),_=Je(S),P=e.mode==="live"&&!!C,T=b.source!==_||b.bound!==P,k;T&&(Pt(b),k=In(_),b.source=_,b.bound=P,b.unresolved=k.unresolved,b.variables=[...new Set(k.bindings.map(Z=>Z.variable))]);let W=new Map,G=b.unresolved;if(P)for(let Z of b.variables){let ie=Y(Z);if(ie==null){G=!0;continue}let oe=String(typeof ie=="object"?JSON.stringify(ie):ie).replace(/\r\n?/g,`
|
|
242
|
+
`);oe.includes("{{")&&(G=!0),W.set(Z,oe)}if(G&&e.mode==="live"){if(Pt(b),b.parked){let ie=document.createElement("div");b.body.replaceWith(ie),b.body=ie,b.parked=!1}let Z=_e(S.fallback??"").value.replace(/\r\n?/g,`
|
|
243
|
+
`);(!b.fallback||b.body.textContent!==Z)&&(b.body.textContent=Z),b.fallback=!0,b.bindings=[]}else if(T||b.fallback||!b.initialized){k??=In(_);let Z=!k.inUse,ie=Z?k.content:k.content.cloneNode(!0);b.bindings=k.bindings.map(({path:oe,variable:ge})=>{let Me=ie;for(let nt of oe)Me=Me.childNodes[nt];return{node:Me,variable:ge}});for(let oe of b.bindings)oe.node.data=W.get(oe.variable);b.body.replaceWith(ie),b.body=ie,b.parked=!1,Z&&M.get(k.key)===k?(k.inUse=!0,b.template=k):b.template=null;for(let oe of b.body.querySelectorAll("img"))oe.addEventListener("load",ji);b.fallback=!1,b.initialized=!0}else for(let Z of b.bindings){let ie=W.get(Z.variable);Z.node.data!==ie&&(Z.node.data=ie)}let se=Ee(S.id),fe=S.html[V];y.classList.toggle("g-missing",e.mode==="editor"&&(!!se?.missing?.length||!se&&_.includes("{{")||!(fe&&fe.trim())))}function Ot(y,S,b){let _=Ee(y.id),P=_?.[S],T=P!==void 0?{value:P,missing:!!_?.missing?.length}:_e(b);if(e.mode==="live"&&C){let k=!1,W=T.value.replace(/\{\{\s*variables\.([^{}]+?)\s*\}\}/g,(G,se)=>{se=se.trim();let fe=Y(se);return fe==null||fe===""||Array.isArray(fe)&&!fe.length?(k=!0,""):Array.isArray(fe)?fe.join(", "):String(fe)});if(k)return{value:y.fallback?_e(y.fallback).value:"",missing:!0};if(!W.includes("{{"))return{value:W,missing:T.missing}}return P!==void 0?T:T.value.includes("{{")&&e.mode==="live"?{value:y.fallback?_e(y.fallback).value:"",missing:!0}:{value:T.value,missing:T.missing||T.value.includes("{{")}}function Dr(y){if(y.name)return y.name;let S=e.editorMessages?.nodeTypes?.[y.type];return e.mode==="editor"&&typeof S=="string"?S:{stack:"\u5BB9\u5668",text:"\u6587\u672C",image:"\u56FE\u7247",button:"\u6309\u94AE",divider:"\u5206\u9694\u7EBF",spacer:"\u7559\u767D",custom_html:"\u81EA\u5B9A\u4E49 HTML",price:"\u4EF7\u683C",coupon_code:"\u4F18\u60E0\u7801",countdown:"\u5012\u8BA1\u65F6",plan_picker:"\u771F\u5B9E\u5957\u9910\u9009\u62E9"}[y.type]??y.type}function ti(y,S){if(S.type==="color")y.background="none",y.backgroundColor=Se(S.color);else if(S.type==="linear"){let b=S.stops.map(_=>`${Se(_.color)} ${Number(_.at)}%`).join(",");y.backgroundColor="transparent",y.backgroundImage=`linear-gradient(${Number(S.angle)}deg,${b})`}else if(S.type==="image"&&typeof S.src=="string"){let b=/^data:image\/(?:svg\+xml|jpeg|png);base64,[A-Za-z0-9+/]+={0,2}$/.test(S.src)?S.src:S.src.replace(/[^A-Za-z0-9\-._~:/?#[\]@!$&*+;=%]/gu,P=>P.length===1&&P.charCodeAt(0)<128?`%${P.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`:encodeURIComponent(P));y.backgroundImage=`url("${b}")`;let _=S.position;y.backgroundPosition=_?`${_.x}% ${_.y}%`:"center",y.backgroundSize=S.fit==="contain"?"contain":"cover",y.backgroundRepeat="no-repeat"}}function Oo(y){return`${Number(y.top)}px ${Number(y.right)}px ${Number(y.bottom)}px ${Number(y.left)}px`}function To(y,S,b,_,P){if(S===void 0)return;let T=_?.direction??"vertical",k=T!=="overlay"&&b==="width"==(T==="horizontal"),W=b==="width"?"minWidth":"minHeight";S==="fill"?T==="overlay"?(y.style[b]="100%",y.style[b==="width"?"justifySelf":"alignSelf"]="stretch"):k?(y.style.flex="1 1 0",y.style[W]="0"):(y.style.alignSelf="stretch",y.style[b]="auto"):S==="fit"?(y.style[b]="fit-content",b==="width"&&(y.style.maxWidth="100%"),!k&&T!=="overlay"&&(!_||_.align==="stretch")&&(y.style.alignSelf=P==="center"?"center":P==="end"?"flex-end":"flex-start")):typeof S=="number"&&(y.style[b]=`${S}px`,b==="width"&&(y.style.maxWidth="100%"),k&&(y.style.flex="0 0 auto"))}function ni(y,S,b){let _=S.style,P=_.text??{},T=y.style;if(S.type==="customer_data"&&(P.font&&T.setProperty("--g-data-display-font",u[String(P.font)]??u.system),S.data.source==="membership"&&(typeof P.size=="number"&&T.setProperty("--g-data-display-size",`clamp(${Math.min(P.size,28)}px, ${P.size/12}vw, ${P.size}px)`),typeof P.weight=="number"&&T.setProperty("--g-data-display-weight",String(P.weight)))),S.type==="customer_data"&&S.data.source==="credit_balance"&&(typeof P.size=="number"&&T.setProperty("--g-data-number-size",`clamp(${Math.min(P.size,48)}px, ${P.size/10}vw, ${P.size}px)`),P.font&&T.setProperty("--g-data-number-font",u[String(P.font)]??u.system),typeof P.weight=="number"&&T.setProperty("--g-data-number-weight",String(P.weight))),S.type==="customer_data"&&P.color){let se=Se(P.color);T.setProperty("--g-data-ink",se),T.setProperty("--g-data-muted",`color-mix(in srgb, ${se} 72%, transparent)`),T.setProperty("--g-data-line",`color-mix(in srgb, ${se} 20%, transparent)`),T.setProperty("--g-data-surface",`color-mix(in srgb, ${se} 8%, transparent)`)}_.padding&&(T.padding=Oo(_.padding)),_.margin&&(T.margin=Oo(_.margin)),typeof _.gap=="number"&&S.type==="stack"&&(T.gap=`${_.gap}px`),_.background&&ti(T,_.background),typeof _.opacity=="number"&&(T.opacity=String(_.opacity));let k=_.shape;if(k?.type==="pill")T.borderRadius="9999px";else if(k?.type==="rect"){let se=k.radius;T.borderRadius=typeof se=="number"?`${se}px`:`${Number(se.topLeft)}px ${Number(se.topRight)}px ${Number(se.bottomRight)}px ${Number(se.bottomLeft)}px`}(_.clipContent===!0||_.clipContent!==!1&&k&&(_.background||S.type==="image"))&&(T.overflow="hidden");let W=_.border;W&&(T.border=Number(W.width)>0?`${Number(W.width)}px ${W.style==="dashed"?"dashed":"solid"} ${Se(W.color)}`:"0");let G=_.shadow;G&&(T.boxShadow=`${Number(G.x)}px ${Number(G.y)}px ${Number(G.blur)}px ${Number(G.spread)}px ${Se(G.color)}`),["text","button","price","coupon_code","countdown","plan_picker"].includes(S.type)&&(P.font&&(T.fontFamily=u[String(P.font)]??""),typeof P.size=="number"&&(T.fontSize=`${P.size}px`),typeof P.weight=="number"&&(T.fontWeight=String(P.weight)),typeof P.lineHeight=="number"&&(T.lineHeight=String(P.lineHeight)),typeof P.letterSpacing=="number"&&(T.letterSpacing=`${P.letterSpacing}px`),P.color&&(T.color=Se(P.color)),P.align&&(T.textAlign=String(P.align)),P.italic&&(T.fontStyle="italic"),P.decoration&&(T.textDecoration=String(P.decoration)),P.transform&&(T.textTransform=String(P.transform))),To(y,_.width,"width",b,P.align),To(y,_.height,"height",b,P.align),b?.direction==="horizontal"&&_.grow!==void 0&&(T.flexGrow=String(_.grow===!0?1:_.grow===!1?0:_.grow))}function $r(y,S){if(C){let b=C.bindings.find(_=>_.componentId===y);if(!b)return;C.answers[b.variable]=S,w.add(y),tt({type:"answers",answers:Ro()}),Yt();return}}function Ro(){let y={};for(let S of C?.bindings??[]){let b=N[S.componentId];b!==void 0&&typeof b!="number"&&(y[S.variable]=b)}return y}function ja(y){let S=document.createElement("section");S.className="g-data",S.dataset.layout=y.data.layout,S.dataset.source=y.data.source;let b=I?.nodes[y.id];S.dataset.status=b?.status??"idle",S.dataset.preview=String(!!b?.preview);let _=b?.status==="loading",P=V.startsWith("zh"),T=(pe,$e)=>P?pe:$e;S.setAttribute("aria-busy",String(!!_));let k=(pe,$e,Tt)=>{let Fe=document.createElement(pe);return Fe.className=$e,Tt!==void 0&&(Fe.textContent=Tt),Fe},W=pe=>{let $e=document.createElementNS("http://www.w3.org/2000/svg","svg");$e.setAttribute("viewBox","0 0 24 24"),$e.setAttribute("fill","none"),$e.setAttribute("stroke","currentColor"),$e.setAttribute("stroke-width","1.7"),$e.setAttribute("stroke-linecap","round"),$e.setAttribute("stroke-linejoin","round"),$e.setAttribute("aria-hidden","true"),$e.classList.add("g-data-icon");let Tt={refresh:["M20 7v5h-5","M4 17v-5h5","M6.1 7a7 7 0 0 1 11.5-1.5L20 8M4 16l2.4 2.5A7 7 0 0 0 18 17"],down:["M7 7l10 10M7 17h10V7"],up:["M7 17L17 7M7 7h10v10"],chevron:["M6 9l6 6 6-6"],empty:["M4 8l8-4 8 4v10l-8 4-8-4V8Z","M4 8l8 4 8-4M12 12v10"],credit:["M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z","M12 7v10M8 12h8"]};for(let Fe of Tt[pe]){let mt=document.createElementNS("http://www.w3.org/2000/svg","path");mt.setAttribute("d",Fe),$e.append(mt)}return $e},G=(pe,$e,Tt,Fe=!1,mt=$e)=>{let Lt=k("button","g-data-button",pe);return Lt.type="button",Lt.disabled=Fe||!!_&&$e!=="refresh"||!!b?.preview||e.mode!=="live",_&&$e==="refresh"&&Lt.setAttribute("aria-disabled","true"),Lt.dataset.gDataFocus=`${y.id}:${mt}:${Tt??""}`,Lt.addEventListener("click",dn=>{!dn.isTrusted||Lt.disabled||_||tt({type:"customer-data-intent",intent:{nodeId:y.id,action:$e,...Tt?{value:Tt}:{}}})}),Lt},se=k("div","g-data-header"),fe=k("h2","g-data-heading",_e(y.title).value);fe.id=`g-data-title-${y.id}`,S.setAttribute("aria-labelledby",fe.id);let Z=k("div","g-data-controls"),ie=[],oe=pe=>{pe.hidden||(pe.type==="customer_data"&&ie.push(pe),pe.type==="stack"&&pe.children.forEach(oe))},ge=A?.pages[0];ge&&oe(ge.root);let Me=ie.every(pe=>I?.nodes[pe.id]?.preview),nt=ie.find(pe=>pe.data.source==="credit_balance")??ie[0];b?.preview&&(!Me||nt?.id===y.id)&&Z.append(k("span","g-data-preview",T("\u793A\u4F8B\u6570\u636E","Sample data")));let Qe=_?T("\u66F4\u65B0\u4E2D\u2026","Updating\u2026"):T("\u5237\u65B0","Refresh"),Et=G(Qe,"refresh");if(Et.replaceChildren(W("refresh")),Et.setAttribute("aria-label",Qe),Et.title=Qe,Et.classList.add("g-data-refresh"),_&&Et.classList.add("g-data-refreshing"),Z.append(Et),y.data.source==="billing"&&y.data.outputs?.billing_portal&&Z.append(G(b?.billingBusy?T("\u6B63\u5728\u51C6\u5907\u2026","Preparing\u2026"):T("\u7BA1\u7406\u652F\u4ED8\u65B9\u5F0F","Manage payment method"),"billing_portal",void 0,!!b?.billingBusy||b?.status!=="ready")),y.data.source==="credit_balance"&&(fe.prepend(W("credit")),b?.resources.length===1&&fe.append(k("span","g-data-resource-label",b.resources[0].name)),b?.updatedAt)){let pe=k("time","g-data-updated",`${T("\u66F4\u65B0\u4E8E","Updated")} ${new Intl.DateTimeFormat(V,{timeStyle:"short"}).format(new Date(b.updatedAt))}`);pe.dateTime=b.updatedAt,pe.title=new Intl.DateTimeFormat(V,{dateStyle:"medium",timeStyle:"short"}).format(new Date(b.updatedAt)),Z.prepend(pe)}if(se.append(fe,Z),S.append(se),!b||b.source!==y.data.source)return S.append(k("p","g-data-empty",T("\u8FDE\u63A5\u5BA2\u6237\u6570\u636E\u540E\u663E\u793A\u6B64\u5185\u5BB9\u3002","Connect customer data to display this content."))),S;if(b.errorMessage){let pe=k("div","g-data-error",b.errorMessage);pe.setAttribute("role","alert"),S.append(pe);let $e=k("div","g-data-recovery");$e.append(G(T("\u91CD\u8BD5","Retry"),"refresh")),S.append($e)}if(b.membershipResult){let pe=k("p","g-data-note",b.membershipResult);pe.setAttribute("role","status"),S.append(pe)}if(b.membershipReview){let pe=b.membershipReview,$e=k("section","g-data-resource");$e.dataset.gDataReview="",$e.setAttribute("aria-label",pe.title),$e.setAttribute("aria-busy",String(!!b.membershipBusy));let Tt=k("h3","g-data-row-label",pe.title);Tt.tabIndex=-1,$e.append(Tt);let Fe=k("dl","g-data-facts");for(let Lt of pe.facts){let dn=k("div","");dn.append(k("dt","",Lt.label),k("dd","",Lt.value)),Fe.append(dn)}$e.append(Fe,k("p","g-data-note",pe.note));let mt=k("div","g-data-controls");mt.append(G(T("\u8FD4\u56DE","Back"),"membership_dismiss",void 0,!!b.membershipBusy),G(b.membershipBusy?T("\u6B63\u5728\u5904\u7406\u2026","Processing\u2026"):T("\u786E\u8BA4","Confirm"),"membership_confirm",void 0,!!b.membershipBusy)),$e.append(mt),S.append($e)}if(b.stale&&(b.resources.length||b.rows.length)&&S.append(k("p",_?"g-data-live-status":"g-data-note",_?T("\u6B63\u5728\u66F4\u65B0\u8D26\u6237\u6570\u636E\u3002","Updating account data."):T("\u663E\u793A\u4E0A\u6B21\u8BFB\u53D6\u7684\u7ED3\u679C\uFF0C\u6B63\u5728\u7B49\u5F85\u66F4\u65B0\u3002","Showing the last result while awaiting an update."))),_&&!b.resources.length&&!b.rows.length){let pe=k("div","g-data-skeleton");if(pe.setAttribute("aria-hidden","true"),y.data.source==="credit_balance")pe.append(k("span","g-data-skeleton-line g-data-skeleton-value"),k("span","g-data-skeleton-line g-data-skeleton-meta"));else{let Tt=Math.min(y.data.pageSize,y.data.layout==="compact"?2:4);for(let Fe=0;Fe<Tt;Fe++){let mt=k("div","g-data-skeleton-row");mt.append(k("span","g-data-skeleton-line"),k("span","g-data-skeleton-line")),pe.append(mt)}}let $e=k("p","g-data-live-status",T("\u6B63\u5728\u8BFB\u53D6\u8D26\u6237\u6570\u636E\u2026","Loading account data\u2026"));return $e.setAttribute("role","status"),S.append(pe,$e),S}let rn={credit_transactions:[["all","\u5168\u90E8\u8BB0\u5F55","All activity"],["consume","\u6D88\u8D39","Usage"],["reserve","\u9884\u6263","Reserved"],["confirm","\u786E\u8BA4\u6263\u8D39","Confirmed"],["release","\u91CA\u653E","Released"],["refund","\u9000\u56DE","Refund"]],credit_pack_orders:[["all","\u5168\u90E8\u8BA2\u5355","All orders"],["pending","\u7B49\u5F85\u4ED8\u6B3E","Pending"],["paid","\u5DF2\u4ED8\u6B3E","Paid"],["expired","\u5DF2\u8FC7\u671F","Expired"],["refunded","\u5DF2\u9000\u6B3E","Refunded"],["disputed","\u4E89\u8BAE\u4E2D","Disputed"]],offer_history:[["all","\u5168\u90E8\u8BB0\u5F55","All offers"],["issued","\u672A\u4F7F\u7528","Unused"],["reserved","\u4ED8\u6B3E\u5904\u7406\u4E2D","Payment pending"],["redeemed","\u5DF2\u4F7F\u7528","Redeemed"],["expired","\u5DF2\u5230\u671F","Expired"],["revoked","\u5DF2\u4F5C\u5E9F","Revoked"]]};if(rn[y.data.source]){let pe=k("select","g-data-select");pe.setAttribute("aria-label",T("\u7B5B\u9009\u8BB0\u5F55","Filter records")),pe.dataset.gDataFocus=`${y.id}:filter`,pe.disabled=!!_||b.preview||e.mode!=="live";for(let[$e,Tt,Fe]of rn[y.data.source]){let mt=document.createElement("option");mt.value=$e,mt.textContent=T(Tt,Fe),pe.append(mt)}pe.value=b.filter,pe.addEventListener("change",()=>{!pe.disabled&&e.mode==="live"&&tt({type:"customer-data-intent",intent:{nodeId:y.id,action:"filter",value:pe.value}})}),Z.prepend(pe)}let _d=(pe,$e=!1)=>{let Tt=k("ul","g-data-list");if(y.data.source==="credit_transactions"&&pe.length&&!$e){let Fe=k("div","g-data-table-head");Fe.setAttribute("aria-hidden","true"),Fe.append(k("span","",T("\u8BB0\u5F55","Record")),k("span","",T("\u7C7B\u578B","Type")),k("span","",T("\u79EF\u5206","Credits"))),S.append(Fe)}for(let Fe of pe){let mt=k("li","g-data-row"),Lt=k("div","g-data-row-main"),dn=k("div","g-data-row-copy");dn.append(k("p","g-data-row-label",Fe.label));for(let ft of Fe.detail)ft!==Fe.status&&dn.append(k("div","g-data-row-detail",ft));if(y.data.source==="credit_transactions"&&!$e){let ft=k("span","g-data-row-mark");ft.append(W(["Refund","\u9000\u56DE"].includes(Fe.status??"")?"up":"down")),Lt.append(ft)}if(Lt.append(dn),mt.append(Lt),Fe.status?mt.append(k("div","g-data-row-status",Fe.status)):mt.classList.add("g-data-row-no-status"),Fe.value?mt.append(k("div","g-data-row-value",Fe.value)):mt.classList.add("g-data-row-no-value"),Fe.facts.length||Fe.purchaseId||Fe.membershipActions?.length||Fe.billingActions?.length){let ft=k("div","g-data-row-extra"),Lr=k("div","g-data-facts"),ir=(xn,Lo)=>{for(let Uc of xn){let Vc=k("span","",Uc.label);Vc.append(k("strong","",Uc.value)),Lo.append(Vc)}};if(ir(Fe.facts.slice(0,3),Lr),Fe.facts.length>3){let xn=k("details","g-data-sources");xn.dataset.gDataSources=`facts:${Fe.id}`,xn.append(k("summary","",`${y.data.source==="billing"?T("\u8D26\u5355\u8BE6\u60C5","Invoice details"):y.data.source==="offer_history"?T("\u4F18\u60E0\u5238\u660E\u7EC6","Coupon details"):T("\u5168\u90E8\u6263\u8D39\u660E\u7EC6","All allocations")} \xB7 ${Fe.facts.length}`));let Lo=k("div","g-data-facts");ir(Fe.facts.slice(3),Lo),xn.append(Lo),Lr.append(xn)}if(ft.append(Lr),!$e)for(let xn of Fe.billingActions??[])ft.append(G(xn.label,xn.action,Fe.id,!!b.billingBusy));if(Fe.purchaseId&&y.data.allowPurchase&&!$e){let xn=G(b.buyingId===Fe.purchaseId?T("\u6B63\u5728\u51C6\u5907\u2026","Preparing\u2026"):T("\u8D2D\u4E70\u79EF\u5206","Buy credits"),"buy_pack",Fe.purchaseId,!!b.preview||!!b.buyingId);xn.classList.add("g-data-buy"),ft.append(xn)}if(y.data.allowPurchase&&!$e)for(let xn of Fe.membershipActions??[])ft.append(G(xn.label,"membership_preview",xn.value,!!b.preview||!!b.membershipBusy||!!b.membershipReview));mt.append(ft)}Tt.append(mt)}return Tt};for(let pe of b.resources){let $e=k("article","g-data-resource");$e.setAttribute("aria-label",pe.name),b.resources.length>1&&$e.append(k("p","g-data-name",pe.name));let Tt=k("div","g-data-balance"),Fe=new Intl.NumberFormat(V).formatToParts(1.1).find(ft=>ft.type==="decimal")?.value??".",mt=pe.spendable.lastIndexOf(Fe),Lt=k("strong","g-data-number",mt<0?pe.spendable:pe.spendable.slice(0,mt));mt>=0&&Lt.append(k("span","g-data-fraction",pe.spendable.slice(mt))),Tt.append(Lt,k("span","g-data-unit",T("\u53EF\u7528\u79EF\u5206","Spendable credits"))),$e.append(Tt);let dn=k("div","g-data-facts");for(let[ft,Lr]of[[T("\u4F59\u989D","Balance"),pe.available],[T("\u51BB\u7ED3","Reserved"),pe.reserved]]){let ir=k("span","",ft);ir.append(k("strong","",Lr)),dn.append(ir)}if(pe.expiry&&dn.append(k("span","g-data-expiry",`${T("\u6700\u8FD1\u5230\u671F","Next expiry")} \xB7 ${pe.expiry}`)),$e.append(dn),y.data.showSources&&pe.sourceCount){let ft=k("details","g-data-sources");if(ft.dataset.gDataSources=pe.key,ft.append(k("summary","",`${T("\u79EF\u5206\u6765\u6E90","Credit sources")} \xB7 ${pe.sourceCount}`),_d(pe.sources,!0)),ft.querySelector("summary")?.append(W("chevron")),pe.hasNextSources||pe.hasPreviousSources){let Lr=k("div","g-data-footer");Lr.append(k("span","",`${T("\u7B2C","Page")} ${pe.sourcePage}`));let ir=k("div","g-data-controls");ir.append(G(T("\u4E0A\u4E00\u9875","Previous"),"sources_previous",pe.key,!pe.hasPreviousSources),G(T("\u4E0B\u4E00\u9875","Next"),"sources_next",pe.key,!pe.hasNextSources)),Lr.append(ir),ft.append(Lr)}$e.append(ft)}S.append($e)}if(b.rows.length&&S.append(_d(b.rows)),y.data.source==="billing_controls"&&(y.data.outputs?.billing_authorization||y.data.outputs?.billing_adjustment)){let pe=k("div","g-data-controls");y.data.outputs?.billing_authorization&&pe.append(G(T("\u8BBE\u7F6E\u81EA\u52A8\u4ED8\u6B3E\u6388\u6743","Set up payment authorization"),"billing_authorization")),y.data.outputs?.billing_adjustment&&pe.append(G(T("\u67E5\u770B\u5F85\u786E\u8BA4\u8865\u6B3E","Review pending adjustment"),"billing_adjustment")),S.append(pe)}if(!b.rows.length&&!b.resources.length&&b.status!=="error"){let pe=k("p","g-data-empty",_?T("\u6B63\u5728\u8BFB\u53D6\u8D26\u6237\u6570\u636E\u2026","Loading account data\u2026"):b.status==="idle"?T("\u767B\u5F55\u540E\u67E5\u770B\u4F60\u7684\u8D26\u6237\u6570\u636E\u3002","Sign in to view your account data."):b.filter!=="all"?T("\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u8BB0\u5F55\u3002","No records match this filter."):y.data.source==="credit_pack_orders"?T("\u6682\u65E0\u8D2D\u4E70\u8BB0\u5F55","No purchases yet"):y.data.source==="credit_balance"?T("\u6682\u65E0\u79EF\u5206\u6765\u6E90","No credit balances yet"):y.data.source==="membership"?T("\u6682\u65E0\u4F1A\u5458\u65B9\u6848","No memberships yet"):y.data.source==="customer_plans"?T("\u6682\u65E0\u53EF\u9009\u5957\u9910","No plans available"):y.data.source==="credit_packs"?T("\u6682\u65E0\u53EF\u8D2D\u4E70\u7684\u79EF\u5206\u5305","No credit packs available"):y.data.source==="billing_controls"?T("\u5C1A\u672A\u8BBE\u7F6E\u7528\u91CF\u9650\u5236\u6216\u81EA\u52A8\u4ED8\u6B3E\u6388\u6743","No usage limits or payment authorizations configured"):y.data.source==="offer_history"?T("\u6682\u65E0\u4F18\u60E0\u8BB0\u5F55","No offers yet"):y.data.source==="billing"?T("\u6682\u65E0\u8D26\u5355","No invoices yet"):T("\u8FD9\u91CC\u8FD8\u6CA1\u6709\u8BB0\u5F55\u3002","There are no records yet."));pe.prepend(W("empty")),pe.setAttribute("role","status"),S.append(pe)}if(b.hasNext||b.hasPrevious){let pe=k("div","g-data-footer");pe.append(k("span","",`${T("\u7B2C","Page")} ${b.page}`));let $e=k("div","g-data-controls");$e.append(G(T("\u4E0A\u4E00\u9875","Previous"),"previous",void 0,!b.hasPrevious),G(T("\u4E0B\u4E00\u9875","Next"),"next",void 0,!b.hasNext)),pe.append($e),S.append(pe)}return b.updatedAt&&y.data.source!=="credit_balance"&&S.append(k("p","g-data-note g-data-updated",`${T("\u6570\u636E\u66F4\u65B0\u4E8E","Updated")} ${new Intl.DateTimeFormat(V,{dateStyle:"medium",timeStyle:"short"}).format(new Date(b.updatedAt))}`)),S}let ri=new Map,La=new Map,Dc=y=>{let S=y.target;for(let b of ri.keys())S&&!jr(b)?.contains(S)&&ri.delete(b)};document.addEventListener("focusin",Dc),document.addEventListener("pointerdown",Dc);function $c(y){let S=I;if(I=y,!A)return;let b=(P,T)=>{if(P.type==="stack"){P.children.forEach(ge=>b(ge,P));return}if(P.type!=="customer_data"||JSON.stringify(S?.nodes[P.id])===JSON.stringify(y.nodes[P.id]))return;let k=jr(P.id);if(!k)return;let W=document.activeElement;W&&k.contains(W)&&W.dataset.gDataFocus&&ri.set(P.id,W.dataset.gDataFocus);let G=new Set([...k.querySelectorAll("details[data-g-data-sources]")].filter(ge=>ge.open).map(ge=>ge.dataset.gDataSources)),se=Di(P,T);if(!se)return;for(let ge of se.querySelectorAll("details[data-g-data-sources]"))ge.open=G.has(ge.dataset.gDataSources);let fe=k.scrollTop;k.replaceWith(se),se.scrollTop=fe;let Z=!!y.nodes[P.id]?.membershipReview&&!S?.nodes[P.id]?.membershipReview,ie=!y.nodes[P.id]?.membershipReview&&!!S?.nodes[P.id]?.membershipReview;Z&&ri.get(P.id)&&La.set(P.id,ri.get(P.id));let oe=ie?La.get(P.id):ri.get(P.id);oe&&[...se.querySelectorAll("[data-g-data-focus]")].find(ge=>ge.dataset.gDataFocus===oe)?.focus({preventScroll:!0}),Z&&se.querySelector("[data-g-data-review] h3")?.focus({preventScroll:!0}),ie&&La.delete(P.id),se.animate&&y.nodes[P.id]?.status==="ready"&&!window.matchMedia("(prefers-reduced-motion:reduce)").matches&&se.animate([{opacity:.7},{opacity:1}],{duration:140,easing:"ease-out"})},_=A.pages.find(P=>P.id===Q)??A.pages[0];b(_.root,null),rr()}function Di(y,S){if(y.hidden)return null;let b;if(y.type==="customer_data")b=ja(y);else if(y.type==="stack"){b=document.createElement(y.purchaseAction?"button":"div"),y.purchaseAction&&(b.type="button",b.dataset.gAction=y.purchaseAction),b.className=`${y.purchaseAction?`g-btn g-btn-${y.buttonVariant??"primary"} `:""}g-stack ${y.direction==="horizontal"?"g-h":y.direction==="overlay"?"g-o":"g-v"}`,y.direction==="overlay"?(b.style.alignItems=h[y.align]??"stretch",b.style.justifyItems=p[y.justify]??"stretch"):(b.style.alignItems=l[y.align]??"stretch",b.style.justifyContent=d[y.justify]??"flex-start");for(let _ of y.children){let P=Di(_,y);P&&b.append(P)}if(y.interaction&&$i(b,y),y.purchaseAction&&e.mode==="live"){let _=E?.nodes[y.id],P=_?.picker;P&&(b.disabled=!E?.pickers[P]?.options.includes(String(N[P]??""))),Ee(y.id)?.unavailable&&(b.disabled=!0)}e.mode==="editor"&&!b.childElementCount&&(b.classList.add("g-empty"),b.dataset.gEditorPlaceholder=e.editorMessages?.emptyContainer??"\u62D6\u5165\u7EC4\u4EF6")}else if(y.type==="text"){let _=y.variant==="title"?"h1":y.variant==="heading"?"h2":"p";b=document.createElement(_),b.className=`g-text g-${y.variant}`;let P=Ot(y,"text",y.text);b.textContent=P.value,P.missing&&e.mode==="editor"&&b.classList.add("g-missing")}else if(y.type==="button"){b=document.createElement("button"),b.type="button",b.className=`g-btn g-btn-${y.variant}`;let _=Ot(y,"label",y.label);b.textContent=_.value,_.missing&&e.mode==="editor"&&b.classList.add("g-missing"),b.dataset.gAction=y.action;let P=E?.nodes[y.id]?.picker;if(P&&e.mode==="live"){let T=P,k=E?.pickers[T],W=N[T]??k?.selected;b.disabled=!k?.options.includes(String(W)),b.disabled&&b.setAttribute("aria-disabled","true")}e.mode==="live"&&Ee(y.id)?.unavailable&&(b.disabled=!0,b.setAttribute("aria-disabled","true")),e.mode==="editor"&&(b.tabIndex=-1)}else if(y.type==="image"){b=document.createElement("div"),b.className="g-img",f[y.aspect]&&(b.dataset.aspect=y.aspect,b.style.aspectRatio=f[y.aspect]);let _=document.createElement("img");_.src=y.localizedSrc?.[V]??y.localizedSrc?.[A.strings.defaultLocale]??y.src,_.alt=Ot(y,"alt",y.alt).value,_.referrerPolicy="no-referrer",_.decoding="async",_.style.objectFit=y.fit,y.position&&(_.style.objectPosition=`${y.position.x}% ${y.position.y}%`),_.addEventListener("load",ji),b.append(_)}else if(y.type==="price"){b=document.createElement("div"),b.className="g-price",b.style.cssText="display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;font-variant-numeric:tabular-nums";let _=Ee(y.id);if(!_?.price)b.textContent=_?.text??_e(y.fallback).value,e.mode==="editor"&&b.classList.add("g-missing");else for(let P of["current","original","period"]){let T=_.price[P];if(!T)continue;let k=document.createElement(P==="original"?"s":"span");k.textContent=T,P==="original"&&(k.style.opacity=".6"),y.parts?.[P]&&ni(k,{type:"text",id:y.id,text:y.fallback,variant:"body",style:y.parts[P]},null),b.append(k)}}else if(y.type==="coupon_code"){b=document.createElement("div"),b.style.cssText="display:flex;align-items:center;gap:12px;flex-wrap:wrap";let _=Ee(y.id);if(_?.code){let P=document.createElement("code");P.textContent=_.code;let T=document.createElement("button");T.type="button",T.className="g-btn g-btn-secondary",T.textContent=_e(y.label).value,T.addEventListener("click",k=>{e.mode!=="editor"&&(k.stopPropagation(),tt({type:"copy",nodeId:y.id}))}),b.append(P,T)}else b.textContent=_?.text??_e(y.fallback).value,e.mode==="editor"&&b.classList.add("g-missing")}else if(y.type==="countdown"){b=document.createElement("span"),b.setAttribute("role","timer"),b.style.fontVariantNumeric="tabular-nums";let _=Ee(y.id),P=_?.countdownAt?Date.parse(_.countdownAt):NaN,T=y.granularity==="second"?void 0:new Intl.NumberFormat(V,{style:"unit",unit:y.granularity,unitDisplay:"short"});!Number.isFinite(P)&&e.mode==="editor"&&b.classList.add("g-missing");let k=()=>{if(!Number.isFinite(P)){b.textContent=_?.text??_e(y.fallback).value;return}let W=Math.max(0,Math.ceil((P-Date.now())/1e3));if(!W){b.textContent=_e(y.expired).value;let Z=F.get(y.id);Z!==void 0&&clearInterval(Z),F.delete(y.id);return}let G=y.granularity,se=G==="day"?86400:G==="hour"?3600:G==="minute"?60:1,fe=T?T.format(Math.ceil(W/se)):[Math.floor(W/86400),Math.floor(W/3600)%24,Math.floor(W/60)%60,W%60].map(Z=>String(Z).padStart(2,"0")).join(":");b.textContent!==fe&&(b.textContent=fe)};k(),Number.isFinite(P)&&P>Date.now()&&F.set(y.id,setInterval(k,1e3))}else if(y.type==="quantity_picker"){b=document.createElement("div");let _=E?.quantities?.[y.id],P=document.createElement("label");P.textContent=_e(y.label).value;let T=document.createElement("input");T.type="range",T.id=`quantity-${y.id}`,P.htmlFor=T.id,T.min=String(_?.minimum??y.minimumQuantity),T.max=String(_?.maximum??y.maximumQuantity),T.step=String(y.step),T.value=String(typeof N[y.id]=="number"?N[y.id]:y.defaultQuantity),N[y.id]=Number(T.value),T.disabled=e.mode!=="editor"&&!_?.available,T.style.cssText="width:100%;accent-color:var(--g-primary)";let k=document.createElement("output");k.textContent=_?.label||_e(y.fallback).value,T.setAttribute("aria-valuetext",_?.label??String(T.value)),T.oninput=()=>{N[y.id]=Number(T.value),tt({type:"selection",selection:Ue()})},b.append(P,T,k)}else if(y.type==="plan_picker"){b=document.createElement("div"),b.setAttribute("role",y.grouping?"group":"radiogroup"),b.setAttribute("aria-label",_e(y.label).value),b.style.cssText="display:flex;flex-direction:column;gap:8px";let _=E?.pickers[y.id],P=y.grouping;if(!_?.options.length)b.textContent=_e(y.fallback).value,e.mode==="editor"&&b.classList.add("g-missing");else{let T=typeof N[y.id]=="string"?String(N[y.id]):_.selected,k=z[y.id];if(P){if(!k){let nt=P.assignments.find(Qe=>Qe.productVersionId===T);k={period:nt?.period??"month",tierId:nt?.tierId??P.tiers[0].id},z[y.id]=k}let Z=P.assignments.find(nt=>nt.tierId===k.tierId&&nt.period===k.period);T=Z&&_.options.includes(Z.productVersionId)?Z.productVersionId:"";let ie=document.createElement("div");ie.setAttribute("role","radiogroup"),ie.setAttribute("aria-label",`${_e(P.monthLabel).value} / ${_e(P.yearLabel).value}`),ie.style.cssText="display:flex;gap:4px;padding:4px;border:1px solid var(--g-border);border-radius:10px";let oe=["month","year"],ge=oe.filter(nt=>P.assignments.some(Qe=>Qe.period===nt&&_.options.includes(Qe.productVersionId))),Me=nt=>{k.period=nt;let Qe=P.assignments.find(Et=>Et.tierId===k.tierId&&Et.period===nt);N[y.id]=Qe&&_.options.includes(Qe.productVersionId)?Qe.productVersionId:"",Yt(),tt({type:"selection",selection:Ue()}),jr(y.id)?.querySelector(`[data-product-period="${nt}"]`)?.focus()};for(let nt of oe){let Qe=document.createElement("button");Qe.type="button",Qe.className=`g-btn g-btn-${nt===k.period?"primary":"secondary"}`,Qe.style.cssText="flex:1;min-width:0;min-height:40px",Qe.dataset.productPeriod=nt,Qe.setAttribute("role","radio"),Qe.setAttribute("aria-checked",String(nt===k.period)),Qe.textContent=_e(nt==="month"?P.monthLabel:P.yearLabel).value,Qe.disabled=!ge.includes(nt),Qe.tabIndex=e.mode==="editor"||Qe.disabled?-1:nt===k.period||!ge.includes(k.period)&&nt===ge[0]?0:-1,Qe.addEventListener("click",Et=>{e.mode!=="editor"&&(Et.stopPropagation(),Me(nt))}),Qe.addEventListener("keydown",Et=>{if(e.mode==="editor"||!ge.length)return;let rn;["ArrowRight","ArrowDown"].includes(Et.key)?rn=(ge.indexOf(nt)+1)%ge.length:["ArrowLeft","ArrowUp"].includes(Et.key)?rn=(ge.indexOf(nt)-1+ge.length)%ge.length:Et.key==="Home"?rn=0:Et.key==="End"&&(rn=ge.length-1),rn!==void 0&&(Et.preventDefault(),Me(ge[rn]))}),ie.append(Qe)}b.append(ie)}N[y.id]=T??"";let W=P?P.tiers.map(Z=>({tier:Z,id:P.assignments.find(ie=>ie.tierId===Z.id&&ie.period===k.period)?.productVersionId})):_.options.map(Z=>({id:Z,tier:void 0})),G=W.filter(Z=>Z.id&&_.options.includes(Z.id)),se=P?document.createElement("div"):b;P&&(se.setAttribute("role","radiogroup"),se.setAttribute("aria-label",_e(y.label).value),se.style.cssText="display:flex;flex-direction:column;gap:8px",b.append(se));let fe=Z=>{!Z.id||!_.options.includes(Z.id)||(P&&Z.tier&&(k.tierId=Z.tier.id),N[y.id]=Z.id,Yt(),tt({type:"selection",selection:Ue()}),jr(y.id)?.querySelector(`[data-plan-id="${Z.id}"]`)?.focus())};for(let Z of W){let ie=Z.id?E.plans[Z.id]:void 0,oe=!!ie&&_.options.includes(Z.id),ge=document.createElement("button");ge.type="button",ge.className="g-btn g-btn-secondary",ge.style.cssText="width:100%;text-align:start;min-height:44px",ge.setAttribute("role","radio");let Me=P?Z.tier?.id===k.tierId:Z.id===T;ge.setAttribute("aria-checked",String(Me)),ge.disabled=!oe,ge.tabIndex=e.mode==="editor"||!oe?-1:Me||!T&&Z===G[0]?0:-1,Z.id&&(ge.dataset.planId=Z.id),Z.tier&&(ge.dataset.productTier=Z.tier.id);let nt=Z.id?E.nodes[y.id]?.byPlan?.[Z.id]?.price:void 0;ge.textContent=oe?`${Z.tier?.name??ie.name} \xB7 ${nt?.current??ie.price}${nt?.period??ie.period}`:`${Z.tier?.name??""} \xB7 ${_e(P?.unavailableLabel??y.fallback).value}`,Me&&(ge.style.borderColor="var(--g-primary)",ge.style.boxShadow="inset 0 0 0 1px var(--g-primary)",y.states?.selected&&ni(ge,{type:"text",id:y.id,text:y.label,variant:"body",style:y.states.selected},null)),ge.addEventListener("click",Qe=>{e.mode==="editor"||!oe||(Qe.stopPropagation(),fe(Z))}),ge.addEventListener("keydown",Qe=>{if(e.mode==="editor"||!G.length)return;let Et=G.indexOf(Z),rn;["ArrowRight","ArrowDown"].includes(Qe.key)?rn=(Et+1)%G.length:["ArrowLeft","ArrowUp"].includes(Qe.key)?rn=(Et-1+G.length)%G.length:Qe.key==="Home"?rn=0:Qe.key==="End"&&(rn=G.length-1),rn!==void 0&&(Qe.preventDefault(),fe(G[rn]))}),se.append(ge)}if(P&&!T){let Z=document.createElement("p");Z.setAttribute("role","status"),Z.textContent=_e(P.unavailableLabel).value,b.append(Z)}}}else if(y.type==="divider")b=document.createElement("hr"),b.className="g-divider";else if(y.type==="spacer")b=document.createElement("div"),b.setAttribute("aria-hidden","true"),b.style.flex="0 0 auto",b.style.width=b.style.height=`${s[y.size]??0}px`;else if(y.type==="custom_html"){b=document.createElement("div"),b.className="g-custom";let _=b.attachShadow({mode:"open"}),P=document.createElement("style"),T="@media(prefers-reduced-motion:reduce){:host,:host::before,:host::after,*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}";P.textContent=`:host{display:block}${T}@layer indiana-accessibility{${T}}${y.css}`;let k=document.createElement("div");_.append(P,k),J.set(b,{body:k,source:null,bound:!1,unresolved:!1,variables:[],bindings:[],fallback:!1,initialized:!1,template:null,parked:!1}),Dt(b,y)}else return null;return y.style&&ni(b,y,S),b.dataset.gNode=y.id,b.dataset.gLabel=Dr(y),q.set(y.id,b),b}function $i(y,S){let b=S.interaction,_=[...y.children];y.setAttribute("aria-label",_e(b.label).value);let P=C?.bindings.find(k=>k.componentId===S.id),T=P?{id:P.variable,source:P.componentId,required:P.required}:void 0;if(T){let k=document.createElement("p");k.className="g-text g-body",k.textContent=_e(b.label).value+(T.required?" *":""),y.prepend(k),T.required&&y.setAttribute("aria-required","true")}if(b.type==="input"){let k=document.createElement("input");k.type=b.keyboard,k.maxLength=b.maxLength,k.autocomplete="off",k.setAttribute("aria-label",_e(b.label).value),k.setAttribute("aria-required",String(!!T?.required)),k.value=typeof N[S.id]=="string"?String(N[S.id]):"",k.style.cssText="box-sizing:border-box;width:100%;min-height:44px;padding:10px 14px;border:1px solid var(--g-border);border-radius:8px;background:var(--g-surface);color:var(--g-text);font:inherit",k.disabled=e.mode!=="live",k.addEventListener("input",()=>{N[S.id]=k.value,$r(S.id,k.value)}),y.append(k);return}if(!(e.mode!=="live"||!_.length&&b.type!=="toggle")){if(b.type==="multiselect"){y.setAttribute("role","group"),y.dataset.gMin=String(b.min);let k=S.children.filter(se=>!se.hidden),W=new Set(Array.isArray(N[S.id])?N[S.id]:[]),G=()=>_.forEach((se,fe)=>{let Z=W.has(k[fe].id);se.setAttribute("aria-checked",String(Z)),se.setAttribute("aria-disabled",String(!Z&&W.size>=b.max)),se.style.outline=Z?"2px solid var(--g-primary)":"",se.style.outlineOffset="-2px"});_.forEach((se,fe)=>{se.setAttribute("role","checkbox"),se.tabIndex=0,se.setAttribute("aria-label",se.textContent?.trim()||String(fe+1)),se.style.cursor="pointer";let Z=()=>{let ie=k[fe].id;if(W.has(ie))W.delete(ie);else if(W.size<b.max)W.add(ie);else return;let oe=k.filter(ge=>W.has(ge.id)).map(ge=>ge.id);N[S.id]=oe,G(),$r(S.id,oe)};se.addEventListener("click",ie=>{ie.stopPropagation(),Z()}),se.addEventListener("keydown",ie=>{[" ","Enter"].includes(ie.key)&&(ie.preventDefault(),ie.stopPropagation(),Z())})}),G();return}if(b.type==="select"){y.setAttribute("role","radiogroup");let k=S.children.filter(fe=>!fe.hidden),W=t(S)?S.interaction.pickerId:void 0,G=k.findIndex(fe=>W?fe.type==="stack"&&fe.bind?.plan===N[W]:fe.id===N[S.id]);!W&&G<0&&!T?.required&&(G=Math.min(b.defaultIndex,_.length-1));let se=(fe,Z=!1,ie=!0)=>{if(W&&ie&&fe>=0){let oe=k[fe],ge=oe.type==="stack"?oe.bind?.plan:void 0;if(!ge||!E?.pickers[W]?.options.includes(ge))return;N[S.id]=oe.id,N[W]=ge,Yt(),tt({type:"selection",selection:Ue()}),Z&&qe.querySelector(`[data-g-node="${oe.id}"]`)?.focus({preventScroll:!0});return}G=fe,fe>=0&&(N[S.id]=k[fe].id),ie&&fe>=0&&$r(S.id,k[fe].id),_.forEach((oe,ge)=>{oe.setAttribute("aria-checked",String(ge===fe)),oe.tabIndex=ge===(fe<0?0:fe)?0:-1,oe.style.cssText="";let Me=k[ge];Me.type==="stack"&&(oe.style.alignItems=l[Me.align]??"stretch",oe.style.justifyContent=d[Me.justify]??"flex-start"),Me.style&&ni(oe,Me,S),ge===fe&&(b.selectedStyle&&ni(oe,{...Me,style:b.selectedStyle},S),Me.type==="stack"&&Me.states?.selected&&ni(oe,{...Me,style:Me.states.selected},S),!b.selectedStyle?.border&&!(Me.type==="stack"&&Me.states?.selected?.border)&&(oe.style.outline="2px solid var(--g-primary)",oe.style.outlineOffset="-2px")),oe.style.cursor="pointer"}),Z&&fe>=0&&_[fe].focus()};_.forEach((fe,Z)=>{if(fe.setAttribute("role","radio"),W){let ie=k[Z],oe=ie.type==="stack"?ie.bind?.plan:void 0;fe.setAttribute("aria-disabled",String(!oe||!E?.pickers[W]?.options.includes(oe)))}fe.setAttribute("aria-label",fe.textContent?.trim()||String(Z+1)),fe.addEventListener("click",ie=>{ie.stopPropagation(),se(Z)}),fe.addEventListener("keydown",ie=>{let oe=ie.key;if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"," ","Enter"].includes(oe))return;ie.preventDefault(),ie.stopPropagation();let ge=G<0?Z:G;se(oe==="Home"?0:oe==="End"?_.length-1:oe==="ArrowRight"||oe==="ArrowDown"?(ge+1)%_.length:oe==="ArrowLeft"||oe==="ArrowUp"?(ge+_.length-1)%_.length:Z,!0)})}),se(G,!1,!1)}else if(b.type==="tabs"){let k=S.children.filter(Z=>!Z.hidden),W=document.createElement("div");W.setAttribute("role","tablist"),W.setAttribute("aria-label",_e(b.label).value),W.style.cssText="display:flex;gap:4px;padding:4px;border:1px solid var(--g-border);border-radius:12px";let G=_.map((Z,ie)=>{let oe=document.createElement("button");return oe.type="button",oe.setAttribute("role","tab"),oe.textContent=ii(k[ie])||String(ie+1),oe.style.cssText="flex:1;min-width:0;min-height:44px;padding:8px 16px;border:0;border-radius:8px;font:inherit;cursor:pointer",Z.id=`g-${S.id}-${k[ie].id}`,Z.setAttribute("role","tabpanel"),oe.setAttribute("aria-controls",Z.id),W.append(oe),oe}),se=(Z,ie=!1,oe=!1)=>{if(N[S.id]=k[Z].id,oe&&A&&Object.keys(r(A)).length){for(let ge of Object.keys(r(A)))delete N[ge];Yt(),tt({type:"selection",selection:Ue()}),ie&&qe.querySelector(`[data-g-node="${S.id}"] [role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0});return}_.forEach((ge,Me)=>{ge.hidden=Me!==Z,G[Me].setAttribute("aria-selected",String(Me===Z)),G[Me].tabIndex=Me===Z?0:-1,G[Me].style.background=Me===Z?"var(--g-primary)":"transparent",G[Me].style.color=Me===Z?"var(--g-on-primary)":"var(--g-text)"}),ie&&G[Z].focus(),rr()};G.forEach((Z,ie)=>{Z.addEventListener("click",oe=>{oe.stopPropagation(),se(ie,!1,!0)}),Z.addEventListener("keydown",oe=>{["ArrowLeft","ArrowRight","Home","End"].includes(oe.key)&&(oe.preventDefault(),oe.stopPropagation(),se(oe.key==="Home"?0:oe.key==="End"?_.length-1:(ie+(oe.key==="ArrowRight"?1:_.length-1))%_.length,!0,!0))})}),y.prepend(W);let fe=k.findIndex(Z=>Z.id===N[S.id]);se(fe>=0?fe:Math.min(b.defaultIndex,_.length-1))}else if(b.type==="toggle"){let k=document.createElement("button");k.type="button",k.setAttribute("role","switch"),k.className="g-btn g-btn-secondary",k.style.cssText="display:flex;align-items:center;justify-content:space-between;gap:16px;color:var(--g-text)";let W=document.createElement("span");W.textContent=_e(b.label).value;let G=document.createElement("span");G.setAttribute("aria-hidden","true"),G.style.cssText="position:relative;display:block;flex:none;width:44px;height:24px;border-radius:12px;background:var(--g-border)";let se=document.createElement("span");se.style.cssText="position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003",G.append(se),k.append(W,G);let fe=(Z,ie=!1)=>{if(N[S.id]=Z,ie&&A&&Object.keys(r(A)).length){for(let oe of Object.keys(r(A)))delete N[oe];Yt(),tt({type:"selection",selection:Ue()}),qe.querySelector(`[data-g-node="${S.id}"] [role="switch"]`)?.focus({preventScroll:!0});return}k.setAttribute("aria-checked",String(Z)),G.style.background=Z?"var(--g-primary)":"var(--g-border)",se.style.left=Z?"23px":"3px",se.style.background=Z?"var(--g-on-primary)":"#FFFFFF",_.forEach((oe,ge)=>oe.hidden=ge!==(Z?0:1)),rr()};k.addEventListener("click",Z=>{Z.stopPropagation(),fe(!N[S.id],!0),$r(S.id,!!N[S.id])}),y.prepend(k),fe(typeof N[S.id]=="boolean"?N[S.id]:b.defaultEnabled)}else{y.setAttribute("role","region"),y.setAttribute("aria-roledescription","carousel");let k=document.createElement("div");k.style.cssText="display:flex;align-items:center;justify-content:center;gap:10px";let W=document.createElement("button"),G=document.createElement("button"),se=document.createElement("span"),fe=V.startsWith("zh");W.textContent="\u2190",G.textContent="\u2192",W.setAttribute("aria-label",fe?"\u4E0A\u4E00\u6761\u8BC4\u4EF7":"Previous review"),G.setAttribute("aria-label",fe?"\u4E0B\u4E00\u6761\u8BC4\u4EF7":"Next review");for(let ie of[W,G])ie.type="button",ie.className="g-btn g-btn-secondary",ie.style.color="var(--g-text)";se.setAttribute("aria-live","polite");let Z=ie=>{O[S.id]=ie,_.forEach((oe,ge)=>oe.hidden=ge!==ie),se.textContent=`${ie+1} / ${_.length}`,rr()};W.addEventListener("click",ie=>{ie.stopPropagation(),Z((O[S.id]+_.length-1)%_.length)}),G.addEventListener("click",ie=>{ie.stopPropagation(),Z((O[S.id]+1)%_.length)}),k.append(W,se,G),y.append(k),Z(O[S.id]??0)}}}function ii(y){if(y.hidden)return"";if(y.type==="text"&&(y.variant==="title"||y.variant==="heading"))return _e(y.text).value;if(y.type==="stack")for(let S of y.children){let b=ii(S);if(b)return b}return""}function jc(y){return y.type==="stack"&&!y.interaction&&!y.purchaseAction}function No(y){let S=[],b=_=>{let P=E?.nodes[_.id];if(S.push(_.id,Ee(_.id)),P?.picker&&S.push(N[P.picker],E?.pickers[P.picker]),_.type==="text")S.push(Ot(_,"text",_.text));else if(_.type==="button")S.push(Ot(_,"label",_.label));else if(_.type==="image")S.push(Ot(_,"alt",_.alt));else if(_.type==="custom_html"){let T=Je(_);S.push(T,e.mode==="live"&&C?Re(T).map(k=>[k,Y(k)]):void 0)}else if(_.type==="customer_data")S.push(I?.nodes[_.id]);else if(_.type==="plan_picker"){let T=E?.pickers[_.id];S.push(N[_.id],z[_.id],T,P,T?.options.map(k=>E?.plans[k]))}else _.type==="stack"&&(_.interaction?.type!=="input"&&S.push(N[_.id],O[_.id]),t(_)&&S.push(N[_.interaction.pickerId],E?.pickers[_.interaction.pickerId]),_.children.forEach(b))};return b(y),JSON.stringify(S)}function Lc(y){y.hidden||(jc(y)?y.children.forEach(Lc):L.set(y.id,No(y)))}function Ma(y){if(y.type==="custom_html"){let b=jr(y.id),_=b&&J.get(b);_&&Pt(_)}let S=F.get(y.id);S!==void 0&&clearInterval(S),F.delete(y.id),y.type==="stack"&&y.children.forEach(Ma)}function Mc(y,S){if(y.hidden)return;if(jc(y)){y.children.forEach(P=>Mc(P,y));return}if(L.get(y.id)===No(y))return;let b=jr(y.id);if(!b)return;if(y.type==="custom_html"&&J.has(b)){Dt(b,y),L.set(y.id,No(y));return}Ma(y);let _=Di(y,S);_&&(b.replaceWith(_),L.set(y.id,No(y)))}function Fa(){let y=document.activeElement;if(!(y instanceof HTMLElement)||!qe.contains(y))return;let S=y.closest("[data-g-node]");if(!S)return;let b=[];for(let _=y;_!==S;){let P=_.parentElement;if(!P)return;b.unshift(Array.prototype.indexOf.call(P.children,_)),_=P}return{active:y,nodeId:S.dataset.gNode,path:b,identity:["productPeriod","planId","productTier","gDataFocus"].map(_=>[_,y.dataset[_]]).find(([,_])=>_!==void 0),selection:y instanceof HTMLInputElement&&y.selectionStart!==null?{start:y.selectionStart,end:y.selectionEnd,direction:y.selectionDirection}:void 0}}function za(y){if(!y||y.active.isConnected)return;let S=jr(y.nodeId);if(!S)return;let b=S;if(y.identity){let[_,P]=y.identity;b=[...S.querySelectorAll("*")].find(T=>T.dataset[_]===P)}else for(let _ of y.path)b=b?.children[_];!b||b.hasAttribute("disabled")||(b.focus({preventScroll:!0}),y.selection&&b instanceof HTMLInputElement&&["text","search","tel","url","password"].includes(b.type)&&b.setSelectionRange(y.selection.start,y.selection.end,y.selection.direction??void 0))}function Yt(y=!1){if(!A)return;let S=y?void 0:Fa(),b=A.pages.find(P=>P.id===(Q??A.initialPageId))??A.pages[0];if(Q=b.id,E){let P={},T=k=>{k.type==="stack"&&k.children.forEach(T),k.type==="plan_picker"&&typeof N[k.id]=="string"&&N[k.id]!==""&&(P[k.id]=String(N[k.id]))};T(b.root),Object.assign(N,i({...A,pages:[b]},Ue(),E)),Object.assign(N,P)}let _=P=>{if(P.type==="stack"&&P.children.forEach(_),P.type!=="plan_picker"||!P.grouping)return;let T=P.grouping,k=E?.pickers[P.id],W=z[P.id];if(!W){let se=T.assignments.find(fe=>fe.productVersionId===(N[P.id]??k?.selected));W={period:se?.period??"month",tierId:se?.tierId??T.tiers[0].id},z[P.id]=W}let G=T.assignments.find(se=>se.tierId===W.tierId&&se.period===W.period);N[P.id]=G&&k?.options.includes(G.productVersionId)?G.productVersionId:""};if(_(b.root),y||U!==b){U&&Ma(U.root),F.forEach(k=>clearInterval(k)),F.clear(),L.clear(),q.clear(),qe.style.cssText="",me(b.theme?{...A,theme:b.theme}:A);let P=V.split("-")[0];document.documentElement.lang=V,document.documentElement.dir=["ar","he","fa","ur"].includes(P)?"rtl":"ltr",qe.dataset.gPresentation=A.presentation.type;let T=Di(b.root,null);qe.replaceChildren(...T?[T]:[]),U=b,Lc(b.root)}else Mc(b.root,null);if(za(S),qe.dataset.gPage=b.id,e.mode==="live"&&tt({type:"page",pageId:b.id}),de)rr();else{$o(),Do();let P=Math.ceil(qe.getBoundingClientRect().height);de=!0,je=P,tt({type:"rendered",height:P,label:ii(b.root)||A.name})}}function rr(){let y=Math.ceil(qe.getBoundingClientRect().height);y!==je&&(je=y,tt({type:"resize",height:y})),$o(),Do()}function ji(){Ge||(Ge=!0,window.requestAnimationFrame(()=>{Ge=!1,rr()}))}function Do(){if(e.mode!=="editor")return;let y=[];for(let b of qe.querySelectorAll("[data-g-node]")){let _=b.getBoundingClientRect();!_.width||!_.height||y.push({id:b.dataset.gNode,x:_.x,y:_.y,width:_.width,height:_.height})}let S=JSON.stringify(y);S!==Pe&&(Pe=S,tt({type:"layout",nodes:y}))}function jr(y){if(!y||!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(y))return null;let S=q.get(y);return S?.isConnected?S:null}function Fc(y,S){let b=jr(S);if(!b){y.style.display="none";return}let _=b.getBoundingClientRect();y.style.display="block",y.style.left=`${_.left+window.scrollX}px`,y.style.top=`${_.top+window.scrollY}px`,y.style.width=`${_.width}px`,y.style.height=`${_.height}px`,y.toggleAttribute("data-below",_.top<20),y.firstChild.textContent=b.dataset.gLabel??""}function $o(){e.mode==="editor"&&(Fc(Kt,Ve),Fc(wt,pt&&pt!==Ve?pt:null))}function jo(y){for(let S of y.composedPath()){if(S instanceof HTMLElement&&S.dataset.gNode)return S.dataset.gNode;if(S===qe)break}return null}function zc(y){if(y.isTrusted){if(e.mode==="editor"){y.preventDefault(),y.stopPropagation(),tt({type:"select",id:jo(y)});return}for(let S of y.composedPath()){if(!(S instanceof HTMLElement))continue;let b=S.dataset.gAction??(S.tagName==="BUTTON"?S.getAttribute("data-grow-action"):null);if(b&&!S.disabled){y.preventDefault();let _=A?.actions.find(P=>P.id===b);if(_?.type==="navigate"){if(Q=_.pageId,A)for(let T of Object.keys(r(A)))delete N[T];Yt();let P=qe.querySelector("h1,h2")??qe;P===qe&&(qe.setAttribute("role","group"),qe.setAttribute("aria-label",A?.pages.find(T=>T.id===Q)?.name??A?.name??"Page")),P.tabIndex=-1,P.focus({preventScroll:!0});return}tt({type:"action",actionId:b,nodeId:jo(y)??void 0,...Object.keys(N).length?{selection:Ue()}:{},...C?{answers:Ro()}:{}});return}if(S===qe)return}}}function wd(y){let S=y;if(!(!S||S.channel!==e.channel))try{if(S.type==="render"){let b=S.doc;if(!b||b.kind!=="screen"||b.schemaVersion!==4||Object.hasOwn(b,"funnel")||!b.pages?.length||b.pages.length>(b.surface==="paywall"?10:1)||b.pages.some(_=>Object.hasOwn(_,"source"))||b.actions?.some(_=>!["event","close","open_url","claim_offer",...b.surface==="paywall"?["navigate"]:[]].includes(_.type)))throw new Error("Unsupported screen document; use the current Funnel runtime for flows");M.clear(),$=D=0,A=b,Q=null,V=String(S.locale),w=new Set,C=S.serverInput,N=g(),z=g(),E=S.capabilities,I=S.customerData,ri.clear();for(let[_,P]of Object.entries(E?.pickers??{}))P.selected&&(N[_]=P.selected);if(S.selection&&typeof S.selection=="object"&&!Array.isArray(S.selection)){let _=S.selection,P=k=>{let W=_[k.id];if(k.type==="quantity_picker"&&typeof W=="number"&&(N[k.id]=W),k.type==="plan_picker"&&typeof W=="string"&&k.planIds?.includes(W)&&(N[k.id]=W),k.type==="stack"){if(k.interaction?.type==="toggle"&&typeof W=="boolean"&&(N[k.id]=W),k.interaction&&["select","tabs"].includes(k.interaction.type)&&typeof W=="string"&&k.children.some(G=>G.id===W)&&(N[k.id]=W),t(k)){let G=_[k.interaction.pickerId];typeof G=="string"&&k.children.some(se=>se.type==="stack"&&se.bind?.plan===G)&&(N[k.interaction.pickerId]=G)}k.children.forEach(P)}};A.pages.forEach(k=>P(k.root));let T=_.__page;typeof T=="string"&&A.pages.some(k=>k.id===T)&&(Q=T)}for(let _ of C?.bindings??[])Object.hasOwn(C.answers,_.variable)&&(N[_.componentId]=C.answers[_.variable],w.add(_.componentId));O=g(),V=String(S.locale),Le(),Yt(!0)}else if(S.type==="capabilities"){E=S.capabilities;for(let[b,_]of Object.entries(E.quantities??{})){let P=jr(b),T=P?.querySelector('input[type="range"]');if(T){T.min=String(_.minimum),T.max=String(_.maximum),T.disabled=!_.available,T.setAttribute("aria-valuetext",_.label);let k=P?.querySelector("output");k&&(k.textContent=_.label)}}Le();for(let[b,_]of Object.entries(E.pickers))!z[b]&&(N[b]===void 0||N[b]==="")&&(N[b]=_.selected??"");Yt()}else S.type==="customer-data"?$c(S.data):S.type==="restore-action-focus"&&e.mode==="live"?[...qe.querySelectorAll("button[data-g-node]")].find(b=>b.dataset.gNode===S.nodeId&&!b.disabled)?.focus({preventScroll:!0}):S.type==="highlight"&&e.mode==="editor"&&(pt=S.hoverId??null,Ve=S.selectedId??null,$o())}catch(b){tt({type:"error",message:b instanceof Error?b.message:"render failed"})}}let Li=document.createElement("style");if(Li.textContent=m,document.head.append(Li),document.body.append(qe),e.mode==="editor"){document.body.dataset.gEditor="",document.body.append(wt,Kt),document.addEventListener("mouseover",S=>{let b=jo(S);b!==ot&&(ot=b,tt({type:"hover",id:b}))}),document.documentElement.addEventListener("mouseleave",()=>{ot!==null&&(ot=null,tt({type:"hover",id:null}))}),document.addEventListener("dblclick",S=>{let b=jo(S);b&&S.isTrusted&&tt({type:"edit",id:b})}),document.addEventListener("click",S=>{qe.contains(S.target)||tt({type:"select",id:null})});let y=(S,b)=>{if(!S.isTrusted)return;let _=S.metaKey||S.ctrlKey,P=S.key;(P===" "||b==="down"&&(["Delete","Backspace","Escape"].includes(P)||_&&/^[zysdcvg0=+-]$/i.test(P)))&&((_||P===" ")&&S.preventDefault(),tt({type:"key",key:{key:P,phase:b,meta:S.metaKey,ctrl:S.ctrlKey,shift:S.shiftKey,alt:S.altKey}}))};document.addEventListener("keydown",S=>y(S,"down")),document.addEventListener("keyup",S=>y(S,"up")),document.addEventListener("wheel",S=>{!S.isTrusted||!(S.ctrlKey||S.metaKey)||(S.preventDefault(),tt({type:"zoom",delta:S.deltaY}))},{passive:!1})}qe.addEventListener("click",zc),document.addEventListener("keydown",y=>{y.key==="Escape"&&y.isTrusted&&tt({type:"escape"})}),typeof ResizeObserver=="function"&&new ResizeObserver(ji).observe(qe),window.addEventListener("resize",ji),e.mode==="editor"&&window.addEventListener("scroll",Do),window.addEventListener("message",y=>{y.source===o&&wd(y.data)}),a.__indianaReceive=wd,tt({type:"ready"})}function KU(e,t){let r=JSON.stringify(e).replace(/</g,"\\u003c");return`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'nonce-${t}'; style-src 'unsafe-inline'; img-src https: data:; connect-src 'none'; font-src 'none'; media-src 'none'; frame-src 'none'; base-uri 'none'; form-action 'none'"></head><body><script type="application/json" id="grow-renderer-boot">${r}<\/script><script nonce="${t}">${UY}<\/script></body></html>`}var UY,WU=x(()=>{"use strict";UY=`(${zY.toString()})(JSON.parse(document.getElementById("grow-renderer-boot").textContent))`});function JU(e,t){return U1.set(e,t),()=>U1.delete(e)}function Ad(e){let t=e.defaultView?.HTMLElement,r=e.activeElement;for(let o=0;o<16&&r?.shadowRoot?.activeElement;o++)r=r.shadowRoot.activeElement;let i=r?U1.get(r)?.():void 0;return()=>{!r?.isConnected||!t||!(r instanceof t)||(r.focus({preventScroll:!0}),i?.())}}var U1,sy=x(()=>{"use strict";U1=new WeakMap});function QU(e){let t={display:"block",position:"fixed",top:"0",left:"0",opacity:"0",pointerEvents:"none",zIndex:"-1"},r=Object.keys(t).map(a=>{let s=a,c=e.style[s];return e.style[s]=t[s],[s,c]}),i=e.inert??!1,o=e.getAttribute("aria-hidden");return e.inert=!0,e.setAttribute("aria-hidden","true"),()=>{for(let[a,s]of r)e.style[a]=s;e.inert=i,o===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",o)}}var YU=x(()=>{"use strict"});function XU(e){return Object.assign(new Error(`Web View renderer did not start (${e.phase} timeout)`),{name:"RendererStartupError",code:"RENDERER_STARTUP_TIMEOUT",details:e})}function e6(e,t,r){let i=(()=>{let A=e.defaultView;if(!A)throw new Error("Renderer host has no browser window");return A})(),o=r?.hasAttribute("src")?"navigation":"handshake",a=o==="navigation"?1e4:5e3,s=0,c=0,u,l=!1,d=!1;function p(){if(u===void 0)return;i.clearTimeout(u),u=void 0;let A=Math.max(0,performance.now()-c);s+=A,a=Math.max(0,a-A)}function h(){l||(l=!0,p(),e.removeEventListener("visibilitychange",f),r?.removeEventListener("load",g))}function f(){if(!(l||d)){if(e.visibilityState==="hidden"){p();return}u===void 0&&(c=performance.now(),u=i.setTimeout(()=>{s+=Math.max(0,performance.now()-c),u=void 0,h(),t({phase:o,visibleMs:Math.round(s)})},a))}}function m(A){l||o===A||o==="render"||(p(),o=A,a=5e3,f())}function g(){o==="navigation"&&m("handshake")}return r?.addEventListener("load",g,{once:!0}),e.addEventListener("visibilitychange",f),f(),Object.assign(h,{ready:()=>{d=!1,m("render"),f()},awaitContent:()=>{l||o==="render"||(p(),d=!0,m("render"))}})}var t6=x(()=>{"use strict"});function VY(e,t,r,i,o=document){let a=crypto.randomUUID(),s=crypto.randomUUID().replaceAll("-",""),c=o.createElement("iframe");c.title=t,c.setAttribute("sandbox","allow-scripts"),c.referrerPolicy="no-referrer";let u=o.defaultView,l=1;for(;u!==window&&l<16;)u=u.parent,l++;if(u!==window)throw new Error("Renderer container must belong to this host or a descendant window");let d={channel:a,parentOrigin:window.origin,hostDepth:l,mode:e,...e==="editor"?{editorMessages:r}:{}};if(i==="bundled"){if(e!=="live")throw new Error("Bundled renderer requires live mode");c.src="data:text/html;charset=utf-8,"+encodeURIComponent(ok.html)+"#"+encodeURIComponent(JSON.stringify(d))}else if(i){if(e!=="live")throw new Error("Hosted Web Views only support live rendering");let f=new URL(i);if(f.username||f.password||f.search||f.hash||!/^\/web-view\/renderer\/[a-f0-9]{64}$/.test(f.pathname)||f.protocol!=="https:"&&!(f.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(f.hostname)))throw new Error("Invalid hosted renderer URL");f.hash=encodeURIComponent(JSON.stringify(d)),c.src=f.href}else c.srcdoc=KU(d,s);return{frame:c,post:f=>c.contentWindow?.postMessage({...f,channel:a},"*"),accept:f=>f.source===c.contentWindow&&f.origin==="null"&&f.data&&typeof f.data=="object"&&"channel"in f.data&&"type"in f.data&&typeof f.data.type=="string"&&f.data.channel===a?f.data:null}}function cy(e,t={}){let r=(()=>{let N=e.ownerDocument.defaultView;if(!N)throw new Error("Preview container has no browser window");return N})(),i=t.mode??"editor",o=ZU(r),{frame:a,post:s,accept:c}=VY(i,t.title??"\u5F39\u7A97\u9884\u89C8",t.editorMessages,t.rendererUrl,e.ownerDocument);a.style.cssText="display:block;border:0;width:100%;height:0";let u=!1,l=!1,d=null,p=null,h=!1,f,m=JU(a,()=>f),g,A,C=new Promise((N,O)=>{g=N,A=O});C.catch(()=>{});let w=e6(e.ownerDocument,N=>{if(h||l)return;let O=XU(N);A(O),rt(t.onError,O.message),E()},a);function E(){h||(h=!0,m(),f=void 0,o.destroy(),w(),u||A(new Error("Web View mount cancelled")),window.removeEventListener("message",U),u=!1,d=null,p=null,I=null,q=void 0,X.clear(),a.remove(),a.removeAttribute("srcdoc"),a.removeAttribute("src"))}let I=null,F={},L,q,H="modal",X=new Set,M=t.viewportHeight,J=0,$=N=>{J=N;let O=M,z=O?H==="fullscreen"?O:Math.max(1,Math.min(N,O-(H==="sheet"?0:32))):N;a.style.height=`${z}px`,rt(t.onResize,z)};function D(N){if(!q)return;let O=Gr.safeParse(N);if(!O.success||Object.keys(O.data).some(z=>!q.bindings.some(V=>V.variable===z))){rt(t.onError,"Invalid current-screen answers");return}return O.data}function U(N){let O=h?null:c(N);if(O)if(O.type==="ready")u=!0,g(),d&&s(d),d?w.ready():w.awaitContent(),p&&s(p);else if(O.type==="rendered"||O.type==="resize")$(O.height),O.type==="rendered"&&(l=!0,w(),rt(t.onRendered));else if(O.type==="layout"&&i==="editor")Array.isArray(O.nodes)&&O.nodes.length<=(I?fn.nodes:0)&&O.nodes.every(z=>z&&typeof z.id=="string"&&/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(z.id)&&[z.x,z.y,z.width,z.height].every(V=>typeof V=="number"&&Number.isFinite(V))&&z.width>0&&z.height>0)&&rt(t.onLayout,O.nodes);else if(O.type==="page"&&i==="live"&&X.has(O.pageId))rt(t.onPageChange,O.pageId);else if(O.type==="escape"&&i==="live")rt(t.onEscape);else if(O.type==="hover")rt(t.onHover,O.id);else if(O.type==="select")rt(t.onSelect,O.id);else if(O.type==="edit")rt(t.onEdit,O.id);else if(O.type==="key"&&i==="editor"){let z=O.key;z&&typeof z.key=="string"&&z.key.length<=16&&(z.phase==="down"||z.phase==="up")&&[z.meta,z.ctrl,z.shift,z.alt].every(V=>typeof V=="boolean")&&rt(t.onKey,{key:z.key,phase:z.phase,meta:z.meta,ctrl:z.ctrl,shift:z.shift,alt:z.alt})}else if(O.type==="zoom"&&i==="editor"&&typeof O.delta=="number"&&Number.isFinite(O.delta))rt(t.onZoom,O.delta);else if(O.type==="customer-data-intent"&&i==="live"&&I){let z=Ow.safeParse(O.intent);z.success&&Pn(I,z.data.nodeId)?.type==="customer_data"&&rt(t.onCustomerDataIntent,z.data)}else if(O.type==="answers"&&i==="live"&&q){let z=D(O.answers);z&&rt(t.onAnswers,z)}else if(O.type==="selection"&&I&&d?.type==="render"&&d.capabilities){let z=$f(I,O.selection,d.capabilities);F=z;let V=Zl(I,L??d.capabilities,z,d.locale);s({type:"capabilities",capabilities:V}),rt(t.onSelection,z)}else if(O.type==="action"&&I?.actions.some(z=>z.id===O.actionId)){let z=D(O.answers);if(q&&!z)return;let V=I,de=O.nodeId?Pn(V,O.nodeId):void 0;f=i==="live"&&de?.type==="button"&&de.action===O.actionId?()=>{!h&&I===V&&s({type:"restore-action-focus",nodeId:de.id})}:void 0,rt(t.onAction,O.actionId,$f(I,O.selection,d?.type==="render"?d.capabilities:void 0),z)}else O.type==="error"&&rt(t.onError,O.message)}window.addEventListener("message",U),e.append(a);let Q={ready:C,get document(){return I},updateCustomerData(N){if(h||!I)return;let O=Gs.parse(N),z={nodes:Object.fromEntries(Object.entries(O.nodes).filter(([V,de])=>{let je=Pn(I,V);return je?.type==="customer_data"&&je.data.source===de.source}))};d?.type==="render"&&(d.customerData=z),u&&s({type:"customer-data",data:z})},updateCapabilities(N){if(h||!I)return;L=N;let O=o.prepare(Zl(I,N,F,d?.type==="render"?d.locale:"en"),I);O&&(d?.type==="render"&&JSON.stringify(d.capabilities)===JSON.stringify(O)||(d?.type==="render"&&(d.capabilities=O),u&&s({type:"capabilities",capabilities:O})))},update(N,O,z){if(h)return;let V;try{let de=HU(N,r),je=i==="live"&&!!z?.serverInput,Ge=je?Pl(de,[O]):O,Pe=je?Dw(de,Ge):de,pt=z?.serverInput?k_.parse(z.serverInput):void 0;if(pt&&(de.surface!=="paywall"&&de.pages.length!==1||de.actions.some(qe=>qe.type!=="event"&&qe.type!=="navigate"||qe.close)||pt.bindings.some(qe=>{let wt=Pn(de,qe.componentId);return wt?.type!=="stack"||!wt.interaction||!["input","multiselect","select","tabs","toggle"].includes(wt.interaction.type)})))throw new Error("Current Funnel input requires one screen with bound interactive controls and output actions");let Ve=Vn.parse(z?.parameters??{}),ot=z?.customerData?Gs.parse(z.customerData):void 0;if(i==="live"&&!z?.reset&&d?.type==="render"&&(z?.capabilities!==void 0||d.capabilities===void 0)&&JSON.stringify([d.doc,d.locale,d.parameters,d.serverInput,d.selection])===JSON.stringify([Pe,Ge,Ve,pt,z?.selection])){z?.capabilities&&Q.updateCapabilities(z.capabilities),JSON.stringify(d.customerData)!==JSON.stringify(ot)&&(Q.updateCustomerData(ot??{nodes:{}}),d.customerData=ot);return}I=Pe,L=z?.capabilities,F=z?.selection??{},q=pt,H=de.presentation.type,X=new Set(de.pages.map(qe=>qe.id)),V={type:"render",doc:Pe,...pt?{serverInput:pt}:{},locale:Ge,parameters:Ve,capabilities:o.prepare(z?.capabilities?Zl(Pe,z.capabilities,z.selection??{},Ge):void 0,de),...z?.selection?{selection:z.selection}:{},customerData:ot},H==="fullscreen"&&M&&$(M)}catch(de){rt(t.onError,de instanceof Error?de.message:"\u5185\u5BB9\u4E0D\u6B63\u786E");return}d=V,u&&(s(V),w.ready())},resizeViewport(N){h||!Number.isFinite(N)||N<=0||(M=N,$(J))},highlight(N,O){h||(p={type:"highlight",hoverId:N,selectedId:O},u&&s(p))},destroy:E};return Q}var V1=x(()=>{"use strict";ik();UM();GU();WU();Ea();sy();t6()});async function a6(e,t,r){if(t.status!=="complete")throw new K("INVALID_RESPONSE","A verified completed purchase is required");if(await r.onComplete?.(t),!e||!r.check)return;let i=Br.parse(await r.check());if(i.internal_feature_id!==e.internal_feature_id||i.quantity!==e.quantity)throw new K("INVALID_RESPONSE","The access requirement changed");i.allowed&&await r.onAccessGranted?.(i)}var s6=x(()=>{"use strict";gn();gr()});var Z1={};Ie(Z1,{mountScreenPreview:()=>cy});var H1=x(()=>{V1()});async function my(e,t){let r=t.check?Br.parse(await t.check()):null;if(r?.allowed)return await t.onAccessGranted?.(r),{check:r,host:null};let i=Ad(e.ownerDocument),o=await t.start(),a=o.view??await o.refresh();if(!a)throw new K("INVALID_RESPONSE","Paywall presentation is missing");let{mountScreenPreview:s}=await Promise.resolve().then(()=>(H1(),Z1)),c=e.ownerDocument,u=new AbortController,l=c.createElement("section"),d=c.createElement("div"),p=c.createElement("div"),h=c.createElement("p"),f=c.createElement("button"),m=c.createElement("button"),g=c.createElement("dialog"),A=a.document.screen.strings.defaultLocale.startsWith("zh");l.dataset.indianaPaywall="",l.setAttribute("aria-label",a.document.name),l.style.cssText="width:100%;box-sizing:border-box;background:#fff;color:#172033;font:14px/1.5 system-ui,sans-serif",p.style.cssText="display:flex;gap:12px;padding:12px 20px;align-items:center;flex-wrap:wrap",h.setAttribute("role","status"),m.textContent=A?"\u5173\u95ED":"Close",f.textContent=A?"\u91CD\u8BD5":"Retry",f.hidden=!0,p.append(h,f,m),l.append(d,p);let C=a.document.presentation,w,E=!1,I=!1,F=null,L=!1,q=()=>!L&&t.canInteract?.()!==!1,H=!1,X=null,M=null,J=V=>{h.textContent=V instanceof Error?V.message:A?"\u8BF7\u6C42\u5931\u8D25":"Request failed",rt(t.onError,V),f.hidden=X===null};async function $(V){if(!(I||E||!q())){I=!0,f.hidden=!0,h.textContent="";try{await V()}catch(de){E||J(de)}finally{I=!1}}}async function D(V){await a6(r,V,t)}async function U(V){if(E)return;if(!q()){X=async()=>U(await o.read()),f.hidden=!1;return}if(h.textContent=V.status,V.status==="complete"){X=null,await D(V);return}if(V.status!=="pending"){if(o.canReselect===!1){h.textContent=A?"\u6B63\u5728\u6838\u5BF9\u539F\u8D2D\u4E70\u7ED3\u679C":"Checking the original purchase result",f.textContent=A?"\u67E5\u8BE2\u7ED3\u679C":"Check result",X=async()=>U(await o.read()),f.hidden=!1;return}f.textContent=A?"\u91CD\u8BD5":"Retry",X=null,F=null;return}let de=Date.now()+6e5,je=2e3;for(;!E&&Date.now()<de;){if(await new Promise(Pe=>{let pt=()=>{clearTimeout(Ve),Pe()},Ve=setTimeout(()=>{u.signal.removeEventListener("abort",pt),Pe()},je);u.signal.addEventListener("abort",pt,{once:!0})}),E)return;if(!q()){X=async()=>U(await o.read()),f.hidden=!1;return}let Ge=await o.read();if(Ge.status!=="pending"){await U(Ge);return}je=Math.min(je*1.5,3e4)}X=async()=>U(await o.read()),f.hidden=!1}async function Q(){M?.remove(),M=null,X=Q;let V=await o.confirm();if(!q()){X=Q,f.hidden=!1;return}if(V.status==="pending"){if(V.checkoutUrl)t.onCheckoutUrl?await t.onCheckoutUrl(V.checkoutUrl):c.defaultView?.location.assign(V.checkoutUrl);else if(V.execution||V.nativePurchase){if(!t.onPurchase)throw new K("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await t.onPurchase({operation:V,signal:u.signal})}}X=async()=>U(await o.read()),await U(V)}function N(V){M?.remove();let de=c.createElement("div"),je=c.createElement("button"),Ge=c.createElement("button"),Pe=c.createElement("p");Pe.textContent=V.lines.map(ot=>ot.productName).join(", ")+" \xB7 "+Cs(V.charge?.totalMinor??V.catalogAmountMinor-(V.discount?.amountMinor??0),V.currency),je.textContent=A?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",Ge.textContent=A?"\u53D6\u6D88":"Cancel",je.onclick=()=>{$(Q)};let pt=async()=>{let ot=await o.cancel();E||(de.remove(),M=null,await U(ot))};Ge.onclick=()=>{X=pt,$(pt)};let Ve=c.createElement("div");for(let ot of V.lines){let qe=c.createElement("p");qe.textContent=`${ot.productName} \xB7 ${Cs(ot.catalogAmountMinor,V.currency)}${ql(ot.interval,A?"zh-CN":"en",ot.intervalCount??1)}`,Ve.append(qe);for(let wt of ot.prepaid??[]){let Kt=c.createElement("p"),tt=o.view?.capabilities.plans[ot.productVersionId]?.prepaid?.find(Sr=>Sr.internalFeatureId===wt.internal_feature_id);Kt.textContent=`${tt?.name??wt.internal_feature_id} \xB7 ${wt.quantity} ${A?"\u4EFD":"packs"} \xD7 ${wt.terms.units}`,tt&&(Kt.textContent+=ql(tt.reset==="week"||tt.reset==="month"||tt.reset==="year"?tt.reset:"one_time",A?"zh-CN":"en",tt.resetCount)),Ve.append(Kt)}if(ot.trial){let wt=c.createElement("p");wt.textContent=A?`\u8BD5\u7528 ${ot.trial.days} \u5929\uFF1B${ot.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${ot.trial.days}; ${ot.trial.cardRequired?"a payment method is required":"no payment method is required"}`,Ve.append(wt)}}if(!V.charge){let ot=c.createElement("p");ot.textContent=A?"\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.",Ve.append(ot)}de.append(Pe,Ve,je,Ge),p.prepend(de),M=de,X=null}async function O(){if(!F)return;if(X=O,!H){let de=o.view,je=de?.document.buttons[F.actionId],Ge=de&&je?.type==="checkout"?ya(je.product,F.selection,de.capabilities):null;if(!Ge)throw new K("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let Pe=await t.resolveOfferId?.({actionId:F.actionId,productVersionId:Ge});if(E)return;Pe!==void 0&&(F.offerId=Pe),H=!0}if(!q()){f.hidden=!1;return}let V=await o.preview(F);E||N(V)}function z(V="destroy"){E||(E=!0,u.abort(),w?.destroy(),o.destroy(),g.open&&g.close(),g.remove(),l.remove(),i(),V==="dismiss"&&rt(t.onDismiss))}m.onclick=()=>{q()&&z("dismiss")},g.addEventListener("cancel",V=>{V.preventDefault(),q()&&z("dismiss")}),f.onclick=()=>{X&&$(X)};try{if(C.type==="inline")e.append(l);else{let V={sm:420,md:640,lg:900};g.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in C?V[C.size]+"px":"100vw"}`,g.setAttribute("aria-label",a.document.name),g.append(l),e.append(g),q()&&g.showModal()}w=s(d,{mode:"live",rendererUrl:o.webViewUrl,title:a.document.name,onAction(V,de={}){if(!q())return;let je=o.view,Ge=je?.document.buttons[V];if(!Ge)return;if(Ge.type==="close"){$(async()=>{await t.onAction?.(V),z(t.onAction?"action":"dismiss")});return}if(Ge.type==="action"){X=async()=>{if(Ge.action.type==="event"){if(!t.onEvent)throw new K("EVENT_HANDLER_REQUIRED","Provide the event handler");await t.onEvent(Ge.action.event)}else t.onOpenUrl?await t.onOpenUrl(Ge.action.url):c.defaultView?.location.assign(Ge.action.url);await t.onAction?.(V),X=null},$(X);return}if((o.quote||F)&&o.canReselect===!1){X=o.quote?async()=>U(await o.read()):O,$(X);return}let Pe=je&&ya(Ge.product,de,je.capabilities);if(!je||!Pe){J(new K("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(t.onPurchaseIntent){X=null,$(async()=>{let pt={actionId:V,productVersionId:Pe,selection:structuredClone(de),featureQuantities:yc(je.document.screen,Pe,de,je.capabilities)};await t.onPurchaseIntent(pt)});return}if(F&&F.actionId!==V){J(new K("COMMAND_PENDING","Finish the current purchase"));return}F||(F={requestId:crypto.randomUUID(),actionId:V,selection:de},H=!1),$(O)},onEscape:()=>{q()&&z("dismiss")},onError:V=>J(new Error(V))}),w.update(a.document.screen,a.document.screen.strings.defaultLocale,{capabilities:a.capabilities,serverInput:{bindings:[],answers:{}}}),await w.ready}catch(V){throw z(),V}return{check:r,host:{setSuspended(V){L=V,l.hidden=V,V&&g.open?g.close():!V&&!E&&C.type!=="inline"&&!g.open&&g.showModal()},destroy:z,refresh:async()=>{if(!q()){if(o.view)return o.view;throw new K("PRECONDITION_FAILED","Paywall presentation is suspended")}let V=await o.refresh();return E||w?.updateCapabilities(V.capabilities),V}}}}var G1=x(()=>{"use strict";gn();gr();Ea();sy();s6()});function HY(e){return e==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}function Ay(e){var t=by.get(e);return t||(t={element:e,attributes:{}},by.set(e,t)),t}function xy(e,t,r,i,o){var a=r(e),s={isDirty:!1,originalValue:a,virtualValue:a,mutations:[],el:e,_positionTimeout:null,observer:new MutationObserver(function(){if(!pX&&!(t==="position"&&s._positionTimeout)){t==="position"&&(s._positionTimeout=setTimeout(function(){s._positionTimeout=null},1e3));var c=r(e);t==="position"&&c.parentNode===s.virtualValue.parentNode&&c.insertBeforeNode===s.virtualValue.insertBeforeNode||c!==s.virtualValue&&(s.originalValue=c,o(s))}}),mutationRunner:o,setValue:i,getCurrentValue:r};return t==="position"&&e.parentNode?s.observer.observe(e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):s.observer.observe(e,HY(t)),s}function Sy(e,t){var r=t.getCurrentValue(t.el);t.virtualValue=e,e&&typeof e!="string"?(!r||e.parentNode!==r.parentNode||e.insertBeforeNode!==r.insertBeforeNode)&&(t.isDirty=!0,g6()):e!==r&&(t.isDirty=!0,g6())}function GY(e){var t=e.originalValue;e.mutations.forEach(function(r){return t=r.mutate(t)}),Sy(sX(t),e)}function KY(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(r){return r.mutate(t)}),Sy(Array.from(t).filter(Boolean).join(" "),e)}function WY(e){var t=e.originalValue;e.mutations.forEach(function(r){return t=r.mutate(t)}),Sy(t,e)}function JY(e){var t=e.parentSelector,r=e.insertBeforeSelector,i=document.querySelector(t);if(!i)return null;var o=r?document.querySelector(r):null;return r&&!o?null:{parentNode:i,insertBeforeNode:o}}function QY(e){var t=e.originalValue;e.mutations.forEach(function(r){var i=r.mutate(),o=JY(i);t=o||t}),Sy(t,e)}function b6(e){var t=Ay(e);return t.html||(t.html=xy(e,"html",YY,XY,GY)),t.html}function A6(e){var t=Ay(e);return t.position||(t.position=xy(e,"position",eX,tX,QY)),t.position}function x6(e){var t=Ay(e);return t.classes||(t.classes=xy(e,"class",rX,nX,KY)),t.classes}function S6(e,t){var r=Ay(e);return r.attributes[t]||(r.attributes[t]=xy(e,t,iX(t),oX(t),WY)),r.attributes[t]}function aX(e,t){var r=by.get(e);if(r)if(t==="html"){var i,o;(i=r.html)==null||(o=i.observer)==null||o.disconnect(),delete r.html}else if(t==="class"){var a,s;(a=r.classes)==null||(s=a.observer)==null||s.disconnect(),delete r.classes}else if(t==="position"){var c,u;(c=r.position)==null||(u=c.observer)==null||u.disconnect(),delete r.position}else{var l,d,p;(l=r.attributes)==null||(d=l[t])==null||(p=d.observer)==null||p.disconnect(),delete r.attributes[t]}}function sX(e){return hy||(hy=document.createElement("div")),hy.innerHTML=e,hy.innerHTML}function gy(e,t,r){if(r.isDirty){r.isDirty=!1;var i=r.virtualValue;r.mutations.length||aX(e,t),r.setValue(e,i)}}function cX(e,t){e.html&&gy(t,"html",e.html),e.classes&&gy(t,"class",e.classes),e.position&&gy(t,"position",e.position),Object.keys(e.attributes).forEach(function(r){gy(t,r,e.attributes[r])})}function g6(){by.forEach(cX)}function uX(e,t){var r=null;e.kind==="html"?r=b6(t):e.kind==="class"?r=x6(t):e.kind==="attribute"?r=S6(t,e.attribute):e.kind==="position"&&(r=A6(t)),r&&(r.mutations.push(e),r.mutationRunner(r))}function lX(e,t){var r=null;if(e.kind==="html"?r=b6(t):e.kind==="class"?r=x6(t):e.kind==="attribute"?r=S6(t,e.attribute):e.kind==="position"&&(r=A6(t)),!!r){var i=r.mutations.indexOf(e);i!==-1&&r.mutations.splice(i,1),r.mutationRunner(r)}}function v6(e){if(!(e.kind==="position"&&e.elements.size===1)){var t=new Set(e.elements),r=document.querySelectorAll(e.selector);r.forEach(function(i){t.has(i)||(e.elements.add(i),uX(e,i))})}}function dX(e){e.elements.forEach(function(t){return lX(e,t)}),e.elements.clear(),Y1.delete(e)}function y6(){Y1.forEach(v6)}function mX(){typeof document>"u"||(W1||(W1=new MutationObserver(function(){y6()})),y6(),W1.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}function vy(e){return typeof document>"u"?Q1:(Y1.add(e),v6(e),{revert:function(){dX(e)}})}function J1(e,t){return vy({kind:"html",elements:new Set,mutate:t,selector:e})}function w6(e,t){return vy({kind:"position",elements:new Set,mutate:t,selector:e})}function vd(e,t){return vy({kind:"class",elements:new Set,mutate:t,selector:e})}function yy(e,t,r){return ZY.test(t)?t==="class"||t==="className"?vd(e,function(i){var o=r(Array.from(i).join(" "));i.clear(),o&&o.split(/\s+/g).filter(Boolean).forEach(function(a){return i.add(a)})}):vy({kind:"attribute",attribute:t,elements:new Set,mutate:r,selector:e}):Q1}function fX(e){var t=e.selector,r=e.action,i=e.value,o=e.attribute,a=e.parentSelector,s=e.insertBeforeSelector;if(o==="html"){if(r==="append")return J1(t,function(c){return c+(i??"")});if(r==="set")return J1(t,function(){return i??""})}else if(o==="class"){if(r==="append")return vd(t,function(c){i&&c.add(i)});if(r==="remove")return vd(t,function(c){i&&c.delete(i)});if(r==="set")return vd(t,function(c){c.clear(),i&&c.add(i)})}else if(o==="position"){if(r==="set"&&a)return w6(t,function(){return{insertBeforeSelector:s,parentSelector:a}})}else{if(r==="append")return yy(t,o,function(c){return c!==null?c+(i??""):i??""});if(r==="set")return yy(t,o,function(){return i??""});if(r==="remove")return yy(t,o,function(){return null})}return Q1}var ZY,Q1,by,Y1,YY,XY,eX,tX,nX,rX,iX,oX,hy,pX,W1,hX,X1,_6=x(()=>{ZY=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Q1={revert:function(){}},by=new Map,Y1=new Set;YY=function(t){return t.innerHTML},XY=function(t,r){return t.innerHTML=r};eX=function(t){return{parentNode:t.parentElement,insertBeforeNode:t.nextElementSibling}},tX=function(t,r){r.insertBeforeNode&&!r.parentNode.contains(r.insertBeforeNode)||r.parentNode.insertBefore(t,r.insertBeforeNode)};nX=function(t,r){return r?t.className=r:t.removeAttribute("class")},rX=function(t){return t.className};iX=function(t){return function(r){var i;return(i=r.getAttribute(t))!=null?i:null}},oX=function(t){return function(r,i){return i!==null?r.setAttribute(t,i):r.removeAttribute(t)}};pX=!1;mX();hX={html:J1,classes:vd,attribute:yy,position:w6,declarative:fX},X1=hX});function wy(e,t=()=>{}){let r=new WeakMap,i=0,o=a=>{let s=r.get(a);if(s!==void 0)return s;let c=[],u=a,l=!0;for(;u;){let d=r.get(u);if(d!==void 0){l=d;break}if(++i>8192||c.length>=256)throw Error("IAM render ancestry budget exceeded");if(c.push(u),t(),u.hasAttribute("hidden")||/(?:^|;)\s*display\s*:\s*none\s*(?:!\s*important\s*)?(?:;|$)/i.test(u.getAttribute("style")??"")){l=!1;break}u=u.parentElement}for(let d of c)r.set(d,l);return l};return a=>{let s=0,c=e.querySelectorAll(a);for(let u=0;u<c.length;u++){let l=c[u];if(!l)throw Error("IAM render selection changed");o(l)&&s++,t()}return s}}var eP=x(()=>{"use strict"});function I6(e){if(!gX(e)||Object.keys(e).some(a=>!["schemaVersion","renderKey","routeTemplate","selectors","present","absent"].includes(a))||e.schemaVersion!==1||typeof e.renderKey!="string"||!e.renderKey||e.renderKey.length>256||typeof e.routeTemplate!="string"||!e.routeTemplate.startsWith("/")||e.routeTemplate.length>2048||!Array.isArray(e.selectors)||e.selectors.length>512||e.selectors.some(a=>typeof a!="string"||a.length>512||!/^[a-z][a-z0-9-]*\[(?:id|data-testid|data-test|data-qa|data-indiana-id)="(?:[^"\\\x00-\x1f\x7f]|\\["\\])*"\]$/.test(a))||!Array.isArray(e.present)||!Array.isArray(e.absent))throw new Error("Invalid IAM render guard");if(e.present.length===0)throw Error("IAM render needs positive source evidence");let t=e.selectors,r=e.present,i=e.absent,o=[...r,...i];if(new Set(t).size!==t.length||o.length!==t.length||new Set(o).size!==o.length||o.some(a=>typeof a!="number"||!Number.isInteger(a)||a<0||a>=t.length))throw new Error("Invalid IAM render signature");return{schemaVersion:1,renderKey:e.renderKey,routeTemplate:e.routeTemplate,selectors:e.selectors,present:e.present,absent:e.absent}}function yX(e,t){let r=e.split("/").filter(Boolean),i="";for(let o of r)/^\[\[\.\.\.[^\[\]]+\]\]$/.test(o)?i+="(?:/[^/]+)*":/^\[\.\.\.[^\[\]]+\]$/.test(o)?i+="(?:/[^/]+)+":/^\[[^\[\]]+\]$/.test(o)?i+="/[^/]+":i+="/"+o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp("^"+(i?i+"/?":"/")+"$").test(t)&&!/[\[\]]/.test(t)}function k6(e,t,r,i,o=wy(t,i)){if(!yX(e.routeTemplate,r))return!1;let a=new Set(e.present),s=!0;for(let c=0;c<e.selectors.length;c++){let u=o(e.selectors[c]);if(a.has(c)&&u>1)throw new Error("IAM render anchor is ambiguous");(a.has(c)?u!==1:u!==0)&&(s=!1),i()}return s}var gX,tP=x(()=>{"use strict";eP();gX=e=>!!e&&typeof e=="object"&&!Array.isArray(e)});function iP(e){rP.add(e)}function bX(e){let t=new Set,r=new Set,i,o=0,a=!1,s=0,c,u=()=>{t.size||o||(i?.disconnect(),c!==void 0&&cancelAnimationFrame(c),e.removeEventListener("visibilitychange",p),nP.delete(e))};function l(h){if(e.hidden)return;let f=performance.now(),m=new Map,g=new Map,A=()=>{if(performance.now()-f>8)throw new Nc},C=H=>{A();let X=m.get(H);return X||(X=e.querySelectorAll(H),m.set(H,X)),A(),X},w=wy({querySelectorAll:C},A),E=H=>{let X=H.filter($=>!m.has($));if(!X.length)return;let M=new Map;for(let $ of X){let D=/^([a-z][a-z0-9-]*)\[(id|data-testid|data-test|data-qa|data-indiana-id)="((?:[^"\\\x00-\x1f\x7f]|\\["\\])*)"\]$/.exec($);if(!D)throw Error("Invalid IAM render selector");let[,U,Q,N]=D,O=N.replace(/\\(["\\])/g,"$1"),z=M.get(U);z||M.set(U,z=new Map);let V=z.get(Q);V||z.set(Q,V=new Map);let de=V.get(O);de||V.set(O,de=[]),m.set($,de)}A();let J=e.querySelectorAll(X.join(","));if(A(),J.length>8192)throw Error("IAM render selection budget exceeded");for(let $ of J){let D=M.get($.localName.toLowerCase());if(D)for(let[U,Q]of D){let N=$.getAttribute(U);N!==null&&Q.get(N)?.push($)}A()}},I={query:C,checkpoint:A,matches(H,X){let M=g.get(X);if(!M){try{let J=!1;M={match:k6(H,e,location.pathname,A,$=>(J||(E(H.selectors),J=!0),w($)))}}catch(J){M={error:J}}g.set(X,M)}if("error"in M)throw M.error;return M.match}},F=[],L=[],q=[];for(let H of h)if(t.has(H))try{F.push({job:H,commit:H.prepare(I)})}catch(X){if(X instanceof Nc)throw X;L.push({job:H,error:X})}A();for(let{job:H,error:X}of L)t.has(H)&&H.fail(X);for(let{job:H,commit:X}of F)if(t.has(H))try{A(),X(M=>q.push(M))}catch(M){if(M instanceof Nc)throw M;H.fail(M)}for(let H of q)H()}function d(h){if(!(c!==void 0||e.hidden))try{l(h),s=0}catch(f){if(!(f instanceof Nc))throw f;for(let m of[...t])m.suspend();if(s++>=2){for(let m of[...t])m.fail(f);return}c=requestAnimationFrame(()=>{c=void 0,d([...t])})}}function p(){a||!t.size||e.hidden||(a=!0,queueMicrotask(()=>{a=!1,d([...t])}))}return{begin(){o++},end(){--o===0&&(r.clear(),d([...t])),u()},add(h){return i||(i=new MutationObserver(f=>{let m=g=>rP.has(g)||!!(g.parentNode&&rP.has(g.parentNode));f.some(g=>!m(g.target)&&!(g.type==="childList"&&[...g.addedNodes,...g.removedNodes].length>0&&[...g.addedNodes,...g.removedNodes].every(m)))&&p()}),i.observe(e.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","hidden","data-indiana-id","data-indiana-release","data-testid","id","name"]}),e.addEventListener("visibilitychange",p)),t.add(h),o?r.add(h):d([h]),()=>{t.delete(h),r.delete(h),u()}}}}function AX(){let e=nP.get(document);return e||(e=bX(document),nP.set(document,e)),e}function E6(e){return AX().add(e)}var Nc,nP,rP,C6=x(()=>{"use strict";eP();tP();Nc=class extends Error{constructor(){super("IAM page check exceeded its work budget")}},nP=new WeakMap,rP=new WeakSet});function O6(e){return(!oP||P6!==window)&&(oP=Mh(window),P6=window),oP.sanitize(e,{USE_PROFILES:{html:!0},FORBID_TAGS:["form","input","textarea","select","button","style"]})}function T6(e){let t={...e};if(!["html","class","style","position","href","src","alt","title","id","role","hidden"].includes(t.attribute)&&!/^(aria|data)-[a-z0-9_-]+$/.test(t.attribute))throw new Error("Unsupported visual attribute");document.querySelector(t.selector);for(let r of document.querySelectorAll(t.selector))if(["SCRIPT","IFRAME","OBJECT","EMBED","HTML","HEAD"].includes(r.tagName)||r.tagName==="BODY"&&t.attribute==="html")throw new Error("Protected visual target");if(t.attribute==="html"&&(t.value=O6(t.value??"")),["href","src"].includes(t.attribute)&&t.action!=="remove"){let r=new URL(t.value??"",location.href);if(!["https:","http:","mailto:","tel:"].includes(r.protocol)||t.attribute==="src"&&!["https:","http:"].includes(r.protocol))throw new Error("Unsafe visual URL")}return t.parentSelector&&document.querySelector(t.parentSelector),t.insertBeforeSelector&&document.querySelector(t.insertBeforeSelector),t}function R6(e,t={}){if(e.renderGuard&&!t.requireUniqueTargets)throw new Error("IAM render guard requires the source release fence");if(t.requireUniqueTargets)return xX(e,t);let r=e.domMutations.map(T6),i=[],o=!1,a=!1,s,c=()=>{if(!o){o=!0,s?.disconnect();for(let l of i.reverse())l()}},u=()=>{o||a||(!r.length||e.css||t.allowJs&&e.js||r.some(l=>document.querySelector(l.selector)))&&(a=!0,t.onApplied?.())};try{if(e.css){let p=document.createElement("style");t.nonce&&(p.nonce=t.nonce),p.textContent=e.css,document.head.append(p),i.push(()=>p.remove())}for(let p of r){let h=X1.declarative(p);i.push(()=>h.revert())}if(t.allowJs&&e.js){let p=document.createElement("script");t.nonce&&(p.nonce=t.nonce),p.textContent=e.js,document.head.append(p),i.push(()=>p.remove())}let l=performance.now(),d=new WeakMap;s=new MutationObserver(p=>{if(!o){performance.now()-l>1e3&&(l=performance.now(),d=new WeakMap);for(let h of p){let f=(d.get(h.target)??0)+1;if(d.set(h.target,f),f>40){c(),t.onError?.(new Error("Visual changes conflict with repeated page rendering"));return}}u()}}),s.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),u()}catch(l){throw c(),l}return{revert:c,inspect(){return{status:"unavailable",total:0,applied:0}},get applied(){return a}}}function xX(e,t){let r=t?.boundVariations??[e],i=new Set,o=new Set,a=[],s=new Map,c=r.flatMap(H=>H.renderGuard?[I6(H.renderGuard)]:[]),u=c[0];if(c.some(H=>JSON.stringify(H)!==JSON.stringify(u)))throw new Error("IAM variations use different render states");if(e.js||r.some(H=>H.js))throw Error("IAM scripts cannot execute");if(r.length>20||r.reduce((H,X)=>H+X.css.length,0)>262144)throw Error("IAM target budget");let l=(H,X)=>{for(let J of H.domMutations){if(J.action!=="set"||J.attribute!=="html")throw Error("Unsupported IAM mutation");i.add(J.selector),o.add(J.selector)}if(!H.css)return;let M=document.createElement("style");iP(M),M.media="not all",t?.nonce&&(M.nonce=t.nonce),M.textContent=H.css;try{if(document.head.append(M),!M.sheet)throw Error("IAM CSS is blocked");for(let J of M.sheet.cssRules){if(!("selectorText"in J)||typeof J.selectorText!="string")throw Error("Unsupported IAM style rule");i.add(J.selectorText),X&&a.push({selector:J.selectorText,css:J.cssText})}}finally{M.remove()}};for(let H of r)l(H,!1);if(l(e,!0),i.size>200)throw Error("IAM target budget");let d=e.domMutations.map(T6),p=!1,h=!1,f=!1,m=!1,g="",A=0,C=(H,X)=>{let M=`${H}:${X}`;if(M!==g&&(g=M,!(!t?.onTargetStatus||A>=32))){A++;try{t.onTargetStatus({status:H,total:i.size,matched:X})}catch{}}},w={},E=u?JSON.stringify(u):"",I,F="",L=()=>{if(!p){p=!0,w.unsubscribe?.();for(let H of s.values())H.revert();s.clear(),I?.remove(),I=void 0,h=!1}},q=()=>{for(let H of s.values())H.revert();s.clear(),I?.remove(),I=void 0,F="",h=!1};return w.unsubscribe=E6({suspend:q,fail(H){L(),t?.onError?.(H)},prepare(H){if(u&&!H.matches(u,E))return M=>{p||(q(),m=!1,M(()=>{p||C("inactive",null)}))};let X=new Map;for(let M of i){let J=H.query(M);if(J.length>1)throw Error("IAM target is ambiguous in this rendered state");if(J.length){if(o.has(M)&&J[0].children.length)throw Error("IAM text target is no longer a leaf");X.set(M,J[0])}H.checkpoint()}return M=>{if(p)return;for(let[D,U]of s)X.get(D)!==U.element&&(U.revert(),s.delete(D));for(let D of new Set(d.map(U=>U.selector))){let U=X.get(D);if(!U||s.has(D))continue;let Q=d.filter(N=>N.selector===D).map(N=>X1.declarative(N));s.set(D,{element:U,revert:()=>Q.forEach(N=>N.revert())})}let J=a.filter(D=>X.has(D.selector)).map(D=>D.css).join(`
|
|
244
|
+
`);J!==F&&(F=J,J?(I||(I=document.createElement("style"),iP(I),t?.nonce&&(I.nonce=t.nonce),document.head.append(I)),I.textContent=J):(I?.remove(),I=void 0)),h=i.size===0||X.size>0;let $=X.size===i.size?"matched":X.size>0?"partial":m?"missing":"waiting";X.size&&(m=!0),M(()=>{p||C($,X.size)}),h&&!f&&M(()=>{!p&&h&&!f&&(f=!0,t?.onApplied?.())})}}}),p&&w.unsubscribe(),{revert:L,inspect(){let H=d.length+a.reduce(($,D)=>$+(D.css.includes("font-size:")?1:0)+(D.css.includes("color:")?1:0),0);if(p)return{status:"error",total:H,applied:0};if(g.startsWith("inactive:"))return{status:"inactive",total:H,applied:0};if(!H)return{status:"no_changes",total:H,applied:0};let X=0,M=0;for(let $ of d){let D=document.querySelectorAll($.selector);D.length===1&&(M++,D[0].innerHTML===O6($.value??"")&&X++)}let J=document.createElement("span");for(let $ of a){let D=document.querySelectorAll($.selector),U=D.length===1?D[0]:void 0,Q=$.css.slice($.css.indexOf("{")+1,$.css.lastIndexOf("}"));J.style.cssText=Q;for(let N of["font-size","color"]){let O=J.style.getPropertyValue(N);O&&U?.isConnected&&(M++,getComputedStyle(U).getPropertyValue(N)===O&&X++)}}return{status:X===H?"applied":M?X?"partial":"mismatch":"waiting",total:H,applied:X}},get applied(){return h}}}var oP,P6,N6=x(()=>{"use strict";_6();fk();tP();C6()});var D6={};Ie(D6,{applyVisualVariation:()=>R6});var $6=x(()=>{N6()});var L6={};Ie(L6,{showPaywall:()=>my});var M6=x(()=>{G1()});gn();gr();gn();ee();gn();_o();ee();_o();function RM(e,t,r,i){try{return e.parse(t)}catch(o){throw i&&o instanceof YS?new K(r,i):o}}async function td(e,t,r,i={},o){let a=typeof i=="function"?{}:i,s=RM(t.request,r,"INVALID_REQUEST",a.request),c=await e(t.path,s,t.method,o),u=typeof i=="function"?i:i.parseResponse;return u?u(t.response,c):RM(t.response,c,"INVALID_RESPONSE",a.response)}var NM=e=>new TextEncoder().encode(JSON.stringify(e)).length,DM=16384;function $M(e,t){let r=0,i,o=m=>{i={config:structuredClone(m),until:Date.now()+3e4}},a=[],s=null,c;function u(){if(!t())throw new K("NOT_IDENTIFIED","Call identify before using Features or events")}function l(){c||!a.length||(c=setTimeout(()=>{c=void 0,p().catch(()=>{}).finally(l)},5e3),typeof c=="object"&&"unref"in c&&c.unref())}function d(m,g={},A={}){if(u(),i&&Date.now()<i.until&&!Dj(i.config,m))return;f();let C=ae.trackEvents.request.parse({events:[{eventUuid:crypto.randomUUID(),timestamp:new Date().toISOString(),name:m,properties:g,...A}]}).events[0];if(NM({events:[C]})>DM)throw new K("INVALID_REQUEST","Event exceeds the delivery size limit");if(a.length>=500)throw new K("EVENT_QUEUE_FULL","Flush pending events before tracking more");a.push(structuredClone(C)),l()}async function p(m=!1){if(u(),s)return s;let g=r,A=(async()=>{let C={inserted:0,duplicates:0,rejected:0,skipped:0},w=a.length;for(;w&&g===r;){let E=[];for(let L of a.slice(0,Math.min(w,100))){if(E.length&&NM({events:[...E,L]})>DM)break;E.push(L)}let I=ae.trackEvents,F=await td(e,I,{events:E},void 0,{keepalive:m});if(g!==r)throw new K("IDENTITY_CHANGED","Event identity changed during delivery");if(F.inserted+F.duplicates+F.rejected+F.skipped!==E.length)throw new K("INVALID_RESPONSE","Incomplete event acknowledgement");o(F.analyticsConfig),a.splice(0,E.length),w-=E.length,C.inserted+=F.inserted,C.duplicates+=F.duplicates,C.rejected+=F.rejected,C.skipped+=F.skipped}return C})();s=A;try{return await A}finally{s===A&&(s=null)}}let h;function f(){if(h||typeof document>"u")return;let m=()=>{document.visibilityState==="hidden"&&t()&&a.length&&p(!0).catch(()=>{})};document.addEventListener("visibilitychange",m),h=()=>document.removeEventListener("visibilitychange",m)}return{rememberConfiguration:o,track(m,g,A={}){return f(),d(m,g,A)},flush:p,reset(){r++,i=void 0,clearTimeout(c),c=void 0,a=[],s=null},detachVisibility(){h?.(),h=void 0}}}gn();gn();function jM(e){let t=null,r=null,i=0,o=0,a=!1,s=new Set,c=null,u=null,l=new Set,d=()=>{for(let w of l)try{w()}catch{}},p={attributes:tn.parse(e.attributes??{}),onFeatureUsage:e.onFeatureUsage?(w,E)=>{!s.has(w)&&(!t||!("analyticsConfig"in t)||t.analyticsConfig.featureUsageEnabled)&&e.onFeatureUsage(w,structuredClone(E),structuredClone(p.attributes))}:void 0,onExperimentViewed:e.onExperimentViewed?(w,E)=>(!t||!("analyticsConfig"in t)||t.analyticsConfig.experimentViewsEnabled)&&e.onExperimentViewed(structuredClone(w),structuredClone(E),structuredClone(p.attributes)):void 0,stickyBucketAssignmentDocs:structuredClone(e.stickyBucketAssignmentDocs),saveStickyBucketAssignmentDoc:e.saveStickyBucketAssignmentDoc?w=>e.saveStickyBucketAssignmentDoc(structuredClone(w)):void 0,trackedFeatureUsage:{},trackedExperiments:new Set},h=()=>({value:null,source:"unknownFeature",on:!1,off:!0,ruleId:""});function f(w,E=new Set){return s.has(w)?!c||!c.features[w]||["unknownFeature","cyclicPrerequisite"].includes(c.features[w].source):E.has(w)?!1:(E.add(w),(t?.features[w]?.rules??[]).some(I=>[...I.parentConditions??[],...(I.tracks??[]).flatMap(F=>F.experiment.parentConditions??[])].some(F=>f(F.id,E))))}let m=w=>{if(e.assertUsable?.(t?.generation),!t)throw new Error("Initialize the Feature client before evaluation");if(t.expiresAt&&Date.parse(t.expiresAt)<=Date.now())throw new Error("Feature configuration expired; refresh before evaluation");return c?.expiresAt&&Date.parse(c.expiresAt)<=Date.now()&&(c=null,p.features=t.features),s.has(w)?!c||c.expiresAt&&Date.parse(c.expiresAt)<=Date.now()?h():structuredClone(c.features[w]??h()):e.evaluateRemote&&(p.attributes?.merchandise||p.attributes?.merchandiseId)&&!a||f(w)?h():structuredClone(Ii(w,p))};async function g(){if(!t||!s.size&&!p.attributes?.merchandise&&!p.attributes?.merchandiseId)return;if(!e.evaluateRemote){if(s.size)throw new Error("Remote Feature evaluation requires a server loader");return}let w=o;if(u?.revision===w)return u.loading;let E=i,I=t,F=[...s],L=(async()=>{let q=eh.parse(await e.evaluateRemote({attributes:structuredClone(p.attributes),features:F}));if(!(E!==i||w!==o||I!==t)){if(e.assertUsable?.(I.generation),q.generation!==I.generation)throw new Error("Feature configuration changed; refresh before evaluation");if(F.some(H=>!Object.hasOwn(q.features,H))||Object.keys(q.features).some(H=>!s.has(H)))throw new Error("Invalid remote Feature results");if(p.attributes?.merchandise||p.attributes?.merchandiseId){if(!q.merchandiseContext)throw new Error("Server did not resolve merchandise context");p.attributes=tn.parse({...p.attributes,...q.merchandiseContext}),a=!0}c=structuredClone(q),p.features={...I.features,...Object.fromEntries(Object.entries(c.features).map(([H,X])=>[H,{defaultValue:X.value}]))},d()}})();u={revision:w,loading:L};try{await L}finally{u?.loading===L&&(u=null)}}function A(){g().catch(w=>{try{e.onError?.(w)}catch{}})}async function C(){if(r)return r;let w=i,E=(async()=>{let I=await e.load(),F="remoteFeatures"in I?$l.parse(I):null,L=F??Er.parse(I);if(L.scope.projectId!==e.scope.projectId||L.scope.environment!==e.scope.environment)throw new Error("Feature payload scope changed");if(w!==i)throw new Error("Feature client was reset");if(e.assertUsable&&t?.generation===L.generation){let{evaluatedAt:H,expiresAt:X,...M}=t,{evaluatedAt:J,expiresAt:$,...D}=L;if(_n(M)!==_n(D))throw new Error("Immutable Feature generation changed content");return t.evaluatedAt=L.evaluatedAt,t.expiresAt=L.expiresAt,d(),(!c||c.expiresAt&&Date.parse(c.expiresAt)<=Date.now())&&A(),structuredClone(t)}let q=new Set(F?.remoteFeatures??[]);if([...q].some(H=>Object.hasOwn(L.features,H)))throw new Error("Remote Feature definitions must not be delivered locally");return t&&"analyticsConfig"in t&&"analyticsConfig"in L&&!t.analyticsConfig.experimentViewsEnabled&&F?.analyticsConfig.experimentViewsEnabled&&p.trackedExperiments?.clear(),t=structuredClone(L),s=q,c=null,u=null,o++,p.features=t.features,p.savedGroups=Ms(t.savedGroups),p.trackedFeatureUsage={},d(),A(),structuredClone(t)})();r=E;try{return await E}finally{r===E&&(r=null)}}return{init:C,refresh:C,refreshRemote:g,get generation(){return t?.generation??null},get expiresAt(){return t?.expiresAt??null},subscribe(w){return l.add(w),()=>{l.delete(w)}},setAttributes(w){let E=tn.parse(w);(p.attributes?.merchandise||p.attributes?.merchandiseId||w.merchandise||w.merchandiseId)&&p.trackedExperiments?.clear(),p.attributes=E,o++,a=!1,c=null,u=null,p.features=t?.features??{},p.trackedFeatureUsage={},d(),A()},evalFeature:m,isOn(w){return m(w).on},isOff(w){return m(w).off},getFeatureValue(w,E){let I=m(w).value;return structuredClone(I===null?E:I)},reset(){i++,o++,r=null,u=null,t=null,c=null,s.clear(),p.features={},p.savedGroups={},p.stickyBucketAssignmentDocs={},p.attributes={},p.trackedFeatureUsage={},p.trackedExperiments?.clear(),d()}}}gr();function LM(e){let t=e.merchandise;if(typeof e.merchandiseId=="string")return{internalId:e.merchandiseId};if(!(!t||typeof t!="object"||Array.isArray(t))){if(typeof t.internalId=="string")return{internalId:t.internalId};if(typeof t.externalId=="string")return{id:t.externalId};if(typeof t.id=="string")return{id:t.id}}}function iK(e){let t=LM(e),{merchandiseId:r,merchandise:i,...o}=e;return{...o,...t?{merchandise:t}:{}}}function MM(e,t,r,i,o){if(o&&i&&(o.scope.projectId!==i.projectId||o.scope.environment!==i.environment))throw new K("SCOPE_MISMATCH","Configuration belongs to another App/environment");let a=0,s=new Set;function c(){if(!t())throw new K("NOT_IDENTIFIED","Call identify before using Features or events")}async function u(l={}){o||c();let d=a,p=!1,h=async()=>{if(p||d!==a)throw new K("IDENTITY_CHANGED","Feature identity changed");let M=ae.getFeatures,J=o?{scope:{projectId:o.scope.projectId,environment:o.scope.environment},payload:await o.features()}:await td(e,M,{});if(d!==a)throw new K("IDENTITY_CHANGED","Feature identity changed");if(i&&(J.scope.projectId!==i.projectId||J.scope.environment!==i.environment))throw new K("INVALID_RESPONSE","Feature response scope changed");return r.rememberConfiguration(J.payload.analyticsConfig),J},f=await h(),m=!0,g,A=M=>{try{l.onError?.(M)}catch{}},C=(M,J,$)=>{try{let D=LM($);r.track(M,J,D?{merchandise:D}:{})}catch(D){A(D)}},w=jM({assertUsable:o?.assertFeatures,scope:f.scope,attributes:l.attributes,onError:l.onError,load:async()=>m?(m=!1,f.payload):(await h()).payload,evaluateRemote:async M=>{if(d!==a)throw new K("IDENTITY_CHANGED","Feature identity changed");let J=ae.evaluateFeatures,$=await td(e,J,{...M,attributes:iK(M.attributes)});if($.scope.projectId!==f.scope.projectId||$.scope.environment!==f.scope.environment)throw new K("INVALID_RESPONSE","Remote Feature response scope changed");return{generation:$.generation,evaluatedAt:$.evaluatedAt,expiresAt:$.expiresAt,features:$.features,...$.merchandiseContext?{merchandiseContext:$.merchandiseContext}:{}}},onExperimentViewed:(M,J,$)=>C("Experiment Viewed",{experimentId:M.key,variationId:J.key},$),onFeatureUsage:(M,J,$)=>C("Feature Evaluated",{feature:M,value:J.value,source:J.source,ruleId:J.ruleId,...J.experimentResult?{variationId:J.experimentResult.key}:{}},$)}),E=w.refresh;function I(){clearTimeout(g),!o&&(p||d!==a||!w.expiresAt||(g=setTimeout(()=>{F().catch(A)},Math.min(2147483647,Math.max(1e3,Date.parse(w.expiresAt)-Date.now()))),typeof g=="object"&&"unref"in g&&g.unref()))}async function F(){try{return await E()}finally{I()}}let L=()=>{p||F().catch(A)},q=w.subscribe(I),H=o?.subscribe(()=>{!p&&o.fresh&&F().catch(A)});function X(){p||(p=!0,clearTimeout(g),typeof window<"u"&&window.removeEventListener("focus",L),q(),H?.(),w.reset(),s.delete(X))}s.add(X);try{await w.init(),(l.attributes?.merchandise||l.attributes?.merchandiseId)&&await w.refreshRemote()}catch(M){throw X(),M}return I(),!o&&typeof window<"u"&&window.addEventListener("focus",L),Object.assign(w,{refresh:F,destroy:X})}return{features:u,reset(l){a++,l();for(let d of s)d()}}}gr();async function FM(e,t,r){let i={features:"getFeatures","features/evaluate":"evaluateFeatures",events:"trackEvents"},o=!1,a=async(l,d={})=>{if(o||!i[l])throw new K("IDENTITY_CHANGED","Feature session is unavailable");return e("featureOperation",{operation:i[l],input:d})},s=$M(a,()=>!o),c=MM(a,()=>!o,s,yt.parse(t)),u=await c.features({attributes:n.record(n.string(),Te).parse(r??{})});return{async call(l){if(o)throw new K("IDENTITY_CHANGED","Feature session is unavailable");let d=n.strictObject({method:n.enum(["evalFeature","isOn","isOff","getFeatureValue","setAttributes","refresh","flush"]),key:n.string().min(1).max(255).optional(),fallback:Te.optional(),attributes:n.record(n.string(),Te).optional()}).parse(l);switch(d.method){case"refresh":return await u.refresh(),null;case"flush":return await s.flush(),null;case"setAttributes":return u.setAttributes(d.attributes??{}),await u.refreshRemote(),null;case"evalFeature":{let{value:p,source:h,on:f,off:m,ruleId:g,experimentResult:A}=u.evalFeature(n.string().parse(d.key));return g_.parse({value:p,source:h,on:f,off:m,ruleId:g,...A?{experimentResult:A}:{}})}case"isOn":return u.isOn(n.string().parse(d.key));case"isOff":return u.isOff(n.string().parse(d.key));case"getFeatureValue":return u.getFeatureValue(n.string().parse(d.key),d.fallback??null)}},refresh:()=>u.refresh(),destroy(){o||(o=!0,c.reset(s.reset),s.detachVisibility())}}}gn();ee();gn();ee();Ea();gr();V1();sy();YU();var B1=new WeakMap;function n6(e){let t={string:n.string(),number:n.number().finite(),boolean:n.boolean(),strings:n.array(n.string()),json:Te}[e.type];return e.nullable?t.nullable():t}async function r6(e,t){return BY(e,t,!1)}async function BY(e,t,r){t.signal?.throwIfAborted();let i=pa.parse(t.content),o=i.document;if(B1.has(e))throw new K("CONFLICT","Content is already mounted in this container");let a=n.record(n.string(),Te).parse(t.inputs??{});if(Object.keys(a).length>40)throw new K("INVALID_REQUEST","Too many content inputs");for(let[M,J]of Object.entries(a))Vn.parse({[M]:J});if(Object.keys(a).some(M=>!Object.hasOwn(o.contract.inputs,M)))throw new K("INVALID_REQUEST","Undeclared content input");for(let[M,J]of Object.entries(o.contract.inputs))if(Object.hasOwn(a,M))n6(J).parse(a[M]);else if(J.required)throw new K("INVALID_REQUEST",`Missing content input ${M}`);for(let M of Object.keys(o.contract.outputs))if(typeof t.actions[M]!="function")throw new K("INVALID_REQUEST",`Missing host handler for ${M}`);let s=cc.parse(t.bindings??[]),c=e.ownerDocument,u,l=o.kind==="popup",d=l?c.createElement("dialog"):null,p=c.createElement("div");if(p.dataset.indianaContent=o.kind,p.setAttribute("aria-label",o.name),p.style.cssText="width:100%;min-width:0",d){d.setAttribute("aria-label",o.name);let M=o.screen.presentation;d.style.cssText="box-sizing:border-box;padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto",M.type==="modal"||M.type==="sheet"?(d.style.width=`${Df[M.size]}px`,M.type==="sheet"&&(d.style.margin="auto auto 0")):d.style.width="100vw",d.append(p),e.append(d)}else e.append(p);let h=!1,f=!1,m=!1;r&&!d&&(p.style.width=`${e.getBoundingClientRect().width||c.defaultView?.innerWidth||800}px`);let g=r?QU(d??p):()=>{},A,C,w=new Promise((M,J)=>{A=M,C=J});w.catch(()=>{});let E=null,I=structuredClone(o.screen);I.actions=I.actions.map(M=>M.type==="event"?{...M,close:!1}:M);let F;function L(){h||(h=!0,t.signal?.removeEventListener("abort",L),C(new Error("Content preparation cancelled")),F?.destroy(),d?.close(),d?.remove(),p.remove(),B1.delete(e),d&&u?.())}let q=()=>{m&&(L(),rt(t.onDismiss))};if(d){let M=c.createElement("button");M.type="button",M.textContent="\xD7",M.setAttribute("aria-label",t.locale?.startsWith("zh")?"\u5173\u95ED":"Close"),M.style.cssText="position:absolute;right:8px;top:8px;width:30px;height:30px;z-index:1",M.addEventListener("click",q),d.prepend(M)}d?.addEventListener("cancel",M=>{M.preventDefault(),q()});async function H(){if(h||!m||f||!E)return;let M=E;f=!0,p.setAttribute("aria-busy","true");try{await t.actions[M.actionId](structuredClone(M)),E=null}catch(J){rt(t.onError,J)}finally{f=!1,h||p.removeAttribute("aria-busy")}}function X(){if(h)throw new K("CONFLICT","Content host has been destroyed");m||(u=Ad(c),g(),r&&!d&&(p.style.width="100%"),d?.showModal(),m=!0)}try{r||X(),F=cy(p,{mode:"live",title:o.name,viewportHeight:o.kind==="page"?e.clientHeight||c.defaultView?.innerHeight||800:void 0,onRendered:A,onError:$=>{let D=new Error($);C(D),rt(t.onError,D)},onEscape:l?q:void 0,onAction:($,D,U)=>{if(h||!m||f||E)return;let Q=o.screen.actions.find(O=>O.id===$),N=o.contract.outputs[$];if(!(Q?.type!=="event"||!N))try{let O=n6(N).parse(Object.hasOwn(Q.properties,"value")?Q.properties.value:Q.properties);E={requestId:crypto.randomUUID(),contentVersionId:i.id,actionId:$,event:Q.event,value:O,selection:D??{},answers:U??{},requestedClose:Q.close},H()}catch(O){rt(t.onError,O)}}});let M={destroy:L,show:X,get pendingAction(){return E?structuredClone(E):null},retryAction:H,updateCapabilities:$=>F?.updateCapabilities($)};B1.set(e,M),t.signal?.addEventListener("abort",L,{once:!0}),t.signal?.aborted&&(L(),t.signal.throwIfAborted());let J=Pl(I,[t.locale,...c.defaultView?.navigator.languages??[]]);if(F.update(I,J,{capabilities:t.capabilities,serverInput:{bindings:s,answers:{},values:a}}),await Promise.race([F.ready,w]),r&&await w,h)throw new Error("Content preparation cancelled");return M}catch(M){throw L(),M}}async function i6(e){let t=n.strictObject({content:pa,locale:n.string().min(1).max(35),inputs:n.record(n.string(),Te)}).parse(await e("content"));return{destroy:(await r6(document.body,{...t,actions:Object.fromEntries(Object.keys(t.content.document.contract.outputs).map(i=>[i,o=>e("contentAction",o)])),onDismiss:()=>{e("dismiss").catch(()=>{})},onError:()=>{e("error").catch(()=>{})}})).destroy,refresh:async()=>{}}}gn();gr();_o();function q1(e,t){let r=structuredClone(e);for(let[i,o]of Object.entries(r.plans)){let a=t.plans[i];!a||a.versionId!==o.versionId||(a.amountMinor!==void 0&&(o.amountMinor=a.amountMinor),a.interval!==void 0&&(o.interval=a.interval),a.intervalCount!==void 0&&(o.intervalCount=a.intervalCount),a.prepaid!==void 0&&(o.prepaid=structuredClone(a.prepaid)))}return r}function uy(e,t){let r=i=>"document"in i?i.offering.id:i.content.offeringVersionId;return e.id===t.id&&r(e)===r(t)&&e.content?.artifact.sha256===t.content?.artifact.sha256}function ly(e,t,r){if(e.operationId!==t.operationId||t.currency!==void 0&&e.currency!==t.currency)throw new K("INVALID_RESPONSE",r)}function dy(e,t,r){let i=Object.fromEntries((e.lines[0]?.prepaid??[]).map(o=>[o.internal_feature_id,o.quantity]));if(t.featureQuantities&&(Object.keys(i).length!==Object.keys(t.featureQuantities).length||Object.entries(t.featureQuantities).some(([o,a])=>i[o]!==a)))throw new K("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)throw new K("INVALID_RESPONSE",r)}function py(e,t,r=!1){return!e||e.operationId!==t?.operationId?t:e.status==="complete"&&t.status!=="complete"||e.status!=="pending"&&(t.status==="pending"||r&&t.status!=="complete")?e:t}async function o6(e){let t=null,r=null,i=null,o=!1,a=async(l,d={})=>{if(o)throw new K("CLOSED","Paywall is closed");let p=await e({operation:l,input:d});if(o)throw new K("IDENTITY_CHANGED","Paywall identity changed");return p};async function s(){let l=yo.parse(await a("resolve"));if(t&&(!uy(l,t)||l.paywallId!==t.paywallId))throw new K("INVALID_RESPONSE","Pinned Paywall changed");return t=l,structuredClone(l)}async function c(l){if(!r)throw new K("INVALID_REQUEST","A quote is required");let d=mo.parse(await a(l));return ly(d,r,"Purchase identity changed"),i=py(i,d),structuredClone(i)}let u={get view(){return t&&structuredClone(t)},get quote(){return r&&structuredClone(r)},get operation(){return i&&structuredClone(i)},webViewUrl:"bundled",refresh:s,async preview(l){let d=t?.document.buttons[l.actionId],p=t&&d?.type==="checkout"&&ya(d.product,l.selection,t.capabilities);if(!p)throw new K("PRODUCT_UNAVAILABLE","Choose an available Product");let h=yc(t.document.screen,p,l.selection,t.capabilities),f=ga.parse(await a("preview",{actionId:l.actionId,productVersionId:p,...Object.keys(h).length?{featureQuantities:h}:{},requestId:l.requestId,...l.offerId?{offerId:l.offerId}:{},...l.nativeOffer?{nativeOffer:l.nativeOffer}:{}}));return dy(f,{productVersionId:p,featureQuantities:h},"Quoted Product changed"),r=f,i=null,structuredClone(f)},confirm:()=>c("confirm"),cancel:()=>c("cancel"),read:()=>c("read"),destroy(){o=!0,t=null,r=null,i=null}};return await s(),u}G1();gn();gr();function c6(e){let t=e.view;if(!t?.paywall)throw new K("INVALID_REQUEST","The current node is not a Paywall");let r=t.paywall.receiptId,i=t.nodeId,o=t.visit,a=t.paywall.resolution,s=a,c="document"in a?a:null;function u($){if(!uy($,a))throw new K("INVALID_RESPONSE","The pinned Paywall binding changed")}let l=t.paywall.quote,d=t.paywall.operation,p=!1,h=new AbortController,f=t.paywall.purchaseRequestId,m=0,g=t.paywall.selectionGeneration??0,A=t.paywall.canReselect===!0,C=null,w=new Map,E=new Map,I=new Map;function F($){if($.purchase&&$.purchase.receiptId!==r)throw new K("INVALID_RESPONSE","Purchase receipt changed");let D=$.run.paywall;return $.purchase??(D?.receiptId===r?D:null)}function L(){if(p)throw new K("IDENTITY_CHANGED","Paywall presentation has closed")}function q($,D,U){if(L(),D!==m||U!==void 0&&l?.operationId!==U)return!1;let Q=g,N=$.run.paywall;if(N?.receiptId===r){if((N.selectionGeneration??0)<g)return!1;g=N.selectionGeneration??0,A=N.canReselect===!0,u(N.resolution)}let O=F($),z=g>Q,V=z?O?.quote??null:O?.quote??l,de=O?.operation??(V?.operationId===l?.operationId?d:null);return V&&de&&ly(de,{operationId:V.operationId},"Purchase operation changed"),N?.receiptId===r&&(s=N.resolution,c="document"in s?s:c?{...s,document:c.document,offering:c.offering,capabilities:q1(s.capabilities,c.capabilities)}:null),(z||V?.operationId!==l?.operationId)&&(m++,N?.receiptId===r&&(f=N.purchaseRequestId)),l=V,d=py(d,de,!0),!0}function H($,D,U){return new Promise((Q,N)=>{let O=!1,z=()=>{clearTimeout(Ge),h.signal.removeEventListener("abort",je)},V=Pe=>{O||(O=!0,z(),Q(Pe))},de=Pe=>{O||(O=!0,z(),N(Pe))},je=()=>de(new K("IDENTITY_CHANGED","Paywall presentation has closed")),Ge=setTimeout(()=>de(new K("COMMAND_PENDING","The purchase command is still pending; retry the original request",202,U)),Math.max(0,D-Date.now()));h.signal.addEventListener("abort",je,{once:!0}),h.signal.aborted&&je(),$.then(V,de)})}function X($){return new Promise(D=>{let U=()=>{clearTimeout(Q),h.signal.removeEventListener("abort",U),D()},Q=setTimeout(U,$);h.signal.addEventListener("abort",U,{once:!0}),h.signal.aborted&&U()})}async function M($,D,U){L();let Q=w.get($);if(!Q){let z=e.pendingCommands?.find(V=>V.requestId===$)??e.pendingCommand;if(z?.operation==="submit"&&z.requestId===$&&z.nodeId===i&&z.visit===o){D.type==="paywall_quote"&&z.input.type==="paywall_quote"&&z.input.predecessor&&!D.predecessor&&(D={...D,predecessor:z.input.predecessor});let V=hc.parse(z),de=hc.parse({...z,input:D});if(de.operation!=="submit"||V.operation!=="submit"||JSON.stringify(de.input)!==JSON.stringify(V.input))throw new K("CONFLICT","A restored purchase request cannot change its input");D=de.input,Q=V,w.set($,Q)}}if(Q){if(JSON.stringify(Q.input)!==JSON.stringify(D))throw new K("CONFLICT","A purchase request cannot change its input")}else{let z=e.view;if(!z||z.nodeId!==i||z.visit!==o||z.paywall?.receiptId!==r)throw new K("PRECONDITION_FAILED","The Paywall visit has changed");Q={operation:"submit",requestId:$,nodeId:i,visit:o,revision:z.revision,input:D},w.set($,Q)}let N=Date.now()+3e4,O=await H(e.submit(Q),N,$);for(;O.run.pendingRequest?.requestId===$&&Date.now()<N&&!p&&(await X(Math.min(1e3,N-Date.now())),!(p||Date.now()>=N));)O=await H(e.resume($),N,$);if(p)throw new K("IDENTITY_CHANGED","Paywall presentation has closed");if(O.run.pendingRequest?.requestId===$)throw new K("COMMAND_PENDING","The purchase command is still pending; retry the original request",202,$);if(!q(O,U,D.type==="paywall_confirm"||D.type==="paywall_cancel"?D.operationId:void 0))throw new K("PRECONDITION_FAILED","The purchase selection has changed")}async function J($){if(!l)throw new K("INVALID_REQUEST","A quoted purchase is required");let D=`${$}:${l.operationId}`,U=E.get(D);if(!U){let Q=$==="confirm"?"paywall_confirm":"paywall_cancel",N=e.pendingCommands?.find(O=>O.operation==="submit"&&O.input.type===Q&&"operationId"in O.input&&O.input.operationId===l.operationId)??e.pendingCommand;U=N?.operation==="submit"&&N.input.type===Q&&"operationId"in N.input&&N.input.operationId===l.operationId?N.requestId:crypto.randomUUID(),E.set(D,U)}if(await M(U,{type:$==="confirm"?"paywall_confirm":"paywall_cancel",operationId:l.operationId},m),!d)throw new K("INVALID_RESPONSE","The accepted purchase result is missing");return structuredClone(d)}return{get view(){return structuredClone(c)},get quote(){return l?structuredClone(l):null},get operation(){return d?structuredClone(d):null},get webViewUrl(){return e.webViewUrl},get canReselect(){return A},async refresh(){L();let $=m,D=await e.get();if(q(D,$),D.run.paywall?.receiptId!==r)throw new K("PRECONDITION_FAILED","Paywall presentation has changed");if(!c){if("document"in s||!e.resolvePaywall)throw new K("INVALID_RESPONSE","Public Paywall reader is unavailable");let U=await e.resolvePaywall(s);L(),u(U),c={...s,document:U.document,offering:U.offering,capabilities:q1(s.capabilities,U.capabilities)}}return structuredClone(c)},preview($){if(!c)return Promise.reject(new K("PRECONDITION_FAILED","Load the Paywall presentation first"));if(f&&f!==$.requestId&&(C||!A))return Promise.reject(new K("COMMAND_PENDING","Retry the original purchase before starting another"));let D=c.document.buttons[$.actionId],U=D?.type==="checkout"?ya(D.product,$.selection,c.capabilities):null;if(!U)return Promise.reject(new K("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));let Q=yc(c.document.screen,U,$.selection,c.capabilities),N=JSON.stringify({actionId:$.actionId,product:U,featureQuantities:Q,offerId:$.offerId,nativeOffer:$.nativeOffer});if(I.has($.requestId)&&I.get($.requestId)!==N)return Promise.reject(new K("CONFLICT","A purchase request cannot change its quantities or Product"));if(I.set($.requestId,N),f===$.requestId&&C)return C;let O=f!==$.requestId&&g>0?{operationId:l?.operationId??null,generation:g}:void 0;if(O&&(!A||g<=0))return Promise.reject(new K("COMMAND_PENDING","Original purchase requires authoritative termination"));f!==$.requestId&&m++;let z=m;f=$.requestId;let V=(async()=>{if(await M($.requestId,{type:"paywall_quote",actionId:$.actionId,productVersionId:U,...Object.keys(Q).length?{featureQuantities:Q}:{},...O?{predecessor:O}:{},...$.offerId?{offerId:$.offerId}:{},...$.nativeOffer?{nativeOffer:$.nativeOffer}:{}},z),!l)throw new K("INVALID_RESPONSE","The accepted quote is missing");return dy(l,{productVersionId:U,featureQuantities:Q},"The selected purchase changed"),structuredClone(l)})();return C=V,V.then(()=>{C===V&&(C=null)},de=>{C===V&&(C=null),f===$.requestId&&e.pendingCommand?.requestId!==$.requestId&&de instanceof K&&de.status!==void 0&&de.status<500&&![401,425].includes(de.status)&&(f=null)}),V},confirm:()=>J("confirm"),cancel:()=>J("cancel"),async read(){if(L(),!l)throw new K("INVALID_REQUEST","A quoted purchase is required");let $=l.operationId,D=m,U=e.pendingCommands?.find(z=>z.operation==="submit"&&(z.input.type==="paywall_confirm"||z.input.type==="paywall_cancel")&&z.input.operationId===$)??e.pendingCommand;U?.operation==="submit"&&(U.input.type==="paywall_confirm"||U.input.type==="paywall_cancel")&&U.input.operationId===$&&await e.settle?.(U.requestId);let Q=await e.get(void 0,{receiptId:r,operationId:$});L();let N=F(Q);if(N?.quote&&N.quote.operationId!==$||N?.operation&&N.operation.operationId!==$)throw new K("INVALID_RESPONSE","Purchase operation changed");let O=q(Q,D,$)?d:N?.operation;if(!O)throw new K("INVALID_RESPONSE","The current purchase result is missing");return structuredClone(O)},destroy(){p=!0,h.abort(),w.clear(),E.clear(),I.clear()}}}gr();Ea();_o();function u6(e){let t=new Set,r=new Set,i=null;function o(a){if(e.reviewing||t.has(a)||r.has(a)||e.stopped)return;r.add(a);let s=async()=>{if(e.reviewing||e.stopped||e.key!==a){r.delete(a);return}if(e.busy||e.client.pendingCommand){setTimeout(()=>{s()},250);return}let c=(async()=>{let l=e.client.view,d=e.expected(),p=d.requestId,h=!1;try{await e.client.submit({operation:"shown",...d})}catch(f){if(!(f instanceof K)||f.code!=="CONFLICT"||f.status!==409||e.client.pendingCommand)throw f;await e.client.get();let m=e.client.view;if(e.stopped||e.reviewing||e.key!==a||!m||!l||m.id!==l.id||m.source.versionId!==l.source.versionId||m.nodeId!==d.nodeId||m.visit!==d.visit||m.revision<=d.revision||m.stopped||!m.screen||!["running","waiting"].includes(m.status)||e.client.pendingCommand)throw f;let g=e.expected();p=g.requestId,await e.client.submit({operation:"shown",...g})}for(;!e.stopped&&e.key===a&&e.client.pendingCommand?.requestId===p;){if(!e.client.settle)throw new K("COMMAND_PENDING","The original display acknowledgement is still pending");await e.client.settle(p),h=!0,e.client.pendingCommand?.requestId===p&&await new Promise(f=>setTimeout(f,1500))}e.stopped||e.key!==a||(h&&await e.client.get(),!(e.stopped||e.key!==a)&&t.add(a))})();i=c;let u=()=>{i===c&&(i=null),r.delete(a)};c.then(u,l=>{u(),e.busy||e.fail(l)})};s()}return{report:o,get inFlight(){return i}}}gn();_o();function l6(e){let t={},r=new Map;async function i(o){let a=e.client.view,s=a?.screen,c=s?.customerData.nodes[o.nodeId];if(e.stopped||e.busy||!a||!s||!c)return;if(!["refresh","next","previous","filter","sources_next","sources_previous"].includes(o.action)){let m=e.document,g=m?Pn(m,o.nodeId):null,A=g?.type==="customer_data"?g.data.outputs?.[o.action]:void 0;A&&s.outputs.includes(A)?await e.perform(()=>e.client.submit({operation:"submit",...e.expected(),input:{type:"screen",output:A,answers:e.answers,selection:o.value?{[o.nodeId]:o.value}:{}}})):await e.onIntent?.(o,a);return}let l=o.action.startsWith("sources_")?c.resources.find(m=>m.key===o.value):null;if(o.action.startsWith("sources_")&&!l)throw new K("INVALID_REQUEST","Choose a current resource");let d=`${a.visit}:${o.nodeId}:${l?.key??""}`,p=r.get(d)??[null],f=t[o.nodeId]??{page:1,after:null,filter:"all",...l?{resourceKey:l.key}:{}};if(o.action==="filter"){let m=o.value;if(!m||!(c.source==="offer_history"?["all","issued","reserved","redeemed","expired","revoked"]:["all","purchase","refund","source","usage","debt","settlement"]).includes(m))throw new K("INVALID_REQUEST","Unknown data filter");f={page:1,after:null,filter:m},p.splice(0,p.length,null)}else if(o.action==="next"||o.action==="sources_next"){let m=l?.sources.at(-1),g=l?m?{kind:"ledger",cursor:{at:m.detail[0],id:m.id,type:"source"}}:null:s.dataCursors[o.nodeId];if(!g||!l&&!c.hasNext)return;p[f.page]=g,f={...f,page:f.page+1,after:g}}else if(o.action==="previous"||o.action==="sources_previous"){if(f.page<=1)return;f={...f,page:f.page-1,after:p[f.page-2]??null}}r.set(d,p),t={...t,[o.nodeId]:f},await e.perform(()=>e.client.get({nodeId:a.nodeId,visit:a.visit,revision:a.revision,components:t}))}return{get queries(){return t},intent:i,reset(){t={},r.clear()}}}_o();function d6(e){let{doc:t,holder:r,reviewHolder:i,mountScreenPreview:o}=e,a=!1,s,c=0,u=null,l="",d=new Map,p=m=>m?`${m.id}:${m.nodeId}:${m.visit}:${m.revision}:${m.paywall?.quote?.operationId??""}`:"";async function h(m){if(e.stopped||!e.client.review)return;a||(l=p(e.client.view),d.set(l,structuredClone(e.answers))),a=!0,s=m,r.hidden=!0,e.suspend(!0),i.hidden=!1;let g=++c;try{let A=await e.client.review(m);if(e.stopped||g!==c||!a)return;if(!A.review)throw new K("INVALID_RESPONSE","Historical projection is missing");u?.destroy(),u=null,i.replaceChildren();let C=A.run.locale.startsWith("zh"),w=t.createElement("p");w.textContent=C?"\u53EA\u8BFB\u56DE\u770B":"Read-only history",i.append(w);for(let[F,L]of A.review.pages.entries()){let q=t.createElement("button");q.type="button",q.textContent=C?`\u7B2C ${F+1} \u9875`:`Page ${F+1}`,q.onclick=()=>{h(L.receiptId)},i.append(q)}if(A.review.page){let F=A.review.page,L=t.createElement("div");if(L.inert=!0,i.append(L),u=o(L,{mode:"live",rendererUrl:e.client.webViewUrl,title:F.document.name,onAction:()=>{},onAnswers:()=>{},onCustomerDataIntent:()=>{},onRendered:()=>{},onEscape:()=>{f()}}),u.update(F.document,A.run.locale,{serverInput:{bindings:F.inputs,answers:F.answers,values:F.values}}),await u.ready,e.stopped||g!==c||!a)return}let E=C?{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"},I=C?{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 F of[...A.review.coupons.map((L,q)=>`${C?"\u4F18\u60E0\u5238":"Coupon"} ${q+1}: ${E[L.status]}`),...A.review.purchases.map((L,q)=>`${C?"\u8D2D\u4E70":"Purchase"} ${q+1}: ${I[L.status]}`)]){let L=t.createElement("p");L.textContent=F,i.append(L)}e.client.view&&await e.enqueue(e.client.view)}catch(A){if(g!==c||e.stopped)return;u?.destroy(),u=null,i.replaceChildren(),e.fail(A)}}async function f(){if(!a||e.stopped||!e.client.review)return;let m=++c;try{if(await e.client.review(),e.stopped||m!==c)return;a=!1,c++,u?.destroy(),u=null,i.replaceChildren(),i.hidden=!0,r.hidden=!1;let g=e.client.view;p(g)!==l?(d.set(l,structuredClone(e.answers)),e.resetScreen()):(d.delete(l),e.suspend(!1)),g&&await e.enqueue(g)}catch(g){if(m!==c||e.stopped)return;u?.destroy(),u=null,i.replaceChildren(),e.fail(g)}}return{get active(){return a},get receipt(){return s},open:h,exit:f,get drafts(){return new Map([...d].map(([m,g])=>[m,structuredClone(g)]))},stop(){a=!1,c++,u?.destroy(),u=null,i.replaceChildren(),i.hidden=!0,r.hidden=!1}}}rl();var K1=new WeakMap;function p6(e,t=document){if(!/^[a-f0-9]{64}$/.test(e))throw new Error("Invalid IAM manifest digest");let r="data-indiana-release",i=t.documentElement,o=()=>new Set((i.getAttribute(r)??"").split(/\s+/).filter(Boolean)),a=K1.get(t);if(!a){let d=new Map,p=new MutationObserver(()=>{let h=o(),f=!1;for(let[m,g]of d)g.count&&!h.has(m)&&(h.add(m),f=!0);f&&i.setAttribute(r,[...h].join(" "))});p.observe(i,{attributes:!0,attributeFilter:[r]}),a={releases:d,observer:p},K1.set(t,a)}let{releases:s,observer:c}=a,u=s.get(e);if(!u){let d=o();u={count:0,owned:!d.has(e)},s.set(e,u),d.add(e),i.setAttribute(r,[...d].join(" "))}u.count++;let l=!1;return{attributes:{indianaAppManifestRelease:e},destroy(){if(!l&&(l=!0,u.count--,!u.count&&(s.delete(e),s.size||(c.disconnect(),K1.delete(t)),u.owned))){let d=o();d.delete(e),d.size?i.setAttribute(r,[...d].join(" ")):i.removeAttribute(r)}}}}Ea();var xd=new Set,fy;function m6(e){let t=()=>e();if(xd.add(t),!fy){let r=!0,i=history.pushState,o=history.replaceState,a=()=>{if(r)for(let u of[...xd])xd.has(u)&&rt(u)},s=function(...u){i.apply(this,u),a()},c=function(...u){o.apply(this,u),a()};history.pushState=s,history.replaceState=c,addEventListener("popstate",a),addEventListener("hashchange",a),fy=()=>{r=!1,history.pushState===s&&(history.pushState=i),history.replaceState===c&&(history.replaceState=o),removeEventListener("popstate",a),removeEventListener("hashchange",a)}}return()=>{xd.delete(t)&&(xd.size||(fy?.(),fy=void 0))}}var Sd=new Map,qY=new Set,f6=()=>{for(let e of[...qY])e()};function h6(e,t){if(Sd.has(e)&&Sd.get(e)!==t)throw new Error("A different Funnel owns this page experiment");return Sd.set(e,t),f6(),()=>{Sd.get(e)===t&&(Sd.delete(e),f6())}}Ea();function j6(e){if(!e.client.pageExperiments)throw new Error("The Run controller does not support page experiments");let t=e.client.pageExperiments.bind(e.client),r=!1,i=!1,o=0,a=!1,s=!1,c,u=new Map,l=new Set,d={},p=new Map,h=p6(e.appManifestRelease),f=()=>{for(let E of u.values())E.effect.revert();u.clear();for(let E of p.values())E();p.clear()};function m(E){r||l.has(E)||(l.add(E),t(e.appManifestRelease,[E]).catch(I=>{l.delete(E),rt(e.onError,I)}))}async function g(){if(r)return;let E=e.client.view;if(!E||E.stopped||!["running","waiting"].includes(E.status)){o++,f();return}if(a){s=!0;return}a=!0;let I=++o,F=`${E.id}:${E.visit}:${E.revision}`,L=location.href;try{let[q,{applyVisualVariation:H}]=await Promise.all([t(e.appManifestRelease),Promise.resolve().then(()=>($6(),D6))]),X=e.client.view;if(r||I!==o||!X||X.stopped||!["running","waiting"].includes(X.status)||`${X.id}:${X.visit}:${X.revision}`!==F||location.href!==L)return;let M=new Set,J=new Set;for(let $ of q.assignments){let D=`${q.payload.environmentId}:${$.experimentKey}`;if(J.add(D),p.has(D)||p.set(D,h6(D,d)),!!$.inExperiment)for(let U of q.payload.experiments){if(U.key!==$.experimentKey||!tl(location.href,U.urlPatterns??[]))continue;let Q=U.meta?.findIndex(je=>je.key===$.variationKey)??-1,N=U.variations[Q];if(!N?.renderGuard)continue;let O=$.receiptId+":"+U.changeId,z=JSON.stringify([$.variationKey,N]);M.add(O);let V=u.get(O);if(V?.signature===z){V.effect.applied&&m($.receiptId);continue}u.get(O)?.effect.revert(),u.delete(O);let de=H(N,{requireUniqueTargets:!0,boundVariations:U.variations,allowJs:!1,onApplied:()=>m($.receiptId),onError:je=>rt(e.onError,je)});u.set(O,{signature:z,effect:de}),de.applied&&m($.receiptId)}}for(let[$,D]of u)M.has($)||(D.effect.revert(),u.delete($));for(let[$,D]of p)J.has($)||(D(),p.delete($))}catch(q){I===o&&f(),rt(e.onError,q)}finally{a=!1,s&&!r&&(s=!1,g())}}let A=e.client.subscribe(()=>{o++,g()}),C=m6(()=>{o++,f(),g()}),w=async()=>{await g(),r||(c=setTimeout(()=>{w()},15e3))};return{async start(){i||r||(i=!0,await w())},refresh:g,destroy(){r=!0,o++,clearTimeout(c),A(),C(),f(),h.destroy()}}}async function F6(e,t){let r=t,{mountScreenPreview:i}=await Promise.resolve().then(()=>(H1(),Z1)),{showPaywall:o}=await Promise.resolve().then(()=>(M6(),L6)),a=r.appManifestRelease?j6({client:r.client,appManifestRelease:r.appManifestRelease,onError:r.onError}):void 0;a?.start();let s=e.ownerDocument,c=s.activeElement,u=s.createElement("section"),l=s.createElement("div"),d=s.createElement("div"),p=s.createElement("div"),h=s.createElement("button");p.hidden=!0,h.type="button";let f=s.createElement("p"),m=s.createElement("p"),g=s.createElement("button"),A=s.createElement("button"),C=s.createElement("button"),w=s.createElement("dialog");u.dataset.indianaFunnel="",u.setAttribute("aria-busy","false"),u.style.cssText="box-sizing:border-box;width:100%;min-width:0;font:14px/1.5 system-ui,sans-serif;color:#172033;background:#fff",d.style.cssText="display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 20px",f.setAttribute("role","status"),m.setAttribute("role","alert"),m.hidden=!0,g.type=A.type=C.type="button",d.append(g,f,m,C,h,A),u.append(l,p,d),e.append(u);let E=null,I=null,F=null,L="",q="",H="",X="",M="",J=!1,$=0,D=!1,U="",Q=null,N=Promise.resolve(),O=null,z=null,V=new Set,de={},je=(Y,Re=null)=>{J||(z=Re,m.textContent=Y instanceof Error?Y.message:"Request failed",m.hidden=!1,C.hidden=r.client.pendingCommand===null,rt(r.onError,Y))};function Ge(){let Y=r.client.view;if(!Y)throw new K("INVALID_REQUEST","No current Run is available");return{requestId:crypto.randomUUID(),nodeId:Y.nodeId,visit:Y.visit,revision:Y.revision}}let Pe=d6({client:r.client,doc:s,holder:l,reviewHolder:p,mountScreenPreview:i,get stopped(){return J},get answers(){return de},suspend(Y){I?.setSuspended(Y)},resetScreen(){L="",q="",H=""},enqueue:Se,fail:je}),pt=u6({client:r.client,expected:Ge,fail:je,get stopped(){return J},get reviewing(){return Pe.active},get key(){return L},get busy(){return $}}),Ve=l6({client:r.client,expected:Ge,perform:wt,onIntent:r.onCustomerDataIntent,get stopped(){return J},get busy(){return $},get document(){return E?.document},get answers(){return de}}),ot=Y=>Y&&(Y.screen||Y.paywall)?`${Y.id}:${Y.nodeId}:${Y.visit}`:"";function qe(){let Y=r.client.view;g.disabled=!Pe.active&&($>0||!!r.client.pendingCommand||!Y?.canBack||Y.stopped||!["running","waiting"].includes(Y.status)||!ot(Y)||q!==ot(Y))}async function wt(Y,Re=!1){if(!($&&!Re||J||Pe.active&&!Re)){$++,u.setAttribute("aria-busy","true"),qe(),m.hidden=!0,z=null;try{if(!Re&&pt.inFlight){let Le=r.client.view;await pt.inFlight;let ct=r.client.view;if(!Le||!ct||ct.id!==Le.id||ct.nodeId!==Le.nodeId||ct.visit!==Le.visit||ct.stopped||!["running","waiting"].includes(ct.status))throw new K("PRECONDITION_FAILED","The screen changed while its display was acknowledged")}if(J)return;let Je=await Y();J||await Se(r.client.view??Je.run)}catch(Je){je(Je,r.client.pendingCommand?.requestId??null)}finally{$=Math.max(0,$-1),u.setAttribute("aria-busy",String($>0)),J||(C.hidden=r.client.pendingCommand===null,qe())}}}function Kt(){Q&&clearTimeout(Q),!(J||!F||!["running","waiting"].includes(F.status)&&!r.client.pendingCommand)&&(Q=setTimeout(()=>{Q=null,tt().finally(Kt)},F.pendingRequest||r.client.pendingCommand?1500:5e3))}async function tt(){if(!(J||D||$)){if(Pe.active){await Pe.open(Pe.receipt);return}D=!0;try{let Y=r.client.pendingCommand;Y&&r.client.settle&&await r.client.settle(Y.requestId);let Re=r.client.view,Je=Ve.queries,Le=await r.client.get(Re?.screen&&Object.keys(Je).length?{nodeId:Re.nodeId,visit:Re.visit,revision:Re.revision,components:Je}:void 0);!J&&Je===Ve.queries&&await Se(r.client.view??Le.run)}catch(Y){je(Y)}finally{D=!1}}}function Sr(Y){let Re=Y.screen?.presentation;if(!Re||Re.type==="inline"){w.open&&w.close(),u.parentElement!==e&&e.append(u);return}u.parentElement!==w&&(w.append(u),e.append(w));let Je={sm:420,md:640,lg:900};w.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${"size"in Re?Je[Re.size]+"px":"100vw"}`,w.setAttribute("aria-label",E?.document?.name??Y.screen?.content.document.name??"Funnel"),w.open||w.showModal()}async function be(Y){if(J)return;F=Y,z&&r.client.pendingCommand?.requestId!==z&&(m.hidden=!0,z=null);let Re=Y.locale.startsWith("zh");if(h.textContent=Re?"\u56DE\u770B":"History",h.hidden=!r.client.review,g.textContent=Pe.active?Re?"\u8FD4\u56DE\u5F53\u524D":"Return to current":Re?"\u8FD4\u56DE":"Back",A.textContent=Re?"\u5173\u95ED":"Close",C.textContent=Re?"\u91CD\u8BD5":"Retry",qe(),C.hidden=r.client.pendingCommand===null,f.textContent=Y.pendingRequest?Re?"\u6B63\u5728\u5904\u7406":"Processing":Y.instruction?.type==="wait"?Re?"\u7B49\u5F85\u4E2D":"Waiting":"",U!==`${Y.revision}:${Y.visit}:${Y.status}:${Y.stopped}`&&(U=`${Y.revision}:${Y.visit}:${Y.status}:${Y.stopped}`,rt(r.onState,structuredClone(Y))),Y.stopped||r.client.configurationReady===!1){Pe.stop(),E?.destroy(),E=null,I?.destroy(),I=null,l.replaceChildren(),L="",q="",H="",M="",w.open&&w.close(),u.hidden=!0,Kt();return}if(u.hidden=!1,Pe.active){Kt();return}let Je=ot(Y);if(Je!==L&&(q="",E?.destroy(),E=null,I?.destroy(),I=null,l.replaceChildren(),L=Je,H="",M="",de={...Y.answers},Ve.reset()),Sr(Y),Y.screen){let ct=Y.screen.content;E||(E=i(l,{mode:"live",rendererUrl:r.client.webViewUrl,title:ct.document.name,onAction(Pt,Dt={},Ot={}){if(Pe.active)return;de={...de,...Ot};let Dr=Object.fromEntries((Y.screen?.inputs??[]).filter(({variable:ti})=>Object.hasOwn(de,ti)).map(({variable:ti})=>[ti,de[ti]]));wt(()=>r.client.submit({operation:"submit",...Ge(),input:{type:"screen",output:Pt,answers:Dr,selection:Dt}}))},onAnswers:Pt=>{Pe.active||(de={...de,...Pt})},onCustomerDataIntent:Pt=>{Pe.active||Ve.intent(Pt).catch(je)},onEscape:()=>{Pe.active||Ee()},onError:Pt=>je(new Error(Pt)),onRendered:()=>pt.report(Je)}));let lt={capabilities:Y.screen.capabilities,customerData:Y.screen.customerData,parameters:Y.parameters,serverInput:{bindings:Y.screen.inputs,answers:de,values:Y.screen.values}},In=JSON.stringify([ct,Y.locale,lt.parameters,Y.screen.inputs,Y.screen.values]);if(In!==H)E.update(ct.document,Y.locale,lt),H=In,X=JSON.stringify(lt.capabilities),M=JSON.stringify(lt.customerData);else{let Pt=JSON.stringify(lt.capabilities);Pt!==X&&(E.updateCapabilities(lt.capabilities),X=Pt),JSON.stringify(lt.customerData)!==M&&(E.updateCustomerData(lt.customerData),M=JSON.stringify(lt.customerData))}await E.ready}else if(Y.paywall&&!I){let ct=await o(l,{canInteract:()=>!Pe.active&&!J,start:async()=>c6(r.client),onPurchase:r.onPurchase,onCheckoutUrl:r.onCheckoutUrl,resolveOfferId:r.resolveOfferId,onEvent:r.onEvent,onOpenUrl:lt=>r.onOpenUrl?r.onOpenUrl({receiptId:Y.paywall.receiptId,url:lt,openIn:"same_window"}):s.defaultView?.location.assign(lt),onAction:async lt=>{if(Pe.active)return;let In=await r.client.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:Y.nodeId,visit:Y.visit,revision:Y.revision,input:{type:"screen",output:lt,answers:{}}});await Se(r.client.view??In.run)},onError:je,onDismiss:()=>{!Pe.active&&!J&&r.client.view?.visit===Y.visit&&Ee()}});J?ct.host?.destroy():(I=ct.host,I?.setSuspended(Pe.active)),pt.report(Je)}if(J)return;q=Je,qe();let Le=Y.instruction;if(Le&&(Le.type==="open_url"||Le.type==="event")&&!V.has(Le.receiptId)){let ct=s.createElement("button");ct.type="button",ct.textContent=Le.type==="open_url"?`${Re?"\u524D\u5F80":"Continue to"} ${new URL(Le.url).host}`:Re?"\u7EE7\u7EED":"Continue",ct.onclick=()=>{let lt=Ge(),In=Le.type==="open_url"&&!r.onOpenUrl&&Le.openIn==="new_window"?he(Le.url):null;wt(async()=>{let Pt="success";if(Le.type==="open_url")if(r.onOpenUrl)try{Pt=await r.onOpenUrl({receiptId:Le.receiptId,url:Le.url,openIn:Le.openIn})===!1?"failed":"opened"}catch(Ot){rt(r.onError,Ot),Pt="failed"}else Pt=Le.openIn==="new_window"&&!In?"failed":"opened";if(Le.type==="event"){if(!r.onEvent)throw new K("EVENT_HANDLER_REQUIRED","Provide the event handler");await r.onEvent(Le.event)}if(J||r.client.view?.nodeId!==lt.nodeId||r.client.view.visit!==lt.visit)throw new K("PRECONDITION_FAILED","The client action visit changed");let Dt=await r.client.submit({operation:"submit",...lt,input:{type:"client_action",receiptId:Le.receiptId,outcome:Pt}});return V.add(Le.receiptId),Le.type==="open_url"&&!r.onOpenUrl&&Le.openIn==="same_window"&&s.defaultView?.location.assign(Le.url),Dt})},l.replaceChildren(ct)}!Y.pendingRequest&&Y.status==="completed"&&!V.has(`complete:${Y.id}`)&&(V.add(`complete:${Y.id}`),rt(r.onComplete,structuredClone(Y))),Kt()}function he(Y){let Re=s.defaultView?.open(Y,"_blank")??null;return Re&&(Re.opener=null),Re}function Se(Y){return qe(),N=N.catch(()=>{}).then(()=>be(Y)),N}let me=r.client.subscribe(Y=>{r.client.configurationReady===!1&&(u.hidden=!0,E?.destroy(),E=null,I?.destroy(),I=null,l.replaceChildren(),L="",q="",H="",M="",w.open&&w.close()),Se(Y).catch(je)}),_e=r.client.subscribeError?.(je);function Ee(){return O||(J?Promise.resolve():r.client.view&&!["running","waiting"].includes(r.client.view.status)?(Ue(),Promise.resolve()):(O=wt(()=>r.client.submit({operation:"close",...Ge()}),!0).then(()=>{r.client.view?.status==="closed"&&Ue()}).finally(()=>{O=null}),O))}function Ue(){a?.destroy(),!J&&(J=!0,Q&&clearTimeout(Q),me(),_e?.(),E?.destroy(),Pe.stop(),I?.destroy(),w.close(),w.remove(),u.remove(),c instanceof HTMLElement&&c.isConnected&&c.focus(),rt(r.onDismiss,F?structuredClone(F):null))}g.onclick=()=>{if(!g.disabled){if(Pe.active){Pe.exit();return}wt(()=>r.client.submit({operation:"back",...Ge()}))}},h.onclick=()=>{Pe.open()},A.onclick=()=>{Ee()},C.onclick=()=>{wt(()=>r.client.retry())},w.addEventListener("cancel",Y=>{Y.preventDefault(),Ee()});try{let Y=await r.client.get();await Se(r.client.view??Y.run)}catch(Y){throw Ue(),Y}return{destroy:Ue,refresh:tt,review:Pe.open,exitReview:Pe.exit,get unappliedDrafts(){return Pe.drafts}}}gn();gr();ee();rk();ee();gn();var SX=n.record(n.string().regex(/^[a-f0-9]{64}$/),n.strictObject({at:n.number(),text:n.string()})),z6=2*1048576,vX=100;function wX(){try{return typeof window>"u"?void 0:window.localStorage}catch{return}}function U6(e,t){let r=t===void 0?wX():t,i=Promise.resolve();async function o(s){if(!r)return null;let c;try{return await Promise.race([Promise.resolve().then(()=>r.getItem(s)),new Promise(u=>{c=setTimeout(()=>u(null),vX)})])}catch{return null}finally{clearTimeout(c)}}async function a(){try{let s=await o(`${e}:artifacts`);if(s&&s.length<=z6)return SX.parse(JSON.parse(s))}catch{}return{}}return{async readManifest(){return o(e)},writeManifest(s){Promise.resolve().then(()=>r?.setItem(e,s)).catch(()=>{})},async readArtifact(s){let c=(await a())[s];return c&&Date.now()>=c.at&&Date.now()-c.at<=Pr.retentionMs?c.text:void 0},writeArtifact(s,c){r&&(i=i.catch(()=>{}).then(async()=>{let u=await a(),l=Date.now();u[s]={at:l,text:c};let d={},p=2,h=0;for(let[f,m]of Object.entries(u).sort(([,g],[,A])=>A.at-g.at)){if(m.at>l||l-m.at>Pr.retentionMs)continue;let g=new TextEncoder().encode(JSON.stringify({[f]:m})).byteLength;p+g>z6||h>=128||(d[f]=m,p+=g,h++)}await r.setItem(`${e}:artifacts`,JSON.stringify(d))}).catch(()=>{}))}}}TM();gn();async function _X(e,t,r){if(Number(e.headers.get("content-length"))>t)throw r.error("limit");let i=e.body?.getReader();if(!i)throw r.error("missing");let o=[],a=0;try{for(;;){r.signal?.throwIfAborted();let u=await i.read();if(u.done)break;if(a+=u.value.length,a>t)throw r.error("limit");o.push(u.value)}}finally{await i.cancel().catch(()=>{})}r.signal?.throwIfAborted();let s=new Uint8Array(a),c=0;for(let u of o)s.set(u,c),c+=u.length;return s}async function V6(e,t,r){return new TextDecoder("utf-8",{fatal:!0}).decode(await _X(e,t,r))}function B6(e,t){let r=typeof e=="string"?new TextEncoder().encode(e):e;return r.byteLength===t.byteLength&&nI(r)===t.sha256}var We=(e,t)=>new K(e,t),Po=()=>performance.now(),q6=e=>{typeof e=="object"&&"unref"in e&&e.unref()};function Z6(e){let t=X_.parse(e.scope),r=new wo(e.origin??OM);if(r.username||r.password||r.search||r.hash||r.pathname!=="/"||r.protocol!=="https:"&&!(r.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(r.hostname)))throw We("INVALID_URL","Configuration requires a trusted HTTPS origin");let i=new Set([r.origin,...(e.assetOrigins??[]).map(be=>{let he=new wo(be);if(he.protocol!=="https:"||he.username||he.password||he.search||he.hash||he.pathname!=="/")throw We("INVALID_URL","Invalid configuration asset origin");return he.origin})]),o=e.fetch??globalThis.fetch.bind(globalThis),a=`/api/v1/configuration/${t.environmentId}`,s=`indiana:configuration:1:${r.origin}:${_n(t)}`,c=U6(s,e.storage),u,l=0,d=0,p=!1,h=!1,f=0,m=0,g,A,C,w,E=0,I=new Set,F=new Set,L=new Map,q=new Map,H=0,X=!1;function M(){for(let be of I)try{be()}catch{}}function J(be){try{e.onError?.(be)}catch{}}let $=()=>!h&&!p&&!!u&&Po()<l&&Date.now()<d;function D(){if(!$())throw We("CONFIGURATION_EXPIRED","Refresh configuration before using it")}function U(be,he){let Se=new TextEncoder().encode(he).byteLength;if(!L.has(be)){for(;L.size&&(L.size>=128||H+Se>Pr.maxCacheBytes);){let me=L.entries().next().value;H-=new TextEncoder().encode(me[1]).byteLength,L.delete(me[0])}L.set(be,he),H+=Se}}function Q(be,he,Se){return V6(be,he,{signal:Se,error:me=>We("INVALID_RESPONSE",me==="missing"?"Configuration body is missing":"Configuration exceeds its byte limit")})}function N(be){let he=new wo(be,r);if(!i.has(he.origin)||he.username||he.password||he.hash||he.search)throw We("INVALID_URL","Configuration artifact origin is not trusted");return he.href}async function O(be,he,Se=!1){let me=await o(N(be),{method:"GET",credentials:"omit",redirect:"error",cache:Se?"default":"no-cache",signal:he,headers:{}});if(me.status===429){let _e=me.headers.get("retry-after")??"";E=/^\d+$/.test(_e)?Number(_e)*1e3:Math.max(0,Date.parse(_e)-Date.now())||15e3}if(!me.ok&&me.status!==304)throw We(`CONFIGURATION_HTTP_${me.status}`,"Configuration synchronization failed");return me}function z(be,he,Se){let me=Date.parse(be.headers.get("x-indiana-config-validated-at")??""),_e=Date.parse(be.headers.get("x-indiana-config-valid-until")??""),Ee=Date.parse(be.headers.get("date")??""),Ue=be.headers.get("age"),Y=Ue!==null&&/^\d+(\.\d+)?$/.test(Ue)?Number(Ue)*1e3:NaN;if(![me,_e,Ee,Y].every(Number.isFinite)||_e<=me||_e-me>Pr.maxControlAgeMs||me>Ee+1e3)throw We("INVALID_RESPONSE","Configuration freshness evidence is invalid");let Je=Math.min(_e-me,Se.maxControlAgeSeconds*1e3,Pr.maxControlAgeMs)-Math.max(Y,Ee-me,0)-(Po()-he);if(Je<=0)throw We("CONFIGURATION_EXPIRED","Configuration validation expired in transit");return Po()+Je}function V(){if(clearTimeout(C),clearTimeout(w),h||!I.size)return;$()&&(w=setTimeout(()=>{$()?V():M()},Math.max(1,l-Po())),q6(w));let be=m?Math.min(15e3,1e3*2**Math.min(m-1,4)):Math.min(15e3,(u?.policy.refreshIntervalSeconds??15)*1e3);C=setTimeout(()=>{de().catch(J)},Math.max(E,be*(.8+Math.random()*.2))),q6(C)}async function de(){if(h)throw We("CONFIGURATION_DISPOSED","Configuration manager was destroyed");if(g)return g;let be=f,he=new AbortController;A=he;let Se=(async()=>{if(!X){X=!0;try{let Pt=await c.readManifest();if(Pt&&!u){let Dt=tI.parse(JSON.parse(Pt));_n(Dt.scope)===_n(t)&&(u=Dt)}}catch{}}he.signal.throwIfAborted();let Ue=u,Y=Po(),Re=await O(a,he.signal);Re.status===304&&(!Ue||!Re.headers.has("x-indiana-config-validated-at")||!Re.headers.has("x-indiana-config-valid-until")||!Re.headers.has("age"))&&(Re=await O(a,he.signal));let Je=Re.status===304?Ue:tI.parse(JSON.parse(await Q(Re,Pr.maxManifestBytes,he.signal))),{generation:Le,...ct}=Je,lt=Re.headers.get("etag");if(_n(Je.scope)!==_n(t)||kL(ct)!==Le||lt!==`"${Le}"`&<!==`W/"${Le}"`)throw We("INVALID_RESPONSE","Configuration scope or content identity changed");if(Ue&&(Je.revision<Ue.revision||Je.revision===Ue.revision&&Je.generation!==Ue.generation))throw We("INVALID_RESPONSE","Configuration revision moved backwards or changed identity");for(let[Pt,Dt]of Object.entries(Ue?.funnels??{})){let Ot=Je.funnels[Pt];if(Ot&&(Ot.controlRevision<Dt.controlRevision||Ot.evaluationRevision<Dt.evaluationRevision||Ot.controlRevision===Dt.controlRevision&&Ot.state!==Dt.state||Ot.evaluationRevision===Dt.evaluationRevision&&Ot.evaluationMode!==Dt.evaluationMode))throw We("INVALID_RESPONSE","Funnel control revision changed identity")}let In=z(Re,Y,Je.policy);if(he.signal.throwIfAborted(),be!==f)throw We("CONFIGURATION_DISPOSED","Configuration scope changed");return u=Je,l=In,d=Date.now()+Math.max(0,In-Po()),p=!1,m=0,E=0,c.writeManifest(_n(Je)),M(),structuredClone(Je)})(),me=setTimeout(()=>he.abort(We("CONFIGURATION_UNAVAILABLE","Configuration initialization timed out")),Pr.initializationMs),_e=new Promise((Ue,Y)=>he.signal.addEventListener("abort",()=>Y(he.signal.reason),{once:!0})),Ee=Promise.race([Se,_e]).catch(Ue=>{throw m++,(Ue instanceof n.ZodError||Ue instanceof SyntaxError||Ue instanceof K&&["CONFIGURATION_HTTP_404","CONFIGURATION_HTTP_410","INVALID_RESPONSE"].includes(Ue.code))&&(l=0,p=!0,M()),Ue}).finally(()=>{clearTimeout(me),g===Ee&&(g=void 0),V()});return g=Ee,Ee}async function je(be){let he=be.sha256,Se=Le=>B6(Le,be);N(be.url);let me=L.get(he);if(me&&Se(me))return L.delete(he),L.set(he,me),me;if(q.has(he))return q.get(he);let _e=new AbortController;F.add(_e);let Ee=f,Ue=(async()=>{try{let lt=await c.readArtifact(he);if(lt&&Se(lt))return U(he,lt),lt}catch{}_e.signal.throwIfAborted();let Le=await O(be.url,_e.signal,!0),ct=await Q(Le,be.byteLength,_e.signal);if(!Se(ct))throw We("INVALID_RESPONSE","Configuration artifact digest or size mismatch");if(h||Ee!==f)throw We("CONFIGURATION_DISPOSED","Configuration scope changed");return U(he,ct),c.writeArtifact(he,ct),ct})(),Y=setTimeout(()=>_e.abort(We("CONFIGURATION_UNAVAILABLE","Configuration artifact timed out")),Pr.initializationMs),Re=new Promise((Le,ct)=>_e.signal.addEventListener("abort",()=>ct(_e.signal.reason),{once:!0})),Je=Promise.race([Ue,Re]).finally(()=>{clearTimeout(Y),F.delete(_e),q.delete(he)});return q.set(he,Je),Je}async function Ge(){return $()||await de(),D(),u}async function Pe(be){let he,Se=new Promise((me,_e)=>{he=setTimeout(()=>_e(We("CONFIGURATION_UNAVAILABLE","Configuration initialization timed out")),Pr.initializationMs)});try{return await Promise.race([be(),Se])}finally{clearTimeout(he)}}function pt(be,he){if(D(),u?.generation!==be.generation)throw We("CONFIGURATION_CHANGED","Configuration changed while preparing a snapshot");if(he&&u.funnels[he]?.state!=="active")throw We("FUNNEL_STOPPED","Funnel is paused or unavailable")}async function Ve(be){let he=be.gb.features;if(!he)throw We("CONFIGURATION_UNAVAILABLE","Public Feature delivery is disabled");let Se=be.artifacts[he];if(Se.formatVersion!==1)throw We("UNSUPPORTED_SCHEMA","Unsupported public GB configuration format");let me=h_.parse(JSON.parse(await je(Se)));if(_n(me.scope)!==_n({projectId:t.projectId,environment:t.environment})||me.generation!==Se.generation||me.remoteFeatures.some(_e=>Object.hasOwn(me.features,_e)))throw We("INVALID_RESPONSE","Public GB configuration scope or generation is invalid");return pt(be),{...me,evaluatedAt:new Date().toISOString(),expiresAt:new Date(Date.now()+Math.max(0,l-Po())).toISOString()}}async function ot(be,he){let Se=await Ge(),me=Se.funnels[be];he&&(!me||me.evaluationMode==="local"&&!me.versions[he])&&(g&&await g,Se=await de()),pt(Se,be);let _e=Se.funnels[be];if(_e.evaluationMode!=="local")throw We("EVALUATION_MODE","This Funnel executes at Indiana; public graph loading is disabled");let Ee=he??_e.currentVersionId,Ue=_e.versions[Ee];if(!Ue)throw We("CONFIGURATION_UNAVAILABLE","Pinned Funnel Version is unavailable");if(Se.artifacts[Ue.artifact].formatVersion!==3)throw We("UNSUPPORTED_SCHEMA","Unsupported public Funnel format");let[Y,Re]=await Promise.all([je(Se.artifacts[Ue.artifact]).then(Je=>CL(JSON.parse(Je))),_e.evaluationMode==="local"?Ve(Se):void 0]);if(Re&&_n(EL(Y,Re))!==_n(Ue.dependencies))throw We("INVALID_RESPONSE","Funnel and GB dependency contract do not match");return pt(Se,be),{document:Y,growth:Re,versionId:Ee,control:structuredClone(_e),manifest:structuredClone(Se)}}async function qe(be,he){try{return await ot(be,he)}catch(Se){if(!(Se instanceof K)||!(Se.code==="CONFIGURATION_CHANGED"||Se.code==="CONFIGURATION_HTTP_404"&&$()))throw Se;let me=u?.generation;if(g&&await g,await de(),Se.code!=="CONFIGURATION_CHANGED"&&u?.generation===me)throw Se;return ot(be,he)}}function wt(){p=!0,M(),de().catch(J)}let Kt=()=>{(typeof document>"u"||document.visibilityState==="visible")&&wt()};function tt(be){if(h)throw We("CONFIGURATION_DISPOSED","Configuration manager was destroyed");return I.add(be),I.size===1&&(typeof window<"u"&&(window.addEventListener("online",wt),window.addEventListener("focus",Kt),document.addEventListener("visibilitychange",Kt)),V()),()=>{I.delete(be),I.size||(clearTimeout(C),clearTimeout(w),Sr())}}function Sr(){typeof window<"u"&&(window.removeEventListener("online",wt),window.removeEventListener("focus",Kt),document.removeEventListener("visibilitychange",Kt))}return{scope:Object.freeze({...t}),refresh:de,subscribe:tt,assertFresh:D,assertFeatures(be){D();let he=u.gb.features;if(!he)throw We("CONFIGURATION_UNAVAILABLE","Public Feature delivery is disabled");if(be!==void 0&&u.artifacts[he].generation!==be)throw We("CONFIGURATION_CHANGED","Refresh changed Feature configuration before evaluation")},get fresh(){return $()},get snapshot(){return u?structuredClone(u):null},get remainingMs(){return $()?Math.max(0,l-Po()):0},async features(){return Pe(async()=>Ve(await Ge()))},pageExperiments:()=>Pe(async()=>{let be=await Ge(),he=be.gb.pageExperiments;if(!he)throw We("CONFIGURATION_UNAVAILABLE","Public page experiments are disabled");let Se=be.artifacts[he];if(Se.formatVersion!==1)throw We("UNSUPPORTED_SCHEMA","Unsupported page experiment format");let me=X2.parse(JSON.parse(await je(Se)));if(me.environmentId!==t.environmentId||me.generation!==Se.generation)throw We("INVALID_RESPONSE","Page experiment scope or generation changed");return pt(be),me}),funnel:(be,he)=>Pe(()=>qe(be,he)),paywall:(be,he)=>Pe(async()=>{let Se=await Ge(),me=Se.paywalls?.[be];if(!me||!he&&me.state!=="published")throw We("PAYWALL_UNAVAILABLE","Published Paywall is unavailable");let _e=he??me.currentVersionId,Ee=me.versions[_e],Ue=Ee&&Se.artifacts[Ee.artifact];if(!Ue||Ue.kind!=="paywall"||Ue.formatVersion!==1)throw We("UNSUPPORTED_SCHEMA","Public Paywall format is unavailable");let Y=wL.parse(JSON.parse(await je(Ue)));return pt(Se),{document:Y,versionId:_e,version:Ee.version,control:structuredClone(me),manifest:structuredClone(Se)}}),async localFunnel(be,he){let Se=await Pe(()=>qe(be,he));if(!Se.growth)throw We("EVALUATION_MODE","This Funnel requires remote execution");let{analyticsConfig:me,remoteFeatures:_e,...Ee}=Se.growth;return j2({scope:{projectId:t.projectId,environment:t.environment},funnelId:be,versionId:Se.versionId,evaluationMode:"local",evaluationRevision:Se.control.evaluationRevision,document:Se.document,payload:Ee})},assertFunnel(be,he,Se){D();let me=u.funnels[be];if(!me||me.state!=="active")throw We("FUNNEL_STOPPED","Funnel is paused or unavailable");if(me.evaluationMode!=="local")throw We("EVALUATION_MODE","This Funnel now executes at Indiana");if(he!==void 0&&me.controlRevision!==he)throw We("RUN_RECONCILIATION_REQUIRED","Reconcile the original Run after a control change");if(Se!==void 0&&!me.versions[Se])throw We("CONFIGURATION_UNAVAILABLE","Pinned Funnel Version is unavailable")},destroy(){if(!h){h=!0,f++,l=0,A?.abort(We("CONFIGURATION_DISPOSED","Configuration manager was destroyed")),clearTimeout(C),clearTimeout(w),Sr(),M(),I.clear();for(let be of F)be.abort(We("CONFIGURATION_DISPOSED","Configuration manager was destroyed"));L.clear(),H=0}}}}gn();gr();var H6=(e,t)=>new K(e,t);gr();async function G6(e,t,{predict:r=!0}={}){let i=t.instruction;if(i?.type!=="evaluate_segment")throw new Error("Local segment instruction required");if(!e)throw new K("CONFIGURATION_UNAVAILABLE","Local execution requires public configuration");if(e.scope.environmentId!==i.environmentId)throw new K("SCOPE_MISMATCH","Evaluation environment changed");let o=null,a;if(r)try{let s=await e.funnel(t.source.id,t.source.versionId);a=s.manifest.generation,o=IX(e,t,s)}catch{o=null}return a??=e.snapshot?.generation??(await e.refresh()).generation,{advance:{policyRevision:i.policyRevision,generation:a},prediction:o}}function IX(e,t,r){let i=t.instruction;if(i?.type!=="evaluate_segment"||!r.growth||r.control.evaluationMode!=="local"||r.control.evaluationRevision!==i.policyRevision)return null;let{analyticsConfig:o,remoteFeatures:a,...s}=r.growth,c=OI({scope:{projectId:e.scope.projectId,environment:e.scope.environment},funnelId:t.source.id,versionId:t.source.versionId,evaluationMode:"local",evaluationRevision:i.policyRevision,document:r.document,payload:Er.parse(s)}),u=kX(c,r.document,{...t,...i}),l=u.steps.at(-1),d=u.boundary??(l?.result.port==="value"?{nodeId:l.nodeId,visit:t.visit+u.steps.length-1}:null);return d?{runId:t.id,from:{nodeId:t.nodeId,visit:t.visit,revision:t.revision},nodeId:d.nodeId,visit:d.visit,terminal:!u.boundary}:null}function kX(e,t,r){return iM(e,t,r,H6)}gn();function _y(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((o,a)=>_y(o,t[a]));if(!e||!t||typeof e!="object"||typeof t!="object")return!1;let r=Object.entries(e),i=Object.entries(t);return r.length===i.length&&r.every(([o,a])=>Object.hasOwn(t,o)&&_y(a,Reflect.get(t,o)))}ee();var EX=/^\/api\/v1\/configuration\/[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}(?:\/artifacts\/[a-f0-9]{64})?$/,CX=n.strictObject({status:n.number().int().min(200).max(599),headers:n.record(n.string(),n.string()),body:n.string()});function K6(){let e=window,t,r=new Map,i=null,o=null,a=!1,s=!1,c=null,u,l=null,d=null,p=null,h=null,f=!1,m=new Set,g=null,A=null,C=null,w=new Set;function E(D){if(a)throw new K("CLOSED","Native host is unavailable");if(i)i.postMessage(JSON.stringify(D));else if(e.webkit?.messageHandlers?.indianaFunnel)e.webkit.messageHandlers.indianaFunnel.postMessage(D);else throw new K("BRIDGE_UNAVAILABLE","Native bridge is unavailable")}function I(D,U={}){let Q=crypto.randomUUID();return new Promise((N,O)=>{let z=setTimeout(()=>{r.delete(Q),O(new K("TIMEOUT","Retry the original command"))},45e3);r.set(Q,{resolve:N,reject:O,timer:z});try{E({id:Q,method:D,payload:U})}catch(V){clearTimeout(z),r.delete(Q),O(V)}})}function F(D,U=!1,Q=d,N){let O=Ql.parse(D);if(N&&O.settlement?.requestId!==N)throw new K("INVALID_RESPONSE","Exact command settlement is missing or changed");if(U&&!O.review)throw new K("INVALID_RESPONSE","Historical projection is missing");if(!c||O.scope.projectId!==c.projectId||O.scope.environment!==c.environment)throw new K("SCOPE_MISMATCH","Native run scope changed");if(d&&(d.id!==O.run.id||d.source.type!==O.run.source.type||d.source.id!==O.run.source.id||d.source.versionId!==O.run.source.versionId||d.locale!==O.run.locale||!_y(d.parameters,O.run.parameters)))throw new K("INVALID_RESPONSE","Run identity changed");if(U&&d&&d!==Q&&O.run.revision<=d.revision||(U&&!O.run.stopped&&["running","waiting"].includes(O.run.status)&&d&&O.run.nodeId===d.nodeId&&O.run.visit===d.visit&&O.run.revision===d.revision&&(O.run.screen=d.screen,(d.paywall?.quote?.operationId===O.review?.activeOperationId||!d.paywall?.quote&&O.review?.activeOperationId===null)&&(O.run.paywall=d.paywall)),["running","waiting"].includes(O.run.status)||(f=!0),d?.paywall&&O.run.paywall&&d.paywall.receiptId===O.run.paywall.receiptId&&(O.run.paywall.selectionGeneration??0)<(d.paywall.selectionGeneration??0)))return O;if(!d||O.run.revision>=d.revision){d=O.run;for(let z of w)try{z(structuredClone(d))}catch{}}return O}async function L(D){let U=hc.parse(D),Q=D.operation==="close";if(Q){if(f=!0,h&&JSON.stringify(h)!==JSON.stringify(D))throw new K("COMMAND_PENDING","Retry the original Close");h=D}if(!Q&&f)throw new K("COMMAND_PENDING","Settle the original command after Close");if(!Q&&p&&JSON.stringify(p)!==JSON.stringify(D))throw new K("COMMAND_PENDING","Retry the original command");Q||(p=D);let N=m.has(D.requestId);m.add(D.requestId);try{if(U.operation==="start"||U.operation==="review"||"customerToken"in U)throw new K("INVALID_REQUEST","Credentials belong to the native host");let O=F(await I("command",U),!1,d,D.requestId);return O.settlement?.state==="settled"&&(!f||Q||O.settlement?.requestId===D.requestId&&O.settlement.state==="settled"&&!["running","waiting"].includes(O.run.status))&&(p===D&&(p=null),h===D&&(h=null),m.delete(D.requestId)),O}catch(O){throw p===D&&!N&&!f&&O instanceof K&&O.status!==void 0&&O.status<500&&![401,425].includes(O.status)&&(p=null),O}}async function q(D,U){let Q=new URL(D instanceof Request?D.url:D);if(Q.origin!==t||Q.search||Q.hash||(U?.method??"GET")!=="GET"||!EX.test(Q.pathname))throw new K("INVALID_URL","Configuration path is not trusted");U?.signal?.throwIfAborted();let N=CX.parse(await I("configuration",{path:Q.pathname}));return U?.signal?.throwIfAborted(),new Response([204,205,304].includes(N.status)?null:N.body,{status:N.status,headers:N.headers})}async function H(D){if(D.run.instruction?.type!=="evaluate_segment"||p||f)return D;if(l)return l;let U=(async()=>{let Q=D;for(let N=0;N<32;N++){let O=Q.run,z=O.instruction;if(z?.type!=="evaluate_segment")break;if(a||!c)throw new K("IDENTITY_CHANGED","Native session changed");u??=Z6({origin:t,scope:{...c,environmentId:z.environmentId},fetch:q,storage:null});let V=()=>d&&(d.revision!==O.revision||d.visit!==O.visit||d.nodeId!==O.nodeId);if(z.type==="evaluate_segment"){let{advance:de}=await G6(u,O,{predict:!1});if(p||f)return Q;if(V())return F(await I("command",{operation:"get"}));Q=await L({operation:"commit_segment",requestId:E2(O.id,O.visit,`segment:${O.revision}`),nodeId:O.nodeId,visit:O.visit,revision:O.revision,...de})}}return Q})();l=U;try{return await U}finally{l===U&&(l=null)}}function X(){if(!a){a=!0,u?.destroy(),C?.destroy(),g?.destroy(),g=null,d=null,p=null,h=null,m.clear(),w.clear();for(let D of r.values())clearTimeout(D.timer),D.reject(new K("IDENTITY_CHANGED","Native identity changed"));r.clear(),i?.close(),i=null,o=null,window.removeEventListener("message",$),document.body.replaceChildren()}}let M={async resolvePaywall(D){return yo.parse(await I("paywallContent",{id:D.id,sha256:D.content.artifact.sha256}))},get view(){return d?structuredClone(d):null},get pendingCommand(){let D=h??p;return D?structuredClone(D):null},get pendingCommands(){return[p,h].filter(D=>D!==null).map(D=>structuredClone(D))},async settle(D){let U=F(await I("command",{operation:"get",settlementRequestId:D}));if(U.settlement?.requestId!==D)throw new K("INVALID_RESPONSE","Exact command settlement is missing");return U.settlement.state==="settled"&&(p?.requestId===D&&(p=null),h?.requestId===D&&(h=null),m.delete(D)),U},webViewUrl:"bundled",async review(D){let U=d;return F(await I("command",{operation:"review",...D?{receiptId:D}:{}}),!0,U)},async get(D,U){let Q=F(await I("command",{operation:"get",...D?{data:D}:{},...U?{purchase:U}:{}})),N=await I("pendingCommand");if(N){let O=hc.parse(N);if(O.operation==="get"||O.operation==="start"||O.operation==="review"||"customerToken"in O)throw new K("INVALID_RESPONSE","Invalid native pending command");O.operation==="close"?(h=O,f=!0):p=O}else p=null,h=null;return H(Q)},submit:D=>L(D).then(H),retry:()=>h?L(h):f&&p?M.settle(p.requestId):p?L(p).then(H):Promise.reject(new K("INVALID_REQUEST","No pending command")),resume:(D=d?.pendingRequest?.requestId)=>D?f?M.settle(D):L({operation:"resume",requestId:D}).then(H):Promise.reject(new K("INVALID_REQUEST","No interrupted command")),identify(){throw new K("INVALID_REQUEST","Customer credentials belong to the native session")},subscribe(D){return w.add(D),()=>w.delete(D)},reset:X};async function J(D,U,Q,N){if(s||a)return;let O=new URL(n.string().parse(U));if(O.origin!==U||O.username||O.password||O.protocol!=="https:"&&!(O.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(O.hostname)))throw new K("INVALID_CONFIGURATION","Invalid native API origin");if(t=O.origin,c=yt.parse(D),s=!0,Q==="features"){if(A=await FM(I,c,N),g=A,a){g.destroy(),g=null;return}await I("featuresReady");return}if(Q==="content"){g=await i6(I),a&&(g.destroy(),g=null);return}if(Q==="paywall"){if(C=await o6(V=>I("paywall",V)),a){C.destroy();return}g=(await my(document.body,{start:async()=>C,onPurchase:({operation:V})=>I("purchase",{operation:V}),onCheckoutUrl:V=>I("checkout",{url:V}),onOpenUrl:V=>I("open",{url:V}),onEvent:V=>I("event",{event:V}),onComplete:()=>I("complete"),onDismiss:()=>{a||I("dismiss").catch(()=>{})},onError:()=>{a||I("error").catch(()=>{})}})).host,a&&(g?.destroy(),g=null);return}if(Q!==void 0&&Q!=="funnel")throw new K("INVALID_CONFIGURATION","Unknown native surface");g=await F6(document.getElementById("grow-funnel-root")??document.body,{client:M,onPurchase:({operation:z})=>I("purchase",{operation:z}),onCheckoutUrl:z=>I("checkout",{url:z}),onOpenUrl:z=>I("open",z),onEvent:z=>I("event",{event:z}),onComplete:()=>I("complete"),onDismiss:()=>{a||I("dismiss").catch(()=>{})}}),a&&(g.destroy(),g=null)}e.__indianaFunnelReceive=D=>{if(a||!D||typeof D!="object")return;let U=D;if(U.event==="invalidated")return X();if(U.event==="feature_call"){let N=U.id;if(typeof N!="string"||!A)return;A.call(U.input).then(O=>I("featureResult",{id:N,result:O})).catch(O=>I("featureResult",{id:N,error:{code:O instanceof K?O.code:"INVALID_RESPONSE"}})).catch(()=>{});return}if(U.event==="refresh"){g?.refresh().catch(()=>{});return}if(U.event==="init"){J(U.scope,U.apiOrigin,U.surface,U.attributes).catch(X);return}if(typeof U.id!="string")return;let Q=r.get(U.id);if(Q)if(r.delete(U.id),clearTimeout(Q.timer),U.error&&typeof U.error=="object"){let N=U.error;Q.reject(new K(typeof N.code=="string"?N.code:"NATIVE_OPERATION_FAILED","Native operation did not finish",typeof N.status=="number"?N.status:void 0))}else Q.resolve(U.result)},e.__indianaFunnelPreparePort=D=>a||i||!/^[a-f0-9-]{36}$/.test(D)?!1:(o=D,!0);function $(D){let U=D.data;if(typeof U=="string")try{U=JSON.parse(U)}catch{return}!U||typeof U!="object"||!("type"in U)||U.type!=="indiana-native-port"||!o||!("nonce"in U)||U.nonce!==o||i||!D.ports[0]||(o=null,i=D.ports[0],i.onmessage=Q=>{if(!(typeof Q.data!="string"||Q.data.length>2097152))try{e.__indianaFunnelReceive?.(JSON.parse(Q.data))}catch{X()}},i.start(),E({id:crypto.randomUUID(),method:"ready",payload:{}}))}return window.addEventListener("message",$),e.webkit?.messageHandlers?.indianaFunnel&&E({id:crypto.randomUUID(),method:"ready",payload:{}}),{destroy:X}}globalThis.__indianaInstallNativeFunnelHost=K6;})();
|
|
245
|
+
/*!
|
|
246
|
+
Copyright (c) 2025 GrowthBook, Inc.
|
|
247
|
+
|
|
248
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
|
249
|
+
furnished to do so, subject to the following conditions:
|
|
250
|
+
|
|
251
|
+
The above copyright notice and this permission notice shall be included in all
|
|
252
|
+
copies or substantial portions of the Software.
|
|
253
|
+
|
|
254
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
255
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
256
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
257
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
258
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
259
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
260
|
+
SOFTWARE.
|
|
261
|
+
*/
|
|
262
|
+
/*! Bundled license information:
|
|
263
|
+
|
|
264
|
+
dompurify/dist/purify.es.mjs:
|
|
265
|
+
(*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE *)
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
globalThis.__indianaInstallNativeFunnelHost();</script></body></html>
|