FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surerank
/
build
/
vendor-536eaa00
Edit File: index.js
"use strict";(globalThis.webpackChunksurerank=globalThis.webpackChunksurerank||[]).push([[359],{51893(e,t,n){n.d(t,{A:()=>g});var a=function(){function e(e){var t=this;this._insertTag=function(e){t.container.insertBefore(e,0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(a){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),r=n(40390),i=n(19735),s=n(24534),o=n(50483),d=n(49503),c=n(73716),u=function(e,t,n){for(var a=0,i=0;a=i,i=(0,r.se)(),38===a&&12===i&&(t[n]=1),!(0,r.Sh)(i);)(0,r.K2)();return(0,r.di)(e,r.G1)},l=new WeakMap,p=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,a=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||l.get(n))&&!a){l.set(e,!0);for(var s=[],o=function(e,t){return(0,r.VF)(function(e,t){var n=-1,a=44;do{switch((0,r.Sh)(a)){case 0:38===a&&12===(0,r.se)()&&(t[n]=1),e[n]+=u(r.G1-1,t,n);break;case 2:e[n]+=(0,r.Tb)(a);break;case 4:if(44===a){e[++n]=58===(0,r.se)()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=(0,i.HT)(a)}}while(a=(0,r.K2)());return e}((0,r.c4)(e),t))}(t,s),d=n.props,c=0,p=0;c<o.length;c++)for(var h=0;h<d.length;h++,p++)e.props[p]=s[c]?o[c].replace(/&\f/g,d[h]):d[h]+" "+o[c]}}},h=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function m(e,t){switch((0,i.tW)(e,t)){case 5103:return s.j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return s.j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return s.j+e+s.vd+e+s.MS+e+e;case 6828:case 4268:return s.j+e+s.MS+e+e;case 6165:return s.j+e+s.MS+"flex-"+e+e;case 5187:return s.j+e+(0,i.HC)(e,/(\w+).+(:[^]+)/,s.j+"box-$1$2"+s.MS+"flex-$1$2")+e;case 5443:return s.j+e+s.MS+"flex-item-"+(0,i.HC)(e,/flex-|-self/,"")+e;case 4675:return s.j+e+s.MS+"flex-line-pack"+(0,i.HC)(e,/align-content|flex-|-self/,"")+e;case 5548:return s.j+e+s.MS+(0,i.HC)(e,"shrink","negative")+e;case 5292:return s.j+e+s.MS+(0,i.HC)(e,"basis","preferred-size")+e;case 6060:return s.j+"box-"+(0,i.HC)(e,"-grow","")+s.j+e+s.MS+(0,i.HC)(e,"grow","positive")+e;case 4554:return s.j+(0,i.HC)(e,/([^-])(transform)/g,"$1"+s.j+"$2")+e;case 6187:return(0,i.HC)((0,i.HC)((0,i.HC)(e,/(zoom-|grab)/,s.j+"$1"),/(image-set)/,s.j+"$1"),e,"")+e;case 5495:case 3959:return(0,i.HC)(e,/(image-set\([^]*)/,s.j+"$1$`$1");case 4968:return(0,i.HC)((0,i.HC)(e,/(.+:)(flex-)?(.*)/,s.j+"box-pack:$3"+s.MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+s.j+e+e;case 4095:case 3583:case 4068:case 2532:return(0,i.HC)(e,/(.+)-inline(.+)/,s.j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if((0,i.b2)(e)-1-t>6)switch((0,i.wN)(e,t+1)){case 109:if(45!==(0,i.wN)(e,t+4))break;case 102:return(0,i.HC)(e,/(.+:)(.+)-([^]+)/,"$1"+s.j+"$2-$3$1"+s.vd+(108==(0,i.wN)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,i.K5)(e,"stretch")?m((0,i.HC)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,i.wN)(e,t+1))break;case 6444:switch((0,i.wN)(e,(0,i.b2)(e)-3-(~(0,i.K5)(e,"!important")&&10))){case 107:return(0,i.HC)(e,":",":"+s.j)+e;case 101:return(0,i.HC)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+s.j+(45===(0,i.wN)(e,14)?"inline-":"")+"box$3$1"+s.j+"$2$3$1"+s.MS+"$2box$3")+e}break;case 5936:switch((0,i.wN)(e,t+11)){case 114:return s.j+e+s.MS+(0,i.HC)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return s.j+e+s.MS+(0,i.HC)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return s.j+e+s.MS+(0,i.HC)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return s.j+e+s.MS+e+e}return e}var f=[function(e,t,n,a){if(e.length>-1&&!e.return)switch(e.type){case s.LU:e.return=m(e.value,e.length);break;case s.Sv:return(0,o.l)([(0,r.C)(e,{value:(0,i.HC)(e.value,"@","@"+s.j)})],a);case s.XZ:if(e.length)return(0,i.kg)(e.props,function(t){switch((0,i.YW)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,o.l)([(0,r.C)(e,{props:[(0,i.HC)(t,/:(read-\w+)/,":"+s.vd+"$1")]})],a);case"::placeholder":return(0,o.l)([(0,r.C)(e,{props:[(0,i.HC)(t,/:(plac\w+)/,":"+s.j+"input-$1")]}),(0,r.C)(e,{props:[(0,i.HC)(t,/:(plac\w+)/,":"+s.vd+"$1")]}),(0,r.C)(e,{props:[(0,i.HC)(t,/:(plac\w+)/,s.MS+"input-$1")]})],a)}return""})}}],g=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,i,s=e.stylisPlugins||f,u={},l=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)u[t[n]]=!0;l.push(e)});var m,g=[p,h],y=[o.A,(0,d.MY)(function(e){m.insert(e)})],_=(0,d.r1)(g.concat(s,y));i=function(e,t,n,a){m=n,(0,o.l)((0,c.wE)(e?e+"{"+t.styles+"}":t.styles),_),a&&(v.inserted[t.name]=!0)};var v={key:t,sheet:new a({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:u,registered:{},insert:i};return v.sheet.hydrate(l),v}},11456(e,t,n){n.d(t,{AH:()=>A,Y:()=>S,i7:()=>R});var a=n(51609),r=n(51893),i=function(e,t,n){var a=e.key+"-"+t.name;!1===n&&void 0===e.registered[a]&&(e.registered[a]=t.styles)},s={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function o(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var d=/[A-Z]|^ms/g,c=/_EMO_([^_]+?)_([^]*?)_EMO_/g,u=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!==typeof e},p=o(function(e){return u(e)?e:e.replace(d,"-$&").toLowerCase()}),h=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(c,function(e,t,n){return f={name:t,styles:n,next:f},t})}return 1===s[e]||u(e)||"number"!==typeof t||0===t?t:t+"px"};function m(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return f={name:n.name,styles:n.styles,next:f},n.name;var a=n;if(void 0!==a.styles){var r=a.next;if(void 0!==r)for(;void 0!==r;)f={name:r.name,styles:r.styles,next:f},r=r.next;return a.styles+";"}return function(e,t,n){var a="";if(Array.isArray(n))for(var r=0;r<n.length;r++)a+=m(e,t,n[r])+";";else for(var i in n){var s=n[i];if("object"!==typeof s){var o=s;null!=t&&void 0!==t[o]?a+=i+"{"+t[o]+"}":l(o)&&(a+=p(i)+":"+h(i,o)+";")}else if(!Array.isArray(s)||"string"!==typeof s[0]||null!=t&&void 0!==t[s[0]]){var d=m(e,t,s);switch(i){case"animation":case"animationName":a+=p(i)+":"+d+";";break;default:a+=i+"{"+d+"}"}}else for(var c=0;c<s.length;c++)l(s[c])&&(a+=p(i)+":"+h(i,s[c])+";")}return a}(e,t,n);case"function":if(void 0!==e){var i=f,s=n(e);return f=i,m(e,t,s)}}if(null==t)return n;var o=t[n];return void 0!==o?o:n}var f,g=/label:\s*([^\s;{]+)\s*(;|$)/g;function y(e,t,n){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var a=!0,r="";f=void 0;var i=e[0];null==i||void 0===i.raw?(a=!1,r+=m(n,t,i)):r+=i[0];for(var s=1;s<e.length;s++)r+=m(n,t,e[s]),a&&(r+=i[s]);g.lastIndex=0;for(var o,d="";null!==(o=g.exec(r));)d+="-"+o[1];var c=function(e){for(var t,n=0,a=0,r=e.length;r>=4;++a,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+d;return{name:c,styles:r,next:f}}var _=!!a.useInsertionEffect&&a.useInsertionEffect||function(e){return e()},v=a.createContext("undefined"!==typeof HTMLElement?(0,r.A)({key:"css"}):null),b=function(e){return(0,a.forwardRef)(function(t,n){var r=(0,a.useContext)(v);return e(t,r,n)})},w=a.createContext({}),x={}.hasOwnProperty,E="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",T=function(e){var t=e.cache,n=e.serialized,a=e.isStringTag;return i(t,n,a),_(function(){return function(e,t,n){i(e,t,n);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+a:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,a)}),null},k=b(function(e,t,n){var r=e.css;"string"===typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var i=e[E],s=[r],o="";"string"===typeof e.className?o=function(e,t,n){var a="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(a+=n+" ")}),a}(t.registered,s,e.className):null!=e.className&&(o=e.className+" ");var d=y(s,void 0,a.useContext(w));o+=t.key+"-"+d.name;var c={};for(var u in e)x.call(e,u)&&"css"!==u&&u!==E&&(c[u]=e[u]);return c.className=o,n&&(c.ref=n),a.createElement(a.Fragment,null,a.createElement(T,{cache:t,serialized:d,isStringTag:"string"===typeof i}),a.createElement(i,c))}),S=(n(4146),function(e,t){var n=arguments;if(null==t||!x.call(t,"css"))return a.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=k,i[1]=function(e,t){var n={};for(var a in t)x.call(t,a)&&(n[a]=t[a]);return n[E]=e,n}(e,t);for(var s=2;s<r;s++)i[s]=n[s];return a.createElement.apply(null,i)});function A(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y(t)}function R(){var e=A.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}!function(e){var t;t||(t=e.JSX||(e.JSX={}))}(S||(S={}))},12542(e,t,n){var a,r,i,s,o,d,c,u,l;n.d(t,{BK:()=>Bn}),function(e){e.POST_MESSAGE="postMessage"}(a||(a={})),function(e){e.POST_MESSAGE="postMessage"}(r||(r={})),function(e){e.STREAMABLE_HTTP="streamableHttp",e.SSE="sse"}(i||(i={})),function(e){e.LOCAL="local",e.REMOTE="remote"}(s||(s={})),function(e){e.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",e.SDK_ANGIE_REFRESH_PING="sdk-angie-refresh-ping",e.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",e.SDK_REQUEST_INIT_SERVER="sdk-request-init-server",e.SDK_TRIGGER_ANGIE="sdk-trigger-angie",e.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response"}(o||(o={})),function(e){e.SET="ANGIE_SET_LOCALSTORAGE",e.GET="ANGIE_GET_LOCALSTORAGE"}(d||(d={})),function(e){e.RESET_HASH="reset-hash",e.HOST_READY="host/ready",e.ANGIE_LOADED="angie/loaded",e.ANGIE_READY="angie/ready"}(c||(c={}));class p{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(e=>{this.readyResolve=e}),"undefined"==typeof window)return;let e=0;const t=()=>{if(this.isAngieReady||e>=500)return void(!this.isAngieReady&&e>=500&&this.handleDetectionTimeout());const n=new MessageChannel;n.port1.onmessage=e=>{this.handleAngieReady(e.data),n.port1.close(),n.port2.close()};const a={type:o.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(a,window.location.origin,[n.port2]),e++,setTimeout(t,500)};t()}handleAngieReady(e){this.isAngieReady=!0,this.readyResolve&&this.readyResolve({isReady:!0,version:e.version,capabilities:e.capabilities})}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1})}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class h{queue=[];isProcessing=!1;add(e){const t={id:this.generateId(e),config:e,timestamp:Date.now(),status:"pending"};return this.queue.push(t),t}getAll(){return[...this.queue]}getPending(){return this.queue.filter(e=>"pending"===e.status)}updateStatus(e,t,n){const a=this.queue.find(t=>t.id===e);a&&(a.status=t,n?a.error=n:"pending"!==t&&"registered"!==t||delete a.error)}async processQueue(e){if(this.isProcessing)return;this.isProcessing=!0;const t=this.getPending();try{for(const n of t)try{await e(n),this.updateStatus(n.id,"registered")}catch(e){const t=e instanceof Error?e.message:String(e);this.updateStatus(n.id,"failed",t)}}finally{this.isProcessing=!1}}clear(){this.queue=[]}resetAllToPending(){return!this.isProcessing&&(this.queue.filter(e=>"registered"===e.status),this.queue.filter(e=>"failed"===e.status),this.queue.forEach(e=>{"pending"!==e.status&&(e.status="pending",delete e.error)}),!0)}remove(e){const t=this.queue.findIndex(t=>t.id===e);return-1!==t&&(this.queue.splice(t,1),!0)}generateId(e){return`reg_${e.name}_${e.version}_${Date.now()}`}}class m{async requestClientCreation(e){const{config:t}=e,n={serverId:e.id,serverName:t.name,serverVersion:t.version,description:t.description,transport:t.transport||r.POST_MESSAGE,capabilities:t.capabilities,instanceId:e.instanceId};return"type"in t&&"remote"===t.type&&(n.remote={url:t.url}),new Promise((e,t)=>{const a=new MessageChannel,r=setTimeout(()=>{t(new Error("Client creation request timed out after 15000ms"))},15e3);a.port1.onmessage=t=>{clearTimeout(r),e(t.data)};const i={type:o.SDK_REQUEST_CLIENT_CREATION,payload:n,timestamp:Date.now()};window.postMessage(i,window.location.origin,[a.port2])})}}!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),a={};for(const e of n)a[e]=t[e];return e.objectValues(a)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(u||(u={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(l||(l={}));const f=u.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),g=e=>{switch(typeof e){case"undefined":return f.undefined;case"string":return f.string;case"number":return Number.isNaN(e)?f.nan:f.number;case"boolean":return f.boolean;case"function":return f.function;case"bigint":return f.bigint;case"symbol":return f.symbol;case"object":return Array.isArray(e)?f.array:null===e?f.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?f.promise:"undefined"!=typeof Map&&e instanceof Map?f.map:"undefined"!=typeof Set&&e instanceof Set?f.set:"undefined"!=typeof Date&&e instanceof Date?f.date:f.object;default:return f.unknown}},y=u.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class _ extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(this),n}static assert(e){if(!(e instanceof _))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,u.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const a of this.issues)if(a.path.length>0){const n=a.path[0];t[n]=t[n]||[],t[n].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}_.create=e=>new _(e);const v=(e,t)=>{let n;switch(e.code){case y.invalid_type:n=e.received===f.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,u.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:n=`Unrecognized key(s) in object: ${u.joinValues(e.keys,", ")}`;break;case y.invalid_union:n="Invalid input";break;case y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${u.joinValues(e.options)}`;break;case y.invalid_enum_value:n=`Invalid enum value. Expected ${u.joinValues(e.options)}, received '${e.received}'`;break;case y.invalid_arguments:n="Invalid function arguments";break;case y.invalid_return_type:n="Invalid function return type";break;case y.invalid_date:n="Invalid date";break;case y.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:u.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case y.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case y.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case y.custom:n="Invalid input";break;case y.invalid_intersection_types:n="Intersection results could not be merged";break;case y.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case y.not_finite:n="Number must be finite";break;default:n=t.defaultError,u.assertNever(e)}return{message:n}};let b=v;var w;function x(e,t){const n=(e=>{const{data:t,path:n,errorMaps:a,issueData:r}=e,i=[...n,...r.path||[]],s={...r,path:i};if(void 0!==r.message)return{...r,path:i,message:r.message};let o="";const d=a.filter(e=>!!e).slice().reverse();for(const c of d)o=c(s,{data:t,defaultError:o}).message;return{...r,path:i,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,b,b===v?void 0:v].filter(e=>!!e)});e.common.issues.push(n)}!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(w||(w={}));class E{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if("aborted"===a.status)return T;"dirty"===a.status&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const e=await a.key,t=await a.value;n.push({key:e,value:t})}return E.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return T;if("aborted"===r.status)return T;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(n[t.value]=r.value)}return{status:e.value,value:n}}}const T=Object.freeze({status:"aborted"}),k=e=>({status:"dirty",value:e}),S=e=>({status:"valid",value:e}),A=e=>"aborted"===e.status,R=e=>"dirty"===e.status,C=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;class I{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const O=(e,t)=>{if(C(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new _(e.common.issues);return this._error=t,this._error}}};function L(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:a,description:r}=e;if(t&&(n||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??r.defaultError}:void 0===r.data?{message:i??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:i??n??r.defaultError}},description:r}}class D{get description(){return this._def.description}_getType(e){return g(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:g(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new E,ctx:{common:e.parent.common,data:e.data,parsedType:g(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(N(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:g(e)},a=this._parseSync({data:e,path:n.path,parent:n});return O(n,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:g(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return C(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>C(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:g(e)},a=this._parse({data:e,path:n.path,parent:n}),r=await(N(a)?a:Promise.resolve(a));return O(n,r)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const r=e(t),i=()=>a.addIssue({code:y.custom,...n(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((n,a)=>!!e(n)||(a.addIssue("function"==typeof t?t(n,a):t),!1))}_refinement(e){return new Pe({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Me.create(this,this._def)}nullable(){return je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ye.create(this)}promise(){return De.create(this,this._def)}or(e){return be.create([this,e],this._def)}and(e){return Te.create(this,e,this._def)}transform(e){return new Pe({...L(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ze({...L(this._def),innerType:this,defaultValue:t,typeName:He.ZodDefault})}brand(){return new $e({typeName:He.ZodBranded,type:this,...L(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ue({...L(this._def),innerType:this,catchValue:t,typeName:He.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ze.create(this,e)}readonly(){return Fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const P=/^c[^\s-]{8,}$/i,M=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Z=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,U=/^[a-z0-9_-]{21}$/i,G=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,z=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let F;const H=/^(?:(?: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])$/,q=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,B=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,W=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,K=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,V=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y="((\\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])))",Q=new RegExp(`^${Y}$`);function X(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function J(e){return new RegExp(`^${X(e)}$`)}function ee(e){let t=`${Y}T${X(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function te(e,t){return!("v4"!==t&&t||!H.test(e))||!("v6"!==t&&t||!B.test(e))}function ne(e,t){if(!G.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const a=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==r?.typ||!r.alg||t&&r.alg!==t)}catch{return!1}}function ae(e,t){return!("v4"!==t&&t||!q.test(e))||!("v6"!==t&&t||!W.test(e))}class re extends D{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.string,received:t.parsedType}),T}const t=new E;let n;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const r=e.data.length>a.value,i=e.data.length<a.value;(r||i)&&(n=this._getOrReturnCtx(e,n),r?x(n,{code:y.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&x(n,{code:y.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)z.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"email",code:y.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)F||(F=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),F.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"emoji",code:y.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)Z.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"uuid",code:y.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)U.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"nanoid",code:y.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)P.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid",code:y.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)M.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid2",code:y.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)j.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ulid",code:y.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),x(n,{validation:"url",code:y.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"regex",code:y.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?ee(a).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?Q.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?J(a).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?$.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"duration",code:y.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?te(e.data,a.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ip",code:y.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?ne(e.data,a.alg)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"jwt",code:y.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?ae(e.data,a.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cidr",code:y.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?K.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64",code:y.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?V.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64url",code:y.invalid_string,message:a.message}),t.dirty()):u.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:y.invalid_string,...w.errToObj(n)})}_addCheck(e){return new re({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...w.errToObj(e)})}url(e){return this._addCheck({kind:"url",...w.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...w.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...w.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...w.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...w.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...w.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...w.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...w.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...w.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...w.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...w.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...w.errToObj(e)})}datetime(e){return this._addCheck("string"==typeof e?{kind:"datetime",precision:null,offset:!1,local:!1,message:e}:{kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...w.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return this._addCheck("string"==typeof e?{kind:"time",precision:null,message:e}:{kind:"time",precision:void 0===e?.precision?null:e?.precision,...w.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...w.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...w.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...w.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...w.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...w.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...w.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...w.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...w.errToObj(t)})}nonempty(e){return this.min(1,w.errToObj(e))}trim(){return new re({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new re({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new re({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function ie(e,t){const n=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=n>a?n:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}re.create=e=>new re({checks:[],typeName:He.ZodString,coerce:e?.coerce??!1,...L(e)});class se extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==f.number){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.number,received:t.parsedType}),T}let t;const n=new E;for(const a of this._def.checks)"int"===a.kind?u.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),x(t,{code:y.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):"multipleOf"===a.kind?0!==ie(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),x(t,{code:y.not_finite,message:a.message}),n.dirty()):u.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,n,a){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:w.toString(a)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:w.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:w.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&u.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}se.create=e=>new se({checks:[],typeName:He.ZodNumber,coerce:e?.coerce||!1,...L(e)});class oe extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==f.bigint)return this._getInvalidInput(e);let t;const n=new E;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):u.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.bigint,received:t.parsedType}),T}gte(e,t){return this.setLimit("min",e,!0,w.toString(t))}gt(e,t){return this.setLimit("min",e,!1,w.toString(t))}lte(e,t){return this.setLimit("max",e,!0,w.toString(t))}lt(e,t){return this.setLimit("max",e,!1,w.toString(t))}setLimit(e,t,n,a){return new oe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:w.toString(a)}]})}_addCheck(e){return new oe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:w.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}oe.create=e=>new oe({checks:[],typeName:He.ZodBigInt,coerce:e?.coerce??!1,...L(e)});class de extends D{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==f.boolean){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.boolean,received:t.parsedType}),T}return S(e.data)}}de.create=e=>new de({typeName:He.ZodBoolean,coerce:e?.coerce||!1,...L(e)});class ce extends D{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.date,received:t.parsedType}),T}if(Number.isNaN(e.data.getTime()))return x(this._getOrReturnCtx(e),{code:y.invalid_date}),T;const t=new E;let n;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):u.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ce({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:w.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:w.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ce.create=e=>new ce({checks:[],coerce:e?.coerce||!1,typeName:He.ZodDate,...L(e)});class ue extends D{_parse(e){if(this._getType(e)!==f.symbol){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.symbol,received:t.parsedType}),T}return S(e.data)}}ue.create=e=>new ue({typeName:He.ZodSymbol,...L(e)});class le extends D{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.undefined,received:t.parsedType}),T}return S(e.data)}}le.create=e=>new le({typeName:He.ZodUndefined,...L(e)});class pe extends D{_parse(e){if(this._getType(e)!==f.null){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.null,received:t.parsedType}),T}return S(e.data)}}pe.create=e=>new pe({typeName:He.ZodNull,...L(e)});class he extends D{constructor(){super(...arguments),this._any=!0}_parse(e){return S(e.data)}}he.create=e=>new he({typeName:He.ZodAny,...L(e)});class me extends D{constructor(){super(...arguments),this._unknown=!0}_parse(e){return S(e.data)}}me.create=e=>new me({typeName:He.ZodUnknown,...L(e)});class fe extends D{_parse(e){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.never,received:t.parsedType}),T}}fe.create=e=>new fe({typeName:He.ZodNever,...L(e)});class ge extends D{_parse(e){if(this._getType(e)!==f.undefined){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.void,received:t.parsedType}),T}return S(e.data)}}ge.create=e=>new ge({typeName:He.ZodVoid,...L(e)});class ye extends D{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==f.array)return x(t,{code:y.invalid_type,expected:f.array,received:t.parsedType}),T;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(x(t,{code:e?y.too_big:y.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(x(t,{code:y.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(x(t,{code:y.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>a.type._parseAsync(new I(t,e,t.path,n)))).then(e=>E.mergeArray(n,e));const r=[...t.data].map((e,n)=>a.type._parseSync(new I(t,e,t.path,n)));return E.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new ye({...this._def,minLength:{value:e,message:w.toString(t)}})}max(e,t){return new ye({...this._def,maxLength:{value:e,message:w.toString(t)}})}length(e,t){return new ye({...this._def,exactLength:{value:e,message:w.toString(t)}})}nonempty(e){return this.min(1,e)}}function _e(e){if(e instanceof ve){const t={};for(const n in e.shape)t[n]=Me.create(_e(e.shape[n]));return new ve({...e._def,shape:()=>t})}return e instanceof ye?new ye({...e._def,type:_e(e.element)}):e instanceof Me?Me.create(_e(e.unwrap())):e instanceof je?je.create(_e(e.unwrap())):e instanceof ke?ke.create(e.items.map(e=>_e(e))):e}ye.create=(e,t)=>new ye({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...L(t)});class ve extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=u.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.object,received:t.parsedType}),T}const{status:t,ctx:n}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof fe&&"strip"===this._def.unknownKeys))for(const o in n.data)r.includes(o)||i.push(o);const s=[];for(const o of r)s.push({key:{status:"valid",value:o},value:a[o]._parse(new I(n,n.data[o],n.path,o)),alwaysSet:o in n.data});if(this._def.catchall instanceof fe){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of i)s.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)i.length>0&&(x(n,{code:y.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i)s.push({key:{status:"valid",value:t},value:e._parse(new I(n,n.data[t],n.path,t)),alwaysSet:t in n.data})}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of s){const n=await t.key,a=await t.value;e.push({key:n,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>E.mergeObjectSync(t,e)):E.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return new ve({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const a=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:w.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new ve({...this._def,unknownKeys:"strip"})}passthrough(){return new ve({...this._def,unknownKeys:"passthrough"})}extend(e){return new ve({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ve({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:He.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ve({...this._def,catchall:e})}pick(e){const t={};for(const n of u.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ve({...this._def,shape:()=>t})}omit(e){const t={};for(const n of u.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ve({...this._def,shape:()=>t})}deepPartial(){return _e(this)}partial(e){const t={};for(const n of u.objectKeys(this.shape)){const a=this.shape[n];t[n]=e&&!e[n]?a:a.optional()}return new ve({...this._def,shape:()=>t})}required(e){const t={};for(const n of u.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Me;)e=e._def.innerType;t[n]=e}return new ve({...this._def,shape:()=>t})}keyof(){return Ie(u.objectKeys(this.shape))}}ve.create=(e,t)=>new ve({shape:()=>e,unknownKeys:"strip",catchall:fe.create(),typeName:He.ZodObject,...L(t)}),ve.strictCreate=(e,t)=>new ve({shape:()=>e,unknownKeys:"strict",catchall:fe.create(),typeName:He.ZodObject,...L(t)}),ve.lazycreate=(e,t)=>new ve({shape:e,unknownKeys:"strip",catchall:fe.create(),typeName:He.ZodObject,...L(t)});class be extends D{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const n=e.map(e=>new _(e.ctx.common.issues));return x(t,{code:y.invalid_union,unionErrors:n}),T});{let e;const a=[];for(const i of n){const n={...t,common:{...t.common,issues:[]},parent:null},r=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:n}),n.common.issues.length&&a.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map(e=>new _(e));return x(t,{code:y.invalid_union,unionErrors:r}),T}}get options(){return this._def.options}}be.create=(e,t)=>new be({options:e,typeName:He.ZodUnion,...L(t)});const we=e=>e instanceof Ce?we(e.schema):e instanceof Pe?we(e.innerType()):e instanceof Ne?[e.value]:e instanceof Oe?e.options:e instanceof Le?u.objectValues(e.enum):e instanceof Ze?we(e._def.innerType):e instanceof le?[void 0]:e instanceof pe?[null]:e instanceof Me?[void 0,...we(e.unwrap())]:e instanceof je?[null,...we(e.unwrap())]:e instanceof $e||e instanceof Fe?we(e.unwrap()):e instanceof Ue?we(e._def.innerType):[];class xe extends D{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return x(t,{code:y.invalid_type,expected:f.object,received:t.parsedType}),T;const n=this.discriminator,a=this.optionsMap.get(t.data[n]);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(x(t,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),T)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const r of t){const t=we(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(a.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);a.set(n,r)}}return new xe({typeName:He.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...L(n)})}}function Ee(e,t){const n=g(e),a=g(t);if(e===t)return{valid:!0,data:e};if(n===f.object&&a===f.object){const n=u.objectKeys(t),a=u.objectKeys(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const i of a){const n=Ee(e[i],t[i]);if(!n.valid)return{valid:!1};r[i]=n.data}return{valid:!0,data:r}}if(n===f.array&&a===f.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let a=0;a<e.length;a++){const r=Ee(e[a],t[a]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===f.date&&a===f.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Te extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(e,a)=>{if(A(e)||A(a))return T;const r=Ee(e.value,a.value);return r.valid?((R(e)||R(a))&&t.dirty(),{status:t.value,value:r.data}):(x(n,{code:y.invalid_intersection_types}),T)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Te.create=(e,t,n)=>new Te({left:e,right:t,typeName:He.ZodIntersection,...L(n)});class ke extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.array)return x(n,{code:y.invalid_type,expected:f.array,received:n.parsedType}),T;if(n.data.length<this._def.items.length)return x(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),T;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new I(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(a).then(e=>E.mergeArray(t,e)):E.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new ke({...this._def,rest:e})}}ke.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ke({items:e,typeName:He.ZodTuple,rest:null,...L(t)})};class Se extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.object)return x(n,{code:y.invalid_type,expected:f.object,received:n.parsedType}),T;const a=[],r=this._def.keyType,i=this._def.valueType;for(const s in n.data)a.push({key:r._parse(new I(n,s,n.path,s)),value:i._parse(new I(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?E.mergeObjectAsync(t,a):E.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return new Se(t instanceof D?{keyType:e,valueType:t,typeName:He.ZodRecord,...L(n)}:{keyType:re.create(),valueType:e,typeName:He.ZodRecord,...L(t)})}}class Ae extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.map)return x(n,{code:y.invalid_type,expected:f.map,received:n.parsedType}),T;const a=this._def.keyType,r=this._def.valueType,i=[...n.data.entries()].map(([e,t],i)=>({key:a._parse(new I(n,e,n.path,[i,"key"])),value:r._parse(new I(n,t,n.path,[i,"value"]))}));if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of i){const a=await n.key,r=await n.value;if("aborted"===a.status||"aborted"===r.status)return T;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of i){const a=n.key,r=n.value;if("aborted"===a.status||"aborted"===r.status)return T;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}Ae.create=(e,t,n)=>new Ae({valueType:t,keyType:e,typeName:He.ZodMap,...L(n)});class Re extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==f.set)return x(n,{code:y.invalid_type,expected:f.set,received:n.parsedType}),T;const a=this._def;null!==a.minSize&&n.data.size<a.minSize.value&&(x(n,{code:y.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&n.data.size>a.maxSize.value&&(x(n,{code:y.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const n=new Set;for(const a of e){if("aborted"===a.status)return T;"dirty"===a.status&&t.dirty(),n.add(a.value)}return{status:t.value,value:n}}const s=[...n.data.values()].map((e,t)=>r._parse(new I(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>i(e)):i(s)}min(e,t){return new Re({...this._def,minSize:{value:e,message:w.toString(t)}})}max(e,t){return new Re({...this._def,maxSize:{value:e,message:w.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Re.create=(e,t)=>new Re({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...L(t)});class Ce extends D{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ce.create=(e,t)=>new Ce({getter:e,typeName:He.ZodLazy,...L(t)});class Ne extends D{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:y.invalid_literal,expected:this._def.value}),T}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new Oe({values:e,typeName:He.ZodEnum,...L(t)})}Ne.create=(e,t)=>new Ne({value:e,typeName:He.ZodLiteral,...L(t)});class Oe extends D{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e);return x(t,{expected:u.joinValues(this._def.values),received:t.parsedType,code:y.invalid_type}),T}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:y.invalid_enum_value,options:this._def.values}),T}return S(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Oe.create(e,{...this._def,...t})}exclude(e,t=this._def){return Oe.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Oe.create=Ie;class Le extends D{_parse(e){const t=u.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==f.string&&n.parsedType!==f.number){const e=u.objectValues(t);return x(n,{expected:u.joinValues(e),received:n.parsedType,code:y.invalid_type}),T}if(this._cache||(this._cache=new Set(u.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=u.objectValues(t);return x(n,{received:n.data,code:y.invalid_enum_value,options:e}),T}return S(e.data)}get enum(){return this._def.values}}Le.create=(e,t)=>new Le({values:e,typeName:He.ZodNativeEnum,...L(t)});class De extends D{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&!1===t.common.async)return x(t,{code:y.invalid_type,expected:f.promise,received:t.parsedType}),T;const n=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return S(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}De.create=(e,t)=>new De({type:e,typeName:He.ZodPromise,...L(t)});class Pe extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,r={addIssue:e=>{x(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===a.type){const e=a.transform(n.data,r);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return T;const a=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===a.status?T:"dirty"===a.status||"dirty"===t.value?k(a.value):a});{if("aborted"===t.value)return T;const a=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===a.status?T:"dirty"===a.status||"dirty"===t.value?k(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,r);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===a.status?T:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?T:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!C(e))return T;const i=a.transform(e.value,r);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>C(e)?Promise.resolve(a.transform(e.value,r)).then(e=>({status:t.value,value:e})):T)}u.assertNever(a)}}Pe.create=(e,t,n)=>new Pe({schema:e,typeName:He.ZodEffects,effect:t,...L(n)}),Pe.createWithPreprocess=(e,t,n)=>new Pe({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...L(n)});class Me extends D{_parse(e){return this._getType(e)===f.undefined?S(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:He.ZodOptional,...L(t)});class je extends D{_parse(e){return this._getType(e)===f.null?S(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:He.ZodNullable,...L(t)});class Ze extends D{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===f.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:He.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...L(t)});class Ue extends D{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return N(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new _(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new _(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ue.create=(e,t)=>new Ue({innerType:e,typeName:He.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...L(t)});class Ge extends D{_parse(e){if(this._getType(e)!==f.nan){const t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:f.nan,received:t.parsedType}),T}return{status:"valid",value:e.data}}}Ge.create=e=>new Ge({typeName:He.ZodNaN,...L(e)}),Symbol("zod_brand");class $e extends D{_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.type._parse({data:t.data,path:t.path,parent:t})}unwrap(){return this._def.type}}class ze extends D{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?T:"dirty"===e.status?(t.dirty(),k(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?T:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ze({in:e,out:t,typeName:He.ZodPipeline})}}class Fe extends D{_parse(e){const t=this._def.innerType._parse(e),n=e=>(C(e)&&(e.value=Object.freeze(e.value)),e);return N(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}var He;Fe.create=(e,t)=>new Fe({innerType:e,typeName:He.ZodReadonly,...L(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(He||(He={}));const qe=re.create,Be=se.create,We=de.create,Ke=me.create,Ve=ye.create,Ye=ve.create,Qe=be.create,Xe=xe.create,Je=Se.create,et=Ne.create,tt=Oe.create,nt=Me.create,at="2.0",rt=Qe([qe(),Be().int()]),it=qe(),st=Ye({progressToken:nt(rt)}).passthrough(),ot=Ye({_meta:nt(st)}).passthrough(),dt=Ye({method:qe(),params:nt(ot)}),ct=Ye({_meta:nt(Ye({}).passthrough())}).passthrough(),ut=Ye({method:qe(),params:nt(ct)}),lt=Ye({_meta:nt(Ye({}).passthrough())}).passthrough(),pt=Qe([qe(),Be().int()]),ht=Ye({jsonrpc:et(at),id:pt}).merge(dt).strict(),mt=Ye({jsonrpc:et(at)}).merge(ut).strict(),ft=Ye({jsonrpc:et(at),id:pt,result:lt}).strict();var gt;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(gt||(gt={}));const yt=Qe([ht,mt,ft,Ye({jsonrpc:et(at),id:pt,error:Ye({code:Be().int(),message:qe(),data:nt(Ke())})}).strict()]),_t=lt.strict(),vt=ut.extend({method:et("notifications/cancelled"),params:ct.extend({requestId:pt,reason:qe().optional()})}),bt=Ye({name:qe(),title:nt(qe())}).passthrough(),wt=bt.extend({version:qe()}),xt=Ye({experimental:nt(Ye({}).passthrough()),sampling:nt(Ye({}).passthrough()),elicitation:nt(Ye({}).passthrough()),roots:nt(Ye({listChanged:nt(We())}).passthrough())}).passthrough(),Et=dt.extend({method:et("initialize"),params:ot.extend({protocolVersion:qe(),capabilities:xt,clientInfo:wt})}),Tt=Ye({experimental:nt(Ye({}).passthrough()),logging:nt(Ye({}).passthrough()),completions:nt(Ye({}).passthrough()),prompts:nt(Ye({listChanged:nt(We())}).passthrough()),resources:nt(Ye({subscribe:nt(We()),listChanged:nt(We())}).passthrough()),tools:nt(Ye({listChanged:nt(We())}).passthrough())}).passthrough(),kt=lt.extend({protocolVersion:qe(),capabilities:Tt,serverInfo:wt,instructions:nt(qe())}),St=ut.extend({method:et("notifications/initialized")}),At=dt.extend({method:et("ping")}),Rt=Ye({progress:Be(),total:nt(Be()),message:nt(qe())}).passthrough(),Ct=ut.extend({method:et("notifications/progress"),params:ct.merge(Rt).extend({progressToken:rt})}),Nt=dt.extend({params:ot.extend({cursor:nt(it)}).optional()}),It=lt.extend({nextCursor:nt(it)}),Ot=Ye({uri:qe(),mimeType:nt(qe()),_meta:nt(Ye({}).passthrough())}).passthrough(),Lt=Ot.extend({text:qe()}),Dt=qe().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),Pt=Ot.extend({blob:Dt}),Mt=bt.extend({uri:qe(),description:nt(qe()),mimeType:nt(qe()),_meta:nt(Ye({}).passthrough())}),jt=bt.extend({uriTemplate:qe(),description:nt(qe()),mimeType:nt(qe()),_meta:nt(Ye({}).passthrough())}),Zt=Nt.extend({method:et("resources/list")}),Ut=It.extend({resources:Ve(Mt)}),Gt=Nt.extend({method:et("resources/templates/list")}),$t=It.extend({resourceTemplates:Ve(jt)}),zt=dt.extend({method:et("resources/read"),params:ot.extend({uri:qe()})}),Ft=lt.extend({contents:Ve(Qe([Lt,Pt]))}),Ht=ut.extend({method:et("notifications/resources/list_changed")}),qt=dt.extend({method:et("resources/subscribe"),params:ot.extend({uri:qe()})}),Bt=dt.extend({method:et("resources/unsubscribe"),params:ot.extend({uri:qe()})}),Wt=ut.extend({method:et("notifications/resources/updated"),params:ct.extend({uri:qe()})}),Kt=Ye({name:qe(),description:nt(qe()),required:nt(We())}).passthrough(),Vt=bt.extend({description:nt(qe()),arguments:nt(Ve(Kt)),_meta:nt(Ye({}).passthrough())}),Yt=Nt.extend({method:et("prompts/list")}),Qt=It.extend({prompts:Ve(Vt)}),Xt=dt.extend({method:et("prompts/get"),params:ot.extend({name:qe(),arguments:nt(Je(qe()))})}),Jt=Ye({type:et("text"),text:qe(),_meta:nt(Ye({}).passthrough())}).passthrough(),en=Ye({type:et("image"),data:Dt,mimeType:qe(),_meta:nt(Ye({}).passthrough())}).passthrough(),tn=Ye({type:et("audio"),data:Dt,mimeType:qe(),_meta:nt(Ye({}).passthrough())}).passthrough(),nn=Ye({type:et("resource"),resource:Qe([Lt,Pt]),_meta:nt(Ye({}).passthrough())}).passthrough(),an=Qe([Jt,en,tn,Mt.extend({type:et("resource_link")}),nn]),rn=Ye({role:tt(["user","assistant"]),content:an}).passthrough(),sn=lt.extend({description:nt(qe()),messages:Ve(rn)}),on=ut.extend({method:et("notifications/prompts/list_changed")}),dn=Ye({title:nt(qe()),readOnlyHint:nt(We()),destructiveHint:nt(We()),idempotentHint:nt(We()),openWorldHint:nt(We())}).passthrough(),cn=bt.extend({description:nt(qe()),inputSchema:Ye({type:et("object"),properties:nt(Ye({}).passthrough()),required:nt(Ve(qe()))}).passthrough(),outputSchema:nt(Ye({type:et("object"),properties:nt(Ye({}).passthrough()),required:nt(Ve(qe()))}).passthrough()),annotations:nt(dn),_meta:nt(Ye({}).passthrough())}),un=Nt.extend({method:et("tools/list")}),ln=It.extend({tools:Ve(cn)}),pn=lt.extend({content:Ve(an).default([]),structuredContent:Ye({}).passthrough().optional(),isError:nt(We())}),hn=(pn.or(lt.extend({toolResult:Ke()})),dt.extend({method:et("tools/call"),params:ot.extend({name:qe(),arguments:nt(Je(Ke()))})})),mn=ut.extend({method:et("notifications/tools/list_changed")}),fn=tt(["debug","info","notice","warning","error","critical","alert","emergency"]),gn=dt.extend({method:et("logging/setLevel"),params:ot.extend({level:fn})}),yn=ut.extend({method:et("notifications/message"),params:ct.extend({level:fn,logger:nt(qe()),data:Ke()})}),_n=Ye({name:qe().optional()}).passthrough(),vn=Ye({hints:nt(Ve(_n)),costPriority:nt(Be().min(0).max(1)),speedPriority:nt(Be().min(0).max(1)),intelligencePriority:nt(Be().min(0).max(1))}).passthrough(),bn=Ye({role:tt(["user","assistant"]),content:Qe([Jt,en,tn])}).passthrough(),wn=dt.extend({method:et("sampling/createMessage"),params:ot.extend({messages:Ve(bn),systemPrompt:nt(qe()),includeContext:nt(tt(["none","thisServer","allServers"])),temperature:nt(Be()),maxTokens:Be().int(),stopSequences:nt(Ve(qe())),metadata:nt(Ye({}).passthrough()),modelPreferences:nt(vn)})}),xn=lt.extend({model:qe(),stopReason:nt(tt(["endTurn","stopSequence","maxTokens"]).or(qe())),role:tt(["user","assistant"]),content:Xe("type",[Jt,en,tn])}),En=Qe([Ye({type:et("boolean"),title:nt(qe()),description:nt(qe()),default:nt(We())}).passthrough(),Ye({type:et("string"),title:nt(qe()),description:nt(qe()),minLength:nt(Be()),maxLength:nt(Be()),format:nt(tt(["email","uri","date","date-time"]))}).passthrough(),Ye({type:tt(["number","integer"]),title:nt(qe()),description:nt(qe()),minimum:nt(Be()),maximum:nt(Be())}).passthrough(),Ye({type:et("string"),title:nt(qe()),description:nt(qe()),enum:Ve(qe()),enumNames:nt(Ve(qe()))}).passthrough()]),Tn=dt.extend({method:et("elicitation/create"),params:ot.extend({message:qe(),requestedSchema:Ye({type:et("object"),properties:Je(qe(),En),required:nt(Ve(qe()))}).passthrough()})}),kn=lt.extend({action:tt(["accept","decline","cancel"]),content:nt(Je(qe(),Ke()))}),Sn=Ye({type:et("ref/resource"),uri:qe()}).passthrough(),An=Ye({type:et("ref/prompt"),name:qe()}).passthrough(),Rn=dt.extend({method:et("completion/complete"),params:ot.extend({ref:Qe([An,Sn]),argument:Ye({name:qe(),value:qe()}).passthrough(),context:nt(Ye({arguments:nt(Je(qe(),qe()))}))})}),Cn=lt.extend({completion:Ye({values:Ve(qe()).max(100),total:nt(Be().int()),hasMore:nt(We())}).passthrough()}),Nn=Ye({uri:qe().startsWith("file://"),name:nt(qe()),_meta:nt(Ye({}).passthrough())}).passthrough(),In=dt.extend({method:et("roots/list")}),On=lt.extend({roots:Ve(Nn)}),Ln=ut.extend({method:et("notifications/roots/list_changed")});Qe([At,Et,Rn,gn,Xt,Yt,Zt,Gt,zt,qt,Bt,hn,un]),Qe([vt,Ct,St,Ln]),Qe([_t,xn,kn,On]),Qe([At,wn,Tn,In]),Qe([vt,Ct,yn,Wt,Ht,mn,on]),Qe([_t,kt,Cn,sn,Qt,Ut,$t,Ft,pn,ln]),Error;class Dn{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(e,t){if(!e)throw new Error("MessagePort is required");this._port=e,this.sessionId=t||this.generateId(),this._port.onmessage=e=>{try{const t=yt.parse(e.data);this.onmessage?.(t)}catch(e){const t=new Error(`Failed to parse message: ${e}`);this.onerror?.(t)}},this._port.onmessageerror=e=>{const t=new Error(`MessagePort error: ${JSON.stringify(e)}`);this.onerror?.(t)}}static generateSessionId(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,10)}`}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(e){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((t,n)=>{try{this._port.postMessage(e),t()}catch(e){const a=e instanceof Error?e:new Error(String(e));this.onerror?.(a),n(a)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}generateId(){return Dn.generateSessionId()}}let Pn=null;const Mn=()=>(Pn&&document.contains(Pn)||(Pn=document.querySelector('iframe[src*="angie/"]')),Pn),jn=(e,t)=>{const n=Mn();if(!n?.contentWindow)return!1;const a=t||(()=>{const e=Mn();if(!e)return null;try{return new URL(e.src).origin}catch(e){return null}})();return!!a&&(n.contentWindow.postMessage(e,a),!0)};let Zn=!1;const Un=(e,t)=>{const n=document.getElementById("angie-sidebar-container");n&&n.setAttribute("aria-hidden",t?"false":"true"),t?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1")},Gn=(e,t)=>{e.postMessage({status:"success",payload:t})},$n=(e,t)=>{e.postMessage({status:"error",payload:t})};var zn;(zn||(zn={})).POST_MESSAGE="postMessage";const Fn={open:!1,iframe:null,iframeUrlObject:null};function Hn(){const e=new URL(window.location.href);e.searchParams.set("start-oauth","1"),window.location.href=e.toString()}var qn;!function(e){e.SDK_ANGIE_ALL_SERVERS_REGISTERED="sdk-angie-all-servers-registered",e.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",e.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",e.SDK_TRIGGER_ANGIE="sdk-trigger-angie",e.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response",e.ANGIE_SIDEBAR_RESIZED="angie-sidebar-resized",e.ANGIE_SIDEBAR_TOGGLED="angie-sidebar-toggled",e.ANGIE_CHAT_TOGGLE="angie-chat-toggle",e.ANGIE_STUDIO_TOGGLE="angie-studio-toggle",e.ANGIE_NAVIGATE_TO_URL="angie/navigate-to-url",e.ANGIE_PAGE_RELOAD="angie/page-reload"}(qn||(qn={}));class Bn{angieDetector;registrationQueue;clientManager;isInitialized=!1;instanceId;constructor(){this.instanceId=Math.random().toString(36).substring(2,8),this.angieDetector=new p,this.registrationQueue=new h,this.clientManager=new m,this.setupAngieReadyHandler(),this.setupServerInitHandler(),this.setupReRegistrationHandler()}async loadSidebar(e){!function(){if("undefined"==typeof document||Zn)return;const e="angie-sidebar-styles";if(document.getElementById(e))return void(Zn=!0);const t=document.createElement("style");t.id=e,t.textContent="/* Angie Sidebar - CSS Variables */\n:root {\n --angie-sidebar-z-index: 1200; /* below MUI popups, elementor popups and media library modal */\n --angie-sidebar-width: 330px;\n --angie-sidebar-transition: margin 0.3s ease-in-out, transform 0.3s ease-in-out;\n /* Direction-aware transform values for sidebar positioning */\n --angie-sidebar-hide-transform: translateX(-100%); /* LTR: hide to the left */\n --angie-sidebar-show-transform: translateX(0);\n}\n\n/* RTL-specific transform values */\n[dir=\"rtl\"] {\n --angie-sidebar-hide-transform: translateX(100%); /* RTL: hide to the right */\n}\n\n/* Respect user's motion preferences */\n@media (prefers-reduced-motion: reduce) {\n :root {\n --angie-sidebar-transition: none;\n }\n}\n\n/* Apply transitions only when user is actively toggling */\nbody.angie-sidebar-transitioning {\n transition: var(--angie-sidebar-transition) !important;\n}\n\nbody.angie-sidebar-transitioning #angie-sidebar-container {\n transition: var(--angie-sidebar-transition) !important;\n}\n\n/* LTR Layout (default) - Push content to the right */\n@media (min-width: 768px) {\n body.angie-sidebar-active {\n padding-inline-start: var(--angie-sidebar-width) !important;\n }\n\n body.angie-sidebar-active #angie-body-top-padding {\n width: 100%;\n height: 8px;\n }\n\n /* Push WordPress Admin Bar - LTR */\n body.angie-sidebar-active #wpadminbar {\n inset-inline-start: var(--angie-sidebar-width) !important;\n inset-inline-end: 8px !important;\n width: calc(100% - 8px - var(--angie-sidebar-width)) !important;\n margin-top: 8px;\n }\n\n /* Sidebar container - LTR */\n #angie-sidebar-container {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n width: var(--angie-sidebar-width);\n height: 100vh;\n z-index: var(--angie-sidebar-z-index) !important; /* below elementor popups and media library modal */\n background: #FCFCFC;\n transform: var(--angie-sidebar-hide-transform);\n outline: none;\n overflow: hidden;\n /* No default transition - only when transitioning */\n }\n\n /* Resize handle */\n #angie-sidebar-container::after {\n content: '';\n position: absolute;\n top: 0;\n inset-inline-end: 0;\n width: 4px;\n height: 100%;\n cursor: ew-resize;\n background: transparent;\n z-index: 1000001;\n }\n\n /* Pink border during resize */\n #angie-sidebar-container.angie-resizing {\n border-inline-end-color: #ff69b4 !important;\n border-inline-end-width: 2px !important;\n }\n\n /* Disable iframe pointer events during resize */\n #angie-sidebar-container.angie-resizing iframe#angie-iframe {\n pointer-events: none !important;\n }\n}\n\n/* Active states */\nbody.angie-sidebar-active #angie-sidebar-container {\n transform: var(--angie-sidebar-show-transform);\n}\n\n/* Studio mode - sidebar takes full width */\n@media (min-width: 768px) {\n html.angie-studio-active body.angie-sidebar-active #angie-sidebar-container {\n width: 100%;\n }\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n #angie-sidebar-container {\n border-color: #000;\n box-shadow: none;\n }\n}\n\n/* Screen reader only class */\n.angie-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Plugin conflict resolution */\nbody.angie-sidebar-active {\n /* Reset common conflicting styles */\n box-sizing: border-box !important;\n position: relative !important;\n}\n\n#angie-sidebar-toggle {\n z-index: 99999 !important;\n}\n";const n=document.head||document.getElementsByTagName("head")[0];n.insertBefore(t,n.firstChild),Zn=!0}(),"undefined"!=typeof window&&(window.toggleAngieSidebar=function(e,t){const n=document.body,a=document.getElementById("angie-sidebar-container");if(!a)return;const r=n.classList.contains("angie-sidebar-active"),i=void 0!==e?e:!r;t||(n.classList.add("angie-sidebar-transitioning"),setTimeout(function(){n.classList.remove("angie-sidebar-transitioning")},300)),i?n.classList.add("angie-sidebar-active"):n.classList.remove("angie-sidebar-active"),i&&setTimeout(function(){jn({type:"focusInput"})},t?0:300),function(e){try{localStorage.setItem("angie_sidebar_state",e)}catch(e){}}(i?"open":"closed");const s=new CustomEvent("angieSidebarToggle",{detail:{isOpen:i,sidebar:a,skipTransition:t}});document.dispatchEvent(s),jn({type:qn.ANGIE_SIDEBAR_TOGGLED,payload:{state:i?"opened":"closed"}})},window.addEventListener("message",function(e){if(e.data&&"toggleAngieSidebar"===e.data.type){const{force:t,skipTransition:n}=e.data.payload||{};window.toggleAngieSidebar&&window.toggleAngieSidebar(t,n)}})),await(async e=>{if(window.screen.availWidth<=768)return;let t=document.getElementById("angie-sidebar-container");if(!t&&(performance.now(),await new Promise(e=>{let n=0;const a=setInterval(()=>{t=document.getElementById("angie-sidebar-container"),n++,(t||n>20)&&(clearInterval(a),t&&e())},100);setTimeout(()=>{if(clearInterval(a),t)return void e();const n=new MutationObserver(()=>{t=document.getElementById("angie-sidebar-container"),t&&(n.disconnect(),e())});n.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{n.disconnect(),e()},8e3)},2e3)}),!t))return;const{iframe:n,iframeUrlObject:a}=await(async e=>{const t=e.origin,n=new URL(e.path,t),a=n.pathname.slice(1).replace(/\//,"--")+"-"+Math.random().toString(36).substring(7);return new Promise(r=>{const i=new URL(t);i.pathname=n.pathname;const s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(i.searchParams.append("colorScheme",e.uiTheme||s||"light"),i.searchParams.append("sdkVersion",e.sdkVersion),i.searchParams.append("instanceId",a),i.searchParams.append("origin",window.location.origin),e.isRTL&&i.searchParams.append("isRTL",e.isRTL?"true":"false"),"localhost"===window.location.hostname&&window.location.search.includes("debug_error")){const e=new URLSearchParams(window.location.search).get("debug_error");e&&i.searchParams.append("debug_error",e)}n.searchParams.forEach((e,t)=>{i.searchParams.set(t,e)}),i.searchParams.set("ver",(new Date).getTime().toString());const o=e.parent||document,d=o.createElement("iframe"),u={"background-color":"transparent","color-scheme":"normal",...e.css};window.addEventListener("message",async e=>{if(e.origin===i.origin)switch(e.data.type){case c.ANGIE_READY:r({iframe:d,iframeUrlObject:i});break;case c.ANGIE_LOADED:d.contentWindow?.postMessage({type:c.HOST_READY,instanceId:a},i.origin)}}),d.setAttribute("src",i.href),d.id="angie-iframe",d.setAttribute("frameborder","0"),d.setAttribute("scrolling","no"),d.setAttribute("style",Object.entries(u).map(([e,t])=>`${e}: ${t}`).join("; ")),d.setAttribute("allow","clipboard-write; clipboard-read"),e.insertCallback?e.insertCallback(d):o.body.appendChild(d)})})({origin:e.origin||"https://angie.elementor.com",path:"angie/wp-admin",insertCallback:e=>{e.setAttribute("title","Angie AI Assistant"),e.setAttribute("role","application"),e.setAttribute("aria-label","Angie AI Assistant Interface");const n=document.getElementById("angie-sidebar-loading");n&&(n.textContent=""),t?.appendChild(e),Un(e,!0),e.addEventListener("load",()=>{e.focus()})},css:{width:"100%",height:"100%",border:"none",outline:"none"},uiTheme:e.uiTheme,isRTL:e.isRTL,sdkVersion:"1.0.3"});Fn.iframe=n,Fn.iframeUrlObject=a,window.addEventListener("message",e=>{if(e.origin===Fn.iframeUrlObject?.origin)switch(e.data.type){case d.SET:window.localStorage.setItem(e.data.key,e.data.value);break;case d.GET:const t=e.ports[0],n=window.localStorage.getItem(e.data.key);t.postMessage({value:n})}}),(e=>{window.addEventListener("message",async t=>{if(t.origin===window.location.origin||t.origin===e.iframeUrlObject?.origin)switch(t?.data?.type){case qn.SDK_ANGIE_ALL_SERVERS_REGISTERED:break;case qn.SDK_ANGIE_READY_PING:Gn(t.ports[0],{message:"Angie is ready"});break;case qn.SDK_REQUEST_CLIENT_CREATION:const n=t.data.payload;try{const a=t.ports[0],r=new MessageChannel;r.port1.onmessage=e=>{a.postMessage({success:!0,data:e.data})};const i={type:qn.SDK_REQUEST_CLIENT_CREATION,payload:{success:!0,...n,clientId:`dynamic-client-${n.serverName}-${n.serverVersion}-${Date.now()}`,requestId:t.data.payload.requestId},timestamp:Date.now()};if(!e.iframe)throw new Error("Iframe not found");e.iframe.contentWindow?.postMessage(i,e.iframeUrlObject?.origin||"",[r.port2])}catch(e){}break;case qn.SDK_TRIGGER_ANGIE:try{const{requestId:n,prompt:a,context:r}=t.data.payload;if(!e.iframe)throw new Error("Iframe not found");e.iframe.contentWindow?.postMessage({type:qn.SDK_TRIGGER_ANGIE,payload:{requestId:n,prompt:a,context:r}},e.iframeUrlObject?.origin||""),window.postMessage({type:qn.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!0,requestId:n,response:"Angie triggered successfully"}},window.location.origin)}catch(e){window.postMessage({type:qn.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!1,requestId:t.data.payload?.requestId,error:e instanceof Error?e.message:"Unknown error"}},window.location.origin)}}})})(Fn),window.addEventListener("message",e=>{if(e.origin===Fn.iframeUrlObject?.origin)switch(e.data.type){case"OAUTH_GET_CODE_AND_STATE":(e=>{const t=new URLSearchParams(window.location.search),n=t.get("oauth_code"),a=t.get("oauth_state");if(n&&a)Gn(e,{code:n,state:a});else{const r=t.get("oauth_error");if(r){$n(e,{message:r,code:n||null,state:a||null});const t=new URL(window.location.href);t.searchParams.delete("oauth_error"),history.replaceState({},"",t.toString())}else Gn(e,{message:"No OAuth error found"})}})(e.ports[0]);break;case"OAUTH_GET_TOP_URL":Gn(e.ports[0],{topUrl:window.location.href});break;case"OAUTH_REDIRECT_TOP_WINDOW":window.location.href=e.data.payload.url;break;case"OAUTH_UPDATE_URL":!function(e,t){if(history?.replaceState)try{const n=window.location.href;history.replaceState({},"",e),function(e,t){const n=new URL(t),a=new URL(e),r=n.searchParams,i=a.searchParams,s=["oauth_code","oauth_state","start-oauth"];return s.some(e=>i?.has(e))&&!s.some(e=>r?.has(e))}(n,e)&&function(){try{localStorage.setItem("angie_sidebar_state","open")}catch(e){}setTimeout(()=>{window.toggleAngieSidebar(!0)},500)}(),Gn(t,{message:"URL updated successfully"})}catch(e){$n(t,{message:"URL update failed: "+(e instanceof Error?e.message:"Unknown error")})}else $n(t,{message:"URL update not supported in this browser"})}(e.data.payload.url,e.ports[0]);break;case"ANGIE_REDIRECT_TO_WP_ADMIN_WITH_OAUTH":Hn();break;case"ANGIE_REDIRECT_TO_AUTH_ORIGIN_LOGOUT":try{Hn()}catch(e){window.location.reload()}}}),window.addEventListener("message",async t=>{if([window.location.origin,e.origin||"https://angie.elementor.com"].includes(t.origin))if(t?.data?.type===qn.ANGIE_CHAT_TOGGLE)Fn.open=t.data.open,Fn.iframe&&Un(Fn.iframe,Fn.open);else if(t?.data?.type===qn.ANGIE_STUDIO_TOGGLE){if(!Fn.iframe)return;if(t.data.isStudioOpen)document.documentElement.classList.add("angie-studio-active");else{const e=function(){if("undefined"==typeof window)return 370;try{const e=window.localStorage.getItem("angie_sidebar_width");if(e){const t=parseInt(e,10);if(t>=350&&t<=590)return t}}catch(e){}return 370}();document.documentElement.style.setProperty("--angie-sidebar-width",`${e}px`),document.documentElement.classList.remove("angie-studio-active")}}else if(t?.data?.type===qn.ANGIE_NAVIGATE_TO_URL){const{url:e=""}=t.data;if(!((e,t=[])=>{const n=0===t.length&&"undefined"!=typeof window?[window.location.origin]:t;if(!e.startsWith("http"))return!1;try{const t=new URL(e);return n.includes(t.origin)}catch{return!1}})(e))throw new Error("Angie: Invalid URL - navigation blocked for security reasons");window.location.assign(e)}else t?.data?.type===qn.ANGIE_PAGE_RELOAD?window.location.reload():t?.data?.type===c.RESET_HASH&&(window.location.hash="",Gn(t.ports[0],{message:"Hash reset successfully"}))})})({origin:e?.origin||"https://angie.elementor.com",uiTheme:e?.uiTheme||"light",isRTL:e?.isRTL||!1,...e}),this.setupPromptHashDetection()}setupReRegistrationHandler(){window.addEventListener("message",e=>{e.data?.type===o.SDK_ANGIE_REFRESH_PING&&this.registrationQueue.resetAllToPending()&&(this.registrationQueue.getPending(),this.handleAngieReady())})}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(e=>{e.isReady&&this.handleAngieReady()}).catch(e=>{})}async handleAngieReady(){try{await this.registrationQueue.processQueue(async e=>{await this.processRegistration(e)}),this.isInitialized=!0}catch(a){}}async processRegistration(e){try{const t={...e,instanceId:this.instanceId};await this.clientManager.requestClientCreation(t)}catch(r){throw r}}registerLocalServer(e){return e.type=s.LOCAL,e.transport=r.POST_MESSAGE,this.registerServer(e)}registerRemoteServer(e){return e.type=s.REMOTE,this.registerServer(e)}isLocalServerConfig(e){return e.type===s.LOCAL||!e.type&&"server"in e}isRemoteServerConfig(e){return e.type===s.REMOTE&&"url"in e}async registerServer(e){if(!e.type)return void this.registerLocalServer(e);if(!e.name)throw new Error("Server name is required");if(!e.description)throw new Error("Server description is required");if(this.isLocalServerConfig(e)&&!e.server)throw new Error("Server instance is required for local servers");const t=this.registrationQueue.add(e);if(this.angieDetector.isReady())try{await this.processRegistration(t),this.registrationQueue.updateStatus(t.id,"registered")}catch(e){const n=e instanceof Error?e.message:String(e);throw this.registrationQueue.updateStatus(t.id,"failed",n),e}}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(e=>setTimeout(e,100))}async triggerAngie(e){if(!this.isAngieReady())throw new Error("Angie is not ready. Please wait for Angie to be available before triggering.");const t=this.generateRequestId(),n=e.options?.timeout||3e4;return new Promise((a,r)=>{const i=setTimeout(()=>{r(new Error("Angie trigger request timed out"))},n),s=e=>{e.data?.type===o.SDK_TRIGGER_ANGIE_RESPONSE&&e.data?.payload?.requestId===t&&(clearTimeout(i),window.removeEventListener("message",s),a(e.data.payload))};window.addEventListener("message",s);const d={type:o.SDK_TRIGGER_ANGIE,payload:{requestId:t,prompt:e.prompt,options:e.options,context:{pageUrl:window.location.href,pageTitle:document.title,...e.context}},timestamp:Date.now()};window.postMessage(d,window.location.origin)})}destroy(){this.registrationQueue.clear()}setupServerInitHandler(){window.addEventListener("message",e=>{e.data?.type===o.SDK_REQUEST_INIT_SERVER&&this.handleServerInitRequest(e)})}handleServerInitRequest(e){const{clientId:t,serverId:n,instanceId:a}=e.data.payload||{};if(t&&n)if(a&&a!==this.instanceId);else try{const t=this.registrationQueue.getAll().find(e=>e.id===n);if(!t)return;if("type"in t.config&&"remote"===t.config.type)return;const a=e.ports[0];if(!a)return;const r=t.config.server,i=new Dn(a);r.connect(i)}catch(e){}}generateRequestId(){return`${this.instanceId}-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}async handlePromptHash(){const e=window.location.hash;if(e.startsWith("#angie-prompt="))try{const t=e.replace("#angie-prompt=",""),n=decodeURIComponent(t);if(!n)return;await this.waitForReady(),await this.triggerAngie({prompt:n,context:{source:"hash-parameter",pageUrl:window.location.href,timestamp:(new Date).toISOString()}}),window.location.hash=""}catch(e){}}setupPromptHashDetection(){this.handlePromptHash(),window.addEventListener("hashchange",()=>this.handlePromptHash())}}},99418(e,t,n){n.d(t,{A:()=>ne});const{entries:a,setPrototypeOf:r,isFrozen:i,getPrototypeOf:s,getOwnPropertyDescriptor:o}=Object;let{freeze:d,seal:c,create:u}=Object,{apply:l,construct:p}="undefined"!==typeof Reflect&&Reflect;d||(d=function(e){return e}),c||(c=function(e){return e}),l||(l=function(e,t){for(var n=arguments.length,a=new Array(n>2?n-2:0),r=2;r<n;r++)a[r-2]=arguments[r];return e.apply(t,a)}),p||(p=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return new e(...n)});const h=R(Array.prototype.forEach),m=R(Array.prototype.lastIndexOf),f=R(Array.prototype.pop),g=R(Array.prototype.push),y=R(Array.prototype.splice),_=R(String.prototype.toLowerCase),v=R(String.prototype.toString),b=R(String.prototype.match),w=R(String.prototype.replace),x=R(String.prototype.indexOf),E=R(String.prototype.trim),T=R(Object.prototype.hasOwnProperty),k=R(RegExp.prototype.test),S=(A=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p(A,t)});var A;function R(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return l(e,t,a)}}function C(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_;r&&r(e,null);let a=t.length;for(;a--;){let r=t[a];if("string"===typeof r){const e=n(r);e!==r&&(i(t)||(t[a]=e),r=e)}e[r]=!0}return e}function N(e){for(let t=0;t<e.length;t++)T(e,t)||(e[t]=null);return e}function I(e){const t=u(null);for(const[n,r]of a(e))T(e,n)&&(t[n]=Array.isArray(r)?N(r):r&&"object"===typeof r&&r.constructor===Object?I(r):r);return t}function O(e,t){for(;null!==e;){const n=o(e,t);if(n){if(n.get)return R(n.get);if("function"===typeof n.value)return R(n.value)}e=s(e)}return function(){return null}}const L=d(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),D=d(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),M=d(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),j=d(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Z=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=d(["#text"]),G=d(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),$=d(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),z=d(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),F=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=c(/\{\{[\w\W]*|[\w\W]*\}\}/gm),q=c(/<%[\w\W]*|[\w\W]*%>/gm),B=c(/\$\{[\w\W]*/gm),W=c(/^data-[\-\w.\u00B7-\uFFFF]+$/),K=c(/^aria-[\-\w]+$/),V=c(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Y=c(/^(?:\w+script|data):/i),Q=c(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X=c(/^html$/i),J=c(/^[a-z][.\w]*(-[.\w]+)+$/i);var ee=Object.freeze({__proto__:null,ARIA_ATTR:K,ATTR_WHITESPACE:Q,CUSTOM_ELEMENT:J,DATA_ATTR:W,DOCTYPE_NAME:X,ERB_EXPR:q,IS_ALLOWED_URI:V,IS_SCRIPT_OR_DATA:Y,MUSTACHE_EXPR:H,TMPLIT_EXPR:B});const te=function(){return"undefined"===typeof window?null:window};var ne=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te();const n=t=>e(t);if(n.version="3.3.1",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const i=r,s=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:c,Node:l,Element:p,NodeFilter:A,NamedNodeMap:R=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:N,DOMParser:H,trustedTypes:q}=t,B=p.prototype,W=O(B,"cloneNode"),K=O(B,"remove"),Y=O(B,"nextSibling"),Q=O(B,"childNodes"),J=O(B,"parentNode");if("function"===typeof c){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ne,ae="";const{implementation:re,createNodeIterator:ie,createDocumentFragment:se,getElementsByTagName:oe}=r,{importNode:de}=i;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"===typeof a&&"function"===typeof J&&re&&void 0!==re.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:le,TMPLIT_EXPR:pe,DATA_ATTR:he,ARIA_ATTR:me,IS_SCRIPT_OR_DATA:fe,ATTR_WHITESPACE:ge,CUSTOM_ELEMENT:ye}=ee;let{IS_ALLOWED_URI:_e}=ee,ve=null;const be=C({},[...L,...D,...P,...j,...U]);let we=null;const xe=C({},[...G,...$,...z,...F]);let Ee=Object.seal(u(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,ke=null;const Se=Object.seal(u(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ae=!0,Re=!0,Ce=!1,Ne=!0,Ie=!1,Oe=!0,Le=!1,De=!1,Pe=!1,Me=!1,je=!1,Ze=!1,Ue=!0,Ge=!1,$e=!0,ze=!1,Fe={},He=null;const qe=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Be=null;const We=C({},["audio","video","img","source","image","track"]);let Ke=null;const Ve=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",Xe="http://www.w3.org/1999/xhtml";let Je=Xe,et=!1,tt=null;const nt=C({},[Ye,Qe,Xe],v);let at=C({},["mi","mo","mn","ms","mtext"]),rt=C({},["annotation-xml"]);const it=C({},["title","style","font","a","script"]);let st=null;const ot=["application/xhtml+xml","text/html"];let dt=null,ct=null;const ut=r.createElement("form"),lt=function(e){return e instanceof RegExp||e instanceof Function},pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"===typeof e||(e={}),e=I(e),st=-1===ot.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,dt="application/xhtml+xml"===st?v:_,ve=T(e,"ALLOWED_TAGS")?C({},e.ALLOWED_TAGS,dt):be,we=T(e,"ALLOWED_ATTR")?C({},e.ALLOWED_ATTR,dt):xe,tt=T(e,"ALLOWED_NAMESPACES")?C({},e.ALLOWED_NAMESPACES,v):nt,Ke=T(e,"ADD_URI_SAFE_ATTR")?C(I(Ve),e.ADD_URI_SAFE_ATTR,dt):Ve,Be=T(e,"ADD_DATA_URI_TAGS")?C(I(We),e.ADD_DATA_URI_TAGS,dt):We,He=T(e,"FORBID_CONTENTS")?C({},e.FORBID_CONTENTS,dt):qe,Te=T(e,"FORBID_TAGS")?C({},e.FORBID_TAGS,dt):I({}),ke=T(e,"FORBID_ATTR")?C({},e.FORBID_ATTR,dt):I({}),Fe=!!T(e,"USE_PROFILES")&&e.USE_PROFILES,Ae=!1!==e.ALLOW_ARIA_ATTR,Re=!1!==e.ALLOW_DATA_ATTR,Ce=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ne=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Ie=e.SAFE_FOR_TEMPLATES||!1,Oe=!1!==e.SAFE_FOR_XML,Le=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,je=e.RETURN_DOM_FRAGMENT||!1,Ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Ue=!1!==e.SANITIZE_DOM,Ge=e.SANITIZE_NAMED_PROPS||!1,$e=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,_e=e.ALLOWED_URI_REGEXP||V,Je=e.NAMESPACE||Xe,at=e.MATHML_TEXT_INTEGRATION_POINTS||at,rt=e.HTML_INTEGRATION_POINTS||rt,Ee=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&<(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Ee.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&<(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Ee.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"===typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Ee.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ie&&(Re=!1),je&&(Me=!0),Fe&&(ve=C({},U),we=[],!0===Fe.html&&(C(ve,L),C(we,G)),!0===Fe.svg&&(C(ve,D),C(we,$),C(we,F)),!0===Fe.svgFilters&&(C(ve,P),C(we,$),C(we,F)),!0===Fe.mathMl&&(C(ve,j),C(we,z),C(we,F))),e.ADD_TAGS&&("function"===typeof e.ADD_TAGS?Se.tagCheck=e.ADD_TAGS:(ve===be&&(ve=I(ve)),C(ve,e.ADD_TAGS,dt))),e.ADD_ATTR&&("function"===typeof e.ADD_ATTR?Se.attributeCheck=e.ADD_ATTR:(we===xe&&(we=I(we)),C(we,e.ADD_ATTR,dt))),e.ADD_URI_SAFE_ATTR&&C(Ke,e.ADD_URI_SAFE_ATTR,dt),e.FORBID_CONTENTS&&(He===qe&&(He=I(He)),C(He,e.FORBID_CONTENTS,dt)),e.ADD_FORBID_CONTENTS&&(He===qe&&(He=I(He)),C(He,e.ADD_FORBID_CONTENTS,dt)),$e&&(ve["#text"]=!0),Le&&C(ve,["html","head","body"]),ve.table&&(C(ve,["tbody"]),delete Te.tbody),e.TRUSTED_TYPES_POLICY){if("function"!==typeof e.TRUSTED_TYPES_POLICY.createHTML)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!==typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw S('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ne=e.TRUSTED_TYPES_POLICY,ae=ne.createHTML("")}else void 0===ne&&(ne=function(e,t){if("object"!==typeof e||"function"!==typeof e.createPolicy)return null;let n=null;const a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(n=t.getAttribute(a));const r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch(i){return null}}(q,s)),null!==ne&&"string"===typeof ae&&(ae=ne.createHTML(""));d&&d(e),ct=e}},ht=C({},[...D,...P,...M]),mt=C({},[...j,...Z]),ft=function(e){g(n.removed,{element:e});try{J(e).removeChild(e)}catch(t){K(e)}},gt=function(e,t){try{g(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(a){g(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(Me||je)try{ft(t)}catch(a){}else try{t.setAttribute(e,"")}catch(a){}},yt=function(e){let t=null,n=null;if(Pe)e="<remove></remove>"+e;else{const t=b(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===st&&Je===Xe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const a=ne?ne.createHTML(e):e;if(Je===Xe)try{t=(new H).parseFromString(a,st)}catch(s){}if(!t||!t.documentElement){t=re.createDocument(Je,"template",null);try{t.documentElement.innerHTML=et?ae:a}catch(s){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Je===Xe?oe.call(t,Le?"html":"body")[0]:Le?t.documentElement:i},_t=function(e){return ie.call(e.ownerDocument||e,e,A.SHOW_ELEMENT|A.SHOW_COMMENT|A.SHOW_TEXT|A.SHOW_PROCESSING_INSTRUCTION|A.SHOW_CDATA_SECTION,null)},vt=function(e){return e instanceof N&&("string"!==typeof e.nodeName||"string"!==typeof e.textContent||"function"!==typeof e.removeChild||!(e.attributes instanceof R)||"function"!==typeof e.removeAttribute||"function"!==typeof e.setAttribute||"string"!==typeof e.namespaceURI||"function"!==typeof e.insertBefore||"function"!==typeof e.hasChildNodes)},bt=function(e){return"function"===typeof l&&e instanceof l};function wt(e,t,a){h(e,e=>{e.call(n,t,a,ct)})}const xt=function(e){let t=null;if(wt(ce.beforeSanitizeElements,e,null),vt(e))return ft(e),!0;const a=dt(e.nodeName);if(wt(ce.uponSanitizeElement,e,{tagName:a,allowedTags:ve}),Oe&&e.hasChildNodes()&&!bt(e.firstElementChild)&&k(/<[/\w!]/g,e.innerHTML)&&k(/<[/\w!]/g,e.textContent))return ft(e),!0;if(7===e.nodeType)return ft(e),!0;if(Oe&&8===e.nodeType&&k(/<[/\w]/g,e.data))return ft(e),!0;if(!(Se.tagCheck instanceof Function&&Se.tagCheck(a))&&(!ve[a]||Te[a])){if(!Te[a]&&Tt(a)){if(Ee.tagNameCheck instanceof RegExp&&k(Ee.tagNameCheck,a))return!1;if(Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(a))return!1}if($e&&!He[a]){const t=J(e)||e.parentNode,n=Q(e)||e.childNodes;if(n&&t)for(let a=n.length-1;a>=0;--a){const r=W(n[a],!0);r.__removalCount=(e.__removalCount||0)+1,t.insertBefore(r,Y(e))}}return ft(e),!0}return e instanceof p&&!function(e){let t=J(e);t&&t.tagName||(t={namespaceURI:Je,tagName:"template"});const n=_(e.tagName),a=_(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===Xe?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===a||at[a]):Boolean(ht[n]):e.namespaceURI===Ye?t.namespaceURI===Xe?"math"===n:t.namespaceURI===Qe?"math"===n&&rt[a]:Boolean(mt[n]):e.namespaceURI===Xe?!(t.namespaceURI===Qe&&!rt[a])&&!(t.namespaceURI===Ye&&!at[a])&&!mt[n]&&(it[n]||!ht[n]):!("application/xhtml+xml"!==st||!tt[e.namespaceURI]))}(e)?(ft(e),!0):"noscript"!==a&&"noembed"!==a&&"noframes"!==a||!k(/<\/no(script|embed|frames)/i,e.innerHTML)?(Ie&&3===e.nodeType&&(t=e.textContent,h([ue,le,pe],e=>{t=w(t,e," ")}),e.textContent!==t&&(g(n.removed,{element:e.cloneNode()}),e.textContent=t)),wt(ce.afterSanitizeElements,e,null),!1):(ft(e),!0)},Et=function(e,t,n){if(Ue&&("id"===t||"name"===t)&&(n in r||n in ut))return!1;if(Re&&!ke[t]&&k(he,t));else if(Ae&&k(me,t));else if(Se.attributeCheck instanceof Function&&Se.attributeCheck(t,e));else if(!we[t]||ke[t]){if(!(Tt(e)&&(Ee.tagNameCheck instanceof RegExp&&k(Ee.tagNameCheck,e)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(e))&&(Ee.attributeNameCheck instanceof RegExp&&k(Ee.attributeNameCheck,t)||Ee.attributeNameCheck instanceof Function&&Ee.attributeNameCheck(t,e))||"is"===t&&Ee.allowCustomizedBuiltInElements&&(Ee.tagNameCheck instanceof RegExp&&k(Ee.tagNameCheck,n)||Ee.tagNameCheck instanceof Function&&Ee.tagNameCheck(n))))return!1}else if(Ke[t]);else if(k(_e,w(n,ge,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==x(n,"data:")||!Be[e])if(Ce&&!k(fe,w(n,ge,"")));else if(n)return!1;return!0},Tt=function(e){return"annotation-xml"!==e&&b(e,ye)},kt=function(e){wt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||vt(e))return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let r=t.length;for(;r--;){const s=t[r],{name:o,namespaceURI:d,value:c}=s,u=dt(o),l=c;let p="value"===o?l:E(l);if(a.attrName=u,a.attrValue=p,a.keepAttr=!0,a.forceKeepAttr=void 0,wt(ce.uponSanitizeAttribute,e,a),p=a.attrValue,!Ge||"id"!==u&&"name"!==u||(gt(o,e),p="user-content-"+p),Oe&&k(/((--!?|])>)|<\/(style|title|textarea)/i,p)){gt(o,e);continue}if("attributename"===u&&b(p,"href")){gt(o,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){gt(o,e);continue}if(!Ne&&k(/\/>/i,p)){gt(o,e);continue}Ie&&h([ue,le,pe],e=>{p=w(p,e," ")});const m=dt(e.nodeName);if(Et(m,u,p)){if(ne&&"object"===typeof q&&"function"===typeof q.getAttributeType)if(d);else switch(q.getAttributeType(m,u)){case"TrustedHTML":p=ne.createHTML(p);break;case"TrustedScriptURL":p=ne.createScriptURL(p)}if(p!==l)try{d?e.setAttributeNS(d,o,p):e.setAttribute(o,p),vt(e)?ft(e):f(n.removed)}catch(i){gt(o,e)}}else gt(o,e)}wt(ce.afterSanitizeAttributes,e,null)},St=function e(t){let n=null;const a=_t(t);for(wt(ce.beforeSanitizeShadowDOM,t,null);n=a.nextNode();)wt(ce.uponSanitizeShadowNode,n,null),xt(n),kt(n),n.content instanceof o&&e(n.content);wt(ce.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=null,r=null,s=null,d=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!==typeof e&&!bt(e)){if("function"!==typeof e.toString)throw S("toString is not a function");if("string"!==typeof(e=e.toString()))throw S("dirty is not a string, aborting")}if(!n.isSupported)return e;if(De||pt(t),n.removed=[],"string"===typeof e&&(ze=!1),ze){if(e.nodeName){const t=dt(e.nodeName);if(!ve[t]||Te[t])throw S("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)a=yt("\x3c!----\x3e"),r=a.ownerDocument.importNode(e,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?a=r:a.appendChild(r);else{if(!Me&&!Ie&&!Le&&-1===e.indexOf("<"))return ne&&Ze?ne.createHTML(e):e;if(a=yt(e),!a)return Me?null:Ze?ae:""}a&&Pe&&ft(a.firstChild);const c=_t(ze?e:a);for(;s=c.nextNode();)xt(s),kt(s),s.content instanceof o&&St(s.content);if(ze)return e;if(Me){if(je)for(d=se.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return(we.shadowroot||we.shadowrootmode)&&(d=de.call(i,d,!0)),d}let u=Le?a.outerHTML:a.innerHTML;return Le&&ve["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&k(X,a.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+a.ownerDocument.doctype.name+">\n"+u),Ie&&h([ue,le,pe],e=>{u=w(u,e," ")}),ne&&Ze?ne.createHTML(u):u},n.setConfig=function(){pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),De=!0},n.clearConfig=function(){ct=null,De=!1},n.isValidAttribute=function(e,t,n){ct||pt({});const a=dt(e),r=dt(t);return Et(a,r,n)},n.addHook=function(e,t){"function"===typeof t&&g(ce[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=m(ce[e],t);return-1===n?void 0:y(ce[e],n,1)[0]}return f(ce[e])},n.removeHooks=function(e){ce[e]=[]},n.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}()}}]);
Save
Back