@marketrix.ai/widget 3.8.469 → 3.8.470
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/sdk/contracts/common.d.ts +12 -0
- package/dist/widget.mjs +1 -1
- package/dist/widget.mjs.map +1 -1
- package/package.json +1 -1
package/dist/widget.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import*as e from"react";import t,{createContext as n,createElement as r,forwardRef as o,useCallback as i,useContext as s,useEffect as a,useImperativeHandle as c,useLayoutEffect as l,useMemo as d,useRef as u,useState as p,useSyncExternalStore as h}from"react";import{createRoot as f}from"react-dom/client";import{Fragment as m,jsx as g,jsxs as y}from"react/jsx-runtime";import*as b from"react-dom";function v(e){return Array.isArray(e)?e:null==e?[]:[e]}var w="orpc",x=class extends Error{constructor(...e){super(...e),this.name="AbortError"}};function k(e){let t;return()=>{if(t)return t.result;const n=e();return t={result:n},n}}function S(){return globalThis["__@orpc/shared@1.15.0/otel/config__"]}function _(e,t={},n){return(S()?.tracer)?.startSpan(e,t,n)}function E(e,t,n={}){if(!e)return;const r=function(e){if(e instanceof Error){const t={message:e.message,name:e.name,stack:e.stack};return!("code"in e)||"string"!=typeof e.code&&"number"!=typeof e.code||(t.code=e.code),t}return{message:String(e)}}(t);e.recordException(r),n.signal?.aborted&&n.signal.reason===t||e.setStatus({code:2,message:r.message})}async function C({name:e,context:t,...n},r){const o=S()?.tracer;if(!o)return r();const i=async e=>{try{return await r(e)}catch(t){throw E(e,t,n),t}finally{e.end()}};return t?o.startActiveSpan(e,n,t,i):o.startActiveSpan(e,n,i)}async function I(e,t){const n=S();if(!e||!n)return t();const r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}function T(e){return!(!e||"object"!=typeof e)&&("next"in e&&"function"==typeof e.next&&Symbol.asyncIterator in e&&"function"==typeof e[Symbol.asyncIterator])}var z=Symbol.asyncDispose??Symbol.for("asyncDispose"),M=class{#e=!1;#t=!1;#n;#r;constructor(e,t){this.#n=t,this.#r=function(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}(async()=>{if(this.#e)return{done:!0,value:void 0};try{const t=await e();return t.done&&(this.#e=!0),t}catch(t){throw this.#e=!0,t}finally{this.#e&&!this.#t&&(this.#t=!0,await this.#n("next"))}})}next(){return this.#r()}async return(e){return this.#e=!0,this.#t||(this.#t=!0,await this.#n("return")),{done:!0,value:e}}async throw(e){throw this.#e=!0,this.#t||(this.#t=!0,await this.#n("throw")),e}async[z](){this.#e=!0,this.#t||(this.#t=!0,await this.#n("dispose"))}[Symbol.asyncIterator](){return this}};function O({name:e,...t},n){let r;return new M(async()=>{r??=_(e);try{const e=await I(r,()=>n.next());return r?.addEvent(e.done?"completed":"yielded"),e}catch(o){throw E(r,o,t),o}},async e=>{try{"next"!==e&&await I(r,()=>n.return?.())}catch(o){throw E(r,o,t),o}finally{r?.end()}})}function R(e,t,n){const r=(t,o)=>{const i=e[o];return i?i({...t,next:(e=t)=>r(e,o+1)}):n(t)};return r(t,0)}function N(e){if(e)return JSON.parse(e)}function A(e){return JSON.stringify(e)}function P(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function $(e){return!!e&&("object"==typeof e||"function"==typeof e)}function D(e,...t){return"function"==typeof e?e(...t):e}function L(e){return new Proxy(e,{get(e,t,n){const r=Reflect.get(e,t,n);return"then"!==t||"function"!=typeof r?r:new Proxy(r,{apply(t,n,r){if(2!==r.length||r.some(e=>{return!("function"==typeof(t=e)&&j.test(t.toString()));var t}))return Reflect.apply(t,n,r);let o=!0;r[0].call(n,L(new Proxy(e,{get:(e,t,n)=>{if(!o||"then"!==t)return Reflect.get(e,t,n);o=!1}})))}})}})}var j=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/;var F,U=/* @__PURE__ */new Set(["bind","valueOf","toString","toJSON"]),W={BAD_REQUEST:{status:400,message:"Bad Request"},UNAUTHORIZED:{status:401,message:"Unauthorized"},FORBIDDEN:{status:403,message:"Forbidden"},NOT_FOUND:{status:404,message:"Not Found"},METHOD_NOT_SUPPORTED:{status:405,message:"Method Not Supported"},NOT_ACCEPTABLE:{status:406,message:"Not Acceptable"},TIMEOUT:{status:408,message:"Request Timeout"},CONFLICT:{status:409,message:"Conflict"},PRECONDITION_FAILED:{status:412,message:"Precondition Failed"},PAYLOAD_TOO_LARGE:{status:413,message:"Payload Too Large"},UNSUPPORTED_MEDIA_TYPE:{status:415,message:"Unsupported Media Type"},UNPROCESSABLE_CONTENT:{status:422,message:"Unprocessable Content"},TOO_MANY_REQUESTS:{status:429,message:"Too Many Requests"},CLIENT_CLOSED_REQUEST:{status:499,message:"Client Closed Request"},INTERNAL_SERVER_ERROR:{status:500,message:"Internal Server Error"},NOT_IMPLEMENTED:{status:501,message:"Not Implemented"},BAD_GATEWAY:{status:502,message:"Bad Gateway"},SERVICE_UNAVAILABLE:{status:503,message:"Service Unavailable"},GATEWAY_TIMEOUT:{status:504,message:"Gateway Timeout"}};var B=class e extends Error{defined;code;status;data;static{const t=Symbol.for("__@orpc/client@1.15.0/error/ORPC_ERROR_CONSTRUCTORS__");globalThis[t]??=/* @__PURE__ */new WeakSet,(F=globalThis[t]).add(e)}constructor(e,...t){const n=function(e){return e[0]??{}}(t);if(void 0!==n.status&&!H(n.status))throw new Error("[ORPCError] Invalid error status code.");const r=function(e,t){return t||W[e]?.message||e}(e,n.message);super(r,n),this.code=e,this.status=function(e,t){return t??W[e]?.status??500}(e,n.status),this.defined=n.defined??!1,this.data=n.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](e){if(F.has(this)){const t=function(e){return $(e)?Object.getPrototypeOf(e)?.constructor:null}(e);if(t&&F.has(t))return!0}return super[Symbol.hasInstance](e)}};function H(e){return e<200||e>=400}function Z(e){if(!P(e))return!1;const t=["defined","code","status","message","data"];return!Object.keys(e).some(e=>!t.includes(e))&&("defined"in e&&"boolean"==typeof e.defined&&"code"in e&&"string"==typeof e.code&&"status"in e&&"number"==typeof e.status&&H(e.status)&&"message"in e&&"string"==typeof e.message)}function q(e,t={}){return new B(e.code,{...t,...e})}var V=class extends TypeError{},G=class extends TypeError{},Y=class extends Error{data;constructor(e){super(e?.message??"An error event was received",e),this.data=e?.data}},J=/\r\n|\r(?!\n)|\n/,X=/(?:\r\n|\r(?!\n)|\n){2}/,K=/(?:\r\n|\r(?!\n)|\n){2}/g;function Q(e){const t={data:void 0,event:void 0,id:void 0,retry:void 0,comments:[]};for(const n of e.split(J)){if(""===n)continue;const e=n.indexOf(":"),r=-1===e?"":n.slice(32===n.charCodeAt(e+1)?e+2:e+1);if(0!==e)switch(-1===e?n:n.slice(0,e)){case"data":t.data=void 0===t.data?r:`${t.data}\n${r}`;break;case"event":t.event=r;break;case"id":t.id=r;break;case"retry":{const e=Number.parseInt(r,10);e>=0&&e.toString()===r&&(t.retry=e);break}}else t.comments.push(r)}return t}var ee=class{constructor(e={}){this.options=e}pending=[];tail="";discardLeadingLF=!1;feed(e){if(""===e)return;if(this.discardLeadingLF&&(this.discardLeadingLF=!1,10===e.charCodeAt(0)&&""===(e=e.slice(1))))return;const t=this.tail+e;if(!X.test(t))return this.pending.push(e),void(this.tail=t.slice(-3));this.pending.push(e);const n=1===this.pending.length?e:this.pending.join(""),r=n.length-t.length,o=[];let i=0;for(const a of t.matchAll(K))o.push(n.slice(i,r+a.index)),i=r+a.index+a[0].length;const s=n.slice(i);this.pending.length=0,this.tail=s.slice(-3),""===s?this.discardLeadingLF=13===e.charCodeAt(e.length-1):this.pending.push(s);for(const a of o){const e=Q(a);this.options.onEvent&&this.options.onEvent(e)}}end(){if(0!==this.pending.length)throw new G("Event Iterator ended before complete")}},te=class extends TransformStream{constructor(){let e;super({start(t){e=new ee({onEvent:e=>{t.enqueue(e)}})},transform(t){e.feed(t)},flush(){e.end()}})}},ne=/\r\n|[\n\r]/,re=/\r\n|[\n\r]/g;function oe(e){return ne.test(e)}function ie(e){if(oe(e))throw new V("Event's id must not contain a carriage return or newline character")}function se(e){if(!Number.isInteger(e)||e<0)throw new V("Event's retry must be a integer and >= 0")}function ae(e){if(oe(e))throw new V("Event's comment must not contain a carriage return or newline character")}function ce(e){let t="";var n;return t+=function(e){let t="";for(const n of e??[])ae(n),t+=`: ${n}\n`;return t}(e.comments),void 0!==e.event&&(!function(e){if(oe(e))throw new V("Event's event must not contain a carriage return or newline character")}(e.event),t+=`event: ${e.event}\n`),void 0!==e.retry&&(se(e.retry),t+=`retry: ${e.retry}\n`),void 0!==e.id&&(ie(e.id),t+=`id: ${e.id}\n`),t+=void 0===(n=e.data)?"":`data: ${n.replace(re,"\ndata: ")}\n`,t+="\n",t}var le=Symbol("ORPC_EVENT_SOURCE_META");function de(e,t){if(void 0===t.id&&void 0===t.retry&&!t.comments?.length)return e;if(void 0!==t.id&&ie(t.id),void 0!==t.retry&&se(t.retry),void 0!==t.comments)for(const n of t.comments)ae(n);return new Proxy(e,{get:(e,n,r)=>n===le?t:Reflect.get(e,n,r)})}function ue(e){return $(e)?Reflect.get(e,le):void 0}function pe(e){const t=e.match(/filename\*=(UTF-8'')?([^;]*)/i);if(t&&"string"==typeof t[2])return function(e){try{return decodeURIComponent(e)}catch{return e}}(t[2]);const n=e.match(/filename="((?:\\"|[^"])*)"/i);return n&&"string"==typeof n[1]?n[1].replace(/\\"/g,'"'):void 0}function he(e,t){const n=async e=>{let n=await t.error(e);if(n!==e){const t=ue(e);t&&$(n)&&(n=de(n,t))}return n};return new M(async()=>{const{done:r,value:o}=await(async()=>{try{return await e.next()}catch(t){throw await n(t)}})();let i=await t.value(o,r);if(i!==o){const e=ue(o);e&&$(i)&&(i=de(i,e))}return{done:r,value:i}},async()=>{try{await(e.return?.())}catch(t){throw await n(t)}})}function fe(e,t={}){const n=t.path??[];return L(new Proxy(async(...[t,r={}])=>await e.call(n,t,function(e){return{...e,context:e.context??{}}}(r)),{get:(r,o)=>"string"!=typeof o||U.has(o)?Reflect.get(r,o):fe(e,{...t,path:[...n,o]})}))}function me(e,t={}){return C({name:"parse_standard_body",signal:t.signal},async()=>{const n=e.headers.get("content-disposition");if("string"==typeof n){const t=pe(n)??"blob",r=await e.blob();return new File([r],t,{type:r.type})}const r=e.headers.get("content-type");if(!r||r.startsWith("application/json")){return N(await e.text())}if(r.startsWith("multipart/form-data"))return await e.formData();if(r.startsWith("application/x-www-form-urlencoded")){const t=await e.text();return new URLSearchParams(t)}if(r.startsWith("text/event-stream"))return function(e,t={}){const n=(e?.pipeThrough(new TextDecoderStream).pipeThrough(new te))?.getReader();let r,o=!1;return new M(async()=>{r??=_("consume_event_iterator_stream");try{for(;;){if(void 0===n)return{done:!0,value:void 0};const{done:e,value:t}=await I(r,()=>n.read());if(e){if(o)throw new x("Stream was cancelled");return{done:!0,value:void 0}}switch(t.event){case"message":{let e=N(t.data);return $(e)&&(e=de(e,t)),r?.addEvent("message"),{done:!1,value:e}}case"error":{let e=new Y({data:N(t.data)});throw e=de(e,t),r?.addEvent("error"),e}case"done":{let e=N(t.data);return $(e)&&(e=de(e,t)),r?.addEvent("done"),{done:!0,value:e}}default:r?.addEvent("maybe_keepalive")}}}catch(e){throw e instanceof Y||E(r,e,t),e}},async e=>{try{"next"!==e&&(o=!0,r?.addEvent("cancelled")),await I(r,()=>n?.cancel())}catch(i){throw E(r,i,t),i}finally{r?.end()}})}(e.body,t);if(r.startsWith("text/plain"))return await e.text();const o=await e.blob();return new File([o],"blob",{type:o.type})})}function ge(e,t,n={}){if(e instanceof ReadableStream)return e;const r=t.get("content-disposition");return t.delete("content-type"),t.delete("content-disposition"),void 0!==e?e instanceof Blob?(t.set("content-type",e.type),t.set("content-length",e.size.toString()),t.set("content-disposition",r??function(e,t="inline"){return`${t}; filename="${e.replace(/[^\x20-\x7E]/g,"_").replace(/"/g,'\\"')}"; filename*=utf-8''${encodeURIComponent(e).replace(/['()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`).replace(/%(7C|60|5E)/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)))}`}(e instanceof File?e.name:"blob")),e):e instanceof FormData||e instanceof URLSearchParams?e:T(e)?(t.set("content-type","text/event-stream"),function(e,t={}){const n=t.eventIteratorKeepAliveEnabled??!0,r=t.eventIteratorKeepAliveInterval??5e3,o=t.eventIteratorKeepAliveComment??"",i=t.eventIteratorInitialCommentEnabled??!0,s=t.eventIteratorInitialComment??"";let a,c,l=!1;return new ReadableStream({start(e){c=_("stream_event_iterator"),i&&e.enqueue(ce({comments:[s]}))},async pull(t){try{n&&(a=setInterval(()=>{t.enqueue(ce({comments:[o]})),c?.addEvent("keepalive")},r));const i=await I(c,()=>e.next());if(clearInterval(a),l)return;const s=ue(i.value);if(!i.done||void 0!==i.value||void 0!==s){const e=i.done?"done":"message";t.enqueue(ce({...s,event:e,data:A(i.value)})),c?.addEvent(e)}i.done&&(t.close(),c?.end())}catch(i){if(clearInterval(a),l)return;i instanceof Y?(t.enqueue(ce({...ue(i),event:"error",data:A(i.data)})),c?.addEvent("error"),t.close()):(E(c,i),t.error(i)),c?.end()}},async cancel(){try{l=!0,clearInterval(a),c?.addEvent("cancelled"),await I(c,()=>e.return?.())}catch(t){throw E(c,t),t}finally{c?.end()}}}).pipeThrough(new TextEncoderStream)}(e,n)):(t.set("content-type","application/json"),A(e)):void 0}function ye(e,t={}){return e.forEach((e,n)=>{Array.isArray(t[n])?t[n].push(e):void 0!==t[n]?t[n]=[t[n],e]:t[n]=e}),t}function be(e,t={}){const n=function(e,t=new Headers){for(const[n,r]of Object.entries(e))if(Array.isArray(r))for(const e of r)t.append(n,e);else void 0!==r&&t.append(n,r);return t}(e.headers),r=ge(e.body,n,t);return new Request(e.url,{signal:e.signal,method:e.method,headers:n,body:r})}var ve=class{plugins;constructor(e=[]){this.plugins=[...e].sort((e,t)=>(e.order??0)-(t.order??0))}init(e){for(const t of this.plugins)t.init?.(e)}},we=class{constructor(e,t,n={}){this.codec=e,this.sender=t,new ve(n.plugins).init(n),this.interceptors=v(n.interceptors),this.clientInterceptors=v(n.clientInterceptors)}interceptors;clientInterceptors;call(e,t,n){return C({name:`${w}.${e.join("/")}`,signal:n.signal},r=>(r?.setAttribute("rpc.system",w),r?.setAttribute("rpc.method",e.join(".")),T(t)&&(t=O({name:"consume_event_iterator_input",signal:n.signal},t)),R(this.interceptors,{...n,path:e,input:t},async({path:e,input:t,...n})=>{const o=S();let i;const s=o?.trace.getActiveSpan()??r;s&&o&&(i=o?.trace.setSpan(o.context.active(),s));const a=await C({name:"encode_request",context:i},()=>this.codec.encode(e,t,n)),c=await R(this.clientInterceptors,{...n,input:t,path:e,request:a},({input:e,path:t,request:n,...r})=>C({name:"send_request",signal:r.signal,context:i},()=>this.sender.call(n,r,t,e))),l=await C({name:"decode_response",context:i},()=>this.codec.decode(c,n,e,t));return T(l)?O({name:"consume_event_iterator_output",signal:n.signal},l):l})))}},xe=0,ke=1,Se=2,_e=3,Ee=4,Ce=5,Ie=6,Te=7,ze=class{customSerializers;constructor(e={}){if(this.customSerializers=e.customJsonSerializers??[],this.customSerializers.length!==new Set(this.customSerializers.map(e=>e.type)).size)throw new Error("Custom serializer type must be unique.")}serialize(e,t=[],n=[],r=[],o=[]){for(const i of this.customSerializers)if(i.condition(e)){const s=this.serialize(i.serialize(e),t,n,r,o);return n.push([i.type,...t]),s}if(e instanceof Blob)return r.push(t),o.push(e),[e,n,r,o];if("bigint"==typeof e)return n.push([xe,...t]),[e.toString(),n,r,o];if(e instanceof Date)return n.push([ke,...t]),Number.isNaN(e.getTime())?[null,n,r,o]:[e.toISOString(),n,r,o];if(Number.isNaN(e))return n.push([Se,...t]),[null,n,r,o];if(e instanceof URL)return n.push([Ee,...t]),[e.toString(),n,r,o];if(e instanceof RegExp)return n.push([Ce,...t]),[e.toString(),n,r,o];if(e instanceof Set){const i=this.serialize(Array.from(e),t,n,r,o);return n.push([Ie,...t]),i}if(e instanceof Map){const i=this.serialize(Array.from(e.entries()),t,n,r,o);return n.push([Te,...t]),i}if(Array.isArray(e))return[e.map((e,i)=>void 0===e?(n.push([_e,...t,i]),null):this.serialize(e,[...t,i],n,r,o)[0]),n,r,o];if(P(e)){const i={};for(const s in e)"toJSON"===s&&"function"==typeof e[s]||(i[s]=this.serialize(e[s],[...t,s],n,r,o)[0]);return[i,n,r,o]}return[e,n,r,o]}deserialize(e,t,n,r){const o={data:e};n&&r&&n.forEach((e,t)=>{let n=o,i="data";e.forEach(e=>{if(n=n[i],i=e,!Object.hasOwn(n,i))throw new Error(`Security error: accessing non-existent path during deserialization. Path segment: ${i}`)}),n[i]=r(t)});for(const i of t){const e=i[0];let t=o,n="data";for(let r=1;r<i.length;r++)if(t=t[n],n=i[r],!Object.hasOwn(t,n))throw new Error(`Security error: accessing non-existent path during deserialization. Path segment: ${n}`);for(const r of this.customSerializers)if(r.type===e){t[n]=r.deserialize(t[n]);break}switch(e){case xe:t[n]=BigInt(t[n]);break;case ke:t[n]=new Date(t[n]??"Invalid Date");break;case Se:t[n]=NaN;break;case _e:t[n]=void 0;break;case Ee:t[n]=new URL(t[n]);break;case Ce:{const[,e,r]=t[n].match(/^\/(.*)\/([a-z]*)$/);t[n]=new RegExp(e,r);break}case Ie:t[n]=new Set(t[n]);break;case Te:t[n]=new Map(t[n])}}return o.data}};var Me,Oe=class{constructor(e,t){this.serializer=e,this.baseUrl=t.url,this.maxUrlLength=t.maxUrlLength??2083,this.fallbackMethod=t.fallbackMethod??"POST",this.expectedMethod=t.method??this.fallbackMethod,this.headers=t.headers??{}}baseUrl;maxUrlLength;fallbackMethod;expectedMethod;headers;async encode(e,t,n){let r=function(e){return"function"==typeof e.forEach?ye(e):e}(await D(this.headers,n,e,t));void 0!==n.lastEventId&&(r=function(e,t){const n={...e};for(const r in t)Array.isArray(t[r])?n[r]=[...v(n[r]),...t[r]]:void 0!==t[r]&&(Array.isArray(n[r])?n[r]=[...n[r],t[r]]:void 0!==n[r]?n[r]=[n[r],t[r]]:n[r]=t[r]);return n}(r,{"last-event-id":n.lastEventId}));const o=await D(this.expectedMethod,n,e,t),i=await D(this.baseUrl,n,e,t),s=new URL(i);s.pathname=`${s.pathname.replace(/\/$/,"")}${function(e){return`/${e.map(encodeURIComponent).join("/")}`}(e)}`;const a=this.serializer.serialize(t);if(!("GET"!==o||a instanceof FormData||T(a))){const i=await D(this.maxUrlLength,n,e,t),c=new URL(s);if(c.searchParams.append("data",A(a)),c.toString().length<=i)return{body:void 0,method:o,headers:r,url:c,signal:n.signal}}return{url:s,method:"GET"===o?this.fallbackMethod:o,headers:r,body:a,signal:n.signal}}async decode(e){const t=!H(e.status),n=await(async()=>{let t=!1;try{const n=await e.body();return t=!0,this.serializer.deserialize(n)}catch(n){if(!t)throw new Error("Cannot parse response body, please check the response body and content-type.",{cause:n});throw new Error("Invalid RPC response format.",{cause:n})}})();if(!t){if(Z(n))throw q(n);throw new B((r=e.status,Object.entries(W).find(([,e])=>e.status===r)?.[0]??"MALFORMED_ORPC_ERROR_RESPONSE"),{status:e.status,data:{...e,body:n}})}var r;return n}},Re=class{constructor(e){this.jsonSerializer=e}serialize(e){return T(e)?he(e,{value:async e=>this.#o(e,!1),error:async e=>{return new Y({data:this.#o((t=e,t instanceof B?t:new B("INTERNAL_SERVER_ERROR",{message:"Internal server error",cause:t})).toJSON(),!1),cause:e});var t}}):this.#o(e,!0)}#o(e,t){const[n,r,o,i]=this.jsonSerializer.serialize(e),s=0===r.length?void 0:r;if(!t||0===i.length)return{json:n,meta:s};const a=new FormData;return a.set("data",A({json:n,meta:s,maps:o})),i.forEach((e,t)=>{a.set(t.toString(),e)}),a}deserialize(e){return T(e)?he(e,{value:async e=>this.#i(e),error:async e=>{if(!(e instanceof Y))return e;const t=this.#i(e.data);return Z(t)?q(t,{cause:e}):new Y({data:t,cause:e})}}):this.#i(e)}#i(e){if(void 0===e)return;if(!(e instanceof FormData))return this.jsonSerializer.deserialize(e.json,e.meta??[]);const t=JSON.parse(e.get("data"));return this.jsonSerializer.deserialize(t.json,t.meta??[],t.maps,t=>e.get(t.toString()))}},Ne=class extends we{constructor(e,t){const n=new ze(t),r=new Re(n);super(new Oe(r,t),e,t)}},Ae=class extends ve{initRuntimeAdapter(e){for(const t of this.plugins)t.initRuntimeAdapter?.(e)}},Pe=class{fetch;toFetchRequestOptions;adapterInterceptors;constructor(e){new Ae(e.plugins).initRuntimeAdapter(e),this.fetch=e.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=e,this.adapterInterceptors=v(e.adapterInterceptors)}async call(e,t,n,r){const o=be(e,this.toFetchRequestOptions);return function(e,t={}){return{body:k(()=>me(e,t)),status:e.status,get headers(){const t=ye(e.headers);return Object.defineProperty(this,"headers",{value:t,writable:!0}),t},set headers(e){Object.defineProperty(this,"headers",{value:e,writable:!0})}}}(await R(this.adapterInterceptors,{...t,request:o,path:n,input:r,init:{redirect:"manual"}},({request:e,path:t,input:n,init:r,...o})=>this.fetch(e,r,o,t,n)),{signal:o.signal})}},$e=class extends Ne{constructor(e){super(new Pe(e),e)}};function De(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:/* @__PURE__ */new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Le=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},je=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Me=globalThis).__zod_globalConfig??(Me.__zod_globalConfig={});var Fe=globalThis.__zod_globalConfig;function Ue(e){return e&&Object.assign(Fe,e),Fe}function We(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Be(e,t){return"bigint"==typeof t?t.toString():t}function He(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ze(e){return null==e}function qe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var Ve=/* @__PURE__*/Symbol("evaluating");function Ge(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ve)return void 0===r&&(r=Ve,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ye(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Je(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Xe(e){return JSON.stringify(e)}var Ke="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}var et=/* @__PURE__*/He(()=>{if(Fe.jitless)return!1;if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function tt(e){if(!1===Qe(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Qe(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function nt(e){return tt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var rt=/* @__PURE__*/new Set(["string","number","symbol"]);function ot(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function st(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}var at={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ct(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function lt(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===e.issues[n]?.continue)return!0;return!1}function dt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ut(e){return"string"==typeof e?e:e?.message}function pt(e,t,n){const r=e.message?e.message:ut(e.inst?._zod.def?.error?.(e))??ut(t?.error?.(e))??ut(n.customError?.(e))??ut(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function ht(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function ft(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}var mt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Be,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},gt=De("$ZodError",mt),yt=De("$ZodError",mt,{Parent:Error});var bt=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Le;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>pt(e,i,Ue())));throw Ke(t,o?.callee),t}return s.value},vt=e=>async(t,n,r,o)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>pt(e,i,Ue())));throw Ke(t,o?.callee),t}return s.value},wt=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new Le;return i.issues.length?{success:!1,error:new(e??gt)(i.issues.map(e=>pt(e,o,Ue())))}:{success:!0,data:i.value}},xt=/* @__PURE__*/wt(yt),kt=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>pt(e,o,Ue())))}:{success:!0,data:i.value}},St=/* @__PURE__*/kt(yt),_t=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return bt(e)(t,n,o)},Et=e=>(t,n,r)=>bt(e)(t,n,r),Ct=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return vt(e)(t,n,o)},It=e=>async(t,n,r)=>vt(e)(t,n,r),Tt=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return wt(e)(t,n,o)},zt=e=>(t,n,r)=>wt(e)(t,n,r),Mt=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return kt(e)(t,n,o)},Ot=e=>async(t,n,r)=>kt(e)(t,n,r),Rt=/^[cC][0-9a-z]{6,}$/,Nt=/^[0-9a-z]+$/,At=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Pt=/^[0-9a-vA-V]{20}$/,$t=/^[A-Za-z0-9]{27}$/,Dt=/^[a-zA-Z0-9_-]{21}$/,Lt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jt=/^([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})$/,Ft=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ut=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Wt=/^(?:(?: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])$/,Bt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ht=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Zt=/^(([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])$/,qt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vt=/^[A-Za-z0-9_-]*$/,Gt=/^https?$/,Yt=/^\+[1-9]\d{6,14}$/,Jt="(?:(?:\\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])))",Xt=/*@__PURE__*/new RegExp(`^${Jt}$`);function Kt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}var Qt=/^-?\d+$/,en=/^-?\d+(?:\.\d+)?$/,tn=/^(?:true|false)$/i,nn=/^[^A-Z]*$/,rn=/^[^a-z]*$/,on=/*@__PURE__*/De("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),sn={number:"number",bigint:"bigint",object:"date"},an=/*@__PURE__*/De("$ZodCheckLessThan",(e,t)=>{on.init(e,t);const n=sn[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cn=/*@__PURE__*/De("$ZodCheckGreaterThan",(e,t)=>{on.init(e,t);const n=sn[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ln=/*@__PURE__*/De("$ZodCheckMultipleOf",(e,t)=>{on.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value!==BigInt(0):0!==function(e,t){const n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}(n.value,t.value))&&n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dn=/*@__PURE__*/De("$ZodCheckNumberFormat",(e,t)=>{on.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=at[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=Qt)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),un=/*@__PURE__*/De("$ZodCheckMaxLength",(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ze(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=ht(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pn=/*@__PURE__*/De("$ZodCheckMinLength",(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ze(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=ht(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),hn=/*@__PURE__*/De("$ZodCheckLengthEquals",(e,t)=>{var n;on.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ze(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=ht(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),fn=/*@__PURE__*/De("$ZodCheckStringFormat",(e,t)=>{var n,r;on.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=/* @__PURE__ */new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),mn=/*@__PURE__*/De("$ZodCheckRegex",(e,t)=>{fn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),gn=/*@__PURE__*/De("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=nn),fn.init(e,t)}),yn=/*@__PURE__*/De("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=rn),fn.init(e,t)}),bn=/*@__PURE__*/De("$ZodCheckIncludes",(e,t)=>{on.init(e,t);const n=ot(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),vn=/*@__PURE__*/De("$ZodCheckStartsWith",(e,t)=>{on.init(e,t);const n=new RegExp(`^${ot(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),wn=/*@__PURE__*/De("$ZodCheckEndsWith",(e,t)=>{on.init(e,t);const n=new RegExp(`.*${ot(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=/* @__PURE__ */new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),xn=/*@__PURE__*/De("$ZodCheckOverwrite",(e,t)=>{on.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),kn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const o of r)this.content.push(o)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}},Sn={major:4,minor:4,patch:3},_n=/*@__PURE__*/De("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const t of o._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=ct(e);for(const i of t){if(i._zod.def.when){if(lt(e))continue;if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new Le;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(o||(o=ct(e,t)))});else{if(e.issues.length===t)continue;o||(o=ct(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(ct(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new Le;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new Le;return s.then(e=>t(e,r,i))}return t(s,r,i)}}Ge(e,"~standard",()=>({validate:t=>{try{const n=xt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return St(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),En=/*@__PURE__*/De("$ZodString",(e,t)=>{var n;_n.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Cn=/*@__PURE__*/De("$ZodStringFormat",(e,t)=>{fn.init(e,t),En.init(e,t)}),In=/*@__PURE__*/De("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jt),Cn.init(e,t)}),Tn=/*@__PURE__*/De("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ft(e))}else t.pattern??(t.pattern=Ft());Cn.init(e,t)}),zn=/*@__PURE__*/De("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ut),Cn.init(e,t)}),Mn=/*@__PURE__*/De("$ZodURL",(e,t)=>{Cn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===Gt.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),On=/*@__PURE__*/De("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Cn.init(e,t)}),Rn=/*@__PURE__*/De("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Dt),Cn.init(e,t)}),Nn=/*@__PURE__*/De("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Rt),Cn.init(e,t)}),An=/*@__PURE__*/De("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Nt),Cn.init(e,t)}),Pn=/*@__PURE__*/De("$ZodULID",(e,t)=>{t.pattern??(t.pattern=At),Cn.init(e,t)}),$n=/*@__PURE__*/De("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Pt),Cn.init(e,t)}),Dn=/*@__PURE__*/De("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$t),Cn.init(e,t)}),Ln=/*@__PURE__*/De("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Kt({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Jt}T(?:${r})$`)}(t)),Cn.init(e,t)}),jn=/*@__PURE__*/De("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Xt),Cn.init(e,t)}),Fn=/*@__PURE__*/De("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Kt(t)}$`)),Cn.init(e,t)}),Un=/*@__PURE__*/De("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Lt),Cn.init(e,t)}),Wn=/*@__PURE__*/De("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wt),Cn.init(e,t),e._zod.bag.format="ipv4"}),Bn=/*@__PURE__*/De("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Bt),Cn.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Hn=/*@__PURE__*/De("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ht),Cn.init(e,t)}),Zn=/*@__PURE__*/De("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Zt),Cn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function qn(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Vn=/*@__PURE__*/De("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=qt),Cn.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{qn(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});var Gn=/*@__PURE__*/De("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vt),Cn.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Vt.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return qn(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Yn=/*@__PURE__*/De("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Yt),Cn.init(e,t)});var Jn=/*@__PURE__*/De("$ZodJWT",(e,t)=>{Cn.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Xn=/*@__PURE__*/De("$ZodNumber",(e,t)=>{_n.init(e,t),e._zod.pattern=e._zod.bag.pattern??en,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),Kn=/*@__PURE__*/De("$ZodNumberFormat",(e,t)=>{dn.init(e,t),Xn.init(e,t)}),Qn=/*@__PURE__*/De("$ZodBoolean",(e,t)=>{_n.init(e,t),e._zod.pattern=tn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),er=/*@__PURE__*/De("$ZodUnknown",(e,t)=>{_n.init(e,t),e._zod.parse=e=>e}),tr=/*@__PURE__*/De("$ZodNever",(e,t)=>{_n.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),nr=/*@__PURE__*/De("$ZodDate",(e,t)=>{_n.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(s){}const o=n.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),n}});function rr(e,t,n){e.issues.length&&t.issues.push(...dt(n,e.issues)),t.value[n]=e.value}var or=/*@__PURE__*/De("$ZodArray",(e,t)=>{_n.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>rr(t,n,e))):rr(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function ir(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...dt(n,e.issues))}s||o?void 0===e.value?s&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}function sr(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ar(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,d="optional"===c.optin,u="optional"===c.optout;for(const p in t){if("__proto__"===p)continue;if(a.has(p))continue;if("never"===l){s.push(p);continue}const o=c.run({value:t[p],issues:[]},r);o instanceof Promise?e.push(o.then(e=>ir(e,n,p,t,d,u))):ir(o,n,p,t,d,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}var cr=/*@__PURE__*/De("$ZodObject",(e,t)=>{if(_n.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const n=He(()=>sr(t));Ge(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */new Set);for(const e of r.values)n[t].add(e)}}return n});const r=Qe,o=t.catchall;let i;e._zod.parse=(t,s)=>{i??(i=n.value);const a=t.value;if(!r(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],l=i.shape;for(const e of i.keys){const n=l[e],r="optional"===n._zod.optin,o="optional"===n._zod.optout,i=n._zod.run({value:a[e],issues:[]},s);i instanceof Promise?c.push(i.then(n=>ir(n,t,e,a,r,o))):ir(i,t,e,a,r,o)}return o?ar(c,a,t,s,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),lr=/*@__PURE__*/De("$ZodObjectJIT",(e,t)=>{cr.init(e,t);const n=e._zod.parse,r=He(()=>sr(t));let o;const i=Qe,s=!Fe.jitless,a=s&&et.value,c=t.catchall;let l;e._zod.parse=(d,u)=>{l??(l=r.value);const p=d.value;return i(p)?s&&a&&!1===u?.async&&!0!==u.jitless?(o||(o=(e=>{const t=new kn(["shape","payload","ctx"]),n=r.value,o=e=>{const t=Xe(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const r of n.keys)i[r]="key_"+s++;t.write("const newResult = {};");for(const r of n.keys){const n=i[r],s=Xe(r),a=e[r],c="optional"===a?._zod?.optin,l="optional"===a?._zod?.optout;t.write(`const ${n} = ${o(r)};`),c&&l?t.write(`\n if (${n}.issues.length) {\n if (${s} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `):c?t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `):t.write(`\n const ${n}_present = ${s} in input;\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n if (!${n}_present && !${n}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${s}]\n });\n }\n\n if (${n}_present) {\n if (${n}.value === undefined) {\n newResult[${s}] = undefined;\n } else {\n newResult[${s}] = ${n}.value;\n }\n }\n\n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),d=o(d,u),c?ar([],p,d,u,l,e):d):n(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function dr(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!ct(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>pt(e,r,Ue())))}),t)}var ur=/*@__PURE__*/De("$ZodUnion",(e,t)=>{_n.init(e,t),Ge(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ge(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ge(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ge(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>qe(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},o);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=>dr(t,r,e,o)):dr(s,r,e,o)}}),pr=/*@__PURE__*/De("$ZodIntersection",(e,t)=>{_n.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>fr(e,t,n)):fr(e,o,i)}});function hr(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(tt(e)&&tt(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const i of r){const n=hr(e[i],t[i]);if(!n.valid)return{valid:!1,mergeErrorPath:[i,...n.mergeErrorPath]};o[i]=n.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=hr(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function fr(e,t,n){const r=/* @__PURE__ */new Map;let o;for(const a of t.issues)if("unrecognized_keys"===a.code){o??(o=a);for(const e of a.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(a);for(const a of n.issues)if("unrecognized_keys"===a.code)for(const e of a.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(a);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),ct(e))return e;const s=hr(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var mr=/*@__PURE__*/De("$ZodRecord",(e,t)=>{_n.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!tt(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=/* @__PURE__ */new Set;for(const l of s)if("string"==typeof l||"number"==typeof l||"symbol"==typeof l){a.add("number"==typeof l?l.toString():l);const s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>pt(e,r,Ue())),input:l,path:[l],inst:e});continue}const c=s.value,d=t.valueType._zod.run({value:o[l],issues:[]},r);d instanceof Promise?i.push(d.then(e=>{e.issues.length&&n.issues.push(...dt(l,e.issues)),n.value[c]=e.value})):(d.issues.length&&n.issues.push(...dt(l,d.issues)),n.value[c]=d.value)}let c;for(const e in o)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:c})}else{n.value={};for(const s of Reflect.ownKeys(o)){if("__proto__"===s)continue;if(!Object.prototype.propertyIsEnumerable.call(o,s))continue;let a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof s&&en.test(s)&&a.issues.length){const e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?n.value[s]=o[s]:n.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>pt(e,r,Ue())),input:s,path:[s],inst:e});continue}const c=t.valueType._zod.run({value:o[s],issues:[]},r);c instanceof Promise?i.push(c.then(e=>{e.issues.length&&n.issues.push(...dt(s,e.issues)),n.value[a.value]=e.value})):(c.issues.length&&n.issues.push(...dt(s,c.issues)),n.value[a.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),gr=/*@__PURE__*/De("$ZodEnum",(e,t)=>{_n.init(e,t);const n=We(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>rt.has(typeof e)).map(e=>"string"==typeof e?ot(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),yr=/*@__PURE__*/De("$ZodLiteral",(e,t)=>{if(_n.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?ot(e):e?ot(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),br=/*@__PURE__*/De("$ZodTransform",(e,t)=>{_n.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new je(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n));if(o instanceof Promise)throw new Le;return n.value=o,n.fallback=!0,n}});function vr(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var wr=/*@__PURE__*/De("$ZodOptional",(e,t)=>{_n.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ge(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,void 0]):void 0),Ge(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qe(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=e.value,o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(e=>vr(e,r)):vr(o,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),xr=/*@__PURE__*/De("$ZodExactOptional",(e,t)=>{wr.init(e,t),Ge(e._zod,"values",()=>t.innerType._zod.values),Ge(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),kr=/*@__PURE__*/De("$ZodNullable",(e,t)=>{_n.init(e,t),Ge(e._zod,"optin",()=>t.innerType._zod.optin),Ge(e._zod,"optout",()=>t.innerType._zod.optout),Ge(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qe(e.source)}|null)$`):void 0}),Ge(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Sr=/*@__PURE__*/De("$ZodDefault",(e,t)=>{_n.init(e,t),e._zod.optin="optional",Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>_r(e,t)):_r(r,t)}});function _r(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}var Er=/*@__PURE__*/De("$ZodPrefault",(e,t)=>{_n.init(e,t),e._zod.optin="optional",Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Cr=/*@__PURE__*/De("$ZodNonOptional",(e,t)=>{_n.init(e,t),Ge(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Ir(t,e)):Ir(o,e)}});function Ir(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Tr=/*@__PURE__*/De("$ZodCatch",(e,t)=>{_n.init(e,t),e._zod.optin="optional",Ge(e._zod,"optout",()=>t.innerType._zod.optout),Ge(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>pt(e,n,Ue()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>pt(e,n,Ue()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),zr=/*@__PURE__*/De("$ZodPipe",(e,t)=>{_n.init(e,t),Ge(e._zod,"values",()=>t.in._zod.values),Ge(e._zod,"optin",()=>t.in._zod.optin),Ge(e._zod,"optout",()=>t.out._zod.optout),Ge(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Mr(e,t.in,n)):Mr(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Mr(e,t.out,n)):Mr(r,t.out,n)}});function Mr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Or=/*@__PURE__*/De("$ZodReadonly",(e,t)=>{_n.init(e,t),Ge(e._zod,"propValues",()=>t.innerType._zod.propValues),Ge(e._zod,"values",()=>t.innerType._zod.values),Ge(e._zod,"optin",()=>t.innerType?._zod?.optin),Ge(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Rr):Rr(r)}});function Rr(e){return e.value=Object.freeze(e.value),e}var Nr,Ar=/*@__PURE__*/De("$ZodCustom",(e,t)=>{on.init(e,t),_n.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>Pr(t,n,r,e));Pr(o,n,r,e)}});function Pr(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ft(e))}}var $r=class{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};(Nr=globalThis).__zod_globalRegistry??(Nr.__zod_globalRegistry=new $r);var Dr=globalThis.__zod_globalRegistry;function Lr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...st(t)})}function jr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...st(t)})}function Fr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...st(t)})}function Ur(e,t){return new an({check:"less_than",...st(t),value:e,inclusive:!1})}function Wr(e,t){return new an({check:"less_than",...st(t),value:e,inclusive:!0})}function Br(e,t){return new cn({check:"greater_than",...st(t),value:e,inclusive:!1})}function Hr(e,t){return new cn({check:"greater_than",...st(t),value:e,inclusive:!0})}function Zr(e,t){return new ln({check:"multiple_of",...st(t),value:e})}function qr(e,t){return new un({check:"max_length",...st(t),maximum:e})}function Vr(e,t){return new pn({check:"min_length",...st(t),minimum:e})}function Gr(e,t){return new hn({check:"length_equals",...st(t),length:e})}function Yr(e){return new xn({check:"overwrite",tx:e})}function Jr(e,t){const n=new on({check:"custom",...st(t)});return n._zod.check=e,n}function Xr(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Dr,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:/* @__PURE__ */new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Kr(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),Kr(i,t,r),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),"input"===t.io&&to(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Qr(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=/* @__PURE__ */new Map;for(const i of e.seen.entries()){const t=e.metadataRegistry.get(i[0])?.id;if(t){const e=r.get(t);if(e&&e!==i[0])throw new Error(`Duplicate schema id "${t}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(t,i[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const s=r.schema;for(const e in s)delete s[e];s.$ref=o};if("throw"===e.cycles)for(const i of e.seen.entries()){const e=i[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const n=i[1];if(t!==i[0]){if(e.external){const n=e.external.registry.get(i[0])?.id;if(t!==i[0]&&n){o(i);continue}}(e.metadataRegistry.get(i[0])?.id||n.cycle||n.count>1&&"ref"===e.reused)&&o(i)}else o(i)}}function eo(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},s=n.ref;if(n.ref=null,s){r(s);const n=e.seen.get(s),a=n.schema;if(!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,i),t._zod.parent===s)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const c of[...e.seen.entries()].reverse())r(c[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;void 0!==i&&o.id===i&&delete o.id;const s=e.external?.defs??{};for(const c of e.seen.entries()){const e=c[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?o.$defs=s:o.definitions=s);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:no(t,"input",e.processors),output:no(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(a){throw new Error("Error converting schema to JSON.")}}function to(e,t){const n=t??{seen:/* @__PURE__ */new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return to(r.element,n);if("set"===r.type)return to(r.valueType,n);if("lazy"===r.type)return to(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return to(r.innerType,n);if("intersection"===r.type)return to(r.left,n)||to(r.right,n);if("record"===r.type||"map"===r.type)return to(r.keyType,n)||to(r.valueType,n);if("pipe"===r.type)return!!e._zod.traits.has("$ZodCodec")||(to(r.in,n)||to(r.out,n));if("object"===r.type){for(const e in r.shape)if(to(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(to(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(to(e,n))return!0;return!(!r.rest||!to(r.rest,n))}return!1}var no=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=Xr({...o??{},target:i,io:t,processors:n});return Kr(e,s),Qr(s,e),eo(s,e)},ro={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},oo=(e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r);t.seen.get(e).ref=o.innerType},io=/*@__PURE__*/De("ZodISODateTime",(e,t)=>{Ln.init(e,t),Ao.init(e,t)});function so(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...st(t)})}(io,e)}var ao=/*@__PURE__*/De("ZodISODate",(e,t)=>{jn.init(e,t),Ao.init(e,t)});function co(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...st(t)})}(ao,e)}var lo=/*@__PURE__*/De("ZodISOTime",(e,t)=>{Fn.init(e,t),Ao.init(e,t)});function uo(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...st(t)})}(lo,e)}var po=/*@__PURE__*/De("ZodISODuration",(e,t)=>{Un.init(e,t),Ao.init(e,t)});function ho(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...st(t)})}(po,e)}var fo=(e,t)=>{gt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=(e,o=[])=>{for(const i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e},[...o,...i.path]));else if("invalid_key"===i.code)r({issues:i.issues},[...o,...i.path]);else if("invalid_element"===i.code)r({issues:i.issues},[...o,...i.path]);else{const e=[...o,...i.path];if(0===e.length)n._errors.push(t(i));else{let r=n,o=0;for(;o<e.length;){const n=e[o];o!==e.length-1?r[n]=r[n]||{_errors:[]}:(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(i))),r=r[n],o++}}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Be,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Be,2)}},isEmpty:{get:()=>0===e.issues.length}})},mo=/*@__PURE__*/De("ZodError",fo,{Parent:Error}),go=/* @__PURE__ */bt(mo),yo=/* @__PURE__ */vt(mo),bo=/* @__PURE__ */wt(mo),vo=/* @__PURE__ */kt(mo),wo=/* @__PURE__ */_t(mo),xo=/* @__PURE__ */Et(mo),ko=/* @__PURE__ */Ct(mo),So=/* @__PURE__ */It(mo),_o=/* @__PURE__ */Tt(mo),Eo=/* @__PURE__ */zt(mo),Co=/* @__PURE__ */Mt(mo),Io=/* @__PURE__ */Ot(mo),To=/* @__PURE__ */new WeakMap;function zo(e,t,n){const r=Object.getPrototypeOf(e);let o=To.get(r);if(o||(o=/* @__PURE__ */new Set,To.set(r,o)),!o.has(t)){o.add(t);for(const e in n){const t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){const n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var Mo=/*@__PURE__*/De("ZodType",(e,t)=>(_n.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:no(e,"input"),output:no(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=Xr({...n,processors:t});return Kr(e,r),Qr(r,e),eo(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>go(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>bo(e,t,n),e.parseAsync=async(t,n)=>yo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>vo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>wo(e,t,n),e.decode=(t,n)=>xo(e,t,n),e.encodeAsync=async(t,n)=>ko(e,t,n),e.decodeAsync=async(t,n)=>So(e,t,n),e.safeEncode=(t,n)=>_o(e,t,n),e.safeDecode=(t,n)=>Eo(e,t,n),e.safeEncodeAsync=async(t,n)=>Co(e,t,n),e.safeDecodeAsync=async(t,n)=>Io(e,t,n),zo(e,"ZodType",{check(...e){const t=this.def;return this.clone(Je(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return it(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...st(n)})}($i,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return function(e,t){const n=/* @__PURE__ */Jr(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(ft(e,t.value,n._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=t.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),t.issues.push(ft(r))}},e(t.value,t)),t);return n}(e,t)}(e,t))},overwrite(e){return this.check(Yr(e))},optional(){return Ei(this)},exactOptional(){return new Ci({type:"optional",innerType:this})},nullable(){return Ti(this)},nullish(){return Ei(Ti(this))},nonoptional(e){return function(e,t){return new Oi({type:"nonoptional",innerType:e,...st(t)})}(this,e)},array(){return pi(this)},or(e){return gi([this,e])},and(e){return new yi({type:"intersection",left:this,right:e})},transform(e){return Ai(this,new Si({type:"transform",transform:e}))},default(e){return t=e,new zi({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():nt(t)}});var t},prefault(e){return t=e,new Mi({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():nt(t)}});var t},catch(e){return new Ri({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return Ai(this,e)},readonly(){return new Pi({type:"readonly",innerType:this})},describe(e){const t=this.clone();return Dr.add(t,{description:e}),t},meta(...e){if(0===e.length)return Dr.get(this);const t=this.clone();return Dr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>Dr.get(e)?.description,configurable:!0}),e)),Oo=/*@__PURE__*/De("_ZodString",(e,t)=>{En.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:s,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),s&&(r.format=ro[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),c&&(r.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,zo(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new mn({check:"string_format",format:"regex",...st(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new bn({check:"string_format",format:"includes",...st(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new vn({check:"string_format",format:"starts_with",...st(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new wn({check:"string_format",format:"ends_with",...st(t),suffix:e})}(...e))},min(...e){return this.check(Vr(...e))},max(...e){return this.check(qr(...e))},length(...e){return this.check(Gr(...e))},nonempty(...e){return this.check(Vr(1,...e))},lowercase(e){return this.check(function(e){return new gn({check:"string_format",format:"lowercase",...st(e)})}(e))},uppercase(e){return this.check(function(e){return new yn({check:"string_format",format:"uppercase",...st(e)})}(e))},trim(){return this.check(/* @__PURE__ */Yr(e=>e.trim()))},normalize(...e){return this.check(function(e){/* @__PURE__ */
|
|
2
|
-
return Yr(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(/* @__PURE__ */Yr(e=>e.toLowerCase()))},toUpperCase(){return this.check(/* @__PURE__ */Yr(e=>e.toUpperCase()))},slugify(){return this.check(/* @__PURE__ */Yr(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),Ro=/*@__PURE__*/De("ZodString",(e,t)=>{En.init(e,t),Oo.init(e,t),e.email=t=>e.check(Lr(Po,t)),e.url=t=>e.check(Fr(Lo,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...st(t)})}(Qo,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...st(t)})}(jo,t)),e.guid=t=>e.check(jr($o,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...st(t)})}(Do,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...st(t)})}(Do,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...st(t)})}(Do,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...st(t)})}(Do,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...st(t)})}(Fo,t)),e.guid=t=>e.check(jr($o,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...st(t)})}(Uo,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...st(t)})}(Wo,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...st(t)})}(Bo,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...st(t)})}(Jo,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...st(t)})}(Xo,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...st(t)})}(Ho,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...st(t)})}(Zo,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...st(t)})}(qo,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...st(t)})}(Vo,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...st(t)})}(Go,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...st(t)})}(Yo,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...st(t)})}(Ko,t)),e.datetime=t=>e.check(so(t)),e.date=t=>e.check(co(t)),e.time=t=>e.check(uo(t)),e.duration=t=>e.check(ho(t))});function No(e){return function(e,t){return new e({type:"string",...st(t)})}(Ro,e)}var Ao=/*@__PURE__*/De("ZodStringFormat",(e,t)=>{Cn.init(e,t),Oo.init(e,t)}),Po=/*@__PURE__*/De("ZodEmail",(e,t)=>{zn.init(e,t),Ao.init(e,t)});var $o=/*@__PURE__*/De("ZodGUID",(e,t)=>{In.init(e,t),Ao.init(e,t)}),Do=/*@__PURE__*/De("ZodUUID",(e,t)=>{Tn.init(e,t),Ao.init(e,t)}),Lo=/*@__PURE__*/De("ZodURL",(e,t)=>{Mn.init(e,t),Ao.init(e,t)});var jo=/*@__PURE__*/De("ZodEmoji",(e,t)=>{On.init(e,t),Ao.init(e,t)}),Fo=/*@__PURE__*/De("ZodNanoID",(e,t)=>{Rn.init(e,t),Ao.init(e,t)}),Uo=/*@__PURE__*/De("ZodCUID",(e,t)=>{Nn.init(e,t),Ao.init(e,t)}),Wo=/*@__PURE__*/De("ZodCUID2",(e,t)=>{An.init(e,t),Ao.init(e,t)}),Bo=/*@__PURE__*/De("ZodULID",(e,t)=>{Pn.init(e,t),Ao.init(e,t)}),Ho=/*@__PURE__*/De("ZodXID",(e,t)=>{$n.init(e,t),Ao.init(e,t)}),Zo=/*@__PURE__*/De("ZodKSUID",(e,t)=>{Dn.init(e,t),Ao.init(e,t)}),qo=/*@__PURE__*/De("ZodIPv4",(e,t)=>{Wn.init(e,t),Ao.init(e,t)}),Vo=/*@__PURE__*/De("ZodIPv6",(e,t)=>{Bn.init(e,t),Ao.init(e,t)}),Go=/*@__PURE__*/De("ZodCIDRv4",(e,t)=>{Hn.init(e,t),Ao.init(e,t)}),Yo=/*@__PURE__*/De("ZodCIDRv6",(e,t)=>{Zn.init(e,t),Ao.init(e,t)}),Jo=/*@__PURE__*/De("ZodBase64",(e,t)=>{Vn.init(e,t),Ao.init(e,t)}),Xo=/*@__PURE__*/De("ZodBase64URL",(e,t)=>{Gn.init(e,t),Ao.init(e,t)}),Ko=/*@__PURE__*/De("ZodE164",(e,t)=>{Yn.init(e,t),Ao.init(e,t)}),Qo=/*@__PURE__*/De("ZodJWT",(e,t)=>{Jn.init(e,t),Ao.init(e,t)}),ei=/*@__PURE__*/De("ZodNumber",(e,t)=>{Xn.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";const d="number"==typeof l&&l>=(o??Number.NEGATIVE_INFINITY),u="number"==typeof c&&c<=(i??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;d?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof o&&(r.minimum=o),u?p?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:"number"==typeof i&&(r.maximum=i),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),zo(e,"ZodNumber",{gt(e,t){return this.check(Br(e,t))},gte(e,t){return this.check(Hr(e,t))},min(e,t){return this.check(Hr(e,t))},lt(e,t){return this.check(Ur(e,t))},lte(e,t){return this.check(Wr(e,t))},max(e,t){return this.check(Wr(e,t))},int(e){return this.check(ri(e))},safe(e){return this.check(ri(e))},positive(e){return this.check(Br(0,e))},nonnegative(e){return this.check(Hr(0,e))},negative(e){return this.check(Ur(0,e))},nonpositive(e){return this.check(Wr(0,e))},multipleOf(e,t){return this.check(Zr(e,t))},step(e,t){return this.check(Zr(e,t))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ti(e){return function(e,t){return new e({type:"number",checks:[],...st(t)})}(ei,e)}var ni=/*@__PURE__*/De("ZodNumberFormat",(e,t)=>{Kn.init(e,t),ei.init(e,t)});function ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...st(t)})}(ni,e)}var oi=/*@__PURE__*/De("ZodBoolean",(e,t)=>{Qn.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function ii(e){return function(e,t){return new e({type:"boolean",...st(t)})}(oi,e)}var si=/*@__PURE__*/De("ZodUnknown",(e,t)=>{er.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function ai(){return new si({type:"unknown"})}var ci=/*@__PURE__*/De("ZodNever",(e,t)=>{tr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function li(e){return function(e,t){return new e({type:"never",...st(t)})}(ci,e)}var di=/*@__PURE__*/De("ZodDate",(e,t)=>{nr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(Hr(t,n)),e.max=(t,n)=>e.check(Wr(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),ui=/*@__PURE__*/De("ZodArray",(e,t)=>{or.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(o.minItems=s),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=Kr(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,zo(e,"ZodArray",{min(e,t){return this.check(Vr(e,t))},nonempty(e){return this.check(Vr(1,e))},max(e,t){return this.check(qr(e,t))},length(e,t){return this.check(Gr(e,t))},unwrap(){return this.element}})});function pi(e,t){return function(e,t,n){return new e({type:"array",element:t,...st(n)})}(ui,e,t)}var hi=/*@__PURE__*/De("ZodObject",(e,t)=>{lr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const l in s)o.properties[l]=Kr(s[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(o.required=Array.from(c)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Kr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),Ge(e,"shape",()=>t.shape),zo(e,"ZodObject",{keyof(){return xi(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ai()})},loose(){return this.clone({...this._zod.def,catchall:ai()})},strict(){return this.clone({...this._zod.def,catchall:li()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!tt(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return it(e,Je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ye(this,"shape",n),n}}))}(this,e)},safeExtend(e){return function(e,t){if(!tt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,Je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ye(this,"shape",n),n}}))}(this,e)},merge(e){return function(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");return it(e,Je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ye(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}(this,e)},pick(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return it(e,Je(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ye(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");return it(e,Je(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ye(this,"shape",r),r},checks:[]}))}(this,e)},partial(...e){return function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");return it(t,Je(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Ye(this,"shape",o),o},checks:[]}))}(_i,this,e[0])},required(...e){return t=Oi,n=this,r=e[0],it(n,Je(n._zod.def,{get shape(){const e=n._zod.def.shape,o={...e};if(r)for(const n in r){if(!(n in o))throw new Error(`Unrecognized key: "${n}"`);r[n]&&(o[n]=new t({type:"nonoptional",innerType:e[n]}))}else for(const n in e)o[n]=new t({type:"nonoptional",innerType:e[n]});return Ye(this,"shape",o),o}}));var t,n,r}})});function fi(e,t){const n={type:"object",shape:e??{},...st(t)};return new hi(n)}var mi=/*@__PURE__*/De("ZodUnion",(e,t)=>{ur.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,s=o.options.map((e,n)=>Kr(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options});function gi(e,t){return new mi({type:"union",options:e,...st(t)})}var yi=/*@__PURE__*/De("ZodIntersection",(e,t)=>{pr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Kr(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Kr(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length;n.allOf=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]]})(e,t,n,r)});var bi=/*@__PURE__*/De("ZodRecord",(e,t)=>{mr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,a=s._zod.bag?.patterns;if("loose"===i.mode&&a&&a.size>0){const e=Kr(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const t of a)o.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(o.propertyNames=Kr(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Kr(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const e=[...c].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(o.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vi(e,t,n){return t&&t._zod?new bi({type:"record",keyType:e,valueType:t,...st(n)}):new bi({type:"record",keyType:No(),valueType:e,...st(t)})}var wi=/*@__PURE__*/De("ZodEnum",(e,t)=>{gr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=We(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new wi({...t,checks:[],...st(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new wi({...t,checks:[],...st(r),entries:o})}});function xi(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wi({type:"enum",entries:n,...st(t)})}var ki=/*@__PURE__*/De("ZodLiteral",(e,t)=>{yr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const i of r.values)if(void 0===i){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof i){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(i))}else o.push(i);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});var Si=/*@__PURE__*/De("ZodTransform",(e,t)=>{br.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new je(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ft(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ft(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});var _i=/*@__PURE__*/De("ZodOptional",(e,t)=>{wr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Ei(e){return new _i({type:"optional",innerType:e})}var Ci=/*@__PURE__*/De("ZodExactOptional",(e,t)=>{xr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});var Ii=/*@__PURE__*/De("ZodNullable",(e,t)=>{kr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Kr(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ti(e){return new Ii({type:"nullable",innerType:e})}var zi=/*@__PURE__*/De("ZodDefault",(e,t)=>{Sr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});var Mi=/*@__PURE__*/De("ZodPrefault",(e,t)=>{Er.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});var Oi=/*@__PURE__*/De("ZodNonOptional",(e,t)=>{Cr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});var Ri=/*@__PURE__*/De("ZodCatch",(e,t)=>{Tr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});var Ni=/*@__PURE__*/De("ZodPipe",(e,t)=>{zr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s="input"===t.io?i?o.out:o.in:o.out;Kr(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function Ai(e,t){return new Ni({type:"pipe",in:e,out:t})}var Pi=/*@__PURE__*/De("ZodReadonly",(e,t)=>{Or.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});var $i=/*@__PURE__*/De("ZodCustom",(e,t)=>{Ar.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function Di(e){return function(e,t){return new e({type:"number",coerce:!0,checks:[],...st(t)})}(ei,e)}function Li(e){return function(e,t){return new e({type:"date",coerce:!0,...st(t)})}(di,e)}var ji,Fi=xi(["created","active","suspended"]),Ui=fi({id:ti().optional(),created_at:Li().optional(),updated_at:Li().optional()}),Wi=(fi({id:Di()}),fi({slug:No()}),fi({widget_id:Di()}),fi({simulation_id:Di()}),fi({application_id:Di()}),fi({user_id:Di()}),fi({limit:Di().optional().default(50),offset:Di().optional().default(0)}),gi([ii(),No()]).transform(e=>"boolean"==typeof e?e:"true"===e||"false"!==e&&void 0).optional(),fi({success:function(e,t){return new ki({type:"literal",values:Array.isArray(e)?e:[e],...st(t)})}(!0)})),Bi=(Wi.extend({message:No()}),fi({name:No().min(1),params:vi(No(),ai()).default({}),result:vi(No(),ai()).default({})}),Fr(Lo,ji).refine(e=>/^https:\/\/hooks\.slack\.com\//.test(e),{message:"Slack webhook URL must start with https://hooks.slack.com/"}),fi({start:No(),end:No(),action:No()}).passthrough()),Hi=fi({id:No(),label:No(),purpose:No(),elements:pi(vi(No(),ai())).default([]),bbox:vi(No(),ai()).default({}),screenshot:No().default(""),embedding:pi(ti()).nullish()}).passthrough(),Zi=fi({id:No(),title:No(),url:No(),summary:No().default(""),screenshot:No().default(""),sections:pi(Hi).default([]),sequence_ids:pi(ti()).default([]),embedding:pi(ti()).nullish()}).passthrough(),qi=(fi({nodes:pi(Zi),edges:pi(Bi)}),xi(["answered","dismissed","cancelled"]),xi(["free","startup","growth","enterprise"])),Vi=xi(["app","website"]),Gi=xi(["widget"]),Yi=xi(["tell","show","do"]),Ji=xi(["password","oauth"]),Xi=xi(["admin","member"]),Ki=(Ui.extend({is_super:ii(),status:Fi,email:function(e){return Lr(Po,e)}(),external_id:No().nullish(),first_name:No().nullish(),last_name:No().nullish(),password:No().nullish(),image_url:No().nullish(),last_login_at:Li().nullish(),auth_method:Ji.nullish(),workspace_role:Xi.nullish()}),Ui.extend({name:No(),slug:No(),status:Fi,package:qi,ending_date:Li().nullish(),external_workspace_id:No().nullish(),slack_webhook_configured:ii().optional(),notify_all_members_on_question:ii().optional()}),Ui.extend({workspace_id:ti(),name:No(),slug:No(),type:Vi,url:No(),username:No().nullish(),password:No().nullish(),allowed_domains:pi(No()).default([])}).omit({password:!0}),fi({chip_mode:Yi,chip_text:No()})),Qi=fi({widget_enabled:ii(),widget_appearance:xi(["default","hidden"]),widget_position:xi(["bottom_left","bottom_right","top_left","top_right"]),widget_header:No(),widget_body:No(),widget_greeting:No(),widget_greeting_toast:ii(),widget_recording:ii(),widget_feature_tell:ii(),widget_feature_show:ii(),widget_feature_do:ii(),widget_background_color:No(),widget_text_color:No(),widget_border_color:No(),widget_accent_color:No(),widget_secondary_color:No(),widget_border_radius:No(),widget_font_size:No(),widget_width:No(),widget_height:No(),widget_animation_duration:No(),widget_fade_duration:No(),widget_chips:pi(Ki)}),es=(Qi.omit({widget_border_radius:!0,widget_font_size:!0,widget_animation_duration:!0,widget_fade_duration:!0}),Ui.extend({application_id:ti(),type:Gi,settings:Qi,status:Fi,marketrix_id:No(),marketrix_key:No(),snippet:No().nullish()}),xi(["user_login","url_visit","update_workspace","create_user","update_user","delete_user","create_application","update_application","delete_application","create_widget","update_widget","delete_widget","create_knowledge","update_knowledge","delete_knowledge","request_membership","invite_user","create_workspace","trial_started","trial_ending_soon","trial_ended","subscription_created","subscription_canceled","plan_changed","payment_succeeded","payment_failed","widget_question","qa_run_started","start_simulation","create_workflow","update_workflow","delete_workflow","toggle_workflow","slack_command","create_form","update_form","delete_form","duplicate_form","publish_form","unpublish_form","archive_form","submit_form_response","delete_form_response"])),ts=fi({details:No().optional(),id:ti().optional(),type:No().optional(),name:No().optional(),target_user_id:ti().optional(),target_user_email:No().optional(),reason:No().optional(),ip_address:No().optional(),user_agent:No().optional(),widget_type:No().optional(),created_by:ti().optional()}).passthrough();Ui.extend({workspace_id:ti(),user_id:ti().nullable(),type:es,metadata:ts.optional()}).partial().extend({type:es});function ns(e){return fe(new $e({url:e}))}var rs="",os=ns(""),is=new Proxy({},{get:(e,t)=>os[t]}),ss="marketrix_chat_context",as={chat_id:null,messages:[],isTaskRunning:!1,currentMode:"tell",isOpen:!1,config:null,timestamp:0};function cs(e){try{return"undefined"==typeof localStorage?null:localStorage.getItem(e)}catch(t){return null}}function ls(e,t){try{"undefined"!=typeof localStorage&&localStorage.setItem(e,t)}catch(n){}}var ds,us=new class{context=function(){const e=cs(ss);if(!e)return{...as};try{const t={...as,...JSON.parse(e)};if(Date.now()-t.timestamp<=6048e5)return t}catch(t){}return{...as}}();getContext(){return this.context}updateContext(e){this.context={...this.context,...e,timestamp:Date.now()},ls(ss,JSON.stringify(this.context))}getChatId(){const e="undefined"==typeof window?"":window.name;return e.trim()?(e!==this.context.chat_id&&this.updateContext({chat_id:e}),e):this.context.chat_id}setChatId(e){this.updateContext({chat_id:e}),"undefined"!=typeof window&&(window.name=e)}getConfig(){return this.context.config}setConfig(e){this.updateContext({config:e})}},ps=new class{creation=null;async getOrCreateChatId(){const e=us.getChatId();return e||(this.creation??=this.createChatId().finally(()=>{this.creation=null}),this.creation)}async createChatId(){const e=await is.chatCreate(void 0);if(!e)throw new Error("API returned empty chat ID");return us.setChatId(e),e}},hs=Object.defineProperty,fs=(e,t,n)=>((e,t,n)=>t in e?hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),ms=/* @__PURE__ */(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(ms||{}),gs=/* @__PURE__ */(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(gs||{}),ys=/* @__PURE__ */(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ys||{}),bs=/* @__PURE__ */(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(bs||{}),vs=/* @__PURE__ */(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(vs||{}),ws=/* @__PURE__ */(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ws||{}),xs=/* @__PURE__ */(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(xs||{}),ks={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ss={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},_s={},Es={};function Cs(e){if(_s[e])return _s[e];const t=globalThis[e],n=t.prototype,r=e in ks?ks[e]:void 0,o=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),i=e in Ss?Ss[e]:void 0,s=Boolean(i&&i.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&s&&!globalThis.Zone)return _s[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;if(!i)return r.remove(),n;const s=navigator.userAgent;return s.includes("Safari")&&!s.includes("Chrome")?(r.classList.add("rr-block"),r.setAttribute("__rrwebUntaintedMutationObserver",""),Es[e]=()=>r.remove()):r.remove(),_s[e]=i}catch{return n}}var Is={};function Ts(e,t,n){var r;const o=`${e}.${String(n)}`;if(Is[o])return Is[o].call(t);const i=Cs(e),s=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return s?(Is[o]=s,s.call(t)):t[n]}var zs={};function Ms(e,t,n){const r=`${e}.${String(n)}`;if(zs[r])return zs[r].bind(t);const o=Cs(e)[n];return"function"!=typeof o?t[n]:(zs[r]=o,o.bind(t))}function Os(){return[Cs("MutationObserver").constructor,Es.MutationObserver??(()=>{})]}var Rs=Date.now;function Ns(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())||(Rs=()=>/* @__PURE__ */(new Date).getTime());var As={ownerDocument:function(e){return Ts("Node",e,"ownerDocument")},childNodes:function(e){return Ts("Node",e,"childNodes")},parentNode:function(e){return Ts("Node",e,"parentNode")},parentElement:function(e){return Ts("Node",e,"parentElement")},textContent:function(e){return Ts("Node",e,"textContent")},contains:function(e,t){return Ms("Node",e,"contains")(t)},getRootNode:function(e){return Ms("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ts("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ts("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ts("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ts("Element",e,"querySelectorAll")(t)},nowTimestamp:Rs,mutationObserverCtor:Os,patch:Ns};function Ps(e){return e.nodeType===e.ELEMENT_NODE}function $s(e){const t=e&&"host"in e&&"mode"in e&&As.host(e)||null;return Boolean(t&&"shadowRoot"in t&&As.shadowRoot(t)===e)}function Ds(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ls(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(t=Array.from(n,e=>js(e,r)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function js(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Ls(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?Js(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?Js(n,t):n}}var Fs=class{constructor(){fs(this,"idNodeMap",/* @__PURE__ */new Map),fs(this,"nodeMetaMap",/* @__PURE__ */new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=/* @__PURE__ */new Map,this.nodeMetaMap=/* @__PURE__ */new WeakMap}};function Us({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let s=o||"";const a=r&&Ws(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=i?i(s,e):"*".repeat(s.length)),s}function Ws(e){return e.toLowerCase()}var Bs="__rrweb_original__";function Hs(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ws(t):null}function Zs(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(o){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}var qs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Vs=/^(?:[a-z+]+:)?\/\//i,Gs=/^www\..*/i,Ys=/^(data:)([^,]*),(.*)/i;function Js(e,t){return(e||"").replace(qs,(e,n,r,o,i,s)=>{const a=r||i||s,c=n||o||"";if(!a)return e;if(Vs.test(a)||Gs.test(a))return`url(${c}${a}${c})`;if(Ys.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=a.split("#")[0],d=a.substring(l.length),u=t.split("#")[0].split("/"),p=l.split("/");u.pop();for(const t of p){if("."===t)continue;".."===t?u.pop():u.push(t)}return`url(${c}${u.join("/")}${d}${c})`})}function Xs(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ks(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&"string"==typeof e){let t=Xs(e,n);const s=t.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&"string"==typeof r[a].textContent){const c=Xs(r[a].textContent,n),l=100;let d=3;for(;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){let u=c.substring(0,d),p=t.split(u),h=-1;if(2===p.length)h=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[a-1].textContent)h=t.indexOf(u,1);else if(1===p.length){if(u=u.substring(0,u.length-1),p=t.split(u),p.length<=1)return o.push(e),o;d=101}else d===c.length-1&&(h=t.indexOf(u));if(p.length>=2&&d>l){const e=r[a-1].textContent;if(e&&"string"==typeof e){const n=Xs(e).length;h=t.indexOf(u,n)}-1===h&&(h=p[0].length)}if(-1!==h){let a=Math.floor(h/s);for(;a>0&&a<e.length;){if(i+=1,i>50*r.length)return o.push(e),o;const c=Xs(e.substring(0,a),n);if(c.length===h){o.push(e.substring(0,a)),e=e.substring(a),t=t.substring(h);break}c.length<h?a+=Math.max(1,Math.floor((h-c.length)/s)):a-=Math.max(1,Math.floor((c.length-h)*s))}break}}}}return o.push(e),o}(e,t).join("/* rr_split */")}var Qs,ea,ta=1,na=/* @__PURE__ */new RegExp("[^a-z0-9-_:]");function ra(){return ta++}var oa=/^[^ \t\n\r\u000c]+/,ia=/^[, \t\n\r\u000c]+/;var sa=/* @__PURE__ */new WeakMap;function aa(e,t){return t&&""!==t.trim()?la(e,t):t}function ca(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function la(e,t){let n=sa.get(e);if(n||(n=e.createElement("a"),sa.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function da(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?aa(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(ia),!(n>=t.length);){let i=r(oa);if(","===i.slice(-1))i=aa(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=aa(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?Js(r,la(e)):"object"===t&&"data"===n?aa(e,r):r:r}function ua(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function pa(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&pa(As.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&pa(As.parentNode(e),t,n)}function ha(e,t,n,r){let o;if(Ps(e)){if(o=e,!As.childNodes(o).length)return!1}else{if(null===As.parentElement(e))return!1;o=As.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(pa(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(i){}return!1}function fa(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:c={},maskTextFn:l,maskInputFn:d,dataURLOptions:u={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:xs.Document,childNodes:[],compatMode:e.compatMode}:{type:xs.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:xs.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:c={},inlineImages:l,recordCanvas:d,keepIframeSrcFn:u,newlyAddedElement:p=!1,rootId:h}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ws(e.tagName);return na.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let w=0;w<y;w++){const t=e.attributes[w];ua(m,t.name,t.value)||(g[t.name]=da(n,m,Ws(t.name),t.value))}if("link"===m&&i){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=Ls(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===m&&e.sheet){let t=Ls(e.sheet);t&&(e.childNodes.length>1&&(t=Ks(t,e)),g._cssText=t)}if(["input","textarea","select"].includes(m)){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Us({element:e,type:Hs(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===m&&(e.selected&&!s.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=Bs in o?o[Bs]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(c.type,c.quality)&&(g.rr_dataURL=t)}if("img"===m&&l){Qs||(Qs=n.createElement("canvas"),ea=Qs.getContext("2d"));const t=e,r=(t.currentSrc||t.getAttribute("src"),t.crossOrigin),o=()=>{t.removeEventListener("load",o);try{Qs.width=t.naturalWidth,Qs.height=t.naturalHeight,ea.drawImage(t,0,0),g.rr_dataURL=Qs.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o))}"anonymous"===t.crossOrigin&&(r?g.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if(["audio","video"].includes(m)){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==m||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let b;try{customElements.get(m)&&(b=!0)}catch(v){}return{type:xs.Element,tagName:m,attributes:g,childNodes:[],isSVG:ca(e)||void 0,needBlock:f,rootId:h,isCustom:b}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c,maskInputFn:d,dataURLOptions:u,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,s=As.parentNode(e),a=s&&s.tagName;let c="";const l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;d?c="SCRIPT_PLACEHOLDER":i||(c=As.textContent(e),l&&c&&(c=Js(c,la(t.doc))));!l&&!d&&c&&n&&(c=r?r(c,As.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:xs.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:s,maskTextFn:l,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:xs.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:xs.Comment,textContent:As.textContent(e)||"",rootId:y};default:return!1}}function ma(e){return null==e?"":e.toLowerCase()}function ga(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function ya(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:S=!1,cssCaptured:_=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:C=!0}=t;E||(E=ha(e,s,a,void 0===E));const I=fa(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:k,newlyAddedElement:S,cssCaptured:_});if(!I)return null;let T;T=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===xs.Comment)return!0;if(e.type===xs.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Zs(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ma(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ma(e.attributes.name)||"icon"===ma(e.attributes.rel)||"apple-touch-icon"===ma(e.attributes.rel)||"shortcut icon"===ma(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ma(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ma(e.attributes.property).match(/^(og|twitter|fb):/)||ma(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ma(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ma(e.attributes.name)||"googlebot"===ma(e.attributes.name)||"bingbot"===ma(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ma(e.attributes.name)||"generator"===ma(e.attributes.name)||"framework"===ma(e.attributes.name)||"publisher"===ma(e.attributes.name)||"progid"===ma(e.attributes.name)||ma(e.attributes.property).match(/^article:/)||ma(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ma(e.attributes.name)||"yandex-verification"===ma(e.attributes.name)||"csrf-token"===ma(e.attributes.name)||"p:domain_verify"===ma(e.attributes.name)||"verify-v1"===ma(e.attributes.name)||"verification"===ma(e.attributes.name)||"shopify-checkout-api-token"===ma(e.attributes.name)))return!0}}return!1}(I,h)||!C&&I.type===xs.Text&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ra();const z=Object.assign(I,{id:T});if(r.add(e,z),-2===T)return null;y&&y(e);let M=!c;if(z.type===xs.Element){M=M&&!z.needBlock,delete z.needBlock;const t=As.shadowRoot(e);t&&Ds(t)&&(z.isShadowHost=!0)}if((z.type===xs.Document||z.type===xs.Element)&&M){h.headWhitespace&&z.type===xs.Element&&"head"===z.tagName&&(C=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:C,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:k,cssCaptured:!1};if(z.type===xs.Element&&"textarea"===z.tagName&&void 0!==z.attributes.value);else{z.type===xs.Element&&void 0!==z.attributes._cssText&&"string"==typeof z.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(As.childNodes(e))){const e=ya(n,t);e&&z.childNodes.push(e)}}let S=null;if(Ps(e)&&(S=As.shadowRoot(e)))for(const e of Array.from(As.childNodes(S))){const n=ya(e,t);n&&(Ds(S)&&(n.isShadow=!0),z.childNodes.push(n))}}const O=As.parentNode(e);return O&&$s(O)&&Ds(O)&&(z.isShadow=!0),z.type===xs.Element&&"iframe"===z.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(a){return}if("complete"!==o){const r=setTimeout(()=>{i||(t(),i=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),i=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&b){const n=ya(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:C,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:k});n&&b(e,n)}},v),z.type===xs.Element&&"link"===z.tagName&&"string"==typeof z.attributes.rel&&("stylesheet"===z.attributes.rel||"preload"===z.attributes.rel&&"string"==typeof z.attributes.href&&"css"===Zs(z.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(s){return}if(r)return;const i=setTimeout(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),o=!0,t()})}(e,()=>{if(w){const t=ya(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:C,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:k});t&&w(e,t)}},x),z}var ba=class e{constructor(...e){fs(this,"parentElement",null),fs(this,"parentNode",null),fs(this,"ownerDocument"),fs(this,"firstChild",null),fs(this,"lastChild",null),fs(this,"previousSibling",null),fs(this,"nextSibling",null),fs(this,"ELEMENT_NODE",1),fs(this,"TEXT_NODE",3),fs(this,"nodeType"),fs(this,"nodeName"),fs(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function va(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var wa={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function xa(e,t,n={}){let r=null,o=0;return function(...i){const s=Date.now();o||!1!==n.leading||(o=s);const a=t-(s-o),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)},a))}}function ka(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>ka(e,t,i||{},!0)}function Sa(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=As.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=As.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function _a(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ea(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ca(e){return e?e.nodeType===e.ELEMENT_NODE?e:As.parentElement(e):null}function Ia(e,t,n,r){if(!e)return!1;const o=Ca(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(pa(o,t,r))return!0}catch(i){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function Ta(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function za(e,t){if($s(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=As.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||za(r,t))}function Ma(e){return Boolean(e.changedTouches)}function Oa(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ra(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Na(e){return!!e&&(e instanceof ba&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(As.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wa=new Proxy(wa,{get:(e,t,n)=>Reflect.get(e,t,n)}));var Aa=class{constructor(){fs(this,"id",1),fs(this,"styleIDMap",/* @__PURE__ */new WeakMap),fs(this,"idStyleMap",/* @__PURE__ */new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=/* @__PURE__ */new WeakMap,this.idStyleMap=/* @__PURE__ */new Map,this.id=1}generateId(){return this.id++}};function Pa(e){var t;let n=null;return"getRootNode"in e&&(null==(t=As.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&As.host(As.getRootNode(e))&&(n=As.host(As.getRootNode(e))),n}function $a(e){const t=As.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Pa(n);)n=t;return n}(e);return As.contains(t,n)}function Da(e){const t=As.ownerDocument(e);return!!t&&(As.contains(t,e)||$a(e))}function La(e){return"__ln"in e}var ja,Fa=class{constructor(){fs(this,"length",0),fs(this,"head",null),fs(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&La(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&La(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Ua=(e,t)=>`${e}@${t}`,Wa=class{constructor(){fs(this,"frozen",!1),fs(this,"locked",!1),fs(this,"texts",[]),fs(this,"attributes",[]),fs(this,"attributeMap",/* @__PURE__ */new WeakMap),fs(this,"removes",[]),fs(this,"mapRemoves",[]),fs(this,"movedMap",{}),fs(this,"addedSet",/* @__PURE__ */new Set),fs(this,"movedSet",/* @__PURE__ */new Set),fs(this,"droppedSet",/* @__PURE__ */new Set),fs(this,"removesSubTreeCache",/* @__PURE__ */new Set),fs(this,"mutationCb"),fs(this,"blockClass"),fs(this,"blockSelector"),fs(this,"maskTextClass"),fs(this,"maskTextSelector"),fs(this,"inlineStylesheet"),fs(this,"maskInputOptions"),fs(this,"maskTextFn"),fs(this,"maskInputFn"),fs(this,"keepIframeSrcFn"),fs(this,"recordCanvas"),fs(this,"inlineImages"),fs(this,"slimDOMOptions"),fs(this,"dataURLOptions"),fs(this,"doc"),fs(this,"mirror"),fs(this,"iframeManager"),fs(this,"stylesheetManager"),fs(this,"shadowDomManager"),fs(this,"canvasManager"),fs(this,"processedNodeManager"),fs(this,"unattachedDoc"),fs(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),fs(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=/* @__PURE__ */new Set,n=new Fa,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=As.parentNode(o);if(!i||!Da(o))return;let s=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(s=!0)}const a=$s(i)?this.mirror.getId(Pa(o)):this.mirror.getId(i),c=r(o);if(-1===a||-1===c)return n.addNode(o);const l=ya(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Oa(e,this.mirror)&&this.iframeManager.addIframe(e),Ra(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Na(o)&&this.shadowDomManager.addShadowRoot(As.shadowRoot(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});l&&(e.push({parentId:a,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Ha(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(As.parentNode(a))||o(a);for(const a of this.addedSet)Za(this.droppedSet,a)||Ha(this.removesSubTreeCache,a,this.mirror)?Za(this.movedSet,a)?o(a):this.droppedSet.add(a):o(a);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(As.parentNode(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(As.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=As.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=As.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=As.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=/* @__PURE__ */new WeakMap,this.removes=[],this.addedSet=/* @__PURE__ */new Set,this.movedSet=/* @__PURE__ */new Set,this.droppedSet=/* @__PURE__ */new Set,this.removesSubTreeCache=/* @__PURE__ */new Set,this.movedMap={},this.mutationCb(s))}),fs(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(As.childNodes(e),e=>As.textContent(e)||"").join("");t.attributes.value=Us({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Hs(e),value:n,maskInputFn:this.maskInputFn})}),fs(this,"processMutation",e=>{if(!Ta(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=As.textContent(e.target);Ia(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ha(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ca(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,o=e.target.getAttribute(r);if("value"===r){const e=Hs(n);o=Us({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(Ia(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(o)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!ua(n.tagName,r))if(i.attributes[r]=da(this.doc,Ws(n.tagName),Ws(r),o),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),o=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?t:[t,o]:i._unchangedStyles[e]=[t,o]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Ia(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=$s(e.target)?this.mirror.getId(As.host(e.target)):this.mirror.getId(e.target);Ia(e.target,this.blockClass,this.blockSelector,!1)||Ta(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ba(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||za(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ua(n,r)]?Ba(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!$s(e.target)||!Ds(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),As.childNodes(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),fs(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ta(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ua(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ia(e,this.blockClass,this.blockSelector,!1)||(As.childNodes(e).forEach(e=>this.genAdds(e)),Na(e)&&As.childNodes(As.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Ba(e,t){e.delete(t),As.childNodes(t).forEach(t=>Ba(e,t))}function Ha(e,t,n){return 0!==e.size&&function(e,t){const n=As.parentNode(t);return!!n&&e.has(n)}(e,t)}function Za(e,t){return 0!==e.size&&qa(e,t)}function qa(e,t){const n=As.parentNode(t);return!!n&&(!!e.has(n)||qa(e,n))}var Va=e=>{if(!ja)return e;return(...t)=>{try{return e(...t)}catch(n){if(ja&&!0===ja(n))return;throw n}}},Ga=[];function Ya(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ja(e,t){const n=new Wa;Ga.push(n),n.init(e);const[r,o]=Os(),i=new r(Va(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Xa({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let c=null;return Object.keys(ys).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(i=>{let s=Ws(i);const l=(t=>i=>{const s=Ya(i);if(Ia(s,r,o,!0))return;let a=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=bs.Mouse;break;case"touch":a=bs.Touch;break;case"pen":a=bs.Pen}a===bs.Touch?ys[t]===ys.MouseDown?l="TouchStart":ys[t]===ys.MouseUp&&(l="TouchEnd"):bs.Pen}else Ma(i)&&(a=bs.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===bs.Touch||l.startsWith("Mouse")&&a===bs.Mouse)&&(a=null)):ys[t]===ys.Click&&(a=c,c=null);const d=Ma(i)?i.changedTouches[0]:i;if(!d)return;const u=n.getId(s),{clientX:p,clientY:h}=d;Va(e)({type:ys[l],id:u,x:p,y:h,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(ys[i]){case ys.MouseDown:case ys.MouseUp:s=s.replace("mouse","pointer");break;case ys.TouchStart:case ys.TouchEnd:return}a.push(va(s,l,t))}),Va(()=>{a.forEach(e=>e())})}function Ka({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return va("scroll",Va(xa(Va(i=>{const s=Ya(i);if(!s||Ia(s,r,o,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Sa(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),i.scroll||100)),t)}var Qa=["INPUT","TEXTAREA","SELECT"],ec=/* @__PURE__ */new WeakMap;function tc(e){return function e(t,n){if(ic("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ic("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ic("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ic("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(r),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function nc(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function rc({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(As.host(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,c=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=c.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(o){}return r}}),Va(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function oc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Ja(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=xa(Va(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),i),l=Va(xa(Va(e=>{const t=Ya(e),{clientX:n,clientY:o}=Ma(e)?e.changedTouches[0]:e;s||(s=Rs()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Rs()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?gs.Drag:e instanceof MouseEvent?gs.MouseMove:gs.TouchMove)}),o,{trailing:!1})),d=[va("mousemove",l,n),va("touchmove",l,n),va("drag",l,n)];return Va(()=>{d.forEach(e=>e())})}(e),s=Xa(e),a=Ka(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return va("resize",Va(xa(Va(()=>{const t=_a(),o=Ea();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)}),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:d}){function u(e){let n=Ya(e);const l=e.isTrusted,u=n&&n.tagName;if(n&&"OPTION"===u&&(n=As.parentElement(n)),!n||!u||Qa.indexOf(u)<0||Ia(n,r,o,!0))return;if(n.classList.contains(i)||s&&n.matches(s))return;let h=n.value,f=!1;const m=Hs(n)||"";"radio"===m||"checkbox"===m?f=n.checked:(a[u.toLowerCase()]||a[m])&&(h=Us({element:n,maskInputOptions:a,tagName:u,type:m,value:h,maskInputFn:c})),p(n,d?{text:h,isChecked:f,userTriggered:l}:{text:h,isChecked:f});const g=n.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;p(e,d?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,r){const o=ec.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ec.set(t,r);const o=n.getId(t);Va(e)({...r,id:o})}}const h=("last"===l.input?["change"]:["input","change"]).map(e=>va(e,Va(u),t)),f=t.defaultView;if(!f)return()=>{h.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&h.push(...g.map(e=>ka(e[0],e[1],{set(){Va(u)({target:this,isTrusted:!1})}},!1,f))),Va(()=>{h.forEach(e=>e())})}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const s=Va(i=>xa(Va(o=>{const s=Ya(o);if(!s||Ia(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:d,loop:u}=s;e({type:i,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:d,loop:u})}),o.media||500)),a=[va("play",s(ws.Play),i),va("pause",s(ws.Pause),i),va("seeked",s(ws.Seeked),i),va("volumechange",s(ws.VolumeChange),i),va("ratechange",s(ws.RateChange),i)];return Va(()=>{a.forEach(e=>e())})}(e);let u=()=>{},p=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Va((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=nc(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:a}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),r.apply(o,i)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(o,i)})}));const c={};sc("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(sc("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),sc("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),sc("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Va((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=nc(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:[...tc(o),a||0]}]}),r.apply(o,i)})}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...tc(o),s]}]}),r.apply(o,i)})})}),Va(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:n}),p=rc(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Va((o,s,a)=>{var c;const[l,d,u]=a;if(n.has(l))return i.apply(s,[l,d,u]);const{id:p,styleId:h}=nc(null==(c=s.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:l,value:d,priority:u},index:tc(s.parentRule)}),o.apply(s,a)})});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Va((o,i,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(i,[l]);const{id:d,styleId:u}=nc(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||u&&-1!==u)&&e({id:d,styleId:u,remove:{property:l},index:tc(i.parentRule)}),o.apply(i,a)})}),Va(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=/* @__PURE__ */new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=Ns(t.fonts,"add",function(t){return function(n){return setTimeout(Va(()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=i}),r.push(s),Va(()=>{r.forEach(e=>e())})}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=Va(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const{startContainer:i,startOffset:s,endContainer:c,endOffset:l}=e.getRangeAt(t);Ia(i,r,o,!0)||Ia(c,r,o,!0)||a.push({start:n.getId(i),startOffset:s,end:n.getId(c),endOffset:l})}i({ranges:a})});return a(),va("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Ns(n.customElements,"define",function(e){return function(n,r,o){try{t({define:{name:n}})}catch(i){}return e.apply(this,[n,r,o])}}):()=>{}}(e),y=[];for(const b of e.plugins)y.push(b.observer(b.callback,n,b.options));return Va(()=>{Ga.forEach(e=>e.reset()),r?.disconnect(),o(),i(),s(),a(),c(),l(),d(),u(),p(),h(),f(),m(),g(),y.forEach(e=>e())})}function ic(e){return void 0!==window[e]}function sc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var ac=class{constructor(e){fs(this,"iframeIdToRemoteIdMap",/* @__PURE__ */new WeakMap),fs(this,"iframeRemoteIdToIdMap",/* @__PURE__ */new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=/* @__PURE__ */new WeakMap,void(this.iframeRemoteIdToIdMap=/* @__PURE__ */new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},cc=class{constructor(e){fs(this,"iframes",/* @__PURE__ */new WeakMap),fs(this,"crossOriginIframeMap",/* @__PURE__ */new WeakMap),fs(this,"crossOriginIframeMirror",new ac(ra)),fs(this,"crossOriginIframeStyleMirror"),fs(this,"crossOriginIframeRootIdMap",/* @__PURE__ */new WeakMap),fs(this,"mirror"),fs(this,"mutationCb"),fs(this,"wrappedEmit"),fs(this,"loadListener"),fs(this,"stylesheetManager"),fs(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ac(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ms.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ms.IncrementalSnapshot,data:{source:gs.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ms.Meta:case ms.Load:case ms.DomContentLoaded:return!1;case ms.Plugin:return t;case ms.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ms.IncrementalSnapshot:switch(t.data.source){case gs.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case gs.Drag:case gs.TouchMove:case gs.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case gs.ViewportResize:return!1;case gs.MediaInteraction:case gs.MouseInteraction:case gs.Scroll:case gs.CanvasMutation:case gs.Input:return this.replaceIds(t.data,e,["id"]),t;case gs.StyleSheetRule:case gs.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case gs.Font:return t;case gs.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case gs.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===xs.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},lc=class{constructor(e){fs(this,"shadowDoms",/* @__PURE__ */new WeakSet),fs(this,"mutationCb"),fs(this,"scrollCb"),fs(this,"bypassOptions"),fs(this,"mirror"),fs(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ds(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Ja({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Ka({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(As.host(e))),this.restoreHandlers.push(rc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Ns(e.prototype,"attachShadow",function(e){return function(r){const o=e.call(this,r),i=As.shadowRoot(this);return i&&Da(this)&&n.addShadowRoot(i,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=/* @__PURE__ */new WeakSet}},dc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uc="undefined"==typeof Uint8Array?[]:/* @__PURE__ */new Uint8Array(256),pc=0;pc<64;pc++)uc[dc.charCodeAt(pc)]=pc;var hc=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=dc[n[t]>>2],o+=dc[(3&n[t])<<4|n[t+1]>>4],o+=dc[(15&n[t+1])<<2|n[t+2]>>6],o+=dc[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},fc=/* @__PURE__ */new Map;var mc=(e,t,n)=>{if(!e||!bc(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=fc.get(e);return n||(n=/* @__PURE__ */new Map,fc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function gc(e,t,n){if(e instanceof Array)return e.map(e=>gc(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:hc(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gc(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[gc(e.data,t,n),e.width,e.height]}:bc(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mc(e,t,n)}:e}var yc=(e,t,n)=>e.map(e=>gc(e,t,n)),bc=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function vc(e,t,n,r){const o=[];try{const i=Ns(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o,...i){if(!Ia(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}});o.push(i)}catch{}return()=>{o.forEach(e=>e())}}function wc(e,t,n,r,o,i){const s=[],a=Object.getOwnPropertyNames(e);for(const c of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const a=Ns(e,c,function(e){return function(...s){const a=e.apply(this,s);if(mc(a,i,this),"tagName"in this.canvas&&!Ia(this.canvas,r,o,!0)){const e=yc(s,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return a}});s.push(a)}catch{const r=ka(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});s.push(r)}return s}var xc='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',kc="undefined"!=typeof self&&self.Blob&&new Blob([xc],{type:"text/javascript;charset=utf-8"});function Sc(e){let t;try{if(t=kc&&(self.URL||self.webkitURL).createObjectURL(kc),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(xc),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var _c,Ec,Cc,Ic=class{constructor(e){fs(this,"pendingCanvasMutations",/* @__PURE__ */new Map),fs(this,"rafStamps",{latestId:0,invokeId:null}),fs(this,"mirror"),fs(this,"mutationCb"),fs(this,"resetObservers"),fs(this,"frozen",!1),fs(this,"locked",!1),fs(this,"processMutation",(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=vc(t,n,r,!0),s=/* @__PURE__ */new Map,a=new Sc;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:vs["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ia(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])})),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=vc(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=Ns(t.CanvasRenderingContext2D.prototype,s,function(o){return function(...i){return Ia(this.canvas,n,r,!0)||setTimeout(()=>{const n=yc(i,t,this);e(this.canvas,{type:vs["2D"],property:s,args:n})},0),o.apply(this,i)}});o.push(i)}catch{const n=ka(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:vs["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return void 0!==t.WebGLRenderingContext&&o.push(...wc(t.WebGLRenderingContext.prototype,vs.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...wc(t.WebGL2RenderingContext.prototype,vs.WebGL2,e,n,r,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}},Tc=class{constructor(e){fs(this,"trackedLinkElements",/* @__PURE__ */new WeakSet),fs(this,"mutationCb"),fs(this,"adoptedStyleSheetCb"),fs(this,"styleMirror",new Aa),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let e;this.styleMirror.has(o)?e=this.styleMirror.getId(o):(e=this.styleMirror.add(o),r.push({styleId:e,rules:Array.from(o.rules||CSSRule,(e,t)=>({rule:js(e,o.href),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=/* @__PURE__ */new WeakSet}trackStylesheetInLinkElement(e){}},zc=class{constructor(){fs(this,"nodeMap",/* @__PURE__ */new WeakMap),fs(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=/* @__PURE__ */new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||/* @__PURE__ */new Set).add(t))}destroy(){}},Mc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ds=e.contentWindow)?void 0:ds.Array.from)||Array.from,document.body.removeChild(e)}}catch(Yg){}var Oc=new Fs;function Rc(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:b={},dataURLOptions:v={},mousemoveWait:w,recordDOM:x=!0,recordCanvas:k=!1,recordCrossOriginIframes:S=!1,recordAfter:_=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:C=!1,inlineImages:I=!1,plugins:T,keepIframeSrcFn:z=()=>!1,ignoreCSSAttributes:M=/* @__PURE__ */new Set([]),errorHandler:O}=e;ja=O;const R=!S||window.parent===window;let N=!1;if(!R)try{window.parent.document&&(N=!1)}catch(q){N=!0}if(R&&!t)throw new Error("emit function is required");if(!R&&!N)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Oc.reset();const A=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},P=ga(h);let $;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let D=0;const L=e=>{for(const t of T||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};_c=(e,o)=>{var i;const s=e;if(s.timestamp=Rs(),!(null==(i=Ga[0])?void 0:i.isFrozen())||s.type===ms.FullSnapshot||s.type===ms.IncrementalSnapshot&&s.data.source===gs.Mutation||Ga.forEach(e=>e.unfreeze()),R)t?.(L(s),o);else if(N){const e={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===ms.FullSnapshot)$=s,D=0;else if(s.type===ms.IncrementalSnapshot){if(s.data.source===gs.Mutation&&s.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&s.timestamp-$.timestamp>n;(e||t)&&Ec(!0)}};const j=e=>{_c({type:ms.IncrementalSnapshot,data:{source:gs.Mutation,...e}})},F=e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.Scroll,...e}}),U=e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.CanvasMutation,...e}}),W=new Tc({mutationCb:j,adoptedStyleSheetCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.AdoptedStyleSheet,...e}})}),B=new cc({mirror:Oc,mutationCb:j,stylesheetManager:W,recordCrossOriginIframes:S,wrappedEmit:_c});for(const G of T||[])G.getMirror&&G.getMirror({nodeMirror:Oc,crossOriginIframeMirror:B.crossOriginIframeMirror,crossOriginIframeStyleMirror:B.crossOriginIframeStyleMirror});const H=new zc;Cc=new Ic({recordCanvas:k,mutationCb:U,win:window,blockClass:o,blockSelector:i,mirror:Oc,sampling:b.canvas,dataURLOptions:v});const Z=new lc({mutationCb:j,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:A,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:k,inlineImages:I,sampling:b,slimDOMOptions:P,iframeManager:B,stylesheetManager:W,canvasManager:Cc,keepIframeSrcFn:z,processedNodeManager:H},mirror:Oc});Ec=(e=!1)=>{if(!x)return;_c({type:ms.Meta,data:{href:window.location.href,width:Ea(),height:_a()}},e),W.reset(),Z.init(),Ga.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new Fs,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:u,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:x=()=>!1}=t;return ya(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:ga(h),dataURLOptions:f,inlineImages:c,recordCanvas:l,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:x,newlyAddedElement:!1})}(document,{mirror:Oc,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:d,maskAllInputs:A,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:v,recordCanvas:k,inlineImages:I,onSerialize:e=>{Oa(e,Oc)&&B.addIframe(e),Ra(e,Oc)&&W.trackLinkElement(e),Na(e)&&Z.addShadowRoot(As.shadowRoot(e),document)},onIframeLoad:(e,t)=>{B.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:z});t&&(_c({type:ms.FullSnapshot,data:{node:t,initialOffset:Sa(window)}},e),Ga.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Oc.getId(document)))};try{const e=[],t=e=>{var t;return Va(oc)({mutationCb:j,mousemoveCb:(e,t)=>_c({type:ms.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.MouseInteraction,...e}}),scrollCb:F,viewportResizeCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.ViewportResize,...e}}),inputCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.Input,...e}}),mediaInteractionCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.MediaInteraction,...e}}),styleSheetRuleCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.StyleSheetRule,...e}}),styleDeclarationCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.StyleDeclaration,...e}}),canvasMutationCb:U,fontCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.Font,...e}}),selectionCb:e=>{_c({type:ms.IncrementalSnapshot,data:{source:gs.Selection,...e}})},customElementCb:e=>{_c({type:ms.IncrementalSnapshot,data:{source:gs.CustomElement,...e}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:c,maskTextSelector:l,maskInputOptions:A,inlineStylesheet:d,sampling:b,recordDOM:x,recordCanvas:k,inlineImages:I,userTriggeredOnInput:E,collectFonts:C,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:z,blockSelector:i,slimDOMOptions:P,dataURLOptions:v,mirror:Oc,iframeManager:B,stylesheetManager:W,shadowDomManager:Z,processedNodeManager:H,canvasManager:Cc,ignoreCSSAttributes:M,plugins:(null==(t=null==T?void 0:T.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>_c({type:ms.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};B.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(r){}});const n=()=>{Ec(),e.push(t(document)),Mc=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(va("DOMContentLoaded",()=>{_c({type:ms.DomContentLoaded,data:{}}),"DOMContentLoaded"===_&&n()})),e.push(va("load",()=>{_c({type:ms.Load,data:{}}),"load"===_&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")}}),H.destroy(),Mc=!1,ja=void 0}}catch(V){}}Rc.addCustomEvent=(e,t)=>{if(!Mc)throw new Error("please add custom event after start recording");_c({type:ms.Custom,data:{tag:e,payload:t}})},Rc.freezePage=()=>{Ga.forEach(e=>e.freeze())},Rc.takeFullSnapshot=e=>{if(!Mc)throw new Error("please take full snapshot after start recording");Ec(e)},Rc.mirror=Oc;var Nc=class{chatId;applicationId;events=[];sessionId=globalThis.crypto.randomUUID();stopRecording=null;flushTimer=null;flushPromise=Promise.resolve();stopped=!1;constructor(e,t){this.chatId=e,this.applicationId=t}async start(){this.stopRecording||this.stopped||(await is.widgetMessagePost({chat_id:this.chatId,command:{type:"rrweb/metadata",rrweb_session_id:this.sessionId,chat_id:this.chatId,application_id:this.applicationId,url:window.location.href,user_agent:navigator.userAgent,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}}}),this.stopped||(this.stopRecording=Rc({emit:e=>this.buffer(e),maskAllInputs:!0,maskTextClass:/^(rr-mask|mtx-mask)$/,blockClass:/^(rr-block|mtx-block)$/})))}stop(){this.stopped=!0,this.stopRecording?.(),this.stopRecording=null,this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=null,this.flush()}buffer(e){this.events.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},500))}flush(){return this.flushPromise=this.flushPromise.then(async()=>{this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=null;const e=this.events.splice(0);if(e.length)try{await is.widgetMessagePost({chat_id:this.chatId,command:{type:"rrweb/events",rrweb_session_id:this.sessionId,events:e}})}catch(t){this.events.unshift(...e)}}),this.flushPromise}},Ac=class extends Error{},Pc=class e{static instance=null;abortController=null;chatId=null;status="disconnected";callbacks=/* @__PURE__ */new Set;reconnectSuppressed=!1;reconnectAttempts=0;maxReconnectAttempts=10;reconnectDelay=1e3;maxReconnectDelay=3e4;reconnectTimer=null;connectionId=0;tabId=globalThis.crypto.randomUUID();registrationWaiters=/* @__PURE__ */new Set;constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}addCallbacks(e){this.callbacks.add(e)}removeCallbacks(e){this.callbacks.delete(e)}isConnected(){return"registered"===this.status}canReconnect(){return null!==this.chatId&&!this.reconnectSuppressed&&!this.isConnected()}reconnectNow(){this.canReconnect()&&null!==this.chatId&&(this.clearReconnectTimer(),this.reconnectAttempts=0,this.reconnectDelay=1e3,this.connect(this.chatId).catch(console.error))}async waitUntilRegistered(){this.isConnected()||await new Promise((e,t)=>this.registrationWaiters.add({resolve:e,reject:t}))}async connect(e){if(this.reconnectSuppressed=!1,this.chatId===e&&("connecting"===this.status||"open"===this.status||"registered"===this.status))return;this.abortController&&(this.abortController.abort(),this.abortController=null),this.chatId=e,this.status="connecting";const t=++this.connectionId;this.abortController=new AbortController;const n=this.abortController.signal;try{const{mtxId:r,mtxKey:o}=us.getConfig()??{},i=await is.widgetStream({chat_id:e,tab_id:this.tabId,...r&&o&&{marketrix_id:r,marketrix_key:o}},{signal:n});this.status="open",this.consumeEvents(i,t)}catch(r){n.aborted||(this.status="error",this.notifyError(/* @__PURE__ */new Error("Stream connection failed")),this.scheduleReconnect())}}async consumeEvents(e,t){let n=!1;try{for await(const r of e){if(this.connectionId!==t){n=!0;break}this.handleMessage(r)}}catch(r){this.connectionId!==t?n=!0:this.reconnectSuppressed||(this.status="error")}finally{n||this.connectionId!==t||this.reconnectSuppressed||(this.status="disconnected",this.scheduleReconnect())}}disconnect(){this.reconnectSuppressed=!0,this.clearReconnectTimer(),this.abortController&&(this.abortController.abort(),this.abortController=null),this.status="disconnected",this.chatId=null;for(const e of this.registrationWaiters)e.reject(/* @__PURE__ */new Error("Stream disconnected before registration"));this.registrationWaiters.clear()}send(e){return this.chatId?is.widgetMessagePost({chat_id:this.chatId,tab_id:this.tabId,command:e}).then(()=>{}).catch(e=>{throw this.notifyError(/* @__PURE__ */new Error(`Failed to send message: ${String(e)}`)),e}):Promise.reject(/* @__PURE__ */new Error("No active chat"))}notifyError(e){this.callbacks.forEach(t=>t.onError?.(e))}handleMessage(e){if(!this.reconnectSuppressed&&"heartbeat"!==e.type){if("registered"===e.type&&e.chat_id===this.chatId){this.status="registered",this.reconnectAttempts=0,this.reconnectDelay=1e3;for(const e of this.registrationWaiters)e.resolve();this.registrationWaiters.clear()}"chat/error"===e.type&&"auth"===e.request_id&&(this.reconnectSuppressed=!0,this.notifyError(new Ac("Chat is unavailable — the widget credentials were rejected."))),this.callbacks.forEach(t=>t.onMessage?.(e))}}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return void this.notifyError(new Ac("Could not reconnect to the assistant. Try again."));this.clearReconnectTimer(),this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay);this.reconnectTimer=setTimeout(()=>{!this.reconnectSuppressed&&this.chatId&&this.connect(this.chatId).catch(console.error)},e)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}};function $c(e,t={}){return{...t,...e}}function Dc(e){return e.mtxId??(null!=e.mtxApp?String(e.mtxApp):"default")}function Lc(e){return e instanceof Error?e.message:"string"==typeof e?e:"Unknown error"}function jc(e,t){const n=new Error(e);return n.cause=t,n}async function Fc(e){const{mtxId:t,mtxKey:n}=e;if(!t||!n)throw new Error("Please provide mtxId + mtxKey");let r;try{({items:r}=await is.widgetSearch({marketrix_id:t,marketrix_key:n}))}catch(a){throw function(e,t){const n=Lc(e);return n.includes("Failed to fetch")||n.includes("ERR_CONNECTION_REFUSED")||n.includes("NetworkError")||n.includes("Network request failed")?jc(`Cannot connect to API server. Please ensure the API server is running at ${t.mtxApiHost||"configured API server"}. Error: ${n}`,e):jc(`Widget validation failed: ${n}`,e)}(a,e)}if(!r.length)throw new Error("Widget not found or invalid credentials");const o=r.find(e=>"active"===e.status);if(!o){const e=r.map(e=>e.status).join(", ");throw new Error(`Found widget(s) but none are active. Current status(es): ${e}. Please activate the widget in the dashboard.`)}if(!o.application_id)throw new Error("Widget missing application_id");try{await is.applicationGet({application_id:o.application_id})}catch(a){throw jc(`Failed to validate application: ${Lc(a)}`,a)}let i;try{i=await is.widgetDefaultGet({type:"widget"})}catch(a){throw jc(`Failed to fetch widget settings from API: ${Lc(a)}`,a)}const s=Qi.safeParse({...i,...o.settings});if(!s.success){const e=[...new Set(s.error.issues.map(e=>e.path.join(".")||"settings"))];throw new Error(`Widget settings are invalid: ${e.join(", ")}`)}return{...$c(s.data,e),mtxApp:o.application_id}}var Uc="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20361%20360'%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20display:%20none;%20fill:%20none;%20stroke:%20%23cdc9c2;%20stroke-width:%201.3px;%20}%20.st1%20{%20fill:%20%23fff;%20}%20.st2,%20.st3%20{%20fill:%20%237cffa6;%20}%20.st3%20{%20stroke:%20%237cffa6;%20stroke-width:%20.38px;%20}%20.st4%20{%20fill:%20%23101828;%20}%20%3c/style%3e%3c/defs%3e%3crect%20class='st4'%20x='.5'%20width='360'%20height='360'/%3e%3cpath%20class='st2'%20d='M83.37,209.58c15.35,0,27.8-12.45,27.8-27.8s-12.44-27.79-27.8-27.79-27.8,12.44-27.8,27.79,12.44,27.8,27.8,27.8Z'/%3e%3cpath%20class='st1'%20d='M85.86,68.28l152.45,223.44h67.29l-70.62-113.77,68.13-109.67h-67.29l-41.12,65.31-41.54-65.31h-67.29Z'/%3e%3cpath%20class='st3'%20d='M176.61,249.83l-35.08-51-57.82,92.71h66.85l26.05-41.7Z'/%3e%3crect%20class='st0'%20x='1.25'%20y='.65'%20width='358.7'%20height='358.7'%20rx='43.35'%20ry='43.35'/%3e%3c/svg%3e",Wc={none:"none",card:"0 1px 4px rgba(0,0,0,0.1)",section:"0 2px 8px rgba(0,0,0,0.06)",panel:"0 12px 40px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.08)",fab:"0 2px 8px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04)",button:"0 4px 6px -1px rgba(0,0,0,0.1)"},Bc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",theme:"rounded-[var(--radius)]",pill:"rounded-full",circle:"rounded-full"},Hc={default:"text-foreground",muted:"text-foreground-muted",faint:"text-foreground-faint",primary:"text-primary",inherit:"text-inherit"},Zc={tight:"leading-tight",snug:"leading-snug",normal:"leading-normal",relaxed:"leading-relaxed"},qc={info:{background:"#f0f9ff",border:"1px solid #bae6fd",titleColor:"#0c4a6e",bodyColor:"#0369a1",closeColor:"#7dd3fc",actionBackground:"#e0f2fe"},error:{background:"#fef2f2",border:"1px solid #fecaca",titleColor:"#b91c1c",bodyColor:"#b91c1c",closeColor:"#f87171",actionBackground:"#fee2e2"},neutral:{background:"rgba(255, 255, 255, 0.95)",border:"1px solid rgba(255, 255, 255, 0.2)",titleColor:"#1f2937",bodyColor:"#1f2937",closeColor:"#6b7280",actionBackground:"transparent"}};function Vc(e){if(e&&"none"!==e)return{boxShadow:Wc[e]}}var Gc=2147483002,Yc=2147483001,Jc=2147483005,Xc=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kc="-",Qc=[],el=e=>{const t=rl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return nl(e);const n=e.split(Kc),r=""===n[0]&&n.length>1?1:0;return tl(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],o=n[e];return t?o?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(o,t):t:o||Qc}return n[e]||Qc}}},tl=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const n=tl(e,t+1,o);if(n)return n}const i=n.validators;if(null===i)return;const s=0===t?e.join(Kc):e.slice(t).join(Kc),a=i.length;for(let c=0;c<a;c++){const e=i[c];if(e.validator(s))return e.classGroupId}},nl=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),rl=e=>{const{theme:t,classGroups:n}=e;return ol(n,t)},ol=(e,t)=>{const n=Xc();for(const r in e){const o=e[r];il(o,n,r,t)}return n},il=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const o=e[i];sl(o,t,n,r)}},sl=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?ll(e,t,n,r):cl(e,t,n,r):al(e,t,n)},al=(e,t,n)=>{(""===e?t:dl(t,e)).classGroupId=n},cl=(e,t,n,r)=>{ul(e)?il(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},ll=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[e,i]=o[s];il(i,dl(t,e),n,r)}},dl=(e,t)=>{let n=e;const r=t.split(Kc),o=r.length;for(let i=0;i<o;i++){const e=r[i];let t=n.nextPart.get(e);t||(t=Xc(),n.nextPart.set(e,t)),n=t}return n},ul=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,pl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}},hl=[],fl=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),ml=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,i=0;const s=e.length;for(let d=0;d<s;d++){const s=e[d];if(0===r&&0===o){if(":"===s){t.push(e.slice(i,d)),i=d+1;continue}if("/"===s){n=d;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const a=0===t.length?e:e.slice(i);let c=a,l=!1;a.endsWith("!")?(c=a.slice(0,-1),l=!0):a.startsWith("!")&&(c=a.slice(1),l=!0);return fl(t,l,c,n&&n>i?n-i:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fl(hl,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},gl=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let o=0;o<e.length;o++){const i=e[o],s="["===i[0],a=t.has(i);s||a?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},yl=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},bl=/\s+/,vl=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vl(e[r]))&&(n&&(n+=" "),n+=t);return n},wl=(e,...t)=>{let n,r,o,i;const s=e=>{const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,a=[],c=e.trim().split(bl);let l="";for(let d=c.length-1;d>=0;d-=1){const e=c[d],{isExternal:t,modifiers:u,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&s[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){l=e+(l.length>0?" "+l:l);continue}if(m=r(h),!m){l=e+(l.length>0?" "+l:l);continue}g=!1}const y=0===u.length?"":1===u.length?u[0]:i(u).join(":"),b=p?y+"!":y,v=b+m;if(a.indexOf(v)>-1)continue;a.push(v);const w=o(m,g);for(let n=0;n<w.length;++n){const e=w[n];a.push(b+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return o(e,i),i};return i=a=>{const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:pl(e.cacheSize),parseClassName:ml(e),sortModifiers:gl(e),postfixLookupClassGroupIds:yl(e),...el(e)}))(c),r=n.cache.get,o=n.cache.set,i=s,s(a)},(...e)=>i(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=vl(t))&&(o&&(o+=" "),o+=n);return o})(...e))},xl=[],kl=e=>{const t=t=>t[e]||xl;return t.isThemeGetter=!0,t},Sl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_l=/^\((?:(\w[\w-]*):)?(.+)\)$/i,El=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Il=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ml=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ol=e=>El.test(e),Rl=e=>!!e&&!Number.isNaN(Number(e)),Nl=e=>!!e&&Number.isInteger(Number(e)),Al=e=>e.endsWith("%")&&Rl(e.slice(0,-1)),Pl=e=>Cl.test(e),$l=()=>!0,Dl=e=>Il.test(e)&&!Tl.test(e),Ll=()=>!1,jl=e=>zl.test(e),Fl=e=>Ml.test(e),Ul=e=>!Hl(e)&&!Kl(e),Wl=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),Bl=e=>sd(e,dd,Ll),Hl=e=>Sl.test(e),Zl=e=>sd(e,ud,Dl),ql=e=>sd(e,pd,Rl),Vl=e=>sd(e,fd,$l),Gl=e=>sd(e,hd,Ll),Yl=e=>sd(e,cd,Ll),Jl=e=>sd(e,ld,Fl),Xl=e=>sd(e,md,jl),Kl=e=>_l.test(e),Ql=e=>ad(e,ud),ed=e=>ad(e,hd),td=e=>ad(e,cd),nd=e=>ad(e,dd),rd=e=>ad(e,ld),od=e=>ad(e,md,!0),id=e=>ad(e,fd,!0),sd=(e,t,n)=>{const r=Sl.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ad=(e,t,n=!1)=>{const r=_l.exec(e);return!!r&&(r[1]?t(r[1]):n)},cd=e=>"position"===e||"percentage"===e,ld=e=>"image"===e||"url"===e,dd=e=>"length"===e||"size"===e||"bg-size"===e,ud=e=>"length"===e,pd=e=>"number"===e,hd=e=>"family-name"===e,fd=e=>"number"===e||"weight"===e,md=e=>"shadow"===e,gd=/*#__PURE__*/wl(()=>{const e=kl("color"),t=kl("font"),n=kl("text"),r=kl("font-weight"),o=kl("tracking"),i=kl("leading"),s=kl("breakpoint"),a=kl("container"),c=kl("spacing"),l=kl("radius"),d=kl("shadow"),u=kl("inset-shadow"),p=kl("text-shadow"),h=kl("drop-shadow"),f=kl("blur"),m=kl("perspective"),g=kl("aspect"),y=kl("ease"),b=kl("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Kl,Hl],w=()=>[Kl,Hl,c],x=()=>[Ol,"full","auto",...w()],k=()=>[Nl,"none","subgrid",Kl,Hl],S=()=>["auto",{span:["full",Nl,Kl,Hl]},Nl,Kl,Hl],_=()=>[Nl,"auto",Kl,Hl],E=()=>["auto","min","max","fr",Kl,Hl],C=()=>["auto",...w()],I=()=>[Ol,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],T=()=>[Ol,"screen","full","dvw","lvw","svw","min","max","fit",...w()],z=()=>[Ol,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],M=()=>[e,Kl,Hl],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",td,Yl,{position:[Kl,Hl]}],R=()=>["auto","cover","contain",nd,Bl,{size:[Kl,Hl]}],N=()=>[Al,Ql,Zl],A=()=>["","none","full",l,Kl,Hl],P=()=>["",Rl,Ql,Zl],$=()=>[Rl,Al,td,Yl],D=()=>["","none",f,Kl,Hl],L=()=>["none",Rl,Kl,Hl],j=()=>["none",Rl,Kl,Hl],F=()=>[Rl,Kl,Hl],U=()=>[Ol,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pl],breakpoint:[Pl],color:[$l],container:[Pl],"drop-shadow":[Pl],ease:["in","out","in-out"],font:[Ul],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pl],shadow:[Pl],spacing:["px",Rl],text:[Pl],"text-shadow":[Pl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ol,Hl,Kl,g]}],container:["container"],"container-type":[{"@container":["","normal","size",Kl,Hl]}],"container-named":[Wl],columns:[{columns:[Rl,Hl,Kl,a]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{"inset-s":x(),start:x()}],end:[{"inset-e":x(),end:x()}],"inset-bs":[{"inset-bs":x()}],"inset-be":[{"inset-be":x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Nl,"auto",Kl,Hl]}],basis:[{basis:[Ol,"full","auto",a,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rl,Ol,"auto","initial","none",Hl]}],grow:[{grow:["",Rl,Kl,Hl]}],shrink:[{shrink:["",Rl,Kl,Hl]}],order:[{order:[Nl,"first","last","none",Kl,Hl]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[a,"screen",...I()]}],"min-w":[{"min-w":[a,"screen","none",...I()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Ql,Zl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,id,Vl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Al,Hl]}],"font-family":[{font:[ed,Gl,t]}],"font-features":[{"font-features":[Hl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Kl,Hl]}],"line-clamp":[{"line-clamp":[Rl,"none",Kl,ql]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",Kl,Hl]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Kl,Hl]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Rl,"from-font","auto",Kl,Zl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Rl,"auto",Kl,Hl]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Nl,Kl,Hl]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Kl,Hl]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Kl,Hl]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nl,Kl,Hl],radial:["",Kl,Hl],conic:[Nl,Kl,Hl]},rd,Jl]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Rl,Kl,Hl]}],"outline-w":[{outline:["",Rl,Ql,Zl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,od,Xl]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",u,od,Xl]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Rl,Zl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",p,od,Xl]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Rl,Kl,Hl]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Rl]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Kl,Hl]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Rl]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Kl,Hl]}],filter:[{filter:["","none",Kl,Hl]}],blur:[{blur:D()}],brightness:[{brightness:[Rl,Kl,Hl]}],contrast:[{contrast:[Rl,Kl,Hl]}],"drop-shadow":[{"drop-shadow":["","none",h,od,Xl]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Rl,Kl,Hl]}],"hue-rotate":[{"hue-rotate":[Rl,Kl,Hl]}],invert:[{invert:["",Rl,Kl,Hl]}],saturate:[{saturate:[Rl,Kl,Hl]}],sepia:[{sepia:["",Rl,Kl,Hl]}],"backdrop-filter":[{"backdrop-filter":["","none",Kl,Hl]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[Rl,Kl,Hl]}],"backdrop-contrast":[{"backdrop-contrast":[Rl,Kl,Hl]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rl,Kl,Hl]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rl,Kl,Hl]}],"backdrop-invert":[{"backdrop-invert":["",Rl,Kl,Hl]}],"backdrop-opacity":[{"backdrop-opacity":[Rl,Kl,Hl]}],"backdrop-saturate":[{"backdrop-saturate":[Rl,Kl,Hl]}],"backdrop-sepia":[{"backdrop-sepia":["",Rl,Kl,Hl]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Kl,Hl]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rl,"initial",Kl,Hl]}],ease:[{ease:["linear","initial",y,Kl,Hl]}],delay:[{delay:[Rl,Kl,Hl]}],animate:[{animate:["none",b,Kl,Hl]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Kl,Hl]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:j()}],"scale-x":[{"scale-x":j()}],"scale-y":[{"scale-y":j()}],"scale-z":[{"scale-z":j()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[Kl,Hl,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],zoom:[{zoom:[Nl,Kl,Hl]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Kl,Hl]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Kl,Hl]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Rl,Ql,Zl,ql]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function yd(...e){return gd(e.filter(Boolean).join(" "))}var bd={sm:"w-5 h-5",md:"w-8 h-8",lg:"w-12 h-12"};function vd(e){const{src:t,alt:n,elevation:r,fit:o="contain",size:i="md",rounded:s,className:a,style:c,ref:l,...d}=e,u="string"==typeof i,p=u?bd[i]:void 0,h=u?c:{width:i,height:i,...c};/* @__PURE__ */
|
|
2
|
+
return Yr(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(/* @__PURE__ */Yr(e=>e.toLowerCase()))},toUpperCase(){return this.check(/* @__PURE__ */Yr(e=>e.toUpperCase()))},slugify(){return this.check(/* @__PURE__ */Yr(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),Ro=/*@__PURE__*/De("ZodString",(e,t)=>{En.init(e,t),Oo.init(e,t),e.email=t=>e.check(Lr(Po,t)),e.url=t=>e.check(Fr(Lo,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...st(t)})}(Qo,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...st(t)})}(jo,t)),e.guid=t=>e.check(jr($o,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...st(t)})}(Do,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...st(t)})}(Do,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...st(t)})}(Do,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...st(t)})}(Do,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...st(t)})}(Fo,t)),e.guid=t=>e.check(jr($o,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...st(t)})}(Uo,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...st(t)})}(Wo,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...st(t)})}(Bo,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...st(t)})}(Jo,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...st(t)})}(Xo,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...st(t)})}(Ho,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...st(t)})}(Zo,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...st(t)})}(qo,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...st(t)})}(Vo,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...st(t)})}(Go,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...st(t)})}(Yo,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...st(t)})}(Ko,t)),e.datetime=t=>e.check(so(t)),e.date=t=>e.check(co(t)),e.time=t=>e.check(uo(t)),e.duration=t=>e.check(ho(t))});function No(e){return function(e,t){return new e({type:"string",...st(t)})}(Ro,e)}var Ao=/*@__PURE__*/De("ZodStringFormat",(e,t)=>{Cn.init(e,t),Oo.init(e,t)}),Po=/*@__PURE__*/De("ZodEmail",(e,t)=>{zn.init(e,t),Ao.init(e,t)});var $o=/*@__PURE__*/De("ZodGUID",(e,t)=>{In.init(e,t),Ao.init(e,t)}),Do=/*@__PURE__*/De("ZodUUID",(e,t)=>{Tn.init(e,t),Ao.init(e,t)}),Lo=/*@__PURE__*/De("ZodURL",(e,t)=>{Mn.init(e,t),Ao.init(e,t)});var jo=/*@__PURE__*/De("ZodEmoji",(e,t)=>{On.init(e,t),Ao.init(e,t)}),Fo=/*@__PURE__*/De("ZodNanoID",(e,t)=>{Rn.init(e,t),Ao.init(e,t)}),Uo=/*@__PURE__*/De("ZodCUID",(e,t)=>{Nn.init(e,t),Ao.init(e,t)}),Wo=/*@__PURE__*/De("ZodCUID2",(e,t)=>{An.init(e,t),Ao.init(e,t)}),Bo=/*@__PURE__*/De("ZodULID",(e,t)=>{Pn.init(e,t),Ao.init(e,t)}),Ho=/*@__PURE__*/De("ZodXID",(e,t)=>{$n.init(e,t),Ao.init(e,t)}),Zo=/*@__PURE__*/De("ZodKSUID",(e,t)=>{Dn.init(e,t),Ao.init(e,t)}),qo=/*@__PURE__*/De("ZodIPv4",(e,t)=>{Wn.init(e,t),Ao.init(e,t)}),Vo=/*@__PURE__*/De("ZodIPv6",(e,t)=>{Bn.init(e,t),Ao.init(e,t)}),Go=/*@__PURE__*/De("ZodCIDRv4",(e,t)=>{Hn.init(e,t),Ao.init(e,t)}),Yo=/*@__PURE__*/De("ZodCIDRv6",(e,t)=>{Zn.init(e,t),Ao.init(e,t)}),Jo=/*@__PURE__*/De("ZodBase64",(e,t)=>{Vn.init(e,t),Ao.init(e,t)}),Xo=/*@__PURE__*/De("ZodBase64URL",(e,t)=>{Gn.init(e,t),Ao.init(e,t)}),Ko=/*@__PURE__*/De("ZodE164",(e,t)=>{Yn.init(e,t),Ao.init(e,t)}),Qo=/*@__PURE__*/De("ZodJWT",(e,t)=>{Jn.init(e,t),Ao.init(e,t)}),ei=/*@__PURE__*/De("ZodNumber",(e,t)=>{Xn.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";const d="number"==typeof l&&l>=(o??Number.NEGATIVE_INFINITY),u="number"==typeof c&&c<=(i??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;d?p?(r.minimum=l,r.exclusiveMinimum=!0):r.exclusiveMinimum=l:"number"==typeof o&&(r.minimum=o),u?p?(r.maximum=c,r.exclusiveMaximum=!0):r.exclusiveMaximum=c:"number"==typeof i&&(r.maximum=i),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),zo(e,"ZodNumber",{gt(e,t){return this.check(Br(e,t))},gte(e,t){return this.check(Hr(e,t))},min(e,t){return this.check(Hr(e,t))},lt(e,t){return this.check(Ur(e,t))},lte(e,t){return this.check(Wr(e,t))},max(e,t){return this.check(Wr(e,t))},int(e){return this.check(ri(e))},safe(e){return this.check(ri(e))},positive(e){return this.check(Br(0,e))},nonnegative(e){return this.check(Hr(0,e))},negative(e){return this.check(Ur(0,e))},nonpositive(e){return this.check(Wr(0,e))},multipleOf(e,t){return this.check(Zr(e,t))},step(e,t){return this.check(Zr(e,t))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ti(e){return function(e,t){return new e({type:"number",checks:[],...st(t)})}(ei,e)}var ni=/*@__PURE__*/De("ZodNumberFormat",(e,t)=>{Kn.init(e,t),ei.init(e,t)});function ri(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...st(t)})}(ni,e)}var oi=/*@__PURE__*/De("ZodBoolean",(e,t)=>{Qn.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function ii(e){return function(e,t){return new e({type:"boolean",...st(t)})}(oi,e)}var si=/*@__PURE__*/De("ZodUnknown",(e,t)=>{er.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function ai(){return new si({type:"unknown"})}var ci=/*@__PURE__*/De("ZodNever",(e,t)=>{tr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function li(e){return function(e,t){return new e({type:"never",...st(t)})}(ci,e)}var di=/*@__PURE__*/De("ZodDate",(e,t)=>{nr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Date cannot be represented in JSON Schema")})(0,e),e.min=(t,n)=>e.check(Hr(t,n)),e.max=(t,n)=>e.check(Wr(t,n));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),ui=/*@__PURE__*/De("ZodArray",(e,t)=>{or.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(o.minItems=s),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=Kr(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,zo(e,"ZodArray",{min(e,t){return this.check(Vr(e,t))},nonempty(e){return this.check(Vr(1,e))},max(e,t){return this.check(qr(e,t))},length(e,t){return this.check(Gr(e,t))},unwrap(){return this.element}})});function pi(e,t){return function(e,t,n){return new e({type:"array",element:t,...st(n)})}(ui,e,t)}var hi=/*@__PURE__*/De("ZodObject",(e,t)=>{lr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const l in s)o.properties[l]=Kr(s[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(o.required=Array.from(c)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=Kr(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),Ge(e,"shape",()=>t.shape),zo(e,"ZodObject",{keyof(){return xi(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:ai()})},loose(){return this.clone({...this._zod.def,catchall:ai()})},strict(){return this.clone({...this._zod.def,catchall:li()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!tt(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return it(e,Je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ye(this,"shape",n),n}}))}(this,e)},safeExtend(e){return function(e,t){if(!tt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return it(e,Je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ye(this,"shape",n),n}}))}(this,e)},merge(e){return function(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");return it(e,Je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ye(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}(this,e)},pick(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return it(e,Je(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return Ye(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");return it(e,Je(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return Ye(this,"shape",r),r},checks:[]}))}(this,e)},partial(...e){return function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");return it(t,Je(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return Ye(this,"shape",o),o},checks:[]}))}(_i,this,e[0])},required(...e){return t=Oi,n=this,r=e[0],it(n,Je(n._zod.def,{get shape(){const e=n._zod.def.shape,o={...e};if(r)for(const n in r){if(!(n in o))throw new Error(`Unrecognized key: "${n}"`);r[n]&&(o[n]=new t({type:"nonoptional",innerType:e[n]}))}else for(const n in e)o[n]=new t({type:"nonoptional",innerType:e[n]});return Ye(this,"shape",o),o}}));var t,n,r}})});function fi(e,t){const n={type:"object",shape:e??{},...st(t)};return new hi(n)}var mi=/*@__PURE__*/De("ZodUnion",(e,t)=>{ur.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,s=o.options.map((e,n)=>Kr(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options});function gi(e,t){return new mi({type:"union",options:e,...st(t)})}var yi=/*@__PURE__*/De("ZodIntersection",(e,t)=>{pr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Kr(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=Kr(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length;n.allOf=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]]})(e,t,n,r)});var bi=/*@__PURE__*/De("ZodRecord",(e,t)=>{mr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object";const s=i.keyType,a=s._zod.bag?.patterns;if("loose"===i.mode&&a&&a.size>0){const e=Kr(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(const t of a)o.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(o.propertyNames=Kr(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),o.additionalProperties=Kr(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=s._zod.values;if(c){const e=[...c].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(o.required=e)}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vi(e,t,n){return t&&t._zod?new bi({type:"record",keyType:e,valueType:t,...st(n)}):new bi({type:"record",keyType:No(),valueType:e,...st(t)})}var wi=/*@__PURE__*/De("ZodEnum",(e,t)=>{gr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=We(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);o[i]=t.entries[i]}return new wi({...t,checks:[],...st(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new wi({...t,checks:[],...st(r),entries:o})}});function xi(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new wi({type:"enum",entries:n,...st(t)})}var ki=/*@__PURE__*/De("ZodLiteral",(e,t)=>{yr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const i of r.values)if(void 0===i){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof i){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(i))}else o.push(i);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(e,t,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});var Si=/*@__PURE__*/De("ZodTransform",(e,t)=>{br.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new je(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(ft(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(ft(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});var _i=/*@__PURE__*/De("ZodOptional",(e,t)=>{wr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Ei(e){return new _i({type:"optional",innerType:e})}var Ci=/*@__PURE__*/De("ZodExactOptional",(e,t)=>{xr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});var Ii=/*@__PURE__*/De("ZodNullable",(e,t)=>{kr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=Kr(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ti(e){return new Ii({type:"nullable",innerType:e})}var zi=/*@__PURE__*/De("ZodDefault",(e,t)=>{Sr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});var Mi=/*@__PURE__*/De("ZodPrefault",(e,t)=>{Er.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});var Oi=/*@__PURE__*/De("ZodNonOptional",(e,t)=>{Cr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});var Ri=/*@__PURE__*/De("ZodCatch",(e,t)=>{Tr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});var Ni=/*@__PURE__*/De("ZodPipe",(e,t)=>{zr.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s="input"===t.io?i?o.out:o.in:o.out;Kr(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function Ai(e,t){return new Ni({type:"pipe",in:e,out:t})}var Pi=/*@__PURE__*/De("ZodReadonly",(e,t)=>{Or.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;Kr(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});var $i=/*@__PURE__*/De("ZodCustom",(e,t)=>{Ar.init(e,t),Mo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});function Di(e){return function(e,t){return new e({type:"number",coerce:!0,checks:[],...st(t)})}(ei,e)}function Li(e){return function(e,t){return new e({type:"date",coerce:!0,...st(t)})}(di,e)}var ji,Fi=xi(["created","active","suspended"]),Ui=fi({id:ti().optional(),created_at:Li().optional(),updated_at:Li().optional()}),Wi=(fi({id:Di()}),fi({slug:No()}),fi({widget_id:Di()}),fi({simulation_id:Di()}),fi({application_id:Di()}),fi({user_id:Di()}),fi({limit:Di().optional().default(50),offset:Di().optional().default(0)}),gi([ii(),No()]).transform(e=>"boolean"==typeof e?e:"true"===e||"false"!==e&&void 0).optional(),fi({success:function(e,t){return new ki({type:"literal",values:Array.isArray(e)?e:[e],...st(t)})}(!0)})),Bi=(Wi.extend({message:No()}),fi({name:No().min(1),params:vi(No(),ai()).default({}),result:vi(No(),ai()).default({})}),Fr(Lo,ji).refine(e=>/^https:\/\/hooks\.slack\.com\//.test(e),{message:"Slack webhook URL must start with https://hooks.slack.com/"}),fi({start:No(),end:No(),action:No()}).passthrough()),Hi=fi({id:No(),label:No(),purpose:No(),elements:pi(vi(No(),ai())).default([]),bbox:vi(No(),ai()).default({}),screenshot:No().default(""),embedding:pi(ti()).nullish()}).passthrough(),Zi=fi({id:No(),title:No(),url:No(),summary:No().default(""),screenshot:No().default(""),sections:pi(Hi).default([]),sequence_ids:pi(ti()).default([]),embedding:pi(ti()).nullish()}).passthrough(),qi=(fi({nodes:pi(Zi),edges:pi(Bi)}),xi(["answered","dismissed","cancelled"]),xi(["study_plan","qa_generate_journeys","qa_prefill_values","persona_generate","persona_from_description","persona_autocomplete"]),xi(["free","startup","growth","enterprise"])),Vi=xi(["app","website"]),Gi=xi(["widget"]),Yi=xi(["tell","show","do"]),Ji=xi(["password","oauth"]),Xi=xi(["admin","member"]),Ki=(Ui.extend({is_super:ii(),status:Fi,email:function(e){return Lr(Po,e)}(),external_id:No().nullish(),first_name:No().nullish(),last_name:No().nullish(),password:No().nullish(),image_url:No().nullish(),last_login_at:Li().nullish(),auth_method:Ji.nullish(),workspace_role:Xi.nullish()}),Ui.extend({name:No(),slug:No(),status:Fi,package:qi,ending_date:Li().nullish(),external_workspace_id:No().nullish(),slack_webhook_configured:ii().optional(),notify_all_members_on_question:ii().optional()}),Ui.extend({workspace_id:ti(),name:No(),slug:No(),type:Vi,url:No(),username:No().nullish(),password:No().nullish(),allowed_domains:pi(No()).default([])}).omit({password:!0}),fi({chip_mode:Yi,chip_text:No()})),Qi=fi({widget_enabled:ii(),widget_appearance:xi(["default","hidden"]),widget_position:xi(["bottom_left","bottom_right","top_left","top_right"]),widget_header:No(),widget_body:No(),widget_greeting:No(),widget_greeting_toast:ii(),widget_recording:ii(),widget_feature_tell:ii(),widget_feature_show:ii(),widget_feature_do:ii(),widget_background_color:No(),widget_text_color:No(),widget_border_color:No(),widget_accent_color:No(),widget_secondary_color:No(),widget_border_radius:No(),widget_font_size:No(),widget_width:No(),widget_height:No(),widget_animation_duration:No(),widget_fade_duration:No(),widget_chips:pi(Ki)}),es=(Qi.omit({widget_border_radius:!0,widget_font_size:!0,widget_animation_duration:!0,widget_fade_duration:!0}),Ui.extend({application_id:ti(),type:Gi,settings:Qi,status:Fi,marketrix_id:No(),marketrix_key:No(),snippet:No().nullish()}),xi(["user_login","url_visit","update_workspace","create_user","update_user","delete_user","create_application","update_application","delete_application","create_widget","update_widget","delete_widget","create_knowledge","update_knowledge","delete_knowledge","request_membership","invite_user","create_workspace","trial_started","trial_ending_soon","trial_ended","subscription_created","subscription_canceled","plan_changed","payment_succeeded","payment_failed","widget_question","qa_run_started","start_simulation","create_workflow","update_workflow","delete_workflow","toggle_workflow","slack_command","create_form","update_form","delete_form","duplicate_form","publish_form","unpublish_form","archive_form","submit_form_response","delete_form_response"])),ts=fi({details:No().optional(),id:ti().optional(),type:No().optional(),name:No().optional(),target_user_id:ti().optional(),target_user_email:No().optional(),reason:No().optional(),ip_address:No().optional(),user_agent:No().optional(),widget_type:No().optional(),created_by:ti().optional()}).passthrough();Ui.extend({workspace_id:ti(),user_id:ti().nullable(),type:es,metadata:ts.optional()}).partial().extend({type:es});function ns(e){return fe(new $e({url:e}))}var rs="",os=ns(""),is=new Proxy({},{get:(e,t)=>os[t]}),ss="marketrix_chat_context",as={chat_id:null,messages:[],isTaskRunning:!1,currentMode:"tell",isOpen:!1,config:null,timestamp:0};function cs(e){try{return"undefined"==typeof localStorage?null:localStorage.getItem(e)}catch(t){return null}}function ls(e,t){try{"undefined"!=typeof localStorage&&localStorage.setItem(e,t)}catch(n){}}var ds,us=new class{context=function(){const e=cs(ss);if(!e)return{...as};try{const t={...as,...JSON.parse(e)};if(Date.now()-t.timestamp<=6048e5)return t}catch(t){}return{...as}}();getContext(){return this.context}updateContext(e){this.context={...this.context,...e,timestamp:Date.now()},ls(ss,JSON.stringify(this.context))}getChatId(){const e="undefined"==typeof window?"":window.name;return e.trim()?(e!==this.context.chat_id&&this.updateContext({chat_id:e}),e):this.context.chat_id}setChatId(e){this.updateContext({chat_id:e}),"undefined"!=typeof window&&(window.name=e)}getConfig(){return this.context.config}setConfig(e){this.updateContext({config:e})}},ps=new class{creation=null;async getOrCreateChatId(){const e=us.getChatId();return e||(this.creation??=this.createChatId().finally(()=>{this.creation=null}),this.creation)}async createChatId(){const e=await is.chatCreate(void 0);if(!e)throw new Error("API returned empty chat ID");return us.setChatId(e),e}},hs=Object.defineProperty,fs=(e,t,n)=>((e,t,n)=>t in e?hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),ms=/* @__PURE__ */(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))(ms||{}),gs=/* @__PURE__ */(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(gs||{}),ys=/* @__PURE__ */(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(ys||{}),bs=/* @__PURE__ */(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(bs||{}),vs=/* @__PURE__ */(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(vs||{}),ws=/* @__PURE__ */(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(ws||{}),xs=/* @__PURE__ */(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(xs||{}),ks={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ss={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},_s={},Es={};function Cs(e){if(_s[e])return _s[e];const t=globalThis[e],n=t.prototype,r=e in ks?ks[e]:void 0,o=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),i=e in Ss?Ss[e]:void 0,s=Boolean(i&&i.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&s&&!globalThis.Zone)return _s[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;if(!i)return r.remove(),n;const s=navigator.userAgent;return s.includes("Safari")&&!s.includes("Chrome")?(r.classList.add("rr-block"),r.setAttribute("__rrwebUntaintedMutationObserver",""),Es[e]=()=>r.remove()):r.remove(),_s[e]=i}catch{return n}}var Is={};function Ts(e,t,n){var r;const o=`${e}.${String(n)}`;if(Is[o])return Is[o].call(t);const i=Cs(e),s=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return s?(Is[o]=s,s.call(t)):t[n]}var zs={};function Ms(e,t,n){const r=`${e}.${String(n)}`;if(zs[r])return zs[r].bind(t);const o=Cs(e)[n];return"function"!=typeof o?t[n]:(zs[r]=o,o.bind(t))}function Os(){return[Cs("MutationObserver").constructor,Es.MutationObserver??(()=>{})]}var Rs=Date.now;function Ns(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())||(Rs=()=>/* @__PURE__ */(new Date).getTime());var As={ownerDocument:function(e){return Ts("Node",e,"ownerDocument")},childNodes:function(e){return Ts("Node",e,"childNodes")},parentNode:function(e){return Ts("Node",e,"parentNode")},parentElement:function(e){return Ts("Node",e,"parentElement")},textContent:function(e){return Ts("Node",e,"textContent")},contains:function(e,t){return Ms("Node",e,"contains")(t)},getRootNode:function(e){return Ms("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ts("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ts("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ts("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ts("Element",e,"querySelectorAll")(t)},nowTimestamp:Rs,mutationObserverCtor:Os,patch:Ns};function Ps(e){return e.nodeType===e.ELEMENT_NODE}function $s(e){const t=e&&"host"in e&&"mode"in e&&As.host(e)||null;return Boolean(t&&"shadowRoot"in t&&As.shadowRoot(t)===e)}function Ds(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Ls(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),(t=Array.from(n,e=>js(e,r)).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(n){return null}var t}function js(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Ls(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?Js(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?Js(n,t):n}}var Fs=class{constructor(){fs(this,"idNodeMap",/* @__PURE__ */new Map),fs(this,"nodeMetaMap",/* @__PURE__ */new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=/* @__PURE__ */new Map,this.nodeMetaMap=/* @__PURE__ */new WeakMap}};function Us({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let s=o||"";const a=r&&Ws(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=i?i(s,e):"*".repeat(s.length)),s}function Ws(e){return e.toLowerCase()}var Bs="__rrweb_original__";function Hs(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ws(t):null}function Zs(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(o){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}var qs=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Vs=/^(?:[a-z+]+:)?\/\//i,Gs=/^www\..*/i,Ys=/^(data:)([^,]*),(.*)/i;function Js(e,t){return(e||"").replace(qs,(e,n,r,o,i,s)=>{const a=r||i||s,c=n||o||"";if(!a)return e;if(Vs.test(a)||Gs.test(a))return`url(${c}${a}${c})`;if(Ys.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=a.split("#")[0],d=a.substring(l.length),u=t.split("#")[0].split("/"),p=l.split("/");u.pop();for(const t of p){if("."===t)continue;".."===t?u.pop():u.push(t)}return`url(${c}${u.join("/")}${d}${c})`})}function Xs(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function Ks(e,t){return function(e,t,n=!1){const r=Array.from(t.childNodes),o=[];let i=0;if(r.length>1&&e&&"string"==typeof e){let t=Xs(e,n);const s=t.length/e.length;for(let a=1;a<r.length;a++)if(r[a].textContent&&"string"==typeof r[a].textContent){const c=Xs(r[a].textContent,n),l=100;let d=3;for(;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){let u=c.substring(0,d),p=t.split(u),h=-1;if(2===p.length)h=p[0].length;else if(p.length>2&&""===p[0]&&""!==r[a-1].textContent)h=t.indexOf(u,1);else if(1===p.length){if(u=u.substring(0,u.length-1),p=t.split(u),p.length<=1)return o.push(e),o;d=101}else d===c.length-1&&(h=t.indexOf(u));if(p.length>=2&&d>l){const e=r[a-1].textContent;if(e&&"string"==typeof e){const n=Xs(e).length;h=t.indexOf(u,n)}-1===h&&(h=p[0].length)}if(-1!==h){let a=Math.floor(h/s);for(;a>0&&a<e.length;){if(i+=1,i>50*r.length)return o.push(e),o;const c=Xs(e.substring(0,a),n);if(c.length===h){o.push(e.substring(0,a)),e=e.substring(a),t=t.substring(h);break}c.length<h?a+=Math.max(1,Math.floor((h-c.length)/s)):a-=Math.max(1,Math.floor((c.length-h)*s))}break}}}}return o.push(e),o}(e,t).join("/* rr_split */")}var Qs,ea,ta=1,na=/* @__PURE__ */new RegExp("[^a-z0-9-_:]");function ra(){return ta++}var oa=/^[^ \t\n\r\u000c]+/,ia=/^[, \t\n\r\u000c]+/;var sa=/* @__PURE__ */new WeakMap;function aa(e,t){return t&&""!==t.trim()?la(e,t):t}function ca(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function la(e,t){let n=sa.get(e);if(n||(n=e.createElement("a"),sa.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function da(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?aa(e,r):"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(ia),!(n>=t.length);){let i=r(oa);if(","===i.slice(-1))i=aa(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=aa(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?Js(r,la(e)):"object"===t&&"data"===n?aa(e,r):r:r}function ua(e,t,n){return["video","audio"].includes(e)&&"autoplay"===t}function pa(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&pa(As.parentNode(e),t,n);for(let r=e.classList.length;r--;){const n=e.classList[r];if(t.test(n))return!0}return!!n&&pa(As.parentNode(e),t,n)}function ha(e,t,n,r){let o;if(Ps(e)){if(o=e,!As.childNodes(o).length)return!1}else{if(null===As.parentElement(e))return!1;o=As.parentElement(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(pa(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(i){}return!1}function fa(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:c={},maskTextFn:l,maskInputFn:d,dataURLOptions:u={},inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:xs.Document,childNodes:[],compatMode:e.compatMode}:{type:xs.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:xs.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:c={},inlineImages:l,recordCanvas:d,keepIframeSrcFn:u,newlyAddedElement:p=!1,rootId:h}=t,f=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(r){}return!1}(e,r,o),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=Ws(e.tagName);return na.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let w=0;w<y;w++){const t=e.attributes[w];ua(m,t.name,t.value)||(g[t.name]=da(n,m,Ws(t.name),t.value))}if("link"===m&&i){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=Ls(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===m&&e.sheet){let t=Ls(e.sheet);t&&(e.childNodes.length>1&&(t=Ks(t,e)),g._cssText=t)}if(["input","textarea","select"].includes(m)){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Us({element:e,type:Hs(e),tagName:m,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}"option"===m&&(e.selected&&!s.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&d)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=Bs in o?o[Bs]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(c.type,c.quality)&&(g.rr_dataURL=t)}if("img"===m&&l){Qs||(Qs=n.createElement("canvas"),ea=Qs.getContext("2d"));const t=e,r=(t.currentSrc||t.getAttribute("src"),t.crossOrigin),o=()=>{t.removeEventListener("load",o);try{Qs.width=t.naturalWidth,Qs.height=t.naturalHeight,ea.drawImage(t,0,0),g.rr_dataURL=Qs.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o))}"anonymous"===t.crossOrigin&&(r?g.crossOrigin=r:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if(["audio","video"].includes(m)){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}"iframe"!==m||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let b;try{customElements.get(m)&&(b=!0)}catch(v){}return{type:xs.Element,tagName:m,attributes:g,childNodes:[],isSVG:ca(e)||void 0,needBlock:f,rootId:h,isCustom:b}}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c,maskInputFn:d,dataURLOptions:u,inlineImages:p,recordCanvas:h,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,s=As.parentNode(e),a=s&&s.tagName;let c="";const l="STYLE"===a||void 0,d="SCRIPT"===a||void 0;d?c="SCRIPT_PLACEHOLDER":i||(c=As.textContent(e),l&&c&&(c=Js(c,la(t.doc))));!l&&!d&&c&&n&&(c=r?r(c,As.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:xs.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:s,maskTextFn:l,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:xs.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:xs.Comment,textContent:As.textContent(e)||"",rootId:y};default:return!1}}function ma(e){return null==e?"":e.toLowerCase()}function ga(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function ya(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:d={},maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v=5e3,onStylesheetLoad:w,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:k=()=>!1,newlyAddedElement:S=!1,cssCaptured:_=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:C=!0}=t;E||(E=ha(e,s,a,void 0===E));const I=fa(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:k,newlyAddedElement:S,cssCaptured:_});if(!I)return null;let T;T=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===xs.Comment)return!0;if(e.type===xs.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Zs(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(ma(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===ma(e.attributes.name)||"icon"===ma(e.attributes.rel)||"apple-touch-icon"===ma(e.attributes.rel)||"shortcut icon"===ma(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&ma(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ma(e.attributes.property).match(/^(og|twitter|fb):/)||ma(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===ma(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===ma(e.attributes.name)||"googlebot"===ma(e.attributes.name)||"bingbot"===ma(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===ma(e.attributes.name)||"generator"===ma(e.attributes.name)||"framework"===ma(e.attributes.name)||"publisher"===ma(e.attributes.name)||"progid"===ma(e.attributes.name)||ma(e.attributes.property).match(/^article:/)||ma(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===ma(e.attributes.name)||"yandex-verification"===ma(e.attributes.name)||"csrf-token"===ma(e.attributes.name)||"p:domain_verify"===ma(e.attributes.name)||"verify-v1"===ma(e.attributes.name)||"verification"===ma(e.attributes.name)||"shopify-checkout-api-token"===ma(e.attributes.name)))return!0}}return!1}(I,h)||!C&&I.type===xs.Text&&!I.textContent.replace(/^\s+|\s+$/gm,"").length?-2:ra();const z=Object.assign(I,{id:T});if(r.add(e,z),-2===T)return null;y&&y(e);let M=!c;if(z.type===xs.Element){M=M&&!z.needBlock,delete z.needBlock;const t=As.shadowRoot(e);t&&Ds(t)&&(z.isShadowHost=!0)}if((z.type===xs.Document||z.type===xs.Element)&&M){h.headWhitespace&&z.type===xs.Element&&"head"===z.tagName&&(C=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:C,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:k,cssCaptured:!1};if(z.type===xs.Element&&"textarea"===z.tagName&&void 0!==z.attributes.value);else{z.type===xs.Element&&void 0!==z.attributes._cssText&&"string"==typeof z.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(As.childNodes(e))){const e=ya(n,t);e&&z.childNodes.push(e)}}let S=null;if(Ps(e)&&(S=As.shadowRoot(e)))for(const e of Array.from(As.childNodes(S))){const n=ya(e,t);n&&(Ds(S)&&(n.isShadow=!0),z.childNodes.push(n))}}const O=As.parentNode(e);return O&&$s(O)&&Ds(O)&&(z.isShadow=!0),z.type===xs.Element&&"iframe"===z.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(a){return}if("complete"!==o){const r=setTimeout(()=>{i||(t(),i=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),i=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&b){const n=ya(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:C,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:k});n&&b(e,n)}},v),z.type===xs.Element&&"link"===z.tagName&&"string"==typeof z.attributes.rel&&("stylesheet"===z.attributes.rel||"preload"===z.attributes.rel&&"string"==typeof z.attributes.href&&"css"===Zs(z.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(s){return}if(r)return;const i=setTimeout(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),o=!0,t()})}(e,()=>{if(w){const t=ya(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:h,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:C,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:v,onStylesheetLoad:w,stylesheetLoadTimeout:x,keepIframeSrcFn:k});t&&w(e,t)}},x),z}var ba=class e{constructor(...e){fs(this,"parentElement",null),fs(this,"parentNode",null),fs(this,"ownerDocument"),fs(this,"firstChild",null),fs(this,"lastChild",null),fs(this,"previousSibling",null),fs(this,"nextSibling",null),fs(this,"ELEMENT_NODE",1),fs(this,"TEXT_NODE",3),fs(this,"nodeType"),fs(this,"nodeName"),fs(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e))return!1;if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}};function va(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var wa={map:{},getId:()=>-1,getNode:()=>null,removeNodeFromMap(){},has:()=>!1,reset(){}};function xa(e,t,n={}){let r=null,o=0;return function(...i){const s=Date.now();o||!1!==n.leading||(o=s);const a=t-(s-o),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)},a))}}function ka(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>ka(e,t,i||{},!0)}function Sa(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=As.parentElement(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=As.parentElement(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function _a(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ea(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Ca(e){return e?e.nodeType===e.ELEMENT_NODE?e:As.parentElement(e):null}function Ia(e,t,n,r){if(!e)return!1;const o=Ca(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(pa(o,t,r))return!0}catch(i){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function Ta(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function za(e,t){if($s(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=As.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||za(r,t))}function Ma(e){return Boolean(e.changedTouches)}function Oa(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ra(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Na(e){return!!e&&(e instanceof ba&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(As.shadowRoot(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(wa=new Proxy(wa,{get:(e,t,n)=>Reflect.get(e,t,n)}));var Aa=class{constructor(){fs(this,"id",1),fs(this,"styleIDMap",/* @__PURE__ */new WeakMap),fs(this,"idStyleMap",/* @__PURE__ */new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=/* @__PURE__ */new WeakMap,this.idStyleMap=/* @__PURE__ */new Map,this.id=1}generateId(){return this.id++}};function Pa(e){var t;let n=null;return"getRootNode"in e&&(null==(t=As.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&As.host(As.getRootNode(e))&&(n=As.host(As.getRootNode(e))),n}function $a(e){const t=As.ownerDocument(e);if(!t)return!1;const n=function(e){let t,n=e;for(;t=Pa(n);)n=t;return n}(e);return As.contains(t,n)}function Da(e){const t=As.ownerDocument(e);return!!t&&(As.contains(t,e)||$a(e))}function La(e){return"__ln"in e}var ja,Fa=class{constructor(){fs(this,"length",0),fs(this,"head",null),fs(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&La(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&La(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},Ua=(e,t)=>`${e}@${t}`,Wa=class{constructor(){fs(this,"frozen",!1),fs(this,"locked",!1),fs(this,"texts",[]),fs(this,"attributes",[]),fs(this,"attributeMap",/* @__PURE__ */new WeakMap),fs(this,"removes",[]),fs(this,"mapRemoves",[]),fs(this,"movedMap",{}),fs(this,"addedSet",/* @__PURE__ */new Set),fs(this,"movedSet",/* @__PURE__ */new Set),fs(this,"droppedSet",/* @__PURE__ */new Set),fs(this,"removesSubTreeCache",/* @__PURE__ */new Set),fs(this,"mutationCb"),fs(this,"blockClass"),fs(this,"blockSelector"),fs(this,"maskTextClass"),fs(this,"maskTextSelector"),fs(this,"inlineStylesheet"),fs(this,"maskInputOptions"),fs(this,"maskTextFn"),fs(this,"maskInputFn"),fs(this,"keepIframeSrcFn"),fs(this,"recordCanvas"),fs(this,"inlineImages"),fs(this,"slimDOMOptions"),fs(this,"dataURLOptions"),fs(this,"doc"),fs(this,"mirror"),fs(this,"iframeManager"),fs(this,"stylesheetManager"),fs(this,"shadowDomManager"),fs(this,"canvasManager"),fs(this,"processedNodeManager"),fs(this,"unattachedDoc"),fs(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),fs(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=/* @__PURE__ */new Set,n=new Fa,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=As.parentNode(o);if(!i||!Da(o))return;let s=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(s=!0)}const a=$s(i)?this.mirror.getId(Pa(o)):this.mirror.getId(i),c=r(o);if(-1===a||-1===c)return n.addNode(o);const l=ya(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Oa(e,this.mirror)&&this.iframeManager.addIframe(e),Ra(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Na(o)&&this.shadowDomManager.addShadowRoot(As.shadowRoot(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});l&&(e.push({parentId:a,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Ha(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(As.parentNode(a))||o(a);for(const a of this.addedSet)Za(this.droppedSet,a)||Ha(this.removesSubTreeCache,a,this.mirror)?Za(this.movedSet,a)?o(a):this.droppedSet.add(a):o(a);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(As.parentNode(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(As.parentNode(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=As.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=As.host(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=As.parentNode(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(s.texts.length||s.attributes.length||s.removes.length||s.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=/* @__PURE__ */new WeakMap,this.removes=[],this.addedSet=/* @__PURE__ */new Set,this.movedSet=/* @__PURE__ */new Set,this.droppedSet=/* @__PURE__ */new Set,this.removesSubTreeCache=/* @__PURE__ */new Set,this.movedMap={},this.mutationCb(s))}),fs(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));const n=Array.from(As.childNodes(e),e=>As.textContent(e)||"").join("");t.attributes.value=Us({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Hs(e),value:n,maskInputFn:this.maskInputFn})}),fs(this,"processMutation",e=>{if(!Ta(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=As.textContent(e.target);Ia(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:ha(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Ca(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const n=e.target;let r=e.attributeName,o=e.target.getAttribute(r);if("value"===r){const e=Hs(n);o=Us({element:n,maskInputOptions:this.maskInputOptions,tagName:n.tagName,type:e,value:o,maskInputFn:this.maskInputFn})}if(Ia(e.target,this.blockClass,this.blockSelector,!1)||o===e.oldValue)return;let i=this.attributeMap.get(e.target);if("IFRAME"===n.tagName&&"src"===r&&!this.keepIframeSrcFn(o)){if(n.contentDocument)return;r="rr_src"}if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),"type"===r&&"INPUT"===n.tagName&&"password"===(e.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!ua(n.tagName,r))if(i.attributes[r]=da(this.doc,Ws(n.tagName),Ws(r),o),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(t){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(n.style)){const t=n.style.getPropertyValue(e),o=n.style.getPropertyPriority(e);t!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?i.styleDiff[e]=""===o?t:[t,o]:i._unchangedStyles[e]=[t,o]}for(const e of Array.from(r.style))""===n.style.getPropertyValue(e)&&(i.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal");break}case"childList":if(Ia(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=$s(e.target)?this.mirror.getId(As.host(e.target)):this.mirror.getId(e.target);Ia(e.target,this.blockClass,this.blockSelector,!1)||Ta(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ba(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||za(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ua(n,r)]?Ba(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!$s(e.target)||!Ds(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),As.childNodes(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),fs(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Ta(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ua(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Ia(e,this.blockClass,this.blockSelector,!1)||(As.childNodes(e).forEach(e=>this.genAdds(e)),Na(e)&&As.childNodes(As.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Ba(e,t){e.delete(t),As.childNodes(t).forEach(t=>Ba(e,t))}function Ha(e,t,n){return 0!==e.size&&function(e,t){const n=As.parentNode(t);return!!n&&e.has(n)}(e,t)}function Za(e,t){return 0!==e.size&&qa(e,t)}function qa(e,t){const n=As.parentNode(t);return!!n&&(!!e.has(n)||qa(e,n))}var Va=e=>{if(!ja)return e;return(...t)=>{try{return e(...t)}catch(n){if(ja&&!0===ja(n))return;throw n}}},Ga=[];function Ya(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ja(e,t){const n=new Wa;Ga.push(n),n.init(e);const[r,o]=Os(),i=new r(Va(n.processMutations.bind(n)));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[i,o]}function Xa({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let c=null;return Object.keys(ys).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(i=>{let s=Ws(i);const l=(t=>i=>{const s=Ya(i);if(Ia(s,r,o,!0))return;let a=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=bs.Mouse;break;case"touch":a=bs.Touch;break;case"pen":a=bs.Pen}a===bs.Touch?ys[t]===ys.MouseDown?l="TouchStart":ys[t]===ys.MouseUp&&(l="TouchEnd"):bs.Pen}else Ma(i)&&(a=bs.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===bs.Touch||l.startsWith("Mouse")&&a===bs.Mouse)&&(a=null)):ys[t]===ys.Click&&(a=c,c=null);const d=Ma(i)?i.changedTouches[0]:i;if(!d)return;const u=n.getId(s),{clientX:p,clientY:h}=d;Va(e)({type:ys[l],id:u,x:p,y:h,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(ys[i]){case ys.MouseDown:case ys.MouseUp:s=s.replace("mouse","pointer");break;case ys.TouchStart:case ys.TouchEnd:return}a.push(va(s,l,t))}),Va(()=>{a.forEach(e=>e())})}function Ka({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return va("scroll",Va(xa(Va(i=>{const s=Ya(i);if(!s||Ia(s,r,o,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=Sa(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),i.scroll||100)),t)}var Qa=["INPUT","TEXTAREA","SELECT"],ec=/* @__PURE__ */new WeakMap;function tc(e){return function e(t,n){if(ic("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ic("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ic("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ic("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule){const r=Array.from(t.parentRule.cssRules).indexOf(t);return n.unshift(r),e(t.parentRule,n)}if(t.parentStyleSheet){const e=Array.from(t.parentStyleSheet.cssRules).indexOf(t);n.unshift(e)}return n}(e,[])}function nc(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function rc({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(As.host(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,c=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=c.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(o){}return r}}),Va(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function oc(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:p,selectionCb:h,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),p(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),h(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t);let o=()=>{};e.recordDOM&&([r,o]=Ja(e,e.doc));const i=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=xa(Va(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),i),l=Va(xa(Va(e=>{const t=Ya(e),{clientX:n,clientY:o}=Ma(e)?e.changedTouches[0]:e;s||(s=Rs()),a.push({x:n,y:o,id:r.getId(t),timeOffset:Rs()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?gs.Drag:e instanceof MouseEvent?gs.MouseMove:gs.TouchMove)}),o,{trailing:!1})),d=[va("mousemove",l,n),va("touchmove",l,n),va("drag",l,n)];return Va(()=>{d.forEach(e=>e())})}(e),s=Xa(e),a=Ka(e),c=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return va("resize",Va(xa(Va(()=>{const t=_a(),o=Ea();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)}),200)),t)}(e,{win:n}),l=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:d}){function u(e){let n=Ya(e);const l=e.isTrusted,u=n&&n.tagName;if(n&&"OPTION"===u&&(n=As.parentElement(n)),!n||!u||Qa.indexOf(u)<0||Ia(n,r,o,!0))return;if(n.classList.contains(i)||s&&n.matches(s))return;let h=n.value,f=!1;const m=Hs(n)||"";"radio"===m||"checkbox"===m?f=n.checked:(a[u.toLowerCase()]||a[m])&&(h=Us({element:n,maskInputOptions:a,tagName:u,type:m,value:h,maskInputFn:c})),p(n,d?{text:h,isChecked:f,userTriggered:l}:{text:h,isChecked:f});const g=n.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;p(e,d?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function p(t,r){const o=ec.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){ec.set(t,r);const o=n.getId(t);Va(e)({...r,id:o})}}const h=("last"===l.input?["change"]:["input","change"]).map(e=>va(e,Va(u),t)),f=t.defaultView;if(!f)return()=>{h.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&h.push(...g.map(e=>ka(e[0],e[1],{set(){Va(u)({target:this,isTrusted:!1})}},!1,f))),Va(()=>{h.forEach(e=>e())})}(e),d=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const s=Va(i=>xa(Va(o=>{const s=Ya(o);if(!s||Ia(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:d,loop:u}=s;e({type:i,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:d,loop:u})}),o.media||500)),a=[va("play",s(ws.Play),i),va("pause",s(ws.Pause),i),va("seeked",s(ws.Seeked),i),va("volumechange",s(ws.VolumeChange),i),va("ratechange",s(ws.RateChange),i)];return Va(()=>{a.forEach(e=>e())})}(e);let u=()=>{},p=()=>{},h=()=>{},f=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Va((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=nc(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:a}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),r.apply(o,i)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(o,i)})}));const c={};sc("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(sc("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),sc("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),sc("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Va((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=nc(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:[...tc(o),a||0]}]}),r.apply(o,i)})}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Va((r,o,i)=>{const[s]=i,{id:a,styleId:c}=nc(o.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...tc(o),s]}]}),r.apply(o,i)})})}),Va(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:n}),p=rc(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Va((o,s,a)=>{var c;const[l,d,u]=a;if(n.has(l))return i.apply(s,[l,d,u]);const{id:p,styleId:h}=nc(null==(c=s.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(p&&-1!==p||h&&-1!==h)&&e({id:p,styleId:h,set:{property:l,value:d,priority:u},index:tc(s.parentRule)}),o.apply(s,a)})});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Va((o,i,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(i,[l]);const{id:d,styleId:u}=nc(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||u&&-1!==u)&&e({id:d,styleId:u,remove:{property:l},index:tc(i.parentRule)}),o.apply(i,a)})}),Va(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(f=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=/* @__PURE__ */new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=Ns(t.fonts,"add",function(t){return function(n){return setTimeout(Va(()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=i}),r.push(s),Va(()=>{r.forEach(e=>e())})}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=Va(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const{startContainer:i,startOffset:s,endContainer:c,endOffset:l}=e.getRangeAt(t);Ia(i,r,o,!0)||Ia(c,r,o,!0)||a.push({start:n.getId(i),startOffset:s,end:n.getId(c),endOffset:l})}i({ranges:a})});return a(),va("selectionchange",a)}(e),g=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Ns(n.customElements,"define",function(e){return function(n,r,o){try{t({define:{name:n}})}catch(i){}return e.apply(this,[n,r,o])}}):()=>{}}(e),y=[];for(const b of e.plugins)y.push(b.observer(b.callback,n,b.options));return Va(()=>{Ga.forEach(e=>e.reset()),r?.disconnect(),o(),i(),s(),a(),c(),l(),d(),u(),p(),h(),f(),m(),g(),y.forEach(e=>e())})}function ic(e){return void 0!==window[e]}function sc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var ac=class{constructor(e){fs(this,"iframeIdToRemoteIdMap",/* @__PURE__ */new WeakMap),fs(this,"iframeRemoteIdToIdMap",/* @__PURE__ */new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const o=r.get(t);return o||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=/* @__PURE__ */new WeakMap,void(this.iframeRemoteIdToIdMap=/* @__PURE__ */new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=/* @__PURE__ */new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},cc=class{constructor(e){fs(this,"iframes",/* @__PURE__ */new WeakMap),fs(this,"crossOriginIframeMap",/* @__PURE__ */new WeakMap),fs(this,"crossOriginIframeMirror",new ac(ra)),fs(this,"crossOriginIframeStyleMirror"),fs(this,"crossOriginIframeRootIdMap",/* @__PURE__ */new WeakMap),fs(this,"mirror"),fs(this,"mutationCb"),fs(this,"wrappedEmit"),fs(this,"loadListener"),fs(this,"stylesheetManager"),fs(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ac(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case ms.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:ms.IncrementalSnapshot,data:{source:gs.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ms.Meta:case ms.Load:case ms.DomContentLoaded:return!1;case ms.Plugin:return t;case ms.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ms.IncrementalSnapshot:switch(t.data.source){case gs.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case gs.Drag:case gs.TouchMove:case gs.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case gs.ViewportResize:return!1;case gs.MediaInteraction:case gs.MouseInteraction:case gs.Scroll:case gs.CanvasMutation:case gs.Input:return this.replaceIds(t.data,e,["id"]),t;case gs.StyleSheetRule:case gs.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case gs.Font:return t;case gs.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case gs.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===xs.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},lc=class{constructor(e){fs(this,"shadowDoms",/* @__PURE__ */new WeakSet),fs(this,"mutationCb"),fs(this,"scrollCb"),fs(this,"bypassOptions"),fs(this,"mirror"),fs(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ds(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const[n]=Ja({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Ka({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(As.host(e))),this.restoreHandlers.push(rc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Ns(e.prototype,"attachShadow",function(e){return function(r){const o=e.call(this,r),i=As.shadowRoot(this);return i&&Da(this)&&n.addShadowRoot(i,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=/* @__PURE__ */new WeakSet}},dc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",uc="undefined"==typeof Uint8Array?[]:/* @__PURE__ */new Uint8Array(256),pc=0;pc<64;pc++)uc[dc.charCodeAt(pc)]=pc;var hc=function(e){var t,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=dc[n[t]>>2],o+=dc[(3&n[t])<<4|n[t+1]>>4],o+=dc[(15&n[t+1])<<2|n[t+2]>>6],o+=dc[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o},fc=/* @__PURE__ */new Map;var mc=(e,t,n)=>{if(!e||!bc(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=fc.get(e);return n||(n=/* @__PURE__ */new Map,fc.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function gc(e,t,n){if(e instanceof Array)return e.map(e=>gc(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:hc(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[gc(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[gc(e.data,t,n),e.width,e.height]}:bc(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:mc(e,t,n)}:e}var yc=(e,t,n)=>e.map(e=>gc(e,t,n)),bc=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function vc(e,t,n,r){const o=[];try{const i=Ns(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o,...i){if(!Ia(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}});o.push(i)}catch{}return()=>{o.forEach(e=>e())}}function wc(e,t,n,r,o,i){const s=[],a=Object.getOwnPropertyNames(e);for(const c of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const a=Ns(e,c,function(e){return function(...s){const a=e.apply(this,s);if(mc(a,i,this),"tagName"in this.canvas&&!Ia(this.canvas,r,o,!0)){const e=yc(s,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return a}});s.push(a)}catch{const r=ka(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});s.push(r)}return s}var xc='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',kc="undefined"!=typeof self&&self.Blob&&new Blob([xc],{type:"text/javascript;charset=utf-8"});function Sc(e){let t;try{if(t=kc&&(self.URL||self.webkitURL).createObjectURL(kc),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(xc),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var _c,Ec,Cc,Ic=class{constructor(e){fs(this,"pendingCanvasMutations",/* @__PURE__ */new Map),fs(this,"rafStamps",{latestId:0,invokeId:null}),fs(this,"mirror"),fs(this,"mutationCb"),fs(this,"resetObservers"),fs(this,"frozen",!1),fs(this,"locked",!1),fs(this,"processMutation",(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,o){const i=vc(t,n,r,!0),s=/* @__PURE__ */new Map,a=new Sc;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:vs["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Ia(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])})),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=vc(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=Ns(t.CanvasRenderingContext2D.prototype,s,function(o){return function(...i){return Ia(this.canvas,n,r,!0)||setTimeout(()=>{const n=yc(i,t,this);e(this.canvas,{type:vs["2D"],property:s,args:n})},0),o.apply(this,i)}});o.push(i)}catch{const n=ka(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:vs["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return void 0!==t.WebGLRenderingContext&&o.push(...wc(t.WebGLRenderingContext.prototype,vs.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...wc(t.WebGL2RenderingContext.prototype,vs.WebGL2,e,n,r,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}},Tc=class{constructor(e){fs(this,"trackedLinkElements",/* @__PURE__ */new WeakSet),fs(this,"mutationCb"),fs(this,"adoptedStyleSheetCb"),fs(this,"styleMirror",new Aa),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const o of e){let e;this.styleMirror.has(o)?e=this.styleMirror.getId(o):(e=this.styleMirror.add(o),r.push({styleId:e,rules:Array.from(o.rules||CSSRule,(e,t)=>({rule:js(e,o.href),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=/* @__PURE__ */new WeakSet}trackStylesheetInLinkElement(e){}},zc=class{constructor(){fs(this,"nodeMap",/* @__PURE__ */new WeakMap),fs(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=/* @__PURE__ */new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||/* @__PURE__ */new Set).add(t))}destroy(){}},Mc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(ds=e.contentWindow)?void 0:ds.Array.from)||Array.from,document.body.removeChild(e)}}catch(Yg){}var Oc=new Fs;function Rc(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:d=!0,maskAllInputs:u,maskInputOptions:p,slimDOMOptions:h,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:b={},dataURLOptions:v={},mousemoveWait:w,recordDOM:x=!0,recordCanvas:k=!1,recordCrossOriginIframes:S=!1,recordAfter:_=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:C=!1,inlineImages:I=!1,plugins:T,keepIframeSrcFn:z=()=>!1,ignoreCSSAttributes:M=/* @__PURE__ */new Set([]),errorHandler:O}=e;ja=O;const R=!S||window.parent===window;let N=!1;if(!R)try{window.parent.document&&(N=!1)}catch(q){N=!0}if(R&&!t)throw new Error("emit function is required");if(!R&&!N)return()=>{};void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),Oc.reset();const A=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==p?p:{password:!0},P=ga(h);let $;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let D=0;const L=e=>{for(const t of T||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};_c=(e,o)=>{var i;const s=e;if(s.timestamp=Rs(),!(null==(i=Ga[0])?void 0:i.isFrozen())||s.type===ms.FullSnapshot||s.type===ms.IncrementalSnapshot&&s.data.source===gs.Mutation||Ga.forEach(e=>e.unfreeze()),R)t?.(L(s),o);else if(N){const e={type:"rrweb",event:L(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===ms.FullSnapshot)$=s,D=0;else if(s.type===ms.IncrementalSnapshot){if(s.data.source===gs.Mutation&&s.data.isAttachIframe)return;D++;const e=r&&D>=r,t=n&&s.timestamp-$.timestamp>n;(e||t)&&Ec(!0)}};const j=e=>{_c({type:ms.IncrementalSnapshot,data:{source:gs.Mutation,...e}})},F=e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.Scroll,...e}}),U=e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.CanvasMutation,...e}}),W=new Tc({mutationCb:j,adoptedStyleSheetCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.AdoptedStyleSheet,...e}})}),B=new cc({mirror:Oc,mutationCb:j,stylesheetManager:W,recordCrossOriginIframes:S,wrappedEmit:_c});for(const G of T||[])G.getMirror&&G.getMirror({nodeMirror:Oc,crossOriginIframeMirror:B.crossOriginIframeMirror,crossOriginIframeStyleMirror:B.crossOriginIframeStyleMirror});const H=new zc;Cc=new Ic({recordCanvas:k,mutationCb:U,win:window,blockClass:o,blockSelector:i,mirror:Oc,sampling:b.canvas,dataURLOptions:v});const Z=new lc({mutationCb:j,scrollCb:F,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:d,maskInputOptions:A,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:k,inlineImages:I,sampling:b,slimDOMOptions:P,iframeManager:B,stylesheetManager:W,canvasManager:Cc,keepIframeSrcFn:z,processedNodeManager:H},mirror:Oc});Ec=(e=!1)=>{if(!x)return;_c({type:ms.Meta,data:{href:window.location.href,width:Ea(),height:_a()}},e),W.reset(),Z.init(),Ga.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new Fs,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:d=!1,maskTextFn:u,maskInputFn:p,slimDOM:h=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:x=()=>!1}=t;return ya(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===d?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===d?{password:!0}:d,maskTextFn:u,maskInputFn:p,slimDOMOptions:ga(h),dataURLOptions:f,inlineImages:c,recordCanvas:l,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:w,keepIframeSrcFn:x,newlyAddedElement:!1})}(document,{mirror:Oc,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:d,maskAllInputs:A,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:v,recordCanvas:k,inlineImages:I,onSerialize:e=>{Oa(e,Oc)&&B.addIframe(e),Ra(e,Oc)&&W.trackLinkElement(e),Na(e)&&Z.addShadowRoot(As.shadowRoot(e),document)},onIframeLoad:(e,t)=>{B.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:z});t&&(_c({type:ms.FullSnapshot,data:{node:t,initialOffset:Sa(window)}},e),Ga.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,Oc.getId(document)))};try{const e=[],t=e=>{var t;return Va(oc)({mutationCb:j,mousemoveCb:(e,t)=>_c({type:ms.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.MouseInteraction,...e}}),scrollCb:F,viewportResizeCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.ViewportResize,...e}}),inputCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.Input,...e}}),mediaInteractionCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.MediaInteraction,...e}}),styleSheetRuleCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.StyleSheetRule,...e}}),styleDeclarationCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.StyleDeclaration,...e}}),canvasMutationCb:U,fontCb:e=>_c({type:ms.IncrementalSnapshot,data:{source:gs.Font,...e}}),selectionCb:e=>{_c({type:ms.IncrementalSnapshot,data:{source:gs.Selection,...e}})},customElementCb:e=>{_c({type:ms.IncrementalSnapshot,data:{source:gs.CustomElement,...e}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:c,maskTextSelector:l,maskInputOptions:A,inlineStylesheet:d,sampling:b,recordDOM:x,recordCanvas:k,inlineImages:I,userTriggeredOnInput:E,collectFonts:C,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:z,blockSelector:i,slimDOMOptions:P,dataURLOptions:v,mirror:Oc,iframeManager:B,stylesheetManager:W,shadowDomManager:Z,processedNodeManager:H,canvasManager:Cc,ignoreCSSAttributes:M,plugins:(null==(t=null==T?void 0:T.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>_c({type:ms.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};B.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(r){}});const n=()=>{Ec(),e.push(t(document)),Mc=!0};return["interactive","complete"].includes(document.readyState)?n():(e.push(va("DOMContentLoaded",()=>{_c({type:ms.DomContentLoaded,data:{}}),"DOMContentLoaded"===_&&n()})),e.push(va("load",()=>{_c({type:ms.Load,data:{}}),"load"===_&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(t){String(t).toLowerCase().includes("cross-origin")}}),H.destroy(),Mc=!1,ja=void 0}}catch(V){}}Rc.addCustomEvent=(e,t)=>{if(!Mc)throw new Error("please add custom event after start recording");_c({type:ms.Custom,data:{tag:e,payload:t}})},Rc.freezePage=()=>{Ga.forEach(e=>e.freeze())},Rc.takeFullSnapshot=e=>{if(!Mc)throw new Error("please take full snapshot after start recording");Ec(e)},Rc.mirror=Oc;var Nc=class{chatId;applicationId;events=[];sessionId=globalThis.crypto.randomUUID();stopRecording=null;flushTimer=null;flushPromise=Promise.resolve();stopped=!1;constructor(e,t){this.chatId=e,this.applicationId=t}async start(){this.stopRecording||this.stopped||(await is.widgetMessagePost({chat_id:this.chatId,command:{type:"rrweb/metadata",rrweb_session_id:this.sessionId,chat_id:this.chatId,application_id:this.applicationId,url:window.location.href,user_agent:navigator.userAgent,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}}}),this.stopped||(this.stopRecording=Rc({emit:e=>this.buffer(e),maskAllInputs:!0,maskTextClass:/^(rr-mask|mtx-mask)$/,blockClass:/^(rr-block|mtx-block)$/})))}stop(){this.stopped=!0,this.stopRecording?.(),this.stopRecording=null,this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=null,this.flush()}buffer(e){this.events.push(e),this.flushTimer||(this.flushTimer=setTimeout(()=>{this.flush()},500))}flush(){return this.flushPromise=this.flushPromise.then(async()=>{this.flushTimer&&clearTimeout(this.flushTimer),this.flushTimer=null;const e=this.events.splice(0);if(e.length)try{await is.widgetMessagePost({chat_id:this.chatId,command:{type:"rrweb/events",rrweb_session_id:this.sessionId,events:e}})}catch(t){this.events.unshift(...e)}}),this.flushPromise}},Ac=class extends Error{},Pc=class e{static instance=null;abortController=null;chatId=null;status="disconnected";callbacks=/* @__PURE__ */new Set;reconnectSuppressed=!1;reconnectAttempts=0;maxReconnectAttempts=10;reconnectDelay=1e3;maxReconnectDelay=3e4;reconnectTimer=null;connectionId=0;tabId=globalThis.crypto.randomUUID();registrationWaiters=/* @__PURE__ */new Set;constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}addCallbacks(e){this.callbacks.add(e)}removeCallbacks(e){this.callbacks.delete(e)}isConnected(){return"registered"===this.status}canReconnect(){return null!==this.chatId&&!this.reconnectSuppressed&&!this.isConnected()}reconnectNow(){this.canReconnect()&&null!==this.chatId&&(this.clearReconnectTimer(),this.reconnectAttempts=0,this.reconnectDelay=1e3,this.connect(this.chatId).catch(console.error))}async waitUntilRegistered(){this.isConnected()||await new Promise((e,t)=>this.registrationWaiters.add({resolve:e,reject:t}))}async connect(e){if(this.reconnectSuppressed=!1,this.chatId===e&&("connecting"===this.status||"open"===this.status||"registered"===this.status))return;this.abortController&&(this.abortController.abort(),this.abortController=null),this.chatId=e,this.status="connecting";const t=++this.connectionId;this.abortController=new AbortController;const n=this.abortController.signal;try{const{mtxId:r,mtxKey:o}=us.getConfig()??{},i=await is.widgetStream({chat_id:e,tab_id:this.tabId,...r&&o&&{marketrix_id:r,marketrix_key:o}},{signal:n});this.status="open",this.consumeEvents(i,t)}catch(r){n.aborted||(this.status="error",this.notifyError(/* @__PURE__ */new Error("Stream connection failed")),this.scheduleReconnect())}}async consumeEvents(e,t){let n=!1;try{for await(const r of e){if(this.connectionId!==t){n=!0;break}this.handleMessage(r)}}catch(r){this.connectionId!==t?n=!0:this.reconnectSuppressed||(this.status="error")}finally{n||this.connectionId!==t||this.reconnectSuppressed||(this.status="disconnected",this.scheduleReconnect())}}disconnect(){this.reconnectSuppressed=!0,this.clearReconnectTimer(),this.abortController&&(this.abortController.abort(),this.abortController=null),this.status="disconnected",this.chatId=null;for(const e of this.registrationWaiters)e.reject(/* @__PURE__ */new Error("Stream disconnected before registration"));this.registrationWaiters.clear()}send(e){return this.chatId?is.widgetMessagePost({chat_id:this.chatId,tab_id:this.tabId,command:e}).then(()=>{}).catch(e=>{throw this.notifyError(/* @__PURE__ */new Error(`Failed to send message: ${String(e)}`)),e}):Promise.reject(/* @__PURE__ */new Error("No active chat"))}notifyError(e){this.callbacks.forEach(t=>t.onError?.(e))}handleMessage(e){if(!this.reconnectSuppressed&&"heartbeat"!==e.type){if("registered"===e.type&&e.chat_id===this.chatId){this.status="registered",this.reconnectAttempts=0,this.reconnectDelay=1e3;for(const e of this.registrationWaiters)e.resolve();this.registrationWaiters.clear()}"chat/error"===e.type&&"auth"===e.request_id&&(this.reconnectSuppressed=!0,this.notifyError(new Ac("Chat is unavailable — the widget credentials were rejected."))),this.callbacks.forEach(t=>t.onMessage?.(e))}}scheduleReconnect(){if(this.reconnectAttempts>=this.maxReconnectAttempts)return void this.notifyError(new Ac("Could not reconnect to the assistant. Try again."));this.clearReconnectTimer(),this.reconnectAttempts++;const e=Math.min(this.reconnectDelay*Math.pow(2,this.reconnectAttempts-1),this.maxReconnectDelay);this.reconnectTimer=setTimeout(()=>{!this.reconnectSuppressed&&this.chatId&&this.connect(this.chatId).catch(console.error)},e)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}};function $c(e,t={}){return{...t,...e}}function Dc(e){return e.mtxId??(null!=e.mtxApp?String(e.mtxApp):"default")}function Lc(e){return e instanceof Error?e.message:"string"==typeof e?e:"Unknown error"}function jc(e,t){const n=new Error(e);return n.cause=t,n}async function Fc(e){const{mtxId:t,mtxKey:n}=e;if(!t||!n)throw new Error("Please provide mtxId + mtxKey");let r;try{({items:r}=await is.widgetSearch({marketrix_id:t,marketrix_key:n}))}catch(a){throw function(e,t){const n=Lc(e);return n.includes("Failed to fetch")||n.includes("ERR_CONNECTION_REFUSED")||n.includes("NetworkError")||n.includes("Network request failed")?jc(`Cannot connect to API server. Please ensure the API server is running at ${t.mtxApiHost||"configured API server"}. Error: ${n}`,e):jc(`Widget validation failed: ${n}`,e)}(a,e)}if(!r.length)throw new Error("Widget not found or invalid credentials");const o=r.find(e=>"active"===e.status);if(!o){const e=r.map(e=>e.status).join(", ");throw new Error(`Found widget(s) but none are active. Current status(es): ${e}. Please activate the widget in the dashboard.`)}if(!o.application_id)throw new Error("Widget missing application_id");try{await is.applicationGet({application_id:o.application_id})}catch(a){throw jc(`Failed to validate application: ${Lc(a)}`,a)}let i;try{i=await is.widgetDefaultGet({type:"widget"})}catch(a){throw jc(`Failed to fetch widget settings from API: ${Lc(a)}`,a)}const s=Qi.safeParse({...i,...o.settings});if(!s.success){const e=[...new Set(s.error.issues.map(e=>e.path.join(".")||"settings"))];throw new Error(`Widget settings are invalid: ${e.join(", ")}`)}return{...$c(s.data,e),mtxApp:o.application_id}}var Uc="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%20viewBox='0%200%20361%20360'%3e%3cdefs%3e%3cstyle%3e%20.st0%20{%20display:%20none;%20fill:%20none;%20stroke:%20%23cdc9c2;%20stroke-width:%201.3px;%20}%20.st1%20{%20fill:%20%23fff;%20}%20.st2,%20.st3%20{%20fill:%20%237cffa6;%20}%20.st3%20{%20stroke:%20%237cffa6;%20stroke-width:%20.38px;%20}%20.st4%20{%20fill:%20%23101828;%20}%20%3c/style%3e%3c/defs%3e%3crect%20class='st4'%20x='.5'%20width='360'%20height='360'/%3e%3cpath%20class='st2'%20d='M83.37,209.58c15.35,0,27.8-12.45,27.8-27.8s-12.44-27.79-27.8-27.79-27.8,12.44-27.8,27.79,12.44,27.8,27.8,27.8Z'/%3e%3cpath%20class='st1'%20d='M85.86,68.28l152.45,223.44h67.29l-70.62-113.77,68.13-109.67h-67.29l-41.12,65.31-41.54-65.31h-67.29Z'/%3e%3cpath%20class='st3'%20d='M176.61,249.83l-35.08-51-57.82,92.71h66.85l26.05-41.7Z'/%3e%3crect%20class='st0'%20x='1.25'%20y='.65'%20width='358.7'%20height='358.7'%20rx='43.35'%20ry='43.35'/%3e%3c/svg%3e",Wc={none:"none",card:"0 1px 4px rgba(0,0,0,0.1)",section:"0 2px 8px rgba(0,0,0,0.06)",panel:"0 12px 40px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.08)",fab:"0 2px 8px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.04)",button:"0 4px 6px -1px rgba(0,0,0,0.1)"},Bc={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl",theme:"rounded-[var(--radius)]",pill:"rounded-full",circle:"rounded-full"},Hc={default:"text-foreground",muted:"text-foreground-muted",faint:"text-foreground-faint",primary:"text-primary",inherit:"text-inherit"},Zc={tight:"leading-tight",snug:"leading-snug",normal:"leading-normal",relaxed:"leading-relaxed"},qc={info:{background:"#f0f9ff",border:"1px solid #bae6fd",titleColor:"#0c4a6e",bodyColor:"#0369a1",closeColor:"#7dd3fc",actionBackground:"#e0f2fe"},error:{background:"#fef2f2",border:"1px solid #fecaca",titleColor:"#b91c1c",bodyColor:"#b91c1c",closeColor:"#f87171",actionBackground:"#fee2e2"},neutral:{background:"rgba(255, 255, 255, 0.95)",border:"1px solid rgba(255, 255, 255, 0.2)",titleColor:"#1f2937",bodyColor:"#1f2937",closeColor:"#6b7280",actionBackground:"transparent"}};function Vc(e){if(e&&"none"!==e)return{boxShadow:Wc[e]}}var Gc=2147483002,Yc=2147483001,Jc=2147483005,Xc=(e=/* @__PURE__ */new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Kc="-",Qc=[],el=e=>{const t=rl(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return nl(e);const n=e.split(Kc),r=""===n[0]&&n.length>1?1:0;return tl(n,r,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=r[e],o=n[e];return t?o?((e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n})(o,t):t:o||Qc}return n[e]||Qc}}},tl=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],o=n.nextPart.get(r);if(o){const n=tl(e,t+1,o);if(n)return n}const i=n.validators;if(null===i)return;const s=0===t?e.join(Kc):e.slice(t).join(Kc),a=i.length;for(let c=0;c<a;c++){const e=i[c];if(e.validator(s))return e.classGroupId}},nl=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?"arbitrary.."+r:void 0})(),rl=e=>{const{theme:t,classGroups:n}=e;return ol(n,t)},ol=(e,t)=>{const n=Xc();for(const r in e){const o=e[r];il(o,n,r,t)}return n},il=(e,t,n,r)=>{const o=e.length;for(let i=0;i<o;i++){const o=e[i];sl(o,t,n,r)}},sl=(e,t,n,r)=>{"string"!=typeof e?"function"!=typeof e?ll(e,t,n,r):cl(e,t,n,r):al(e,t,n)},al=(e,t,n)=>{(""===e?t:dl(t,e)).classGroupId=n},cl=(e,t,n,r)=>{ul(e)?il(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(n,e)))},ll=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[e,i]=o[s];il(i,dl(t,e),n,r)}},dl=(e,t)=>{let n=e;const r=t.split(Kc),o=r.length;for(let i=0;i<o;i++){const e=r[i];let t=n.nextPart.get(e);t||(t=Xc(),n.nextPart.set(e,t)),n=t}return n},ul=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,pl=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(o,i)=>{n[o]=i,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(o(e,t),t):void 0},set(e,t){e in n?n[e]=t:o(e,t)}}},hl=[],fl=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),ml=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=e=>{const t=[];let n,r=0,o=0,i=0;const s=e.length;for(let d=0;d<s;d++){const s=e[d];if(0===r&&0===o){if(":"===s){t.push(e.slice(i,d)),i=d+1;continue}if("/"===s){n=d;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const a=0===t.length?e:e.slice(i);let c=a,l=!1;a.endsWith("!")?(c=a.slice(0,-1),l=!0):a.startsWith("!")&&(c=a.slice(1),l=!0);return fl(t,l,c,n&&n>i?n-i:void 0)};if(t){const e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):fl(hl,!1,t,void 0,!0)}if(n){const e=r;r=t=>n({className:t,parseClassName:e})}return r},gl=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{const n=[];let r=[];for(let o=0;o<e.length;o++){const i=e[o],s="["===i[0],a=t.has(i);s||a?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(i)):r.push(i)}return r.length>0&&(r.sort(),n.push(...r)),n}},yl=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},bl=/\s+/,vl=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=vl(e[r]))&&(n&&(n+=" "),n+=t);return n},wl=(e,...t)=>{let n,r,o,i;const s=e=>{const t=r(e);if(t)return t;const i=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i,postfixLookupClassGroupIds:s}=t,a=[],c=e.trim().split(bl);let l="";for(let d=c.length-1;d>=0;d-=1){const e=c[d],{isExternal:t,modifiers:u,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:f}=n(e);if(t){l=e+(l.length>0?" "+l:l);continue}let m,g=!!f;if(g){m=r(h.substring(0,f));const e=m&&s[m]?r(h):void 0;e&&e!==m&&(m=e,g=!1)}else m=r(h);if(!m){if(!g){l=e+(l.length>0?" "+l:l);continue}if(m=r(h),!m){l=e+(l.length>0?" "+l:l);continue}g=!1}const y=0===u.length?"":1===u.length?u[0]:i(u).join(":"),b=p?y+"!":y,v=b+m;if(a.indexOf(v)>-1)continue;a.push(v);const w=o(m,g);for(let n=0;n<w.length;++n){const e=w[n];a.push(b+e)}l=e+(l.length>0?" "+l:l)}return l})(e,n);return o(e,i),i};return i=a=>{const c=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:pl(e.cacheSize),parseClassName:ml(e),sortModifiers:gl(e),postfixLookupClassGroupIds:yl(e),...el(e)}))(c),r=n.cache.get,o=n.cache.set,i=s,s(a)},(...e)=>i(((...e)=>{let t,n,r=0,o="";for(;r<e.length;)(t=e[r++])&&(n=vl(t))&&(o&&(o+=" "),o+=n);return o})(...e))},xl=[],kl=e=>{const t=t=>t[e]||xl;return t.isThemeGetter=!0,t},Sl=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_l=/^\((?:(\w[\w-]*):)?(.+)\)$/i,El=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Cl=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Il=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Tl=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,zl=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ml=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ol=e=>El.test(e),Rl=e=>!!e&&!Number.isNaN(Number(e)),Nl=e=>!!e&&Number.isInteger(Number(e)),Al=e=>e.endsWith("%")&&Rl(e.slice(0,-1)),Pl=e=>Cl.test(e),$l=()=>!0,Dl=e=>Il.test(e)&&!Tl.test(e),Ll=()=>!1,jl=e=>zl.test(e),Fl=e=>Ml.test(e),Ul=e=>!Hl(e)&&!Kl(e),Wl=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),Bl=e=>sd(e,dd,Ll),Hl=e=>Sl.test(e),Zl=e=>sd(e,ud,Dl),ql=e=>sd(e,pd,Rl),Vl=e=>sd(e,fd,$l),Gl=e=>sd(e,hd,Ll),Yl=e=>sd(e,cd,Ll),Jl=e=>sd(e,ld,Fl),Xl=e=>sd(e,md,jl),Kl=e=>_l.test(e),Ql=e=>ad(e,ud),ed=e=>ad(e,hd),td=e=>ad(e,cd),nd=e=>ad(e,dd),rd=e=>ad(e,ld),od=e=>ad(e,md,!0),id=e=>ad(e,fd,!0),sd=(e,t,n)=>{const r=Sl.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},ad=(e,t,n=!1)=>{const r=_l.exec(e);return!!r&&(r[1]?t(r[1]):n)},cd=e=>"position"===e||"percentage"===e,ld=e=>"image"===e||"url"===e,dd=e=>"length"===e||"size"===e||"bg-size"===e,ud=e=>"length"===e,pd=e=>"number"===e,hd=e=>"family-name"===e,fd=e=>"number"===e||"weight"===e,md=e=>"shadow"===e,gd=/*#__PURE__*/wl(()=>{const e=kl("color"),t=kl("font"),n=kl("text"),r=kl("font-weight"),o=kl("tracking"),i=kl("leading"),s=kl("breakpoint"),a=kl("container"),c=kl("spacing"),l=kl("radius"),d=kl("shadow"),u=kl("inset-shadow"),p=kl("text-shadow"),h=kl("drop-shadow"),f=kl("blur"),m=kl("perspective"),g=kl("aspect"),y=kl("ease"),b=kl("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Kl,Hl],w=()=>[Kl,Hl,c],x=()=>[Ol,"full","auto",...w()],k=()=>[Nl,"none","subgrid",Kl,Hl],S=()=>["auto",{span:["full",Nl,Kl,Hl]},Nl,Kl,Hl],_=()=>[Nl,"auto",Kl,Hl],E=()=>["auto","min","max","fr",Kl,Hl],C=()=>["auto",...w()],I=()=>[Ol,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],T=()=>[Ol,"screen","full","dvw","lvw","svw","min","max","fit",...w()],z=()=>[Ol,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],M=()=>[e,Kl,Hl],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",td,Yl,{position:[Kl,Hl]}],R=()=>["auto","cover","contain",nd,Bl,{size:[Kl,Hl]}],N=()=>[Al,Ql,Zl],A=()=>["","none","full",l,Kl,Hl],P=()=>["",Rl,Ql,Zl],$=()=>[Rl,Al,td,Yl],D=()=>["","none",f,Kl,Hl],L=()=>["none",Rl,Kl,Hl],j=()=>["none",Rl,Kl,Hl],F=()=>[Rl,Kl,Hl],U=()=>[Ol,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pl],breakpoint:[Pl],color:[$l],container:[Pl],"drop-shadow":[Pl],ease:["in","out","in-out"],font:[Ul],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pl],shadow:[Pl],spacing:["px",Rl],text:[Pl],"text-shadow":[Pl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ol,Hl,Kl,g]}],container:["container"],"container-type":[{"@container":["","normal","size",Kl,Hl]}],"container-named":[Wl],columns:[{columns:[Rl,Hl,Kl,a]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:x()}],"inset-x":[{"inset-x":x()}],"inset-y":[{"inset-y":x()}],start:[{"inset-s":x(),start:x()}],end:[{"inset-e":x(),end:x()}],"inset-bs":[{"inset-bs":x()}],"inset-be":[{"inset-be":x()}],top:[{top:x()}],right:[{right:x()}],bottom:[{bottom:x()}],left:[{left:x()}],visibility:["visible","invisible","collapse"],z:[{z:[Nl,"auto",Kl,Hl]}],basis:[{basis:[Ol,"full","auto",a,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Rl,Ol,"auto","initial","none",Hl]}],grow:[{grow:["",Rl,Kl,Hl]}],shrink:[{shrink:["",Rl,Kl,Hl]}],order:[{order:[Nl,"first","last","none",Kl,Hl]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:S()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:S()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...T()]}],"min-inline-size":[{"min-inline":["auto",...T()]}],"max-inline-size":[{"max-inline":["none",...T()]}],"block-size":[{block:["auto",...z()]}],"min-block-size":[{"min-block":["auto",...z()]}],"max-block-size":[{"max-block":["none",...z()]}],w:[{w:[a,"screen",...I()]}],"min-w":[{"min-w":[a,"screen","none",...I()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,Ql,Zl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,id,Vl]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Al,Hl]}],"font-family":[{font:[ed,Gl,t]}],"font-features":[{"font-features":[Hl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Kl,Hl]}],"line-clamp":[{"line-clamp":[Rl,"none",Kl,ql]}],leading:[{leading:[i,...w()]}],"list-image":[{"list-image":["none",Kl,Hl]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Kl,Hl]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Rl,"from-font","auto",Kl,Zl]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Rl,"auto",Kl,Hl]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Nl,Kl,Hl]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Kl,Hl]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Kl,Hl]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:R()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Nl,Kl,Hl],radial:["",Kl,Hl],conic:[Nl,Kl,Hl]},rd,Jl]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:N()}],"gradient-via-pos":[{via:N()}],"gradient-to-pos":[{to:N()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Rl,Kl,Hl]}],"outline-w":[{outline:["",Rl,Ql,Zl]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,od,Xl]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",u,od,Xl]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Rl,Zl]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",p,od,Xl]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Rl,Kl,Hl]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Rl]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Kl,Hl]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Rl]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Kl,Hl]}],filter:[{filter:["","none",Kl,Hl]}],blur:[{blur:D()}],brightness:[{brightness:[Rl,Kl,Hl]}],contrast:[{contrast:[Rl,Kl,Hl]}],"drop-shadow":[{"drop-shadow":["","none",h,od,Xl]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Rl,Kl,Hl]}],"hue-rotate":[{"hue-rotate":[Rl,Kl,Hl]}],invert:[{invert:["",Rl,Kl,Hl]}],saturate:[{saturate:[Rl,Kl,Hl]}],sepia:[{sepia:["",Rl,Kl,Hl]}],"backdrop-filter":[{"backdrop-filter":["","none",Kl,Hl]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[Rl,Kl,Hl]}],"backdrop-contrast":[{"backdrop-contrast":[Rl,Kl,Hl]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Rl,Kl,Hl]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rl,Kl,Hl]}],"backdrop-invert":[{"backdrop-invert":["",Rl,Kl,Hl]}],"backdrop-opacity":[{"backdrop-opacity":[Rl,Kl,Hl]}],"backdrop-saturate":[{"backdrop-saturate":[Rl,Kl,Hl]}],"backdrop-sepia":[{"backdrop-sepia":["",Rl,Kl,Hl]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Kl,Hl]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Rl,"initial",Kl,Hl]}],ease:[{ease:["linear","initial",y,Kl,Hl]}],delay:[{delay:[Rl,Kl,Hl]}],animate:[{animate:["none",b,Kl,Hl]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,Kl,Hl]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:j()}],"scale-x":[{"scale-x":j()}],"scale-y":[{"scale-y":j()}],"scale-z":[{"scale-z":j()}],"scale-3d":["scale-3d"],skew:[{skew:F()}],"skew-x":[{"skew-x":F()}],"skew-y":[{"skew-y":F()}],transform:[{transform:[Kl,Hl,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:U()}],"translate-x":[{"translate-x":U()}],"translate-y":[{"translate-y":U()}],"translate-z":[{"translate-z":U()}],"translate-none":["translate-none"],zoom:[{zoom:[Nl,Kl,Hl]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Kl,Hl]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Kl,Hl]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Rl,Ql,Zl,ql]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function yd(...e){return gd(e.filter(Boolean).join(" "))}var bd={sm:"w-5 h-5",md:"w-8 h-8",lg:"w-12 h-12"};function vd(e){const{src:t,alt:n,elevation:r,fit:o="contain",size:i="md",rounded:s,className:a,style:c,ref:l,...d}=e,u="string"==typeof i,p=u?bd[i]:void 0,h=u?c:{width:i,height:i,...c};/* @__PURE__ */
|
|
3
3
|
return g("img",{...d,ref:l,alt:n,className:yd("flex-shrink-0","contain"===o?"object-contain":"object-cover",p,!0===s||"theme"===s?Bc.theme:"full"===s?Bc.pill:s?Bc[s]:void 0,a),src:t,style:{...Vc(r),...h}})}function wd(){return"undefined"!=typeof window}function xd(e){return Sd(e)?(e.nodeName||"").toLowerCase():"#document"}function kd(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Sd(e){return!!wd()&&(e instanceof Node||e instanceof kd(e).Node)}function _d(e){return!!wd()&&(e instanceof Element||e instanceof kd(e).Element)}function Ed(e){return!!wd()&&(e instanceof HTMLElement||e instanceof kd(e).HTMLElement)}function Cd(e){return!(!wd()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof kd(e).ShadowRoot)}function Id(e){return/^(html|body|#document)$/.test(xd(e))}function Td(e){return kd(e).getComputedStyle(e)}function zd(e){if("html"===xd(e))return e;const t=e.assignedSlot||e.parentNode||Cd(e)&&e.host||function(e){var t;return null==(t=(Sd(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return Cd(t)?t.host:t}var Md={...e},Od={};function Rd(t,n){const r=e.useRef(Od);return r.current===Od&&(r.current=t(n)),r}var Nd=Md.useInsertionEffect,Ad=Nd&&Nd!==Md.useLayoutEffect?Nd:e=>e();function Pd(e){const t=Rd($d).current;return t.next=e,Ad(t.effect),t.trampoline}function $d(){const e={next:void 0,callback:Dd,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Dd(){}var Ld="undefined"!=typeof document?e.useLayoutEffect:()=>{};function jd(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}var Fd={};function Ud(e,t,n,r,o){if(!(n||r||o||e))return Wd(t);let i=Wd(e);return t&&(i=Bd(i,t)),n&&(i=Bd(i,n)),r&&(i=Bd(i,r)),o&&(i=Bd(i,o)),i}function Wd(e){return Zd(e)?{...qd(e,Fd)}:function(e){const t={...e};for(const n in t){const e=t[n];Hd(n,e)&&(t[n]=Gd(e))}return t}(e)}function Bd(e,t){return Zd(t)?qd(t,e):function(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":e[n]=jd(e.style,r);break;case"className":e[n]=Jd(e.className,r);break;default:Hd(n,r)?e[n]=Vd(e[n],r):e[n]=r}}return e}(e,t)}function Hd(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return 111===n&&110===r&&o>=65&&o<=90&&("function"==typeof t||void 0===t)}function Zd(e){return"function"==typeof e}function qd(e,t){return Zd(e)?e(t):e??Fd}function Vd(e,t){return t?e?(...n)=>{const r=n[0];if(Xd(r)){const o=r;Yd(o);const i=t(...n);return o.baseUIHandlerPrevented||e?.(...n),i}const o=t(...n);return e?.(...n),o}:Gd(t):e}function Gd(e){return e?(...t)=>{const n=t[0];return Xd(n)&&Yd(n),e(...t)}:e}function Yd(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Jd(e,t){return t?e?t+" "+e:t:e}function Xd(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}var Kd,Qd,eu=(Kd="https://base-ui.com/production-error",Qd="Base UI",function(e,...t){const n=new URL(Kd);return n.searchParams.set("code",e.toString()),t.forEach(e=>n.searchParams.append("args[]",e)),`${Qd} error #${e}; visit ${n} for the full message.`}),tu=/*#__PURE__*/e.createContext(void 0);function nu(e){return e?.ownerDocument||document}function ru(e,t,{detail:n=0}={}){e.dispatchEvent(new(kd(e).PointerEvent)("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function ou(t={}){const{disabled:n=!1,focusableWhenDisabled:r,tabIndex:o=0,native:i=!0,composite:s}=t,a=e.useRef(null),c=function(t=!1){const n=e.useContext(tu);if(void 0===n&&!t)throw new Error(eu(16));return n}(!0),l=s??void 0!==c,{props:d}=function(t){const{focusableWhenDisabled:n,disabled:r,composite:o=!1,tabIndex:i=0,isNativeButton:s}=t,a=o&&!1!==n,c=o&&!1===n;return{props:e.useMemo(()=>{const e={onKeyDown(e){r&&n&&"Tab"!==e.key&&e.preventDefault()}};return o||(e.tabIndex=i,!s&&r&&(e.tabIndex=n?i:-1)),(s&&(n||a)||!s&&r)&&(e["aria-disabled"]=r),!s||n&&!c||(e.disabled=r),e},[o,r,n,a,c,s,i])}}({focusableWhenDisabled:r,disabled:n,composite:l,tabIndex:o,isNativeButton:i}),u=e.useCallback(()=>{const e=a.current;iu(e)&&l&&n&&void 0===d.disabled&&e.disabled&&(e.disabled=!1)},[n,d.disabled,l]);return Ld(u,[u]),{getButtonProps:e.useCallback((e={})=>{const{onClick:t,onMouseDown:r,onKeyUp:o,onKeyDown:s,onPointerDown:a,...c}=e;return Ud({onClick(e){n?e.preventDefault():t?.(e)},onMouseDown(e){n||r?.(e)},onKeyDown(e){if(n)return;if(Yd(e),s?.(e),e.baseUIHandlerPrevented)return;const t=e.target===e.currentTarget,r=e.currentTarget,o=iu(r),a=!i&&(Ed(c=r)&&"A"===c.tagName&&Boolean(c.href));var c;const d=t&&(i?o:!a),u="Enter"===e.key,p=" "===e.key,h=r.getAttribute("role"),f=h?.startsWith("menuitem")||"option"===h||"gridcell"===h;if(t&&l&&p){if(e.defaultPrevented&&f)return;return e.preventDefault(),void(i&&!o||(e.preventBaseUIHandler(),ru(r,e)))}d&&!i&&(p||u)?e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),ru(r,e))):t&&a&&p&&e.preventDefault()},onKeyUp(e){n||(Yd(e),o?.(e),e.target===e.currentTarget&&i&&l&&iu(e.currentTarget)&&" "===e.key?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||l||e.defaultPrevented||" "!==e.key||(e.preventBaseUIHandler(),ru(e.currentTarget,e)))},onPointerDown(e){n?e.preventDefault():a?.(e)}},i?{type:"button"}:{role:"button"},d,c)},[n,d,l,i]),buttonRef:Pd(e=>{a.current=e,u()})}}function iu(e){return Ed(e)&&"BUTTON"===e.tagName}function su(e,t,n,r){const o=Rd(au).current;return function(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}(o,e,t,n,r)&&cu(o,[e,t,n,r]),o.callback}function au(){return{callback:null,cleanup:null,refs:[]}}function cu(e,t){e.refs=t,t.every(e=>null==e)?e.callback=null:e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=n){const r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){const o=t[e];if(null!=o)switch(typeof o){case"function":{const t=o(n);"function"==typeof t&&(r[e]=t);break}case"object":o.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){const n=t[e];if(null!=n)switch(typeof n){case"function":{const t=r[e];"function"==typeof t?t():n(null);break}case"object":n.current=null}}}}}}var lu=parseInt(e.version,10);function du(e){return lu>=e}function uu(t){if(!/*#__PURE__*/e.isValidElement(t))return null;const n=t,r=n.props;return(du(19)?r?.ref:n.ref)??null}function pu(){}var hu=Object.freeze([]),fu=Object.freeze({});function mu(t,n,o={}){const i=n.render,s=function(e,t={}){const{className:n,style:r,render:o}=e,{state:i=fu,ref:s,props:a,stateAttributesMapping:c,enabled:l=!0}=t,d=l?function(e,t){return"function"==typeof e?e(t):e}(n,i):void 0,u=l?function(e,t){return"function"==typeof e?e(t):e}(r,i):void 0,p=l?function(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const e=t[r](o);null!=e&&Object.assign(n,e);continue}!0===o?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}(i,c):fu,h=l&&a?function(e){return Array.isArray(e)?function(e){if(0===e.length)return Fd;if(1===e.length)return Wd(e[0]);let t=Wd(e[0]);for(let n=1;n<e.length;n+=1)t=Bd(t,e[n]);return t}(e):Ud(void 0,e)}(a):void 0,f=l?jd(p,h)??{}:fu;"undefined"!=typeof document&&(l?Array.isArray(s)?f.ref=function(e){const t=Rd(au).current;return function(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}(t,e)&&cu(t,e),t.callback}([f.ref,uu(o),...s]):f.ref=su(f.ref,uu(o),s):su(null,null));if(!l)return fu;void 0!==d&&(f.className=Jd(f.className,d));void 0!==u&&(f.style=jd(f.style,u));return f}(n,o);return!1===o.enabled?null:function(t,n,o,i){if(n){if("function"==typeof n)return n(o,i);const t=Ud(o,n.props);t.ref=o.ref;let r=n;return r?.$$typeof===gu&&(r=e.Children.toArray(n)[0]),/*#__PURE__*/e.cloneElement(r,t)}if(t&&"string"==typeof t)return function(t,n){return"button"===t?/*#__PURE__*/r("button",{type:"button",...n,key:n.key}):"img"===t?/*#__PURE__*/r("img",{alt:"",...n,key:n.key}):/*#__PURE__*/e.createElement(t,n)}(t,o);throw new Error(eu(8))}(t,i,s,o.state??fu)}var gu=Symbol.for("react.lazy");var yu=/*#__PURE__*/e.forwardRef(function(e,t){const{render:n,className:r,disabled:o=!1,focusableWhenDisabled:i=!1,nativeButton:s=!0,style:a,...c}=e,{getButtonProps:l,buttonRef:d}=ou({disabled:o,focusableWhenDisabled:i,native:s});return mu("button",e,{state:{disabled:o},ref:[t,d],props:[c,l]})}),bu={primary:"bg-primary text-primary-foreground border-transparent hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",ghost:"bg-transparent text-foreground border-border hover:bg-muted",bare:"bg-transparent text-inherit border-transparent hover:bg-transparent p-0 min-h-0",chip:"bg-secondary-bg text-foreground border-transparent hover:bg-primary hover:text-primary-foreground hover:border-primary",tab:"bg-transparent text-foreground-muted border-transparent hover:text-foreground hover:bg-transparent p-0 min-h-0"},vu={sm:"px-2 py-1 text-xs min-h-7",md:"px-4 py-2 text-sm min-h-9"},wu={default:"rounded-lg",theme:Bc.theme,pill:Bc.pill};function xu({active:e=!1,className:t,disabled:n,elevation:r,full:o,shape:i="default",size:s="md",stacked:a=!1,type:c="button",variant:l="primary",style:d,ref:u,...p}){const h=!["bare","tab"].includes(l);/* @__PURE__ */
|
|
4
4
|
return g(yu,{...p,ref:u,className:yd("inline-flex items-center justify-center gap-2 font-medium cursor-pointer transition-all focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2",h&&"border",wu[i],bu[l],"bare"!==l&&"tab"!==l&&vu[s],a&&"flex-col gap-0.5","tab"===l&&"h-full min-w-0 flex-1",e&&"tab"===l&&"text-primary font-semibold",n&&"opacity-50 cursor-not-allowed pointer-events-none",o&&"w-full",t),"data-disabled":n?"true":"false","data-size":s,"data-variant":l,disabled:n,style:{...Vc(r),...d},type:c})}var ku={none:"0","2xs":"1",xs:"0.5",sm:"1.5",md:"2",lg:"3",xl:"4","2xl":"6"},Su=/* @__PURE__ */new Set(["padding","paddingX","paddingY","paddingTop","paddingBottom","gap","align","justify","grow","shrink","position","inset","overflow","overflowY","width","height","minWidth","border","rounded","animate","hidden","as","style"]);function _u(e){const t=[];if(void 0!==e.padding&&t.push(`p-${ku[e.padding]}`),void 0!==e.paddingX&&t.push(`px-${ku[e.paddingX]}`),void 0!==e.paddingY&&t.push(`py-${ku[e.paddingY]}`),void 0!==e.paddingTop&&t.push(`pt-${ku[e.paddingTop]}`),void 0!==e.paddingBottom&&t.push(`pb-${ku[e.paddingBottom]}`),void 0!==e.gap&&t.push(`gap-${ku[e.gap]}`),void 0!==e.align&&t.push(`items-${e.align}`),void 0!==e.justify&&t.push(`justify-${e.justify}`),!0===e.grow&&t.push("flex-1"),!1===e.shrink&&t.push("flex-shrink-0"),void 0!==e.position&&t.push(e.position),void 0!==e.inset&&t.push("0"===e.inset?"inset-0":`inset-${ku[e.inset]}`),void 0!==e.overflow&&t.push(`overflow-${e.overflow}`),void 0!==e.overflowY&&t.push(`overflow-y-${e.overflowY}`),void 0!==e.width&&t.push(`w-${e.width}`),void 0!==e.height&&t.push(`h-${e.height}`),"0"===e.minWidth&&t.push("min-w-0"),void 0!==e.border&&!1!==e.border)if(!0===e.border)t.push("border","border-border");else{const n={top:"t",bottom:"b",left:"l",right:"r"}[e.border];t.push(`border-${n}`,"border-border")}return void 0!==e.rounded&&!1!==e.rounded&&(!0===e.rounded?t.push(Bc.theme):"full"===e.rounded?t.push(Bc.pill):t.push(Bc[e.rounded])),void 0!==e.animate&&"none"!==e.animate&&t.push({spin:"animate-spin",ping:"animate-ping",pulse:"animate-pulse",fadeIn:"animate-fade-in"}[e.animate]),!0===e.hidden&&t.push("hidden"),t.join(" ")}var Eu={default:"",card:"bg-card text-card-foreground"},Cu={none:"",card:"px-3 py-2",toast:"py-2 pl-2 pr-3"},Iu=o(function(e,t){const{as:n="div",background:r="default",className:o,elevation:i,paddingPreset:s="none",radius:a,style:c,...l}=e,d=_u(e),u=function(e){const t={};for(const n in e)Su.has(n)||(t[n]=e[n]);return t}(l);/* @__PURE__ */
|
|
5
5
|
return g(n,{...u,ref:t,className:yd(Eu[r],Cu[s],a&&_u({rounded:a}),d,o),style:{...Vc(i),...c}})}),Tu=o(function(e,t){const{className:n,direction:r,...o}=e;/* @__PURE__ */
|