@tinkerlandai/longplay-react-native 0.0.0-stage → 0.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/IndianaReactNative.podspec +19 -0
  2. package/README.md +119 -2
  3. package/THIRD_PARTY_NOTICES.md +101 -0
  4. package/android/build.gradle +24 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/java/ai/tinkerland/indiana/reactnative/IndianaBridgeModule.kt +237 -0
  7. package/android/src/main/java/ai/tinkerland/indiana/reactnative/IndianaBridgePackage.kt +11 -0
  8. package/dist/index.cjs +17 -0
  9. package/dist/index.d.cts +105287 -0
  10. package/dist/index.d.ts +105287 -0
  11. package/dist/index.js +17 -0
  12. package/ios/IndianaBridge.m +11 -0
  13. package/ios/IndianaBridge.swift +275 -0
  14. package/native-sdk/android/assets/indiana/index.html +268 -0
  15. package/native-sdk/android/java/ai/tinkerland/indiana/BillingAuthorizationTerms.kt +55 -0
  16. package/native-sdk/android/java/ai/tinkerland/indiana/BundledWebView.kt +90 -0
  17. package/native-sdk/android/java/ai/tinkerland/indiana/ContentSession.kt +45 -0
  18. package/native-sdk/android/java/ai/tinkerland/indiana/ContentView.kt +36 -0
  19. package/native-sdk/android/java/ai/tinkerland/indiana/CustomerOperations.generated.kt +84 -0
  20. package/native-sdk/android/java/ai/tinkerland/indiana/CustomerResponseSemantics.kt +197 -0
  21. package/native-sdk/android/java/ai/tinkerland/indiana/CustomerSemantics.kt +120 -0
  22. package/native-sdk/android/java/ai/tinkerland/indiana/CustomerSession.kt +106 -0
  23. package/native-sdk/android/java/ai/tinkerland/indiana/FeatureClient.kt +65 -0
  24. package/native-sdk/android/java/ai/tinkerland/indiana/FunnelCommandStorage.kt +163 -0
  25. package/native-sdk/android/java/ai/tinkerland/indiana/FunnelConfigurationRelay.kt +50 -0
  26. package/native-sdk/android/java/ai/tinkerland/indiana/FunnelSession.kt +208 -0
  27. package/native-sdk/android/java/ai/tinkerland/indiana/FunnelView.kt +71 -0
  28. package/native-sdk/android/java/ai/tinkerland/indiana/GeneratedProtocol.kt +16 -0
  29. package/native-sdk/android/java/ai/tinkerland/indiana/GoogleStorefront.kt +165 -0
  30. package/native-sdk/android/java/ai/tinkerland/indiana/HTTPTransport.kt +43 -0
  31. package/native-sdk/android/java/ai/tinkerland/indiana/IndianaClient.kt +526 -0
  32. package/native-sdk/android/java/ai/tinkerland/indiana/MerchantCommerceSemantics.kt +38 -0
  33. package/native-sdk/android/java/ai/tinkerland/indiana/NativePendingKeystore.kt +81 -0
  34. package/native-sdk/android/java/ai/tinkerland/indiana/NativeReceiptRelay.kt +28 -0
  35. package/native-sdk/android/java/ai/tinkerland/indiana/NativeStoreOffer.kt +24 -0
  36. package/native-sdk/android/java/ai/tinkerland/indiana/PaywallContent.kt +75 -0
  37. package/native-sdk/android/java/ai/tinkerland/indiana/PaywallSession.kt +144 -0
  38. package/native-sdk/android/java/ai/tinkerland/indiana/PaywallView.kt +74 -0
  39. package/native-sdk/android/java/ai/tinkerland/indiana/Protocol.kt +28 -0
  40. package/native-sdk/android/java/ai/tinkerland/indiana/PushInstallation.kt +170 -0
  41. package/native-sdk/android/java/ai/tinkerland/indiana/RendererNavigation.kt +13 -0
  42. package/native-sdk/android/java/ai/tinkerland/indiana/SDKVersion.kt +6 -0
  43. package/native-sdk/android/java/ai/tinkerland/indiana/StoreSubscriptionManagement.kt +19 -0
  44. package/native-sdk/android/java/ai/tinkerland/indiana/WireSchema.kt +76 -0
  45. package/native-sdk/android/java/ai/tinkerland/longplay/CustomerOperations.generated.kt +82 -0
  46. package/native-sdk/android/java/ai/tinkerland/longplay/Longplay.kt +32 -0
  47. package/native-sdk/android/resources/funnel-wire-schemas.json +1 -0
  48. package/native-sdk/android/resources/indiana-third-party-notices.txt +101 -0
  49. package/native-sdk/android/resources/renderer-data-url.txt +1 -0
  50. package/native-sdk/ios/AnalyticsReceipt.swift +10 -0
  51. package/native-sdk/ios/AppleStorefront.swift +218 -0
  52. package/native-sdk/ios/BillingAuthorizationTerms.swift +57 -0
  53. package/native-sdk/ios/BundledWebView.swift +87 -0
  54. package/native-sdk/ios/ContentSession.swift +48 -0
  55. package/native-sdk/ios/ContentView.swift +51 -0
  56. package/native-sdk/ios/CustomerOperations.generated.swift +166 -0
  57. package/native-sdk/ios/CustomerResponseSemantics.swift +236 -0
  58. package/native-sdk/ios/CustomerSemantics.swift +145 -0
  59. package/native-sdk/ios/CustomerSession.swift +129 -0
  60. package/native-sdk/ios/FeatureClient.swift +86 -0
  61. package/native-sdk/ios/FunnelCommandStorage.swift +163 -0
  62. package/native-sdk/ios/FunnelConfigurationRelay.swift +48 -0
  63. package/native-sdk/ios/FunnelSession.swift +232 -0
  64. package/native-sdk/ios/FunnelView.swift +125 -0
  65. package/native-sdk/ios/GeneratedProtocol.swift +16 -0
  66. package/native-sdk/ios/HTTPTransport.swift +74 -0
  67. package/native-sdk/ios/IndianaClient.swift +601 -0
  68. package/native-sdk/ios/MerchantCommerceSemantics.swift +51 -0
  69. package/native-sdk/ios/NativePendingKeychain.swift +52 -0
  70. package/native-sdk/ios/NativeReceiptRelay.swift +28 -0
  71. package/native-sdk/ios/NativeStoreOffer.swift +34 -0
  72. package/native-sdk/ios/PaywallContent.swift +75 -0
  73. package/native-sdk/ios/PaywallSession.swift +124 -0
  74. package/native-sdk/ios/PaywallView.swift +87 -0
  75. package/native-sdk/ios/Protocol.swift +49 -0
  76. package/native-sdk/ios/PushInstallation.swift +154 -0
  77. package/native-sdk/ios/RendererNavigation.swift +8 -0
  78. package/native-sdk/ios/Resources.swift +15 -0
  79. package/native-sdk/ios/SDKVersion.swift +4 -0
  80. package/native-sdk/ios/StoreSubscriptionManagement.swift +11 -0
  81. package/native-sdk/ios/WebView/THIRD_PARTY_NOTICES.txt +101 -0
  82. package/native-sdk/ios/WebView/index.html +268 -0
  83. package/native-sdk/ios/WebView/renderer-data-url.txt +1 -0
  84. package/native-sdk/ios/WireSchema.swift +107 -0
  85. package/native-sdk/ios/funnel-wire-schemas.json +1 -0
  86. package/package.json +62 -4
  87. 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-1lw0EMnLzO0PihpQI0QLM2+mI9sHQQWBvLINZHkqQPg=' '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 zV=Object.create;var Zy=Object.defineProperty;var UV=Object.getOwnPropertyDescriptor;var VV=Object.getOwnPropertyNames;var BV=Object.getPrototypeOf,qV=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 Ga=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},ke=(e,t)=>{for(var r in t)Zy(e,r,{get:t[r],enumerable:!0})},ZV=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of VV(t))!qV.call(e,o)&&o!==r&&Zy(e,o,{get:()=>t[o],enumerable:!(i=UV(t,o))||i.enumerable});return e};var HV=(e,t,r)=>(r=e!=null?zV(BV(e)):{},ZV(t||!e||!e.__esModule?Zy(r,"default",{value:e,enumerable:!0}):r,e));var Ee={};ke(Ee,{BIGINT_FORMAT_RANGES:()=>nu,CONSTANT_CATCH:()=>Vd,Class:()=>Ky,NUMBER_FORMAT_RANGES:()=>tu,aborted:()=>Ln,allowsEval:()=>Qy,assert:()=>QV,assertEqual:()=>GV,assertIs:()=>WV,assertNever:()=>JV,assertNotEqual:()=>KV,assignProp:()=>vn,attachSchema:()=>ru,base64ToUint8Array:()=>zP,base64urlToUint8Array:()=>g4,cached:()=>Qa,captureStackTrace:()=>Fd,cleanEnum:()=>h4,cleanRegex:()=>_i,clone:()=>xt,cloneDef:()=>e4,codePointLength:()=>Zo,constantCatch:()=>rb,createTransparentProxy:()=>a4,defineLazy:()=>Wy,defineLazyInternal:()=>Xe,derived:()=>x4,esc:()=>jn,escapeRegex:()=>kr,explicitlyAborted:()=>eb,extend:()=>u4,finalizeIssue:()=>Yn,floatSafeRemainder:()=>Yc,getElementAtPath:()=>t4,getEnumValues:()=>Wa,getLengthableOrigin:()=>ou,getParsedType:()=>o4,getSizableOrigin:()=>iu,hexToUint8Array:()=>b4,hide:()=>au,installLazyProp:()=>_4,isObject:()=>qo,isPlainObject:()=>Ir,issue:()=>es,joinValues:()=>Ld,jsonStringifyReplacer:()=>Ja,members:()=>nb,merge:()=>d4,mergeDefs:()=>Ur,normalizeParams:()=>ue,nullish:()=>Md,numKeys:()=>i4,objectClone:()=>YV,omit:()=>c4,optionalKeys:()=>Xy,own:()=>Bi,parsedType:()=>tb,partial:()=>p4,pick:()=>s4,prefixIssues:()=>Qn,primitiveTypes:()=>Yy,promiseAllObject:()=>n4,propertyKeyTypes:()=>eu,randomString:()=>r4,rawShape:()=>Ya,required:()=>m4,safeExtend:()=>l4,shallowClone:()=>Xc,sizeCaps:()=>Xa,slugify:()=>Jy,stringifyPrimitive:()=>zd,toZod:()=>Qc,uint8ArrayToBase64:()=>UP,uint8ArrayToBase64url:()=>y4,uint8ArrayToHex:()=>A4,unwrapMessage:()=>Ka});function GV(e){return e}function KV(e){return e}function Qc(){return e=>e}function WV(e){}function JV(e){throw new Error("Unexpected value in exhaustive check")}function QV(e){}function Wa(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 Ld(e,t="|"){return e.map(r=>zd(r)).join(t)}function Ja(e,t){return typeof t=="bigint"?t.toString():t}function Qa(e){return new Gy(e)}function Md(e){return e==null}function _i(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Yc(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 Wy(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==jP)return i===void 0&&(i=jP,i=r()),i},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function YV(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function vn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ya(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function wi(e){return Ya(e._zod.def)??e._zod.def.shape}function LP(e,t,r){Object.defineProperty(e,t,{get(){let i=r();return vn(this,t,i),i},enumerable:!0,configurable:!0})}function MP(e,t,r){t in e?vn(e,t,r):e[t]=r}function Bo(e,t,r,i){let o=wi(t);for(let a of r){let s=Object.getOwnPropertyDescriptor(o,a);s.enumerable&&(s.get?LP(e,a,()=>{let c=t._zod.def.shape[a];return i?i(c,a):c}):MP(e,a,i?i(s.value,a):s.value))}}function XV(e,t){for(let r of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,r);i.enumerable&&(i.get?LP(e,r,()=>t[r]):MP(e,r,i.value))}}function Ur(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function e4(e){return Ur(e._zod.def)}function t4(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function n4(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 r4(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function jn(e){return JSON.stringify(e)}function Jy(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function qo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ir(e){if(qo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(qo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Xc(e){return Ir(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function i4(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function kr(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 ue(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 a4(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 zd(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Xy(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function s4(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 Bo(a,e,Ud(e,t)),xt(e,Ur(r,{shape:a,checks:[]}))}function Ud(e,t){let r=wi(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 c4(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(Ud(e,t)),s={};return Bo(s,e,Reflect.ownKeys(wi(e)).filter(c=>!a.has(c))),xt(e,Ur(r,{shape:s,checks:[]}))}function u4(e,t){if(!Ir(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=wi(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,Ur(e._zod.def,{shape:FP(e,t)}))}function FP(e,t){let r={};return Bo(r,e,Reflect.ownKeys(wi(e))),XV(r,t),r}function l4(e,t){if(!Ir(t))throw new Error("Invalid input to safeExtend: expected a plain object");return xt(e,Ur(e._zod.def,{shape:FP(e,t)}))}function d4(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={};Bo(r,e,Reflect.ownKeys(wi(e))),Bo(r,t,Reflect.ownKeys(wi(t)));let i=Ur(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return xt(e,i)}function p4(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(Ud(t,r)):void 0,u={};return Bo(u,t,Reflect.ownKeys(wi(t)),e&&((l,d)=>c&&!c.has(d)?l:new e({type:"optional",innerType:l}))),xt(t,Ur(t._zod.def,{shape:u,checks:[]}))}function m4(e,t,r){let i=r?new Set(Ud(t,r)):void 0,o={};return Bo(o,t,Reflect.ownKeys(wi(t)),(a,s)=>i&&!i.has(s)?a:new e({type:"nonoptional",innerType:a})),xt(t,Ur(t._zod.def,{shape:o}))}function Ln(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 eb(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 Qn(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function Ka(e){return typeof e=="string"?e:e?.message}function Xa(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 ru(e,t,r){var i;for(let o=t;o<e.length;o++)(i=e[o]).schema??(i.schema=r)}function Yn(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:Ka(e.inst?._zod.def?.error?.(e))??Ka(a?.(e))??Ka(t?.error?.(e))??Ka(r.customError?.(e))??Ka(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 iu(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Zo(e){let t=e.length;if(!f4.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 ou(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function tb(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 es(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function h4(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function zP(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 UP(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function g4(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return zP(t+r)}function y4(e){return UP(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function b4(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 A4(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}function nb(e,t){for(let r in t){let i=Object.getOwnPropertyDescriptor(t,r);i.get?Object.defineProperty(e,r,{...i,enumerable:!1}):S4(e,r,i.value)}}function Bi(e,t,r,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:r}),r}function au(e,t,r){return Bi(e,t,r,!1)}function x4(e,t){for(let r in e){let i=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Bi(this,r,i(this))},set(o){Bi(this,r,o)}})}return t}function S4(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Bi(this,t,r.bind(this))},set(i){Bi(this,t,i)}})}function v4(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}function Xe(e,t,r){let i=Object.getPrototypeOf(e._zod);if(t in i&&Hy!==e._zod){Hy=void 0;return}Hy=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,w4);let o=Vi;Vi=!1;try{let a=r(this);return Vi?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:a}),Vi=Vi||o,a}catch(a){throw delete this[t],Vi=Vi||o,a}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function _4(e,t,r,i){let o=v4(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 rb(e){let t=()=>e;return t[Vd]=!0,t}var Gy,jP,Fd,Qy,o4,eu,Yy,tu,nu,f4,Ky,Hy,Vi,w4,Vd,en=x(()=>{qi();Gy=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}};jP=Symbol("evaluating");Fd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Qy=Qa(()=>{if(mn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});o4=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}`)}},eu=new Set(["string","number","symbol"]),Yy=new Set(["string","number","bigint","boolean","symbol","undefined"]);tu={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]},nu={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};f4=/[\uD800-\uDBFF]/;Ky=class{constructor(...t){}};Vi=!1,w4={configurable:!0,get(){Vi=!0}};Vd="~constantCatch"});function I4(e){let t=BP;if(t){let r=t.stackTraceLimit;if(typeof r=="number"){try{t.stackTraceLimit=0}catch{return BP=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function D(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{ib.value=new a(f);try{Object.defineProperty(h,"_zod",ib)}finally{ib.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),nb(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?I4(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(mn,e),mn}var VP,ob,ib,BP,ab,Xn,Zi,mn,qi=x(()=>{en();ob=Object.freeze({status:"aborted"}),ib={value:void 0,enumerable:!1},BP="captureStackTrace"in Error?Error:null;ab=Symbol("zod_brand"),Xn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Zi=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(VP=globalThis).__zod_globalConfig??(VP.__zod_globalConfig={});mn=globalThis.__zod_globalConfig});function k4(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ja,2)),e.message}function E4(e){this._zod.message=e}function P4(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 su(e,t=r=>r.message){let r={},i=[];for(let o of e.issues)o.path.length>0?P4(r,o.path[0],()=>[]).push(t(o)):i.push(t(o));return{formErrors:i,fieldErrors:r}}function cu(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 lb(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 HP(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 db(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 ${HP(i.path)}`);return t.join(`
2
+ `)}var C4,cb,qP,ZP,ub,er,pb=x(()=>{qi();en();C4={get:k4,set:E4,enumerable:!0,configurable:!0},cb={value:void 0,enumerable:!1},qP=new WeakSet([Object.prototype,Error.prototype]),ZP=(e,t)=>{e.name="$ZodError",cb.value=t,Object.defineProperty(e,"issues",cb),cb.value=void 0,Object.defineProperty(e,"message",C4);let r=Object.getPrototypeOf(e);qP.has(r)||(qP.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})}}))},ub=D("$ZodError",ZP),er=D("$ZodError",ZP,void 0,{Parent:Error})});function Bd(e,t){return{callee:t?.callee??e,Err:t?.Err}}function GP(e,t,r){let i;return{success:!1,get error(){return i||(i=new e(t.map(o=>Yn(o,r,Bt()))),t=void 0,r=void 0),i},set error(o){i=o,t=void 0,r=void 0}}}function $4(e,t,r){let i=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,a;if(o?(i[D4]=!0,a=o({value:t,issues:[]},i)):a=e._zod.run({value:t,issues:[]},i),a instanceof Promise)throw new Xn;return a.issues.length===0}var ts,qd,ns,Zd,rs,T4,is,R4,N4,D4,uu,lu,Hd,j4,Gd,L4,Kd,M4,Wd,F4,Jd,z4,Qd,U4,Yd,V4,Xd,B4,mb=x(()=>{qi();pb();en();ts=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 Xn;if(c.issues.length){let u=new(a?.Err??e)(c.issues.map(l=>Yn(l,s,Bt())));throw Fd(u,a?.callee??t),u}return c.value};return t},qd=ts(er),ns=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=>Yn(l,s,Bt())));throw Fd(u,a?.callee??t),u}return c.value};return t},Zd=ns(er),rs=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 Xn;return a.issues.length?GP(e,a.issues,o):{success:!0,data:a.value}},T4=rs(er);is=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?GP(e,a.issues,o):{success:!0,data:a.value}},R4=is(er),N4=Symbol.for("zod.compile.invalid"),D4=Symbol.for("zod.compile.fallback"),uu=((e,t,r)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==N4)return!0;if(i.definite===!0&&r===void 0)return!1}return $4(e,t,r)});lu=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},Hd=e=>{let t=ts(e),r=(i,o,a,s)=>{let c=a?{...a,direction:"backward"}:{direction:"backward"};return t(i,o,c,Bd(r,s))};return r},j4=Hd(er),Gd=e=>{let t=ts(e),r=(i,o,a,s)=>t(i,o,a,Bd(r,s));return r},L4=Gd(er),Kd=e=>{let t=ns(e),r=async(i,o,a,s)=>{let c=a?{...a,direction:"backward"}:{direction:"backward"};return await t(i,o,c,Bd(r,s))};return r},M4=Kd(er),Wd=e=>{let t=ns(e),r=async(i,o,a,s)=>await t(i,o,a,Bd(r,s));return r},F4=Wd(er),Jd=e=>(t,r,i)=>{let o=i?{...i,direction:"backward"}:{direction:"backward"};return rs(e)(t,r,o)},z4=Jd(er),Qd=e=>(t,r,i)=>rs(e)(t,r,i),U4=Qd(er),Yd=e=>async(t,r,i)=>{let o=i?{...i,direction:"backward"}:{direction:"backward"};return is(e)(t,r,o)},V4=Yd(er),Xd=e=>async(t,r,i)=>is(e)(t,r,i),B4=Xd(er)});var Er={};ke(Er,{anyString:()=>zb,base64:()=>Tb,base64url:()=>Rb,bigint:()=>Vb,boolean:()=>Bb,browserEmail:()=>Q4,cidrv4:()=>Pb,cidrv6:()=>Ob,creditCard:()=>ep,cuid:()=>hb,cuid2:()=>gb,currencyCode:()=>jb,date:()=>Lb,datetime:()=>Fb,domain:()=>Db,duration:()=>vb,e164:()=>$b,email:()=>_b,emoji:()=>Ib,extendedDuration:()=>q4,guid:()=>wb,hex:()=>Kb,hostname:()=>Nb,html5Email:()=>K4,httpProtocol:()=>du,iban:()=>tp,idnEmail:()=>J4,integer:()=>pu,ipv4:()=>kb,ipv6:()=>Eb,ksuid:()=>Ab,lowercase:()=>Hb,mac:()=>Cb,md5_base64:()=>tB,md5_base64url:()=>nB,md5_hex:()=>eB,nanoid:()=>xb,nanoidOfLength:()=>Sb,null:()=>qb,number:()=>Ii,rfc5322Email:()=>W4,sha1_base64:()=>iB,sha1_base64url:()=>oB,sha1_hex:()=>rB,sha256_base64:()=>sB,sha256_base64url:()=>cB,sha256_hex:()=>aB,sha384_base64:()=>lB,sha384_base64url:()=>dB,sha384_hex:()=>uB,sha512_base64:()=>mB,sha512_base64url:()=>fB,sha512_hex:()=>pB,string:()=>Ub,time:()=>Mb,ulid:()=>yb,undefined:()=>Zb,unicodeEmail:()=>KP,uppercase:()=>Gb,uuid:()=>Ho,uuid4:()=>Z4,uuid6:()=>H4,uuid7:()=>G4,xid:()=>bb});function Sb(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function Ib(){return new RegExp(Y4,"u")}function X4(e){return new RegExp(`^${e}$`)}function fb(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 Mb(e){return new RegExp(`^${fb(e)}$`)}function Fb(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${fb({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${r}|${fb({precision:e.precision})}`:r;return new RegExp(`^${WP}T(?:${i})$`)}function mu(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fu(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var hb,gb,yb,bb,Ab,xb,vb,q4,wb,Ho,Z4,H4,G4,_b,K4,W4,KP,J4,Q4,Y4,kb,Eb,Cb,Pb,Ob,Tb,Rb,Nb,Db,du,$b,ep,jb,tp,WP,Lb,zb,Ub,Vb,pu,Ii,Bb,qb,Zb,Hb,Gb,Kb,eB,tB,nB,rB,iB,oB,aB,sB,cB,uB,lB,dB,pB,mB,fB,Go=x(()=>{en();hb=/^[cC][0-9a-z]{6,}$/,gb=/^[0-9a-z]+$/,yb=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,bb=/^[0-9a-vA-V]{20}$/,Ab=/^[A-Za-z0-9]{27}$/,xb=/^[a-zA-Z0-9_-]{21}$/;vb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,q4=/^[-+]?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)?)??$/,wb=/^([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})$/,Ho=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)$/,Z4=Ho(4),H4=Ho(6),G4=Ho(7),_b=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,K4=/^[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])?)*$/,W4=/^(([^<>()\[\]\\.,;:\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,}))$/,KP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,J4=KP,Q4=/^[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])?)*$/,Y4="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";kb=/^(?:(?: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])$/,Eb=/^(([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}|:))$/,Cb=e=>{let t=kr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Pb=/^((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])$/,Ob=/^(([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])$/,Tb=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rb=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Nb=/^(?=.{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])?)*\.?$/,Db=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,du=/^https?$/,$b=/^\+[1-9]\d{6,14}$/,ep=/^\d(?:[ -]?\d){11,18}$/,jb=/^(?: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)$/,tp=/^[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])))";Lb=X4(WP);zb=/^[\s\S]{0,}$/,Ub=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Vb=/^-?\d+n?$/,pu=/^-?\d+$/,Ii=/^-?\d+(?:\.\d+)?$/,Bb=/^(?:true|false)$/i,qb=/^null$/i,Zb=/^undefined$/i,Hb=/^[^A-Z]*$/,Gb=/^[^a-z]*$/,Kb=/^[0-9a-fA-F]*$/;eB=/^[0-9a-fA-F]{32}$/,tB=mu(22,"=="),nB=fu(22),rB=/^[0-9a-fA-F]{40}$/,iB=mu(27,"="),oB=fu(27),aB=/^[0-9a-fA-F]{64}$/,sB=mu(43,"="),cB=fu(43),uB=/^[0-9a-fA-F]{96}$/,lB=mu(64,""),dB=fu(64),pB=/^[0-9a-fA-F]{128}$/,mB=mu(86,"=="),fB=fu(86)});function rp(e,t,r){e.issues.length&&t.issues.push(...Qn(r,e.issues))}var Et,Wb,Jb,np,ip,op,Qb,Yb,Xb,eA,tA,nA,rA,iA,oA,os,aA,sA,cA,uA,lA,dA,pA,mA,fA,hA,ap=x(()=>{qi();Go();en();Et=D("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Wb=e=>{let t=e.value;return!Md(t)&&t.size!==void 0},Jb=e=>{let t=e.value;return!Md(t)&&t.length!==void 0},np={number:"number",bigint:"bigint",object:"date"},ip=D("$ZodCheckLessThan",(e,t)=>{Et.init(e,t);let r=np[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:np[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})}}),op=D("$ZodCheckGreaterThan",(e,t)=>{Et.init(e,t);let r=np[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:np[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})}}),Qb=D("$ZodCheckMultipleOf",(e,t)=>{Et.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):Yc(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})}}),Yb=D("$ZodCheckNumberFormat",(e,t)=>{Et.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[o,a]=tu[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})}}),Xb=D("$ZodCheckBigIntFormat",(e,t)=>{Et.init(e,t);let[r,i]=nu[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})}}),eA=D("$ZodCheckMaxSize",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=Wb),e._zod.check=i=>{let o=i.value;o.size<=t.maximum||i.issues.push({origin:iu(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tA=D("$ZodCheckMinSize",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=Wb),e._zod.check=i=>{let o=i.value;o.size>=t.minimum||i.issues.push({origin:iu(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),nA=D("$ZodCheckSizeEquals",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=Wb),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:iu(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})}}),rA=D("$ZodCheckMaxLength",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=Jb),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=ou(o);i.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),iA=D("$ZodCheckMinLength",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=Jb),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=ou(o);i.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),oA=D("$ZodCheckLengthEquals",(e,t)=>{var r;Et.init(e,t),(r=e._zod.def).when??(r.when=Jb),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=ou(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})}}),os=D("$ZodCheckStringFormat",(e,t)=>{var r,i;Et.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=()=>{})}),aA=D("$ZodCheckRegex",(e,t)=>{os.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})}}),sA=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Hb),os.init(e,t)}),cA=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Gb),os.init(e,t)}),uA=D("$ZodCheckIncludes",(e,t)=>{Et.init(e,t);let r=kr(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})}}),lA=D("$ZodCheckStartsWith",(e,t)=>{Et.init(e,t);let r=new RegExp(`^${kr(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})}}),dA=D("$ZodCheckEndsWith",(e,t)=>{Et.init(e,t);let r=new RegExp(`.*${kr(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})}});pA=D("$ZodCheckProperty",(e,t)=>{Et.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=>rp(o,r,t.property));rp(i,r,t.property)}}),mA=D("$ZodCheckProperties",(e,t)=>{Et.init(e,t),au(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=>rp(l,i,s)))):rp(u,i,s)}if(a)return Promise.all(a).then(()=>{})}}),fA=D("$ZodCheckMimeType",(e,t)=>{Et.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})}}),hA=D("$ZodCheckOverwrite",(e,t)=>{Et.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var Ko,sp=x(()=>{Ko=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 gA,yA=x(()=>{gA={major:4,minor:6,patch:6}});async function hB(e,t){let r={async:!0};return pO(await e._zod.run({value:t,issues:[]},r),r)}function pp(e){return{validate:t=>{let r={async:!1};try{let i=e._zod.run({value:t,issues:[]},r);if(!(i instanceof Promise))return pO(i,r)}catch{}return hB(e,t)},vendor:"zod",version:1}}function wA(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function mp(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?wA(e)||hu:mO(e,t)}function mO(e,t){if(!t.normalize&&t.protocol?.source===du.source&&!/^https?:\/\//i.test(e))return vA;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse=="function")return r.parse(e)??hu}return new URL(e)}catch{return hu}}function gu(e){return e.replace(gB,"")}function fp(e,t){return t.lastIndex=0,t.test(e.hostname)}function hp(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}function yu(e){return yB.test(e)?wA(`http://[${e}]`):!1}function gp(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:yu(r)}function bu(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function bp(e){if(!Au.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return bu(r)}function AB(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 Ap(e){return ep.test(e)?AB(e.replace(bB,"")):!1}function xB(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 xp(e){return tp.test(e)?xB(e):!1}function Sp(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 ix(e,t){let r=Xa(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 Xa(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,ru(a.issues,d,e),a}}return o(a,s)}}function QP(e,t,r){e.issues.length&&t.issues.push(...Qn(r,e.issues)),t.value[r]=e.value}function dp(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(...Qn(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 fO(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),i=r.length?r:_B,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=Xy(e.shape);return{...e,allKeys:o,symbolKeys:i,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function hO(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(Ln(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=>dp(A,r,m,t,p,h))):dp(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 YP(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=>!Ln(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=>Yn(s,i,Bt())))}),t)}function XP(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=>Yn(s,i,Bt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1,matches:o}),t)}function cx(e,t){let r=e._zod,i=r.bag.optionsMap;i||(i=yO(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 yO(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 as(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(Ir(e)&&Ir(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=as(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=as(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 eO(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=as(t.value,r.value);if(!u.valid){if(Ln(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}function tO(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 nO(e,t,r){e.issues.length&&t.issues.push(...Qn(r,e.issues)),t.value[r]=e.value}function rO(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(...Qn(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 iO(e,t,r,i,o,a,s){e.issues.length&&(eu.has(typeof i)?r.issues.push(...Qn(i,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:o,inst:a,issues:e.issues.map(c=>Yn(c,s,Bt()))})),t.issues.length&&(eu.has(typeof i)?r.issues.push(...Qn(i,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:a,key:i,issues:t.issues.map(c=>Yn(c,s,Bt()))})),r.value.set(e.value,t.value)}function oO(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function aO(e,t){return e.value=t.issues.length?void 0:t.value,e}function sO(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function cO(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 uO(e,t,r,i){return t.issues.length?(e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Yn(o,i,Bt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function cp(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 up(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=>lp(e,a,t.out,r)):lp(e,o,t.out,r)}else{let o=t.reverseTransform(e.value,e);return o instanceof Promise?o.then(a=>lp(e,a,t.in,r)):lp(e,o,t.in,r)}}function lp(e,t,r,i){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},i)}function lO(e){return e.memo||(e.value=Object.freeze(e.value)),e}function IB(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 Ub({minimum:o,maximum:a}).source;let s=e._zod.pattern;return(i&&s===Ii?pu:s)?.source}function bA(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=bA(i);return r&&o&&a&&a!==o?r.replace(_i(o),()=>_i(a)):r}if(t.options){let o=t.options.map(bA);if(o.every(Boolean))return`^(${o.map(a=>_i(a)).join("|")})$`}return IB(e)}function dO(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(es(o))}}var He,pO,Wo,St,AA,xA,SA,vA,hu,gB,_A,IA,kA,EA,CA,PA,OA,TA,RA,NA,DA,$A,jA,yB,LA,MA,FA,zA,yp,UA,Au,VA,BA,bB,qA,ZA,HA,GA,vp,KA,xu,wp,WA,JA,QA,YA,XA,ex,tx,nx,rx,SB,vB,wB,ox,_B,gO,ax,Su,sx,ux,lx,_p,dx,px,mx,fx,hx,gx,yx,Ip,bx,Ax,xx,Sx,vx,wx,_x,Ix,kp,vu,kx,Ex,Cx,Px,Ox,wu,Tx,ss=x(()=>{ap();qi();sp();mb();Go();en();yA();en();He=D("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gA;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=Ln(c),p;for(let h of u){if(h._zod.def.when){if(eb(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 Xn;if(p||m instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await m,c.issues.length!==f&&(ru(c.issues,f,e),d||(d=Ln(c,f)))});else{if(c.issues.length===f)continue;ru(c.issues,f,e),d||(d=Ln(c,f))}}return p?p.then(()=>c):c},s=(c,u,l)=>{if(Ln(c))return c.aborted=!0,c;let d=a(u,o,l);if(d instanceof Promise){if(l.async===!1)throw new Xn;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 Xn;return l.then(d=>a(d,o,u))}return a(l,o,u)}}},{get"~standard"(){return au(this,"~standard",pp(this))},set"~standard"(e){Bi(this,"~standard",e)}}),pO=(e,t)=>e.issues.length?{issues:e.issues.map(r=>Yn(r,t,Bt()))}:{value:e.value};Wo=D("$ZodString",(e,t)=>{He.init(e,t),e._zod.pattern=t.pattern??zb,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=D("$ZodStringFormat",(e,t)=>{os.init(e,t),Wo.init(e,t)}),AA=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wb),St.init(e,t)}),xA=D("$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=Ho(i))}else t.pattern??(t.pattern=Ho());St.init(e,t)}),SA=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_b),St.init(e,t)}),vA=1,hu=2;gB=/[\t\n\r]/g;_A=D("$ZodURL",(e,t)=>{St.init(e,t),e._zod.check=r=>{try{let i=r.value.trim(),o=mp(i,t);if(o===vA){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===hu){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=gu(i);return}t.hostname&&!fp(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&&!hp(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:gu(i);return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),IA=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ib()),St.init(e,t)}),kA=D("$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?xb:Sb(t.length)),St.init(e,t)}),EA=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=hb),St.init(e,t)}),CA=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=gb),St.init(e,t)}),PA=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=yb),St.init(e,t)}),OA=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bb),St.init(e,t)}),TA=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ab),St.init(e,t)}),RA=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Fb(t)),St.init(e,t)}),NA=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Lb),St.init(e,t)}),DA=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Mb(t)),St.init(e,t)}),$A=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=vb),St.init(e,t)}),jA=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=kb),St.init(e,t)}),yB=/^[0-9a-fA-F:.]+$/;LA=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Eb),St.init(e,t),e._zod.check=r=>{yu(r.value)||r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}),MA=D("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Cb(t.delimiter)),St.init(e,t)}),FA=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Pb),St.init(e,t)});zA=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ob),St.init(e,t),e._zod.check=r=>{gp(r.value)||r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});yp=/^[0-9a-zA-Z+/]*={0,2}$/,UA=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=yp),St.init(e,t),e._zod.check=r=>{bu(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Au=/^[A-Za-z0-9_-]*$/;VA=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Au),St.init(e,t),e._zod.check=r=>{bp(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),BA=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$b),St.init(e,t)}),bB=/[- ]/g;qA=D("$ZodCreditCard",(e,t)=>{t.pattern??(t.pattern=ep),St.init(e,t),e._zod.check=r=>{Ap(r.value)||r.issues.push({code:"invalid_format",format:"credit_card",input:r.value,inst:e,continue:!t.abort})}});ZA=D("$ZodIBAN",(e,t)=>{t.pattern??(t.pattern=tp),St.init(e,t),e._zod.check=r=>{xp(r.value)||r.issues.push({code:"invalid_format",format:"iban",input:r.value,inst:e,continue:!t.abort})}});HA=D("$ZodJWT",(e,t)=>{St.init(e,t),e._zod.check=r=>{Sp(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),GA=D("$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})}}),vp=D("$ZodNumber",(e,t)=>{He.init(e,t),e._zod.pattern=Ii,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}}),KA=D("$ZodNumberFormat",(e,t)=>{Yb.init(e,t),vp.init(e,t)}),xu=D("$ZodBoolean",(e,t)=>{He.init(e,t),e._zod.pattern=Bb,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}}),wp=D("$ZodBigInt",(e,t)=>{He.init(e,t),e._zod.pattern=Vb,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}}),WA=D("$ZodBigIntFormat",(e,t)=>{Xb.init(e,t),wp.init(e,t)}),JA=D("$ZodSymbol",(e,t)=>{He.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}}),QA=D("$ZodUndefined",(e,t)=>{He.init(e,t),e._zod.pattern=Zb,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}}),YA=D("$ZodNull",(e,t)=>{He.init(e,t),e._zod.pattern=qb,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}}),XA=D("$ZodAny",(e,t)=>{He.init(e,t),e._zod.parse=r=>r}),ex=D("$ZodUnknown",(e,t)=>{He.init(e,t),e._zod.parse=r=>r}),tx=D("$ZodNever",(e,t)=>{He.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),nx=D("$ZodVoid",(e,t)=>{He.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}}),rx=D("$ZodDate",(e,t)=>{He.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}});SB=e=>Array.isArray(e)?e.length:-1,vB=e=>e instanceof Map?e.size:-1,wB=e=>e instanceof Set?e.size:-1;ox=D("$ZodArray",(e,t)=>{He.init(e,t);let r=mn.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=>QP(p,i,u)));else if(QP(d,i,u),c&&d.issues.length!==0&&Ln(d))break}return s.length?Promise.all(s).then(()=>i):i},ix(e,SB)});_B=[];gO=D("$ZodObject",(e,t)=>{He.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=Qa(()=>fO(t));Xe(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)||vn(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=qo,s=t.catchall,c,u=mn.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(Ln(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=>dp(F,l,A,p,w,E))):dp(I,l,A,p,w,E)}return s?hO(h,p,l,d,o.value,e,m===!0):h.length?Promise.all(h).then(()=>l):l}}),ax=D("$ZodObjectJIT",(e,t)=>{gO.init(e,t);let r=e._zod.parse,i=Qa(()=>fO(t)),o=mn.memoizer,a=f=>{let m=i.value,g=m.symbolKeys,A=new Ko(["payload","ctx"],{shape:f,inst:e,memo:o,syms:g}),C=F=>`shape[${F}]._zod.run({ value: input[${F}], issues: [] }, ctx)`,w=(F,j)=>`
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 ? [${j}, ...iss.path] : [${j}];
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 j=E[F],U=typeof F=="symbol"?`syms[${g.indexOf(F)}]`:jn(F),Z=`${U} in input`,Q=f[F],M=Q?._zod?.optin,Y=M!==void 0,L=Q?._zod?.optout==="optional";if(A.write(`const ${j} = ${C(U)};`),Y&&L){let N=M==="optional"?`${j}_present`:`${j}.value !== undefined || ${j}_present`;A.write(`
18
+ const ${j}_present = ${Z};
19
+ if (!${j}.issues.length || ${j}_present) {
20
+ if (${j}.issues.length) {${w(j,U)}
21
+ }
22
+
23
+ if (${N}) {
24
+ newResult[${U}] = ${j}.value;
25
+ }
26
+ }
27
+
28
+ `)}else Y?(A.write(`
29
+ if (${j}.issues.length) {${w(j,U)}
30
+ }
31
+ `),M==="defaulted"?A.write(`newResult[${U}] = ${j}.value;`):A.write(`
32
+ if (${j}.value !== undefined || ${Z}) {
33
+ newResult[${U}] = ${j}.value;
34
+ }
35
+ `)):A.write(`
36
+ const ${j}_present = ${Z};
37
+ if (${j}.issues.length) {${w(j,U)}
38
+ }
39
+ if (!${j}_present && !${j}.issues.length) {
40
+ payload.issues.push({
41
+ code: "invalid_type",
42
+ expected: "nonoptional",
43
+ input: undefined,
44
+ path: [${U}]
45
+ });
46
+ if (ctx && ctx.abortEarly) {
47
+ payload.value = newResult;
48
+ return payload;
49
+ }
50
+ }
51
+
52
+ if (${j}_present) {
53
+ newResult[${U}] = ${j}.value;
54
+ }
55
+
56
+ `)}return A.write("payload.value = newResult;"),A.write("return payload;"),A.compile()},s,c=qo,u=!mn.jitless,d=u&&Qy.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?hO([],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)}});Su=D("$ZodUnion",(e,t)=>{He.init(e,t),Xe(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),Xe(e,"optout",i=>i.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Xe(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)))}),Xe(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=>_i(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=>YP(c,i,e,o)):YP(s,i,e,o)}});sx=D("$ZodXor",(e,t)=>{Su.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=>XP(c,i,e,o)):XP(s,i,e,o)}});ux=D("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Su.init(e,t);let r=e._zod.parse;Xe(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)||vn(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=Ya(o._zod.def);if(s&&!Object.prototype.hasOwnProperty.call(s,t.discriminator))throw new Error(`Invalid discriminated union option at index "${a}"`)});let i=Qa(()=>yO(t));e._zod.parse=(o,a)=>{let s=o.value;if(!qo(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)}}),lx=D("$ZodIntersection",(e,t)=>{He.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])=>eO(r,u,l)):eO(r,a,s)}});_p=D("$ZodTuple",(e,t)=>{He.init(e,t);let r=t.items,i=mn.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=tO(r,"optin"),l=tO(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=Ln(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(Ln(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=>nO(w,o,f))):nO(C,o,f)}}return c.length?Promise.all(c).then(()=>rO(d,o,r,s,l)):rO(d,o,r,s,l)}});dx=D("$ZodRecord",(e,t)=>{He.init(e,t);let r=mn.memoizer;r?.attach(e),e._zod.parse=(i,o)=>{let a=i.value;if(!Ir(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=>Yn(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(...Qn(d,m.issues)),i.value[h]=m.value})):(f.issues.length&&i.issues.push(...Qn(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"&&Ii.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=>Yn(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(...Qn(l,m.issues)),i.value[h]=m.value})):(f.issues.length&&i.issues.push(...Qn(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}}),px=D("$ZodMap",(e,t)=>{He.init(e,t);let r=mn.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(Ln(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])=>{iO(f,m,i,l,a,e,o)})):iO(p,h,i,l,a,e,o)}return s.length?Promise.all(s).then(()=>i):i},ix(e,vB)});mx=D("$ZodSet",(e,t)=>{He.init(e,t);let r=mn.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(Ln(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=>oO(p,i))):oO(d,i)}return s.length?Promise.all(s).then(()=>i):i},ix(e,wB)});fx=D("$ZodEnum",(e,t)=>{He.init(e,t);let r=Wa(t.entries),i=new Set(r);e._zod.values=i,Xe(e,"pattern",o=>{let a=Wa(o.def.entries).filter(s=>eu.has(typeof s));return new RegExp(a.length?`^(${a.map(s=>kr(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}}),hx=D("$ZodLiteral",(e,t)=>{He.init(e,t);let r=new Set(t.values);e._zod.values=r,Xe(e,"pattern",i=>{let o=i.def.values;return new RegExp(o.length?`^(${o.map(a=>typeof a=="string"?kr(a):a?kr(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}}),gx=D("$ZodFile",(e,t)=>{He.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}}),yx=D("$ZodTransform",(e,t)=>{He.init(e,t),e._zod.optin="optional",mn.memoizer?.guard(e),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Zi(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 Xn;return r.value=o,r}});Ip=D("$ZodOptional",(e,t)=>{He.init(e,t),Xe(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Xe(e,"values",r=>{let i=r.def.innerType._zod.values;return i?new Set([...i,void 0]):void 0}),Xe(e,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${_i(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=>aO(r,a)):aO(r,o)}return t.innerType._zod.run(r,i)}}),bx=D("$ZodExactOptional",(e,t)=>{Ip.init(e,t),Xe(e,"values",r=>r.def.innerType._zod.values),Xe(e,"pattern",r=>r.def.innerType._zod.pattern),e._zod.parse=(r,i)=>t.innerType._zod.run(r,i)}),Ax=D("$ZodNullable",(e,t)=>{He.init(e,t),Xe(e,"optin",r=>r.def.innerType._zod.optin),Xe(e,"optout",r=>r.def.innerType._zod.optout),Xe(e,"pattern",r=>{let i=r.def.innerType._zod.pattern;return i?new RegExp(`^(${_i(i.source)}|null)$`):void 0}),Xe(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)}),xx=D("$ZodDefault",(e,t)=>{He.init(e,t),e._zod.optin="defaulted",Xe(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=>sO(a,t)):sO(o,t)}});Sx=D("$ZodPrefault",(e,t)=>{He.init(e,t),e._zod.optin="defaulted",Xe(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))}),vx=D("$ZodNonOptional",(e,t)=>{He.init(e,t),Xe(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=>cO(a,e)):cO(o,e)}});wx=D("$ZodSuccess",(e,t)=>{He.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Zi("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)}});_x=D("$ZodCatch",(e,t)=>{He.init(e,t),Xe(e,"optin",r=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Xe(e,"optout",r=>r.def.innerType._zod.optout),Xe(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=>uO(r,a,t,i)):uO(r,o,t,i)}}),Ix=D("$ZodNaN",(e,t)=>{He.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)}),kp=D("$ZodPipe",(e,t)=>{He.init(e,t),Xe(e,"values",r=>r.def.in._zod.values),Xe(e,"optin",r=>r.def.in._zod.optin),Xe(e,"optout",r=>r.def.out._zod.optout),Xe(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=>cp(s,t.in,i)):cp(a,t.in,i)}let o=t.in._zod.run(r,i);return o instanceof Promise?o.then(a=>cp(a,t.out,i)):cp(o,t.out,i)}});vu=D("$ZodCodec",(e,t)=>{He.init(e,t),Xe(e,"values",r=>r.def.in._zod.values),Xe(e,"optin",r=>r.def.in._zod.optin),Xe(e,"optout",r=>r.def.out._zod.optout),Xe(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=>up(s,t,i)):up(a,t,i)}else{let a=t.out._zod.run(r,i);return a instanceof Promise?a.then(s=>up(s,t,i)):up(a,t,i)}}});kx=D("$ZodPreprocess",(e,t)=>{kp.init(e,t)}),Ex=D("$ZodReadonly",(e,t)=>{He.init(e,t),Xe(e,"propValues",r=>r.def.innerType._zod.propValues),Xe(e,"values",r=>r.def.innerType._zod.values),Xe(e,"optin",r=>r.def.innerType?._zod?.optin),Xe(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(lO):lO(o)}});Cx=D("$ZodTemplateLiteral",(e,t)=>{He.init(e,t);let r=[];for(let i of t.parts)if(typeof i=="object"&&i!==null){let o=bA(i);if(!o)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);r.push(_i(o))}else if(i===null||Yy.has(typeof i))r.push(kr(`${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)}),Px=D("$ZodFunction",(e,t)=>(He.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?qd(e._def.input,i):i,a=Reflect.apply(r,this,o);return e._def.output?qd(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 Zd(e._def.input,i):i,a=await Reflect.apply(r,this,o);return e._def.output?await Zd(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 _p({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)),Ox=D("$ZodPromise",(e,t)=>{He.init(e,t),e._zod.parse=(r,i)=>Promise.resolve(r.value).then(o=>t.innerType._zod.run({value:o,issues:[]},i))}),wu=D("$ZodLazy",(e,t)=>{He.init(e,t),Wy(e._zod,"innerType",()=>{let r=t;return r._cachedInner||(r._cachedInner=t.getter()),r._cachedInner}),Xe(e,"pattern",r=>r.innerType?._zod?.pattern),Xe(e,"propValues",r=>r.innerType?._zod?.propValues),Xe(e,"optin",r=>r.innerType?._zod?.optin??void 0),Xe(e,"optout",r=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,i)=>e._zod.innerType._zod.run(r,i)}),Tx=D("$ZodCustom",(e,t)=>{Et.init(e,t),He.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=>dO(a,r,i,e));dO(o,r,i,e)}})});function xO(e){return e!==null&&typeof e=="object"}function Rx(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}function Iu(e,t,r){let i=SO.get(e);if(i!==void 0)return i?_u:cs;if(t.has(e))return _u;t.add(e);let o=cs,a=d=>{if(o!==_u&&d?._zod){let p=Iu(d,t,r);p>o&&(o=p)}},s=(d,p)=>{let h=cs;for(let f of Reflect.ownKeys(d)){let m=Object.getOwnPropertyDescriptor(d,f);if(p&&!m.enumerable)continue;let g=m.get?Pp:m.value?._zod?Iu(m.value,t,r):cs;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=Ya(u);c(d?s(d,!0):Pp),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?Iu(d,t,!1):Pp);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),kB(e,o)}function kB(e,t){return t!==Pp&&SO.set(e,t===_u),t}function Tp(e){return Iu(e,new Set,!0)!==cs}function EB(e,t){let r=e.buckets.get(t);return r||(r=new WeakMap,e.buckets.set(t,r)),r}function ku(){return CB}function Rp(e,t){let r=e[Nx]?.backEdges;return r!==void 0&&xO(t)&&r.has(t)}var Op,Nx,AO,SO,cs,Pp,_u,Ep,Cp,CB,Dx=x(()=>{en();Op=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},Nx="~memo",AO=[];SO=new WeakMap,cs=0,Pp=1,_u=2;Cp=[],CB={alloc(e,t,r){let i=Ep;if(!i)return r;Ep=void 0;let o={value:r,issues:null};return i.set(t.value,o),Cp.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"&&Rp(a,o.value))throw new Op;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=Iu(e,new Set,!1);if(C===cs)return e._zod.parse=s,e._zod.run===c&&(e._zod.run=s),s(u,l);C===_u||i?r=!0:i=!0}let d=u.value;if(!xO(d))return s(u,l);let p=l[Nx];p||(p={buckets:new WeakMap,backEdges:void 0},l[Nx]=p);let h;o===l?h=a:(h=EB(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(...Rx(f.issues)):(u.memo=!0,p.backEdges??(p.backEdges=new WeakSet),p.backEdges.add(f.value)),u;Ep=h;let m=Cp.length,g=s(u,l);Ep=void 0;let A=Cp.length>m?Cp.pop():void 0;return g instanceof Promise?g.then(C=>(A&&(A.issues=C.issues.length?Rx(C.issues):AO),C)):(A&&(A.issues=g.issues.length?Rx(g.issues):AO),g)};e._zod.parse=c,e._zod.run===s&&(e._zod.run=c)})}}});function Np(){return{localeError:PB()}}var PB,$x=x(()=>{en();PB=()=>{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=tb(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 ${zd(a.values[0])}`:`Invalid option: expected one of ${Ld(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":""}: ${Ld(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 Eu={};ke(Eu,{en:()=>Np});var jx=x(()=>{$x()});function $p(){return new Dp}var vO,Lx,Mx,Dp,wn,Cu=x(()=>{Lx=Symbol("ZodOutput"),Mx=Symbol("ZodInput"),Dp=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)}};(vO=globalThis).__zod_globalRegistry??(vO.__zod_globalRegistry=$p());wn=globalThis.__zod_globalRegistry});function TB(e,t){try{return Lp(e,{assertOnly:!0})}catch{return t}}function Vx(e,t){try{let r=Lp(e),i=jp(e,r);return i._zod.bag.validator=TB(e,r),i}catch(r){if(t?.strict)throw r;return e}}function jp(e,t){if(Tp(e))throw new at("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?.[wO]||c&&Rp(c,s.value))return o(s,c);let u=t(s.value);return u!==Mn?(s.value=u,s):(c&&(c[wO]=!0),o(s,c))};return a.__originalRun=o,r._zod.bag.fallbackRun=o,r._zod.bag.validator=t,r._zod.run=a,i.__originalRun||RB(r,e,t),r}function RB(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!==Mn?{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!==Mn?u:a(s,c)}}}function Lp(e,t){let r=!0;try{r=Tp(e)}catch{}if(r)throw new at("a schema whose subtree contains a reference cycle");let i={constants:new Map,constantCounter:0,varCounter:0,definite:!0},o=new Ko(["input"]),a=Mt(o,i,e,"input",!t?.assertOnly);o.write(a===null?"return true;":`return ${a};`);let s=["INVALID",...i.constants.keys()],c=[Mn,...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 at(`this schema (generated code failed to evaluate: ${f.message})`)}return t?.debug&&(h.code=l),h.definite=i.definite,h}function qe(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 Qo(e,t){return e.definite=!1,qe(e,t)}function De(e){return`v${e.varCounter++}`}function NB(e,t){let r=e._zod.run({value:t,issues:[]},{});if(r&&typeof r.then=="function")return Mn;let i=r;return i.issues.length===0?i.value:Mn}function En(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 at)||!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,DB(e,t,r,i)}}function DB(e,t,r,i){t.definite=!1;let o=qe(t,r),a=qe(t,NB),s=De(t);return e.write(`const ${s} = ${a}(${o}, ${i});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function jB(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&&!$B.has(c.check))throw new at('check with a custom "when" condition');switch(c.check){case"greater_than":LB(e,t,c,a);break;case"less_than":MB(e,t,c,a);break;case"multiple_of":FB(e,t,c,a);break;case"number_format":PO(e,c,a);break;case"min_length":{let u=Hi(c.minimum,"min_length"),l=Fx(e,t,a,`${a}.length >= ${u} && ${a}.length < ${c.minimum*2}`);e.write(`if (${l} < ${u}) return INVALID;`);break}case"max_length":{let u=Hi(c.maximum,"max_length"),l=Fx(e,t,a,`${a}.length > ${u}`);e.write(`if (${l} > ${u}) return INVALID;`);break}case"length_equals":{let u=Hi(c.length,"length_equals"),l=Fx(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 < ${Hi(c.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${a}.size > ${Hi(c.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${a}.size !== ${Hi(c.size,"size_equals")}) return INVALID;`);break;case"string_format":a=OO(e,t,c,a);break;case"custom":a=ZB(e,t,s,a);break;case"bigint_format":zB(e,c,a);break;case"mime_type":UB(e,t,c,a);break;case"property":BB(e,t,c,a);break;case"properties":VB(e,t,c,a);break;case"overwrite":{let u=De(t);qB(e,t,s,a,u),a=u;break}default:throw new at(`check type ${c.check}`)}}return a}function Fx(e,t,r,i){let o=qe(t,Zo),a=De(t);return e.write(`const ${a} = typeof ${r} === "string" && ${i} ? ${o}(${r}) : ${r}.length;`),a}function Hi(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new at(`${t} bound of type ${typeof e}`);return`${e}`}function CO(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new at("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new at("comparison check with Invalid Date bound");return qe(e,t)}throw new at(`comparison check bound of type ${typeof t}`)}function LB(e,t,r,i){let o=r.inclusive?"<":"<=";e.write(`if (${i} ${o} ${CO(t,r.value)}) return INVALID;`)}function MB(e,t,r,i){let o=r.inclusive?">":">=";e.write(`if (${i} ${o} ${CO(t,r.value)}) return INVALID;`)}function FB(e,t,r,i){if(typeof r.value=="bigint"){if(r.value===BigInt(0))throw new at("multiple_of check with a zero divisor");e.write(`if (${i} % ${r.value}n !== 0n) return INVALID;`)}else{let o=qe(t,Yc);e.write(`if (${o}(${i}, ${Hi(r.value,"multiple_of")}) !== 0) return INVALID;`)}}function PO(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 at(`number format ${i}`)}}function zB(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 at(`bigint format ${i}`)}}function UB(e,t,r,i){let o=r.mime;if(o&&o.length>0){let a=qe(t,new Set(o));e.write(`if (!${a}.has(${i}.type)) return INVALID;`)}}function VB(e,t,r,i){if(r.when)throw new at('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"?qe(t,a):jn(a),c=De(t);e.write(`const ${c} = ${i}[${s}];`),En(e,t,o[a],c,!1)}}function BB(e,t,r,i){let o=`${i}[${JSON.stringify(r.property)}]`;Mt(e,t,r.schema,o)}function qB(e,t,r,i,o){let a=r._zod.def.tx;if(!a)throw new at("overwrite check without a transform function");if(Yo(a))throw new Vr("z.compile: async overwrite transforms are not supported");let s=qe(t,a);e.write(`const ${o} = ${s}(${i});`)}function zx(){throw new Xn}function Bx(e){this.issues.push(e)}function ZB(e,t,r,i){let o=r._zod.def;if(o.fn){if(Yo(o.fn))throw new Vr("z.compile: async .refine() predicates are not supported");let a=Qo(t,o.fn),s=qe(t,zx),c=De(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(Yo(r._zod.check))throw new Vr("z.compile: async .superRefine() / check functions are not supported");let a=r._zod.check,c=Qo(t,l=>{let d={value:l,issues:[],addIssue:Bx};return a(d)instanceof Promise&&zx(),d.issues.length===0?d.value:Mn}),u=De(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),u}throw new at("custom check without a predicate or check function")}function OO(e,t,r,i,o=!0){let a=r.format;if(a==="base64"){let l=qe(t,bu);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="base64url"){let l=qe(t,bp);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="jwt"){let l=qe(t,Sp),d=qe(t,r.alg??null);return e.write(`if (!${l}(${i}, ${d})) return INVALID;`),i}if(a==="ipv6"){let l=qe(t,yu);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="cidrv6"){let l=qe(t,gp);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="credit_card"){let l=qe(t,Ap);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(a==="iban"){let l=qe(t,xp);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=qe(t,mp),d=qe(t,r),p=De(t),h=De(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=qe(t,fp);e.write(`if (!${g}(${h}, ${d}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let g=qe(t,hp);e.write(`if (!${g}(${h}, ${d}.protocol)) return INVALID;`)}if(!o)return null;let f=De(t),m=s.normalize?`${h}.href`:`${qe(t,gu)}(${p})`;return e.write(`const ${f} = ${m};`),f}let c=r.fn;if(c){if(Yo(c))throw new at(`async string format ${a}`);let l=qe(t,c);return e.write(`if (!${l}(${i})) return INVALID;`),i}if(HB.has(a)&&r.pattern){let l=qe(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 at("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(${jn(r.includes)})) return INVALID;`);break;case"starts_with":{let l=r.prefix;e.write(`if (${i}.slice(0, ${l.length}) !== ${jn(l)}) return INVALID;`);break}case"ends_with":{let l=r.suffix;e.write(`if (${i}.slice(-${l.length}) !== ${jn(l)}) return INVALID;`);break}default:throw new at(`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 at(`coercion (z.coerce.${s}())`);let c=o||!!a.checks?.length,u;switch(s){case"string":u=GB(e,t,r,i,c);break;case"number":u=KB(e,r,i);break;case"boolean":u=WB(e,i);break;case"bigint":u=JB(e,r,i);break;case"symbol":u=QB(e,i);break;case"undefined":u=YB(e,i);break;case"null":u=XB(e,i);break;case"any":case"unknown":u=i;break;case"never":e.write("return INVALID;"),u=i;break;case"void":u=e5(e,i);break;case"nan":u=t5(e,i);break;case"date":u=n5(e,i);break;case"object":u=r5(e,t,r,i,c);break;case"optional":u=i5(e,t,r,i,c);break;case"nullable":u=s5(e,t,r,i,c);break;case"array":u=c5(e,t,r,i,c);break;case"literal":u=u5(e,t,r,i);break;case"enum":u=l5(e,t,r,i);break;case"readonly":{let l=IO(e,t,r,i),d=De(t);e.write(`const ${d} = Object.freeze(${l});`),u=d;break}case"success":IO(e,t,r,i),u="true";break;case"default":case"prefault":u=d5(e,t,r,i);break;case"nonoptional":u=p5(e,t,r,i);break;case"tuple":u=m5(e,t,r,i);break;case"union":u=f5(e,t,r,i);break;case"intersection":u=y5(e,t,r,i);break;case"record":u=b5(e,t,r,i);break;case"map":u=x5(e,t,r,i);break;case"set":u=S5(e,t,r,i);break;case"file":u=v5(e,i);break;case"template_literal":u=w5(e,t,r,i);break;case"lazy":u=_5(e,t,r,i);break;case"pipe":u=I5(e,t,r,i);break;case"custom":u=k5(e,t,r,i);break;case"transform":u=P5(e,t,r,i);break;case"catch":u=C5(e,t,r,i);break;default:throw new at(`schema type ${s}`)}return u===null?null:jB(e,t,r,u)}function GB(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:OO(e,t,a,i,o)}function KB(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&&PO(e,{format:i.format},r),r}function WB(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function JB(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 QB(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function YB(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function XB(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function e5(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function t5(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function n5(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function r5(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"?qe(t,w):jn(w),p=w=>typeof w=="symbol"?`[${d(w)}]`:jn(w),h=s;if(c.includes("__proto__"))throw new at('object shape key "__proto__"');let f=new Map;for(let w of l){let E=h[w],I=d(w),F=De(t);if(e.write(`const ${F} = ${i}[${I}];`),E._zod.optin!==void 0){let j=De(t);e.write(`let ${j} = (() => {`),e.indented(U=>{let Z=En(U,t,E,F);U.write(`return ${Z};`)}),e.write("})();"),E._zod.optout==="optional"?(e.write(`if (${j} === INVALID) {`),e.indented(U=>{U.write(`if (${I} in ${i}) return INVALID;`),U.write(`${j} = undefined;`)}),e.write("}")):e.write(`if (${j} === INVALID) return INVALID;`),f.set(w,j)}else{a5(E)&&e.write(`if (!(${I} in ${i})) return INVALID;`);let j=En(e,t,E,F,o);j!==null&&f.set(w,j)}}let m=a.catchall,g="none";if(m){let w=m._zod.def.type;if(w==="never"){let E=c.map(I=>`k !== ${jn(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=De(t),C=l.some(w=>_O(h[w])||Ux(h[w]));if(!o){if(g==="schema"){let w=c.length>0?qe(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=De(t);E.write(`const ${I} = ${i}[k];`),En(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);Ux(h[w])?e.write(`if (${E} in ${i}) ${A}[${E}] = ${I};`):_O(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?qe(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=De(t);E.write(`const ${I} = ${i}[k];`);let F=En(E,t,m,I);E.write(`${A}[k] = ${F};`)}}),e.write("}")}return A}function i5(e,t,r,i,o=!0){let a=r._zod.def;if(o5(r))return Mt(e,t,a.innerType,i,o);if(a.innerType._zod.optin==="defaulted"){let c=De(t),u=De(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?De(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 o5(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function a5(e){return e._zod.optin===void 0&&Jo(e)}function Jo(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?Jo(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?Jo(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(Jo):!0;case"intersection":return!t.left||!t.right?!0:Jo(t.left)&&Jo(t.right);case"pipe":return t.in?Jo(t.in):!0;default:return!0}}function Ux(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function _O(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&us(e)}function us(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?us(t.innerType):!0;case"union":return t.options?t.options.some(us):!0;case"intersection":return!t.left||!t.right||us(t.left)||us(t.right);case"pipe":return t.out?us(t.out):!0;default:return!0}}function s5(e,t,r,i,o=!0){let a=r._zod.def,s=o?De(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 qx(e,t,r){for(let[i,o]of Xa(t._zod.def.checks))e.write(`if (${r} > ${Hi(i,o._zod.def.check)}) return INVALID;`)}function c5(e,t,r,i,o=!0){let a=r._zod.def;e.write(`if (!Array.isArray(${i})) return INVALID;`),qx(e,r,`${i}.length`);let s=o?De(t):null,c=De(t),u=De(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=En(l,t,a.element,u,o);s&&d!==null&&l.write(`${s}[${c}] = ${d};`)}),e.write("}"),s}function u5(e,t,r,i){let a=r._zod.def.values;if(a.length!==1){let c=qe(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=qe(t,new Set(a));return e.write(`if (!${c}.has(${i})) return INVALID;`),i}if(typeof s=="string")e.write(`if (${i} !== ${jn(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 at(`literal type ${typeof s}`);return i}function l5(e,t,r,i){let o=r._zod.values;if(!o)throw new at("enum schema without enumerated values");let a=qe(t,o);return e.write(`if (!${a}.has(${i})) return INVALID;`),i}function IO(e,t,r,i){let o=r._zod.def;return Mt(e,t,o.innerType,i)}function d5(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=qe(t,s),l=De(t);return e.write(`let ${l} = ${i};`),e.write(`if (${i} === undefined) ${l} = ${u}();`),Mt(e,t,o.innerType,l)}let c=De(t);if(s){let u=qe(t,s),l=qe(t,Xc);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 p5(e,t,r,i){let o=r._zod.def,a=Mt(e,t,o.innerType,i),s=De(t);return e.write(`const ${s} = ${a};`),e.write(`if (${s} === undefined) return INVALID;`),s}function m5(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=kO(a,"optin"),u=kO(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=De(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=De(t);f.write(`const ${m} = ${i}[${d}];`);let g=En(f,t,p,m);f.write(`${l}[${d}] = ${g};`)}),h.write("} else {"),h.indented(f=>{if(Ux(p)){f.write(`${l}.length = ${d};`);return}let m=De(t),g=De(t);f.write(`const ${m} = undefined;`),f.write(`const ${g} = (() => {`),f.indented(A=>{let C=En(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=De(t);e.write(`const ${h} = ${i}[${d}];`);let f=En(e,t,p,h);e.write(`${l}[${d}] = ${f};`)}}if(s){let d=De(t),p=De(t);e.write(`for (let ${d} = ${a.length}; ${d} < ${i}.length; ${d}++) {`),e.indented(h=>{h.write(`const ${p} = ${i}[${d}];`);let f=En(h,t,s,p);h.write(`${l}[${d}] = ${f};`)}),e.write("}")}return l}function kO(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 f5(e,t,r,i){let o=r._zod.def,a=o.options;if(o.discriminator)return h5(e,t,o,i);if(o.inclusive===!1)throw new at("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=qe(t,u);return e.write(`if (!${l}.has(${i})) return INVALID;`),i}let c=De(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 h5(e,t,r,i){if(r.unionFallback)throw new at("discriminated union with unionFallback");if(r.options.length===0)return e.write("return INVALID;"),i;let o=De(t),a=De(t);e.write(`const ${o} = ${i}?.[${jn(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 at("discriminated union option without static discriminator values");for(let h of l){if(c.has(h))throw new at(`duplicate discriminator value ${String(h)}`);c.add(h)}let d=Array.from(l,h=>g5(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 g5(e,t,r){if(typeof r=="string")return`${t} === ${jn(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=qe(e,r);return`${t} === ${i}`}throw new at(`literal discriminator value ${String(r)}`)}function y5(e,t,r,i){let o=r._zod.def;t.definite=!1;let a=En(e,t,o.left,i),s=En(e,t,o.right,i),c=qe(t,as),u=De(t);return e.write(`const ${u} = ${c}(${a}, ${s});`),e.write(`if (!${u}.valid) return INVALID;`),`${u}.data`}function b5(e,t,r,i){let o=r._zod.def,a=qe(t,Ir);e.write(`if (!${a}(${i})) return INVALID;`);let s=De(t),c=De(t),u=De(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 at(`record key value ${String(g)}`);let A=typeof g=="number"?g.toString():g;if(A==="__proto__")throw new at('record key "__proto__"');f.push(A);let C=qe(t,g),w=Mt(e,t,o.keyType,C),E=De(t);e.write(`const ${E} = ${i}[${A5(t,A)}];`);let I=En(e,t,o.valueType,E);e.write(`${s}[${w}] = ${I};`)}let m=qe(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=Lp(o.keyType);m.definite===!1&&(t.definite=!1);let g=qe(t,m),A=qe(t,Ii),C=De(t);return EO(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=De(t);w.write(`const ${E} = ${i}[${c}];`);let I=En(w,t,o.valueType,E);w.write(`${s}[${C}] = ${I};`)}),s}return EO(e,t,i,c,f=>{f.write(`const ${u} = ${i}[${c}];`);let m=En(f,t,o.valueType,u);f.write(`${s}[${c}] = ${m};`)},"return INVALID;"),s}function EO(e,t,r,i,o,a){let s=qe(t,Object.prototype.propertyIsEnumerable),c=De(t),u=De(t),l=De(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 A5(e,t){return typeof t=="string"?jn(t):qe(e,t)}function x5(e,t,r,i){let o=r._zod.def;e.write(`if (!(${i} instanceof Map)) return INVALID;`),qx(e,r,`${i}.size`);let a=De(t),s=De(t),c=De(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 S5(e,t,r,i){let o=r._zod.def;e.write(`if (!(${i} instanceof Set)) return INVALID;`),qx(e,r,`${i}.size`);let a=De(t),s=De(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 v5(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function w5(e,t,r,i){e.write(`if (typeof ${i} !== "string") return INVALID;`);let o=r._zod.pattern;if(o){let a=qe(t,o);e.write(`${a}.lastIndex = 0;`),e.write(`if (!${a}.test(${i})) return INVALID;`)}return i}function _5(e,t,r,i){let o=r._zod.def,a=Qo(t,o.getter),s=qe(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=De(t);return e.write(`const ${c} = ${s}.parser(${i});`),e.write(`if (${c} === INVALID) return INVALID;`),c}function I5(e,t,r,i){let o=r._zod.def,a=Mt(e,t,o.in,i);if(o.transform){if(Yo(o.transform))throw new Vr("z.compile: async transforms in pipes are not supported");let s=o.transform,u=Qo(t,d=>{let p={value:d,issues:[],addIssue:Bx},h=s(d,p);return h instanceof Promise?Mn:p.issues.length===0?h:Mn}),l=De(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 Yo(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function k5(e,t,r,i){let o=r._zod.def;if(o.fn){if(Yo(o.fn))throw new Vr("z.compile: async custom predicates are not supported");let a=Qo(t,o.fn),s=qe(t,zx),c=De(t);e.write(`const ${c} = ${a}(${i});`),e.write(`if (${c} instanceof Promise) ${s}();`),e.write(`if (!${c}) return INVALID;`)}else throw new at("custom schema without a predicate function");return i}function E5(e,t,r){let i=e._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return Mn;let o=i;return o.issues.length===0?o.value:t()}function C5(e,t,r,i){let o=r._zod.def;if(!o.catchValue[Vd])throw new at("catch with a callback (only a constant catch value compiles)",!1);let a=De(t);e.write(`let ${a} = (() => {`),e.indented(l=>{let d=En(l,t,o.innerType,i);l.write(`return ${d};`)}),e.write("})();");let s=qe(t,o.innerType),c=Qo(t,o.catchValue),u=qe(t,E5);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 P5(e,t,r,i){let o=r._zod.def;if(o.transform){if(Yo(o.transform))throw new Vr("z.compile: async transforms are not supported");let a=o.transform,c=Qo(t,l=>{let d={value:l,issues:[],addIssue:Bx},p=a(l,d);return p instanceof Promise?Mn:d.issues.length===0?p:Mn}),u=De(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),u}return i}var Mn,wO,Vr,at,$B,HB,TO=x(()=>{qi();sp();Dx();Go();ss();en();Mn=Symbol.for("zod.compile.invalid"),wO=Symbol.for("zod.compile.fallback"),Vr=class extends Error{constructor(t="z.compile does not support async refinements, transforms, or checks"){super(t),this.name="ZodCompileAsyncError"}},at=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}};$B=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);HB=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 Mp(e){return e.checks&&(e.checks=[...e.checks]),e}function Zx(e,t){return new e(Mp({type:"string",...ue(t)}))}function Hx(e,t){return new e(Mp({type:"string",coerce:!0,...ue(t)}))}function Fp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ue(t)})}function zp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ue(t)})}function Up(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ue(t)})}function Vp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ue(t)})}function Bp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ue(t)})}function qp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ue(t)})}function Pu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ue(t)})}function Zp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ue(t)})}function Hp(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ue(t)})}function Gp(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ue(t)})}function Kp(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ue(t)})}function Wp(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ue(t)})}function Jp(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ue(t)})}function Qp(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ue(t)})}function Yp(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ue(t)})}function Xp(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ue(t)})}function Gx(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ue(t)})}function em(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ue(t)})}function tm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ue(t)})}function nm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ue(t)})}function rm(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ue(t)})}function im(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ue(t)})}function Kx(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...ue(t)})}function Wx(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...ue(t)})}function om(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ue(t)})}function Ou(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ue(t)})}function Tu(e,t){return new e({type:"string",format:"date",check:"string_format",...ue(t)})}function Ru(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ue(t)})}function Nu(e,t){return new e({type:"string",format:"duration",check:"string_format",...ue(t)})}function Qx(e,t){return new e(Mp({type:"number",checks:[],...ue(t)}))}function Yx(e,t){return new e(Mp({type:"number",coerce:!0,checks:[],...ue(t)}))}function Xx(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ue(t)})}function eS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ue(t)})}function tS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ue(t)})}function nS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ue(t)})}function rS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ue(t)})}function iS(e,t){return new e({type:"boolean",...ue(t)})}function oS(e,t){return new e({type:"boolean",coerce:!0,...ue(t)})}function aS(e,t){return new e({type:"bigint",...ue(t)})}function sS(e,t){return new e({type:"bigint",coerce:!0,...ue(t)})}function cS(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ue(t)})}function uS(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ue(t)})}function lS(e,t){return new e({type:"symbol",...ue(t)})}function dS(e,t){return new e({type:"undefined",...ue(t)})}function pS(e,t){return new e({type:"null",...ue(t)})}function mS(e){return new e({type:"any"})}function fS(e){return new e({type:"unknown"})}function hS(e,t){return new e({type:"never",...ue(t)})}function gS(e,t){return new e({type:"void",...ue(t)})}function yS(e,t){return new e({type:"date",...ue(t)})}function bS(e,t){return new e({type:"date",coerce:!0,...ue(t)})}function AS(e,t){return new e({type:"nan",...ue(t)})}function ci(e,t){return new ip({check:"less_than",...ue(t),value:e,inclusive:!1})}function ur(e,t){return new ip({check:"less_than",...ue(t),value:e,inclusive:!0})}function ui(e,t){return new op({check:"greater_than",...ue(t),value:e,inclusive:!1})}function lr(e,t){return new op({check:"greater_than",...ue(t),value:e,inclusive:!0})}function am(e){return ui(0,e)}function sm(e){return ci(0,e)}function cm(e){return ur(0,e)}function um(e){return lr(0,e)}function Gi(e,t){return new Qb({check:"multiple_of",...ue(t),value:e})}function Ki(e,t){return new eA({check:"max_size",...ue(t),maximum:e})}function li(e,t){return new tA({check:"min_size",...ue(t),minimum:e})}function Xo(e,t){return new nA({check:"size_equals",...ue(t),size:e})}function ea(e,t){return new rA({check:"max_length",...ue(t),maximum:e})}function ki(e,t){return new iA({check:"min_length",...ue(t),minimum:e})}function ta(e,t){return new oA({check:"length_equals",...ue(t),length:e})}function ls(e,t){return new aA({check:"string_format",format:"regex",...ue(t),pattern:e})}function ds(e){return new sA({check:"string_format",format:"lowercase",...ue(e)})}function ps(e){return new cA({check:"string_format",format:"uppercase",...ue(e)})}function ms(e,t){return new uA({check:"string_format",format:"includes",...ue(t),includes:e})}function fs(e,t){return new lA({check:"string_format",format:"starts_with",...ue(t),prefix:e})}function hs(e,t){return new dA({check:"string_format",format:"ends_with",...ue(t),suffix:e})}function lm(e,t,r){return new pA({check:"property",property:e,schema:t,...ue(r)})}function gs(e,t){return new mA({check:"properties",shape:e,...ue(t)})}function ys(e,t){return new fA({check:"mime_type",mime:e,...ue(t)})}function Br(e){return new hA({check:"overwrite",tx:e})}function bs(e){return Br(t=>t.normalize(e))}function As(){return Br(e=>e.trim())}function xs(){return Br(e=>e.toLowerCase())}function Ss(){return Br(e=>e.toUpperCase())}function vs(){return Br(e=>Jy(e))}function xS(e,t,r){return new e({type:"array",element:t,...ue(r)})}function O5(e,t,r){return new e({type:"union",options:t,...ue(r)})}function T5(e,t,r){return new e({type:"union",options:t,inclusive:!1,...ue(r)})}function R5(e,t,r,i){return new e({type:"union",options:r,discriminator:t,...ue(i)})}function N5(e,t,r){return new e({type:"intersection",left:t,right:r})}function D5(e,t,r,i){let o=r instanceof He,a=o?i:r,s=o?r:null;return new e({type:"tuple",items:t,rest:s,...ue(a)})}function $5(e,t,r,i){return new e({type:"record",keyType:t,valueType:r,...ue(i)})}function j5(e,t,r,i){return new e({type:"map",keyType:t,valueType:r,...ue(i)})}function L5(e,t,r){return new e({type:"set",valueType:t,...ue(r)})}function M5(e,t,r){let i=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:i,...ue(r)})}function F5(e,t,r){return new e({type:"enum",entries:t,...ue(r)})}function z5(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ue(r)})}function SS(e,t){return new e({type:"file",...ue(t)})}function U5(e,t){return new e({type:"transform",transform:t})}function V5(e,t){return new e({type:"optional",innerType:t})}function B5(e,t){return new e({type:"nullable",innerType:t})}function q5(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Xc(r)}})}function Z5(e,t,r){return new e({type:"nonoptional",innerType:t,...ue(r)})}function H5(e,t){return new e({type:"success",innerType:t})}function G5(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:rb(r)})}function K5(e,t,r){return new e({type:"pipe",in:t,out:r})}function W5(e,t){return new e({type:"readonly",innerType:t})}function J5(e,t,r){return new e({type:"template_literal",parts:t,...ue(r)})}function Q5(e,t){return new e({type:"lazy",getter:t})}function Y5(e,t){return new e({type:"promise",innerType:t})}function vS(e,t,r){let i=ue(r);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:t,...i})}function wS(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ue(r)})}function _S(e,t){let r=RO(i=>(i.addIssue=o=>{if(typeof o=="string")i.issues.push(es(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(es(a))}},e(i.value,i)),t);return r}function RO(e,t){let r=new Et({check:"custom",...ue(t)});return r._zod.check=e,r}function IS(e){let t=new Et({check:"describe"});return t._zod.onattach=[r=>{let i=wn.get(r)??{};wn.add(r,{...i,description:e})}],t._zod.check=()=>{},t}function kS(e){let t=new Et({check:"meta"});return t._zod.onattach=[r=>{let i=wn.get(r)??{};wn.add(r,{...i,...e})}],t._zod.check=()=>{},t}function ES(e,t){let r=ue(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??vu,u=e.Boolean??xu,l=e.String??Wo,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 na(e,t,r,i={}){let o=ue(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 Jx,NO=x(()=>{ap();Cu();ss();en();Jx={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Du(e,...t){for(let r of t)for(let i of Reflect.ownKeys(r))Object.prototype.propertyIsEnumerable.call(r,i)&&vn(e,i,r[i]);return e}function Wi(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??wn,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 an(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&&Du(s.schema,u),t.io==="input"&&Fn(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 DO(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Ji(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}/${DO(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+DO(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 LO(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;LO(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 jO(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function CS(e){let t=[];for(let a of e){if(typeof a!="object"||a.type!=="object")return null;for(let s in a)if(!MO.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]??jO(l);d!=null&&(c.some(p=>JSON.stringify(p)===JSON.stringify(d))||c.push(d))}let u=c.length===1?c[0]:CS(c)??{allOf:c};vn(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=jO(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 X5(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of MO)if(o in e)return;let r=t.filter(o=>$O.some(a=>Array.isArray(o[a]))),i=null;if(!r.length)i=CS(t);else{let o=r[0],a=$O.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=>CS([...s,u]));if(c.some(u=>!u))return;i={[a]:c}}i&&(delete e.allOf,Du(e,i))}function Qi(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)):Du(l,m),Du(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())LO(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)??[])X5(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)}Du(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,vn(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:ws(t,"input",e.processors),output:ws(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function Fn(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 Fn(i.element,r);if(i.type==="set")return Fn(i.valueType,r);if(i.type==="lazy")return Fn(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 Fn(i.innerType,r);if(i.type==="intersection")return Fn(i.left,r)||Fn(i.right,r);if(i.type==="record"||i.type==="map")return Fn(i.keyType,r)||Fn(i.valueType,r);if(i.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Fn(i.in,r)||Fn(i.out,r);if(i.type==="object"){for(let o in i.shape)if(Fn(i.shape[o],r))return!0;return!1}if(i.type==="union"){for(let o of i.options)if(Fn(o,r))return!0;return!1}if(i.type==="tuple"){for(let o of i.items)if(Fn(o,r))return!0;return!!(i.rest&&Fn(i.rest,r))}return!1}var MO,$O,PS,ws,$u=x(()=>{Cu();en();MO=new Set(["type","properties","required","additionalProperties"]),$O=["oneOf","anyOf"];PS=(e,t={})=>r=>{let i=Wi({...r,processors:t});return vt(e,i),Ji(i,e),Qi(i,e)},ws=(e,t,r={})=>i=>{let{libraryOptions:o,target:a}=i??{},s=Wi({...o??{},target:a,io:t,processors:r});return vt(e,s),Ji(s,e),Qi(s,e)}});function sn(e){let t={},r=e._zod.def,i=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let a of i)e3[a._zod.def.check]?.(t,a._zod.def);let o=e._zod.bag;o.minimum!==void 0&&_s(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&_s(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Is(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Is(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&BO(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&ZO(t,o.mime);for(let a of o.patterns??[])qO(t,a);return t}function ju(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?ju(t.out):t.type==="catch"?ju(t.innerType):e._zod.optin}function OS(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=OS(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=>OS(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")?Ii:pu).source)),f}function r3(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 TS.get(e)??[]){let o=e.seen.get(i),a=(o?.def??o?.schema)?.propertyNames;if(!a||a===!0||r.has(a))continue;let s=OS(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 KO(e,t,r,i,o){let a=!1,s=JSON.stringify(e,(c,u)=>typeof u!="bigint"?u:(a=!0,null));return a?(an(t,r,i,o,"BigInt defaults cannot be represented in JSON Schema"),cv):JSON.parse(s)}function fm(e,t){if("_idmap"in e){let i=e,o=Wi({...t,processors:dm}),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;Ji(o,d),vn(s,l,Qi(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=Wi({...t,processors:dm});return vt(e,r),Ji(r,e),Qi(r,e)}var _s,Is,FO,BO,qO,ZO,HO,zO,UO,VO,e3,t3,n3,GO,RS,NS,DS,$S,jS,LS,MS,FS,zS,US,VS,BS,qS,ZS,HS,GS,KS,WS,JS,QS,YS,XS,ev,tv,nv,pm,rv,iv,TS,ov,av,sv,cv,uv,lv,dv,pv,mv,fv,mm,hv,dm,Lu=x(()=>{Go();ss();$u();en();_s=(e,t,r)=>{(e[t]===void 0||r>e[t])&&(e[t]=r)},Is=(e,t,r)=>{(e[t]===void 0||r<e[t])&&(e[t]=r)},FO=(e,t)=>{_s(e,"minimum",t),Is(e,"maximum",t)},BO=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},qO=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},ZO=(e,t)=>{e.mime=e.mime?e.mime.filter(r=>t.includes(r)):[...t]},HO=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},zO=(e,t)=>_s(e,"minimum",t.minimum),UO=(e,t)=>Is(e,"maximum",t.maximum),VO=e=>(t,r)=>{HO(t,r.format);let[i,o]=e[r.format];_s(t,"minimum",i),Is(t,"maximum",o)},e3={greater_than:(e,t)=>_s(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Is(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>BO(e,t.value),number_format:VO(tu),bigint_format:VO(nu),min_length:zO,max_length:UO,length_equals:(e,t)=>FO(e,t.length),min_size:zO,max_size:UO,size_equals:(e,t)=>FO(e,t.size),string_format:(e,t)=>{HO(e,t.format),t.pattern&&qO(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)=>ZO(e,t.mime)};t3={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},n3=new Map([[yp,Tb],[Au,Rb]]),GO=e=>n3.get(e)??e,RS=(e,t,r,i)=>{let o=r;o.type="string";let{minimum:a,maximum:s,format:c,patterns:u,contentEncoding:l,laxFormat:d}=sn(e);if(typeof a=="number"&&(o.minLength=a),typeof s=="number"&&(o.maxLength=s),c&&(o.format=t3[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(GO);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}))])}},NS=(e,t,r,i)=>{let o=r,{minimum:a,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l,isInt:d}=sn(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)):an(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}))])}},DS=(e,t,r,i)=>{r.type="boolean"},$S=(e,t,r,i)=>{an(e,t,r,i,"BigInt cannot be represented in JSON Schema")},jS=(e,t,r,i)=>{an(e,t,r,i,"Symbols cannot be represented in JSON Schema")},LS=(e,t,r,i)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},MS=(e,t,r,i)=>{an(e,t,r,i,"Undefined cannot be represented in JSON Schema")},FS=(e,t,r,i)=>{an(e,t,r,i,"Void cannot be represented in JSON Schema")},zS=(e,t,r,i)=>{r.not={}},US=(e,t,r,i)=>{},VS=(e,t,r,i)=>{},BS=(e,t,r,i)=>{an(e,t,r,i,"Date cannot be represented in JSON Schema")},qS=(e,t,r,i)=>{let o=e._zod.def,a=Wa(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},ZS=(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(an(e,t,r,i,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(an(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},HS=(e,t,r,i)=>{an(e,t,r,i,"NaN cannot be represented in JSON Schema")},GS=(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},KS=(e,t,r,i)=>{let o=r;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:a,maximum:s,mime:c}=sn(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})))},WS=(e,t,r,i)=>{r.type="boolean"},JS=(e,t,r,i)=>{an(e,t,r,i,"Custom types cannot be represented in JSON Schema")},QS=(e,t,r,i)=>{an(e,t,r,i,"Function types cannot be represented in JSON Schema")},YS=(e,t,r,i)=>{an(e,t,r,i,"Transforms cannot be represented in JSON Schema")},XS=(e,t,r,i)=>{an(e,t,r,i,"Map cannot be represented in JSON Schema")},ev=(e,t,r,i)=>{an(e,t,r,i,"Set cannot be represented in JSON Schema")},tv=(e,t,r,i)=>{let o=r,a=e._zod.def,{minimum:s,maximum:c}=sn(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"]})};nv=(e,t,r,i)=>{let o=r,a=e._zod.def,s=a.shape;if(Object.getOwnPropertySymbols(s).length&&an(e,t,o,i,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let l in s)vn(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"?ju(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)},pm=(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},rv=(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)},iv=(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"?ju(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}=sn(e);typeof f=="number"&&(o.minItems=f),typeof m=="number"&&(o.maxItems=m)};TS=new WeakMap;ov=(e,t,r,i)=>{let o=r,a=e._zod.def;o.type="object";let s=a.keyType,c=sn(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)vn(o.patternProperties,GO(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=TS.get(t);d||(d=[],TS.set(t,d),t.deferred.push(()=>r3(t))),d.push(e)}o.additionalProperties=vt(a.valueType,t,{...i,path:[...i.path,"additionalProperties"]})}let u=s._zod.values,l=t.io==="input"&&ju(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))}},av=(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"}]},sv=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType},cv=Symbol();uv=(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=KO(o.defaultValue,e,t,r,i);s!==cv&&(r.default=s)},lv=(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=KO(o.defaultValue,e,t,r,i);s!==cv&&(r._prefault=s)},dv=(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{an(e,t,r,i,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},pv=(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},mv=(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},fv=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType},mm=(e,t,r,i)=>{let o=e._zod.def;vt(o.innerType,t,i);let a=t.seen.get(e);a.ref=o.innerType},hv=(e,t,r,i)=>{let o=e._zod.innerType;vt(o,t,i);let a=t.seen.get(e);a.ref=o},dm={string:RS,number:NS,boolean:DS,bigint:$S,symbol:jS,null:LS,undefined:MS,void:FS,never:zS,any:US,unknown:VS,date:BS,enum:qS,literal:ZS,nan:HS,template_literal:GS,file:KS,success:WS,custom:JS,function:QS,transform:YS,map:XS,set:ev,array:tv,object:nv,union:pm,intersection:rv,tuple:iv,record:ov,nullable:av,nonoptional:sv,default:uv,prefault:lv,catch:dv,pipe:pv,readonly:mv,promise:fv,optional:mm,lazy:hv}});var hm,WO=x(()=>{Lu();$u();hm=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=Wi({processors:dm,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,Ji(this.ctx,t);let i=Qi(this.ctx,t),{"~standard":o,...a}=i;return a}}});var JO={};var QO=x(()=>{});var Ei={};ke(Ei,{$ZodAny:()=>XA,$ZodArray:()=>ox,$ZodAsyncError:()=>Xn,$ZodBase64:()=>UA,$ZodBase64URL:()=>VA,$ZodBigInt:()=>wp,$ZodBigIntFormat:()=>WA,$ZodBoolean:()=>xu,$ZodCIDRv4:()=>FA,$ZodCIDRv6:()=>zA,$ZodCUID:()=>EA,$ZodCUID2:()=>CA,$ZodCatch:()=>_x,$ZodCheck:()=>Et,$ZodCheckBigIntFormat:()=>Xb,$ZodCheckEndsWith:()=>dA,$ZodCheckGreaterThan:()=>op,$ZodCheckIncludes:()=>uA,$ZodCheckLengthEquals:()=>oA,$ZodCheckLessThan:()=>ip,$ZodCheckLowerCase:()=>sA,$ZodCheckMaxLength:()=>rA,$ZodCheckMaxSize:()=>eA,$ZodCheckMimeType:()=>fA,$ZodCheckMinLength:()=>iA,$ZodCheckMinSize:()=>tA,$ZodCheckMultipleOf:()=>Qb,$ZodCheckNumberFormat:()=>Yb,$ZodCheckOverwrite:()=>hA,$ZodCheckProperties:()=>mA,$ZodCheckProperty:()=>pA,$ZodCheckRegex:()=>aA,$ZodCheckSizeEquals:()=>nA,$ZodCheckStartsWith:()=>lA,$ZodCheckStringFormat:()=>os,$ZodCheckUpperCase:()=>cA,$ZodCodec:()=>vu,$ZodCreditCard:()=>qA,$ZodCustom:()=>Tx,$ZodCustomStringFormat:()=>GA,$ZodCyclicError:()=>Op,$ZodDate:()=>rx,$ZodDefault:()=>xx,$ZodDiscriminatedUnion:()=>ux,$ZodE164:()=>BA,$ZodEmail:()=>SA,$ZodEmoji:()=>IA,$ZodEncodeError:()=>Zi,$ZodEnum:()=>fx,$ZodError:()=>ub,$ZodExactOptional:()=>bx,$ZodFile:()=>gx,$ZodFunction:()=>Px,$ZodGUID:()=>AA,$ZodIBAN:()=>ZA,$ZodIPv4:()=>jA,$ZodIPv6:()=>LA,$ZodISODate:()=>NA,$ZodISODateTime:()=>RA,$ZodISODuration:()=>$A,$ZodISOTime:()=>DA,$ZodIntersection:()=>lx,$ZodJWT:()=>HA,$ZodKSUID:()=>TA,$ZodLazy:()=>wu,$ZodLiteral:()=>hx,$ZodMAC:()=>MA,$ZodMap:()=>px,$ZodNaN:()=>Ix,$ZodNanoID:()=>kA,$ZodNever:()=>tx,$ZodNonOptional:()=>vx,$ZodNull:()=>YA,$ZodNullable:()=>Ax,$ZodNumber:()=>vp,$ZodNumberFormat:()=>KA,$ZodObject:()=>gO,$ZodObjectJIT:()=>ax,$ZodOptional:()=>Ip,$ZodPipe:()=>kp,$ZodPrefault:()=>Sx,$ZodPreprocess:()=>kx,$ZodPromise:()=>Ox,$ZodReadonly:()=>Ex,$ZodRealError:()=>er,$ZodRecord:()=>dx,$ZodRegistry:()=>Dp,$ZodSet:()=>mx,$ZodString:()=>Wo,$ZodStringFormat:()=>St,$ZodSuccess:()=>wx,$ZodSymbol:()=>JA,$ZodTemplateLiteral:()=>Cx,$ZodTransform:()=>yx,$ZodTuple:()=>_p,$ZodType:()=>He,$ZodULID:()=>PA,$ZodURL:()=>_A,$ZodUUID:()=>xA,$ZodUndefined:()=>QA,$ZodUnion:()=>Su,$ZodUnknown:()=>ex,$ZodVoid:()=>nx,$ZodXID:()=>OA,$ZodXor:()=>sx,$brand:()=>ab,$constructor:()=>D,$input:()=>Mx,$output:()=>Lx,Doc:()=>Ko,INVALID:()=>Mn,JSONSchema:()=>JO,JSONSchemaGenerator:()=>hm,NEVER:()=>ob,TimePrecision:()=>Jx,URL_BAD_FORMAT:()=>vA,URL_UNPARSEABLE:()=>hu,ZodCompileAsyncError:()=>Vr,ZodCompileUnsupportedError:()=>at,_any:()=>mS,_array:()=>xS,_base64:()=>nm,_base64url:()=>rm,_bigint:()=>aS,_boolean:()=>iS,_catch:()=>G5,_check:()=>RO,_cidrv4:()=>em,_cidrv6:()=>tm,_coercedBigint:()=>sS,_coercedBoolean:()=>oS,_coercedDate:()=>bS,_coercedNumber:()=>Yx,_coercedString:()=>Hx,_creditCard:()=>Kx,_cuid:()=>Gp,_cuid2:()=>Kp,_custom:()=>vS,_date:()=>yS,_decode:()=>Gd,_decodeAsync:()=>Wd,_default:()=>q5,_discriminatedUnion:()=>R5,_e164:()=>im,_email:()=>Fp,_emoji:()=>Zp,_encode:()=>Hd,_encodeAsync:()=>Kd,_endsWith:()=>hs,_enum:()=>M5,_file:()=>SS,_float32:()=>eS,_float64:()=>tS,_gt:()=>ui,_gte:()=>lr,_guid:()=>zp,_iban:()=>Wx,_includes:()=>ms,_int:()=>Xx,_int32:()=>nS,_int64:()=>cS,_intersection:()=>N5,_ipv4:()=>Yp,_ipv6:()=>Xp,_isoDate:()=>Tu,_isoDateTime:()=>Ou,_isoDuration:()=>Nu,_isoTime:()=>Ru,_jwt:()=>om,_ksuid:()=>Qp,_lazy:()=>Q5,_length:()=>ta,_literal:()=>z5,_lowercase:()=>ds,_lt:()=>ci,_lte:()=>ur,_mac:()=>Gx,_map:()=>j5,_max:()=>ur,_maxLength:()=>ea,_maxSize:()=>Ki,_mime:()=>ys,_min:()=>lr,_minLength:()=>ki,_minSize:()=>li,_multipleOf:()=>Gi,_nan:()=>AS,_nanoid:()=>Hp,_nativeEnum:()=>F5,_negative:()=>sm,_never:()=>hS,_nonnegative:()=>um,_nonoptional:()=>Z5,_nonpositive:()=>cm,_normalize:()=>bs,_null:()=>pS,_nullable:()=>B5,_number:()=>Qx,_optional:()=>V5,_overwrite:()=>Br,_parse:()=>ts,_parseAsync:()=>ns,_pipe:()=>K5,_positive:()=>am,_promise:()=>Y5,_properties:()=>gs,_property:()=>lm,_readonly:()=>W5,_record:()=>$5,_refine:()=>wS,_regex:()=>ls,_safeDecode:()=>Qd,_safeDecodeAsync:()=>Xd,_safeEncode:()=>Jd,_safeEncodeAsync:()=>Yd,_safeParse:()=>rs,_safeParseAsync:()=>is,_set:()=>L5,_size:()=>Xo,_slugify:()=>vs,_startsWith:()=>fs,_string:()=>Zx,_stringFormat:()=>na,_stringbool:()=>ES,_success:()=>H5,_superRefine:()=>_S,_symbol:()=>lS,_templateLiteral:()=>J5,_toLowerCase:()=>xs,_toUpperCase:()=>Ss,_transform:()=>U5,_trim:()=>As,_tuple:()=>D5,_uint32:()=>rS,_uint64:()=>uS,_ulid:()=>Wp,_undefined:()=>dS,_union:()=>O5,_unknown:()=>fS,_uppercase:()=>ps,_url:()=>Pu,_uuid:()=>Up,_uuidv4:()=>Vp,_uuidv6:()=>Bp,_uuidv7:()=>qp,_void:()=>gS,_xid:()=>Jp,_xor:()=>T5,base64Charset:()=>yp,base64urlCharset:()=>Au,canParseURL:()=>wA,clone:()=>xt,compile:()=>Vx,compileFn:()=>Lp,config:()=>Bt,createStandardJSONSchemaMethod:()=>ws,createToJSONSchemaMethod:()=>PS,decode:()=>L4,decodeAsync:()=>F4,describe:()=>IS,encode:()=>j4,encodeAsync:()=>M4,extractDefs:()=>Ji,finalize:()=>Qi,flattenError:()=>su,formatError:()=>cu,getDiscriminatedOption:()=>cx,globalConfig:()=>mn,globalRegistry:()=>wn,handleUnrepresentable:()=>an,initializeContext:()=>Wi,isBackEdge:()=>Rp,isRecursiveSchema:()=>Tp,isValidBase64:()=>bu,isValidBase64URL:()=>bp,isValidCIDRv6:()=>gp,isValidCreditCard:()=>Ap,isValidIBAN:()=>xp,isValidIPv6:()=>yu,isValidJWT:()=>Sp,locales:()=>Eu,memoizer:()=>ku,mergeValues:()=>as,meta:()=>kS,parse:()=>qd,parseAsync:()=>Zd,parseURLObject:()=>mO,prettifyError:()=>db,process:()=>vt,processSchema:()=>vt,regexes:()=>Er,registry:()=>$p,safeDecode:()=>U4,safeDecodeAsync:()=>B4,safeEncode:()=>z4,safeEncodeAsync:()=>V4,safeParse:()=>T4,safeParseAsync:()=>R4,standardProps:()=>pp,stripTabAndNewline:()=>gu,toDotPath:()=>HP,toJSONSchema:()=>fm,toZod:()=>Qc,treeifyError:()=>lb,urlHostnameOk:()=>fp,urlProtocolOk:()=>hp,util:()=>Ee,validate:()=>uu,validateAsync:()=>lu,validateURL:()=>mp,version:()=>gA,withParser:()=>jp});var dr=x(()=>{qi();mb();pb();ss();Dx();ap();yA();en();en();Go();jx();Cu();sp();TO();NO();$u();Lu();WO();QO()});var gm={};ke(gm,{endsWith:()=>hs,gt:()=>ui,gte:()=>lr,includes:()=>ms,length:()=>ta,lowercase:()=>ds,lt:()=>ci,lte:()=>ur,maxLength:()=>ea,maxSize:()=>Ki,mime:()=>ys,minLength:()=>ki,minSize:()=>li,multipleOf:()=>Gi,negative:()=>sm,nonnegative:()=>um,nonpositive:()=>cm,normalize:()=>bs,overwrite:()=>Br,positive:()=>am,properties:()=>gs,property:()=>lm,regex:()=>ls,size:()=>Xo,slugify:()=>vs,startsWith:()=>fs,toLowerCase:()=>xs,toUpperCase:()=>Ss,trim:()=>As,uppercase:()=>ps});var ym=x(()=>{dr()});function bm(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 YO,XO,gv,tr,yv=x(()=>{dr();dr();en();YO=new WeakSet([Object.prototype,Error.prototype]);XO=(e,t)=>{ub.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);YO.has(r)||(YO.add(r),bm(r,"format",i=>o=>cu(i,o)),bm(r,"flatten",i=>o=>su(i,o)),bm(r,"addIssue",i=>o=>{i.issues.push(o),i.message=JSON.stringify(i.issues,Ja,2)}),bm(r,"addIssues",i=>o=>{i.issues.push(...o),i.message=JSON.stringify(i.issues,Ja,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},gv=D("ZodError",XO),tr=D("ZodError",XO,void 0,{Parent:Error})});var bv,Av,xv,Sv,vv,wv,_v,Iv,kv,Ev,Cv,Pv,Ov=x(()=>{dr();yv();dr();bv=ts(tr),Av=ns(tr),xv=rs(tr),Sv=is(tr),vv=Hd(tr),wv=Gd(tr),_v=Kd(tr),Iv=Wd(tr),kv=Jd(tr),Ev=Qd(tr),Cv=Yd(tr),Pv=Xd(tr)});var Ns={};ke(Ns,{ZodAny:()=>zv,ZodArray:()=>qv,ZodBase64:()=>$m,ZodBase64URL:()=>jm,ZodBigInt:()=>Ts,ZodBigIntFormat:()=>Fm,ZodBoolean:()=>Os,ZodCIDRv4:()=>Nm,ZodCIDRv6:()=>Dm,ZodCUID:()=>km,ZodCUID2:()=>Em,ZodCatch:()=>d0,ZodCodec:()=>Gu,ZodCreditCard:()=>Rv,ZodCustom:()=>Ku,ZodCustomStringFormat:()=>aa,ZodDate:()=>Uu,ZodDefault:()=>o0,ZodDiscriminatedUnion:()=>Hv,ZodE164:()=>Lm,ZodEmail:()=>vm,ZodEmoji:()=>_m,ZodEnum:()=>Es,ZodExactOptional:()=>Bm,ZodFile:()=>t0,ZodFunction:()=>S0,ZodGUID:()=>wm,ZodIBAN:()=>Nv,ZodIPv4:()=>Tm,ZodIPv6:()=>Rm,ZodISODate:()=>Xi,ZodISODateTime:()=>Yi,ZodISODuration:()=>to,ZodISOTime:()=>eo,ZodInstanceOf:()=>_0,ZodIntersection:()=>Gv,ZodJWT:()=>Mm,ZodKSUID:()=>Om,ZodLazy:()=>b0,ZodLiteral:()=>e0,ZodMAC:()=>Tv,ZodMap:()=>Yv,ZodNaN:()=>m0,ZodNanoID:()=>Im,ZodNever:()=>Vv,ZodNonOptional:()=>qm,ZodNull:()=>Mv,ZodNullable:()=>i0,ZodNumber:()=>Ps,ZodNumberFormat:()=>sa,ZodObject:()=>Bu,ZodOptional:()=>Zu,ZodPipe:()=>Hu,ZodPrefault:()=>s0,ZodPreprocess:()=>f0,ZodPromise:()=>x0,ZodReadonly:()=>h0,ZodRecord:()=>ks,ZodSet:()=>Xv,ZodString:()=>Cs,ZodStringFormat:()=>wt,ZodSuccess:()=>l0,ZodSymbol:()=>jv,ZodTemplateLiteral:()=>y0,ZodTransform:()=>n0,ZodTuple:()=>Wv,ZodType:()=>We,ZodULID:()=>Cm,ZodURL:()=>zu,ZodUUID:()=>di,ZodUndefined:()=>Lv,ZodUnion:()=>qu,ZodUnknown:()=>Uv,ZodVoid:()=>Bv,ZodXID:()=>Pm,ZodXor:()=>Zv,_ZodString:()=>Sm,_default:()=>a0,_function:()=>uR,any:()=>zT,array:()=>Vu,base64:()=>xT,base64url:()=>ST,bigint:()=>$T,boolean:()=>$v,catch:()=>p0,check:()=>lR,cidrv4:()=>bT,cidrv6:()=>AT,codec:()=>oR,creditCard:()=>wT,cuid:()=>lT,cuid2:()=>dT,currencyCode:()=>PT,custom:()=>dR,date:()=>VT,describe:()=>pR,discriminatedUnion:()=>KT,e164:()=>vT,email:()=>eT,emoji:()=>cT,enum:()=>Um,exactOptional:()=>r0,file:()=>tR,float32:()=>TT,float64:()=>RT,function:()=>uR,guid:()=>tT,hash:()=>OT,hex:()=>CT,hostname:()=>ET,httpUrl:()=>sT,iban:()=>_T,instanceof:()=>fR,int:()=>Am,int32:()=>NT,int64:()=>jT,intersection:()=>Kv,invertCodec:()=>aR,ipv4:()=>hT,ipv6:()=>yT,json:()=>gR,jwt:()=>IT,keyof:()=>BT,ksuid:()=>fT,lazy:()=>A0,literal:()=>eR,looseObject:()=>HT,looseRecord:()=>JT,mac:()=>gT,map:()=>QT,meta:()=>mR,nan:()=>iR,nanoid:()=>uT,nativeEnum:()=>XT,never:()=>zm,nonoptional:()=>u0,null:()=>Fv,nullable:()=>Fu,nullish:()=>nR,number:()=>Dv,object:()=>qT,optional:()=>ia,partialRecord:()=>WT,pipe:()=>xm,prefault:()=>c0,preprocess:()=>yR,promise:()=>cR,readonly:()=>g0,record:()=>Qv,refine:()=>v0,set:()=>YT,strictObject:()=>ZT,string:()=>Mu,stringFormat:()=>kT,stringbool:()=>hR,success:()=>rR,superRefine:()=>w0,symbol:()=>MT,templateLiteral:()=>sR,transform:()=>Vm,tuple:()=>Jv,uint32:()=>DT,uint64:()=>LT,ulid:()=>pT,undefined:()=>FT,union:()=>Rs,unknown:()=>ra,url:()=>aT,uuid:()=>nT,uuidv4:()=>rT,uuidv6:()=>iT,uuidv7:()=>oT,void:()=>UT,xid:()=>mT,xor:()=>GT});function a3(){mn.localeError||Bt(Np())}function oa(){mn.memoizer||Bt({memoizer:ku()})}function Mu(e){return Zx(Cs,e)}function eT(e){return Fp(vm,e)}function tT(e){return zp(wm,e)}function nT(e){return Up(di,e)}function rT(e){return Vp(di,e)}function iT(e){return Bp(di,e)}function oT(e){return qp(di,e)}function aT(e){return Pu(zu,e)}function sT(e){return Pu(zu,{protocol:du,hostname:Db,...Ee.normalizeParams(e)})}function cT(e){return Zp(_m,e)}function uT(e){return Hp(Im,e)}function lT(e){return Gp(km,e)}function dT(e){return Kp(Em,e)}function pT(e){return Wp(Cm,e)}function mT(e){return Jp(Pm,e)}function fT(e){return Qp(Om,e)}function hT(e){return Yp(Tm,e)}function gT(e){return Gx(Tv,e)}function yT(e){return Xp(Rm,e)}function bT(e){return em(Nm,e)}function AT(e){return tm(Dm,e)}function xT(e){return nm($m,e)}function ST(e){return rm(jm,e)}function vT(e){return im(Lm,e)}function wT(e){return Kx(Rv,e)}function _T(e){return Wx(Nv,e)}function IT(e){return om(Mm,e)}function kT(e,t,r={}){return na(aa,e,t,r)}function ET(e){return na(aa,"hostname",Nb,e)}function CT(e){return na(aa,"hex",Kb,e)}function PT(e){return na(aa,"currency_code",jb,e)}function OT(e,t){let r=t?.enc??"hex",i=`${e}_${r}`,o=Er[i];if(!o)throw new Error(`Unrecognized hash format: ${i}`);return na(aa,i,o,t)}function Dv(e){return Qx(Ps,e)}function Am(e){return Xx(sa,e)}function TT(e){return eS(sa,e)}function RT(e){return tS(sa,e)}function NT(e){return nS(sa,e)}function DT(e){return rS(sa,e)}function $v(e){return iS(Os,e)}function $T(e){return aS(Ts,e)}function jT(e){return cS(Fm,e)}function LT(e){return uS(Fm,e)}function MT(e){return lS(jv,e)}function FT(e){return dS(Lv,e)}function Fv(e){return pS(Mv,e)}function zT(){return mS(zv)}function ra(){return fS(Uv)}function zm(e){return hS(Vv,e)}function UT(e){return gS(Bv,e)}function VT(e){return yS(Uu,e)}function Vu(e,t){return xS(qv,e,t)}function BT(e){let t=e._zod.def.shape;return Um(Object.keys(t))}function qT(e,t){let r={type:"object",shape:e??{},...Ee.normalizeParams(t)};return new Bu(r)}function ZT(e,t){return new Bu({type:"object",shape:e,catchall:zm(),...Ee.normalizeParams(t)})}function HT(e,t){return new Bu({type:"object",shape:e,catchall:ra(),...Ee.normalizeParams(t)})}function Rs(e,t){return new qu({type:"union",options:e,...Ee.normalizeParams(t)})}function GT(e,t){return new Zv({type:"union",options:e,inclusive:!1,...Ee.normalizeParams(t)})}function KT(e,t,r){return new Hv({type:"union",options:t,discriminator:e,...Ee.normalizeParams(r)})}function Kv(e,t){return new Gv({type:"intersection",left:e,right:t})}function Jv(e,t,r){let i=t instanceof He,o=i?r:t,a=i?t:null;return new Wv({type:"tuple",items:e,rest:a,...Ee.normalizeParams(o)})}function Qv(e,t,r){return!t||!t._zod?new ks({type:"record",keyType:Mu(),valueType:e,...Ee.normalizeParams(t)}):new ks({type:"record",keyType:e,valueType:t,...Ee.normalizeParams(r)})}function WT(e,t,r){return new ks({type:"record",keyType:e,valueType:t,...Ee.normalizeParams(r),partial:!0})}function JT(e,t,r){return new ks({type:"record",keyType:e,valueType:t,mode:"loose",...Ee.normalizeParams(r)})}function QT(e,t,r){return new Yv({type:"map",keyType:e,valueType:t,...Ee.normalizeParams(r)})}function YT(e,t){return new Xv({type:"set",valueType:e,...Ee.normalizeParams(t)})}function Um(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Es({type:"enum",entries:r,...Ee.normalizeParams(t)})}function XT(e,t){return new Es({type:"enum",entries:e,...Ee.normalizeParams(t)})}function eR(e,t){return new e0({type:"literal",values:Array.isArray(e)?e:[e],...Ee.normalizeParams(t)})}function tR(e){return SS(t0,e)}function Vm(e){return new n0({type:"transform",transform:e})}function ia(e){return new Zu({type:"optional",innerType:e})}function r0(e){return new Bm({type:"optional",innerType:e})}function Fu(e){return new i0({type:"nullable",innerType:e})}function nR(e){return ia(Fu(e))}function a0(e,t){return new o0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ee.shallowClone(t)}})}function c0(e,t){return new s0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ee.shallowClone(t)}})}function u0(e,t){return new qm({type:"nonoptional",innerType:e,...Ee.normalizeParams(t)})}function rR(e){return new l0({type:"success",innerType:e})}function p0(e,t){return new d0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:Ee.constantCatch(t)})}function iR(e){return AS(m0,e)}function xm(e,t){return new Hu({type:"pipe",in:e,out:t})}function oR(e,t,r){return new Gu({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function aR(e){let t=e._zod.def;return new Gu({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function g0(e){return new h0({type:"readonly",innerType:e})}function sR(e,t){return new y0({type:"template_literal",parts:e,...Ee.normalizeParams(t)})}function A0(e){return new b0({type:"lazy",getter:e})}function cR(e){return new x0({type:"promise",innerType:e})}function uR(e){return new S0({type:"function",input:Array.isArray(e?.input)?Jv(e?.input):e?.input??Vu(ra()),output:e?.output??ra()})}function lR(e){let t=new Et({check:"custom"});return t._zod.check=e,t}function dR(e,t){return vS(Ku,e??(()=>!0),t)}function v0(e,t={}){return wS(Ku,e,t)}function w0(e,t){return _S(e,t)}function fR(e,t={}){let r=new _0({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...Ee.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 gR(e){let t=A0(()=>Rs([Mu(e),Dv(),$v(),Fv(),Vu(t),Qv(Mu(),t)]));return t}function yR(e,t){return new f0({type:"pipe",in:Vm(e),out:t})}var We,Sm,Cs,wt,Yi,Xi,eo,to,vm,wm,di,zu,_m,Im,km,Em,Cm,Pm,Om,Tm,Tv,Rm,Nm,Dm,$m,jm,Lm,Rv,Nv,Mm,aa,Ps,sa,Os,Ts,Fm,jv,Lv,Mv,zv,Uv,Vv,Bv,Uu,qv,Bu,qu,Zv,Hv,Gv,Wv,ks,Yv,Xv,Es,e0,t0,n0,Zu,Bm,i0,o0,s0,qm,l0,d0,m0,Hu,Gu,f0,h0,y0,b0,x0,S0,Ku,pR,mR,_0,hR,no=x(()=>{dr();dr();Lu();Go();$u();$x();ym();Ov();We=D("ZodType",(e,t)=>(a3(),He.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ee.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(v0(e,t))},superRefine(e,t){return this.check(w0(e,t))},overwrite(e){return this.check(Br(e))},optional(){return ia(this)},exactOptional(){return r0(this)},nullable(){return Fu(this)},nullish(){return ia(Fu(this))},nonoptional(e){return u0(this,e)},array(){return Vu(this)},or(e){return Rs([this,e])},and(e){return Kv(this,e)},transform(e){return xm(this,Vm(e))},default(e){return a0(this,e)},prefault(e){return c0(this,e)},catch(e){return p0(this,e)},pipe(e){return xm(this,e)},readonly(){return g0(this)},describe(e){let t=this.clone();return wn.add(t,{description:e}),t},meta(...e){if(e.length===0)return wn.get(this);let t=this.clone();return wn.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 Ee.hide(this,"~standard",{...pp(this),jsonSchema:{input:ws(this,"input"),output:ws(this,"output")}})},set"~standard"(e){Ee.own(this,"~standard",e)},parse:function e(t,r){return bv(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await Av(this,t,r,{callee:e})},safeParse(e,t){return xv(this,e,t)},async safeParseAsync(e,t){return Sv(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ee.own(this,"spa",e)},validate(e,t){return uu(this,e,t)},validateAsync(e,t){return lu(this,e,t)},encode:function e(t,r){return vv(this,t,r,{callee:e})},decode:function e(t,r){return wv(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await _v(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await Iv(this,t,r,{callee:e})},safeEncode(e,t){return kv(this,e,t)},safeDecode(e,t){return Ev(this,e,t)},async safeEncodeAsync(e,t){return Cv(this,e,t)},async safeDecodeAsync(e,t){return Pv(this,e,t)},toJSONSchema(e){return PS(this,{})(e)},get description(){return wn.get(this)?.description},get _def(){return this._zod.def}}),Sm=D("_ZodString",(e,t)=>{Wo.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>RS(e,r,i,o)},Ee.derived({format:e=>sn(e).format??null,minLength:e=>sn(e).minimum??null,maxLength:e=>sn(e).maximum??null},{regex(...e){return this.check(ls(...e))},includes(...e){return this.check(ms(...e))},startsWith(...e){return this.check(fs(...e))},endsWith(...e){return this.check(hs(...e))},min(...e){return this.check(ki(...e))},max(...e){return this.check(ea(...e))},length(...e){return this.check(ta(...e))},nonempty(...e){return this.check(ki(1,...e))},lowercase(e){return this.check(ds(e))},uppercase(e){return this.check(ps(e))},trim(){return this.check(As())},normalize(...e){return this.check(bs(...e))},toLowerCase(){return this.check(xs())},toUpperCase(){return this.check(Ss())},slugify(){return this.check(vs())}})),Cs=D("ZodString",(e,t)=>{Wo.init(e,t),Sm.init(e,t)},{email(e){return this.check(Fp(vm,e))},url(e){return this.check(Pu(zu,e))},jwt(e){return this.check(om(Mm,e))},emoji(e){return this.check(Zp(_m,e))},guid(e){return this.check(zp(wm,e))},uuid(e){return this.check(Up(di,e))},uuidv4(e){return this.check(Vp(di,e))},uuidv6(e){return this.check(Bp(di,e))},uuidv7(e){return this.check(qp(di,e))},nanoid(e){return this.check(Hp(Im,e))},cuid(e){return this.check(Gp(km,e))},cuid2(e){return this.check(Kp(Em,e))},ulid(e){return this.check(Wp(Cm,e))},base64(e){return this.check(nm($m,e))},base64url(e){return this.check(rm(jm,e))},xid(e){return this.check(Jp(Pm,e))},ksuid(e){return this.check(Qp(Om,e))},ipv4(e){return this.check(Yp(Tm,e))},ipv6(e){return this.check(Xp(Rm,e))},cidrv4(e){return this.check(em(Nm,e))},cidrv6(e){return this.check(tm(Dm,e))},e164(e){return this.check(im(Lm,e))},datetime(e){return this.check(Ou(Yi,e))},date(e){return this.check(Tu(Xi,e))},time(e){return this.check(Ru(eo,e))},duration(e){return this.check(Nu(to,e))}});wt=D("ZodStringFormat",(e,t)=>{St.init(e,t),Sm.init(e,t)}),Yi=D("ZodISODateTime",(e,t)=>{RA.init(e,t),wt.init(e,t)}),Xi=D("ZodISODate",(e,t)=>{NA.init(e,t),wt.init(e,t)}),eo=D("ZodISOTime",(e,t)=>{DA.init(e,t),wt.init(e,t)}),to=D("ZodISODuration",(e,t)=>{$A.init(e,t),wt.init(e,t)}),vm=D("ZodEmail",(e,t)=>{SA.init(e,t),wt.init(e,t)});wm=D("ZodGUID",(e,t)=>{AA.init(e,t),wt.init(e,t)});di=D("ZodUUID",(e,t)=>{xA.init(e,t),wt.init(e,t)});zu=D("ZodURL",(e,t)=>{_A.init(e,t),wt.init(e,t)});_m=D("ZodEmoji",(e,t)=>{IA.init(e,t),wt.init(e,t)});Im=D("ZodNanoID",(e,t)=>{kA.init(e,t),wt.init(e,t)});km=D("ZodCUID",(e,t)=>{EA.init(e,t),wt.init(e,t)});Em=D("ZodCUID2",(e,t)=>{CA.init(e,t),wt.init(e,t)});Cm=D("ZodULID",(e,t)=>{PA.init(e,t),wt.init(e,t)});Pm=D("ZodXID",(e,t)=>{OA.init(e,t),wt.init(e,t)});Om=D("ZodKSUID",(e,t)=>{TA.init(e,t),wt.init(e,t)});Tm=D("ZodIPv4",(e,t)=>{jA.init(e,t),wt.init(e,t)});Tv=D("ZodMAC",(e,t)=>{MA.init(e,t),wt.init(e,t)});Rm=D("ZodIPv6",(e,t)=>{LA.init(e,t),wt.init(e,t)});Nm=D("ZodCIDRv4",(e,t)=>{FA.init(e,t),wt.init(e,t)});Dm=D("ZodCIDRv6",(e,t)=>{zA.init(e,t),wt.init(e,t)});$m=D("ZodBase64",(e,t)=>{UA.init(e,t),wt.init(e,t)});jm=D("ZodBase64URL",(e,t)=>{VA.init(e,t),wt.init(e,t)});Lm=D("ZodE164",(e,t)=>{BA.init(e,t),wt.init(e,t)});Rv=D("ZodCreditCard",(e,t)=>{qA.init(e,t),wt.init(e,t)});Nv=D("ZodIBAN",(e,t)=>{ZA.init(e,t),wt.init(e,t)});Mm=D("ZodJWT",(e,t)=>{HA.init(e,t),wt.init(e,t)});aa=D("ZodCustomStringFormat",(e,t)=>{GA.init(e,t),wt.init(e,t)});Ps=D("ZodNumber",(e,t)=>{vp.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>NS(e,r,i,o),e.isFinite=!0},Ee.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:r}=sn(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:r}=sn(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:r}=sn(e);return!!t||!!r?.some(Number.isSafeInteger)},format:e=>sn(e).format??null},{gt(e,t){return this.check(ui(e,t))},gte(e,t){return this.check(lr(e,t))},min(e,t){return this.check(lr(e,t))},lt(e,t){return this.check(ci(e,t))},lte(e,t){return this.check(ur(e,t))},max(e,t){return this.check(ur(e,t))},int(e){return this.check(Am(e))},safe(e){return this.check(Am(e))},positive(e){return this.check(ui(0,e))},nonnegative(e){return this.check(lr(0,e))},negative(e){return this.check(ci(0,e))},nonpositive(e){return this.check(ur(0,e))},multipleOf(e,t){return this.check(Gi(e,t))},step(e,t){return this.check(Gi(e,t))},finite(){return this}}));sa=D("ZodNumberFormat",(e,t)=>{KA.init(e,t),Ps.init(e,t)});Os=D("ZodBoolean",(e,t)=>{xu.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>DS(e,r,i,o)});Ts=D("ZodBigInt",(e,t)=>{wp.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>$S(e,r,i,o)},Ee.derived({minValue:e=>sn(e).minimum??null,maxValue:e=>sn(e).maximum??null,format:e=>sn(e).format??null},{gte(e,t){return this.check(lr(e,t))},min(e,t){return this.check(lr(e,t))},gt(e,t){return this.check(ui(e,t))},lt(e,t){return this.check(ci(e,t))},lte(e,t){return this.check(ur(e,t))},max(e,t){return this.check(ur(e,t))},positive(e){return this.check(ui(BigInt(0),e))},negative(e){return this.check(ci(BigInt(0),e))},nonpositive(e){return this.check(ur(BigInt(0),e))},nonnegative(e){return this.check(lr(BigInt(0),e))},multipleOf(e,t){return this.check(Gi(e,t))}}));Fm=D("ZodBigIntFormat",(e,t)=>{WA.init(e,t),Ts.init(e,t)});jv=D("ZodSymbol",(e,t)=>{JA.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>jS(e,r,i,o)});Lv=D("ZodUndefined",(e,t)=>{QA.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>MS(e,r,i,o)});Mv=D("ZodNull",(e,t)=>{YA.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>LS(e,r,i,o)});zv=D("ZodAny",(e,t)=>{XA.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>US(e,r,i,o)});Uv=D("ZodUnknown",(e,t)=>{ex.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>VS(e,r,i,o)});Vv=D("ZodNever",(e,t)=>{tx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>zS(e,r,i,o)});Bv=D("ZodVoid",(e,t)=>{nx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>FS(e,r,i,o)});Uu=D("ZodDate",(e,t)=>{rx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>BS(e,r,i,o),e.min=(r,i)=>e.check(lr(r,i)),e.max=(r,i)=>e.check(ur(r,i))},Ee.derived({minDate:e=>{let{minimum:t}=sn(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=sn(e);return t?new Date(t):null}},{}));qv=D("ZodArray",(e,t)=>{oa(),ox.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>tv(e,r,i,o),e.element=t.element},{min(e,t){return this.check(ki(e,t))},nonempty(e){return this.check(ki(1,e))},max(e,t){return this.check(ea(e,t))},length(e,t){return this.check(ta(e,t))},unwrap(){return this.element}});Bu=D("ZodObject",(e,t)=>{oa(),ax.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>nv(e,r,i,o),Ee.installLazyProp(e,"shape",r=>r._zod.def.shape,!1)},{keyof(){return Um(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ee.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ee.mergeDefs(this._zod.def,{catchall:ra()}))},loose(){return this.clone(Ee.mergeDefs(this._zod.def,{catchall:ra()}))},strict(){return this.clone(Ee.mergeDefs(this._zod.def,{catchall:zm()}))},strip(){return this.clone(Ee.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return Ee.extend(this,e)},safeExtend(e){return Ee.safeExtend(this,e)},merge(e){return Ee.merge(this,e)},pick(e){return Ee.pick(this,e)},omit(e){return Ee.omit(this,e)},partial(...e){return Ee.partial(Zu,this,e[0])},exactPartial(...e){return Ee.partial(Bm,this,e[0],"exactPartial")},required(...e){return Ee.required(qm,this,e[0])}});qu=D("ZodUnion",(e,t)=>{Su.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>pm(e,r,i,o),e.options=t.options});Zv=D("ZodXor",(e,t)=>{qu.init(e,t),sx.init(e,t),e._zod.processJSONSchema=(r,i,o)=>pm(e,r,i,o),e.options=t.options});Hv=D("ZodDiscriminatedUnion",(e,t)=>{qu.init(e,t),ux.init(e,t)});Gv=D("ZodIntersection",(e,t)=>{lx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>rv(e,r,i,o)});Wv=D("ZodTuple",(e,t)=>{oa(),_p.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>iv(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 Zu({type:"optional",innerType:t}))})}});ks=D("ZodRecord",(e,t)=>{oa(),dx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ov(e,r,i,o),e.keyType=t.keyType,e.valueType=t.valueType});Yv=D("ZodMap",(e,t)=>{oa(),px.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>XS(e,r,i,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(li(...r)),e.nonempty=r=>e.check(li(1,r)),e.max=(...r)=>e.check(Ki(...r)),e.size=(...r)=>e.check(Xo(...r))});Xv=D("ZodSet",(e,t)=>{oa(),mx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ev(e,r,i,o),e.min=(...r)=>e.check(li(...r)),e.nonempty=r=>e.check(li(1,r)),e.max=(...r)=>e.check(Ki(...r)),e.size=(...r)=>e.check(Xo(...r))});Es=D("ZodEnum",(e,t)=>{fx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(i,o,a)=>qS(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 Es({...t,checks:[],...Ee.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 Es({...t,checks:[],...Ee.normalizeParams(o),entries:a})}});e0=D("ZodLiteral",(e,t)=>{hx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>ZS(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]}})});t0=D("ZodFile",(e,t)=>{gx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>KS(e,r,i,o),e.min=(r,i)=>e.check(li(r,i)),e.max=(r,i)=>e.check(Ki(r,i)),e.mime=(r,i)=>e.check(ys(Array.isArray(r)?r:[r],i))});n0=D("ZodTransform",(e,t)=>{oa(),yx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>YS(e,r,i,o),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Zi(e.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(Ee.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(Ee.issue(s))}};let o=t.transform(r.value,r);return o instanceof Promise?o.then(a=>(r.value=a,r)):(r.value=o,r)}});Zu=D("ZodOptional",(e,t)=>{Ip.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>mm(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});Bm=D("ZodExactOptional",(e,t)=>{bx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>mm(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});i0=D("ZodNullable",(e,t)=>{Ax.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>av(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});o0=D("ZodDefault",(e,t)=>{xx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>uv(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});s0=D("ZodPrefault",(e,t)=>{Sx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>lv(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});qm=D("ZodNonOptional",(e,t)=>{vx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>sv(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});l0=D("ZodSuccess",(e,t)=>{wx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>WS(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});d0=D("ZodCatch",(e,t)=>{_x.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>dv(e,r,i,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});m0=D("ZodNaN",(e,t)=>{Ix.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>HS(e,r,i,o)});Hu=D("ZodPipe",(e,t)=>{kp.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>pv(e,r,i,o),e.in=t.in,e.out=t.out});Gu=D("ZodCodec",(e,t)=>{Hu.init(e,t),vu.init(e,t)});f0=D("ZodPreprocess",(e,t)=>{Hu.init(e,t),kx.init(e,t)}),h0=D("ZodReadonly",(e,t)=>{Ex.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>mv(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});y0=D("ZodTemplateLiteral",(e,t)=>{Cx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>GS(e,r,i,o)});b0=D("ZodLazy",(e,t)=>{wu.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>hv(e,r,i,o),e.unwrap=()=>e._zod.def.getter()});x0=D("ZodPromise",(e,t)=>{Ox.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>fv(e,r,i,o),e.unwrap=()=>e._zod.def.innerType});S0=D("ZodFunction",(e,t)=>{Px.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>QS(e,r,i,o)});Ku=D("ZodCustom",(e,t)=>{Tx.init(e,t),We.init(e,t),e._zod.processJSONSchema=(r,i,o)=>JS(e,r,i,o)});pR=IS,mR=kS,_0=D("ZodInstanceOf",(e,t)=>{Ku.init(e,t)},{properties(e,t){return this.check(gs(e,t))}});hR=(...e)=>ES({Codec:Gu,Boolean:Os,String:Cs},...e)});function c3(e){Bt({customError:e})}function u3(){return Bt().customError}var s3,I0,bR=x(()=>{dr();s3={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"};I0||(I0={})});var Wu={};ke(Wu,{ZodISODate:()=>Xi,ZodISODateTime:()=>Yi,ZodISODuration:()=>to,ZodISOTime:()=>eo,date:()=>d3,datetime:()=>l3,duration:()=>m3,time:()=>p3});function l3(e){return Ou(Yi,e)}function d3(e){return Tu(Xi,e)}function p3(e){return Ru(eo,e)}function m3(e){return Nu(to,e)}var Zm=x(()=>{dr();no();no()});function h3(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 AR(e,t){return e.map((r,i)=>i<t?r:r.optional())}function g3(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function y3(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:g3(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 b3(e,t){return xe.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 k0(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=k0(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=k0(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 Ju(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Ju):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,r])=>A3.has(t)?Ju(r):!x3.has(t)||typeof r!="object"||r===null?!1:Object.values(r).some(Ju))}function xR(e){return e===1?"element":"elements"}function S3(e,t){return xe.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=k0(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 ${xR(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 ${xR(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}function SR(e,t){if(e!==!1)return e===void 0||e===!0?xe.any():zn(e,t)}function vR(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return xe.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 xe.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=y3(o,t),s=zn(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 xe.null();if(o.length===0)return xe.never();if(o.length===1)return xe.literal(o[0]);if(o.every(s=>typeof s=="string"))return xe.enum(o);let a=o.map(s=>xe.literal(s));return a.length<2?a[0]:xe.union([a[0],a[1],...a.slice(2)])}if(e.const!==void 0)return xe.literal(e.const);let r=e.type;if(Array.isArray(r)){let o=r.map(a=>{let s={...e,type:a};return vR(s,t)});return o.length===0?xe.never():o.length===1?o[0]:xe.union(o)}if(!r)return xe.any();let i;switch(r){case"string":{let o=xe.string();if(e.format){let a=e.format;a==="email"?o=o.check(xe.email()):a==="uri"||a==="uri-reference"?o=o.check(xe.url()):a==="uuid"||a==="guid"?o=o.check(xe.uuid()):a==="date-time"?o=o.check(xe.iso.datetime({offset:!0})):a==="date"?o=o.check(xe.iso.date()):a==="time"?o=o.check(xe.regex(v3)):a==="duration"?o=o.check(xe.iso.duration()):a==="hostname"?o=o.check(xe.hostname()):a==="ipv4"?o=o.check(xe.ipv4()):a==="ipv6"?o=o.check(xe.ipv6()):a==="mac"?o=o.check(xe.mac()):a==="cidr"?o=o.check(xe.cidrv4()):a==="cidr-v6"?o=o.check(xe.cidrv6()):a==="base64"?o=o.check(xe.base64()):a==="base64url"?o=o.check(xe.base64url()):a==="e164"?o=o.check(xe.e164()):a==="credit_card"?o=o.check(xe.creditCard()):a==="iban"?o=o.check(xe.iban()):a==="jwt"?o=o.check(xe.jwt()):a==="emoji"?o=o.check(xe.emoji()):a==="nanoid"?o=o.check(xe.nanoid()):a==="cuid"?o=o.check(xe.cuid()):a==="cuid2"?o=o.check(xe.cuid2()):a==="ulid"?o=o.check(xe.ulid()):a==="xid"?o=o.check(xe.xid()):a==="ksuid"&&(o=o.check(xe.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"?xe.number().int():xe.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=xe.boolean();break}case"null":{i=xe.null();break}case"object":{let o={},a=e.properties||{},s=new Set(e.required||[]),c=typeof e.additionalProperties=="object"?zn(e.additionalProperties,t):void 0;for(let[p,h]of Object.entries(a)){let f=zn(h,t);vn(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=zn(p[g],t),C=xe.string().regex(new RegExp(g));f.push(xe.looseRecord(C,A))}let m=[];if(Object.keys(o).length>0&&m.push(xe.object(o).passthrough()),m.push(...f),m.length===0)i=xe.object({}).passthrough();else if(m.length===1)i=m[0];else{let g=xe.intersection(m[0],m[1]);for(let A=2;A<m.length;A++)g=xe.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(!Ir(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=xe.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=zn(h,t)}i=b3(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=>zn(p,t)),u=AR(c,s),l=Array.isArray(a)?void 0:SR(a,t),d=xe.tuple(u);i=l?d.rest(l):d,typeof e.minItems=="number"&&(i=i.check(xe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(xe.maxLength(e.maxItems)))}else if(Array.isArray(a)){let s=typeof e.minItems=="number"?e.minItems:0,c=a.map(p=>zn(p,t)),u=AR(c,s),l=SR(e.additionalItems,t),d=xe.tuple(u);i=l?d.rest(l):d,typeof e.minItems=="number"&&(i=i.check(xe.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(xe.maxLength(e.maxItems)))}else if(a!==void 0){let s=zn(a,t),c=xe.array(s);typeof e.minItems=="number"&&(c=c.min(e.minItems)),typeof e.maxItems=="number"&&(c=c.max(e.maxItems)),i=c}else i=xe.array(xe.any());(e.uniqueItems===!0||e.contains!==void 0)&&(i=S3(i,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?zn(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 zn(e,t){if(typeof e=="boolean")return e?xe.any():xe.never();let r=vR(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=>zn(l,t)),u=xe.union(c);r=i?xe.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let c=e.oneOf.map(l=>zn(l,t)),u=xe.xor(c);r=i?xe.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=i?r:xe.any();else{let c=i?r:zn(e.allOf[0],t),u=i?0:1;for(let l=u;l<e.allOf.length;l++)c=xe.intersection(c,zn(e.allOf[l],t));r=c}e.nullable===!0&&t.version==="openapi-3.0"&&(r=xe.nullable(r)),e.readOnly===!0&&(r=xe.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&&!Ju(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&&!Ju(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))f3.has(c)||vn(o,c,e[c]);return Object.keys(o).length>0&&t.registry.add(r,o),e.description&&(r=r.describe(e.description)),r}function wR(e,t){if(typeof e=="boolean")return e?xe.any():xe.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=h3(r,t?.defaultTarget),o=r.$defs||r.definitions||{},a={version:i,defs:o,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??wn};return zn(r,a)}var xe,f3,A3,x3,v3,_R=x(()=>{Cu();en();ym();Zm();no();xe={...Ns,...gm,iso:Wu},f3=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"]);A3=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),x3=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);v3=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/});function Qu(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===IR)return new wu({type:"lazy",getter:()=>i.get(s)});if(c!==void 0)return c;i.set(s,IR);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 IR,E0=x(()=>{ss();en();IR=Symbol("z.visit/resolving")});function kR(e){return Qu(e,{object:t=>t.partial(),union:t=>{let r=t._zod.def;return r.discriminator===void 0?t:Rs(r.options)}})}var ER=x(()=>{E0();no()});function w3(e,t){if(!t?.length)return e;let r=e._zod.def;return xt(e,Ur(r,{checks:[...r.checks??[],...t]}),{parent:!0})}function CR(e){return w3(e.out,e.checks)}function _3(e){return e.in._zod.traits.has("$ZodTransform")?CR(e):e.in}function PR(e){return Qu(e,{pipe:t=>_3(t._zod.def),default:(t,r)=>r?ia(t._zod.def.innerType):t,catch:(t,r)=>r?t._zod.def.innerType:t})}function OR(e){return Qu(e,{pipe:t=>CR(t._zod.def),prefault:(t,r)=>r?t._zod.def.innerType:t})}var TR=x(()=>{en();E0();no()});var C0={};ke(C0,{bigint:()=>C3,boolean:()=>E3,date:()=>P3,number:()=>k3,string:()=>I3});function I3(e){return Hx(Cs,e)}function k3(e){return Yx(Ps,e)}function E3(e){return oS(Os,e)}function C3(e){return sS(Ts,e)}function P3(e){return bS(Uu,e)}var RR=x(()=>{dr();no()});var n={};ke(n,{$brand:()=>ab,$input:()=>Mx,$output:()=>Lx,INVALID:()=>Mn,NEVER:()=>ob,TimePrecision:()=>Jx,ZodAny:()=>zv,ZodArray:()=>qv,ZodBase64:()=>$m,ZodBase64URL:()=>jm,ZodBigInt:()=>Ts,ZodBigIntFormat:()=>Fm,ZodBoolean:()=>Os,ZodCIDRv4:()=>Nm,ZodCIDRv6:()=>Dm,ZodCUID:()=>km,ZodCUID2:()=>Em,ZodCatch:()=>d0,ZodCodec:()=>Gu,ZodCompileAsyncError:()=>Vr,ZodCompileUnsupportedError:()=>at,ZodCreditCard:()=>Rv,ZodCustom:()=>Ku,ZodCustomStringFormat:()=>aa,ZodDate:()=>Uu,ZodDefault:()=>o0,ZodDiscriminatedUnion:()=>Hv,ZodE164:()=>Lm,ZodEmail:()=>vm,ZodEmoji:()=>_m,ZodEnum:()=>Es,ZodError:()=>gv,ZodExactOptional:()=>Bm,ZodFile:()=>t0,ZodFirstPartyTypeKind:()=>I0,ZodFunction:()=>S0,ZodGUID:()=>wm,ZodIBAN:()=>Nv,ZodIPv4:()=>Tm,ZodIPv6:()=>Rm,ZodISODate:()=>Xi,ZodISODateTime:()=>Yi,ZodISODuration:()=>to,ZodISOTime:()=>eo,ZodInstanceOf:()=>_0,ZodIntersection:()=>Gv,ZodIssueCode:()=>s3,ZodJWT:()=>Mm,ZodKSUID:()=>Om,ZodLazy:()=>b0,ZodLiteral:()=>e0,ZodMAC:()=>Tv,ZodMap:()=>Yv,ZodNaN:()=>m0,ZodNanoID:()=>Im,ZodNever:()=>Vv,ZodNonOptional:()=>qm,ZodNull:()=>Mv,ZodNullable:()=>i0,ZodNumber:()=>Ps,ZodNumberFormat:()=>sa,ZodObject:()=>Bu,ZodOptional:()=>Zu,ZodPipe:()=>Hu,ZodPrefault:()=>s0,ZodPreprocess:()=>f0,ZodPromise:()=>x0,ZodReadonly:()=>h0,ZodRealError:()=>tr,ZodRecord:()=>ks,ZodSet:()=>Xv,ZodString:()=>Cs,ZodStringFormat:()=>wt,ZodSuccess:()=>l0,ZodSymbol:()=>jv,ZodTemplateLiteral:()=>y0,ZodTransform:()=>n0,ZodTuple:()=>Wv,ZodType:()=>We,ZodULID:()=>Cm,ZodURL:()=>zu,ZodUUID:()=>di,ZodUndefined:()=>Lv,ZodUnion:()=>qu,ZodUnknown:()=>Uv,ZodVoid:()=>Bv,ZodXID:()=>Pm,ZodXor:()=>Zv,_ZodString:()=>Sm,_default:()=>a0,_function:()=>uR,any:()=>zT,array:()=>Vu,base64:()=>xT,base64url:()=>ST,bigint:()=>$T,boolean:()=>$v,catch:()=>p0,check:()=>lR,cidrv4:()=>bT,cidrv6:()=>AT,clone:()=>xt,codec:()=>oR,coerce:()=>C0,compile:()=>Vx,config:()=>Bt,core:()=>Ei,creditCard:()=>wT,cuid:()=>lT,cuid2:()=>dT,currencyCode:()=>PT,custom:()=>dR,date:()=>VT,decode:()=>wv,decodeAsync:()=>Iv,deepPartial:()=>kR,describe:()=>pR,discriminatedUnion:()=>KT,e164:()=>vT,email:()=>eT,emoji:()=>cT,encode:()=>vv,encodeAsync:()=>_v,endsWith:()=>hs,enum:()=>Um,exactOptional:()=>r0,file:()=>tR,flattenError:()=>su,float32:()=>TT,float64:()=>RT,formatError:()=>cu,fromJSONSchema:()=>wR,function:()=>uR,getDiscriminatedOption:()=>cx,getErrorMap:()=>u3,globalRegistry:()=>wn,gt:()=>ui,gte:()=>lr,guid:()=>tT,hash:()=>OT,hex:()=>CT,hostname:()=>ET,httpUrl:()=>sT,iban:()=>_T,includes:()=>ms,input:()=>PR,instanceof:()=>fR,int:()=>Am,int32:()=>NT,int64:()=>jT,intersection:()=>Kv,invertCodec:()=>aR,ipv4:()=>hT,ipv6:()=>yT,iso:()=>Wu,json:()=>gR,jwt:()=>IT,keyof:()=>BT,ksuid:()=>fT,lazy:()=>A0,length:()=>ta,literal:()=>eR,locales:()=>Eu,looseObject:()=>HT,looseRecord:()=>JT,lowercase:()=>ds,lt:()=>ci,lte:()=>ur,mac:()=>gT,map:()=>QT,maxLength:()=>ea,maxSize:()=>Ki,memoizer:()=>ku,meta:()=>mR,mime:()=>ys,minLength:()=>ki,minSize:()=>li,multipleOf:()=>Gi,nan:()=>iR,nanoid:()=>uT,nativeEnum:()=>XT,negative:()=>sm,never:()=>zm,nonnegative:()=>um,nonoptional:()=>u0,nonpositive:()=>cm,normalize:()=>bs,null:()=>Fv,nullable:()=>Fu,nullish:()=>nR,number:()=>Dv,object:()=>qT,optional:()=>ia,output:()=>OR,overwrite:()=>Br,parse:()=>bv,parseAsync:()=>Av,partialRecord:()=>WT,pipe:()=>xm,positive:()=>am,prefault:()=>c0,preprocess:()=>yR,prettifyError:()=>db,promise:()=>cR,properties:()=>gs,property:()=>lm,readonly:()=>g0,record:()=>Qv,refine:()=>v0,regex:()=>ls,regexes:()=>Er,registry:()=>$p,safeDecode:()=>Ev,safeDecodeAsync:()=>Pv,safeEncode:()=>kv,safeEncodeAsync:()=>Cv,safeParse:()=>xv,safeParseAsync:()=>Sv,set:()=>YT,setErrorMap:()=>c3,size:()=>Xo,slugify:()=>vs,startsWith:()=>fs,strictObject:()=>ZT,string:()=>Mu,stringFormat:()=>kT,stringbool:()=>hR,success:()=>rR,superRefine:()=>w0,symbol:()=>MT,templateLiteral:()=>sR,toJSONSchema:()=>fm,toLowerCase:()=>xs,toUpperCase:()=>Ss,toZod:()=>Qc,transform:()=>Vm,treeifyError:()=>lb,trim:()=>As,tuple:()=>Jv,uint32:()=>DT,uint64:()=>LT,ulid:()=>pT,undefined:()=>FT,union:()=>Rs,unknown:()=>ra,uppercase:()=>ps,url:()=>aT,util:()=>Ee,uuid:()=>nT,uuidv4:()=>rT,uuidv6:()=>iT,uuidv7:()=>oT,validate:()=>uu,validateAsync:()=>lu,void:()=>UT,withParser:()=>jp,xid:()=>mT,xor:()=>GT});var Yu=x(()=>{dr();no();ym();yv();Ov();bR();dr();Lu();_R();ER();TR();jx();Zm();Zm();RR()});var J=x(()=>{Yu();Yu()});var O3,yt,pr=x(()=>{"use strict";J();O3=n.enum(["sandbox","live"]),yt=n.object({projectId:n.string().min(1),environment:O3}).strict()});var Xu,NR,DR,Hm,P0,$R,jR,cne,O0,une,lne,Gm,T0,dne,R0=x(()=>{"use strict";J();Xu=n.number().int().min(1).max(Number.MAX_SAFE_INTEGER),NR=n.enum(["unknown","denied","provisional","granted"]),DR=n.enum(["ios","android"]),Hm=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}$/)}),P0=n.string().regex(/^[a-f0-9]{64}$/),$R=Hm.extend({sequence:Xu,platform:DR,credentialDigest:P0}),jR=Hm.extend({credentialDigest:P0}),cne=Hm.extend({sequence:Xu,platform:DR}),O0=Hm.extend({sequence:Xu,credentialDigest:P0,connectionId:n.uuid().nullable(),kind:n.enum(["fcm_token","apns_token"]).nullable(),token:n.string().regex(/^[\x21-\x7e]{16,4096}$/).nullable(),permission:NR}),une=O0.extend({challenge:n.string().regex(/^[A-Za-z0-9_-]{100,3500}$/)}),lne=n.strictObject({requested:n.literal(!0),expiresAt:n.iso.datetime({offset:!0})}),Gm=n.strictObject({installationId:n.uuid(),bound:n.boolean(),identitySeq:Xu,bindingGeneration:Xu,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:NR}),T0=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()}),dne=n.strictObject({state:n.enum(["allowed","denied"]),revision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER-1)})});function R3(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(LR,e)){let i=LR[e];return{retryable:i==="retry_same_request",recovery:i}}let r=el.safeParse(e);return r.success?{retryable:e==="RATE_LIMITED"||e==="SERVICE_UNAVAILABLE",recovery:T3[r.data].recovery}:{retryable:!1,recovery:"contact_support"}}function N3(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 FR(e,t,r={}){let i=R3(e,t),o=r.reason==="RESULT_UNKNOWN"?"recover_operation":r.recovery??i.recovery,a=i.retryable&&r.retryable!==!1&&o!=="recover_operation",s=a?N3(r.retryAfter??null):void 0;return{...i,retryable:a,recovery:o,...s===void 0?{}:{retryAfterSeconds:s},...r.reason?{reason:r.reason}:{}}}var el,fne,hne,N0,D0,T3,LR,MR,D3,gne,yne,Km=x(()=>{"use strict";J();el=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"]),fne=n.enum([...el.options,"INVALID_SERVER_RESPONSE","RESPONSE_TOO_LARGE","AMBIGUOUS_AUTHENTICATION","BROWSER_REQUIRED","INVALID_REDIRECT_URI","AUTHORIZATION_UNAVAILABLE","UNREGISTERED_CLIENT","MANAGEMENT_OPERATION_FAILED"]),hne=n.enum([...el.options,"stale_revision"]),N0=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"]),D0=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"]),T3={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"}},LR={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"};MR=n.object({retryable:n.boolean(),recovery:N0,reason:D0.optional(),retryAfterSeconds:n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()}),D3=n.object({requestId:n.uuid().optional(),error:n.object({code:n.string().regex(/^[A-Z][A-Z0-9_]{0,95}$/),message:n.string(),...MR.partial().shape})}),gne=n.object({error:D3.shape.error.extend({requestId:n.uuid().optional()})}),yne=n.object({error:n.string(),code:n.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,95}$/),requestId:n.uuid(),...MR.shape})});var zR=x(()=>{"use strict"});function $0(e){let t=Te.parse(e.toUpperCase());return["JPY","KRW","VND"].includes(t)?0:2}function Ds(e,t,r="en",i={}){let o=Te.parse(t.toUpperCase());return new Intl.NumberFormat(r,{style:"currency",currency:o,...i}).format(e/10**$0(o))}var Wm,Te,qt=x(()=>{"use strict";J();Wm=["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"],Te=n.enum(Wm)});var VR,UR,$3,_ne,j0=x(()=>{"use strict";J();qt();VR=n.partialRecord(n.enum(Wm),n.number().int().min(1).max(1e8)),UR=n.strictObject({currency:n.enum(Wm),automaticTax:n.boolean()}),$3=n.strictObject({projectId:n.uuid(),environmentId:n.uuid()}),_ne=$3.extend({settings:UR,expected:UR})});var Cn,Un,Kt,Jm,j3,BR,qR,L3,z0,Qm,Ym,Xm,ZR,tl,L0,ca,HR,M0,F0,$s,GR,KR,nl=x(()=>{"use strict";J();Km();Cn=n.string().min(1).max(200),Un=n.iso.datetime({offset:!0}),Kt=n.number().int().nonnegative().max(1e8),Jm=n.string().regex(/^[A-Z]{3}$/),j3=["purchase.subscription","purchase.one_time","purchase.prepaid","purchase.trial","purchase.seats","purchase.tiered","tax.automatic","discount.percent.once","discount.percent.repeating","discount.percent.forever","discount.amount.once","discount.amount.repeating","discount.amount.forever","subscription.cancel.immediate","subscription.cancel.renewal","subscription.resume","subscription.plan.immediate","subscription.plan.renewal","subscription.seats","subscription.quantity","subscription.billing_cycle","subscription.proration","refund.full","refund.partial","refund.revoke"],BR=n.enum(j3),qR=n.strictObject({priceId:n.uuid(),productVersionId:n.uuid(),productId:Cn,quantity:n.number().int().min(1).max(1e6),unitAmountMinor:Kt,totalMinor:Kt,interval:n.enum(["week","month","year","one_off"]),intervalCount:n.number().int().min(1).max(52),kind:n.enum(["fixed","prepaid","seat"]),tiers:n.strictObject({mode:n.enum(["graduated","volume"]),tiers:n.array(n.strictObject({upTo:n.number().int().positive().nullable(),unitAmountMinor:Kt,flatAmountMinor:Kt.optional()})).min(2).max(12)}).nullable()}),L3=n.strictObject({grantId:n.uuid(),couponId:n.uuid(),amountMinor:Kt,terms:n.discriminatedUnion("type",[n.strictObject({type:n.literal("percent"),percentOff:n.number().gt(0).max(100)}),n.strictObject({type:n.literal("amount"),amountOffMinor:Kt,currency:Jm})]),duration:n.discriminatedUnion("type",[n.strictObject({type:n.literal("once")}),n.strictObject({type:n.literal("forever")}),n.strictObject({type:n.literal("repeating"),months:n.number().int().min(1).max(36)})])}),z0={provider:n.literal("merchant"),executor:n.literal("merchant"),operationId:n.uuid(),customerId:n.uuid(),configurationRevision:n.number().int().nonnegative(),connectionRevision:n.number().int().nonnegative(),currency:Jm,expiresAt:Un},Qm=n.strictObject({...z0,type:n.literal("purchase"),mode:n.enum(["payment","subscription"]),lineItems:n.array(qR).min(1).max(100),catalogAmountMinor:Kt,discount:L3.nullable(),trialPeriodDays:n.number().int().min(1).max(730).nullable(),automaticTax:n.boolean()}).refine(e=>e.lineItems.reduce((t,r)=>t+r.totalMinor,0)===e.catalogAmountMinor&&(!e.discount||e.discount.amountMinor<=e.catalogAmountMinor)&&new Set(e.lineItems.map(t=>t.priceId)).size===e.lineItems.length,"Purchase lines must retain the original total and unique Price identities"),Ym=n.strictObject({...z0,type:n.literal("subscription_change"),subscriptionId:n.uuid(),merchantSubscriptionId:Cn,membershipId:n.uuid(),subscriptionAction:n.enum(["update","cancel","schedule","release"]),supersedesOperationId:n.uuid().nullable(),change:n.discriminatedUnion("type",[n.strictObject({type:n.literal("cancel")}),n.strictObject({type:n.literal("uncancel")}),n.strictObject({type:n.literal("plan"),productVersionId:n.uuid()}),n.strictObject({type:n.literal("seats"),licenseKey:Cn,quantity:n.number().int().nonnegative().max(1e6)}),n.strictObject({type:n.literal("quantity"),internal_feature_id:n.uuid(),quantity:n.number().int().nonnegative().max(1e6)}),n.strictObject({type:n.literal("billing_cycle"),billingCycleAnchor:n.union([n.literal("now"),n.number().int().positive()])})]),timing:n.enum(["immediate","renewal"]),effectiveAt:Un,creditMinor:Kt,debitMinor:Kt,totalMinor:Kt,discountMinor:Kt,taxMinor:Kt,proration:n.enum(["none","create_prorations","always_invoice"]),lineItems:n.array(qR.extend({quantity:n.number().int().nonnegative().max(1e6)})).max(100),removePriceIds:n.array(n.uuid()).max(100)}),Xm=n.strictObject({...z0,type:n.literal("refund"),invoiceId:n.uuid(),merchantInvoiceId:Cn,amountMinor:Kt.refine(e=>e>0),mode:n.enum(["full","partial"]),entitlementAction:n.enum(["retain","revoke"]),cancelSubscriptions:n.array(Cn).max(100)}),ZR=n.discriminatedUnion("type",[Qm,Ym,Xm]),tl=n.strictObject({phase:n.enum(["execution","payment","fulfillment","recording"]),code:el,reason:D0.optional(),recovery:N0,retryable:n.boolean()}).refine(e=>e.reason!=="RESULT_UNKNOWN"||!e.retryable&&e.recovery==="recover_operation","Unknown financial effects require recovery of the original operation"),L0={operationId:n.uuid(),customerId:n.uuid(),merchantExecutionId:Cn,fulfillmentStatus:n.enum(["not_started","pending","applied","failed","not_applicable"]),recordingStatus:n.enum(["not_ready","pending","accepted","failed"]),updatedAt:Un,problem:tl.nullable(),pollAfterMs:n.number().int().min(1e3).max(6e4).nullable()},ca=n.discriminatedUnion("type",[n.strictObject({...L0,type:n.literal("purchase"),merchantOrderId:Cn.nullable(),paymentStatus:n.enum(["not_started","pending","succeeded","not_required","failed","expired","unknown"]),checkoutUrl:n.url().refine(e=>new URL(e).protocol==="https:").nullable(),checkoutExpiresAt:Un.nullable()}).refine(e=>!e.checkoutUrl||["not_started","pending"].includes(e.paymentStatus)&&e.checkoutExpiresAt!==null,"Only an unfinished original purchase may expose its checkout"),n.strictObject({...L0,type:n.literal("subscription_change"),status:n.enum(["pending","scheduled","applied","failed","unknown"]),merchantSubscriptionId:Cn,scheduledFor:Un.nullable()}).refine(e=>e.status==="scheduled"==(e.scheduledFor!==null),"A scheduled change retains its future effective time"),n.strictObject({...L0,type:n.literal("refund"),status:n.enum(["pending","succeeded","failed","unknown"]),merchantRefundId:Cn.nullable()}).refine(e=>e.status!=="succeeded"||e.merchantRefundId!==null,"A successful refund retains its original merchant identity")]),HR=n.discriminatedUnion("lookup",[n.strictObject({lookup:n.literal("found"),operationId:n.uuid(),customerId:n.uuid(),execution:ca,readAt:Un}),n.strictObject({lookup:n.literal("not_received"),operationId:n.uuid(),customerId:n.uuid(),execution:n.null(),readAt:Un})]).refine(e=>!e.execution||e.execution.operationId===e.operationId&&e.execution.customerId===e.customerId,"Lookup must retain the original Customer and operation"),M0=n.strictObject({merchantSubscriptionId:Cn,revision:n.number().int().positive(),status:n.enum(["incomplete","trialing","active","past_due","canceled","unpaid","paused","incomplete_expired"]),periodStartsAt:Un,periodEndsAt:Un,cancelAtPeriodEnd:n.boolean(),hasDiscounts:n.boolean(),items:n.array(n.strictObject({merchantItemId:Cn,priceId:n.uuid(),quantity:n.number().int().positive().max(1e6)})).min(1).max(100)}).refine(e=>Date.parse(e.periodEndsAt)>Date.parse(e.periodStartsAt)&&new Set(e.items.map(t=>t.priceId)).size===e.items.length,"Subscription periods and Price identities must be unambiguous"),F0=n.strictObject({merchantInvoiceId:Cn,currency:Jm,subtotalMinor:Kt,discountMinor:Kt,taxMinor:Kt,totalMinor:Kt,paidMinor:Kt,periodStartsAt:Un.nullable(),periodEndsAt:Un.nullable(),lines:n.array(n.strictObject({merchantLineId:Cn,priceId:n.uuid(),quantity:n.number().int().nonnegative().max(1e6),subtotalMinor:n.number().int().min(-1e8).max(1e8),discountMinor:Kt,taxMinor:Kt,totalMinor:n.number().int().min(-1e8).max(2e8),periodStartsAt:Un.nullable(),periodEndsAt:Un.nullable()}).refine(e=>e.subtotalMinor-e.discountMinor+e.taxMinor===e.totalMinor&&(e.subtotalMinor<0?e.discountMinor===0&&e.taxMinor===0:e.discountMinor<=e.subtotalMinor),"Invoice line amounts must retain the complete debit or credit")).min(1).max(100)}).refine(e=>e.subtotalMinor-e.discountMinor+e.taxMinor===e.totalMinor&&e.discountMinor<=e.subtotalMinor&&e.paidMinor===e.totalMinor&&new Set(e.lines.map(t=>t.merchantLineId)).size===e.lines.length&&e.lines.reduce((t,r)=>t+r.subtotalMinor,0)===e.subtotalMinor&&e.lines.reduce((t,r)=>t+r.discountMinor,0)===e.discountMinor&&e.lines.reduce((t,r)=>t+r.taxMinor,0)===e.taxMinor&&e.lines.reduce((t,r)=>t+r.totalMinor,0)===e.totalMinor,"A paid Invoice retains the complete financial amounts"),$s={provider:n.literal("merchant"),eventId:n.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,199}$/),customerId:n.uuid(),occurredAt:Un},GR=n.enum(["purchase.completed","purchase.closed","subscription.observed","subscription.change.completed","invoice.paid","refund.updated"]),KR=n.discriminatedUnion("type",[n.strictObject({...$s,type:n.literal("purchase.completed"),operationId:n.uuid(),merchantOrderId:Cn,paymentStatus:n.enum(["paid","trialing","no_payment_required"]),invoice:F0.nullable(),subscription:M0.nullable()}).refine(e=>e.paymentStatus!=="paid"||e.invoice!==null,"A paid purchase includes its Invoice"),n.strictObject({...$s,type:n.literal("purchase.closed"),operationId:n.uuid(),status:n.enum(["failed","expired","canceled"])}),n.strictObject({...$s,type:n.literal("subscription.observed"),operationId:n.uuid().nullable(),subscription:M0}),n.strictObject({...$s,type:n.literal("subscription.change.completed"),operationId:n.uuid(),status:n.enum(["scheduled","applied"]),scheduledFor:Un.nullable(),subscription:M0,invoice:F0.nullable()}).refine(e=>e.status==="scheduled"==(e.scheduledFor!==null),"Scheduled and applied changes are distinct facts"),n.strictObject({...$s,type:n.literal("invoice.paid"),merchantSubscriptionId:Cn,invoice:F0}),n.strictObject({...$s,type:n.literal("refund.updated"),operationId:n.uuid(),merchantRefundId:Cn,status:n.enum(["pending","succeeded","failed"]),amountMinor:Kt.refine(e=>e>0),currency:Jm})])});var ro,js,ua=x(()=>{"use strict";J();ro=/^gg_ct_[A-Za-z0-9_-]{32,128}$/,js=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 V0,M3,F3,z3,JR,U3,V3,B3,QR,YR,XR,q3,Dne,WR,$ne,B0,Z3,H3,G3,ef,tf,U0,Ci,K3,W3,J3,jne,rl,Q3,Lne,Mne,q0=x(()=>{"use strict";J();nl();ua();V0=3,M3=["session","catalog","customer_commerce","presentation","presentation_events","purchases","operation_status","billing_records","subscription_changes","refunds"],F3=n.enum(M3),z3=n.enum(["bridge.ping","bridge.describe","session.create","catalog.read","customer.commerce.read","presentation.resolve","presentation.report","purchase.execute","operation.read","subscription.change","refund.execute"]),JR=n.string().regex(/^[A-Za-z0-9_-]{1,64}$/),U3=n.string().regex(/^[A-Za-z0-9_-]{43}$/).refine(e=>"AEIMQUYcgkosw048".includes(e.at(-1)),"Use canonical base64url for a 32-byte key"),V3=n.strictObject({keyId:JR,signingSecret:U3}),B3=n.string().max(300).superRefine((e,t)=>{try{let r=new URL(e);if(r.protocol!=="https:"||r.username||r.password||r.search||r.hash||r.pathname!=="/"||r.port&&r.port!=="443"||!/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?\.[a-z]{2,63}$/.test(r.hostname)||/(?:^|\.)(?:localhost|local|internal)$/.test(r.hostname))throw new Error("invalid origin")}catch{t.addIssue({code:"custom",message:"Use an exact public HTTPS origin"})}}).transform(e=>new URL(e).origin),QR=n.array(F3).max(10).refine(e=>new Set(e).size===e.length,"Capabilities must be unique"),YR=n.strictObject({bridgeVersion:n.literal(V0),projectId:n.uuid(),environmentId:n.uuid(),environment:n.enum(["sandbox","live"]),capabilities:QR,catalog:n.enum(["endpoint","static","none"]),billingEvents:n.array(GR).max(6),profiles:n.array(BR).max(32).refine(e=>new Set(e).size===e.length,"Profiles must be unique")}).superRefine((e,t)=>{let r=i=>e.capabilities.includes(i);r("catalog")!==(e.catalog!=="none")&&t.addIssue({code:"custom",path:["catalog"],message:"Catalog declaration differs from its capability"}),(r("billing_records")!==e.billingEvents.length>0||new Set(e.billingEvents).size!==e.billingEvents.length)&&t.addIssue({code:"custom",path:["billingEvents"],message:"Declare the unique supported billing events"})}),XR=n.strictObject({origin:B3,requiredCapabilities:QR}),q3=n.strictObject({revision:n.number().int().nonnegative(),checkedAt:n.iso.datetime(),outcome:n.enum(["valid","unreachable","invalid","scope_mismatch","authentication_failed","credentials_missing"]),diagnostics:n.strictObject({ping:n.enum(["passed","failed","not_checked"]),authentication:n.enum(["passed","failed","not_checked"]),catalog:n.enum(["passed","failed","not_checked","static","unsupported"])}),manifest:YR.nullable()}).superRefine((e,t)=>{e.outcome==="valid"!=(e.manifest!==null)&&t.addIssue({code:"custom",path:["manifest"],message:"Only a valid declaration carries a manifest"})}),Dne=n.strictObject({projectId:n.uuid(),environmentId:n.uuid(),environment:n.enum(["sandbox","live"]),execution:n.enum(["indiana","record_only"]),accountId:n.string().nullable(),revision:n.number().int().nonnegative(),authentication:n.strictObject({keyId:JR}).nullable(),secretStoreConfigured:n.boolean().optional(),connection:XR.nullable(),check:q3.nullable()}),WR=n.strictObject({projectId:n.uuid(),environmentId:n.uuid()}),$ne=n.discriminatedUnion("action",[WR.extend({action:n.literal("save"),revision:n.number().int().nonnegative(),connection:XR,authentication:V3.optional()}),WR.extend({action:n.literal("check"),revision:n.number().int().nonnegative()})]),B0=n.strictObject({projectId:n.uuid(),environmentId:n.uuid(),environment:n.enum(["sandbox","live"])}),Z3=n.strictObject({nativeUserId:n.string().min(1).max(128),session:js.strict()}),H3=n.strictObject({nativeUserId:n.string().min(1).max(128),presentation:n.strictObject({customerId:n.uuid(),decisionId:n.uuid(),offeringVersionId:n.uuid(),paywallVersionId:n.uuid(),variant:n.string().min(1).max(128)}).nullable()}),G3=n.strictObject({decisionId:n.uuid(),eventId:n.uuid()}),ef=n.strictObject({operationId:n.uuid(),customerId:n.uuid()}),tf=n.strictObject({scope:B0,operationId:n.uuid(),customerId:n.uuid(),confirmedAt:n.iso.datetime({offset:!0}).nullable(),initialExecutionAllowed:n.boolean(),instruction:ZR}).refine(e=>e.operationId===e.instruction.operationId&&e.customerId===e.instruction.customerId,"Authority must refer to the original Customer and operation"),U0=ca,Ci=n.string().min(1).max(120),K3=n.string().regex(/^-?[0-9]+(?:\.[0-9]{1,6})?$/),W3=n.strictObject({revision:Ci,updatedAt:n.iso.datetime(),provider:n.literal("merchant"),items:n.array(n.strictObject({merchantProductId:Ci,productVersionId:n.uuid(),name:n.string().min(1).max(255),kind:n.enum(["subscription","credit_pack"]),merchantPriceId:Ci,currency:n.string().regex(/^[a-z]{3}$/),amountMinor:n.number().int().nonnegative().max(1e8),interval:n.enum(["one_time","month","year"]),intervalCount:n.literal(1),includedCredits:n.string().regex(/^[0-9]{1,18}(?:\.[0-9]{1,6})?$/),creditReset:n.enum(["none","month"]),creditPolicyId:Ci,available:n.boolean()}).superRefine((e,t)=>{(e.kind==="credit_pack"&&(e.interval!=="one_time"||e.creditReset!=="none")||e.kind==="subscription"&&e.interval==="one_time"||e.available&&e.amountMinor===0)&&t.addIssue({code:"custom",message:"Unsupported version 1 catalog terms"})})).max(500)}),J3=n.strictObject({customerId:n.uuid(),revision:n.string().min(1).max(128),observedAt:n.iso.datetime(),subscriptions:n.array(n.strictObject({merchantSubscriptionId:Ci,merchantProductId:Ci,productVersionId:n.uuid().nullable(),status:n.enum(["active","trialing","past_due","cancelled","expired"]),currentPeriodStartsAt:n.iso.datetime().nullable(),currentPeriodEndsAt:n.iso.datetime().nullable(),cancelAtPeriodEnd:n.boolean(),scheduledChange:n.strictObject({effectiveAt:n.iso.datetime(),merchantProductId:Ci}).nullable()})).max(100),purchaseHistory:n.strictObject({complete:n.boolean(),hasPaidPurchase:n.boolean(),lastPaidAt:n.iso.datetime().nullable()}),balances:n.array(n.strictObject({bucketId:Ci,key:Ci,available:K3,expiresAt:n.iso.datetime().nullable(),nextResetAt:n.iso.datetime().nullable()})).max(100)}),jne=n.strictObject({bridgeVersion:n.literal(V0),requestId:n.uuid(),command:n.string().min(1).max(64),scope:B0,error:n.strictObject({code:n.string().regex(/^MERCHANT_BRIDGE_[A-Z_]+$/),message:n.string().min(1).max(500),retryable:n.boolean(),recovery:n.string().min(1).max(80)})}),rl=n.strictObject({}),Q3={"bridge.ping":n.strictObject({challenge:n.uuid()}),"bridge.describe":rl,"session.create":rl,"catalog.read":rl,"customer.commerce.read":rl,"presentation.resolve":rl,"presentation.report":G3,"purchase.execute":ef,"operation.read":ef,"subscription.change":ef,"refund.execute":ef},Lne={"bridge.ping":n.strictObject({challenge:n.uuid()}),"bridge.describe":YR,"session.create":Z3,"catalog.read":W3,"customer.commerce.read":J3,"presentation.resolve":H3,"presentation.report":n.strictObject({queued:n.literal(!0)}),"purchase.execute":U0,"operation.read":HR,"subscription.change":U0,"refund.execute":U0},Mne=n.strictObject({bridgeVersion:n.literal(V0),requestId:n.uuid(),scope:B0,command:z3,data:n.unknown()}).superRefine((e,t)=>{Q3[e.command].safeParse(e.data).success||t.addIssue({code:"custom",path:["data"],message:"Invalid command data"})})});var eN=x(()=>{"use strict"});var la,Bne,nf=x(()=>{"use strict";J();qt();la=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"),Bne=n.object({amountCents:n.number().int().min(0).max(1e8),currency:Te,interval:n.enum(["free","month","year"]),currencyOptions:n.partialRecord(Te,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 tN=x(()=>{Yu();Yu()});var il=x(()=>{tN()});var nN,rN=x(()=>{"use strict";il();nN=n.registry()});var rf,iN,Y3,X3,ol,e9,t9,n9,r9,i9,o9,oN,Z0,Ls,a9,io,H0,al,aN,s9,c9,sN,cN,G0,of,sl,af,uN,u9,sf,cf,K0,lN,l9,d9,W0,dN,p9,pN,J0,mN,Q0,m9,cl,f9,h9,g9,fN,y9,b9,A9,x9,S9,v9,uf,w9,_9,I9,k9,E9,hN,C9,P9,O9,T9,Y0,R9,N9,gN,D9,$9,yN,j9,bN,L9,M9,lf,AN,F9,z9,U9,V9,B9,xN,X0,q9,Z9,Xne,H9,SN,vN,wN,_N,G9,K9,df,W9,ew,J9,IN,Q9,Y9,X9,eq,tq,kN,pf,EN,CN,nq,rq,PN,iq,tw,oq,nw,ON,TN,aq,sq,cq,ere,uq,RN,lq,NN,dq,pq,DN,$N,tre,nre,jN,LN,mq,MN,fq,hq,FN,gq,yq,bq,Aq,xq,Sq,vq,rre,rw,iw,ow,wq,_q,Iq,kq,aw,Eq,zN,Cq,ire,Pq,UN,Oq,VN,Tq,Rq,Nq,Dq,$q,BN,jq,mf,Lq,Mq,Fq,ul,qN,zq,ZN,Uq,ff,Vq,HN,Bq,qq,GN,KN,Zq,ore,WN,sw,JN,cw,are,Hq,sre,uw,cre,QN,Gq,ure,lre,YN=x(()=>{"use strict";il();rN();({AppEnv:rf}=(()=>{var e;return(function(t){t.Sandbox="sandbox",t.Live="live"})(e||(e={})),{AppEnv:e}})()),{IGNORE_PAST_DUE_DESCRIPTION:iN}={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:Y3}=(()=>{var e;return(function(t){t.Hour="hour",t.Day="day",t.Week="week",t.Month="month"})(e||(e={})),{PurchaseLimitInterval:e}})(),{SpendLimitType:X3}=(e=>({SpendLimitType:e.enum(["absolute","usage_percentage"])}))(n),{ResetInterval:ol}=(()=>{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:e9}={USAGE_LIMIT_ANCHORS:["billing_cycle","utc"]},{USAGE_LIMIT_FILTER_MAX_KEY_LENGTH:t9}={USAGE_LIMIT_FILTER_MAX_KEY_LENGTH:64},{USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH:n9}={USAGE_LIMIT_FILTER_MAX_VALUE_LENGTH:128},{USAGE_LIMIT_FILTER_MAX_KEYS:r9}={USAGE_LIMIT_FILTER_MAX_KEYS:4},{UsageAlertThresholdType:i9}=(e=>({UsageAlertThresholdType:e.enum(["usage","usage_percentage","remaining","remaining_percentage"])}))(n),{BALANCE_BASES:o9}={BALANCE_BASES:["balance","included","recurring"]},{DEFAULT_USAGE_ALERT_BASIS:oN}={DEFAULT_USAGE_ALERT_BASIS:"balance"},{DbOverageAllowedSchema:Z0}=(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:Ls}=(e=>({ProductMetadataSchema:e.record(e.string(),e.any())}))(n),{findDuplicate:a9}={findDuplicate:t=>{let r=new Set;for(let i of t){if(r.has(i))return i;r.add(i)}}},{BillingInterval:io}=(()=>{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:H0}=(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:al}=(e=>({withSpecDefault:({schema:r,defaultValue:i,description:o})=>(e.add(r,{description:o,default:i}),r)}))(nN),{COMMON:aN}={COMMON:["usd","eur","gbp","cad","aud","jpy","chf","cny","inr"]},{STRIPE_PRESENTMENT_CURRENCIES:s9}={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:c9}=(e=>({COMMON_SET:new Set(e)}))(aN),{hasNoDuplicateCurrencies:sN}={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:cN}={DUPLICATE_CURRENCY_MESSAGE:"Each currency may appear at most once in additional_currencies."},{IncludedUsageParamsSchema:G0}=(e=>({IncludedUsageParamsSchema:e.number().max(1e13,{error:"Included usage cannot exceed 10 trillion; use unlimited usage instead"})}))(n),{Infinite:of}={Infinite:"inf"},{TierBehavior:sl}=(()=>{var e;return(function(t){t.Graduated="graduated",t.VolumeBased="volume"})(e||(e={})),{TierBehavior:e}})(),{BillingMethod:af}=(()=>{var e;return(function(t){t.Prepaid="prepaid",t.UsageBased="usage_based"})(e||(e={})),{BillingMethod:e}})(),{AllocatedBilling:uN}=(()=>{var e;return(function(t){t.Arrear="arrear",t.ProratedLegacy="prorated_legacy"})(e||(e={})),{AllocatedBilling:e}})(),{PLAN_ITEM_PRICE_DESCRIPTION:u9}={PLAN_ITEM_PRICE_DESCRIPTION:"Pricing for usage beyond included units. Omit for free features."},{OnIncrease:sf}=(()=>{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:cf}=(()=>{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:K0}=(()=>{var e;return(function(t){t.Month="month",t.Forever="forever"})(e||(e={})),{RolloverExpiryDurationType:e}})(),{EntitlementDuration:lN}=(()=>{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:l9}={CREDIT_DIMENSION_NAME_MAX_LENGTH:64},{USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:d9}={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:dN}=(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:p9}={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:pN}=(e=>({MarkupEntrySchema:e.object({markup:e.number().min(-100)})}))(n),{ModelMarkupsSchema:J0}=((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,pN),{additionalCurrencyPlanItemIssues:mN}={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:Q0}=((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,af,io,ol,G0),{UpdatePlanItemParamsV1Schema:m9}=((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,Q0,ol),{FreeTrialDuration:cl}=(()=>{var e;return(function(t){t.Day="day",t.Month="month",t.Year="year"})(e||(e={})),{FreeTrialDuration:e}})(),{laneParam:f9}=((e,t)=>({laneParam:({schema:i,description:o})=>e({schema:t.array(i).optional(),defaultValue:[],description:o})}))(al,n),{findDuplicateInControls:h9}={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:g9}={featureIdIdentity:t=>t.feature_id||void 0},{usageLimitFilterKey:fN}={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:y9}=((e,t)=>({usageAlertIdentity:i=>[i.feature_id??"",i.basis??e,t(i.filter),i.threshold_type,i.threshold].join("|")}))(oN,fN),{RemovePlanLicenseSchema:b9}=(e=>({RemovePlanLicenseSchema:e.object({license_plan_id:e.string()})}))(n),{ApiStripePriceProcessorSchema:A9}=(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:x9}=(()=>{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:S9}=(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:v9}=(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:uf}={TrialOnEnd:["bill","revert"]},{EligibilityStatus:w9}=(()=>{var e;return(function(t){t.Active="active",t.Scheduled="scheduled"})(e||(e={})),{EligibilityStatus:e}})(),{AttachAction:_9}=(()=>{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:I9}=(()=>{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:k9}=(e=>({UsageWindowDimensionSchema:e.enum(["balance","metered_feature"])}))(n),{UsageWindowScopeSchema:E9}=(e=>({UsageWindowScopeSchema:e.enum(["customer","entity"])}))(n),{EntInterval:hN}=(()=>{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:C9}=(()=>{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:P9}=(e=>({FeatureStripeMeterSchema:e.object({id:e.string(),event_name:e.string()})}))(n),{FreeTrialSchema:O9}=((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,cl,uf),{BillingType:T9}=(()=>{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:Y0}=((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,of),{IgnoredFixedPriceMetadataSchema:R9}=(e=>({IgnoredFixedPriceMetadataSchema:e.preprocess(r=>typeof r=="string"?null:r,e.null().or(e.undefined()))}))(n),{BillWhen:N9}=(()=>{var e;return(function(t){t.InAdvance="in_advance",t.StartOfPeriod="start_of_period",t.EndOfPeriod="end_of_period"})(e||(e={})),{BillWhen:e}})(),{AllocatedBillingBehavior:gN}=(()=>{var e;return(function(t){t.Arrear="arrear",t.Prorated="prorated"})(e||(e={})),{AllocatedBillingBehavior:e}})(),{ProrationConfigSchema:D9}=((e,t,r)=>({ProrationConfigSchema:e.object({on_increase:e.nativeEnum(t).default(t.ProrateImmediately),on_decrease:e.nativeEnum(r).default(r.ProrateImmediately)})}))(n,sf,cf),{AllowanceType:$9}=(()=>{var e;return(function(t){t.Fixed="fixed",t.Unlimited="unlimited",t.None="none"})(e||(e={})),{AllowanceType:e}})(),{RolloverConfigSchema:yN}=((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,K0),{CreditDimensionBaseSchema:j9}=((e,t)=>({CreditDimensionBaseSchema:e.object({match:t,priority:e.number().int().optional()})}))(n,W0),{flatCreditRateShape:bN}=(e=>({flatCreditRateShape:{credit_amount:e.number(),tier_behavior:e.never().optional(),tiers:e.never().optional()}}))(n),{CreditTierSchema:L9}=(e=>({CreditTierSchema:e.object({to:e.union([e.number(),e.literal("inf")]),credit_amount:e.number()})}))(n),{CreditMultiplierSchema:M9}=((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:lf}={idRegex:/^[a-zA-Z0-9_-]+$/},{descriptions:AN}={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:F9}=(()=>{var e;return(function(t){t.Feature="feature",t.FeaturePrice="priced_feature",t.Price="price"})(e||(e={})),{ProductItemType:e}})(),{ProductItemFeatureType:z9}=(()=>{var e;return(function(t){t.SingleUse="single_use",t.ContinuousUse="continuous_use",t.Boolean="boolean",t.Static="static"})(e||(e={})),{ProductItemFeatureType:e}})(),{ProductItemInterval:U9}=(()=>{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:V9}=(()=>{var e;return(function(t){t.Prepaid="prepaid",t.PayPerUse="pay_per_use"})(e||(e={})),{UsageModel:e}})(),{TierInfinite:B9}={TierInfinite:"inf"},{CreateFreeTrialSchema:xN}=((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,cl,uf),{ProductConfigParamsSchema:X0}=((e,t,r)=>({ProductConfigParamsSchema:e.object({ignore_past_due:t({schema:e.boolean().optional(),defaultValue:!1,description:r})})}))(n,al,iN),{CREATE_PRODUCT_EXAMPLE:q9}={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:Z9}=((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,cl,uf),{CreateProductSchema:Xne}=(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:H9}={isUsageLimitBasisAlert:t=>t.basis==="usage_limit"},{PromoCodeSchema:SN}=(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:vN}=(()=>{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:wN}=(()=>{var e;return(function(t){t.OneOff="one_off",t.Months="months",t.Forever="forever"})(e||(e={})),{CouponDurationType:e}})(),{FreeProductConfigSchema:_N}=((e,t)=>({FreeProductConfigSchema:e.object({duration_type:e.nativeEnum(t),duration_value:e.number()})}))(n,wN),{RewardTriggerEvent:G9}=(()=>{var e;return(function(t){t.CustomerCreation="customer_creation",t.Checkout="checkout"})(e||(e={})),{RewardTriggerEvent:e}})(),{RewardReceivedBy:K9}=(()=>{var e;return(function(t){t.Referrer="referrer",t.All="all"})(e||(e={})),{RewardReceivedBy:e}})(),{ProductConfigSchema:df}=((e,t)=>({ProductConfigSchema:e.object({ignore_past_due:e.boolean().default(!1).meta({description:t})})}))(n,iN),{PurchaseLimitIntervalEnum:W9}=((e,t)=>({PurchaseLimitIntervalEnum:e.enum(t)}))(n,Y3),{DbSpendLimitSchema:ew}=((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,X3),{USAGE_LIMIT_INTERVALS:J9}=(e=>({USAGE_LIMIT_INTERVALS:[e.Day,e.Week,e.Month,e.Year]}))(ol),{UsageLimitAnchorSchema:IN}=((e,t)=>({UsageLimitAnchorSchema:e.enum(t)}))(n,e9),{UsageLimitFilterValueSchema:Q9}=((e,t)=>({UsageLimitFilterValueSchema:e.union([e.string().min(1).max(t),e.number(),e.boolean()]).transform(String).pipe(e.string())}))(n,n9),{USAGE_ALERT_BASES:Y9}=(e=>({USAGE_ALERT_BASES:[...e,"usage_limit"]}))(o9),{licensePatchIssues:X9}=(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"]}]}}))(a9),{BasePriceSchema:eq}=((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,io,H0),{CURRENCY_CODES:tq}=((e,t,r)=>({CURRENCY_CODES:[...e,...t.filter(o=>!r.has(o)).sort()]}))(aN,s9,c9),{AllocatedBillingFieldSchema:kN}=((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,uN),{EntitlementExpirySchema:pf}=((e,t)=>({EntitlementExpirySchema:e.object({duration:e.enum(t),length:e.number()})}))(n,lN),{CreditDimensionNameSchema:EN}=((e,t,r)=>({CreditDimensionNameSchema:e.string().min(1).max(t).refine(o=>!o.includes(r),{message:`Dimension names cannot contain "${r}"`})}))(n,l9,d9),{ApiCreditMatchSchema:CN}=(e=>({ApiCreditMatchSchema:e.meta({description:"Event properties this entry applies to. Every key must equal the tracked property, compared as strings."})}))(W0),{findCreditTierViolations:nq}=(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}}))(p9),{ApiCreditMultiplierSchema:rq}=((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,CN),{ProviderMarkupsSchema:PN}=((e,t)=>({ProviderMarkupsSchema:e.record(e.string(),t).nullish()}))(n,pN),{planItemParamsIssues:iq}=((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}}))(af,io,uN,sl,mN),{FreeTrialParamsV1Schema:tw}=((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,cl,al),{duplicateCheck:oq}=(e=>({duplicateCheck:({controlKey:r,...i})=>o=>e({controlKey:r,controls:o[r]??[],rule:i})}))(h9),{usageLimitIdentity:nw}=(e=>({usageLimitIdentity:r=>`${r.feature_id}|${e(r.filter)}`}))(fN),{ApiPriceProcessorsSchema:ON}=((e,t)=>({ApiPriceProcessorsSchema:e.object({stripe:t.nullish()}).meta({"x-atmn-mapping":!0})}))(n,A9),{ApiFeatureV0Schema:TN}=((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,x9),{ApiRevenueCatPlanProcessorSchema:aq}=((e,t)=>({ApiRevenueCatPlanProcessorSchema:e.object({products:e.array(t).meta({description:"Every RevenueCat product that maps to this plan. Replaces the current set."})})}))(n,v9),{ApiFreeTrialV2Schema:sq}=((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,cl,uf),{CustomerEligibilitySchema:cq}=((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,w9,_9,I9),{UsageWindowLimitSchema:ere}=((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,k9,E9,hN,IN),{FeatureSchema:uq}=((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,rf,C9,J0,P9),{PriceCurrencyConfigSchema:RN}=((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,Y0),{UsagePriceConfigSchema:lq}=((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,N9,Y0,io,RN,gN),{graduatedCreditRateShape:NN}=((e,t)=>({graduatedCreditRateShape:{credit_amount:e.never().optional(),tier_behavior:e.literal("graduated"),tiers:e.array(t)}}))(n,L9),{FeatureMarkupsOverrideSchema:dq}=((e,t,r)=>({FeatureMarkupsOverrideSchema:e.strictObject({default_markup:e.number().min(-100).optional(),provider_markups:t,model_markups:r})}))(n,PN,J0),{usageAlertTargetLimitIdentity:pq}=(e=>({usageAlertTargetLimitIdentity:r=>e({feature_id:r.feature_id??"",filter:r.filter})}))(nw),{DiscountConfigSchema:DN}=((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,wN),{RewardEntitlementSchema:$N}=((e,t)=>({RewardEntitlementSchema:e.object({internal_feature_id:e.string().min(1),allowance:e.number().nonnegative().optional(),expiry:t.optional()})}))(n,pf),{UpdateRewardSchema:tre}=((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,SN,vN,DN,_N,$N),{CreateRewardProgram:nre}=((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,G9,K9),{AutoTopupPurchaseLimitSchema:jN}=((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,W9),{UsageLimitFilterSchema:LN}=((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,t9,Q9,r9),{UsageAlertBasisSchema:mq}=((e,t)=>({UsageAlertBasisSchema:e.enum(t)}))(n,Y9),{refineCustomizePlanV1Schema:MN}=(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`})}}))(X9),{SUPPORTED_SET:fq}=(e=>({SUPPORTED_SET:new Set(e)}))(tq),{ApiCreditDimensionBaseSchema:hq}=((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,CN),{refineGraduatedTiers:FN}=(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"]})}}))(nq),{ApiFeatureMarkupsOverrideSchema:gq}=((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,PN,J0),{AutoTopupPurchaseLimitParamsSchema:yq}=((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."})})}))(jN,n),{DUPLICATE_CHECKS:bq}=((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"})]}))(oq,g9,nw,y9),{ApiPlanProcessorsSchema:Aq}=((e,t,r)=>({ApiPlanProcessorsSchema:e.object({stripe:t.nullish(),revenuecat:r.nullish()}).meta({"x-atmn-mapping":!0})}))(n,S9,aq),{FixedPriceConfigSchema:xq}=((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,io,RN,Y0,R9),{CreditDimensionSchema:Sq}=((e,t,r,i)=>({CreditDimensionSchema:e.union([t.extend(r),t.extend(i)])}))(n,j9,bN,NN),{filterUnresolvableUsageLimitAlerts:vq}=((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}]:[])}}))(nw,H9,pq),{CreateRewardSchema:rre}=((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,SN,vN,DN,_N,$N),{AutoTopupSchema:rw}=((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,jN),{DbUsageLimitSchema:iw}=((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,J9,IN,LN),{DbUsageAlertSchema:ow}=((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,i9,mq,oN,LN),{isValidCurrencyCode:wq}=(e=>({isValidCurrencyCode:r=>!!r&&e.has(r.toLowerCase())}))(fq),{ApiCreditDimensionSchema:_q}=((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,hq,dN,FN),{AutoTopupParamsSchema:Iq}=((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."})})}))(rw,yq),{findDuplicateBillingControlIssue:kq}=(e=>({findDuplicateBillingControlIssue:r=>{for(let i of e){let o=i(r);if(o)return o}}}))(bq),{CustomerBillingControlsSchema:aw}=((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,rw,ew,iw,ow,Z0),{PriceSchema:Eq}=((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,T9,sl,xq,lq,D9),{CreditSchemaItemBaseSchema:zN}=((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,EN,Sq,M9),{GraduatedCreditSchemaItemSchema:Cq}=((e,t)=>({GraduatedCreditSchemaItemSchema:e.extend(t)}))(zN,NN),{UpdateProductSchema:ire}=((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,df,aw),{DbBillingControlsSchema:Pq}=((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,rw,ew,iw,ow,Z0),{CurrencyCodeSchema:UN}=((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,wq),{AdditionalCurrencyTierSchema:Oq}=((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,UN),{ApiCreditSchemaItemBaseSchema:VN}=((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,EN,_q,rq),{ApiFlatCreditSchemaItemSchema:Tq}=((e,t)=>({ApiFlatCreditSchemaItemSchema:e.extend({credit_cost:t.number().min(0).meta({description:"Credits consumed per billing-unit group."})}).strict()}))(VN,n),{rejectDuplicateBillingControls:Rq}=(e=>({rejectDuplicateBillingControls:r=>{let i=e(r.value);i&&r.issues.push(i)}}))(kq),{FlatCreditSchemaItemSchema:Nq}=((e,t)=>({FlatCreditSchemaItemSchema:e.extend(t)}))(zN,bN),{ProductSchema:Dq}=((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,rf,df,Pq,Ls),{AdditionalCurrencyPriceSchema:$q}=((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,UN),{AdditionalCurrencyTierArraySchema:BN}=((e,t,r,i)=>({AdditionalCurrencyTierArraySchema:e.array(t).refine(r,{message:i})}))(n,Oq,sN,cN),{ApiGraduatedCreditSchemaItemSchema:jq}=((e,t,r,i)=>({ApiGraduatedCreditSchemaItemSchema:e.extend({tier_behavior:t.literal("graduated"),tiers:t.array(r).min(1)}).strict().superRefine(i)}))(VN,n,dN,FN),{CustomerBillingControlsParamsSchema:mf}=((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,f9,Iq,ew,iw,ow,Z0,Rq),{CreditSchemaItemSchema:Lq}=((e,t,r)=>({CreditSchemaItemSchema:e.union([t,r])}))(n,Nq,Cq),{PriceTierSchema:Mq}=((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,B9,BN),{PlanBillingControlsParamsSchema:Fq}=((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"]})})}))(mf,vq),{AdditionalCurrencyPriceArraySchema:ul}=((e,t,r,i)=>({AdditionalCurrencyPriceArraySchema:e.array(t).refine(r,{message:i})}))(n,$q,sN,cN),{ApiUsageTierWithCurrenciesSchema:qN}=((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,of,BN),{ApiCreditSchemaItemSchema:zq}=((e,t,r)=>({ApiCreditSchemaItemSchema:e.union([t,r])}))(n,jq,Tq),{FeatureConfigOverrideSchema:ZN}=((e,t,r)=>({FeatureConfigOverrideSchema:e.strictObject({schema:e.array(t).optional(),markups:r.optional()})}))(n,Lq,dq),{ProductItemConfigSchema:Uq}=((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,gN,sf,cf,yN,pf,ZN),{BasePriceParamsSchema:ff}=((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."})}))(eq,al,n,ul),{PlanItemPriceParamsSchema:Vq}=((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,ul,qN,sl,io,af,kN),{ApiFeatureOverrideSchema:HN}=((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,zq,gq),{ApiPlanItemV1Schema:Bq}=((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,j=w.value.price?.interval_count??1;if(E&&I&&(String(E)!==String(I)||F!==j)&&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 Z of A(w.value.price))w.issues.push({code:"custom",message:Z,input:w.value.price})}})}))(n,TN,ol,ul,qN,sl,io,af,kN,ON,H0,K0,sf,cf,pf,HN,mN),{EntitlementSchema:qq}=((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,$9,hN,lN,yN,ZN),{ProductItemSchema:GN}=((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,F9,z9,TN,of,U9,V9,Mq,ul,sl,Uq),{ProductV2Schema:KN}=((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,rf,Z9,GN,df,aw,Ls),{PlanItemParamsObjectSchema:Zq}=((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,G0,ol,al,Vq,u9,sf,cf,K0,pf,HN),{FullProductWithoutLicensesSchema:ore}=((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()})}))(Dq,n,Eq,qq,uq,O9),{CreateProductItemParamsSchema:WN}=((e,t,r,i)=>({CreateProductItemParamsSchema:e.extend({included_usage:t.or(r.literal(i)).nullish()})}))(GN,G0,n,of),{CreatePlanItemParamsV1Schema:sw}=((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."})}))(Zq,iq),{LicenseCustomizeSchema:JN}=((e,t,r,i)=>({LicenseCustomizeSchema:e.object({price:t.nullable().optional(),add_items:e.array(r).optional(),remove_items:e.array(i).optional()})}))(n,ff,sw,Q0),{PlanLicenseParamsSchema:cw}=((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,JN),{UpdateProductV2ParamsSchema:are}=((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,lf,AN,WN,cw,xN,X0,mf,Ls),{CreatePlanParamsV1Schema:Hq}=((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,lf,ff,sw,cw,tw,X0,Fq,Ls),{UpdatePlanParamsV1Schema:sre}=((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."})})}))(Hq,n,ff,tw,lf),{CustomizePlanLicenseSchema:uw}=((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,JN),{CreateProductV2ParamsSchema:cre}=((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,lf,AN,WN,cw,xN,X0,mf,Ls,q9),{CustomizePlanV1BaseSchema:QN}=((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,ff,sw,Q0,m9,tw,mf,uw,b9),{VariantCustomizeSchema:Gq}=((e,t)=>({VariantCustomizeSchema:e(t.omit({items:!0}).strict(),{includeItems:!1,includeLicenses:!0})}))(MN,QN),{DiffedCustomizePlanV1Schema:ure}=((e,t)=>({DiffedCustomizePlanV1Schema:e(t.omit({items:!0}),{includeItems:!1,includeLicenses:!0})}))(MN,QN),{ApiPlanV1Schema:lre}=((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,ul,io,H0,ON,Bq,Aq,sq,rf,df,aw,Ls,cq,Gq)});var Kq,tD,lw,XN,nD,rD,Wq,Jq,eD,dw,gf,iD,yf,Qq,pw,Yq,oD,mw,hf,fw,mre,Xq,e8,aD,fre,sD,hre,bf=x(()=>{"use strict";J();Kq=n.string().min(1).regex(/^[a-zA-Z0-9_-]+$/),tD=n.enum(["single_use","continuous_use"]),lw=n.record(n.string(),n.union([n.string(),n.number(),n.boolean()]).transform(String).pipe(n.string())),XN=n.string().min(1).max(64).refine(e=>!e.includes("::")),nD={credit_amount:n.number(),tier_behavior:n.never().optional(),tiers:n.never().optional()},rD={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()}))},Wq=n.union([n.strictObject({match:lw,priority:n.number().int().optional(),...nD}),n.strictObject({match:lw,priority:n.number().int().optional(),...rD})]),Jq=n.strictObject({match:lw,factor:n.number().positive().optional(),add:n.number().optional()}).refine(e=>e.factor!==void 0||e.add!==void 0),eD={metered_feature_id:n.string(),feature_amount:n.number().optional(),dimensions:n.record(XN,Wq).optional(),multipliers:n.record(XN,Jq).optional()},dw=n.union([n.strictObject({...eD,...nD}),n.strictObject({...eD,...rD})]),gf=n.number().min(-100),iD=n.record(n.string(),n.strictObject({markup:gf})).nullish(),yf=n.record(n.string().regex(/.+\/.+/),n.strictObject({markup:gf.optional(),input_cost:n.number().min(0).optional(),output_cost:n.number().min(0).optional()})).nullish(),Qq=n.strictObject({default_markup:gf.optional(),provider_markups:iD,model_markups:yf}),pw=n.strictObject({schema:n.array(dw).optional(),markups:Qq.optional()}),Yq=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:tD}),oD=n.strictObject({schema:n.array(dw).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:tD.default("single_use").overwrite(()=>"single_use"),default_markup:gf.optional(),provider_markups:iD}),mw=oD.safeExtend({schema:n.array(dw).length(0)}),hf={id:Kq,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:yf,stripe_meter:n.strictObject({id:n.string(),event_name:n.string()}).nullish(),stripe_product_id:n.string().nullish()},fw=e=>n.discriminatedUnion("type",[n.strictObject({...hf,...e,type:n.literal("boolean"),config:n.null()}),n.strictObject({...hf,...e,type:n.literal("metered"),config:Yq}),n.strictObject({...hf,...e,type:n.literal("credit_system"),config:oD}),n.strictObject({...hf,...e,type:n.literal("ai_credit_system"),config:mw})]),mre=fw({}),Xq=n.strictObject({id:n.boolean(),type:n.boolean(),usage_type:n.boolean()}),e8={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:Xq},aD=fw(e8),fre=n.strictObject({rows:n.array(aD).max(200),nextCursor:n.uuid().nullable()}),sD=n.strictObject({features:n.array(aD).max(500),limited:n.boolean()}),hre=n.union([fw({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 Vn,$e,Af,hw,cD,da,uD,tn,lD,Ms,dD,t8,n8,r8,bre,_n=x(()=>{"use strict";J();Vn=n.string().regex(/^(0|[1-9]\d{0,12})(\.\d{1,12})?$/),$e=n.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/).transform(e=>e.includes(".")?e.replace(/0+$/,"").replace(/\.$/,""):e),Af=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}),hw=$e.refine(e=>/[1-9]/.test(e),"\u6570\u91CF\u5FC5\u987B\u5927\u4E8E 0"),cD=n.string().min(1).max(64),da=n.string().min(1).regex(/^[a-zA-Z0-9_-]+$/),uD=n.string().min(1).max(64).refine(e=>!e.includes("::"),"Dimension IDs cannot contain ::"),tn=n.record(cD,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)]))),lD=n.record(cD,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"),Ms=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},dD=n.array(n.object({upTo:hw.nullable(),cost:$e}).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&&Ms(t.upTo)>Ms(i))}),"\u9636\u68AF\u4E0A\u9650\u5FC5\u987B\u9012\u589E\uFF0C\u6700\u540E\u4E00\u6863\u4E3A\u65E0\u9650"),t8=n.object({key:uD,match:lD,priority:n.number().int().default(0),cost:$e.optional(),tiers:dD.optional()}).strict().refine(e=>e.cost!==void 0||e.tiers!==void 0,"\u7EF4\u5EA6\u9700\u8981\u6307\u5B9A\u5355\u4EF7\u6216\u9636\u68AF"),n8=n.object({key:uD,match:lD,factor:hw.optional(),add:Af.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"})),r8=n.object({units:hw.default("1"),cost:$e,tiers:dD.optional(),dimensions:n.array(t8).max(12).optional(),multipliers:n.array(n8).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=Ms(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=Ms(s),d=BigInt("1"),p=BigInt("0");for(let[m,g]of i.entries())c&1<<m&&(l*=Ms(g.factor??"1"),d*=BigInt("1000000"),p+=Ms(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"})}}),bre=r8.safeExtend({featureKey:da})});function gw(e,t){if(!Number.isInteger(t)||t<0||t>1e4)throw new Error("Invalid purchased pack quantity");let r=e.pricing?ll.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 Fs(e){return gw({amountMinor:e.unitAmountMinor,...e.pricing?{pricing:e.pricing}:{}},e.quantity)}var pD,ll,zs=x(()=>{"use strict";J();pD=n.number().int().min(0).max(1e8),ll=n.strictObject({kind:n.enum(["graduated","volume"]),tiers:n.array(n.strictObject({upTo:n.number().int().min(1).max(1e4).nullable(),unitAmountMinor:pD,flatAmountMinor:pD.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 mD(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 Vs(e,t,r){if(!Number.isSafeInteger(r)||r<0||r>1e4)throw new Error("Invalid purchased quantity");let i=mD(e)+mD(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 i8,Us,dl=x(()=>{"use strict";J();qt();_n();zs();i8=$e.refine(e=>/[1-9]/.test(e)),Us=n.strictObject({units:i8,prices:n.array(n.strictObject({currency:Te,amountMinor:n.number().int().min(0).max(1e8),pricing:ll.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&&gw({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 fD=x(()=>{"use strict"});function hD(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 xf(e,t,r){return r===2?hD(hD(e+t)+"")%1e4/1e4:null}function o8(e){return e<=0?[]:new Array(e).fill(1/e)}function Sf(e,t){return e>=t[0]&&e<t[1]}function gD(e,t){for(let[r,i]of t.entries())if(Sf(e,i))return r;return-1}function yD(e,t,r){t=t===void 0?1:t,t<0?t=0:t>1&&(t=1);let i=o8(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 bD(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 AD(e){try{return e()}catch{return!1}}function pl(e){return typeof e=="string"?e:JSON.stringify(e)}function mr(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 vf=x(()=>{"use strict"});function xD(e){try{let t=e.replace(/([^\\])\//g,"$1\\/");return new RegExp(t)}catch{return}}function ml(e,t){if(!t.length)return!1;let r=!1,i=!1;for(let o of t){let a=c8(e,o.type,o.pattern);if(o.include===!1){if(a)return!1}else r=!0,a&&(i=!0)}return i||!r}function a8(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 s8(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=>!a8(o[0],o[1],o[2]))}catch{return!1}}function c8(e,t,r){try{let i=new URL(e,"https://_");if(t==="regex"){let o=xD(r);return o?o.test(i.href)||o.test(i.href.substring(i.origin.length)):!1}else if(t==="simple")return s8(i,r);return!1}catch{return!1}}var yw=x(()=>{"use strict"});function bw(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 wf(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 SD(e){for(let t of["overrides","groups"])if(Object.hasOwn(e,t))throw new TypeError(`Retired evaluation context field: ${t}`);wf(e.savedGroups??{})}var _f=x(()=>{"use strict"});function vD(e,t,r,i){let o=u8(r),a=l8(r);e.setUint32(t,i?a:o,i),e.setUint32(t+4,i?o:a,i)}var u8,l8,wD=x(()=>{u8=e=>e/2**32|0,l8=e=>e>>>0});function _D(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function d8(e,t=""){if(typeof e!="number")throw new TypeError(Aw(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(Aw(t)+"expected integer >= 0, got "+e);return e}function If(e,t,r=""){if(_D(e)&&(t===void 0||e.length===t))return e;t!==void 0&&d8(t,"length");let i=_D(e),o=t!==void 0?` of length ${t}`:"",a=i?`length=${e.length}`:`type=${typeof e}`,s=Aw(r)+"expected Uint8Array"+o+", got "+a;throw i?new RangeError(s):new TypeError(s)}function xw(e,t=!0){if(e.destroyed)throw new Error("hash was destroyed");if(t&&e.finished)throw new Error("digest() was already called")}function kD(e,t){If(e,void 0,"output");let r=t.outputLen;if(!(e.length>=r))throw new RangeError('"output" expected length >= '+r)}function Sw(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function kf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function qr(e,t){return e<<32-t|e>>>t}function Bs(e){if(If(e),m8)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=f8[e[r]];return t}function h8(e,t,r="opts"){return ID(e,"defaults"),t!==void 0&&ID(t,r),Object.assign(Object.create(null),e,t)}function ED(e,t={}){if(typeof e!="function")throw new TypeError('"hashCons" expected function, got type='+typeof e);t=h8({},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 Aw,p8,ID,m8,f8,CD,qs=x(()=>{Aw=e=>e?`"${e}" `:"";p8=(e,t)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((t==="object"?"":`"${t}" `)+"expected object, got type="+typeof e)},ID=(e,t)=>{p8(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`)};m8=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",f8=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));CD=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})});function PD(e,t,r){return e&t^~e&r}function OD(e,t,r){return e&t^e&r^t&r}var Ef,TD,RD=x(()=>{wD();qs();Ef=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=kf(this.buffer)}update(t){xw(this),If(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=kf(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){xw(this),kD(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)),vD(i,o-8,this.length*8,a),this.process(i,0),this.roundClean();let c=t===r?i:kf(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()}},TD=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var g8,oo,vw,ww,Zs,Cf=x(()=>{RD();qs();g8=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]),oo=new Uint32Array(64),vw=class extends Ef{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)oo[p]=t.getUint32(r,!1);for(let p=16;p<64;p++){let h=oo[p-15],f=oo[p-2],m=qr(h,7)^qr(h,18)^h>>>3,g=qr(f,17)^qr(f,19)^f>>>10;oo[p]=g+oo[p-7]+m+oo[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=qr(c,6)^qr(c,11)^qr(c,25),f=d+h+PD(c,u,l)+g8[p]+oo[p]|0,g=(qr(i,2)^qr(i,13)^qr(i,22))+OD(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(){Sw(oo)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Sw(this.buffer)}},ww=class extends vw{constructor(){super(32,TD)}},Zs=ED(()=>new ww,CD(1))});function y8(e){return Bs(Zs(new TextEncoder().encode(String(e))))}function zD(e){let t=DD.get(e);return t||(t=new Set(e),DD.set(e,t)),t}function b8(e){let t=$D.get(e);return t||(t=new Set(e.map(Pf)),$D.set(e,t)),t}function Hs(e){wf(e);for(let t of Object.values(e)){let r=t?.type==="list"||t?.type==="hashed"?t.values:null;r&&r.length>=_w&&zD(r)}return e}function nr(e,t,r,i){r=r||{},i||wf(r),i=i||new Set;for(let[o,a]of Object.entries(t))switch(o){case"$or":if(!FD(e,a,r,i))return!1;break;case"$nor":if(FD(e,a,r,i))return!1;break;case"$and":if(!w8(e,a,r,i))return!1;break;case"$not":if(nr(e,a,r,i))return!1;break;case"$savedGroup":if(!A8(e,a,r,i))return!1;break;default:if(!fl(a,UD(e,o),r,!1,i))return!1}return!0}function A8(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=UD(e,u);return pa(s.type==="hashed"?Of(l):l,s.values)}return s.type==="condition"?!s.condition||typeof s.condition!="object"?!1:nr(e,s.condition,r,c):!1}function UD(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 jD(e,t=!1){let r=`${e}${t?"/i":""}`,i=ND.get(r);return i||(i=new RegExp(e.replace(/([^\\])\//g,"$1\\/"),t?"i":void 0),ND.set(r,i)),i}function fl(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)||!VD(e))return JSON.stringify(t)===JSON.stringify(e);let a=e;for(let s in a)if(!v8(s,t,a[s],r,o))return!1;return!0}function VD(e){let t=Object.keys(e);return t.length>0&&t.filter(r=>r[0]==="$").length===t.length}function x8(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 S8(e,t,r,i){if(!Array.isArray(e))return!1;let o=VD(t)?a=>fl(t,a,r,!1,i):a=>nr(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 pa(e,t,r=!1){if(r){let o;if(t.length>=_w){let a=b8(t);o=s=>{let c=Pf(s);return!(typeof c=="number"&&Number.isNaN(c))&&a.has(c)}}else o=a=>t.some(s=>Pf(a)===Pf(s));return Array.isArray(e)?e.some(a=>o(a)):o(e)}let i=t.length>=_w?(o=>a=>o.has(a))(zD(t)):o=>t.includes(o);return Array.isArray(e)?e.some(o=>i(o)):i(e)}function LD(e){return e===void 0?[]:e&&typeof e=="object"&&(e.type==="list"||e.type==="hashed")&&Array.isArray(e.values)?e.values:null}function MD(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(fl(t[a],e[c],r,i,o)){s=!0;break}if(!s)return!1}return!0}function v8(e,t,r,i,o=new Set){let a=t,s=r;switch(e){case"$veq":return mr(t)===mr(r);case"$vne":return mr(t)!==mr(r);case"$vgt":return mr(t)>mr(r);case"$vgte":return mr(t)>=mr(r);case"$vlt":return mr(t)<mr(r);case"$vlte":return mr(t)<=mr(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)?pa(t,r):!1;case"$ini":return Array.isArray(r)?pa(t,r,!0):!1;case"$inGroup":{let c=i[r],u=LD(c);return u===null?!1:pa(c?.type==="hashed"?Of(t):t,u)}case"$notInGroup":{let c=i[r],u=LD(c);return u===null?!1:!pa(c?.type==="hashed"?Of(t):t,u)}case"$nin":return Array.isArray(r)?!pa(t,r):!1;case"$nini":return Array.isArray(r)?!pa(t,r,!0):!1;case"$not":return!fl(r,t,i,!1,o);case"$size":return Array.isArray(t)?fl(r,t.length,i,!1,o):!1;case"$elemMatch":return S8(t,r,i,o);case"$all":return Array.isArray(r)?MD(t,r,i,!1,o):!1;case"$alli":return Array.isArray(r)?MD(t,r,i,!0,o):!1;case"$regex":try{return jD(r).test(t)}catch{return!1}case"$regexi":try{return jD(r,!0).test(t)}catch{return!1}case"$type":return x8(t)===r;default:return!1}}function FD(e,t,r,i){if(!t.length)return!0;for(let o of t)if(nr(e,o,r,i))return!0;return!1}function w8(e,t,r,i){for(let o of t)if(!nr(e,o,r,i))return!1;return!0}var ND,_w,DD,$D,Of,Pf,Iw=x(()=>{"use strict";_f();vf();Cf();qs();ND=new Map,_w=32,DD=new WeakMap,$D=new WeakMap;Of=e=>Array.isArray(e)?e.map(Of):typeof e=="string"||typeof e=="number"?y8(e):null,Pf=e=>typeof e=="string"?e.toLowerCase():e});function kw(e){return SD(e),{context:e,stack:{evaluatedFeatures:new Set}}}function Ew(e){return{...e.attributes,...e.attributeOverrides}}function ao(e,t,r){let i=t||"id",o="",a=Ew(e);return a[i]&&(o=a[i]),!o&&r&&(a[r]&&(o=a[r]),o&&(i=r)),{hashAttribute:i,hashValue:o}}function _t(e,t,r){e.context.log?.(t,r)}var Cw=x(()=>{"use strict";_f()});function Tf(e,t){return t=t||0,`${e}__${t}`}function Pw(e,t){return`${e}||${t}`}function _8(e,t,r){let i=e.stickyBucketAssignmentDocs;if(!i)return{};let{hashAttribute:o,hashValue:a}=ao(e,t),s=Pw(o,pl(a)),{hashAttribute:c,hashValue:u}=ao(e,r),l=u?Pw(c,pl(u)):null,d={};return l&&i[l]&&Object.assign(d,i[l].assignments||{}),i[s]&&Object.assign(d,i[s].assignments||{}),d}function BD({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=Tf(t,r),u=_8(e,i,o);if(a>0)for(let p=0;p<a;p++){let h=Tf(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 qD(e,t,r,i){let o=Pw(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 ZD=x(()=>{"use strict";Cw();vf()});function HD(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var GD=x(()=>{"use strict"});function Rf(e,t){let r=kw(t),i=WD(e,null,r);return t.onExperimentEval?.(e,i),i}function Pi(e,t){return Tw(e,kw(t))}function I8(e){return e.forcedVariations||{}}function KD(e,t,r){let{context:i}=e;if(i.trackedExperiments){let o=YD(t,r);if(i.trackedExperiments.has(o))return;i.trackedExperiments.add(o)}Ow(()=>i.onExperimentViewed?.(t,r))}function k8(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}Ow(()=>i.onFeatureUsage?.(t,r))}function Ow(e){try{let t=e();t&&typeof t.catch=="function"&&t.catch(()=>{})}catch{}}function Tw(e,t){let{context:r}=t;if(t.stack.evaluatedFeatures.has(e))return _t(t,`evalFeature: circular dependency detected: ${t.stack.id} -> ${e}`,{from:t.stack.id,to:e}),so(t,e,null,"cyclicPrerequisite");t.stack.evaluatedFeatures.add(e),t.stack.id=e;let i=r.features?.[e];for(let a of i?.rules??[])bw(a);let o=r.forcedFeatureValues;if(o&&o.has(e))return _t(t,"Global override",{id:e,value:o.get(e)}),so(t,e,o.get(e),"override");if(!i)return _t(t,"Unknown feature",{id:e}),so(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=Tw(l.id,t);if(d.source==="cyclicPrerequisite")return so(t,e,null,"cyclicPrerequisite");let p={value:d.value};if(!nr(p,l.condition||{},r.savedGroups||{})){if(l.gate)return _t(t,"Feature blocked by prerequisite",{id:e,rule:s}),so(t,e,null,"prerequisite");_t(t,"Skip rule because prerequisite evaluation fails",{id:e,rule:s});continue e}}if(s.filters&&QD(s.filters,t)){_t(t,"Skip rule because of filters",{id:e,rule:s});continue}if("force"in s){if(s.condition&&!JD(s.condition,t)){_t(t,"Skip rule because of condition ff",{id:e,rule:s});continue}if(!E8(t,s.seed||e,s.hashAttribute,r.saveStickyBucketAssignmentDoc&&!s.disableStickyBucketing?s.fallbackAttribute:void 0,s.range,s.coverage,s.hashVersion)){_t(t,"Skip rule because user not included in rollout",{id:e,rule:s});continue}return _t(t,"Force value from rule",{id:e,rule:s}),s.tracks&&s.tracks.forEach(l=>{KD(t,l.experiment,l.result)}),so(t,e,s.force,"force",s.id)}if(!s.variations){_t(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=WD(c,e,t);if(r.onExperimentEval?.(c,u),u.inExperiment&&!u.passthrough)return so(t,e,u.value,"experiment",s.id,c,u)}}return _t(t,"Use default value",{id:e,value:i.defaultValue}),so(t,e,i.defaultValue===void 0?null:i.defaultValue,"defaultValue")}function WD(e,t,r){let{context:i}=r;bw(e);let o=e.key,a=e.variations.length;if(a<2)return _t(r,"Invalid experiment",{id:o}),fn(r,e,-1,!1,t);if(i.enabled===!1)return _t(r,"Context disabled",{id:o}),fn(r,e,-1,!1,t);if(e.urlPatterns&&!ml(i.url||"",e.urlPatterns))return _t(r,"Skip because of url targeting",{id:o}),fn(r,e,-1,!1,t);let s=bD(o,i.url||"",a);if(s!==null)return _t(r,"Force via querystring",{id:o,variation:s}),fn(r,e,s,!1,t);let u=I8(i)[o];if(u!==void 0)return _t(r,"Force via dev tools",{id:o,variation:u}),fn(r,e,u,!1,t);if(e.active===!1)return _t(r,"Skip because inactive",{id:o}),fn(r,e,-1,!1,t);let{hashAttribute:l,hashValue:d}=ao(i,e.hashAttribute,i.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0);if(!d)return _t(r,"Skip because missing hashAttribute",{id:o}),fn(r,e,-1,!1,t);let p=-1,h=!1,f=!1;if(i.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{variation:A,versionIsBlocked:C}=BD(HD({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&&QD(e.filters,r))return _t(r,"Skip because of filters",{id:o}),fn(r,e,-1,!1,t);if(e.include&&!AD(e.include))return _t(r,"Skip because of include function",{id:o}),fn(r,e,-1,!1,t);if(e.condition&&!JD(e.condition,r))return _t(r,"Skip because of condition exp",{id:o}),fn(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=Tw(C.id,r);if(w.source==="cyclicPrerequisite")return fn(r,e,-1,!1,t);let E={value:w.value};if(!nr(E,C.condition||{},i.savedGroups||{}))return _t(r,"Skip because prerequisite evaluation fails",{id:o}),fn(r,e,-1,!1,t)}}}let m=xf(e.seed||o,d,e.hashVersion??2);if(m===null)return _t(r,"Skip because of invalid hash version",{id:o}),fn(r,e,-1,!1,t);if(!h){let A=e.ranges||yD(a,e.coverage===void 0?1:e.coverage,e.weights);p=gD(m,A)}if(f)return _t(r,"Skip because sticky bucket version is blocked",{id:o}),fn(r,e,-1,!1,t,void 0,!0);if(p<0)return _t(r,"Skip because of coverage",{id:o}),fn(r,e,-1,!1,t);if("force"in e)return _t(r,"Force variation",{id:o,variation:e.force}),fn(r,e,e.force===void 0?-1:e.force,!1,t);if(i.qaMode)return _t(r,"Skip because QA mode",{id:o}),fn(r,e,-1,!1,t);let g=fn(r,e,p,!0,t,m,h);if(i.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing){let{changed:A,key:C,doc:w}=qD(i,l,pl(d),{[Tf(e.key,e.bucketVersion)]:g.key});if(A){i.stickyBucketAssignmentDocs=i.stickyBucketAssignmentDocs||{},i.stickyBucketAssignmentDocs[C]=w;let E=i.saveStickyBucketAssignmentDoc;Ow(()=>E(w))}}return KD(r,e,g),_t(r,"In experiment",{id:o,variation:g.variationId}),g}function so(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"&&k8(e,t,c),c}function JD(e,t){return nr(Ew(t.context),e,t.context.savedGroups||{})}function QD(e,t){return e.some(r=>{let{hashValue:i}=ao(t.context,r.attribute);if(!i)return!0;let o=xf(r.seed,i,r.hashVersion||2);return o===null?!0:!r.ranges.some(a=>Sf(o,a))})}function E8(e,t,r,i,o,a,s){if(!o&&a===void 0)return!0;if(!o&&a===0)return!1;let{hashValue:c}=ao(e.context,r,i);if(!c)return!1;let u=xf(t,c,s??2);return u===null?!1:o?Sf(u,o):a!==void 0?u<=a:!0}function fn(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}=ao(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 YD(e,t){return t.hashAttribute+t.hashValue+e.key+t.variationId}var XD=x(()=>{"use strict";GD();_f();Iw();Cw();vf();ZD();yw()});var hl=x(()=>{"use strict";fD();yw();Iw();XD();});function Oi(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 Re,nn,C8,Bn,P8,O8,Nw,e$,T8,Rw,R8,N8,mie,D8,$8,j8,L8,gl,fie,hie,Zt=x(()=>{"use strict";J();hl();Re=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"})}),nn=n.record(n.string().min(1).max(128),Re).superRefine((e,t)=>{(!Re.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"})}),C8=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"]),Bn=nn.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("$")&&!C8.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)}),P8=n.discriminatedUnion("type",[n.strictObject({type:n.literal("condition"),condition:Bn}),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");O8=n.record(n.uuid(),P8).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"&&Oi(s.condition).forEach(o),r.delete(a),i.add(a)}Object.keys(e).forEach(o)}),Nw=n.tuple([n.number().min(0).max(1),n.number().min(0).max(1)]).refine(([e,t])=>e<=t),e$=n.strictObject({attribute:n.string().optional(),seed:n.string().min(1),hashVersion:n.literal(2),ranges:n.array(Nw).min(1).max(100)}),T8=n.strictObject({id:n.string().min(1).max(128),condition:Bn,gate:n.boolean().optional()}),Rw={id:n.string().max(128).optional(),condition:Bn.optional(),parentConditions:n.array(T8).max(50).optional(),filters:n.array(e$).max(20).optional()},R8=n.union([n.strictObject({...Rw}),n.strictObject({...Rw,force:Re,coverage:n.number().min(0).max(1).optional(),range:Nw.optional(),seed:n.string().min(1).optional(),hashAttribute:n.string().optional(),hashVersion:n.literal(2).optional()}),n.strictObject({...Rw,type:n.literal("experiment-ref"),experimentId:n.uuid(),values:n.record(n.string().min(1),Re),meta:n.record(n.string().min(1),n.strictObject({passthrough:n.boolean()})).optional()})]),N8=n.strictObject({defaultValue:Re,rules:n.array(R8).max(100)}),mie=n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/),N8).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)}),D8=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:Bn,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(Nw).min(1)}).nullable(),seed:n.string().min(1).max(128)}),$8=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(D8).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"})}),j8=$8.safeExtend({filters:n.array(e$).optional()}),L8=n.strictObject({experiments:n.record(n.uuid(),j8),savedGroups:O8}),gl=n.strictObject({attributeName:n.string(),attributeValue:n.string(),assignments:n.record(n.string(),n.string())}),fie=n.strictObject({snapshot:L8,attributes:nn,results:nn,stickyBucketAssignmentDocs:n.record(n.string(),gl)}),hie=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 co(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 Dw=x(()=>{"use strict"});function $w(e,t={},r=new Set){if(co(e).some(t$))return!0;for(let i of Oi(e)){if(r.has(i))continue;r.add(i);let o=t[i];if(o?.type==="list"&&t$(o.attributeKey)||o?.type==="condition"&&$w(o.condition,t,r))return!0}return!1}var M8,F8,z8,Sie,n$,vie,wie,_ie,t$,Nf=x(()=>{"use strict";J();Zt();Dw();M8=n.enum(["active","inactive"]),F8=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},nn),z8=n.strictObject({id:n.string().trim().min(1).max(255),name:n.string().trim().min(1).max(255),status:M8,metadata:F8}),Sie=z8.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})}),n$=n.union([n.strictObject({id:n.string().trim().min(1).max(255)}),n.strictObject({internalId:n.uuid()})]),vie=n.enum(["customer","merchandise","context"]),wie=n.enum(["system","stored","request"]),_ie=n.enum(["customer","merchandise","mixed"]),t$=e=>e==="merchandiseId"||e==="merchandise"||e.startsWith("merchandise.")});function o$(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 i$.test(a)?a:null}catch{return null}}function r$(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&&U8.has(a)?"zh-Hant":"zh-Hans"}function jw(e,t,r){let i=t.map(o=>({code:qn.parse(o),normalized:o}));for(let o of e){let a=o$(o);if(!a)continue;let s=i.find(d=>d.normalized===a);if(s)return s.code;let c=r$(a),u=i.filter(d=>r$(d.normalized)===c),l=u.find(d=>!d.normalized.includes("-")||d.normalized===c)??u[0];if(l)return l.code}return r}var i$,qn,U8,Gs=x(()=>{"use strict";J();i$=/^[a-z]{2,3}(-[A-Z][a-z]{3})?(-([A-Z]{2}|[0-9]{3}))?$/,qn=n.string().max(16).regex(i$,"\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");U8=new Set(["TW","HK","MO"])});var a$=x(()=>{"use strict"});var Nie,uo,fr,s$,V8,Lw,B8,Die,$ie,yl,c$,lo=x(()=>{"use strict";J();Nf();Zt();qt();Nie=n.enum(["draft","active","paused","archived"]),uo=n.discriminatedUnion("type",[n.object({type:n.literal("percent"),percentOff:n.number().min(1).max(100).multipleOf(.01)}).strict(),n.object({type:n.literal("amount"),amountOffCents:n.number().int().min(1).max(1e8),currency:Te}).strict()]),fr=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()]),s$=[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()],V8=n.discriminatedUnion("type",[...s$,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:Bn})])})]),Lw=n.discriminatedUnion("type",[...s$,n.strictObject({type:n.literal("merchandise"),scope:n.strictObject({type:n.enum(["all","selected","condition"])})})]),B8=n.strictObject({firstPurchaseOnly:n.boolean(),condition:Bn}),Die=n.object({name:n.string().trim().min(1).max(80),description:n.string().max(500),discount:uo,duration:fr,appliesTo:V8,eligibility:B8,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=>!$w(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"]}),$ie=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:Te.nullable()}).strict().refine(e=>e.minimumAmountCents===null==(e.minimumAmountCurrency===null),"Minimum amount requires its currency"),yl=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:uo,duration:fr,appliesTo:Lw}).strict()}).strict(),c$=n.enum(["claim_disabled","unavailable","inactive","outside_window","not_targeted","not_first_purchase","limit_reached","sold_out"])});function f$(e){return e.pricing.kind==="flat"&&ma(e.pricing.units)>0n&&ma(e.pricing.unitAmountMinor)===ma(e.pricing.units)*BigInt(10**$0(e.currency))}var m$,Mw,Ks,q8,bl,Ti,Pn,ma,Z8,H8,G8,po,u$,h$,g$,l$,y$,Df,b$,A$,x$,S$,K8,d$,W8,v$,J8,Q8,Y8,w$,Fw,X8,Al,_$,I$,k$,E$,p$,e7,C$,P$,xl=x(()=>{"use strict";J();lo();qt();_n();m$=n.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,6})?$/),Mw=n.string().regex(/^(0|[1-9]\d{0,14})$/),Ks=n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,30})?$/),q8=n.string().regex(/^(?:[1-9]\d{0,7}|1\d{8}|200000000)$/),bl=q8,Ti=$e.refine(e=>/[1-9]/.test(e)),Pn=n.iso.datetime({offset:!0}),ma=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"))},Z8=n.array(n.object({upTo:Ti.nullable(),unitAmountMinor:m$,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&&ma(t.upTo)>ma(i))})}catch{return!1}},"Tier ceilings must increase and the final tier must be unbounded"),H8=n.discriminatedUnion("kind",[n.object({kind:n.literal("flat"),units:Ti,unitAmountMinor:m$}).strict(),n.object({kind:n.enum(["graduated","volume"]),units:Ti,tiers:Z8}).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"),G8=n.strictObject({interval:n.enum(["month","year"]),count:n.number().int().min(1).max(12),anchor:n.enum(["membership","calendar"])}),po=n.object({currency:Te,pricing:H8,billingCycle:G8.optional()}).strict().refine(e=>e.pricing.kind!=="volume"||e.pricing.tiers.length===1,"Multiple volume tiers require prepaid billing");u$={requestId:n.uuid(),productVersionId:n.uuid(),internal_feature_id:n.uuid(),currency:Te},h$=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)}),g$=n.discriminatedUnion("kind",[n.object({...u$,kind:n.literal("auto_topup"),threshold:Af,quantity:Ti.refine(e=>Number(e)>=1,"AutoTopup quantity must be at least 1"),purchaseLimit:h$.optional()}).strict(),n.object({...u$,kind:n.literal("postpaid"),maxAmountMinorPerPeriod:bl,maxOutstandingMinor:bl}).strict()]),l$={productVersionId:n.uuid(),internal_feature_id:n.uuid(),currency:Te},y$=n.discriminatedUnion("kind",[n.object({...l$,kind:n.literal("auto_topup"),threshold:Af,quantity:Ti.refine(e=>Number(e)>=1,"AutoTopup quantity must be at least 1"),purchaseLimit:h$.optional(),purchaseAmountMinor:bl,purchaseUnits:Ti}).strict(),n.object({...l$,kind:n.literal("postpaid"),maxAmountMinorPerPeriod:bl,maxOutstandingMinor:bl,cashPrice:po}).strict().refine(e=>e.cashPrice.currency===e.currency,"Currency must match")]),Df=n.object({id:n.uuid(),terms:y$,status:n.enum(["prepared","active","revoked","blocked"]),createdAt:Pn,acceptedAt:Pn.nullable(),effectiveAt:Pn.nullable(),revokedAt:Pn.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"),b$=n.object({authorizationId:n.uuid(),terms:y$,setupUrl:n.url().nullable()}).strict(),A$=n.object({authorizationId:n.uuid(),accepted:n.literal(!0)}).strict(),x$=n.object({authorizationId:n.uuid(),requestId:n.uuid()}).strict(),S$=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:tn.optional(),limit:$e.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(Ti).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&&ma(t)>ma(o)}),"Notification thresholds must increase"),K8=S$.safeExtend({requestId:n.uuid()}),d$={control:n.literal("overage"),requestId:n.uuid(),internal_feature_id:n.uuid(),entityId:n.uuid().nullable()},W8=n.discriminatedUnion("action",[n.strictObject({...d$,action:n.literal("set"),allowed:n.boolean().nullable(),overageLimit:$e.nullable(),skipOverageBilling:n.boolean()}),n.strictObject({...d$,action:n.literal("remove")})]),v$=n.union([K8,W8]),J8=n.strictObject({internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),allowed:n.boolean().nullable(),overageLimit:$e.nullable(),skipOverageBilling:n.boolean(),interval:n.enum(["day","week","month","year"]),startsAt:Pn,endsAt:Pn,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()}),Q8=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:tn.optional(),startsAt:Pn,endsAt:Pn,used:Vn,reserved:Vn,limit:$e.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(Ti).max(8).optional(),notifiedAbsoluteThresholds:n.array(Ti).max(1024).optional()}).strict().refine(e=>e.basis!=="usage"||$e.safeParse(e.used).success&&$e.safeParse(e.reserved).success,"Usage counters retain six decimals; credit costs retain twelve"),Y8=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:Pn.nullable(),attemptCount:n.number().int().nonnegative(),failedAttemptCount:n.number().int().nonnegative(),suspendedAt:Pn.nullable(),nextAttemptAt:Pn.nullable(),failureReason:n.string().min(1).max(240).nullable()}).strict(),w$=n.object({internal_feature_id:n.uuid().optional(),entityId:n.uuid().optional()}).strict(),Fw=n.object({authorizations:n.array(Df).max(100),limits:n.array(S$).max(100),overages:n.array(J8).max(100).optional(),windows:n.array(Q8).max(200),autoTopups:n.array(Y8).max(100),limited:n.boolean()}).strict(),X8=n.object({id:n.uuid(),internal_feature_id:n.uuid(),productVersionId:n.uuid(),authorizationId:n.uuid(),entityId:n.uuid().nullable(),units:$e,amountMinor:Ks,cashPrice:po}).strict(),Al=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:Te,startsAt:Pn.nullable(),endsAt:Pn.nullable(),amountMinor:n.string().regex(/^-?(0|[1-9]\d{0,14})$/),grossAmountMinor:n.string().regex(/^-?(0|[1-9]\d{0,14})$/),discountMinor:Mw,paidAmountMinor:Mw,refundedAmountMinor:Mw,createdAt:Pn,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:Pn.nullable(),reason:n.string().min(1).max(500).optional()}).strict().nullable(),lines:n.array(X8).max(100),linesLimited:n.boolean()}).strict(),_$=n.object({invoiceId:n.uuid(),accepted:n.literal(!0)}).strict(),I$=n.strictObject({requestId:n.uuid(),originalInvoiceId:n.uuid(),amountMinor:n.string().regex(/^[1-9]\d{0,8}$/).refine(e=>/^[1-9]\d{0,8}$/.test(e)&&BigInt(e)<=200000000n,"Supplemental amount exceeds the bounded minor amount"),reason:n.string().trim().min(1).max(500)}),k$=n.object({after:n.uuid().nullable(),limit:n.number().int().min(1).max(100)}).strict(),E$=n.object({rows:n.array(Al).max(100),nextCursor:n.uuid().nullable()}).strict(),p$=n.strictObject({id:n.string(),coupon:n.string(),start:n.number().nonnegative(),end:n.number().nullable()}),e7=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(p$).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:p$.optional()})).max(20)})).max(100)}),C$=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")}),P$=n.strictObject({membershipId:n.uuid(),operationId:n.uuid(),status:n.enum(["pending","effective"]),execution:e7.nullable(),grants:n.array(n.strictObject({id:n.uuid(),couponId:n.uuid(),name:n.string(),discount:uo,duration:fr,startedAt:Pn.nullable()})).max(20)})});var Sl,vl,fa,$f=x(()=>{"use strict";J();_n();Sl=n.enum(["minute","hour","day","week","month","quarter","semi_annual","year","lifetime"]),vl=n.number().int().min(1).max(1e3),fa=n.object({cap:$e.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 zw,t7,jf,n7,Uw,O$,T$,R$,r7,i7,eoe,toe,o7,noe,roe,N$=x(()=>{"use strict";YN();bf();dl();J();nf();qt();xl();$f();_n();zw={key:la,name:n.string().trim().min(1).max(80),description:n.string().trim().max(240)},t7=$e.refine(e=>/[1-9]/.test(e)),jf=n.array(n.object({currency:Te,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"),n7=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:$e.nullable(),reset:Sl,resetCount:vl,pooled:n.boolean(),rollover:fa.nullable().optional(),cashPrice:po.nullable().optional(),prepaidPrice:Us.optional(),feature_override:pw.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 Vs(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:$e,reset:Sl,resetCount:vl,rollover:fa.nullable(),pooled:n.boolean(),feature_override:pw.nullish(),cashPrice:po.nullable().optional()}).strict().refine(e=>!e.cashPrice||e.reset!=="lifetime"&&!e.rollover&&!e.pooled&&f$(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")]),Uw=n.array(n7).max(100).refine(e=>new Set(e.map(t=>t.internal_feature_id)).size===e.length,"An entitlement can be granted once per product"),O$=n.object({days:n.number().int().min(1).max(730),cardRequired:n.boolean(),allowances:Uw}).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"),T$=n.object({key:la,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:jf,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"),R$=n.discriminatedUnion("kind",[n.object({...zw,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:jf,allowances:Uw,trial:O$.nullable(),licenses:n.array(T$).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({...zw,kind:n.literal("topup"),interval:n.literal("one_time"),prices:jf,internal_feature_id:n.uuid(),amount:t7,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")]),r7=n.object({interval:n.enum(["free","week","month","year","one_time"]).optional(),intervalCount:n.number().int().min(1).max(156).nullable().optional(),prices:jf.optional(),allowances:n.object({upsert:Uw,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:O$.nullable().optional(),licenses:n.array(T$).max(20).optional()}).strict(),i7=n.object({...zw,kind:n.literal("variant"),baseProductVersionId:n.uuid(),overrides:r7}).strict(),eoe=n.union([R$,i7]),toe=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(),o7=KN.and(n.object({internal_id:n.uuid(),revision:n.number().int().nonnegative(),licenses:n.array(uw)})),noe=n.strictObject({rows:n.array(o7).max(200),nextCursor:n.uuid().nullable()}),roe=n.object({groups:n.array(n.object({id:n.uuid(),name:n.string(),defaultProductVersionId:n.uuid().nullable()}).strict()).max(500),features:sD.shape.features,products:n.array(n.object({id:n.uuid(),productId:n.uuid(),version:n.number().int().positive(),configuration:R$,baseProductVersionId:n.uuid().nullable()}).strict()).max(500),limited:n.boolean()}).strict()});var D$,Vw=x(()=>{"use strict";zs();J();dl();D$=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:Us,pricing:ll.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{Vs(e.includedAmount,e.terms.units,e.quantity),Fs({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 $$(e,t){let r=e.reduce((i,o)=>i+hr(o.units,12),0n)-hr(t,12);return e.some(i=>i.funding==="balance")?r>=-100n&&r<=100n:r===0n}var ha,wl,Lf,hr,_l,Il,Bw,ga,j$,Mf,L$,kl,Ws=x(()=>{"use strict";J();_n();ha=$e.refine(e=>/[1-9]/.test(e),"Quantity must be positive"),wl=n.string().min(1).max(120),Lf=n.enum(["cap","overflow"]),hr=(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"))},_l=e=>{try{return e()}catch{return!1}},Il=n.discriminatedUnion("operation",[n.object({operation:n.literal("quote"),overageBehavior:Lf.optional(),internal_feature_id:n.uuid(),entityId:n.uuid().optional(),quantity:ha,properties:tn}).strict(),n.object({operation:n.literal("consume"),overageBehavior:Lf.optional(),occurredAt:n.iso.datetime({offset:!0}).optional(),internal_feature_id:n.uuid(),entityId:n.uuid().optional(),quantity:$e,properties:tn,idempotencyKey:wl}).strict(),n.object({operation:n.literal("reserve"),occurredAt:n.iso.datetime({offset:!0}).optional(),internal_feature_id:n.uuid(),entityId:n.uuid().optional(),quantity:ha,properties:tn,idempotencyKey:wl,expiresInSeconds:n.number().int().min(1).max(86400)}).strict(),n.object({operation:n.literal("confirm"),operationId:n.uuid(),quantity:ha,properties:tn.optional(),idempotencyKey:wl}).strict(),n.object({operation:n.literal("refund"),operationId:n.uuid(),quantity:ha,idempotencyKey:wl}).strict(),n.object({operation:n.literal("release"),operationId:n.uuid(),idempotencyKey:wl}).strict()]),Bw=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:$e,units:ha,amount:Vn,tier:n.number().int().min(1).max(12).nullable()}).strict(),ga=n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,12})?$/);j$=n.discriminatedUnion("funding",[n.strictObject({funding:n.literal("balance"),sourceId:n.uuid(),rolloverId:n.uuid().nullable(),units:ga.refine(e=>/[1-9]/.test(e)),amount:Vn}),n.strictObject({funding:n.literal("unbilled"),units:ga.refine(e=>/[1-9]/.test(e))}),n.object({funding:n.literal("prepaid"),sourceId:n.uuid(),units:ha,amount:Vn,pricing:n.array(Bw).min(1).max(12)}).strict().refine(e=>_l(()=>e.pricing.reduce((t,r)=>t+hr(r.units,6),0n)===hr(e.units,6)&&e.pricing.reduce((t,r)=>t+hr(r.amount,12),0n)===hr(e.amount,12)&&e.pricing.every(t=>hr(t.unitCost,6)*hr(t.units,6)===hr(t.amount,12))),"Frozen pricing must conserve allocated units and amounts"),n.object({funding:n.literal("postpaid"),invoiceLineId:n.uuid().nullable(),units:ha,authorizationId:n.uuid()}).strict()]),Mf=n.enum(["unavailable","insufficient_balance","limit_exceeded","awaiting_topup","authorization_required","payment_blocked","cash_budget_exceeded"]),L$=n.object({allowed:n.boolean(),internal_feature_id:n.uuid(),quantity:$e,requestedQuantity:$e.optional(),overageBehavior:Lf.optional(),reason:Mf.nullable(),allocations:n.array(j$).max(500)}).strict().refine(e=>_l(()=>e.allowed?e.reason===null&&$$(e.allocations,e.quantity):e.reason!==null&&e.allocations.length===0),"A quote must conserve its accepted units").refine(e=>_l(()=>e.overageBehavior===void 0?e.requestedQuantity===void 0&&/[1-9]/.test(e.quantity):e.requestedQuantity!==void 0&&hr(e.requestedQuantity,6)>=hr(e.quantity,6)&&(e.overageBehavior==="cap"||e.requestedQuantity===e.quantity)),"Explicit overage behavior must retain the requested quantity"),kl=n.object({id:n.uuid(),internal_feature_id:n.uuid(),kind:n.enum(["consume","reserve","confirm","refund","release","expire"]),originalId:n.uuid().nullable(),quantity:$e,requestedQuantity:$e.optional(),overageBehavior:Lf.optional(),accepted:n.boolean(),reason:n.enum([...Mf.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(j$).max(500)}).strict().refine(e=>_l(()=>e.accepted?e.reason===null&&$$(e.allocations,e.quantity):e.reason!==null&&e.allocations.length===0),"An operation must conserve its requested units").refine(e=>_l(()=>e.overageBehavior===void 0?e.requestedQuantity===void 0:e.kind==="consume"&&e.requestedQuantity!==void 0&&hr(e.requestedQuantity,6)>=hr(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 ya,M$,F$,a7,z$,qw,U$,V$,Zw=x(()=>{"use strict";J();_n();$f();ya=n.iso.datetime({offset:!0}),M$=$e.refine(e=>/[1-9]/.test(e)),F$=n.strictObject({interval:Sl.exclude(["lifetime"]),count:vl}),a7=n.strictObject({action:n.literal("create"),requestId:n.uuid(),internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),amount:M$.nullable(),expiresAt:ya.nullable(),reset:F$.nullable(),rollover:fa.nullable(),nextResetAt:ya.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"),z$=n.discriminatedUnion("action",[a7,n.strictObject({action:n.literal("update"),requestId:n.uuid(),grantId:n.uuid(),revision:n.number().int().nonnegative(),amount:M$.nullable(),expiresAt:ya.nullable(),rollover:fa.nullable(),nextResetAt:ya.nullable()}),n.strictObject({action:n.enum(["add","subtract","set_remaining"]),requestId:n.uuid(),grantId:n.uuid(),revision:n.number().int().nonnegative(),amount:$e}),n.strictObject({action:n.literal("revoke"),requestId:n.uuid(),grantId:n.uuid(),revision:n.number().int().nonnegative()})]),qw=n.strictObject({id:n.uuid(),internal_feature_id:n.uuid(),entityId:n.uuid().nullable(),amount:$e.nullable(),reset:F$.nullable(),rollover:fa.nullable(),nextResetAt:ya.nullable(),startsAt:ya,expiresAt:ya.nullable(),revision:n.number().int().nonnegative(),revoked:n.boolean(),available:Vn,held:Vn,spent:Vn}),U$=n.strictObject({customerId:n.uuid(),after:n.uuid().nullable(),limit:n.number().int().min(1).max(100)}),V$=n.strictObject({rows:n.array(qw).max(100),nextCursor:n.uuid().nullable()})});var pi,B$,s7,q$,c7,Hw,Z$,Gw=x(()=>{"use strict";J();xl();_n();Ws();pi=n.iso.datetime({offset:!0}),B$=n.strictObject({invoiceId:n.uuid(),after:n.string().min(1).max(180).nullable(),limit:n.number().int().min(1).max(100)}),s7=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:pi.nullable(),endsAt:pi.nullable(),providerLineId:n.string().nullable(),providerItemId:n.string()}),q$=n.strictObject({invoice:Al,items:n.array(n.discriminatedUnion("kind",[s7,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:$e,reserved:$e,amountMinor:Ks,grossAmountMinor:Ks,creditsAppliedMinor:Ks,properties:tn,cashPrice:po,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:$e,reserved:$e,amountMinor:Ks,cashPrice:po})])).max(100),nextCursor:n.string().min(1).max(180).nullable()}),c7=n.string().regex(/^-?(0|[1-9]\d{0,17})(\.\d{1,12})?$/).refine(e=>!/^\-0(?:\.0+)?$/.test(e)),Hw=n.strictObject({from:pi,to:pi,entityId:n.uuid().optional(),snapshotAt:pi.nullable(),after:n.strictObject({at:pi,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"),Z$=n.strictObject({customerId:n.uuid(),entityId:n.uuid().nullable(),from:pi,to:pi,snapshotAt:pi,totals:n.array(n.strictObject({internal_credit_feature_id:n.uuid(),name:n.string(),consumed:Vn,refunded:Vn,net:c7})).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:pi,internal_feature_id:n.uuid(),entitlementName:n.string(),sourceId:n.uuid(),internal_credit_feature_id:n.uuid(),creditName:n.string(),units:ga,amount:Vn,pricing:n.array(Bw).max(12),properties:tn})).max(100),nextCursor:Hw.shape.after})});var u7,l7,Ff,H$,El,zf=x(()=>{"use strict";J();_n();u7=n.string().max(40).regex(/^(0|[1-9]\d*)(\.\d{1,12})?$/),l7=n.string().max(41).regex(/^-?(0|[1-9]\d*)(\.\d{1,12})?$/),Ff=n.strictObject({internal_feature_id:n.uuid(),entityId:n.uuid().nullable()}),H$=Ff.extend({quantity:$e,expectedRevision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER),idempotencyKey:n.string().min(1).max(120),properties:tn.refine(e=>Object.keys(e).length<=13&&!Object.keys(e).some(t=>t.startsWith("usage_")),"Usage accounting reserves three properties")}).strict(),El=Ff.extend({operationId:n.uuid().nullable(),usage:$e,capacity:u7.nullable(),remaining:l7.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 On,Zr,d7,Cl,G$,K$,Uf,W$,Js,p7,J$,Pl=x(()=>{"use strict";J();qt();_n();Ws();zf();On=n.string().regex(/^(0|[1-9]\d{0,17})(\.\d{1,12})?$/),Zr=n.iso.datetime({offset:!0}),d7=n.enum(["access","metered","credit"]),Cl={internal_feature_id:n.uuid(),key:da,name:n.string().min(1).max(120),kind:d7},G$=n.object({customerId:n.uuid(),snapshotAt:Zr,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:Zr,benefitsAppliedAt:Zr.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:Zr,endsAt:Zr.nullable()}).strict().nullable()}).strict()).max(100),membershipsLimited:n.boolean(),balances:n.array(n.object({...Cl,usageType:n.enum(["consumable","non_consumable"]).nullable(),accessible:n.boolean(),unlimited:n.boolean(),available:On,held:On,debt:On,nextExpiresAt:Zr.nullable(),usage:El.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(),K$=n.enum(["source","usage","transaction","invoice","debt","settlement"]),Uf=n.object({at:Zr,id:n.uuid(),type:K$}).strict(),W$=n.object({type:K$.nullable(),resourceKey:da.optional(),kind:n.enum(["purchase","refund"]).optional(),topup:n.boolean().optional(),from:n.iso.date().nullable(),to:n.iso.date().nullable(),after:Uf.nullable(),limit:n.number().int().min(1).max(50)}).strict().refine(e=>!e.from||!e.to||e.from<=e.to,"Date range is reversed"),Js={id:n.uuid(),occurredAt:Zr},p7=n.discriminatedUnion("type",[n.strictObject({...Js,type:n.literal("invoice"),status:n.string().min(1).max(80),paid:On,refunded:On,currency:Te,externalId:n.string().nullable()}),n.object({...Js,...Cl,type:n.literal("source"),reason:n.enum(["membership","trial","topup","manual","rollover","upgrade_carry","seat"]),quantity:On,unlimited:n.boolean(),status:n.enum(["scheduled","active","expired","revoked","unavailable"]),startsAt:Zr,expiresAt:Zr.nullable(),orderId:n.uuid().nullable(),parentSourceId:n.uuid().nullable()}).strict(),n.object({...Js,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:$e,accepted:n.boolean(),reason:n.enum([...Mf.options,"expired"]).nullable(),properties:tn,reservationStatus:n.enum(["pending","confirmed","released","expired"]).nullable(),expiresAt:Zr.nullable(),charges:n.array(n.discriminatedUnion("funding",[n.strictObject({funding:n.literal("balance"),sourceId:n.uuid(),rolloverId:n.uuid().nullable(),units:ga,amount:On}),n.strictObject({funding:n.literal("unbilled"),units:ga}),n.object({...Cl,funding:n.literal("prepaid"),amount:On}).strict(),n.object({funding:n.literal("postpaid"),invoiceId:n.uuid(),invoiceLineId:n.uuid(),authorizationId:n.uuid(),units:$e,currency:Te}).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({...Js,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:Te.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({...Js,...Cl,type:n.literal("debt"),sourceId:n.uuid(),transactionId:n.uuid(),amount:On}).strict(),n.object({...Js,...Cl,type:n.literal("settlement"),sourceId:n.uuid(),debtId:n.uuid(),kind:n.enum(["payment","usage_refund","payment_return"]),amount:On}).strict()]),J$=n.object({customerId:n.uuid(),rows:n.array(p7).max(50),nextCursor:Uf.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 Y$,X$,Ol,Kw,Ww,Q$,Jw,Qw=x(()=>{"use strict";J();Y$=n.object({customerId:n.uuid()}).strict(),X$=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()]),Ol=n.number().int().nonnegative(),Kw=n.iso.datetime({offset:!0}),Ww=n.strictObject({internalId:n.uuid(),id:n.string(),name:n.string().nullable(),version:n.number().int().positive()}),Q$=n.enum(["active","past_due"]),Jw=n.strictObject({customerId:n.uuid(),licenses:n.array(n.strictObject({id:n.uuid(),linkId:n.uuid(),parent:n.strictObject({customerProductId:n.uuid(),status:Q$,product:Ww}),product:Ww,planLicense:n.strictObject({id:n.uuid(),prepaidOnly:n.boolean(),isCustom:n.boolean()}).nullable(),granted:Ol,included:Ol,paidQuantity:Ol,usage:Ol,remaining:Ol,createdAt:Kw}).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:Q$,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:Kw.nullable(),endedAt:Kw.nullable()}).refine(e=>e.entity!==null||e.beneficiary!==null,"A seat assignment has a holder")).max(1e4),limited:n.boolean()})});var Tl,Noe,Doe,m7,f7,h7,g7,y7,b7,A7,ej,tj,x7,S7,$oe,nj,rj,ij,joe,Yw=x(()=>{"use strict";J();Tl=n.enum(["email","sms","voice","push"]),Noe=n.enum(["resend","twilio","fcm","apns"]),Doe=n.string().regex(/^\+[1-9]\d{1,14}$/),m7=n.enum(["email_recipient","sms_segment","voice_second","push_device"]),f7=n.string().trim().min(1).max(200).refine(e=>!/[\r\n\0]/.test(e),"Invalid email header"),h7=n.strictObject({subject:f7,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"}),g7=n.strictObject({body:n.string().min(1).max(1600).refine(e=>e.trim().length>0)}),y7=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)}),b7=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"),A7=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:b7.optional()}).refine(e=>new TextEncoder().encode(JSON.stringify(e)).length<=3072,"Push content exceeds the provider payload budget"),ej=n.discriminatedUnion("channel",[n.strictObject({channel:n.literal("email"),content:h7}),n.strictObject({channel:n.literal("sms"),content:g7}),n.strictObject({channel:n.literal("voice"),content:y7}),n.strictObject({channel:n.literal("push"),content:A7})]),tj=n.strictObject({requestId:n.uuid(),customerId:n.uuid(),connectionId:n.uuid().optional(),message:ej,expiresAt:n.iso.datetime({offset:!0})}),x7=n.array(n.uuid()).min(1).max(1e4).refine(e=>new Set(e).size===e.length,"Duplicate Customer"),S7=n.discriminatedUnion("kind",[n.strictObject({kind:n.literal("all")}),n.strictObject({kind:n.literal("customers"),customerIds:x7})]),$oe=n.strictObject({name:n.string().trim().min(1).max(120),connectionId:n.uuid().optional(),message:ej,audience:S7,frequencyLimit:n.number().int().min(1).max(100)}),nj=n.strictObject({requestId:n.uuid(),channel:Tl,state:n.enum(["allowed","denied"]),expectedRevision:n.number().int().min(0).max(Number.MAX_SAFE_INTEGER-1)}),rj=n.enum(["queued","leased","dispatching","accepted","unknown","retry","skipped","failed","canceled"]),ij=n.enum(["accepted","sent","delivered","delayed","bounced","complained","unsubscribed","opened","clicked","ringing","answered","completed","busy","no_answer","failed","cost_finalized"]),joe=n.strictObject({meter:m7,estimatedUnits:n.string().regex(/^(0|[1-9]\d{0,11})$/),observedUnits:n.string().regex(/^(0|[1-9]\d{0,11})$/).nullable()})});var Rl,Xw=x(()=>{"use strict";J();dl();Rl=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:Us})});var oj,aj,Voe,Boe,Vf=x(()=>{"use strict";J();oj=n.enum(["stripe","apple","google","merchant"]),aj=n.enum(["membership","credit_pack","lifetime"]),Voe=n.enum(["active","grace","suspended","inactive","revoked"]),Boe=n.strictObject({currency:n.string().regex(/^[A-Z]{3}$/),micros:n.string().regex(/^(0|[1-9][0-9]{0,29})$/)})});var Qs,Nl=x(()=>{"use strict";J();Vf();qt();Qs=n.object({provider:oj,currency:Te}).strict()});var mo,sj,v7,e_,Hr,Xoe,Ys=x(()=>{"use strict";J();_n();qt();Nl();mo=n.strictObject({internal_feature_id:n.uuid(),quantity:$e.refine(e=>/[1-9]/.test(e)),properties:tn,entityId:n.uuid().optional()}),sj=n.strictObject({requirement:mo,commerce:Qs.optional(),paywallId:n.uuid().optional()}),v7=n.enum(["not_entitled","insufficient_balance","capacity_exceeded","limit_exceeded","awaiting_topup","authorization_required","payment_blocked","cash_budget_exceeded","unavailable","authentication_required"]),e_=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:Te,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)}),Hr=n.strictObject({internal_feature_id:n.string().min(1),name:n.string().min(1).max(120),kind:n.enum(["access","metered","credit"]),quantity:$e,allowed:n.boolean(),reason:v7.nullable(),preview:n.strictObject({scenario:n.enum(["feature_flag","usage_limit"]),candidates:n.array(e_).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"})}),Xoe=n.strictObject({paywallId:n.uuid(),requirement:mo})});function Zf(e){return[...e.matchAll(/\{\{\s*([^{}]+?)\s*\}\}/g)].flatMap(t=>t[1]===void 0?[]:[t[1].trim()])}function t_(e){let t=Zf(e).filter(i=>!w7.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 w7,qf,Bf,Xs,fo=x(()=>{"use strict";J();Xw();qt();Ys();w7=["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"],qf=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(),Bf=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:Te.optional(),couponId:n.uuid().optional(),offerId:n.uuid().optional(),unavailable:n.boolean().optional(),unavailableReason:n.string().optional(),missing:n.array(n.string()).optional()}).strict(),Xs=n.object({paywall:Hr.optional(),nodes:n.record(n.string(),n.object({base:Bf,picker:n.string().optional(),byPlan:n.record(n.string(),Bf).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:Te.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(Rl).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 cj(e){return e.type==="stack"&&e.interaction?.type==="select"&&e.interaction.purpose==="product"&&!!e.interaction.pickerId}function Hf(e){let t={};function r(i){if(cj(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 uj(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(cj(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(Hf(e)))c[u]??="";return c}var Gf=x(()=>{"use strict"});function Wf(e,t){return e.assignments.length===t.length&&e.assignments.every(r=>t.includes(r.productVersionId))}var lj,Kf,Dl=x(()=>{"use strict";J();lj=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),Kf=n.strictObject({tiers:n.array(n.strictObject({id:lj,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:lj,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 _7,dj,pj,cn,mj,I7,k7,ec,n_,$l=x(()=>{"use strict";J();_n();_7=["credit_balance","credit_transactions","membership","billing","billing_controls","customer_plans","credit_packs","credit_pack_orders","offer_history"],dj=n.enum(_7),pj=n.object({source:dj,layout:n.enum(["full","compact"]),resourceKey:da.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"})}),cn=n.string().max(2e3),mj=n.object({id:n.string().max(100),label:cn,detail:n.array(cn).max(12),value:cn.optional(),status:cn.optional(),facts:n.array(n.object({label:cn,value:cn}).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:cn})).max(1).optional(),membershipActions:n.array(n.object({value:n.string().max(100),label:cn}).strict()).max(3).optional()}).strict(),I7=n.object({key:da,name:cn,spendable:cn,reserved:cn,available:cn,expiry:cn.nullable(),sources:n.array(mj).max(50),sourceCount:n.number().int().nonnegative(),sourcePage:n.number().int().positive(),hasNextSources:n.boolean(),hasPreviousSources:n.boolean()}).strict(),k7=n.object({source:dj,status:n.enum(["idle","loading","ready","error"]),stale:n.boolean(),preview:n.boolean(),errorCode:n.string().max(80).optional(),errorMessage:cn.optional(),resources:n.array(I7).max(500),rows:n.array(mj).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:cn,note:cn,facts:n.array(n.object({label:cn,value:cn}).strict()).max(100)}).strict().optional(),membershipResult:cn.optional()}).strict(),ec=n.object({nodes:n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),k7)}).strict(),n_=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 Jf(e){let t=t_(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 r_=x(()=>{"use strict";fo()});function un(e,t){for(let r of e.pages)ho(r.root,t)}function ho(e,t,r=1,i=null){if(t(e,r,i)!==!1&&e.type==="stack")for(let o of e.children)ho(o,t,r+1,e)}function zl(e){let t=[],r=new Set;return un(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 nZ(e,t,r){if(t.field==="html"){let i;return un(e,o=>{o.id===t.nodeId&&o.type==="custom_html"&&(i=o.html[r])}),i}if(t.field==="src"){let i=Tn(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 Ri(e){let t=zl(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=>!nZ(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 rZ(e){return Ri(e).filter(t=>t.complete||t.locale===e.strings.defaultLocale).map(t=>t.locale)}function Ul(e,t){return jw(t,rZ(e),e.strings.defaultLocale)}function a_(e,t){let r=e.strings.locales[t]??{},i=e.strings.locales[e.strings.defaultLocale]??{},o={};for(let s of zl(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 iZ(e,t){let r=null;return ho(e,i=>{if(r)return!1;i.id===t&&(r=i)}),r}function Tn(e,t){for(let r of e.pages){let i=iZ(r.root,t);if(i)return i}return null}function Yf(e,t,r){let i={};if(!t||typeof t!="object"||Array.isArray(t))return i;let o=t;if(un(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,uj(e,a,r))}return i}var E7,hn,Ll,lt,C7,P7,i_,gj,Ml,fj,Fl,ct,hj,O7,T7,yj,R7,N7,D7,$7,j7,ba,rr,L7,M7,F7,z7,U7,V7,B7,q7,Z7,H7,G7,K7,W7,Gr,bj,J7,Q7,jl,Y7,X7,o_,eZ,Qf,tZ,ln,Cr=x(()=>{"use strict";fo();J();Gf();Dl();$l();Gs();E7=4,hn={nodes:150,depth:8,children:50,locales:20,actions:40,pages:10,stringLength:2e3,customHtml:32768,customCss:16384,documentBytes:2e5},Ll=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),lt=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),C7=n.enum(["none","xs","sm","md","lg","xl"]),P7=n.enum(["none","sm","md","lg","full"]),i_=n.string().regex(/^#[0-9a-fA-F]{6}$/),gj=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"),Ml=n.union([gj,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}$/)]),fj=n.object({primary:i_,background:i_,text:i_,radius:P7,font:n.enum(["system","serif","rounded","mono"])}).strict(),Fl=n.union([n.enum(["primary","text","muted","background","surface"]),n.string().regex(/^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/)]),ct=(e,t)=>n.number().int().min(e).max(t),hj=n.union([n.enum(["fit","fill"]),ct(1,1200)]),O7=n.object({top:ct(0,200),right:ct(0,200),bottom:ct(0,200),left:ct(0,200)}).strict(),T7=n.object({top:ct(-100,200),right:ct(-100,200),bottom:ct(-100,200),left:ct(-100,200)}).strict(),yj=n.object({x:ct(0,100),y:ct(0,100)}).strict(),R7=n.discriminatedUnion("type",[n.object({type:n.literal("color"),color:Fl}).strict(),n.object({type:n.literal("linear"),angle:ct(0,360),stops:n.array(n.object({color:Fl,at:ct(0,100)}).strict()).min(2).max(4)}).strict(),n.object({type:n.literal("image"),src:Ml,fit:n.enum(["cover","contain"]),position:yj.optional()}).strict()]),N7=n.discriminatedUnion("type",[n.object({type:n.literal("rect"),radius:n.union([ct(0,200),n.object({topLeft:ct(0,200),topRight:ct(0,200),bottomRight:ct(0,200),bottomLeft:ct(0,200)}).strict()])}).strict(),n.object({type:n.literal("pill")}).strict()]),D7=n.object({width:ct(0,12),color:Fl,style:n.enum(["solid","dashed"])}).strict(),$7=n.object({x:ct(-40,40),y:ct(-40,40),blur:ct(0,80),spread:ct(-20,40),color:Fl}).strict(),j7=n.object({font:n.enum(["system","serif","rounded","mono"]),size:ct(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:Fl,align:n.enum(["start","center","end"]),italic:n.boolean(),decoration:n.enum(["none","underline","line-through"]),transform:n.enum(["none","uppercase"])}).strict().partial(),ba=n.object({width:hj,height:hj,padding:O7,margin:T7,gap:ct(0,120),grow:n.union([n.boolean(),n.number().min(0).max(12)]),background:R7,opacity:n.number().min(0).max(1),clipContent:n.boolean(),shape:N7,border:D7,shadow:$7,text:j7}).strict().partial(),rr={id:Ll,name:n.string().trim().min(1).max(60).optional(),hidden:n.boolean().optional(),style:ba.optional(),fallback:lt.optional()},L7=n.object({...rr,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:lt,variant:n.enum(["title","heading","body","caption"])}).strict(),M7=n.object({...rr,type:n.literal("image"),src:Ml,localizedSrc:n.record(qn,Ml).optional(),alt:lt,aspect:n.enum(["auto","1:1","4:3","16:9","3:1"]),fit:n.enum(["cover","contain"]),position:yj.optional()}).strict(),F7=n.object({...rr,type:n.literal("button"),label:lt,variant:n.enum(["primary","secondary","link"]),action:lt,purpose:n.enum(["purchase","navigation","close"]).optional(),bind:qf.optional()}).strict(),z7=n.object({...rr,type:n.literal("divider")}).strict(),U7=n.object({...rr,type:n.literal("customer_data"),title:lt,data:pj}).strict(),V7=n.object({...rr,type:n.literal("spacer"),size:C7}).strict(),B7=n.object({...rr,type:n.literal("custom_html"),html:n.record(qn,n.string().max(hn.customHtml)),css:n.string().max(hn.customCss)}).strict(),q7=n.object({...rr,type:n.literal("price"),fallback:lt,parts:n.object({current:ba.optional(),original:ba.optional(),period:ba.optional()}).strict().optional()}).strict(),Z7=n.object({...rr,type:n.literal("coupon_code"),label:lt,fallback:lt}).strict(),H7=n.object({...rr,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:lt,fallback:lt}).strict().refine(e=>e.source!=="fixed"||!!e.at,"\u56FA\u5B9A\u5012\u8BA1\u65F6\u9700\u8981\u7ED3\u675F\u65F6\u95F4"),G7=n.object({...rr,type:n.literal("plan_picker"),label:lt,fallback:lt,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:Kf.safeExtend({monthLabel:lt,yearLabel:lt,unavailableLabel:lt}).optional(),states:n.object({selected:ba.optional()}).strict().optional()}).strict().superRefine((e,t)=>{e.grouping&&(!e.planIds||!Wf(e.grouping,e.planIds))&&t.addIssue({code:"custom",message:"Grouped picker assignments must match its product allowlist"})}),K7=n.object({...rr,type:n.literal("quantity_picker"),bind:qf.optional(),label:lt,fallback:lt,internalFeatureId:n.uuid(),minimumQuantity:ct(0,1e4),maximumQuantity:ct(0,1e4),defaultQuantity:ct(0,1e4),step:ct(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"),W7=n.discriminatedUnion("type",[n.object({type:n.literal("input"),label:lt,keyboard:n.enum(["text","email","tel","url"]),maxLength:ct(1,500)}).strict(),n.object({type:n.literal("multiselect"),label:lt,min:ct(0,50),max:ct(1,50)}).strict(),n.object({type:n.literal("select"),label:lt,defaultIndex:ct(0,49),purpose:n.enum(["option","product","tier"]).optional(),pickerId:Ll.optional(),selectedStyle:ba.optional()}).strict(),n.object({type:n.literal("tabs"),label:lt,defaultIndex:ct(0,49),purpose:n.literal("tier").optional()}).strict(),n.object({type:n.literal("toggle"),label:lt,defaultEnabled:n.boolean()}).strict(),n.object({type:n.literal("carousel"),label:lt}).strict()]),Gr={...rr,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:ct(0,19),period:n.enum(["month","year"]).optional(),requireBinding:n.boolean().optional()}).strict().optional(),interaction:W7.optional(),states:n.object({selected:ba.optional()}).strict().optional(),purpose:n.literal("benefits").optional(),purchaseAction:lt.optional(),buttonVariant:n.enum(["primary","secondary","link"]).optional(),bind:qf.optional()},bj=n.lazy(()=>n.object({...rr,type:Gr.type,direction:Gr.direction,align:Gr.align,justify:Gr.justify,children:n.array(J7).max(hn.children),productSlot:Gr.productSlot,interaction:Gr.interaction,states:Gr.states,purpose:Gr.purpose,purchaseAction:Gr.purchaseAction,buttonVariant:Gr.buttonVariant,bind:Gr.bind}).strict()),J7=n.lazy(()=>n.union([bj,L7,M7,F7,z7,V7,B7,q7,Z7,H7,G7,K7,U7])),Q7=n.union([n.string().max(500),n.number().finite(),n.boolean(),n.null()]),jl={id:lt,event:lt,properties:n.record(lt,Q7).refine(e=>Object.keys(e).length<=20,"\u6700\u591A 20 \u4E2A\u53C2\u6570")},Y7=n.discriminatedUnion("type",[n.object({...jl,type:n.literal("navigate"),close:n.literal(!1),pageId:Ll}).strict(),n.object({...jl,type:n.literal("event"),close:n.boolean()}).strict(),n.object({...jl,type:n.literal("close"),close:n.literal(!0)}).strict(),n.object({...jl,type:n.literal("open_url"),close:n.boolean(),url:gj}).strict(),n.object({...jl,type:n.literal("claim_offer"),close:n.boolean(),couponId:n.uuid()}).strict()]),X7=n.object({defaultLocale:qn,locales:n.record(qn,n.record(lt,n.string().max(hn.stringLength)))}).strict(),o_=n.enum(["popup","paywall","onboarding","page","banner"]),eZ=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()]),Qf={sm:360,md:420,lg:560},tZ=n.object({kind:n.literal("screen"),schemaVersion:n.literal(E7),name:n.string().trim().min(1).max(80),surface:o_,initialPageId:Ll.optional(),presentation:eZ,theme:fj,pages:n.array(n.object({id:Ll,name:n.string().trim().min(1).max(60),root:bj,theme:fj.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(hn.pages),strings:X7,actions:n.array(Y7).max(hn.actions)}).strict();ln=tZ.superRefine((e,t)=>{let r=hn;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>hn.locales&&i(`\u6700\u591A ${hn.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;un(e,(d,p)=>{if(u++,p>hn.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 ${hn.depth} \u5C42`)})});function Pr(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=>Pr(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 u_(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&&u_(e.items,t.items)}function Xf(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(!Pr(o,l))throw new Error(`Invalid variable value: ${i}`);r[i]=l}}return r}function rc(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 Aj(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"||!Pr(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,s_,tc,nc,vae,c_,Kr=x(()=>{"use strict";J();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"),s_=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()}),tc=s_.extend({type:n.enum([...s_.shape.type.options,"array"]),items:s_.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"})}),nc=tc.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})])}),vae=n.record(Wt,nc),c_=n.record(Wt,Wt).refine(e=>Object.keys(e).length<=20)});function xj(e,t){if(!t)return e;for(let r of Wr.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 l_(e,t){if(e.source==="literal")return structuredClone(e.value);let r=Xf(t.declarations,t);if(!Object.hasOwn(r,e.key))throw new Error("Capability input is missing");return structuredClone(Re.parse(xj(r[e.key],e.path)))}var Wr,mi,Ni=x(()=>{"use strict";J();Zt();Kr();Wr=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"),mi=n.discriminatedUnion("source",[n.strictObject({source:n.literal("literal"),value:Re}),n.strictObject({source:n.literal("variable"),key:n.string().min(1).max(255),path:Wr.optional()})])});function d_(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&&!Wr.safeParse(i).success?null:{key:r,path:i}}function p_(e){let t=Object.values(e.strings.locales).flatMap(r=>Object.values(r));return un(e,r=>{r.type==="custom_html"&&t.push(...Object.values(r.html))}),[...new Set(t.flatMap(Zf))]}function eh(e){return p_(e).filter(t=>t.startsWith("variables.")).map(t=>t.slice(10))}var th=x(()=>{"use strict";Cr();fo();Ni()});function gr(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 ic=x(()=>{"use strict"});function cZ(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 go,oZ,Sj,aZ,sZ,nh,uZ,vj,Lae,Mae,Aa,Fae,zae,m_=x(()=>{"use strict";J();Cr();th();ic();go=n.enum(["page","popup","banner"]),oZ=3e5,Sj=n.strictObject({type:n.enum(["string","number","boolean","strings","json"]),nullable:n.boolean()}),aZ=n.strictObject({inputs:n.record(lt,Sj.extend({required:n.boolean()})).refine(e=>Object.keys(e).length<=40,"Too many content inputs"),outputs:n.record(lt,Sj).refine(e=>Object.keys(e).length<=40,"Too many content outputs")}),sZ=n.strictObject({kind:go,schemaVersion:n.literal(1),name:n.string().trim().min(1).max(80),screen:ln,contract:aZ}),nh=sZ.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"]),gr(e)>oZ&&r("Content document exceeds its byte budget",[])});uZ=nh.superRefine((e,t)=>{for(let r of eh(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&&!cZ(o,i)&&t.addIssue({code:"custom",path:["contract","outputs",r.id],message:"Action value differs from its declared type"})}Ri(e.screen).some(r=>!r.complete)&&t.addIssue({code:"custom",path:["screen","strings"],message:"Content needs complete localized copy"})}),vj=n.strictObject({id:n.uuid(),kind:go,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})}),Lae=vj.extend({draft:nh}),Mae=n.strictObject({rows:n.array(vj).max(200),nextCursor:n.uuid().nullable()}),Aa=n.strictObject({id:n.uuid(),kind:go,resourceId:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),version:n.number().int().positive(),sourceRevision:n.number().int().nonnegative(),document:uZ,createdAt:n.iso.datetime({offset:!0})}),Fae=Aa.omit({document:!0}),zae=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),kind:go,id:n.uuid(),document:nh}),n.strictObject({action:n.literal("save"),kind:go,id:n.uuid(),revision:n.number().int().nonnegative(),document:nh}),n.strictObject({action:n.enum(["publish","archive"]),kind:go,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 oc,f_=x(()=>{"use strict";J();oc={funnelId:n.uuid().optional(),funnelVersionId:n.uuid().optional()}});var Zae,Hae,ac,Gae,h_=x(()=>{"use strict";J();Zae=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()})]),Hae=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),ac=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"})}),Gae=n.record(n.uuid(),ac).refine(e=>Object.keys(e).length<=20,"At most 20 native store selections")});var g_,y_=x(()=>{"use strict";J();qt();Vf();g_=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:aj,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:Te,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 lZ,wj,dZ,pZ,_j,mZ,fZ,Ij,kj,hZ,gZ,yZ,Ej,bZ,AZ,xZ,SZ,Cj,vZ,Pj,wZ,_Z,Oj,IZ,kZ,EZ,Tj,xa,CZ,PZ,OZ,Rj,TZ,RZ,Nj,NZ,DZ,$Z,Dj,b_,jZ,LZ,$j,MZ,FZ,zZ,jj,UZ,Lj,VZ,BZ,qZ,ZZ,Mj,HZ,GZ,KZ,WZ,JZ,Fj,QZ,YZ,XZ,eH,tH,sc,rh=x(()=>{"use strict";il();il();lZ=n.registry(),{BillingInterval:wj}=(()=>{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:dZ}=(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:pZ}=(e=>({withSpecDefault:({schema:r,defaultValue:i,description:o})=>(e.add(r,{description:o,default:i}),r)}))(lZ),{COMMON:_j}={COMMON:["usd","eur","gbp","cad","aud","jpy","chf","cny","inr"]},{STRIPE_PRESENTMENT_CURRENCIES:mZ}={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:fZ}=(e=>({COMMON_SET:new Set(e)}))(_j),{hasNoDuplicateCurrencies:Ij}={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:kj}={DUPLICATE_CURRENCY_MESSAGE:"Each currency may appear at most once in additional_currencies."},{ApiStripePriceProcessorSchema:hZ}=(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:gZ}={Infinite:"inf"},{TierBehavior:yZ}=(()=>{var e;return(function(t){t.Graduated="graduated",t.VolumeBased="volume"})(e||(e={})),{TierBehavior:e}})(),{BillingMethod:Ej}=(()=>{var e;return(function(t){t.Prepaid="prepaid",t.UsageBased="usage_based"})(e||(e={})),{BillingMethod:e}})(),{AllocatedBilling:bZ}=(()=>{var e;return(function(t){t.Arrear="arrear",t.ProratedLegacy="prorated_legacy"})(e||(e={})),{AllocatedBilling:e}})(),{CREDIT_DIMENSION_NAME_MAX_LENGTH:AZ}={CREDIT_DIMENSION_NAME_MAX_LENGTH:64},{USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:xZ}={USAGE_ATTRIBUTION_DIMENSION_SEPARATOR:"::"},{CreditMatchSchema:SZ}=(e=>({CreditMatchSchema:e.record(e.string(),e.union([e.string(),e.number(),e.boolean()]).transform(String).pipe(e.string()))}))(n),{ApiCreditTierSchema:Cj}=(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:vZ}={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:Pj}=(e=>({MarkupEntrySchema:e.object({markup:e.number().min(-100)})}))(n),{ModelMarkupsSchema:wZ}=((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,Pj),{InvoiceUsageEntrySchema:_Z}=(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:Oj}=(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:IZ}=(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:kZ}=(e=>({UnixMsTimestampSchema:e.number().int().safe().nonnegative()}))(n),{CreateInvoicePreviewLineSchema:EZ}=(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:Tj}=(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:xa}=(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:CZ}=(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:PZ}=((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,wj,dZ),{CURRENCY_CODES:OZ}=((e,t,r)=>({CURRENCY_CODES:[...e,...t.filter(o=>!r.has(o)).sort()]}))(_j,mZ,fZ),{ApiPriceProcessorsSchema:Rj}=((e,t)=>({ApiPriceProcessorsSchema:e.object({stripe:t.nullish()}).meta({"x-atmn-mapping":!0})}))(n,hZ),{AllocatedBillingFieldSchema:TZ}=((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,bZ),{CreditDimensionNameSchema:RZ}=((e,t,r)=>({CreditDimensionNameSchema:e.string().min(1).max(t).refine(o=>!o.includes(r),{message:`Dimension names cannot contain "${r}"`})}))(n,AZ,xZ),{ApiCreditMatchSchema:Nj}=(e=>({ApiCreditMatchSchema:e.meta({description:"Event properties this entry applies to. Every key must equal the tracked property, compared as strings."})}))(SZ),{findCreditTierViolations:NZ}=(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}}))(vZ),{ApiCreditMultiplierSchema:DZ}=((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,Nj),{ProviderMarkupsSchema:$Z}=((e,t)=>({ProviderMarkupsSchema:e.record(e.string(),t).nullish()}))(n,Pj),{InvoiceFeatureQuantitySchema:Dj}=((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,Ej,_Z),{CreateInvoicePreviewSchema:b_}=((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,EZ),{SUPPORTED_SET:jZ}=(e=>({SUPPORTED_SET:new Set(e)}))(OZ),{ApiCreditDimensionBaseSchema:LZ}=((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,Nj),{refineGraduatedTiers:$j}=(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"]})}}))(NZ),{ApiFeatureMarkupsOverrideSchema:MZ}=((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,$Z,wZ),{isValidCurrencyCode:FZ}=(e=>({isValidCurrencyCode:r=>!!r&&e.has(r.toLowerCase())}))(jZ),{ApiCreditDimensionSchema:zZ}=((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,LZ,Cj,$j),{CurrencyCodeSchema:jj}=((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,FZ),{AdditionalCurrencyTierSchema:UZ}=((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,jj),{ApiCreditSchemaItemBaseSchema:Lj}=((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,RZ,zZ,DZ),{ApiFlatCreditSchemaItemSchema:VZ}=((e,t)=>({ApiFlatCreditSchemaItemSchema:e.extend({credit_cost:t.number().min(0).meta({description:"Credits consumed per billing-unit group."})}).strict()}))(Lj,n),{AdditionalCurrencyPriceSchema:BZ}=((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,jj),{AdditionalCurrencyTierArraySchema:qZ}=((e,t,r,i)=>({AdditionalCurrencyTierArraySchema:e.array(t).refine(r,{message:i})}))(n,UZ,Ij,kj),{ApiGraduatedCreditSchemaItemSchema:ZZ}=((e,t,r,i)=>({ApiGraduatedCreditSchemaItemSchema:e.extend({tier_behavior:t.literal("graduated"),tiers:t.array(r).min(1)}).strict().superRefine(i)}))(Lj,n,Cj,$j),{AdditionalCurrencyPriceArraySchema:Mj}=((e,t,r,i)=>({AdditionalCurrencyPriceArraySchema:e.array(t).refine(r,{message:i})}))(n,BZ,Ij,kj),{ApiUsageTierWithCurrenciesSchema:HZ}=((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,gZ,qZ),{ApiCreditSchemaItemSchema:GZ}=((e,t,r)=>({ApiCreditSchemaItemSchema:e.union([t,r])}))(n,ZZ,VZ),{BasePriceParamsSchema:KZ}=((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."})}))(PZ,pZ,n,Mj),{PlanItemPriceParamsSchema:WZ}=((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,Mj,HZ,yZ,wj,Ej,TZ),{ApiFeatureOverrideSchema:JZ}=((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,GZ,MZ),{InvoiceBasePriceParamsSchema:Fj}=((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()}))(KZ,Rj),{InvoiceItemPriceParamsSchema:QZ}=((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()}))(WZ,Rj),{InvoiceLicenseQuantitySchema:YZ}=((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,Fj,Dj),{InvoiceCustomizeItemSchema:XZ}=((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,QZ,JZ),{InvoiceCustomizeSchema:eH}=((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,Fj,XZ),{InvoicePlanParamsSchema:tH}=((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,eH,Dj,YZ,Oj),{CreateInvoiceParamsSchema:sc}=((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,tH,IZ,Oj,kZ)});var Vj,va,gn,nH,Bj,rH,iH,qj,yo,bo,oh,Zj,ih,zj,Uj,Hj,ah,oH,aH,sH,Gj,A_,Vl,Sa,Kj,Wj,x_,sh,mse,fse,Bl=x(()=>{"use strict";nl();q0();zs();y_();h_();J();lo();qt();Vw();nf();rh();Vj=n.strictObject({requestId:n.uuid(),predecessorOperationId:n.uuid().optional(),invoiceMode:xa.optional(),entityId:n.uuid().optional(),billingSubscriptionId:n.uuid().optional(),newBillingSubscription:n.literal(!0).optional(),offerId:n.uuid().optional(),nativeOffer:ac.optional(),plans:n.array(n.strictObject({productVersionId:n.uuid(),seatQuantities:n.record(la,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","merchant"]),currency:Te}).refine(e=>!e.offerId||!e.billingSubscriptionId&&(["stripe","merchant"].includes(e.provider)||e.nativeOffer!==void 0),"Held offers apply to new purchases; existing subscriptions use billing coupons").refine(e=>!e.nativeOffer||["apple","google"].includes(e.provider)&&e.plans.length===1,"A store selection applies to exactly one native SKU").refine(e=>!e.newBillingSubscription||["stripe","merchant"].includes(e.provider)&&!e.billingSubscriptionId,"A new billing subscription has no existing subscription target").refine(e=>!e.invoiceMode?.enabled||e.provider==="stripe"&&!e.entityId,"Invoice mode requires a Stripe subscription without an Entity target"),va=n.strictObject({operationId:n.uuid()}),gn=n.number().int().min(0).max(1e8),nH=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:gn,seats:n.array(n.strictObject({key:la,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:gn})).max(20),prepaid:n.array(D$).max(100).optional(),catalogAmountMinor:gn,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+Fs({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"),Bj=n.string().regex(/^[A-Za-z0-9_-]{1,200}$/),rH=n.strictObject({id:Bj,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"),iH=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()}),qj=n.strictObject({invoiceMode:xa.optional(),append:iH.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:Bj,terms:rH})).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})}),yo=n.strictObject({operationId:n.uuid(),entityId:n.uuid().nullable(),billingSubscriptionId:n.uuid().nullable(),discount:n.strictObject({offerId:n.uuid(),couponId:n.uuid(),discount:uo,duration:fr,amountMinor:gn,allocations:n.array(n.strictObject({productVersionId:n.uuid(),amountMinor:gn})).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:gn,discountMinor:gn,taxMinor:gn,totalMinor:gn}).nullable(),expiresAt:n.iso.datetime({offset:!0}),provider:n.enum(["stripe","apple","google","merchant"]),nativeOffer:ac.optional(),currency:Te,lines:n.array(nH).min(1).max(20),catalogAmountMinor:gn,automaticTax:n.boolean(),execution:n.union([qj,Qm]).nullable()}).refine(e=>e.provider==="merchant"?e.execution?.provider==="merchant"&&e.execution.operationId===e.operationId&&e.execution.catalogAmountMinor===e.catalogAmountMinor&&e.execution.currency===e.currency&&Date.parse(e.execution.expiresAt)<=Date.parse(e.expiresAt)&&e.execution.trialPeriodDays===(e.lines[0]?.trial?.days??null)&&e.execution.discount?.grantId===e.discount?.offerId:e.provider==="stripe"?e.execution?.provider!=="merchant"&&(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&&(["stripe","merchant"].includes(e.provider)||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)&&(["stripe","merchant"].includes(e.provider)?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"),bo=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:n.union([qj,Qm]).nullable(),currency:Te,catalogAmountMinor:gn,taxMinor:gn,totalMinor:n.number().int().min(0).max(2e8).nullable(),quoteFinalized:n.boolean(),nativePurchase:g_.nullable(),confirmedAt:n.iso.datetime({offset:!0}).nullable().optional(),quote:yo.optional(),merchantExecution:ca.nullable().optional(),problem:tl.nullable().optional(),authority:tf.optional()}).refine(e=>(e.checkoutUrl===null||e.executor==="indiana"||e.merchantExecution?.type==="purchase")&&(e.execution===null||e.executor==="merchant"),"Only Indiana-executed purchases carry a Checkout URL and only record-only purchases carry execution instructions"),oh=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()}),Zj=n.strictObject({requestId:n.uuid(),invoiceMode:xa.optional(),membershipId:n.uuid(),carryOverBalances:oh.optional(),carryOverUsages:oh.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:la,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"),ih=n.string().regex(/^price_[A-Za-z0-9]+$/),zj=n.strictObject({grooveUpdateId:n.uuid(),grooveCustomerId:n.uuid()}),Uj=n.strictObject({price:ih.nullable(),priceId:n.uuid().optional(),quantity:n.number().int().min(0).max(1e4)}),Hj=n.strictObject({provider:n.literal("stripe"),invoiceMode:xa.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(Uj).max(20),remove:n.array(ih).max(20),restoreItems:n.array(n.strictObject({price:ih,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:zj}).nullable(),cancel:n.strictObject({prorate:n.literal(!1),invoiceNow:n.literal(!1)}).nullable(),schedule:n.strictObject({currentItems:n.array(n.strictObject({price:ih,quantity:n.number().int().min(0).max(1e4)})).max(20),nextItems:n.array(Uj).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:zj}).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"),ah=n.strictObject({carryOverBalances:oh.optional(),carryOverUsages:oh.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:Te,creditMinor:gn,debitMinor:gn,discountMinor:gn,taxMinor:gn,totalMinor:gn,retainedProductVersionIds:n.array(n.uuid()).max(19),execution:n.union([Hj,Ym])}),oH=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:n.union([Hj,Ym]).nullable(),confirmedAt:n.iso.datetime({offset:!0}).nullable().optional(),merchantExecution:ca.nullable().optional(),problem:tl.nullable().optional(),quote:ah.optional(),authority:tf.optional()}).refine(e=>e.execution===null||e.executor==="merchant","Only record-only changes carry execution instructions"),aH=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:Te,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:gn,policy:n.enum(["apple_store","google_full_price"])})}),sH=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:g_.nullable()}),Gj=n.union([ah,aH]),A_=n.union([oH,sH]),Vl=n.number().int().positive().max(2e8),Sa=n.number().int().min(0).max(2e8),Kj=n.strictObject({requestId:n.uuid(),invoiceId:n.uuid(),mode:n.enum(["full","partial"]),amountMinor:Vl.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"),Wj=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:Vl,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)}),x_=n.strictObject({operationId:n.uuid(),invoiceId:n.uuid(),providerInvoiceId:n.string().min(1).max(200),currency:Te,paidMinor:Sa,refundedMinor:Sa,pendingMinor:Sa,amountMinor:Vl,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().min(1).max(200)).max(20)}),execution:n.union([Wj,Xm]),expiresAt:n.iso.datetime({offset:!0})}).refine(e=>e.amountMinor<=e.paidMinor-e.refundedMinor-e.pendingMinor&&e.execution.amountMinor===e.amountMinor&&(e.execution.provider==="merchant"?e.execution.merchantInvoiceId===e.providerInvoiceId&&e.execution.operationId===e.operationId&&e.execution.currency===e.currency: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"),sh=n.strictObject({operationId:n.uuid(),invoiceId:n.uuid(),providerInvoiceId:n.string().min(1).max(200),status:n.enum(["quoted","pending","succeeded","failed","expired"]),executor:n.enum(["indiana","merchant"]),currency:Te,amountMinor:Vl,mode:n.enum(["full","partial"]),entitlementAction:n.enum(["retain","revoke"]),refundId:n.string().min(1).max(200).nullable(),quote:x_.optional(),execution:n.union([Wj,Xm]).nullable(),confirmedAt:n.iso.datetime({offset:!0}).nullable().optional(),merchantExecution:ca.nullable().optional(),problem:tl.nullable().optional(),authority:tf.optional(),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"),mse=n.strictObject({invoiceId:n.uuid(),currency:Te,paidMinor:Sa,refundedMinor:Sa,pendingMinor:Sa,refundableMinor:Sa,executor:n.enum(["indiana","merchant"]).nullable(),canRefund:n.boolean(),operations:n.array(sh).max(50)}).refine(e=>e.operations.every(t=>t.invoiceId===e.invoiceId),"Refund operations belong to the invoice"),fse=n.strictObject({requestId:n.uuid(),mode:n.enum(["full","partial"]),amountMinor:Vl.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 Jj,ch,cH,ql,S_=x(()=>{"use strict";J();Bl();Jj=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"),ch=n.strictObject({batchId:n.uuid()}),cH=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:ah.nullable(),managementUrl:n.url().nullable(),failureCode:n.enum(["provider_unavailable","invalid_evidence","pending_payment"]).nullable()}),ql=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(cH).min(1).max(100)})});var uH,v_,uh,Qj,Yj,lH,w_,xse,__=x(()=>{"use strict";J();uH=n.string().trim().min(1).max(240),v_={requestId:n.uuid(),reason:uH},uh=n.discriminatedUnion("action",[n.strictObject({...v_,action:n.literal("start"),productVersionId:n.uuid(),entityId:n.uuid().optional(),days:n.number().int().min(1).max(730).optional()}),n.strictObject({...v_,action:n.literal("extend"),membershipId:n.uuid(),days:n.number().int().min(1).max(730)}),n.strictObject({...v_,action:n.literal("end"),membershipId:n.uuid()})]),Qj=n.strictObject({operationId:n.uuid()}),Yj=n.iso.datetime({offset:!0}),lH=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"),Yj]),prorationBehavior:n.literal("none")}),w_=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:Yj.nullable(),execution:lH.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"),xse=n.strictObject({groupId:n.uuid(),productVersionId:n.uuid(),enabled:n.boolean()})});var Xj,eL,dH,I_,k_=x(()=>{"use strict";J();qt();Xj=n.strictObject({requestId:n.uuid(),currency:Te,makeDefault:n.boolean()}),eL=n.strictObject({setupId:n.uuid()}),dH=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})}),I_=n.strictObject({id:n.uuid(),provider:n.literal("stripe"),status:n.enum(["prepared","complete","expired"]),currency:Te,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:dH.nullable()})});var tL,nL,rL,E_=x(()=>{"use strict";J();tL=n.union([n.string(),n.number(),n.boolean(),n.null()]),nL=n.strictObject({customerId:n.uuid()}),rL=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:tL,actual:tL})).max(1e4)})});var lh,dh,ph,C_,pH,mH,fH,iL,oL,aL,sL,cL,uL,P_=x(()=>{"use strict";J();qt();lh=n.iso.datetime({offset:!0}),dh=n.strictObject({createdAt:lh,id:n.uuid()}),ph=n.strictObject({customerId:n.uuid().optional(),entityId:n.uuid().optional(),productId:n.string().min(1).max(256).optional(),provider:n.enum(["stripe","apple","google","merchant","free"]).optional(),status:n.enum(["trial","active","past_due","ended","refunded"]).optional(),cursor:dh.optional(),limit:n.number().int().min(1).max(100).optional()}),C_={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","merchant","free"]),createdAt:lh},pH=n.strictObject({...C_,status:n.enum(["trial","active","past_due","ended"]),cancelAtPeriodEnd:n.boolean(),billingSubscriptionId:n.uuid().nullable()}),mH=n.strictObject({...C_,status:n.enum(["active","ended","refunded"]),orderId:n.uuid().nullable(),transactionId:n.uuid().nullable(),currency:Te.nullable(),amountMinor:n.string().regex(/^(0|[1-9]\d{0,17})$/).nullable()}),fH=n.strictObject({...C_,status:n.enum(["blocked","resolved"]),conflict:n.strictObject({detectedAt:lh,blockingMembershipIds:n.array(n.uuid()).min(1).max(100),transactionId:n.uuid()}),resolvedAt:lh.nullable()}),iL=ph.extend({status:n.enum(["blocked","resolved"]).optional()}),oL=n.strictObject({customerId:n.uuid(),orderId:n.uuid()}),aL=n.strictObject({orderId:n.uuid(),status:n.enum(["blocked","resolved"])}),sL=n.strictObject({items:n.array(pH).max(100),nextCursor:dh.nullable()}),cL=n.strictObject({items:n.array(mH).max(100),nextCursor:dh.nullable()}),uL=n.strictObject({items:n.array(fH).max(100),nextCursor:dh.nullable()})});var lL,dL,O_=x(()=>{"use strict";J();qt();lL=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)})]),dL=n.strictObject({requestId:n.uuid(),orderId:n.uuid(),purchaseIntentId:n.uuid(),status:n.enum(["created","pending","trialing","paid","cancelled","failed"]),currency:Te,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 N_(e){return e.items.flatMap(t=>t.type==="product"?[t.productId]:N_(t))}function _H(e){let t=[];N_(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 R_,hH,gH,Zl,yH,T_,pL,bH,AH,xH,cc,SH,mL,fL,vH,Dse,$se,hL,wH,jse,mh=x(()=>{"use strict";J();R_=n.uuid().refine(e=>e===e.toLowerCase(),"Product references require canonical lowercase UUIDs"),hH=n.record(n.string(),n.json()).refine(e=>Array.from(JSON.stringify(e)).length<=4e3,"Offering metadata exceeds 4000 characters"),gH=3,Zl=20,yH=gH*Zl,T_=n.strictObject({type:n.literal("product"),productId:R_}),pL={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)},bH=n.discriminatedUnion("type",[T_,n.strictObject({...pL,items:n.array(T_).max(Zl)})]),AH=n.discriminatedUnion("type",[T_,n.strictObject({...pL,items:n.array(bH).max(Zl)})]),xH=n.array(AH).max(Zl).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>Zl||o>yH)&&t.addIssue({code:"custom",message:"Offering item limit exceeded"})});cc=n.strictObject({lookupKey:n.string().trim().min(1).max(200),displayName:n.string().trim().min(1).max(1500),items:xH,metadata:hH}),SH=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()))}),mL=cc.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"})}),fL=n.strictObject({id:n.uuid(),offeringId:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),version:n.number().int().positive(),document:cc,productEvidence:n.record(R_,SH),createdAt:n.iso.datetime({offset:!0})}).superRefine((e,t)=>{let r=N_(e.document);(!r.length||_H(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"})}),vH=n.strictObject({rows:n.array(mL).max(200),versions:n.array(fL).max(500)}),Dse=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),document:cc}),n.strictObject({action:n.literal("save"),id:n.uuid(),revision:n.number().int().nonnegative(),document:cc}),n.strictObject({action:n.enum(["publish","set_current","archive","restore"]),id:n.uuid(),revision:n.number().int().nonnegative()})]),$se=n.strictObject({record:mL,version:fL.nullable()}),hL=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()})]),wH=n.strictObject({internalId:R_,id:n.string(),name:n.string().nullable(),version:n.number().int().positive(),archived:n.boolean()}),jse=vH.extend({products:n.array(wH).max(500),pagination:n.strictObject({rows:n.string().nullable(),versions:n.string().nullable(),products:n.string().nullable()}).optional()})});var gL,D_=x(()=>{"use strict";J();mh();gL=n.strictObject({id:n.uuid(),offeringId:n.uuid(),version:n.number().int().positive(),document:cc})});function wa(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 fh,hh=x(()=>{"use strict";J();Dl();fh=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:Kf.optional()})});var IH,gh,Di,uc=x(()=>{"use strict";J();IH=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),gh=n.discriminatedUnion("type",[n.object({type:n.literal("fixed"),productVersionId:n.string().min(1).max(200)}).strict(),n.object({type:n.literal("picker"),pickerId:IH,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")]),Di=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 CH(e){let t=e.products.items.map(a=>a.productVersionId),r=Hf(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&&(!Wf(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")),un(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"),un(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 PH(e){let t=[],r=e.screen.pages.at(-1),i=new Map;for(let c of e.screen.pages)i.set(c.id,[]),ho(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 $_,kH,EH,lc,Xse,yL,ece,tce,nce,rce,yh=x(()=>{"use strict";J();hh();Gf();Dl();Cr();Ys();uc();$_=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:")})]),kH=ln,EH=n.discriminatedUnion("type",[n.object({type:n.literal("checkout"),product:gh}).strict(),n.object({type:n.literal("close")}).strict(),n.object({type:n.literal("action"),action:$_}).strict()]),lc=n.object({schemaVersion:n.literal(3),kind:n.literal("paywall"),name:n.string().trim().min(1).max(80),presentation:Di,requirement:mo.optional(),products:fh,offeringVersionId:n.uuid().nullable(),offeringId:n.uuid(),screen:kH,buttons:n.record(n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),EH)}).strict(),Xse=lc.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 PH(e))t.addIssue({code:"custom",message:i});for(let i of CH(e))t.addIssue({code:"custom",message:i});Ri(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"})});yL=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:lc}).strict(),ece=n.object({rows:n.array(yL).max(200),nextCursor:n.uuid().nullable()}).strict(),tce=yL.omit({draft:!0}).extend({name:n.string(),productCount:n.number().int().nonnegative()}).strict(),nce=n.discriminatedUnion("action",[n.object({action:n.literal("save"),id:n.uuid().nullable(),revision:n.number().int().nonnegative(),document:lc}).strict(),n.object({action:n.enum(["publish","archive"]),id:n.uuid(),revision:n.number().int().nonnegative()}).strict()]),rce=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:Di,buttons:lc.shape.buttons}).strict()).max(500),limited:n.boolean()}).strict()});var Ao,OH,bL,dc=x(()=>{"use strict";J();Gs();fo();Ao=n.string().regex(/^[a-f0-9]{64}$/),OH=Bf.pick({text:!0,label:!0,alt:!0,html:!0,couponId:!0,countdownAt:!0,missing:!0}),bL=n.strictObject({couponDigests:n.record(n.uuid(),Ao),variables:n.record(qn,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(qn,Xs.extend({nodes:n.record(n.string(),n.strictObject({base:OH})),plans:n.object({}).strict(),pickers:n.object({}).strict()}).omit({paywall:!0}))})});function AL(e,t){return t==="Experiment Viewed"?e.experimentViewsEnabled:t==="Feature Evaluated"?e.featureUsageEnabled:e.eventsEnabled}var j_,lce,L_=x(()=>{"use strict";J();j_=n.strictObject({eventsEnabled:n.boolean(),experimentViewsEnabled:n.boolean(),featureUsageEnabled:n.boolean()}),lce=Object.freeze({eventsEnabled:!0,experimentViewsEnabled:!0,featureUsageEnabled:!0})});var M_,TH,RH,NH,xL,pc,F_,DH,$H,Hl,Or,mc=x(()=>{"use strict";J();pr();Zt();M_=n.tuple([n.number().min(0).max(1),n.number().min(0).max(1)]).refine(([e,t])=>e<=t),TH=n.strictObject({attribute:n.string().optional(),seed:n.string(),hashVersion:n.literal(2),ranges:n.array(M_).max(100)}),RH=n.strictObject({id:n.string().min(1).max(255),condition:Bn,gate:n.boolean().optional()}),NH=n.strictObject({key:n.string().optional(),name:n.string().optional(),passthrough:n.boolean().optional()}),xL={condition:Bn.optional(),parentConditions:n.array(RH).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(TH).max(100).optional(),ranges:n.array(M_).max(20).optional(),meta:n.array(NH).max(20).optional(),seed:n.string().optional(),name:n.string().optional(),phase:n.string().optional()},pc=n.strictObject({...xL,key:n.string().min(1).max(255),variations:n.tuple([Re,Re]).rest(Re).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:Re,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()}),DH=n.strictObject({...xL,id:n.string().max(255).optional(),force:Re.optional(),variations:n.array(Re).min(2).max(20).optional(),key:n.string().optional(),range:M_.optional(),tracks:n.array(n.strictObject({experiment:pc,result:F_})).max(100).optional()}),$H=n.strictObject({defaultValue:Re.optional(),rules:n.array(DH).max(500).optional()}),Hl=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:Bn})])),Or=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(),$H),savedGroups:Hl,experiments:n.record(n.uuid(),pc)})});var Gl,z_,SL,U_,bh,vL,wL,Ah=x(()=>{"use strict";J();L_();Zt();mc();Nf();Gl=Or.extend({analyticsConfig:j_,remoteFeatures:n.array(n.string().min(1).max(255)).max(500)}),z_=Gl.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"})}),SL=n.strictObject({attributes:nn,features:n.array(n.string().min(1).max(255)).max(500).optional(),customerId:n.uuid().optional()}),U_=n.strictObject({value:Re,source:n.enum(["unknownFeature","defaultValue","force","override","experiment","prerequisite","cyclicPrerequisite"]),on:n.boolean(),off:n.boolean(),ruleId:n.string(),experimentResult:F_.optional()}),bh=n.strictObject({generation:Or.shape.generation,evaluatedAt:Or.shape.evaluatedAt,expiresAt:Or.shape.expiresAt,features:n.record(n.string(),U_),merchandiseContext:n.strictObject({merchandiseId:n.uuid(),merchandise:nn}).optional()}),vL=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:n$.optional(),properties:n.record(n.string(),Re).default({}),deviceId:n.string().min(1).max(255).optional(),sessionId:n.string().min(1).max(255).optional()})).min(1).max(100)}),wL=n.strictObject({inserted:n.number().int().nonnegative(),duplicates:n.number().int().nonnegative(),rejected:n.number().int().nonnegative(),skipped:n.number().int().nonnegative(),analyticsConfig:j_})});function V_(e,t=[]){let r=[];un(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(zl(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 _L(e){return e.hidden?null:e.type!=="stack"?e:{...e,children:e.children.flatMap(t=>_L(t)??[])}}function jH(e){let t=e.pages.map(o=>{let a=_L(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(zl({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 IL(e,t=[]){let r=ln.parse(structuredClone(jH(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=V_(r,t);if(o.length)throw new Error(o.join("; "));return r}var xh=x(()=>{"use strict";Cr()});var Sh,kL,vh=x(()=>{"use strict";J();Sh=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"})}),kL=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 LH,B_,MH,EL,CL=x(()=>{"use strict";J();LH=["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}",MH=n.string().regex(new RegExp(`^${B_}/${B_}/${B_}/manifest\\.json$`)),EL=n.strictObject({kind:n.literal("gcs-resumable"),url:n.url(),bucket:n.enum(LH),objectKey:MH,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,yr,wh,PL,OL,FH,Kl,Z_,Tce,H_,zH,Rce,q_,Nce,Dce,$ce,jce,Lce,Mce,_h=x(()=>{"use strict";J();vh();CL();Ht=n.string().min(1).max(256),yr=n.string().regex(/^[a-f0-9]{64}$/),wh=n.strictObject({versionId:n.uuid(),manifestDigest:yr,sourceGraphDigest:yr,pageKey:Ht,stateKey:Ht,documentKey:Ht,documentHash:yr,elementKey:Ht.optional(),nodeId:Ht.optional(),contentHash:yr.optional(),renderKey:Ht.optional()}),PL=n.strictObject({pageKey:Ht,documentKey:Ht,expectedDocumentHash:yr,renderKey:Ht.optional(),nodeId:Ht,elementKey:Ht,expectedContentHash:yr,property:n.enum(["text","fontSize","color"]),value:n.union([n.string().max(4e3),n.number().finite()])}),OL=n.strictObject({versionId:n.uuid(),manifestDigest:yr,sourceGraphDigest:yr,pageKey:Ht,stateKey:Ht,documentKey:Ht,documentHash:yr,renderKey:Ht.optional(),patches:n.array(PL.omit({pageKey:!0,documentKey:!0,expectedDocumentHash:!0,renderKey:!0})).min(1).max(200)}),FH=/^[a-z][a-z0-9-]{0,39}$/,Kl=n.string().regex(FH),Z_=n.enum(["web","ios","android"]),Tce=n.discriminatedUnion("action",[n.strictObject({action:n.literal("register"),requestId:n.uuid(),client:Kl,platform:Z_,label:n.string().trim().min(1).max(100),sha256:yr,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:yr.nullable(),editorUrl:n.string().url().max(2048),patches:n.array(PL).max(200)})]),H_=n.strictObject({id:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),clientKey:Kl,platform:Z_,label:n.string(),sha256:yr,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())}),zH=n.strictObject({key:Kl,platform:Z_,currentId:n.uuid().nullable()}),Rce=n.strictObject({rows:n.array(H_).max(100),nextCursor:n.uuid().nullable(),clients:n.array(zH).max(20)}),q_=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()}),Nce=n.strictObject({asOf:n.iso.datetime({offset:!0}),reclamation:n.literal("manual-review-required"),buckets:n.strictObject({source:q_,runtime:q_,previews:q_})}),Dce=n.strictObject({version:H_,actorId:n.uuid(),claims:n.record(n.string(),n.json())}),$ce=n.strictObject({version:H_,upload:EL.nullable()}),jce=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:yr,initialStateKey:Ht,initialRenderKey:Ht})),renders:n.array(kL)}).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"})}),Lce=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()}),Mce=n.strictObject({enabled:n.boolean(),allowedOrigins:n.array(n.string())})});var TL,RL=x(()=>{"use strict";J();_h();TL=n.strictObject({id:n.uuid(),name:n.string().trim().min(1).max(80),client:Kl,source:wh,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 K_(e){return UH.some(t=>e===t||e.startsWith(t+"."))}function W_(e){let t={};for(let[i,o]of Object.entries(Xf(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])=>!K_(i))),variables:t}}var G_,UH,fc=x(()=>{"use strict";Zt();Kr();Dw();G_=Re,UH=["parameters","answers","results","variables"]});function J_(e,t=0){return t>20?!0:!!e&&typeof e=="object"&&(Array.isArray(e)?e.some(r=>J_(r,t+1)):Object.entries(e).some(([r,i])=>["__proto__","constructor","prototype"].includes(r)||BH.test(r)||J_(i,t+1)))}var Ih,VH,Jr,BH,qH,Zn,NL,hc,Q_,xo=x(()=>{"use strict";J();Zt();Pl();Ih=n.discriminatedUnion("kind",[n.object({kind:n.literal("ledger"),cursor:Uf}).strict(),n.object({kind:n.literal("billing"),cursor:n.uuid()}).strict()]),VH=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),Jr=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"),BH=/^(?:api_?key|authorization|password|(?:customer|run|visitor|access|purchase)_?token|client_?secret|signed_?transaction|raw_?proof)$/i;qH=/gg_(?:sk|ct|fr|fv|gc)_[A-Za-z0-9_-]{20,}/,Zn=n.record(VH,Re).refine(e=>Object.keys(e).length<=20,"Too many parameters").refine(e=>!J_(e)&&!qH.test(JSON.stringify(e)),"Credentials cannot be screen parameters"),NL=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),hc=n.array(n.object({variable:NL,componentId:NL,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"),Q_=n.object({bindings:hc,answers:Jr,values:n.record(n.string(),Re).optional()}).strict()});var kh,Y_=x(()=>{"use strict";J();kh=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/)});var X_,DL,$L,eI,ZH,jL,LL,oue,aue,sue,HH,cue,Eh=x(()=>{"use strict";J();fc();xo();Y_();pr();Ni();X_=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),DL=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,128}$/),$L=Zn.refine(e=>new TextEncoder().encode(JSON.stringify(e)).byteLength<=8192,"Task data exceeds 8 KiB"),eI=n.record(X_,n.enum(["string","number","boolean","strings"])).refine(e=>Object.keys(e).length<=20,"Too many output fields"),ZH=mi,jL=n.strictObject({type:n.literal("external_task"),endpointId:n.uuid(),taskKey:X_,inputs:n.record(X_,ZH).refine(e=>Object.keys(e).length<=20),outputs:eI}),LL=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"),oue=n.strictObject({outcome:n.enum(["success","failure"]),data:$L}),aue=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("signal"),runId:n.uuid(),nodeId:DL,eventName:kh,eventId:n.uuid(),data:$L}),n.strictObject({operation:n.literal("read_results"),runId:n.uuid()})]),sue=n.strictObject({scope:yt,runId:n.uuid(),eventId:n.uuid(),accepted:n.boolean()}),HH=n.record(DL,G_),cue=n.strictObject({scope:yt,runId:n.uuid(),results:HH})});var Qr,ML,Ch=x(()=>{"use strict";Qr={flowNodes:500,logicNodes:480,pages:100,components:1500,actions:250,questions:40,documentBytes:1e6,conditionDepth:3,conditionChildren:20,conditionPredicates:100},ML="00000000-0000-0000-0000-000000000000"});var fue,tI,FL,zL,nI,UL,VL,Ph=x(()=>{"use strict";J();Zt();xo();fue=n.enum(["local","remote"]),tI=n.strictObject({port:n.string().regex(/^[a-zA-Z0-9_.:-]{1,128}$/),value:Re.optional(),sticky:n.array(n.strictObject({expected:gl.nullable(),next:gl})).max(100),exposures:n.array(Re).max(100),features:n.array(Re).max(100)}),FL=n.strictObject({type:n.literal("evaluate"),receiptId:n.uuid(),environmentId:n.uuid(),policyRevision:n.number().int().nonnegative(),attributes:nn,sticky:n.record(n.string(),gl)}),zL=FL.extend({runId:n.uuid(),versionId:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative()}),nI=FL.omit({type:!0,receiptId:!0}).extend({type:n.literal("evaluate_segment")}),UL=n.strictObject({nodeId:n.string().min(1).max(64),result:tI}),VL=nI.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:Zn,answers:Jr,variables:n.record(n.string(),Re)})});var rI,gc,Oh,Th,Rh,Nh,BL,qL,yc,bc,_a,Ia,Ac,ZL,GH,KH,iI,HL,GL,KL,ka=x(()=>{"use strict";J();Zt();rI=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"),gc=n.intersection(nn,n.looseObject({tags:rI.optional()})).refine(e=>!["id","externalUserId","createdAt","ageDays","subscription","parameters","answers","results"].some(t=>Object.hasOwn(e,t)),"Reserved customer attribute"),Oh=n.string().trim().max(80),Th=n.string().regex(/^\+[1-9]\d{1,14}$/).nullable(),Rh=n.union([n.email().max(254),n.literal("")]),Nh=n.string().trim().min(1).max(255).refine(e=>!/\p{Cc}/u.test(e),"Fingerprint must not contain control characters"),BL=n.string().trim().min(1).max(255).refine(e=>!e.startsWith("gg_guest_"),"Reserved guest identity namespace"),qL=n.object({externalUserId:BL.optional(),name:Oh.default(""),email:Rh.default(""),phone:Th.optional(),attributes:gc.default({})}).strict().refine(e=>e.externalUserId!==void 0||e.email!=="","\u8BF7\u63D0\u4F9B\u4E1A\u52A1\u7528\u6237 ID \u6216\u90AE\u7BB1"),yc=n.discriminatedUnion("type",[n.strictObject({type:n.literal("id"),value:n.uuid()}),n.strictObject({type:n.literal("externalUserId"),value:BL})]),bc=n.strictObject({name:Oh.optional(),email:Rh.optional(),phone:Th.optional(),attributes:gc.optional(),fingerprint:Nh.optional()}),_a=e=>!e.customerData||e.customer?.type==="externalUserId",Ia="customerData requires an externalUserId customer",Ac=n.object({id:n.uuid(),externalUserId:n.string().min(1).max(255).nullable(),name:Oh,email:Rh,phone:Th.optional(),attributes:gc,createdAt:n.iso.datetime()}).strict(),ZL=n.object({customer:Ac,changed:n.boolean(),replayed:n.boolean()}).strict(),GH=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()]),KH=n.object({name:Oh.optional(),email:Rh.optional(),phone:Th.optional(),attributes:gc.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:rI,remove:rI}).optional()}).strict().refine(e=>Object.keys(e).length>0,"\u8BF7\u63D0\u4F9B\u9700\u8981\u4FEE\u6539\u7684\u5B57\u6BB5"),iI=n.object({lookup:GH}).strict(),HL=iI.extend({requestId:n.uuid(),patch:KH}).strict(),GL=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(),KL=n.object({customers:Ac.array(),hasMore:n.boolean(),total:n.number().int().nonnegative().nullable(),evaluatedAt:n.iso.datetime()}).strict()});var Wl,WH,oI,kue,Eue,Cue,Jl=x(()=>{"use strict";J();Kr();Ni();Ph();pr();Zt();ka();Wl=n.discriminatedUnion("type",[n.strictObject({type:n.literal("literal"),value:Re}),n.strictObject({type:n.literal("variable"),key:Wt,path:Wr.optional()}),n.strictObject({type:n.literal("feature"),featureKey:n.string().min(1).max(128)})]),WH=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:Re}),oI={funnelId:n.uuid(),requestId:n.uuid(),customer:yc,customerData:bc.optional(),attributes:nn.refine(e=>!["parameters","answers","results","variables"].some(t=>Object.hasOwn(e,t)),"parameters, answers, results and variables are reserved flow namespaces")},kue=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("decide"),...oI}).refine(_a,Ia),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:tI}),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(UL).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()})]),Eue=n.strictObject({scope:yt,decisionId:n.uuid(),requestId:n.uuid(),status:n.enum(["pending","completed","failed"]),decision:WH.nullable(),evaluation:n.discriminatedUnion("type",[zL,VL]).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"),Cue=n.strictObject({scope:yt,decisionId:n.uuid(),eventId:n.uuid(),source:n.literal("caller_reported")})});var WL,JH,Due,$ue,aI=x(()=>{"use strict";J();Zt();lo();Ni();WL=n.strictObject({type:n.literal("bundle"),paywall:mi.optional(),offering:mi.optional(),coupons:mi,data:mi}),JH=e=>n.strictObject({type:n.literal(e),id:n.uuid()}),Due=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:Re}),$ue=n.strictObject({type:n.literal("bundle"),offering:JH("offering_version").nullable(),paywall:n.strictObject({versionId:n.uuid(),paywallId:n.uuid(),offeringVersionId:n.uuid()}).nullable(),coupons:n.array(yl).max(20),data:Re})});var JL,QH,YH,QL,sI=x(()=>{"use strict";J();Ni();JL=n.union([n.string(),n.number().finite(),n.boolean(),n.null()]),QH=n.union([JL,n.array(JL).min(1).max(20)]),YH=n.record(Wr,QH).refine(e=>Object.keys(e).length<=10),QL=n.strictObject({path:Wr,type:n.enum(["string","number","boolean","strings"]),nullable:n.boolean().optional(),aggregation:n.enum(["count","exists"]).optional(),where:YH.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 XH,YL,eG,XL,cI=x(()=>{"use strict";J();Eh();Ni();sI();XH=["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"],YL=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/),eG=mi,XL=n.discriminatedUnion("type",[jL,n.strictObject({type:n.literal("claim_offer"),coupon:mi}),n.strictObject({type:n.literal("event"),event:YL}),n.strictObject({type:n.literal("api"),operation:n.enum(XH),inputs:n.record(Wr,eG).refine(e=>Object.keys(e).length<=40),outputs:n.record(YL,QL).refine(e=>Object.keys(e).length<=20)})])});function Dh(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 iG(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>Qr.pages||e.nodes.filter(d=>!["screen","entry","end","output"].includes(d.type)).length>Qr.logicNodes)&&o("Flow node limit exceeded","budget");let a=new Set;for(let d of e.nodes){for(let p of Dh(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 Dh(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,tG,br,nG,uI,lI,rG,dI,xc,Ql=x(()=>{"use strict";J();_h();RL();Eh();Y_();Ch();Jl();aI();cI();uc();Zt();Kr();fc();$t=kh,tG=n.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/),br={id:$t,name:n.string().trim().min(1).max(80),position:n.strictObject({x:n.number().finite(),y:n.number().finite()}).optional()},nG={success:$t,cancel:$t,unavailable:$t,failure:$t},uI=n.url().max(2048).refine(e=>{try{return new URL(e).protocol==="https:"}catch{return!1}},{message:"External pages require HTTPS"}),lI=n.enum(["same_window","new_window"]),rG=n.discriminatedUnion("type",[n.strictObject({...br,type:n.literal("entry"),next:$t,triggers:n.array(TL).max(20).refine(e=>new Set(e.map(t=>t.id)).size===e.length,"Entry trigger IDs must be unique").optional()}),n.strictObject({...br,type:n.literal("screen"),screenId:$t,presentation:Di,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({...br,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({...br,type:n.literal("coupon"),couponId:n.uuid(),writes:n.strictObject({value:Wt}),next:$t}),n.strictObject({...br,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({...br,type:n.literal("output"),value:n.discriminatedUnion("type",[...Wl.options,WL,n.strictObject({type:n.literal("selection"),screenId:$t,offeringKey:Wt})])}),n.strictObject({...br,type:n.literal("condition"),cases:n.array(n.strictObject({condition:Bn,target:$t})).min(1).max(50),default:$t}),n.strictObject({...br,type:n.literal("feature"),featureKey:n.string().min(1).max(128),writes:n.strictObject({value:Wt}),next:$t}),n.strictObject({...br,type:n.literal("split"),experimentId:n.uuid(),applyPageExperiment:n.literal(!0).optional(),routes:n.record(tG,$t).refine(e=>Object.keys(e).length>=2&&Object.keys(e).length<=20),notParticipating:$t}),n.strictObject({...br,type:n.literal("action"),...nG,execution:LL,action:XL,writes:c_.optional()}),n.strictObject({...br,type:n.literal("external_page"),appManifest:wh.optional(),url:uI,openIn:lI,opened:$t,failed:$t}),n.strictObject({...br,type:n.literal("end"),outcome:n.enum(["completed","closed","ineligible","failed"]),output:Wl.optional()}),n.strictObject({...br,type:n.literal("wait"),writes:c_.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:eI,timeoutSeconds:n.number().int().min(1).max(2592e3),received:$t,timeout:$t})])})]),dI=n.strictObject({version:n.literal(5),entry:$t,nodes:n.array(rG).min(1).max(Qr.flowNodes)}),xc=dI.superRefine((e,t)=>{iG(e,r=>t.addIssue({code:"custom",message:r.message,path:r.path,params:{reason:r.reason}}))})});var pI,mI=x(()=>{"use strict";pI={maxTransitions:1e4,runTimeoutSeconds:2592e3}});function e2(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 co(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 fI=x(()=>{"use strict";fc()});var Sc,$h,ple,gI,Yl,Xl,t2,mle,Ea,hI,fle,ed=x(()=>{"use strict";J();Zt();ic();Sc=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,127}$/),$h=e=>n.record(n.string(),Re).refine(t=>gr(t)<=e,"Funnel evidence exceeds its byte budget"),ple=n.enum(["local_segment","evaluation","presentation","timer","event","operation"]),gI=n.enum(["entry","presentation","decision","configuration","capability","wait","terminal"]),Yl=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()})]),Xl=n.strictObject({schemaVersion:n.literal(1),kind:gI,selector:Yl.nullable(),context:$h(131072),contract:n.strictObject({version:n.number().int().positive(),evaluator:n.string().min(1).max(128),policyRevision:n.number().int().nonnegative()})}).refine(e=>gr(e)<=131072,"Node input exceeds its byte budget"),t2=n.strictObject({schemaVersion:n.literal(1),kind:gI,outcome:n.enum(["success","cancel","failure","unavailable","elapsed","received","timeout","not_participating"]),data:$h(131072),route:n.string().regex(/^[a-zA-Z0-9_.-]{1,128}$/).nullable(),evidence:$h(131072)}).refine(e=>gr(e)<=131072,"Node result exceeds its byte budget"),mle=n.strictObject({schemaVersion:n.literal(1),operations:n.record(Sc,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:Sc,id:n.uuid()}).nullable()}))}).refine(e=>gr(e)<=65536,"Execution state exceeds its byte budget"),Ea={receiptId:n.uuid()},hI=n.iso.datetime({offset:!0}),fle=n.discriminatedUnion("type",[n.strictObject({type:n.literal("node_entered"),details:n.strictObject({kind:gI})}),n.strictObject({type:n.literal("presentation_shown"),details:n.strictObject({...Ea,source:n.literal("client"),occurredAt:hI.optional()})}),n.strictObject({type:n.literal("decision_accepted"),details:n.strictObject(Ea)}),n.strictObject({type:n.literal("signal_received"),details:n.strictObject({signalId:n.uuid(),nodeId:Sc,eventName:Sc,data:$h(8192),source:n.literal("server"),occurredAt:hI})}),n.strictObject({type:n.literal("signal_consumed"),details:n.strictObject({...Ea,signalId:n.uuid()})}),n.strictObject({type:n.literal("wait_elapsed"),details:n.strictObject(Ea)}),n.strictObject({type:n.literal("wait_timeout"),details:n.strictObject(Ea)}),n.strictObject({type:n.literal("operation_completed"),details:n.strictObject({...Ea,operation:Sc,reference:n.strictObject({type:Sc,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({...Ea,source:n.enum(["client","server"]),occurredAt:hI,reference:n.string().min(1).max(128).optional()})})])});function aG(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 Lh(e){return Array.isArray(e)?e.some(Lh):!e||typeof e!="object"?!1:Object.entries(e).some(([t,r])=>t==="productVersionId"?r===ML:Lh(r))}function sG(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=IL(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&&!Tn(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}),aG(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"&&Lh(o.value.value)||o.type==="end"&&o.output?.type==="literal"&&Lh(o.output.value))&&t.push({message:"Checkout outputs require a Product Version",reason:"product",path:a})}return t}function r2(e,t){for(let{message:r,reason:i,path:o}of sG(e))t.addIssue({code:"custom",message:r,path:o,params:{reason:i}})}function i2(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 j=e.variables[F],U=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;(j?.source.type!=="node"||U&&j.type!==U)&&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}Ri(I.document).some(U=>!U.complete)&&r("Owned screens require complete local content","translations",g);let j=new Set(I.document.actions.map(U=>U.id));(j.size!==Object.keys(m.outputs).length||Object.keys(m.outputs).some(U=>!j.has(U)))&&r("Every screen action requires exactly one outcome route","buttonOutputs",g),ho(F.root,U=>{!m.offering&&(U.type==="plan_picker"||(U.type==="stack"||U.type==="button")&&U.bind?.plan||U.type==="customer_data"&&["customer_plans","credit_packs"].includes(U.data.source))&&r("Product presentation requires an Offering Version","offering",g),U.type==="customer_data"&&Object.values(U.data.outputs??{}).some(Z=>Z!==void 0&&!j.has(Z))&&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"&&!Pr(e.outputSchema,m.output.value)&&r("Terminal output does not match outputSchema","output",g),m.type==="output"&&m.value.type==="literal"&&!Pr(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&&!u_(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 p_(I.document))(/^(input|params)\./.test(F)||F.startsWith("variables.")&&!d_(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 Oi(I.condition))a("saved_group",F)||r("Conditions require explicit Saved Group references","savedGroup",g);for(let F of co(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 j=m.value[I];if(j)if(j.source==="literal"){let U=I==="coupons"?j.value:[j.value];(!Array.isArray(U)||U.length>20||U.some(Z=>!Pr({type:F,nullable:!1},Z)||!a(F,Z.id))||I==="coupons"&&new Set(U.map(Z=>Z.id)).size!==U.length)&&r("Bundle requires distinct scoped resource references",I==="coupons"?"coupon":I==="paywall"?"paywall":"offering",[...g,"value",I])}else{let U=e.variables[j.key];(j.path||!U||U.nullable||(I==="coupons"?U.type!=="array"||U.items?.type!=="reward"||U.items.nullable:U.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=[...e2(m,u),...g?.type==="owned"?eh(g.document).map(C=>d_(C,u)?.key??C):[]];for(let C of new Set(A)){let F=function(j){if(j===m.id)return!0;if(I.has(j))return!1;I.add(j);let U=e.graph.nodes.find(Q=>Q.id===j);return U?(E.has(j)?U.type==="action"?[U.cancel,U.unavailable,U.failure]:U.type==="wait"&&U.wait.type==="event"?[U.wait.timeout]:[]:Dh(U)).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(j=>j.screenId===m.screenId&&j.variable===C)||w.source.type==="parameter"||w.source.type==="attribute")continue;let E=w.source.type==="input"?new Set(e.inputs.filter(j=>j.variable===C&&j.required).flatMap(j=>s.filter(U=>U.screenId===j.screenId).map(U=>U.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"?Tn(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)ho(m.root,()=>{d++});p+=f.document.actions.length}(d>Qr.components||p>Qr.actions||gr(e)>Qr.documentBytes)&&r("Funnel document exceeds its budget","budget")}var Tr,oG,yI,n2,cG,So,uG,Nle,jh,td,lG,dG,vc,wc=x(()=>{"use strict";J();ua();xh();dc();h_();Cr();Ql();Ch();mI();ic();Kr();th();Kr();fI();ed();ka();Zt();xo();Tr=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),oG=n.discriminatedUnion("type",[n.strictObject({id:Tr,type:n.literal("owned"),publicData:bL.optional(),document:ln.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:Tr,type:n.literal("paywall"),paywallVersionId:n.uuid()})]),yI={kind:n.literal("funnel"),schemaVersion:n.literal(4),screens:n.array(oG).max(Qr.pages),references:n.record(Tr,Yl).refine(e=>Object.keys(e).length<=500),inputs:n.array(n.strictObject({variable:Tr,screenId:Tr,componentId:Tr,required:n.boolean()})).max(Qr.questions),variables:n.record(Wt,nc).refine(e=>Object.keys(e).length<=Qr.logicNodes),outputSchema:tc,execution:n.strictObject({runTimeoutSeconds:n.number().int().min(1).max(pI.runTimeoutSeconds),maxTransitions:n.number().int().min(1).max(pI.maxTransitions)})},n2=n.strictObject({...yI,graph:dI});cG=n.strictObject({...yI,graph:xc}).superRefine(i2),So=n.strictObject({...yI,graph:xc,displayName:n.string().trim().min(1).max(80)}).superRefine(i2),uG=So.superRefine(r2),Nle=cG.superRefine(r2),jh=n.string().regex(ro),td={requestId:n.uuid(),nodeId:Tr,visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),customerToken:jh.optional()},lG=n.discriminatedUnion("type",[n.strictObject({type:n.literal("screen"),output:Tr,answers:Jr,selection:n.record(Tr,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:Tr,productVersionId:n.uuid(),offerId:n.uuid().optional(),nativeOffer:ac.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"])})]),dG=n.object({nodeId:Tr,visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative(),components:n.record(Tr,n.object({resourceKey:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/).optional(),page:n.number().int().min(1).max(1e5),after:Ih.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(),vc=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("start"),funnelId:n.uuid(),requestId:n.uuid(),customer:yc.optional(),customerData:bc.optional(),locale:n.string().min(1).max(35),parameters:Zn}).refine(_a,Ia),n.strictObject({operation:n.literal("get"),settlementRequestId:n.uuid().optional(),data:dG.optional(),purchase:n.strictObject({receiptId:n.uuid(),operationId:n.uuid()}).optional(),customerToken:jh.optional()}),n.strictObject({operation:n.literal("resume"),requestId:n.uuid(),customerToken:jh.optional()}),n.strictObject({operation:n.literal("submit"),...td,input:lG}),n.strictObject({operation:n.literal("back"),...td}),n.strictObject({operation:n.literal("shown"),...td}),n.strictObject({operation:n.literal("close"),...td}),n.strictObject({operation:n.literal("commit_segment"),...td,policyRevision:n.number().int().nonnegative(),generation:n.string().min(1).max(256)}),n.strictObject({operation:n.literal("review"),receiptId:n.uuid().optional(),customerToken:jh.optional()})])});function Mh(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 Oi(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&&K_(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 bI=x(()=>{"use strict";Zt();fc()});function nd(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 AI=x(()=>{"use strict"});function o2(e,t){let r=[],i={};un(e,o=>{if(o.hidden)return!1;if(o.type!=="quantity_picker")return;let a=o.bind?.plan?[o.bind.plan]:[];o.bind?.picker&&un(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 _c(e,t,r,i){let o=i.plans[t];if(!o?.available)throw new Error("Selected Product is unavailable");let a={};if(un(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 pG(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:Fs({quantity:r,unitAmountMinor:i.amountMinor,...i.pricing?{pricing:i.pricing}:{}}),allowance:Vs(e.includedAmount,e.terms.units,r)}}function rd(e,t,r,i){let o=!1;if(un(e,c=>{c.type==="quantity_picker"&&(o=!0)}),!o)return t;let a=structuredClone(t);a.quantities={};let s=new Map;un(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=pG(d,l.currency,m);A.label=`${new Intl.NumberFormat(i).format(Number(C.allowance))} ${d.name}${["week","month","year"].includes(d.reset)?nd(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=Ds(u,l.currency,i);l.price=d;for(let[p,h]of Object.entries(a.nodes)){let f=Tn(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,Ds(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 Fh=x(()=>{"use strict";dl();zs();Cr();qt();AI();Xw()});var a2,xI=x(()=>{"use strict";J();Gs();a2=n.object({defaultLocale:qn,locales:n.record(qn,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 mG,fG,s2,zh,hG,gG,yG,bG,AG,xG,c2,u2,SI=x(()=>{"use strict";J();Fh();qt();dc();lo();xI();yh();hh();xh();Cr();uc();mG=["customer_data","coupon_code"],fG=n.string().min(1).max(255).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/),s2=n.string().min(1).max(255).regex(/^[a-z0-9][a-z0-9-]*$/),zh=(e,t)=>new Set(e.map(t)).size===e.length,hG=n.strictObject({currency:Te,amountMinor:n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}),gG=n.strictObject({featureId:n.uuid(),name:n.string().trim().min(1).max(120),allowance:n.string().max(40).nullable(),access:n.boolean()}),yG=n.strictObject({stripe:n.strictObject({prices:n.array(hG).min(1).max(50)}).optional(),apple:n.strictObject({productIds:n.array(fG).min(1).max(10)}).optional(),google:n.strictObject({products:n.array(n.strictObject({productId:s2,basePlanId:s2.nullable()})).min(1).max(10)}).optional()}).superRefine((e,t)=>{(e.stripe&&!zh(e.stripe.prices,r=>r.currency)||e.apple&&!zh(e.apple.productIds,r=>r)||e.google&&!zh(e.google.products,r=>`${r.productId}:${r.basePlanId}`))&&t.addIssue({code:"custom",message:"Duplicate channel entry"})}),bG=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(gG).max(50).refine(e=>zh(e,t=>t.featureId),"Duplicate benefit"),channels:yG,prepaid:n.array(Rl).max(100).optional()}),AG=n.strictObject({digest:Ao,content:n.strictObject({discount:uo,duration:fr,appliesTo:Lw,displayCopy:a2.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()})}),xG=n.discriminatedUnion("type",[n.strictObject({type:n.literal("checkout"),product:gh}),n.strictObject({type:n.literal("close")}),n.strictObject({type:n.literal("action"),action:$_})]),c2=n.strictObject({kind:n.literal("paywall"),formatVersion:n.literal(1),name:n.string().trim().min(1).max(80),offeringVersionId:n.uuid(),presentation:Di,screen:ln,products:fh,catalog:n.record(n.uuid(),bG),buttons:n.record(lt,xG),coupons:n.record(n.uuid(),AG)}).superRefine((e,t)=>{let r=g=>t.addIssue({code:"custom",message:g}),{screen:i}=e;o2(i,e.catalog).forEach(r),i.surface!=="paywall"&&r("Screen must be a Paywall"),V_(i,mG).forEach(r),Ri(i).some(g=>!g.complete)&&r("Every published locale must be complete");let o=new Set,a=new Set,s=new Set;un(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")}),u2=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 In(e){if(Array.isArray(e))return`[${e.map(In).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)}:${In(i)}`).join(",")}}`;let t=JSON.stringify(e);if(t===void 0)throw new Error("Configuration must contain JSON values");return t}function EI(e){return Bs(Zs(typeof e=="string"?new TextEncoder().encode(e):e))}function d2(e){return EI(In(e))}function p2(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=Mh(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||!Pr(l,p)))throw new Error("GB Feature values violate the Funnel type contract")}let o=new Set,a=s=>{for(let c of Oi(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 of c.variations)if(typeof u!="string"||!Object.hasOwn(s.routes,u))throw new Error("Experiment variation has no declared Funnel route")}return l2.parse({features:Object.keys(r.features).sort(),experiments:Object.fromEntries(Object.entries(r.experiments).map(([s,c])=>[s,c.variations.map(String)])),savedGroups:[...o].sort()})}function m2(e){return So.parse(e)}var Rr,vI,wI,_I,l2,II,SG,kI,CI=x(()=>{"use strict";J();Cf();qs();pr();dc();Ah();wc();bI();Zt();SI();Rr={manifestCdnSeconds:15,maxControlAgeMs:6e4,initializationMs:5e3,maxArtifactBytes:1048576,maxManifestBytes:524288,maxCacheBytes:32*1048576,retentionMs:7*864e5},vI=n.string().regex(/^[a-f0-9]{64}$/),wI=n.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),_I=yt.extend({environmentId:n.uuid()}),l2=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)}),II=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:vI,byteLength:n.number().int().positive().max(Rr.maxArtifactBytes),generation:vI.optional()}),SG=n.strictObject({state:n.enum(["active","paused","archived"]),controlRevision:wI,evaluationMode:n.enum(["local","remote"]),evaluationRevision:wI,currentVersionId:n.uuid(),versions:n.record(n.uuid(),n.strictObject({artifact:n.string(),dependencies:l2,definitionDigest:Ao.optional(),couponDigests:n.record(n.uuid(),Ao).optional()}))}),kI=n.strictObject({kind:n.literal("sdk_configuration"),schemaVersion:n.literal(1),scope:_I,revision:wI,generation:vI,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(),II),funnels:n.record(n.uuid(),SG),paywalls:n.record(n.uuid(),u2).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 f2,vo,id,Uh=x(()=>{"use strict";f_();J();Nl();Ys();yh();CI();fo();f2=n.strictObject({...oc,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:mo.optional()}),vo=n.strictObject({id:n.uuid(),paywallId:n.uuid(),version:n.number().int().positive(),document:lc.omit({requirement:!0,offeringId:!0}),offering:n.strictObject({id:n.uuid()}),content:n.strictObject({environmentId:n.uuid(),offeringVersionId:n.uuid(),artifact:II.refine(e=>e.kind==="paywall"&&e.formatVersion===1)}).optional(),capabilities:Xs,check:Hr.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"})}),id=n.strictObject(vo.shape).omit({document:!0,offering:!0}).extend({content:vo.shape.content.unwrap()})});var h2,g2,PI,y2,OI=x(()=>{"use strict";J();_n();Pl();h2={requestId:n.uuid(),sourceId:n.uuid(),expectedAvailable:On},g2=n.discriminatedUnion("action",[n.strictObject({...h2,action:n.enum(["add","subtract","set_remaining"]),amount:$e}),n.strictObject({...h2,action:n.literal("edit"),granted:$e,expiresAt:n.iso.datetime({offset:!0}).nullable(),nextResetAt:n.iso.datetime({offset:!0}).nullable(),expectedRevision:n.number().int().nonnegative()})]),PI=n.strictObject({sourceId:n.uuid(),available:On,held:On,spent:On,adjustmentGrantId:n.uuid().nullable()}),y2=PI.extend({granted:On,expiresAt:n.iso.datetime({offset:!0}).nullable(),nextResetAt:n.iso.datetime({offset:!0}).nullable(),revision:n.number().int().nonnegative()})});var b2,A2,TI=x(()=>{"use strict";J();b2=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()]),A2=n.object({id:n.uuid(),externalId:n.string().min(1).max(128),name:n.string().min(1).max(80),archived:n.boolean()}).strict()});var S2,x2,RI,Ca,vG,NI,Dde,DI=x(()=>{"use strict";J();S2=["input","output","cache_read","cache_write","reasoning","input_audio","output_audio"],x2=n.string().regex(/.+\/.+/),RI=n.number().min(-100),Ca=n.string().regex(/^(0|[1-9]\d{0,5})(\.\d{1,12})?$/),vG=n.strictObject({input:Ca,output:Ca,cache_read:Ca.optional(),cache_write:Ca.optional(),reasoning:Ca.optional(),input_audio:Ca.optional(),output_audio:Ca.optional()}),NI=(e,t)=>n.record(e,t).refine(r=>Object.keys(r).length<=100,"At most 100 AI overrides"),Dde=n.strictObject({defaultMarkup:RI,providerMarkups:NI(n.string().min(1),RI),modelMarkups:NI(x2,RI),customModels:NI(x2,vG.partial())})});var Pa,wo,wG,v2,_G,Oa,w2,Vh=x(()=>{"use strict";J();Pa=n.iso.datetime({offset:!0}),wo=n.string().regex(/^-?(0|[1-9]\d{0,23})(\.\d{1,12})?$/),wG=n.discriminatedUnion("kind",[n.object({kind:n.literal("absolute"),from:Pa,to:Pa}).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()]),v2=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"),_G=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(),Oa=n.object({range:wG,timezone:v2,filterBy:n.array(_G).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:Pa,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)"})}),w2=n.object({from:Pa,to:Pa,interval:n.enum(["hour","day","week","month"]),timezone:v2,rows:n.array(n.object({bucket:Pa,group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid(),resourceId:n.uuid(),consumedUnits:wo,refundedUnits:wo,reservedUnits:wo,charged:wo,refunded:wo,reserved:wo,netUnits:wo,netCharged:wo}).strict()).max(100),nextCursor:n.object({bucket:Pa,group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid(),resourceId:n.uuid()}).strict().nullable()}).strict()});var Ic,_2,$I,I2,k2,jI=x(()=>{"use strict";J();DI();Vh();Ic=n.string().regex(/^(0|[1-9]\d{0,29})$/),_2=n.string().regex(/^(0|[1-9]\d{0,29})(\.\d{1,18})?$/),$I=n.strictObject({bucket:n.iso.datetime({offset:!0}),group:n.string().max(240),isOther:n.boolean(),internal_feature_id:n.uuid()}),I2=n.strictObject({...Oa.shape,groupBy:n.union([n.enum(["customer","entity","entitlement"]),n.string().regex(/^properties\.[a-z][a-z0-9_]{0,63}$/)]),after:$I.nullable()}).superRefine((e,t)=>{let r=Oa.safeParse({...e,after:null});if(!r.success)for(let i of r.error.issues)t.addIssue({code:"custom",path:i.path,message:i.message})}),k2=n.strictObject({from:n.iso.datetime({offset:!0}),to:n.iso.datetime({offset:!0}),interval:Oa.shape.interval,timezone:Oa.shape.timezone,rows:n.array(n.strictObject({...$I.shape,eventCount:Ic,units:_2,tokenEventCount:Ic,tokens:n.strictObject(Object.fromEntries(S2.map(e=>[e,Ic]))),totalTokens:Ic,providerCostEventCount:Ic,providerCostUsd:_2,invalidTelemetryEventCount:Ic})).max(100),nextCursor:$I.nullable()})});var E2,C2,P2,LI=x(()=>{"use strict";J();Ws();E2=n.object({requestId:n.uuid(),items:n.array(n.object({customerId:n.uuid(),command:Il.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"),C2=n.object({batchId:n.uuid(),after:n.number().int().min(-1).max(999),limit:n.number().int().min(1).max(100)}).strict(),P2=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:kl.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 IG,O2,T2,R2,kG,EG,CG,PG,N2,D2,MI,$2,j2,OG,TG,Kde,Wde,Jde,L2,M2,F2,RG,z2,U2,V2,Qde,Yde,NG,DG,Xde,epe,FI=x(()=>{"use strict";J();qt();lo();IG=n.enum(["percentage_discount","fixed_discount","free_product","invoice_credits","feature_grant"]),O2=n.enum(["draft","active","paused","archived"]),T2=n.string().min(1).max(256),R2=n.array(T2).max(50).refine(e=>new Set(e).size===e.length,"Duplicate products"),kG=n.strictObject({duration:n.enum(["day","week","month","year"]),length:n.number().int().min(1).max(3660)}),EG=n.strictObject({internal_feature_id:n.uuid(),allowance:n.number().nonnegative().max(1e15).nullable(),expiry:kG.nullable()}),CG=n.discriminatedUnion("type",[n.strictObject({type:n.literal("feature_grant"),grants:n.array(EG).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:T2,duration:fr}),n.strictObject({type:n.literal("invoice_credits"),amount:n.number().positive().max(1e8),duration:fr,rollover:n.boolean(),productIds:R2})]),PG=n.string().regex(/^[a-zA-Z0-9_-]{1,64}$/),N2=n.object({key:PG,name:n.string().trim().min(1).max(80),configuration:CG}).strict(),D2=n.string().regex(/^[A-Z0-9][A-Z0-9_-]{2,31}$/),MI=n.object({code:D2,maxUses:n.number().int().min(1).max(1e6).nullable(),firstPurchaseOnly:n.boolean()}).strict(),$2=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:R2,excludeTrial:n.boolean()}).strict().refine(e=>e.redeemOn==="checkout"||e.productIds.length===0&&!e.excludeTrial,"Purchase restrictions require checkout trigger"),j2={id:n.uuid(),projectId:n.uuid(),environmentId:n.uuid(),revision:n.number().int().nonnegative(),status:O2,createdAt:n.iso.datetime({offset:!0}),updatedAt:n.iso.datetime({offset:!0})},OG=N2.extend(j2).strict(),TG=$2.safeExtend(j2).strict(),Kde=n.strictObject({id:n.uuid(),key:n.string(),name:n.string(),type:IG,status:O2}),Wde=n.discriminatedUnion("action",[n.object({action:n.literal("save"),id:n.uuid().nullable(),revision:n.number().int().nonnegative(),input:N2}).strict(),n.object({action:n.enum(["activate","pause","resume","archive","delete"]),id:n.uuid(),revision:n.number().int().nonnegative()}).strict()]),Jde=n.discriminatedUnion("action",[n.object({action:n.literal("save"),id:n.uuid().nullable(),revision:n.number().int().nonnegative(),input:$2}).strict(),n.object({action:n.enum(["activate","pause","resume","archive","delete"]),id:n.uuid(),revision:n.number().int().nonnegative()}).strict()]),L2=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(),M2=n.object({code:D2,requestId:n.uuid()}).strict(),F2=n.strictObject({redemptionId:n.uuid(),currency:Te,requestId:n.uuid(),accepted:n.literal(!0)}),RG=n.strictObject({type:n.literal("checkout"),orderId:n.uuid(),productVersionId:n.uuid(),currency:Te,duration:fr,renewalAmountMinor:n.number().int().positive().max(1e8),status:n.enum(["created","pending","trialing","paid","cancelled","failed"]),url:n.url().nullable()}),z2=n.discriminatedUnion("type",[RG,n.strictObject({type:n.literal("subscription"),operationId:n.uuid(),membershipId:n.uuid(),productVersionId:n.uuid(),currency:Te,duration:fr,renewalAmountMinor:n.number().int().positive().max(1e8),status:n.enum(["pending","running","applied","failed"])})]),U2=n.object({programId:n.uuid(),requestId:n.uuid()}).strict(),V2=n.object({id:n.uuid(),programId:n.uuid(),code:MI.shape.code,createdAt:n.iso.datetime({offset:!0})}).strict(),Qde=n.object({rows:n.array(OG).max(100),nextCursor:n.uuid().nullable()}).strict(),Yde=n.object({rows:n.array(TG).max(100),nextCursor:n.uuid().nullable()}).strict(),NG=MI.extend({id:n.uuid(),redemptions:n.number().int().nonnegative()}).strict(),DG=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})}),Xde=n.object({codes:n.array(NG).max(100),redemptions:n.array(DG).max(100),customers:n.record(n.uuid(),n.string()),codesCursor:n.uuid().nullable(),redemptionsCursor:n.uuid().nullable()}).strict(),epe=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 fi,od,zI,$G,ad,jG,B2,q2,Z2,rpe,H2,LG,G2,MG,UI,VI,FG,zG,UG,ipe,BI=x(()=>{"use strict";J();fi={repositories:20,branches:4,keys:2e3,references:1e4,referencesPerKey:2e3,reportBytes:1048576,files:1e4,sourceBytes:1e8},od=e=>new Set(e).size===e.length,zI=n.string().regex(/^[a-zA-Z0-9_.:|-]{1,256}$/),$G=n.string().max(512).regex(/^[\w.-]+(?:\/[\w.-]+){1,5}$/).refine(e=>!e.split("/").some(t=>t==="."||t==="..")),ad=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"))),jG=n.string().min(1).max(512).refine(e=>!/[\\\u0000-\u001f\u007f]/.test(e)&&!e.startsWith("/")&&!e.split("/").some(t=>!t||t==="."||t==="..")),B2=n.string().min(1).max(256).regex(/^[a-zA-Z0-9_./*?-]+$/).refine(e=>!e.startsWith("/")&&!e.split("/").some(t=>!t||t==="."||t==="..")),q2=n.strictObject({id:n.uuid(),repo:$G,platform:n.enum(["github","gitlab","bitbucket"]),branches:n.array(ad).min(1).max(4).refine(od),workflow:n.string().regex(/^\.github\/workflows\/[a-zA-Z0-9_-]+\.ya?ml$/),keyIds:n.array(n.uuid()).min(1).max(4).refine(od),include:n.array(B2).min(1).max(16),exclude:n.array(B2).max(16),methods:n.array(n.string().regex(/^[a-zA-Z_$][\w$]{0,63}$/)).min(1).max(32).refine(od),maxAgeHours:n.number().int().min(1).max(720)}),Z2=q2.extend({revision:n.number().int().positive()}),rpe=n.strictObject({repository:q2,expectedRevision:n.number().int().min(0)}).refine(({repository:e})=>e.platform==="gitlab"||e.repo.split("/").length===2,{path:["repository","repo"]}),H2=n.strictObject({repositoryId:n.uuid(),branch:ad}),LG=n.array(zI).max(fi.keys).refine(od),G2=n.strictObject({repository:Z2.omit({keyIds:!0}),branch:ad,keys:LG,keySetHash:n.string().regex(/^[a-f0-9]{64}$/)}),MG=n.strictObject({filePath:jG,startingLineNumber:n.number().int().min(1).max(1e7)}),UI=n.strictObject({protocol:n.literal(1),repositoryId:n.uuid(),branch:ad,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(fi.files),sourceBytes:n.number().int().min(0).max(fi.sourceBytes),unresolvedCalls:n.number().int().min(0).max(1e6),unsupportedFiles:n.number().int().min(0).max(fi.files)}),features:n.array(n.strictObject({key:zI,refs:n.array(MG).max(fi.referencesPerKey)})).max(fi.keys)}).superRefine((e,t)=>{od(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)>fi.references&&t.addIssue({code:"custom",path:["features"],message:"Reference budget exceeded"})}),VI=n.strictObject({scanId:n.uuid(),commit:n.string(),receivedAt:n.string(),references:n.number().int().nonnegative(),removedReferences:n.number().int().nonnegative()}),FG=VI.extend({repositoryId:n.uuid(),branch:ad,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:UI.shape.coverage}),zG=n.strictObject({repositories:n.array(Z2).max(fi.repositories),scans:n.array(FG).max(fi.repositories*fi.branches)}),UG=n.strictObject({key:zI,references:n.number().int().nonnegative(),coveredTargets:n.number().int().nonnegative(),expiredTargets:n.number().int().nonnegative(),uncertainTargets:n.number().int().nonnegative()}),ipe=n.strictObject({available:n.boolean().default(!0),settings:zG,expectedTargets:n.number().int().min(0).max(80),features:n.array(UG).max(2001),truncated:n.boolean()})});var VG,BG,K2,W2,qI=x(()=>{"use strict";J();nl();VG=n.enum(["checkout.session.completed","checkout.session.expired","checkout.session.async_payment_succeeded","checkout.session.async_payment_failed","customer.subscription.created","customer.subscription.updated","customer.subscription.deleted","customer.subscription.paused","customer.subscription.resumed","invoice.created","invoice.paid","customer.discount.created","customer.discount.updated","refund.created","refund.updated","refund.failed","charge.refunded"]),BG=n.strictObject({provider:n.literal("stripe"),accountId:n.string().regex(/^acct_[A-Za-z0-9]+$/),eventId:n.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,199}$/),type:VG,occurredAt:n.number().int().positive().max(Number.MAX_SAFE_INTEGER),data:n.record(n.string(),n.unknown()).and(n.object({id:n.string().min(1).max(255),object:n.enum(["checkout.session","subscription","invoice","discount","refund","charge"]),livemode:n.boolean()}))}),K2=n.union([BG,KR]),W2=n.strictObject({id:n.uuid(),eventId:n.string().min(1).max(200),source:n.literal("merchant"),providerVerified:n.literal(!1),outcome:n.string().min(1).max(100)})});var Q2,Y2,X2,eM,J2,tM,ZI=x(()=>{"use strict";J();Q2={customerId:n.uuid(),eventId:n.string().trim().min(1).max(200),grantId:n.uuid(),occurredAt:n.iso.datetime({offset:!0})},Y2=n.strictObject({...Q2,productVersionId:n.uuid(),subscriptionId:n.string().trim().min(1).max(255)}),X2=n.strictObject({...Q2,merchandiseId:n.uuid()}),eM=n.union([Y2,X2]),J2={id:n.uuid(),couponId:n.uuid(),status:n.literal("redeemed"),source:n.literal("merchant"),recordedAt:n.iso.datetime({offset:!0})},tM=n.union([Y2.extend(J2),X2.extend(J2)])});var nM,qG,HI,ZG,rM,mpe,iM,GI,oM,kc,aM,KI=x(()=>{"use strict";J();rh();rh();nM=Tj,qG=nM.extend({invoice_id:nM.shape.invoice_id.meta({description:"The Indiana invoice ID to void and replace.",example:"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"})}),HI=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()}),ZG=HI.extend({id:n.string().min(1).max(255),created_at:n.number().nullable()}),rM=n.strictObject({items:n.array(ZG).max(50),nextCursor:n.uuid().nullable()}),mpe=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),requestId:n.uuid(),values:HI}),n.strictObject({action:n.literal("update"),id:n.string().min(1).max(255),values:HI}),n.strictObject({action:n.literal("delete"),id:n.string().min(1).max(255)})]),iM=n.discriminatedUnion("action",[n.strictObject({action:n.literal("create"),requestId:n.uuid(),params:sc}),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:qG})]),GI=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()}),oM=GI.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)}),kc=n.strictObject({taskId:n.uuid(),status:n.enum(["ready","running","done","dead"]),invoice:GI.nullable(),errorCode:n.string().nullable()}),aM=n.strictObject({items:n.array(GI).max(50),nextCursor:n.uuid().nullable(),operations:n.array(kc).max(50),operationsLimited:n.boolean()})});function cM(){return le.extend({offer:yl.nullable(),reason:c$.nullable()})}var HG,sM,ime,le,GG,KG,ie,ome,uM=x(()=>{"use strict";ua();Yw();m_();f_();_n();_n();S_();__();k_();E_();P_();O_();bf();Ys();mh();D_();Uh();Nl();OI();zf();TI();Zw();jI();Vh();LI();FI();Ws();Pl();Qw();xl();J();R0();BI();Gw();Bl();pr();qI();ka();lo();ZI();Ah();KI();HG=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"]),sM={scope:yt,permissions:n.array(HG),expiresAt:n.iso.datetime().nullable()},ime=n.discriminatedUnion("kind",[n.object({...sM,kind:n.literal("server"),keyId:n.string().min(1)}),n.object({...sM,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(),GG=qL.safeExtend({fingerprint:Nh.optional()}).strict(),KG=le.extend({customer:Ac,created:n.boolean()});ie={sendMessage:{method:"POST",path:"messaging/send",permission:"messaging:write",audience:"server",request:tj,response:le.extend({message:n.object({messageId:n.uuid(),channel:Tl,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:Tl,status:n.enum(["accepted","sending","completed","canceled"]),deliveries:n.array(n.object({id:n.uuid(),status:rj,attempts:n.number().int().nonnegative(),receipts:n.array(n.object({kind:ij,occurredAt:n.iso.datetime({offset:!0}).nullable()}))}))})})},bindPushInstallation:{method:"POST",path:"push/installations/bind",permission:"messaging:write",audience:"customer",request:$R,response:le.extend({installation:Gm})},readPushInstallation:{method:"POST",path:"push/installations/read",permission:"messaging:write",audience:"customer",request:jR,response:le.extend({installation:Gm})},updatePushAddress:{method:"POST",path:"push/installations/address",permission:"messaging:write",audience:"customer",request:O0,response:le.extend({installation:Gm})},readMessagingPreference:{method:"POST",path:"messaging/preferences/read",permission:"messaging:write",audience:"customer",request:n.strictObject({channel:Tl}),response:le.extend({preference:T0})},setMessagingPreference:{method:"POST",path:"messaging/preferences/set",permission:"messaging:write",audience:"customer",request:nj,response:le.extend({preference:T0})},listInvoiceTemplates:{method:"POST",path:"invoices/templates",permission:"billing:read",audience:"server",request:n.strictObject({cursor:n.uuid().optional()}),response:le.extend({templates:rM})},previewInvoice:{method:"POST",path:"invoices/preview",permission:"billing:write",audience:"server",request:n.strictObject({customerId:n.uuid(),params:sc}),response:le.extend({preview:b_})},createInvoice:{method:"POST",path:"invoices/create",permission:"billing:write",audience:"server",request:n.strictObject({customerId:n.uuid(),requestId:n.uuid(),params:sc}).refine(e=>e.params.preview!==!0,"Use previewInvoice for a side-effect-free preview"),response:le.extend({operation:kc})},manageInvoice:{method:"POST",path:"invoices/manage",permission:"billing:write",audience:"server",request:n.strictObject({customerId:n.uuid(),command:iM}).refine(e=>e.command.action!=="create"||e.command.params.preview!==!0,"Use previewInvoice for a side-effect-free preview"),response:le.extend({operation:kc})},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:kc})},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:aM})},getInvoice:{method:"POST",path:"invoices/read",permission:"billing:read",audience:"server",request:n.strictObject({customerId:n.uuid(),invoiceId:n.uuid()}),response:le.extend({invoice:oM})},getCodeReferenceConfig:{method:"POST",path:"code-references/config",permission:"code-references:read",audience:"server",request:H2,response:le.extend({config:G2})},submitCodeReferences:{method:"POST",path:"code-references",permission:"code-references:write",audience:"server",request:UI,response:le.extend({receipt:VI})},getFeatures:{method:"GET",path:"features",permission:"features:read",audience:"mixed",request:n.strictObject({}),response:le.extend({payload:Gl})},evaluateFeatures:{method:"POST",path:"features/evaluate",permission:"features:read",audience:"mixed",request:SL,response:le.merge(bh)},trackEvents:{method:"POST",path:"events",permission:"events:write",audience:"mixed",request:vL,response:le.merge(wL)},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:y2})},adjustBalance:{method:"POST",path:"balances/source/adjust",permission:"credits:manage",audience:"server",request:n.strictObject({customerId:n.uuid(),command:g2}),response:le.extend({balance:PI})},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:mw,model_markups:yf})},readUsage:{method:"POST",path:"usage/read",permission:"credits:read",audience:"server",request:n.strictObject({customerId:n.uuid(),query:Ff}),response:le.extend({usage:El})},setUsage:{method:"POST",path:"usage/set",permission:"credits:manage",audience:"server",request:n.strictObject({customerId:n.uuid(),command:H$}),response:le.extend({usage:El})},manageBalanceGrant:{method:"POST",path:"balances/grants/manage",permission:"credits:manage",audience:"server",request:n.strictObject({customerId:n.uuid(),command:z$}),response:le.extend({grant:qw})},listBalanceGrants:{method:"POST",path:"balances/grants/list",permission:"credits:read",audience:"server",request:U$,response:le.extend({grants:V$})},restoreNativePurchase:{method:"POST",path:"subscriptions/native/restore",permission:"billing:write",audience:"mixed",request:n.union(lL.options.map(e=>e.extend({customerId:n.uuid().optional(),customerToken:n.string().regex(ro).optional()}))),response:le.extend({operation:dL})},setupPayment:{method:"POST",path:"billing/setup-payment",permission:"billing:write",audience:"mixed",request:Xj.extend({customerId:n.uuid().optional()}),response:le.extend({setup:I_})},readPaymentSetup:{method:"POST",path:"billing/payment-setup",permission:"billing:read",audience:"mixed",request:eL.extend({customerId:n.uuid().optional()}),response:le.extend({setup:I_})},previewSubscriptionBatch:{method:"POST",path:"subscriptions/batches/preview",permission:"billing:write",audience:"server",request:Jj.safeExtend({customerId:n.uuid()}),response:le.extend({batch:ql})},confirmSubscriptionBatch:{method:"POST",path:"subscriptions/batches/confirm",permission:"billing:write",audience:"server",request:ch.extend({customerId:n.uuid()}),response:le.extend({batch:ql})},readSubscriptionBatch:{method:"POST",path:"subscriptions/batches/read",permission:"billing:read",audience:"server",request:ch.extend({customerId:n.uuid()}),response:le.extend({batch:ql})},abandonSubscriptionBatch:{method:"POST",path:"subscriptions/batches/abandon",permission:"billing:write",audience:"server",request:ch.extend({customerId:n.uuid()}),response:le.extend({batch:ql})},manageSubscriptionTrial:{method:"POST",path:"subscriptions/trials/manage",permission:"billing:write",audience:"server",request:n.discriminatedUnion("action",[uh.options[0].extend({customerId:n.uuid()}),uh.options[1].extend({customerId:n.uuid()}),uh.options[2].extend({customerId:n.uuid()})]),response:le.extend({trial:w_})},readSubscriptionTrial:{method:"POST",path:"subscriptions/trials/read",permission:"billing:read",audience:"server",request:Qj.extend({customerId:n.uuid()}),response:le.extend({trial:w_})},listSubscriptions:{method:"POST",path:"subscriptions/list",permission:"billing:read",audience:"server",request:ph,response:le.extend({subscriptions:sL})},listPurchases:{method:"POST",path:"purchases/list",permission:"billing:read",audience:"server",request:ph,response:le.extend({purchases:cL})},listSubscriptionConflicts:{method:"POST",path:"subscriptions/conflicts/list",permission:"billing:read",audience:"server",request:iL,response:le.extend({conflicts:uL})},retrySubscriptionConflict:{method:"POST",path:"subscriptions/conflicts/retry",permission:"billing:write",audience:"server",request:oL,response:le.extend({resolution:aL})},verifySubscriptions:{method:"POST",path:"subscriptions/verify",permission:"billing:read",audience:"server",request:nL,response:le.extend({verification:rL})},previewAttach:{method:"POST",path:"subscriptions/preview-attach",permission:"billing:read",audience:"mixed",request:Vj.safeExtend({...oc,customerId:n.uuid().optional()}),response:le.extend({quote:yo})},recordBillingEvent:{method:"POST",path:"billing/events/record",permission:"billing:write",audience:"server",request:K2,response:le.extend({record:W2})},attach:{method:"POST",path:"subscriptions/attach",permission:"billing:write",audience:"mixed",request:va.extend({customerId:n.uuid().optional(),intent:n.enum(["confirm","cancel"]).optional()}),response:le.extend({operation:bo})},readSubscriptionOperation:{method:"POST",path:"subscriptions/operations/read",permission:"billing:read",audience:"mixed",request:va.extend({customerId:n.uuid().optional()}),response:le.extend({operation:bo})},previewUpdate:{method:"POST",path:"subscriptions/preview-update",permission:"billing:read",audience:"mixed",request:Zj.safeExtend({customerId:n.uuid().optional()}),response:le.extend({quote:Gj})},update:{method:"POST",path:"subscriptions/update",permission:"billing:write",audience:"mixed",request:va.extend({customerId:n.uuid().optional(),intent:n.enum(["confirm","cancel"]).optional()}),response:le.extend({operation:A_})},readSubscriptionUpdate:{method:"POST",path:"subscriptions/updates/read",permission:"billing:read",audience:"mixed",request:va.extend({customerId:n.uuid().optional()}),response:le.extend({operation:A_})},previewRefund:{method:"POST",path:"subscriptions/refunds/preview",permission:"billing:read",audience:"server",request:Kj.safeExtend({customerId:n.uuid()}),response:le.extend({quote:x_})},refund:{method:"POST",path:"subscriptions/refunds/confirm",permission:"billing:write",audience:"server",request:va.extend({customerId:n.uuid()}),response:le.extend({operation:sh})},readRefund:{method:"POST",path:"subscriptions/refunds/read",permission:"billing:read",audience:"server",request:va.extend({customerId:n.uuid()}),response:le.extend({operation:sh})},readBillingControls:{method:"POST",path:"billing/controls/read",permission:"billing:read",audience:"customer",request:w$,response:le.extend({controls:Fw})},prepareBillingAuthorization:{method:"POST",path:"billing/authorizations/prepare",permission:"billing:write",audience:"customer",request:g$,response:le.extend({prepared:b$})},confirmBillingAuthorization:{method:"POST",path:"billing/authorizations/confirm",permission:"billing:write",audience:"customer",request:A$,response:le.extend({authorization:Df})},setBillingCoupons:{method:"POST",path:"billing/coupons",permission:"billing:write",audience:"customer",request:C$,response:le.extend({coupons:P$})},revokeBillingAuthorization:{method:"POST",path:"billing/authorizations/revoke",permission:"billing:write",audience:"customer",request:x$,response:le.extend({authorization:Df})},listBillingInvoices:{method:"POST",path:"billing/invoices/read",permission:"billing:read",audience:"customer",request:k$,response:le.extend({invoices:E$})},prepareBillingAdjustment:{method:"POST",path:"billing/invoices/prepare-adjustment",permission:"billing:write",audience:"server",request:I$.extend({customerId:n.uuid()}),response:le.extend({operation:kc})},confirmBillingAdjustment:{method:"POST",path:"billing/invoices/confirm-adjustment",permission:"billing:write",audience:"customer",request:_$,response:le.extend({invoice:Al})},manageBillingLimits:{method:"POST",path:"billing/controls/manage",permission:"billing:write",audience:"server",request:n.object({customerId:n.uuid(),command:v$}).strict(),response:le.extend({controls:Fw})},manageUsageEntity:{method:"POST",path:"usage/entities",permission:"credits:manage",audience:"server",request:n.object({customerId:n.uuid(),command:b2}).strict(),response:le.extend({entity:A2})},readUsageAnalytics:{method:"POST",path:"usage/analytics",permission:"credits:read",audience:"server",request:n.strictObject({customerId:n.uuid().nullable(),query:I2}),response:le.extend({analytics:k2})},readCreditAnalytics:{method:"POST",path:"credits/analytics",permission:"credits:read",audience:"server",request:n.object({customerId:n.uuid().nullable(),query:Oa}).strict(),response:le.extend({analytics:w2})},submitUsageBatch:{method:"POST",path:"usage/batch",permission:"credits:consume",audience:"server",request:E2,response:le.extend({batchId:n.uuid()})},readUsageBatch:{method:"POST",path:"usage/batch/read",permission:"credits:read",audience:"server",request:C2,response:le.extend({batch:P2})},checkEntitlement:{method:"POST",path:"entitlements/check",permission:"entitlements:read",audience:"mixed",request:sj.extend({customerId:n.string().min(1).optional()}),response:le.extend({check:Hr})},resolveContent:{method:"POST",path:"content/resolve",permission:"content:read",audience:"mixed",request:n.strictObject({kind:go,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:Aa})},resolvePaywall:{method:"POST",path:"paywalls/resolve",permission:"entitlements:read",audience:"mixed",request:f2,response:le.extend({paywall:id})},resolveOffering:{method:"POST",path:"offerings/resolve",permission:"entitlements:read",audience:"mixed",request:n.strictObject({...oc,selector:hL,customerId:n.string().min(1).optional(),commerce:Qs,requirement:mo.optional()}),response:le.extend({offering:gL,candidates:n.array(e_).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:Hr.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:G$})},readLedger:{method:"POST",path:"customer-ledger",permission:"credits:read",audience:"mixed",request:n.object({customerId:n.uuid().optional(),query:W$}).strict(),response:le.extend({ledger:J$})},readBillingInvoice:{method:"POST",path:"billing/invoices/detail",permission:"billing:read",audience:"mixed",request:B$.extend({customerId:n.uuid().optional()}),response:le.extend({detail:q$})},readCreditStatement:{method:"POST",path:"credit-statements/read",permission:"credits:read",audience:"mixed",request:Hw.safeExtend({customerId:n.uuid().optional()}),response:le.extend({statement:Z$})},quoteBalance:{method:"POST",path:"balances/quote",permission:"credits:read",audience:"mixed",request:n.object({customerId:n.uuid().optional(),command:Il.options[0]}).strict(),response:le.extend({quote:L$})},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:$e.optional(),properties:tn.optional(),entityId:n.uuid().optional(),idempotencyKey:n.string().min(1).max(120)}),n.strictObject({internal_feature_id:n.uuid(),quantity:$e.optional(),properties:tn.optional(),entityId:n.uuid().optional(),idempotencyKey:n.string().min(1).max(120)})])}),response:le.extend({receipts:n.array(kl).min(1)})},mutateBalance:{method:"POST",path:"balances/execute",permission:"credits:consume",audience:"server",request:n.object({customerId:n.uuid(),command:Il.refine(e=>e.operation!=="quote","Use the quote endpoint for a read")}).strict(),response:le.extend({receipt:kl})},redeemReward:{method:"POST",path:"rewards/redeem",permission:"offers:resolve",audience:"customer",request:M2,response:le.extend({redemption:L2})},createReferralCode:{method:"POST",path:"rewards/referral-code",permission:"offers:resolve",audience:"customer",request:U2,response:le.extend({referralCode:V2})},claimRewardProduct:{method:"POST",path:"rewards/product/claim",permission:"offers:resolve",audience:"customer",request:F2,response:le.extend({checkout:z2})},readSeats:{method:"POST",path:"seats/list",permission:"customers:read",audience:"server",request:Y$,response:le.extend({seats:Jw})},manageSeat:{method:"POST",path:"seats/manage",permission:"billing:write",audience:"server",request:X$,response:le.extend({seats:Jw})},createCustomer:{method:"POST",path:"customers",permission:"customers:write",audience:"server",request:GG,response:KG},getCustomer:{method:"POST",path:"customers/get",permission:"customers:read",audience:"server",request:iI,response:le.extend({customer:Ac})},listCustomers:{method:"POST",path:"customers/list",permission:"customers:read",audience:"server",request:GL,response:le.extend(KL.shape)},updateCustomer:{method:"POST",path:"customers/update",permission:"customers:write",audience:"server",request:HL,response:le.extend(ZL.shape)},createSession:{method:"POST",path:"customer-sessions",permission:"sessions:create",audience:"server",request:n.object({customerId:n.uuid()}).strict(),response:le.extend(js.shape)},refreshSession:{method:"POST",path:"customer-sessions/refresh",permission:"sessions:create",audience:"refresh",request:n.strictObject({}),response:le.extend(js.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:Nh.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(js.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:Ac,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:cM()},listOffers:{method:"GET",path:"offers",permission:"offers:resolve",audience:"customer",request:n.object({}).strict(),response:le.extend({offers:n.array(yl)})},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(),...oc,requestId:n.uuid(),couponContentDigest:n.string().regex(/^[a-f0-9]{64}$/).optional()}).strict(),response:cM()},recordCouponRedemption:{method:"POST",path:"offers/redemptions",permission:"billing:write",audience:"server",request:eM,response:le.extend({receipt:tM})}},ome={recordBillingEvent:ie.recordBillingEvent,sendMessage:ie.sendMessage,readMessage:ie.readMessage,bindPushInstallation:ie.bindPushInstallation,readPushInstallation:ie.readPushInstallation,updatePushAddress:ie.updatePushAddress,readMessagingPreference:ie.readMessagingPreference,setMessagingPreference:ie.setMessagingPreference,listInvoiceTemplates:ie.listInvoiceTemplates,previewInvoice:ie.previewInvoice,createInvoice:ie.createInvoice,manageInvoice:ie.manageInvoice,readInvoiceOperation:ie.readInvoiceOperation,listInvoices:ie.listInvoices,getInvoice:ie.getInvoice,getCodeReferenceConfig:ie.getCodeReferenceConfig,submitCodeReferences:ie.submitCodeReferences,getFeatures:ie.getFeatures,evaluateFeatures:ie.evaluateFeatures,trackEvents:ie.trackEvents,setupPayment:ie.setupPayment,readPaymentSetup:ie.readPaymentSetup,previewSubscriptionBatch:ie.previewSubscriptionBatch,confirmSubscriptionBatch:ie.confirmSubscriptionBatch,readSubscriptionBatch:ie.readSubscriptionBatch,abandonSubscriptionBatch:ie.abandonSubscriptionBatch,manageSubscriptionTrial:ie.manageSubscriptionTrial,readSubscriptionTrial:ie.readSubscriptionTrial,listSubscriptions:ie.listSubscriptions,listPurchases:ie.listPurchases,listSubscriptionConflicts:ie.listSubscriptionConflicts,retrySubscriptionConflict:ie.retrySubscriptionConflict,readAiPricing:ie.readAiPricing,readUsage:ie.readUsage,setUsage:ie.setUsage,previewRefund:ie.previewRefund,refund:ie.refund,readRefund:ie.readRefund,previewUpdate:ie.previewUpdate,update:ie.update,readSubscriptionUpdate:ie.readSubscriptionUpdate,restoreNativePurchase:ie.restoreNativePurchase,verifySubscriptions:ie.verifySubscriptions,previewAttach:ie.previewAttach,attach:ie.attach,readSubscriptionOperation:ie.readSubscriptionOperation,manageBalanceGrant:ie.manageBalanceGrant,readBalanceSource:ie.readBalanceSource,adjustBalance:ie.adjustBalance,listBalanceGrants:ie.listBalanceGrants,readBillingControls:ie.readBillingControls,prepareBillingAuthorization:ie.prepareBillingAuthorization,confirmBillingAuthorization:ie.confirmBillingAuthorization,setBillingCoupons:ie.setBillingCoupons,revokeBillingAuthorization:ie.revokeBillingAuthorization,listBillingInvoices:ie.listBillingInvoices,confirmBillingAdjustment:ie.confirmBillingAdjustment,prepareBillingAdjustment:ie.prepareBillingAdjustment,manageBillingLimits:ie.manageBillingLimits,createCustomer:ie.createCustomer,getCustomer:ie.getCustomer,listCustomers:ie.listCustomers,updateCustomer:ie.updateCustomer,createSession:ie.createSession,refreshSession:ie.refreshSession,revokeSessions:ie.revokeSessions,createGuestCustomer:ie.createGuestCustomer,resumeGuestSession:ie.resumeGuestSession,claimGuestCustomer:ie.claimGuestCustomer,checkEntitlement:ie.checkEntitlement,resolveOffering:ie.resolveOffering,resolveContent:ie.resolveContent,resolvePaywall:ie.resolvePaywall,readHoldings:ie.readHoldings,readLedger:ie.readLedger,readBillingInvoice:ie.readBillingInvoice,readCreditStatement:ie.readCreditStatement,quoteBalance:ie.quoteBalance,trackUsage:ie.trackUsage,mutateBalance:ie.mutateBalance,manageUsageEntity:ie.manageUsageEntity,readUsageAnalytics:ie.readUsageAnalytics,readCreditAnalytics:ie.readCreditAnalytics,submitUsageBatch:ie.submitUsageBatch,readUsageBatch:ie.readUsageBatch,listOffers:ie.listOffers,grantOffer:ie.grantOffer,recordCouponRedemption:ie.recordCouponRedemption,redeemCoupon:ie.redeemCoupon,redeemReward:ie.redeemReward,createReferralCode:ie.createReferralCode,claimRewardProduct:ie.claimRewardProduct,readSeats:ie.readSeats,manageSeat:ie.manageSeat}});var lM=x(()=>{"use strict"});var ume,WI,JI=x(()=>{"use strict";J();_n();ume=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(),$e)}).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 mme,WG,JG,dM,QG,fme,pM=x(()=>{"use strict";J();JI();mme=n.object({group:n.string().regex(/^[a-z][a-z0-9_]{0,63}$/).default("main"),kind:n.enum(["main","addon"]).default("main")}).strict(),WG=n.enum(["immediate","end_of_cycle"]),JG=n.enum(["attach","change","cancel","resume","cancel_change"]),dM=n.object({id:n.uuid(),subscriptionId:n.uuid().nullable(),targetPlanVersionId:n.uuid().nullable(),action:JG,timing:WG,status:n.enum(["preparing","payment_pending","scheduled","completed","canceled","failed"]),effectiveAt:n.iso.datetime().nullable(),createdAt:n.iso.datetime()}),QG=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:dM.nullable(),trial:WI.nullable().optional()}),fme=n.object({customerId:n.uuid(),evaluatedAt:n.iso.datetime(),holdings:n.array(QG),changes:n.array(dM),trials:n.array(WI).optional()})});var mM,YG,bme,Ame,xme,fM=x(()=>{"use strict";J();Cr();mM=n.union([Ml,n.string().max(200).regex(/^\/template-covers\/[a-z0-9-]+-[a-f0-9]{16}\.webp$/)]),YG=n.strictObject({thumbnail:mM,full:mM}),bme=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:o_,source:n.enum(["official","private"]),cover_image:YG.nullable().default(null),document:ln,revision:n.number().int().positive(),archived_at:n.string().nullable(),created_at:n.string()}).strict(),Ame=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:ln}).strict(),xme=n.object({projectId:n.uuid(),environmentId:n.uuid(),id:n.uuid(),revision:n.number().int().positive()}).strict()});function QI(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=>nr(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 sd("Required GB Feature is unavailable");o=Pi(e.featureKey,t),s=o.value,Object.assign(i,rc(e,{value:s})),u=e.next;break;case"split":{let l=r[e.experimentId];if(!l)throw new sd("Required GB Experiment is unavailable");if(a=Rf(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 sd("Experiment Variation has no published route");break}case"offering":{let l=e.configuration.source==="fixed"?e.configuration.versionId:Pi(e.configuration.featureKey,t).value;s={type:"offering_version",id:n.uuid().parse(l)},Object.assign(i,rc(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,rc(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 hM(e,t,r){n.uuid().parse(e),n.number().int().nonnegative().parse(t);let i=Bs(Zs(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 sd,YI=x(()=>{"use strict";Kr();J();Cf();qs();hl();sd=class extends Error{constructor(t){super(t),this.name="FunnelCalculationError"}}});var gM,Rme,Nme,yM=x(()=>{"use strict";J();pr();Gs();dc();gM=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),Rme=n.strictObject({operation:n.literal("resolve_screen"),funnelId:n.uuid(),versionId:n.uuid(),screenId:gM,locale:qn,customerId:n.uuid().optional()}),Nme=n.strictObject({scope:yt,funnelId:n.uuid(),versionId:n.uuid(),screenId:gM,locale:qn,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(),Ao)})});var _o,ek,XG,eK,tK,nK,XI,cd,bM,Bh=x(()=>{"use strict";J();Ph();Kr();Ql();pr();fo();$l();Cr();uc();xo();Zt();Uh();Bl();_o=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),ek=n.enum(["running","waiting","completed","closed","ineligible","failed"]),XG=n.discriminatedUnion("type",[nI,n.strictObject({type:n.literal("wait"),receiptId:n.uuid(),kind:n.enum(["timer","event","operation"]),deadline:n.iso.datetime({offset:!0}).nullable(),eventName:_o.optional()}),n.strictObject({type:n.literal("open_url"),receiptId:n.uuid(),url:uI,openIn:lI}),n.strictObject({type:n.literal("event"),receiptId:n.uuid(),event:_o})]),eK=n.strictObject({type:n.literal("funnel"),id:n.uuid(),versionId:n.uuid()}),tK={id:_o,presentation:Di,outputs:n.array(_o).max(250),inputs:hc,values:n.record(n.string(),Re).optional(),offeringKey:Wt.optional(),capabilities:Xs,customerData:ec,dataCursors:n.record(_o,Ih.nullable())},nK=n.strictObject({...tK,content:n.strictObject({type:n.literal("document"),document:ln})}),XI=n.strictObject({id:n.uuid(),source:eK,revision:n.number().int().nonnegative(),visit:n.number().int().nonnegative(),nodeId:_o,nodeType:n.enum(["entry","screen","condition","split","feature","action","external_page","wait","end","offering","coupon","coupons","output"]),status:ek,stopped:n.boolean(),canBack:n.boolean(),authenticated:n.boolean(),locale:n.string().min(1).max(35),answers:Jr,parameters:Zn,variables:n.record(n.string(),Re),output:Re.nullable(),screen:nK.nullable(),paywall:n.strictObject({receiptId:n.uuid(),resolution:n.union([vo,id]),quote:yo.nullable(),operation:bo.nullable(),purchaseRequestId:n.uuid().nullable(),selectionGeneration:n.number().int().nonnegative().optional(),canReselect:n.boolean().optional()}).nullable(),instruction:XG.nullable(),pendingRequest:n.strictObject({requestId:n.uuid(),authenticationRequired:n.boolean()}).nullable(),runExpiresAt:n.iso.datetime({offset:!0}),credentialExpiresAt:n.iso.datetime({offset:!0}).nullable()}),cd=n.strictObject({scope:yt,run:XI,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:yo.nullable(),operation:bo.nullable(),canReselect:n.boolean().optional()}).optional(),review:n.strictObject({activeOperationId:n.uuid().nullable(),pages:n.array(n.strictObject({receiptId:n.uuid(),nodeId:_o,visit:n.number().int().nonnegative()})).max(100),page:n.strictObject({receiptId:n.uuid(),nodeId:_o,visit:n.number().int().nonnegative(),document:ln,answers:Jr,inputs:hc,values:n.record(n.string(),Re).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()}),bM=cd.extend({run:XI.extend({paywall:XI.shape.paywall.unwrap().extend({resolution:id}).nullable()})})});var Yme,AM,xM,tk=x(()=>{"use strict";J();Bh();Yme=n.strictObject({operation:n.literal("renew_run"),runId:n.uuid(),customerId:n.uuid()}),AM=cd.refine(e=>!!e.runToken,"Renewal returns a credential"),xM=bM.refine(e=>!!e.runToken,"Renewal returns a credential")});var afe,rK,sfe,SM=x(()=>{"use strict";J();Jl();tk();pr();xo();ka();afe=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("campaign_decide"),...oI}).refine(_a,Ia),n.strictObject({operation:n.literal("campaign_start"),funnelId:n.uuid(),requestId:n.uuid(),customer:yc,customerData:bc.optional(),locale:n.string().min(1).max(35),parameters:Zn,cooldownSeconds:n.number().int().min(1).max(2592e3)}).refine(_a,Ia)]),rK=n.union([n.strictObject({scope:yt,suppressed:n.literal(!0),reason:n.enum(["frequency","in_progress"]),retryAt:n.iso.datetime({offset:!0})}),AM]),sfe=n.union([rK.options[0],xM])});function oK(e){return wM.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 nk(e){let t=So.parse(e.document),r=e.evaluationMode==="local"?Or.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:oK(t)};return Cc.parse(e.evaluationMode==="remote"?i:{...i,growth:Mh(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 _M(e){let t=nk(e);if(t.evaluationMode!=="local")throw new Error("Remote Funnel cannot disclose local rules");let r=So.parse(e.document);return iK.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 Ec,wM,vM,Cc,iK,qh=x(()=>{"use strict";J();pr();wc();Jl();Kr();mc();Zt();bI();Ec=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),wM=n.strictObject({entry:Ec,nodes:n.array(n.strictObject({id:Ec,type:n.enum(["entry","screen","condition","split","feature","action","external_page","wait","end","offering","coupon","coupons","output"]),outputs:n.record(n.string(),Ec),writes:n.record(Wt,Wt),resources:n.strictObject({screenId:Ec.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)}),vM={scope:yt,funnelId:n.uuid(),versionId:n.uuid(),evaluationRevision:n.number().int().nonnegative(),expiresAt:n.iso.datetime({offset:!0}).nullable(),topology:wM},Cc=n.discriminatedUnion("evaluationMode",[n.strictObject({...vM,evaluationMode:n.literal("local"),growth:Or,conditions:n.record(Ec,n.array(n.strictObject({condition:Bn,port:n.string()})))}),n.strictObject({...vM,evaluationMode:n.literal("remote")})]),iK=Cc.options[0].extend({evaluation:n.strictObject({maxTransitions:n.number().int().min(1).max(1e4),variables:n.record(Wt,nc),outputSchema:tc,terminals:n.record(Ec,n.strictObject({outcome:n.enum(["completed","closed","ineligible","failed"]),output:Wl.nullable()}))})})});function EM(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 Zh,aK,vfe,IM,kM,wfe,_fe,CM=x(()=>{"use strict";J();wc();ed();Ql();Zh=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),aK=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()})]),vfe=n.strictObject({type:n.literal("banner_version"),id:n.uuid()}),IM=e=>e==="page"?n.strictObject({id:Zh,type:n.literal("page"),pageId:n.uuid(),pageVersionId:n.uuid().nullable()}):n.strictObject({id:Zh,type:n.literal("popup"),popupId:n.uuid(),popupVersionId:n.uuid().nullable()}),kM=n2.omit({schemaVersion:!0,screens:!0,references:!0}).extend({schemaVersion:n.literal(5),screens:n.array(n.discriminatedUnion("type",[IM("page"),IM("popup"),n.strictObject({id:Zh,type:n.literal("paywall"),paywallVersionId:n.uuid()})])).max(100),references:n.record(Zh,n.union([Yl,aK])).refine(e=>Object.keys(e).length<=500)});wfe=kM.extend({graph:xc}).superRefine(EM),_fe=kM.extend({displayName:n.string().trim().min(1).max(80),graph:xc}).superRefine(EM)});var PM=x(()=>{"use strict"});var Efe,Cfe,OM=x(()=>{"use strict";Efe=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`),Cfe=new Set("\f^{}\\[~]|\u20AC")});var Nr,Io,TM,sK,cK,uK,lK,dK,pK,Rfe,mK,Nfe,Dfe,RM=x(()=>{"use strict";J();ka();Nr=n.string().min(1).max(255),Io=n.number().finite().nonnegative(),TM=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)}),sK=n.strictObject({feature_id:Nr,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()}),cK=n.strictObject({feature_id:Nr.optional(),enabled:n.boolean().default(!1),limit_type:n.enum(["absolute","usage_percentage"]).optional(),overage_limit:Io.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"),uK=n.strictObject({feature_id:Nr,enabled:n.boolean().default(!0),limit:Io,interval:n.enum(["day","week","month","year"]),anchor:n.enum(["billing_cycle","utc"]).optional(),filter:TM.optional()}),lK=n.strictObject({feature_id:Nr.optional(),enabled:n.boolean().default(!0),threshold:Io,threshold_type:n.enum(["usage","usage_percentage","remaining","remaining_percentage"]),basis:n.enum(["balance","included","recurring","usage_limit"]).default("balance"),filter:TM.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"),dK=n.strictObject({feature_id:Nr,enabled:n.boolean().default(!1)}),pK=n.strictObject({auto_topups:n.array(sK).nullable(),spend_limits:n.array(cK).nullable(),usage_limits:n.array(uK).nullable(),usage_alerts:n.array(lK).nullable(),overage_allowed:n.array(dK).nullable()}),Rfe=pK.omit({auto_topups:!0}),mK=gc,Nfe=n.strictObject({internal_id:n.uuid(),id:Nr.nullable(),project_id:n.uuid(),environment_id:n.uuid(),name:n.string().max(80).nullable(),email:n.string().max(254).nullable(),metadata:mK.nullable(),created_at:n.number().finite().nonnegative().max(864e13)}),Dfe=n.strictObject({id:Nr,internal_product_id:Nr,product_id:Nr.nullable(),status:n.enum(["scheduled","pending","active","past_due","expired","unknown","trialing","paused"]),canceled_at:Io.nullable(),free_trial_id:Nr.nullable(),trial_ends_at:Io.nullable(),starts_at:Io.nullable(),access_starts_at:Io.nullable(),ended_at:Io.nullable(),product:n.strictObject({internal_id:Nr,id:Nr,name:n.string(),version:n.number().int().positive(),is_add_on:n.boolean()})})});var fK,NM,Ffe,DM=x(()=>{"use strict";J();qt();j0();fK=n.string().regex(/^[a-z][a-z0-9_]{0,63}$/),NM=n.number().int().min(0).max(1e4),Ffe=n.object({key:fK,featureId:n.uuid(),planVersionId:n.uuid(),includedQuantity:NM,maximumQuantity:NM,unitAmountCents:n.number().int().min(0).max(1e8),currency:Te,currencyOptions:VR.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 Rn,$M,qfe,Zfe,jM=x(()=>{"use strict";J();qt();Bh();Rn=n.number().int().nonnegative(),$M=n.strictObject({at:n.iso.datetime({offset:!0}),id:n.uuid()}),qfe=n.strictObject({versionId:n.uuid().nullable(),from:n.iso.datetime({offset:!0}).nullable(),to:n.iso.datetime({offset:!0}).nullable(),after:$M.nullable()}).refine(e=>!e.from||!e.to||Date.parse(e.from)<Date.parse(e.to),"Time range must increase"),Zfe=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:Rn,completed:Rn,closed:Rn,failed:Rn,waiting:Rn,paid:Rn}),decisions:n.strictObject({queries:Rn,completed:Rn,reportedUsed:Rn,pending:Rn,failed:Rn}),revenue:n.array(n.strictObject({currency:Te,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:Rn,completed:Rn,shown:Rn,waiting:Rn})).max(1e4),recentRuns:n.array(n.strictObject({id:n.uuid(),versionId:n.uuid(),customerId:n.uuid(),status:ek,nodeId:n.string(),visit:Rn,createdAt:n.iso.datetime({offset:!0}),updatedAt:n.iso.datetime({offset:!0})})).max(100),nextCursor:$M.nullable()})});var LM,MM,rk=x(()=>{"use strict";J();LM=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)})]),MM=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 Xfe,ehe,FM=x(()=>{"use strict";J();pr();rk();ua();Xfe=n.strictObject({operation:n.literal("native_receipt"),requestId:n.uuid(),customerToken:n.string().regex(ro),orderId:n.uuid(),receiptId:n.uuid(),nativeEvidence:LM.nullable()}).refine(e=>e.nativeEvidence===null||e.nativeEvidence.orderId===e.orderId&&e.nativeEvidence.receiptId===e.receiptId,"Evidence must use this current order receipt"),ehe=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:MM.optional()})});var zM,hK,UM,gK,ihe,ohe,VM=x(()=>{"use strict";J();mc();zM=n.string().regex(/^[a-f0-9]{64}$/),hK=pc.omit({variations:!0,active:!0}).extend({changeId:zM,variations:n.array(n.strictObject({urlRedirect:n.string().max(2048)})).min(2).max(20)}),UM=n.strictObject({environmentId:n.uuid(),trackExposures:n.boolean(),generation:zM,experiments:n.array(hK).max(100),savedGroups:Hl}),gK=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)}),ihe=n.strictObject({events:n.array(gK).min(1).max(20)}),ohe=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 yK,bK,ik,AK,BM,ok=x(()=>{"use strict";J();_h();vh();mc();yK=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()}),bK=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(yK).max(200).default([]),iam:OL.optional(),renderGuard:Sh.optional()}),ik=bK.omit({variation:!0,description:!0,iam:!0}),AK=pc.omit({variations:!0,active:!0}).extend({changeId:n.string().regex(/^[a-f0-9]{64}$/),variations:n.tuple([ik,ik]).rest(ik).refine(e=>e.length<=20)}),BM=n.strictObject({trackExposures:n.boolean(),environmentId:n.uuid(),generation:n.string().regex(/^[a-f0-9]{64}$/),experiments:n.array(AK).max(100),savedGroups:Hl})});var qM=x(()=>{"use strict"});function ck(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 sk,xK,SK,ak,vK,yhe,uk=x(()=>{"use strict";J();Zt();ic();ed();sk=32,xK=522240;SK=n.strictObject({nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative()}),ak=n.record(n.string(),Re),vK=n.strictObject({id:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),input:n.strictObject({schemaVersion:Xl.shape.schemaVersion,kind:Xl.shape.kind,selector:Xl.shape.selector,contract:Xl.shape.contract}),context:ak,removed:n.array(n.string()).max(100),attributes:ak,removedAttributes:n.array(n.string()).max(100),result:t2,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()})}),yhe=n.strictObject({schemaVersion:n.literal(1),mode:n.enum(["local","remote"]),versionId:n.uuid(),generation:n.number().int().positive(),base:SK,context:ak,steps:n.array(vK).min(1).max(sk)}).refine(e=>gr(e)<=xK,"Segment exceeds its byte budget")});function _K(e,t=ZM){let r=new Map(e.topology.nodes.map(s=>[s.id,s])),i=Hs(e.growth.savedGroups),o=wK(e.growth);function a(s,c){if(!Object.hasOwn(e.growth.features,s))throw t("INVALID_RESPONSE","Required GB Feature is unavailable");return Pi(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=QI({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=QI({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 IK(e,t){let r=Cc.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=_K(r,t);return(s,c)=>(o(),kK(a,s,c))}function kK(e,t,r){let i=nn.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 EK(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(Re.parse({key:c.key,variationId:u.variationId,keyUsed:u.key,hashAttribute:u.hashAttribute,hashValue:u.hashValue}))},onFeatureUsage(c,u){a.push(Re.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 HM(e,t,r,i=ZM){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??=IK(e,i),EK(h,g,{attributes:W_({declarations:t.variables,attributes:o.attributes,parameters:r.parameters,answers:r.answers,results:s,savedGroups:{}}),sticky:c}));for(let g=0;g<sk;g++){let A=a.get(l);if(!A||!ck(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"?l_({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||!Pr(t.outputSchema,C.value)))throw i("INVALID_RESPONSE","Local terminal violates its declared output")}let E=[...u,{nodeId:l,result:C}];if(gr({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(j=>({type:"reward",id:j})):A.type==="coupon"?{type:"reward",id:A.couponId}:C.value;if(I===void 0)throw i("INVALID_RESPONSE","Node output is missing");let F=rc(A,{value:I});Aj(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&&!ck(m)?{boundary:{nodeId:l,visit:d}}:{}}}var lk,ZM,wK,GM=x(()=>{"use strict";hl();Zt();YI();qh();fc();Ni();Kr();ic();uk();lk=class extends Error{constructor(r,i){super(i);this.code=r;this.name="FunnelLocalCalculationError"}code},ZM=(e,t)=>new lk(e,t),wK=e=>({experiments:e.experiments,features:e.features})});var Rhe,KM=x(()=>{"use strict";J();wc();qh();Rhe=n.strictObject({document:So,configuration:Cc.options[0]})});var Hh,CK,Fhe,zhe,Uhe,Vhe,PK,Bhe,qhe,WM=x(()=>{"use strict";J();vh();pr();ok();ua();Hh=n.string().regex(/^[a-f0-9]{64}$/),CK=n.strictObject({release:Hh,render:Sh,button:n.strictObject({selector:n.string().min(1).max(512),elementKey:n.string().min(1).max(256),tag:n.enum(["button","a","input"])}).nullable()}),Fhe=n.strictObject({scope:yt.extend({environmentId:n.uuid()}),release:Hh,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:CK})).max(4e3)}),zhe=n.strictObject({operation:n.literal("entry_start"),funnelId:n.uuid(),versionId:n.uuid(),entryId:n.uuid(),release:Hh,requestId:n.uuid(),locale:n.string().min(1).max(35).default("en")}),Uhe=n.strictObject({scope:yt,suppressed:n.literal(!0),reason:n.enum(["frequency","in_progress"]),retryAt:n.iso.datetime({offset:!0}).nullable()}),Vhe=n.strictObject({experimentId:n.uuid(),splitNodeId:n.string().min(1).max(128)}),PK=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)}),Bhe=n.strictObject({operation:n.literal("page_experiments"),release:Hh,usedReceiptIds:n.array(n.uuid()).max(20).default([]),customerToken:n.string().regex(ro).optional()}),qhe=n.strictObject({scope:yt,runId:n.uuid(),assignments:n.array(PK.extend({receiptId:n.uuid()})).max(20),payload:BM})});var yn=x(()=>{"use strict";pr();R0();Km();zR();qt();j0();nl();q0();eN();nf();N$();Vw();Ws();Zw();xl();Gw();Pl();Qw();uM();lM();Gs();Cr();Ch();mI();lo();ZI();a$();_n();pM();JI();fM();Ql();YI();yM();wc();Bh();Jl();aI();SM();qh();Ph();tk();Nl();uc();yh();m_();CM();Uh();hh();Fh();mh();Gf();Ys();fo();dc();r_();PM();ka();Yw();OM();RM();$l();xI();DM();Vf();xo();ed();cI();Ni();sI();FI();jM();$f();Vh();jI();LI();TI();FM();rk();Bl();qI();Eh();zf();OI();DI();y_();O_();AI();E_();P_();k_();__();S_();zs();Zt();mc();Ah();L_();VM();Dl();bf();D_();fI();ok();BI();KI();CI();SI();xh();qM();uk();GM();KM();th();Nf();ua();WM()});function At(e){return typeof e=="string"?e:String(e)}function TK(e){return e.replace(OK,"$1\uFFFD")}function fk(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 iF(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 JM(e){let t;if(Array.isArray(e)){let r=e.map(At);if(r.length===2)return r}else if((t=iF(e))!=null){let r=fk(t.next()),i=fk(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 hi(e){return`%${QM[e>>4&15]}${QM[15&e]}`}function oF(e,t,r=!1){return e>=55296&&e<=57343&&(e=65533),e<=127?r&&e===32?"+":t(e)?hi(e):String.fromCharCode(e):e<=2047?hi(192|e>>6)+hi(128|63&e):e<=65535?hi(224|e>>12)+hi(128|e>>6&63)+hi(128|63&e):hi(240|e>>18)+hi(128|e>>12&63)+hi(128|e>>6&63)+hi(128|63&e)}function hk(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-65+10:e>=97&&e<=102?e-97+10:-1}function gk(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(RK,i=>{try{return decodeURIComponent(i)}catch{return"\uFFFD".repeat(i.length/3)}})}function dd(e){return e<=31||e>126}function NK(e){switch(e){case 32:case 34:case 60:case 62:case 96:return!0;default:return dd(e)}}function wk(e){switch(e){case 32:case 34:case 35:case 60:case 62:return!0;default:return dd(e)}}function DK(e){return wk(e)||e===39}function yk(e){switch(e){case 63:case 94:case 96:case 123:case 125:return!0;default:return wk(e)}}function Qh(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 yk(e)}}function YM(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 Qh(r)}})(e)}}function aF(e,t){return oF(e=e||0,t)}function gi(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+=oF(s,t,r)}return o}function _k(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([gk(o.slice(0,a),!0),gk(o.slice(a+1),!0)])}if(r=i+1,i===e.length)break}return t}function bk(e){let t="";for(let r=0;r<e.length;r++){let i=gi(e[r][0],YM,!0),o=gi(e[r][1],YM,!0);t+=r!==0?`&${i}=${o}`:`${i}=${o}`}return t}function FK(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 BK(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 sF(e,t){for(let r=0;r<e.length;r+=2)if(t>=e[r]&&t<=e[r+1])return!0;return!1}function ud(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 qK(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&&sF(MK,t[r-1]))continue;if(i===8205)return!1;let o=r-1;for(;o>=0&&ud(XM,t[o]);)o--;let a=r+1;for(;a<t.length&&ud(XM,t[a]);)a++;if(!(o>=0&&a<t.length&&ud(UK,t[o])&&ud(VK,t[a])))return!1}return!0}function GK(e){return!ZK.test(e)||!HK.test(e)}function eF(e){return String.fromCharCode(e+22+75*+(e<26))}function XK(e,t,r){let i=0;for(e=r?Math.floor(e/WK):e>>1,e+=Math.floor(e/t);e>(ko-Kh)*Ak>>1;i+=ko)e=Math.floor(e/(ko-Kh));return Math.floor(i+(ko-Kh+1)*e/(e+KK))}function eW(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=QK,s=0,c=JK;for(;i<t.length;){let u=YK;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=ko;;h+=ko){let f=h<=c?Kh:h>=c+Ak?Ak:h-c;if(p<f)break;r+=eF(f+(p-f)%(ko-f)),p=Math.floor((p-f)/(ko-f))}r+=eF(p),c=XK(s,i+1,i===o),s=0,i++}}s++,a++}return r}function dk(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=hk(e.charCodeAt(i));if(o>=t||o<0)return-1;r=r*t+o}return r}function tF(e){switch(e){case".":case"%2e":case"%2E":return!0;default:return!1}}function cF(e,t){return(e>=65&&e<=90||e>=97&&e<=122)&&(t===58||t===124)}function uF(e){return e.length===2&&cF(e.codePointAt(0),e.codePointAt(1))}function nF(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 lF(e){switch(e){case"ftp":return 21;case"http":case"ws":return 80;case"https":case"wss":return 443;default:return null}}function xk(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=hk(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+hk(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 nF(i)?null:gi(i,dd)})(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)&&!sF($K,p)||ud(zK,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=BK(p,h);if(f){d+=f;continue}let m=jK.indexOf(h);d+=m<0?p:LK[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(FK(l)||d&&(/^\p{Mark}/u.test(l)||!qK(l)||!GK(l)||l.startsWith("xn--")))return null;d&&(c[u]=`xn--${eW(l)}`)}return(o=c.join("."))!==""?o:null})(e.indexOf("%")===-1?e:gk(e));return r===null||nF(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(dk(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=dk(a[l]);if(d<0||d>255)return null;c+=d*(1<<8*(3-l))}let u=dk(a[s-1]);return u<0||u>=256**(5-s)?null:(c+=u,c)})(r):r}}function Sk(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 dF(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 pF(e){return e.username!==""||e.password!==""}function pk(e){return e.host===null||e.host===""||e.scheme==="file"}function Ar(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),z=0,te=e,Ge="",ht=r||null,re=t||{scheme:"",username:"",password:"",host:null,port:null,path:[],query:null,fragment:null,opaquePath:!1},Wh=!1,Jh=!1,Ta=!1,Ut=i||0;let o=tW;switch(i){case 3:case 4:o=Yh;break;case 5:o=kk;break;case 6:o=Ra;break;case 7:o=Eo;break;case 8:o=yi}return o(be(e,z))!==1?re:null}function _e(e,t){return z+=z===e?Yr(t):1,z<=te.length}function be(e,t){return t<e.length?e.codePointAt(t):void 0}function Yr(e){return e!=null&&e>65535?2:1}function mF(e){return e==null?"":e<=65535?String.fromCharCode(e):String.fromCodePoint(e)}function hF(e,t){let r=e.length-t;if(r<2)return!1;if(cF(be(e,t),be(e,t+1))){if(r===2)return!0;{let i=be(e,t+2);return i===47||i===92||i===63||i===35}}else return!1}function vk(e){if(e.opaquePath)return e.path[0];{let t="";for(let r of e.path)t+=`/${r}`;return t}}function yF(e){switch(e.scheme){case"blob":{let t=Ar(vk(e),null,null,0);return t===null||t.scheme!=="http"&&t.scheme!=="https"?"null":yF(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 mk(e,t){t?e[Nt].list=_k(t):e[Nt].list.length=0,e[Nt].serialized=t==null}function Gh(e){if(e.url){let t=bk(e.list);(function(i,o){i[bt].url.query=o})(e.url,t||null),e.serialized=!0}}var OK,QM,RK,$K,jK,LK,MK,zK,UK,VK,XM,ZK,HK,ko,Kh,Ak,KK,WK,JK,QK,YK,z,te,Ge,ht,re,Wh,Jh,Ta,Ut,tW,nW,fF,rW,iW,Ik,rF,oW,eg,Pc,Yh,kk,Ek,aW,Ck,Ra,Xr,gF,Eo,yi,bt,Co,Nt,sW,cW,ld,Xh,Pk=x(()=>{OK=/[\ud800-\udbff](?![\udc00-\udfff])|(^|[^\ud800-\udbff])[\udc00-\udfff]/g;QM="0123456789ABCDEF",RK=/(?:%[0-9A-Fa-f]{2})+/g;$K=[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],jK=[7296,7297,7298,7299,7300,7301,7302,7303,7304,42958,42962,42964,42993],LK=["\u0432","\u0434","\u043E","\u0441","\u0442","\u0442","\u044A","\u0463","\uA64B","\uA7CF","\uA7D3","\uA7D5","s"],MK=[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];[zK,UK,VK,XM]=[[[],"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))]});ZK=/(?![\p{Mark}\p{Decimal_Number}])[\p{Script=Arabic}\p{Script=Hebrew}]/u,HK=/\p{Script=Latin}/u;ko=36,Kh=1,Ak=26,KK=38,WK=700,JK=72,QK=128,YK=2147483647;z=0,te="",Ge="",ht=null,Wh=!1,Jh=!1,Ta=!1;tW=e=>{let t=z;if(e!=null&&(e>=65&&e<=90||e>=97&&e<=122)){let r=z+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 Ge=te.slice(z,r).toLowerCase(),z=r,nW(r<te.length?e:void 0)}else return Ut?1:(--z,_e(t,e)?fF(be(te,z)):0)},nW=e=>{let t=z;if(e===58){if(Ut){if(zt(re.scheme)!==zt(Ge))return 0;if((pF(re)||re.port!==null)&&Ge==="file")return 0;if(re.scheme==="file"&&re.host==="")return 0}return re.scheme=Ge,Ut?(re.port===lF(re.scheme)&&(re.port=null),0):(Ge="",re.scheme==="file"?_e(t,e)?Ek(be(te,z)):0:zt(re.scheme)&&ht!==null&&ht.scheme===re.scheme?_e(t,e)?rW(be(te,z)):0:zt(re.scheme)?_e(t,e)?oW(be(te,z)):0:be(te,z+1)===47?(z++,_e(t,e)?iW(be(te,z)):0):(re.path=[""],re.opaquePath=!0,_e(t,e)?gF(be(te,z)):0))}else return Ut?1:(Ge="",z=-1,_e(t,e)?fF(be(te,z)):0)},fF=e=>{let t=z;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="",_e(t,e)?yi(be(te,z)):0):ht.scheme==="file"?(z--,_e(t,e)?Ek(be(te,z)):0):(z--,_e(t,e)?Ik(be(te,z)):0)},rW=e=>{let t=z;return e===47&&be(te,z+1)===47?(++z,_e(t,e)?eg(be(te,z)):0):(z--,_e(t,e)?Ik(be(te,z)):0)},iW=e=>{let t=z;return e===47?_e(t,e)?Pc(be(te,z)):0:(z--,_e(t,e)?Xr(be(te,z)):0)},Ik=e=>{let t=z;return re.scheme=ht.scheme,e===47||zt(re.scheme)&&e===92?_e(t,e)?rF(be(te,z)):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="",_e(t,e)?Eo(be(te,z)):0):e===35?(re.fragment="",_e(t,e)?yi(be(te,z)):0):e!=null?(re.query=null,re.path.pop(),z--,_e(t,e)?Xr(be(te,z)):0):_e(t,e)?Ik(be(te,z)):0)},rF=e=>{let t=z;return zt(re.scheme)&&(e===47||e===92)?_e(t,e)?eg(be(te,z)):0:e===47?_e(t,e)?Pc(be(te,z)):0:(re.username=ht.username,re.password=ht.password,re.host=ht.host,re.port=ht.port,z--,_e(t,e)?Xr(be(te,z)):0)},oW=e=>{let t=z;return e===47&&be(te,z+1)===47?z++:z--,_e(t,e)?eg(be(te,z)):0},eg=e=>{let t=z;return e!==47&&e!==92?(z--,_e(t,e)?Pc(be(te,z)):0):_e(t,e)?eg(be(te,z)):0},Pc=e=>{let t=z;if(e!=null&&e!==64&&e!==35&&e!==47&&e!==63&&(e!==92||!zt(re.scheme))){let r=z+Yr(e);for(;r<te.length;){let i=be(te,r);if(i==null||i===64||i===35||i===47||i===63||i===92&&zt(re.scheme))break;r+=Yr(i)}return Ge+=te.slice(z,r),z=r-1,_e(t,e)?Pc(be(te,z)):0}if(e===64){Wh&&(Ge=`%40${Ge}`),Wh=!0;for(let r=0;r<Ge.length;r++){let i=Ge.codePointAt(r);if(i===58&&!Jh){Jh=!0;continue}let o=aF(i,Qh);Jh?re.password+=o:re.username+=o,i!=null&&i>65535&&r++}return Ge="",_e(t,e)?Pc(be(te,z)):0}else return e==null||e===35||e===47||e===63||e===92&&zt(re.scheme)?Wh&&Ge===""?1:(z-=Ge.length+1,Ge="",_e(t,e)?Yh(be(te,z)):0):(Ge+=mF(e),_e(t,e)?Pc(be(te,z)):0)},Yh=e=>{let t=z;if(Ut&&re.scheme==="file")return z--,_e(t,e)?Ck(be(te,z)):0;if(e!=null&&e!==58&&e!==35&&e!==47&&e!==63&&(e!==92||!zt(re.scheme))){let r=z+Yr(e);for(e===91?Ta=!0:e===93&&(Ta=!1);r<te.length;){let i=be(te,r);if(i==null||!Ta&&i===58||i===35||i===47||i===63||i===92&&zt(re.scheme))break;i===91?Ta=!0:i===93&&(Ta=!1),r+=Yr(i)}return Ge+=te.slice(z,r),z=r-1,_e(t,e)?Yh(be(te,z)):0}else if(e===58&&!Ta){if(Ge===""||Ut===4)return 1;let r=xk(Ge,!zt(re.scheme));return r===null?1:(re.host=Sk(r),Ge="",_e(t,e)?kk(be(te,z)):0)}else if(e==null||e===35||e===47||e===63||e===92&&zt(re.scheme)){if(z--,zt(re.scheme)&&Ge==="")return 1;if(Ut&&Ge===""&&(pF(re)||re.port!==null))return 1;let r=xk(Ge,!zt(re.scheme));return r===null?1:(re.host=Sk(r),Ge="",Ut?0:_e(t,e)?Ra(be(te,z)):0)}else return Ge+=mF(e),_e(t,e)?Yh(be(te,z)):0},kk=e=>{let t=z;if(e!=null&&e>=48&&e<=57){let r=z+1;for(;r<te.length;){let i=te.charCodeAt(r);if(i<48||i>57)break;r++}return Ge+=te.slice(z,r),z=r-1,_e(t,e)?kk(be(te,z)):0}else if(Ut||e==null||e===35||e===47||e===63||e===92&&zt(re.scheme)){if(Ge!==""){let r=parseInt(Ge,10);if(r>65535)return 1;if(re.port=r===lF(re.scheme)?null:r,Ge="",Ut)return 0}return Ut?1:(z--,_e(t,e)?Ra(be(te,z)):0)}else return 1};Ek=e=>{let t=z;return re.scheme="file",re.host="",e===47||e===92?_e(t,e)?aW(be(te,z)):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="",_e(t,e)?Eo(be(te,z)):0):e===35?(re.fragment="",_e(t,e)?yi(be(te,z)):0):e!=null?(re.query=null,hF(te,z)?re.path=[]:dF(re),z--,_e(t,e)?Xr(be(te,z)):0):_e(t,e)?Ek(be(te,z)):0):(z--,_e(t,e)?Xr(be(te,z)):0)},aW=e=>{let t=z;return e===47||e===92?_e(t,e)?Ck(be(te,z)):0:(ht!==null&&ht.scheme==="file"&&(!hF(te,z)&&(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),z--,_e(t,e)?Xr(be(te,z)):0)},Ck=e=>{let t=z;if(e!=null&&e!==47&&e!==92&&e!==63&&e!==35){let r=z+Yr(e);for(;r<te.length;){let i=be(te,r);if(i==null||i===47||i===92||i===63||i===35)break;r+=Yr(i)}return Ge+=te.slice(z,r),z=r-1,_e(t,e)?Ck(be(te,z)):0}else if(e==null||e===47||e===92||e===63||e===35){if(z--,!Ut&&uF(Ge))return _e(t,e)?Xr(be(te,z)):0;if(Ge==="")return re.host="",Ut?0:_e(t,e)?Ra(be(te,z)):0;{let r=xk(Ge,!zt(re.scheme));return r===null?1:(r==="localhost"&&(r=""),re.host=Sk(r),Ge="",Ut?0:_e(t,e)?Ra(be(te,z)):0)}}return 1},Ra=e=>{let t=z;return zt(re.scheme)?(e!==92&&e!==47&&z--,_e(t,e)?Xr(be(te,z)):0):!Ut&&e===63?(re.query="",_e(t,e)?Eo(be(te,z)):0):!Ut&&e===35?(re.fragment="",_e(t,e)?yi(be(te,z)):0):e!=null?(e!==47&&z--,_e(t,e)?Xr(be(te,z)):0):(Ut&&re.host===null&&re.path.push(""),_e(t,e)?Ra(be(te,z)):0)},Xr=e=>{let t=z;if(e!=null&&e!==47&&(!zt(re.scheme)||e!==92)&&(Ut||e!==63&&e!==35)){let r=z+Yr(e);for(;r<te.length;){let i=be(te,r);if(i==null||i===47||zt(re.scheme)&&i===92||!Ut&&(i===63||i===35))break;r+=Yr(i)}Ge+=gi(te.slice(z,r),yk),z=r,e=be(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}})(Ge)?(dF(re),e!==47&&!r&&re.path.push("")):tF(Ge)&&e!==47&&!r?re.path.push(""):tF(Ge)||(re.scheme==="file"&&re.path.length===0&&uF(Ge)&&(Ge=`${Ge[0]}:`),re.path.push(Ge)),Ge="",e===63?(re.query="",_e(t,e)?Eo(be(te,z)):0):e===35?(re.fragment="",_e(t,e)?yi(be(te,z)):0):_e(t,e)?Xr(be(te,z)):0}else return Ge+=aF(e,yk),_e(t,e)?Xr(be(te,z)):0},gF=e=>{let t=z;if(e===63)return re.query="",_e(t,e)?Eo(be(te,z)):0;if(e===35)return re.fragment="",_e(t,e)?yi(be(te,z)):0;if(e!=null){let r=z+Yr(e);for(;r<te.length;){let o=be(te,r);if(o===63||o===35)break;r+=Yr(o)}let i=te.slice(z,r);if(r<te.length&&i.charCodeAt(i.length-1)===32?re.path[0]+=gi(i.slice(0,-1),dd)+"%20":re.path[0]+=gi(i,dd),z=r,(e=be(te,r))===63)return re.query="",_e(t,e)?Eo(be(te,z)):0;if(e===35)return re.fragment="",_e(t,e)?yi(be(te,z)):0}return _e(t,e)?gF(be(te,z)):0},Eo=e=>{let t=z,r=z;if(e!=null){if(Ut)r=te.length;else{let o=te.indexOf("#",z);r=o===-1?te.length:o}let i=zt(re.scheme)?DK:wk;re.query+=gi(te.slice(z,r),i)}return z=r,be(te,r)===35&&!Ut?(re.fragment="",_e(t,e)?yi(be(te,z)):0):_e(t,e)?Eo(be(te,z)):0},yi=e=>{let t=z;return e!=null&&(re.fragment+=gi(te.slice(z),NK),z=te.length),_e(t,e)?yi(be(te,z)):0};bt=Symbol("URLImpl"),Co=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=Ar(r,null,null,0),i==null))throw new TypeError(`Invalid base URL: ${r}`);let o=Ar(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=Ar(r,null,null,0),i==null)?!1:Ar(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+=vk(r),r.query!==null&&(i+=`?${r.query}`),r.fragment!==null&&(i+=`#${r.fragment}`),i})(this[bt].url)}set href(t){let r=Ar(t=At(t),null,null,0);if(r==null)throw new TypeError(`Invalid URL: ${t}`);this[bt].url=r,this[bt].query&&mk(this[bt].query,r.query)}get origin(){return yF(this[bt].url)}get protocol(){return`${this[bt].url.scheme}:`}set protocol(t){Ar(`${t=At(t)}:`,this[bt].url,null,2)}get username(){return this[bt].url.username}set username(t){t=At(t),pk(this[bt].url)||(function(i,o){i.username=gi(o,Qh)})(this[bt].url,t)}get password(){return this[bt].url.password}set password(t){t=At(t),pk(this[bt].url)||(function(i,o){i.password=gi(o,Qh)})(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||Ar(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||Ar(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];pk(r)||(t?Ar(t,r,null,5):r.port=null)}get pathname(){return vk(this[bt].url)}set pathname(t){t=At(t);let{url:r}=this[bt];r.opaquePath||(r.path=[],Ar(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&&mk(i,null);else{let o=t[0]==="?"?t.substring(1):t;r.query="",Ar(o,r,null,7),i&&mk(i,r.query)}}get searchParams(){let t=this[bt],r=t.query;return r==null&&(r=t.query=(function(o,a){let s=new Xh;return s[Nt].url=o,s[Nt].serialized=a==null,a&&(s[Nt].list=_k(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="",Ar(i,r,null,8)}}toJSON(){return this.href}toString(){return this.href}};Object.defineProperty(Co.prototype,Symbol.toStringTag,{value:"URL",configurable:!0});Nt=Symbol("URLSearchParamsImpl"),sW=Symbol.dispose||Symbol.for("dispose");cW=typeof Iterator<"u"?Iterator:Object,ld=class extends cW{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}[sW](){}},Xh=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(JM(t[o]));else if((i=iF(t))!=null){let o;for(;!(o=fk(i.next())).done;)r.list.push(JM(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=TK(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=_k(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,bk([[t,r]])):Gh(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++;Gh(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&&Gh(this[Nt])}sort(){this[Nt].list.sort((t,r)=>t[0]<r[0]?-1:t[0]>r[0]?1:0),Gh(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 ld(this[Nt],t=>t)}keys(){return new ld(this[Nt],t=>t[0])}values(){return new ld(this[Nt],t=>t[1])}toString(){return bk(this[Nt].list)}[Symbol.iterator](){return this.entries()}};Object.defineProperty(Xh.prototype,Symbol.toStringTag,{value:"URLSearchParams",configurable:!0})});var H,Po=x(()=>{"use strict";Km();H=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=FR(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 bF,AF=x(()=>{"use strict";bF="https://api.longplayai.com"});var xr=x(()=>{"use strict";Pk();Po()});function ot(e,...t){try{Promise.resolve(e?.(...t)).catch(()=>{})}catch{}}var Na=x(()=>{"use strict"});var Ok=x(()=>{"use strict";Cr();xo();$l();r_();Fh()});var Tk,CF=x(()=>{"use strict";Tk={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 PF=x(()=>{"use strict";CF()});function OF(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 dW(e){if(Array.isArray(e))return e}function pW(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 mW(){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 fW(e,t){return dW(e)||pW(e,t)||hW(e,t)||mW()}function hW(e,t){if(e){if(typeof e=="string")return OF(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)?OF(e,t):void 0}}function rn(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 Mk(e,t,i)}}function _W(e){return function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return Fk(e,r)}}function pt(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gd;if(TF&&TF(e,null),!Tc(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let a=r(o);a!==o&&(gW(t)||(t[i]=a),o=a)}e[o]=!0}return e}function IW(e){for(let t=0;t<e.length;t++)ir(e,t)||(e[t]=null);return e}function vr(e){let t=Oc(null);for(let i of ZF(e)){var r=fW(i,2);let o=r[0],a=r[1];ir(e,o)&&(Tc(a)?t[o]=IW(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=vr(a):t[o]=a)}return t}function kW(e){switch(typeof e){case"string":return e;case"number":return vW(e);case"boolean":return wW(e);case"bigint":return $F?$F(e):"0";case"symbol":return jF?jF(e):"Symbol()";case"undefined":return hd(e);case"function":case"object":{if(e===null)return hd(e);let t=e,r=Dr(t,"toString");if(typeof r=="function"){let i=r(t);return typeof i=="string"?i:hd(i)}return hd(e)}default:return hd(e)}}function Dr(e,t){for(;e!==null;){let i=bW(e,t);if(i){if(i.get)return rn(i.get);if(typeof i.value=="function")return rn(i.value)}e=yW(e)}function r(){return null}return r}function EW(e){try{return Nn(e,""),!0}catch{return!1}}function KF(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:BW(),t=de=>KF(de);if(t.version="3.4.15",t.removed=[],!e||!e.document||e.document.nodeType!==Sr.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=Dr(h,"cloneNode"),m=Dr(h,"remove"),g=Dr(h,"removeAttributeNode"),A=Dr(h,"nextSibling"),C=Dr(h,"childNodes"),w=Dr(h,"parentNode"),E=Dr(h,"shadowRoot"),I=Dr(h,"attributes"),F=s&&s.prototype?Dr(s.prototype,"nodeType"):null,j=s&&s.prototype?Dr(s.prototype,"nodeName"):null,U=s&&s.prototype?Dr(s.prototype,"ownerDocument"):null,Z=function(v){return F?F(v):v.nodeType},Q=function(v){return j?j(v):v.nodeName};if(typeof a=="function"){let de=r.createElement("template");de.content&&de.content.ownerDocument&&(r=de.content.ownerDocument)}let M,Y="",L,N=!1,V=0,X=function(){if(V>0)throw Da('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.')},R=function(v){X(),V++;try{return M.createHTML(v)}finally{V--}},O=function(v){X(),V++;try{return M.createScriptURL(v)}finally{V--}},B=function(){return N||(L=qW(p,o),N=!0),L},ce=r,Ae=ce.implementation,ee=ce.createNodeIterator,Ke=ce.createDocumentFragment,Ce=ce.getElementsByTagName,je=i.importNode,Me=qF();t.isSupported=typeof ZF=="function"&&typeof w=="function"&&Ae&&Ae.createHTMLDocument!==void 0;let Pt=OW,Fe=TW,nt=RW,Yt=NW,rt=DW,Kn=$W,fe=jW,me=MW,ve=UF,he=null,Ie=pt({},[...LF,...Nk,...Dk,...$k,...MF]),Pe=null,ze=pt({},[...FF,...jk,...zF,...tg]),W=Object.seal(Oc(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}})),Ne=null,Qe=null,Ue=Object.seal(Oc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ut=!0,dt=!0,kn=!1,Ct=!0,Dt=!1,Ot=!0,Lr=!1,ii=!1,$o=null,jo=null,oi=!1,Mr=!1,Lo=!1,Va=!1,ai=!0,Ba=!1,Vc="user-content-",Bc=!0,Mi=!1,Fi={},si=null,qc=pt({},["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"]),Mo=null,Zc=pt({},["audio","video","img","source","image","track"]),qa=null,Hc=pt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Za="http://www.w3.org/1998/Math/MathML",Ha="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml",sr=Xt,zi=!1,Fo=null,Fr=pt({},[Za,Ha,Xt],Rk),Gc=dn(["mi","mo","mn","ms","mtext"]),zo=pt({},Gc),Uo=dn(["annotation-xml"]),Kc=pt({},Uo),Dd=pt({},["title","style","font","a","script"]),Ui=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=vr(v),Ui=y.indexOf(v.PARSER_MEDIA_TYPE)===-1?S:v.PARSER_MEDIA_TYPE,b=Ui==="application/xhtml+xml"?Rk:gd,he=Oo(v,"ALLOWED_TAGS",Ie,{transform:b}),Pe=Oo(v,"ALLOWED_ATTR",ze,{transform:b}),Fo=Oo(v,"ALLOWED_NAMESPACES",Fr,{transform:Rk}),qa=Oo(v,"ADD_URI_SAFE_ATTR",Hc,{transform:b,base:Hc}),Mo=Oo(v,"ADD_DATA_URI_TAGS",Zc,{transform:b,base:Zc}),si=Oo(v,"FORBID_CONTENTS",qc,{transform:b}),Ne=Oo(v,"FORBID_TAGS",vr({}),{transform:b}),Qe=Oo(v,"FORBID_ATTR",vr({}),{transform:b}),Fi=ir(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?vr(v.USE_PROFILES):v.USE_PROFILES:!1,ut=v.ALLOW_ARIA_ATTR!==!1,dt=v.ALLOW_DATA_ATTR!==!1,kn=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Ct=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Dt=v.SAFE_FOR_TEMPLATES||!1,Ot=v.SAFE_FOR_XML!==!1,Lr=v.WHOLE_DOCUMENT||!1,Mr=v.RETURN_DOM||!1,Lo=v.RETURN_DOM_FRAGMENT||!1,Va=v.RETURN_TRUSTED_TYPE||!1,oi=v.FORCE_BODY||!1,ai=v.SANITIZE_DOM!==!1,Ba=v.SANITIZE_NAMED_PROPS||!1,Bc=v.KEEP_CONTENT!==!1,Mi=v.IN_PLACE||!1,ve=EW(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:UF,sr=typeof v.NAMESPACE=="string"?v.NAMESPACE:Xt,zo=Lk(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>pt({},Gc)),Kc=Lk(v,"HTML_INTEGRATION_POINTS",()=>pt({},Uo));let $=Lk(v,"CUSTOM_ELEMENT_HANDLING",()=>Oc(null));if(W=Oc(null),ir($,"tagNameCheck")&&T($.tagNameCheck)&&(W.tagNameCheck=$.tagNameCheck),ir($,"attributeNameCheck")&&T($.attributeNameCheck)&&(W.attributeNameCheck=$.attributeNameCheck),ir($,"allowCustomizedBuiltInElements")&&typeof $.allowCustomizedBuiltInElements=="boolean"&&(W.allowCustomizedBuiltInElements=$.allowCustomizedBuiltInElements),bn(W),Dt&&(dt=!1),Lo&&(Mr=!0),Fi&&(he=pt({},MF),Pe=Oc(null),Fi.html===!0&&(pt(he,LF),pt(Pe,FF)),Fi.svg===!0&&(pt(he,Nk),pt(Pe,jk),pt(Pe,tg)),Fi.svgFilters===!0&&(pt(he,Dk),pt(Pe,jk),pt(Pe,tg)),Fi.mathMl===!0&&(pt(he,$k),pt(Pe,zF),pt(Pe,tg))),Ue.tagCheck=null,Ue.attributeCheck=null,ir(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?Ue.tagCheck=v.ADD_TAGS:Tc(v.ADD_TAGS)&&(he===Ie&&(he=vr(he)),pt(he,v.ADD_TAGS,b))),ir(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?Ue.attributeCheck=v.ADD_ATTR:Tc(v.ADD_ATTR)&&(Pe===ze&&(Pe=vr(Pe)),pt(Pe,v.ADD_ATTR,b))),ir(v,"ADD_FORBID_CONTENTS")&&Tc(v.ADD_FORBID_CONTENTS)&&(si===qc&&(si=vr(si)),pt(si,v.ADD_FORBID_CONTENTS,b)),Bc&&(he["#text"]=!0),Lr&&pt(he,["html","head","body"]),he.table&&(pt(he,["tbody"]),delete Ne.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw Da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let ne=M;M=v.TRUSTED_TYPES_POLICY;try{Y=R("")}catch(we){throw M=ne,we}}else v.TRUSTED_TYPES_POLICY===null?(M=void 0,Y=""):(M===void 0&&(M=B()),M&&typeof Y=="string"&&(Y=R("")));dn&&dn(v),_=v},K=pt({},[...Nk,...Dk,...CW]),G=pt({},[...$k,...PW]),se=function(v,$,ne){return $.namespaceURI===Xt?v==="svg":$.namespaceURI===Za?v==="svg"&&(ne==="annotation-xml"||zo[ne]):!!K[v]},ge=function(v,$,ne){return $.namespaceURI===Xt?v==="math":$.namespaceURI===Ha?v==="math"&&Kc[ne]:!!G[v]},q=function(v,$,ne){return $.namespaceURI===Ha&&!Kc[ne]||$.namespaceURI===Za&&!zo[ne]?!1:!G[v]&&(Dd[v]||!K[v])},oe=function(v){let $=w(v);(!$||!$.tagName)&&($={namespaceURI:sr,tagName:"template"});let ne=gd(v.tagName),we=gd($.tagName);return Fo[v.namespaceURI]?v.namespaceURI===Ha?se(ne,$,we):v.namespaceURI===Za?ge(ne,$,we):v.namespaceURI===Xt?q(ne,$,we):!!(Ui==="application/xhtml+xml"&&Fo[v.namespaceURI]):!1},ae=function(v){md(t.removed,{element:v});try{w(v).removeChild(v)}catch{if(m(v),!w(v))throw Da("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ye=function(v,$,ne){try{g(v,$)}catch{try{v.removeAttribute(ne)}catch{}}},Ve=function(v){kt(v);let $=C(v);if($){let we=[];$a($,Oe=>{md(we,Oe)}),$a(we,Oe=>{try{m(Oe)}catch{}})}let ne=I(v);if(ne)for(let we=ne.length-1;we>=0;--we){let Oe=ne[we],Ze=Oe&&Oe.name;typeof Ze=="string"&&ye(v,Oe,Ze)}},it=function(v,$,ne){if(!ne)try{ne=$.getAttributeNode(v)}catch{ne=null}md(t.removed,{attribute:ne||null,from:$});try{ne?g($,ne):$.removeAttribute(v)}catch{try{$.removeAttribute(v)}catch{}}if(v==="is")if(Mr||Lo)try{ae($)}catch{}else try{$.setAttribute(v,"")}catch{}},Ye=function(v){let $=I(v);if($)for(let ne=$.length-1;ne>=0;--ne){let we=$[ne],Oe=we&&we.name;typeof Oe!="string"||Pe[b(Oe)]||ye(v,we,Oe)}},kt=function(v){let $=[v];for(;$.length>0;){let ne=$.pop();Z(ne)===Sr.element&&Ye(ne);let Oe=C(ne);if(Oe)for(let Ze=Oe.length-1;Ze>=0;--Ze)$.push(Oe[Ze])}},on=function(v,$){return Ot?v==="patchsrc"?!0:v==="for"&&$!=="label"&&$!=="output":!1},$d=function(v){if(!Ot)return;let $=[v];for(;$.length>0;){let ne=$.pop(),we=Z(ne);if(we===Sr.processingInstruction||we===Sr.comment&&Nn(BF,ne.data)){try{m(ne)}catch{}continue}if(we===Sr.element){let Ze=ne,Rt=b(Q(ne));try{Ze.hasAttribute&&Ze.hasAttribute("patchsrc")&&Ze.removeAttribute("patchsrc"),Ze.hasAttribute&&Ze.hasAttribute("for")&&on("for",Rt)&&Ze.removeAttribute("for")}catch{}}let Oe=C(ne);if(Oe)for(let Ze=Oe.length-1;Ze>=0;--Ze)$.push(Oe[Ze])}},pe=function(v){let $=null,ne=null;if(oi)v="<remove></remove>"+v;else{let Ze=NF(v,/^[\r\n\t ]+/);ne=Ze&&Ze[0]}Ui==="application/xhtml+xml"&&sr===Xt&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");let we=M?R(v):v;if(sr===Xt)try{$=new d().parseFromString(we,Ui)}catch{}if(!$||!$.documentElement){$=Ae.createDocument(sr,"template",null);try{$.documentElement.innerHTML=zi?Y:we}catch{}}let Oe=$.body||$.documentElement;return v&&ne&&Oe.insertBefore(r.createTextNode(ne),Oe.childNodes[0]||null),sr===Xt?Ce.call($,Lr?"html":"body")[0]:Lr?$.documentElement:Oe},Le=function(v){let $=U?U(v):v.ownerDocument;return ee.call($||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=fd(v,Pt," "),v=fd(v,Fe," "),v=fd(v,nt," "),v},Be=function(v){var $;v.normalize();let ne=U?U(v):v.ownerDocument,we=ee.call(ne||v,v,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null),Oe=we.nextNode();for(;Oe;)Oe.data=Tt(Oe.data),Oe=we.nextNode();let Ze=($=v.querySelectorAll)===null||$===void 0?void 0:$.call(v,"template");Ze&&$a(Ze,Rt=>{Lt(Rt.content)&&Be(Rt.content)})},mt=function(v){let $=j?j(v):null;return typeof $!="string"||b($)!=="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)===Sr.documentFragment}catch{return!1}},pn=function(v){if(!F||typeof v!="object"||v===null)return!1;try{return typeof F(v)=="number"}catch{return!1}};function ft(de,v,$){de.length!==0&&$a(de,ne=>{ne.call(t,v,$,_)})}let zr=function(v,$){return!!(Ot&&v.hasChildNodes()&&!pn(v.firstElementChild)&&Nn(VF,v.textContent)&&Nn(VF,v.innerHTML)||Ot&&v.namespaceURI===Xt&&UW[$]&&(pn(v.firstElementChild)||typeof v.textContent=="string"&&Nn(VW[$],v.textContent))||v.nodeType===Sr.processingInstruction||Ot&&v.nodeType===Sr.comment&&Nn(BF,v.data))},cr=function(v,$){if(v instanceof RegExp)return Nn(v,$);if(v instanceof Function){for(var ne=arguments.length,we=new Array(ne>2?ne-2:0),Oe=2;Oe<ne;Oe++)we[Oe-2]=arguments[Oe];return!!v($,...we)}return!1},Sn=function(v,$,ne){if(!Ne[$]&&NP($)&&cr(W.tagNameCheck,$))return!1;if(Bc&&!si[$]){let we=w(v),Oe=C(v);if(Oe&&we){let Ze=Oe.length;for(let Rt=Ze-1;Rt>=0;--Rt){let Ft=v===ne?f(Oe[Rt],!0):Oe[Rt];we.insertBefore(Ft,A(v))}}}return ae(v),!0},Vo=function(v,$,ne,we){return v.length===0?$:$===ne||$===we?vr($):$},Wc=function(v,$){return v===$||w(v)!==null?!1:(Mi&&kt(v),!0)},Jc=function(v,$){if(ft(Me.beforeSanitizeElements,v,null),Wc(v,$))return!0;if(mt(v))return ae(v),!0;let ne=b(Q(v));if(he=Vo(Me.uponSanitizeElement,he,Ie,$o),ft(Me.uponSanitizeElement,v,{tagName:ne,allowedTags:he}),Wc(v,$))return!0;if(zr(v,ne))return ae(v),!0;if(Ne[ne]||!(Ue.tagCheck instanceof Function&&Ue.tagCheck(ne))&&!he[ne]){let Oe=Sn(v,ne,$);return Oe===!1&&ft(Me.afterSanitizeElements,v,null),Oe}if(Z(v)===Sr.element&&!oe(v)||(ne==="noscript"||ne==="noembed"||ne==="noframes")&&Nn(FW,v.innerHTML))return ae(v),!0;if(Dt&&v.nodeType===Sr.text){let Oe=Tt(v.textContent);v.textContent!==Oe&&(md(t.removed,{element:v.cloneNode()}),v.textContent=Oe)}return ft(Me.afterSanitizeElements,v,null),!1},RP=function(v,$,ne){if(Qe[$]||on($,v)||ai&&($==="id"||$==="name")&&(ne in r||ne in P))return!1;let we=Pe[$]||Ue.attributeCheck instanceof Function&&Ue.attributeCheck($,v);return dt&&Nn(Yt,$)||ut&&Nn(rt,$)?!0:we?qa[$]||Nn(ve,fd(ne,fe,""))||($==="src"||$==="xlink:href"||$==="href")&&v!=="script"&&DF(ne,"data:")===0&&Mo[v]||kn&&!Nn(Kn,fd(ne,fe,""))?!0:!ne:NP(v)&&cr(W.tagNameCheck,v)&&cr(W.attributeNameCheck,$,v)||$==="is"&&W.allowCustomizedBuiltInElements&&cr(W.tagNameCheck,ne)},LV=pt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),NP=function(v){return!LV[gd(v)]&&Nn(me,v)},MV=function(v,$,ne,we){if(M&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!ne)switch(p.getAttributeType(v,$)){case"TrustedHTML":return R(we);case"TrustedScriptURL":return O(we)}return we},FV=function(v,$,ne,we){try{return ne?v.setAttributeNS(ne,$,we):v.setAttribute($,we),mt(v)?(ae(v),!1):!0}catch{return it($,v),!1}},DP=function(v){ft(Me.beforeSanitizeAttributes,v,null);let $=v.attributes;if(!$||mt(v))return;Pe=Vo(Me.uponSanitizeAttribute,Pe,ze,jo);let ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0},we=$.length,Oe=b(v.nodeName);for(;we--;){let Ze=$[we],Rt=Ze.name,Ft=Ze.namespaceURI,Wn=Ze.value,Jn=b(Rt),qy=Wn,$n=Rt==="value"?qy:SW(qy),$P=!1;if(ne.attrName=Jn,ne.attrValue=$n,ne.keepAttr=!0,ne.forceKeepAttr=void 0,ft(Me.uponSanitizeAttribute,v,ne),$n=ne.attrValue,Ba&&(Jn==="id"||Jn==="name")&&DF($n,Vc)!==0&&(it(Rt,v,Ze),$n=Vc+$n,$P=!0),Ot&&Nn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,$n)){it(Rt,v,Ze);continue}if(Jn==="attributename"&&NF($n,"href")){it(Rt,v,Ze);continue}if(!ne.forceKeepAttr){if(!ne.keepAttr){it(Rt,v,Ze);continue}if(!Ct&&Nn(zW,$n)){it(Rt,v,Ze);continue}if(Dt&&($n=Tt($n)),!RP(Oe,Jn,$n)){it(Rt,v,Ze);continue}$n=MV(Oe,Jn,Ft,$n),$n!==qy&&FV(v,Rt,Ft,$n)&&$P&&RF(t.removed)}}ft(Me.afterSanitizeAttributes,v,null)},jd=function(v){let $=null,ne=Le(v);for(ft(Me.beforeSanitizeShadowDOM,v,null);$=ne.nextNode();)if(ft(Me.uponSanitizeShadowNode,$,null),Jc($,v),DP($),Lt($.content)&&jd($.content),Z($)===Sr.element){let we=E($);Lt(we)&&(By(we),jd(we))}ft(Me.afterSanitizeShadowDOM,v,null)},By=function(v){let $=[{node:v,shadow:null}];for(;$.length>0;){let ne=$.pop();if(ne.shadow){jd(ne.shadow);continue}let we=ne.node,Ze=Z(we)===Sr.element,Rt=C(we);if(Rt)for(let Ft=Rt.length-1;Ft>=0;--Ft)$.push({node:Rt[Ft],shadow:null});if(Ze){let Ft=j?j(we):null;if(typeof Ft=="string"&&b(Ft)==="template"){let Wn=we.content;Lt(Wn)&&$.push({node:Wn,shadow:null})}}if(Ze){let Ft=E(we);Lt(Ft)&&$.push({node:null,shadow:Ft},{node:Ft,shadow:null})}}};return t.sanitize=function(de){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,ne=null,we=null,Oe=null;if(zi=!de,zi&&(de="\x3c!-->"),typeof de!="string"&&!pn(de)&&(de=kW(de),typeof de!="string"))throw Da("dirty is not a string, aborting");if(!t.isSupported)return de;ii?(he=$o,Pe=jo):k(v),(Me.uponSanitizeElement.length>0||Me.uponSanitizeAttribute.length>0)&&(he=vr(he)),Me.uponSanitizeAttribute.length>0&&(Pe=vr(Pe)),t.removed=[];let Ze=Mi&&typeof de!="string"&&pn(de);if(Ze){$d(de);let Wn=Q(de);if(typeof Wn=="string"){let Jn=b(Wn);if(!he[Jn]||Ne[Jn])throw Ve(de),Da("root node is forbidden and cannot be sanitized in-place")}if(mt(de))throw Ve(de),Da("root node is clobbered and cannot be sanitized in-place");try{By(de)}catch(Jn){throw Ve(de),Jn}}else if(pn(de))$=pe("\x3c!---->"),ne=$.ownerDocument.importNode(de,!0),ne.nodeType===Sr.element&&ne.nodeName==="BODY"||ne.nodeName==="HTML"?$=ne:$.appendChild(ne),By($);else{if(!Mr&&!Dt&&!Lr&&de.indexOf("<")===-1)return M&&Va?R(de):de;if($=pe(de),!$)return Mr?null:Va?Y:""}$&&oi&&ae($.firstChild);let Rt=Ze?de:$;try{let Wn=Le(Rt);for(;we=Wn.nextNode();)Jc(we,Rt),DP(we),Lt(we.content)&&jd(we.content)}catch(Wn){throw Ze&&(Ve(de),$a(t.removed,Jn=>{Jn.element&&kt(Jn.element)})),Wn}if(Ze)return $a(t.removed,Wn=>{Wn.element&&kt(Wn.element)}),Dt&&Be(de),de;if(Mr){if(Dt&&Be($),Lo)for(Oe=Ke.call($.ownerDocument);$.firstChild;)Oe.appendChild($.firstChild);else Oe=$;return(Pe.shadowroot||Pe.shadowrootmode)&&(Oe=je.call(i,Oe,!0)),Oe}let Ft=Lr?$.outerHTML:$.innerHTML;return Lr&&he["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Nn(LW,$.ownerDocument.doctype.name)&&(Ft="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
65
+ `+Ft),Dt&&(Ft=Tt(Ft)),M&&Va?R(Ft):Ft},t.setConfig=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};k(de),ii=!0,$o=he,jo=Pe},t.clearConfig=function(){_=null,ii=!1,$o=null,jo=null,M=L,Y=""},t.isValidAttribute=function(de,v,$){_||k({});let ne=b(de),we=b(v);return RP(ne,we,$)},t.addHook=function(de,v){typeof v=="function"&&ir(Me,de)&&md(Me[de],v)},t.removeHook=function(de,v){if(ir(Me,de)){if(v!==void 0){let $=AW(Me[de],v);return $===-1?void 0:xW(Me[de],$,1)[0]}return RF(Me[de])}},t.removeHooks=function(de){ir(Me,de)&&(Me[de]=[])},t.removeAllHooks=function(){Me=qF()},t}var ZF,TF,gW,yW,bW,dn,bn,Oc,HF,Mk,Fk,$a,AW,RF,md,xW,Tc,gd,Rk,NF,fd,DF,SW,vW,wW,$F,jF,ir,hd,Nn,Da,LF,Nk,Dk,CW,$k,PW,MF,FF,jk,zF,tg,OW,TW,RW,NW,DW,UF,$W,jW,LW,MW,VF,BF,FW,zW,Sr,GF,UW,VW,BW,qW,qF,Oo,Lk,ng,zk=x(()=>{ZF=Object.entries,TF=Object.setPrototypeOf,gW=Object.isFrozen,yW=Object.getPrototypeOf,bW=Object.getOwnPropertyDescriptor,dn=Object.freeze,bn=Object.seal,Oc=Object.create,HF=typeof Reflect<"u"&&Reflect,Mk=HF.apply,Fk=HF.construct;dn||(dn=function(t){return t});bn||(bn=function(t){return t});Mk||(Mk=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)});Fk||(Fk=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)});$a=rn(Array.prototype.forEach),AW=rn(Array.prototype.lastIndexOf),RF=rn(Array.prototype.pop),md=rn(Array.prototype.push),xW=rn(Array.prototype.splice),Tc=Array.isArray,gd=rn(String.prototype.toLowerCase),Rk=rn(String.prototype.toString),NF=rn(String.prototype.match),fd=rn(String.prototype.replace),DF=rn(String.prototype.indexOf),SW=rn(String.prototype.trim),vW=rn(Number.prototype.toString),wW=rn(Boolean.prototype.toString),$F=typeof BigInt>"u"?null:rn(BigInt.prototype.toString),jF=typeof Symbol>"u"?null:rn(Symbol.prototype.toString),ir=rn(Object.prototype.hasOwnProperty),hd=rn(Object.prototype.toString),Nn=rn(RegExp.prototype.test),Da=_W(TypeError);LF=dn(["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"]),Nk=dn(["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"]),Dk=dn(["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"]),CW=dn(["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"]),$k=dn(["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"]),PW=dn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),MF=dn(["#text"]),FF=dn(["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"]),jk=dn(["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"]),zF=dn(["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"]),tg=dn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),OW=bn(/{{[\w\W]*|^[\w\W]*}}/g),TW=bn(/<%[\w\W]*|^[\w\W]*%>/g),RW=bn(/\${[\w\W]*/g),NW=bn(/^data-[\-\w.\u00B7-\uFFFF]+$/),DW=bn(/^aria-[\-\w]+$/),UF=bn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$W=bn(/^(?:\w+script|data):/i),jW=bn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),LW=bn(/^html$/i),MW=bn(/^[a-z][.\w]*(-[.\w]+)+$/i),VF=bn(/<[/\w!]/g),BF=bn(/<[/\w]/g),FW=bn(/<\/no(script|embed|frames)/i),zW=bn(/\/>/i),Sr={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},GF=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],UW=dn(pt({},GF)),VW=(function(){let e={};return $a(GF,t=>{e[t]=bn(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),dn(e)})(),BW=function(){return typeof window>"u"?null:window},qW=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}},qF=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Oo=function(t,r,i,o){return ir(t,r)&&Tc(t[r])?pt(o.base?vr(o.base):{},t[r],o.transform):i},Lk=function(t,r,i){let o=ir(t,r)?t[r]:void 0;return o&&typeof o=="object"?vr(o):i()};ng=KF()});var Rc,yd,WF=x(()=>{Rc=null,yd=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 Rc!==null?(i=Rc,Rc=Rc.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=Rc,Rc=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 JF(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 QF=x(()=>{});function ez({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+=(XF.length-1)*(l[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>Uk&&(f=r-YF+3,r=YF-2);for(let m=d;m<=p;m++)m>=0&&m<l.length&&(l[m]=l[m].replace(/\t/g,XF),l[m]=(f>0&&l[m].length>f?"\u2026":"")+l[m].substr(f,Uk-2)+(l[m].length>f+Uk-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 Vk(e,t,r,i,o,a=1,s=1){return Object.assign(JF("SyntaxError",e),{source:t,offset:r,line:i,column:o,sourceFragment(u){return ez({source:t,line:i,column:o,baseLine:a,baseColumn:s},isNaN(u)?0:u)},get formattedMessage(){return`Parse error: ${e}
70
+ `+ez({source:t,line:i,column:o,baseLine:a,baseColumn:s},2)}})}var Uk,YF,XF,tz=x(()=>{QF();Uk=100,YF=60,XF=" "});var Bk=x(()=>{});function Hn(e){return e>=48&&e<=57}function bi(e){return Hn(e)||e>=65&&e<=70||e>=97&&e<=102}function ig(e){return e>=65&&e<=90}function HW(e){return e>=97&&e<=122}function GW(e){return ig(e)||HW(e)}function KW(e){return e>=128}function rg(e){return GW(e)||KW(e)||e===95}function og(e){return rg(e)||Hn(e)||e===45}function WW(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function bd(e){return e===10||e===13||e===12}function Ai(e){return bd(e)||e===32||e===9}function or(e,t){return!(e!==92||bd(t)||t===0)}function ag(e,t,r){return e===45?rg(t)||t===45||or(t,r):rg(e)?!0:e===92?or(e,t):!1}function sg(e,t,r){return e===43||e===45?Hn(t)?2:t===46&&Hn(r)?3:0:e===46?Hn(t)?2:0:Hn(e)?1:0}function cg(e){return e===65279||e===65534?1:0}function lg(e){return e<128?qk[e]:ug}var qk,JW,Ad,Zk,ug,Hk,xd=x(()=>{qk=new Array(128),JW=128,Ad=130,Zk=131,ug=132,Hk=133;for(let e=0;e<qk.length;e++)qk[e]=Ai(e)&&Ad||Hn(e)&&Zk||rg(e)&&ug||WW(e)&&Hk||e||JW});function Nc(e,t){return t<e.length?e.charCodeAt(t):0}function dg(e,t,r){return r===13&&Nc(e,t+1)===10?2:1}function Kk(e,t,r){let i=e.charCodeAt(t);return ig(i)&&(i=i|32),i===r}function ja(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(ig(s)&&(s=s|32),s!==a)return!1}return!0}function nz(e,t){for(;t>=0&&Ai(e.charCodeAt(t));t--);return t+1}function Sd(e,t){for(;t<e.length&&Ai(e.charCodeAt(t));t++);return t}function Gk(e,t){for(;t<e.length&&Hn(e.charCodeAt(t));t++);return t}function $i(e,t){if(t+=2,bi(Nc(e,t-1))){for(let i=Math.min(e.length,t+5);t<i&&bi(Nc(e,t));t++);let r=Nc(e,t);Ai(r)&&(t+=dg(e,t,r))}return t}function vd(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!og(r)){if(or(r,Nc(e,t+1))){t=$i(e,t)-1;continue}break}}return t}function pg(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),Hn(r)&&(t=Gk(e,t+1),r=e.charCodeAt(t)),r===46&&Hn(e.charCodeAt(t+1))&&(t+=2,t=Gk(e,t)),Kk(e,t,101)){let i=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(i=1,r=e.charCodeAt(t+2)),Hn(r)&&(t=Gk(e,t+1+i+1))}return t}function mg(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}or(r,Nc(e,t+1))&&(t=$i(e,t))}return t}function fg(e){if(e.length===1&&!bi(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 hg=x(()=>{xd()});var Dc,Wk=x(()=>{Dc=["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 $c(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var Jk=x(()=>{});function oz(e){let t=e.source,r=t.length,i=t.length>0?cg(t.charCodeAt(0)):0,o=$c(e.lines,r),a=$c(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===rz||l===iz||l===QW)&&(l===iz&&u+1<r&&t.charCodeAt(u+1)===rz&&(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 rz,QW,iz,gg,az=x(()=>{Jk();xd();rz=10,QW=12,iz=13;gg=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||oz(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,i){return this.computed||oz(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 sz(e,t,r){return e<t?t:e>r?r:e}var ei,ti,_d,bg,To,ni,yg,cz=x(()=>{Jk();hg();Wk();ei=16777215,ti=24,_d=1,bg=2,To=new Uint8Array(32);To[2]=22;To[21]=22;To[19]=20;To[23]=24;ni=new Uint8Array(32);ni[2]=_d;ni[21]=_d;ni[19]=_d;ni[23]=_d;ni[22]=bg;ni[20]=bg;ni[24]=bg;yg=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=$c(this.offsetAndType,t.length+1),a=$c(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<<ti|h,c===-1&&(c=p),a[f]=l,d===u){let m=a[l];a[l]=f,l=m,u=To[o[m]>>ti]}else this.isBlockOpenerTokenType(d)&&(l=f,u=To[d])}),o[s]=0<<ti|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]>>ti:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let i=this.offsetAndType[r]>>ti;if(i!==13&&i!==25&&t--===0)return i}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&ei:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let i=this.offsetAndType[r]>>ti;if(i!==13&&i!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?ja(this.source,this.offsetAndType[t-1]&ei,this.offsetAndType[t]&ei,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&ei:this.offsetAndType[this.tokenCount]&ei:this.firstCharOffset}getTokenEnd(t){return t===this.tokenIndex?this.tokenEnd:this.offsetAndType[sz(t,0,this.tokenCount)]&ei}getTokenType(t){return t===this.tokenIndex?this.tokenType:this.offsetAndType[sz(t,0,this.tokenCount)]>>ti}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBlockOpenerTokenType(t){return ni[t]===_d}isBlockCloserTokenType(t){return ni[t]===bg}getBlockTokenPairIndex(t){let r=this.getTokenType(t);if(ni[r]===1){let i=this.balance[t],o=this.getTokenType(i);return To[r]===o?i:-1}else if(ni[r]===2){let i=this.balance[t],o=this.getTokenType(i);return To[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]&ei,r=this.offsetAndType[r],this.tokenType=r>>ti,this.tokenEnd=r&ei):(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>>ti,this.tokenEnd=t&ei):(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]&ei:this.firstCharOffset,r(this.source.charCodeAt(a))){case 1:break e;case 2:i++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[i]>>ti)&&(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&ei,c=a>>ti;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:Dc[r],chunk:this.source.substring(i,o),balance:this.balance[a]}}),t}}});function Ag(e,t){function r(p){return p<c?e.charCodeAt(p):0}function i(){if(l=pg(e,l),ag(r(l),r(l+1),r(l+2))){d=12,l=vd(e,l);return}if(r(l)===37){d=11,l++;return}d=10}function o(){let p=l;if(l=vd(e,l),ja(e,p,l,"url")&&r(l)===40){if(l=Sd(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(lg(h)){case p:l++;return;case Ad:if(bd(h)){l+=dg(e,l,h),d=6;return}break;case 92:if(l===e.length-1)break;let f=r(l+1);bd(f)?l+=dg(e,l+1,f):or(h,f)&&(l=$i(e,l)-1);break}}}function s(){for(d=7,l=Sd(e,l);l<e.length;l++){let p=e.charCodeAt(l);switch(lg(p)){case 41:l++;return;case Ad:if(l=Sd(e,l),r(l)===41||l>=e.length){l<e.length&&l++;return}l=mg(e,l),d=8;return;case 34:case 39:case 40:case Hk:l=mg(e,l),d=8;return;case 92:if(or(p,r(l+1))){l=$i(e,l)-1;break}l=mg(e,l),d=8;return}}}e=String(e||"");let c=e.length,u=cg(r(0)),l=u,d;for(;l<c;){let p=e.charCodeAt(l);switch(lg(p)){case Ad:d=13,l=Sd(e,l+1);break;case 34:a();break;case 35:og(r(l+1))||or(r(l+1),r(l+2))?(d=4,l=vd(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:sg(p,r(l+1),r(l+2))?i():(d=9,l++);break;case 44:d=18,l++;break;case 45:sg(p,r(l+1),r(l+2))?i():r(l+1)===45&&r(l+2)===62?(d=15,l=l+3):ag(p,r(l+1),r(l+2))?o():(d=9,l++);break;case 46:sg(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:ag(r(l+1),r(l+2),r(l+3))?(d=3,l=vd(e,l+1)):(d=9,l++);break;case 91:d=19,l++;break;case 92:or(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 Zk:i();break;case ug:o();break;default:d=9,l++}t(d,u,u=l)}}var Ma=x(()=>{xd();hg();Bk();Bk();Wk();xd();hg();az();cz()});function uz(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 lz=x(()=>{});function nJ(e){return function(){return this[e]()}}function Xk(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 rJ(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Xk(e.atrule),pseudo:Xk(e.pseudo),node:Xk(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]=nJ(i);break}return{config:t,...t,...t.node}}function mz(e){let t="",r="<unknown>",i=!1,o=Mc,a=!1,s=new gg,c=Object.assign(new yg,rJ(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:uz,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(d){return d===dz?1:0},consumeUntilLeftCurlyBracketOrSemicolon(d){return d===dz||d===Yk?1:0},consumeUntilExclamationMarkOrSemicolon(d){return d===YW||d===Yk?1:0},consumeUntilSemicolonIncluded(d){return d===Yk?2:0},createList:Mc,createSingleNodeList:Mc,getFirstListNode:Mc,getLastListNode:Mc,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!==pz);return pz},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 Kk(t,d,p)},cmpStr(d,p,h){return ja(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,pg(t,this.tokenStart));return this.eat(d),p},eat(d){if(this.tokenType!==d){let p=Dc[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(XW)&&(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(nz(t,t.length-1)):s.getLocation(this.tokenStart);throw new Vk(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=>Dc[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,Ag),s.setSource(t,p.offset,p.line,p.column),r=p.filename||"<unknown>",i=!!p.positions,o=typeof p.onParseError=="function"?p.onParseError:Mc,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?tJ:eJ),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=ja(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:Vk,config:c.config})}var Mc,YW,XW,Yk,dz,pz,eJ,tJ,fz=x(()=>{WF();tz();Ma();lz();Mc=()=>{},YW=33,XW=35,Yk=59,dz=123,pz=0,eJ={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}},tJ={createList(){return new yd},createSingleNodeList(e){return new yd().appendData(e)},getFirstListNode(e){return e&&e.first},getLastListNode(e){return e&&e.last}}});function Id(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,cJ)&&this.cmpChar(this.tokenStart+1,hz)?this.UnicodeRange():this.Identifier();case 9:{let t=this.charCodeAt(this.tokenStart);if(t===sJ||t===oJ||t===hz||t===aJ)return this.Operator();t===iJ&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var iJ,oJ,hz,aJ,sJ,cJ,eE=x(()=>{iJ=35,oJ=42,hz=43,aJ=45,sJ=47,cJ=117});var gz,yz=x(()=>{eE();gz={getNode:Id}});function yJ(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function bJ(){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)===bz&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case pJ:case fJ:case gJ:case mJ:return this.Combinator();case bz:return this.ClassSelector();case dJ:case hJ:return this.TypeSelector();case uJ:return this.IdSelector();case lJ:return this.NestingSelector()}break}}}var uJ,lJ,dJ,pJ,mJ,bz,fJ,hJ,gJ,Az,xz=x(()=>{uJ=35,lJ=38,dJ=42,pJ=43,mJ=47,bz=46,fJ=62,hJ=124,gJ=126;Az={onWhiteSpace:yJ,getNode:bJ}});function Sz(){return this.createSingleNodeList(this.Raw(null,!1))}var vz=x(()=>{});function wz(){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 _z=x(()=>{});function Iz(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var kz,Ez=x(()=>{eE();vz();_z();kz={getNode:Id,onWhiteSpace(e,t){Iz(e)&&(e.value=" "+e.value),Iz(t.last)&&(t.last.value+=" ")},expression:Sz,var:wz}});var tE={};ke(tE,{AtrulePrelude:()=>gz,Selector:()=>Az,Value:()=>kz});var Cz=x(()=>{yz();xz();Ez()});var AJ,Pz,Oz=x(()=>{AJ=new Set(["none","and","not","or"]),Pz={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);AJ.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}}});var Tz,Rz=x(()=>{Tz={parse:{prelude:null,block(){return this.Block(!0)}}}});function nE(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 Nz,Dz,$z=x(()=>{Nz={layer(){this.skipSC();let e=this.createList(),t=nE.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=nE.call(this,this.Declaration,()=>nE.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Dz={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,Nz)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Nz)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}}});var jz,Lz=x(()=>{jz={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}}});var Mz,Fz=x(()=>{Mz={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}}});var zz,Uz=x(()=>{zz={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var Vz,Bz=x(()=>{Vz={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var qz,Zz=x(()=>{qz={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}}});var Hz,Gz=x(()=>{Hz={parse:{prelude:null,block(e=!1){return this.Block(e)}}}});var Kz,Wz=x(()=>{Kz={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}});var Jz,Qz=x(()=>{Oz();Rz();$z();Lz();Fz();Uz();Bz();Zz();Gz();Wz();Jz={container:Pz,"font-face":Tz,import:Dz,layer:jz,media:Mz,nest:zz,page:Vz,scope:qz,"starting-style":Hz,supports:Kz}});function Yz(){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 Xz=x(()=>{});var Fa,rE,xJ,SJ,xg,eU,tU=x(()=>{Xz();Fa={parse(){return this.createSingleNodeList(this.SelectorList())}},rE={parse(){return this.createSingleNodeList(this.Selector())}},xJ={parse(){return this.createSingleNodeList(this.Identifier())}},SJ={parse:Yz},xg={parse(){return this.createSingleNodeList(this.Nth())}},eU={dir:xJ,has:Fa,lang:SJ,matches:Fa,is:Fa,"-moz-any":Fa,"-webkit-any":Fa,where:Fa,not:Fa,"nth-child":xg,"nth-last-child":xg,"nth-last-of-type":xg,"nth-of-type":xg,slotted:rE,host:rE,"host-context":rE}});var sE={};ke(sE,{generate:()=>aE,name:()=>wJ,parse:()=>oE,structure:()=>_J});function vg(e,t){let r=this.tokenStart+e,i=this.charCodeAt(r);for((i===vi||i===_r)&&(t&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)Hn(this.charCodeAt(r))||this.error("Integer is expected",r)}function Fc(e){return vg.call(this,0,e)}function No(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let r="";switch(t){case Sg:r="N is expected";break;case _r:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+e)}}function iE(){let e=0,t=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++e);if(r!==10)if(this.isDelim(vi,e)||this.isDelim(_r,e)){t=this.isDelim(vi,e)?vi:_r;do r=this.lookupType(++e);while(r===13||r===25);r!==10&&(this.skip(e),Fc.call(this,za))}else return null;return e>0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==vi&&r!==_r&&this.error("Number sign is expected")),Fc.call(this,t!==0),t===_r?"-"+this.consume(10):this.consume(10)}function oE(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)Fc.call(this,vJ),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,_r))switch(t="-1",No.call(this,1,Sg),this.tokenEnd-this.tokenStart){case 2:this.next(),r=iE.call(this);break;case 3:No.call(this,2,_r),this.next(),this.skipSC(),Fc.call(this,za),r="-"+this.consume(10);break;default:No.call(this,2,_r),vg.call(this,3,za),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(vi)&&this.lookupType(1)===1){let i=0;switch(t="1",this.isDelim(vi)&&(i=1,this.next()),No.call(this,0,Sg),this.tokenEnd-this.tokenStart){case 1:this.next(),r=iE.call(this);break;case 2:No.call(this,1,_r),this.next(),this.skipSC(),Fc.call(this,za),r="-"+this.consume(10);break;default:No.call(this,1,_r),vg.call(this,2,za),this.next(),r=this.substrToCursor(e+i+1)}}else if(this.tokenType===12){let i=this.charCodeAt(this.tokenStart),o=i===vi||i===_r,a=this.tokenStart+o;for(;a<this.tokenEnd&&Hn(this.charCodeAt(a));a++);a===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),No.call(this,a-this.tokenStart,Sg),t=this.substring(e,a),a+1===this.tokenEnd?(this.next(),r=iE.call(this)):(No.call(this,a-this.tokenStart+1,_r),a+2===this.tokenEnd?(this.next(),this.skipSC(),Fc.call(this,za),r="-"+this.consume(10)):(vg.call(this,a-this.tokenStart+2,za),this.next(),r=this.substrToCursor(a+1)))}else this.error();return t!==null&&t.charCodeAt(0)===vi&&(t=t.substr(1)),r!==null&&r.charCodeAt(0)===vi&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:r}}function aE(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 vi,_r,Sg,za,vJ,wJ,_J,wg=x(()=>{Ma();vi=43,_r=45,Sg=110,za=!0,vJ=!1;wJ="AnPlusB",_J={a:[String,null],b:[String,null]}});var lE={};ke(lE,{generate:()=>uE,name:()=>kJ,parse:()=>cE,structure:()=>CJ,walkContext:()=>EJ});function nU(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function IJ(){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 cE(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),nU):o=nU.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(IJ.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:r,prelude:o,block:a}}function uE(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var kJ,EJ,CJ,_g=x(()=>{kJ="Atrule",EJ="atrule",CJ={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]}});var mE={};ke(mE,{generate:()=>pE,name:()=>PJ,parse:()=>dE,structure:()=>TJ,walkContext:()=>OJ});function dE(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 pE(e){this.children(e)}var PJ,OJ,TJ,Ig=x(()=>{PJ="AtrulePrelude",OJ="atrulePrelude",TJ={children:[[]]}});var yE={};ke(yE,{generate:()=>gE,name:()=>LJ,parse:()=>hE,structure:()=>MJ});function $J(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(rU)?(t=!0,this.next()):this.isDelim(fE)||this.eat(1),this.isDelim(fE)?this.charCodeAt(this.tokenStart+1)!==kg?(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 jJ(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==kg&&t!==DJ&&t!==NJ&&t!==RJ&&t!==rU&&t!==fE&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==kg&&(this.isDelim(kg)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}function hE(){let e=this.tokenStart,t,r=null,i=null,o=null;return this.eat(19),this.skipSC(),t=$J.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=jJ.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 gE(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 RJ,rU,kg,NJ,fE,DJ,LJ,MJ,Eg=x(()=>{RJ=36,rU=42,kg=61,NJ=94,fE=124,DJ=126;LJ="AttributeSelector",MJ={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]}});var xE={};ke(xE,{generate:()=>AE,name:()=>UJ,parse:()=>bE,structure:()=>BJ,walkContext:()=>VJ});function aU(){return this.Raw(null,!0)}function iU(){return this.parseWithFallback(this.Rule,aU)}function oU(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function zJ(){if(this.tokenType===17)return oU.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,oU);return this.tokenType===17&&this.next(),e}function bE(e){let t=e?zJ:iU,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),aU));break;default:e&&this.isDelim(FJ)?i.push(iU.call(this)):i.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(r,this.tokenStart),children:i}}function AE(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var FJ,UJ,VJ,BJ,Cg=x(()=>{FJ=38;UJ="Block",VJ="block",BJ={children:[["Atrule","Rule","Declaration"]]}});var wE={};ke(wE,{generate:()=>vE,name:()=>qJ,parse:()=>SE,structure:()=>ZJ});function SE(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 vE(e){this.token(9,"["),this.children(e),this.token(9,"]")}var qJ,ZJ,Pg=x(()=>{qJ="Brackets",ZJ={children:[[]]}});var kE={};ke(kE,{generate:()=>IE,name:()=>HJ,parse:()=>_E,structure:()=>GJ});function _E(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function IE(){this.token(15,"-->")}var HJ,GJ,Og=x(()=>{HJ="CDC",GJ=[]});var PE={};ke(PE,{generate:()=>CE,name:()=>KJ,parse:()=>EE,structure:()=>WJ});function EE(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function CE(){this.token(14,"\x3c!--")}var KJ,WJ,Tg=x(()=>{KJ="CDO",WJ=[]});var RE={};ke(RE,{generate:()=>TE,name:()=>QJ,parse:()=>OE,structure:()=>YJ});function OE(){return this.eatDelim(JJ),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function TE(e){this.token(9,"."),this.token(1,e.name)}var JJ,QJ,YJ,Rg=x(()=>{JJ=46,QJ="ClassSelector",YJ={name:String}});var $E={};ke($E,{generate:()=>DE,name:()=>nQ,parse:()=>NE,structure:()=>rQ});function NE(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case eQ:case XJ:case tQ:this.next();break;case sU:this.next(),this.eatIdent("deep"),this.eatDelim(sU);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function DE(e){this.tokenize(e.name)}var XJ,sU,eQ,tQ,nQ,rQ,Ng=x(()=>{XJ=43,sU=47,eQ=62,tQ=126,nQ="Combinator",rQ={name:String}});var ME={};ke(ME,{generate:()=>LE,name:()=>aQ,parse:()=>jE,structure:()=>sQ});function jE(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===iQ&&this.charCodeAt(t-1)===oQ&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function LE(e){this.token(25,"/*"+e.value+"*/")}var iQ,oQ,aQ,sQ,Dg=x(()=>{iQ=42,oQ=47,aQ="Comment",sQ={value:String}});var UE={};ke(UE,{generate:()=>zE,name:()=>uQ,parse:()=>FE,structure:()=>lQ});function cU(e){return this.lookupTypeNonSC(1)===1&&cQ.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}function FE(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(()=>dQ[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 zE(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}var cQ,uQ,lQ,dQ,$g=x(()=>{cQ=new Set([16,22,0]),uQ="Condition",lQ={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};dQ={media:cU,container:cU,supports(){return this.SupportsDeclaration()}}});function lU(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===uU&&e.charCodeAt(t+1)===uU}var uU,dU=x(()=>{uU=45});var qE={};ke(qE,{generate:()=>BE,name:()=>xQ,parse:()=>VE,structure:()=>vQ,walkContext:()=>SQ});function yQ(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function bQ(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function AQ(){let e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(mU)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}function VE(){let e=this.tokenStart,t=this.tokenIndex,r=wQ.call(this),i=lU(r),o=i?this.parseCustomProperty:this.parseValue,a=i?bQ:yQ,s=!1,c;this.skipSC(),this.eat(16);let u=this.tokenIndex;if(i||this.skipSC(),o?c=this.parseWithFallback(AQ,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(mU)&&(s=_Q.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 BE(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 wQ(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case hQ:case mQ:case gQ:case pQ:case fQ:this.next();break;case pU:this.next(),this.isDelim(pU)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function _Q(){this.eat(9),this.skipSC();let e=this.consume(1);return e==="important"?!0:e}var mU,pQ,mQ,fQ,hQ,gQ,pU,xQ,SQ,vQ,jg=x(()=>{dU();mU=33,pQ=35,mQ=36,fQ=38,hQ=42,gQ=43,pU=47;xQ="Declaration",SQ="declaration",vQ={important:[Boolean,String],property:String,value:["Value","Raw"]}});var KE={};ke(KE,{generate:()=>GE,name:()=>kQ,parse:()=>HE,structure:()=>EQ});function ZE(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function HE(){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),ZE));break;default:this.isDelim(IQ)?e.push(this.parseWithFallback(this.Rule,ZE)):e.push(this.parseWithFallback(this.Declaration,ZE))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function GE(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var IQ,kQ,EQ,Lg=x(()=>{IQ=38;kQ="DeclarationList",EQ={children:[["Declaration","Atrule","Rule"]]}});var QE={};ke(QE,{generate:()=>JE,name:()=>CQ,parse:()=>WE,structure:()=>PQ});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 JE(e){this.token(12,e.value+e.unit)}var CQ,PQ,Mg=x(()=>{CQ="Dimension",PQ={value:String,unit:String}});var eC={};ke(eC,{generate:()=>XE,name:()=>TQ,parse:()=>YE,structure:()=>RQ});function YE(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(OQ)&&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 XE(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var OQ,TQ,RQ,Fg=x(()=>{OQ=47,TQ="Feature",RQ={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]}});var rC={};ke(rC,{generate:()=>nC,name:()=>NQ,parse:()=>tC,structure:()=>DQ});function $Q(e,t){let i=(this.features[e]||{})[t];return typeof i!="function"&&this.error(`Unknown feature ${t}()`),i}function tC(e="unknown"){let t=this.tokenStart,r=this.consumeFunctionName(),i=$Q.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 nC(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}var NQ,DQ,zg=x(()=>{NQ="FeatureFunction",DQ={kind:String,feature:String,value:["Declaration","Selector"]}});var sC={};ke(sC,{generate:()=>aC,name:()=>MQ,parse:()=>oC,structure:()=>FQ});function iC(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(fU,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(fU)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function gU(e){if(this.skipSC(),this.isDelim(jQ)||this.isDelim(LQ)){let t=this.source[this.tokenStart];return this.next(),this.isDelim(hU)?(this.next(),t+"="):t}if(this.isDelim(hU))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function oC(e="unknown"){let t=this.tokenStart;this.skipSC(),this.eat(21);let r=iC.call(this),i=gU.call(this,r.type==="Identifier"),o=iC.call(this),a=null,s=null;return this.lookupNonWSType(0)!==22&&(a=gU.call(this),s=iC.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 aC(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 fU,jQ,hU,LQ,MQ,FQ,Ug=x(()=>{fU=47,jQ=60,hU=61,LQ=62,MQ="FeatureRange",FQ={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 lC={};ke(lC,{generate:()=>uC,name:()=>zQ,parse:()=>cC,structure:()=>VQ,walkContext:()=>UQ});function cC(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 uC(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var zQ,UQ,VQ,Vg=x(()=>{zQ="Function",UQ="function",VQ={name:String,children:[[]]}});var mC={};ke(mC,{generate:()=>pC,name:()=>BQ,parse:()=>dC,structure:()=>qQ});function dC(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 pC(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}var BQ,qQ,Bg=x(()=>{BQ="GeneralEnclosed",qQ={kind:String,function:[String,null],children:[[]]}});var gC={};ke(gC,{generate:()=>hC,name:()=>HQ,parse:()=>fC,structure:()=>GQ,xxx:()=>ZQ});function fC(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function hC(e){this.token(4,"#"+e.value)}var ZQ,HQ,GQ,qg=x(()=>{ZQ="XXX",HQ="Hash",GQ={value:String}});var AC={};ke(AC,{generate:()=>bC,name:()=>KQ,parse:()=>yC,structure:()=>WQ});function yC(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function bC(e){this.token(1,e.name)}var KQ,WQ,Zg=x(()=>{KQ="Identifier",WQ={name:String}});var vC={};ke(vC,{generate:()=>SC,name:()=>JQ,parse:()=>xC,structure:()=>QQ});function xC(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function SC(e){this.token(9,"#"+e.name)}var JQ,QQ,Hg=x(()=>{JQ="IdSelector",QQ={name:String}});var IC={};ke(IC,{generate:()=>_C,name:()=>XQ,parse:()=>wC,structure:()=>eY});function wC(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(YQ);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function _C(e){this.tokenize(e.name)}var YQ,XQ,eY,Gg=x(()=>{YQ=46,XQ="Layer",eY={name:String}});var CC={};ke(CC,{generate:()=>EC,name:()=>tY,parse:()=>kC,structure:()=>nY});function kC(){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 EC(e){this.children(e,()=>this.token(18,","))}var tY,nY,Kg=x(()=>{tY="LayerList",nY={children:[["Layer"]]}});var TC={};ke(TC,{generate:()=>OC,name:()=>rY,parse:()=>PC,structure:()=>iY});function PC(){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 OC(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 rY,iY,Wg=x(()=>{rY="MediaQuery",iY={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]}});var DC={};ke(DC,{generate:()=>NC,name:()=>oY,parse:()=>RC,structure:()=>aY});function RC(){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 NC(e){this.children(e,()=>this.token(18,","))}var oY,aY,Jg=x(()=>{oY="MediaQueryList",aY={children:[["MediaQuery"]]}});var LC={};ke(LC,{generate:()=>jC,name:()=>cY,parse:()=>$C,structure:()=>uY});function $C(){let e=this.tokenStart;return this.eatDelim(sY),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function jC(){this.token(9,"&")}var sY,cY,uY,Qg=x(()=>{sY=38,cY="NestingSelector",uY={}});var zC={};ke(zC,{generate:()=>FC,name:()=>lY,parse:()=>MC,structure:()=>dY});function MC(){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 FC(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var lY,dY,Yg=x(()=>{lY="Nth",dY={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}});var BC={};ke(BC,{generate:()=>VC,name:()=>pY,parse:()=>UC,structure:()=>mY});function UC(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function VC(e){this.token(10,e.value)}var pY,mY,Xg=x(()=>{pY="Number",mY={value:String}});var HC={};ke(HC,{generate:()=>ZC,name:()=>fY,parse:()=>qC,structure:()=>hY});function qC(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function ZC(e){this.tokenize(e.value)}var fY,hY,ey=x(()=>{fY="Operator",hY={value:String}});var WC={};ke(WC,{generate:()=>KC,name:()=>gY,parse:()=>GC,structure:()=>yY});function GC(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 KC(e){this.token(21,"("),this.children(e),this.token(22,")")}var gY,yY,ty=x(()=>{gY="Parentheses",yY={children:[[]]}});var YC={};ke(YC,{generate:()=>QC,name:()=>bY,parse:()=>JC,structure:()=>AY});function JC(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function QC(e){this.token(11,e.value+"%")}var bY,AY,ny=x(()=>{bY="Percentage",AY={value:String}});var t1={};ke(t1,{generate:()=>e1,name:()=>xY,parse:()=>XC,structure:()=>vY,walkContext:()=>SY});function XC(){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 e1(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var xY,SY,vY,ry=x(()=>{xY="PseudoClassSelector",SY="function",vY={name:String,children:[["Raw"],null]}});var i1={};ke(i1,{generate:()=>r1,name:()=>wY,parse:()=>n1,structure:()=>IY,walkContext:()=>_Y});function n1(){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 r1(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 wY,_Y,IY,iy=x(()=>{wY="PseudoElementSelector",_Y="function",IY={name:String,children:[["Raw"],null]}});var s1={};ke(s1,{generate:()=>a1,name:()=>kY,parse:()=>o1,structure:()=>EY});function bU(){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 o1(){let e=this.tokenStart,t=bU.call(this),r=null;return this.skipSC(),this.isDelim(yU)&&(this.eatDelim(yU),r=bU.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:r}}function a1(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}var yU,kY,EY,oy=x(()=>{yU=47;kY="Ratio",EY={left:["Number","Function"],right:["Number","Function",null]}});var l1={};ke(l1,{generate:()=>u1,name:()=>PY,parse:()=>c1,structure:()=>OY});function CY(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function c1(e,t){let r=this.getTokenStart(this.tokenIndex),i;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>r?i=CY.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(r,i),value:this.substring(r,i)}}function u1(e){this.tokenize(e.value)}var PY,OY,ay=x(()=>{PY="Raw",OY={value:String}});var m1={};ke(m1,{generate:()=>p1,name:()=>RY,parse:()=>d1,structure:()=>DY,walkContext:()=>NY});function AU(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function TY(){let e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}function d1(){let e=this.tokenIndex,t=this.tokenStart,r,i;return this.parseRulePrelude?r=this.parseWithFallback(TY,AU):r=AU.call(this,e),i=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:r,block:i}}function p1(e){this.node(e.prelude),this.node(e.block)}var RY,NY,DY,sy=x(()=>{RY="Rule",NY="rule",DY={prelude:["SelectorList","Raw"],block:["Block"]}});var g1={};ke(g1,{generate:()=>h1,name:()=>$Y,parse:()=>f1,structure:()=>jY});function f1(){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 h1(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 $Y,jY,cy=x(()=>{$Y="Scope",jY={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}});var A1={};ke(A1,{generate:()=>b1,name:()=>LY,parse:()=>y1,structure:()=>MY});function y1(){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 b1(e){this.children(e)}var LY,MY,uy=x(()=>{LY="Selector",MY={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}});var v1={};ke(v1,{generate:()=>S1,name:()=>FY,parse:()=>x1,structure:()=>UY,walkContext:()=>zY});function x1(){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 S1(e){this.children(e,()=>this.token(18,","))}var FY,zY,UY,ly=x(()=>{FY="SelectorList",zY="selector",UY={children:[["Selector","Raw"]]}});function dy(e){let t=e.length,r=e.charCodeAt(0),i=r===xU||r===SU?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===w1){if(s===o){s!==t-1&&(a=e.substr(s+1));break}if(c=e.charCodeAt(++s),or(w1,c)){let u=s-1,l=$i(e,u);s=l-1,a+=fg(e.substring(u+1,l))}else c===13&&e.charCodeAt(s+1)===10&&s++}else a+=e[s]}return a}function vU(e,t){let r=t?"'":'"',i=t?SU:xU,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===w1?(o+="\\"+e.charAt(s),a=!1):(a&&(bi(c)||Ai(c))&&(o+=" "),o+=e.charAt(s),a=!1)}return r+o+r}var w1,xU,SU,_1=x(()=>{Ma();w1=92,xU=34,SU=39});var E1={};ke(E1,{generate:()=>k1,name:()=>BY,parse:()=>I1,structure:()=>qY});function I1(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:dy(this.consume(5))}}function k1(e){this.token(5,vU(e.value))}var BY,qY,py=x(()=>{_1();BY="String",qY={value:String}});var O1={};ke(O1,{generate:()=>P1,name:()=>HY,parse:()=>C1,structure:()=>KY,walkContext:()=>GY});function wU(){return this.Raw(null,!1)}function C1(){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)!==ZY){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,wU);break;default:r=this.parseWithFallback(this.Rule,wU)}t.push(r)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function P1(e){this.children(e)}var ZY,HY,GY,KY,my=x(()=>{ZY=33;HY="StyleSheet",GY="stylesheet",KY={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]}});var N1={};ke(N1,{generate:()=>R1,name:()=>WY,parse:()=>T1,structure:()=>JY});function T1(){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 R1(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var WY,JY,fy=x(()=>{WY="SupportsDeclaration",JY={declaration:"Declaration"}});var L1={};ke(L1,{generate:()=>j1,name:()=>YY,parse:()=>$1,structure:()=>XY});function D1(){this.tokenType!==1&&this.isDelim(QY)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function $1(){let e=this.tokenStart;return this.isDelim(_U)?(this.next(),D1.call(this)):(D1.call(this),this.isDelim(_U)&&(this.next(),D1.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function j1(e){this.tokenize(e.name)}var QY,_U,YY,XY,hy=x(()=>{QY=42,_U=124;YY="TypeSelector",XY={name:String}});var U1={};ke(U1,{generate:()=>z1,name:()=>nX,parse:()=>F1,structure:()=>rX});function kd(e,t){let r=0;for(let i=this.tokenStart+e;i<this.tokenEnd;i++){let o=this.charCodeAt(i);if(o===kU&&t&&r!==0)return kd.call(this,e+r+1,!1),-1;bi(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 gy(e){let t=0;for(;this.isDelim(M1);)++t>e&&this.error("Too many question marks"),this.next()}function eX(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===IU?"Plus sign":"Hyphen minus")+" is expected")}function tX(){let e=0;switch(this.tokenType){case 10:if(e=kd.call(this,1,!0),this.isDelim(M1)){gy.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){eX.call(this,kU),kd.call(this,1,!1);break}break;case 12:e=kd.call(this,1,!0),e>0&&gy.call(this,6-e);break;default:if(this.eatDelim(IU),this.tokenType===1){e=kd.call(this,0,!0),e>0&&gy.call(this,6-e);break}if(this.isDelim(M1)){this.next(),gy.call(this,5);break}this.error("Hex digit or question mark is expected")}}function F1(){let e=this.tokenStart;return this.eatIdent("u"),tX.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function z1(e){this.tokenize(e.value)}var IU,kU,M1,nX,rX,yy=x(()=>{Ma();IU=43,kU=45,M1=63;nX="UnicodeRange",rX={value:String}});function CU(e){let t=e.length,r=4,i=e.charCodeAt(t-1)===EU?t-2:t-1,o="";for(;r<i&&Ai(e.charCodeAt(r));)r++;for(;r<i&&Ai(e.charCodeAt(i));)i--;for(let a=r;a<=i;a++){let s=e.charCodeAt(a);if(s===V1){if(a===i){a!==t-1&&(o=e.substr(a+1));break}if(s=e.charCodeAt(++a),or(V1,s)){let c=a-1,u=$i(e,c);a=u-1,o+=fg(e.substring(c+1,u))}else s===13&&e.charCodeAt(a+1)===10&&a++}else o+=e[a]}return o}function PU(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===iX||o===V1||o===oX||o===aX||o===sX||o===EU?(t+="\\"+e.charAt(i),r=!1):(r&&bi(o)&&(t+=" "),t+=e.charAt(i),r=!1)}return"url("+t+")"}var iX,V1,oX,aX,sX,EU,OU=x(()=>{Ma();iX=32,V1=92,oX=34,aX=39,sX=40,EU=41});var Z1={};ke(Z1,{generate:()=>q1,name:()=>uX,parse:()=>B1,structure:()=>lX});function B1(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=CU(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=dy(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 q1(e){this.token(7,PU(e.value))}var uX,lX,by=x(()=>{OU();_1();uX="Url",lX={value:String}});var K1={};ke(K1,{generate:()=>G1,name:()=>dX,parse:()=>H1,structure:()=>pX});function H1(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function G1(e){this.children(e)}var dX,pX,Ay=x(()=>{dX="Value",pX={children:[[]]}});var Q1={};ke(Q1,{generate:()=>J1,name:()=>fX,parse:()=>W1,structure:()=>hX});function W1(){return this.eat(13),mX}function J1(e){this.token(13,e.value)}var mX,fX,hX,xy=x(()=>{mX=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),fX="WhiteSpace",hX={value:String}});var Y1={};ke(Y1,{AnPlusB:()=>oE,Atrule:()=>cE,AtrulePrelude:()=>dE,AttributeSelector:()=>hE,Block:()=>bE,Brackets:()=>SE,CDC:()=>_E,CDO:()=>EE,ClassSelector:()=>OE,Combinator:()=>NE,Comment:()=>jE,Condition:()=>FE,Declaration:()=>VE,DeclarationList:()=>HE,Dimension:()=>WE,Feature:()=>YE,FeatureFunction:()=>tC,FeatureRange:()=>oC,Function:()=>cC,GeneralEnclosed:()=>dC,Hash:()=>fC,IdSelector:()=>xC,Identifier:()=>yC,Layer:()=>wC,LayerList:()=>kC,MediaQuery:()=>PC,MediaQueryList:()=>RC,NestingSelector:()=>$C,Nth:()=>MC,Number:()=>UC,Operator:()=>qC,Parentheses:()=>GC,Percentage:()=>JC,PseudoClassSelector:()=>XC,PseudoElementSelector:()=>n1,Ratio:()=>o1,Raw:()=>c1,Rule:()=>d1,Scope:()=>f1,Selector:()=>y1,SelectorList:()=>x1,String:()=>I1,StyleSheet:()=>C1,SupportsDeclaration:()=>T1,TypeSelector:()=>$1,UnicodeRange:()=>F1,Url:()=>B1,Value:()=>H1,WhiteSpace:()=>W1});var TU=x(()=>{wg();_g();Ig();Eg();Cg();Pg();Og();Tg();Rg();Ng();Dg();$g();jg();Lg();Mg();Fg();zg();Ug();Vg();Bg();qg();Zg();Hg();Gg();Kg();Wg();Jg();Qg();Yg();Xg();ey();ty();ny();ry();iy();oy();ay();sy();cy();uy();ly();py();my();fy();hy();yy();by();Ay();xy()});var RU,NU=x(()=>{Cz();Qz();tU();TU();RU={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:tE,atrule:Jz,pseudo:eU,node:Y1}});var X1,DU=x(()=>{fz();NU();X1=mz(RU)});var jU=Ga(eP=>{var $U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");eP.encode=function(e){if(0<=e&&e<$U.length)return $U[e];throw new TypeError("Must be between 0 and 63: "+e)};eP.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 UU=Ga(nP=>{var LU=jU(),tP=5,MU=1<<tP,FU=MU-1,zU=MU;function gX(e){return e<0?(-e<<1)+1:(e<<1)+0}function yX(e){var t=(e&1)===1,r=e>>1;return t?-r:r}nP.encode=function(t){var r="",i,o=gX(t);do i=o&FU,o>>>=tP,o>0&&(i|=zU),r+=LU.encode(i);while(o>0);return r};nP.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=LU.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&zU),u&=FU,a=a+(u<<s),s+=tP}while(c);i.value=yX(a),i.rest=r}});var Sy=Ga(xn=>{function bX(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}xn.getArg=bX;var VU=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,AX=/^data:.+\,.+$/;function Ed(e){var t=e.match(VU);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}xn.urlParse=Ed;function zc(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}xn.urlGenerate=zc;var xX=32;function SX(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>xX&&t.pop(),a}}var rP=SX(function(t){var r=t,i=Ed(t);if(i){if(!i.path)return t;r=i.path}for(var o=xn.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,zc(i)):r});xn.normalize=rP;function BU(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ed(t),i=Ed(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),zc(r);if(r||t.match(AX))return t;if(i&&!i.host&&!i.path)return i.host=t,zc(i);var o=t.charAt(0)==="/"?t:rP(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=o,zc(i)):o}xn.join=BU;xn.isAbsolute=function(e){return e.charAt(0)==="/"||VU.test(e)};function vX(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)}xn.relative=vX;var qU=(function(){var e=Object.create(null);return!("__proto__"in e)})();function ZU(e){return e}function wX(e){return HU(e)?"$"+e:e}xn.toSetString=qU?ZU:wX;function _X(e){return HU(e)?e.slice(1):e}xn.fromSetString=qU?ZU:_X;function HU(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 IX(e,t,r){var i=ji(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:ji(e.name,t.name)}xn.compareByOriginalPositions=IX;function kX(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:ji(e.name,t.name)}xn.compareByOriginalPositionsNoSource=kX;function EX(e,t,r){var i=e.generatedLine-t.generatedLine;return i!==0||(i=e.generatedColumn-t.generatedColumn,i!==0||r)||(i=ji(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:ji(e.name,t.name)}xn.compareByGeneratedPositionsDeflated=EX;function CX(e,t,r){var i=e.generatedColumn-t.generatedColumn;return i!==0||r||(i=ji(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:ji(e.name,t.name)}xn.compareByGeneratedPositionsDeflatedNoLine=CX;function ji(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function PX(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=ji(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:ji(e.name,t.name)}xn.compareByGeneratedPositionsInflated=PX;function OX(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}xn.parseSourceMapInput=OX;function TX(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var i=Ed(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=BU(zc(i),t)}return rP(t)}xn.computeSourceURL=TX});var KU=Ga(GU=>{var iP=Sy(),oP=Object.prototype.hasOwnProperty,Ua=typeof Map<"u";function Li(){this._array=[],this._set=Ua?new Map:Object.create(null)}Li.fromArray=function(t,r){for(var i=new Li,o=0,a=t.length;o<a;o++)i.add(t[o],r);return i};Li.prototype.size=function(){return Ua?this._set.size:Object.getOwnPropertyNames(this._set).length};Li.prototype.add=function(t,r){var i=Ua?t:iP.toSetString(t),o=Ua?this.has(t):oP.call(this._set,i),a=this._array.length;(!o||r)&&this._array.push(t),o||(Ua?this._set.set(t,a):this._set[i]=a)};Li.prototype.has=function(t){if(Ua)return this._set.has(t);var r=iP.toSetString(t);return oP.call(this._set,r)};Li.prototype.indexOf=function(t){if(Ua){var r=this._set.get(t);if(r>=0)return r}else{var i=iP.toSetString(t);if(oP.call(this._set,i))return this._set[i]}throw new Error('"'+t+'" is not in the set.')};Li.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Li.prototype.toArray=function(){return this._array.slice()};GU.ArraySet=Li});var QU=Ga(JU=>{var WU=Sy();function RX(e,t){var r=e.generatedLine,i=t.generatedLine,o=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=o||WU.compareByGeneratedPositionsInflated(e,t)<=0}function vy(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}vy.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};vy.prototype.add=function(t){RX(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};vy.prototype.toArray=function(){return this._sorted||(this._array.sort(WU.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};JU.MappingList=vy});var XU=Ga(YU=>{var Cd=UU(),Qt=Sy(),wy=KU().ArraySet,NX=QU().MappingList;function jr(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 wy,this._names=new wy,this._mappings=new NX,this._sourcesContents=null}jr.prototype._version=3;jr.fromSourceMap=function(t,r){var i=t.sourceRoot,o=new jr(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};jr.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}))};jr.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))};jr.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 wy,c=new wy;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)};jr.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)}};jr.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+=Cd.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(p=this._sources.indexOf(l.source),u+=Cd.encode(p-s),s=p,u+=Cd.encode(l.originalLine-1-o),o=l.originalLine-1,u+=Cd.encode(l.originalColumn-i),i=l.originalColumn,l.name!=null&&(d=this._names.indexOf(l.name),u+=Cd.encode(d-a),a=d)),c+=u}return c};jr.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)};jr.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};jr.prototype.toString=function(){return JSON.stringify(this.toJSON())};YU.SourceMapGenerator=jr});function n6(e){let t=new t6.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&&e6.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&&e6.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 t6,e6,r6=x(()=>{t6=HV(XU(),1),e6=new Set(["Atrule","Selector","Declaration"])});var _y={};ke(_y,{safe:()=>sP,spec:()=>LX});function o6(e){let t=new Set(e.map(([r,i])=>aP(r)<<16|aP(i)));return function(r,i,o){let a=aP(i,o),s=o.charCodeAt(0),c=s===$X&&i!==1&&i!==2&&i!==15||s===DX?t.has((r&65534)<<16|s<<7):t.has((r&65534)<<16|a);return a|c}}var DX,$X,aP,i6,jX,LX,sP,a6=x(()=>{DX=43,$X=45,aP=(e,t)=>(e===9&&(e=t),typeof e=="string"&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),i6=[[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],["/","*"]],jX=i6.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,"-"]]);LX=o6(i6),sP=o6(jX)});function FX(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 s6(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:sP,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)===MX&&this.emit(`
71
+ `,13,!0)},emit(u){o+=u},result(){return o}};i&&(typeof i.decorator=="function"&&(s=i.decorator(s)),i.sourceMap&&(s=n6(s)),i.mode in _y&&(s.tokenBefore=_y[i.mode]));let c={node:u=>s.node(u),children:FX,token:(u,l)=>s.token(u,l),tokenize:u=>Ag(u,(l,d,p)=>{s.token(l,u.slice(d,p),d!==0)})};return s.node(r),s.result()}}var MX,c6=x(()=>{Ma();r6();a6();MX=92});var cP={};ke(cP,{AnPlusB:()=>aE,Atrule:()=>uE,AtrulePrelude:()=>pE,AttributeSelector:()=>gE,Block:()=>AE,Brackets:()=>vE,CDC:()=>IE,CDO:()=>CE,ClassSelector:()=>TE,Combinator:()=>DE,Comment:()=>LE,Condition:()=>zE,Declaration:()=>BE,DeclarationList:()=>GE,Dimension:()=>JE,Feature:()=>XE,FeatureFunction:()=>nC,FeatureRange:()=>aC,Function:()=>uC,GeneralEnclosed:()=>pC,Hash:()=>hC,IdSelector:()=>SC,Identifier:()=>bC,Layer:()=>_C,LayerList:()=>EC,MediaQuery:()=>OC,MediaQueryList:()=>NC,NestingSelector:()=>jC,Nth:()=>FC,Number:()=>VC,Operator:()=>ZC,Parentheses:()=>KC,Percentage:()=>QC,PseudoClassSelector:()=>e1,PseudoElementSelector:()=>r1,Ratio:()=>a1,Raw:()=>u1,Rule:()=>p1,Scope:()=>h1,Selector:()=>b1,SelectorList:()=>S1,String:()=>k1,StyleSheet:()=>P1,SupportsDeclaration:()=>R1,TypeSelector:()=>j1,UnicodeRange:()=>z1,Url:()=>q1,Value:()=>G1,WhiteSpace:()=>J1});var u6=x(()=>{wg();_g();Ig();Eg();Cg();Pg();Og();Tg();Rg();Ng();Dg();$g();jg();Lg();Mg();Fg();zg();Ug();Vg();Bg();qg();Zg();Hg();Gg();Kg();Wg();Jg();Qg();Yg();Xg();ey();ty();ny();ry();iy();oy();ay();sy();cy();uy();ly();py();my();fy();hy();yy();by();Ay();xy()});var l6,d6=x(()=>{u6();l6={node:cP}});var p6,m6=x(()=>{c6();d6();p6=s6(l6)});function f6(e){return typeof e=="function"?e:Pd}function h6(e,t){return function(r,i,o){r.type===t&&e.call(this,r,i,o)}}function zX(e,t){let r=t.structure,i=[];for(let o in r){if(uP.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 UX(e){let t={};for(let r in e.node)if(uP.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]=zX(r,i)}return t}function g6(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 y6({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 b6(e){let t=UX(e),r={},i={},o=Symbol("break-walk"),a=Symbol("skip-node");for(let l in t)uP.call(t,l)&&t[l]!==null&&(r[l]=g6(t[l],!1),i[l]=g6(t[l],!0));let s=y6(r),c=y6(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=Pd,f=Pd,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=f6(d.enter),f=f6(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=h6(h,d.visit),f=h6(f,d.visit)}if(h===Pd&&f===Pd)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 uP,Pd,A6=x(()=>{({hasOwnProperty:uP}=Object.prototype),Pd=function(){}});var lP={};ke(lP,{AnPlusB:()=>sE,Atrule:()=>lE,AtrulePrelude:()=>mE,AttributeSelector:()=>yE,Block:()=>xE,Brackets:()=>wE,CDC:()=>kE,CDO:()=>PE,ClassSelector:()=>RE,Combinator:()=>$E,Comment:()=>ME,Condition:()=>UE,Declaration:()=>qE,DeclarationList:()=>KE,Dimension:()=>QE,Feature:()=>eC,FeatureFunction:()=>rC,FeatureRange:()=>sC,Function:()=>lC,GeneralEnclosed:()=>mC,Hash:()=>gC,IdSelector:()=>vC,Identifier:()=>AC,Layer:()=>IC,LayerList:()=>CC,MediaQuery:()=>TC,MediaQueryList:()=>DC,NestingSelector:()=>LC,Nth:()=>zC,Number:()=>BC,Operator:()=>HC,Parentheses:()=>WC,Percentage:()=>YC,PseudoClassSelector:()=>t1,PseudoElementSelector:()=>i1,Ratio:()=>s1,Raw:()=>l1,Rule:()=>m1,Scope:()=>g1,Selector:()=>A1,SelectorList:()=>v1,String:()=>E1,StyleSheet:()=>O1,SupportsDeclaration:()=>N1,TypeSelector:()=>L1,UnicodeRange:()=>U1,Url:()=>Z1,Value:()=>K1,WhiteSpace:()=>Q1});var x6=x(()=>{wg();_g();Ig();Eg();Cg();Pg();Og();Tg();Rg();Ng();Dg();$g();jg();Lg();Mg();Fg();zg();Ug();Vg();Bg();qg();Zg();Hg();Gg();Kg();Wg();Jg();Qg();Yg();Xg();ey();ty();ny();ry();iy();oy();ay();sy();cy();uy();ly();py();my();fy();hy();yy();by();Ay();xy()});var S6,v6=x(()=>{x6();S6={node:lP}});var dP,w6=x(()=>{A6();v6();dP=b6(S6)});function _6(e){let t=0;return e.trim()&&dP(X1(e),()=>{t++}),t}function I6(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=X1(e,{onParseError:i=>{throw Object.assign(new Error("CSS \u683C\u5F0F\u4E0D\u6B63\u786E\u3002"),{offset:i.offset})}}),r=0;return dP(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")}),p6(t)}var k6=x(()=>{"use strict";DU();m6();w6()});function VX(e){return I6(e)}function T6(e,t,r,i){if(!e.trim())return{html:"",elements:0};let o=Jf(e);if(o.length)throw new Error(o[0]);let a=ng(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=Jf(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 R6(e,t,r,i){let o=r.document;if(!o)throw new Error("A content document is required");let a=P6.get(r)??new Map;P6.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}`,()=>_6(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>E6)throw new Error(`Page custom HTML exceeds ${E6} elements`);if(p>C6)throw new Error(`Page custom CSS exceeds ${C6} syntax nodes`)};h(l.root)}}function BX(e,t,r){let i=pP.get(t);i||pP.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 N6(e){let t={};return{prepare:(r,i)=>qX(r,i,e,t),destroy:()=>pP.get(e)?.delete(t)}}function qX(e,t,r,i=t){if(!e)return;let o={},a=t.actions.map(d=>d.id),s=BX(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??=Tn(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}=T6(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 R6(t,l,r,c),l}function D6(e,t){let r=ln.parse(e),i=JSON.stringify(r),o=O6.get(t);o||(o=new Map,O6.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=T6(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,j]of Object.entries(w.html))E[F]=p(j);let I=d.get(w.css);return I===void 0&&(I=VX(w.css),d.set(w.css,I)),{...w,html:E,css:I}},f={...r,pages:r.pages.map(w=>({...w,root:h(w.root)}))};R6(f,void 0,t,l);let m=JSON.stringify(f),g=new TextEncoder,A=g.encode(m).length;if(A>hn.documentBytes)throw new Error(`\u754C\u9762\u5185\u5BB9\u8FC7\u5927\uFF08\u4E0A\u9650 ${hn.documentBytes/1e3} KB\uFF09\u3002`);let C=g.encode(i).length;if(C<=hn.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 E6,C6,P6,pP,O6,$6=x(()=>{"use strict";zk();k6();Ok();E6=2e3,C6=1e4,P6=new WeakMap;pP=new WeakMap;O6=new WeakMap});function ZX(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 K=k.type==="stack"?k.bind?.plan:void 0;K&&!P.ids.includes(K)&&P.ids.push(K)}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 q=b.pickers[G.id];_[G.id]={ids:q?.options??[],defaults:q?.selected?[q.selected]:[],remembered:[]};return}if(G.type!=="stack")return;let se=G.children.filter(q=>!q.hidden),ge=G.interaction;if(t(G)){let q=_[G.interaction.pickerId]??={ids:[],defaults:[],remembered:[]},oe=b.pickers[G.interaction.pickerId]?.options??[];for(let ye of se){let Ve=ye.type==="stack"?ye.bind?.plan:void 0;Ve&&oe.includes(Ve)&&!q.ids.includes(Ve)&&q.ids.push(Ve),Ve&&ye.id===S[G.id]&&q.remembered.push(Ve)}let ae=G.children[G.interaction.defaultIndex];ae?.type==="stack"&&!ae.hidden&&ae.bind?.plan&&q.defaults.push(ae.bind.plan)}if(ge?.type==="tabs"){let q=se.find(oe=>oe.id===S[G.id])??G.children[ge.defaultIndex];q&&P(q)}else if(ge?.type==="toggle"){let q=typeof S[G.id]=="boolean"?S[G.id]:ge.defaultEnabled,oe=G.children[q?0:1];oe&&P(oe)}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 K={};for(let[G,se]of Object.entries(_)){let ge=S[G],q=se.remembered[0]??(se.ids.includes(b.pickers[G]?.selected??"")?b.pickers[G]?.selected:se.defaults[0]);K[G]=typeof ge=="string"?se.ids.includes(ge)?ge:"":q&&se.ids.includes(q)?q:""}for(let G of Object.keys(r(y)))K[G]??="";return K}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,j=new Map,U=new Map,Z=new Map,Q=0,M=new Map,Y=new WeakMap,L=0,N=0,V,X=null,R=g(),O=g(),B=g(),ce="",Ae=!1,ee=-1,Ke=!1,Ce="",je=null,Me=null,Pt=null,Fe=document.createElement("div");Fe.id="g-card";let nt=document.createElement("div"),Yt=document.createElement("div");nt.className=Yt.className="g-box",Yt.dataset.kind="select",nt.append(document.createElement("span")),Yt.append(document.createElement("span"));function rt(y){let S={...y,channel:e.channel};try{o.postMessage(S,e.parentOrigin)}catch{}}function Kn(y){let S=parseInt(y.slice(1),16);return[S>>16&255,S>>8&255,S&255]}function fe(y,S,b){let _=Kn(y),P=Kn(S),T=_.map((k,K)=>Math.round(k*b+P[K]*(1-b)));return`rgb(${T[0]},${T[1]},${T[2]})`}function me(y){let[S,b,_]=Kn(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 ve(y){return typeof y!="string"?"":y.startsWith("#")?y:`var(--g-${y==="background"?"bg":y})`}function he(y){let S=y.theme,b=document.documentElement.style,_=me(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",fe(S.text,S.background,.62)),b.setProperty("--g-surface",fe(S.text,S.background,.05)),b.setProperty("--g-border",fe(S.text,S.background,.16)),b.setProperty("--g-focus",fe(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 Ie(y){let S=A?.strings.locales[ce]?.[y];return S&&S.trim()?{value:S,missing:!1}:{value:A?.strings.locales[A.strings.defaultLocale]?.[y]??"",missing:!0}}function Pe(y){let S=E?.nodes[y];if(!S)return;let b=S.picker?R[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 ze(){return{...A?.surface==="paywall"&&X?{__page:X}:{},...Object.fromEntries(Object.entries(R).filter(y=>!Array.isArray(y[1])))}}function W(y){return C&&Object.hasOwn(C.answers,y)&&C.bindings.some(S=>S.variable===y)?C.answers[y]:C?.values?.[y]}function Ne(y){let S=Z.get(y);if(S)return S;let b=[...new Set([...y.matchAll(/\{\{\s*variables\.([^{}]+?)\s*\}\}/g)].map(_=>_[1].trim()))];if(y.length<=1e6)for(Z.set(y,b),Q+=y.length;Z.size>128||Q>1e6;){let _=Z.keys().next().value;Z.delete(_),Q-=_.length}return b}function Qe(y){let S=y.html[ce];return Pe(y.id)?.html??E?.nodes[y.id]?.base.html??(S&&S.trim()?S:y.html[A?.strings.defaultLocale??""]??"")}function Ue(){Z.clear(),Q=0;let y=[],S=[],b=K=>{if(!K.hidden){if(K.type==="stack")K.children.forEach(b);else if(K.type==="custom_html"){y.push(Qe(K));let G=E?.nodes[K.id];for(let se of[G?.base,...Object.values(G?.byPlan??{})])se?.html!==void 0&&S.push(se.html)}}},_=X??A?.initialPageId,P=A?.pages??[],T=new Set;for(let K of[...P.filter(G=>G.id===_),...P.filter(G=>G.id!==_)]){y.length=S.length=0,b(K.root);for(let G of[...y,...S])T.add(G)}let k=new Set([...T].map(ut));for(let[K,G]of M)k.has(K)||dt(K,G);for(let K of T)Ne(K),!M.has(ut(K))&&(M.size>=32||N+500>4e3||L+K.length+2>262144||kn(K,!0))}function ut(y){return(e.mode==="live"&&C?"b:":"s:")+y}function dt(y,S){M.delete(y),L-=y.length,N-=S.elements}function kn(y,S=!1){let b=ut(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,K=/\{\{\s*variables\.([^{}]+?)\s*\}\}/g,G=k?y.replace(K,(ae,ye)=>(T.push(ye.trim()),`<span ${P}="${T.length-1}"></span>`)):y,se=document.createElement("template");se.innerHTML=`<div>${G}</div>`;let ge=se.content.firstElementChild,q=[];for(let ae of ge.querySelectorAll(`[${P}]`)){let ye=document.createTextNode(""),Ve=T[Number(ae.getAttribute(P))];ae.replaceWith(ye);let it=[];for(let Ye=ye;Ye!==ge;){let kt=Ye.parentNode;it.unshift(Array.prototype.indexOf.call(kt.childNodes,Ye)),Ye=kt}q.push({path:it,variable:Ve})}let oe={key:b,content:ge,inUse:!1,bindings:q,unresolved:(k?y.replace(K,""):y).includes("{{"),elements:ge.getElementsByTagName("*").length};if(b.length<=262144&&oe.elements<=4e3){if(!S)for(;M.size>=32||L+b.length>262144||N+oe.elements>4e3;){let[ae,ye]=M.entries().next().value;dt(ae,ye)}M.size<32&&L+b.length<=262144&&N+oe.elements<=4e3&&(M.set(b,oe),L+=b.length,N+=oe.elements)}return oe}function Ct(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=Y.get(y),_=Qe(S),P=e.mode==="live"&&!!C,T=b.source!==_||b.bound!==P,k;T&&(Ct(b),k=kn(_),b.source=_,b.bound=P,b.unresolved=k.unresolved,b.variables=[...new Set(k.bindings.map(q=>q.variable))]);let K=new Map,G=b.unresolved;if(P)for(let q of b.variables){let oe=W(q);if(oe==null){G=!0;continue}let ae=String(typeof oe=="object"?JSON.stringify(oe):oe).replace(/\r\n?/g,`
242
+ `);ae.includes("{{")&&(G=!0),K.set(q,ae)}if(G&&e.mode==="live"){if(Ct(b),b.parked){let oe=document.createElement("div");b.body.replaceWith(oe),b.body=oe,b.parked=!1}let q=Ie(S.fallback??"").value.replace(/\r\n?/g,`
243
+ `);(!b.fallback||b.body.textContent!==q)&&(b.body.textContent=q),b.fallback=!0,b.bindings=[]}else if(T||b.fallback||!b.initialized){k??=kn(_);let q=!k.inUse,oe=q?k.content:k.content.cloneNode(!0);b.bindings=k.bindings.map(({path:ae,variable:ye})=>{let Ve=oe;for(let it of ae)Ve=Ve.childNodes[it];return{node:Ve,variable:ye}});for(let ae of b.bindings)ae.node.data=K.get(ae.variable);b.body.replaceWith(oe),b.body=oe,b.parked=!1,q&&M.get(k.key)===k?(k.inUse=!0,b.template=k):b.template=null;for(let ae of b.body.querySelectorAll("img"))ae.addEventListener("load",zi);b.fallback=!1,b.initialized=!0}else for(let q of b.bindings){let oe=K.get(q.variable);q.node.data!==oe&&(q.node.data=oe)}let se=Pe(S.id),ge=S.html[ce];y.classList.toggle("g-missing",e.mode==="editor"&&(!!se?.missing?.length||!se&&_.includes("{{")||!(ge&&ge.trim())))}function Ot(y,S,b){let _=Pe(y.id),P=_?.[S],T=P!==void 0?{value:P,missing:!!_?.missing?.length}:Ie(b);if(e.mode==="live"&&C){let k=!1,K=T.value.replace(/\{\{\s*variables\.([^{}]+?)\s*\}\}/g,(G,se)=>{se=se.trim();let ge=W(se);return ge==null||ge===""||Array.isArray(ge)&&!ge.length?(k=!0,""):Array.isArray(ge)?ge.join(", "):String(ge)});if(k)return{value:y.fallback?Ie(y.fallback).value:"",missing:!0};if(!K.includes("{{"))return{value:K,missing:T.missing}}return P!==void 0?T:T.value.includes("{{")&&e.mode==="live"?{value:y.fallback?Ie(y.fallback).value:"",missing:!0}:{value:T.value,missing:T.missing||T.value.includes("{{")}}function Lr(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 ii(y,S){if(S.type==="color")y.background="none",y.backgroundColor=ve(S.color);else if(S.type==="linear"){let b=S.stops.map(_=>`${ve(_.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 $o(y){return`${Number(y.top)}px ${Number(y.right)}px ${Number(y.bottom)}px ${Number(y.left)}px`}function jo(y,S,b,_,P){if(S===void 0)return;let T=_?.direction??"vertical",k=T!=="overlay"&&b==="width"==(T==="horizontal"),K=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[K]="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 oi(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=ve(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=$o(_.padding)),_.margin&&(T.margin=$o(_.margin)),typeof _.gap=="number"&&S.type==="stack"&&(T.gap=`${_.gap}px`),_.background&&ii(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 K=_.border;K&&(T.border=Number(K.width)>0?`${Number(K.width)}px ${K.style==="dashed"?"dashed":"solid"} ${ve(K.color)}`:"0");let G=_.shadow;G&&(T.boxShadow=`${Number(G.x)}px ${Number(G.y)}px ${Number(G.blur)}px ${Number(G.spread)}px ${ve(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=ve(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))),jo(y,_.width,"width",b,P.align),jo(y,_.height,"height",b,P.align),b?.direction==="horizontal"&&_.grow!==void 0&&(T.flexGrow=String(_.grow===!0?1:_.grow===!1?0:_.grow))}function Mr(y,S){if(C){let b=C.bindings.find(_=>_.componentId===y);if(!b)return;C.answers[b.variable]=S,w.add(y),rt({type:"answers",answers:Lo()}),Xt();return}}function Lo(){let y={};for(let S of C?.bindings??[]){let b=R[S.componentId];b!==void 0&&typeof b!="number"&&(y[S.variable]=b)}return y}function Va(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=ce.startsWith("zh"),T=(pe,Le)=>P?pe:Le;S.setAttribute("aria-busy",String(!!_));let k=(pe,Le,Tt)=>{let Be=document.createElement(pe);return Be.className=Le,Tt!==void 0&&(Be.textContent=Tt),Be},K=pe=>{let Le=document.createElementNS("http://www.w3.org/2000/svg","svg");Le.setAttribute("viewBox","0 0 24 24"),Le.setAttribute("fill","none"),Le.setAttribute("stroke","currentColor"),Le.setAttribute("stroke-width","1.7"),Le.setAttribute("stroke-linecap","round"),Le.setAttribute("stroke-linejoin","round"),Le.setAttribute("aria-hidden","true"),Le.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 Be of Tt[pe]){let mt=document.createElementNS("http://www.w3.org/2000/svg","path");mt.setAttribute("d",Be),Le.append(mt)}return Le},G=(pe,Le,Tt,Be=!1,mt=Le)=>{let Lt=k("button","g-data-button",pe);return Lt.type="button",Lt.disabled=Be||!!_&&Le!=="refresh"||!!b?.preview||e.mode!=="live",_&&Le==="refresh"&&Lt.setAttribute("aria-disabled","true"),Lt.dataset.gDataFocus=`${y.id}:${mt}:${Tt??""}`,Lt.addEventListener("click",pn=>{!pn.isTrusted||Lt.disabled||_||rt({type:"customer-data-intent",intent:{nodeId:y.id,action:Le,...Tt?{value:Tt}:{}}})}),Lt},se=k("div","g-data-header"),ge=k("h2","g-data-heading",Ie(y.title).value);ge.id=`g-data-title-${y.id}`,S.setAttribute("aria-labelledby",ge.id);let q=k("div","g-data-controls"),oe=[],ae=pe=>{pe.hidden||(pe.type==="customer_data"&&oe.push(pe),pe.type==="stack"&&pe.children.forEach(ae))},ye=A?.pages[0];ye&&ae(ye.root);let Ve=oe.every(pe=>I?.nodes[pe.id]?.preview),it=oe.find(pe=>pe.data.source==="credit_balance")??oe[0];b?.preview&&(!Ve||it?.id===y.id)&&q.append(k("span","g-data-preview",T("\u793A\u4F8B\u6570\u636E","Sample data")));let Ye=_?T("\u66F4\u65B0\u4E2D\u2026","Updating\u2026"):T("\u5237\u65B0","Refresh"),kt=G(Ye,"refresh");if(kt.replaceChildren(K("refresh")),kt.setAttribute("aria-label",Ye),kt.title=Ye,kt.classList.add("g-data-refresh"),_&&kt.classList.add("g-data-refreshing"),q.append(kt),y.data.source==="billing"&&y.data.outputs?.billing_portal&&q.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"&&(ge.prepend(K("credit")),b?.resources.length===1&&ge.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(ce,{timeStyle:"short"}).format(new Date(b.updatedAt))}`);pe.dateTime=b.updatedAt,pe.title=new Intl.DateTimeFormat(ce,{dateStyle:"medium",timeStyle:"short"}).format(new Date(b.updatedAt)),q.prepend(pe)}if(se.append(ge,q),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 Le=k("div","g-data-recovery");Le.append(G(T("\u91CD\u8BD5","Retry"),"refresh")),S.append(Le)}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,Le=k("section","g-data-resource");Le.dataset.gDataReview="",Le.setAttribute("aria-label",pe.title),Le.setAttribute("aria-busy",String(!!b.membershipBusy));let Tt=k("h3","g-data-row-label",pe.title);Tt.tabIndex=-1,Le.append(Tt);let Be=k("dl","g-data-facts");for(let Lt of pe.facts){let pn=k("div","");pn.append(k("dt","",Lt.label),k("dd","",Lt.value)),Be.append(pn)}Le.append(Be,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)),Le.append(mt),S.append(Le)}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 Be=0;Be<Tt;Be++){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 Le=k("p","g-data-live-status",T("\u6B63\u5728\u8BFB\u53D6\u8D26\u6237\u6570\u636E\u2026","Loading account data\u2026"));return Le.setAttribute("role","status"),S.append(pe,Le),S}let on={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(on[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[Le,Tt,Be]of on[y.data.source]){let mt=document.createElement("option");mt.value=Le,mt.textContent=T(Tt,Be),pe.append(mt)}pe.value=b.filter,pe.addEventListener("change",()=>{!pe.disabled&&e.mode==="live"&&rt({type:"customer-data-intent",intent:{nodeId:y.id,action:"filter",value:pe.value}})}),q.prepend(pe)}let $d=(pe,Le=!1)=>{let Tt=k("ul","g-data-list");if(y.data.source==="credit_transactions"&&pe.length&&!Le){let Be=k("div","g-data-table-head");Be.setAttribute("aria-hidden","true"),Be.append(k("span","",T("\u8BB0\u5F55","Record")),k("span","",T("\u7C7B\u578B","Type")),k("span","",T("\u79EF\u5206","Credits"))),S.append(Be)}for(let Be of pe){let mt=k("li","g-data-row"),Lt=k("div","g-data-row-main"),pn=k("div","g-data-row-copy");pn.append(k("p","g-data-row-label",Be.label));for(let ft of Be.detail)ft!==Be.status&&pn.append(k("div","g-data-row-detail",ft));if(y.data.source==="credit_transactions"&&!Le){let ft=k("span","g-data-row-mark");ft.append(K(["Refund","\u9000\u56DE"].includes(Be.status??"")?"up":"down")),Lt.append(ft)}if(Lt.append(pn),mt.append(Lt),Be.status?mt.append(k("div","g-data-row-status",Be.status)):mt.classList.add("g-data-row-no-status"),Be.value?mt.append(k("div","g-data-row-value",Be.value)):mt.classList.add("g-data-row-no-value"),Be.facts.length||Be.purchaseId||Be.membershipActions?.length||Be.billingActions?.length){let ft=k("div","g-data-row-extra"),zr=k("div","g-data-facts"),cr=(Sn,Vo)=>{for(let Wc of Sn){let Jc=k("span","",Wc.label);Jc.append(k("strong","",Wc.value)),Vo.append(Jc)}};if(cr(Be.facts.slice(0,3),zr),Be.facts.length>3){let Sn=k("details","g-data-sources");Sn.dataset.gDataSources=`facts:${Be.id}`,Sn.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 ${Be.facts.length}`));let Vo=k("div","g-data-facts");cr(Be.facts.slice(3),Vo),Sn.append(Vo),zr.append(Sn)}if(ft.append(zr),!Le)for(let Sn of Be.billingActions??[])ft.append(G(Sn.label,Sn.action,Be.id,!!b.billingBusy));if(Be.purchaseId&&y.data.allowPurchase&&!Le){let Sn=G(b.buyingId===Be.purchaseId?T("\u6B63\u5728\u51C6\u5907\u2026","Preparing\u2026"):T("\u8D2D\u4E70\u79EF\u5206","Buy credits"),"buy_pack",Be.purchaseId,!!b.preview||!!b.buyingId);Sn.classList.add("g-data-buy"),ft.append(Sn)}if(y.data.allowPurchase&&!Le)for(let Sn of Be.membershipActions??[])ft.append(G(Sn.label,"membership_preview",Sn.value,!!b.preview||!!b.membershipBusy||!!b.membershipReview));mt.append(ft)}Tt.append(mt)}return Tt};for(let pe of b.resources){let Le=k("article","g-data-resource");Le.setAttribute("aria-label",pe.name),b.resources.length>1&&Le.append(k("p","g-data-name",pe.name));let Tt=k("div","g-data-balance"),Be=new Intl.NumberFormat(ce).formatToParts(1.1).find(ft=>ft.type==="decimal")?.value??".",mt=pe.spendable.lastIndexOf(Be),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"))),Le.append(Tt);let pn=k("div","g-data-facts");for(let[ft,zr]of[[T("\u4F59\u989D","Balance"),pe.available],[T("\u51BB\u7ED3","Reserved"),pe.reserved]]){let cr=k("span","",ft);cr.append(k("strong","",zr)),pn.append(cr)}if(pe.expiry&&pn.append(k("span","g-data-expiry",`${T("\u6700\u8FD1\u5230\u671F","Next expiry")} \xB7 ${pe.expiry}`)),Le.append(pn),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(K("chevron")),pe.hasNextSources||pe.hasPreviousSources){let zr=k("div","g-data-footer");zr.append(k("span","",`${T("\u7B2C","Page")} ${pe.sourcePage}`));let cr=k("div","g-data-controls");cr.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)),zr.append(cr),ft.append(zr)}Le.append(ft)}S.append(Le)}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(K("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 Le=k("div","g-data-controls");Le.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(Le),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(ce,{dateStyle:"medium",timeStyle:"short"}).format(new Date(b.updatedAt))}`)),S}let ai=new Map,Ba=new Map,Vc=y=>{let S=y.target;for(let b of ai.keys())S&&!Fr(b)?.contains(S)&&ai.delete(b)};document.addEventListener("focusin",Vc),document.addEventListener("pointerdown",Vc);function Bc(y){let S=I;if(I=y,!A)return;let b=(P,T)=>{if(P.type==="stack"){P.children.forEach(ye=>b(ye,P));return}if(P.type!=="customer_data"||JSON.stringify(S?.nodes[P.id])===JSON.stringify(y.nodes[P.id]))return;let k=Fr(P.id);if(!k)return;let K=document.activeElement;K&&k.contains(K)&&K.dataset.gDataFocus&&ai.set(P.id,K.dataset.gDataFocus);let G=new Set([...k.querySelectorAll("details[data-g-data-sources]")].filter(ye=>ye.open).map(ye=>ye.dataset.gDataSources)),se=Mi(P,T);if(!se)return;for(let ye of se.querySelectorAll("details[data-g-data-sources]"))ye.open=G.has(ye.dataset.gDataSources);let ge=k.scrollTop;k.replaceWith(se),se.scrollTop=ge;let q=!!y.nodes[P.id]?.membershipReview&&!S?.nodes[P.id]?.membershipReview,oe=!y.nodes[P.id]?.membershipReview&&!!S?.nodes[P.id]?.membershipReview;q&&ai.get(P.id)&&Ba.set(P.id,ai.get(P.id));let ae=oe?Ba.get(P.id):ai.get(P.id);ae&&[...se.querySelectorAll("[data-g-data-focus]")].find(ye=>ye.dataset.gDataFocus===ae)?.focus({preventScroll:!0}),q&&se.querySelector("[data-g-data-review] h3")?.focus({preventScroll:!0}),oe&&Ba.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===X)??A.pages[0];b(_.root,null),sr()}function Mi(y,S){if(y.hidden)return null;let b;if(y.type==="customer_data")b=Va(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=Mi(_,y);P&&b.append(P)}if(y.interaction&&Fi(b,y),y.purchaseAction&&e.mode==="live"){let _=E?.nodes[y.id],P=_?.picker;P&&(b.disabled=!E?.pickers[P]?.options.includes(String(R[P]??""))),Pe(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],K=R[T]??k?.selected;b.disabled=!k?.options.includes(String(K)),b.disabled&&b.setAttribute("aria-disabled","true")}e.mode==="live"&&Pe(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?.[ce]??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",zi),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 _=Pe(y.id);if(!_?.price)b.textContent=_?.text??Ie(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]&&oi(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 _=Pe(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=Ie(y.label).value,T.addEventListener("click",k=>{e.mode!=="editor"&&(k.stopPropagation(),rt({type:"copy",nodeId:y.id}))}),b.append(P,T)}else b.textContent=_?.text??Ie(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 _=Pe(y.id),P=_?.countdownAt?Date.parse(_.countdownAt):NaN,T=y.granularity==="second"?void 0:new Intl.NumberFormat(ce,{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??Ie(y.fallback).value;return}let K=Math.max(0,Math.ceil((P-Date.now())/1e3));if(!K){b.textContent=Ie(y.expired).value;let q=F.get(y.id);q!==void 0&&clearInterval(q),F.delete(y.id);return}let G=y.granularity,se=G==="day"?86400:G==="hour"?3600:G==="minute"?60:1,ge=T?T.format(Math.ceil(K/se)):[Math.floor(K/86400),Math.floor(K/3600)%24,Math.floor(K/60)%60,K%60].map(q=>String(q).padStart(2,"0")).join(":");b.textContent!==ge&&(b.textContent=ge)};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=Ie(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 R[y.id]=="number"?R[y.id]:y.defaultQuantity),R[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||Ie(y.fallback).value,T.setAttribute("aria-valuetext",_?.label??String(T.value)),T.oninput=()=>{R[y.id]=Number(T.value),rt({type:"selection",selection:ze()})},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",Ie(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=Ie(y.fallback).value,e.mode==="editor"&&b.classList.add("g-missing");else{let T=typeof R[y.id]=="string"?String(R[y.id]):_.selected,k=B[y.id];if(P){if(!k){let it=P.assignments.find(Ye=>Ye.productVersionId===T);k={period:it?.period??"month",tierId:it?.tierId??P.tiers[0].id},B[y.id]=k}let q=P.assignments.find(it=>it.tierId===k.tierId&&it.period===k.period);T=q&&_.options.includes(q.productVersionId)?q.productVersionId:"";let oe=document.createElement("div");oe.setAttribute("role","radiogroup"),oe.setAttribute("aria-label",`${Ie(P.monthLabel).value} / ${Ie(P.yearLabel).value}`),oe.style.cssText="display:flex;gap:4px;padding:4px;border:1px solid var(--g-border);border-radius:10px";let ae=["month","year"],ye=ae.filter(it=>P.assignments.some(Ye=>Ye.period===it&&_.options.includes(Ye.productVersionId))),Ve=it=>{k.period=it;let Ye=P.assignments.find(kt=>kt.tierId===k.tierId&&kt.period===it);R[y.id]=Ye&&_.options.includes(Ye.productVersionId)?Ye.productVersionId:"",Xt(),rt({type:"selection",selection:ze()}),Fr(y.id)?.querySelector(`[data-product-period="${it}"]`)?.focus()};for(let it of ae){let Ye=document.createElement("button");Ye.type="button",Ye.className=`g-btn g-btn-${it===k.period?"primary":"secondary"}`,Ye.style.cssText="flex:1;min-width:0;min-height:40px",Ye.dataset.productPeriod=it,Ye.setAttribute("role","radio"),Ye.setAttribute("aria-checked",String(it===k.period)),Ye.textContent=Ie(it==="month"?P.monthLabel:P.yearLabel).value,Ye.disabled=!ye.includes(it),Ye.tabIndex=e.mode==="editor"||Ye.disabled?-1:it===k.period||!ye.includes(k.period)&&it===ye[0]?0:-1,Ye.addEventListener("click",kt=>{e.mode!=="editor"&&(kt.stopPropagation(),Ve(it))}),Ye.addEventListener("keydown",kt=>{if(e.mode==="editor"||!ye.length)return;let on;["ArrowRight","ArrowDown"].includes(kt.key)?on=(ye.indexOf(it)+1)%ye.length:["ArrowLeft","ArrowUp"].includes(kt.key)?on=(ye.indexOf(it)-1+ye.length)%ye.length:kt.key==="Home"?on=0:kt.key==="End"&&(on=ye.length-1),on!==void 0&&(kt.preventDefault(),Ve(ye[on]))}),oe.append(Ye)}b.append(oe)}R[y.id]=T??"";let K=P?P.tiers.map(q=>({tier:q,id:P.assignments.find(oe=>oe.tierId===q.id&&oe.period===k.period)?.productVersionId})):_.options.map(q=>({id:q,tier:void 0})),G=K.filter(q=>q.id&&_.options.includes(q.id)),se=P?document.createElement("div"):b;P&&(se.setAttribute("role","radiogroup"),se.setAttribute("aria-label",Ie(y.label).value),se.style.cssText="display:flex;flex-direction:column;gap:8px",b.append(se));let ge=q=>{!q.id||!_.options.includes(q.id)||(P&&q.tier&&(k.tierId=q.tier.id),R[y.id]=q.id,Xt(),rt({type:"selection",selection:ze()}),Fr(y.id)?.querySelector(`[data-plan-id="${q.id}"]`)?.focus())};for(let q of K){let oe=q.id?E.plans[q.id]:void 0,ae=!!oe&&_.options.includes(q.id),ye=document.createElement("button");ye.type="button",ye.className="g-btn g-btn-secondary",ye.style.cssText="width:100%;text-align:start;min-height:44px",ye.setAttribute("role","radio");let Ve=P?q.tier?.id===k.tierId:q.id===T;ye.setAttribute("aria-checked",String(Ve)),ye.disabled=!ae,ye.tabIndex=e.mode==="editor"||!ae?-1:Ve||!T&&q===G[0]?0:-1,q.id&&(ye.dataset.planId=q.id),q.tier&&(ye.dataset.productTier=q.tier.id);let it=q.id?E.nodes[y.id]?.byPlan?.[q.id]?.price:void 0;ye.textContent=ae?`${q.tier?.name??oe.name} \xB7 ${it?.current??oe.price}${it?.period??oe.period}`:`${q.tier?.name??""} \xB7 ${Ie(P?.unavailableLabel??y.fallback).value}`,Ve&&(ye.style.borderColor="var(--g-primary)",ye.style.boxShadow="inset 0 0 0 1px var(--g-primary)",y.states?.selected&&oi(ye,{type:"text",id:y.id,text:y.label,variant:"body",style:y.states.selected},null)),ye.addEventListener("click",Ye=>{e.mode==="editor"||!ae||(Ye.stopPropagation(),ge(q))}),ye.addEventListener("keydown",Ye=>{if(e.mode==="editor"||!G.length)return;let kt=G.indexOf(q),on;["ArrowRight","ArrowDown"].includes(Ye.key)?on=(kt+1)%G.length:["ArrowLeft","ArrowUp"].includes(Ye.key)?on=(kt-1+G.length)%G.length:Ye.key==="Home"?on=0:Ye.key==="End"&&(on=G.length-1),on!==void 0&&(Ye.preventDefault(),ge(G[on]))}),se.append(ye)}if(P&&!T){let q=document.createElement("p");q.setAttribute("role","status"),q.textContent=Ie(P.unavailableLabel).value,b.append(q)}}}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),Y.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&&oi(b,y,S),b.dataset.gNode=y.id,b.dataset.gLabel=Lr(y),U.set(y.id,b),b}function Fi(y,S){let b=S.interaction,_=[...y.children];y.setAttribute("aria-label",Ie(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=Ie(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",Ie(b.label).value),k.setAttribute("aria-required",String(!!T?.required)),k.value=typeof R[S.id]=="string"?String(R[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",()=>{R[S.id]=k.value,Mr(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),K=new Set(Array.isArray(R[S.id])?R[S.id]:[]),G=()=>_.forEach((se,ge)=>{let q=K.has(k[ge].id);se.setAttribute("aria-checked",String(q)),se.setAttribute("aria-disabled",String(!q&&K.size>=b.max)),se.style.outline=q?"2px solid var(--g-primary)":"",se.style.outlineOffset="-2px"});_.forEach((se,ge)=>{se.setAttribute("role","checkbox"),se.tabIndex=0,se.setAttribute("aria-label",se.textContent?.trim()||String(ge+1)),se.style.cursor="pointer";let q=()=>{let oe=k[ge].id;if(K.has(oe))K.delete(oe);else if(K.size<b.max)K.add(oe);else return;let ae=k.filter(ye=>K.has(ye.id)).map(ye=>ye.id);R[S.id]=ae,G(),Mr(S.id,ae)};se.addEventListener("click",oe=>{oe.stopPropagation(),q()}),se.addEventListener("keydown",oe=>{[" ","Enter"].includes(oe.key)&&(oe.preventDefault(),oe.stopPropagation(),q())})}),G();return}if(b.type==="select"){y.setAttribute("role","radiogroup");let k=S.children.filter(ge=>!ge.hidden),K=t(S)?S.interaction.pickerId:void 0,G=k.findIndex(ge=>K?ge.type==="stack"&&ge.bind?.plan===R[K]:ge.id===R[S.id]);!K&&G<0&&!T?.required&&(G=Math.min(b.defaultIndex,_.length-1));let se=(ge,q=!1,oe=!0)=>{if(K&&oe&&ge>=0){let ae=k[ge],ye=ae.type==="stack"?ae.bind?.plan:void 0;if(!ye||!E?.pickers[K]?.options.includes(ye))return;R[S.id]=ae.id,R[K]=ye,Xt(),rt({type:"selection",selection:ze()}),q&&Fe.querySelector(`[data-g-node="${ae.id}"]`)?.focus({preventScroll:!0});return}G=ge,ge>=0&&(R[S.id]=k[ge].id),oe&&ge>=0&&Mr(S.id,k[ge].id),_.forEach((ae,ye)=>{ae.setAttribute("aria-checked",String(ye===ge)),ae.tabIndex=ye===(ge<0?0:ge)?0:-1,ae.style.cssText="";let Ve=k[ye];Ve.type==="stack"&&(ae.style.alignItems=l[Ve.align]??"stretch",ae.style.justifyContent=d[Ve.justify]??"flex-start"),Ve.style&&oi(ae,Ve,S),ye===ge&&(b.selectedStyle&&oi(ae,{...Ve,style:b.selectedStyle},S),Ve.type==="stack"&&Ve.states?.selected&&oi(ae,{...Ve,style:Ve.states.selected},S),!b.selectedStyle?.border&&!(Ve.type==="stack"&&Ve.states?.selected?.border)&&(ae.style.outline="2px solid var(--g-primary)",ae.style.outlineOffset="-2px")),ae.style.cursor="pointer"}),q&&ge>=0&&_[ge].focus()};_.forEach((ge,q)=>{if(ge.setAttribute("role","radio"),K){let oe=k[q],ae=oe.type==="stack"?oe.bind?.plan:void 0;ge.setAttribute("aria-disabled",String(!ae||!E?.pickers[K]?.options.includes(ae)))}ge.setAttribute("aria-label",ge.textContent?.trim()||String(q+1)),ge.addEventListener("click",oe=>{oe.stopPropagation(),se(q)}),ge.addEventListener("keydown",oe=>{let ae=oe.key;if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"," ","Enter"].includes(ae))return;oe.preventDefault(),oe.stopPropagation();let ye=G<0?q:G;se(ae==="Home"?0:ae==="End"?_.length-1:ae==="ArrowRight"||ae==="ArrowDown"?(ye+1)%_.length:ae==="ArrowLeft"||ae==="ArrowUp"?(ye+_.length-1)%_.length:q,!0)})}),se(G,!1,!1)}else if(b.type==="tabs"){let k=S.children.filter(q=>!q.hidden),K=document.createElement("div");K.setAttribute("role","tablist"),K.setAttribute("aria-label",Ie(b.label).value),K.style.cssText="display:flex;gap:4px;padding:4px;border:1px solid var(--g-border);border-radius:12px";let G=_.map((q,oe)=>{let ae=document.createElement("button");return ae.type="button",ae.setAttribute("role","tab"),ae.textContent=si(k[oe])||String(oe+1),ae.style.cssText="flex:1;min-width:0;min-height:44px;padding:8px 16px;border:0;border-radius:8px;font:inherit;cursor:pointer",q.id=`g-${S.id}-${k[oe].id}`,q.setAttribute("role","tabpanel"),ae.setAttribute("aria-controls",q.id),K.append(ae),ae}),se=(q,oe=!1,ae=!1)=>{if(R[S.id]=k[q].id,ae&&A&&Object.keys(r(A)).length){for(let ye of Object.keys(r(A)))delete R[ye];Xt(),rt({type:"selection",selection:ze()}),oe&&Fe.querySelector(`[data-g-node="${S.id}"] [role="tab"][aria-selected="true"]`)?.focus({preventScroll:!0});return}_.forEach((ye,Ve)=>{ye.hidden=Ve!==q,G[Ve].setAttribute("aria-selected",String(Ve===q)),G[Ve].tabIndex=Ve===q?0:-1,G[Ve].style.background=Ve===q?"var(--g-primary)":"transparent",G[Ve].style.color=Ve===q?"var(--g-on-primary)":"var(--g-text)"}),oe&&G[q].focus(),sr()};G.forEach((q,oe)=>{q.addEventListener("click",ae=>{ae.stopPropagation(),se(oe,!1,!0)}),q.addEventListener("keydown",ae=>{["ArrowLeft","ArrowRight","Home","End"].includes(ae.key)&&(ae.preventDefault(),ae.stopPropagation(),se(ae.key==="Home"?0:ae.key==="End"?_.length-1:(oe+(ae.key==="ArrowRight"?1:_.length-1))%_.length,!0,!0))})}),y.prepend(K);let ge=k.findIndex(q=>q.id===R[S.id]);se(ge>=0?ge: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 K=document.createElement("span");K.textContent=Ie(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(K,G);let ge=(q,oe=!1)=>{if(R[S.id]=q,oe&&A&&Object.keys(r(A)).length){for(let ae of Object.keys(r(A)))delete R[ae];Xt(),rt({type:"selection",selection:ze()}),Fe.querySelector(`[data-g-node="${S.id}"] [role="switch"]`)?.focus({preventScroll:!0});return}k.setAttribute("aria-checked",String(q)),G.style.background=q?"var(--g-primary)":"var(--g-border)",se.style.left=q?"23px":"3px",se.style.background=q?"var(--g-on-primary)":"#FFFFFF",_.forEach((ae,ye)=>ae.hidden=ye!==(q?0:1)),sr()};k.addEventListener("click",q=>{q.stopPropagation(),ge(!R[S.id],!0),Mr(S.id,!!R[S.id])}),y.prepend(k),ge(typeof R[S.id]=="boolean"?R[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 K=document.createElement("button"),G=document.createElement("button"),se=document.createElement("span"),ge=ce.startsWith("zh");K.textContent="\u2190",G.textContent="\u2192",K.setAttribute("aria-label",ge?"\u4E0A\u4E00\u6761\u8BC4\u4EF7":"Previous review"),G.setAttribute("aria-label",ge?"\u4E0B\u4E00\u6761\u8BC4\u4EF7":"Next review");for(let oe of[K,G])oe.type="button",oe.className="g-btn g-btn-secondary",oe.style.color="var(--g-text)";se.setAttribute("aria-live","polite");let q=oe=>{O[S.id]=oe,_.forEach((ae,ye)=>ae.hidden=ye!==oe),se.textContent=`${oe+1} / ${_.length}`,sr()};K.addEventListener("click",oe=>{oe.stopPropagation(),q((O[S.id]+_.length-1)%_.length)}),G.addEventListener("click",oe=>{oe.stopPropagation(),q((O[S.id]+1)%_.length)}),k.append(K,se,G),y.append(k),q(O[S.id]??0)}}}function si(y){if(y.hidden)return"";if(y.type==="text"&&(y.variant==="title"||y.variant==="heading"))return Ie(y.text).value;if(y.type==="stack")for(let S of y.children){let b=si(S);if(b)return b}return""}function qc(y){return y.type==="stack"&&!y.interaction&&!y.purchaseAction}function Mo(y){let S=[],b=_=>{let P=E?.nodes[_.id];if(S.push(_.id,Pe(_.id)),P?.picker&&S.push(R[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=Qe(_);S.push(T,e.mode==="live"&&C?Ne(T).map(k=>[k,W(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(R[_.id],B[_.id],T,P,T?.options.map(k=>E?.plans[k]))}else _.type==="stack"&&(_.interaction?.type!=="input"&&S.push(R[_.id],O[_.id]),t(_)&&S.push(R[_.interaction.pickerId],E?.pickers[_.interaction.pickerId]),_.children.forEach(b))};return b(y),JSON.stringify(S)}function Zc(y){y.hidden||(qc(y)?y.children.forEach(Zc):j.set(y.id,Mo(y)))}function qa(y){if(y.type==="custom_html"){let b=Fr(y.id),_=b&&Y.get(b);_&&Ct(_)}let S=F.get(y.id);S!==void 0&&clearInterval(S),F.delete(y.id),y.type==="stack"&&y.children.forEach(qa)}function Hc(y,S){if(y.hidden)return;if(qc(y)){y.children.forEach(P=>Hc(P,y));return}if(j.get(y.id)===Mo(y))return;let b=Fr(y.id);if(!b)return;if(y.type==="custom_html"&&Y.has(b)){Dt(b,y),j.set(y.id,Mo(y));return}qa(y);let _=Mi(y,S);_&&(b.replaceWith(_),j.set(y.id,Mo(y)))}function Za(){let y=document.activeElement;if(!(y instanceof HTMLElement)||!Fe.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 Ha(y){if(!y||y.active.isConnected)return;let S=Fr(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 Xt(y=!1){if(!A)return;let S=y?void 0:Za(),b=A.pages.find(P=>P.id===(X??A.initialPageId))??A.pages[0];if(X=b.id,E){let P={},T=k=>{k.type==="stack"&&k.children.forEach(T),k.type==="plan_picker"&&typeof R[k.id]=="string"&&R[k.id]!==""&&(P[k.id]=String(R[k.id]))};T(b.root),Object.assign(R,i({...A,pages:[b]},ze(),E)),Object.assign(R,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],K=B[P.id];if(!K){let se=T.assignments.find(ge=>ge.productVersionId===(R[P.id]??k?.selected));K={period:se?.period??"month",tierId:se?.tierId??T.tiers[0].id},B[P.id]=K}let G=T.assignments.find(se=>se.tierId===K.tierId&&se.period===K.period);R[P.id]=G&&k?.options.includes(G.productVersionId)?G.productVersionId:""};if(_(b.root),y||V!==b){V&&qa(V.root),F.forEach(k=>clearInterval(k)),F.clear(),j.clear(),U.clear(),Fe.style.cssText="",he(b.theme?{...A,theme:b.theme}:A);let P=ce.split("-")[0];document.documentElement.lang=ce,document.documentElement.dir=["ar","he","fa","ur"].includes(P)?"rtl":"ltr",Fe.dataset.gPresentation=A.presentation.type;let T=Mi(b.root,null);Fe.replaceChildren(...T?[T]:[]),V=b,Zc(b.root)}else Hc(b.root,null);if(Ha(S),Fe.dataset.gPage=b.id,e.mode==="live"&&rt({type:"page",pageId:b.id}),Ae)sr();else{zo(),Fo();let P=Math.ceil(Fe.getBoundingClientRect().height);Ae=!0,ee=P,rt({type:"rendered",height:P,label:si(b.root)||A.name})}}function sr(){let y=Math.ceil(Fe.getBoundingClientRect().height);y!==ee&&(ee=y,rt({type:"resize",height:y})),zo(),Fo()}function zi(){Ke||(Ke=!0,window.requestAnimationFrame(()=>{Ke=!1,sr()}))}function Fo(){if(e.mode!=="editor")return;let y=[];for(let b of Fe.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!==Ce&&(Ce=S,rt({type:"layout",nodes:y}))}function Fr(y){if(!y||!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(y))return null;let S=U.get(y);return S?.isConnected?S:null}function Gc(y,S){let b=Fr(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 zo(){e.mode==="editor"&&(Gc(Yt,Me),Gc(nt,je&&je!==Me?je:null))}function Uo(y){for(let S of y.composedPath()){if(S instanceof HTMLElement&&S.dataset.gNode)return S.dataset.gNode;if(S===Fe)break}return null}function Kc(y){if(y.isTrusted){if(e.mode==="editor"){y.preventDefault(),y.stopPropagation(),rt({type:"select",id:Uo(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(X=_.pageId,A)for(let T of Object.keys(r(A)))delete R[T];Xt();let P=Fe.querySelector("h1,h2")??Fe;P===Fe&&(Fe.setAttribute("role","group"),Fe.setAttribute("aria-label",A?.pages.find(T=>T.id===X)?.name??A?.name??"Page")),P.tabIndex=-1,P.focus({preventScroll:!0});return}rt({type:"action",actionId:b,nodeId:Uo(y)??void 0,...Object.keys(R).length?{selection:ze()}:{},...C?{answers:Lo()}:{}});return}if(S===Fe)return}}}function Dd(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(),L=N=0,A=b,X=null,ce=String(S.locale),w=new Set,C=S.serverInput,R=g(),B=g(),E=S.capabilities,I=S.customerData,ai.clear();for(let[_,P]of Object.entries(E?.pickers??{}))P.selected&&(R[_]=P.selected);if(S.selection&&typeof S.selection=="object"&&!Array.isArray(S.selection)){let _=S.selection,P=k=>{let K=_[k.id];if(k.type==="quantity_picker"&&typeof K=="number"&&(R[k.id]=K),k.type==="plan_picker"&&typeof K=="string"&&k.planIds?.includes(K)&&(R[k.id]=K),k.type==="stack"){if(k.interaction?.type==="toggle"&&typeof K=="boolean"&&(R[k.id]=K),k.interaction&&["select","tabs"].includes(k.interaction.type)&&typeof K=="string"&&k.children.some(G=>G.id===K)&&(R[k.id]=K),t(k)){let G=_[k.interaction.pickerId];typeof G=="string"&&k.children.some(se=>se.type==="stack"&&se.bind?.plan===G)&&(R[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)&&(X=T)}for(let _ of C?.bindings??[])Object.hasOwn(C.answers,_.variable)&&(R[_.componentId]=C.answers[_.variable],w.add(_.componentId));O=g(),ce=String(S.locale),Ue(),Xt(!0)}else if(S.type==="capabilities"){E=S.capabilities;for(let[b,_]of Object.entries(E.quantities??{})){let P=Fr(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)}}Ue();for(let[b,_]of Object.entries(E.pickers))!B[b]&&(R[b]===void 0||R[b]==="")&&(R[b]=_.selected??"");Xt()}else S.type==="customer-data"?Bc(S.data):S.type==="restore-action-focus"&&e.mode==="live"?[...Fe.querySelectorAll("button[data-g-node]")].find(b=>b.dataset.gNode===S.nodeId&&!b.disabled)?.focus({preventScroll:!0}):S.type==="highlight"&&e.mode==="editor"&&(je=S.hoverId??null,Me=S.selectedId??null,zo())}catch(b){rt({type:"error",message:b instanceof Error?b.message:"render failed"})}}let Ui=document.createElement("style");if(Ui.textContent=m,document.head.append(Ui),document.body.append(Fe),e.mode==="editor"){document.body.dataset.gEditor="",document.body.append(nt,Yt),document.addEventListener("mouseover",S=>{let b=Uo(S);b!==Pt&&(Pt=b,rt({type:"hover",id:b}))}),document.documentElement.addEventListener("mouseleave",()=>{Pt!==null&&(Pt=null,rt({type:"hover",id:null}))}),document.addEventListener("dblclick",S=>{let b=Uo(S);b&&S.isTrusted&&rt({type:"edit",id:b})}),document.addEventListener("click",S=>{Fe.contains(S.target)||rt({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(),rt({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(),rt({type:"zoom",delta:S.deltaY}))},{passive:!1})}Fe.addEventListener("click",Kc),document.addEventListener("keydown",y=>{y.key==="Escape"&&y.isTrusted&&rt({type:"escape"})}),typeof ResizeObserver=="function"&&new ResizeObserver(zi).observe(Fe),window.addEventListener("resize",zi),e.mode==="editor"&&window.addEventListener("scroll",Fo),window.addEventListener("message",y=>{y.source===o&&Dd(y.data)}),a.__indianaReceive=Dd,rt({type:"ready"})}function j6(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}">${HX}<\/script></body></html>`}var HX,L6=x(()=>{"use strict";HX=`(${ZX.toString()})(JSON.parse(document.getElementById("grow-renderer-boot").textContent))`});function M6(e,t){return mP.set(e,t),()=>mP.delete(e)}function Od(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?mP.get(r)?.():void 0;return()=>{!r?.isConnected||!t||!(r instanceof t)||(r.focus({preventScroll:!0}),i?.())}}var mP,Iy=x(()=>{"use strict";mP=new WeakMap});function F6(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 z6=x(()=>{"use strict"});function U6(e){return Object.assign(new Error(`Web View renderer did not start (${e.phase} timeout)`),{name:"RendererStartupError",code:"RENDERER_STARTUP_TIMEOUT",details:e})}function V6(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 B6=x(()=>{"use strict"});function GX(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(Tk.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=j6(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 ky(e,t={}){let r=(()=>{let R=e.ownerDocument.defaultView;if(!R)throw new Error("Preview container has no browser window");return R})(),i=t.mode??"editor",o=N6(r),{frame:a,post:s,accept:c}=GX(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=M6(a,()=>f),g,A,C=new Promise((R,O)=>{g=R,A=O});C.catch(()=>{});let w=V6(e.ownerDocument,R=>{if(h||l)return;let O=U6(R);A(O),ot(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",V),u=!1,d=null,p=null,I=null,U=void 0,Q.clear(),a.remove(),a.removeAttribute("srcdoc"),a.removeAttribute("src"))}let I=null,F={},j,U,Z="modal",Q=new Set,M=t.viewportHeight,Y=0,L=R=>{Y=R;let O=M,B=O?Z==="fullscreen"?O:Math.max(1,Math.min(R,O-(Z==="sheet"?0:32))):R;a.style.height=`${B}px`,ot(t.onResize,B)};function N(R){if(!U)return;let O=Jr.safeParse(R);if(!O.success||Object.keys(O.data).some(B=>!U.bindings.some(ce=>ce.variable===B))){ot(t.onError,"Invalid current-screen answers");return}return O.data}function V(R){let O=h?null:c(R);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")L(O.height),O.type==="rendered"&&(l=!0,w(),ot(t.onRendered));else if(O.type==="layout"&&i==="editor")Array.isArray(O.nodes)&&O.nodes.length<=(I?hn.nodes:0)&&O.nodes.every(B=>B&&typeof B.id=="string"&&/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(B.id)&&[B.x,B.y,B.width,B.height].every(ce=>typeof ce=="number"&&Number.isFinite(ce))&&B.width>0&&B.height>0)&&ot(t.onLayout,O.nodes);else if(O.type==="page"&&i==="live"&&Q.has(O.pageId))ot(t.onPageChange,O.pageId);else if(O.type==="escape"&&i==="live")ot(t.onEscape);else if(O.type==="hover")ot(t.onHover,O.id);else if(O.type==="select")ot(t.onSelect,O.id);else if(O.type==="edit")ot(t.onEdit,O.id);else if(O.type==="key"&&i==="editor"){let B=O.key;B&&typeof B.key=="string"&&B.key.length<=16&&(B.phase==="down"||B.phase==="up")&&[B.meta,B.ctrl,B.shift,B.alt].every(ce=>typeof ce=="boolean")&&ot(t.onKey,{key:B.key,phase:B.phase,meta:B.meta,ctrl:B.ctrl,shift:B.shift,alt:B.alt})}else if(O.type==="zoom"&&i==="editor"&&typeof O.delta=="number"&&Number.isFinite(O.delta))ot(t.onZoom,O.delta);else if(O.type==="customer-data-intent"&&i==="live"&&I){let B=n_.safeParse(O.intent);B.success&&Tn(I,B.data.nodeId)?.type==="customer_data"&&ot(t.onCustomerDataIntent,B.data)}else if(O.type==="answers"&&i==="live"&&U){let B=N(O.answers);B&&ot(t.onAnswers,B)}else if(O.type==="selection"&&I&&d?.type==="render"&&d.capabilities){let B=Yf(I,O.selection,d.capabilities);F=B;let ce=rd(I,j??d.capabilities,B,d.locale);s({type:"capabilities",capabilities:ce}),ot(t.onSelection,B)}else if(O.type==="action"&&I?.actions.some(B=>B.id===O.actionId)){let B=N(O.answers);if(U&&!B)return;let ce=I,Ae=O.nodeId?Tn(ce,O.nodeId):void 0;f=i==="live"&&Ae?.type==="button"&&Ae.action===O.actionId?()=>{!h&&I===ce&&s({type:"restore-action-focus",nodeId:Ae.id})}:void 0,ot(t.onAction,O.actionId,Yf(I,O.selection,d?.type==="render"?d.capabilities:void 0),B)}else O.type==="error"&&ot(t.onError,O.message)}window.addEventListener("message",V),e.append(a);let X={ready:C,get document(){return I},updateCustomerData(R){if(h||!I)return;let O=ec.parse(R),B={nodes:Object.fromEntries(Object.entries(O.nodes).filter(([ce,Ae])=>{let ee=Tn(I,ce);return ee?.type==="customer_data"&&ee.data.source===Ae.source}))};d?.type==="render"&&(d.customerData=B),u&&s({type:"customer-data",data:B})},updateCapabilities(R){if(h||!I)return;j=R;let O=o.prepare(rd(I,R,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(R,O,B){if(h)return;let ce;try{let Ae=D6(R,r),ee=i==="live"&&!!B?.serverInput,Ke=ee?Ul(Ae,[O]):O,Ce=ee?a_(Ae,Ke):Ae,je=B?.serverInput?Q_.parse(B.serverInput):void 0;if(je&&(Ae.surface!=="paywall"&&Ae.pages.length!==1||Ae.actions.some(Fe=>Fe.type!=="event"&&Fe.type!=="navigate"||Fe.close)||je.bindings.some(Fe=>{let nt=Tn(Ae,Fe.componentId);return nt?.type!=="stack"||!nt.interaction||!["input","multiselect","select","tabs","toggle"].includes(nt.interaction.type)})))throw new Error("Current Funnel input requires one screen with bound interactive controls and output actions");let Me=Zn.parse(B?.parameters??{}),Pt=B?.customerData?ec.parse(B.customerData):void 0;if(i==="live"&&!B?.reset&&d?.type==="render"&&(B?.capabilities!==void 0||d.capabilities===void 0)&&JSON.stringify([d.doc,d.locale,d.parameters,d.serverInput,d.selection])===JSON.stringify([Ce,Ke,Me,je,B?.selection])){B?.capabilities&&X.updateCapabilities(B.capabilities),JSON.stringify(d.customerData)!==JSON.stringify(Pt)&&(X.updateCustomerData(Pt??{nodes:{}}),d.customerData=Pt);return}I=Ce,j=B?.capabilities,F=B?.selection??{},U=je,Z=Ae.presentation.type,Q=new Set(Ae.pages.map(Fe=>Fe.id)),ce={type:"render",doc:Ce,...je?{serverInput:je}:{},locale:Ke,parameters:Me,capabilities:o.prepare(B?.capabilities?rd(Ce,B.capabilities,B.selection??{},Ke):void 0,Ae),...B?.selection?{selection:B.selection}:{},customerData:Pt},Z==="fullscreen"&&M&&L(M)}catch(Ae){ot(t.onError,Ae instanceof Error?Ae.message:"\u5185\u5BB9\u4E0D\u6B63\u786E");return}d=ce,u&&(s(ce),w.ready())},resizeViewport(R){h||!Number.isFinite(R)||R<=0||(M=R,L(Y))},highlight(R,O){h||(p={type:"highlight",hoverId:R,selectedId:O},u&&s(p))},destroy:E};return X}var fP=x(()=>{"use strict";Ok();PF();$6();L6();Na();Iy();B6()});async function K6(e,t,r){if(t.status!=="complete")throw new H("INVALID_RESPONSE","A verified completed purchase is required");if(await r.onComplete?.(t),!e||!r.check)return;let i=Hr.parse(await r.check());if(i.internal_feature_id!==e.internal_feature_id||i.quantity!==e.quantity)throw new H("INVALID_RESPONSE","The access requirement changed");i.allowed&&await r.onAccessGranted?.(i)}var W6=x(()=>{"use strict";yn();xr()});var yP={};ke(yP,{mountScreenPreview:()=>ky});var bP=x(()=>{fP()});async function Ty(e,t){let r=t.check?Hr.parse(await t.check()):null;if(r?.allowed)return await t.onAccessGranted?.(r),{check:r,host:null};let i=Od(e.ownerDocument),o=await t.start(),a=o.view??await o.refresh();if(!a)throw new H("INVALID_RESPONSE","Paywall presentation is missing");let{mountScreenPreview:s}=await Promise.resolve().then(()=>(bP(),yP)),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,j=!1,U=()=>!j&&t.canInteract?.()!==!1,Z=!1,Q=null,M=null,Y=new Map;async function L(ee){if(!(!U()||!ee.checkoutUrl||Y.get(ee.operationId)===ee.checkoutUrl)){Y.set(ee.operationId,ee.checkoutUrl);try{t.onCheckoutUrl?await t.onCheckoutUrl(ee.checkoutUrl):c.defaultView?.location.assign(ee.checkoutUrl)}catch(Ke){throw Y.delete(ee.operationId),Ke}}}let N=ee=>{h.textContent=ee instanceof Error?ee.message:A?"\u8BF7\u6C42\u5931\u8D25":"Request failed",ot(t.onError,ee),f.hidden=Q===null};async function V(ee){if(!(I||E||!U())){I=!0,f.hidden=!0,h.textContent="";try{await ee()}catch(Ke){E||N(Ke)}finally{I=!1}}}async function X(ee){await K6(r,ee,t)}async function R(ee){if(E)return;if(!U()){Q=async()=>R(await o.read()),f.hidden=!1;return}if(h.textContent=ee.status,ee.problem){let je=ee.problem;Q=O,f.textContent=A?"\u68C0\u67E5\u5E76\u6062\u590D\u539F\u64CD\u4F5C":"Check and recover original purchase",N(new H(je.code,je.reason==="RESULT_UNKNOWN"?A?"\u4ED8\u6B3E\u7ED3\u679C\u5C1A\u672A\u786E\u5B9A\uFF0C\u8BF7\u6062\u590D\u539F\u64CD\u4F5C\uFF0C\u6682\u52FF\u91CD\u590D\u8D2D\u4E70\u3002":"The payment result is unknown. Recover the original purchase before buying again.":je.phase==="fulfillment"?A?"\u4ED8\u6B3E\u5DF2\u8BB0\u5F55\uFF0C\u5546\u6237\u6743\u76CA\u5904\u7406\u9700\u8981\u6838\u5BF9\u3002":"Payment was recorded. Access fulfillment needs attention.":je.code==="CAPABILITY_UNAVAILABLE"?A?"\u5546\u6237\u5C1A\u4E0D\u652F\u6301\u672C\u6B21\u8D2D\u4E70\u6240\u9700\u7684\u5B8C\u6574\u80FD\u529B\uFF0C\u8BF7\u5904\u7406\u540E\u6062\u590D\u539F\u64CD\u4F5C\u3002":"The merchant does not currently support all actions required by this purchase. Recover the original purchase after this is resolved.":je.code==="NOT_CONFIGURED"?A?"\u4ED8\u6B3E\u670D\u52A1\u8FDE\u63A5\u9700\u8981\u5904\u7406\uFF0C\u8BF7\u8054\u7CFB\u5546\u6237\u540E\u6062\u590D\u539F\u64CD\u4F5C\u3002":"The payment connection needs attention. Contact the merchant, then recover the original purchase.":A?"\u539F\u8D2D\u4E70\u64CD\u4F5C\u9700\u8981\u5904\u7406\uFF0C\u8BF7\u67E5\u8BE2\u6216\u6062\u590D\u6B64\u64CD\u4F5C\u3002":"The original purchase needs attention. Check or recover this operation.",void 0,void 0,je));return}if(ee.merchantExecution?.type==="purchase"&&ee.merchantExecution.paymentStatus==="succeeded"&&!["applied","not_applicable"].includes(ee.merchantExecution.fulfillmentStatus)&&(h.textContent=A?"\u4ED8\u6B3E\u5DF2\u8BB0\u5F55\uFF0C\u6B63\u5728\u7B49\u5F85\u5546\u6237\u5B8C\u6210\u5904\u7406\u3002":"Payment was recorded. Waiting for merchant fulfillment."),ee.status==="complete"){Q=null,await X(ee);return}if(ee.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",Q=async()=>R(await o.read()),f.hidden=!1;return}f.textContent=A?"\u91CD\u8BD5":"Retry",Q=null,F=null;return}await L(ee);let Ke=Date.now()+6e5,Ce=2e3;for(;!E&&Date.now()<Ke;){if(await new Promise(Me=>{let Pt=()=>{clearTimeout(Fe),Me()},Fe=setTimeout(()=>{u.signal.removeEventListener("abort",Pt),Me()},Ce);u.signal.addEventListener("abort",Pt,{once:!0})}),E)return;if(!U()){Q=async()=>R(await o.read()),f.hidden=!1;return}let je=await o.read();if(!je.problem&&je.status==="pending"&&await L(je),je.status!=="pending"||je.problem){await R(je);return}Ce=Math.min(Ce*1.5,3e4)}Q=async()=>R(await o.read()),f.hidden=!1}async function O(){M?.remove(),M=null,Q=O;let ee=await o.confirm();if(!U()){Q=O,f.hidden=!1;return}if(ee.problem){await R(ee);return}if(ee.status==="pending"){if(ee.checkoutUrl)await L(ee);else if(ee.execution&&ee.execution.provider!=="merchant"||ee.nativePurchase){if(!t.onPurchase)throw new H("PURCHASE_HANDLER_REQUIRED","Provide the merchant or native purchase handler");await t.onPurchase({operation:ee,signal:u.signal})}}Q=async()=>R(await o.read()),await R(ee)}function B(ee){M?.remove();let Ke=c.createElement("div"),Ce=c.createElement("button"),je=c.createElement("button"),Me=c.createElement("p");Me.textContent=ee.lines.map(nt=>nt.productName).join(", ")+" \xB7 "+Ds(ee.charge?.totalMinor??ee.catalogAmountMinor-(ee.discount?.amountMinor??0),ee.currency),Ce.textContent=A?"\u786E\u8BA4\u8D2D\u4E70":"Confirm purchase",je.textContent=A?"\u53D6\u6D88":"Cancel",Ce.onclick=()=>{V(O)};let Pt=async()=>{let nt=await o.cancel();E||(Ke.remove(),M=null,await R(nt))};je.onclick=()=>{Q=Pt,V(Pt)};let Fe=c.createElement("div");for(let nt of ee.lines){let Yt=c.createElement("p");Yt.textContent=`${nt.productName} \xB7 ${Ds(nt.catalogAmountMinor,ee.currency)}${nd(nt.interval,A?"zh-CN":"en",nt.intervalCount??1)}`,Fe.append(Yt);for(let rt of nt.prepaid??[]){let Kn=c.createElement("p"),fe=o.view?.capabilities.plans[nt.productVersionId]?.prepaid?.find(me=>me.internalFeatureId===rt.internal_feature_id);Kn.textContent=`${fe?.name??rt.internal_feature_id} \xB7 ${rt.quantity} ${A?"\u4EFD":"packs"} \xD7 ${rt.terms.units}`,fe&&(Kn.textContent+=nd(fe.reset==="week"||fe.reset==="month"||fe.reset==="year"?fe.reset:"one_time",A?"zh-CN":"en",fe.resetCount)),Fe.append(Kn)}if(nt.trial){let rt=c.createElement("p");rt.textContent=A?`\u8BD5\u7528 ${nt.trial.days} \u5929\uFF1B${nt.trial.cardRequired?"\u9700\u8981\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F":"\u65E0\u9700\u63D0\u4F9B\u4ED8\u6B3E\u65B9\u5F0F"}`:`Trial days: ${nt.trial.days}; ${nt.trial.cardRequired?"a payment method is required":"no payment method is required"}`,Fe.append(rt)}}if(!ee.charge){let nt=c.createElement("p");nt.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.",Fe.append(nt)}Ke.append(Me,Fe,Ce,je),p.prepend(Ke),M=Ke,Q=null}async function ce(){if(!F)return;if(Q=ce,!Z){let Ke=o.view,Ce=Ke?.document.buttons[F.actionId],je=Ke&&Ce?.type==="checkout"?wa(Ce.product,F.selection,Ke.capabilities):null;if(!je)throw new H("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area");let Me=await t.resolveOfferId?.({actionId:F.actionId,productVersionId:je});if(E)return;Me!==void 0&&(F.offerId=Me),Z=!0}if(!U()){f.hidden=!1;return}let ee=await o.preview(F);E||B(ee)}function Ae(ee="destroy"){E||(E=!0,u.abort(),w?.destroy(),o.destroy(),g.open&&g.close(),g.remove(),l.remove(),i(),ee==="dismiss"&&ot(t.onDismiss))}m.onclick=()=>{U()&&Ae("dismiss")},g.addEventListener("cancel",ee=>{ee.preventDefault(),U()&&Ae("dismiss")}),f.onclick=()=>{Q&&V(Q)};try{if(C.type==="inline")e.append(l);else{let ee={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?ee[C.size]+"px":"100vw"}`,g.setAttribute("aria-label",a.document.name),g.append(l),e.append(g),U()&&g.showModal()}w=s(d,{mode:"live",rendererUrl:o.webViewUrl,title:a.document.name,onAction(ee,Ke={}){if(!U())return;let Ce=o.view,je=Ce?.document.buttons[ee];if(!je)return;if(je.type==="close"){V(async()=>{await t.onAction?.(ee),Ae(t.onAction?"action":"dismiss")});return}if(je.type==="action"){Q=async()=>{if(je.action.type==="event"){if(!t.onEvent)throw new H("EVENT_HANDLER_REQUIRED","Provide the event handler");await t.onEvent(je.action.event)}else t.onOpenUrl?await t.onOpenUrl(je.action.url):c.defaultView?.location.assign(je.action.url);await t.onAction?.(ee),Q=null},V(Q);return}if((o.quote||F)&&o.canReselect===!1){Q=o.quote?async()=>R(await o.read()):ce,V(Q);return}let Me=Ce&&wa(je.product,Ke,Ce.capabilities);if(!Ce||!Me){N(new H("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));return}if(t.onPurchaseIntent){Q=null,V(async()=>{let Pt={actionId:ee,productVersionId:Me,selection:structuredClone(Ke),featureQuantities:_c(Ce.document.screen,Me,Ke,Ce.capabilities)};await t.onPurchaseIntent(Pt)});return}if(F&&F.actionId!==ee){N(new H("COMMAND_PENDING","Finish the current purchase"));return}F||(F={requestId:crypto.randomUUID(),actionId:ee,selection:Ke},Z=!1),V(ce)},onEscape:()=>{U()&&Ae("dismiss")},onError:ee=>N(new Error(ee))}),w.update(a.document.screen,a.document.screen.strings.defaultLocale,{capabilities:a.capabilities,serverInput:{bindings:[],answers:{}}}),await w.ready}catch(ee){throw Ae(),ee}return{check:r,host:{setSuspended(ee){j=ee,l.hidden=ee,ee&&g.open?g.close():!ee&&!E&&C.type!=="inline"&&!g.open&&g.showModal()},destroy:Ae,refresh:async()=>{if(!U()){if(o.view)return o.view;throw new H("PRECONDITION_FAILED","Paywall presentation is suspended")}let ee=await o.refresh();return E||w?.updateCapabilities(ee.capabilities),ee}}}}var AP=x(()=>{"use strict";yn();xr();Na();Iy();W6()});function QX(e){return e==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}function Ly(e){var t=jy.get(e);return t||(t={element:e,attributes:{}},jy.set(e,t)),t}function My(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(!yee&&!(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,QX(t)),s}function Fy(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,iV()):e!==r&&(t.isDirty=!0,iV())}function YX(e){var t=e.originalValue;e.mutations.forEach(function(r){return t=r.mutate(t)}),Fy(pee(t),e)}function XX(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach(function(r){return r.mutate(t)}),Fy(Array.from(t).filter(Boolean).join(" "),e)}function eee(e){var t=e.originalValue;e.mutations.forEach(function(r){return t=r.mutate(t)}),Fy(t,e)}function tee(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 nee(e){var t=e.originalValue;e.mutations.forEach(function(r){var i=r.mutate(),o=tee(i);t=o||t}),Fy(t,e)}function aV(e){var t=Ly(e);return t.html||(t.html=My(e,"html",ree,iee,YX)),t.html}function sV(e){var t=Ly(e);return t.position||(t.position=My(e,"position",oee,aee,nee)),t.position}function cV(e){var t=Ly(e);return t.classes||(t.classes=My(e,"class",cee,see,XX)),t.classes}function uV(e,t){var r=Ly(e);return r.attributes[t]||(r.attributes[t]=My(e,t,uee(t),lee(t),eee)),r.attributes[t]}function dee(e,t){var r=jy.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 pee(e){return Ny||(Ny=document.createElement("div")),Ny.innerHTML=e,Ny.innerHTML}function Dy(e,t,r){if(r.isDirty){r.isDirty=!1;var i=r.virtualValue;r.mutations.length||dee(e,t),r.setValue(e,i)}}function mee(e,t){e.html&&Dy(t,"html",e.html),e.classes&&Dy(t,"class",e.classes),e.position&&Dy(t,"position",e.position),Object.keys(e.attributes).forEach(function(r){Dy(t,r,e.attributes[r])})}function iV(){jy.forEach(mee)}function fee(e,t){var r=null;e.kind==="html"?r=aV(t):e.kind==="class"?r=cV(t):e.kind==="attribute"?r=uV(t,e.attribute):e.kind==="position"&&(r=sV(t)),r&&(r.mutations.push(e),r.mutationRunner(r))}function hee(e,t){var r=null;if(e.kind==="html"?r=aV(t):e.kind==="class"?r=cV(t):e.kind==="attribute"?r=uV(t,e.attribute):e.kind==="position"&&(r=sV(t)),!!r){var i=r.mutations.indexOf(e);i!==-1&&r.mutations.splice(i,1),r.mutationRunner(r)}}function lV(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),fee(e,i))})}}function gee(e){e.elements.forEach(function(t){return hee(e,t)}),e.elements.clear(),_P.delete(e)}function oV(){_P.forEach(lV)}function bee(){typeof document>"u"||(SP||(SP=new MutationObserver(function(){oV()})),oV(),SP.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}function zy(e){return typeof document>"u"?wP:(_P.add(e),lV(e),{revert:function(){gee(e)}})}function vP(e,t){return zy({kind:"html",elements:new Set,mutate:t,selector:e})}function dV(e,t){return zy({kind:"position",elements:new Set,mutate:t,selector:e})}function Nd(e,t){return zy({kind:"class",elements:new Set,mutate:t,selector:e})}function $y(e,t,r){return JX.test(t)?t==="class"||t==="className"?Nd(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)})}):zy({kind:"attribute",attribute:t,elements:new Set,mutate:r,selector:e}):wP}function Aee(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 vP(t,function(c){return c+(i??"")});if(r==="set")return vP(t,function(){return i??""})}else if(o==="class"){if(r==="append")return Nd(t,function(c){i&&c.add(i)});if(r==="remove")return Nd(t,function(c){i&&c.delete(i)});if(r==="set")return Nd(t,function(c){c.clear(),i&&c.add(i)})}else if(o==="position"){if(r==="set"&&a)return dV(t,function(){return{insertBeforeSelector:s,parentSelector:a}})}else{if(r==="append")return $y(t,o,function(c){return c!==null?c+(i??""):i??""});if(r==="set")return $y(t,o,function(){return i??""});if(r==="remove")return $y(t,o,function(){return null})}return wP}var JX,wP,jy,_P,ree,iee,oee,aee,see,cee,uee,lee,Ny,yee,SP,xee,IP,pV=x(()=>{JX=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,wP={revert:function(){}},jy=new Map,_P=new Set;ree=function(t){return t.innerHTML},iee=function(t,r){return t.innerHTML=r};oee=function(t){return{parentNode:t.parentElement,insertBeforeNode:t.nextElementSibling}},aee=function(t,r){r.insertBeforeNode&&!r.parentNode.contains(r.insertBeforeNode)||r.parentNode.insertBefore(t,r.insertBeforeNode)};see=function(t,r){return r?t.className=r:t.removeAttribute("class")},cee=function(t){return t.className};uee=function(t){return function(r){var i;return(i=r.getAttribute(t))!=null?i:null}},lee=function(t){return function(r,i){return i!==null?r.setAttribute(t,i):r.removeAttribute(t)}};yee=!1;bee();xee={html:vP,classes:Nd,attribute:$y,position:dV,declarative:Aee},IP=xee});function Uy(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 kP=x(()=>{"use strict"});function mV(e){if(!See(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 vee(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 fV(e,t,r,i,o=Uy(t,i)){if(!vee(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 See,EP=x(()=>{"use strict";kP();See=e=>!!e&&typeof e=="object"&&!Array.isArray(e)});function OP(e){PP.add(e)}function wee(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),CP.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 Uc},C=Z=>{A();let Q=m.get(Z);return Q||(Q=e.querySelectorAll(Z),m.set(Z,Q)),A(),Q},w=Uy({querySelectorAll:C},A),E=Z=>{let Q=Z.filter(L=>!m.has(L));if(!Q.length)return;let M=new Map;for(let L of Q){let N=/^([a-z][a-z0-9-]*)\[(id|data-testid|data-test|data-qa|data-indiana-id)="((?:[^"\\\x00-\x1f\x7f]|\\["\\])*)"\]$/.exec(L);if(!N)throw Error("Invalid IAM render selector");let[,V,X,R]=N,O=R.replace(/\\(["\\])/g,"$1"),B=M.get(V);B||M.set(V,B=new Map);let ce=B.get(X);ce||B.set(X,ce=new Map);let Ae=ce.get(O);Ae||ce.set(O,Ae=[]),m.set(L,Ae)}A();let Y=e.querySelectorAll(Q.join(","));if(A(),Y.length>8192)throw Error("IAM render selection budget exceeded");for(let L of Y){let N=M.get(L.localName.toLowerCase());if(N)for(let[V,X]of N){let R=L.getAttribute(V);R!==null&&X.get(R)?.push(L)}A()}},I={query:C,checkpoint:A,matches(Z,Q){let M=g.get(Q);if(!M){try{let Y=!1;M={match:fV(Z,e,location.pathname,A,L=>(Y||(E(Z.selectors),Y=!0),w(L)))}}catch(Y){M={error:Y}}g.set(Q,M)}if("error"in M)throw M.error;return M.match}},F=[],j=[],U=[];for(let Z of h)if(t.has(Z))try{F.push({job:Z,commit:Z.prepare(I)})}catch(Q){if(Q instanceof Uc)throw Q;j.push({job:Z,error:Q})}A();for(let{job:Z,error:Q}of j)t.has(Z)&&Z.fail(Q);for(let{job:Z,commit:Q}of F)if(t.has(Z))try{A(),Q(M=>U.push(M))}catch(M){if(M instanceof Uc)throw M;Z.fail(M)}for(let Z of U)Z()}function d(h){if(!(c!==void 0||e.hidden))try{l(h),s=0}catch(f){if(!(f instanceof Uc))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=>PP.has(g)||!!(g.parentNode&&PP.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 _ee(){let e=CP.get(document);return e||(e=wee(document),CP.set(document,e)),e}function hV(e){return _ee().add(e)}var Uc,CP,PP,gV=x(()=>{"use strict";kP();EP();Uc=class extends Error{constructor(){super("IAM page check exceeded its work budget")}},CP=new WeakMap,PP=new WeakSet});function bV(e){return(!TP||yV!==window)&&(TP=ng(window),yV=window),TP.sanitize(e,{USE_PROFILES:{html:!0},FORBID_TAGS:["form","input","textarea","select","button","style"]})}function AV(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=bV(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 xV(e,t={}){if(e.renderGuard&&!t.requireUniqueTargets)throw new Error("IAM render guard requires the source release fence");if(t.requireUniqueTargets)return Iee(e,t);let r=e.domMutations.map(AV),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=IP.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 Iee(e,t){let r=t?.boundVariations??[e],i=new Set,o=new Set,a=[],s=new Map,c=r.flatMap(Z=>Z.renderGuard?[mV(Z.renderGuard)]:[]),u=c[0];if(c.some(Z=>JSON.stringify(Z)!==JSON.stringify(u)))throw new Error("IAM variations use different render states");if(e.js||r.some(Z=>Z.js))throw Error("IAM scripts cannot execute");if(r.length>20||r.reduce((Z,Q)=>Z+Q.css.length,0)>262144)throw Error("IAM target budget");let l=(Z,Q)=>{for(let Y of Z.domMutations){if(Y.action!=="set"||Y.attribute!=="html")throw Error("Unsupported IAM mutation");i.add(Y.selector),o.add(Y.selector)}if(!Z.css)return;let M=document.createElement("style");OP(M),M.media="not all",t?.nonce&&(M.nonce=t.nonce),M.textContent=Z.css;try{if(document.head.append(M),!M.sheet)throw Error("IAM CSS is blocked");for(let Y of M.sheet.cssRules){if(!("selectorText"in Y)||typeof Y.selectorText!="string")throw Error("Unsupported IAM style rule");i.add(Y.selectorText),Q&&a.push({selector:Y.selectorText,css:Y.cssText})}}finally{M.remove()}};for(let Z of r)l(Z,!1);if(l(e,!0),i.size>200)throw Error("IAM target budget");let d=e.domMutations.map(AV),p=!1,h=!1,f=!1,m=!1,g="",A=0,C=(Z,Q)=>{let M=`${Z}:${Q}`;if(M!==g&&(g=M,!(!t?.onTargetStatus||A>=32))){A++;try{t.onTargetStatus({status:Z,total:i.size,matched:Q})}catch{}}},w={},E=u?JSON.stringify(u):"",I,F="",j=()=>{if(!p){p=!0,w.unsubscribe?.();for(let Z of s.values())Z.revert();s.clear(),I?.remove(),I=void 0,h=!1}},U=()=>{for(let Z of s.values())Z.revert();s.clear(),I?.remove(),I=void 0,F="",h=!1};return w.unsubscribe=hV({suspend:U,fail(Z){j(),t?.onError?.(Z)},prepare(Z){if(u&&!Z.matches(u,E))return M=>{p||(U(),m=!1,M(()=>{p||C("inactive",null)}))};let Q=new Map;for(let M of i){let Y=Z.query(M);if(Y.length>1)throw Error("IAM target is ambiguous in this rendered state");if(Y.length){if(o.has(M)&&Y[0].children.length)throw Error("IAM text target is no longer a leaf");Q.set(M,Y[0])}Z.checkpoint()}return M=>{if(p)return;for(let[N,V]of s)Q.get(N)!==V.element&&(V.revert(),s.delete(N));for(let N of new Set(d.map(V=>V.selector))){let V=Q.get(N);if(!V||s.has(N))continue;let X=d.filter(R=>R.selector===N).map(R=>IP.declarative(R));s.set(N,{element:V,revert:()=>X.forEach(R=>R.revert())})}let Y=a.filter(N=>Q.has(N.selector)).map(N=>N.css).join(`
244
+ `);Y!==F&&(F=Y,Y?(I||(I=document.createElement("style"),OP(I),t?.nonce&&(I.nonce=t.nonce),document.head.append(I)),I.textContent=Y):(I?.remove(),I=void 0)),h=i.size===0||Q.size>0;let L=Q.size===i.size?"matched":Q.size>0?"partial":m?"missing":"waiting";Q.size&&(m=!0),M(()=>{p||C(L,Q.size)}),h&&!f&&M(()=>{!p&&h&&!f&&(f=!0,t?.onApplied?.())})}}}),p&&w.unsubscribe(),{revert:j,inspect(){let Z=d.length+a.reduce((L,N)=>L+(N.css.includes("font-size:")?1:0)+(N.css.includes("color:")?1:0),0);if(p)return{status:"error",total:Z,applied:0};if(g.startsWith("inactive:"))return{status:"inactive",total:Z,applied:0};if(!Z)return{status:"no_changes",total:Z,applied:0};let Q=0,M=0;for(let L of d){let N=document.querySelectorAll(L.selector);N.length===1&&(M++,N[0].innerHTML===bV(L.value??"")&&Q++)}let Y=document.createElement("span");for(let L of a){let N=document.querySelectorAll(L.selector),V=N.length===1?N[0]:void 0,X=L.css.slice(L.css.indexOf("{")+1,L.css.lastIndexOf("}"));Y.style.cssText=X;for(let R of["font-size","color"]){let O=Y.style.getPropertyValue(R);O&&V?.isConnected&&(M++,getComputedStyle(V).getPropertyValue(R)===O&&Q++)}}return{status:Q===Z?"applied":M?Q?"partial":"mismatch":"waiting",total:Z,applied:Q}},get applied(){return h}}}var TP,yV,SV=x(()=>{"use strict";pV();zk();EP();gV()});var vV={};ke(vV,{applyVisualVariation:()=>xV});var wV=x(()=>{SV()});var IV={};ke(IV,{showPaywall:()=>Ty});var kV=x(()=>{AP()});yn();xr();yn();J();yn();Po();J();Po();function xF(e,t,r,i){try{return e.parse(t)}catch(o){throw i&&o instanceof gv?new H(r,i):o}}async function pd(e,t,r,i={},o){let a=typeof i=="function"?{}:i,s=xF(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):xF(t.response,c,"INVALID_RESPONSE",a.response)}var SF=e=>new TextEncoder().encode(JSON.stringify(e)).length,vF=16384;function wF(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 H("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&&!AL(i.config,m))return;f();let C=ie.trackEvents.request.parse({events:[{eventUuid:crypto.randomUUID(),timestamp:new Date().toISOString(),name:m,properties:g,...A}]}).events[0];if(SF({events:[C]})>vF)throw new H("INVALID_REQUEST","Event exceeds the delivery size limit");if(a.length>=500)throw new H("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 j of a.slice(0,Math.min(w,100))){if(E.length&&SF({events:[...E,j]})>vF)break;E.push(j)}let I=ie.trackEvents,F=await pd(e,I,{events:E},void 0,{keepalive:m});if(g!==r)throw new H("IDENTITY_CHANGED","Event identity changed during delivery");if(F.inserted+F.duplicates+F.rejected+F.skipped!==E.length)throw new H("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}}}yn();yn();function _F(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:nn.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(Pi(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],j=(async()=>{let U=bh.parse(await e.evaluateRemote({attributes:structuredClone(p.attributes),features:F}));if(!(E!==i||w!==o||I!==t)){if(e.assertUsable?.(I.generation),U.generation!==I.generation)throw new Error("Feature configuration changed; refresh before evaluation");if(F.some(Z=>!Object.hasOwn(U.features,Z))||Object.keys(U.features).some(Z=>!s.has(Z)))throw new Error("Invalid remote Feature results");if(p.attributes?.merchandise||p.attributes?.merchandiseId){if(!U.merchandiseContext)throw new Error("Server did not resolve merchandise context");p.attributes=nn.parse({...p.attributes,...U.merchandiseContext}),a=!0}c=structuredClone(U),p.features={...I.features,...Object.fromEntries(Object.entries(c.features).map(([Z,Q])=>[Z,{defaultValue:Q.value}]))},d()}})();u={revision:w,loading:j};try{await j}finally{u?.loading===j&&(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?Gl.parse(I):null,j=F??Or.parse(I);if(j.scope.projectId!==e.scope.projectId||j.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===j.generation){let{evaluatedAt:Z,expiresAt:Q,...M}=t,{evaluatedAt:Y,expiresAt:L,...N}=j;if(In(M)!==In(N))throw new Error("Immutable Feature generation changed content");return t.evaluatedAt=j.evaluatedAt,t.expiresAt=j.expiresAt,d(),(!c||c.expiresAt&&Date.parse(c.expiresAt)<=Date.now())&&A(),structuredClone(t)}let U=new Set(F?.remoteFeatures??[]);if([...U].some(Z=>Object.hasOwn(j.features,Z)))throw new Error("Remote Feature definitions must not be delivered locally");return t&&"analyticsConfig"in t&&"analyticsConfig"in j&&!t.analyticsConfig.experimentViewsEnabled&&F?.analyticsConfig.experimentViewsEnabled&&p.trackedExperiments?.clear(),t=structuredClone(j),s=U,c=null,u=null,o++,p.features=t.features,p.savedGroups=Hs(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=nn.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()}}}xr();function IF(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 uW(e){let t=IF(e),{merchandiseId:r,merchandise:i,...o}=e;return{...o,...t?{merchandise:t}:{}}}function kF(e,t,r,i,o){if(o&&i&&(o.scope.projectId!==i.projectId||o.scope.environment!==i.environment))throw new H("SCOPE_MISMATCH","Configuration belongs to another App/environment");let a=0,s=new Set;function c(){if(!t())throw new H("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 H("IDENTITY_CHANGED","Feature identity changed");let M=ie.getFeatures,Y=o?{scope:{projectId:o.scope.projectId,environment:o.scope.environment},payload:await o.features()}:await pd(e,M,{});if(d!==a)throw new H("IDENTITY_CHANGED","Feature identity changed");if(i&&(Y.scope.projectId!==i.projectId||Y.scope.environment!==i.environment))throw new H("INVALID_RESPONSE","Feature response scope changed");return r.rememberConfiguration(Y.payload.analyticsConfig),Y},f=await h(),m=!0,g,A=M=>{try{l.onError?.(M)}catch{}},C=(M,Y,L)=>{try{let N=IF(L);r.track(M,Y,N?{merchandise:N}:{})}catch(N){A(N)}},w=_F({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 H("IDENTITY_CHANGED","Feature identity changed");let Y=ie.evaluateFeatures,L=await pd(e,Y,{...M,attributes:uW(M.attributes)});if(L.scope.projectId!==f.scope.projectId||L.scope.environment!==f.scope.environment)throw new H("INVALID_RESPONSE","Remote Feature response scope changed");return{generation:L.generation,evaluatedAt:L.evaluatedAt,expiresAt:L.expiresAt,features:L.features,...L.merchandiseContext?{merchandiseContext:L.merchandiseContext}:{}}},onExperimentViewed:(M,Y,L)=>C("Experiment Viewed",{experimentId:M.key,variationId:Y.key},L),onFeatureUsage:(M,Y,L)=>C("Feature Evaluated",{feature:M,value:Y.value,source:Y.source,ruleId:Y.ruleId,...Y.experimentResult?{variationId:Y.experimentResult.key}:{}},L)}),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 j=()=>{p||F().catch(A)},U=w.subscribe(I),Z=o?.subscribe(()=>{!p&&o.fresh&&F().catch(A)});function Q(){p||(p=!0,clearTimeout(g),typeof window<"u"&&window.removeEventListener("focus",j),U(),Z?.(),w.reset(),s.delete(Q))}s.add(Q);try{await w.init(),(l.attributes?.merchandise||l.attributes?.merchandiseId)&&await w.refreshRemote()}catch(M){throw Q(),M}return I(),!o&&typeof window<"u"&&window.addEventListener("focus",j),Object.assign(w,{refresh:F,destroy:Q})}return{features:u,reset(l){a++,l();for(let d of s)d()}}}xr();async function EF(e,t,r){let i={features:"getFeatures","features/evaluate":"evaluateFeatures",events:"trackEvents"},o=!1,a=async(l,d={})=>{if(o||!i[l])throw new H("IDENTITY_CHANGED","Feature session is unavailable");return e("featureOperation",{operation:i[l],input:d})},s=wF(a,()=>!o),c=kF(a,()=>!o,s,yt.parse(t)),u=await c.features({attributes:n.record(n.string(),Re).parse(r??{})});return{async call(l){if(o)throw new H("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:Re.optional(),attributes:n.record(n.string(),Re).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 U_.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())}}}yn();J();yn();J();Na();xr();fP();Iy();z6();var hP=new WeakMap;function q6(e){let t={string:n.string(),number:n.number().finite(),boolean:n.boolean(),strings:n.array(n.string()),json:Re}[e.type];return e.nullable?t.nullable():t}async function Z6(e,t){return KX(e,t,!1)}async function KX(e,t,r){t.signal?.throwIfAborted();let i=Aa.parse(t.content),o=i.document;if(hP.has(e))throw new H("CONFLICT","Content is already mounted in this container");let a=n.record(n.string(),Re).parse(t.inputs??{});if(Object.keys(a).length>40)throw new H("INVALID_REQUEST","Too many content inputs");for(let[M,Y]of Object.entries(a))Zn.parse({[M]:Y});if(Object.keys(a).some(M=>!Object.hasOwn(o.contract.inputs,M)))throw new H("INVALID_REQUEST","Undeclared content input");for(let[M,Y]of Object.entries(o.contract.inputs))if(Object.hasOwn(a,M))q6(Y).parse(a[M]);else if(Y.required)throw new H("INVALID_REQUEST",`Missing content input ${M}`);for(let M of Object.keys(o.contract.outputs))if(typeof t.actions[M]!="function")throw new H("INVALID_REQUEST",`Missing host handler for ${M}`);let s=hc.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=`${Qf[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?F6(d??p):()=>{},A,C,w=new Promise((M,Y)=>{A=M,C=Y});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 j(){h||(h=!0,t.signal?.removeEventListener("abort",j),C(new Error("Content preparation cancelled")),F?.destroy(),d?.close(),d?.remove(),p.remove(),hP.delete(e),d&&u?.())}let U=()=>{m&&(j(),ot(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",U),d.prepend(M)}d?.addEventListener("cancel",M=>{M.preventDefault(),U()});async function Z(){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(Y){ot(t.onError,Y)}finally{f=!1,h||p.removeAttribute("aria-busy")}}function Q(){if(h)throw new H("CONFLICT","Content host has been destroyed");m||(u=Od(c),g(),r&&!d&&(p.style.width="100%"),d?.showModal(),m=!0)}try{r||Q(),F=ky(p,{mode:"live",title:o.name,viewportHeight:o.kind==="page"?e.clientHeight||c.defaultView?.innerHeight||800:void 0,onRendered:A,onError:L=>{let N=new Error(L);C(N),ot(t.onError,N)},onEscape:l?U:void 0,onAction:(L,N,V)=>{if(h||!m||f||E)return;let X=o.screen.actions.find(O=>O.id===L),R=o.contract.outputs[L];if(!(X?.type!=="event"||!R))try{let O=q6(R).parse(Object.hasOwn(X.properties,"value")?X.properties.value:X.properties);E={requestId:crypto.randomUUID(),contentVersionId:i.id,actionId:L,event:X.event,value:O,selection:N??{},answers:V??{},requestedClose:X.close},Z()}catch(O){ot(t.onError,O)}}});let M={destroy:j,show:Q,get pendingAction(){return E?structuredClone(E):null},retryAction:Z,updateCapabilities:L=>F?.updateCapabilities(L)};hP.set(e,M),t.signal?.addEventListener("abort",j,{once:!0}),t.signal?.aborted&&(j(),t.signal.throwIfAborted());let Y=Ul(I,[t.locale,...c.defaultView?.navigator.languages??[]]);if(F.update(I,Y,{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 j(),M}}async function H6(e){let t=n.strictObject({content:Aa,locale:n.string().min(1).max(35),inputs:n.record(n.string(),Re)}).parse(await e("content"));return{destroy:(await Z6(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()=>{}}}yn();xr();Po();function gP(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 Ey(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 Cy(e,t,r){if(e.operationId!==t.operationId||t.currency!==void 0&&e.currency!==t.currency)throw new H("INVALID_RESPONSE",r)}function Py(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 H("INVALID_RESPONSE","The purchase quote changed its selected quantities");if(e.lines.length!==1||e.lines[0].productVersionId!==t.productVersionId||t.currency!==void 0&&e.currency!==t.currency||t.provider!==void 0&&e.provider!==t.provider&&!(t.provider==="stripe"&&e.provider==="merchant"&&e.execution?.provider==="merchant"))throw new H("INVALID_RESPONSE",r)}function Oy(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 G6(e){let t=null,r=null,i=null,o=!1,a=async(l,d={})=>{if(o)throw new H("CLOSED","Paywall is closed");let p=await e({operation:l,input:d});if(o)throw new H("IDENTITY_CHANGED","Paywall identity changed");return p};async function s(){let l=vo.parse(await a("resolve"));if(t&&(!Ey(l,t)||l.paywallId!==t.paywallId))throw new H("INVALID_RESPONSE","Pinned Paywall changed");return t=l,structuredClone(l)}async function c(l){if(!r)throw new H("INVALID_REQUEST","A quote is required");let d=bo.parse(await a(l));return Cy(d,r,"Purchase identity changed"),i=Oy(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"&&wa(d.product,l.selection,t.capabilities);if(!p)throw new H("PRODUCT_UNAVAILABLE","Choose an available Product");let h=_c(t.document.screen,p,l.selection,t.capabilities),f=yo.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 Py(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}AP();yn();xr();function J6(e){let t=e.view;if(!t?.paywall)throw new H("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(L){if(!Ey(L,a))throw new H("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(L){if(L.purchase&&L.purchase.receiptId!==r)throw new H("INVALID_RESPONSE","Purchase receipt changed");let N=L.run.paywall;return L.purchase??(N?.receiptId===r?N:null)}function j(){if(p)throw new H("IDENTITY_CHANGED","Paywall presentation has closed")}function U(L,N,V){if(j(),N!==m||V!==void 0&&l?.operationId!==V)return!1;let X=g,R=L.run.paywall;if(R?.receiptId===r){if((R.selectionGeneration??0)<g)return!1;g=R.selectionGeneration??0,A=R.canReselect===!0,u(R.resolution)}let O=F(L),B=g>X,ce=B?O?.quote??null:O?.quote??l,Ae=O?.operation??(ce?.operationId===l?.operationId?d:null);return ce&&Ae&&Cy(Ae,{operationId:ce.operationId},"Purchase operation changed"),R?.receiptId===r&&(s=R.resolution,c="document"in s?s:c?{...s,document:c.document,offering:c.offering,capabilities:gP(s.capabilities,c.capabilities)}:null),(B||ce?.operationId!==l?.operationId)&&(m++,R?.receiptId===r&&(f=R.purchaseRequestId)),l=ce,d=Oy(d,Ae,!0),!0}function Z(L,N,V){return new Promise((X,R)=>{let O=!1,B=()=>{clearTimeout(Ke),h.signal.removeEventListener("abort",ee)},ce=Ce=>{O||(O=!0,B(),X(Ce))},Ae=Ce=>{O||(O=!0,B(),R(Ce))},ee=()=>Ae(new H("IDENTITY_CHANGED","Paywall presentation has closed")),Ke=setTimeout(()=>Ae(new H("COMMAND_PENDING","The purchase command is still pending; retry the original request",202,V)),Math.max(0,N-Date.now()));h.signal.addEventListener("abort",ee,{once:!0}),h.signal.aborted&&ee(),L.then(ce,Ae)})}function Q(L){return new Promise(N=>{let V=()=>{clearTimeout(X),h.signal.removeEventListener("abort",V),N()},X=setTimeout(V,L);h.signal.addEventListener("abort",V,{once:!0}),h.signal.aborted&&V()})}async function M(L,N,V){j();let X=w.get(L);if(!X){let B=e.pendingCommands?.find(ce=>ce.requestId===L)??e.pendingCommand;if(B?.operation==="submit"&&B.requestId===L&&B.nodeId===i&&B.visit===o){N.type==="paywall_quote"&&B.input.type==="paywall_quote"&&B.input.predecessor&&!N.predecessor&&(N={...N,predecessor:B.input.predecessor});let ce=vc.parse(B),Ae=vc.parse({...B,input:N});if(Ae.operation!=="submit"||ce.operation!=="submit"||JSON.stringify(Ae.input)!==JSON.stringify(ce.input))throw new H("CONFLICT","A restored purchase request cannot change its input");N=Ae.input,X=ce,w.set(L,X)}}if(X){if(JSON.stringify(X.input)!==JSON.stringify(N))throw new H("CONFLICT","A purchase request cannot change its input")}else{let B=e.view;if(!B||B.nodeId!==i||B.visit!==o||B.paywall?.receiptId!==r)throw new H("PRECONDITION_FAILED","The Paywall visit has changed");X={operation:"submit",requestId:L,nodeId:i,visit:o,revision:B.revision,input:N},w.set(L,X)}let R=Date.now()+3e4,O=await Z(e.submit(X),R,L);for(;O.run.pendingRequest?.requestId===L&&Date.now()<R&&!p&&(await Q(Math.min(1e3,R-Date.now())),!(p||Date.now()>=R));)O=await Z(e.resume(L),R,L);if(p)throw new H("IDENTITY_CHANGED","Paywall presentation has closed");if(O.run.pendingRequest?.requestId===L)throw new H("COMMAND_PENDING","The purchase command is still pending; retry the original request",202,L);if(!U(O,V,N.type==="paywall_confirm"||N.type==="paywall_cancel"?N.operationId:void 0))throw new H("PRECONDITION_FAILED","The purchase selection has changed")}async function Y(L){if(!l)throw new H("INVALID_REQUEST","A quoted purchase is required");let N=`${L}:${l.operationId}`,V=E.get(N);if(!V){let X=L==="confirm"?"paywall_confirm":"paywall_cancel",R=e.pendingCommands?.find(O=>O.operation==="submit"&&O.input.type===X&&"operationId"in O.input&&O.input.operationId===l.operationId)??e.pendingCommand;V=R?.operation==="submit"&&R.input.type===X&&"operationId"in R.input&&R.input.operationId===l.operationId?R.requestId:crypto.randomUUID(),E.set(N,V)}if(await M(V,{type:L==="confirm"?"paywall_confirm":"paywall_cancel",operationId:l.operationId},m),!d)throw new H("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(){j();let L=m,N=await e.get();if(U(N,L),N.run.paywall?.receiptId!==r)throw new H("PRECONDITION_FAILED","Paywall presentation has changed");if(!c){if("document"in s||!e.resolvePaywall)throw new H("INVALID_RESPONSE","Public Paywall reader is unavailable");let V=await e.resolvePaywall(s);j(),u(V),c={...s,document:V.document,offering:V.offering,capabilities:gP(s.capabilities,V.capabilities)}}return structuredClone(c)},preview(L){if(!c)return Promise.reject(new H("PRECONDITION_FAILED","Load the Paywall presentation first"));if(f&&f!==L.requestId&&(C||!A))return Promise.reject(new H("COMMAND_PENDING","Retry the original purchase before starting another"));let N=c.document.buttons[L.actionId],V=N?.type==="checkout"?wa(N.product,L.selection,c.capabilities):null;if(!V)return Promise.reject(new H("PRODUCT_UNAVAILABLE","Choose an available Product in this purchase area"));let X=_c(c.document.screen,V,L.selection,c.capabilities),R=JSON.stringify({actionId:L.actionId,product:V,featureQuantities:X,offerId:L.offerId,nativeOffer:L.nativeOffer});if(I.has(L.requestId)&&I.get(L.requestId)!==R)return Promise.reject(new H("CONFLICT","A purchase request cannot change its quantities or Product"));if(I.set(L.requestId,R),f===L.requestId&&C)return C;let O=f!==L.requestId&&g>0?{operationId:l?.operationId??null,generation:g}:void 0;if(O&&(!A||g<=0))return Promise.reject(new H("COMMAND_PENDING","Original purchase requires authoritative termination"));f!==L.requestId&&m++;let B=m;f=L.requestId;let ce=(async()=>{if(await M(L.requestId,{type:"paywall_quote",actionId:L.actionId,productVersionId:V,...Object.keys(X).length?{featureQuantities:X}:{},...O?{predecessor:O}:{},...L.offerId?{offerId:L.offerId}:{},...L.nativeOffer?{nativeOffer:L.nativeOffer}:{}},B),!l)throw new H("INVALID_RESPONSE","The accepted quote is missing");return Py(l,{productVersionId:V,featureQuantities:X},"The selected purchase changed"),structuredClone(l)})();return C=ce,ce.then(()=>{C===ce&&(C=null)},Ae=>{C===ce&&(C=null),f===L.requestId&&e.pendingCommand?.requestId!==L.requestId&&Ae instanceof H&&Ae.status!==void 0&&Ae.status<500&&![401,425].includes(Ae.status)&&(f=null)}),ce},confirm:()=>Y("confirm"),cancel:()=>Y("cancel"),async read(){if(j(),!l)throw new H("INVALID_REQUEST","A quoted purchase is required");let L=l.operationId,N=m,V=e.pendingCommands?.find(B=>B.operation==="submit"&&(B.input.type==="paywall_confirm"||B.input.type==="paywall_cancel")&&B.input.operationId===L)??e.pendingCommand;V?.operation==="submit"&&(V.input.type==="paywall_confirm"||V.input.type==="paywall_cancel")&&V.input.operationId===L&&await e.settle?.(V.requestId);let X=await e.get(void 0,{receiptId:r,operationId:L});j();let R=F(X);if(R?.quote&&R.quote.operationId!==L||R?.operation&&R.operation.operationId!==L)throw new H("INVALID_RESPONSE","Purchase operation changed");let O=U(X,N,L)?d:R?.operation;if(!O)throw new H("INVALID_RESPONSE","The current purchase result is missing");return structuredClone(O)},destroy(){p=!0,h.abort(),w.clear(),E.clear(),I.clear()}}}xr();Na();Po();function Q6(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 H)||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 H("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}}}yn();Po();function Y6(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?Tn(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 H("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 H("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()}}}Po();function X6(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 H("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,j]of A.review.pages.entries()){let U=t.createElement("button");U.type="button",U.textContent=C?`\u7B2C ${F+1} \u9875`:`Page ${F+1}`,U.onclick=()=>{h(j.receiptId)},i.append(U)}if(A.review.page){let F=A.review.page,j=t.createElement("div");if(j.inert=!0,i.append(j),u=o(j,{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((j,U)=>`${C?"\u4F18\u60E0\u5238":"Coupon"} ${U+1}: ${E[j.status]}`),...A.review.purchases.map((j,U)=>`${C?"\u8D2D\u4E70":"Purchase"} ${U+1}: ${I[j.status]}`)]){let j=t.createElement("p");j.textContent=F,i.append(j)}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}}}hl();var xP=new WeakMap;function eV(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=xP.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},xP.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(),xP.delete(t)),u.owned))){let d=o();d.delete(e),d.size?i.setAttribute(r,[...d].join(" ")):i.removeAttribute(r)}}}}Na();var Td=new Set,Ry;function tV(e){let t=()=>e();if(Td.add(t),!Ry){let r=!0,i=history.pushState,o=history.replaceState,a=()=>{if(r)for(let u of[...Td])Td.has(u)&&ot(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),Ry=()=>{r=!1,history.pushState===s&&(history.pushState=i),history.replaceState===c&&(history.replaceState=o),removeEventListener("popstate",a),removeEventListener("hashchange",a)}}return()=>{Td.delete(t)&&(Td.size||(Ry?.(),Ry=void 0))}}var Rd=new Map,WX=new Set,nV=()=>{for(let e of[...WX])e()};function rV(e,t){if(Rd.has(e)&&Rd.get(e)!==t)throw new Error("A different Funnel owns this page experiment");return Rd.set(e,t),nV(),()=>{Rd.get(e)===t&&(Rd.delete(e),nV())}}Na();function _V(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=eV(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),ot(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}`,j=location.href;try{let[U,{applyVisualVariation:Z}]=await Promise.all([t(e.appManifestRelease),Promise.resolve().then(()=>(wV(),vV))]),Q=e.client.view;if(r||I!==o||!Q||Q.stopped||!["running","waiting"].includes(Q.status)||`${Q.id}:${Q.visit}:${Q.revision}`!==F||location.href!==j)return;let M=new Set,Y=new Set;for(let L of U.assignments){let N=`${U.payload.environmentId}:${L.experimentKey}`;if(Y.add(N),p.has(N)||p.set(N,rV(N,d)),!!L.inExperiment)for(let V of U.payload.experiments){if(V.key!==L.experimentKey||!ml(location.href,V.urlPatterns??[]))continue;let X=V.meta?.findIndex(ee=>ee.key===L.variationKey)??-1,R=V.variations[X];if(!R?.renderGuard)continue;let O=L.receiptId+":"+V.changeId,B=JSON.stringify([L.variationKey,R]);M.add(O);let ce=u.get(O);if(ce?.signature===B){ce.effect.applied&&m(L.receiptId);continue}u.get(O)?.effect.revert(),u.delete(O);let Ae=Z(R,{requireUniqueTargets:!0,boundVariations:V.variations,allowJs:!1,onApplied:()=>m(L.receiptId),onError:ee=>ot(e.onError,ee)});u.set(O,{signature:B,effect:Ae}),Ae.applied&&m(L.receiptId)}}for(let[L,N]of u)M.has(L)||(N.effect.revert(),u.delete(L));for(let[L,N]of p)Y.has(L)||(N(),p.delete(L))}catch(U){I===o&&f(),ot(e.onError,U)}finally{a=!1,s&&!r&&(s=!1,g())}}let A=e.client.subscribe(()=>{o++,g()}),C=tV(()=>{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 EV(e,t){let r=t,{mountScreenPreview:i}=await Promise.resolve().then(()=>(bP(),yP)),{showPaywall:o}=await Promise.resolve().then(()=>(kV(),IV)),a=r.appManifestRelease?_V({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,j="",U="",Z="",Q="",M="",Y=!1,L=0,N=!1,V="",X=null,R=Promise.resolve(),O=null,B=null,ce=new Set,Ae={},ee=(W,Ne=null)=>{Y||(B=Ne,m.textContent=W instanceof Error?W.message:"Request failed",m.hidden=!1,C.hidden=r.client.pendingCommand===null,ot(r.onError,W))};function Ke(){let W=r.client.view;if(!W)throw new H("INVALID_REQUEST","No current Run is available");return{requestId:crypto.randomUUID(),nodeId:W.nodeId,visit:W.visit,revision:W.revision}}let Ce=X6({client:r.client,doc:s,holder:l,reviewHolder:p,mountScreenPreview:i,get stopped(){return Y},get answers(){return Ae},suspend(W){I?.setSuspended(W)},resetScreen(){j="",U="",Z=""},enqueue:ve,fail:ee}),je=Q6({client:r.client,expected:Ke,fail:ee,get stopped(){return Y},get reviewing(){return Ce.active},get key(){return j},get busy(){return L}}),Me=Y6({client:r.client,expected:Ke,perform:nt,onIntent:r.onCustomerDataIntent,get stopped(){return Y},get busy(){return L},get document(){return E?.document},get answers(){return Ae}}),Pt=W=>W&&(W.screen||W.paywall)?`${W.id}:${W.nodeId}:${W.visit}`:"";function Fe(){let W=r.client.view;g.disabled=!Ce.active&&(L>0||!!r.client.pendingCommand||!W?.canBack||W.stopped||!["running","waiting"].includes(W.status)||!Pt(W)||U!==Pt(W))}async function nt(W,Ne=!1){if(!(L&&!Ne||Y||Ce.active&&!Ne)){L++,u.setAttribute("aria-busy","true"),Fe(),m.hidden=!0,B=null;try{if(!Ne&&je.inFlight){let Ue=r.client.view;await je.inFlight;let ut=r.client.view;if(!Ue||!ut||ut.id!==Ue.id||ut.nodeId!==Ue.nodeId||ut.visit!==Ue.visit||ut.stopped||!["running","waiting"].includes(ut.status))throw new H("PRECONDITION_FAILED","The screen changed while its display was acknowledged")}if(Y)return;let Qe=await W();Y||await ve(r.client.view??Qe.run)}catch(Qe){ee(Qe,r.client.pendingCommand?.requestId??null)}finally{L=Math.max(0,L-1),u.setAttribute("aria-busy",String(L>0)),Y||(C.hidden=r.client.pendingCommand===null,Fe())}}}function Yt(){X&&clearTimeout(X),!(Y||!F||!["running","waiting"].includes(F.status)&&!r.client.pendingCommand)&&(X=setTimeout(()=>{X=null,rt().finally(Yt)},F.pendingRequest||r.client.pendingCommand?1500:5e3))}async function rt(){if(!(Y||N||L)){if(Ce.active){await Ce.open(Ce.receipt);return}N=!0;try{let W=r.client.pendingCommand;W&&r.client.settle&&await r.client.settle(W.requestId);let Ne=r.client.view,Qe=Me.queries,Ue=await r.client.get(Ne?.screen&&Object.keys(Qe).length?{nodeId:Ne.nodeId,visit:Ne.visit,revision:Ne.revision,components:Qe}:void 0);!Y&&Qe===Me.queries&&await ve(r.client.view??Ue.run)}catch(W){ee(W)}finally{N=!1}}}function Kn(W){let Ne=W.screen?.presentation;if(!Ne||Ne.type==="inline"){w.open&&w.close(),u.parentElement!==e&&e.append(u);return}u.parentElement!==w&&(w.append(u),e.append(w));let Qe={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 Ne?Qe[Ne.size]+"px":"100vw"}`,w.setAttribute("aria-label",E?.document?.name??W.screen?.content.document.name??"Funnel"),w.open||w.showModal()}async function fe(W){if(Y)return;F=W,B&&r.client.pendingCommand?.requestId!==B&&(m.hidden=!0,B=null);let Ne=W.locale.startsWith("zh");if(h.textContent=Ne?"\u56DE\u770B":"History",h.hidden=!r.client.review,g.textContent=Ce.active?Ne?"\u8FD4\u56DE\u5F53\u524D":"Return to current":Ne?"\u8FD4\u56DE":"Back",A.textContent=Ne?"\u5173\u95ED":"Close",C.textContent=Ne?"\u91CD\u8BD5":"Retry",Fe(),C.hidden=r.client.pendingCommand===null,f.textContent=W.pendingRequest?Ne?"\u6B63\u5728\u5904\u7406":"Processing":W.instruction?.type==="wait"?Ne?"\u7B49\u5F85\u4E2D":"Waiting":"",V!==`${W.revision}:${W.visit}:${W.status}:${W.stopped}`&&(V=`${W.revision}:${W.visit}:${W.status}:${W.stopped}`,ot(r.onState,structuredClone(W))),!W.pendingRequest&&["closed","ineligible","failed"].includes(W.status)){ze();return}if(W.stopped||r.client.configurationReady===!1){Ce.stop(),E?.destroy(),E=null,I?.destroy(),I=null,l.replaceChildren(),j="",U="",Z="",M="",w.open&&w.close(),u.hidden=!0,Yt();return}if(u.hidden=!1,Ce.active){Yt();return}let Qe=Pt(W);if(Qe!==j&&(U="",E?.destroy(),E=null,I?.destroy(),I=null,l.replaceChildren(),j=Qe,Z="",M="",Ae={...W.answers},Me.reset()),Kn(W),W.screen){let ut=W.screen.content;E||(E=i(l,{mode:"live",rendererUrl:r.client.webViewUrl,title:ut.document.name,onAction(Ct,Dt={},Ot={}){if(Ce.active)return;Ae={...Ae,...Ot};let Lr=Object.fromEntries((W.screen?.inputs??[]).filter(({variable:ii})=>Object.hasOwn(Ae,ii)).map(({variable:ii})=>[ii,Ae[ii]]));nt(()=>r.client.submit({operation:"submit",...Ke(),input:{type:"screen",output:Ct,answers:Lr,selection:Dt}}))},onAnswers:Ct=>{Ce.active||(Ae={...Ae,...Ct})},onCustomerDataIntent:Ct=>{Ce.active||Me.intent(Ct).catch(ee)},onEscape:()=>{Ce.active||Pe()},onError:Ct=>ee(new Error(Ct)),onRendered:()=>je.report(Qe)}));let dt={capabilities:W.screen.capabilities,customerData:W.screen.customerData,parameters:W.parameters,serverInput:{bindings:W.screen.inputs,answers:Ae,values:W.screen.values}},kn=JSON.stringify([ut,W.locale,dt.parameters,W.screen.inputs,W.screen.values]);if(kn!==Z)E.update(ut.document,W.locale,dt),Z=kn,Q=JSON.stringify(dt.capabilities),M=JSON.stringify(dt.customerData);else{let Ct=JSON.stringify(dt.capabilities);Ct!==Q&&(E.updateCapabilities(dt.capabilities),Q=Ct),JSON.stringify(dt.customerData)!==M&&(E.updateCustomerData(dt.customerData),M=JSON.stringify(dt.customerData))}await E.ready}else if(W.paywall&&!I){let ut=await o(l,{canInteract:()=>!Ce.active&&!Y,start:async()=>J6(r.client),onPurchase:r.onPurchase,onCheckoutUrl:r.onCheckoutUrl,resolveOfferId:r.resolveOfferId,onEvent:r.onEvent,onOpenUrl:dt=>r.onOpenUrl?r.onOpenUrl({receiptId:W.paywall.receiptId,url:dt,openIn:"same_window"}):s.defaultView?.location.assign(dt),onAction:async dt=>{if(Ce.active)return;let kn=await r.client.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:W.nodeId,visit:W.visit,revision:W.revision,input:{type:"screen",output:dt,answers:{}}});await ve(r.client.view??kn.run)},onError:ee,onDismiss:()=>{!Ce.active&&!Y&&r.client.view?.visit===W.visit&&Pe()}});Y?ut.host?.destroy():(I=ut.host,I?.setSuspended(Ce.active)),je.report(Qe)}if(Y)return;U=Qe,Fe();let Ue=W.instruction;if(Ue&&(Ue.type==="open_url"||Ue.type==="event")&&!ce.has(Ue.receiptId)){let ut=s.createElement("button");ut.type="button",ut.textContent=Ue.type==="open_url"?`${Ne?"\u524D\u5F80":"Continue to"} ${new URL(Ue.url).host}`:Ne?"\u7EE7\u7EED":"Continue",ut.onclick=()=>{let dt=Ke(),kn=Ue.type==="open_url"&&!r.onOpenUrl&&Ue.openIn==="new_window"?me(Ue.url):null;nt(async()=>{let Ct="success";if(Ue.type==="open_url")if(r.onOpenUrl)try{Ct=await r.onOpenUrl({receiptId:Ue.receiptId,url:Ue.url,openIn:Ue.openIn})===!1?"failed":"opened"}catch(Ot){ot(r.onError,Ot),Ct="failed"}else Ct=Ue.openIn==="new_window"&&!kn?"failed":"opened";if(Ue.type==="event"){if(!r.onEvent)throw new H("EVENT_HANDLER_REQUIRED","Provide the event handler");await r.onEvent(Ue.event)}if(Y||r.client.view?.nodeId!==dt.nodeId||r.client.view.visit!==dt.visit)throw new H("PRECONDITION_FAILED","The client action visit changed");let Dt=await r.client.submit({operation:"submit",...dt,input:{type:"client_action",receiptId:Ue.receiptId,outcome:Ct}});return ce.add(Ue.receiptId),Ue.type==="open_url"&&!r.onOpenUrl&&Ue.openIn==="same_window"&&s.defaultView?.location.assign(Ue.url),Dt})},l.replaceChildren(ut)}!W.pendingRequest&&W.status==="completed"&&!ce.has(`complete:${W.id}`)&&(ce.add(`complete:${W.id}`),ot(r.onComplete,structuredClone(W))),Yt()}function me(W){let Ne=s.defaultView?.open(W,"_blank")??null;return Ne&&(Ne.opener=null),Ne}function ve(W){return Fe(),R=R.catch(()=>{}).then(()=>fe(W)),R}let he=r.client.subscribe(W=>{r.client.configurationReady===!1&&(u.hidden=!0,E?.destroy(),E=null,I?.destroy(),I=null,l.replaceChildren(),j="",U="",Z="",M="",w.open&&w.close()),ve(W).catch(ee)}),Ie=r.client.subscribeError?.(ee);function Pe(){return O||(Y?Promise.resolve():r.client.view&&!["running","waiting"].includes(r.client.view.status)?(ze(),Promise.resolve()):(O=nt(()=>r.client.submit({operation:"close",...Ke()}),!0).then(()=>{r.client.view?.status==="closed"&&ze()}).finally(()=>{O=null}),O))}function ze(){a?.destroy(),!Y&&(Y=!0,X&&clearTimeout(X),he(),Ie?.(),E?.destroy(),Ce.stop(),I?.destroy(),w.close(),w.remove(),u.remove(),c instanceof HTMLElement&&c.isConnected&&c.focus(),ot(r.onDismiss,F?structuredClone(F):null))}g.onclick=()=>{if(!g.disabled){if(Ce.active){Ce.exit();return}nt(()=>r.client.submit({operation:"back",...Ke()}))}},h.onclick=()=>{Ce.open()},A.onclick=()=>{Pe()},C.onclick=()=>{nt(()=>r.client.retry())},w.addEventListener("cancel",W=>{W.preventDefault(),Pe()});try{let W=await r.client.get();await ve(r.client.view??W.run)}catch(W){throw ze(),W}return{destroy:ze,refresh:rt,review:Ce.open,exitReview:Ce.exit,get unappliedDrafts(){return Ce.drafts}}}yn();xr();J();Pk();J();yn();var kee=n.record(n.string().regex(/^[a-f0-9]{64}$/),n.strictObject({at:n.number(),text:n.string()})),CV=2*1048576,Eee=100;function Cee(){try{return typeof window>"u"?void 0:window.localStorage}catch{return}}function PV(e,t){let r=t===void 0?Cee():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),Eee)})])}catch{return null}finally{clearTimeout(c)}}async function a(){try{let s=await o(`${e}:artifacts`);if(s&&s.length<=CV)return kee.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<=Rr.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>Rr.retentionMs)continue;let g=new TextEncoder().encode(JSON.stringify({[f]:m})).byteLength;p+g>CV||h>=128||(d[f]=m,p+=g,h++)}await r.setItem(`${e}:artifacts`,JSON.stringify(d))}).catch(()=>{}))}}}AF();yn();async function Pee(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 OV(e,t,r){return new TextDecoder("utf-8",{fatal:!0}).decode(await Pee(e,t,r))}function TV(e,t){let r=typeof e=="string"?new TextEncoder().encode(e):e;return r.byteLength===t.byteLength&&EI(r)===t.sha256}var Je=(e,t)=>new H(e,t),Do=()=>performance.now(),RV=e=>{typeof e=="object"&&"unref"in e&&e.unref()};function NV(e){let t=_I.parse(e.scope),r=new Co(e.origin??bF);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 Je("INVALID_URL","Configuration requires a trusted HTTPS origin");let i=new Set([r.origin,...(e.assetOrigins??[]).map(fe=>{let me=new Co(fe);if(me.protocol!=="https:"||me.username||me.password||me.search||me.hash||me.pathname!=="/")throw Je("INVALID_URL","Invalid configuration asset origin");return me.origin})]),o=e.fetch??globalThis.fetch.bind(globalThis),a=`/api/v1/configuration/${t.environmentId}`,s=`indiana:configuration:1:${r.origin}:${In(t)}`,c=PV(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,j=new Map,U=new Map,Z=0,Q=!1;function M(){for(let fe of I)try{fe()}catch{}}function Y(fe){try{e.onError?.(fe)}catch{}}let L=()=>!h&&!p&&!!u&&Do()<l&&Date.now()<d;function N(){if(!L())throw Je("CONFIGURATION_EXPIRED","Refresh configuration before using it")}function V(fe,me){let ve=new TextEncoder().encode(me).byteLength;if(!j.has(fe)){for(;j.size&&(j.size>=128||Z+ve>Rr.maxCacheBytes);){let he=j.entries().next().value;Z-=new TextEncoder().encode(he[1]).byteLength,j.delete(he[0])}j.set(fe,me),Z+=ve}}function X(fe,me,ve){return OV(fe,me,{signal:ve,error:he=>Je("INVALID_RESPONSE",he==="missing"?"Configuration body is missing":"Configuration exceeds its byte limit")})}function R(fe){let me=new Co(fe,r);if(!i.has(me.origin)||me.username||me.password||me.hash||me.search)throw Je("INVALID_URL","Configuration artifact origin is not trusted");return me.href}async function O(fe,me,ve=!1){let he=await o(R(fe),{method:"GET",credentials:"omit",redirect:"error",cache:ve?"default":"no-cache",signal:me,headers:{}});if(he.status===429){let Ie=he.headers.get("retry-after")??"";E=/^\d+$/.test(Ie)?Number(Ie)*1e3:Math.max(0,Date.parse(Ie)-Date.now())||15e3}if(!he.ok&&he.status!==304)throw Je(`CONFIGURATION_HTTP_${he.status}`,"Configuration synchronization failed");return he}function B(fe,me,ve){let he=Date.parse(fe.headers.get("x-indiana-config-validated-at")??""),Ie=Date.parse(fe.headers.get("x-indiana-config-valid-until")??""),Pe=Date.parse(fe.headers.get("date")??""),ze=fe.headers.get("age"),W=ze!==null&&/^\d+(\.\d+)?$/.test(ze)?Number(ze)*1e3:NaN;if(![he,Ie,Pe,W].every(Number.isFinite)||Ie<=he||Ie-he>Rr.maxControlAgeMs||he>Pe+1e3)throw Je("INVALID_RESPONSE","Configuration freshness evidence is invalid");let Qe=Math.min(Ie-he,ve.maxControlAgeSeconds*1e3,Rr.maxControlAgeMs)-Math.max(W,Pe-he,0)-(Do()-me);if(Qe<=0)throw Je("CONFIGURATION_EXPIRED","Configuration validation expired in transit");return Do()+Qe}function ce(){if(clearTimeout(C),clearTimeout(w),h||!I.size)return;L()&&(w=setTimeout(()=>{L()?ce():M()},Math.max(1,l-Do())),RV(w));let fe=m?Math.min(15e3,1e3*2**Math.min(m-1,4)):Math.min(15e3,(u?.policy.refreshIntervalSeconds??15)*1e3);C=setTimeout(()=>{Ae().catch(Y)},Math.max(E,fe*(.8+Math.random()*.2))),RV(C)}async function Ae(){if(h)throw Je("CONFIGURATION_DISPOSED","Configuration manager was destroyed");if(g)return g;let fe=f,me=new AbortController;A=me;let ve=(async()=>{if(!Q){Q=!0;try{let Ct=await c.readManifest();if(Ct&&!u){let Dt=kI.parse(JSON.parse(Ct));In(Dt.scope)===In(t)&&(u=Dt)}}catch{}}me.signal.throwIfAborted();let ze=u,W=Do(),Ne=await O(a,me.signal);Ne.status===304&&(!ze||!Ne.headers.has("x-indiana-config-validated-at")||!Ne.headers.has("x-indiana-config-valid-until")||!Ne.headers.has("age"))&&(Ne=await O(a,me.signal));let Qe=Ne.status===304?ze:kI.parse(JSON.parse(await X(Ne,Rr.maxManifestBytes,me.signal))),{generation:Ue,...ut}=Qe,dt=Ne.headers.get("etag");if(In(Qe.scope)!==In(t)||d2(ut)!==Ue||dt!==`"${Ue}"`&&dt!==`W/"${Ue}"`)throw Je("INVALID_RESPONSE","Configuration scope or content identity changed");if(ze&&(Qe.revision<ze.revision||Qe.revision===ze.revision&&Qe.generation!==ze.generation))throw Je("INVALID_RESPONSE","Configuration revision moved backwards or changed identity");for(let[Ct,Dt]of Object.entries(ze?.funnels??{})){let Ot=Qe.funnels[Ct];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 Je("INVALID_RESPONSE","Funnel control revision changed identity")}let kn=B(Ne,W,Qe.policy);if(me.signal.throwIfAborted(),fe!==f)throw Je("CONFIGURATION_DISPOSED","Configuration scope changed");return u=Qe,l=kn,d=Date.now()+Math.max(0,kn-Do()),p=!1,m=0,E=0,c.writeManifest(In(Qe)),M(),structuredClone(Qe)})(),he=setTimeout(()=>me.abort(Je("CONFIGURATION_UNAVAILABLE","Configuration initialization timed out")),Rr.initializationMs),Ie=new Promise((ze,W)=>me.signal.addEventListener("abort",()=>W(me.signal.reason),{once:!0})),Pe=Promise.race([ve,Ie]).catch(ze=>{throw m++,(ze instanceof n.ZodError||ze instanceof SyntaxError||ze instanceof H&&["CONFIGURATION_HTTP_404","CONFIGURATION_HTTP_410","INVALID_RESPONSE"].includes(ze.code))&&(l=0,p=!0,M()),ze}).finally(()=>{clearTimeout(he),g===Pe&&(g=void 0),ce()});return g=Pe,Pe}async function ee(fe){let me=fe.sha256,ve=Ue=>TV(Ue,fe);R(fe.url);let he=j.get(me);if(he&&ve(he))return j.delete(me),j.set(me,he),he;if(U.has(me))return U.get(me);let Ie=new AbortController;F.add(Ie);let Pe=f,ze=(async()=>{try{let dt=await c.readArtifact(me);if(dt&&ve(dt))return V(me,dt),dt}catch{}Ie.signal.throwIfAborted();let Ue=await O(fe.url,Ie.signal,!0),ut=await X(Ue,fe.byteLength,Ie.signal);if(!ve(ut))throw Je("INVALID_RESPONSE","Configuration artifact digest or size mismatch");if(h||Pe!==f)throw Je("CONFIGURATION_DISPOSED","Configuration scope changed");return V(me,ut),c.writeArtifact(me,ut),ut})(),W=setTimeout(()=>Ie.abort(Je("CONFIGURATION_UNAVAILABLE","Configuration artifact timed out")),Rr.initializationMs),Ne=new Promise((Ue,ut)=>Ie.signal.addEventListener("abort",()=>ut(Ie.signal.reason),{once:!0})),Qe=Promise.race([ze,Ne]).finally(()=>{clearTimeout(W),F.delete(Ie),U.delete(me)});return U.set(me,Qe),Qe}async function Ke(){return L()||await Ae(),N(),u}async function Ce(fe){let me,ve=new Promise((he,Ie)=>{me=setTimeout(()=>Ie(Je("CONFIGURATION_UNAVAILABLE","Configuration initialization timed out")),Rr.initializationMs)});try{return await Promise.race([fe(),ve])}finally{clearTimeout(me)}}function je(fe,me){if(N(),u?.generation!==fe.generation)throw Je("CONFIGURATION_CHANGED","Configuration changed while preparing a snapshot");if(me&&u.funnels[me]?.state!=="active")throw Je("FUNNEL_STOPPED","Funnel is paused or unavailable")}async function Me(fe){let me=fe.gb.features;if(!me)throw Je("CONFIGURATION_UNAVAILABLE","Public Feature delivery is disabled");let ve=fe.artifacts[me];if(ve.formatVersion!==1)throw Je("UNSUPPORTED_SCHEMA","Unsupported public GB configuration format");let he=z_.parse(JSON.parse(await ee(ve)));if(In(he.scope)!==In({projectId:t.projectId,environment:t.environment})||he.generation!==ve.generation||he.remoteFeatures.some(Ie=>Object.hasOwn(he.features,Ie)))throw Je("INVALID_RESPONSE","Public GB configuration scope or generation is invalid");return je(fe),{...he,evaluatedAt:new Date().toISOString(),expiresAt:new Date(Date.now()+Math.max(0,l-Do())).toISOString()}}async function Pt(fe,me){let ve=await Ke(),he=ve.funnels[fe];me&&(!he||he.evaluationMode==="local"&&!he.versions[me])&&(g&&await g,ve=await Ae()),je(ve,fe);let Ie=ve.funnels[fe];if(Ie.evaluationMode!=="local")throw Je("EVALUATION_MODE","This Funnel executes at Longplay; public graph loading is disabled");let Pe=me??Ie.currentVersionId,ze=Ie.versions[Pe];if(!ze)throw Je("CONFIGURATION_UNAVAILABLE","Pinned Funnel Version is unavailable");if(ve.artifacts[ze.artifact].formatVersion!==3)throw Je("UNSUPPORTED_SCHEMA","Unsupported public Funnel format");let[W,Ne]=await Promise.all([ee(ve.artifacts[ze.artifact]).then(Qe=>m2(JSON.parse(Qe))),Ie.evaluationMode==="local"?Me(ve):void 0]);if(Ne&&In(p2(W,Ne))!==In(ze.dependencies))throw Je("INVALID_RESPONSE","Funnel and GB dependency contract do not match");return je(ve,fe),{document:W,growth:Ne,versionId:Pe,control:structuredClone(Ie),manifest:structuredClone(ve)}}async function Fe(fe,me){try{return await Pt(fe,me)}catch(ve){if(!(ve instanceof H)||!(ve.code==="CONFIGURATION_CHANGED"||ve.code==="CONFIGURATION_HTTP_404"&&L()))throw ve;let he=u?.generation;if(g&&await g,await Ae(),ve.code!=="CONFIGURATION_CHANGED"&&u?.generation===he)throw ve;return Pt(fe,me)}}function nt(){p=!0,M(),Ae().catch(Y)}let Yt=()=>{(typeof document>"u"||document.visibilityState==="visible")&&nt()};function rt(fe){if(h)throw Je("CONFIGURATION_DISPOSED","Configuration manager was destroyed");return I.add(fe),I.size===1&&(typeof window<"u"&&(window.addEventListener("online",nt),window.addEventListener("focus",Yt),document.addEventListener("visibilitychange",Yt)),ce()),()=>{I.delete(fe),I.size||(clearTimeout(C),clearTimeout(w),Kn())}}function Kn(){typeof window<"u"&&(window.removeEventListener("online",nt),window.removeEventListener("focus",Yt),document.removeEventListener("visibilitychange",Yt))}return{scope:Object.freeze({...t}),refresh:Ae,subscribe:rt,assertFresh:N,assertFeatures(fe){N();let me=u.gb.features;if(!me)throw Je("CONFIGURATION_UNAVAILABLE","Public Feature delivery is disabled");if(fe!==void 0&&u.artifacts[me].generation!==fe)throw Je("CONFIGURATION_CHANGED","Refresh changed Feature configuration before evaluation")},get fresh(){return L()},get snapshot(){return u?structuredClone(u):null},get remainingMs(){return L()?Math.max(0,l-Do()):0},async features(){return Ce(async()=>Me(await Ke()))},pageExperiments:()=>Ce(async()=>{let fe=await Ke(),me=fe.gb.pageExperiments;if(!me)throw Je("CONFIGURATION_UNAVAILABLE","Public page experiments are disabled");let ve=fe.artifacts[me];if(ve.formatVersion!==1)throw Je("UNSUPPORTED_SCHEMA","Unsupported page experiment format");let he=UM.parse(JSON.parse(await ee(ve)));if(he.environmentId!==t.environmentId||he.generation!==ve.generation)throw Je("INVALID_RESPONSE","Page experiment scope or generation changed");return je(fe),he}),funnel:(fe,me)=>Ce(()=>Fe(fe,me)),paywall:(fe,me)=>Ce(async()=>{let ve=await Ke(),he=ve.paywalls?.[fe];if(!he||!me&&he.state!=="published")throw Je("PAYWALL_UNAVAILABLE","Published Paywall is unavailable");let Ie=me??he.currentVersionId,Pe=he.versions[Ie],ze=Pe&&ve.artifacts[Pe.artifact];if(!ze||ze.kind!=="paywall"||ze.formatVersion!==1)throw Je("UNSUPPORTED_SCHEMA","Public Paywall format is unavailable");let W=c2.parse(JSON.parse(await ee(ze)));return je(ve),{document:W,versionId:Ie,version:Pe.version,control:structuredClone(he),manifest:structuredClone(ve)}}),async localFunnel(fe,me){let ve=await Ce(()=>Fe(fe,me));if(!ve.growth)throw Je("EVALUATION_MODE","This Funnel requires remote execution");let{analyticsConfig:he,remoteFeatures:Ie,...Pe}=ve.growth;return _M({scope:{projectId:t.projectId,environment:t.environment},funnelId:fe,versionId:ve.versionId,evaluationMode:"local",evaluationRevision:ve.control.evaluationRevision,document:ve.document,payload:Pe})},assertFunnel(fe,me,ve){N();let he=u.funnels[fe];if(!he||he.state!=="active")throw Je("FUNNEL_STOPPED","Funnel is paused or unavailable");if(he.evaluationMode!=="local")throw Je("EVALUATION_MODE","This Funnel now executes at Longplay");if(me!==void 0&&he.controlRevision!==me)throw Je("RUN_RECONCILIATION_REQUIRED","Reconcile the original Run after a control change");if(ve!==void 0&&!he.versions[ve])throw Je("CONFIGURATION_UNAVAILABLE","Pinned Funnel Version is unavailable")},destroy(){if(!h){h=!0,f++,l=0,A?.abort(Je("CONFIGURATION_DISPOSED","Configuration manager was destroyed")),clearTimeout(C),clearTimeout(w),Kn(),M(),I.clear();for(let fe of F)fe.abort(Je("CONFIGURATION_DISPOSED","Configuration manager was destroyed"));j.clear(),Z=0}}}}yn();xr();var DV=(e,t)=>new H(e,t);xr();async function $V(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 H("CONFIGURATION_UNAVAILABLE","Local execution requires public configuration");if(e.scope.environmentId!==i.environmentId)throw new H("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=Oee(e,t,s)}catch{o=null}return a??=e.snapshot?.generation??(await e.refresh()).generation,{advance:{policyRevision:i.policyRevision,generation:a},prediction:o}}function Oee(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=nk({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:Or.parse(s)}),u=Tee(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 Tee(e,t,r){return HM(e,t,r,DV)}yn();function Vy(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)=>Vy(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)&&Vy(a,Reflect.get(t,o)))}J();var Ree=/^\/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})?$/,Nee=n.strictObject({status:n.number().int().min(200).max(599),headers:n.record(n.string(),n.string()),body:n.string()});function jV(){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(N){if(a)throw new H("CLOSED","Native host is unavailable");if(i)i.postMessage(JSON.stringify(N));else if(e.webkit?.messageHandlers?.indianaFunnel)e.webkit.messageHandlers.indianaFunnel.postMessage(N);else throw new H("BRIDGE_UNAVAILABLE","Native bridge is unavailable")}function I(N,V={}){let X=crypto.randomUUID();return new Promise((R,O)=>{let B=setTimeout(()=>{r.delete(X),O(new H("TIMEOUT","Retry the original command"))},45e3);r.set(X,{resolve:R,reject:O,timer:B});try{E({id:X,method:N,payload:V})}catch(ce){clearTimeout(B),r.delete(X),O(ce)}})}function F(N,V=!1,X=d,R){let O=cd.parse(N);if(R&&O.settlement?.requestId!==R)throw new H("INVALID_RESPONSE","Exact command settlement is missing or changed");if(V&&!O.review)throw new H("INVALID_RESPONSE","Historical projection is missing");if(!c||O.scope.projectId!==c.projectId||O.scope.environment!==c.environment)throw new H("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||!Vy(d.parameters,O.run.parameters)))throw new H("INVALID_RESPONSE","Run identity changed");if(V&&d&&d!==X&&O.run.revision<=d.revision||(V&&!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 B of w)try{B(structuredClone(d))}catch{}}return O}async function j(N){let V=vc.parse(N),X=N.operation==="close";if(X){if(f=!0,h&&JSON.stringify(h)!==JSON.stringify(N))throw new H("COMMAND_PENDING","Retry the original Close");h=N}if(!X&&f)throw new H("COMMAND_PENDING","Settle the original command after Close");if(!X&&p&&JSON.stringify(p)!==JSON.stringify(N))throw new H("COMMAND_PENDING","Retry the original command");X||(p=N);let R=m.has(N.requestId);m.add(N.requestId);try{if(V.operation==="start"||V.operation==="review"||"customerToken"in V)throw new H("INVALID_REQUEST","Credentials belong to the native host");let O=F(await I("command",V),!1,d,N.requestId);return O.settlement?.state==="settled"&&(!f||X||O.settlement?.requestId===N.requestId&&O.settlement.state==="settled"&&!["running","waiting"].includes(O.run.status))&&(p===N&&(p=null),h===N&&(h=null),m.delete(N.requestId)),O}catch(O){throw p===N&&!R&&!f&&O instanceof H&&O.status!==void 0&&O.status<500&&![401,425].includes(O.status)&&(p=null),O}}async function U(N,V){let X=new URL(N instanceof Request?N.url:N);if(X.origin!==t||X.search||X.hash||(V?.method??"GET")!=="GET"||!Ree.test(X.pathname))throw new H("INVALID_URL","Configuration path is not trusted");V?.signal?.throwIfAborted();let R=Nee.parse(await I("configuration",{path:X.pathname}));return V?.signal?.throwIfAborted(),new Response([204,205,304].includes(R.status)?null:R.body,{status:R.status,headers:R.headers})}async function Z(N){if(N.run.instruction?.type!=="evaluate_segment"||p||f)return N;if(l)return l;let V=(async()=>{let X=N;for(let R=0;R<32;R++){let O=X.run,B=O.instruction;if(B?.type!=="evaluate_segment")break;if(a||!c)throw new H("IDENTITY_CHANGED","Native session changed");u??=NV({origin:t,scope:{...c,environmentId:B.environmentId},fetch:U,storage:null});let ce=()=>d&&(d.revision!==O.revision||d.visit!==O.visit||d.nodeId!==O.nodeId);if(B.type==="evaluate_segment"){let{advance:Ae}=await $V(u,O,{predict:!1});if(p||f)return X;if(ce())return F(await I("command",{operation:"get"}));X=await j({operation:"commit_segment",requestId:hM(O.id,O.visit,`segment:${O.revision}`),nodeId:O.nodeId,visit:O.visit,revision:O.revision,...Ae})}}return X})();l=V;try{return await V}finally{l===V&&(l=null)}}function Q(){if(!a){a=!0,u?.destroy(),C?.destroy(),g?.destroy(),g=null,d=null,p=null,h=null,m.clear(),w.clear();for(let N of r.values())clearTimeout(N.timer),N.reject(new H("IDENTITY_CHANGED","Native identity changed"));r.clear(),i?.close(),i=null,o=null,window.removeEventListener("message",L),document.body.replaceChildren()}}let M={async resolvePaywall(N){return vo.parse(await I("paywallContent",{id:N.id,sha256:N.content.artifact.sha256}))},get view(){return d?structuredClone(d):null},get pendingCommand(){let N=h??p;return N?structuredClone(N):null},get pendingCommands(){return[p,h].filter(N=>N!==null).map(N=>structuredClone(N))},async settle(N){let V=F(await I("command",{operation:"get",settlementRequestId:N}));if(V.settlement?.requestId!==N)throw new H("INVALID_RESPONSE","Exact command settlement is missing");return V.settlement.state==="settled"&&(p?.requestId===N&&(p=null),h?.requestId===N&&(h=null),m.delete(N)),V},webViewUrl:"bundled",async review(N){let V=d;return F(await I("command",{operation:"review",...N?{receiptId:N}:{}}),!0,V)},async get(N,V){let X=F(await I("command",{operation:"get",...N?{data:N}:{},...V?{purchase:V}:{}})),R=await I("pendingCommand");if(R){let O=vc.parse(R);if(O.operation==="get"||O.operation==="start"||O.operation==="review"||"customerToken"in O)throw new H("INVALID_RESPONSE","Invalid native pending command");O.operation==="close"?(h=O,f=!0):p=O}else p=null,h=null;return Z(X)},submit:N=>j(N).then(Z),retry:()=>h?j(h):f&&p?M.settle(p.requestId):p?j(p).then(Z):Promise.reject(new H("INVALID_REQUEST","No pending command")),resume:(N=d?.pendingRequest?.requestId)=>N?f?M.settle(N):j({operation:"resume",requestId:N}).then(Z):Promise.reject(new H("INVALID_REQUEST","No interrupted command")),identify(){throw new H("INVALID_REQUEST","Customer credentials belong to the native session")},subscribe(N){return w.add(N),()=>w.delete(N)},reset:Q};async function Y(N,V,X,R){if(s||a)return;let O=new URL(n.string().parse(V));if(O.origin!==V||O.username||O.password||O.protocol!=="https:"&&!(O.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(O.hostname)))throw new H("INVALID_CONFIGURATION","Invalid native API origin");if(t=O.origin,c=yt.parse(N),s=!0,X==="features"){if(A=await EF(I,c,R),g=A,a){g.destroy(),g=null;return}await I("featuresReady");return}if(X==="content"){g=await H6(I),a&&(g.destroy(),g=null);return}if(X==="paywall"){if(C=await G6(ce=>I("paywall",ce)),a){C.destroy();return}g=(await Ty(document.body,{start:async()=>C,onPurchase:({operation:ce})=>I("purchase",{operation:ce}),onCheckoutUrl:ce=>I("checkout",{url:ce}),onOpenUrl:ce=>I("open",{url:ce}),onEvent:ce=>I("event",{event:ce}),onComplete:()=>I("complete"),onDismiss:()=>{a||I("dismiss").catch(()=>{})},onError:()=>{a||I("error").catch(()=>{})}})).host,a&&(g?.destroy(),g=null);return}if(X!==void 0&&X!=="funnel")throw new H("INVALID_CONFIGURATION","Unknown native surface");g=await EV(document.getElementById("grow-funnel-root")??document.body,{client:M,onPurchase:({operation:B})=>I("purchase",{operation:B}),onCheckoutUrl:B=>I("checkout",{url:B}),onOpenUrl:B=>I("open",B),onEvent:B=>I("event",{event:B}),onComplete:()=>I("complete"),onDismiss:()=>{a||I("dismiss").catch(()=>{})}}),a&&(g.destroy(),g=null)}e.__indianaFunnelReceive=N=>{if(a||!N||typeof N!="object")return;let V=N;if(V.event==="invalidated")return Q();if(V.event==="feature_call"){let R=V.id;if(typeof R!="string"||!A)return;A.call(V.input).then(O=>I("featureResult",{id:R,result:O})).catch(O=>I("featureResult",{id:R,error:{code:O instanceof H?O.code:"INVALID_RESPONSE"}})).catch(()=>{});return}if(V.event==="refresh"){g?.refresh().catch(()=>{});return}if(V.event==="init"){Y(V.scope,V.apiOrigin,V.surface,V.attributes).catch(Q);return}if(typeof V.id!="string")return;let X=r.get(V.id);if(X)if(r.delete(V.id),clearTimeout(X.timer),V.error&&typeof V.error=="object"){let R=V.error;X.reject(new H(typeof R.code=="string"?R.code:"NATIVE_OPERATION_FAILED","Native operation did not finish",typeof R.status=="number"?R.status:void 0))}else X.resolve(V.result)},e.__indianaFunnelPreparePort=N=>a||i||!/^[a-f0-9-]{36}$/.test(N)?!1:(o=N,!0);function L(N){let V=N.data;if(typeof V=="string")try{V=JSON.parse(V)}catch{return}!V||typeof V!="object"||!("type"in V)||V.type!=="indiana-native-port"||!o||!("nonce"in V)||V.nonce!==o||i||!N.ports[0]||(o=null,i=N.ports[0],i.onmessage=X=>{if(!(typeof X.data!="string"||X.data.length>2097152))try{e.__indianaFunnelReceive?.(JSON.parse(X.data))}catch{Q()}},i.start(),E({id:crypto.randomUUID(),method:"ready",payload:{}}))}return window.addEventListener("message",L),e.webkit?.messageHandlers?.indianaFunnel&&E({id:crypto.randomUUID(),method:"ready",payload:{}}),{destroy:Q}}globalThis.__indianaInstallNativeFunnelHost=jV;})();
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>