PageSourceSearch

https://bloom.diy/_next/static/chunks/7947-4a63ad920b07cc23.js

js bloom.diy collected 2026-09-25 19:16:53 UTC 161,534 bytes, 94 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7947],{14284:(e,t,r)=>{r.d(t,{Mr:()=>i});var n=class extends Error{constructor(e,t){super(e),this.name="SendError",this.events=t}},i=class{constructor(e){if(this.queue=[],this.flushTimer=null,this.isShutdown=!1,this.flushPromise=null,this.unloadHandler=null,this.visibilityChangeHandler=null,!e.writeKey)throw Error("writeKey is required");this._writeKey=e.writeKey,this.config={writeKey:e.writeKey,endpoint:e.endpoint||"https://i.klime.com",flushInterval:e.flushInterval??2e3,maxBatchSize:Math.min(e.maxBatchSize??20,100),maxQueueSize:e.maxQueueSize??1e3,retryMaxAttempts:e.retryMaxAttempts??5,retryInitialDelay:e.retryInitialDelay??1e3,autoFlushOnUnload:e.autoFlushOnUnload??!0,logger:e.logger??{debug:(e,...t)=>console.debug(`[Klime] ${e}`,...t),info:(e,...t)=>console.info(`[Klime] ${e}`,...t),warn:(e,...t)=>console.warn(`[Klime] ${e}`,...t),error:(e,...t)=>console.error(`[Klime] ${e}`,...t)},onError:e.onError,onSuccess:e.onSuccess},this.config.autoFlushOnUnload&&"undefined"!=typeof window&&(this.unloadHandler=()=>{this.flush()},window.addEventListener("beforeunload",this.unloadHandler),window.addEventListener("pagehide",this.unloadHandler),this.visibilityChangeHandler=()=>{"undefined"!=typeof document&&"hidden"===document.visibilityState&&this.flush()},document.addEventListener("visibilitychange",this.visibilityChangeHandler)),this.scheduleFlush()}track(e,t,r){if(this.isShutdown)return;let n={type:"track",messageId:this.generateUUID(),event:e,timestamp:this.generateTimestamp(),properties:t||{},context:this.getContext()};r?.userId&&(n.userId=r.userId),r?.groupId&&(n.groupId=r.groupId),this.enqueue(n)}identify(e,t){if(this.isShutdown)return;let r={type:"identify",messageId:this.generateUUID(),userId:e,timestamp:this.generateTimestamp(),traits:t||{},context:this.getContext()};this.enqueue(r)}group(e,t,r){if(this.isShutdown)return;let n={type:"group",messageId:this.generateUUID(),groupId:e,timestamp:this.generateTimestamp(),traits:t||{},context:this.getContext()};r?.userId&&(n.userId=r.userId),this.enqueue(n)}async trackSync(e,t,r){if(this.isShutdown)throw new n("Client is shutdown",[]);let i={type:"track",messageId:this.generateUUID(),event:e,timestamp:this.generateTimestamp(),properties:t||{},context:this.getContext()};return r?.userId&&(i.userId=r.userId),r?.groupId&&(i.groupId=r.groupId),this.sendSync([i])}async identifySync(e,t){if(this.isShutdown)throw new n("Client is shutdown",[]);let r={type:"identify",messageId:this.generateUUID(),userId:e,timestamp:this.generateTimestamp(),traits:t||{},context:this.getContext()};return this.sendSync([r])}async groupSync(e,t,r){if(this.isShutdown)throw new n("Client is shutdown",[]);let i={type:"group",messageId:this.generateUUID(),groupId:e,timestamp:this.generateTimestamp(),traits:t||{},context:this.getContext()};return r?.userId&&(i.userId=r.userId),this.sendSync([i])}getQueueSize(){return this.queue.length}async flush(){if(this.flushPromise)return this.flushPromise;this.flushPromise=this.doFlush();try{await this.flushPromise}finally{this.flushPromise=null}}async shutdown(){this.isShutdown||(this.isShutdown=!0,this.unloadHandler&&"undefined"!=typeof window&&(window.removeEventListener("beforeunload",this.unloadHandler),window.removeEventListener("pagehide",this.unloadHandler)),this.visibilityChangeHandler&&"undefined"!=typeof document&&document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null),await this.flush())}enqueue(e){let t=this.estimateEventSize(e);if(t>204800)return void this.config.logger.warn(`Event size (${t} bytes) exceeds 204800 bytes limit`);if(this.queue.length>=this.config.maxQueueSize){let e=this.queue.shift();this.config.logger.warn(`Queue full, dropping oldest event: ${e?.type}`)}this.queue.push(e),this.config.logger.debug(`Enqueued ${e.type} event, queue size: ${this.queue.length}`),this.queue.length>=this.config.maxBatchSize&&this.flush()}async doFlush(){if(0!==this.queue.length){for(this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null);this.queue.length>0;){let e=this.extractBatch();if(0===e.length)break;await this.sendBatch(e)}this.scheduleFlush()}}extractBatch(){let e=[],t=0;for(;this.queue.length>0&&e.length<100;){let r=this.queue[0],n=this.estimateEventSize(r);if(t+n>0xa00000)break;e.push(this.queue.shift()),t+=n}return e}async sendBatch(e){if(0===e.length)return;this.config.logger.debug(`Sending batch of ${e.length} events`);let t=await this.doSend(e);if(null===t){let t=Error(`Failed to send batch of ${e.length} events after retries`);this.invokeOnError(t,e)}else t.failed>0&&t.errors?this.config.logger.warn(`Batch partially failed. Accepted: ${t.accepted}, Failed: ${t.failed}`,t.errors):this.config.logger.debug(`Batch sent successfully. Accepted: ${t.accepted}`),this.invokeOnSuccess(t)}async sendSync(e){this.config.logger.debug(`Sending ${e.length} events synchronously`);let t=await this.doSend(e);if(null===t)throw new n(`Failed to send ${e.length} events after retries`,e);return t}
1async doSend(e){let t=`${this.config.endpoint}/v1/batch`,r=JSON.stringify({batch:e}),n=r.length<=65536,i=0,s=this.config.retryInitialDelay;for(;i<this.config.retryMaxAttempts;)try{let e=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.writeKey}`},body:r,keepalive:n}),a=await e.json();if(e.ok)return a;if(400===e.status||401===e.status)return this.config.logger.error(`Permanent error (${e.status}):`,a),null;if(429===e.status||503===e.status){let t=e.headers.get("Retry-After");if(t&&(s=1e3*parseInt(t,10)),++i<this.config.retryMaxAttempts){this.config.logger.debug(`Retrying after ${s}ms (attempt ${i})`),await this.sleep(s),s=Math.min(2*s,16e3);continue}}++i<this.config.retryMaxAttempts&&(this.config.logger.debug(`Retrying after ${s}ms (attempt ${i})`),await this.sleep(s),s=Math.min(2*s,16e3))}catch(e){++i<this.config.retryMaxAttempts?(this.config.logger.debug(`Retrying after ${s}ms (attempt ${i})`),await this.sleep(s),s=Math.min(2*s,16e3)):this.config.logger.error("Failed to send batch after retries:",e)}return null}invokeOnError(e,t){if(this.config.onError)try{this.config.onError(e,t)}catch(e){this.config.logger.error("Error in onError callback:",e)}}invokeOnSuccess(e){if(this.config.onSuccess)try{this.config.onSuccess(e)}catch(e){this.config.logger.error("Error in onSuccess callback:",e)}}scheduleFlush(){this.isShutdown||this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},this.config.flushInterval))}generateUUID(){return"undefined"!=typeof crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}generateTimestamp(){return new Date().toISOString()}getContext(){let e={library:{name:"js-sdk",version:"1.1.0"}};if("undefined"!=typeof navigator&&(navigator.userAgent&&(e.userAgent=navigator.userAgent),navigator.language&&(e.locale=navigator.language)),"undefined"!=typeof Intl&&Intl.DateTimeFormat)try{let t=Intl.DateTimeFormat().resolvedOptions().timeZone;t&&(e.timezone=t)}catch(e){}return e}estimateEventSize(e){try{return JSON.stringify(e).length}catch{return 500}}sleep(e){return new Promise(t=>setTimeout(t,e))}}},17896:(e,t,r)=>{r.d(t,{Od:()=>l,Rb:()=>o,Tj:()=>a,bp:()=>h,wG:()=>c,xL:()=>u});var n=r(65726),i=r(21758),s=r(33821);let a=e=>(t,r,i,a)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new n.GT;if(l.issues.length){let t=new(a?.Err??e)(l.issues.map(e=>s.iR(e,o,n.$W())));throw s.gx(t,a?.callee),t}return l.value};i.Kd;let o=e=>async(t,r,i,a)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise&&(l=await l),l.issues.length){let t=new(a?.Err??e)(l.issues.map(e=>s.iR(e,o,n.$W())));throw s.gx(t,a?.callee),t}return l.value};i.Kd;let l=e=>(t,r,a)=>{let o=a?{...a,async:!1}:{async:!1},l=t._zod.run({value:r,issues:[]},o);if(l instanceof Promise)throw new n.GT;return l.issues.length?{success:!1,error:new(e??i.a$)(l.issues.map(e=>s.iR(e,o,n.$W())))}:{success:!0,data:l.value}},u=l(i.Kd),c=e=>async(t,r,i)=>{let a=i?Object.assign(i,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},a);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>s.iR(e,a,n.$W())))}:{success:!0,data:o.value}},h=c(i.Kd)},21758:(e,t,r)=>{r.d(t,{JM:()=>l,Kd:()=>o,Wk:()=>u,a$:()=>a});var n=r(65726),i=r(33821);let s=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,i.k8,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},a=(0,n.xI)("$ZodError",s),o=(0,n.xI)("$ZodError",s,{Parent:Error});function l(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function u(e,t){let r=t||function(e){return e.message},n={_errors:[]},i=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>i({issues:e}));else if("invalid_key"===t.code)i({issues:t.issues});else if("invalid_element"===t.code)i({issues:t.issues});
1else if(0===t.path.length)n._errors.push(r(t));else{let e=n,i=0;for(;i<t.path.length;){let n=t.path[i];i===t.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(r(t))):e[n]=e[n]||{_errors:[]},e=e[n],i++}}};return i(e),n}},31638:(e,t,r)=>{r.d(t,{fd:()=>i,rs:()=>n}),Symbol("ZodOutput"),Symbol("ZodInput");class n{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&"object"==typeof r&&"id"in r){if(this._idmap.has(r.id))throw Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let 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){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};return delete r.id,{...r,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}let i=new n},33821:(e,t,r)=>{function n(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function i(e,t){return"bigint"==typeof t?t.toString():t}function s(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function a(e){return null==e}function o(e){let t=+!!e.startsWith("^"),r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function l(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}function u(e,t,r){Object.defineProperty(e,t,{get(){{let n=r();return e[t]=n,n}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function c(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function h(e){return JSON.stringify(e)}r.d(t,{$f:()=>y,A2:()=>b,Gv:()=>d,LG:()=>l,NM:()=>k,OH:()=>S,PO:()=>s,QH:()=>T,Qd:()=>m,Rc:()=>P,UQ:()=>h,Up:()=>w,Vy:()=>c,X$:()=>z,cJ:()=>_,cl:()=>a,gJ:()=>u,gx:()=>p,h1:()=>$,hI:()=>f,iR:()=>O,k8:()=>i,lQ:()=>A,mw:()=>I,o8:()=>v,p6:()=>o,qQ:()=>g,sn:()=>E,w5:()=>n,zH:()=>x});let p=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function d(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let f=s(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function m(e){if(!1===d(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!1!==d(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}let g=new Set(["string","number","symbol"]);function y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function b(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function k(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let x={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function w(e,t){let r={},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(r[e]=n.shape[e])}return v(e,{...e._zod.def,shape:r,checks:[]})}function _(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return v(e,{...e._zod.def,shape:r,checks:[]})}function z(e,t){if(!m(t))throw Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return c(this,"shape",r),r},checks:[]};return v(e,r)}function $(e,t){return v(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return c(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function S(e,t,r){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return v(t,{...t._zod.def,shape:i,checks:[]})}function I(e,t,r){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return v(t,{...t._zod.def,shape:i,checks:[]})}function T(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function A(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function R(e){return"string"==typeof e?e:e?.message}function O(e,t,r){let n={...e,path:e.path??[]};return e.message||(n.message=R(e.inst?._zod.def?.error?.(e))??R(t?.error?.(e))??R(r.customError?.(e))??R(r.localeError?.(e))??"Invalid input"),delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function P(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function E(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}},34976:(e,t,r)=>{r.d(t,{t:()=>s});var n=r(92659),i=r(65211),s=new class extends n.Q{#e=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!i.S$&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}
1setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}}},36522:(e,t,r)=>{r.d(t,{jG:()=>i});var n=r(44288).Zq,i=function(){let e=[],t=0,r=e=>{e()},i=e=>{e()},s=n,a=n=>{t?e.push(n):s(()=>{r(n)})};return{batch:n=>{let a;t++;try{a=n()}finally{--t||(()=>{let t=e;e=[],t.length&&s(()=>{i(()=>{t.forEach(e=>{r(e)})})})})()}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{s=e}}}()},43059:(e,t,r)=>{r.d(t,{II:()=>c,cc:()=>u,v_:()=>l});var n=r(59913),i=r(34976),s=r(92997),a=r(65211);function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||i.t.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let t,r=!1,c=0,h=(0,s.T)(),p=()=>n.m.isFocused()&&("always"===e.networkMode||i.t.isOnline())&&e.canRun(),d=()=>l(e.networkMode)&&e.canRun(),f=e=>{"pending"===h.status&&(t?.(),h.resolve(e))},m=e=>{"pending"===h.status&&(t?.(),h.reject(e))},g=()=>new Promise(r=>{t=e=>{("pending"!==h.status||p())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===h.status&&e.onContinue?.()}),y=()=>{let t;if("pending"!==h.status)return;let n=0===c?e.initialPromise:void 0;try{t=n??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(f).catch(t=>{if("pending"!==h.status)return;let n=e.retry??3*!a.S$,i=e.retryDelay??o,s="function"==typeof i?i(c,t):i,l=!0===n||"number"==typeof n&&c<n||"function"==typeof n&&n(c,t);if(r||!l)return void m(t);c++,e.onFail?.(c,t),(0,a.yy)(s).then(()=>p()?void 0:g()).then(()=>{r?m(t):y()})})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new u(t);m(r),e.onCancel?.(r)}},continue:()=>(t?.(),h),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:d,start:()=>(d()?y():g().then(y),h)}}},44288:(e,t,r)=>{r.d(t,{Zq:()=>s,zs:()=>i});var n={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i=new class{#n=n;#i=!1;setTimeoutProvider(e){this.#n=e}setTimeout(e,t){return this.#n.setTimeout(e,t)}clearTimeout(e){this.#n.clearTimeout(e)}setInterval(e,t){return this.#n.setInterval(e,t)}clearInterval(e){this.#n.clearInterval(e)}};function s(e){setTimeout(e,0)}},48729:(e,t,r)=>{r.d(t,{qg:()=>l,EJ:()=>u,xL:()=>c,bp:()=>h});var n=r(17896),i=r(21758),s=r(65726);let a=(e,t)=>{i.a$.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>i.Wk(e,t)},flatten:{value:t=>i.JM(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})};s.xI("ZodError",a);let o=s.xI("ZodError",a,{Parent:Error}),l=n.Tj(o),u=n.Rb(o),c=n.Od(o),h=n.wG(o)},59913:(e,t,r)=>{r.d(t,{m:()=>s});var n=r(92659),i=r(65211),s=new class extends n.Q{#s;#t;#r;constructor(){super(),this.#r=e=>{if(!i.S$&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#s!==e&&(this.#s=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}}},62136:(e,t,r)=>{r.d(t,{Ht:()=>o,jE:()=>a});var n=r(37172),i=r(69496),s=n.createContext(void 0),a=e=>{let t=n.useContext(s);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},o=e=>{let{client:t,children:r}=e;return n.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,i.jsx)(s.Provider,{value:t,children:r})}},65211:(e,t,r)=>{r.d(t,{Cp:()=>m,EN:()=>f,Eh:()=>c,F$:()=>d,GU:()=>I,MK:()=>h,S$:()=>i,ZM:()=>S,ZZ:()=>z,Zw:()=>a,d2:()=>u,f8:()=>y,gn:()=>o,hT:()=>$,j3:()=>l,lQ:()=>s,nJ:()=>p,ox:()=>T,pl:()=>w,y9:()=>_,yy:()=>x});var n=r(44288),i="undefined"==typeof window||"Deno"in globalThis;function s(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(n){if(t.queryHash!==d(a,t.options))return!1}else if(!m(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!i||i===t.state.fetchStatus)&&(!s||!!s(t))}function p(e,t){let{exact:r,status:n,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(r){if(f(t.options.mutationKey)!==f(s))return!1}else if(!m(t.options.mutationKey,s))return!1}return(!n||t.state.status===n)&&(!i||!!i(t))}function d(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>m(e[r],t[r]))}var g=Object.prototype.hasOwnProperty;function y(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function v(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!k(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!k(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function k(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return new Promise(t=>{n.zs.setTimeout(t,e)})}function w(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,n=0){if(t===r)return t;if(n>500)return r;let i=v(t)&&v(r);if(!i&&!(b(t)&&b(r)))return r;let s=(i?t:Object.keys(t)).length,a=i?r:Object.keys(r),o=a.length,l=i?Array(o):{},u=0;for(let c=0;c<o;c++){let o=i?c:a[c],h=t[o],p=r[o];if(h===p){l[o]=h,(i?c<s:g.call(t,o))&&u++;continue}if(null===h||null===p||"object"!=typeof h||"object"!=typeof p){l[o]=p;continue}let d=e(h,p,n+1);l[o]=d,d===h&&u++}return s===o&&u===s?t:l}(e,t):t}function _(e,t,r=0){let n=[...e,t];return r&&n.length>r?n.slice(1):n}function z(e,t,r=0){let n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var $=Symbol();function S(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==$?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function I(e,t){return"function"==typeof e?e(...t):!!e}function T(e,t,r){let n,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(n??=t(),i||(i=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)}),e}},65726:(e,t,r)=>{function n(e,t,r){function n(r,n){var i;for(let s in Object.defineProperty(r,"_zod",{value:r._zod??{},enumerable:!1}),(i=r._zod).traits??(i.traits=new Set),r._zod.traits.add(e),t(r,n),a.prototype)s in r||Object.defineProperty(r,s,{value:a.prototype[s].bind(r)});r._zod.constr=a,r._zod.def=n}
1let i=r?.Parent??Object;class s extends i{}function a(e){var t;let i=r?.Parent?new s:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}r.d(t,{$W:()=>a,GT:()=>i,cr:()=>s,xI:()=>n}),Object.freeze({status:"aborted"}),Symbol("zod_brand");class i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}let s={};function a(e){return e&&Object.assign(s,e),s}},72995:(e,t,r)=>{r.d(t,{k:()=>s});var n=r(44288),i=r(65211),s=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.gn)(this.gcTime)&&(this.#a=n.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i.S$?1/0:3e5))}clearGcTimeout(){this.#a&&(n.zs.clearTimeout(this.#a),this.#a=void 0)}}},73390:(e,t,r)=>{r.d(t,{X:()=>o,k:()=>l});var n=r(65211),i=r(36522),s=r(43059),a=r(72995),o=class extends a.k{#o;#l;#u;#c;#h;#p;#d;constructor(e){super(),this.#d=!1,this.#p=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=c(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#p,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=c(this.options);void 0!==e.data&&(this.setState(u(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){let r=(0,n.pl)(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,n.Eh)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===n.hT||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,n.d2)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,n.j3)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#d?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#d=!0,r.signal)}
1)},a=()=>{let e=(0,n.ZM)(this.options,t),r=(()=>{let e={client:this.#c,queryKey:this.queryKey,meta:this.meta};return i(e),e})();return(this.#d=!1,this.options.persister)?this.options.persister(e,r,this):e(r)},o=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a};return i(e),e})();this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=(0,s.II)({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof s.cc&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof s.cc){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...u(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),i.jG.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,s.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function u(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}},79660:(e,t,r)=>{function n(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}r.d(t,{JG:()=>ed});var i=n(),s={exec:()=>null};function a(e,t=""){let r="string"==typeof e?e:e.source,n={replace:(e,t)=>{let i="string"==typeof t?t:t.source;return i=i.replace(l.caret,"$1"),r=r.replace(e,i),n},getRegex:()=>new RegExp(r,t)};return n}var o=(()=>{try{return!!RegExp("(?<=1)(?<!1)")}catch{return!1}})(),l={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine
vendor: 4,141 bytes, line 1
1:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},u=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,c=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,h=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,p=a(h).replace(/bull/g,c).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),d=a(h).replace(/bull/g,c).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),f=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,m=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,g=a(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",m).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),y=a(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,c).getRegex(),v="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",b=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,k=a("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",b).replace("tag",v).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=a(f).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),w={blockquote:a(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",x).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:g,fences:/^ {0,3}(`{3,}
vendor: 12,797 bytes, lines 1-24
1(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:u,html:k,lheading:p,list:y,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:x,table:s,text:/^[^\n]+/},_=a("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex(),z={...w,lheading:d,table:_,paragraph:a(f).replace("hr",u).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",v).getRegex()},$={...w,html:a(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",b).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:s,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:a(f).replace("hr",u).replace("heading",` *#{1,6} *[^
2]`).replace("lheading",p).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},S=/^( {2,}|\\)\n(?!\s*$)/,I=/[\p{P}\p{S}]/u,T=/[\s\p{P}\p{S}]/u,A=/[^\s\p{P}\p{S}]/u,R=a(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,T).getRegex(),O=/(?!~)[\p{P}\p{S}]/u,P=/(?![*_])[\p{P}\p{S}]/u,E=a(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",o?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Z=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,j=a(Z,"u").replace(/punct/g,I).getRegex(),C=a(Z,"u").replace(/punct/g,O).getRegex(),N="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",F=a(N,"gu").replace(/notPunctSpace/g,A).replace(/punctSpace/g,T).replace(/punct/g,I).getRegex(),L=a(N,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,O).getRegex(),U=a("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,A).replace(/punctSpace/g,T).replace(/punct/g,I).getRegex(),M=a(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,P).getRegex(),D=a("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)","gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|[*_])/u).replace(/punctSpace/g,/(?![*_])[\s\p{P}\p{S}]/u).replace(/punct/g,P).getRegex(),Q=a(/\\(punct)/,"gu").replace(/punct/g,I).getRegex(),q=a(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),J=a(b).replace("(?:--\x3e|$)","--\x3e").getRegex(),B=a("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",J).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,H=a(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",W).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),G=a(/^!?\[(label)\]\[(ref)\]/).replace("label",W).replace("ref",m).getRegex(),Y=a(/^!?\[(ref)\](?:\[\])?/).replace("ref",m).getRegex(),V=a("reflink|nolink(?!\\()","g").replace("reflink",G).replace("nolink",Y).getRegex(),K=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,X={_backpedal:s,anyPunctuation:Q,autolink:q,blockSkip:E,br:S,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:s,delLDelim:s,delRDelim:s,emStrongLDelim:j,emStrongRDelimAst:F,emStrongRDelimUnd:U,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:H,nolink:Y,punctuation:R,reflink:G,reflinkSearch:V,tag:B,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:s},ee={...X,link:a(/^!?\[(label)\]\((.*?)\)/).replace("label",W).getRegex(),reflink:a(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W).getRegex()},et={...X,emStrongRDelimAst:L,emStrongLDelim:C,delLDelim:M,delRDelim:D,url:a(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",K).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:a(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",K).getRegex()},er={...et,br:a(S).replace("{2,}","*").getRegex(),text:a(et.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},en={normal:w,gfm:z,pedantic:$},ei={normal:X,gfm:et,breaks:er,pedantic:ee},es={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ea=e=>es[e];function eo(e,t){if(t){if(l.escapeTest.test(e))return e.replace(l.escapeReplace,ea)}else if(l.escapeTestNoEncode.test(e))return e.replace(l.escapeReplaceNoEncode,ea);return e}function el(e){try{e=encodeURI(e).replace(l.percentDecode,"%")}catch{return null}return e}function eu(e,t){let r=e.replace(l.findPipe,(e,t,r)=>{let n=!1,i=t;for(;--i>=0&&"\\"===r[i];)n=!n;return n?"|":" |"}).split(l.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(l.slashPipe,"|");return r}function ec(e,t,r){let n=e.length;if(0===n)return"";let i=0;for(;i<n;){let s=e.charAt(n-i-1);if(s!==t||r)if(s!==t&&r)i++;else break;else i++}return e.slice(0,n-i)}function eh(e,t,r,n,i){let s=t.href,a=t.title||null,o=e[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;let l={type:"!"===e[0].charAt(0)?"image":"link",raw:r,href:s,title:a,text:o,tokens:n.inlineTokens(o)};return n.state.inLink=!1,l}var ep=class{options;rules;lexer;constructor(e){this.options=e||i}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:ec(e,`
3`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],r=function(e,t,r){let n=e.match(r.other.indentCodeCompensation);if(null===n)return t;let i=n[1];return t.split(`
4`).map(e=>{let t=e.match(r.other.beginningSpace);if(null===t)return e;let[n]=t;return n.length>=i.length?e.slice(i.length):e}).join(`
5`)}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=ec(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:ec(t[0],`
6`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=ec(t[0],`
7`).split(`
8`),r="",n="",i=[];for(;e.length>0;){let t=!1,s=[],a;for(a=0;a<e.length;a++)if(this.rules.other.blockquoteStart.test(e[a]))s.push(e[a]),t=!0;else if(t)break;else s.push(e[a]);e=e.slice(a);let o=s.join(`
9`),l=o.replace(this.rules.other.blockquoteSetextReplace,`
10    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11${o}`:o,n=n?`${n}
12${l}`:l;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,i,!0),this.lexer.state.top=u,0===e.length)break;let c=i.at(-1);if(c?.type==="code")break;if(c?.type==="blockquote"){let t=c.raw+`
13`+e.join(`
14`),s=this.blockquote(t);i[i.length-1]=s,r=r.substring(0,r.length-c.raw.length)+s.raw,n=n.substring(0,n.length-c.text.length)+s.text;break}if(c?.type==="list"){let t=c.raw+`
15`+e.join(`
16`),s=this.list(t);i[i.length-1]=s,r=r.substring(0,r.length-c.raw.length)+s.raw,n=n.substring(0,n.length-c.raw.length)+s.raw,e=t.substring(i.at(-1).raw.length).split(`
17`);continue}}return{type:"blockquote",raw:r,tokens:i,text:n}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim(),n=r.length>1,i={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");let s=this.rules.other.listItemRegex(r),a=!1;for(;e;){let r=!1,n="",o="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;n=t[0],e=e.substring(n.length);let l=function(e,t=0){let r=t,n="";for(let t of e)if("	"===t){let e=4-r%4;n+=" ".repeat(e),r+=e}else n+=t,r++;return n}(t[2].split(`
18`,1)[0],t[1].length),u=e.split(`
19`,1)[0],c=!l.trim(),h=0;if(this.options.pedantic?(h=2,o=l.trimStart()):c?h=t[1].length+1:(h=(h=l.search(this.rules.other.nonSpaceChar))>4?1:h,o=l.slice(h),h+=t[1].length),c&&this.rules.other.blankLine.test(u)&&(n+=u+`
20`,e=e.substring(u.length+1),r=!0),!r){let t=this.rules.other.nextBulletRegex(h),r=this.rules.other.hrRegex(h),i=this.rules.other.fencesBeginRegex(h),s=this.rules.other.headingBeginRegex(h),a=this.rules.other.htmlBeginRegex(h),p=this.rules.other.blockquoteBeginRegex(h);for(;e;){let d=e.split(`
21`,1)[0],f;if(u=d,f=this.options.pedantic?u=u.replace(this.rules.other.listReplaceNesting,"  "):u.replace(this.rules.other.tabCharGlobal,"    "),i.test(u)||s.test(u)||a.test(u)||p.test(u)||t.test(u)||r.test(u))break;if(f.search(this.rules.other.nonSpaceChar)>=h||!u.trim())o+=`
22`+f.slice(h);else{if(c||l.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||i.test(l)||s.test(l)||r.test(l))break;o+=`
23`+u}c=!u.trim(),n+=d+`
24`,e=e.substring(d.length+1),l=f.slice(h)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(n)&&(a=!0)),i.items.push({type:"list_item",raw:n,task:!!this.options.gfm&&this.rules.other.listIsTask.test(o),loose:!1,text:o,tokens:[]}),i.raw+=n}let o=i.items.at(-1);if(!o)return;for(let e of(o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),i.raw=i.raw.trimEnd(),i.items)){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),e.tokens[0]?.type==="text"||e.tokens[0]?.type==="paragraph"){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let r={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=r.checked,i.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=r.raw+e.tokens[0].raw,e.tokens[0].text=r.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(r)):e.tokens.unshift({type:"paragraph",raw:r.raw,text:r.raw,tokens:[r]}):e.tokens.unshift(r)}}if(!i.loose){let t=e.tokens.filter(e=>
24"space"===e.type);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items)for(let t of(e.loose=!0,e.tokens))"text"===t.type&&(t.type="paragraph");return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:n}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let r=eu(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25`):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(let e of n)this.rules.other.tableAlignRight.test(e)?s.align.push("right"):this.rules.other.tableAlignCenter.test(e)?s.align.push("center"):this.rules.other.tableAlignLeft.test(e)?s.align.push("left"):s.align.push(null);for(let e=0;e<r.length;e++)s.header.push({text:r[e],tokens:this.lexer.inline(r[e]),header:!0,align:s.align[e]});for(let e of i)s.rows.push(eu(e,s.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:s.align[t]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
26`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=ec(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(")"))return -1;let r=0;for(let n=0;n<e.length;n++)if("\\"===e[n])n++;else if("("===e[n])r++;else if(e[n]===t[1]&&--r<0)return n;return r>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let r=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,r).trim(),t[3]=""}}let r=t[2],n="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(r);e&&(r=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(r=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r.slice(1):r.slice(1,-1)),eh(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let e=t[(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=r[0].charAt(0);return{type:"text",raw:e,text:e}}return eh(r,e,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(n[1]||n[2])||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,i,s,a=r,o=0,l="*"===n[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=l.exec(t));){if(!(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(s=[...i].length,n[3]||n[4]){a+=s;continue}if((n[5]||n[6])&&r%3&&!((r+s)%3)){o+=s;continue}if((a-=s)>0)continue;s=Math.min(s,s+a+o);let t=[...n[0]][0].length,l=e.slice(0,r+n.index+t+s);if(Math.min(r,s)%2){let e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}let u=l.slice(2,-2);return{type:"strong",raw:l,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),n=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&n&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,r=""){let n=this.rules.inline.delLDelim.exec(e);if(n&&(!n[1]||!r||this.rules.inline.punctuation.exec(r))){let r=[...n[0]].length-1,i,s,a=r,o=this.rules.inline.delRDelim;for(o.lastIndex=0,t=t.slice(-1*e.length+r);null!=(n=o.exec(t));){if(!(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])||(s=[...i].length)!==r)continue;if(n[3]||n[4]){a+=s;continue}if((a-=s)>0)continue;s=Math.min(s,s+a);let t=[...n[0]][0].length,o=e.slice(0,r+n.index+t+s),l=o.slice(r,-r);return{type:"del",raw:o,text:l,tokens:this.lexer.inlineTokens(l)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,r;return r="@"===t[2]?"mailto:"+(e=t[1]):e=t[1],{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,r;if("@"===t[2])r="mailto:"+(e=t[0]);else{let n;do n=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(n!==t[0]);e=t[0],r="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},ed=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||i,this.options.tokenizer=this.options.tokenizer||new ep,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:l,block:en.normal,inline:ei.normal};this.options.pedantic?(t.block=en.pedantic,t.inline=ei.pedantic):this.options.gfm&&(t.block=en.gfm,this.options.breaks?t.inline=ei.breaks:t.inline=ei.gfm),this.tokenizer.rules=t}static get rules(){return{block:en,inline:ei}}static lex(t,r){return new e(r).lex(t)}static lexInline(t,r){return new e(r).inlineTokens(t)}lex(e){e=e.replace(l.carriageReturn,`
27`),this.blockTokens(e,this.tokens);for(let e=0;
27e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(l.tabCharGlobal,"    ").replace(l.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(r=>!!(n=r.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let r=t.at(-1);1===n.raw.length&&void 0!==r?r.raw+=`
28`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
29`)?"":`
30`)+n.raw,r.text+=`
31`+n.text,this.inlineQueue.at(-1).src=r.text):t.push(n);continue}if((n=this.tokenizer.fences(e))||(n=this.tokenizer.heading(e))||(n=this.tokenizer.hr(e))||(n=this.tokenizer.blockquote(e))||(n=this.tokenizer.list(e))||(n=this.tokenizer.html(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="paragraph"||r?.type==="text"?(r.raw+=(r.raw.endsWith(`
32`)?"":`
33`)+n.raw,r.text+=`
34`+n.raw,this.inlineQueue.at(-1).src=r.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if((n=this.tokenizer.table(e))||(n=this.tokenizer.lheading(e))){e=e.substring(n.raw.length),t.push(n);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,r=e.slice(1),n;this.options.extensions.startBlock.forEach(e=>{"number"==typeof(n=e.call({lexer:this},r))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(i))){let s=t.at(-1);r&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
35`)?"":`
36`)+n.raw,s.text+=`
37`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):t.push(n),r=i.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let r=t.at(-1);r?.type==="text"?(r.raw+=(r.raw.endsWith(`
38`)?"":`
39`)+n.raw,r.text+=`
40`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r,n=e,i=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(n));)r=i[2]?i[2].length:0,n=n.slice(0,i.index+r)+"["+"a".repeat(i[0].length-r-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let s=!1,a="";for(;e;){let r;if(s||(a=""),s=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);"text"===r.type&&n?.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,a))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,a))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,r=e.slice(1),n;this.options.extensions.startInline.forEach(e=>{"number"==typeof(n=e.call({lexer:this},r))&&n>=0&&(t=Math.min(t,n))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(a=r.raw.slice(-1)),s=!0;let n=t.at(-1);n?.type==="text"?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},ef=class{options;parser;constructor(e){this.options=e||i}space(e){return""}code({text:e,lang:t,escaped:r}
vendor: 1,709 bytes, lines 40-58
40){let n=(t||"").match(l.notSpaceStart)?.[0],i=e.replace(l.endingNewline,"")+`
41`;return n?'<pre><code class="language-'+eo(n)+'">'+(r?i:eo(i,!0))+`</code></pre>
42`:"<pre><code>"+(r?i:eo(i,!0))+`</code></pre>
43`}blockquote({tokens:e}){return`<blockquote>
44${this.parser.parse(e)}</blockquote>
45`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
46`}hr(e){return`<hr>
47`}list(e){let t=e.ordered,r=e.start,n="";for(let t=0;t<e.items.length;t++){let r=e.items[t];n+=this.listitem(r)}let i=t?"ol":"ul";return"<"+i+(t&&1!==r?' start="'+r+'"':"")+`>
48`+n+"</"+i+`>
49`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
50`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
51`}table(e){let t="",r="";for(let t=0;t<e.header.length;t++)r+=this.tablecell(e.header[t]);t+=this.tablerow({text:r});let n="";for(let t=0;t<e.rows.length;t++){let i=e.rows[t];r="";for(let e=0;e<i.length;e++)r+=this.tablecell(i[e]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
52<thead>
53`+t+`</thead>
54`+n+`</table>
55`}tablerow({text:e}){return`<tr>
56${e}</tr>
57`}tablecell(e){let t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
58`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${eo(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){let n=this.parser.parseInline(r),i=el(e);
58if(null===i)return n;let s='<a href="'+(e=i)+'"';return t&&(s+=' title="'+eo(t)+'"'),s+=">"+n+"</a>"}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));let i=el(e);if(null===i)return eo(r);e=i;let s=`<img src="${e}" alt="${eo(r)}"`;return t&&(s+=` title="${eo(t)}"`),s+=">"}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:eo(e.text)}},em=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},eg=class e{options;renderer;textRenderer;constructor(e){this.options=e||i,this.options.renderer=this.options.renderer||new ef,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new em}static parse(t,r){return new e(r).parse(t)}static parseInline(t,r){return new e(r).parseInline(t)}parse(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let e=this.options.extensions.renderers[n.type].call({parser:this},n);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(n.type)){t+=e||"";continue}}switch(n.type){case"space":t+=this.renderer.space(n);break;case"hr":t+=this.renderer.hr(n);break;case"heading":t+=this.renderer.heading(n);break;case"code":t+=this.renderer.code(n);break;case"table":t+=this.renderer.table(n);break;case"blockquote":t+=this.renderer.blockquote(n);break;case"list":t+=this.renderer.list(n);break;case"checkbox":t+=this.renderer.checkbox(n);break;case"html":t+=this.renderer.html(n);break;case"def":t+=this.renderer.def(n);break;case"paragraph":t+=this.renderer.paragraph(n);break;case"text":t+=this.renderer.text(n);break;default:{let e='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return t}parseInline(e,t=this.renderer){let r="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){r+=e||"";continue}}switch(i.type){case"escape":case"text":r+=t.text(i);break;case"html":r+=t.html(i);break;case"link":r+=t.link(i);break;case"image":r+=t.image(i);break;case"checkbox":r+=t.checkbox(i);break;case"strong":r+=t.strong(i);break;case"em":r+=t.em(i);break;case"codespan":r+=t.codespan(i);break;case"br":r+=t.br(i);break;case"del":r+=t.del(i);break;default:{let e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw Error(e)}}}return r}},ey=class{options;block;constructor(e){this.options=e||i}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?ed.lex:ed.lexInline}provideParser(){return this.block?eg.parse:eg.parseInline}},ev=new class{defaults=n();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eg;Renderer=ef;TextRenderer=em;Lexer=ed;Tokenizer=ep;Hooks=ey;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(let n of e)switch(r=r.concat(t.call(this,n)),n.type){case"table":for(let e of n.header)r=r.concat(this.walkTokens(e.tokens,t));for(let e of n.rows)for(let n of e)r=r.concat(this.walkTokens(n.tokens,t));break;case"list":r=r.concat(this.walkTokens(n.items,t));break;default:{let e=n;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(n=>{let i=e[n].flat(1/0);r=r.concat(this.walkTokens(i,t))}):e.tokens&&(r=r.concat(this.walkTokens(e.tokens,t)))}}return r}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};
58return e.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if("renderer"in e){let r=t.renderers[e.name];r?t.renderers[e.name]=function(...t){let n=e.renderer.apply(this,t);return!1===n&&(n=r.apply(this,t)),n}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");let r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),e.renderer){let t=this.defaults.renderer||new ef(this.defaults);for(let r in e.renderer){if(!(r in t))throw Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;let n=e.renderer[r],i=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r||""}}r.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ep(this.defaults);for(let r in e.tokenizer){if(!(r in t))throw Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;let n=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r}}r.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ey;for(let r in e.hooks){if(!(r in t))throw Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;let n=e.hooks[r],i=t[r];ey.passThroughHooks.has(r)?t[r]=e=>{if(this.defaults.async&&ey.passThroughHooksRespectAsync.has(r))return(async()=>{let r=await n.call(t,e);return i.call(t,r)})();let s=n.call(t,e);return i.call(t,s)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let r=await n.apply(t,e);return!1===r&&(r=await i.apply(t,e)),r})();let r=n.apply(t,e);return!1===r&&(r=i.apply(t,e)),r}}r.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,n=e.walkTokens;r.walkTokens=function(e){let r=[];return r.push(n.call(this,e)),t&&(r=r.concat(t.call(this,e))),r}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ed.lex(e,t??this.defaults)}parser(e,t){return eg.parse(e,t??this.defaults)}parseMarkdown(e){return(t,r)=>{let n={...r},i={...this.defaults,...n},s=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===n.async)return s(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return s(Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return s(Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let r=i.hooks?await i.hooks.preprocess(t):t,n=await (i.hooks?await i.hooks.provideLexer():e?ed.lex:ed.lexInline)(r,i),s=i.hooks?await i.hooks.processAllTokens(n):n;i.walkTokens&&await Promise.all(this.walkTokens(s,i.walkTokens));let a=await (i.hooks?await i.hooks.provideParser():e?eg.parse:eg.parseInline)(s,i);return i.hooks?await i.hooks.postprocess(a):a})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let r=(i.hooks?i.hooks.provideLexer():e?ed.lex:ed.lexInline)(t,i);i.hooks&&(r=i.hooks.processAllTokens(r)),i.walkTokens&&this.walkTokens(r,i.walkTokens);let n=(i.hooks?i.hooks.provideParser():e?eg.parse:eg.parseInline)(r,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return s(e)}}}onError(e,t){return r=>{if(r.message+=`
59Please report this to https://github.com/markedjs/marked.`,e){let e="<p>An error occurred:</p><pre>"+eo(r.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(r);throw r}}};function eb(e,t){return ev.parse(e,t)}eb.options=eb.setOptions=function(e){return ev.setOptions(e),eb.defaults=ev.defaults,i=eb.defaults,eb},eb.getDefaults=n,eb.defaults=i,eb.use=function(...e){return ev.use(...e),eb.defaults=ev.defaults,i=eb.defaults,eb},eb.walkTokens=function(e,t){return ev.walkTokens(e,t)},eb.parseInline=ev.parseInline,eb.Parser=eg,eb.parser=eg.parse,eb.Renderer=ef,eb.TextRenderer=em,eb.Lexer=ed,eb.lexer=ed.lex,eb.Tokenizer=ep,eb.Hooks=ey,eb.parse=eb,eb.options,eb.setOptions,eb.use,eb.walkTokens,eb.parseInline,eg.parse,ed.lex},81492:(e,t,r)=>{r.d(t,{I:()=>k});var n=r(59913),i=r(36522),s=r(73390),a=r(92659),o=r(92997),l=r(65211),u=r(44288),c=class extends a.Q{constructor(e,t){super(),this.options=t,this.#c=e,this.#m=null,this.#g=(0,o.T)(),this.bindMethods(),this.setOptions(t)}#c;#y=void 0;#v=void 0;#b=void 0;#k;#x;#g;#m;#w;#_;#z;#$;#S;#I;#T=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#y.addObserver(this),h(this.#y,this.options)?this.#A():this.updateResult(),this.#R())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return p(this.#y,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return p(this.#y,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#P(),this.#y.removeObserver(this)}setOptions(e){let t=this.options,r=this.#y;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,l.Eh)(this.options.enabled,this.#y))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");
59this.#E(),this.#y.setOptions(this.options),t._defaulted&&!(0,l.f8)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#y,observer:this});let n=this.hasListeners();n&&d(this.#y,r,this.options,t)&&this.#A(),this.updateResult(),n&&(this.#y!==r||(0,l.Eh)(this.options.enabled,this.#y)!==(0,l.Eh)(t.enabled,this.#y)||(0,l.d2)(this.options.staleTime,this.#y)!==(0,l.d2)(t.staleTime,this.#y))&&this.#Z();let i=this.#j();n&&(this.#y!==r||(0,l.Eh)(this.options.enabled,this.#y)!==(0,l.Eh)(t.enabled,this.#y)||i!==this.#I)&&this.#C(i)}getOptimisticResult(e){var t,r;let n=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(n,e);return t=this,r=i,(0,l.f8)(t.getCurrentResult(),r)||(this.#b=i,this.#x=this.options,this.#k=this.#y.state),i}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#g.status||this.#g.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#T.add(e)}getCurrentQuery(){return this.#y}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#A({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#A(e){this.#E();let t=this.#y.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.lQ)),t}#Z(){this.#O();let e=(0,l.d2)(this.options.staleTime,this.#y);if(l.S$||this.#b.isStale||!(0,l.gn)(e))return;let t=(0,l.j3)(this.#b.dataUpdatedAt,e);this.#$=u.zs.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#j(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#y):this.options.refetchInterval)??!1}#C(e){this.#P(),this.#I=e,!l.S$&&!1!==(0,l.Eh)(this.options.enabled,this.#y)&&(0,l.gn)(this.#I)&&0!==this.#I&&(this.#S=u.zs.setInterval(()=>{(this.options.refetchIntervalInBackground||n.m.isFocused())&&this.#A()},this.#I))}#R(){this.#Z(),this.#C(this.#j())}#O(){this.#$&&(u.zs.clearTimeout(this.#$),this.#$=void 0)}#P(){this.#S&&(u.zs.clearInterval(this.#S),this.#S=void 0)}createResult(e,t){let r,n=this.#y,i=this.options,a=this.#b,u=this.#k,c=this.#x,p=e!==n?e.state:this.#v,{state:m}=e,g={...m},y=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&h(e,t),o=r&&d(e,n,t,i);(a||o)&&(g={...g,...(0,s.k)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(g.fetchStatus="idle")}let{error:v,errorUpdatedAt:b,status:k}=g;r=g.data;let x=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===k){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#z?.state.data,this.#z):t.placeholderData,void 0!==e&&(k="success",r=(0,l.pl)(a?.data,e,t),y=!0)}if(t.select&&void 0!==r&&!x)if(a&&r===u?.data&&t.select===this.#w)r=this.#_;else try{this.#w=t.select,r=t.select(r),r=(0,l.pl)(a?.data,r,t),this.#_=r,this.#m=null}catch(e){this.#m=e}this.#m&&(v=this.#m,r=this.#_,b=Date.now(),k="error");let w="fetching"===g.fetchStatus,_="pending"===k,z="error"===k,$=_&&w,S=void 0!==r,I={status:k,fetchStatus:g.fetchStatus,isPending:_,isSuccess:"success"===k,isError:z,isInitialLoading:$,isLoading:$,data:r,dataUpdatedAt:g.dataUpdatedAt,error:v,errorUpdatedAt:b,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:w,isRefetching:w&&!_,isLoadingError:z&&!S,isPaused:"paused"===g.fetchStatus,isPlaceholderData:y,isRefetchError:z&&S,isStale:f(e,t),refetch:this.refetch,promise:this.#g,isEnabled:!1!==(0,l.Eh)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==I.data,r="error"===I.status&&!t,i=e=>{r?e.reject(I.error):t&&e.resolve(I.data)},s=()=>{i(this.#g=I.promise=(0,o.T)())},a=this.#g;
59switch(a.status){case"pending":e.queryHash===n.queryHash&&i(a);break;case"fulfilled":(r||I.data!==a.value)&&s();break;case"rejected":r&&I.error===a.reason||s()}}return I}updateResult(){let e=this.#b,t=this.createResult(this.#y,this.options);if(this.#k=this.#y.state,this.#x=this.options,void 0!==this.#k.data&&(this.#z=this.#y),(0,l.f8)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#T.size)return!0;let n=new Set(r??this.#T);return this.options.throwOnError&&n.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&n.has(t))};this.#N({listeners:r()})}#E(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#y)return;let t=this.#y;this.#y=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#R()}#N(e){i.jG.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#y,type:"observerResultsUpdated"})})}};function h(e,t){return!1!==(0,l.Eh)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&p(e,t,t.refetchOnMount)}function p(e,t,r){if(!1!==(0,l.Eh)(t.enabled,e)&&"static"!==(0,l.d2)(t.staleTime,e)){let n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&f(e,t)}return!1}function d(e,t,r,n){return(e!==t||!1===(0,l.Eh)(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&f(e,r)}function f(e,t){return!1!==(0,l.Eh)(t.enabled,e)&&e.isStaleByTime((0,l.d2)(t.staleTime,e))}var m=r(37172),g=r(62136);r(69496);var y=m.createContext(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),v=m.createContext(!1);v.Provider;var b=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function k(e,t){return function(e,t,r){var n,s,a,o;let u=m.useContext(v),c=m.useContext(y),h=(0,g.jE)(r),p=h.defaultQueryOptions(e);
59null==(s=h.getDefaultOptions().queries)||null==(n=s._experimental_beforeQuery)||n.call(s,p);let d=h.getQueryCache().get(p.queryHash);if(p._optimisticResults=u?"isRestoring":"optimistic",p.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=p.staleTime;p.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof p.gcTime&&(p.gcTime=Math.max(p.gcTime,1e3))}let f=(null==d?void 0:d.state.error)&&"function"==typeof p.throwOnError?(0,l.GU)(p.throwOnError,[d.state.error,d]):p.throwOnError;(p.suspense||p.experimental_prefetchInRender||f)&&!c.isReset()&&(p.retryOnMount=!1),m.useEffect(()=>{c.clearReset()},[c]);let k=!h.getQueryCache().get(p.queryHash),[x]=m.useState(()=>new t(h,p)),w=x.getOptimisticResult(p),_=!u&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=_?x.subscribe(i.jG.batchCalls(e)):l.lQ;return x.updateResult(),t},[x,_]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),m.useEffect(()=>{x.setOptions(p)},[p,x]),p?.suspense&&w.isPending)throw b(p,x,c);if((e=>{let{result:t,errorResetBoundary:r,throwOnError:n,query:i,suspense:s}=e;return t.isError&&!r.isReset()&&!t.isFetching&&i&&(s&&void 0===t.data||(0,l.GU)(n,[t.error,i]))})({result:w,errorResetBoundary:c,throwOnError:p.throwOnError,query:d,suspense:p.suspense}))throw w.error;if(null==(o=h.getDefaultOptions().queries)||null==(a=o._experimental_afterQuery)||a.call(o,p,w),p.experimental_prefetchInRender&&!l.S$&&w.isLoading&&w.isFetching&&!u){let e=k?b(p,x,c):null==d?void 0:d.promise;null==e||e.catch(l.lQ).finally(()=>{x.updateResult()})}return p.notifyOnChangeProps?w:x.trackResult(w)}(e,c,t)}},82444:(e,t,r)=>{r.d(t,{EB:()=>tg,YO:()=>tG,zM:()=>tM,Ie:()=>rm,gM:()=>t2,k5:()=>t5,Nl:()=>rg,RZ:()=>rd,eu:()=>t7,Zm:()=>tW,ch:()=>tQ,ai:()=>tN,Ik:()=>tV,g1:()=>t4,re:()=>tK,Yj:()=>tm,KC:()=>t0,L5:()=>tJ});var n=r(65726);let i=/^[cC][^\s-]{8,}$/,s=/^[0-9a-z]+$/,a=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,o=/^[0-9a-vA-V]{20}$/,l=/^[A-Za-z0-9]{27}$/,u=/^[a-zA-Z0-9_-]{21}$/,c=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,h=/^([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})$/,p=e=>e?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)$/,d=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,f=/^(?:(?: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])$/,m=/^(([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})$/,g=/^((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])$/,y=/^(([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])$/,v=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,b=/^[A-Za-z0-9_-]*$/,k=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,x=/^\+(?:[0-9]){6,14}[0-9]$/,w="(?:(?:\\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])))",_=RegExp(`^${w}$`);function z(e){let 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+)?)?`}let $=/^\d+$/,S=/^-?\d+(?:\.\d+)?/i,I=/true|false/i,T=/null/i,A=/^[^A-Z]*$/,R=/^[^a-z]*$/;var O=r(33821);let P=n.xI("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),E={number:"number",bigint:"bigint",object:"date"},Z=n.xI("$ZodCheckLessThan",(e,t)=>{P.init(e,t);let r=E[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??1/0;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),j=n.xI("$ZodCheckGreaterThan",(e,t)=>{P.init(e,t);let r=E[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),C=n.xI("$ZodCheckMultipleOf",(e,t)=>{P.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===O.LG(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),N=n.xI("$ZodCheckNumberFormat",(e,t)=>{P.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=O.zH[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=s,r&&(n.pattern=$)}),e._zod.check=a=>{let o=a.value;if(r){if(!Number.isInteger(o))return void a.issues.push({expected:n,format:t.format,code:"invalid_type",input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?a.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):a.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}))}o<i&&a.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>s&&a.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inst:e})}}),F=n.xI("$ZodCheckMaxLength",(e,t)=>{var r;P.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!O.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??1/0;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=O.Rc(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),L=n.xI("$ZodCheckMinLength",(e,t)=>{var r;P.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!O.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??-1/0;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=O.Rc(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),U=n.xI("$ZodCheckLengthEquals",(e,t)=>{var r;P.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!O.cl(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let s=O.Rc(n),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),M=n.xI("$ZodCheckStringFormat",(e,t)=>{var r,n;P.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),D=n.xI("$ZodCheckRegex",(e,t)=>{M.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Q=n.xI("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=A),M.init(e,t)}),q=n.xI("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=R),M.init(e,t)}),J=n.xI("$ZodCheckIncludes",(e,t)=>{P.init(e,t);let r=O.$f(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input
59:r.value,inst:e,continue:!t.abort})}}),B=n.xI("$ZodCheckStartsWith",(e,t)=>{P.init(e,t);let r=RegExp(`^${O.$f(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),W=n.xI("$ZodCheckEndsWith",(e,t)=>{P.init(e,t);let r=RegExp(`.*${O.$f(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),H=n.xI("$ZodCheckOverwrite",(e,t)=>{P.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class G{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){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>`  ${e}`)].join("\n"))}}var Y=r(17896);let V={major:4,minor:0,patch:0},K=n.xI("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=V;let i=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&i.unshift(e),i))for(let r of t._zod.onattach)r(e);if(0===i.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let i,s=O.QH(e);for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(s)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&r?.async===!1)throw new n.GT;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(s||(s=O.QH(e,t)))});else{if(e.issues.length===t)continue;s||(s=O.QH(e,t))}}return i?i.then(()=>e):e};e._zod.run=(r,s)=>{let a=e._zod.parse(r,s);if(a instanceof Promise){if(!1===s.async)throw new n.GT;return a.then(e=>t(e,i,s))}return t(a,i,s)}}e["~standard"]={validate:t=>{try{let r=(0,Y.xL)(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return(0,Y.bp)(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),X=n.xI("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)})(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ee=n.xI("$ZodStringFormat",(e,t)=>{M.init(e,t),X.init(e,t)}),et=n.xI("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=h),ee.init(e,t)}),er=n.xI("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=p(e))}else t.pattern??(t.pattern=p());ee.init(e,t)}),en=n.xI("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=d),ee.init(e,t)}),ei=n.xI("$ZodURL",(e,t)=>{ee.init(e,t),e._zod.check=r=>{try{let n=r.value,i=new URL(n),s=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:k.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),es=n.xI("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ee.init(e,t)}),ea=n.xI("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=u),ee.init(e,t)}),eo=n.xI("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=i),ee.init(e,t)}),el=n.xI("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=s),ee.init(e,t)}),eu=n.xI("$ZodULID",(e,t)=>{t.pattern??(t.pattern=a),ee.init(e,t)}),ec=n.xI("$ZodXID",(e,t)=>{t.pattern??(t.pattern=o),ee.init(e,t)}),eh=n.xI("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=l),ee.init(e,t)}),ep=n.xI("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){let t=z({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${w}T(?:${n})$`)}(t)),ee.init(e,t)}),ed=n.xI("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_),ee.init(e,t)}),ef=n.xI("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=RegExp(`^${z(t)}$`)),ee.init(e,t)}),em=n.xI("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=c),ee.init(e,t)}),eg=n.xI("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=f),ee.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),ey=n.xI("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=m),ee.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ev=n.xI("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=g),ee.init(e,t)}),eb=n.xI("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=y),ee.init(e,t),e._zod.check=r=>{let[n,i]=r.value.split("/");try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function ek(e){if(""===e)return!0;
59if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let ex=n.xI("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=v),ee.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{ek(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ew=n.xI("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=b),ee.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{!function(e){if(!b.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ek(t.padEnd(4*Math.ceil(t.length/4),"="))}(r.value)&&r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),e_=n.xI("$ZodE164",(e,t)=>{t.pattern??(t.pattern=x),ee.init(e,t)}),ez=n.xI("$ZodJWT",(e,t)=>{ee.init(e,t),e._zod.check=r=>{!function(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(r.value,t.alg)&&r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),e$=n.xI("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??S,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}}),eS=n.xI("$ZodNumber",(e,t)=>{N.init(e,t),e$.init(e,t)}),eI=n.xI("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=I,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),eT=n.xI("$ZodNull",(e,t)=>{K.init(e,t),e._zod.pattern=T,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),eA=n.xI("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=e=>e}),eR=n.xI("$ZodNever",(e,t)=>{K.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function eO(e,t,r){e.issues.length&&t.issues.push(...O.lQ(r,e.issues)),t.value[r]=e.value}let eP=n.xI("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let s=[];for(let e=0;e<i.length;e++){let a=i[e],o=t.element._zod.run({value:a,issues:[]},n);o instanceof Promise?s.push(o.then(t=>eO(t,r,e))):eO(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function eE(e,t,r){e.issues.length&&t.issues.push(...O.lQ(r,e.issues)),t.value[r]=e.value}function eZ(e,t,r,n){e.issues.length?void 0===n[r]?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...O.lQ(r,e.issues)):void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}let ej=n.xI("$ZodObject",(e,t)=>{let r,i;K.init(e,t);let s=O.PO(()=>{let e=Object.keys(t.shape);for(let r of e)if(!(t.shape[r]instanceof K))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=O.NM(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}});O.gJ(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let a=O.Gv,o=!n.cr.jitless,l=O.hI,u=o&&l.value,c=t.catchall;e._zod.parse=(n,l)=>{i??(i=s.value);let h=n.value;if(!a(h))return n.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),n;let p=[];if(o&&u&&l?.async===!1&&!0!==l.jitless)r||(r=(e=>{let t=new G(["shape","payload","ctx"]),r=s.value,n=e=>{let t=O.UQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),a=0;for(let e of r.keys)i[e]=`key_${a++}`;for(let e of(t.write("const newResult = {}"),r.keys))if(r.optionalKeys.has(e)){let r=i[e];t.write(`const ${r} = ${n(e)};`);let s=O.UQ(e);t.write(`
60        if (${r}.issues.length) {
61          if (input[${s}] === undefined) {
62            if (${s} in input) {
63              newResult[${s}] = undefined;
64            }
65          } else {
66            payload.issues = payload.issues.concat(
67              ${r}.issues.map((iss) => ({
68                ...iss,
69                path: iss.path ? [${s}, ...iss.path] : [${s}],
70              }))
71            );
72          }
73        } else if (${r}.value === undefined) {
74          if (${s} in input) newResult[${s}] = undefined;
75        } else {
76          newResult[${s}] = ${r}.value;
77        }
78        `)}else{let r=i[e];t.write(`const ${r} = ${n(e)};`),t.write(`
79          if (${r}.issues.length) payload.issues = payload.issues.concat(${r}.issues.map(iss => ({
80            ...iss,
81            path: iss.path ? [${O.UQ(e)}, ...iss.path] : [${O.UQ(e)}]
82          })));`),t.write(`newResult[${O.UQ(e)}] = ${r}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");let o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),n=r(n,l);else{n.value={};let e=i.shape;for(let t of i.keys){let r=e[t],i=r._zod.run({value:h[t],issues:[]},l),s="optional"===r._zod.optin&&"optional"===r._zod.optout;i instanceof Promise?p.push(i.then(e=>s?eZ(e,n,t,h):eE(e,n,t))):s?eZ(i,n,t,h):eE(i,n,t)}}if(!c)return p.length?Promise.all(p).then(()=>n):n;let d=[],f=i.keySet,m=c._zod,g=m.def.type;for(let e of Object.keys(h)){if(f.has(e))continue;if("never"===g){d.push(e);continue}let t=m.run({value:h[e],issues:[]},l);t instanceof Promise?p.push(t.then(t=>eE(t,n,e))):eE(t,n,e)}return(d.length&&n.issues.push({code:"unrecognized_keys",keys:d,input:h,inst:e}),p.length)?Promise.all(p).then(()=>n):n}});function eC(e,t,r,i){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>O.iR(e,i,n.$W())))}),t}let eN=n.xI("$ZodUnion",(e,t)=>{K.init(e,t),O.gJ(e._zod,"optin",()=>t.options.some(e=>
82"optional"===e._zod.optin)?"optional":void 0),O.gJ(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),O.gJ(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),O.gJ(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>O.p6(e.source)).join("|")})$`)}}),e._zod.parse=(r,n)=>{let i=!1,s=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},n);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>eC(t,r,e,n)):eC(s,r,e,n)}}),eF=n.xI("$ZodDiscriminatedUnion",(e,t)=>{eN.init(e,t);let r=e._zod.parse;O.gJ(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=O.PO(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(i,s)=>{let a=i.value;if(!O.Gv(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let o=n.value.get(a?.[t.discriminator]);return o?o._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[t.discriminator],inst:e}),i)}}),eL=n.xI("$ZodIntersection",(e,t)=>{K.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,r])=>eU(e,t,r)):eU(e,i,s)}});function eU(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),O.QH(e))return e;let n=function e(t,r){if(t===r||t instanceof Date&&r instanceof Date&&+t==+r)return{valid:!0,data:t};if(O.Qd(t)&&O.Qd(r)){let n=Object.keys(r),i=Object.keys(t).filter(e=>-1!==n.indexOf(e)),s={...t,...r};for(let n of i){let i=e(t[n],r[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};s[n]=i.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(r)){if(t.length!==r.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<t.length;i++){let s=e(t[i],r[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}(t.value,r.value);if(!n.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}let eM=n.xI("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,i)=>{let s=r.value;if(!O.Qd(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let a=[];if(t.keyType._zod.values){let n,o=t.keyType._zod.values;for(let e of(r.value={},o))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let n=t.valueType._zod.run({value:s[e],issues:[]},i);n instanceof Promise?a.push(n.then(t=>{t.issues.length&&r.issues.push(...O.lQ(e,t.issues)),r.value[e]=t.value})):(n.issues.length&&r.issues.push(...O.lQ(e,n.issues)),r.value[e]=n.value)}for(let e in s)o.has(e)||(n=n??[]).push(e);n&&n.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:n})}else for(let o of(r.value={},Reflect.ownKeys(s))){if("__proto__"===o)continue;let l=t.keyType._zod.run({value:o,issues:[]},i);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:l.issues.map(e=>O.iR(e,i,n.$W())),input:o,path:[o],inst:e}),r.value[l.value]=l.value;continue}let u=t.valueType._zod.run({value:s[o],issues:[]},i);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&r.issues.push(...O.lQ(o,e.issues)),r.value[l.value]=e.value})):(u.issues.length&&r.issues.push(...O.lQ(o,u.issues)),r.value[l.value]=u.value)}return a.length?Promise.all(a).then(()=>r):r}}),eD=n.xI("$ZodEnum",(e,t)=>{K.init(e,t);let r=O.w5(t.entries);e._zod.values=new Set(r),e._zod.pattern=RegExp(`^(${r.filter(e=>O.qQ.has(typeof e)).map(e=>"string"==typeof e?O.$f(e):e.toString()).join("|")})$`),e._zod.parse=(t,n)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:"invalid_value",values:r,input:i,inst:e}),t}}),eQ=n.xI("$ZodLiteral",(e,t)=>{K.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?O.$f(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(r,n)=>{let i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),eq=n.xI("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(e,r)=>{let i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(t=>(e.value=t,e));if(i instanceof Promise)throw new n.GT;return e.value=i,e}}),eJ=n.xI("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",O.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),O.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${O.p6(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,r):void 0===e.value?e:t.innerType._zod.run(e,r)}),eB=n.xI("$ZodNullable",(e,t)=>{K.init(e,t),O.gJ(e._zod,"optin",()=>t.innerType._zod.optin),O.gJ(e._zod,"optout",()=>t.innerType._zod.optout),O.gJ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${O.p6(e.source)}|null)$`):void 0}),O.gJ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),eW=n.xI("$ZodDefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",O.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>eH(e,t)):eH(n,t)}});function eH(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let eG=n.xI("$ZodPrefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",O.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),eY=n.xI("$ZodNonOptional",(e,t)=>{K.init(e,t),O.gJ(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>eV(t,e)):eV(i,e)}});function eV(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let eK=n.xI("$ZodCatch",(e,t)=>{K.init(e,t),e._zod.optin="optional",O.gJ(e._zod,"optout",()=>t.innerType._zod.optout),O.gJ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{let i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>O.iR(e,r,n.$W()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>O.iR(e,r,n.$W()))},input:e.value}),e.issues=[]),e)}}),eX=n.xI("$ZodPipe",(e,t)=>{K.init(e,t),O.gJ(e._zod,"values",()=>t.in._zod.values),O.gJ(e._zod,"optin",()=>t.in._zod.optin),O.gJ(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,r)=>{let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>e0(e,t,r)):e0(n,t,r)}});function e0(e,t,r){return O.QH(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}let e1=n.xI("$ZodReadonly",(e,t)=>{K.init(e,t),O.gJ(e._zod,"propValues",()=>t.innerType._zod.propValues),O.gJ(e._zod,"values",()=>t.innerType._zod.values),O.gJ(e._zod,"optin",()=>t.innerType._zod.optin),O.gJ(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,r)=>{let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e2):e2(n)}});function e2(e){return e.value=Object.freeze(e.value),e}let e9=n.xI("$ZodLazy",(e,t)=>{K.init(e,t),O.gJ(e._zod,"innerType",()=>t.getter()),O.gJ(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),O.gJ(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),O.gJ(e._zod,"optin",()=>e._zod.innerType._zod.optin),O.gJ(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),e3=n.xI("$ZodCustom",(e,t)=>{P.init(e,t),K.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>e4(t,r,n,e));e4(i,r,n,e)}});function e4(e,t,r,n){if(!e){let e={code:"custom",input:r,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(O.sn(e))}}var e6=r(31638);function e5(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O.A2(t)})}function e8(e,t){return new Z({check:"less_than",...O.A2(t),value:e,inclusive:!1})}function e7(e,t){return new Z({check:"less_than",...O.A2(t),value:e,inclusive:!0})}function te(e,t){return new j({check:"greater_than",...O.A2(t),value:e,inclusive:!1})}function tt(e,t){return new j({check:"greater_than",...O.A2(t),value:e,inclusive:!0})}function tr(e,t){return new C({check:"multiple_of",...O.A2(t),value:e})}function tn(e,t){return new F({check:"max_length",...O.A2(t),maximum:e})}function ti(e,t){return new L({check:"min_length",...O.A2(t),minimum:e})}function ts(e,t){return new U({check:"length_equals",...O.A2(t),length:e})}function ta(e){return new H({check:"overwrite",tx:e})}let to=n.xI("ZodISODateTime",(e,t)=>{ep.init(e,t),tg.init(e,t)}),tl=n.xI("ZodISODate",(e,t)=>{ed.init(e,t),tg.init(e,t)}),tu=n.xI("ZodISOTime",(e,t)=>{ef.init(e,t),tg.init(e,t)}),tc=n.xI("ZodISODuration",(e,t)=>{em.init(e,t),tg.init(e,t)});var th=r(48729);let tp=n.xI("ZodType",(e,t)=>(K.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,r)=>O.o8(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>th.qg(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>th.xL(e,t,r),e.parseAsync=async(t,r)=>th.EJ(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>th.bp(e,t,r),e.spa=e.safeParseAsync,e.refine=(t,r)=>e.check(function(e,t={}){return new rf({type:"custom",check:"custom",fn:e,...O.A2(t)})}(t,r)),e.superRefine=t=>e.check(function(e){let t=function(e){let t=new P({check:"custom"});return t._zod.check=e,t}(r=>(r.addIssue=e=>{"string"==typeof e?r.issues.push(O.sn(e,r.value,t._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=r.value),e.inst??(e.inst=t),e.continue??(e.continue=!t._zod.def.abort),r.issues.push(O.sn(e)))},e(r.value,r)));return t}(t)),e.overwrite=t=>
82e.check(ta(t)),e.optional=()=>rr(e),e.nullable=()=>ri(e),e.nullish=()=>rr(ri(e)),e.nonoptional=t=>{var r,n;return r=e,n=t,new ro({type:"nonoptional",innerType:r,...O.A2(n)})},e.array=()=>tG(e),e.or=t=>t0([e,t]),e.and=t=>new t9({type:"intersection",left:e,right:t}),e.transform=t=>rc(e,new re({type:"transform",transform:t})),e.default=t=>(function(e,t){return new rs({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})})(e,t),e.prefault=t=>(function(e,t){return new ra({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})})(e,t),e.catch=t=>(function(e,t){return new rl({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})})(e,t),e.pipe=t=>rc(e,t),e.readonly=()=>new rh({type:"readonly",innerType:e}),e.describe=t=>{let r=e.clone();return e6.fd.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>e6.fd.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return e6.fd.get(e);let r=e.clone();return e6.fd.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),td=n.xI("_ZodString",(e,t)=>{X.init(e,t),tp.init(e,t);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new D({check:"string_format",format:"regex",...O.A2(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new J({check:"string_format",format:"includes",...O.A2(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new B({check:"string_format",format:"starts_with",...O.A2(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new W({check:"string_format",format:"ends_with",...O.A2(t),suffix:e})}(...t)),e.min=(...t)=>e.check(ti(...t)),e.max=(...t)=>e.check(tn(...t)),e.length=(...t)=>e.check(ts(...t)),e.nonempty=(...t)=>e.check(ti(1,...t)),e.lowercase=t=>e.check(new Q({check:"string_format",format:"lowercase",...O.A2(t)})),e.uppercase=t=>e.check(new q({check:"string_format",format:"uppercase",...O.A2(t)})),e.trim=()=>e.check(ta(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ta(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ta(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ta(e=>e.toUpperCase()))}),tf=n.xI("ZodString",(e,t)=>{X.init(e,t),td.init(e,t),e.email=t=>e.check(new ty({type:"string",format:"email",check:"string_format",abort:!1,...O.A2(t)})),e.url=t=>e.check(new tk({type:"string",format:"url",check:"string_format",abort:!1,...O.A2(t)})),e.jwt=t=>e.check(new tj({type:"string",format:"jwt",check:"string_format",abort:!1,...O.A2(t)})),e.emoji=t=>e.check(new tx({type:"string",format:"emoji",check:"string_format",abort:!1,...O.A2(t)})),e.guid=t=>e.check(e5(tv,t)),e.uuid=t=>e.check(new tb({type:"string",format:"uuid",check:"string_format",abort:!1,...O.A2(t)})),e.uuidv4=t=>e.check(new tb({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O.A2(t)})),e.uuidv6=t=>e.check(new tb({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O.A2(t)})),e.uuidv7=t=>e.check(new tb({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O.A2(t)})),e.nanoid=t=>e.check(new tw({type:"string",format:"nanoid",check:"string_format",abort:!1,...O.A2(t)})),e.guid=t=>e.check(e5(tv,t)),e.cuid=t=>e.check(new t_({type:"string",format:"cuid",check:"string_format",abort:!1,...O.A2(t)})),e.cuid2=t=>e.check(new tz({type:"string",format:"cuid2",check:"string_format",abort:!1,...O.A2(t)})),e.ulid=t=>e.check(new t$({type:"string",format:"ulid",check:"string_format",abort:!1,...O.A2(t)})),e.base64=t=>e.check(new tP({type:"string",format:"base64",check:"string_format",abort:!1,...O.A2(t)})),e.base64url=t=>e.check(new tE({type:"string",format:"base64url",check:"string_format",abort:!1,...O.A2(t)})),e.xid=t=>e.check(new tS({type:"string",format:"xid",check:"string_format",abort:!1,...O.A2(t)})),e.ksuid=t=>e.check(new tI({type:"string",format:"ksuid",check:"string_format",abort:!1,...O.A2(t)})),e.ipv4=t=>e.check(new tT({type:"string",format:"ipv4",check:"string_format",abort:!1,...O.A2(t)})),e.ipv6=t=>e.check(new tA({type:"string",format:"ipv6",check:"string_format",abort:!1,...O.A2(t)})),e.cidrv4=t=>e.check(new tR({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O.A2(t)})),e.cidrv6=t=>e.check(new tO({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O.A2(t)})),e.e164=t=>e.check(new tZ({type:"string",format:"e164",check:"string_format",abort:!1,...O.A2(t)})),e.datetime=t=>e.check(function(e){return new to({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O.A2(e)})}(t)),e.date=t=>e.check(function(e){return new tl({type:"string",format:"date",check:"string_format",...O.A2(e)})}(t)),e.time=t=>e.check(function(e){return new tu({type:"string",format:"time",check:"string_format",precision:null,...O.A2(e)})}(t)),e.duration=t=>e.check(function(e){return new tc({type:"string",format:"duration",check:"string_format",...O.A2(e)})}(t))});function tm(e){return new tf({type:"string",...O.A2(e)})}let tg=n.xI("ZodStringFormat",(e,t)=>{ee.init(e,t),td.init(e,t)}),ty=n.xI("ZodEmail",(e,t)=>{en.init(e,t),tg.init(e,t)}),tv=n.xI("ZodGUID",(e,t)=>{et.init(e,t),tg.init(e,t)}),tb=n.xI("ZodUUID",(e,t)=>{er.init(e,t),tg.init(e,t)}),tk=n.xI("ZodURL",(e,t)=>{ei.init(e,t),tg.init(e,t)}),tx=n.xI("ZodEmoji",(e,t)=>{es.init(e,t),tg.init(e,t)}),tw=n.xI("ZodNanoID",(e,t)=>{ea.init(e,t),tg.init(e,t)}),t_=n.xI("ZodCUID",(e,t)=>{eo.init(e,t),tg.init(e,t)}),tz=n.xI("ZodCUID2",(e,t)=>{el.init(e,t),tg.init(e,t)}),t$=n.xI("ZodULID",(e,t)=>{eu.init(e,t),tg.init(e,t)}),tS=n.xI("ZodXID",(e,t)=>{ec.init(e,t),tg.init(e,t)}),tI=n.xI("ZodKSUID",(e,t)=>{eh.init(e,t),tg.init(e,t)}),tT=n.xI("ZodIPv4",(e,t)=>{eg.init(e,t),tg.init(e,t)}),tA=n.xI("ZodIPv6",(e,t)=>{ey.init(e,t),tg.init(e,t)}),tR=n.xI("ZodCIDRv4",(e,t)=>{ev.init(e,t),tg.init(e,t)}),tO=n.xI("ZodCIDRv6",(e,t)=>{eb.init(e,t),tg.init(e,t)}
82),tP=n.xI("ZodBase64",(e,t)=>{ex.init(e,t),tg.init(e,t)}),tE=n.xI("ZodBase64URL",(e,t)=>{ew.init(e,t),tg.init(e,t)}),tZ=n.xI("ZodE164",(e,t)=>{e_.init(e,t),tg.init(e,t)}),tj=n.xI("ZodJWT",(e,t)=>{ez.init(e,t),tg.init(e,t)}),tC=n.xI("ZodNumber",(e,t)=>{e$.init(e,t),tp.init(e,t),e.gt=(t,r)=>e.check(te(t,r)),e.gte=(t,r)=>e.check(tt(t,r)),e.min=(t,r)=>e.check(tt(t,r)),e.lt=(t,r)=>e.check(e8(t,r)),e.lte=(t,r)=>e.check(e7(t,r)),e.max=(t,r)=>e.check(e7(t,r)),e.int=t=>e.check(tL(t)),e.safe=t=>e.check(tL(t)),e.positive=t=>e.check(te(0,t)),e.nonnegative=t=>e.check(tt(0,t)),e.negative=t=>e.check(e8(0,t)),e.nonpositive=t=>e.check(e7(0,t)),e.multipleOf=(t,r)=>e.check(tr(t,r)),e.step=(t,r)=>e.check(tr(t,r)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??-1/0,r.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(r.maximum??1/0,r.exclusiveMaximum??1/0)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function tN(e){return new tC({type:"number",checks:[],...O.A2(e)})}let tF=n.xI("ZodNumberFormat",(e,t)=>{eS.init(e,t),tC.init(e,t)});function tL(e){return new tF({type:"number",check:"number_format",abort:!1,format:"safeint",...O.A2(e)})}let tU=n.xI("ZodBoolean",(e,t)=>{eI.init(e,t),tp.init(e,t)});function tM(e){return new tU({type:"boolean",...O.A2(e)})}let tD=n.xI("ZodNull",(e,t)=>{eT.init(e,t),tp.init(e,t)});function tQ(e){return new tD({type:"null",...O.A2(e)})}let tq=n.xI("ZodUnknown",(e,t)=>{eA.init(e,t),tp.init(e,t)});function tJ(){return new tq({type:"unknown"})}let tB=n.xI("ZodNever",(e,t)=>{eR.init(e,t),tp.init(e,t)});function tW(e){return new tB({type:"never",...O.A2(e)})}let tH=n.xI("ZodArray",(e,t)=>{eP.init(e,t),tp.init(e,t),e.element=t.element,e.min=(t,r)=>e.check(ti(t,r)),e.nonempty=t=>e.check(ti(1,t)),e.max=(t,r)=>e.check(tn(t,r)),e.length=(t,r)=>e.check(ts(t,r)),e.unwrap=()=>e.element});function tG(e,t){return new tH({type:"array",element:e,...O.A2(t)})}let tY=n.xI("ZodObject",(e,t)=>{ej.init(e,t),tp.init(e,t),O.gJ(e,"shape",()=>t.shape),e.keyof=()=>t5(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:tJ()}),e.loose=()=>e.clone({...e._zod.def,catchall:tJ()}),e.strict=()=>e.clone({...e._zod.def,catchall:tW()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>O.X$(e,t),e.merge=t=>O.h1(e,t),e.pick=t=>O.Up(e,t),e.omit=t=>O.cJ(e,t),e.partial=(...t)=>O.OH(rt,e,t[0]),e.required=(...t)=>O.mw(ro,e,t[0])});function tV(e,t){return new tY({type:"object",get shape(){return O.Vy(this,"shape",{...e}),this.shape},...O.A2(t)})}function tK(e,t){return new tY({type:"object",get shape(){return O.Vy(this,"shape",{...e}),this.shape},catchall:tW(),...O.A2(t)})}let tX=n.xI("ZodUnion",(e,t)=>{eN.init(e,t),tp.init(e,t),e.options=t.options});function t0(e,t){return new tX({type:"union",options:e,...O.A2(t)})}let t1=n.xI("ZodDiscriminatedUnion",(e,t)=>{tX.init(e,t),eF.init(e,t)});function t2(e,t,r){return new t1({type:"union",options:t,discriminator:e,...O.A2(r)})}let t9=n.xI("ZodIntersection",(e,t)=>{eL.init(e,t),tp.init(e,t)}),t3=n.xI("ZodRecord",(e,t)=>{eM.init(e,t),tp.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function t4(e,t,r){return new t3({type:"record",keyType:e,valueType:t,...O.A2(r)})}let t6=n.xI("ZodEnum",(e,t)=>{eD.init(e,t),tp.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new t6({...t,checks:[],...O.A2(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new t6({...t,checks:[],...O.A2(n),entries:i})}});function t5(e,t){return new t6({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...O.A2(t)})}let t8=n.xI("ZodLiteral",(e,t)=>{eQ.init(e,t),tp.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if
82(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function t7(e,t){return new t8({type:"literal",values:Array.isArray(e)?e:[e],...O.A2(t)})}let re=n.xI("ZodTransform",(e,t)=>{eq.init(e,t),tp.init(e,t),e._zod.parse=(r,n)=>{r.addIssue=n=>{"string"==typeof n?r.issues.push(O.sn(n,r.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!0),r.issues.push(O.sn(n)))};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}}),rt=n.xI("ZodOptional",(e,t)=>{eJ.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rr(e){return new rt({type:"optional",innerType:e})}let rn=n.xI("ZodNullable",(e,t)=>{eB.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ri(e){return new rn({type:"nullable",innerType:e})}let rs=n.xI("ZodDefault",(e,t)=>{eW.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ra=n.xI("ZodPrefault",(e,t)=>{eG.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.innerType}),ro=n.xI("ZodNonOptional",(e,t)=>{eY.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.innerType}),rl=n.xI("ZodCatch",(e,t)=>{eK.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),ru=n.xI("ZodPipe",(e,t)=>{eX.init(e,t),tp.init(e,t),e.in=t.in,e.out=t.out});function rc(e,t){return new ru({type:"pipe",in:e,out:t})}let rh=n.xI("ZodReadonly",(e,t)=>{e1.init(e,t),tp.init(e,t)}),rp=n.xI("ZodLazy",(e,t)=>{e9.init(e,t),tp.init(e,t),e.unwrap=()=>e._zod.def.getter()});function rd(e){return new rp({type:"lazy",getter:e})}let rf=n.xI("ZodCustom",(e,t)=>{e3.init(e,t),tp.init(e,t)});function rm(e,t){let r=O.A2(t);return r.abort??(r.abort=!0),new rf({type:"custom",check:"custom",fn:e??(()=>!0),...r})}function rg(e,t={error:`Input not instance of ${e.name}`}){let r=new rf({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...O.A2(t)});return r._zod.bag.Class=e,r}},92659:(e,t,r)=>{r.d(t,{Q:()=>n});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},92997:(e,t,r)=>{r.d(t,{T:()=>n});function n(){let e,t,r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}},97115:(e,t,r)=>{r.d(t,{W:()=>w,nV:()=>x,mD:()=>er,Z9:()=>g,n_:()=>y,hK:()=>I,$C:()=>T,G1:()=>A,ID:()=>ee,qx:()=>R,_Z:()=>eo,cS:()=>_,hd:()=>el,N8:()=>ea,ZZ:()=>es,uM:()=>z,k5:()=>ei,WZ:()=>O,jN:()=>en});var n,i,s=r(97582),a=r(31638),o=r(33821);class l{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??a.fd,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var r;let n=e._zod.def,i=this.seen.get(e);if(i)return i.count++,t.schemaPath.includes(e)&&(i.cycle=t.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let r={...t,schemaPath:[...t.schemaPath,e],path:t.path},i=e._zod.parent;if(i)s.ref=i,this.process(i,r),this.seen.get(i).isParent=!0;else{let t=s.schema;switch(n.type){case"string":{t.type="string";let{minimum:r,maximum:n,format:i,patterns:a,contentEncoding:o}=e._zod.bag;if("number"==typeof r&&(t.minLength=r),"number"==typeof n&&(t.maxLength=n),i&&(t.format=({guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""})[i]??i,""===t.format&&delete t.format),o&&(t.contentEncoding=o),a&&a.size>0){let e=[...a];1===e.length?t.pattern=e[0].source:e.length>1&&(s.schema.allOf=[...e.map(e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source}))])}break}case"number":{let{minimum:r,maximum:n,format:i,multipleOf:s,exclusiveMaximum:a,exclusiveMinimum:o}=e._zod.bag;"string"==typeof i&&i.includes("int")?t.type="integer":t.type="number","number"==typeof o&&(t.exclusiveMinimum=o),"number"==typeof r&&(t.minimum=r,"number"==typeof o&&(o>=r?delete t.minimum:delete t.exclusiveMinimum)),"number"==typeof a&&(t.exclusiveMaximum=a),"number"==typeof n&&(t.maximum=n,"number"==typeof a&&(a<=n?delete t.maximum:delete t.exclusiveMaximum)),"number"==typeof s&&(t.multipleOf=s);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw Error("Date cannot be represented in JSON Schema");break;case"array":{let{minimum:i,maximum:s}=e._zod.bag;"number"==typeof i&&(t.minItems=i),"number"==typeof s&&(t.maxItems=s),t.type="array",t.items=this.process(n.element,{...r,path:[...r.path,"items"]});break}case"object":{t.type="object",t.properties={};let e=n.shape;for(let n in e)t.properties[n]=this.process(e[n],{...r,path:[...r.path,"properties",n]});let i=new Set([...new Set(Object.keys(e))].filter(e=>{let t=n.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout}));i.size>0&&(t.required=Array.from(i)),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=this.process(n.catchall,{...r,path:[...r.path,"additionalProperties"]})):"output"===this.io&&(t.additionalProperties=!1);break}case"union":t.anyOf=n.options.map((e,t)=>this.process(e,{...r,path:[...r.path,"anyOf",t]}));break;case"intersection":{let e=this.process(n.left,{...r,path:[...r.path,"allOf",0]}),i=this.process(n.right,{...r,path:[...r.path,"allOf",1]}),s=e=>"allOf"in e&&1===Object.keys(e).length;t.allOf=[...s(e)?e.allOf:[e],...s(i)?i.allOf:[i]];break}case"tuple":{t.type="array";let i=n.items.map((e,t)=>this.process(e,{...r,path:[...r.path,"prefixItems",t]}));
82if("draft-2020-12"===this.target?t.prefixItems=i:t.items=i,n.rest){let e=this.process(n.rest,{...r,path:[...r.path,"items"]});"draft-2020-12"===this.target?t.items=e:t.additionalItems=e}n.rest&&(t.items=this.process(n.rest,{...r,path:[...r.path,"items"]}));let{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(t.minItems=s),"number"==typeof a&&(t.maxItems=a);break}case"record":t.type="object",t.propertyNames=this.process(n.keyType,{...r,path:[...r.path,"propertyNames"]}),t.additionalProperties=this.process(n.valueType,{...r,path:[...r.path,"additionalProperties"]});break;case"map":if("throw"===this.unrepresentable)throw Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw Error("Set cannot be represented in JSON Schema");break;case"enum":{let e=(0,o.w5)(n.entries);e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=e;break}case"literal":{let e=[];for(let t of n.values)if(void 0===t){if("throw"===this.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof t)if("throw"===this.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else e.push(Number(t));else e.push(t);if(0===e.length);else if(1===e.length){let r=e[0];t.type=null===r?"null":typeof r,t.const=r}else e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),e.every(e=>"boolean"==typeof e)&&(t.type="string"),e.every(e=>null===e)&&(t.type="null"),t.enum=e;break}case"file":{let r={type:"string",format:"binary",contentEncoding:"binary"},{minimum:n,maximum:i,mime:s}=e._zod.bag;void 0!==n&&(r.minLength=n),void 0!==i&&(r.maxLength=i),s?1===s.length?(r.contentMediaType=s[0],Object.assign(t,r)):t.anyOf=s.map(e=>({...r,contentMediaType:e})):Object.assign(t,r);break}case"transform":if("throw"===this.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema");break;case"nullable":t.anyOf=[this.process(n.innerType,r),{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(n.innerType,r),s.ref=n.innerType;break;case"default":this.process(n.innerType,r),s.ref=n.innerType,t.default=JSON.parse(JSON.stringify(n.defaultValue));break;case"prefault":this.process(n.innerType,r),s.ref=n.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break;case"catch":{let e;this.process(n.innerType,r),s.ref=n.innerType;try{e=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{let r=e._zod.pattern;if(!r)throw Error("Pattern not found in template literal");t.type="string",t.pattern=r.source;break}case"pipe":{let e="input"===this.io?"transform"===n.in._zod.def.type?n.out:n.in:n.out;this.process(e,r),s.ref=e;break}case"readonly":this.process(n.innerType,r),s.ref=n.innerType,t.readOnly=!0;break;case"lazy":{let t=e._zod.innerType;this.process(t,r),s.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")}}}let l=this.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===this.io&&function e(t,r){let n=r??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let i=t._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return e(i.element,n);case"object":for(let t in i.shape)if(e(i.shape[t],n))return!0;return!1;case"union":for(let t of i.options)if(e(t,n))return!0;return!1;case"intersection":return e(i.left,n)||e(i.right,n);case"tuple":for(let t of i.items)if(e(t,n))return!0;if(i.rest&&e(i.rest,n))return!0;return!1;case"record":case"map":return e(i.keyType,n)||e(i.valueType,n);case"set":return e(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return e(i.innerType,n);case"lazy":return e(i.getter(),n);case"transform":return!0;case"pipe":return e(i.in,n)||e(i.out,n)}throw Error(`Unknown schema type: ${i.type}`)}(e)&&(delete s.schema.examples,delete s.schema.default),"input"===this.io&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,t){let r={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let i=e=>
82{let t="draft-2020-12"===this.target?"$defs":"definitions";if(r.external){let n=r.external.registry.get(e[0])?.id,i=r.external.uri??(e=>e);if(n)return{ref:i(n)};let s=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=s,{defId:s,ref:`${i("__shared")}#/${t}/${s}`}}if(e[1]===n)return{ref:"#"};let i=`#/${t}/`,s=e[1].schema.id??`__schema${this.counter++}`;return{defId:s,ref:i+s}},s=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:r,defId:n}=i(e);t.def={...t.schema},n&&(t.defId=n);let s=t.schema;for(let e in s)delete s[e];s.$ref=r};if("throw"===r.cycles)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/<root>
83
84Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let n=t[1];if(e===t[0]){s(t);continue}if(r.external){let n=r.external.registry.get(t[0])?.id;if(e!==t[0]&&n){s(t);continue}}if(this.metadataRegistry.get(t[0])?.id||n.cycle||n.count>1&&"ref"===r.reused){s(t);continue}}let a=(e,t)=>{let r=this.seen.get(e),n=r.def??r.schema,i={...n};if(null===r.ref)return;let s=r.ref;if(r.ref=null,s){a(s,t);let e=this.seen.get(s).schema;e.$ref&&"draft-7"===t.target?(n.allOf=n.allOf??[],n.allOf.push(e)):(Object.assign(n,e),Object.assign(n,i))}r.isParent||this.override({zodSchema:e,jsonSchema:n,path:r.path??[]})};for(let e of[...this.seen.entries()].reverse())a(e[0],{target:this.target});let o={};if("draft-2020-12"===this.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?o.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){let t=r.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");o.$id=r.external.uri(t)}Object.assign(o,n.def);let l=r.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}r.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?o.$defs=l:o.definitions=l);try{return JSON.parse(JSON.stringify(o))}catch(e){throw Error("Error converting schema to JSON.")}}}var u=r(48729),c=r(28453);
84class h extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function p(e){}class d extends TransformStream{constructor({onError:e,onRetry:t,onComment:r}={}){let n;super({start(i){n=function(e){if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=p,onError:r=p,onRetry:n=p,onComment:i}=e,s="",a=!0,o,l="",u="";function c(e){if(""===e)return void(l.length>0&&t({id:o,event:u||void 0,data:l.endsWith(`
85`)?l.slice(0,-1):l}),o=void 0,l="",u="");if(e.startsWith(":")){i&&i(e.slice(e.startsWith(": ")?2:1));return}let r=e.indexOf(":");if(-1!==r){let t=e.slice(0,r),n=" "===e[r+1]?2:1;d(t,e.slice(r+n),e);return}d(e,"",e)}function d(e,t,i){switch(e){case"event":u=t;break;case"data":l=`${l}${t}
86`;break;case"id":o=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?n(parseInt(t,10)):r(new h(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:i}));break;default:r(new h(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:i}))}}return{feed:function(e){let t=a?e.replace(/^\xEF\xBB\xBF/,""):e,[r,n]=function(e){let t=[],r="",n=0;for(;n<e.length;){let i=e.indexOf("\r",n),s=e.indexOf(`
87`,n),a=-1;if(-1!==i&&-1!==s?a=Math.min(i,s):-1!==i?a=i===e.length-1?-1:i:-1!==s&&(a=s),-1===a){r=e.slice(n);break}{let r=e.slice(n,a);t.push(r),"\r"===e[(n=a+1)-1]&&e[n]===`
88`&&n++}}return[t,r]}(`${s}${t}`);for(let e of r)c(e);s=n,a=!1},reset:function(e={}){s&&e.consume&&c(s),a=!0,o=void 0,l="",u="",s=""}}}({onEvent:e=>{i.enqueue(e)},onError(t){"terminate"===e?i.error(t):"function"==typeof e&&e(t)},onRetry:t,onComment:r})},transform(e){n.feed(e)}})}}r(46142);var{btoa:f,atob:m}=globalThis;function g(e){let t=m(e.replace(/-/g,"+").replace(/_/g,"/"));return Uint8Array.from(t,e=>e.codePointAt(0))}function y(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCodePoint(e[r]);return f(t)}var v="AI_DownloadError",b=`vercel.ai.error.${v}`,k=Symbol.for(b),x=class extends(i=s.bD,n=k,i){constructor({url:e,statusCode:t,statusText:r,cause:i,message:s=null==i?`Failed to download ${e}: ${t} ${r}`:`Failed to download ${e}: ${i}`}){super({name:v,message:s,cause:i}),this[n]=!0,this.url=e,this.statusCode=t,this.statusText=r}static isInstance(e){return s.bD.hasMarker(e,b)}},w=0x80000000;async function _({response:e,url:t,maxBytes:r=w}){let n=e.headers.get("content-length");if(null!=n){let e=parseInt(n,10);if(!isNaN(e)&&e>r)throw new x({url:t,message:`Download of ${t} exceeded maximum size of ${r} bytes (Content-Length: ${e}).`})}let i=e.body;if(null==i)return new Uint8Array(0);let s=i.getReader(),a=[],o=0;try{for(;;){let{done:e,value:n}=await s.read();if(e)break;if((o+=n.length)>r)throw new x({url:t,message:`Download of ${t} exceeded maximum size of ${r} bytes.`});a.push(n)}}finally{try{await s.cancel()}finally{s.releaseLock()}}let l=new Uint8Array(o),u=0;
88for(let e of a)l.set(e,u),u+=e.length;return l}function z(e){let t;try{t=new URL(e)}catch(t){throw new x({url:e,message:`Invalid URL: ${e}`})}if("http:"!==t.protocol&&"https:"!==t.protocol)throw new x({url:e,message:`URL scheme must be http or https, got ${t.protocol}`});let r=t.hostname;if(!r)throw new x({url:e,message:"URL must have a hostname"});if("localhost"===r||r.endsWith(".local")||r.endsWith(".localhost"))throw new x({url:e,message:`URL with hostname ${r} is not allowed`});if(r.startsWith("[")&&r.endsWith("]")){if(function(e){let t=e.toLowerCase();if("::1"===t||"::"===t)return!0;if(t.startsWith("::ffff:")){let e=t.slice(7);if($(e))return S(e);let r=e.split(":");if(2===r.length){let e=parseInt(r[0],16),t=parseInt(r[1],16);if(!isNaN(e)&&!isNaN(t))return S(`${e>>8&255}.${255&e}.${t>>8&255}.${255&t}`)}}return!!(t.startsWith("fc")||t.startsWith("fd")||t.startsWith("fe80"))}(r.slice(1,-1)))throw new x({url:e,message:`URL with IPv6 address ${r} is not allowed`});return}if($(r)){if(S(r))throw new x({url:e,message:`URL with IP address ${r} is not allowed`});return}}function $(e){let t=e.split(".");return 4===t.length&&t.every(e=>{let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255&&String(t)===e})}function S(e){let[t,r]=e.split(".").map(Number);return 0===t||10===t||127===t||169===t&&254===r||172===t&&!!(r>=16)&&!!(r<=31)||192===t&&168===r}var I=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let i=()=>{let e=r.length,n=Array(t);for(let i=0;i<t;i++)n[i]=r[Math.random()*e|0];return n.join("")};if(null==e)return i;if(r.includes(n))throw new s.Di({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return()=>`${e}${n}${i()}`},T=I();function A(e=globalThis){var t,r,n;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(n=null==(r=e.process)?void 0:r.versions)?void 0:n.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function R(e){if(null==e)return{};let t={};if(e instanceof Headers)e.forEach((e,r)=>{t[r.toLowerCase()]=e});else for(let[r,n]of(Array.isArray(e)||(e=Object.entries(e)),e))null!=n&&(t[r.toLowerCase()]=n);return t}function O(e,...t){let r=new Headers(R(e)),n=r.get("user-agent")||"";return r.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var P=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,E=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Z(e){let t=JSON.parse(e);return null===t||"object"!=typeof t||!1===P.test(e)&&!1===E.test(e)?t:function(e){let t=[e];for(;t.length;){let e=t;for(let r of(t=[],e)){if(Object.prototype.hasOwnProperty.call(r,"__proto__")||Object.prototype.hasOwnProperty.call(r,"constructor")&&null!==r.constructor&&"object"==typeof r.constructor&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let e in r){let n=r[e];n&&"object"==typeof n&&t.push(n)}}}return e}(t)}function j(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=C(t[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(C):C(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(C)),null!=e.allOf&&(e.allOf=e.allOf.map(C)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(C));let{definitions:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=C(t[e]);return e}function C(e){return"boolean"==typeof e?e:j(e)}var N=Symbol("Let zodToJsonSchema decide on which parser to use"),F={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function L(e,t){return Y(e.type._def,t)}var U=void 0,M={cuid:/^[cC][^\s-]{8,}
88$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===U&&(U=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),U),ipv4Cidr:/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function D(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":r.minLength="number"==typeof r.minLength?Math.max(r.minLength,n.value):n.value;break;case"max":r.maxLength="number"==typeof r.maxLength?Math.min(r.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":J(r,"email",n.message,t);break;case"format:idn-email":J(r,"idn-email",n.message,t);break;case"pattern:zod":B(r,M.email,n.message,t)}break;case"url":J(r,"uri",n.message,t);break;case"uuid":J(r,"uuid",n.message,t);break;case"regex":B(r,n.regex,n.message,t);break;case"cuid":B(r,M.cuid,n.message,t);break;case"cuid2":B(r,M.cuid2,n.message,t);break;case"startsWith":B(r,RegExp(`^${Q(n.value,t)}`),n.message,t);break;case"endsWith":B(r,RegExp(`${Q(n.value,t)}$`),n.message,t);break;case"datetime":J(r,"date-time",n.message,t);break;case"date":J(r,"date",n.message,t);break;case"time":J(r,"time",n.message,t);break;case"duration":J(r,"duration",n.message,t);break;case"length":r.minLength="number"==typeof r.minLength?Math.max(r.minLength,n.value):n.value,r.maxLength="number"==typeof r.maxLength?Math.min(r.maxLength,n.value):n.value;break;case"includes":B(r,RegExp(Q(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&J(r,"ipv4",n.message,t),"v4"!==n.version&&J(r,"ipv6",n.message,t);break;case"base64url":B(r,M.base64url,n.message,t);break;case"jwt":B(r,M.jwt,n.message,t);break;case"cidr":"v6"!==n.version&&B(r,M.ipv4Cidr,n.message,t),"v4"!==n.version&&B(r,M.ipv6Cidr,n.message,t);break;case"emoji":B(r,M.emoji(),n.message,t);break;case"ulid":B(r,M.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":J(r,"binary",n.message,t);break;case"contentEncoding:base64":r.contentEncoding="base64";break;case"pattern:zod":B(r,M.base64,n.message,t)}break;case"nanoid":B(r,M.nanoid,n.message,t)}return r}function Q(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;r<e.length;r++)q.has(e[r])||(t+="\\"),t+=e[r];return t}(e):e}var q=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function J(e,t,r,n){var i;e.format||(null==(i=e.anyOf)?void 0:i.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):e.format=t}function B(e,t,r,n){var i;e.pattern||(null==(i=e.allOf)?void 0:i.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:W(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):e.pattern=W(t,n)}function W(e,t){var r;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=n.i?e.source.toLowerCase():e.source,s="",a=!1,o=!1,l=!1;for(let e=0;e<i.length;e++){if(a){s+=i[e],a=!1;continue}
88if(n.i){if(o){if(i[e].match(/[a-z]/)){l?(s+=i[e],s+=`${i[e-2]}-${i[e]}`.toUpperCase(),l=!1):"-"===i[e+1]&&(null==(r=i[e+2])?void 0:r.match(/[a-z]/))?(s+=i[e],l=!0):s+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){s+=`[${i[e]}${i[e].toUpperCase()}]`;continue}}if(n.m){if("^"===i[e]){s+=`(^|(?<=[\r
89]))`;continue}else if("$"===i[e]){s+=`($|(?=[\r
90]))`;continue}}if(n.s&&"."===i[e]){s+=o?`${i[e]}\r
91`:`[${i[e]}\r
92]`;continue}s+=i[e],"\\"===i[e]?a=!0:o&&"]"===i[e]?o=!1:o||"["!==i[e]||(o=!0)}try{new RegExp(s)}catch(r){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function H(e,t){var r,n,i,s,a,o;let l={type:"object",additionalProperties:null!=(r=Y(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?r:t.allowedAdditionalProperties};if((null==(n=e.keyType)?void 0:n._def.typeName)===c.kY.ZodString&&(null==(i=e.keyType._def.checks)?void 0:i.length)){let{type:r,...n}=D(e.keyType._def,t);return{...l,propertyNames:n}}if((null==(s=e.keyType)?void 0:s._def.typeName)===c.kY.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(a=e.keyType)?void 0:a._def.typeName)===c.kY.ZodBranded&&e.keyType._def.type._def.typeName===c.kY.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){let{type:r,...n}=L(e.keyType._def,t);return{...l,propertyNames:n}}return l}var G={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Y(e,t,r=!1){var n;let i=t.seen.get(e);if(t.override){let s=null==(n=t.override)?void 0:n.call(t,e,t,i,r);if(s!==N)return s}if(i&&!r){let e=V(i,t);if(void 0!==e)return e}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let a=((e,t,r)=>{switch(t){case c.kY.ZodString:return D(e,r);case c.kY.ZodNumber:var n,i,s,a,o,l,u=e;let h={type:"number"};if(!u.checks)return h;for(let e of u.checks)switch(e.kind){case"int":h.type="integer";break;case"min":e.inclusive?h.minimum=e.value:h.exclusiveMinimum=e.value;break;case"max":e.inclusive?h.maximum=e.value:h.exclusiveMaximum=e.value;break;case"multipleOf":h.multipleOf=e.value}return h;case c.kY.ZodObject:return function(e,t){let r={type:"object",properties:{}},n=[],i=e.shape();for(let e in i){let s=i[e];if(void 0===s||void 0===s._def)continue;let a=function(e){try{return e.isOptional()}catch(e){return!0}}(s),o=Y(s._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(r.properties[e]=o,a||n.push(e))}n.length&&(r.required=n);let s=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return Y(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==s&&(r.additionalProperties=s),r}(e,r);case c.kY.ZodBigInt:var p=e;let d={type:"integer",format:"int64"};if(!p.checks)return d;for(let e of p.checks)switch(e.kind){case"min":e.inclusive?d.minimum=e.value:d.exclusiveMinimum=e.value;break;case"max":e.inclusive?d.maximum=e.value:d.exclusiveMaximum=e.value;break;case"multipleOf":d.multipleOf=e.value}return d;case c.kY.ZodBoolean:return{type:"boolean"};case c.kY.ZodDate:return function e(t,r,n){let i=null!=n?n:r.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((n,i)=>e(t,r,n))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var s=t;let a={type:"integer",format:"unix-time"};for(let e of s.checks)switch(e.kind){case"min":a.minimum=e.value;break;case"max":a.maximum=e.value}return a}}(e,r);case c.kY.ZodUndefined:return{not:{}};case c.kY.ZodNull:return{type:"null"};case c.kY.ZodArray:var f,m,g,y=e,v=r;let b={type:"array"};return(null==(f=y.type)?void 0:f._def)&&(null==(g=null==(m=y.type)?void 0:m._def)?void 0:g.typeName)!==c.kY.ZodAny&&(b.items=Y(y.type._def,{...v,currentPath:[...v.currentPath,"items"]})),y.minLength&&(b.minItems=y.minLength.value),y.maxLength&&(b.maxItems=y.maxLength.value),y.exactLength&&(b.minItems=y.exactLength.value,b.maxItems=y.exactLength.value),b;case c.kY.ZodUnion:case c.kY.ZodDiscriminatedUnion:return function(e,t){let r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(e=>e._def.typeName in G&&(!e._def.checks||!e._def.checks.length))){let e=r.reduce((e,t)=>
92{let r=G[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(r.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=r.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===r.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:r.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(r.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:r.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};var n=e,i=t;let s=(n.options instanceof Map?Array.from(n.options.values()):n.options).map((e,t)=>Y(e._def,{...i,currentPath:[...i.currentPath,"anyOf",`${t}`]})).filter(e=>!!e&&(!i.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return s.length?{anyOf:s}:void 0}(e,r);case c.kY.ZodIntersection:var k=e,x=r;let w=[Y(k.left._def,{...x,currentPath:[...x.currentPath,"allOf","0"]}),Y(k.right._def,{...x,currentPath:[...x.currentPath,"allOf","1"]})].filter(e=>!!e),_=[];return w.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)_.push(...e.allOf);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...n}=e;t=n}_.push(t)}}),_.length?{allOf:_}:void 0;case c.kY.ZodTuple:return E=e,Z=r,E.rest?{type:"array",minItems:E.items.length,items:E.items.map((e,t)=>Y(e._def,{...Z,currentPath:[...Z.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:Y(E.rest._def,{...Z,currentPath:[...Z.currentPath,"additionalItems"]})}:{type:"array",minItems:E.items.length,maxItems:E.items.length,items:E.items.map((e,t)=>Y(e._def,{...Z,currentPath:[...Z.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case c.kY.ZodRecord:return H(e,r);case c.kY.ZodLiteral:var z=e;let $=typeof z.value;return"bigint"!==$&&"number"!==$&&"boolean"!==$&&"string"!==$?{type:Array.isArray(z.value)?"array":"object"}:{type:"bigint"===$?"integer":$,const:z.value};case c.kY.ZodEnum:return{type:"string",enum:Array.from(e.values)};case c.kY.ZodNativeEnum:var S=e;let I=S.values,T=Object.keys(S.values).filter(e=>"number"!=typeof I[I[e]]).map(e=>I[e]),A=Array.from(new Set(T.map(e=>typeof e)));return{type:1===A.length?"string"===A[0]?"string":"number":["string","number"],enum:T};case c.kY.ZodNullable:var R=e,O=r;if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(R.innerType._def.typeName)&&(!R.innerType._def.checks||!R.innerType._def.checks.length))return{type:[G[R.innerType._def.typeName],"null"]};let P=Y(R.innerType._def,{...O,currentPath:[...O.currentPath,"anyOf","0"]});return P&&{anyOf:[P,{type:"null"}]};case c.kY.ZodOptional:var E,Z,j,C=e,N=r;if(N.currentPath.toString()===(null==(j=N.propertyPath)?void 0:j.toString()))return Y(C.innerType._def,N);let F=Y(C.innerType._def,{...N,currentPath:[...N.currentPath,"anyOf","1"]});return F?{anyOf:[{not:{}},F]}:{};case c.kY.ZodMap:return n=e,"record"===(i=r).mapStrategy?H(n,i):{type:"array",maxItems:125,items:{type:"array",items:[Y(n.keyType._def,{...i,currentPath:[...i.currentPath,"items","items","0"]})||{},Y(n.valueType._def,{...i,currentPath:[...i.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case c.kY.ZodSet:var U=e,M=r;let Q={type:"array",uniqueItems:!0,items:Y(U.valueType._def,{...M,currentPath:[...M.currentPath,"items"]})};return U.minSize&&(Q.minItems=U.minSize.value),U.maxSize&&(Q.maxItems=U.maxSize.value),Q;case c.kY.ZodLazy:return()=>e.getter()._def;case c.kY.ZodPromise:return Y(e.type._def,r);case c.kY.ZodNaN:case c.kY.ZodNever:return{not:{}};case c.kY.ZodEffects:return s=e,"input"===(a=r).effectStrategy?Y(s.schema._def,a):{};case c.kY.ZodAny:case c.kY.ZodUnknown:return{};case c.kY.ZodDefault:return o=e,l=r,{...Y(o.innerType._def,l),default:o.defaultValue()};case c.kY.ZodBranded:return L(e,r);case c.kY.ZodReadonly:case c.kY.ZodCatch:return Y(e.innerType._def,r);case c.kY.ZodPipeline:var q=e,J=r;if("input"===J.pipeStrategy)return Y(q.in._def,J);if("output"===J.pipeStrategy)return Y(q.out._def,J);let B=Y(q.in._def,{...J,currentPath:[...J.currentPath,"allOf","0"]}),W=Y(q.out._def,{...J,currentPath:[...J.currentPath,"allOf",B?"1":"0"]});return{allOf:[B,W].filter(e=>void 0!==e)};case c.kY.ZodFunction:case c.kY.ZodVoid:case c.kY.ZodSymbol:default:return}})(e,e.typeName,t),o="function"==typeof a?Y(a(),t):a;if(o&&K(e,t,o),t.postProcess){let r=t.postProcess(o,e,t);return s.jsonSchema=o,r}return s.jsonSchema=o,o}var V=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:((e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")})(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,r)=>t.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},K=(e,t,r)=>(e.description&&(r.description=e.description),r),X=Symbol.for("vercel.ai.schema");function ee(e){let t;return()=>(null==t&&(t=e()),t)}
92function et(e,{validate:t}={}){return{[X]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function er(e){var t;return null==e?et({properties:{},additionalProperties:!1}):"object"==typeof e&&null!==e&&X in e&&!0===e[X]&&"jsonSchema"in e&&"validate"in e?e:"~standard"in e?"zod"===e["~standard"].vendor?en(e):(t=e,et(()=>j(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{let r=await t["~standard"].validate(e);return"value"in r?{success:!0,value:r.value}:{success:!1,error:new s.iM({value:e,cause:r.issues})}}})):e()}function en(e,t){var r,n;if("_zod"in e){let n=null!=(r=null==t?void 0:t.useReferences)&&r;return et(()=>j(function(e,t){if(e instanceof a.rs){let r=new l(t),n={};for(let t of e._idmap.entries()){let[e,n]=t;r.process(n)}let i={},s={registry:e,uri:t?.uri,defs:n};for(let n of e._idmap.entries()){let[e,a]=n;i[e]=r.emit(a,{...t,external:s})}return Object.keys(n).length>0&&(i.__shared={["draft-2020-12"===r.target?"$defs":"definitions"]:n}),{schemas:i}}let r=new l(t);return r.process(e),r.emit(e,t)}(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async t=>{let r=await u.bp(e,t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}}})}let i=null!=(n=null==t?void 0:t.useReferences)&&n;return et(()=>((e,t)=>{var r;let n=(e=>{let t,r="string"==typeof(t=e)?{...F,name:t}:{...F,...t},n=void 0!==r.name?[...r.basePath,r.definitionPath,r.name]:r.basePath;return{...r,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(r.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...r.basePath,r.definitionPath,e],jsonSchema:void 0}]))}})(t),i="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,r])=>{var i;return{...e,[t]:null!=(i=Y(r._def,{...n,currentPath:[...n.basePath,n.definitionPath,t]},!0))?i:{}}},{}):void 0,s="string"==typeof t?t:(null==t?void 0:t.nameStrategy)==="title"||null==t?void 0:t.name,a=null!=(r=Y(e._def,void 0===s?n:{...n,currentPath:[...n.basePath,n.definitionPath,s]},!1))?r:{},o="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==o&&(a.title=o);let l=void 0===s?i?{...a,[n.definitionPath]:i}:a:{$ref:[..."relative"===n.$refStrategy?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...i,[s]:a}};return l.$schema="http://json-schema.org/draft-07/schema#",l})(e,{$refStrategy:i?"root":"none"}),{validate:async t=>{let r=await e.safeParseAsync(t);return r.success?{success:!0,value:r.data}:{success:!1,error:r.error}}})}async function ei({value:e,schema:t,context:r}){let n=await es({value:e,schema:t,context:r});if(!n.success)throw s.iM.wrap({value:e,cause:n.error,context:r});return n.value}async function es({value:e,schema:t,context:r}){let n=er(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};let t=await n.validate(e);if(t.success)return{success:!0,value:t.value,rawValue:e};return{success:!1,error:s.iM.wrap({value:e,cause:t.error,context:r}),rawValue:e}}catch(t){return{success:!1,error:s.iM.wrap({value:e,cause:t,context:r}),rawValue:e}}}async function ea({text:e,schema:t}){try{let r=function(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return Z(e)}try{return Z(e)}finally{Error.stackTraceLimit=t}}(e);if(null==t)return{success:!0,value:r,rawValue:r};return await es({value:r,schema:t})}catch(t){return{success:!1,error:s.u6.isInstance(t)?t:new s.u6({text:e,cause:t}),rawValue:void 0}}}function eo({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new d).pipeThrough(new TransformStream({async transform({data:e},r){"[DONE]"!==e&&r.enqueue(await ea({text:e,schema:t}))}}))}async function el(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}},97582:(e,t,r)=>{r.d(t,{Di:()=>A,b8:()=>H,bD:()=>b,eM:()=>L,hL:()=>_,iM:()=>q,u1:()=>$,u6:()=>Z});var n,i,s,a,o,l,u,c,h,p,d,f,m,g,y="vercel.ai.error",v=Symbol.for(y),b=class e extends(i=Error,n=v,i){constructor({name:e,message:t,cause:r}){super(t),this[n]=!0,this.name=e,this.cause=r}static isInstance(t){return e.hasMarker(t,y)}static hasMarker(e,t){let r=Symbol.for(t);return null!=e&&"object"==typeof e&&r in e&&"boolean"==typeof e[r]&&!0===e[r]}},k="AI_APICallError",x=`vercel.ai.error.${k}`,w=Symbol.for(x),_=class extends(a=b,s=w,a){constructor({message:e,url:t,requestBodyValues:r,statusCode:n,responseHeaders:i,responseBody:a,cause:o,isRetryable:l=null!=n&&(408===n||409===n||429===n||n>=500),data:u}){super({name:k,message:e,cause:o}),this[s]=!0,this.url=t,this.requestBodyValues=r,this.statusCode=n,this.responseHeaders=i,this.responseBody=a,this.isRetryable=l,this.data=u}static isInstance(e){return b.hasMarker(e,x)}},z=Symbol.for("vercel.ai.error.AI_EmptyResponseBodyError");function $(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var S="AI_InvalidArgumentError",I=`vercel.ai.error.${S}
92`,T=Symbol.for(I),A=class extends(l=b,o=T,l){constructor({message:e,cause:t,argument:r}){super({name:S,message:e,cause:t}),this[o]=!0,this.argument=r}static isInstance(e){return b.hasMarker(e,I)}},R=Symbol.for("vercel.ai.error.AI_InvalidPromptError");Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var O="AI_JSONParseError",P=`vercel.ai.error.${O}`,E=Symbol.for(P),Z=class extends(c=b,u=E,c){constructor({text:e,cause:t}){super({name:O,message:`JSON parsing failed: Text: ${e}.
93Error message: ${$(t)}`,cause:t}),this[u]=!0,this.text=e}static isInstance(e){return b.hasMarker(e,P)}},j=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError");Symbol.for("vercel.ai.error.AI_LoadSettingError");Symbol.for("vercel.ai.error.AI_NoContentGeneratedError");var C="AI_NoSuchModelError",N=`vercel.ai.error.${C}`,F=Symbol.for(N),L=class extends(p=b,h=F,p){constructor({errorName:e=C,modelId:t,modelType:r,message:n=`No such ${r}: ${t}`}){super({name:e,message:n}),this[h]=!0,this.modelId=t,this.modelType=r}static isInstance(e){return b.hasMarker(e,N)}},U=Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError"),M="AI_TypeValidationError",D=`vercel.ai.error.${M}`,Q=Symbol.for(D),q=class e extends(f=b,d=Q,f){constructor({value:e,cause:t,context:r}){let n="Type validation failed";if((null==r?void 0:r.field)&&(n+=` for ${r.field}`),(null==r?void 0:r.entityName)||(null==r?void 0:r.entityId)){n+=" (";let e=[];r.entityName&&e.push(r.entityName),r.entityId&&e.push(`id: "${r.entityId}"`),n+=e.join(", "),n+=")"}super({name:M,message:`${n}: Value: ${JSON.stringify(e)}.
94Error message: ${$(t)}`,cause:t}),this[d]=!0,this.value=e,this.context=r}static isInstance(e){return b.hasMarker(e,D)}static wrap({value:t,cause:r,context:n}){var i,s,a;return e.isInstance(r)&&r.value===t&&(null==(i=r.context)?void 0:i.field)===(null==n?void 0:n.field)&&(null==(s=r.context)?void 0:s.entityName)===(null==n?void 0:n.entityName)&&(null==(a=r.context)?void 0:a.entityId)===(null==n?void 0:n.entityId)?r:new e({value:t,cause:r,context:n})}},J="AI_UnsupportedFunctionalityError",B=`vercel.ai.error.${J}`,W=Symbol.for(B),H=class extends(g=b,m=W,g){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:J,message:t}),this[m]=!0,this.functionality=e}static isInstance(e){return b.hasMarker(e,B)}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.