@buildbase/sdk 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ let e=!0;function t(t,...a){e&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(t,...a)}async function a(e,t){try{const a=await e.json();return a?.message||a?.error||t}catch{return t}}async function n(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function r(e,t="Request failed"){if(!e.ok){let a=t;try{const t=await n(e);a=t.message||t.error||a}catch{a=function(e,t){const a={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${a})`)}(e,t).message}throw new Error(a)}try{return await n(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class i extends Error{constructor(e,t,a,n){super(e),this.code=t,this.context=a,this.originalError=n,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,i)}}const o=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(t){this.config={...this.config,...t},void 0!==t.enableConsoleLogging&&function(t){void 0!==t.enableLogging&&(e=t.enableLogging)}({enableLogging:t.enableConsoleLogging})}handleError(e,a={}){if(function(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}(e))return;const n=e instanceof Error?e:new i("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",a),r=n instanceof i?n:new i(n.message,"SDK_ERROR",a,n);if(this.config.enableConsoleLogging&&t(`[SDK Error] ${a.component||"Unknown"}:`,{message:r.message,code:r.code,context:r.context,originalError:r.originalError,stack:r.stack}),this.config.onError)try{this.config.onError(r,a)}catch(e){!function(e,...t){console.error(e,...t)}("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(r,a)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...a)=>e(...a).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...a)=>{try{return e(...a)}catch(e){throw this.handleError(e,t),e}}}};function s(e,t={}){o.handleError(e,t)}const c="saas-session-id";function u(){if("undefined"==typeof window)return null;try{return function(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return s(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}(c)}catch(e){return s(e,{component:"auth-utils",action:"getSessionId",metadata:{key:c}}),null}}function d(){const e=u(),t={};return e&&(t["x-session-id"]=e),t}const l="SDK is not ready (missing serverUrl, version, or orgId)";class f{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(l);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(l)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:d()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const a=this.url(e),n=(t.method??"GET").toUpperCase(),r=this.buildHeaders(t),i={...t,headers:r};let o;if(this._timeout>0){const e=new AbortController;o=setTimeout(()=>e.abort(),this._timeout),i.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const s=async t=>{try{const e=this._fetch.bind(globalThis),r=await e(a,i);if(this._debug&&console.log(`[BuildBase] ${n} ${a} → ${r.status}`),r.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),s(t+1)}return r}catch(a){if(a instanceof Error&&"AbortError"===a.name){if(void 0!==o){const t=new Error(`Request timeout after ${this._timeout}ms: ${n} ${e}`);throw this._onError?.(t,{method:n,path:e}),t}throw a}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),s(t+1)}throw a instanceof Error&&this._onError?.(a,{method:n,path:e}),a}};try{return await s(0)}finally{void 0!==o&&clearTimeout(o)}}async fetchJson(e,t={},a="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await r(n,a)}catch(a){throw a instanceof Error&&this._onError?.(a,{method:(t.method??"GET").toUpperCase(),path:e}),a}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}}class p extends f{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok){let e="Failed to initiate authentication";try{e=(await a.json()).message||e}catch{e=`Failed to initiate authentication (${a.status}: ${a.statusText})`}throw new Error(e)}return a.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}class m extends f{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}class h{constructor(e){this.api=new m(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},a=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),r=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),i=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:a,language:n,timezone:r,currency:i}})}}class g extends f{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}class b extends f{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}class y extends f{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await a(t,"Failed to fetch user attributes"));const n=await t.json();return n&&"object"==typeof n&&!Array.isArray(n)?n:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});if(!t.ok)throw new Error(await a(t,"Failed to fetch user features"));const n=await t.json();return"object"==typeof n&&null!==n?n:{}}}class v extends f{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,a){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(a)},"Failed to update user")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,a){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:a}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);if(!t.ok){let e="Failed to fetch subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch subscription");return a.data||a}return a}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);if(!t.ok){let e="Failed to fetch plan group";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group found for this workspace":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch plan group");return a.data||a}return a}async getPlanGroupByVersion(e,t){const a=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${t}`);if(!a.ok){let e="Failed to fetch plan group version";try{e=(await a.json()).message||e}catch{e=404===a.status?"Plan group version not found":401===a.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${a.status}: ${a.statusText})`}throw new Error(e)}const n=await a.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group version");return n.data||n}return n}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);if(!t.ok){let e="Failed to fetch plan group versions";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group versions found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group versions (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch plan group versions");return a.data||a}return a}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);if(!t.ok){let a="Failed to fetch plans";try{a=(await t.json()).message||a}catch{a=404===t.status?`Plans "${e}" not found`:`Failed to fetch plans (${t.status}: ${t.statusText})`}throw new Error(a)}const a=await t.json();if(void 0!==a.success&&!a.success)throw new Error(a.message||"Failed to fetch plans");return a.data??a}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);if(!t.ok){let e="Failed to fetch plan group version";try{e=(await t.json()).message||e}catch{e=404===t.status?"Plan group version not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch plan group version");return a.data||a}return a}async createCheckoutSession(e,t){const a=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});if(!a.ok){let e="Failed to create checkout session";try{e=(await a.json()).message||e}catch{e=`Failed to create checkout session (${a.status}: ${a.statusText})`}throw new Error(e)}const n=await a.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to create checkout session");return n.data||n}return n}async updateSubscription(e,t){const a=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});if(!a.ok){let e="Failed to update subscription";try{e=(await a.json()).message||e}catch{e=`Failed to update subscription (${a.status}: ${a.statusText})`}throw new Error(e)}const n=await a.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to update subscription");return n.data?.checkoutUrl||n.checkoutUrl,n.data||n}return n.checkoutUrl,n}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,a){const n=new URLSearchParams;n.append("limit",t.toString()),a&&n.append("starting_after",a);const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${n.toString()}`,{});if(!r.ok){let e="Failed to fetch invoices";try{e=(await r.json()).message||e}catch{e=404===r.status?"Workspace not found or no invoices available":401===r.status?"Unauthorized - Please check your session":`Failed to fetch invoices (${r.status}: ${r.statusText})`}throw new Error(e)}const i=await r.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch invoices");return i}return i}async getInvoice(e,t){const a=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`,{});if(!a.ok){let e="Failed to fetch invoice";try{e=(await a.json()).message||e}catch{e=404===a.status?"Invoice not found":401===a.status?"Unauthorized - Please check your session":`Failed to fetch invoice (${a.status}: ${a.statusText})`}throw new Error(e)}const n=await a.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch invoice");return n}return n}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});if(!t.ok){let e="Failed to cancel subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to cancel subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to cancel subscription");return a.data||a}return a}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});if(!t.ok){let e="Failed to resume subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to resume subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to resume subscription");return a.data||a}return a}async recordUsage(e,t){const a=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});if(!a.ok){let e="Failed to record usage";try{e=(await a.json()).message||e}catch{e=`Failed to record usage (${a.status}: ${a.statusText})`}throw new Error(e)}const n=await a.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to record usage");return n.data||n}return n}async getQuotaUsageStatus(e,t){const a=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);if(!a.ok){let e="Failed to fetch quota usage status";try{e=(await a.json()).message||e}catch{e=404===a.status?"Workspace not found or no subscription available":401===a.status?"Unauthorized - Please check your session":`Failed to fetch quota usage status (${a.status}: ${a.statusText})`}throw new Error(e)}const n=await a.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch quota usage status");return n.data||n}return n}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);if(!t.ok){let e="Failed to fetch all quota usage";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch all quota usage (${t.status}: ${t.statusText})`}throw new Error(e)}const a=await t.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch all quota usage");return a.data||a}return a}async getUsageLogs(e,t){const a=new URLSearchParams;t?.quotaSlug&&a.append("quotaSlug",t.quotaSlug),t?.from&&a.append("from",t.from),t?.to&&a.append("to",t.to),t?.source&&a.append("source",t.source),t?.page&&a.append("page",t.page.toString()),t?.limit&&a.append("limit",t.limit.toString());const n=a.toString(),r=`workspaces/${e}/subscription/usage/logs${n?`?${n}`:""}`,i=await this.fetchResponse(r);if(!i.ok){let e="Failed to fetch usage logs";try{e=(await i.json()).message||e}catch{e=404===i.status?"Workspace not found":401===i.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${i.status}: ${i.statusText})`}throw new Error(e)}const o=await i.json();if(void 0!==o.success){if(!o.success)throw new Error(o.message||"Failed to fetch usage logs");return o.data||o}return o}}var A;!function(e){e.V1="v1"}(A||(A={}));class S{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){s(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit("user:created",{user:e})}async emitUserUpdated(e,t){await this.emit("user:updated",{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit("workspace:changed",{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit("workspace:updated",{workspace:e})}async emitWorkspaceUserAdded(e,t,a){await this.emit("workspace:user-added",{userId:e,workspace:t,role:a})}async emitWorkspaceUserRemoved(e,t,a){await this.emit("workspace:user-removed",{userId:e,workspace:t,role:a})}async emitWorkspaceUserRoleChanged(e,t,a,n){await this.emit("workspace:user-role-changed",{userId:e,workspace:t,previousRole:a,newRole:n})}async emitWorkspaceCreated(e){await this.emit("workspace:created",{workspace:e})}async emitWorkspaceDeleted(e){await this.emit("workspace:deleted",{workspace:e})}}const w=new S,T=new Set;function k(){T.forEach(e=>e())}const _=new Set;function E(){_.forEach(e=>e())}const C={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},z={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function P(e){return e&&e.trim()?z[e.trim().toLowerCase()]??"":""}function U(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return C[t]??t.toUpperCase()}const $=["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"],I=$.map(e=>({value:e,label:`${e.toUpperCase()} (${U(e)})`}));function M(e,t){return U(t)+(e/100).toFixed(2)}function x(e,t,a){if(null==e||e<0)return null;const n=null!=t&&t>=1?t:1,r=U(a),i=(e/100).toFixed(2);return 1===n?`${r}${i}/unit`:`${r}${i}/${n.toLocaleString()} units`}function N(e,t,a,n){if(null==e||e<0)return null;const r=null!=t&&t>=1?t:1,i=U(n),o=(e/100).toFixed(2);if(a){const e=a.endsWith("s")?a:`${a}s`;return r>=2?`${i}${o}/${r.toLocaleString()} ${e}`:`${i}${o}/${a}`}return 1===r?`${i}${o}/unit`:`${i}${o}/${r.toLocaleString()} units`}function R(e){const t=(e||"").trim().toLowerCase();if(!t)return"unit";const a=t.split(/\s+/)[0]??t;return new Set(["series","species","status","analysis","basis","bus","campus","corpus","axis"]).has(a)?a:a.endsWith("ies")&&a.length>3?a.slice(0,-3)+"y":a.endsWith("ses")||a.endsWith("xes")||a.endsWith("zes")||a.endsWith("ches")||a.endsWith("shes")?a.slice(0,-2):a.endsWith("s")&&!a.endsWith("ss")&&a.length>1?a.slice(0,-1):a||"unit"}function D(e,t,a,n,r){const i=a.endsWith("s")?a:`${a}s`,o=null!=r&&r>=2?`${r.toLocaleString()} ${i}`:a;return null!=e&&null!=t?`Included: ${e.toLocaleString()}, after that ${M(t,n)}/${o}`:null!=e?`Included: ${e.toLocaleString()}`:null!=t?`After included: ${M(t,n)}/${o}`:"—"}function O(e,t){if(null==e)return null;const a=e[t??"monthly"];return a?{included:a.included,...void 0!==a.overage&&{overage:a.overage},...void 0!==a.unitSize&&{unitSize:a.unitSize}}:null}function F(e,t,a={}){const{overageInCents:n=!0,currency:r}=a,i=a.currencySymbol??U(r??"");if(null==e)return"—";const{included:o,overage:s}=e,c=`${o} included`;if(null==s)return c;const u=n?s/100:s;return`${c}, then ${i}${"number"==typeof u&&Number.isFinite(u)?u.toFixed(2):String(s)}${t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?` / ${e.unitSize.toLocaleString()} ${t}`:t?` / ${t}`:""}`}function B(e,t){const a=e.pricingVariants;if(!a?.length)return null;const n=t.toLowerCase();return a.find(e=>e.currency?.toLowerCase()===n)??null}function G(e,t,a){const n=B(e,t);if(!n?.basePricing)return null;const r=n.basePricing[a];return null!=r?r:null}function Z(e,t,a){const n=B(e,t);if(!n?.stripePrices)return null;const r="monthly"===a?"monthlyPriceId":"yearly"===a?"yearlyPriceId":"quarterlyPriceId",i="monthly"===a?"monthly":"yearly"===a?"yearly":void 0;return n.stripePrices[r]??(i?n.stripePrices[i]:void 0)??null}function L(e,t,a,n){const r=B(e,t),i=r?.quotaOverages?.[a];if(i)return i[n]}function j(e,t){const a=B(e,t);return a?a.currency:e.plan?.currency??""}function K(e){const t=new Set;for(const a of e)a.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}function J(e,t,a,n){const r=e.quotas?.[a];if(null==r)return null;const i=r[n];if(!i)return null;const o=L(e,t,a,n);return{included:i.included,...void 0!==i.unitSize&&{unitSize:i.unitSize},...void 0!==o&&{overage:o}}}function W(e,t){if(!e)return null;for(const a of t){const t=a.pricingVariants;if(t?.length)for(const a of t){const t=a.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:a.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:a.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:a.currency}}}}return null}function H(e,t){const a=B(e,t);return a?.seatPricing?.enabled?a.seatPricing:null}function V(e,t,a){const n=H(e,t);return n?.perSeat?n.perSeat[a]??null:null}function Y(e,t){return Math.max(0,e-(t||0))}function q(e,t,a,n){const r=H(e,t);if(!r)return null;return Y(n,r.includedSeats)*(V(e,t,a)??0)}function X(e,t,a,n){const r=G(e,t,a);if(null===r)return null;if(void 0===n)return r;return r+(q(e,t,a,n)??0)}function Q(e){const{planVersion:t,currency:a="usd",settingsMaxUsers:n}=e;if(t){const e=H(t,a);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=n&&n>0?{maxUsers:n,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function ee(e){const{memberCount:t,maxUsersConfig:a,hasSubscription:n=!0,requireSubscription:r=!1}=e;if(r&&!n)return{canInvite:!1,blockReason:"no_subscription",blockMessage:"A subscription is required to invite members."};const{maxUsers:i,source:o}=a;if(i<=0)return{canInvite:!0,blockReason:null,blockMessage:null};if(t>=i){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[o]??"seat_limit_reached",blockMessage:{seat_pricing:`Your plan allows up to ${i} members. Upgrade for more seats.`,settings:`This workspace allows up to ${i} members.`}[o]??`Member limit of ${i} reached.`}}return{canInvite:!0,blockReason:null,blockMessage:null}}const te="\n// BuildBase Push Notification Service Worker\n// Place this file in your app's public directory (e.g. public/push-sw.js)\n\nself.addEventListener('push', function(event) {\n if (!event.data) return;\n\n try {\n var payload = event.data.json();\n var title = payload.title || 'Notification';\n var options = {\n body: payload.body || '',\n icon: payload.icon || undefined,\n badge: payload.icon || undefined,\n data: { url: payload.url, ...(payload.data || {}) },\n tag: 'buildbase-push-' + Date.now(),\n };\n\n event.waitUntil(\n self.registration.showNotification(title, options)\n );\n } catch (e) {\n console.error('[PushSW] Failed to show notification:', e);\n }\n});\n\nself.addEventListener('notificationclick', function(event) {\n event.notification.close();\n\n var url = event.notification.data && event.notification.data.url;\n if (url) {\n event.waitUntil(\n clients.matchAll({ type: 'window', includeUncontrolled: true }).then(function(clientList) {\n for (var i = 0; i < clientList.length; i++) {\n var client = clientList[i];\n if (client.url === url && 'focus' in client) {\n return client.focus();\n }\n }\n if (clients.openWindow) {\n return clients.openWindow(url);\n }\n })\n );\n }\n});\n";const ae={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},ne={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},re=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=ne[e.code]||"USD",a=ae[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:a};var n}),ie=re.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),oe=Array.from(new Set(ie.map(e=>e.value))).map(e=>ie.find(t=>t.value===e)).filter(e=>void 0!==e);let se=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];se=se.filter((e,t,a)=>t===a.findIndex(t=>t.code===e.code&&t.label===e.label)),se.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const ce=se.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,a)=>t===a.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag})),ue=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let a=t.utc;for(let n=0;n<a.length;n++){const r=a[n],i=t.text;let o=i.substring(i.indexOf("(")+1,i.indexOf(")"));-1!==o.indexOf("UTC")&&e.push({value:r,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${o}) ${r}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,a)=>t===a.findIndex(t=>t.value===e.value));function de(e,t,a){function n(a,n){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:n,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,n);const r=o.prototype,i=Object.keys(r);for(let e=0;e<i.length;e++){const t=i[e];t in a||(a[t]=r[t].bind(a))}}const r=a?.Parent??Object;class i extends r{}function o(e){var t;const r=a?.Parent?new i:this;n(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!(a?.Parent&&t instanceof a.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class le extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class fe extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const pe={};function me(e){return pe}function he(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,a])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function ge(e,t){return"bigint"==typeof t?t.toString():t}function be(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ye(e){return null==e}function ve(e){const t=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;return e.slice(t,a)}const Ae=Symbol("evaluating");function Se(e,t,a){let n;Object.defineProperty(e,t,{get(){if(n!==Ae)return void 0===n&&(n=Ae,n=a()),n},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function we(e,t,a){Object.defineProperty(e,t,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Te(...e){const t={};for(const a of e){const e=Object.getOwnPropertyDescriptors(a);Object.assign(t,e)}return Object.defineProperties({},t)}function ke(e){return JSON.stringify(e)}const _e="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ee(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Ce=be(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ze(e){if(!1===Ee(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const a=t.prototype;return!1!==Ee(a)&&!1!==Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")}function Pe(e){return ze(e)?{...e}:Array.isArray(e)?[...e]:e}const Ue=new Set(["string","number","symbol"]);function $e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ie(e,t,a){const n=new e._zod.constr(t??e._zod.def);return t&&!a?.parent||(n._zod.parent=e),n}function Me(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function xe(e,t=0){if(!0===e.aborted)return!0;for(let a=t;a<e.issues.length;a++)if(!0!==e.issues[a]?.continue)return!0;return!1}function Ne(e,t){return t.map(t=>{var a;return(a=t).path??(a.path=[]),t.path.unshift(e),t})}function Re(e){return"string"==typeof e?e:e?.message}function De(e,t,a){const n={...e,path:e.path??[]};if(!e.message){const r=Re(e.inst?._zod.def?.error?.(e))??Re(t?.error?.(e))??Re(a.customError?.(e))??Re(a.localeError?.(e))??"Invalid input";n.message=r}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Oe(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Fe(...e){const[t,a,n]=e;return"string"==typeof t?{message:t,code:"custom",input:a,inst:n}:{...t}}const Be=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,ge,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ge=de("$ZodError",Be),Ze=de("$ZodError",Be,{Parent:Error});const Le=e=>(t,a,n,r)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:a,issues:[]},i);if(o instanceof Promise)throw new le;if(o.issues.length){const t=new(r?.Err??e)(o.issues.map(e=>De(e,i,me())));throw _e(t,r?.callee),t}return o.value},je=e=>async(t,a,n,r)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:a,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const t=new(r?.Err??e)(o.issues.map(e=>De(e,i,me())));throw _e(t,r?.callee),t}return o.value},Ke=e=>(t,a,n)=>{const r=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:a,issues:[]},r);if(i instanceof Promise)throw new le;return i.issues.length?{success:!1,error:new(e??Ge)(i.issues.map(e=>De(e,r,me())))}:{success:!0,data:i.value}},Je=Ke(Ze),We=e=>async(t,a,n)=>{const r=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:a,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>De(e,r,me())))}:{success:!0,data:i.value}},He=We(Ze),Ve=e=>(t,a,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Le(e)(t,a,r)},Ye=e=>(t,a,n)=>Le(e)(t,a,n),qe=e=>async(t,a,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return je(e)(t,a,r)},Xe=e=>async(t,a,n)=>je(e)(t,a,n),Qe=e=>(t,a,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ke(e)(t,a,r)},et=e=>(t,a,n)=>Ke(e)(t,a,n),tt=e=>async(t,a,n)=>{const r=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return We(e)(t,a,r)},at=e=>async(t,a,n)=>We(e)(t,a,n),nt=/^[cC][^\s-]{8,}$/,rt=/^[0-9a-z]+$/,it=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ot=/^[0-9a-vA-V]{20}$/,st=/^[A-Za-z0-9]{27}$/,ct=/^[a-zA-Z0-9_-]{21}$/,ut=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dt=/^([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})$/,lt=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)$/,ft=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const pt=/^(?:(?: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])$/,mt=/^(([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}|:))$/,ht=/^((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])$/,gt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,yt=/^[A-Za-z0-9_-]*$/,vt=/^\+[1-9]\d{6,14}$/,At="(?:(?:\\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])))",St=new RegExp(`^${At}$`);function wt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Tt=/^[^A-Z]*$/,kt=/^[^a-z]*$/,_t=de("$ZodCheck",(e,t)=>{var a;e._zod??(e._zod={}),e._zod.def=t,(a=e._zod).onattach??(a.onattach=[])}),Et=de("$ZodCheckMaxLength",(e,t)=>{var a;_t.init(e,t),(a=e._zod.def).when??(a.when=e=>{const t=e.value;return!ye(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const a=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const n=a.value;if(n.length<=t.maximum)return;const r=Oe(n);a.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ct=de("$ZodCheckMinLength",(e,t)=>{var a;_t.init(e,t),(a=e._zod.def).when??(a.when=e=>{const t=e.value;return!ye(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const a=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const n=a.value;if(n.length>=t.minimum)return;const r=Oe(n);a.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zt=de("$ZodCheckLengthEquals",(e,t)=>{var a;_t.init(e,t),(a=e._zod.def).when??(a.when=e=>{const t=e.value;return!ye(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const a=e._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=a=>{const n=a.value,r=n.length;if(r===t.length)return;const i=Oe(n),o=r>t.length;a.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Pt=de("$ZodCheckStringFormat",(e,t)=>{var a,n;_t.init(e,t),e._zod.onattach.push(e=>{const a=e._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(a=e._zod).check??(a.check=a=>{t.pattern.lastIndex=0,t.pattern.test(a.value)||a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ut=de("$ZodCheckRegex",(e,t)=>{Pt.init(e,t),e._zod.check=a=>{t.pattern.lastIndex=0,t.pattern.test(a.value)||a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),$t=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tt),Pt.init(e,t)}),It=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=kt),Pt.init(e,t)}),Mt=de("$ZodCheckIncludes",(e,t)=>{_t.init(e,t);const a=$e(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${a}`:a);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),xt=de("$ZodCheckStartsWith",(e,t)=>{_t.init(e,t);const a=new RegExp(`^${$e(t.prefix)}.*`);t.pattern??(t.pattern=a),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),Nt=de("$ZodCheckEndsWith",(e,t)=>{_t.init(e,t);const a=new RegExp(`.*${$e(t.suffix)}$`);t.pattern??(t.pattern=a),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),Rt=de("$ZodCheckOverwrite",(e,t)=>{_t.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Dt{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),a=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(a)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Ot={major:4,minor:3,patch:6},Ft=de("$ZodType",(e,t)=>{var a;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ot;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const a of t._zod.onattach)a(e);if(0===n.length)(a=e._zod).deferred??(a.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,a)=>{let n,r=xe(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(r)continue;const t=e.issues.length,o=i._zod.check(e);if(o instanceof Promise&&!1===a?.async)throw new le;if(n||o instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await o;e.issues.length!==t&&(r||(r=xe(e,t)))});else{if(e.issues.length===t)continue;r||(r=xe(e,t))}}return n?n.then(()=>e):e},a=(a,r,i)=>{if(xe(a))return a.aborted=!0,a;const o=t(r,n,i);if(o instanceof Promise){if(!1===i.async)throw new le;return o.then(t=>e._zod.parse(t,i))}return e._zod.parse(o,i)};e._zod.run=(r,i)=>{if(i.skipChecks)return e._zod.parse(r,i);if("backward"===i.direction){const t=e._zod.parse({value:r.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>a(e,r,i)):a(t,r,i)}const o=e._zod.parse(r,i);if(o instanceof Promise){if(!1===i.async)throw new le;return o.then(e=>t(e,n,i))}return t(o,n,i)}}Se(e,"~standard",()=>({validate:t=>{try{const a=Je(e,t);return a.success?{value:a.data}:{issues:a.error?.issues}}catch(a){return He(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Bt=de("$ZodString",(e,t)=>{var a;Ft.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(a=e._zod.bag,new RegExp(`^${a?`[\\s\\S]{${a?.minimum??0},${a?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(a,n)=>{if(t.coerce)try{a.value=String(a.value)}catch(n){}return"string"==typeof a.value||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:e}),a}}),Gt=de("$ZodStringFormat",(e,t)=>{Pt.init(e,t),Bt.init(e,t)}),Zt=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=dt),Gt.init(e,t)}),Lt=de("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=lt(e))}else t.pattern??(t.pattern=lt());Gt.init(e,t)}),jt=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ft),Gt.init(e,t)}),Kt=de("$ZodURL",(e,t)=>{Gt.init(e,t),e._zod.check=a=>{try{const n=a.value.trim(),r=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:a.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:a.value,inst:e,continue:!t.abort})),void(t.normalize?a.value=r.href:a.value=n)}catch(n){a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:e,continue:!t.abort})}}}),Jt=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Gt.init(e,t)}),Wt=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ct),Gt.init(e,t)}),Ht=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nt),Gt.init(e,t)}),Vt=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=rt),Gt.init(e,t)}),Yt=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=it),Gt.init(e,t)}),qt=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ot),Gt.init(e,t)}),Xt=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=st),Gt.init(e,t)}),Qt=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=wt({precision:e.precision}),a=["Z"];e.local&&a.push(""),e.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${a.join("|")})`;return new RegExp(`^${At}T(?:${n})$`)}(t)),Gt.init(e,t)}),ea=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=St),Gt.init(e,t)}),ta=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${wt(t)}$`)),Gt.init(e,t)}),aa=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ut),Gt.init(e,t)}),na=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=pt),Gt.init(e,t),e._zod.bag.format="ipv4"}),ra=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=mt),Gt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:e,continue:!t.abort})}}}),ia=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ht),Gt.init(e,t)}),oa=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=gt),Gt.init(e,t),e._zod.check=a=>{const n=a.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const a=Number(t);if(`${a}`!==t)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${e}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:e,continue:!t.abort})}}});function sa(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const ca=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=bt),Gt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=a=>{sa(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:e,continue:!t.abort})}});const ua=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=yt),Gt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=a=>{(function(e){if(!yt.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return sa(t.padEnd(4*Math.ceil(t.length/4),"="))})(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:e,continue:!t.abort})}}),da=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vt),Gt.init(e,t)});const la=de("$ZodJWT",(e,t)=>{Gt.init(e,t),e._zod.check=a=>{(function(e,t=null){try{const a=e.split(".");if(3!==a.length)return!1;const[n]=a;if(!n)return!1;const r=JSON.parse(atob(n));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(a.value,t.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:e,continue:!t.abort})}}),fa=de("$ZodUnknown",(e,t)=>{Ft.init(e,t),e._zod.parse=e=>e}),pa=de("$ZodNever",(e,t)=>{Ft.init(e,t),e._zod.parse=(t,a)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ma(e,t,a){e.issues.length&&t.issues.push(...Ne(a,e.issues)),t.value[a]=e.value}const ha=de("$ZodArray",(e,t)=>{Ft.init(e,t),e._zod.parse=(a,n)=>{const r=a.value;if(!Array.isArray(r))return a.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),a;a.value=Array(r.length);const i=[];for(let e=0;e<r.length;e++){const o=r[e],s=t.element._zod.run({value:o,issues:[]},n);s instanceof Promise?i.push(s.then(t=>ma(t,a,e))):ma(s,a,e)}return i.length?Promise.all(i).then(()=>a):a}});function ga(e,t,a,n,r){if(e.issues.length){if(r&&!(a in n))return;t.issues.push(...Ne(a,e.issues))}void 0===e.value?a in n&&(t.value[a]=void 0):t.value[a]=e.value}function ba(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const a=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ya(e,t,a,n,r,i){const o=[],s=r.keySet,c=r.catchall._zod,u=c.def.type,d="optional"===c.optout;for(const r in t){if(s.has(r))continue;if("never"===u){o.push(r);continue}const i=c.run({value:t[r],issues:[]},n);i instanceof Promise?e.push(i.then(e=>ga(e,a,r,t,d))):ga(i,a,r,t,d)}return o.length&&a.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:i}),e.length?Promise.all(e).then(()=>a):a}const va=de("$ZodObject",(e,t)=>{Ft.init(e,t);const a=Object.getOwnPropertyDescriptor(t,"shape");if(!a?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const a={...e};return Object.defineProperty(t,"shape",{value:a}),a}})}const n=be(()=>ba(t));Se(e._zod,"propValues",()=>{const e=t.shape,a={};for(const t in e){const n=e[t]._zod;if(n.values){a[t]??(a[t]=new Set);for(const e of n.values)a[t].add(e)}}return a});const r=Ee,i=t.catchall;let o;e._zod.parse=(t,a)=>{o??(o=n.value);const s=t.value;if(!r(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};const c=[],u=o.shape;for(const e of o.keys){const n=u[e],r="optional"===n._zod.optout,i=n._zod.run({value:s[e],issues:[]},a);i instanceof Promise?c.push(i.then(a=>ga(a,t,e,s,r))):ga(i,t,e,s,r)}return i?ya(c,s,t,a,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Aa=de("$ZodObjectJIT",(e,t)=>{va.init(e,t);const a=e._zod.parse,n=be(()=>ba(t));let r;const i=Ee,o=!pe.jitless,s=o&&Ce.value,c=t.catchall;let u;e._zod.parse=(d,l)=>{u??(u=n.value);const f=d.value;return i(f)?o&&s&&!1===l?.async&&!0!==l.jitless?(r||(r=(e=>{const t=new Dt(["shape","payload","ctx"]),a=n.value,r=e=>{const t=ke(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let o=0;for(const e of a.keys)i[e]="key_"+o++;t.write("const newResult = {};");for(const n of a.keys){const a=i[n],o=ke(n),s=e[n],c="optional"===s?._zod?.optout;t.write(`const ${a} = ${r(n)};`),c?t.write(`\n if (${a}.issues.length) {\n if (${o} in input) {\n payload.issues = payload.issues.concat(${a}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${o}, ...iss.path] : [${o}]\n })));\n }\n }\n \n if (${a}.value === undefined) {\n if (${o} in input) {\n newResult[${o}] = undefined;\n }\n } else {\n newResult[${o}] = ${a}.value;\n }\n \n `):t.write(`\n if (${a}.issues.length) {\n payload.issues = payload.issues.concat(${a}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${o}, ...iss.path] : [${o}]\n })));\n }\n \n if (${a}.value === undefined) {\n if (${o} in input) {\n newResult[${o}] = undefined;\n }\n } else {\n newResult[${o}] = ${a}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const s=t.compile();return(t,a)=>s(e,t,a)})(t.shape)),d=r(d,l),c?ya([],f,d,l,u,e):d):a(d,l):(d.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),d)}});function Sa(e,t,a,n){for(const a of e)if(0===a.issues.length)return t.value=a.value,t;const r=e.filter(e=>!xe(e));return 1===r.length?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:a,errors:e.map(e=>e.issues.map(e=>De(e,n,me())))}),t)}const wa=de("$ZodUnion",(e,t)=>{Ft.init(e,t),Se(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Se(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Se(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Se(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>ve(e.source)).join("|")})$`)}});const a=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(a)return n(r,i);let o=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)s.push(t),o=!0;else{if(0===t.issues.length)return t;s.push(t)}}return o?Promise.all(s).then(t=>Sa(t,r,e,i)):Sa(s,r,e,i)}}),Ta=de("$ZodIntersection",(e,t)=>{Ft.init(e,t),e._zod.parse=(e,a)=>{const n=e.value,r=t.left._zod.run({value:n,issues:[]},a),i=t.right._zod.run({value:n,issues:[]},a);return r instanceof Promise||i instanceof Promise?Promise.all([r,i]).then(([t,a])=>_a(e,t,a)):_a(e,r,i)}});function ka(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(ze(e)&&ze(t)){const a=Object.keys(t),n=Object.keys(e).filter(e=>-1!==a.indexOf(e)),r={...e,...t};for(const a of n){const n=ka(e[a],t[a]);if(!n.valid)return{valid:!1,mergeErrorPath:[a,...n.mergeErrorPath]};r[a]=n.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let n=0;n<e.length;n++){const r=ka(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};a.push(r.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function _a(e,t,a){const n=new Map;let r;for(const a of t.issues)if("unrecognized_keys"===a.code){r??(r=a);for(const e of a.keys)n.has(e)||n.set(e,{}),n.get(e).l=!0}else e.issues.push(a);for(const t of a.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);const i=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&r&&e.issues.push({...r,keys:i}),xe(e))return e;const o=ka(t.value,a.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Ea=de("$ZodEnum",(e,t)=>{Ft.init(e,t);const a=he(t.entries),n=new Set(a);e._zod.values=n,e._zod.pattern=new RegExp(`^(${a.filter(e=>Ue.has(typeof e)).map(e=>"string"==typeof e?$e(e):e.toString()).join("|")})$`),e._zod.parse=(t,r)=>{const i=t.value;return n.has(i)||t.issues.push({code:"invalid_value",values:a,input:i,inst:e}),t}}),Ca=de("$ZodTransform",(e,t)=>{Ft.init(e,t),e._zod.parse=(a,n)=>{if("backward"===n.direction)throw new fe(e.constructor.name);const r=t.transform(a.value,a);if(n.async){return(r instanceof Promise?r:Promise.resolve(r)).then(e=>(a.value=e,a))}if(r instanceof Promise)throw new le;return a.value=r,a}});function za(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Pa=de("$ZodOptional",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Se(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ve(e.source)})?$`):void 0}),e._zod.parse=(e,a)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(t=>za(t,e.value)):za(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,a)}}),Ua=de("$ZodExactOptional",(e,t)=>{Pa.init(e,t),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,a)=>t.innerType._zod.run(e,a)}),$a=de("$ZodNullable",(e,t)=>{Ft.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${ve(e.source)}|null)$`):void 0}),Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,a)=>null===e.value?e:t.innerType._zod.run(e,a)}),Ia=de("$ZodDefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,a)=>{if("backward"===a.direction)return t.innerType._zod.run(e,a);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(e=>Ma(e,t)):Ma(n,t)}});function Ma(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const xa=de("$ZodPrefault",(e,t)=>{Ft.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,a)=>("backward"===a.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,a))}),Na=de("$ZodNonOptional",(e,t)=>{Ft.init(e,t),Se(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(a,n)=>{const r=t.innerType._zod.run(a,n);return r instanceof Promise?r.then(t=>Ra(t,e)):Ra(r,e)}});function Ra(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Da=de("$ZodCatch",(e,t)=>{Ft.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,a)=>{if("backward"===a.direction)return t.innerType._zod.run(e,a);const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>De(e,a,me()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>De(e,a,me()))},input:e.value}),e.issues=[]),e)}}),Oa=de("$ZodPipe",(e,t)=>{Ft.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),Se(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,a)=>{if("backward"===a.direction){const n=t.out._zod.run(e,a);return n instanceof Promise?n.then(e=>Fa(e,t.in,a)):Fa(n,t.in,a)}const n=t.in._zod.run(e,a);return n instanceof Promise?n.then(e=>Fa(e,t.out,a)):Fa(n,t.out,a)}});function Fa(e,t,a){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},a)}const Ba=de("$ZodReadonly",(e,t)=>{Ft.init(e,t),Se(e._zod,"propValues",()=>t.innerType._zod.propValues),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"optin",()=>t.innerType?._zod?.optin),Se(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,a)=>{if("backward"===a.direction)return t.innerType._zod.run(e,a);const n=t.innerType._zod.run(e,a);return n instanceof Promise?n.then(Ga):Ga(n)}});function Ga(e){return e.value=Object.freeze(e.value),e}const Za=de("$ZodCustom",(e,t)=>{_t.init(e,t),Ft.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=a=>{const n=a.value,r=t.fn(n);if(r instanceof Promise)return r.then(t=>La(t,a,n,e));La(r,a,n,e)}});function La(e,t,a,n){if(!e){const e={code:"custom",input:a,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(Fe(e))}}var ja;class Ka{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const a=t[0];return this._map.set(e,a),a&&"object"==typeof a&&"id"in a&&this._idmap.set(a.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const a={...this.get(t)??{}};delete a.id;const n={...a,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(ja=globalThis).__zod_globalRegistry??(ja.__zod_globalRegistry=new Ka);const Ja=globalThis.__zod_globalRegistry;function Wa(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Me(t)})}function Ha(e,t){return new Et({check:"max_length",...Me(t),maximum:e})}function Va(e,t){return new Ct({check:"min_length",...Me(t),minimum:e})}function Ya(e,t){return new zt({check:"length_equals",...Me(t),length:e})}function qa(e){return new Rt({check:"overwrite",tx:e})}function Xa(e){const t=function(e,t){const a=new _t({check:"custom",...Me(t)});return a._zod.check=e,a}(a=>(a.addIssue=e=>{if("string"==typeof e)a.issues.push(Fe(e,a.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=a.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),a.issues.push(Fe(n))}},e(a.value,a)));return t}function Qa(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ja,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function en(e,t,a={path:[],schemaPath:[]}){var n;const r=e._zod.def,i=t.seen.get(e);if(i){i.count++;return a.schemaPath.includes(e)&&(i.cycle=a.path),i.schema}const o={schema:{},count:1,cycle:void 0,path:a.path};t.seen.set(e,o);const s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{const n={...a,schemaPath:[...a.schemaPath,e],path:a.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,n);else{const a=o.schema,i=t.processors[r.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);i(e,t,a,n)}const i=e._zod.parent;i&&(o.ref||(o.ref=i),en(i,t,n),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(o.schema,c),"input"===t.io&&nn(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault;return t.seen.get(e).schema}function tn(e,t){const a=e.seen.get(t);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const t of e.seen.entries()){const a=e.metadataRegistry.get(t[0])?.id;if(a){const e=n.get(a);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,t[0])}}const r=t=>{if(t[1].schema.$ref)return;const n=t[1],{ref:r,defId:i}=(t=>{const n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const a=e.external.registry.get(t[0])?.id,r=e.external.uri??(e=>e);if(a)return{ref:r(a)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${r("__shared")}#/${n}/${i}`}}if(t[1]===a)return{ref:"#"};const r=`#/${n}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:r+i}})(t);n.def={...n.schema},i&&(n.defId=i);const o=n.schema;for(const e in o)delete o[e];o.$ref=r};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const a of e.seen.entries()){const n=a[1];if(t===a[0]){r(a);continue}if(e.external){const n=e.external.registry.get(a[0])?.id;if(t!==a[0]&&n){r(a);continue}}const i=e.metadataRegistry.get(a[0])?.id;i?r(a):(n.cycle||n.count>1&&"ref"===e.reused)&&r(a)}}function an(e,t){const a=e.seen.get(t);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=t=>{const a=e.seen.get(t);if(null===a.ref)return;const r=a.def??a.schema,i={...r},o=a.ref;if(a.ref=null,o){n(o);const a=e.seen.get(o),s=a.schema;!s.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(r,s):(r.allOf=r.allOf??[],r.allOf.push(s)),Object.assign(r,i);if(t._zod.parent===o)for(const e in r)"$ref"!==e&&"allOf"!==e&&(e in i||delete r[e]);if(s.$ref&&a.def)for(const e in r)"$ref"!==e&&"allOf"!==e&&e in a.def&&JSON.stringify(r[e])===JSON.stringify(a.def[e])&&delete r[e]}const s=t._zod.parent;if(s&&s!==o){n(s);const t=e.seen.get(s);if(t?.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(const e in r)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:a.path??[]})};for(const t of[...e.seen.entries()].reverse())n(t[0]);const r={};if("draft-2020-12"===e.target?r.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?r.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(a)}Object.assign(r,a.def??a.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?r.$defs=i:r.definitions=i);try{const a=JSON.parse(JSON.stringify(r));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:rn(t,"input",e.processors),output:rn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(e){throw new Error("Error converting schema to JSON.")}}function nn(e,t){const a=t??{seen:new Set};if(a.seen.has(e))return!1;a.seen.add(e);const n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return nn(n.element,a);if("set"===n.type)return nn(n.valueType,a);if("lazy"===n.type)return nn(n.getter(),a);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return nn(n.innerType,a);if("intersection"===n.type)return nn(n.left,a)||nn(n.right,a);if("record"===n.type||"map"===n.type)return nn(n.keyType,a)||nn(n.valueType,a);if("pipe"===n.type)return nn(n.in,a)||nn(n.out,a);if("object"===n.type){for(const e in n.shape)if(nn(n.shape[e],a))return!0;return!1}if("union"===n.type){for(const e of n.options)if(nn(e,a))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(nn(e,a))return!0;return!(!n.rest||!nn(n.rest,a))}return!1}const rn=(e,t,a={})=>n=>{const{libraryOptions:r,target:i}=n??{},o=Qa({...r??{},target:i,io:t,processors:a});return en(e,o),tn(o,e),an(o,e)},on={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sn=(e,t,a,n)=>{const r=e._zod.def;en(r.innerType,t,n);t.seen.get(e).ref=r.innerType},cn=de("ZodISODateTime",(e,t)=>{Qt.init(e,t),Mn.init(e,t)});function un(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Me(t)})}(cn,e)}const dn=de("ZodISODate",(e,t)=>{ea.init(e,t),Mn.init(e,t)});function ln(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Me(t)})}(dn,e)}const fn=de("ZodISOTime",(e,t)=>{ta.init(e,t),Mn.init(e,t)});function pn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Me(t)})}(fn,e)}const mn=de("ZodISODuration",(e,t)=>{aa.init(e,t),Mn.init(e,t)});function hn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Me(t)})}(mn,e)}const gn=de("ZodError",(e,t)=>{Ge.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const a={_errors:[]},n=e=>{for(const r of e.issues)if("invalid_union"===r.code&&r.errors.length)r.errors.map(e=>n({issues:e}));else if("invalid_key"===r.code)n({issues:r.issues});else if("invalid_element"===r.code)n({issues:r.issues});else if(0===r.path.length)a._errors.push(t(r));else{let e=a,n=0;for(;n<r.path.length;){const a=r.path[n];n===r.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(r))):e[a]=e[a]||{_errors:[]},e=e[a],n++}}};return n(e),a}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const a={},n=[];for(const r of e.issues)r.path.length>0?(a[r.path[0]]=a[r.path[0]]||[],a[r.path[0]].push(t(r))):n.push(t(r));return{formErrors:n,fieldErrors:a}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ge,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ge,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),bn=Le(gn),yn=je(gn),vn=Ke(gn),An=We(gn),Sn=Ve(gn),wn=Ye(gn),Tn=qe(gn),kn=Xe(gn),_n=Qe(gn),En=et(gn),Cn=tt(gn),zn=at(gn),Pn=de("ZodType",(e,t)=>(Ft.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:rn(e,"input"),output:rn(e,"output")}}),e.toJSONSchema=((e,t={})=>a=>{const n=Qa({...a,processors:t});return en(e,n),tn(n,e),an(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...a)=>e.clone(Te(t,{checks:[...t.checks??[],...a.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,a)=>Ie(e,t,a),e.brand=()=>e,e.register=(t,a)=>(t.add(e,a),e),e.parse=(t,a)=>bn(e,t,a,{callee:e.parse}),e.safeParse=(t,a)=>vn(e,t,a),e.parseAsync=async(t,a)=>yn(e,t,a,{callee:e.parseAsync}),e.safeParseAsync=async(t,a)=>An(e,t,a),e.spa=e.safeParseAsync,e.encode=(t,a)=>Sn(e,t,a),e.decode=(t,a)=>wn(e,t,a),e.encodeAsync=async(t,a)=>Tn(e,t,a),e.decodeAsync=async(t,a)=>kn(e,t,a),e.safeEncode=(t,a)=>_n(e,t,a),e.safeDecode=(t,a)=>En(e,t,a),e.safeEncodeAsync=async(t,a)=>Cn(e,t,a),e.safeDecodeAsync=async(t,a)=>zn(e,t,a),e.refine=(t,a)=>e.check(function(e,t={}){return function(e,t,a){return new e({type:"custom",check:"custom",fn:t,...Me(a)})}(Sr,e,t)}(t,a)),e.superRefine=t=>e.check(Xa(t)),e.overwrite=t=>e.check(qa(t)),e.optional=()=>dr(e),e.exactOptional=()=>new lr({type:"optional",innerType:e}),e.nullable=()=>pr(e),e.nullish=()=>dr(pr(e)),e.nonoptional=t=>function(e,t){return new gr({type:"nonoptional",innerType:e,...Me(t)})}(e,t),e.array=()=>{return function(e,t,a){return new e({type:"array",element:t,...Me(a)})}(nr,e,t);var t},e.or=t=>{return new ir({type:"union",options:[e,t],...Me(a)});var a},e.and=t=>new or({type:"intersection",left:e,right:t}),e.transform=t=>vr(e,new cr({type:"transform",transform:t})),e.default=t=>{return a=t,new mr({type:"default",innerType:e,get defaultValue(){return"function"==typeof a?a():Pe(a)}});var a},e.prefault=t=>{return a=t,new hr({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof a?a():Pe(a)}});var a},e.catch=t=>{return new br({type:"catch",innerType:e,catchValue:"function"==typeof(a=t)?a:()=>a});var a},e.pipe=t=>vr(e,t),e.readonly=()=>new Ar({type:"readonly",innerType:e}),e.describe=t=>{const a=e.clone();return Ja.add(a,{description:t}),a},Object.defineProperty(e,"description",{get:()=>Ja.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Ja.get(e);const a=e.clone();return Ja.add(a,t[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Un=de("_ZodString",(e,t)=>{Bt.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a)=>{const n=a;n.type="string";const{minimum:r,maximum:i,format:o,patterns:s,contentEncoding:c}=e._zod.bag;if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),o&&(n.format=on[o]??o,""===n.format&&delete n.format,"time"===o&&delete n.format),c&&(n.contentEncoding=c),s&&s.size>0){const e=[...s];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,a);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Ut({check:"string_format",format:"regex",...Me(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Mt({check:"string_format",format:"includes",...Me(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new xt({check:"string_format",format:"starts_with",...Me(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Nt({check:"string_format",format:"ends_with",...Me(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Va(...t)),e.max=(...t)=>e.check(Ha(...t)),e.length=(...t)=>e.check(Ya(...t)),e.nonempty=(...t)=>e.check(Va(1,...t)),e.lowercase=t=>e.check(function(e){return new $t({check:"string_format",format:"lowercase",...Me(e)})}(t)),e.uppercase=t=>e.check(function(e){return new It({check:"string_format",format:"uppercase",...Me(e)})}(t)),e.trim=()=>e.check(qa(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return qa(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(qa(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(qa(e=>e.toUpperCase())),e.slugify=()=>e.check(qa(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),$n=de("ZodString",(e,t)=>{Bt.init(e,t),Un.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Me(t)})}(xn,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Me(t)})}(Dn,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Me(t)})}(Xn,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Me(t)})}(On,t)),e.guid=t=>e.check(Wa(Nn,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Me(t)})}(Rn,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Me(t)})}(Rn,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Me(t)})}(Rn,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Me(t)})}(Rn,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Me(t)})}(Fn,t)),e.guid=t=>e.check(Wa(Nn,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Me(t)})}(Bn,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Me(t)})}(Gn,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Me(t)})}(Zn,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Me(t)})}(Vn,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Me(t)})}(Yn,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Me(t)})}(Ln,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Me(t)})}(jn,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Me(t)})}(Kn,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Me(t)})}(Jn,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Me(t)})}(Wn,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Me(t)})}(Hn,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Me(t)})}(qn,t)),e.datetime=t=>e.check(un(t)),e.date=t=>e.check(ln(t)),e.time=t=>e.check(pn(t)),e.duration=t=>e.check(hn(t))});function In(e){return function(e,t){return new e({type:"string",...Me(t)})}($n,e)}const Mn=de("ZodStringFormat",(e,t)=>{Gt.init(e,t),Un.init(e,t)}),xn=de("ZodEmail",(e,t)=>{jt.init(e,t),Mn.init(e,t)}),Nn=de("ZodGUID",(e,t)=>{Zt.init(e,t),Mn.init(e,t)}),Rn=de("ZodUUID",(e,t)=>{Lt.init(e,t),Mn.init(e,t)}),Dn=de("ZodURL",(e,t)=>{Kt.init(e,t),Mn.init(e,t)}),On=de("ZodEmoji",(e,t)=>{Jt.init(e,t),Mn.init(e,t)}),Fn=de("ZodNanoID",(e,t)=>{Wt.init(e,t),Mn.init(e,t)}),Bn=de("ZodCUID",(e,t)=>{Ht.init(e,t),Mn.init(e,t)}),Gn=de("ZodCUID2",(e,t)=>{Vt.init(e,t),Mn.init(e,t)}),Zn=de("ZodULID",(e,t)=>{Yt.init(e,t),Mn.init(e,t)}),Ln=de("ZodXID",(e,t)=>{qt.init(e,t),Mn.init(e,t)}),jn=de("ZodKSUID",(e,t)=>{Xt.init(e,t),Mn.init(e,t)}),Kn=de("ZodIPv4",(e,t)=>{na.init(e,t),Mn.init(e,t)}),Jn=de("ZodIPv6",(e,t)=>{ra.init(e,t),Mn.init(e,t)}),Wn=de("ZodCIDRv4",(e,t)=>{ia.init(e,t),Mn.init(e,t)}),Hn=de("ZodCIDRv6",(e,t)=>{oa.init(e,t),Mn.init(e,t)}),Vn=de("ZodBase64",(e,t)=>{ca.init(e,t),Mn.init(e,t)}),Yn=de("ZodBase64URL",(e,t)=>{ua.init(e,t),Mn.init(e,t)}),qn=de("ZodE164",(e,t)=>{da.init(e,t),Mn.init(e,t)}),Xn=de("ZodJWT",(e,t)=>{la.init(e,t),Mn.init(e,t)}),Qn=de("ZodUnknown",(e,t)=>{fa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(e,t,a)=>{}});function er(){return new Qn({type:"unknown"})}const tr=de("ZodNever",(e,t)=>{pa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(e,t,a)=>((e,t,a)=>{a.not={}})(0,0,t)});function ar(e){return function(e,t){return new e({type:"never",...Me(t)})}(tr,e)}const nr=de("ZodArray",(e,t)=>{ha.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=a,i=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;"number"==typeof o&&(r.minItems=o),"number"==typeof s&&(r.maxItems=s),r.type="array",r.items=en(i.element,t,{...n,path:[...n.path,"items"]})})(e,t,a,n),e.element=t.element,e.min=(t,a)=>e.check(Va(t,a)),e.nonempty=t=>e.check(Va(1,t)),e.max=(t,a)=>e.check(Ha(t,a)),e.length=(t,a)=>e.check(Ya(t,a)),e.unwrap=()=>e.element});const rr=de("ZodObject",(e,t)=>{Aa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=a,i=e._zod.def;r.type="object",r.properties={};const o=i.shape;for(const e in o)r.properties[e]=en(o[e],t,{...n,path:[...n.path,"properties",e]});const s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{const a=i.shape[e]._zod;return"input"===t.io?void 0===a.optin:void 0===a.optout}));c.size>0&&(r.required=Array.from(c)),"never"===i.catchall?._zod.def.type?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=en(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,a,n),Se(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const a=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new sr({type:"enum",entries:a,...Me(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:er()}),e.loose=()=>e.clone({...e._zod.def,catchall:er()}),e.strict=()=>e.clone({...e._zod.def,catchall:ar()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to extend: expected a plain object");const a=e._zod.def.checks;if(a&&a.length>0){const a=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(a,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Te(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return we(this,"shape",a),a}});return Ie(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!ze(t))throw new Error("Invalid input to safeExtend: expected a plain object");const a=Te(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return we(this,"shape",a),a}});return Ie(e,a)}(e,t),e.merge=t=>function(e,t){const a=Te(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return we(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:[]});return Ie(e,a)}(e,t),e.pick=t=>function(e,t){const a=e._zod.def,n=a.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Ie(e,Te(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in a.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=a.shape[n])}return we(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const a=e._zod.def,n=a.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=Te(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in a.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return we(this,"shape",n),n},checks:[]});return Ie(e,r)}(e,t),e.partial=(...t)=>function(e,t,a){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Te(t._zod.def,{get shape(){const n=t._zod.def.shape,r={...n};if(a)for(const t in a){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);a[t]&&(r[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)r[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return we(this,"shape",r),r},checks:[]});return Ie(t,r)}(ur,e,t[0]),e.required=(...t)=>function(e,t,a){const n=Te(t._zod.def,{get shape(){const n=t._zod.def.shape,r={...n};if(a)for(const t in a){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);a[t]&&(r[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)r[t]=new e({type:"nonoptional",innerType:n[t]});return we(this,"shape",r),r}});return Ie(t,n)}(gr,e,t[0])});const ir=de("ZodUnion",(e,t)=>{wa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def,i=!1===r.inclusive,o=r.options.map((e,a)=>en(e,t,{...n,path:[...n.path,i?"oneOf":"anyOf",a]}));i?a.oneOf=o:a.anyOf=o})(e,t,a,n),e.options=t.options});const or=de("ZodIntersection",(e,t)=>{Ta.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def,i=en(r.left,t,{...n,path:[...n.path,"allOf",0]}),o=en(r.right,t,{...n,path:[...n.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length,c=[...s(i)?i.allOf:[i],...s(o)?o.allOf:[o]];a.allOf=c})(e,t,a,n)});const sr=de("ZodEnum",(e,t)=>{Ea.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a)=>{const n=he(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(a.type="number"),n.every(e=>"string"==typeof e)&&(a.type="string"),a.enum=n})(e,0,a),e.enum=t.entries,e.options=Object.values(t.entries);const a=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const r={};for(const n of e){if(!a.has(n))throw new Error(`Key ${n} not found in enum`);r[n]=t.entries[n]}return new sr({...t,checks:[],...Me(n),entries:r})},e.exclude=(e,n)=>{const r={...t.entries};for(const t of e){if(!a.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new sr({...t,checks:[],...Me(n),entries:r})}});const cr=de("ZodTransform",(e,t)=>{Ca.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(e,t,a)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(a,n)=>{if("backward"===n.direction)throw new fe(e.constructor.name);a.addIssue=n=>{if("string"==typeof n)a.issues.push(Fe(n,a.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=a.value),t.inst??(t.inst=e),a.issues.push(Fe(t))}};const r=t.transform(a.value,a);return r instanceof Promise?r.then(e=>(a.value=e,a)):(a.value=r,a)}});const ur=de("ZodOptional",(e,t)=>{Pa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>sn(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function dr(e){return new ur({type:"optional",innerType:e})}const lr=de("ZodExactOptional",(e,t)=>{Ua.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>sn(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const fr=de("ZodNullable",(e,t)=>{$a.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def,i=en(r.innerType,t,n),o=t.seen.get(e);"openapi-3.0"===t.target?(o.ref=r.innerType,a.nullable=!0):a.anyOf=[i,{type:"null"}]})(e,t,a,n),e.unwrap=()=>e._zod.def.innerType});function pr(e){return new fr({type:"nullable",innerType:e})}const mr=de("ZodDefault",(e,t)=>{Ia.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def;en(r.innerType,t,n),t.seen.get(e).ref=r.innerType,a.default=JSON.parse(JSON.stringify(r.defaultValue))})(e,t,a,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const hr=de("ZodPrefault",(e,t)=>{xa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def;en(r.innerType,t,n),t.seen.get(e).ref=r.innerType,"input"===t.io&&(a._prefault=JSON.parse(JSON.stringify(r.defaultValue)))})(e,t,a,n),e.unwrap=()=>e._zod.def.innerType});const gr=de("ZodNonOptional",(e,t)=>{Na.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def;en(r.innerType,t,n),t.seen.get(e).ref=r.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const br=de("ZodCatch",(e,t)=>{Da.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def;let i;en(r.innerType,t,n),t.seen.get(e).ref=r.innerType;try{i=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=i})(e,t,a,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const yr=de("ZodPipe",(e,t)=>{Oa.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def,i="input"===t.io?"transform"===r.in._zod.def.type?r.out:r.in:r.out;en(i,t,n),t.seen.get(e).ref=i})(e,t,0,n),e.in=t.in,e.out=t.out});function vr(e,t){return new yr({type:"pipe",in:e,out:t})}const Ar=de("ZodReadonly",(e,t)=>{Ba.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(t,a,n)=>((e,t,a,n)=>{const r=e._zod.def;en(r.innerType,t,n),t.seen.get(e).ref=r.innerType,a.readOnly=!0})(e,t,a,n),e.unwrap=()=>e._zod.def.innerType});const Sr=de("ZodCustom",(e,t)=>{Za.init(e,t),Pn.init(e,t),e._zod.processJSONSchema=(e,t,a)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const wr=function(e,t){const a={type:"object",shape:e??{},...Me(t)};return new rr(a)}({name:In().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:In().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")});var Tr;function kr(e){const{serverUrl:t,orgId:a,version:n="v1",getSessionId:r,timeout:i,maxRetries:o,debug:s,headers:c,onError:u,fetch:d}=e;if(!t)throw new Error("BuildBase: serverUrl is required");if(!a)throw new Error("BuildBase: orgId is required");const l={...void 0!==i&&{timeout:i},...void 0!==o&&{maxRetries:o},...void 0!==s&&{debug:s},...c&&{headers:c},...u&&{onError:u},...d&&{fetch:d}},f=e=>{const r={serverUrl:t,version:n,orgId:a,sessionId:e,...l};return{workspace:new v(r),user:new y(r),settings:new b(r),push:new g(r)}},p=new v({serverUrl:t,version:n,orgId:a,...l}),m=e=>({workspace:{list:async()=>(await e()).workspace.getWorkspaces(),get:async t=>(await e()).workspace.getWorkspace(t),create:async t=>(await e()).workspace.createWorkspace(t),update:async(t,a)=>(await e()).workspace.updateWorkspace(t,a),delete:async t=>(await e()).workspace.deleteWorkspace(t)},users:{list:async t=>(await e()).workspace.getWorkspaceUsers(t),invite:async(t,a,n)=>(await e()).workspace.addUser(t,{email:a,role:n}),remove:async(t,a)=>(await e()).workspace.removeUser(t,a),updateRole:async(t,a,n)=>(await e()).workspace.updateUser(t,a,{role:n}),getProfile:async()=>(await e()).workspace.getProfile(),updateProfile:async t=>(await e()).workspace.updateUserProfile(t)},subscription:{get:async t=>(await e()).workspace.getCurrentSubscription(t),checkout:async(t,a)=>(await e()).workspace.createCheckoutSession(t,a),update:async(t,a)=>(await e()).workspace.updateSubscription(t,a),cancel:async t=>(await e()).workspace.cancelSubscriptionAtPeriodEnd(t),resume:async t=>(await e()).workspace.resumeSubscription(t),getBillingPortalUrl:async(t,a)=>(await e()).workspace.createBillingPortalSession(t,a)},plans:{getGroup:async t=>(await e()).workspace.getPlanGroup(t),getVersions:async t=>(await e()).workspace.getPlanGroupVersions(t),getPublic:e=>p.getPublicPlans(e),getVersion:e=>p.getPlanGroupVersion(e)},invoices:{list:async(t,a,n)=>(await e()).workspace.listInvoices(t,a,n),get:async(t,a)=>(await e()).workspace.getInvoice(t,a)},usage:{record:async(t,a)=>(await e()).workspace.recordUsage(t,a),getQuota:async(t,a)=>(await e()).workspace.getQuotaUsageStatus(t,a),getAll:async t=>(await e()).workspace.getAllQuotaUsage(t),getLogs:async(t,a)=>(await e()).workspace.getUsageLogs(t,a)},settings:{get:async()=>(await e()).settings.getSettings()},features:{list:async()=>(await e()).workspace.getFeatures(),update:async(t,a,n)=>(await e()).workspace.updateFeature(t,a,n)}}),h=m(async()=>f(await(async()=>{if(!r)throw new Error("BuildBase: getSessionId callback is required for authenticated calls. Pass it in BuildBase({ getSessionId: ... }) or use withSession(id) / client.forSession(id).");const e=await r();if(!e)throw new Error("BuildBase: Not authenticated (getSessionId returned null)");return e})()));return{auth:async()=>{if(!r)return null;const e=await r();return e?{sessionId:e}:null},withSession:e=>{const t=f(e);return m(async()=>t)},client:{forSession:f},...h}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(Tr||(Tr={}));export{A as ApiVersion,p as AuthApi,Tr as AuthStatus,f as BaseApi,h as BetaForm,kr as BuildBase,C as CURRENCY_DISPLAY,z as CURRENCY_FLAG,S as EventEmitter,$ as PLAN_CURRENCY_CODES,I as PLAN_CURRENCY_OPTIONS,te as PUSH_SERVICE_WORKER_SCRIPT,g as PushApi,b as SettingsApi,y as UserApi,v as WorkspaceApi,wr as betaFormSchema,Y as calculateBillableSeats,q as calculateSeatOverageCents,X as calculateTotalSubscriptionCents,re as countries,oe as currencies,kr as default,w as eventEmitter,M as formatCents,x as formatOverageRate,N as formatOverageRateWithLabel,D as formatQuotaIncludedOverage,F as formatQuotaWithPrice,K as getAvailableCurrenciesFromPlans,G as getBasePriceCents,W as getBillingIntervalAndCurrencyFromPriceId,P as getCurrencyFlag,U as getCurrencySymbol,j as getDisplayCurrency,V as getPerSeatPriceCents,B as getPricingVariant,O as getQuotaDisplayValue,J as getQuotaDisplayWithVariant,L as getQuotaOverageCents,R as getQuotaUnitLabelFromName,H as getSeatPricing,Z as getStripePriceIdForInterval,E as invalidateQuotaUsage,k as invalidateSubscription,ce as languages,Q as resolveMaxUsers,ue as timezones,ee as validateInvite};