Files
static-php-cli/assets/chunks/esm.CJCpmpiJ.js
2026-07-16 06:25:16 +00:00

103 lines
407 KiB
JavaScript

function e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function n(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function r(e){return function(){var t=this,r=arguments;return new Promise(function(i,a){var o=e.apply(t,r);function s(e){n(o,i,a,s,c,`next`,e)}function c(e){n(o,i,a,s,c,`throw`,e)}s(void 0)})}}function i(e,n,r){return n=u(n),function(e,n){if(n&&(typeof n==`object`||typeof n==`function`))return n;if(n!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return t(e)}(e,f()?Reflect.construct(n,r||[],u(e).constructor):n.apply(e,r))}function a(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,x(r.key),r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=C(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function l(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(f=function(){return!!e})()}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function m(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?p(Object(n),!0).forEach(function(t){l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function h(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function g(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return _(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(_(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,_(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,_(d,`constructor`,l),_(l,`constructor`,c),c.displayName=`GeneratorFunction`,_(l,i,`GeneratorFunction`),_(d),_(d,i,`Generator`),_(d,r,function(){return this}),_(d,`toString`,function(){return`[object Generator]`}),(g=function(){return{w:a,m:f}})()}function _(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}_=function(e,t,n,r){function a(t,n){_(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},_(e,t,n,r)}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||C(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function b(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(t)||C(t)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function x(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:t+``}function S(e){return S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},S(e)}function C(t,n){if(t){if(typeof t==`string`)return e(t,n);var r={}.toString.call(t).slice(8,-1);return r===`Object`&&t.constructor&&(r=t.constructor.name),r===`Map`||r===`Set`?Array.from(t):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function w(e){var t=typeof Map==`function`?new Map:void 0;return w=function(e){if(e===null||!function(e){try{return Function.toString.call(e).indexOf(`[native code]`)!==-1}catch{return typeof e==`function`}}(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(f())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&v(i,n.prototype),i}(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),v(n,e)},w(e)}var T,ee,E,te,ne,re,ie,ae,oe,se,ce,D={},le=[],ue=Array.isArray,de=le.slice,fe=Object.assign;function pe(e){e&&e.parentNode&&e.remove()}function me(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?de.call(arguments,2):n),he(e,o,r,i,null)}function he(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ee,__i:-1,__u:0};return i==null&&T.vnode!=null&&T.vnode(a),a}function ge(){return{current:null}}function _e(e){return e.children}function ve(e,t){this.props=e,this.context=t,this.__g=0}function ye(e,t){if(t==null)return e.__?ye(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?ye(e):null}function be(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return be(e)}}function xe(e){(8&e.__g||!(e.__g|=8)||!E.push(e)||ne++)&&te==T.debounceRendering||((te=T.debounceRendering)||queueMicrotask)(Se)}function Se(){for(var e,t,n,r,i,a,o,s,c=1;E.length;)E.length>c&&E.sort(re),e=E.shift(),c=E.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=fe({},r)).__v=r.__v+1,T.vnode&&T.vnode(n),Ae(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??ye(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Me(a,n,o),n.__e!=i&&be(n)));ne=0}function Ce(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||le,b=t.length;for(c=function(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?he(null,o,null,null,null):ue(o)?he(_e,{children:o},null,null,null):o.constructor==null&&o.__b>0?he(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Ee(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=ye(s)),Fe(s,s));return r}(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?D:y[m.__i]||D,m.__i=f,_=Ae(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Pe(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=we(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function we(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=we(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=ye(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Te(e,t){return t||=[],e==null||typeof e==`boolean`||(ue(e)?e.some(function(e){Te(e,t)}):t.push(e)),t}function Ee(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function De(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Oe(e,t,n,r,i){var a;e:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||De(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||De(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(ie,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=ae,e.addEventListener(t,a?se:oe,a)):e.removeEventListener(t,a?se:oe,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break e}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ke(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=ae++;else if(t.u<n.l)return;return n(T.event?T.event(t):t)}}}function Ae(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,ee,E,te,ne,re,ie,ae,oe=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=T.__b)&&d(t);e:if(typeof oe==`function`)try{if(v=t.props,y=`prototype`in oe&&oe.prototype.render,b=(d=oe.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new oe(v,x):(t.__c=f=new ve(v,x),f.constructor=oe,f.render=Ie),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&oe.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=fe({},f.__s)),fe(f.__s,oe.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&oe.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&oe.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=T.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),ee=0;ee<f._sb.length;ee++)f.__h.push(f._sb[ee]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=fe({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===_e&&d.key==null&&(E=Ne(d.props.children)),s=Ce(e,ue(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(te=0,ne=!1,t.__u|=c?160:128,t.__c.__z=[],re=0;re<a.length;re++)(ie=a[re])==null||ne||(ie.nodeType==8&&ie.data==`$s`?(te>0&&t.__c.__z.push(ie),te++,a[re]=null):ie.nodeType==8&&ie.data==`/$s`?(--te>0&&t.__c.__z.push(ie),ne=te===0,s=a[re],a[re]=null):te>0&&(t.__c.__z.push(ie),a[re]=null));if(!ne){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ae=a.length;ae--;)pe(a[ae]);je(t)}else t.__e=n.__e,t.__k=n.__k,e.then||je(t);T.__e(e,t,n)}else s=t.__e=function(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(T.__m&&T.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=de.call(e.childNodes),v=n.props||D,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Oe(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Oe(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Ce(b==`template`?e.content:e,ue(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&ye(n,0),s,c,l),a!=null)for(u=a.length;u--;)pe(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Oe(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Oe(e,u,g,v[u],i))}return e}(n.__e,t,n,r,i,a,o,c,l,u);return(d=T.diffed)&&d(t),128&t.__u?void 0:s}function je(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(je)}function Me(e,t,n){for(var r=0;r<n.length;r++)Pe(n[r],n[++r],n[++r]);T.__c&&T.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){T.__e(e,t.__v)}})}function Ne(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:ue(e)?e.map(Ne):fe({},e)}function Pe(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){T.__e(e,n)}}function Fe(e,t,n){var r,i;if(T.unmount&&T.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Pe(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){T.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Fe(r[i],t,n||typeof e.type!=`function`);n||pe(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Ie(e,t,n){return this.constructor(e,n)}function Le(e,t){var n,r,i,a;t==document&&(t=document.documentElement),T.__&&T.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=me(_e,null,[e]),i=[],a=[],Ae(t,e,r||D,D,t.namespaceURI,r?null:t.firstChild?de.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Me(i,e,a)}function Re(e,t,n){var r,i,a,o=fe({},e.props);for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e.type!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?de.call(arguments,2):n),he(e.type,o,r||e.key,i||e.ref,null)}T={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw ne=0,e}},ee=0,ve.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=fe({},this.state);typeof e==`function`&&(e=e(fe({},n),this.props)),e&&fe(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),xe(this))},ve.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),xe(this))},ve.prototype.render=_e,E=[],ne=0,re=function(e,t){return e.__v.__b-t.__v.__b},ie=/(PointerCapture)$|Capture$/i,ae=0,oe=ke(!1),se=ke(!0),ce=0;var ze,Be,Ve,He,Ue=Object.is,We=0,Ge=[],Ke=T,qe=Ke.__b,Je=Ke.__r,Ye=Ke.diffed,Xe=Ke.__c,Ze=Ke.unmount,Qe=Ke.__;function $e(e,t){Ke.__h&&Ke.__h(Be,e,We||t),We=0;var n=Be.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function et(e){return We=1,tt(_t,e)}function tt(e,t,n){var r=$e(ze++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):_t(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);Ue(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Be,!Be.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,Ue(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};Be.__f=!0;var a=Be.shouldComponentUpdate,o=Be.componentWillUpdate;Be.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},Be.shouldComponentUpdate=i}return r.__N||r.__}function nt(e,t){var n=$e(ze++,3);!Ke.__s&&gt(n.__H,t)&&(n.__=e,n.u=t,Be.__H.__h.push(n))}function rt(e,t){var n=$e(ze++,4);!Ke.__s&&gt(n.__H,t)&&(n.__=e,n.u=t,Be.__h.push(n))}function it(e){return We=5,ot(function(){return{current:e}},[])}function at(e,t,n){We=6,rt(function(){if(typeof e==`function`){var n=e(t());return function(){e(null),n&&typeof n==`function`&&n()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function ot(e,t){var n=$e(ze++,7);return gt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function st(e,t){return We=8,ot(function(){return e},t)}function ct(e){var t=Be.context[e.__c],n=$e(ze++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(Be)),t.props.value):e.__}function lt(e,t){Ke.useDebugValue&&Ke.useDebugValue(t?t(e):e)}function ut(){var e=$e(ze++,11);if(!e.__){for(var t=Be.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||=[0,0];e.__=`P`+n[0]+`-`+n[1]++}return e.__}function dt(){for(var e;e=Ge.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(mt),e.__H.__h.forEach(ht),e.__H.__h=[]}catch(t){e.__H.__h=[],Ke.__e(t,e.__v)}}Ke.__b=function(e){Be=null,qe&&qe(e)},Ke.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Qe&&Qe(e,t)},Ke.__r=function(e){Je&&Je(e),ze=0;var t=(Be=e.__c).__H;t&&(Ve===Be?(t.__h=[],Be.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(mt),t.__h.forEach(ht),t.__h=[],ze=0)),Ve=Be},Ke.diffed=function(e){Ye&&Ye(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ge.push(t)!==1&&He===Ke.requestAnimationFrame||((He=Ke.requestAnimationFrame)||pt)(dt)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Ve=Be=null},Ke.__c=function(e,t){t.some(function(e){try{e.__h.forEach(mt),e.__h=e.__h.filter(function(e){return!e.__||ht(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Ke.__e(n,e.__v)}}),Xe&&Xe(e,t)},Ke.unmount=function(e){Ze&&Ze(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{mt(e)}catch(e){t=e}}),n.__H=void 0,t&&Ke.__e(t,n.__v))};var ft=typeof requestAnimationFrame==`function`;function pt(e){var t,n=function(){clearTimeout(r),ft&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ft&&(t=requestAnimationFrame(n))}function mt(e){var t=Be,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),Be=t}function ht(e){var t=Be;e.__c=e.__(),Be=t}function gt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!Ue(t,e[n])})}function _t(e,t){return typeof t==`function`?t(e):t}function vt(e,t){var n=t(),r=et({t:{__:n,u:t}}),i=r[0].t,a=r[1];return rt(function(){i.__=n,i.u=t,yt(i)&&a({t:i})},[e,n,t]),nt(function(){return yt(i)&&a({t:i}),e(function(){yt(i)&&a({t:i})})},[e]),n}function yt(e){var t=e.u,n=e.__;try{var r=t();return!Object.is(n,r)}catch{return!0}}function bt(e){e()}function xt(e){return e}function St(){return[!1,bt]}var Ct=rt,wt=Object.assign;function Tt(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}var Et=/^(-|f[lo].*[^se]$|g.{5,}[^ps]$|z|o[pr]|(W.{5})?[lL]i.*(t|mp)$|an|(bo|s).{4}Im|sca|m.{6}[ds]|ta|c.*[st]$|wido|ini)/;function Dt(e,t){this.props=e,this.context=t}function Ot(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Tt(this.props,e)}function r(t){return this.shouldComponentUpdate=n,me(e,t)}return r.displayName=`Memo(`+(e.displayName||e.name)+`)`,r.prototype.isReactComponent=!0,r.type=e,r}(Dt.prototype=new ve).isPureReactComponent=!0,Dt.prototype.shouldComponentUpdate=function(e,t){return Tt(this.props,e)||Tt(this.state,t)};var kt=Symbol.for(`react.forward_ref`),At=function(e,t,n){return e==null?null:Te(Te(e).map(t.bind(n)))},jt={map:At,forEach:At,count:function(e){return e?Te(e).length:0},only:function(e){var t=Te(e);if(t.length!==1)throw`Children.only`;return t[0]},toArray:Te},Mt=T.__e;T.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}Mt(e,t,n,r)};var Nt=T.unmount;function Pt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=wt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__g|=4,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Pt(e,t,n)})),e}function Ft(e,t,n){return e&&n&&(typeof e.type==`string`&&(e.__u|=1),e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ft(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__g|=4,e.__c.__P=n)),e}function It(){this.__u=0,this.o=null,this.__b=null}function Lt(e){return this.getChildContext=function(){return e.context},e.children}function Rt(e){var t=this,n=e.i;if(t.componentWillUnmount=function(){Le(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),!t.l){for(var r=t.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},ownerDocument:n.ownerDocument,insertBefore:function(e,n){this.childNodes.push(e),t.i.insertBefore(e,n)}}}Le(me(Lt,{context:t.context},e.__v),t.l)}function zt(e,t){var n=me(Rt,{__v:e,i:t});return n.containerInfo=t,n}T.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),Nt&&Nt(e)},(It.prototype=new ve).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=!1,a=function(){i||(i=!0,n.__R=null,o())};n.__R=a;var o=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Ft(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},It.prototype.componentWillUnmount=function(){this.o=[]},It.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=Pt(this.__b,n,r.__O=r.__P)}this.__b=null}return[me(_e,null,t.__a?null:e.children),t.__a&&me(_e,null,e.fallback)]};var Bt=Symbol.for(`react.element`),Vt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ht=/[A-Z0-9]/g,Ut=typeof document<`u`,Wt=function(e){return/fil|che|rad/.test(e)};function Gt(e,t,n){return t.__k??(t.textContent=``),Le(e,t),typeof n==`function`&&n(),e?e.__c:null}ve.prototype.isReactComponent={},[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(ve.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Kt=T.event;function qt(){}function Jt(){return this.cancelBubble}function Yt(){return this.defaultPrevented}T.event=function(e){return Kt&&(e=Kt(e)),e.persist=qt,e.isPropagationStopped=Jt,e.isDefaultPrevented=Yt,e.nativeEvent=e};var Xt,Zt={enumerable:!1,configurable:!0,get:function(){return this.class}},Qt=T.vnode;T.vnode=function(e){if(typeof e.type==`string`)(function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)===-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Ut&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){if(a===`style`&&typeof o==`object`)for(var s in o)typeof o[s]!=`number`||Et.test(s)||(o[s]+=`px`);else if(a===`defaultValue`&&`value`in t&&t.value==null)a=`value`;else if(a===`download`&&!0===o)o=``;else if(a===`translate`&&o===`no`)o=!1;else if(a[0]===`o`&&a[1]===`n`){var c=a.toLowerCase();c===`ondoubleclick`?a=`ondblclick`:c!==`onchange`||n!==`input`&&n!==`textarea`||Wt(t.type)?c===`onfocus`?a=`onfocusin`:c===`onblur`&&(a=`onfocusout`):c=a=`oninput`,c===`oninput`&&r[a=c]&&(a=`oninputCapture`)}else i&&Vt.test(a)?a=a.replace(Ht,`-$&`).toLowerCase():o===null&&(o=void 0);r[a]=o}}n==`select`&&r.multiple&&Array.isArray(r.value)&&(r.value=Te(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),n==`select`&&r.defaultValue!=null&&(r.value=Te(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",Zt)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r})(e);else if(typeof e.type==`function`&&(`ref`in e.props&&`prototype`in e.type&&e.type.prototype.render&&(e.ref=e.props.ref,delete e.props.ref),e.type.defaultProps)){var t=wt({},e.props);for(var n in e.type.defaultProps)t[n]===void 0&&(t[n]=e.type.defaultProps[n]);e.props=t}e.$$typeof=Bt,Qt&&Qt(e)};var $t=T.__r;T.__r=function(e){$t&&$t(e),Xt=e.__c};var en=T.diffed;T.diffed=function(e){en&&en(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value),Xt=null};var tn={ReactCurrentDispatcher:{current:{readContext:function(e){return Xt.__n[e.__c].props.value},useCallback:st,useContext:ct,useDebugValue:lt,useDeferredValue:xt,useEffect:nt,useId:ut,useImperativeHandle:at,useInsertionEffect:Ct,useLayoutEffect:rt,useMemo:ot,useReducer:tt,useRef:it,useState:et,useSyncExternalStore:vt,useTransition:St}}};function nn(e){return!!e&&e.$$typeof===Bt}function rn(e){return!!e.__k&&(Le(null,e),!0)}var O={useState:et,useId:ut,useReducer:tt,useEffect:nt,useLayoutEffect:rt,useInsertionEffect:Ct,useTransition:St,useDeferredValue:xt,useSyncExternalStore:vt,startTransition:bt,useRef:it,useImperativeHandle:at,useMemo:ot,useCallback:st,useContext:ct,useDebugValue:lt,version:`18.3.1`,Children:jt,render:Gt,hydrate:function(e,t,n){return function(e,t){e.__u|=32,Le(e,t)}(e,t),typeof n==`function`&&n(),e?e.__c:null},unmountComponentAtNode:rn,createPortal:zt,createElement:me,createContext:function(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__g|=4,xe(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ce++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t},createFactory:function(e){return me.bind(null,e)},cloneElement:function(e){return nn(e)?Re.apply(null,arguments):e},createRef:ge,Fragment:_e,isValidElement:nn,isElement:nn,isFragment:function(e){return nn(e)&&e.type===_e},isMemo:function(e){return!!e&&!!e.displayName&&(typeof e.displayName==`string`||e.displayName instanceof String)&&e.displayName.startsWith(`Memo(`)},findDOMNode:function(e){return e&&(e.__v&&e.__v.__e||e.nodeType===1&&e)||null},Component:ve,PureComponent:Dt,memo:Ot,forwardRef:function(e){function t(t){var n=wt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=kt,t.render=e,t.prototype.isReactComponent=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t},flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:_e,Suspense:It,lazy:function(e){var t,n,r;function i(i){if(t||(t=e()).then(function(e){n=e.default||e},function(e){r=e}),r)throw r;if(!n)throw t;return me(n,i)}return i.displayName=`Lazy`,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:tn};function an(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function on(e,t,n){return(t=function(e){var t=function(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return S(t)==`symbol`?t:t+``}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?sn(Object(n),!0).forEach(function(t){on(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ln(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if(typeof e==`string`)return an(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?an(e,t):void 0}}(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var un={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function dn(e){return cn(cn({},un),e)}function fn(e){var t=e.isOpen,n=e.isAskAiActive,r=e.onAskAiToggle,i=e.onClose,a=e.onOpen,o=e.keyboardShortcuts,s=o===void 0?un:o;O.useEffect(function(){function e(e){if(t&&e.code===`Escape`&&n)r(!1);else{var o=s[`Ctrl/Cmd+K`]&&e.key?.toLowerCase()===`k`&&(e.metaKey||e.ctrlKey),c=s[`/`]&&e.key===`/`;(e.code===`Escape`&&t||o||!function(e){var t=e.composedPath()[0],n=t.tagName;return t.isContentEditable||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`}(e)&&c&&!t)&&(e.preventDefault(),t?i():document.body.classList.contains(`DocSearch--active`)||a())}}return window.addEventListener(`keydown`,e),function(){window.removeEventListener(`keydown`,e)}},[t,n,s,a,i,r])}var pn=[`children`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],mn=O.createContext(void 0);mn.displayName=`DocSearchContext`;var hn=O.forwardRef(function(e,t){var n=e.children,r=e.theme,i=e.onReady,a=e.onOpen,o=e.onClose,s=e.onSidepanelOpen,c=e.onSidepanelClose,l=function(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,pn),u=ln(O.useState(`ready`),2),d=u[0],f=u[1],p=ln(O.useState(l.initialQuery||``),2),m=p[0],h=p[1],g=O.useRef(null),_=dn(l.keyboardShortcuts),v=ln(O.useState(),2),y=v[0],b=v[1],x=ln(O.useState(function(){return new Set}),2),S=x[0],C=x[1],w=function(){var e=ln(O.useState(!1),2),t=e[0],n=e[1];return O.useEffect(function(){var e=function(){n(window.matchMedia(`(max-width: 768px)`).matches)};return e(),window.addEventListener(`resize`,e),function(){window.removeEventListener(`resize`,e)}},[]),t}(),T=O.useRef(`ready`),ee=[`modal-search`,`modal-askai`].includes(d),E=d===`modal-askai`,te=!w&&S.has(`sidepanel`),ne=d===`sidepanel`;O.useEffect(function(){i?.()},[i]),O.useEffect(function(){var e=T.current,t=d;t!==`modal-search`&&t!==`modal-askai`||e===`modal-search`||e===`modal-askai`||a==null||a(),t!==`ready`||e!==`modal-search`&&e!==`modal-askai`||o==null||o(),t===`sidepanel`&&e!==`sidepanel`&&s?.(),t!==`sidepanel`&&e===`sidepanel`&&c?.(),T.current=t},[d,a,o,s,c]);var re=O.useCallback(function(){f(`modal-search`)},[]),ie=O.useCallback(function(){var e;f(`ready`),(e=g.current)==null||e.focus(),h(l.initialQuery??``)},[f,l.initialQuery]),ae=O.useCallback(function(e,t){if(!w&&e&&te)return b(t),void f(`sidepanel`);f(e?`modal-askai`:`modal-search`)},[f,w,te]),oe=O.useCallback(function(e){S.has(`sidepanel`)&&(b(e),f(`sidepanel`))},[f,S]);O.useCallback(function(e){f(`modal-search`),h(e.key)},[f,h]);var se=O.useCallback(function(){b(void 0)},[]),ce=O.useCallback(function(e){S.has(e)||C(function(t){var n=new Set(t);return n.add(e),n})},[S]);O.useImperativeHandle(t,function(){return{open:re,close:ie,openAskAi:function(e){return ae(!0,e)},openSidepanel:oe,get isReady(){return!0},get isOpen(){return ee},get isSidepanelOpen(){return ne},get isSidepanelSupported(){return te}}},[re,ie,ae,oe,ee,ne,te]),function(e){var t=e.theme;nt(function(){if(t){var e=document.documentElement.dataset.theme;if(t!==e)return document.documentElement.dataset.theme=t,function(){e===void 0?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=e}}},[t])}({theme:r}),fn({isOpen:ee,onOpen:re,onClose:ie,onAskAiToggle:ae,isAskAiActive:E,keyboardShortcuts:_});var D=O.useMemo(function(){return{docsearchState:d,setDocsearchState:f,searchButtonRef:g,initialQuery:m,keyboardShortcuts:_,openModal:re,closeModal:ie,isAskAiActive:E,isModalActive:ee,onAskAiToggle:ae,initialAskAiMessage:y,clearInitialAskAiMessage:se,registerView:ce,isHybridModeSupported:te}},[d,g,m,_,re,ie,E,ee,ae,y,se,ce,te]);return O.createElement(mn.Provider,{value:D},n)});hn.displayName=`DocSearch`;var gn=[`type`],_n=[`type`],vn=[`additionalProperties`],yn=[`abortSignal`],bn=[`messageId`],xn=[`messages`],Sn=[`experimental_throttle`,`resume`];function Cn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function wn(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){wn(a,r,i,o,s,`next`,e)}function s(e){wn(a,r,i,o,s,`throw`,e)}o(void 0)})}}function A(e,t,n){return t=On(t),function(e,t){if(t&&(S(t)==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return function(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}(e)}(e,kn()?Reflect.construct(t,n||[],On(e).constructor):t.apply(e,n))}function j(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Tn(e,t,n){if(kn())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&Nn(i,n.prototype),i}function En(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Pn(r.key),r)}}function M(e,t,n){return t&&En(e.prototype,t),n&&En(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function N(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=In(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function P(e,t,n){return(t=Pn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dn(){return Dn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dn.apply(null,arguments)}function On(e){return On=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},On(e)}function F(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nn(e,t)}function kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kn=function(){return!!e})()}function An(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?An(Object(n),!0).forEach(function(t){P(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jn(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function L(){var e,t,n=typeof Symbol==`function`?Symbol:{},r=n.iterator||`@@iterator`,i=n.toStringTag||`@@toStringTag`;function a(n,r,i,a){var c=r&&r.prototype instanceof s?r:s,l=Object.create(c.prototype);return Mn(l,`_invoke`,function(n,r,i){var a,s,c,l=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return a=t,s=0,c=e,f.n=n,o}};function p(n,r){for(s=n,c=r,t=0;!d&&l&&!i&&t<u.length;t++){var i,a=u[t],p=f.p,m=a[2];n>3?(i=m===r)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=p&&((i=n<2&&p<a[1])?(s=0,f.v=r,f.n=a[1]):p<m&&(i=n<3||a[0]>r||r>m)&&(a[4]=n,a[5]=r,f.n=m,s=0))}if(i||n>1)return o;throw d=!0,r}return function(i,u,m){if(l>1)throw TypeError(`Generator is already running`);for(d&&u===1&&p(u,m),s=u,c=m;(t=s<2?e:c)||!d;){a||(s?s<3?(s>1&&(f.n=-1),p(s,c)):f.n=c:f.v=c);try{if(l=2,a){if(s||(i=`next`),t=a[i]){if(!(t=t.call(a,c)))throw TypeError(`iterator result is not an object`);if(!t.done)return t;c=t.value,s<2&&(s=0)}else s===1&&(t=a.return)&&t.call(a),s<2&&(c=TypeError(`The iterator does not provide a '`+i+`' method`),s=1);a=e}else if((t=(d=f.n<0)?c:n.call(r,f))!==o)break}catch(t){a=e,s=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,i,a),!0),l}var o={};function s(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Mn(t={},r,function(){return this}),t),d=l.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Mn(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,Mn(d,`constructor`,l),Mn(l,`constructor`,c),c.displayName=`GeneratorFunction`,Mn(l,i,`GeneratorFunction`),Mn(d),Mn(d,i,`Generator`),Mn(d,r,function(){return this}),Mn(d,`toString`,function(){return`[object Generator]`}),(L=function(){return{w:a,m:f}})()}function Mn(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}Mn=function(e,t,n,r){function a(t,n){Mn(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a(`next`,0),a(`throw`,1),a(`return`,2))},Mn(e,t,n,r)}function Nn(e,t){return Nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nn(e,t)}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||In(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(e){return function(e){if(Array.isArray(e))return Cn(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||In(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Pn(e){var t=function(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return S(t)==`symbol`?t:t+``}function Fn(e){return Fn=typeof Symbol==`function`&&S(Symbol.iterator)==`symbol`?function(e){return S(e)}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:S(e)},Fn(e)}function In(e,t){if(e){if(typeof e==`string`)return Cn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cn(e,t):void 0}}function Ln(e){var t=typeof Map==`function`?new Map:void 0;return Ln=function(e){if(e===null||!function(e){try{return Function.toString.call(e).indexOf(`[native code]`)!==-1}catch{return typeof e==`function`}}(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return Tn(e,arguments,On(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Nn(n,e)},Ln(e)}function Rn(){Rn=function(e,t){return new n(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function n(e,r,i){var a=RegExp(e,r);return t.set(a,i||t.get(e)),Nn(a,n.prototype)}function r(e,n){var r=t.get(n);return Object.keys(r).reduce(function(t,n){var i=r[n];if(typeof i==`number`)t[n]=e[i];else{for(var a=0;e[i[a]]===void 0&&a+1<i.length;)a++;t[n]=e[i[a]]}return t},Object.create(null))}return F(n,RegExp),n.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=r(n,this);var i=n.indices;i&&(i.groups=r(i,this))}return n},n.prototype[Symbol.replace]=function(n,i){if(typeof i==`string`){var a=t.get(this);return e[Symbol.replace].call(this,n,i.replace(/\$<([^>]+)(>|$)/g,function(e,t,n){if(n===``)return e;var r=a[t];return Array.isArray(r)?`$`+r.join(`$`):typeof r==`number`?`$`+r:``}))}if(typeof i==`function`){var o=this;return e[Symbol.replace].call(this,n,function(){var e=arguments;return S(e[e.length-1])!=`object`&&(e=[].slice.call(e)).push(r(e,o)),i.apply(this,e)})}return e[Symbol.replace].call(this,n,i)},Rn.apply(this,arguments)}function zn(e){var t=e.translations,n=(t===void 0?{}:t).poweredByText,r=n===void 0?`Powered by`:n;return O.createElement(`a`,{href:`https://www.algolia.com/ref/docsearch/?utm_source=${window.location.hostname}&utm_medium=referral&utm_content=powered_by&utm_campaign=docsearch`,target:`_blank`,rel:`noopener noreferrer`},O.createElement(`span`,{className:`DocSearch-Label`},r),O.createElement(`svg`,{width:`80`,height:`24`,"aria-label":`Algolia`,role:`img`,id:`Layer_1`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 2196.2 500`},O.createElement(`defs`,null,O.createElement(`style`,null,`.cls-1,.cls-2{fill:#003dff;}.cls-2{fill-rule:evenodd;}`)),O.createElement(`path`,{className:`cls-2`,d:`M1070.38,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z`}),O.createElement(`rect`,{className:`cls-1`,x:`1845.88`,y:`104.73`,width:`62.58`,height:`277.9`,rx:`5.9`,ry:`5.9`}),O.createElement(`path`,{className:`cls-2`,d:`M1851.78,71.38h50.77c3.26,0,5.9-2.64,5.9-5.9V5.9c0-3.62-3.24-6.39-6.82-5.83l-50.77,7.95c-2.87,.45-4.99,2.92-4.99,5.83v51.62c0,3.26,2.64,5.9,5.9,5.9Z`}),O.createElement(`path`,{className:`cls-2`,d:`M1764.03,275.3V5.91c0-3.63-3.24-6.39-6.82-5.83l-50.46,7.94c-2.87,.45-4.99,2.93-4.99,5.84l.17,273.22c0,12.92,0,92.7,95.97,95.49,3.33,.1,6.09-2.58,6.09-5.91v-40.78c0-2.96-2.19-5.51-5.12-5.84-34.85-4.01-34.85-47.57-34.85-54.72Z`}),O.createElement(`path`,{className:`cls-2`,d:`M1631.95,142.72c-11.14-12.25-24.83-21.65-40.78-28.31-15.92-6.53-33.26-9.85-52.07-9.85-18.78,0-36.15,3.17-51.92,9.85-15.59,6.66-29.29,16.05-40.76,28.31-11.47,12.23-20.38,26.87-26.76,44.03-6.38,17.17-9.24,37.37-9.24,58.36,0,20.99,3.19,36.87,9.55,54.21,6.38,17.32,15.14,32.11,26.45,44.36,11.29,12.23,24.83,21.62,40.6,28.46,15.77,6.83,40.12,10.33,52.4,10.48,12.25,0,36.78-3.82,52.7-10.48,15.92-6.68,29.46-16.23,40.78-28.46,11.29-12.25,20.05-27.04,26.25-44.36,6.22-17.34,9.24-33.22,9.24-54.21,0-20.99-3.34-41.19-10.03-58.36-6.38-17.17-15.14-31.8-26.43-44.03Zm-44.43,163.75c-11.47,15.75-27.56,23.7-48.09,23.7-20.55,0-36.63-7.8-48.1-23.7-11.47-15.75-17.21-34.01-17.21-61.2,0-26.89,5.59-49.14,17.06-64.87,11.45-15.75,27.54-23.52,48.07-23.52,20.55,0,36.63,7.78,48.09,23.52,11.47,15.57,17.36,37.98,17.36,64.87,0,27.19-5.72,45.3-17.19,61.2Z`}),O.createElement(`path`,{className:`cls-2`,d:`M894.42,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z`}),O.createElement(`path`,{className:`cls-2`,d:`M2133.97,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-14.52,22.58-22.99,49.63-22.99,78.73,0,44.89,20.13,84.92,51.59,111.1,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47,1.23,0,2.46-.03,3.68-.09,.36-.02,.71-.05,1.07-.07,.87-.05,1.75-.11,2.62-.2,.34-.03,.68-.08,1.02-.12,.91-.1,1.82-.21,2.73-.34,.21-.03,.42-.07,.63-.1,32.89-5.07,61.56-30.82,70.9-62.81v57.83c0,3.26,2.64,5.9,5.9,5.9h50.42c3.26,0,5.9-2.64,5.9-5.9V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,206.92c-12.2,10.16-27.97,13.98-44.84,15.12-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-42.24,0-77.12-35.89-77.12-79.37,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33v142.83Z`}),O.createElement(`path`,{className:`cls-2`,d:`M1314.05,104.73h-49.33c-48.36,0-90.91,25.48-115.75,64.1-11.79,18.34-19.6,39.64-22.11,62.59-.58,5.3-.88,10.68-.88,16.14s.31,11.15,.93,16.59c4.28,38.09,23.14,71.61,50.66,94.52,2.93,2.6,6.05,4.98,9.31,7.14,12.86,8.49,28.11,13.47,44.52,13.47h0c17.99,0,34.61-5.93,48.16-15.97,16.29-11.58,28.88-28.54,34.48-47.75v50.26h-.11v11.08c0,21.84-5.71,38.27-17.34,49.36-11.61,11.08-31.04,16.63-58.25,16.63-11.12,0-28.79-.59-46.6-2.41-2.83-.29-5.46,1.5-6.27,4.22l-12.78,43.11c-1.02,3.46,1.27,7.02,4.83,7.53,21.52,3.08,42.52,4.68,54.65,4.68,48.91,0,85.16-10.75,108.89-32.21,21.48-19.41,33.15-48.89,35.2-88.52V110.63c0-3.26-2.64-5.9-5.9-5.9h-56.32Zm0,64.1s.65,139.13,0,143.36c-12.08,9.77-27.11,13.59-43.49,14.7-.16,.01-.33,.03-.49,.04-1.12,.07-2.24,.1-3.36,.1-1.32,0-2.63-.03-3.94-.1-40.41-2.11-74.52-37.26-74.52-79.38,0-10.25,1.96-20.01,5.42-28.98,11.22-29.12,38.77-49.74,71.06-49.74h49.33Z`}),O.createElement(`path`,{className:`cls-1`,d:`M249.83,0C113.3,0,2,110.09,.03,246.16c-2,138.19,110.12,252.7,248.33,253.5,42.68,.25,83.79-10.19,120.3-30.03,3.56-1.93,4.11-6.83,1.08-9.51l-23.38-20.72c-4.75-4.21-11.51-5.4-17.36-2.92-25.48,10.84-53.17,16.38-81.71,16.03-111.68-1.37-201.91-94.29-200.13-205.96,1.76-110.26,92-199.41,202.67-199.41h202.69V407.41l-115-102.18c-3.72-3.31-9.42-2.66-12.42,1.31-18.46,24.44-48.53,39.64-81.93,37.34-46.33-3.2-83.87-40.5-87.34-86.81-4.15-55.24,39.63-101.52,94-101.52,49.18,0,89.68,37.85,93.91,85.95,.38,4.28,2.31,8.27,5.52,11.12l29.95,26.55c3.4,3.01,8.79,1.17,9.63-3.3,2.16-11.55,2.92-23.58,2.07-35.92-4.82-70.34-61.8-126.93-132.17-131.26-80.68-4.97-148.13,58.14-150.27,137.25-2.09,77.1,61.08,143.56,138.19,145.26,32.19,.71,62.03-9.41,86.14-26.95l150.26,133.2c6.44,5.71,16.61,1.14,16.61-7.47V9.48C499.66,4.25,495.42,0,490.18,0H249.83Z`})))}var Bn,Vn=`vercel.ai.error`,Hn=Symbol.for(Vn),Un=function(){function e(t){var n,r=t.name,o=t.message,s=t.cause;return a(this,e),(n=i(this,e,[o]))[Bn]=!0,n.name=r,n.cause=s,n}return d(e,w(Error)),s(e,null,[{key:`isInstance`,value:function(t){return e.hasMarker(t,Vn)}},{key:`hasMarker`,value:function(e,t){var n=Symbol.for(t);return e!=null&&S(e)==`object`&&n in e&&typeof e[n]==`boolean`&&!0===e[n]}}])}();Bn=Hn;var Wn=Un;function Gn(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.message:JSON.stringify(e)}var Kn,qn=`AI_InvalidArgumentError`,Jn=`vercel.ai.error.${qn}`,Yn=Symbol.for(Jn),Xn=function(){function e(t){var n,r=t.message,o=t.cause,s=t.argument;return a(this,e),(n=i(this,e,[{name:qn,message:r,cause:o}]))[Kn]=!0,n.argument=s,n}return d(e,Wn),s(e,null,[{key:`isInstance`,value:function(e){return Wn.hasMarker(e,Jn)}}])}();Kn=Yn;var Zn,Qn=`AI_JSONParseError`,$n=`vercel.ai.error.${Qn}`,er=Symbol.for($n),tr=function(){function e(t){var n,r=t.text,o=t.cause;return a(this,e),(n=i(this,e,[{name:Qn,message:`JSON parsing failed: Text: ${r}.
Error message: ${Gn(o)}`,cause:o}]))[Zn]=!0,n.text=r,n}return d(e,Wn),s(e,null,[{key:`isInstance`,value:function(e){return Wn.hasMarker(e,$n)}}])}();Zn=er;var nr,rr=`AI_TypeValidationError`,ir=`vercel.ai.error.${rr}`;nr=Symbol.for(ir);var ar=function(){function e(t){var n,r=t.value,o=t.cause;return a(this,e),(n=i(this,e,[{name:rr,message:`Type validation failed: Value: ${JSON.stringify(r)}.
Error message: ${Gn(o)}`,cause:o}]))[nr]=!0,n.value=r,n}return d(e,Wn),s(e,null,[{key:`isInstance`,value:function(e){return Wn.hasMarker(e,ir)}},{key:`wrap`,value:function(t){var n=t.value,r=t.cause;return e.isInstance(r)&&r.value===n?r:new e({value:n,cause:r})}}])}(),or=function(){function e(t,n){var r;return j(this,e),(r=A(this,e,[t])).name=`ParseError`,r.type=n.type,r.field=n.field,r.value=n.value,r.line=n.line,r}return F(e,Ln(Error)),M(e)}();function sr(e){}var cr=function(){function e(){var t,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=n.onError,i=n.onRetry,a=n.onComment;return j(this,e),A(this,e,[{start:function(e){t=function(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");var t,n=e.onEvent,r=n===void 0?sr:n,i=e.onError,a=i===void 0?sr:i,o=e.onRetry,s=o===void 0?sr:o,c=e.onComment,l=``,u=!0,d=``,f=``;function p(e){if(e===``)return d.length>0&&r({id:t,event:f||void 0,data:d.endsWith(`
`)?d.slice(0,-1):d}),t=void 0,d=``,void(f=``);if(e.startsWith(`:`))c&&c(e.slice(e.startsWith(`: `)?2:1));else{var n=e.indexOf(`:`);if(n===-1)m(e,``,e);else{var i=e.slice(0,n),a=e[n+1]===` `?2:1;m(i,e.slice(n+a),e)}}}function m(e,n,r){switch(e){case`event`:f=n;break;case`data`:d=`${d}${n}
`;break;case`id`:t=n.includes(`\0`)?void 0:n;break;case`retry`:/^\d+$/.test(n)?s(parseInt(n,10)):a(new or(`Invalid \`retry\` value: "${n}"`,{type:`invalid-retry`,value:n,line:r}));break;default:a(new or(`Unknown field "${e.length>20?`${e.slice(0,20)}`:e}"`,{type:`unknown-field`,field:e,value:n,line:r}))}}return{feed:function(e){var t,n=u?e.replace(/^\xEF\xBB\xBF/,``):e,r=R(function(e){for(var t=[],n=``,r=0;r<e.length;){var i=e.indexOf(`\r`,r),a=e.indexOf(`
`,r),o=-1;if(i!==-1&&a!==-1?o=Math.min(i,a):i===-1?a!==-1&&(o=a):o=i===e.length-1?-1:i,o===-1){n=e.slice(r);break}var s=e.slice(r,o);t.push(s),e[(r=o+1)-1]===`\r`&&e[r]===`
`&&r++}return[t,n]}(`${l}${n}`),2),i=r[0],a=r[1],o=N(i);try{for(o.s();!(t=o.n()).done;)p(t.value)}catch(e){o.e(e)}finally{o.f()}l=a,u=!1},reset:function(){l&&(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).consume&&p(l),u=!0,t=void 0,d=``,f=``,l=``}}}({onEvent:function(t){e.enqueue(t)},onError:function(t){r===`terminate`?e.error(t):typeof r==`function`&&r(t)},onRetry:i,onComment:a})},transform:function(e){t.feed(e)}}])}return F(e,Ln(TransformStream)),M(e)}();function B(e,t,n){function r(n,r){var i;for(var o in Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),a.prototype)o in n||Object.defineProperty(n,o,{value:a.prototype[o].bind(n)});n._zod.constr=a,n._zod.def=r}var i=function(e){function t(){return j(this,t),A(this,t,arguments)}return F(t,e),M(t)}(n?.Parent??Object);function a(e){var t,a=n!=null&&n.Parent?new i:this;r(a,e),(t=a._zod).deferred??(t.deferred=[]);var o,s=N(a._zod.deferred);try{for(s.s();!(o=s.n()).done;)(0,o.value)()}catch(e){s.e(e)}finally{s.f()}return a}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:function(t){var r;return!!(n!=null&&n.Parent&&t instanceof n.Parent)||(t==null||(r=t._zod)==null||(r=r.traits)==null?void 0:r.has(e))}}),Object.defineProperty(a,"name",{value:e}),a}var lr=function(){function e(){return j(this,e),A(this,e,[`Encountered Promise during synchronous parse. Use .parseAsync() instead.`])}return F(e,Ln(Error)),M(e)}(),ur=function(){function e(t){var n;return j(this,e),(n=A(this,e,[`Encountered unidirectional transform during encode: ${t}`])).name=`ZodEncodeError`,n}return F(e,Ln(Error)),M(e)}(),dr={};function fr(e){return dr}function pr(e){var t=Object.values(e).filter(function(e){return typeof e==`number`});return Object.entries(e).filter(function(e){var n=R(e,2),r=n[0];return n[1],t.indexOf(+r)===-1}).map(function(e){var t=R(e,2);return t[0],t[1]})}function mr(e,t){return typeof t==`bigint`?t.toString():t}function hr(e){return{get value(){var t=e();return Object.defineProperty(this,"value",{value:t}),t}}}function gr(e){return e==null}function _r(e){var t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var vr=Symbol(`evaluating`);function V(e,t,n){var r=void 0;Object.defineProperty(e,t,{get:function(){if(r!==vr)return r===void 0&&(r=vr,r=n()),r},set:function(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function br(){for(var e={},t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i],s=Object.getOwnPropertyDescriptors(o);Object.assign(e,s)}return Object.defineProperties({},e)}function xr(e){return JSON.stringify(e)}var Sr=`captureStackTrace`in Error?Error.captureStackTrace:function(){};function Cr(e){return Fn(e)===`object`&&e!==null&&!Array.isArray(e)}var wr=hr(function(){var e;if(typeof navigator<`u`&&(e=navigator)!=null&&(e=e.userAgent)!=null&&e.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Tr(e){if(!1===Cr(e))return!1;var t=e.constructor;if(t===void 0)return!0;var n=t.prototype;return!1!==Cr(n)&&!1!==Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)}function Er(e){return Tr(e)?I({},e):Array.isArray(e)?z(e):e}var Dr=new Set([`string`,`number`,`symbol`]);function Or(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function kr(e,t,n){var r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function H(e){var t=e;if(!t)return{};if(typeof t==`string`)return{error:function(){return t}};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?I(I({},t),{},{error:function(){return t.error}}):t}var Ar={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function jr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!0===e.aborted)return!0;for(var n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function Mr(e,t){return t.map(function(t){var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Nr(e){return typeof e==`string`?e:e?.message}function Pr(e,t,n){var r=I(I({},e),{},{path:e.path??[]});if(!e.message){var i,a,o;r.message=Nr((i=e.inst)==null||(i=i._zod.def)==null||(a=i.error)==null?void 0:a.call(i,e))??Nr(t==null||(o=t.error)==null?void 0:o.call(t,e))??Nr(n.customError?.call(n,e))??Nr(n.localeError?.call(n,e))??`Invalid input`}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Fr(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Ir(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Lr(){var e=[...arguments],t=e[0],n=e[1],r=e[2];return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:I({},t)}var Rr=function(e,t){e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,mr,2),Object.defineProperty(e,"toString",{value:function(){return e.message},enumerable:!1})},zr=B(`$ZodError`,Rr),Br=B(`$ZodError`,Rr,{Parent:Error}),Vr=function(e){return function(t,n,r,i){var a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new lr;if(o.issues.length){var s=new((i?.Err)??e)(o.issues.map(function(e){return Pr(e,a,fr())}));throw Sr(s,i?.callee),s}return o.value}},Hr=function(e){return function(){var t=k(L().m(function t(n,r,i,a){var o,s,c;return L().w(function(t){for(;;)switch(t.n){case 0:if(o=i?Object.assign(i,{async:!0}):{async:!0},!((s=n._zod.run({value:r,issues:[]},o))instanceof Promise)){t.n=2;break}return t.n=1,s;case 1:s=t.v;case 2:if(!s.issues.length){t.n=3;break}throw c=new((a?.Err)??e)(s.issues.map(function(e){return Pr(e,o,fr())})),Sr(c,a?.callee),c;case 3:return t.a(2,s.value)}},t)}));return function(e,n,r,i){return t.apply(this,arguments)}}()},Ur=function(e){return function(t,n,r){var i=r?I(I({},r),{},{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new lr;return a.issues.length?{success:!1,error:new(e??zr)(a.issues.map(function(e){return Pr(e,i,fr())}))}:{success:!0,data:a.value}}},Wr=Ur(Br),Gr=function(e){return function(){var t=k(L().m(function t(n,r,i){var a,o;return L().w(function(t){for(;;)switch(t.n){case 0:if(a=i?Object.assign(i,{async:!0}):{async:!0},!((o=n._zod.run({value:r,issues:[]},a))instanceof Promise)){t.n=2;break}return t.n=1,o;case 1:o=t.v;case 2:return t.a(2,o.issues.length?{success:!1,error:new e(o.issues.map(function(e){return Pr(e,a,fr())}))}:{success:!0,data:o.value})}},t)}));return function(e,n,r){return t.apply(this,arguments)}}()},Kr=Gr(Br),qr=/^[cC][^\s-]{8,}$/,Jr=/^[0-9a-z]+$/,Yr=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Xr=/^[0-9a-vA-V]{20}$/,Zr=/^[A-Za-z0-9]{27}$/,Qr=/^[a-zA-Z0-9_-]{21}$/,$r=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ei=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ti=function(e){return e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})\$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/},ni=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ri=/^(?:(?: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])$/,ii=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ai=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,oi=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,si=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ci=/^[A-Za-z0-9_-]*$/,li=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ui=/^\+(?:[0-9]){6,14}[0-9]$/,di=`(?:(?:\\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])))`,fi=RegExp(`^${di}\$`);function pi(e){var t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}var mi=/^-?\d+$/,hi=/^-?\d+(?:\.\d+)?/,gi=/^(?:true|false)$/i,_i=/^null$/i,vi=/^[^A-Z]*$/,yi=/^[^a-z]*$/,bi=B(`$ZodCheck`,function(e,t){var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),xi={number:`number`,bigint:`bigint`,object:`date`},Si=B(`$ZodCheckLessThan`,function(e,t){bi.init(e,t);var n=xi[Fn(t.value)];e._zod.onattach.push(function(e){var n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ci=B(`$ZodCheckGreaterThan`,function(e,t){bi.init(e,t);var n=xi[Fn(t.value)];e._zod.onattach.push(function(e){var n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=function(r){(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wi=B(`$ZodCheckMultipleOf`,function(e,t){bi.init(e,t),e._zod.onattach.push(function(e){var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=function(n){if(Fn(n.value)!==Fn(t.value))throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):function(e,t){var n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){var a=r.match(/\d?e-(\d?)/);a!=null&&a[1]&&(i=Number.parseInt(a[1]))}var o=n>i?n:i;return Number.parseInt(e.toFixed(o).replace(`.`,``))%Number.parseInt(t.toFixed(o).replace(`.`,``))/10**o}(n.value,t.value)===0)||n.issues.push({origin:Fn(n.value),code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ti=B(`$ZodCheckNumberFormat`,function(e,t){bi.init(e,t),t.format=t.format||`float64`;var n=t.format?.includes(`int`),r=n?`int`:`number`,i=R(Ar[t.format],2),a=i[0],o=i[1];e._zod.onattach.push(function(e){var r=e._zod.bag;r.format=t.format,r.minimum=a,r.maximum=o,n&&(r.pattern=mi)}),e._zod.check=function(i){var s=i.value;if(n){if(!Number.isInteger(s))return void i.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?i.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):i.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}))}s<a&&i.issues.push({origin:`number`,input:s,code:`too_small`,minimum:a,inclusive:!0,inst:e,continue:!t.abort}),s>o&&i.issues.push({origin:`number`,input:s,code:`too_big`,maximum:o,inst:e})}}),Ei=B(`$ZodCheckMaxSize`,function(e,t){var n;bi.init(e,t),(n=e._zod.def).when??(n.when=function(e){var t=e.value;return!gr(t)&&t.size!==void 0}),e._zod.onattach.push(function(e){var n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;r.size<=t.maximum||n.issues.push({origin:Fr(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Di=B(`$ZodCheckMinSize`,function(e,t){var n;bi.init(e,t),(n=e._zod.def).when??(n.when=function(e){var t=e.value;return!gr(t)&&t.size!==void 0}),e._zod.onattach.push(function(e){var n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;r.size>=t.minimum||n.issues.push({origin:Fr(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Oi=B(`$ZodCheckSizeEquals`,function(e,t){var n;bi.init(e,t),(n=e._zod.def).when??(n.when=function(e){var t=e.value;return!gr(t)&&t.size!==void 0}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=function(n){var r=n.value,i=r.size;if(i!==t.size){var a=i>t.size;n.issues.push(I(I({origin:Fr(r)},a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),ki=B(`$ZodCheckMaxLength`,function(e,t){var n;bi.init(e,t),(n=e._zod.def).when??(n.when=function(e){var t=e.value;return!gr(t)&&t.length!==void 0}),e._zod.onattach.push(function(e){var n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=function(n){var r=n.value;if(!(r.length<=t.maximum)){var i=Ir(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),Ai=B(`$ZodCheckMinLength`,function(e,t){var n;bi.init(e,t),(n=e._zod.def).when??(n.when=function(e){var t=e.value;return!gr(t)&&t.length!==void 0}),e._zod.onattach.push(function(e){var n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=function(n){var r=n.value;if(!(r.length>=t.minimum)){var i=Ir(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}}),ji=B(`$ZodCheckLengthEquals`,function(e,t){var n;bi.init(e,t),(n=e._zod.def).when??(n.when=function(e){var t=e.value;return!gr(t)&&t.length!==void 0}),e._zod.onattach.push(function(e){var n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=function(n){var r=n.value,i=r.length;if(i!==t.length){var a=Ir(r),o=i>t.length;n.issues.push(I(I({origin:a},o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length}),{},{inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort}))}}}),Mi=B(`$ZodCheckStringFormat`,function(e,t){var n,r;bi.init(e,t),e._zod.onattach.push(function(e){var n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push(I(I({origin:`string`,code:`invalid_format`,format:t.format,input:n.value},t.pattern?{pattern:t.pattern.toString()}:{}),{},{inst:e,continue:!t.abort}))}):(r=e._zod).check??(r.check=function(){})}),Ni=B(`$ZodCheckRegex`,function(e,t){Mi.init(e,t),e._zod.check=function(n){t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pi=B(`$ZodCheckLowerCase`,function(e,t){t.pattern??=vi,Mi.init(e,t)}),Fi=B(`$ZodCheckUpperCase`,function(e,t){t.pattern??=yi,Mi.init(e,t)}),Ii=B(`$ZodCheckIncludes`,function(e,t){bi.init(e,t);var n=Or(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(function(e){var t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=function(n){n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Li=B(`$ZodCheckStartsWith`,function(e,t){bi.init(e,t);var n=RegExp(`^${Or(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(function(e){var t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=function(n){n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ri=B(`$ZodCheckEndsWith`,function(e,t){bi.init(e,t);var n=RegExp(`.*${Or(t.suffix)}\$`);t.pattern??=n,e._zod.onattach.push(function(e){var t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=function(n){n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function zi(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,z(Mr(n,e.issues)))}var Bi=B(`$ZodCheckProperty`,function(e,t){bi.init(e,t),e._zod.check=function(e){var n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(function(n){return zi(n,e,t.property)});zi(n,e,t.property)}}),Vi=B(`$ZodCheckMimeType`,function(e,t){bi.init(e,t);var n=new Set(t.mime);e._zod.onattach.push(function(e){e._zod.bag.mime=t.mime}),e._zod.check=function(r){n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Hi=B(`$ZodCheckOverwrite`,function(e,t){bi.init(e,t),e._zod.check=function(e){e.value=t.tx(e.value)}}),Ui=M(function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];j(this,e),this.content=[],this.indent=0,this&&(this.args=t)},[{key:`indented`,value:function(e){this.indent+=1,e(this),--this.indent}},{key:`write`,value:function(e){var t=this;if(typeof e==`function`)return e(this,{execution:`sync`}),void e(this,{execution:`async`});var n,r=e.split(`
`).filter(function(e){return e}),i=Math.min.apply(Math,z(r.map(function(e){return e.length-e.trimStart().length}))),a=N(r.map(function(e){return e.slice(i)}).map(function(e){return` `.repeat(2*t.indent)+e}));try{for(a.s();!(n=a.n()).done;){var o=n.value;this.content.push(o)}}catch(e){a.e(e)}finally{a.f()}}},{key:`compile`,value:function(){var e=Function,t=this==null?void 0:this.args,n=z(((this==null?void 0:this.content)??[``]).map(function(e){return` ${e}`}));return Tn(e,z(t).concat([n.join(`
`)]))}}]),Wi={major:4,minor:1,patch:12},Gi=B(`$ZodType`,function(e,t){var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wi;var r=z(e._zod.def.checks??[]);e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);var i,a=N(r);try{for(a.s();!(i=a.n()).done;){var o,s=N(i.value._zod.onattach);try{for(s.s();!(o=s.n()).done;)(0,o.value)(e)}catch(e){s.e(e)}finally{s.f()}}}catch(e){a.e(e)}finally{a.f()}if(r.length===0){var c;(n=e._zod).deferred??(n.deferred=[]),(c=e._zod.deferred)==null||c.push(function(){e._zod.run=e._zod.parse})}else{var l=function(e,t,n){var r,i,a=jr(e),o=N(t);try{var s=function(){var t=i.value;if(t._zod.def.when){if(!t._zod.def.when(e))return 0}else if(a)return 0;var o=e.issues.length,s=t._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new lr;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(k(L().m(function t(){return L().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,s;case 1:if(e.issues.length!==o){t.n=2;break}return t.a(2);case 2:a||=jr(e,o);case 3:return t.a(2)}},t)})));else{if(e.issues.length===o)return 0;a||=jr(e,o)}};for(o.s();!(i=o.n()).done;)s()}catch(e){o.e(e)}finally{o.f()}return r?r.then(function(){return e}):e},u=function(t,n,i){if(jr(t))return t.aborted=!0,t;var a=l(n,r,i);if(a instanceof Promise){if(!1===i.async)throw new lr;return a.then(function(t){return e._zod.parse(t,i)})}return e._zod.parse(a,i)};e._zod.run=function(t,n){if(n.skipChecks)return e._zod.parse(t,n);if(n.direction===`backward`){var i=e._zod.parse({value:t.value,issues:[]},I(I({},n),{},{skipChecks:!0}));return i instanceof Promise?i.then(function(e){return u(e,t,n)}):u(i,t,n)}var a=e._zod.parse(t,n);if(a instanceof Promise){if(!1===n.async)throw new lr;return a.then(function(e){return l(e,r,n)})}return l(a,r,n)}}e[`~standard`]={validate:function(t){try{var n=Wr(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Kr(e,t).then(function(e){return e.success?{value:e.data}:{issues:e.error?.issues}})}},vendor:`zod`,version:1}}),Ki=B(`$ZodString`,function(e,t){var n,r,i;Gi.init(e,t),e._zod.pattern=z((e==null||(n=e._zod.bag)==null?void 0:n.patterns)??[]).pop()??(i=(r=e._zod.bag)?`[\\s\\S]{${r?.minimum??0},${r?.maximum??``}}`:`[\\s\\S]*`,RegExp(`^${i}\$`)),e._zod.parse=function(n,r){if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),qi=B(`$ZodStringFormat`,function(e,t){Mi.init(e,t),Ki.init(e,t)}),Ji=B(`$ZodGUID`,function(e,t){t.pattern??=ei,qi.init(e,t)}),Yi=B(`$ZodUUID`,function(e,t){if(t.version){var n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ti(n)}else t.pattern??=ti();qi.init(e,t)}),Xi=B(`$ZodEmail`,function(e,t){t.pattern??=ni,qi.init(e,t)}),Zi=B(`$ZodURL`,function(e,t){qi.init(e,t),e._zod.check=function(n){try{var r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:li.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Qi=B(`$ZodEmoji`,function(e,t){t.pattern??=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),qi.init(e,t)}),$i=B(`$ZodNanoID`,function(e,t){t.pattern??=Qr,qi.init(e,t)}),ea=B(`$ZodCUID`,function(e,t){t.pattern??=qr,qi.init(e,t)}),ta=B(`$ZodCUID2`,function(e,t){t.pattern??=Jr,qi.init(e,t)}),na=B(`$ZodULID`,function(e,t){t.pattern??=Yr,qi.init(e,t)}),ra=B(`$ZodXID`,function(e,t){t.pattern??=Xr,qi.init(e,t)}),ia=B(`$ZodKSUID`,function(e,t){t.pattern??=Zr,qi.init(e,t)}),aa=B(`$ZodISODateTime`,function(e,t){t.pattern??=function(e){var t=pi({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);var r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${di}T(?:${r})\$`)}(t),qi.init(e,t)}),oa=B(`$ZodISODate`,function(e,t){t.pattern??=fi,qi.init(e,t)}),sa=B(`$ZodISOTime`,function(e,t){t.pattern??=RegExp(`^${pi(t)}\$`),qi.init(e,t)}),ca=B(`$ZodISODuration`,function(e,t){t.pattern??=$r,qi.init(e,t)}),la=B(`$ZodIPv4`,function(e,t){t.pattern??=ri,qi.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format=`ipv4`})}),ua=B(`$ZodIPv6`,function(e,t){t.pattern??=ii,qi.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.format=`ipv6`}),e._zod.check=function(n){try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),da=B(`$ZodCIDRv4`,function(e,t){t.pattern??=ai,qi.init(e,t)}),fa=B(`$ZodCIDRv6`,function(e,t){t.pattern??=oi,qi.init(e,t),e._zod.check=function(n){var r=n.value.split(`/`);try{if(r.length!==2)throw Error();var i=R(r,2),a=i[0],o=i[1];if(!o)throw Error();var s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${a}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function pa(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ma=B(`$ZodBase64`,function(e,t){t.pattern??=si,qi.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding=`base64`}),e._zod.check=function(n){pa(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ha=B(`$ZodBase64URL`,function(e,t){t.pattern??=ci,qi.init(e,t),e._zod.onattach.push(function(e){e._zod.bag.contentEncoding=`base64url`}),e._zod.check=function(n){(function(e){if(!ci.test(e))return!1;var t=e.replace(/[-_]/g,function(e){return e===`-`?`+`:`/`});return pa(t.padEnd(4*Math.ceil(t.length/4),`=`))})(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ga=B(`$ZodE164`,function(e,t){t.pattern??=ui,qi.init(e,t)}),_a=B(`$ZodJWT`,function(e,t){qi.init(e,t),e._zod.check=function(n){(function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;try{var n=e.split(`.`);if(n.length!==3)return!1;var r=R(n,1)[0];if(!r)return!1;var i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),va=B(`$ZodNumber`,function(e,t){Gi.init(e,t),e._zod.pattern=e._zod.bag.pattern??hi,e._zod.parse=function(n,r){if(t.coerce)try{n.value=Number(n.value)}catch{}var i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;var a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push(I({expected:`number`,code:`invalid_type`,input:i,inst:e},a?{received:a}:{})),n}}),ya=B(`$ZodNumber`,function(e,t){Ti.init(e,t),va.init(e,t)}),ba=B(`$ZodBoolean`,function(e,t){Gi.init(e,t),e._zod.pattern=gi,e._zod.parse=function(n,r){if(t.coerce)try{n.value=!!n.value}catch{}var i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),xa=B(`$ZodNull`,function(e,t){Gi.init(e,t),e._zod.pattern=_i,e._zod.values=new Set([null]),e._zod.parse=function(t,n){var r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Sa=B(`$ZodUnknown`,function(e,t){Gi.init(e,t),e._zod.parse=function(e){return e}}),Ca=B(`$ZodNever`,function(e,t){Gi.init(e,t),e._zod.parse=function(t,n){return t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t}});function wa(e,t,n){var r;e.issues.length&&(r=t.issues).push.apply(r,z(Mr(n,e.issues))),t.value[n]=e.value}var Ta=B(`$ZodArray`,function(e,t){Gi.init(e,t),e._zod.parse=function(n,r){var i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);for(var a=[],o=function(e){var o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(function(t){return wa(t,n,e)})):wa(s,n,e)},s=0;s<i.length;s++)o(s);return a.length?Promise.all(a).then(function(){return n}):n}});function Ea(e,t,n,r){var i;e.issues.length&&(i=t.issues).push.apply(i,z(Mr(n,e.issues))),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Da(e){for(var t=Object.keys(e.shape),n=0,r=t;n<r.length;n++){var i,a=r[n];if((i=e.shape)==null||(i=i[a])==null||(i=i._zod)==null||(i=i.traits)==null||!i.has(`$ZodType`))throw Error(`Invalid element at key "${a}": expected a Zod schema`)}var o,s=(o=e.shape,Object.keys(o).filter(function(e){return o[e]._zod.optin===`optional`&&o[e]._zod.optout===`optional`}));return I(I({},e),{},{keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)})}function Oa(e,t,n,r,i,a){for(var o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=function(){var i=f[d];if(s.has(i))return 0;if(l===`never`)return o.push(i),0;var a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(function(e){return Ea(e,n,i,t)})):Ea(a,n,i,t)},d=0,f=Object.keys(t);d<f.length;d++)u();return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(function(){return n}):n}var ka=B(`$ZodObject`,function(e,t){Gi.init(e,t);var n=Object.getOwnPropertyDescriptor(t,`shape`);if(n==null||!n.get){var r=t.shape;Object.defineProperty(t,"shape",{get:function(){var e=I({},r);return Object.defineProperty(t,"shape",{value:e}),e}})}var i=hr(function(){return Da(t)});V(e._zod,`propValues`,function(){var e=t.shape,n={};for(var r in e){var i=e[r]._zod;if(i.values){n[r]??(n[r]=new Set);var a,o=N(i.values);try{for(o.s();!(a=o.n()).done;){var s=a.value;n[r].add(s)}}catch(e){o.e(e)}finally{o.f()}}}return n});var a,o=Cr,s=t.catchall;e._zod.parse=function(t,n){a??=i.value;var r=t.value;if(!o(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value={};var c,l=[],u=a.shape,d=N(a.keys);try{var f=function(){var e=c.value,i=u[e]._zod.run({value:r[e],issues:[]},n);i instanceof Promise?l.push(i.then(function(n){return Ea(n,t,e,r)})):Ea(i,t,e,r)};for(d.s();!(c=d.n()).done;)f()}catch(e){d.e(e)}finally{d.f()}return s?Oa(l,r,t,n,i.value,e):l.length?Promise.all(l).then(function(){return t}):t}}),Aa=B(`$ZodObjectJIT`,function(e,t){ka.init(e,t);var n,r,i=e._zod.parse,a=hr(function(){return Da(t)}),o=Cr,s=!dr.jitless,c=s&&wr.value,l=t.catchall;e._zod.parse=function(u,d){r??=a.value;var f=u.value;return o(f)?s&&c&&!1===d?.async&&!0!==d.jitless?(n||=function(e){var t=new Ui([`shape`,`payload`,`ctx`]),n=a.value,r=function(e){var t=xr(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);var i,o=Object.create(null),s=0,c=N(n.keys);try{for(c.s();!(i=c.n()).done;)o[i.value]=`key_${s++}`}catch(e){c.e(e)}finally{c.f()}t.write(`const newResult = {};`);var l,u=N(n.keys);try{for(u.s();!(l=u.n()).done;){var d=l.value,f=o[d],p=xr(d);t.write(`const ${f} = ${r(d)};`),t.write(`
if (${f}.issues.length) {
payload.issues = payload.issues.concat(${f}.issues.map(iss => ({
...iss,
path: iss.path ? [${p}, ...iss.path] : [${p}]
})));
}
if (${f}.value === undefined) {
if (${p} in input) {
newResult[${p}] = undefined;
}
} else {
newResult[${p}] = ${f}.value;
}
`)}}catch(e){u.e(e)}finally{u.f()}t.write(`payload.value = newResult;`),t.write(`return payload;`);var m=t.compile();return function(t,n){return m(e,t,n)}}(t.shape),u=n(u,d),l?Oa([],f,u,d,r,e):u):i(u,d):(u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u)}});function ja(e,t,n,r){var i,a=N(e);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(o.issues.length===0)return t.value=o.value,t}}catch(e){a.e(e)}finally{a.f()}var s=e.filter(function(e){return!jr(e)});return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(function(e){return e.issues.map(function(e){return Pr(e,r,fr())})})}),t)}var Ma=B(`$ZodUnion`,function(e,t){Gi.init(e,t),V(e._zod,`optin`,function(){return t.options.some(function(e){return e._zod.optin===`optional`})?`optional`:void 0}),V(e._zod,`optout`,function(){return t.options.some(function(e){return e._zod.optout===`optional`})?`optional`:void 0}),V(e._zod,`values`,function(){if(t.options.every(function(e){return e._zod.values}))return new Set(t.options.flatMap(function(e){return Array.from(e._zod.values)}))}),V(e._zod,`pattern`,function(){if(t.options.every(function(e){return e._zod.pattern})){var e=t.options.map(function(e){return e._zod.pattern});return RegExp(`^(${e.map(function(e){return _r(e.source)}).join(`|`)})\$`)}});var n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=function(i,a){if(n)return r(i,a);var o,s=!1,c=[],l=N(t.options);try{for(l.s();!(o=l.n()).done;){var u=o.value._zod.run({value:i.value,issues:[]},a);if(u instanceof Promise)c.push(u),s=!0;else{if(u.issues.length===0)return u;c.push(u)}}}catch(e){l.e(e)}finally{l.f()}return s?Promise.all(c).then(function(t){return ja(t,i,e,a)}):ja(c,i,e,a)}}),Na=B(`$ZodDiscriminatedUnion`,function(e,t){Ma.init(e,t);var n=e._zod.parse;V(e._zod,`propValues`,function(){var e,n={},r=N(t.options);try{for(r.s();!(e=r.n()).done;){var i=e.value,a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(var o=0,s=Object.entries(a);o<s.length;o++){var c=R(s[o],2),l=c[0],u=c[1];n[l]||(n[l]=new Set);var d,f=N(u);try{for(f.s();!(d=f.n()).done;){var p=d.value;n[l].add(p)}}catch(e){f.e(e)}finally{f.f()}}}}catch(e){r.e(e)}finally{r.f()}return n});var r=hr(function(){var e,n=t.options,r=new Map,i=N(n);try{for(i.s();!(e=i.n()).done;){var a=e.value,o=a._zod.propValues?.[t.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);var s,c=N(o);try{for(c.s();!(s=c.n()).done;){var l=s.value;if(r.has(l))throw Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,a)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){i.e(e)}finally{i.f()}return r});e._zod.parse=function(i,a){var o=i.value;if(!Cr(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;var s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),Pa=B(`$ZodIntersection`,function(e,t){Gi.init(e,t),e._zod.parse=function(e,n){var r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(function(t){var n=R(t,2),r=n[0],i=n[1];return Ia(e,r,i)}):Ia(e,i,a)}});function Fa(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tr(e)&&Tr(t)){var n,r=Object.keys(t),i=Object.keys(e).filter(function(e){return r.indexOf(e)!==-1}),a=I(I({},e),t),o=N(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,c=Fa(e[s],t[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s].concat(z(c.mergeErrorPath))};a[s]=c.data}}catch(e){o.e(e)}finally{o.f()}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};for(var l=[],u=0;u<e.length;u++){var d=Fa(e[u],t[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u].concat(z(d.mergeErrorPath))};l.push(d.data)}return{valid:!0,data:l}}return{valid:!1,mergeErrorPath:[]}}function Ia(e,t,n){var r,i;if(t.issues.length&&(r=e.issues).push.apply(r,z(t.issues)),n.issues.length&&(i=e.issues).push.apply(i,z(n.issues)),jr(e))return e;var a=Fa(t.value,n.value);if(!a.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var La=B(`$ZodRecord`,function(e,t){Gi.init(e,t),e._zod.parse=function(n,r){var i=n.value;if(!Tr(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;var a=[];if(t.keyType._zod.values){var o=t.keyType._zod.values;n.value={};var s,c,l=N(o);try{var u=function(){var e=s.value;if(typeof e==`string`||typeof e==`number`||Fn(e)===`symbol`){var o,c=t.valueType._zod.run({value:i[e],issues:[]},r);c instanceof Promise?a.push(c.then(function(t){var r;t.issues.length&&(r=n.issues).push.apply(r,z(Mr(e,t.issues))),n.value[e]=t.value})):(c.issues.length&&(o=n.issues).push.apply(o,z(Mr(e,c.issues))),n.value[e]=c.value)}};for(l.s();!(s=l.n()).done;)u()}catch(e){l.e(e)}finally{l.f()}for(var d in i)o.has(d)||(c??=[]).push(d);c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};var f,p=N(Reflect.ownKeys(i));try{var m=function(){var o=f.value;if(o===`__proto__`)return 0;var s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length)return n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(function(e){return Pr(e,r,fr())}),input:o,path:[o],inst:e}),n.value[s.value]=s.value,0;var c,l=t.valueType._zod.run({value:i[o],issues:[]},r);l instanceof Promise?a.push(l.then(function(e){var t;e.issues.length&&(t=n.issues).push.apply(t,z(Mr(o,e.issues))),n.value[s.value]=e.value})):(l.issues.length&&(c=n.issues).push.apply(c,z(Mr(o,l.issues))),n.value[s.value]=l.value)};for(p.s();!(f=p.n()).done;)m()}catch(e){p.e(e)}finally{p.f()}}return a.length?Promise.all(a).then(function(){return n}):n}}),Ra=B(`$ZodEnum`,function(e,t){Gi.init(e,t);var n=pr(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(function(e){return Dr.has(Fn(e))}).map(function(e){return typeof e==`string`?Or(e):e.toString()}).join(`|`)})\$`),e._zod.parse=function(t,i){var a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),za=B(`$ZodLiteral`,function(e,t){if(Gi.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(function(e){return typeof e==`string`?Or(e):e?Or(e.toString()):String(e)}).join(`|`)})\$`),e._zod.parse=function(n,r){var i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Ba=B(`$ZodTransform`,function(e,t){Gi.init(e,t),e._zod.parse=function(n,r){if(r.direction===`backward`)throw new ur(e.constructor.name);var i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(function(e){return n.value=e,n});if(i instanceof Promise)throw new lr;return n.value=i,n}});function Va(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Ha=B(`$ZodOptional`,function(e,t){Gi.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,V(e._zod,`values`,function(){return t.innerType._zod.values?new Set([].concat(z(t.innerType._zod.values),[void 0])):void 0}),V(e._zod,`pattern`,function(){var e=t.innerType._zod.pattern;return e?RegExp(`^(${_r(e.source)})?\$`):void 0}),e._zod.parse=function(e,n){if(t.innerType._zod.optin===`optional`){var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(t){return Va(t,e.value)}):Va(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Ua=B(`$ZodNullable`,function(e,t){Gi.init(e,t),V(e._zod,`optin`,function(){return t.innerType._zod.optin}),V(e._zod,`optout`,function(){return t.innerType._zod.optout}),V(e._zod,`pattern`,function(){var e=t.innerType._zod.pattern;return e?RegExp(`^(${_r(e.source)}|null)\$`):void 0}),V(e._zod,`values`,function(){return t.innerType._zod.values?new Set([].concat(z(t.innerType._zod.values),[null])):void 0}),e._zod.parse=function(e,n){return e.value===null?e:t.innerType._zod.run(e,n)}}),Wa=B(`$ZodDefault`,function(e,t){Gi.init(e,t),e._zod.optin=`optional`,V(e._zod,`values`,function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(e){return Ga(e,t)}):Ga(r,t)}});function Ga(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ka=B(`$ZodPrefault`,function(e,t){Gi.init(e,t),e._zod.optin=`optional`,V(e._zod,`values`,function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){return n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n)}}),qa=B(`$ZodNonOptional`,function(e,t){Gi.init(e,t),V(e._zod,`values`,function(){var e=t.innerType._zod.values;return e?new Set(z(e).filter(function(e){return e!==void 0})):void 0}),e._zod.parse=function(n,r){var i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(function(t){return Ja(t,e)}):Ja(i,e)}});function Ja(e,t){return e.issues.length||e.value!==void 0||e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Ya=B(`$ZodCatch`,function(e,t){Gi.init(e,t),V(e._zod,`optin`,function(){return t.innerType._zod.optin}),V(e._zod,`optout`,function(){return t.innerType._zod.optout}),V(e._zod,`values`,function(){return t.innerType._zod.values}),e._zod.parse=function(e,n){if(n.direction===`backward`)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(function(r){return e.value=r.value,r.issues.length&&(e.value=t.catchValue(I(I({},e),{},{error:{issues:r.issues.map(function(e){return Pr(e,n,fr())})},input:e.value})),e.issues=[]),e}):(e.value=r.value,r.issues.length&&(e.value=t.catchValue(I(I({},e),{},{error:{issues:r.issues.map(function(e){return Pr(e,n,fr())})},input:e.value})),e.issues=[]),e)}}),Xa=B(`$ZodPipe`,function(e,t){Gi.init(e,t),V(e._zod,`values`,function(){return t.in._zod.values}),V(e._zod,`optin`,function(){return t.in._zod.optin}),V(e._zod,`optout`,function(){return t.out._zod.optout}),V(e._zod,`propValues`,function(){return t.in._zod.propValues}),e._zod.parse=function(e,n){if(n.direction===`backward`){var r=t.out._zod.run(e,n);return r instanceof Promise?r.then(function(e){return Za(e,t.in,n)}):Za(r,t.in,n)}var i=t.in._zod.run(e,n);return i instanceof Promise?i.then(function(e){return Za(e,t.out,n)}):Za(i,t.out,n)}});function Za(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Qa=B(`$ZodReadonly`,function(e,t){Gi.init(e,t),V(e._zod,`propValues`,function(){return t.innerType._zod.propValues}),V(e._zod,`values`,function(){return t.innerType._zod.values}),V(e._zod,`optin`,function(){return t.innerType._zod.optin}),V(e._zod,`optout`,function(){return t.innerType._zod.optout}),e._zod.parse=function(e,n){if(n.direction===`backward`)return t.innerType._zod.run(e,n);var r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then($a):$a(r)}});function $a(e){return e.value=Object.freeze(e.value),e}var eo=B(`$ZodLazy`,function(e,t){Gi.init(e,t),V(e._zod,`innerType`,function(){return t.getter()}),V(e._zod,`pattern`,function(){return e._zod.innerType._zod.pattern}),V(e._zod,`propValues`,function(){return e._zod.innerType._zod.propValues}),V(e._zod,`optin`,function(){return e._zod.innerType._zod.optin??void 0}),V(e._zod,`optout`,function(){return e._zod.innerType._zod.optout??void 0}),e._zod.parse=function(t,n){return e._zod.innerType._zod.run(t,n)}}),to=B(`$ZodCustom`,function(e,t){bi.init(e,t),Gi.init(e,t),e._zod.parse=function(e,t){return e},e._zod.check=function(n){var r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(function(t){return no(t,n,r,e)});no(i,n,r,e)}});function no(e,t,n,r){if(!e){var i={code:`custom`,input:n,inst:r,path:z(r._zod.def.path??[]),continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Lr(i))}}var ro=M(function e(){j(this,e),this._map=new WeakMap,this._idmap=new Map},[{key:`add`,value:function(e){var t=arguments.length<=1?void 0:arguments[1];if(this._map.set(e,t),t&&Fn(t)===`object`&&`id`in t){if(this._idmap.has(t.id))throw Error(`ID ${t.id} already exists in the registry`);this._idmap.set(t.id,e)}return this}},{key:`clear`,value:function(){return this._map=new WeakMap,this._idmap=new Map,this}},{key:`remove`,value:function(e){var t=this._map.get(e);return t&&Fn(t)===`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}},{key:`get`,value:function(e){var t=e._zod.parent;if(t){var n=I({},this.get(t)??{});delete n.id;var r=I(I({},n),this._map.get(e));return Object.keys(r).length?r:void 0}return this._map.get(e)}},{key:`has`,value:function(e){return this._map.has(e)}}]),io=new ro;function ao(e,t){return new e(I({type:`string`,format:`guid`,check:`string_format`,abort:!1},H(t)))}function oo(e,t){return new Si(I(I({check:`less_than`},H(t)),{},{value:e,inclusive:!1}))}function so(e,t){return new Si(I(I({check:`less_than`},H(t)),{},{value:e,inclusive:!0}))}function co(e,t){return new Ci(I(I({check:`greater_than`},H(t)),{},{value:e,inclusive:!1}))}function lo(e,t){return new Ci(I(I({check:`greater_than`},H(t)),{},{value:e,inclusive:!0}))}function uo(e,t){return new wi(I(I({check:`multiple_of`},H(t)),{},{value:e}))}function fo(e,t){return new ki(I(I({check:`max_length`},H(t)),{},{maximum:e}))}function po(e,t){return new Ai(I(I({check:`min_length`},H(t)),{},{minimum:e}))}function mo(e,t){return new ji(I(I({check:`length_equals`},H(t)),{},{length:e}))}function ho(e,t){return new Ni(I(I({check:`string_format`,format:`regex`},H(t)),{},{pattern:e}))}function go(e){return new Pi(I({check:`string_format`,format:`lowercase`},H(e)))}function _o(e){return new Fi(I({check:`string_format`,format:`uppercase`},H(e)))}function vo(e,t){return new Ii(I(I({check:`string_format`,format:`includes`},H(t)),{},{includes:e}))}function yo(e,t){return new Li(I(I({check:`string_format`,format:`starts_with`},H(t)),{},{prefix:e}))}function bo(e,t){return new Ri(I(I({check:`string_format`,format:`ends_with`},H(t)),{},{suffix:e}))}function xo(e){return new Hi({check:`overwrite`,tx:e})}function So(e){return xo(function(t){return t.normalize(e)})}function Co(){return xo(function(e){return e.trim()})}function wo(){return xo(function(e){return e.toLowerCase()})}function To(){return xo(function(e){return e.toUpperCase()})}var Eo=M(function e(t){j(this,e),this.counter=0,this.metadataRegistry=t?.metadata??io,this.target=t?.target??`draft-2020-12`,this.unrepresentable=t?.unrepresentable??`throw`,this.override=t?.override??function(){},this.io=t?.io??`output`,this.seen=new Map},[{key:`process`,value:function(e){var t,n,r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{path:[],schemaPath:[]},a=e._zod.def,o=this.seen.get(e);if(o)return o.count++,i.schemaPath.includes(e)&&(o.cycle=i.path),o.schema;var s={schema:{},count:1,cycle:void 0,path:i.path};this.seen.set(e,s);var c=(t=e._zod).toJSONSchema?.call(t);if(c)s.schema=c;else{var l=I(I({},i),{},{schemaPath:[].concat(z(i.schemaPath),[e]),path:i.path}),u=e._zod.parent;if(u)s.ref=u,this.process(u,l),this.seen.get(u).isParent=!0;else{var d=s.schema;switch(a.type){case`string`:var f=d;f.type=`string`;var p=e._zod.bag,m=p.minimum,h=p.maximum,g=p.format,_=p.patterns,v=p.contentEncoding;if(typeof m==`number`&&(f.minLength=m),typeof h==`number`&&(f.maxLength=h),g&&(f.format={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``}[g]??g,f.format===``&&delete f.format),v&&(f.contentEncoding=v),_&&_.size>0){var y=z(_);y.length===1?f.pattern=y[0].source:y.length>1&&(s.schema.allOf=z(y.map(function(e){return I(I({},r.target===`draft-7`||r.target===`draft-4`||r.target===`openapi-3.0`?{type:`string`}:{}),{},{pattern:e.source})})))}break;case`number`:var b=d,x=e._zod.bag,S=x.minimum,C=x.maximum,w=x.format,T=x.multipleOf,ee=x.exclusiveMaximum,E=x.exclusiveMinimum;typeof w==`string`&&w.includes(`int`)?b.type=`integer`:b.type=`number`,typeof E==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(b.minimum=E,b.exclusiveMinimum=!0):b.exclusiveMinimum=E),typeof S==`number`&&(b.minimum=S,typeof E==`number`&&this.target!==`draft-4`&&(E>=S?delete b.minimum:delete b.exclusiveMinimum)),typeof ee==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(b.maximum=ee,b.exclusiveMaximum=!0):b.exclusiveMaximum=ee),typeof C==`number`&&(b.maximum=C,typeof ee==`number`&&this.target!==`draft-4`&&(ee<=C?delete b.maximum:delete b.exclusiveMaximum)),typeof T==`number`&&(b.multipleOf=T);break;case`boolean`:case`success`:d.type=`boolean`;break;case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:this.target===`openapi-3.0`?(d.type=`string`,d.nullable=!0,d.enum=[null]):d.type=`null`;break;case`any`:case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:d.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:var te=d,ne=e._zod.bag,re=ne.minimum,ie=ne.maximum;typeof re==`number`&&(te.minItems=re),typeof ie==`number`&&(te.maxItems=ie),te.type=`array`,te.items=this.process(a.element,I(I({},l),{},{path:[].concat(z(l.path),[`items`])}));break;case`object`:var ae=d;ae.type=`object`,ae.properties={};var oe=a.shape;for(var se in oe)ae.properties[se]=this.process(oe[se],I(I({},l),{},{path:[].concat(z(l.path),[`properties`,se])}));var ce=new Set(Object.keys(oe)),D=new Set(z(ce).filter(function(e){var t=a.shape[e]._zod;return r.io===`input`?t.optin===void 0:t.optout===void 0}));D.size>0&&(ae.required=Array.from(D)),a.catchall?._zod.def.type===`never`?ae.additionalProperties=!1:a.catchall?a.catchall&&(ae.additionalProperties=this.process(a.catchall,I(I({},l),{},{path:[].concat(z(l.path),[`additionalProperties`])}))):this.io===`output`&&(ae.additionalProperties=!1);break;case`union`:var le=d;le.anyOf=a.options.map(function(e,t){return r.process(e,I(I({},l),{},{path:[].concat(z(l.path),[`anyOf`,t])}))});break;case`intersection`:var ue=d,de=this.process(a.left,I(I({},l),{},{path:[].concat(z(l.path),[`allOf`,0])})),fe=this.process(a.right,I(I({},l),{},{path:[].concat(z(l.path),[`allOf`,1])})),pe=function(e){return`allOf`in e&&Object.keys(e).length===1};ue.allOf=[].concat(z(pe(de)?de.allOf:[de]),z(pe(fe)?fe.allOf:[fe]));break;case`tuple`:var me=d;me.type=`array`;var he=this.target===`draft-2020-12`?`prefixItems`:`items`,ge=this.target===`draft-2020-12`||this.target===`openapi-3.0`?`items`:`additionalItems`,_e=a.items.map(function(e,t){return r.process(e,I(I({},l),{},{path:[].concat(z(l.path),[he,t])}))}),ve=a.rest?this.process(a.rest,I(I({},l),{},{path:[].concat(z(l.path),[ge],z(this.target===`openapi-3.0`?[a.items.length]:[]))})):null;this.target===`draft-2020-12`?(me.prefixItems=_e,ve&&(me.items=ve)):this.target===`openapi-3.0`?(me.items={anyOf:_e},ve&&me.items.anyOf.push(ve),me.minItems=_e.length,ve||(me.maxItems=_e.length)):(me.items=_e,ve&&(me.additionalItems=ve));var ye=e._zod.bag,be=ye.minimum,xe=ye.maximum;typeof be==`number`&&(me.minItems=be),typeof xe==`number`&&(me.maxItems=xe);break;case`record`:var Se=d;Se.type=`object`,this.target!==`draft-7`&&this.target!==`draft-2020-12`||(Se.propertyNames=this.process(a.keyType,I(I({},l),{},{path:[].concat(z(l.path),[`propertyNames`])}))),Se.additionalProperties=this.process(a.valueType,I(I({},l),{},{path:[].concat(z(l.path),[`additionalProperties`])}));break;case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:var Ce=d,we=pr(a.entries);we.every(function(e){return typeof e==`number`})&&(Ce.type=`number`),we.every(function(e){return typeof e==`string`})&&(Ce.type=`string`),Ce.enum=we;break;case`literal`:var Te,Ee=d,De=[],Oe=N(a.values);try{for(Oe.s();!(Te=Oe.n()).done;){var ke=Te.value;if(ke===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof ke==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);De.push(Number(ke))}else De.push(ke)}}catch(e){Oe.e(e)}finally{Oe.f()}if(De.length!==0)if(De.length===1){var Ae=De[0];Ee.type=Ae===null?`null`:Fn(Ae),this.target===`draft-4`||this.target===`openapi-3.0`?Ee.enum=[Ae]:Ee.const=Ae}else De.every(function(e){return typeof e==`number`})&&(Ee.type=`number`),De.every(function(e){return typeof e==`string`})&&(Ee.type=`string`),De.every(function(e){return typeof e==`boolean`})&&(Ee.type=`string`),De.every(function(e){return e===null})&&(Ee.type=`null`),Ee.enum=De;break;case`file`:var je=d,Me={type:`string`,format:`binary`,contentEncoding:`binary`},Ne=e._zod.bag,Pe=Ne.minimum,Fe=Ne.maximum,Ie=Ne.mime;Pe!==void 0&&(Me.minLength=Pe),Fe!==void 0&&(Me.maxLength=Fe),Ie?Ie.length===1?(Me.contentMediaType=Ie[0],Object.assign(je,Me)):je.anyOf=Ie.map(function(e){return I(I({},Me),{},{contentMediaType:e})}):Object.assign(je,Me);break;case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:var Le=this.process(a.innerType,l);this.target===`openapi-3.0`?(s.ref=a.innerType,d.nullable=!0):d.anyOf=[Le,{type:`null`}];break;case`nonoptional`:case`promise`:case`optional`:this.process(a.innerType,l),s.ref=a.innerType;break;case`default`:this.process(a.innerType,l),s.ref=a.innerType,d.default=JSON.parse(JSON.stringify(a.defaultValue));break;case`prefault`:this.process(a.innerType,l),s.ref=a.innerType,this.io===`input`&&(d._prefault=JSON.parse(JSON.stringify(a.defaultValue)));break;case`catch`:var Re;this.process(a.innerType,l),s.ref=a.innerType;try{Re=a.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}d.default=Re;break;case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:var ze=d,Be=e._zod.pattern;if(!Be)throw Error(`Pattern not found in template literal`);ze.type=`string`,ze.pattern=Be.source;break;case`pipe`:var Ve=this.io===`input`?a.in._zod.def.type===`transform`?a.out:a.in:a.out;this.process(Ve,l),s.ref=Ve;break;case`readonly`:this.process(a.innerType,l),s.ref=a.innerType,d.readOnly=!0;break;case`lazy`:var He=e._zod.innerType;this.process(He,l),s.ref=He;break;case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;case`function`:if(this.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)}}}var Ue=this.metadataRegistry.get(e);return Ue&&Object.assign(s.schema,Ue),this.io===`input`&&Do(e)&&(delete s.schema.examples,delete s.schema.default),this.io===`input`&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}},{key:`emit`,value:function(e,t){var n,r=this,i={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},a=this.seen.get(e);if(!a)throw Error(`Unprocessed schema. This is a bug in Zod.`);var o=function(e){if(!e[1].schema.$ref){var t=e[1],n=function(e){var t=r.target===`draft-2020-12`?`$defs`:`definitions`;if(i.external){var n=i.external.registry.get(e[0])?.id,o=i.external.uri??function(e){return e};if(n)return{ref:o(n)};var s=e[1].defId??e[1].schema.id??`schema${r.counter++}`;return e[1].defId=s,{defId:s,ref:`${o(`__shared`)}#/${t}/${s}`}}if(e[1]===a)return{ref:`#`};var c=`#/${t}/`,l=e[1].schema.id??`__schema${r.counter++}`;return{defId:l,ref:c+l}}(e),o=n.ref,s=n.defId;t.def=I({},t.schema),s&&(t.defId=s);var c=t.schema;for(var l in c)delete c[l];c.$ref=o}};if(i.cycles===`throw`){var s,c=N(this.seen.entries());try{for(c.s();!(s=c.n()).done;){var l=s.value[1];if(l.cycle)throw Error(`Cycle detected: #/${l.cycle?.join(`/`)}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}catch(e){c.e(e)}finally{c.f()}}var u,d=N(this.seen.entries());try{for(d.s();!(u=d.n()).done;){var f,p=u.value,m=p[1];if(e!==p[0]){if(i.external){var h=i.external.registry.get(p[0])?.id;if(e!==p[0]&&h){o(p);continue}}((f=this.metadataRegistry.get(p[0]))!=null&&f.id||m.cycle||m.count>1&&i.reused===`ref`)&&o(p)}else o(p)}}catch(e){d.e(e)}finally{d.f()}var g,_=function(e,t){var n=r.seen.get(e),i=n.def??n.schema,a=I({},i);if(n.ref!==null){var o=n.ref;if(n.ref=null,o){_(o,t);var s=r.seen.get(o).schema;!s.$ref||t.target!==`draft-7`&&t.target!==`draft-4`&&t.target!==`openapi-3.0`?(Object.assign(i,s),Object.assign(i,a)):(i.allOf=i.allOf??[],i.allOf.push(s))}n.isParent||r.override({zodSchema:e,jsonSchema:i,path:n.path??[]})}},v=N(z(this.seen.entries()).reverse());try{for(v.s();!(g=v.n()).done;){var y=g.value;_(y[0],{target:this.target})}}catch(e){v.e(e)}finally{v.f()}var b={};if(this.target===`draft-2020-12`?b.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?b.$schema=`http://json-schema.org/draft-07/schema#`:this.target===`draft-4`?b.$schema=`http://json-schema.org/draft-04/schema#`:this.target===`openapi-3.0`||console.warn(`Invalid target: ${this.target}`),(n=i.external)!=null&&n.uri){var x=i.external.registry.get(e)?.id;if(!x)throw Error("Schema is missing an `id` property");b.$id=i.external.uri(x)}Object.assign(b,a.def);var S,C=i.external?.defs??{},w=N(this.seen.entries());try{for(w.s();!(S=w.n()).done;){var T=S.value[1];T.def&&T.defId&&(C[T.defId]=T.def)}}catch(e){w.e(e)}finally{w.f()}i.external||Object.keys(C).length>0&&(this.target===`draft-2020-12`?b.$defs=C:b.definitions=C);try{return JSON.parse(JSON.stringify(b))}catch{throw Error(`Error converting schema to JSON.`)}}}]);function Do(e,t){var n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);var r=e._zod.def;switch(r.type){case`string`:case`number`:case`bigint`:case`boolean`:case`date`:case`symbol`:case`undefined`:case`null`:case`any`:case`unknown`:case`never`:case`void`:case`literal`:case`enum`:case`nan`:case`file`:case`template_literal`:case`custom`:case`success`:case`catch`:case`function`:return!1;case`array`:return Do(r.element,n);case`object`:for(var i in r.shape)if(Do(r.shape[i],n))return!0;return!1;case`union`:var a,o=N(r.options);try{for(o.s();!(a=o.n()).done;)if(Do(a.value,n))return!0}catch(e){o.e(e)}finally{o.f()}return!1;case`intersection`:return Do(r.left,n)||Do(r.right,n);case`tuple`:var s,c=N(r.items);try{for(c.s();!(s=c.n()).done;)if(Do(s.value,n))return!0}catch(e){c.e(e)}finally{c.f()}return!(!r.rest||!Do(r.rest,n));case`record`:case`map`:return Do(r.keyType,n)||Do(r.valueType,n);case`set`:return Do(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:case`default`:case`prefault`:return Do(r.innerType,n);case`lazy`:return Do(r.getter(),n);case`transform`:return!0;case`pipe`:return Do(r.in,n)||Do(r.out,n)}throw Error(`Unknown schema type: ${r.type}`)}var Oo=Object.freeze({__proto__:null,endsWith:bo,gt:co,gte:lo,includes:vo,length:mo,lowercase:go,lt:oo,lte:so,maxLength:fo,maxSize:function(e,t){return new Ei(I(I({check:`max_size`},H(t)),{},{maximum:e}))},mime:function(e,t){return new Vi(I({check:`mime_type`,mime:e},H(t)))},minLength:po,minSize:function(e,t){return new Di(I(I({check:`min_size`},H(t)),{},{minimum:e}))},multipleOf:uo,negative:function(e){return oo(0,e)},nonnegative:function(e){return lo(0,e)},nonpositive:function(e){return so(0,e)},normalize:So,overwrite:xo,positive:function(e){return co(0,e)},property:function(e,t,n){return new Bi(I({check:`property`,property:e,schema:t},H(n)))},regex:ho,size:function(e,t){return new Oi(I(I({check:`size_equals`},H(t)),{},{size:e}))},startsWith:yo,toLowerCase:wo,toUpperCase:To,trim:Co,uppercase:_o}),ko=B(`ZodISODateTime`,function(e,t){aa.init(e,t),Yo.init(e,t)}),Ao=B(`ZodISODate`,function(e,t){oa.init(e,t),Yo.init(e,t)}),jo=B(`ZodISOTime`,function(e,t){sa.init(e,t),Yo.init(e,t)}),Mo=B(`ZodISODuration`,function(e,t){ca.init(e,t),Yo.init(e,t)}),No=B(`ZodError`,function(e,t){zr.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:function(t){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(e){return e.message},n={_errors:[]},r=function(e){var i,a=N(e.issues);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(o.code===`invalid_union`&&o.errors.length)o.errors.map(function(e){return r({issues:e})});else if(o.code===`invalid_key`)r({issues:o.issues});else if(o.code===`invalid_element`)r({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else for(var s=n,c=0;c<o.path.length;){var l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}}catch(e){a.e(e)}finally{a.f()}};return r(e),n}(e,t)}},flatten:{value:function(t){return function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(e){return e.message},r={},i=[],a=N(e.issues);try{for(a.s();!(t=a.n()).done;){var o=t.value;o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(n(o))):i.push(n(o))}}catch(e){a.e(e)}finally{a.f()}return{formErrors:i,fieldErrors:r}}(e,t)}},addIssue:{value:function(t){e.issues.push(t),e.message=JSON.stringify(e.issues,mr,2)}},addIssues:{value:function(t){var n;(n=e.issues).push.apply(n,z(t)),e.message=JSON.stringify(e.issues,mr,2)}},isEmpty:{get:function(){return e.issues.length===0}}})},{Parent:Error}),Po=Vr(No),Fo=Hr(No),Io=Ur(No),Lo=Gr(No),Ro=function(e){return function(t,n,r){var i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Vr(e)(t,n,i)}}(No),zo=function(e){return function(t,n,r){return Vr(e)(t,n,r)}}(No),Bo=function(e){return function(){var t=k(L().m(function t(n,r,i){var a;return L().w(function(t){for(;;)if(t.n===0)return a=i?Object.assign(i,{direction:`backward`}):{direction:`backward`},t.a(2,Hr(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(No),Vo=function(e){return function(){var t=k(L().m(function t(n,r,i){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Hr(e)(n,r,i))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(No),Ho=function(e){return function(t,n,r){var i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return Ur(e)(t,n,i)}}(No),Uo=function(e){return function(t,n,r){return Ur(e)(t,n,r)}}(No),Wo=function(e){return function(){var t=k(L().m(function t(n,r,i){var a;return L().w(function(t){for(;;)if(t.n===0)return a=i?Object.assign(i,{direction:`backward`}):{direction:`backward`},t.a(2,Gr(e)(n,r,a))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(No),Go=function(e){return function(){var t=k(L().m(function t(n,r,i){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Gr(e)(n,r,i))},t)}));return function(e,n,r){return t.apply(this,arguments)}}()}(No),Ko=B(`ZodType`,function(e,t){return Gi.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=function(){var n=[...arguments];return e.clone(br(t,{checks:[].concat(z(t.checks??[]),z(n.map(function(e){return typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e})))}))},e.clone=function(t,n){return kr(e,t,n)},e.brand=function(){return e},e.register=function(t,n){return t.add(e,n),e},e.parse=function(t,n){return Po(e,t,n,{callee:e.parse})},e.safeParse=function(t,n){return Io(e,t,n)},e.parseAsync=function(){var t=k(L().m(function t(n,r){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Fo(e,n,r,{callee:e.parseAsync}))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeParseAsync=function(){var t=k(L().m(function t(n,r){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Lo(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.spa=e.safeParseAsync,e.encode=function(t,n){return Ro(e,t,n)},e.decode=function(t,n){return zo(e,t,n)},e.encodeAsync=function(){var t=k(L().m(function t(n,r){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Bo(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.decodeAsync=function(){var t=k(L().m(function t(n,r){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Vo(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeEncode=function(t,n){return Ho(e,t,n)},e.safeDecode=function(t,n){return Uo(e,t,n)},e.safeEncodeAsync=function(){var t=k(L().m(function t(n,r){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Wo(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.safeDecodeAsync=function(){var t=k(L().m(function t(n,r){return L().w(function(t){for(;;)if(t.n===0)return t.a(2,Go(e,n,r))},t)}));return function(e,n){return t.apply(this,arguments)}}(),e.refine=function(t,n){return e.check(function(e){return function(e,t,n){return new nc(I({type:`custom`,check:`custom`,fn:t},H(n)))}(0,e,arguments.length>1&&arguments[1]!==void 0?arguments[1]:{})}(t,n))},e.superRefine=function(t){return e.check(function(e){var t=function(e){var t=new bi(I({check:`custom`},H(void 0)));return t._zod.check=e,t}(function(n){return n.addIssue=function(e){if(typeof e==`string`)n.issues.push(Lr(e,n.value,t._zod.def));else{var r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Lr(r))}},e(n.value,n)});return t}(t))},e.overwrite=function(t){return e.check(xo(t))},e.optional=function(){return Us(e)},e.nullable=function(){return Gs(e)},e.nullish=function(){return Us(Gs(e))},e.nonoptional=function(t){return function(e,t){return new Js(I({type:`nonoptional`,innerType:e},H(t)))}(e,t)},e.array=function(){return Os(e)},e.or=function(t){return Ns([e,t])},e.and=function(t){return new Fs({type:`intersection`,left:e,right:t})},e.transform=function(t){return Zs(e,new Vs({type:`transform`,transform:t}))},e.default=function(t){return n=t,new Ks({type:`default`,innerType:e,get defaultValue(){return typeof n==`function`?n():Er(n)}});var n},e.prefault=function(t){return n=t,new qs({type:`prefault`,innerType:e,get defaultValue(){return typeof n==`function`?n():Er(n)}});var n},e.catch=function(t){return new Ys({type:`catch`,innerType:e,catchValue:typeof(n=t)==`function`?n:function(){return n}});var n},e.pipe=function(t){return Zs(e,t)},e.readonly=function(){return new ec({type:`readonly`,innerType:e})},e.describe=function(t){var n=e.clone();return io.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:function(){return io.get(e)?.description},configurable:!0}),e.meta=function(){if(arguments.length===0)return io.get(e);var t=e.clone();return io.add(t,arguments.length<=0?void 0:arguments[0]),t},e.isOptional=function(){return e.safeParse(void 0).success},e.isNullable=function(){return e.safeParse(null).success},e}),qo=B(`_ZodString`,function(e,t){Ki.init(e,t),Ko.init(e,t);var n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=function(){return e.check(ho.apply(Oo,arguments))},e.includes=function(){return e.check(vo.apply(Oo,arguments))},e.startsWith=function(){return e.check(yo.apply(Oo,arguments))},e.endsWith=function(){return e.check(bo.apply(Oo,arguments))},e.min=function(){return e.check(po.apply(Oo,arguments))},e.max=function(){return e.check(fo.apply(Oo,arguments))},e.length=function(){return e.check(mo.apply(Oo,arguments))},e.nonempty=function(){var t=[...arguments];return e.check(po.apply(Oo,[1].concat(t)))},e.lowercase=function(t){return e.check(go(t))},e.uppercase=function(t){return e.check(_o(t))},e.trim=function(){return e.check(Co())},e.normalize=function(){return e.check(So.apply(Oo,arguments))},e.toLowerCase=function(){return e.check(wo())},e.toUpperCase=function(){return e.check(To())}}),Jo=B(`ZodString`,function(e,t){Ki.init(e,t),qo.init(e,t),e.email=function(t){return e.check(function(e,t){return new Xo(I({type:`string`,format:`email`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.url=function(t){return e.check(function(e,t){return new $o(I({type:`string`,format:`url`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.jwt=function(t){return e.check(function(e,t){return new ms(I({type:`string`,format:`jwt`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.emoji=function(t){return e.check(function(e,t){return new es(I({type:`string`,format:`emoji`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.guid=function(t){return e.check(ao(Zo,t))},e.uuid=function(t){return e.check(function(e,t){return new Qo(I({type:`string`,format:`uuid`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.uuidv4=function(t){return e.check(function(e,t){return new Qo(I({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`},H(t)))}(0,t))},e.uuidv6=function(t){return e.check(function(e,t){return new Qo(I({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`},H(t)))}(0,t))},e.uuidv7=function(t){return e.check(function(e,t){return new Qo(I({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`},H(t)))}(0,t))},e.nanoid=function(t){return e.check(function(e,t){return new ts(I({type:`string`,format:`nanoid`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.guid=function(t){return e.check(ao(Zo,t))},e.cuid=function(t){return e.check(function(e,t){return new ns(I({type:`string`,format:`cuid`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.cuid2=function(t){return e.check(function(e,t){return new rs(I({type:`string`,format:`cuid2`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.ulid=function(t){return e.check(function(e,t){return new is(I({type:`string`,format:`ulid`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.base64=function(t){return e.check(function(e,t){return new ds(I({type:`string`,format:`base64`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.base64url=function(t){return e.check(function(e,t){return new fs(I({type:`string`,format:`base64url`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.xid=function(t){return e.check(function(e,t){return new as(I({type:`string`,format:`xid`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.ksuid=function(t){return e.check(function(e,t){return new os(I({type:`string`,format:`ksuid`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.ipv4=function(t){return e.check(function(e,t){return new ss(I({type:`string`,format:`ipv4`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.ipv6=function(t){return e.check(function(e,t){return new cs(I({type:`string`,format:`ipv6`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.cidrv4=function(t){return e.check(function(e,t){return new ls(I({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.cidrv6=function(t){return e.check(function(e,t){return new us(I({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.e164=function(t){return e.check(function(e,t){return new ps(I({type:`string`,format:`e164`,check:`string_format`,abort:!1},H(t)))}(0,t))},e.datetime=function(t){return e.check(function(e){return function(e,t){return new ko(I({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null},H(t)))}(0,e)}(t))},e.date=function(t){return e.check(function(e){return function(e,t){return new Ao(I({type:`string`,format:`date`,check:`string_format`},H(t)))}(0,e)}(t))},e.time=function(t){return e.check(function(e){return function(e,t){return new jo(I({type:`string`,format:`time`,check:`string_format`,precision:null},H(t)))}(0,e)}(t))},e.duration=function(t){return e.check(function(e){return function(e,t){return new Mo(I({type:`string`,format:`duration`,check:`string_format`},H(t)))}(0,e)}(t))}});function U(e){return function(e,t){return new Jo(I({type:`string`},H(t)))}(0,e)}var Yo=B(`ZodStringFormat`,function(e,t){qi.init(e,t),qo.init(e,t)}),Xo=B(`ZodEmail`,function(e,t){Xi.init(e,t),Yo.init(e,t)}),Zo=B(`ZodGUID`,function(e,t){Ji.init(e,t),Yo.init(e,t)}),Qo=B(`ZodUUID`,function(e,t){Yi.init(e,t),Yo.init(e,t)}),$o=B(`ZodURL`,function(e,t){Zi.init(e,t),Yo.init(e,t)}),es=B(`ZodEmoji`,function(e,t){Qi.init(e,t),Yo.init(e,t)}),ts=B(`ZodNanoID`,function(e,t){$i.init(e,t),Yo.init(e,t)}),ns=B(`ZodCUID`,function(e,t){ea.init(e,t),Yo.init(e,t)}),rs=B(`ZodCUID2`,function(e,t){ta.init(e,t),Yo.init(e,t)}),is=B(`ZodULID`,function(e,t){na.init(e,t),Yo.init(e,t)}),as=B(`ZodXID`,function(e,t){ra.init(e,t),Yo.init(e,t)}),os=B(`ZodKSUID`,function(e,t){ia.init(e,t),Yo.init(e,t)}),ss=B(`ZodIPv4`,function(e,t){la.init(e,t),Yo.init(e,t)}),cs=B(`ZodIPv6`,function(e,t){ua.init(e,t),Yo.init(e,t)}),ls=B(`ZodCIDRv4`,function(e,t){da.init(e,t),Yo.init(e,t)}),us=B(`ZodCIDRv6`,function(e,t){fa.init(e,t),Yo.init(e,t)}),ds=B(`ZodBase64`,function(e,t){ma.init(e,t),Yo.init(e,t)}),fs=B(`ZodBase64URL`,function(e,t){ha.init(e,t),Yo.init(e,t)}),ps=B(`ZodE164`,function(e,t){ga.init(e,t),Yo.init(e,t)}),ms=B(`ZodJWT`,function(e,t){_a.init(e,t),Yo.init(e,t)}),hs=B(`ZodNumber`,function(e,t){va.init(e,t),Ko.init(e,t),e.gt=function(t,n){return e.check(co(t,n))},e.gte=function(t,n){return e.check(lo(t,n))},e.min=function(t,n){return e.check(lo(t,n))},e.lt=function(t,n){return e.check(oo(t,n))},e.lte=function(t,n){return e.check(so(t,n))},e.max=function(t,n){return e.check(so(t,n))},e.int=function(t){return e.check(vs(t))},e.safe=function(t){return e.check(vs(t))},e.positive=function(t){return e.check(co(0,t))},e.nonnegative=function(t){return e.check(lo(0,t))},e.negative=function(t){return e.check(oo(0,t))},e.nonpositive=function(t){return e.check(so(0,t))},e.multipleOf=function(t,n){return e.check(uo(t,n))},e.step=function(t,n){return e.check(uo(t,n))},e.finite=function(){return e};var n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function gs(e){return function(e,t){return new hs(I({type:`number`,checks:[]},H(t)))}(0,e)}var _s=B(`ZodNumberFormat`,function(e,t){ya.init(e,t),hs.init(e,t)});function vs(e){return function(e,t){return new _s(I({type:`number`,check:`number_format`,abort:!1,format:`safeint`},H(t)))}(0,e)}var ys=B(`ZodBoolean`,function(e,t){ba.init(e,t),Ko.init(e,t)});function bs(e){return function(e,t){return new ys(I({type:`boolean`},H(t)))}(0,e)}var xs=B(`ZodNull`,function(e,t){xa.init(e,t),Ko.init(e,t)});function Ss(e){return function(e,t){return new xs(I({type:`null`},H(t)))}(0,e)}var Cs=B(`ZodUnknown`,function(e,t){Sa.init(e,t),Ko.init(e,t)});function ws(){return new Cs({type:`unknown`})}var Ts=B(`ZodNever`,function(e,t){Ca.init(e,t),Ko.init(e,t)});function Es(e){return function(e,t){return new Ts(I({type:`never`},H(t)))}(0,e)}var Ds=B(`ZodArray`,function(e,t){Ta.init(e,t),Ko.init(e,t),e.element=t.element,e.min=function(t,n){return e.check(po(t,n))},e.nonempty=function(t){return e.check(po(1,t))},e.max=function(t,n){return e.check(fo(t,n))},e.length=function(t,n){return e.check(mo(t,n))},e.unwrap=function(){return e.element}});function Os(e,t){return function(e,t,n){return new Ds(I({type:`array`,element:t},H(n)))}(0,e,t)}var ks=B(`ZodObject`,function(e,t){Aa.init(e,t),Ko.init(e,t),V(e,`shape`,function(){return t.shape}),e.keyof=function(){return zs(Object.keys(e._zod.def.shape))},e.catchall=function(t){return e.clone(I(I({},e._zod.def),{},{catchall:t}))},e.passthrough=function(){return e.clone(I(I({},e._zod.def),{},{catchall:ws()}))},e.loose=function(){return e.clone(I(I({},e._zod.def),{},{catchall:ws()}))},e.strict=function(){return e.clone(I(I({},e._zod.def),{},{catchall:Es()}))},e.strip=function(){return e.clone(I(I({},e._zod.def),{},{catchall:void 0}))},e.extend=function(t){return function(e,t){if(!Tr(t))throw Error(`Invalid input to extend: expected a plain object`);var n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return kr(e,br(e._zod.def,{get shape(){var n=I(I({},e._zod.def.shape),t);return yr(this,`shape`,n),n},checks:[]}))}(e,t)},e.safeExtend=function(t){return function(e,t){if(!Tr(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return kr(e,I(I({},e._zod.def),{},{get shape(){var n=I(I({},e._zod.def.shape),t);return yr(this,`shape`,n),n},checks:e._zod.def.checks}))}(e,t)},e.merge=function(t){return function(e,t){return kr(e,br(e._zod.def,{get shape(){var n=I(I({},e._zod.def.shape),t._zod.def.shape);return yr(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}(e,t)},e.pick=function(t){return function(e,t){var n=e._zod.def;return kr(e,br(e._zod.def,{get shape(){var e={};for(var r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return yr(this,`shape`,e),e},checks:[]}))}(e,t)},e.omit=function(t){return function(e,t){var n=e._zod.def;return kr(e,br(e._zod.def,{get shape(){var r=I({},e._zod.def.shape);for(var i in t){if(!(i in n.shape))throw Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return yr(this,`shape`,r),r},checks:[]}))}(e,t)},e.partial=function(){return function(e,t,n){return kr(t,br(t._zod.def,{get shape(){var r=t._zod.def.shape,i=I({},r);if(n)for(var a in n){if(!(a in r))throw Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=e?new e({type:`optional`,innerType:r[a]}):r[a])}else for(var o in r)i[o]=e?new e({type:`optional`,innerType:r[o]}):r[o];return yr(this,`shape`,i),i},checks:[]}))}(Hs,e,arguments.length<=0?void 0:arguments[0])},e.required=function(){return function(e,t,n){return kr(t,br(t._zod.def,{get shape(){var r=t._zod.def.shape,i=I({},r);if(n)for(var a in n){if(!(a in i))throw Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:`nonoptional`,innerType:r[a]}))}else for(var o in r)i[o]=new e({type:`nonoptional`,innerType:r[o]});return yr(this,`shape`,i),i},checks:[]}))}(Js,e,arguments.length<=0?void 0:arguments[0])}});function As(e,t){return new ks(I({type:`object`,shape:e??{}},H(t)))}function js(e,t){return new ks(I({type:`object`,shape:e,catchall:Es()},H(t)))}var Ms=B(`ZodUnion`,function(e,t){Ma.init(e,t),Ko.init(e,t),e.options=t.options});function Ns(e,t){return new Ms(I({type:`union`,options:e},H(t)))}var Ps=B(`ZodDiscriminatedUnion`,function(e,t){Ms.init(e,t),Na.init(e,t)}),Fs=B(`ZodIntersection`,function(e,t){Pa.init(e,t),Ko.init(e,t)}),Is=B(`ZodRecord`,function(e,t){La.init(e,t),Ko.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ls(e,t,n){return new Is(I({type:`record`,keyType:e,valueType:t},H(n)))}var Rs=B(`ZodEnum`,function(e,t){Ra.init(e,t),Ko.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);var n=new Set(Object.keys(t.entries));e.extract=function(e,r){var i,a={},o=N(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!n.has(s))throw Error(`Key ${s} not found in enum`);a[s]=t.entries[s]}}catch(e){o.e(e)}finally{o.f()}return new Rs(I(I(I({},t),{},{checks:[]},H(r)),{},{entries:a}))},e.exclude=function(e,r){var i,a=I({},t.entries),o=N(e);try{for(o.s();!(i=o.n()).done;){var s=i.value;if(!n.has(s))throw Error(`Key ${s} not found in enum`);delete a[s]}}catch(e){o.e(e)}finally{o.f()}return new Rs(I(I(I({},t),{},{checks:[]},H(r)),{},{entries:a}))}});function zs(e,t){return new Rs(I({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(function(e){return[e,e]})):e},H(t)))}var Bs=B(`ZodLiteral`,function(e,t){za.init(e,t),Ko.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get:function(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function W(e,t){return new Bs(I({type:`literal`,values:Array.isArray(e)?e:[e]},H(t)))}var Vs=B(`ZodTransform`,function(e,t){Ba.init(e,t),Ko.init(e,t),e._zod.parse=function(n,r){if(r.direction===`backward`)throw new ur(e.constructor.name);n.addIssue=function(r){if(typeof r==`string`)n.issues.push(Lr(r,n.value,t));else{var i=r;i.fatal&&(i.continue=!1),i.code??=`custom`,i.input??=n.value,i.inst??=e,n.issues.push(Lr(i))}};var i=t.transform(n.value,n);return i instanceof Promise?i.then(function(e){return n.value=e,n}):(n.value=i,n)}}),Hs=B(`ZodOptional`,function(e,t){Ha.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function Us(e){return new Hs({type:`optional`,innerType:e})}var Ws=B(`ZodNullable`,function(e,t){Ua.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType}});function Gs(e){return new Ws({type:`nullable`,innerType:e})}var Ks=B(`ZodDefault`,function(e,t){Wa.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeDefault=e.unwrap}),qs=B(`ZodPrefault`,function(e,t){Ka.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType}}),Js=B(`ZodNonOptional`,function(e,t){qa.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType}}),Ys=B(`ZodCatch`,function(e,t){Ya.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType},e.removeCatch=e.unwrap}),Xs=B(`ZodPipe`,function(e,t){Xa.init(e,t),Ko.init(e,t),e.in=t.in,e.out=t.out});function Zs(e,t){return new Xs({type:`pipe`,in:e,out:t})}var Qs,$s,ec=B(`ZodReadonly`,function(e,t){Qa.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.innerType}}),tc=B(`ZodLazy`,function(e,t){eo.init(e,t),Ko.init(e,t),e.unwrap=function(){return e._zod.def.getter()}}),nc=B(`ZodCustom`,function(e,t){to.init(e,t),Ko.init(e,t)});function rc(e,t){return function(e,t,n){var r=H(n);return r.abort??=!0,new e(I({type:`custom`,check:`custom`,fn:t},r))}(nc,e??function(){return!0},t)}function ic(e){var t=new nc(I({type:`custom`,check:`custom`,fn:function(t){return t instanceof e},abort:!0},H(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{error:`Input not instance of ${e.name}`})));return t._zod.bag.Class=e,t}(function(e){e.assertEqual=function(e){},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=function(e){var t,n={},r=N(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;n[i]=i}}catch(e){r.e(e)}finally{r.f()}return n},e.getValidEnumValues=function(t){var n,r={},i=N(e.objectKeys(t).filter(function(e){return typeof t[t[e]]!=`number`}));try{for(i.s();!(n=i.n()).done;){var a=n.value;r[a]=t[a]}}catch(e){i.e(e)}finally{i.f()}return e.objectValues(r)},e.objectValues=function(t){return e.objectKeys(t).map(function(e){return t[e]})},e.objectKeys=typeof Object.keys==`function`?function(e){return Object.keys(e)}:function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=function(e,t){var n,r=N(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(t(i))return i}}catch(e){r.e(e)}finally{r.f()}},e.isInteger=typeof Number.isInteger==`function`?function(e){return Number.isInteger(e)}:function(e){return typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e},e.joinValues=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:` | `;return e.map(function(e){return typeof e==`string`?`'${e}'`:e}).join(t)},e.jsonStringifyReplacer=function(e,t){return typeof t==`bigint`?t.toString():t}})(Qs||={}),($s||={}).mergeShapes=function(e,t){return I(I({},e),t)};var G=Qs.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),ac=function(e){switch(Fn(e)){case`undefined`:return G.undefined;case`string`:return G.string;case`number`:return Number.isNaN(e)?G.nan:G.number;case`boolean`:return G.boolean;case`function`:return G.function;case`bigint`:return G.bigint;case`symbol`:return G.symbol;case`object`:return Array.isArray(e)?G.array:e===null?G.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?G.promise:typeof Map<`u`&&e instanceof Map?G.map:typeof Set<`u`&&e instanceof Set?G.set:typeof Date<`u`&&e instanceof Date?G.date:G.object;default:return G.unknown}},K=Qs.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`]),oc=function(){function e(t){var n;j(this,e),(n=A(this,e)).issues=[],n.addIssue=function(e){n.issues=[].concat(z(n.issues),[e])},n.addIssues=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];n.issues=[].concat(z(n.issues),z(e))};var r=(this instanceof e?this.constructor:void 0).prototype;return Object.setPrototypeOf?Object.setPrototypeOf(n,r):n.__proto__=r,n.name=`ZodError`,n.issues=t,n}return F(e,Ln(Error)),M(e,[{key:`errors`,get:function(){return this.issues}},{key:`format`,value:function(e){var t=e||function(e){return e.message},n={_errors:[]},r=function(e){var i,a=N(e.issues);try{for(a.s();!(i=a.n()).done;){var o=i.value;if(o.code===`invalid_union`)o.unionErrors.map(r);else if(o.code===`invalid_return_type`)r(o.returnTypeError);else if(o.code===`invalid_arguments`)r(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else for(var s=n,c=0;c<o.path.length;){var l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}}catch(e){a.e(e)}finally{a.f()}};return r(this),n}},{key:`toString`,value:function(){return this.message}},{key:`message`,get:function(){return JSON.stringify(this.issues,Qs.jsonStringifyReplacer,2)}},{key:`isEmpty`,get:function(){return this.issues.length===0}},{key:`flatten`,value:function(){var e,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e.message},n=Object.create(null),r=[],i=N(this.issues);try{for(i.s();!(e=i.n()).done;){var a=e.value;if(a.path.length>0){var o=a.path[0];n[o]=n[o]||[],n[o].push(t(a))}else r.push(t(a))}}catch(e){i.e(e)}finally{i.f()}return{formErrors:r,fieldErrors:n}}},{key:`formErrors`,get:function(){return this.flatten()}}],[{key:`assert`,value:function(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}}])}();oc.create=function(e){return new oc(e)};var sc=function(e,t){var n;switch(e.code){case K.invalid_type:n=e.received===G.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Qs.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${Qs.joinValues(e.keys,`, `)}`;break;case K.invalid_union:n=`Invalid input`;break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Qs.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${Qs.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n=`Invalid function arguments`;break;case K.invalid_return_type:n=`Invalid function return type`;break;case K.invalid_date:n=`Invalid date`;break;case K.invalid_string:Fn(e.validation)===`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(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}"`:Qs.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case K.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`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 K.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case K.custom:n=`Invalid input`;break;case K.invalid_intersection_types:n=`Intersection results could not be merged`;break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Qs.assertNever(e)}return{message:n}},cc=sc;function lc(){return cc}var uc=function(e){var t=e.data,n=e.path,r=e.errorMaps,i=e.issueData,a=[].concat(z(n),z(i.path||[])),o=I(I({},i),{},{path:a});if(i.message!==void 0)return I(I({},i),{},{path:a,message:i.message});var s,c=``,l=N(r.filter(function(e){return!!e}).slice().reverse());try{for(l.s();!(s=l.n()).done;)c=(0,s.value)(o,{data:t,defaultError:c}).message}catch(e){l.e(e)}finally{l.f()}return I(I({},i),{},{path:a,message:c})};function q(e,t){var n=lc(),r=uc({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===sc?void 0:sc].filter(function(e){return!!e})});e.common.issues.push(r)}var J,dc=function(){function e(){j(this,e),this.value=`valid`}return M(e,[{key:`dirty`,value:function(){this.value===`valid`&&(this.value=`dirty`)}},{key:`abort`,value:function(){this.value!==`aborted`&&(this.value=`aborted`)}}],[{key:`mergeArray`,value:function(e,t){var n,r=[],i=N(t);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.status===`aborted`)return Y;a.status===`dirty`&&e.dirty(),r.push(a.value)}}catch(e){i.e(e)}finally{i.f()}return{status:e.value,value:r}}},{key:`mergeObjectAsync`,value:(t=k(L().m(function t(n,r){var i,a,o,s,c,l,u;return L().w(function(t){for(;;)switch(t.p=t.n){case 0:i=[],a=N(r),t.p=1,a.s();case 2:if((o=a.n()).done){t.n=6;break}return s=o.value,t.n=3,s.key;case 3:return c=t.v,t.n=4,s.value;case 4:l=t.v,i.push({key:c,value:l});case 5:t.n=2;break;case 6:t.n=8;break;case 7:t.p=7,u=t.v,a.e(u);case 8:return t.p=8,a.f(),t.f(8);case 9:return t.a(2,e.mergeObjectSync(n,i))}},t,null,[[1,7,8,9]])})),function(e,n){return t.apply(this,arguments)})},{key:`mergeObjectSync`,value:function(e,t){var n,r={},i=N(t);try{for(i.s();!(n=i.n()).done;){var a=n.value,o=a.key,s=a.value;if(o.status===`aborted`||s.status===`aborted`)return Y;o.status===`dirty`&&e.dirty(),s.status===`dirty`&&e.dirty(),o.value===`__proto__`||s.value===void 0&&!a.alwaysSet||(r[o.value]=s.value)}}catch(e){i.e(e)}finally{i.f()}return{status:e.value,value:r}}}]);var t}(),Y=Object.freeze({status:`aborted`}),fc=function(e){return{status:`dirty`,value:e}},pc=function(e){return{status:`valid`,value:e}},mc=function(e){return e.status===`aborted`},hc=function(e){return e.status===`dirty`},gc=function(e){return e.status===`valid`},_c=function(e){return typeof Promise<`u`&&e instanceof Promise};(function(e){e.errToObj=function(e){return typeof e==`string`?{message:e}:e||{}},e.toString=function(e){return typeof e==`string`?e:e?.message}})(J||={});var vc=M(function e(t,n,r,i){j(this,e),this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i},[{key:`path`,get:function(){var e,t;return this._cachedPath.length||(Array.isArray(this._key)?(e=this._cachedPath).push.apply(e,z(this._path).concat(z(this._key))):(t=this._cachedPath).push.apply(t,z(this._path).concat([this._key]))),this._cachedPath}}]),yc=function(e,t){if(gc(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;var t=new oc(e.common.issues);return this._error=t,this._error}}};function X(e){if(!e)return{};var t=e.errorMap,n=e.invalid_type_error,r=e.required_error,i=e.description;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:function(t,i){var a=e.message;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var bc,Z=function(){return M(function e(t){var n=this;j(this,e),this.spa=this.safeParseAsync,this._def=t,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:function(e){return n[`~validate`](e)}}},[{key:`description`,get:function(){return this._def.description}},{key:`_getType`,value:function(e){return ac(e.data)}},{key:`_getOrReturnCtx`,value:function(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ac(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}},{key:`_processInputParams`,value:function(e){return{status:new dc,ctx:{common:e.parent.common,data:e.data,parsedType:ac(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}},{key:`_parseSync`,value:function(e){var t=this._parse(e);if(_c(t))throw Error(`Synchronous parse encountered promise.`);return t}},{key:`_parseAsync`,value:function(e){var t=this._parse(e);return Promise.resolve(t)}},{key:`parse`,value:function(e,t){var n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}},{key:`safeParse`,value:function(e,t){var n,r={common:{issues:[],async:(n=t?.async)!=null&&n,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ac(e)};return yc(r,this._parseSync({data:e,path:r.path,parent:r}))}},{key:`~validate`,value:function(e){var t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ac(e)};if(!this[`~standard`].async)try{var n=this._parseSync({data:e,path:[],parent:t});return gc(n)?{value:n.value}:{issues:t.common.issues}}catch(e){var r;e!=null&&(r=e.message)!=null&&(r=r.toLowerCase())!=null&&r.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(function(e){return gc(e)?{value:e.value}:{issues:t.common.issues}})}},{key:`parseAsync`,value:(e=k(L().m(function e(t,n){var r;return L().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.safeParseAsync(t,n);case 1:if(!(r=e.v).success){e.n=2;break}return e.a(2,r.data);case 2:throw r.error;case 3:return e.a(2)}},e,this)})),function(t,n){return e.apply(this,arguments)})},{key:`safeParseAsync`,value:function(){var e=k(L().m(function e(t,n){var r,i,a;return L().w(function(e){for(;;)switch(e.n){case 0:return r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ac(t)},i=this._parse({data:t,path:r.path,parent:r}),e.n=1,_c(i)?i:Promise.resolve(i);case 1:return a=e.v,e.a(2,yc(r,a))}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()},{key:`refine`,value:function(e,t){return this._refinement(function(n,r){var i=e(n),a=function(){return r.addIssue(I({code:K.custom},function(e){return typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t}(n)))};return typeof Promise<`u`&&i instanceof Promise?i.then(function(e){return!!e||(a(),!1)}):!!i||(a(),!1)})}},{key:`refinement`,value:function(e,t){return this._refinement(function(n,r){return!!e(n)||(r.addIssue(typeof t==`function`?t(n,r):t),!1)})}},{key:`_refinement`,value:function(e){return new xl({schema:this,typeName:Q.ZodEffects,effect:{type:`refinement`,refinement:e}})}},{key:`superRefine`,value:function(e){return this._refinement(e)}},{key:`optional`,value:function(){return Sl.create(this,this._def)}},{key:`nullable`,value:function(){return Cl.create(this,this._def)}},{key:`nullish`,value:function(){return this.nullable().optional()}},{key:`array`,value:function(){return nl.create(this)}},{key:`promise`,value:function(){return bl.create(this,this._def)}},{key:`or`,value:function(e){return al.create([this,e],this._def)}},{key:`and`,value:function(e){return ll.create(this,e,this._def)}},{key:`transform`,value:function(e){return new xl(I(I({},X(this._def)),{},{schema:this,typeName:Q.ZodEffects,effect:{type:`transform`,transform:e}}))}},{key:`default`,value:function(e){var t=typeof e==`function`?e:function(){return e};return new wl(I(I({},X(this._def)),{},{innerType:this,defaultValue:t,typeName:Q.ZodDefault}))}},{key:`brand`,value:function(){return new Dl(I({typeName:Q.ZodBranded,type:this},X(this._def)))}},{key:`catch`,value:function(e){var t=typeof e==`function`?e:function(){return e};return new Tl(I(I({},X(this._def)),{},{innerType:this,catchValue:t,typeName:Q.ZodCatch}))}},{key:`describe`,value:function(e){return new this.constructor(I(I({},this._def),{},{description:e}))}},{key:`pipe`,value:function(e){return Ol.create(this,e)}},{key:`readonly`,value:function(){return kl.create(this)}},{key:`isOptional`,value:function(){return this.safeParse(void 0).success}},{key:`isNullable`,value:function(){return this.safeParse(null).success}}]);var e}(),xc=/^c[^\s-]{8,}$/i,Sc=/^[0-9a-z]+$/,Cc=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wc=/^[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,Tc=/^[a-z0-9_-]{21}$/i,Ec=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Dc=/^[-+]?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)?)??$/,Oc=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kc=/^(?:(?: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])$/,Ac=/^(?:(?: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])$/,jc=/^(([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]))$/,Mc=/^(([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])$/,Nc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Pc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fc=`((\\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])))`,Ic=RegExp(`^${Fc}\$`);function Lc(e){var t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);var n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Rc(e){return RegExp(`^${Lc(e)}\$`)}function zc(e){var t=`${Fc}T${Lc(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}\$`)}function Bc(e,t){return!(t!==`v4`&&t||!kc.test(e))||!(t!==`v6`&&t||!jc.test(e))}function Vc(e,t){if(!Ec.test(e))return!1;try{var n=R(e.split(`.`),1)[0];if(!n)return!1;var r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(Fn(i)!==`object`||i===null||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Hc(e,t){return!(t!==`v4`&&t||!Ac.test(e))||!(t!==`v6`&&t||!Mc.test(e))}var Uc=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==G.string){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.string,received:t.parsedType}),Y}var n,r=new dc,i=void 0,a=N(this._def.checks);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(o.kind===`min`)e.data.length<o.value&&(q(i=this._getOrReturnCtx(e,i),{code:K.too_small,minimum:o.value,type:`string`,inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind===`max`)e.data.length>o.value&&(q(i=this._getOrReturnCtx(e,i),{code:K.too_big,maximum:o.value,type:`string`,inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind===`length`){var s=e.data.length>o.value,c=e.data.length<o.value;(s||c)&&(i=this._getOrReturnCtx(e,i),s?q(i,{code:K.too_big,maximum:o.value,type:`string`,inclusive:!0,exact:!0,message:o.message}):c&&q(i,{code:K.too_small,minimum:o.value,type:`string`,inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind===`email`)Oc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`email`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`emoji`)bc||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),bc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`emoji`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`uuid`)wc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`uuid`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`nanoid`)Tc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`nanoid`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`cuid`)xc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`cuid`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`cuid2`)Sc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`cuid2`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`ulid`)Cc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`ulid`,code:K.invalid_string,message:o.message}),r.dirty());else if(o.kind===`url`)try{new URL(e.data)}catch{q(i=this._getOrReturnCtx(e,i),{validation:`url`,code:K.invalid_string,message:o.message}),r.dirty()}else o.kind===`regex`?(o.regex.lastIndex=0,o.regex.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`regex`,code:K.invalid_string,message:o.message}),r.dirty())):o.kind===`trim`?e.data=e.data.trim():o.kind===`includes`?e.data.includes(o.value,o.position)||(q(i=this._getOrReturnCtx(e,i),{code:K.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind===`toLowerCase`?e.data=e.data.toLowerCase():o.kind===`toUpperCase`?e.data=e.data.toUpperCase():o.kind===`startsWith`?e.data.startsWith(o.value)||(q(i=this._getOrReturnCtx(e,i),{code:K.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind===`endsWith`?e.data.endsWith(o.value)||(q(i=this._getOrReturnCtx(e,i),{code:K.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind===`datetime`?zc(o).test(e.data)||(q(i=this._getOrReturnCtx(e,i),{code:K.invalid_string,validation:`datetime`,message:o.message}),r.dirty()):o.kind===`date`?Ic.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{code:K.invalid_string,validation:`date`,message:o.message}),r.dirty()):o.kind===`time`?Rc(o).test(e.data)||(q(i=this._getOrReturnCtx(e,i),{code:K.invalid_string,validation:`time`,message:o.message}),r.dirty()):o.kind===`duration`?Dc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`duration`,code:K.invalid_string,message:o.message}),r.dirty()):o.kind===`ip`?Bc(e.data,o.version)||(q(i=this._getOrReturnCtx(e,i),{validation:`ip`,code:K.invalid_string,message:o.message}),r.dirty()):o.kind===`jwt`?Vc(e.data,o.alg)||(q(i=this._getOrReturnCtx(e,i),{validation:`jwt`,code:K.invalid_string,message:o.message}),r.dirty()):o.kind===`cidr`?Hc(e.data,o.version)||(q(i=this._getOrReturnCtx(e,i),{validation:`cidr`,code:K.invalid_string,message:o.message}),r.dirty()):o.kind===`base64`?Nc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`base64`,code:K.invalid_string,message:o.message}),r.dirty()):o.kind===`base64url`?Pc.test(e.data)||(q(i=this._getOrReturnCtx(e,i),{validation:`base64url`,code:K.invalid_string,message:o.message}),r.dirty()):Qs.assertNever(o)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:e.data}}},{key:`_regex`,value:function(e,t,n){return this.refinement(function(t){return e.test(t)},I({validation:t,code:K.invalid_string},J.errToObj(n)))}},{key:`_addCheck`,value:function(t){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[t])}))}},{key:`email`,value:function(e){return this._addCheck(I({kind:`email`},J.errToObj(e)))}},{key:`url`,value:function(e){return this._addCheck(I({kind:`url`},J.errToObj(e)))}},{key:`emoji`,value:function(e){return this._addCheck(I({kind:`emoji`},J.errToObj(e)))}},{key:`uuid`,value:function(e){return this._addCheck(I({kind:`uuid`},J.errToObj(e)))}},{key:`nanoid`,value:function(e){return this._addCheck(I({kind:`nanoid`},J.errToObj(e)))}},{key:`cuid`,value:function(e){return this._addCheck(I({kind:`cuid`},J.errToObj(e)))}},{key:`cuid2`,value:function(e){return this._addCheck(I({kind:`cuid2`},J.errToObj(e)))}},{key:`ulid`,value:function(e){return this._addCheck(I({kind:`ulid`},J.errToObj(e)))}},{key:`base64`,value:function(e){return this._addCheck(I({kind:`base64`},J.errToObj(e)))}},{key:`base64url`,value:function(e){return this._addCheck(I({kind:`base64url`},J.errToObj(e)))}},{key:`jwt`,value:function(e){return this._addCheck(I({kind:`jwt`},J.errToObj(e)))}},{key:`ip`,value:function(e){return this._addCheck(I({kind:`ip`},J.errToObj(e)))}},{key:`cidr`,value:function(e){return this._addCheck(I({kind:`cidr`},J.errToObj(e)))}},{key:`datetime`,value:function(e){var t,n;return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck(I({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:(t=e?.offset)!=null&&t,local:(n=e?.local)!=null&&n},J.errToObj(e?.message)))}},{key:`date`,value:function(e){return this._addCheck({kind:`date`,message:e})}},{key:`time`,value:function(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck(I({kind:`time`,precision:e?.precision===void 0?null:e?.precision},J.errToObj(e?.message)))}},{key:`duration`,value:function(e){return this._addCheck(I({kind:`duration`},J.errToObj(e)))}},{key:`regex`,value:function(e,t){return this._addCheck(I({kind:`regex`,regex:e},J.errToObj(t)))}},{key:`includes`,value:function(e,t){return this._addCheck(I({kind:`includes`,value:e,position:t?.position},J.errToObj(t?.message)))}},{key:`startsWith`,value:function(e,t){return this._addCheck(I({kind:`startsWith`,value:e},J.errToObj(t)))}},{key:`endsWith`,value:function(e,t){return this._addCheck(I({kind:`endsWith`,value:e},J.errToObj(t)))}},{key:`min`,value:function(e,t){return this._addCheck(I({kind:`min`,value:e},J.errToObj(t)))}},{key:`max`,value:function(e,t){return this._addCheck(I({kind:`max`,value:e},J.errToObj(t)))}},{key:`length`,value:function(e,t){return this._addCheck(I({kind:`length`,value:e},J.errToObj(t)))}},{key:`nonempty`,value:function(e){return this.min(1,J.errToObj(e))}},{key:`trim`,value:function(){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[{kind:`trim`}])}))}},{key:`toLowerCase`,value:function(){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[{kind:`toLowerCase`}])}))}},{key:`toUpperCase`,value:function(){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[{kind:`toUpperCase`}])}))}},{key:`isDatetime`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`datetime`})}},{key:`isDate`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`date`})}},{key:`isTime`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`time`})}},{key:`isDuration`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`duration`})}},{key:`isEmail`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`email`})}},{key:`isURL`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`url`})}},{key:`isEmoji`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`emoji`})}},{key:`isUUID`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`uuid`})}},{key:`isNANOID`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`nanoid`})}},{key:`isCUID`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`cuid`})}},{key:`isCUID2`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`cuid2`})}},{key:`isULID`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`ulid`})}},{key:`isIP`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`ip`})}},{key:`isCIDR`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`cidr`})}},{key:`isBase64`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`base64`})}},{key:`isBase64url`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`base64url`})}},{key:`minLength`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`min`&&(t===null||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`maxLength`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`max`&&(t===null||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}();function Wc(e,t){var n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}Uc.create=function(e){var t;return new Uc(I({checks:[],typeName:Q.ZodString,coerce:(t=e?.coerce)!=null&&t},X(e)))};var Gc=function(){function e(){var t;return j(this,e),(t=A(this,e,arguments)).min=t.gte,t.max=t.lte,t.step=t.multipleOf,t}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==G.number){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.number,received:t.parsedType}),Y}var n,r=void 0,i=new dc,a=N(this._def.checks);try{for(a.s();!(n=a.n()).done;){var o=n.value;o.kind===`int`?Qs.isInteger(e.data)||(q(r=this._getOrReturnCtx(e,r),{code:K.invalid_type,expected:`integer`,received:`float`,message:o.message}),i.dirty()):o.kind===`min`?(o.inclusive?e.data<o.value:e.data<=o.value)&&(q(r=this._getOrReturnCtx(e,r),{code:K.too_small,minimum:o.value,type:`number`,inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind===`max`?(o.inclusive?e.data>o.value:e.data>=o.value)&&(q(r=this._getOrReturnCtx(e,r),{code:K.too_big,maximum:o.value,type:`number`,inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind===`multipleOf`?Wc(e.data,o.value)!==0&&(q(r=this._getOrReturnCtx(e,r),{code:K.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind===`finite`?Number.isFinite(e.data)||(q(r=this._getOrReturnCtx(e,r),{code:K.not_finite,message:o.message}),i.dirty()):Qs.assertNever(o)}}catch(e){a.e(e)}finally{a.f()}return{status:i.value,value:e.data}}},{key:`gte`,value:function(e,t){return this.setLimit(`min`,e,!0,J.toString(t))}},{key:`gt`,value:function(e,t){return this.setLimit(`min`,e,!1,J.toString(t))}},{key:`lte`,value:function(e,t){return this.setLimit(`max`,e,!0,J.toString(t))}},{key:`lt`,value:function(e,t){return this.setLimit(`max`,e,!1,J.toString(t))}},{key:`setLimit`,value:function(t,n,r,i){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[{kind:t,value:n,inclusive:r,message:J.toString(i)}])}))}},{key:`_addCheck`,value:function(t){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[t])}))}},{key:`int`,value:function(e){return this._addCheck({kind:`int`,message:J.toString(e)})}},{key:`positive`,value:function(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:J.toString(e)})}},{key:`negative`,value:function(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:J.toString(e)})}},{key:`nonpositive`,value:function(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:J.toString(e)})}},{key:`nonnegative`,value:function(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:J.toString(e)})}},{key:`multipleOf`,value:function(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:J.toString(t)})}},{key:`finite`,value:function(e){return this._addCheck({kind:`finite`,message:J.toString(e)})}},{key:`safe`,value:function(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:J.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:J.toString(e)})}},{key:`minValue`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`min`&&(t===null||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`maxValue`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`max`&&(t===null||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`isInt`,get:function(){return!!this._def.checks.find(function(e){return e.kind===`int`||e.kind===`multipleOf`&&Qs.isInteger(e.value)})}},{key:`isFinite`,get:function(){var e,t=null,n=null,r=N(this._def.checks);try{for(r.s();!(e=r.n()).done;){var i=e.value;if(i.kind===`finite`||i.kind===`int`||i.kind===`multipleOf`)return!0;i.kind===`min`?(n===null||i.value>n)&&(n=i.value):i.kind===`max`&&(t===null||i.value<t)&&(t=i.value)}}catch(e){r.e(e)}finally{r.f()}return Number.isFinite(n)&&Number.isFinite(t)}}])}();Gc.create=function(e){return new Gc(I({checks:[],typeName:Q.ZodNumber,coerce:e?.coerce||!1},X(e)))};var Kc=function(){function e(){var t;return j(this,e),(t=A(this,e,arguments)).min=t.gte,t.max=t.lte,t}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==G.bigint)return this._getInvalidInput(e);var t,n=void 0,r=new dc,i=N(this._def.checks);try{for(i.s();!(t=i.n()).done;){var a=t.value;a.kind===`min`?(a.inclusive?e.data<a.value:e.data<=a.value)&&(q(n=this._getOrReturnCtx(e,n),{code:K.too_small,type:`bigint`,minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind===`max`?(a.inclusive?e.data>a.value:e.data>=a.value)&&(q(n=this._getOrReturnCtx(e,n),{code:K.too_big,type:`bigint`,maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty()):a.kind===`multipleOf`?e.data%a.value!==BigInt(0)&&(q(n=this._getOrReturnCtx(e,n),{code:K.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):Qs.assertNever(a)}}catch(e){i.e(e)}finally{i.f()}return{status:r.value,value:e.data}}},{key:`_getInvalidInput`,value:function(e){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.bigint,received:t.parsedType}),Y}},{key:`gte`,value:function(e,t){return this.setLimit(`min`,e,!0,J.toString(t))}},{key:`gt`,value:function(e,t){return this.setLimit(`min`,e,!1,J.toString(t))}},{key:`lte`,value:function(e,t){return this.setLimit(`max`,e,!0,J.toString(t))}},{key:`lt`,value:function(e,t){return this.setLimit(`max`,e,!1,J.toString(t))}},{key:`setLimit`,value:function(t,n,r,i){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[{kind:t,value:n,inclusive:r,message:J.toString(i)}])}))}},{key:`_addCheck`,value:function(t){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[t])}))}},{key:`positive`,value:function(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:J.toString(e)})}},{key:`negative`,value:function(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:J.toString(e)})}},{key:`nonpositive`,value:function(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:J.toString(e)})}},{key:`nonnegative`,value:function(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:J.toString(e)})}},{key:`multipleOf`,value:function(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:J.toString(t)})}},{key:`minValue`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`min`&&(t===null||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`maxValue`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`max`&&(t===null||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t}}])}();Kc.create=function(e){var t;return new Kc(I({checks:[],typeName:Q.ZodBigInt,coerce:(t=e?.coerce)!=null&&t},X(e)))};var qc=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==G.boolean){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.boolean,received:t.parsedType}),Y}return pc(e.data)}}])}();qc.create=function(e){return new qc(I({typeName:Q.ZodBoolean,coerce:e?.coerce||!1},X(e)))};var Jc=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==G.date){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.date,received:t.parsedType}),Y}if(Number.isNaN(e.data.getTime()))return q(this._getOrReturnCtx(e),{code:K.invalid_date}),Y;var n,r=new dc,i=void 0,a=N(this._def.checks);try{for(a.s();!(n=a.n()).done;){var o=n.value;o.kind===`min`?e.data.getTime()<o.value&&(q(i=this._getOrReturnCtx(e,i),{code:K.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:`date`}),r.dirty()):o.kind===`max`?e.data.getTime()>o.value&&(q(i=this._getOrReturnCtx(e,i),{code:K.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:`date`}),r.dirty()):Qs.assertNever(o)}}catch(e){a.e(e)}finally{a.f()}return{status:r.value,value:new Date(e.data.getTime())}}},{key:`_addCheck`,value:function(t){return new e(I(I({},this._def),{},{checks:[].concat(z(this._def.checks),[t])}))}},{key:`min`,value:function(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:J.toString(t)})}},{key:`max`,value:function(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:J.toString(t)})}},{key:`minDate`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`min`&&(t===null||r.value>t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t==null?null:new Date(t)}},{key:`maxDate`,get:function(){var e,t=null,n=N(this._def.checks);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.kind===`max`&&(t===null||r.value<t)&&(t=r.value)}}catch(e){n.e(e)}finally{n.f()}return t==null?null:new Date(t)}}])}();Jc.create=function(e){return new Jc(I({checks:[],coerce:e?.coerce||!1,typeName:Q.ZodDate},X(e)))};var Yc=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._getType(e)!==G.symbol){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.symbol,received:t.parsedType}),Y}return pc(e.data)}}])}();Yc.create=function(e){return new Yc(I({typeName:Q.ZodSymbol},X(e)))};var Xc=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._getType(e)!==G.undefined){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.undefined,received:t.parsedType}),Y}return pc(e.data)}}])}();Xc.create=function(e){return new Xc(I({typeName:Q.ZodUndefined},X(e)))};var Zc=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._getType(e)!==G.null){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.null,received:t.parsedType}),Y}return pc(e.data)}}])}();Zc.create=function(e){return new Zc(I({typeName:Q.ZodNull},X(e)))};var Qc=function(){function e(){var t;return j(this,e),(t=A(this,e,arguments))._any=!0,t}return F(e,Z),M(e,[{key:`_parse`,value:function(e){return pc(e.data)}}])}();Qc.create=function(e){return new Qc(I({typeName:Q.ZodAny},X(e)))};var $c=function(){function e(){var t;return j(this,e),(t=A(this,e,arguments))._unknown=!0,t}return F(e,Z),M(e,[{key:`_parse`,value:function(e){return pc(e.data)}}])}();$c.create=function(e){return new $c(I({typeName:Q.ZodUnknown},X(e)))};var el=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.never,received:t.parsedType}),Y}}])}();el.create=function(e){return new el(I({typeName:Q.ZodNever},X(e)))};var tl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._getType(e)!==G.undefined){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.void,received:t.parsedType}),Y}return pc(e.data)}}])}();tl.create=function(e){return new tl(I({typeName:Q.ZodVoid},X(e)))};var nl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e),n=t.ctx,r=t.status,i=this._def;if(n.parsedType!==G.array)return q(n,{code:K.invalid_type,expected:G.array,received:n.parsedType}),Y;if(i.exactLength!==null){var a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(q(n,{code:a?K.too_big:K.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(q(n,{code:K.too_small,minimum:i.minLength.value,type:`array`,inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(q(n,{code:K.too_big,maximum:i.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all(z(n.data).map(function(e,t){return i.type._parseAsync(new vc(n,e,n.path,t))})).then(function(e){return dc.mergeArray(r,e)});var s=z(n.data).map(function(e,t){return i.type._parseSync(new vc(n,e,n.path,t))});return dc.mergeArray(r,s)}},{key:`element`,get:function(){return this._def.type}},{key:`min`,value:function(t,n){return new e(I(I({},this._def),{},{minLength:{value:t,message:J.toString(n)}}))}},{key:`max`,value:function(t,n){return new e(I(I({},this._def),{},{maxLength:{value:t,message:J.toString(n)}}))}},{key:`length`,value:function(t,n){return new e(I(I({},this._def),{},{exactLength:{value:t,message:J.toString(n)}}))}},{key:`nonempty`,value:function(e){return this.min(1,e)}}])}();function rl(e){if(e instanceof il){var t={};for(var n in e.shape){var r=e.shape[n];t[n]=Sl.create(rl(r))}return new il(I(I({},e._def),{},{shape:function(){return t}}))}return e instanceof nl?new nl(I(I({},e._def),{},{type:rl(e.element)})):e instanceof Sl?Sl.create(rl(e.unwrap())):e instanceof Cl?Cl.create(rl(e.unwrap())):e instanceof ul?ul.create(e.items.map(function(e){return rl(e)})):e}nl.create=function(e,t){return new nl(I({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray},X(t)))};var il=function(){function e(){var t;return j(this,e),(t=A(this,e,arguments))._cached=null,t.nonstrict=t.passthrough,t.augment=t.extend,t}return F(e,Z),M(e,[{key:`_getCached`,value:function(){if(this._cached!==null)return this._cached;var e=this._def.shape(),t=Qs.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}},{key:`_parse`,value:function(e){if(this._getType(e)!==G.object){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.object,received:t.parsedType}),Y}var n=this._processInputParams(e),r=n.status,i=n.ctx,a=this._getCached(),o=a.shape,s=a.keys,c=[];if(!(this._def.catchall instanceof el&&this._def.unknownKeys===`strip`))for(var l in i.data)s.includes(l)||c.push(l);var u,d=[],f=N(s);try{for(f.s();!(u=f.n()).done;){var p=u.value,m=o[p],h=i.data[p];d.push({key:{status:`valid`,value:p},value:m._parse(new vc(i,h,i.path,p)),alwaysSet:p in i.data})}}catch(e){f.e(e)}finally{f.f()}if(this._def.catchall instanceof el){var g=this._def.unknownKeys;if(g===`passthrough`){var _,v=N(c);try{for(v.s();!(_=v.n()).done;){var y=_.value;d.push({key:{status:`valid`,value:y},value:{status:`valid`,value:i.data[y]}})}}catch(e){v.e(e)}finally{v.f()}}else if(g===`strict`)c.length>0&&(q(i,{code:K.unrecognized_keys,keys:c}),r.dirty());else if(g!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{var b,x=this._def.catchall,S=N(c);try{for(S.s();!(b=S.n()).done;){var C=b.value,w=i.data[C];d.push({key:{status:`valid`,value:C},value:x._parse(new vc(i,w,i.path,C)),alwaysSet:C in i.data})}}catch(e){S.e(e)}finally{S.f()}}return i.common.async?Promise.resolve().then(k(L().m(function e(){var t,n,r,i,a,o,s;return L().w(function(e){for(;;)switch(e.p=e.n){case 0:t=[],n=N(d),e.p=1,n.s();case 2:if((r=n.n()).done){e.n=6;break}return i=r.value,e.n=3,i.key;case 3:return a=e.v,e.n=4,i.value;case 4:o=e.v,t.push({key:a,value:o,alwaysSet:i.alwaysSet});case 5:e.n=2;break;case 6:e.n=8;break;case 7:e.p=7,s=e.v,n.e(s);case 8:return e.p=8,n.f(),e.f(8);case 9:return e.a(2,t)}},e,null,[[1,7,8,9]])}))).then(function(e){return dc.mergeObjectSync(r,e)}):dc.mergeObjectSync(r,d)}},{key:`shape`,get:function(){return this._def.shape()}},{key:`strict`,value:function(t){var n=this;return J.errToObj,new e(I(I({},this._def),{},{unknownKeys:`strict`},t===void 0?{}:{errorMap:function(e,r){var i,a=(i=n._def).errorMap?.call(i,e,r).message??r.defaultError;return e.code===`unrecognized_keys`?{message:J.errToObj(t).message??a}:{message:a}}}))}},{key:`strip`,value:function(){return new e(I(I({},this._def),{},{unknownKeys:`strip`}))}},{key:`passthrough`,value:function(){return new e(I(I({},this._def),{},{unknownKeys:`passthrough`}))}},{key:`extend`,value:function(t){var n=this;return new e(I(I({},this._def),{},{shape:function(){return I(I({},n._def.shape()),t)}}))}},{key:`merge`,value:function(t){var n=this;return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:function(){return I(I({},n._def.shape()),t._def.shape())},typeName:Q.ZodObject})}},{key:`setKey`,value:function(e,t){return this.augment(P({},e,t))}},{key:`catchall`,value:function(t){return new e(I(I({},this._def),{},{catchall:t}))}},{key:`pick`,value:function(t){var n,r={},i=N(Qs.objectKeys(t));try{for(i.s();!(n=i.n()).done;){var a=n.value;t[a]&&this.shape[a]&&(r[a]=this.shape[a])}}catch(e){i.e(e)}finally{i.f()}return new e(I(I({},this._def),{},{shape:function(){return r}}))}},{key:`omit`,value:function(t){var n,r={},i=N(Qs.objectKeys(this.shape));try{for(i.s();!(n=i.n()).done;){var a=n.value;t[a]||(r[a]=this.shape[a])}}catch(e){i.e(e)}finally{i.f()}return new e(I(I({},this._def),{},{shape:function(){return r}}))}},{key:`deepPartial`,value:function(){return rl(this)}},{key:`partial`,value:function(t){var n,r={},i=N(Qs.objectKeys(this.shape));try{for(i.s();!(n=i.n()).done;){var a=n.value,o=this.shape[a];t&&!t[a]?r[a]=o:r[a]=o.optional()}}catch(e){i.e(e)}finally{i.f()}return new e(I(I({},this._def),{},{shape:function(){return r}}))}},{key:`required`,value:function(t){var n,r={},i=N(Qs.objectKeys(this.shape));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(t&&!t[a])r[a]=this.shape[a];else{for(var o=this.shape[a];o instanceof Sl;)o=o._def.innerType;r[a]=o}}}catch(e){i.e(e)}finally{i.f()}return new e(I(I({},this._def),{},{shape:function(){return r}}))}},{key:`keyof`,value:function(){return _l(Qs.objectKeys(this.shape))}}])}();il.create=function(e,t){return new il(I({shape:function(){return e},unknownKeys:`strip`,catchall:el.create(),typeName:Q.ZodObject},X(t)))},il.strictCreate=function(e,t){return new il(I({shape:function(){return e},unknownKeys:`strict`,catchall:el.create(),typeName:Q.ZodObject},X(t)))},il.lazycreate=function(e,t){return new il(I({shape:e,unknownKeys:`strip`,catchall:el.create(),typeName:Q.ZodObject},X(t)))};var al=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e).ctx,n=this._def.options;if(t.common.async)return Promise.all(n.map(function(){var e=k(L().m(function e(n){var r,i,a;return L().w(function(e){for(;;)switch(e.n){case 0:return r=I(I({},t),{},{common:I(I({},t.common),{},{issues:[]}),parent:null}),e.n=1,n._parseAsync({data:t.data,path:t.path,parent:r});case 1:return i=e.v,a=r,e.a(2,{result:i,ctx:a})}},e)}));return function(t){return e.apply(this,arguments)}}())).then(function(e){var n,r=N(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.result.status===`valid`)return i.result}}catch(e){r.e(e)}finally{r.f()}var a,o=N(e);try{for(o.s();!(a=o.n()).done;){var s,c=a.value;if(c.result.status===`dirty`)return(s=t.common.issues).push.apply(s,z(c.ctx.common.issues)),c.result}}catch(e){o.e(e)}finally{o.f()}var l=e.map(function(e){return new oc(e.ctx.common.issues)});return q(t,{code:K.invalid_union,unionErrors:l}),Y});var r,i,a=void 0,o=[],s=N(n);try{for(s.s();!(r=s.n()).done;){var c=r.value,l=I(I({},t),{},{common:I(I({},t.common),{},{issues:[]}),parent:null}),u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status===`valid`)return u;u.status!==`dirty`||a||(a={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}}catch(e){s.e(e)}finally{s.f()}if(a)return(i=t.common.issues).push.apply(i,z(a.ctx.common.issues)),a.result;var d=o.map(function(e){return new oc(e)});return q(t,{code:K.invalid_union,unionErrors:d}),Y}},{key:`options`,get:function(){return this._def.options}}])}();al.create=function(e,t){return new al(I({options:e,typeName:Q.ZodUnion},X(t)))};var ol=function(e){return e instanceof hl?ol(e.schema):e instanceof xl?ol(e.innerType()):e instanceof gl?[e.value]:e instanceof vl?e.options:e instanceof yl?Qs.objectValues(e.enum):e instanceof wl?ol(e._def.innerType):e instanceof Xc?[void 0]:e instanceof Zc?[null]:e instanceof Sl?[void 0].concat(z(ol(e.unwrap()))):e instanceof Cl?[null].concat(z(ol(e.unwrap()))):e instanceof Dl||e instanceof kl?ol(e.unwrap()):e instanceof Tl?ol(e._def.innerType):[]},sl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==G.object)return q(t,{code:K.invalid_type,expected:G.object,received:t.parsedType}),Y;var n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(q(t,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}},{key:`discriminator`,get:function(){return this._def.discriminator}},{key:`options`,get:function(){return this._def.options}},{key:`optionsMap`,get:function(){return this._def.optionsMap}}],[{key:`create`,value:function(t,n,r){var i,a=new Map,o=N(n);try{for(o.s();!(i=o.n()).done;){var s=i.value,c=ol(s.shape[t]);if(!c.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);var l,u=N(c);try{for(u.s();!(l=u.n()).done;){var d=l.value;if(a.has(d))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);a.set(d,s)}}catch(e){u.e(e)}finally{u.f()}}}catch(e){o.e(e)}finally{o.f()}return new e(I({typeName:Q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:a},X(r)))}}])}();function cl(e,t){var n=ac(e),r=ac(t);if(e===t)return{valid:!0,data:e};if(n===G.object&&r===G.object){var i,a=Qs.objectKeys(t),o=Qs.objectKeys(e).filter(function(e){return a.indexOf(e)!==-1}),s=I(I({},e),t),c=N(o);try{for(c.s();!(i=c.n()).done;){var l=i.value,u=cl(e[l],t[l]);if(!u.valid)return{valid:!1};s[l]=u.data}}catch(e){c.e(e)}finally{c.f()}return{valid:!0,data:s}}if(n===G.array&&r===G.array){if(e.length!==t.length)return{valid:!1};for(var d=[],f=0;f<e.length;f++){var p=cl(e[f],t[f]);if(!p.valid)return{valid:!1};d.push(p.data)}return{valid:!0,data:d}}return n===G.date&&r===G.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var ll=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx,i=function(e,t){if(mc(e)||mc(t))return Y;var i=cl(e.value,t.value);return i.valid?((hc(e)||hc(t))&&n.dirty(),{status:n.value,value:i.data}):(q(r,{code:K.invalid_intersection_types}),Y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(function(e){var t=R(e,2),n=t[0],r=t[1];return i(n,r)}):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}])}();ll.create=function(e,t,n){return new ll(I({left:e,right:t,typeName:Q.ZodIntersection},X(n)))};var ul=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this,n=this._processInputParams(e),r=n.status,i=n.ctx;if(i.parsedType!==G.array)return q(i,{code:K.invalid_type,expected:G.array,received:i.parsedType}),Y;if(i.data.length<this._def.items.length)return q(i,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),Y;!this._def.rest&&i.data.length>this._def.items.length&&(q(i,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),r.dirty());var a=z(i.data).map(function(e,n){var r=t._def.items[n]||t._def.rest;return r?r._parse(new vc(i,e,i.path,n)):null}).filter(function(e){return!!e});return i.common.async?Promise.all(a).then(function(e){return dc.mergeArray(r,e)}):dc.mergeArray(r,a)}},{key:`items`,get:function(){return this._def.items}},{key:`rest`,value:function(t){return new e(I(I({},this._def),{},{rest:t}))}}])}();ul.create=function(e,t){if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new ul(I({items:e,typeName:Q.ZodTuple,rest:null},X(t)))};var dl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`keySchema`,get:function(){return this._def.keyType}},{key:`valueSchema`,get:function(){return this._def.valueType}},{key:`_parse`,value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==G.object)return q(r,{code:K.invalid_type,expected:G.object,received:r.parsedType}),Y;var i=[],a=this._def.keyType,o=this._def.valueType;for(var s in r.data)i.push({key:a._parse(new vc(r,s,r.path,s)),value:o._parse(new vc(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?dc.mergeObjectAsync(n,i):dc.mergeObjectSync(n,i)}},{key:`element`,get:function(){return this._def.valueType}}],[{key:`create`,value:function(t,n,r){return new e(n instanceof Z?I({keyType:t,valueType:n,typeName:Q.ZodRecord},X(r)):I({keyType:Uc.create(),valueType:t,typeName:Q.ZodRecord},X(n)))}}])}(),fl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`keySchema`,get:function(){return this._def.keyType}},{key:`valueSchema`,get:function(){return this._def.valueType}},{key:`_parse`,value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==G.map)return q(r,{code:K.invalid_type,expected:G.map,received:r.parsedType}),Y;var i=this._def.keyType,a=this._def.valueType,o=z(r.data.entries()).map(function(e,t){var n=R(e,2),o=n[0],s=n[1];return{key:i._parse(new vc(r,o,r.path,[t,`key`])),value:a._parse(new vc(r,s,r.path,[t,`value`]))}});if(r.common.async){var s=new Map;return Promise.resolve().then(k(L().m(function e(){var t,r,i,a,c,l;return L().w(function(e){for(;;)switch(e.p=e.n){case 0:t=N(o),e.p=1,t.s();case 2:if((r=t.n()).done){e.n=7;break}return i=r.value,e.n=3,i.key;case 3:return a=e.v,e.n=4,i.value;case 4:if(c=e.v,a.status!==`aborted`&&c.status!==`aborted`){e.n=5;break}return e.a(2,Y);case 5:a.status!==`dirty`&&c.status!==`dirty`||n.dirty(),s.set(a.value,c.value);case 6:e.n=2;break;case 7:e.n=9;break;case 8:e.p=8,l=e.v,t.e(l);case 9:return e.p=9,t.f(),e.f(9);case 10:return e.a(2,{status:n.value,value:s})}},e,null,[[1,8,9,10]])})))}var c,l=new Map,u=N(o);try{for(u.s();!(c=u.n()).done;){var d=c.value,f=d.key,p=d.value;if(f.status===`aborted`||p.status===`aborted`)return Y;f.status!==`dirty`&&p.status!==`dirty`||n.dirty(),l.set(f.value,p.value)}}catch(e){u.e(e)}finally{u.f()}return{status:n.value,value:l}}}])}();fl.create=function(e,t,n){return new fl(I({valueType:t,keyType:e,typeName:Q.ZodMap},X(n)))};var pl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e),n=t.status,r=t.ctx;if(r.parsedType!==G.set)return q(r,{code:K.invalid_type,expected:G.set,received:r.parsedType}),Y;var i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(q(r,{code:K.too_small,minimum:i.minSize.value,type:`set`,inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(q(r,{code:K.too_big,maximum:i.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());var a=this._def.valueType;function o(e){var t,r=new Set,i=N(e);try{for(i.s();!(t=i.n()).done;){var a=t.value;if(a.status===`aborted`)return Y;a.status===`dirty`&&n.dirty(),r.add(a.value)}}catch(e){i.e(e)}finally{i.f()}return{status:n.value,value:r}}var s=z(r.data.values()).map(function(e,t){return a._parse(new vc(r,e,r.path,t))});return r.common.async?Promise.all(s).then(function(e){return o(e)}):o(s)}},{key:`min`,value:function(t,n){return new e(I(I({},this._def),{},{minSize:{value:t,message:J.toString(n)}}))}},{key:`max`,value:function(t,n){return new e(I(I({},this._def),{},{maxSize:{value:t,message:J.toString(n)}}))}},{key:`size`,value:function(e,t){return this.min(e,t).max(e,t)}},{key:`nonempty`,value:function(e){return this.min(1,e)}}])}();pl.create=function(e,t){return new pl(I({valueType:e,minSize:null,maxSize:null,typeName:Q.ZodSet},X(t)))};var ml=function(){function e(){var t;return j(this,e),(t=A(this,e,arguments)).validate=t.implement,t}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e).ctx;if(t.parsedType!==G.function)return q(t,{code:K.invalid_type,expected:G.function,received:t.parsedType}),Y;function n(e,n){return uc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lc(),sc].filter(function(e){return!!e}),issueData:{code:K.invalid_arguments,argumentsError:n}})}function r(e,n){return uc({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lc(),sc].filter(function(e){return!!e}),issueData:{code:K.invalid_return_type,returnTypeError:n}})}var i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof bl){var o=this;return pc(k(L().m(function e(){var t,s,c,l,u,d,f,p=arguments;return L().w(function(e){for(;;)switch(e.n){case 0:for(t=p.length,s=Array(t),c=0;c<t;c++)s[c]=p[c];return l=new oc([]),e.n=1,o._def.args.parseAsync(s,i).catch(function(e){throw l.addIssue(n(s,e)),l});case 1:return u=e.v,e.n=2,Reflect.apply(a,this,u);case 2:return d=e.v,e.n=3,o._def.returns._def.type.parseAsync(d,i).catch(function(e){throw l.addIssue(r(d,e)),l});case 3:return f=e.v,e.a(2,f)}},e,this)})))}var s=this;return pc(function(){var e=[...arguments],t=s._def.args.safeParse(e,i);if(!t.success)throw new oc([n(e,t.error)]);var o=Reflect.apply(a,this,t.data),c=s._def.returns.safeParse(o,i);if(!c.success)throw new oc([r(o,c.error)]);return c.data})}},{key:`parameters`,value:function(){return this._def.args}},{key:`returnType`,value:function(){return this._def.returns}},{key:`args`,value:function(){var t=[...arguments];return new e(I(I({},this._def),{},{args:ul.create(t).rest($c.create())}))}},{key:`returns`,value:function(t){return new e(I(I({},this._def),{},{returns:t}))}},{key:`implement`,value:function(e){return this.parse(e)}},{key:`strictImplement`,value:function(e){return this.parse(e)}}],[{key:`create`,value:function(t,n,r){return new e(I({args:t||ul.create([]).rest($c.create()),returns:n||$c.create(),typeName:Q.ZodFunction},X(r)))}}])}(),hl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`schema`,get:function(){return this._def.getter()}},{key:`_parse`,value:function(e){var t=this._processInputParams(e).ctx;return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}])}();hl.create=function(e,t){return new hl(I({getter:e,typeName:Q.ZodLazy},X(t)))};var gl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(e.data!==this._def.value){var t=this._getOrReturnCtx(e);return q(t,{received:t.data,code:K.invalid_literal,expected:this._def.value}),Y}return{status:`valid`,value:e.data}}},{key:`value`,get:function(){return this._def.value}}])}();function _l(e,t){return new vl(I({values:e,typeName:Q.ZodEnum},X(t)))}gl.create=function(e,t){return new gl(I({value:e,typeName:Q.ZodLiteral},X(t)))};var vl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(typeof e.data!=`string`){var t=this._getOrReturnCtx(e),n=this._def.values;return q(t,{expected:Qs.joinValues(n),received:t.parsedType,code:K.invalid_type}),Y}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){var r=this._getOrReturnCtx(e),i=this._def.values;return q(r,{received:r.data,code:K.invalid_enum_value,options:i}),Y}return pc(e.data)}},{key:`options`,get:function(){return this._def.values}},{key:`enum`,get:function(){var e,t={},n=N(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`Values`,get:function(){var e,t={},n=N(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`Enum`,get:function(){var e,t={},n=N(this._def.values);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r]=r}}catch(e){n.e(e)}finally{n.f()}return t}},{key:`extract`,value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._def;return e.create(t,I(I({},this._def),n))}},{key:`exclude`,value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this._def;return e.create(this.options.filter(function(e){return!t.includes(e)}),I(I({},this._def),n))}}])}();vl.create=_l;var yl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=Qs.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==G.string&&n.parsedType!==G.number){var r=Qs.objectValues(t);return q(n,{expected:Qs.joinValues(r),received:n.parsedType,code:K.invalid_type}),Y}if(this._cache||=new Set(Qs.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){var i=Qs.objectValues(t);return q(n,{received:n.data,code:K.invalid_enum_value,options:i}),Y}return pc(e.data)}},{key:`enum`,get:function(){return this._def.values}}])}();yl.create=function(e,t){return new yl(I({values:e,typeName:Q.ZodNativeEnum},X(t)))};var bl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`unwrap`,value:function(){return this._def.type}},{key:`_parse`,value:function(e){var t=this,n=this._processInputParams(e).ctx;return n.parsedType!==G.promise&&!1===n.common.async?(q(n,{code:K.invalid_type,expected:G.promise,received:n.parsedType}),Y):pc((n.parsedType===G.promise?n.data:Promise.resolve(n.data)).then(function(e){return t._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})}))}}])}();bl.create=function(e,t){return new bl(I({type:e,typeName:Q.ZodPromise},X(t)))};var xl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`innerType`,value:function(){return this._def.schema}},{key:`sourceType`,value:function(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}},{key:`_parse`,value:function(e){var t=this,n=this._processInputParams(e),r=n.status,i=n.ctx,a=this._def.effect||null,o={addIssue:function(e){q(i,e),e.fatal?r.abort():r.dirty()},get path(){return i.path}};if(o.addIssue=o.addIssue.bind(o),a.type===`preprocess`){var s=a.transform(i.data,o);if(i.common.async)return Promise.resolve(s).then(function(){var e=k(L().m(function e(n){var a;return L().w(function(e){for(;;)switch(e.n){case 0:if(r.value!==`aborted`){e.n=1;break}return e.a(2,Y);case 1:return e.n=2,t._def.schema._parseAsync({data:n,path:i.path,parent:i});case 2:if((a=e.v).status!==`aborted`){e.n=3;break}return e.a(2,Y);case 3:if(a.status!==`dirty`){e.n=4;break}return e.a(2,fc(a.value));case 4:if(r.value!==`dirty`){e.n=5;break}return e.a(2,fc(a.value));case 5:return e.a(2,a)}},e)}));return function(t){return e.apply(this,arguments)}}());if(r.value===`aborted`)return Y;var c=this._def.schema._parseSync({data:s,path:i.path,parent:i});return c.status===`aborted`?Y:c.status===`dirty`||r.value===`dirty`?fc(c.value):c}if(a.type===`refinement`){var l=function(e){var t=a.refinement(e,o);if(i.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(!1===i.common.async){var u=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return u.status===`aborted`?Y:(u.status===`dirty`&&r.dirty(),l(u.value),{status:r.value,value:u.value})}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(function(e){return e.status===`aborted`?Y:(e.status===`dirty`&&r.dirty(),l(e.value).then(function(){return{status:r.value,value:e.value}}))})}if(a.type===`transform`){if(!1===i.common.async){var d=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!gc(d))return Y;var f=a.transform(d.value,o);if(f instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:r.value,value:f}}return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(function(e){return gc(e)?Promise.resolve(a.transform(e.value,o)).then(function(e){return{status:r.value,value:e}}):Y})}Qs.assertNever(a)}}])}();xl.create=function(e,t,n){return new xl(I({schema:e,typeName:Q.ZodEffects,effect:t},X(n)))},xl.createWithPreprocess=function(e,t,n){return new xl(I({schema:t,effect:{type:`preprocess`,transform:e},typeName:Q.ZodEffects},X(n)))};var Sl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){return this._getType(e)===G.undefined?pc(void 0):this._def.innerType._parse(e)}},{key:`unwrap`,value:function(){return this._def.innerType}}])}();Sl.create=function(e,t){return new Sl(I({innerType:e,typeName:Q.ZodOptional},X(t)))};var Cl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){return this._getType(e)===G.null?pc(null):this._def.innerType._parse(e)}},{key:`unwrap`,value:function(){return this._def.innerType}}])}();Cl.create=function(e,t){return new Cl(I({innerType:e,typeName:Q.ZodNullable},X(t)))};var wl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return t.parsedType===G.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}},{key:`removeDefault`,value:function(){return this._def.innerType}}])}();wl.create=function(e,t){return new wl(I({innerType:e,typeName:Q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:function(){return t.default}},X(t)))};var Tl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this,n=this._processInputParams(e).ctx,r=I(I({},n),{},{common:I(I({},n.common),{},{issues:[]})}),i=this._def.innerType._parse({data:r.data,path:r.path,parent:I({},r)});return _c(i)?i.then(function(e){return{status:`valid`,value:e.status===`valid`?e.value:t._def.catchValue({get error(){return new oc(r.common.issues)},input:r.data})}}):{status:`valid`,value:i.status===`valid`?i.value:this._def.catchValue({get error(){return new oc(r.common.issues)},input:r.data})}}},{key:`removeCatch`,value:function(){return this._def.innerType}}])}();Tl.create=function(e,t){return new Tl(I({innerType:e,typeName:Q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:function(){return t.catch}},X(t)))};var El=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){if(this._getType(e)!==G.nan){var t=this._getOrReturnCtx(e);return q(t,{code:K.invalid_type,expected:G.nan,received:t.parsedType}),Y}return{status:`valid`,value:e.data}}}])}();El.create=function(e){return new El(I({typeName:Q.ZodNaN},X(e)))};var Q,Dl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._processInputParams(e).ctx,n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}},{key:`unwrap`,value:function(){return this._def.type}}])}(),Ol=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this,n=this._processInputParams(e),r=n.status,i=n.ctx;if(i.common.async)return function(){var e=k(L().m(function e(){var n;return L().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t._def.in._parseAsync({data:i.data,path:i.path,parent:i});case 1:if((n=e.v).status!==`aborted`){e.n=2;break}return e.a(2,Y);case 2:if(n.status!==`dirty`){e.n=3;break}return r.dirty(),e.a(2,fc(n.value));case 3:return e.a(2,t._def.out._parseAsync({data:n.value,path:i.path,parent:i}));case 4:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}()();var a=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return a.status===`aborted`?Y:a.status===`dirty`?(r.dirty(),{status:`dirty`,value:a.value}):this._def.out._parseSync({data:a.value,path:i.path,parent:i})}}],[{key:`create`,value:function(t,n){return new e({in:t,out:n,typeName:Q.ZodPipeline})}}])}(),kl=function(){function e(){return j(this,e),A(this,e,arguments)}return F(e,Z),M(e,[{key:`_parse`,value:function(e){var t=this._def.innerType._parse(e),n=function(e){return gc(e)&&(e.value=Object.freeze(e.value)),e};return _c(t)?t.then(function(e){return n(e)}):n(t)}},{key:`unwrap`,value:function(){return this._def.innerType}}])}();kl.create=function(e,t){return new kl(I({innerType:e,typeName:Q.ZodReadonly},X(t)))},il.lazycreate,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`}(Q||={}),Uc.create,Gc.create,El.create,Kc.create,qc.create,Jc.create,Yc.create,Xc.create,Zc.create,Qc.create,$c.create,el.create,tl.create,nl.create,il.create,il.strictCreate,al.create,sl.create,ll.create,ul.create,dl.create,fl.create,pl.create,ml.create,hl.create,gl.create,vl.create,yl.create,bl.create,xl.create,Sl.create,Cl.create,xl.createWithPreprocess,Ol.create;var Al=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.prefix,n=e.size,r=n===void 0?16:n,i=e.alphabet,a=i===void 0?`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`:i,o=e.separator,s=o===void 0?`-`:o,c=function(){for(var e=a.length,t=Array(r),n=0;n<r;n++)t[n]=a[Math.random()*e|0];return t.join(``)};if(t==null)return c;if(a.includes(s))throw new Xn({argument:`separator`,message:`The separator "${s}" must not be part of the alphabet "${a}".`});return function(){return`${t}${s}${c()}`}},jl=Al();function Ml(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:globalThis;return e.window?`runtime/browser`:e.navigator?.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:e.process?.versions?.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?`runtime/vercel-edge`:`runtime/unknown`}function Nl(e){if(e==null)return{};var t={};if(e instanceof Headers)e.forEach(function(e,n){t[n.toLowerCase()]=e});else{Array.isArray(e)||(e=Object.entries(e));var n,r=c(e);try{for(r.s();!(n=r.n()).done;){var i=y(n.value,2),a=i[0],o=i[1];o!=null&&(t[a.toLowerCase()]=o)}}catch(e){r.e(e)}finally{r.f()}}return t}function Pl(e){for(var t=new Headers(Nl(e)),n=t.get(`user-agent`)||``,r=arguments.length,i=Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return t.set(`user-agent`,[n].concat(i).filter(Boolean).join(` `)),Object.fromEntries(t.entries())}var Fl=/"__proto__"\s*:/,Il=/"constructor"\s*:/;function Ll(e){var t=JSON.parse(e);return t===null||S(t)!=`object`||!1===Fl.test(e)&&!1===Il.test(e)?t:function(e){for(var t=[e];t.length;){var n=t;t=[];var r,i=c(n);try{for(i.s();!(r=i.n()).done;){var a=r.value;if(Object.prototype.hasOwnProperty.call(a,`__proto__`)||Object.prototype.hasOwnProperty.call(a,`constructor`)&&Object.prototype.hasOwnProperty.call(a.constructor,`prototype`))throw SyntaxError(`Object contains forbidden prototype property`);for(var o in a){var s=a[o];s&&S(s)==`object`&&t.push(s)}}}catch(e){i.e(e)}finally{i.f()}}return e}(t)}var Rl=Symbol.for(`vercel.ai.validator`);function zl(e){return function(e){return S(e)==`object`&&e!==null&&Rl in e&&!0===e[Rl]&&`validate`in e}(e)?e:typeof e==`function`?e():(t=e,n=function(){var e=r(g().m(function e(n){var r;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t[`~standard`].validate(n);case 1:return r=e.v,e.a(2,r.issues==null?{success:!0,value:r.value}:{success:!1,error:new ar({value:n,cause:r.issues})})}},e)}));return function(t){return e.apply(this,arguments)}}(),l(l({},Rl,!0),`validate`,n));var t,n}function Bl(e){return Vl.apply(this,arguments)}function Vl(){return Vl=r(g().m(function e(t){var n,r,i;return g().w(function(e){for(;;)switch(e.n){case 0:return n=t.value,r=t.schema,e.n=1,Hl({value:n,schema:r});case 1:if((i=e.v).success){e.n=2;break}throw ar.wrap({value:n,cause:i.error});case 2:return e.a(2,i.value)}},e)})),Vl.apply(this,arguments)}function Hl(e){return Ul.apply(this,arguments)}function Ul(){return Ul=r(g().m(function e(t){var n,r,i,a,o;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.value,r=t.schema,i=zl(r),e.p=1,i.validate!=null){e.n=2;break}return e.a(2,{success:!0,value:n,rawValue:n});case 2:return e.n=3,i.validate(n);case 3:return a=e.v,e.a(2,a.success?{success:!0,value:a.value,rawValue:n}:{success:!1,error:ar.wrap({value:n,cause:a.error}),rawValue:n});case 4:return e.p=4,o=e.v,e.a(2,{success:!1,error:ar.wrap({value:n,cause:o}),rawValue:n})}},e,null,[[1,4]])})),Ul.apply(this,arguments)}function Wl(e){return Gl.apply(this,arguments)}function Gl(){return Gl=r(g().m(function e(t){var n,r,i,a,o;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.text,r=t.schema,e.p=1,i=function(e){var t=Error.stackTraceLimit;try{Error.stackTraceLimit=0}catch{return Ll(e)}try{return Ll(e)}finally{Error.stackTraceLimit=t}}(n),r!=null){e.n=2;break}a={success:!0,value:i,rawValue:i},e.n=4;break;case 2:return e.n=3,Hl({value:i,schema:r});case 3:a=e.v;case 4:return e.a(2,a);case 5:return e.p=5,o=e.v,e.a(2,{success:!1,error:tr.isInstance(o)?o:new tr({text:n,cause:o}),rawValue:void 0})}},e,null,[[1,5]])})),Gl.apply(this,arguments)}function Kl(e){return ql.apply(this,arguments)}function ql(){return ql=r(g().m(function e(t){return g().w(function(e){for(;;)if(e.n===0)return e.a(2,(typeof t==`function`&&(t=t()),Promise.resolve(t)))},e)})),ql.apply(this,arguments)}var Jl=function(e,t){for(var n=0;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString()].concat(b(t.slice(n))).join(`/`)},Yl=Symbol(`Let zodToJsonSchema decide on which parser to use`),Xl={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`};function Zl(e,t){return Su(e.type._def,t)}function Ql(e,t,n){var r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(function(n,r){return Ql(e,t,n)})};switch(r){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return $l(e)}}var $l=function(e){var t,n={type:`integer`,format:`unix-time`},r=c(e.checks);try{for(r.s();!(t=r.n()).done;){var i=t.value;switch(i.kind){case`min`:n.minimum=i.value;break;case`max`:n.maximum=i.value}}}catch(e){r.e(e)}finally{r.f()}return n},eu=void 0,tu=/^[cC][^\s-]{8,}$/,nu=/^[0-9a-z]+$/,ru=/^[0-9A-HJKMNP-TV-Z]{26}$/,iu=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,au=function(){return eu===void 0&&(eu=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),eu},ou=/^(?:(?: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])$/,su=/^(([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])$/,cu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,uu=/^[a-zA-Z0-9_-]{21}$/,du=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function fu(e,t){var n={type:`string`};if(e.checks){var r,i=c(e.checks);try{for(i.s();!(r=i.n()).done;){var a=r.value;switch(a.kind){case`min`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,a.value):a.value;break;case`max`:n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,a.value):a.value;break;case`email`:switch(t.emailStrategy){case`format:email`:hu(n,`email`,a.message,t);break;case`format:idn-email`:hu(n,`idn-email`,a.message,t);break;case`pattern:zod`:gu(n,iu,a.message,t)}break;case`url`:hu(n,`uri`,a.message,t);break;case`uuid`:hu(n,`uuid`,a.message,t);break;case`regex`:gu(n,a.regex,a.message,t);break;case`cuid`:gu(n,tu,a.message,t);break;case`cuid2`:gu(n,nu,a.message,t);break;case`startsWith`:gu(n,RegExp(`^${pu(a.value,t)}`),a.message,t);break;case`endsWith`:gu(n,RegExp(`${pu(a.value,t)}\$`),a.message,t);break;case`datetime`:hu(n,`date-time`,a.message,t);break;case`date`:hu(n,`date`,a.message,t);break;case`time`:hu(n,`time`,a.message,t);break;case`duration`:hu(n,`duration`,a.message,t);break;case`length`:n.minLength=typeof n.minLength==`number`?Math.max(n.minLength,a.value):a.value,n.maxLength=typeof n.maxLength==`number`?Math.min(n.maxLength,a.value):a.value;break;case`includes`:gu(n,RegExp(pu(a.value,t)),a.message,t);break;case`ip`:a.version!==`v6`&&hu(n,`ipv4`,a.message,t),a.version!==`v4`&&hu(n,`ipv6`,a.message,t);break;case`base64url`:gu(n,lu,a.message,t);break;case`jwt`:gu(n,du,a.message,t);break;case`cidr`:a.version!==`v6`&&gu(n,ou,a.message,t),a.version!==`v4`&&gu(n,su,a.message,t);break;case`emoji`:gu(n,au(),a.message,t);break;case`ulid`:gu(n,ru,a.message,t);break;case`base64`:switch(t.base64Strategy){case`format:binary`:hu(n,`binary`,a.message,t);break;case`contentEncoding:base64`:n.contentEncoding=`base64`;break;case`pattern:zod`:gu(n,cu,a.message,t)}break;case`nanoid`:gu(n,uu,a.message,t)}}}catch(e){i.e(e)}finally{i.f()}}return n}function pu(e,t){return t.patternStrategy===`escape`?function(e){for(var t=``,n=0;n<e.length;n++)mu.has(e[n])||(t+=`\\`),t+=e[n];return t}(e):e}var mu=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function hu(e,t,n,r){e.format||e.anyOf?.some(function(e){return e.format})?(e.anyOf||=[],e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push(m({format:t},n&&r.errorMessages&&{errorMessage:{format:n}}))):e.format=t}function gu(e,t,n,r){e.pattern||e.allOf?.some(function(e){return e.pattern})?(e.allOf||=[],e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push(m({pattern:_u(t,r)},n&&r.errorMessages&&{errorMessage:{pattern:n}}))):e.pattern=_u(t,r)}function _u(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;for(var n=e.flags.includes(`i`),r=e.flags.includes(`m`),i=e.flags.includes(`s`),a=n?e.source.toLowerCase():e.source,o=``,s=!1,c=!1,l=!1,u=0;u<a.length;u++)if(s)o+=a[u],s=!1;else{if(n){if(c){if(a[u].match(/[a-z]/)){l?(o+=a[u],o+=`${a[u-2]}-${a[u]}`.toUpperCase(),l=!1):a[u+1]===`-`&&a[u+2]?.match(/[a-z]/)?(o+=a[u],l=!0):o+=`${a[u]}${a[u].toUpperCase()}`;continue}}else if(a[u].match(/[a-z]/)){o+=`[${a[u]}${a[u].toUpperCase()}]`;continue}}if(r){if(a[u]===`^`){o+=`(^|(?<=[\r
]))`;continue}if(a[u]===`$`){o+=`($|(?=[\r
]))`;continue}}i&&a[u]===`.`?o+=c?`${a[u]}\r
`:`[${a[u]}\r
]`:(o+=a[u],a[u]===`\\`?s=!0:c&&a[u]===`]`?c=!1:c||a[u]!==`[`||(c=!0))}try{new RegExp(o)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return o}function vu(e,t){var n={type:`object`,additionalProperties:Su(e.valueType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`additionalProperties`])}))??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===Q.ZodString&&e.keyType._def.checks?.length){var r=fu(e.keyType._def,t);r.type;var i=h(r,gn);return m(m({},n),{},{propertyNames:i})}if(e.keyType?._def.typeName===Q.ZodEnum)return m(m({},n),{},{propertyNames:{enum:e.keyType._def.values}});if(e.keyType?._def.typeName===Q.ZodBranded&&e.keyType._def.type._def.typeName===Q.ZodString&&e.keyType._def.type._def.checks?.length){var a=Zl(e.keyType._def,t);a.type;var o=h(a,_n);return m(m({},n),{},{propertyNames:o})}return n}var yu={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function bu(e){try{return e.isOptional()}catch{return!0}}var xu=function(e,t,n){switch(t){case Q.ZodString:return fu(e,n);case Q.ZodNumber:return function(e){var t={type:`number`};if(!e.checks)return t;var n,r=c(e.checks);try{for(r.s();!(n=r.n()).done;){var i=n.value;switch(i.kind){case`int`:t.type=`integer`;break;case`min`:i.inclusive?t.minimum=i.value:t.exclusiveMinimum=i.value;break;case`max`:i.inclusive?t.maximum=i.value:t.exclusiveMaximum=i.value;break;case`multipleOf`:t.multipleOf=i.value}}}catch(e){r.e(e)}finally{r.f()}return t}(e);case Q.ZodObject:return function(e,t){var n={type:`object`,properties:{}},r=[],i=e.shape();for(var a in i){var o=i[a];if(o!==void 0&&o._def!==void 0){var s=bu(o),c=Su(o._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`properties`,a]),propertyPath:[].concat(b(t.currentPath),[`properties`,a])}));c!==void 0&&(n.properties[a]=c,s||r.push(a))}}r.length&&(n.required=r);var l=function(e,t){if(e.catchall._def.typeName!==`ZodNever`)return Su(e.catchall._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`additionalProperties`])}));switch(e.unknownKeys){case`passthrough`:return t.allowedAdditionalProperties;case`strict`:return t.rejectedAdditionalProperties;case`strip`:return t.removeAdditionalStrategy===`strict`?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return l!==void 0&&(n.additionalProperties=l),n}(e,n);case Q.ZodBigInt:return function(e){var t={type:`integer`,format:`int64`};if(!e.checks)return t;var n,r=c(e.checks);try{for(r.s();!(n=r.n()).done;){var i=n.value;switch(i.kind){case`min`:i.inclusive?t.minimum=i.value:t.exclusiveMinimum=i.value;break;case`max`:i.inclusive?t.maximum=i.value:t.exclusiveMaximum=i.value;break;case`multipleOf`:t.multipleOf=i.value}}}catch(e){r.e(e)}finally{r.f()}return t}(e);case Q.ZodBoolean:return{type:`boolean`};case Q.ZodDate:return Ql(e,n);case Q.ZodUndefined:return{not:{}};case Q.ZodNull:return{type:`null`};case Q.ZodArray:return function(e,t){var n,r={type:`array`};return(n=e.type)!=null&&n._def&&e.type?._def?.typeName!==Q.ZodAny&&(r.items=Su(e.type._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`])}))),e.minLength&&(r.minItems=e.minLength.value),e.maxLength&&(r.maxItems=e.maxLength.value),e.exactLength&&(r.minItems=e.exactLength.value,r.maxItems=e.exactLength.value),r}(e,n);case Q.ZodUnion:case Q.ZodDiscriminatedUnion:return function(e,t){var n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(function(e){return e._def.typeName in yu&&(!e._def.checks||!e._def.checks.length)})){var r=n.reduce(function(e,t){var n=yu[t._def.typeName];return n&&!e.includes(n)?[].concat(b(e),[n]):e},[]);return{type:r.length>1?r:r[0]}}if(n.every(function(e){return e._def.typeName===`ZodLiteral`&&!e.description})){var i=n.reduce(function(e,t){var n=S(t._def.value);switch(n){case`string`:case`number`:case`boolean`:return[].concat(b(e),[n]);case`bigint`:return[].concat(b(e),[`integer`]);case`object`:if(t._def.value===null)return[].concat(b(e),[`null`]);default:return e}},[]);if(i.length===n.length){var a=i.filter(function(e,t,n){return n.indexOf(e)===t});return{type:a.length>1?a:a[0],enum:n.reduce(function(e,t){return e.includes(t._def.value)?e:[].concat(b(e),[t._def.value])},[])}}}else if(n.every(function(e){return e._def.typeName===`ZodEnum`}))return{type:`string`,enum:n.reduce(function(e,t){return[].concat(b(e),b(t._def.values.filter(function(t){return!e.includes(t)})))},[])};return function(e,t){var n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map(function(e,n){return Su(e._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`anyOf`,`${n}`])}))}).filter(function(e){return!!e&&(!t.strictUnions||S(e)==`object`&&Object.keys(e).length>0)});return n.length?{anyOf:n}:void 0}(e,t)}(e,n);case Q.ZodIntersection:return function(e,t){var n=[Su(e.left._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`allOf`,`0`])})),Su(e.right._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`allOf`,`1`])}))].filter(function(e){return!!e}),r=[];return n.forEach(function(e){if(`type`in(n=e)&&n.type===`string`||!(`allOf`in n)){var t=e;`additionalProperties`in e&&!1===e.additionalProperties&&(e.additionalProperties,t=h(e,vn)),r.push(t)}else r.push.apply(r,b(e.allOf));var n}),r.length?{allOf:r}:void 0}(e,n);case Q.ZodTuple:return function(e,t){return e.rest?{type:`array`,minItems:e.items.length,items:e.items.map(function(e,n){return Su(e._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`,`${n}`])}))}).reduce(function(e,t){return t===void 0?e:[].concat(b(e),[t])},[]),additionalItems:Su(e.rest._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`additionalItems`])}))}:{type:`array`,minItems:e.items.length,maxItems:e.items.length,items:e.items.map(function(e,n){return Su(e._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`,`${n}`])}))}).reduce(function(e,t){return t===void 0?e:[].concat(b(e),[t])},[])}}(e,n);case Q.ZodRecord:return vu(e,n);case Q.ZodLiteral:return function(e){var t=S(e.value);return t!==`bigint`&&t!==`number`&&t!==`boolean`&&t!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:{type:t===`bigint`?`integer`:t,const:e.value}}(e);case Q.ZodEnum:return function(e){return{type:`string`,enum:Array.from(e.values)}}(e);case Q.ZodNativeEnum:return function(e){var t=e.values,n=Object.keys(e.values).filter(function(e){return typeof t[t[e]]!=`number`}).map(function(e){return t[e]}),r=Array.from(new Set(n.map(function(e){return S(e)})));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}(e);case Q.ZodNullable:return function(e,t){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[yu[e.innerType._def.typeName],`null`]};var n=Su(e.innerType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`anyOf`,`0`])}));return n&&{anyOf:[n,{type:`null`}]}}(e,n);case Q.ZodOptional:return function(e,t){if(t.currentPath.toString()===t.propertyPath?.toString())return Su(e.innerType._def,t);var n=Su(e.innerType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`anyOf`,`1`])}));return n?{anyOf:[{not:{}},n]}:{}}(e,n);case Q.ZodMap:return function(e,t){return t.mapStrategy===`record`?vu(e,t):{type:`array`,maxItems:125,items:{type:`array`,items:[Su(e.keyType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`,`items`,`0`])}))||{},Su(e.valueType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`,`items`,`1`])}))||{}],minItems:2,maxItems:2}}}(e,n);case Q.ZodSet:return function(e,t){var n={type:`array`,uniqueItems:!0,items:Su(e.valueType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`items`])}))};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}(e,n);case Q.ZodLazy:return function(){return e.getter()._def};case Q.ZodPromise:return function(e,t){return Su(e.type._def,t)}(e,n);case Q.ZodNaN:case Q.ZodNever:return{not:{}};case Q.ZodEffects:return function(e,t){return t.effectStrategy===`input`?Su(e.schema._def,t):{}}(e,n);case Q.ZodAny:case Q.ZodUnknown:return{};case Q.ZodDefault:return function(e,t){return m(m({},Su(e.innerType._def,t)),{},{default:e.defaultValue()})}(e,n);case Q.ZodBranded:return Zl(e,n);case Q.ZodReadonly:case Q.ZodCatch:return function(e,t){return Su(e.innerType._def,t)}(e,n);case Q.ZodPipeline:return function(e,t){if(t.pipeStrategy===`input`)return Su(e.in._def,t);if(t.pipeStrategy===`output`)return Su(e.out._def,t);var n=Su(e.in._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`allOf`,`0`])}));return{allOf:[n,Su(e.out._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`allOf`,n?`1`:`0`])}))].filter(function(e){return e!==void 0})}}(e,n);case Q.ZodFunction:case Q.ZodVoid:case Q.ZodSymbol:default:return}};function Su(e,t){var n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=t.seen.get(e);if(t.override){var i=t.override?.call(t,e,t,r,n);if(i!==Yl)return i}if(r&&!n){var a=Cu(r,t);if(a!==void 0)return a}var o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);var s=xu(e,e.typeName,t),c=typeof s==`function`?Su(s(),t):s;if(c&&wu(e,t,c),t.postProcess){var l=t.postProcess(c,e,t);return o.jsonSchema=c,l}return o.jsonSchema=c,c}var Cu=function(e,t){switch(t.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:Jl(t.currentPath,e.path)};case`none`:case`seen`:return e.path.length<t.currentPath.length&&e.path.every(function(e,n){return t.currentPath[n]===e})?(console.warn(`Recursive reference detected at ${t.currentPath.join(`/`)}! Defaulting to any`),{}):t.$refStrategy===`seen`?{}:void 0}},wu=function(e,t,n){return e.description&&(n.description=e.description),n},Tu=function(e,t){var n=function(e){var t=function(e){return typeof e==`string`?m(m({},Xl),{},{name:e}):m(m({},Xl),e)}(e),n=t.name===void 0?t.basePath:[].concat(b(t.basePath),[t.definitionPath,t.name]);return m(m({},t),{},{currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(function(e){var n=y(e,2),r=n[0],i=n[1];return[i._def,{def:i._def,path:[].concat(b(t.basePath),[t.definitionPath,r]),jsonSchema:void 0}]}))})}(t),r=S(t)==`object`&&t.definitions?Object.entries(t.definitions).reduce(function(e,t){var r=y(t,2),i=r[0],a=r[1];return m(m({},e),{},l({},i,Su(a._def,m(m({},n),{},{currentPath:[].concat(b(n.basePath),[n.definitionPath,i])}),!0)??{}))},{}):void 0,i=typeof t==`string`?t:t?.nameStrategy===`title`||t==null?void 0:t.name,a=Su(e._def,i===void 0?n:m(m({},n),{},{currentPath:[].concat(b(n.basePath),[n.definitionPath,i])}),!1)??{},o=S(t)==`object`&&t.name!==void 0&&t.nameStrategy===`title`?t.name:void 0;o!==void 0&&(a.title=o);var s=i===void 0?r?m(m({},a),{},l({},n.definitionPath,r)):a:l({$ref:[].concat(b(n.$refStrategy===`relative`?[]:n.basePath),[n.definitionPath,i]).join(`/`)},n.definitionPath,m(m({},r),{},l({},i,a)));return s.$schema=`http://json-schema.org/draft-07/schema#`,s};function Eu(e,t){return function(e){return`_zod`in e}(e)?function(e){return Ou(function(){return function(e,t){if(e instanceof ro){var n,r=new Eo(t),i={},a=N(e._idmap.entries());try{for(a.s();!(n=a.n()).done;){var o=R(n.value,2),s=(o[0],o[1]);r.process(s)}}catch(e){a.e(e)}finally{a.f()}var c,l={},u={registry:e,uri:t?.uri,defs:i},d=N(e._idmap.entries());try{for(d.s();!(c=d.n()).done;){var f=R(c.value,2),p=f[0],m=f[1];l[p]=r.emit(m,I(I({},t),{},{external:u}))}}catch(e){d.e(e)}finally{d.f()}return Object.keys(i).length>0&&(l.__shared=P({},r.target===`draft-2020-12`?`$defs`:`definitions`,i)),{schemas:l}}var h=new Eo(t);return h.process(e),h.emit(e,t)}(e,{target:`draft-7`,io:`output`,reused:`inline`})},{validate:(t=r(g().m(function t(n){var r;return g().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Lo(e,n);case 1:return r=t.v,t.a(2,r.success?{success:!0,value:r.data}:{success:!1,error:r.error})}},t)})),function(e){return t.apply(this,arguments)})});var t}(e):function(e){return Ou(function(){return Tu(e,{$refStrategy:`none`})},{validate:(t=r(g().m(function t(n){var r;return g().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,e.safeParseAsync(n);case 1:return r=t.v,t.a(2,r.success?{success:!0,value:r.data}:{success:!1,error:r.error})}},t)})),function(e){return t.apply(this,arguments)})});var t}(e)}var Du=Symbol.for(`vercel.ai.schema`);function Ou(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).validate;return l(function(e,t,n,r){var i={configurable:!0,enumerable:!0};return i[e]=r,Object.defineProperty(t,n,i)}(`get`,l(l(l({},Du,!0),`_type`,void 0),Rl,!0),`jsonSchema`,function(){return typeof e==`function`&&(e=e()),e}),`validate`,t)}var ku,Au=Object.defineProperty,ju=`AI_NoObjectGeneratedError`,Mu=`vercel.ai.error.${ju}`,Nu=Symbol.for(Mu),Pu=function(){function e(t){var n,r=t.message,o=r===void 0?`No object generated.`:r,s=t.cause,c=t.text,l=t.response,u=t.usage,d=t.finishReason;return a(this,e),(n=i(this,e,[{name:ju,message:o,cause:s}]))[ku]=!0,n.text=c,n.response=l,n.usage=u,n.finishReason=d,n}return d(e,Wn),s(e,null,[{key:`isInstance`,value:function(e){return Wn.hasMarker(e,Mu)}}])}();ku=Nu;var Fu=`5.0.93`,Iu=Ns([U(),ic(Uint8Array),ic(ArrayBuffer),rc(function(e){var t;return(t=globalThis.Buffer?.isBuffer(e))!=null&&t},{message:`Must be a Buffer`})]),Lu=new tc({type:`lazy`,getter:function(){return Ns([Ss(),U(),gs(),bs(),Ls(U(),Lu),Os(Lu)])}}),Ru=Ls(U(),Ls(U(),Lu)),zu=As({type:W(`text`),text:U(),providerOptions:Ru.optional()}),Bu=As({type:W(`image`),image:Ns([Iu,ic(URL)]),mediaType:U().optional(),providerOptions:Ru.optional()}),Vu=As({type:W(`file`),data:Ns([Iu,ic(URL)]),filename:U().optional(),mediaType:U(),providerOptions:Ru.optional()}),Hu=As({type:W(`reasoning`),text:U(),providerOptions:Ru.optional()}),Uu=As({type:W(`tool-call`),toolCallId:U(),toolName:U(),input:ws(),providerOptions:Ru.optional(),providerExecuted:bs().optional()}),Wu=new Ps(I({type:`union`,options:[As({type:W(`text`),value:U()}),As({type:W(`json`),value:Lu}),As({type:W(`error-text`),value:U()}),As({type:W(`error-json`),value:Lu}),As({type:W(`content`),value:Os(Ns([As({type:W(`text`),text:U()}),As({type:W(`media`),data:U(),mediaType:U()})]))})],discriminator:`type`},H(void 0))),Gu=As({type:W(`tool-result`),toolCallId:U(),toolName:U(),output:Wu,providerOptions:Ru.optional()});Ns([As({role:W(`system`),content:U(),providerOptions:Ru.optional()}),As({role:W(`user`),content:Ns([U(),Os(Ns([zu,Bu,Vu]))]),providerOptions:Ru.optional()}),As({role:W(`assistant`),content:Ns([U(),Os(Ns([zu,Vu,Hu,Uu,Gu]))]),providerOptions:Ru.optional()}),As({role:W(`tool`),content:Os(Gu),providerOptions:Ru.optional()})]),Al({prefix:`aitxt`,size:24}),TransformStream;var Ku=function(){var e;return function(){return e??=Eu(Ns([js({type:W(`text-start`),id:U(),providerMetadata:Ru.optional()}),js({type:W(`text-delta`),id:U(),delta:U(),providerMetadata:Ru.optional()}),js({type:W(`text-end`),id:U(),providerMetadata:Ru.optional()}),js({type:W(`error`),errorText:U()}),js({type:W(`tool-input-start`),toolCallId:U(),toolName:U(),providerExecuted:bs().optional(),dynamic:bs().optional()}),js({type:W(`tool-input-delta`),toolCallId:U(),inputTextDelta:U()}),js({type:W(`tool-input-available`),toolCallId:U(),toolName:U(),input:ws(),providerExecuted:bs().optional(),providerMetadata:Ru.optional(),dynamic:bs().optional()}),js({type:W(`tool-input-error`),toolCallId:U(),toolName:U(),input:ws(),providerExecuted:bs().optional(),providerMetadata:Ru.optional(),dynamic:bs().optional(),errorText:U()}),js({type:W(`tool-output-available`),toolCallId:U(),output:ws(),providerExecuted:bs().optional(),dynamic:bs().optional(),preliminary:bs().optional()}),js({type:W(`tool-output-error`),toolCallId:U(),errorText:U(),providerExecuted:bs().optional(),dynamic:bs().optional()}),js({type:W(`reasoning-start`),id:U(),providerMetadata:Ru.optional()}),js({type:W(`reasoning-delta`),id:U(),delta:U(),providerMetadata:Ru.optional()}),js({type:W(`reasoning-end`),id:U(),providerMetadata:Ru.optional()}),js({type:W(`source-url`),sourceId:U(),url:U(),title:U().optional(),providerMetadata:Ru.optional()}),js({type:W(`source-document`),sourceId:U(),mediaType:U(),title:U(),filename:U().optional(),providerMetadata:Ru.optional()}),js({type:W(`file`),url:U(),mediaType:U(),providerMetadata:Ru.optional()}),js({type:rc(function(e){return typeof e==`string`&&e.startsWith(`data-`)},{message:`Type must start with "data-"`}),id:U().optional(),data:ws(),transient:bs().optional()}),js({type:W(`start-step`)}),js({type:W(`finish-step`)}),js({type:W(`start`),messageId:U().optional(),messageMetadata:ws().optional()}),js({type:W(`finish`),finishReason:zs([`stop`,`length`,`content-filter`,`tool-calls`,`error`,`other`,`unknown`]).optional(),messageMetadata:ws().optional()}),js({type:W(`abort`)}),js({type:W(`message-metadata`),messageMetadata:ws()})])),e}}();function qu(e,t){if(e!==void 0||t!==void 0){if(e===void 0)return t;if(t===void 0)return e;var n=m({},e);for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];if(i===void 0)continue;var a=r in e?e[r]:void 0,o=!(i===null||S(i)!=`object`||Array.isArray(i)||i instanceof Date||i instanceof RegExp),s=!(a==null||S(a)!=`object`||Array.isArray(a)||a instanceof Date||a instanceof RegExp);n[r]=o&&s?qu(a,i):i}return n}}function Ju(e){var t=[`ROOT`],n=-1,r=null;function i(e,i,a){switch(e){case`"`:n=i,t.pop(),t.push(a),t.push(`INSIDE_STRING`);break;case`f`:case`t`:case`n`:n=i,r=i,t.pop(),t.push(a),t.push(`INSIDE_LITERAL`);break;case`-`:t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=i,t.pop(),t.push(a),t.push(`INSIDE_NUMBER`);break;case`{`:n=i,t.pop(),t.push(a),t.push(`INSIDE_OBJECT_START`);break;case`[`:n=i,t.pop(),t.push(a),t.push(`INSIDE_ARRAY_START`)}}function a(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_OBJECT_AFTER_COMMA`);break;case`}`:n=r,t.pop()}}function o(e,r){switch(e){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=r,t.pop()}}for(var s=0;s<e.length;s++){var c=e[s];switch(t[t.length-1]){case`ROOT`:i(c,s,`FINISH`);break;case`INSIDE_OBJECT_START`:switch(c){case`"`:t.pop(),t.push(`INSIDE_OBJECT_KEY`);break;case`}`:n=s,t.pop()}break;case`INSIDE_OBJECT_AFTER_COMMA`:c===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_KEY`));break;case`INSIDE_OBJECT_KEY`:c===`"`&&(t.pop(),t.push(`INSIDE_OBJECT_AFTER_KEY`));break;case`INSIDE_OBJECT_AFTER_KEY`:c===`:`&&(t.pop(),t.push(`INSIDE_OBJECT_BEFORE_VALUE`));break;case`INSIDE_OBJECT_BEFORE_VALUE`:i(c,s,`INSIDE_OBJECT_AFTER_VALUE`);break;case`INSIDE_OBJECT_AFTER_VALUE`:a(c,s);break;case`INSIDE_STRING`:switch(c){case`"`:t.pop(),n=s;break;case`\\`:t.push(`INSIDE_STRING_ESCAPE`);break;default:n=s}break;case`INSIDE_ARRAY_START`:c===`]`?(n=s,t.pop()):(n=s,i(c,s,`INSIDE_ARRAY_AFTER_VALUE`));break;case`INSIDE_ARRAY_AFTER_VALUE`:switch(c){case`,`:t.pop(),t.push(`INSIDE_ARRAY_AFTER_COMMA`);break;case`]`:n=s,t.pop();break;default:n=s}break;case`INSIDE_ARRAY_AFTER_COMMA`:i(c,s,`INSIDE_ARRAY_AFTER_VALUE`);break;case`INSIDE_STRING_ESCAPE`:t.pop(),n=s;break;case`INSIDE_NUMBER`:switch(c){case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:n=s;break;case`e`:case`E`:case`-`:case`.`:break;case`,`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&a(c,s);break;case`}`:t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`&&a(c,s);break;case`]`:t.pop(),t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s);break;default:t.pop()}break;case`INSIDE_LITERAL`:var l=e.substring(r,s+1);`false`.startsWith(l)||`true`.startsWith(l)||`null`.startsWith(l)?n=s:(t.pop(),t[t.length-1]===`INSIDE_OBJECT_AFTER_VALUE`?a(c,s):t[t.length-1]===`INSIDE_ARRAY_AFTER_VALUE`&&o(c,s))}}for(var u=e.slice(0,n+1),d=t.length-1;d>=0;d--)switch(t[d]){case`INSIDE_STRING`:u+=`"`;break;case`INSIDE_OBJECT_KEY`:case`INSIDE_OBJECT_AFTER_KEY`:case`INSIDE_OBJECT_AFTER_COMMA`:case`INSIDE_OBJECT_START`:case`INSIDE_OBJECT_BEFORE_VALUE`:case`INSIDE_OBJECT_AFTER_VALUE`:u+=`}`;break;case`INSIDE_ARRAY_START`:case`INSIDE_ARRAY_AFTER_COMMA`:case`INSIDE_ARRAY_AFTER_VALUE`:u+=`]`;break;case`INSIDE_LITERAL`:var f=e.substring(r,e.length);`true`.startsWith(f)?u+=`true`.slice(f.length):`false`.startsWith(f)?u+=`false`.slice(f.length):`null`.startsWith(f)&&(u+=`null`.slice(f.length))}return u}function Yu(e){return Xu.apply(this,arguments)}function Xu(){return Xu=r(g().m(function e(t){var n,r;return g().w(function(e){for(;;)switch(e.n){case 0:if(t!==void 0){e.n=1;break}return e.a(2,{value:void 0,state:`undefined-input`});case 1:return e.n=2,Wl({text:t});case 2:if(!(n=e.v).success){e.n=3;break}r={value:n.value,state:`successful-parse`},e.n=5;break;case 3:return e.n=4,Wl({text:Ju(t)});case 4:n=e.v,r=n.success?{value:n.value,state:`repaired-parse`}:{value:void 0,state:`failed-parse`};case 5:return e.a(2,r)}},e)})),Xu.apply(this,arguments)}function Zu(e){return e.type.startsWith(`tool-`)}function Qu(e){return Zu(e)||function(e){return e.type===`dynamic-tool`}(e)}function $u(e){return e.type.split(`-`).slice(1).join(`-`)}function ed(e){var t=e.lastMessage,n=e.messageId;return{message:t?.role===`assistant`?t:{id:n,metadata:void 0,role:`assistant`,parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function td(e){var t=e.stream,n=e.messageMetadataSchema,i=e.dataPartSchemas,a=e.runUpdateMessageJob,o=e.onError,s=e.onToolCall,c=e.onData;return t.pipeThrough(new TransformStream({transform:function(e,t){return r(g().m(function l(){return g().w(function(l){for(;;)switch(l.n){case 0:return l.n=1,a(function(){var a=r(g().m(function a(l){var u,d,f,p,h,_,v,y,b,x,S,C,w,T,ee,E,te,ne,re,ie,ae,oe,se,ce,D;return g().w(function(a){for(;;)switch(a.n){case 0:y=function(){return y=r(g().m(function e(t){var r;return g().w(function(e){for(;;)switch(e.n){case 0:if(t==null){e.n=2;break}if(r=u.message.metadata==null?t:qu(u.message.metadata,t),n==null){e.n=1;break}return e.n=1,Bl({value:r,schema:n});case 1:u.message.metadata=r;case 2:return e.a(2)}},e)})),y.apply(this,arguments)},v=function(e){return y.apply(this,arguments)},_=function(e){var t=u.message.parts.find(function(t){return t.type===`dynamic-tool`&&t.toolCallId===e.toolCallId}),n=e,r=t;t==null?u.message.parts.push(m({type:`dynamic-tool`,toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:n.input,output:n.output,errorText:n.errorText,preliminary:n.preliminary,providerExecuted:n.providerExecuted},n.providerMetadata==null?{}:{callProviderMetadata:n.providerMetadata})):(t.state=e.state,r.toolName=e.toolName,r.input=n.input,r.output=n.output,r.errorText=n.errorText,r.rawInput=n.rawInput??r.rawInput,r.preliminary=n.preliminary,r.providerExecuted=n.providerExecuted??t.providerExecuted,n.providerMetadata!=null&&t.state===`input-available`&&(t.callProviderMetadata=n.providerMetadata))},h=function(e){var t=u.message.parts.find(function(t){return Zu(t)&&t.toolCallId===e.toolCallId}),n=e,r=t;t==null?u.message.parts.push(m({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,input:n.input,output:n.output,rawInput:n.rawInput,errorText:n.errorText,providerExecuted:n.providerExecuted,preliminary:n.preliminary},n.providerMetadata==null?{}:{callProviderMetadata:n.providerMetadata})):(t.state=e.state,r.input=n.input,r.output=n.output,r.errorText=n.errorText,r.rawInput=n.rawInput,r.preliminary=n.preliminary,r.providerExecuted=n.providerExecuted??t.providerExecuted,n.providerMetadata!=null&&t.state===`input-available`&&(t.callProviderMetadata=n.providerMetadata))},p=function(e){var t=u.message.parts.filter(function(e){return e.type===`dynamic-tool`}).find(function(t){return t.toolCallId===e});if(t==null)throw Error(`tool-output-error must be preceded by a tool-input-available`);return t},f=function(e){var t=u.message.parts.filter(Zu).find(function(t){return t.toolCallId===e});if(t==null)throw Error(`tool-output-error must be preceded by a tool-input-available`);return t},u=l.state,d=l.write,D=e.type,a.n=D===`text-start`?1:D===`text-delta`?2:D===`text-end`?3:D===`reasoning-start`?4:D===`reasoning-delta`?5:D===`reasoning-end`?6:D===`file`?7:D===`source-url`?8:D===`source-document`?9:D===`tool-input-start`?10:D===`tool-input-delta`?11:D===`tool-input-available`?13:D===`tool-input-error`?15:D===`tool-output-available`?16:D===`tool-output-error`?17:D===`start-step`?18:D===`finish-step`?19:D===`start`?20:D===`finish`?22:D===`message-metadata`?24:D===`error`?26:27;break;case 1:return b={type:`text`,text:``,providerMetadata:e.providerMetadata,state:`streaming`},u.activeTextParts[e.id]=b,u.message.parts.push(b),d(),a.a(3,30);case 2:return(x=u.activeTextParts[e.id]).text+=e.delta,x.providerMetadata=e.providerMetadata??x.providerMetadata,d(),a.a(3,30);case 3:return(S=u.activeTextParts[e.id]).state=`done`,S.providerMetadata=e.providerMetadata??S.providerMetadata,delete u.activeTextParts[e.id],d(),a.a(3,30);case 4:return C={type:`reasoning`,text:``,providerMetadata:e.providerMetadata,state:`streaming`},u.activeReasoningParts[e.id]=C,u.message.parts.push(C),d(),a.a(3,30);case 5:return(w=u.activeReasoningParts[e.id]).text+=e.delta,w.providerMetadata=e.providerMetadata??w.providerMetadata,d(),a.a(3,30);case 6:return(T=u.activeReasoningParts[e.id]).providerMetadata=e.providerMetadata??T.providerMetadata,T.state=`done`,delete u.activeReasoningParts[e.id],d(),a.a(3,30);case 7:return u.message.parts.push({type:`file`,mediaType:e.mediaType,url:e.url}),d(),a.a(3,30);case 8:return u.message.parts.push({type:`source-url`,sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),d(),a.a(3,30);case 9:return u.message.parts.push({type:`source-document`,sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),d(),a.a(3,30);case 10:return ee=u.message.parts.filter(Zu),u.partialToolCalls[e.toolCallId]={text:``,toolName:e.toolName,index:ee.length,dynamic:e.dynamic},e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-streaming`,input:void 0,providerExecuted:e.providerExecuted}),d(),a.a(3,30);case 11:return(E=u.partialToolCalls[e.toolCallId]).text+=e.inputTextDelta,a.n=12,Yu(E.text);case 12:return te=a.v,ne=te.value,E.dynamic?_({toolCallId:e.toolCallId,toolName:E.toolName,state:`input-streaming`,input:ne}):h({toolCallId:e.toolCallId,toolName:E.toolName,state:`input-streaming`,input:ne}),d(),a.a(3,30);case 13:if(e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:`input-available`,input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),d(),!(s&&!e.providerExecuted)){a.n=14;break}return a.n=14,s({toolCall:e});case 14:return a.a(3,30);case 15:return e.dynamic?_({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}):h({toolCallId:e.toolCallId,toolName:e.toolName,state:`output-error`,input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}),d(),a.a(3,30);case 16:return e.dynamic?(re=p(e.toolCallId),_({toolCallId:e.toolCallId,toolName:re.toolName,state:`output-available`,input:re.input,output:e.output,preliminary:e.preliminary})):(ie=f(e.toolCallId),h({toolCallId:e.toolCallId,toolName:$u(ie),state:`output-available`,input:ie.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary})),d(),a.a(3,30);case 17:return e.dynamic?(ae=p(e.toolCallId),_({toolCallId:e.toolCallId,toolName:ae.toolName,state:`output-error`,input:ae.input,errorText:e.errorText,providerExecuted:e.providerExecuted})):(oe=f(e.toolCallId),h({toolCallId:e.toolCallId,toolName:$u(oe),state:`output-error`,input:oe.input,rawInput:oe.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted})),d(),a.a(3,30);case 18:return u.message.parts.push({type:`step-start`}),a.a(3,30);case 19:return u.activeTextParts={},u.activeReasoningParts={},a.a(3,30);case 20:return e.messageId!=null&&(u.message.id=e.messageId),a.n=21,v(e.messageMetadata);case 21:return e.messageId==null&&e.messageMetadata==null||d(),a.a(3,30);case 22:return e.finishReason!=null&&(u.finishReason=e.finishReason),a.n=23,v(e.messageMetadata);case 23:return e.messageMetadata!=null&&d(),a.a(3,30);case 24:return a.n=25,v(e.messageMetadata);case 25:return e.messageMetadata!=null&&d(),a.a(3,30);case 26:return o?.(Error(e.errorText)),a.a(3,30);case 27:if(!function(e){return e.type.startsWith(`data-`)}(e)){a.n=30;break}if(i?.[e.type]==null){a.n=28;break}return a.n=28,Bl({value:e.data,schema:i[e.type]});case 28:if(!(se=e).transient){a.n=29;break}return c?.(se),a.a(3,30);case 29:ce=se.id==null?void 0:u.message.parts.find(function(e){return se.type===e.type&&se.id===e.id}),ce==null?u.message.parts.push(se):ce.data=se.data,c?.(se),d();case 30:t.enqueue(e);case 31:return a.a(2)}},a)}));return function(e){return a.apply(this,arguments)}}());case 1:return l.a(2)}},l)}))()}}))}Al({prefix:`aitxt`,size:24}),Al({prefix:`aiobj`,size:24});var nd=function(){return s(function e(){a(this,e),this.queue=[],this.isProcessing=!1},[{key:`processQueue`,value:(t=r(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:if(this.isProcessing){e.n=5;break}this.isProcessing=!0;case 1:if(!(this.queue.length>0)){e.n=4;break}return e.n=2,this.queue[0]();case 2:this.queue.shift();case 3:e.n=1;break;case 4:this.isProcessing=!1;case 5:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:`run`,value:(e=r(g().m(function e(t){var n=this;return g().w(function(e){for(;;)if(e.n===0)return e.a(2,new Promise(function(e,i){n.queue.push(r(g().m(function n(){var r;return g().w(function(n){for(;;)switch(n.p=n.n){case 0:return n.p=0,n.n=1,t();case 1:e(),n.n=3;break;case 2:n.p=2,r=n.v,i(r);case 3:return n.a(2)}},n,null,[[0,2]])}))),n.processQueue()}))},e)})),function(t){return e.apply(this,arguments)})}]);var e,t}();Al({prefix:`aiobj`,size:24}),function(e,t){for(var n in t)Au(e,n,{get:t[n],enumerable:!0})}({},{object:function(){return od},text:function(){return ad}});var rd,id,ad=function(){return{type:`text`,responseFormat:{type:`text`},parsePartial:(t=r(g().m(function e(t){var n;return g().w(function(e){for(;;)if(e.n===0)return n=t.text,e.a(2,{partial:n})},e)})),function(e){return t.apply(this,arguments)}),parseOutput:(e=r(g().m(function e(t){var n;return g().w(function(e){for(;;)if(e.n===0)return n=t.text,e.a(2,n)},e)})),function(t){return e.apply(this,arguments)})};var e,t},od=function(e){var t=function(e){return e==null?Ou({properties:{},additionalProperties:!1}):S(t=e)==`object`&&t!==null&&Du in t&&!0===t[Du]&&`jsonSchema`in t&&`validate`in t?e:typeof e==`function`?e():Eu(e);var t}(e.schema);return{type:`object`,responseFormat:{type:`json`,schema:t.jsonSchema},parsePartial:function(e){return r(g().m(function t(){var n,r,i,a;return g().w(function(t){for(;;)switch(t.n){case 0:return n=e.text,t.n=1,Yu(n);case 1:r=t.v,a=r.state,t.n=a===`failed-parse`||a===`undefined-input`?2:a===`repaired-parse`||a===`successful-parse`?3:4;break;case 2:case 5:return t.a(2);case 3:return t.a(2,{partial:r.value});case 4:throw i=r.state,Error(`Unsupported parse state: ${i}`)}},t)}))()},parseOutput:function(e,n){return r(g().m(function r(){var i,a,o;return g().w(function(r){for(;;)switch(r.n){case 0:return i=e.text,r.n=1,Wl({text:i});case 1:if((a=r.v).success){r.n=2;break}throw new Pu({message:`No object generated: could not parse the response.`,cause:a.error,text:i,response:n.response,usage:n.usage,finishReason:n.finishReason});case 2:return r.n=3,Hl({value:a.value,schema:t});case 3:if((o=r.v).success){r.n=4;break}throw new Pu({message:`No object generated: response did not match schema.`,cause:o.error,text:i,response:n.response,usage:n.usage,finishReason:n.finishReason});case 4:return r.a(2,o.value)}},r)}))()}}},sd=function(){return s(function e(t){var n=t.api,r=n===void 0?`/api/chat`:n,i=t.credentials,o=t.headers,s=t.body,c=t.fetch,l=t.prepareSendMessagesRequest,u=t.prepareReconnectToStreamRequest;a(this,e),this.api=r,this.credentials=i,this.headers=o,this.body=s,this.fetch=c,this.prepareSendMessagesRequest=l,this.prepareReconnectToStreamRequest=u},[{key:`sendMessages`,value:(t=r(g().m(function e(t){var n,r,i,a,o,s,c,l,u,d,f,p,_,v,y,b;return g().w(function(e){for(;;)switch(e.n){case 0:return n=t.abortSignal,r=h(t,yn),e.n=1,Kl(this.body);case 1:return a=e.v,e.n=2,Kl(this.headers);case 2:return o=e.v,e.n=3,Kl(this.credentials);case 3:return s=e.v,c=m(m({},Nl(o)),Nl(r.headers)),e.n=4,this.prepareSendMessagesRequest?.call(this,{api:this.api,id:r.chatId,messages:r.messages,body:m(m({},a),r.body),headers:c,credentials:s,requestMetadata:r.metadata,trigger:r.trigger,messageId:r.messageId});case 4:return l=e.v,u=l?.api??this.api,d=l?.headers===void 0?c:Nl(l.headers),f=l?.body===void 0?m(m(m({},a),r.body),{},{id:r.chatId,messages:r.messages,trigger:r.trigger,messageId:r.messageId}):l.body,p=l?.credentials??s,_=this.fetch??globalThis.fetch,e.n=5,_(u,{method:`POST`,headers:Pl(m({"Content-Type":`application/json`},d),`ai-sdk/${Fu}`,Ml()),body:JSON.stringify(f),credentials:p,signal:n});case 5:if((v=e.v).ok){e.n=9;break}return y=Error,e.n=6,v.text();case 6:if((i=e.v)==null){e.n=7;break}b=i,e.n=8;break;case 7:b=`Failed to fetch the chat response.`;case 8:throw new y(b);case 9:if(v.body){e.n=10;break}throw Error(`The response body is empty.`);case 10:return e.a(2,this.processResponseStream(v.body))}},e,this)})),function(e){return t.apply(this,arguments)})},{key:`reconnectToStream`,value:(e=r(g().m(function e(t){var n,r,i,a,o,s,c,l,u,d,f,p,h;return g().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Kl(this.body);case 1:return r=e.v,e.n=2,Kl(this.headers);case 2:return i=e.v,e.n=3,Kl(this.credentials);case 3:return a=e.v,o=m(m({},Nl(i)),Nl(t.headers)),e.n=4,this.prepareReconnectToStreamRequest?.call(this,{api:this.api,id:t.chatId,body:m(m({},r),t.body),headers:o,credentials:a,requestMetadata:t.metadata});case 4:return s=e.v,c=s?.api??`${this.api}/${t.chatId}/stream`,l=s?.headers===void 0?o:Nl(s.headers),u=s?.credentials??a,d=this.fetch??globalThis.fetch,e.n=5,d(c,{method:`GET`,headers:Pl(l,`ai-sdk/${Fu}`,Ml()),credentials:u});case 5:if((f=e.v).status!==204){e.n=6;break}return e.a(2,null);case 6:if(f.ok){e.n=10;break}return p=Error,e.n=7,f.text();case 7:if((n=e.v)==null){e.n=8;break}h=n,e.n=9;break;case 8:h=`Failed to fetch the chat response.`;case 9:throw new p(h);case 10:if(f.body){e.n=11;break}throw Error(`The response body is empty.`);case 11:return e.a(2,this.processResponseStream(f.body))}},e,this)})),function(t){return e.apply(this,arguments)})}]);var e,t}(),cd=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return a(this,e),i(this,e,[t])}return d(e,sd),s(e,[{key:`processResponseStream`,value:function(e){return function(e){var t=e.schema;return e.stream.pipeThrough(new TextDecoderStream).pipeThrough(new cr).pipeThrough(new TransformStream({transform:function(e,n){return r(g().m(function r(){var i,a;return g().w(function(r){for(;;)switch(r.n){case 0:if(i=e.data,i===`[DONE]`){r.n=2;break}return a=n,r.n=1,Wl({text:i,schema:t});case 1:a.enqueue.call(a,r.v);case 2:return r.a(2)}},r)}))()}}))}({stream:e,schema:Ku}).pipeThrough(new TransformStream({transform:function(e,t){return r(g().m(function n(){return g().w(function(n){for(;;)switch(n.n){case 0:if(e.success){n.n=1;break}throw e.error;case 1:t.enqueue(e.value);case 2:return n.a(2)}},n)}))()}}))}}])}(),ld=function(){return s(function e(t){var n=this,i=t.generateId,o=i===void 0?jl:i,s=t.id,c=s===void 0?o():s,l=t.transport,u=l===void 0?new cd:l,d=t.messageMetadataSchema,f=t.dataPartSchemas,p=t.state,_=t.onError,v=t.onToolCall,y=t.onFinish,x=t.onData,S=t.sendAutomaticallyWhen;a(this,e),this.activeResponse=void 0,this.jobExecutor=new nd,this.sendMessage=function(){var e=r(g().m(function e(t,i){var a,o,s;return g().w(function(e){for(;;)switch(e.n){case 0:if(t!=null){e.n=2;break}return e.n=1,n.makeRequest(m({trigger:`submit-message`,messageId:n.lastMessage?.id},i));case 1:return e.a(2,void e.v);case 2:if(!(`text`in t)&&!(`files`in t)){e.n=6;break}if(!Array.isArray(t.files)){e.n=3;break}s=t.files,e.n=5;break;case 3:return e.n=4,function(){var e=r(g().m(function e(t){return g().w(function(e){for(;;)switch(e.n){case 0:if(t!=null){e.n=1;break}return e.a(2,[]);case 1:if(globalThis.FileList&&t instanceof globalThis.FileList){e.n=2;break}throw Error(`FileList is not supported in the current environment`);case 2:return e.a(2,Promise.all(Array.from(t).map(function(){var e=r(g().m(function e(t){var n,r,i,a,o;return g().w(function(e){for(;;)switch(e.n){case 0:return n=t.name,r=t.type,i=r,a=n,e.n=1,new Promise(function(e,n){var r=new FileReader;r.onload=function(t){e(t.target?.result)},r.onerror=function(e){return n(e)},r.readAsDataURL(t)});case 1:return o=e.v,e.a(2,{type:`file`,mediaType:i,filename:a,url:o})}},e)}));return function(t){return e.apply(this,arguments)}}())))}},e)}));return function(t){return e.apply(this,arguments)}}()(t.files);case 4:s=e.v;case 5:a={parts:[].concat(b(s),b(`text`in t&&t.text!=null?[{type:`text`,text:t.text}]:[]))},e.n=7;break;case 6:a=t;case 7:if(t.messageId==null){e.n=10;break}if(o=n.state.messages.findIndex(function(e){return e.id===t.messageId}),o!==-1){e.n=8;break}throw Error(`message with id ${t.messageId} not found`);case 8:if(n.state.messages[o].role===`user`){e.n=9;break}throw Error(`message with id ${t.messageId} is not a user message`);case 9:n.state.messages=n.state.messages.slice(0,o+1),n.state.replaceMessage(o,m(m({},a),{},{id:t.messageId,role:a.role??`user`,metadata:t.metadata})),e.n=11;break;case 10:n.state.pushMessage(m(m({},a),{},{id:a.id??n.generateId(),role:a.role??`user`,metadata:t.metadata}));case 11:return e.n=12,n.makeRequest(m({trigger:`submit-message`,messageId:t.messageId},i));case 12:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),this.regenerate=r(g().m(function e(){var t,r,i,a,o=arguments;return g().w(function(e){for(;;)switch(e.n){case 0:if(r=(t=o.length>0&&o[0]!==void 0?o[0]:{}).messageId,i=h(t,bn),a=r==null?n.state.messages.length-1:n.state.messages.findIndex(function(e){return e.id===r}),a!==-1){e.n=1;break}throw Error(`message ${r} not found`);case 1:return n.state.messages=n.state.messages.slice(0,n.messages[a].role===`assistant`?a:a+1),e.n=2,n.makeRequest(m({trigger:`regenerate-message`,messageId:r},i));case 2:return e.a(2)}},e)})),this.resumeStream=r(g().m(function e(){var t,r=arguments;return g().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&r[0]!==void 0?r[0]:{},e.n=1,n.makeRequest(m({trigger:`resume-stream`},t));case 1:return e.a(2)}},e)})),this.clearError=function(){n.status===`error`&&(n.state.error=void 0,n.setStatus({status:`ready`}))},this.addToolOutput=function(){var e=r(g().m(function e(t){var i,a,o,s,c;return g().w(function(e){for(;;)if(e.n===0)return i=t.state,a=i===void 0?`output-available`:i,t.tool,o=t.toolCallId,s=t.output,c=t.errorText,e.a(2,n.jobExecutor.run(r(g().m(function e(){var t,r,i;return g().w(function(e){for(;;)switch(e.n){case 0:r=n.state.messages,i=r[r.length-1],n.state.replaceMessage(r.length-1,m(m({},i),{},{parts:i.parts.map(function(e){return Qu(e)&&e.toolCallId===o?m(m({},e),{},{state:a,output:s,errorText:c}):e})})),n.activeResponse&&(n.activeResponse.state.message.parts=n.activeResponse.state.message.parts.map(function(e){return Qu(e)&&e.toolCallId===o?m(m({},e),{},{state:a,output:s,errorText:c}):e})),n.status!==`streaming`&&n.status!==`submitted`&&(t=n.sendAutomaticallyWhen)!=null&&t.call(n,{messages:n.state.messages})&&n.makeRequest({trigger:`submit-message`,messageId:n.lastMessage?.id});case 1:return e.a(2)}},e)}))))},e)}));return function(t){return e.apply(this,arguments)}}(),this.addToolResult=this.addToolOutput,this.stop=r(g().m(function e(){var t;return g().w(function(e){for(;;)switch(e.n){case 0:n.status!==`streaming`&&n.status!==`submitted`||(t=n.activeResponse)!=null&&t.abortController&&n.activeResponse.abortController.abort();case 1:return e.a(2)}},e)})),this.id=c,this.transport=u,this.generateId=o,this.messageMetadataSchema=d,this.dataPartSchemas=f,this.state=p,this.onError=_,this.onToolCall=v,this.onFinish=y,this.onData=x,this.sendAutomaticallyWhen=S},[{key:`status`,get:function(){return this.state.status}},{key:`setStatus`,value:function(e){var t=e.status,n=e.error;this.status!==t&&(this.state.status=t,this.state.error=n)}},{key:`error`,get:function(){return this.state.error}},{key:`messages`,get:function(){return this.state.messages},set:function(e){this.state.messages=e}},{key:`lastMessage`,get:function(){return this.state.messages[this.state.messages.length-1]}},{key:`makeRequest`,value:(e=r(g().m(function e(t){var n,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y=this;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.trigger,i=t.metadata,a=t.headers,o=t.body,s=t.messageId,this.setStatus({status:`submitted`,error:void 0}),l=this.lastMessage,u=!1,d=!1,f=!1,e.p=1,(p={state:ed({lastMessage:this.state.snapshot(l),messageId:this.generateId()}),abortController:new AbortController}).abortController.signal.addEventListener(`abort`,function(){u=!0}),this.activeResponse=p,n!==`resume-stream`){e.n=4;break}return e.n=2,this.transport.reconnectToStream({chatId:this.id,metadata:i,headers:a,body:o});case 2:if((h=e.v)!=null){e.n=3;break}return e.a(2,void this.setStatus({status:`ready`}));case 3:m=h,e.n=6;break;case 4:return e.n=5,this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:p.abortController.signal,metadata:i,headers:a,body:o,trigger:n,messageId:s});case 5:m=e.v;case 6:return _=function(e){return y.jobExecutor.run(function(){return e({state:p.state,write:function(){y.setStatus({status:`streaming`}),p.state.message.id===y.lastMessage?.id?y.state.replaceMessage(y.state.messages.length-1,p.state.message):y.state.pushMessage(p.state.message)}})})},e.n=7,function(){var e=r(g().m(function e(t){var n,r,i,a;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:n=t.stream,r=t.onError,i=n.getReader(),e.p=1;case 2:return e.n=3,i.read();case 3:if(!e.v.done){e.n=4;break}return e.a(3,5);case 4:e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,a=e.v,r?.(a);case 7:return e.p=7,i.releaseLock(),e.f(7);case 8:return e.a(2)}},e,null,[[1,6,7,8]])}));return function(t){return e.apply(this,arguments)}}()({stream:td({stream:m,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:_,onError:function(e){throw e}}),onError:function(e){throw e}});case 7:this.setStatus({status:`ready`}),e.n=10;break;case 8:if(e.p=8,v=e.v,!u&&v.name!==`AbortError`){e.n=9;break}return e.a(2,(u=!0,this.setStatus({status:`ready`}),null));case 9:f=!0,v instanceof TypeError&&(v.message.toLowerCase().includes(`fetch`)||v.message.toLowerCase().includes(`network`))&&(d=!0),this.onError&&v instanceof Error&&this.onError(v),this.setStatus({status:`error`,error:v});case 10:e.p=10;try{(c=this.onFinish)==null||c.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:u,isDisconnect:d,isError:f,finishReason:this.activeResponse?.state.finishReason})}catch(e){console.error(e)}return this.activeResponse=void 0,e.f(10);case 11:if(!this.sendAutomaticallyWhen?.call(this,{messages:this.state.messages})||f){e.n=12;break}return e.n=12,this.makeRequest({trigger:`submit-message`,messageId:this.lastMessage?.id,metadata:i,headers:a,body:o});case 12:return e.a(2)}},e,this,[[1,8,10,11]])})),function(t){return e.apply(this,arguments)})}]);var e}();function ud(e){var t=e.messages,n=t[t.length-1];if(!n||n.role!==`assistant`)return!1;var r=n.parts.reduce(function(e,t,n){return t.type===`step-start`?n:e},-1),i=n.parts.slice(r+1).filter(Qu).filter(function(e){return!e.providerExecuted});return i.length>0&&i.every(function(e){return e.state===`output-available`||e.state===`output-error`})}var dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}((id||(id=1,rd=function(e,t){if(typeof e!=`function`)throw TypeError(`Expected the first argument to be a \`function\`, got \`${Fn(e)}\`.`);var n,r=0;return function(){for(var i=this,a=arguments.length,o=Array(a),s=0;s<a;s++)o[s]=arguments[s];clearTimeout(n);var c=Date.now(),l=t-(c-r);l<=0?(r=c,e.apply(this,o)):n=setTimeout(function(){r=Date.now(),e.apply(i,o)},l)}}),rd)),Sd=function(e,t,n){if(!t.has(e))throw TypeError(`Cannot `+n)},Cd=function(e,t,n){return Sd(e,t,`read from private field`),n?n.call(e):t.get(e)},wd=function(e,t,n){if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Td=function(e,t,n,r){return Sd(e,t,`write to private field`),t.set(e,n),n},Ed=function(){return s(function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];a(this,e),wd(this,dd,void 0),wd(this,fd,`ready`),wd(this,pd,void 0),wd(this,md,new Set),wd(this,hd,new Set),wd(this,gd,new Set),this.pushMessage=function(e){Td(t,dd,Cd(t,dd).concat(e)),Cd(t,_d).call(t)},this.popMessage=function(){Td(t,dd,Cd(t,dd).slice(0,-1)),Cd(t,_d).call(t)},this.replaceMessage=function(e,n){Td(t,dd,[].concat(b(Cd(t,dd).slice(0,e)),[t.snapshot(n)],b(Cd(t,dd).slice(e+1)))),Cd(t,_d).call(t)},this.snapshot=function(e){return structuredClone(e)},this[`~registerMessagesCallback`]=function(e,n){var r,i,a=n?(r=e,(i=n)==null?r:xd(r,i)):e;return Cd(t,md).add(a),function(){Cd(t,md).delete(a)}},this[`~registerStatusCallback`]=function(e){return Cd(t,hd).add(e),function(){Cd(t,hd).delete(e)}},this[`~registerErrorCallback`]=function(e){return Cd(t,gd).add(e),function(){Cd(t,gd).delete(e)}},wd(this,_d,function(){Cd(t,md).forEach(function(e){return e()})}),wd(this,vd,function(){Cd(t,hd).forEach(function(e){return e()})}),wd(this,yd,function(){Cd(t,gd).forEach(function(e){return e()})}),Td(this,dd,n)},[{key:`status`,get:function(){return Cd(this,fd)},set:function(e){Td(this,fd,e),Cd(this,vd).call(this)}},{key:`error`,get:function(){return Cd(this,pd)},set:function(e){Td(this,pd,e),Cd(this,yd).call(this)}},{key:`messages`,get:function(){return Cd(this,dd)},set:function(e){Td(this,dd,b(e)),Cd(this,_d).call(this)}}])}();dd=new WeakMap,fd=new WeakMap,pd=new WeakMap,md=new WeakMap,hd=new WeakMap,gd=new WeakMap,_d=new WeakMap,vd=new WeakMap,yd=new WeakMap;var Dd=function(){function e(n){var r,o=n.messages,s=h(n,xn);a(this,e);var c=new Ed(o);return r=i(this,e,[m(m({},s),{},{state:c})]),wd(t(r),bd,void 0),r[`~registerMessagesCallback`]=function(e,n){return Cd(t(r),bd)[`~registerMessagesCallback`](e,n)},r[`~registerStatusCallback`]=function(e){return Cd(t(r),bd)[`~registerStatusCallback`](e)},r[`~registerErrorCallback`]=function(e){return Cd(t(r),bd)[`~registerErrorCallback`](e)},Td(t(r),bd,c),r}return d(e,ld),s(e)}();bd=new WeakMap;var Od=`https://askai.algolia.com/chat`,kd=`https://beta-chat-askai.algolia.com`,Ad=new Set([`AI-203`,`AI-205`,`AI-224`,`AI-225`]);function jd(e,t){for(var n=0,r=Object.entries(e);n<r.length;n++){var i=R(r[n],2),a=i[0],o=i[1];if(a.toLowerCase()===t.toLowerCase()&&typeof o==`string`&&o.trim()!==``)return o.trim()}}function Md(e){var t=/\b(AI-\d{3})\b/i.exec(e);if(t)return t[1].toUpperCase();try{var n=JSON.parse(e),r=n.code??n.errorCode;if(typeof r==`string`&&/AI-\d{3}/i.test(r))return r.trim().toUpperCase()}catch{}}function Nd(e){return/\brequest blocked for this domain\b/.test(e)||/\bblocked for this domain\b/.test(e)}var Pd=[{matches:function(e){return typeof e.extractedCodeUpper==`string`&&Ad.has(e.extractedCodeUpper)}},{matches:function(e){return e.parsedJson!==null&&Nd(((t=jd(e.parsedJson,`message`))??``).toLowerCase());var t},showNewConversationLink:!1},{matches:function(e){return e.parsedJson!==null&&function(e){var t=typeof e.type==`string`?e.type:``;if(/tokenoutput|outputlimit|steplimit|maxstep|ratelimit|domainnotallowed/i.test(t))return!0;var n=jd(e,`error`)??``;if(n.toUpperCase()===`TOO_MANY_REQUESTS`||/token output|output limits|token limits|rate limit|whitelist|step limit|max steps|could not complete response due to token/i.test(n))return!0;var r=jd(e,`message`)??``;if(/rate limit exceeded|retry after \d+/i.test(r)||/whitelist/i.test(r))return!0;var i=r.toLowerCase(),a=i.indexOf(`not allowed`);return a!==-1&&i.indexOf(`domain`,a)!==-1}(e.parsedJson)}},{matches:function(e){return t=e.message,/\bTokenOutputLimitError\b/i.test(t);var t},showNewConversationLink:!1},{matches:function(e){return t=e.messageLower,/\b429\b/.test(t)||/\brate\s*limit/i.test(t)||/\btoo\s+many\s+attempts\b/.test(t)||/\btoo_many_requests\b/.test(t);var t}},{matches:function(e){return Nd(e.messageLower)},showNewConversationLink:!1},{matches:function(e){return t=e.messageLower,/\bwhitelist(ed)?\b/.test(t)||/\bnot\s+allowed\s+for\s+this\s+domain\b/.test(t);var t}},{matches:function(e){return function(e){var t=e;return/\bcontext\s+length\b/.test(t)||/\bmax tokens\b/.test(t)||/\bmax token\b/.test(t)||/\bmaximum tokens\b/.test(t)||/\bmaximum token\b/.test(t)||/\btoken\s+limit\b/.test(t)||/\btoken\s+output\b/.test(t)||/\boutput\s+limits?\b/.test(t)}(e.messageLower)}},{matches:function(e){return function(e){var t=e;return/\bstep limit\b/.test(t)||/\bmax steps\b/.test(t)||/\bmax step\b/.test(t)||/\bmaximum steps\b/.test(t)||/\bmaximum step\b/.test(t)||/\bmax agent steps\b/.test(t)||/\bmax agent step\b/.test(t)||/\bmaximum agent steps\b/.test(t)||/\bmaximum agent step\b/.test(t)}(e.messageLower)}}];function Fd(e){var t=function(e){var t=e.message??``,n=t.toLowerCase(),r=null;try{var i=JSON.parse(t);i&&Fn(i)===`object`&&!Array.isArray(i)&&(r=i)}catch{}return{message:t,messageLower:n,parsedJson:r,extractedCodeUpper:Md(t)}}(e),n=Pd.filter(function(e){return e.matches(t)});return n.length===0?{blocking:!1,showNewConversationLink:!0}:{blocking:!0,showNewConversationLink:n.every(function(e){return!1!==e.showNewConversationLink})}}var Id=function(e,t){var n=t[0].parts.find(function(e){return e.type===`text`}),r=n!=null&&n.text?n.text.replace(/<[^>]*>/g,``).replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`):``;return{query:e,objectID:r,messages:t,type:`askAI`,anchor:`stored`,content:null,hierarchy:{lvl0:`askAI`,lvl1:r,lvl2:null,lvl3:null,lvl4:null,lvl5:null,lvl6:null},url:``,url_without_anchor:``}},Ld=function(e){return e?.parts.find(function(e){return e.type===`text`})};function Rd(e){return!!e&&((t=e.toLowerCase()).includes(`ai-217`)||/thread\s+depth/.test(t));var t}function zd(e){return!!e&&function(e){if(Rd(e))return!0;try{var t=JSON.parse(e),n=t.code??t.errorCode;return typeof n==`string`&&n.toUpperCase()===`AI-217`||Rd(typeof t.message==`string`?t.message:``)}catch{return!1}}(e.message??``)}function Bd(e,t){return!!e&&(!!zd(e)||!!t&&function(e){return Fd(e).blocking}(e))}function Vd(e){if(!e)return!1;var t=e.message??``;if(/TokenOutputLimitError/i.test(t)||/could not complete response due to token output limits/i.test(t))return!0;try{var n=JSON.parse(t);if(typeof n.type==`string`&&/^TokenOutputLimitError$/i.test(n.type.trim())||typeof n.error==`string`&&/token output limits/i.test(n.error))return!0}catch{}return!1}function Hd(e,t){return!e||!Vd(e)&&(!!zd(e)||!t||Fd(e).showNewConversationLink)}function Ud(e){var t=e.trim();if(t)for(var n=0;n<10;){n+=1;try{var r=JSON.parse(t);if(typeof r!=`string`){if(r&&Fn(r)===`object`&&!Array.isArray(r)){var i=r;return jd(i,`message`)||jd(i,`error`)||void 0}return}var a=r.trim();if(!a)return;t=a}catch{if(!/\\"/.test(t)){var o=/"message"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(t);if(o!=null&&o[1])return o[1].replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).trim();var s=/"error"\s*:\s*"((?:[^"\\]|\\.)*)"/.exec(t);return s!=null&&s[1]?s[1].replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).trim():void 0}t=t.replace(/\\"/g,`"`).replace(/\\\\/g,`\\`).trim()}}}function Wd(e){if(e){var t=e.message??``,n=Ud(t);if(n)return n;var r=t.trim().replace(/\s*\(AI-\d{3}\)\s*$/i,``).trim();return r===``?void 0:r}}var Gd=`askai_token`,Kd=function(e){return`https://${e}.algolia.net/agent-studio/1`},qd=function(e){if(!e)return!0;try{var t=function(e){var t=R(e.split(`.`),1)[0];return JSON.parse(atob(t))}(e).exp;return Date.now()/1e3>t-30}catch{return!0}},Jd=null,Yd=function(){var e=k(L().m(function e(t){var n,r,i,a,o,s;return L().w(function(e){for(;;)switch(e.n){case 0:if(n=t.assistantId,r=t.abortSignal,i=t.useStagingEnv,a=i!==void 0&&i,o=sessionStorage.getItem(Gd),qd(o)){e.n=1;break}return e.a(2,o);case 1:return s=a?kd:Od,Jd||=fetch(`${s}/token`,{method:`POST`,headers:{"x-algolia-assistant-id":n,"content-type":`application/json`},signal:r}).then(function(e){return e.json()}).then(function(e){var t=e.token,n=e.success,r=e.message;if(!n&&r)throw Error(r);return sessionStorage.setItem(Gd,t),t}).finally(function(){return Jd=null}),e.a(2,Jd)}},e)}));return function(t){return e.apply(this,arguments)}}(),Xd=function(){var e=k(L().m(function e(t){var n,r,i,a,o,s,c,l,u,d;return L().w(function(e){for(;;)switch(e.n){case 0:return n=t.assistantId,r=t.thumbs,i=t.messageId,a=t.appId,o=t.abortSignal,s=t.useStagingEnv,c=s!==void 0&&s,(l=new Headers).set(`x-algolia-assistant-id`,n),l.set(`content-type`,`application/json`),e.n=1,Yd({assistantId:n,abortSignal:o,useStagingEnv:c});case 1:return u=e.v,l.set(`authorization`,`TOKEN ${u}`),d=c?kd:Od,e.a(2,fetch(`${d}/feedback`,{method:`POST`,body:JSON.stringify({appId:a,messageId:i,thumbs:r}),headers:l}))}},e)}));return function(t){return e.apply(this,arguments)}}(),Zd=function(e){var t=e.agentId,n=e.vote,r=e.messageId,i=e.appId,a=e.apiKey,o=e.abortSignal,s=new Headers;s.set(`x-algolia-application-id`,i),s.set(`x-algolia-api-key`,a),s.set(`content-type`,`application/json`);var c=`${Kd(i)}/feedback`;return fetch(c,{method:`POST`,body:JSON.stringify({messageId:r,agentId:t,vote:n}),headers:s,signal:o})};function Qd(e){return!1===function(){if(typeof window>`u`||!(`localStorage`in window))return!1;var e=`__TEST_KEY__`;try{return window.localStorage.setItem(e,``),window.localStorage.removeItem(e),!0}catch{return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){(function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){if(n instanceof DOMException&&n.name===`QuotaExceededError`)try{(function(){if(typeof window<`u`&&window.localStorage){var e=[];for(var t in window.localStorage)if(t.includes(`__DOCSEARCH_`)){var n=window.localStorage[t];e.push({key:t,size:n.length+t.length})}e.sort(function(e,t){return t.size-e.size});for(var r=Math.ceil(e.length/2),i=0;i<r&&i<e.length;i++)try{window.localStorage.removeItem(e[i].key)}catch{}}})(),window.localStorage.setItem(e,JSON.stringify(t))}catch{}}})(e,t)},getItem:function(){var t=window.localStorage.getItem(e);if(t===null)return[];try{var n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return window.localStorage.removeItem(e),[]}}}}var $d=[`assistantId`,`apiKey`,`appId`,`indexName`,`useStagingEnv`],ef=function(e){var t=e.assistantId,n=e.apiKey,r=e.appId,i=e.indexName,a=e.useStagingEnv,o=a!==void 0&&a,s=jn(e,$d),c=it(new AbortController),l=R(et(function(){return jl()}),2),u=l[0],d=l[1],f=it(null),p=it(null),m=it(null),g=ot(function(){return s.agentStudio?function(e){var t=e.appId,n=e.apiKey,r=e.assistantId,i=e.searchParameters;return new cd({api:`${Kd(t)}/agents/${r}/completions?stream=true&compatibilityMode=ai-sdk-5`,headers:{"x-algolia-application-id":t,"x-algolia-api-key":n},body:i?{algolia:{searchParameters:i}}:{}})}({apiKey:n,appId:r,assistantId:t??``,searchParameters:s.searchParameters}):function(e){var t,n=e.assistantId,r=e.apiKey,i=e.indexName,a=e.searchParameters,o=e.appId,s=e.abortControllerRef,c=e.useStagingEnv;return new cd({api:c?kd:Od,headers:(t=k(L().m(function e(){var t;return L().w(function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}throw Error(`Ask AI assistant ID is required`);case 1:return e.n=2,Yd({assistantId:n,abortSignal:s.current.signal,useStagingEnv:c});case 2:return t=e.v,e.a(2,I(I({},t?{authorization:`TOKEN ${t}`}:{}),{},{"X-Algolia-API-Key":r,"X-Algolia-Application-Id":o,"X-Algolia-Index-Name":i,"X-Algolia-Assistant-Id":n||``,"X-AI-SDK-Version":`v5`}))}},e)})),function(){return t.apply(this,arguments)}),body:a?{searchParameters:a}:{}})}({assistantId:t??``,apiKey:n,appId:r,indexName:i,searchParameters:s.searchParameters,abortControllerRef:c,useStagingEnv:o})},[n,r,t,i,o,s]),_=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.experimental_throttle,n=e.resume,r=n!==void 0&&n,i=h(e,Sn),a=it(`chat`in i?i.chat:new Dd(i));(`chat`in i&&i.chat!==a.current||`id`in i&&a.current.id!==i.id)&&(a.current=`chat`in i?i.chat:new Dd(i));var o=vt(st(function(e){return a.current[`~registerMessagesCallback`](e,t)},[t,`id`in i?i.id:null]),function(){return a.current.messages}),s=vt(a.current[`~registerStatusCallback`],function(){return a.current.status}),c=vt(a.current[`~registerErrorCallback`],function(){return a.current.error}),l=st(function(e){typeof e==`function`&&(e=e(a.current.messages)),a.current.messages=e},[a]);return nt(function(){r&&a.current.resumeStream()},[r,a]),{id:a.current.id,messages:o,setMessages:l,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:c,resumeStream:a.current.resumeStream,status:s,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput}}(ot(function(){return{id:u,sendAutomaticallyWhen:ud,transport:g}},[u,g])),v=_.messages,y=_.sendMessage,b=_.status,x=_.setMessages,S=_.error,C=_.stop,w=_.clearError;p.current=y,m.current=x;var T=it(function(e){var t=e.limit,n=t===void 0?5:t,r=Qd(e.key),i=r.getItem().slice(0,n);return{add:function(e){var t=e.objectID,a=e.query,o=i.findIndex(function(e){return e.objectID===t||e.query===a});o>-1?i[o]=e:(i.unshift(e),i=i.slice(0,n)),r.setItem(i)},addFeedback:function(e,t){var n=i.find(function(t){return t.messages?.some(function(t){return t.id===e})});if(n&&n.messages){var a=n.messages.find(function(t){return t.id===e});a&&(a.feedback=t,r.setItem(i))}},getOne:function(e){var t,n=i.find(function(t){return t.messages?.some(function(t){return t.id===e})});return n==null||(t=n.messages)==null?void 0:t.find(function(t){return t.id===e})},getAll:function(){return i},remove:function(e){i=i.filter(function(t){return t.objectID!==e.objectID}),r.setItem(i)},getConversation:function(e){var t=i.find(function(t){return t.messages?.some(function(t){return t.id===e})});if(t&&t.messages)return t}}}({key:`__DOCSEARCH_ASKAI_CONVERSATIONS__${i}`,limit:10})).current,ee=st(function(){var e=k(L().m(function e(i,a){var l;return L().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2);case 1:return e.n=2,s.agentStudio?Zd({agentId:t,vote:a,messageId:i,appId:r,apiKey:n,abortSignal:c.current.signal}):Xd({assistantId:t,thumbs:a,messageId:i,appId:r,abortSignal:c.current.signal,useStagingEnv:o});case 2:if(!(e.v.status>=300)){e.n=3;break}throw Error(`Failed, try again later.`);case 3:(l=T.addFeedback)==null||l.call(T,i,a===1?`like`:`dislike`);case 4:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),[t,s.agentStudio,r,n,o,T]),E=st(function(){c.current.abort(),c.current=new AbortController},[]),te=st(function(e){E(),f.current=e??null,d(jl())},[E]);nt(function(){var e=f.current;if(e!==null){var t=p.current,n=m.current;if(e.kind===`sendText`){if(!t)return;f.current=null,t({text:e.text},e.requestOptions??{});return}if(e.kind===`sendUserMessage`){if(!t)return;f.current=null,t(e.message,e.requestOptions??{});return}n&&(f.current=null,n(e.messages))}},[u]);var ne=function(){var e=k(L().m(function e(){return L().w(function(e){for(;;)switch(e.n){case 0:return c.current.abort(),e.n=1,C();case 1:c.current=new AbortController;case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),re=ot(function(){for(var e=[],t=0;t<v.length;t++)if(v[t].role===`user`){var n=v[t],r=v[t+1]?.role===`assistant`?v[t+1]:null;e.push({id:n.id,userMessage:n,assistantMessage:r}),r&&t++}return e},[v]),ie=b===`streaming`||b===`submitted`;return{messages:v,sendMessage:y,status:b,setMessages:x,clearError:w,resetAskAiAbortScope:E,resetAskAiChatSession:te,askAiError:ot(function(){if(S)return s.agentStudio?function(e){var t,n=e.message;try{t=JSON.parse(n)}catch{var r=Ud(n);return Error(r??n)}for(;typeof t==`string`;)try{t=JSON.parse(t.trim())}catch{var i=Ud(n);return Error(i??t)}if(Fn(t)!==`object`||t===null||Array.isArray(t)){var a=Ud(n);return Error(a??n)}var o,s=t;if(s.name===`ValidationError`){var c=s,l=n;if(c.detail&&c.detail.length>0){var u=c.detail[0];l=`${u.msg}: ${u.loc.at(-1)}`}return Error(l)}o=Ud(n)||(typeof s.message==`string`&&s.message.trim()!==``?s.message.trim():typeof s.error==`string`&&s.error.trim()!==``?s.error.trim():n);var d=s.code??s.errorCode;if(typeof d==`string`&&d.trim()!==``){var f=d.trim();o.toUpperCase().includes(f.toUpperCase())||(o=`${o} (${f})`)}return Error(o)}(S):S},[S,s.agentStudio]),stopAskAiStreaming:ne,isStreaming:ie,exchanges:re,conversations:T,sendFeedback:ee}},tf=function(){var e=R(O.useState(!1),2),t=e[0],n=e[1];return O.useEffect(function(){var e=function(){n(window.matchMedia(`(max-width: 768px)`).matches)};return e(),window.addEventListener(`resize`,e),function(){window.removeEventListener(`resize`,e)}},[]),t};function nf(e){var t,n=`algolia-client-js-${e.key}`;function r(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function i(){return JSON.parse(r().getItem(n)||`{}`)}function a(e){r().setItem(n,JSON.stringify(e))}return{get:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){var n,r,o;return n=e.timeToLive?1e3*e.timeToLive:null,r=i(),a(o=Object.fromEntries(Object.entries(r).filter(function(e){return R(e,2)[1].timestamp!==void 0}))),n&&a(Object.fromEntries(Object.entries(o).filter(function(e){var t=R(e,2)[1],r=new Date().getTime();return!(t.timestamp+n<r)}))),i()[JSON.stringify(t)]}).then(function(e){return Promise.all([e?e.value:n(),e!==void 0])}).then(function(e){var t=R(e,2),n=t[0],i=t[1];return Promise.all([n,i||r.miss(n)])}).then(function(e){return R(e,1)[0]})},set:function(e,t){return Promise.resolve().then(function(){var a=i();return a[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete:function(e){return Promise.resolve().then(function(){var t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear:function(){return Promise.resolve().then(function(){r().removeItem(n)})}}}function rf(e){var t=z(e.caches),n=t.shift();return n===void 0?{get:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then(function(e){return Promise.all([e,n.miss(e)])}).then(function(e){return R(e,1)[0]})},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}};return n.get(e,r,i).catch(function(){return rf({caches:t}).get(e,r,i)})},set:function(e,r){return n.set(e,r).catch(function(){return rf({caches:t}).set(e,r)})},delete:function(e){return n.delete(e).catch(function(){return rf({caches:t}).delete(e)})},clear:function(){return n.clear().catch(function(){return rf({caches:t}).clear()})}}}function af(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{serializable:!0},t={};return{get:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var o=r();return o.then(function(e){return i.miss(e)}).then(function(){return o})},set:function(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function of(e){var t=e.algoliaAgents,n=e.client,r=e.version,i=function(e){var t={value:`Algolia for JavaScript (${e})`,add:function(e){var n=`; ${e.segment}${e.version===void 0?``:` (${e.version})`}`;return t.value.indexOf(n)===-1&&(t.value=`${t.value}${n}`),t}};return t}(r).add({segment:n,version:r});return t.forEach(function(e){return i.add(e)}),i}var sf=12e4;function cf(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`up`,n=Date.now();return I(I({},e),{},{status:t,lastUpdate:n,isUp:function(){return t===`up`||Date.now()-n>sf},isTimedOut:function(){return t===`timed out`&&Date.now()-n<=sf}})}var lf=function(){function e(t,n){var r;return j(this,e),P(r=A(this,e,[t]),`name`,`AlgoliaError`),n&&(r.name=n),r}return F(e,Ln(Error)),M(e)}(),uf=function(){function e(t,n,r){var i;return j(this,e),P(i=A(this,e,[t,r]),`stackTrace`,void 0),i.stackTrace=n,i}return F(e,lf),M(e)}(),df=function(){function e(t){return j(this,e),A(this,e,[`Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support`,t,`RetryError`])}return F(e,uf),M(e)}(),ff=function(){function e(t,n,r){var i,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`ApiError`;return j(this,e),P(i=A(this,e,[t,r,a]),`status`,void 0),i.status=n,i}return F(e,uf),M(e)}(),pf=function(){function e(t,n){var r;return j(this,e),P(r=A(this,e,[t,`DeserializationError`]),`response`,void 0),r.response=n,r}return F(e,lf),M(e)}(),mf=function(){function e(t,n,r,i){var a;return j(this,e),P(a=A(this,e,[t,n,i,`DetailedApiError`]),`error`,void 0),a.error=r,a}return F(e,ff),M(e)}();function hf(e,t,n){var r,i=(r=n,Object.keys(r).filter(function(e){return r[e]!==void 0}).sort().map(function(e){return`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])===`[object Array]`?r[e].join(`,`):r[e]).replace(/\+/g,`%20`)}`}).join(`&`)),a=`${e.protocol}://${e.url}${e.port?`:${e.port}`:``}/${t.charAt(0)===`/`?t.substring(1):t}`;return i.length&&(a+=`?${i}`),a}function gf(e,t){if(e.method!==`GET`&&(e.data!==void 0||t.data!==void 0)){var n=Array.isArray(e.data)?e.data:I(I({},e.data),t.data);return JSON.stringify(n)}}function _f(e,t,n){var r=I(I(I({Accept:`application/json`},e),t),n),i={};return Object.keys(r).forEach(function(e){var t=r[e];i[e.toLowerCase()]=t}),i}function vf(e){try{return JSON.parse(e.content)}catch(t){throw new pf(t.message,e)}}function yf(e,t){var n=e.content,r=e.status;try{var i=JSON.parse(n);return`error`in i?new mf(i.message,r,i.error,t):new ff(i.message,r,t)}catch{}return new ff(n,r,t)}function bf(e){var t=e.isTimedOut,n=e.status;return t||function(e){return!e.isTimedOut&&~~e.status===0}({isTimedOut:t,status:n})||~~(n/100)!=2&&~~(n/100)!=4}function xf(e){return~~(e.status/100)==2}function Sf(e){return e.map(function(e){return Cf(e)})}function Cf(e){var t=e.request.headers[`x-algolia-api-key`]?{"x-algolia-api-key":`*****`}:{};return I(I({},e),{},{request:I(I({},e.request),{},{headers:I(I({},e.request.headers),t)})})}var wf=[`appId`,`apiKey`,`authMode`,`algoliaAgents`],Tf=[`params`],Ef=`5.43.0`;function Df(e){return[{url:`${e}-dsn.algolia.net`,accept:`read`,protocol:`https`},{url:`${e}.algolia.net`,accept:`write`,protocol:`https`}].concat(function(e){for(var t=e,n=e.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),i=e[n];t[n]=e[r],t[r]=i}return t}([{url:`${e}-1.algolianet.com`,accept:`readWrite`,protocol:`https`},{url:`${e}-2.algolianet.com`,accept:`readWrite`,protocol:`https`},{url:`${e}-3.algolianet.com`,accept:`readWrite`,protocol:`https`}]))}var Of=`4.6.3`;function kf(e,t,n){return O.useMemo(function(){var r=function(e,t){if(!e||typeof e!=`string`)throw Error("`appId` is missing.");if(!t||typeof t!=`string`)throw Error("`apiKey` is missing.");return function(e){var t=e.appId,n=e.apiKey,r=e.authMode,i=e.algoliaAgents,a=jn(e,wf),o=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`WithinHeaders`,r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:function(){return n===`WithinHeaders`?r:{}},queryParameters:function(){return n===`WithinQueryParameters`?r:{}}}}(t,n,r),s=function(e){var t=e.hosts,n=e.hostsCache,r=e.baseHeaders,i=e.logger,a=e.baseQueryParameters,o=e.algoliaAgent,s=e.timeouts,c=e.requester,l=e.requestsCache,u=e.responsesCache;function d(e){return f.apply(this,arguments)}function f(){return(f=k(L().m(function e(t){var r,i,a,o,s;return L().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all(t.map(function(e){return n.get(e,function(){return Promise.resolve(cf(e))})}));case 1:return r=e.v,i=r.filter(function(e){return e.isUp()}),a=r.filter(function(e){return e.isTimedOut()}),o=[].concat(z(i),z(a)),s=o.length>0?o:t,e.a(2,{hosts:s,getTimeout:function(e,t){return(a.length===0&&e===0?1:a.length+3+e)*t}})}},e)}))).apply(this,arguments)}function p(e,t){return m.apply(this,arguments)}function m(){return m=k(L().m(function e(l,u){var f,p,m,h,g,_,v,y,b,x,S,C,w,T=arguments;return L().w(function(e){for(;;)switch(e.n){case 0:if(f=!(T.length>2&&T[2]!==void 0)||T[2],p=[],m=gf(l,u),h=_f(r,l.headers,u.headers),g=l.method===`GET`?I(I({},l.data),u.data):{},_=I(I(I({},a),l.queryParameters),g),o.value&&(_[`x-algolia-agent`]=o.value),u&&u.queryParameters)for(v=0,y=Object.keys(u.queryParameters);v<y.length;v++)b=y[v],u.queryParameters[b]&&Object.prototype.toString.call(u.queryParameters[b])!==`[object Object]`?_[b]=u.queryParameters[b].toString():_[b]=u.queryParameters[b];return x=0,S=function(){var e=k(L().m(function e(t,r){var a,o,d,g,v,y;return L().w(function(e){for(;;)switch(e.n){case 0:if((a=t.pop())!==void 0){e.n=1;break}throw new df(Sf(p));case 1:return o=I(I({},s),u.timeouts),d={data:m,headers:h,method:l.method,url:hf(a,l.path,_),connectTimeout:r(x,o.connect),responseTimeout:r(x,f?o.read:o.write)},g=function(e){var n={request:d,response:e,host:a,triesLeft:t.length};return p.push(n),n},e.n=2,c.send(d);case 2:if(!bf(v=e.v)){e.n=4;break}return y=g(v),v.isTimedOut&&x++,i.info(`Retryable failure`,Cf(y)),e.n=3,n.set(a,cf(a,v.isTimedOut?`timed out`:`down`));case 3:return e.a(2,S(t,r));case 4:if(!xf(v)){e.n=5;break}return e.a(2,vf(v));case 5:throw g(v),yf(v,p);case 6:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}(),C=t.filter(function(e){return e.accept===`readWrite`||(f?e.accept===`read`:e.accept===`write`)}),e.n=1,d(C);case 1:return w=e.v,e.a(2,S(z(w.hosts).reverse(),w.getTimeout))}},e)})),m.apply(this,arguments)}return{hostsCache:n,requester:c,timeouts:s,logger:i,algoliaAgent:o,baseHeaders:r,baseQueryParameters:a,hosts:t,request:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.useReadTransporter||e.method===`GET`;if(!n)return p(e,t,n);var i=function(){return p(e,t)};if(!0!==(t.cacheable||e.cacheable))return i();var o={request:e,requestOptions:t,transporter:{queryParameters:a,headers:r}};return u.get(o,function(){return l.get(o,function(){return l.set(o,i()).then(function(e){return Promise.all([l.delete(o),e])},function(e){return Promise.all([l.delete(o),Promise.reject(e)])}).then(function(e){var t=R(e,2);return t[0],t[1]})})},{miss:function(e){return u.set(o,e)}})},requestsCache:l,responsesCache:u}}(I(I({hosts:Df(t)},a),{},{algoliaAgent:of({algoliaAgents:i,client:`Lite`,version:Ef}),baseHeaders:I(I({"content-type":`text/plain`},o.headers()),a.baseHeaders),baseQueryParameters:I(I({},o.queryParameters()),a.baseQueryParameters)}));return{transporter:s,appId:t,apiKey:n,clearCache:function(){return Promise.all([s.requestsCache.clear(),s.responsesCache.clear()]).then(function(){})},get _ua(){return s.algoliaAgent.value},addAlgoliaAgent:function(e,t){s.algoliaAgent.add({segment:e,version:t})},setClientApiKey:function(e){var t=e.apiKey;r&&r!==`WithinHeaders`?s.baseQueryParameters[`x-algolia-api-key`]=t:s.baseHeaders[`x-algolia-api-key`]=t},searchForHits:function(e,t){return this.search(e,t)},searchForFacets:function(e,t){return this.search(e,t)},customPost:function(e,t){var n=e.path,r=e.parameters,i=e.body;if(!n)throw Error("Parameter `path` is required when calling `customPost`.");var a={method:`POST`,path:`/{path}`.replace(`{path}`,n),queryParameters:r||{},headers:{},data:i||{}};return s.request(a,t)},getRecommendations:function(e,t){if(e&&Array.isArray(e)&&(e={requests:e}),!e)throw Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");var n={method:`POST`,path:`/1/indexes/*/recommendations`,queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)},search:function(e,t){if(e&&Array.isArray(e)&&(e={requests:e.map(function(e){var t=e.params,n=jn(e,Tf);return n.type===`facet`?I(I(I({},n),t),{},{type:`facet`}):I(I(I({},n),t),{},{facet:void 0,maxFacetHits:void 0,facetQuery:void 0})})}),!e)throw Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw Error("Parameter `searchMethodParams.requests` is required when calling `search`.");var n={method:`POST`,path:`/1/indexes/*/queries`,queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return s.request(n,t)}}}(I({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:{debug:function(e,t){return Promise.resolve()},info:function(e,t){return Promise.resolve()},error:function(e,t){return Promise.resolve()}},requester:{send:function(e){return new Promise(function(t){var n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach(function(t){return n.setRequestHeader(t,e.headers[t])});var r,i=function(e,r){return setTimeout(function(){n.abort(),t({status:0,content:r,isTimedOut:!0})},e)},a=i(e.connectTimeout,`Connection timeout`);n.onreadystatechange=function(){n.readyState>n.OPENED&&r===void 0&&(clearTimeout(a),r=i(e.responseTimeout,`Socket timeout`))},n.onerror=function(){n.status===0&&(clearTimeout(a),clearTimeout(r),t({content:n.responseText||`Network request failed`,status:n.status,isTimedOut:!1}))},n.onload=function(){clearTimeout(a),clearTimeout(r),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)})}},algoliaAgents:[{segment:`Browser`}],authMode:`WithinQueryParameters`,responsesCache:af(),requestsCache:af({serializable:!1}),hostsCache:rf({caches:[nf({key:`${Ef}-${e}`}),af()]})},void 0))}(e,t);return r.addAlgoliaAgent(`docsearch`,Of),!1===/docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value)&&r.addAlgoliaAgent(`docsearch-react`,Of),n(r)},[e,t,n])}function Af(e){var t=e.className;return O.createElement(`svg`,{viewBox:`0 0 38 38`,className:t,stroke:`currentColor`,strokeOpacity:`.5`},O.createElement(`g`,{fill:`none`,fillRule:`evenodd`},O.createElement(`g`,{transform:`translate(1 1)`,strokeWidth:`2`},O.createElement(`circle`,{strokeOpacity:`.3`,cx:`18`,cy:`18`,r:`18`}),O.createElement(`path`,{d:`M36 18c0-9.94-8.06-18-18-18`},O.createElement(`animateTransform`,{attributeName:`transform`,type:`rotate`,from:`0 18 18`,to:`360 18 18`,dur:`1s`,repeatCount:`indefinite`})))))}function jf(e){var t=e.className,n=t===void 0?``:t;return O.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`DocSearch-Hit-icon-sparkles ${n}`},O.createElement(`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`}),O.createElement(`path`,{d:`M20 3v4`}),O.createElement(`path`,{d:`M22 5h-4`}),O.createElement(`path`,{d:`M4 17v2`}),O.createElement(`path`,{d:`M5 18H3`}))}function Mf(){return O.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`},O.createElement(`g`,{stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`},O.createElement(`path`,{d:`M3.18 6.6a8.23 8.23 0 1112.93 9.94h0a8.23 8.23 0 01-11.63 0`}),O.createElement(`path`,{d:`M6.44 7.25H2.55V3.36M10.45 6v5.6M10.45 11.6L13 13`})))}function Nf(){return O.createElement(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`},O.createElement(`path`,{d:`M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z`,stroke:`currentColor`,fill:`none`,fillRule:`evenodd`,strokeLinecap:`round`,strokeLinejoin:`round`}))}function Pf(e){var t=e.size,n=t===void 0?20:t,r=e.color,i=r===void 0?`currentColor`:r;return O.createElement(`svg`,{width:n,height:n,className:`DocSearch-Search-Icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`},O.createElement(`circle`,{cx:`11`,cy:`11`,r:`8`,stroke:i,fill:`none`,strokeWidth:`1.4`}),O.createElement(`path`,{d:`m21 21-4.3-4.3`,stroke:i,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`}))}function Ff(){return O.createElement(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,fillRule:`evenodd`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,className:`lucide lucide-triangle-alert-icon lucide-triangle-alert`},O.createElement(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),O.createElement(`path`,{d:`M12 9v4`}),O.createElement(`path`,{d:`M12 17h.01`}))}function If(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,viewBox:`0 0 18 18`,fill:`none`},O.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8.99984 1.29102C4.74264 1.29102 1.2915 4.74215 1.2915 8.99935C1.2915 13.2565 4.74264 16.7077 8.99984 16.7077C13.257 16.7077 16.7082 13.2565 16.7082 8.99935C16.7082 4.74215 13.257 1.29102 8.99984 1.29102ZM0.0415039 8.99935C0.0415039 4.0518 4.05229 0.0410156 8.99984 0.0410156C13.9474 0.0410156 17.9582 4.0518 17.9582 8.99935C17.9582 13.9469 13.9474 17.9577 8.99984 17.9577C4.05229 17.9577 0.0415039 13.9469 0.0415039 8.99935ZM5.87484 6.49935C5.87484 6.15417 6.15466 5.87435 6.49984 5.87435H11.4998C11.845 5.87435 12.1248 6.15417 12.1248 6.49935V11.4993C12.1248 11.8445 11.845 12.1243 11.4998 12.1243H6.49984C6.15466 12.1243 5.87484 11.8445 5.87484 11.4993V6.49935ZM7.12484 7.12435V10.8743H10.8748V7.12435H7.12484Z`,fill:`currentcolor`}))}function Lf(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:4,height:16,viewBox:`0 0 4 16`,fill:`none`},O.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M1.99984 1.95898C1.88478 1.95898 1.7915 2.05226 1.7915 2.16732C1.7915 2.28238 1.88478 2.37565 1.99984 2.37565C2.1149 2.37565 2.20817 2.28238 2.20817 2.16732C2.20817 2.05226 2.1149 1.95898 1.99984 1.95898ZM0.541504 2.16732C0.541504 1.3619 1.19442 0.708984 1.99984 0.708984C2.80525 0.708984 3.45817 1.3619 3.45817 2.16732C3.45817 2.97273 2.80525 3.62565 1.99984 3.62565C1.19442 3.62565 0.541504 2.97273 0.541504 2.16732ZM1.99984 7.79232C1.88478 7.79232 1.7915 7.88559 1.7915 8.00065C1.7915 8.11571 1.88478 8.20898 1.99984 8.20898C2.1149 8.20898 2.20817 8.11571 2.20817 8.00065C2.20817 7.88559 2.1149 7.79232 1.99984 7.79232ZM0.541504 8.00065C0.541504 7.19524 1.19442 6.54232 1.99984 6.54232C2.80525 6.54232 3.45817 7.19524 3.45817 8.00065C3.45817 8.80607 2.80525 9.45898 1.99984 9.45898C1.19442 9.45898 0.541504 8.80607 0.541504 8.00065ZM1.99984 13.6257C1.88478 13.6257 1.7915 13.7189 1.7915 13.834C1.7915 13.949 1.88478 14.0423 1.99984 14.0423C2.1149 14.0423 2.20817 13.949 2.20817 13.834C2.20817 13.7189 2.1149 13.6257 1.99984 13.6257ZM0.541504 13.834C0.541504 13.0286 1.19442 12.3757 1.99984 12.3757C2.80525 12.3757 3.45817 13.0286 3.45817 13.834C3.45817 14.6394 2.80525 15.2923 1.99984 15.2923C1.19442 15.2923 0.541504 14.6394 0.541504 13.834Z`,fill:`currentcolor`}))}function Rf(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 18 18`,fill:`none`},O.createElement(`path`,{d:`M9 0.875C10.6068 0.875 12.1776 1.35149 13.5137 2.24414C14.8498 3.13693 15.8919 4.40598 16.5068 5.89062C17.1218 7.37522 17.2822 9.00892 16.9688 10.585C16.6552 12.1611 15.8814 13.6088 14.7451 14.7451C13.6088 15.8814 12.1611 16.6552 10.585 16.9688C9.00892 17.2822 7.37523 17.1218 5.89062 16.5068C4.40598 15.8919 3.13693 14.8498 2.24414 13.5137C1.35149 12.1776 0.875 10.6068 0.875 9C0.875 8.65482 1.15482 8.375 1.5 8.375C1.84518 8.375 2.125 8.65482 2.125 9C2.125 10.3596 2.52792 11.6888 3.2832 12.8193C4.03864 13.9499 5.1129 14.8312 6.36914 15.3516C7.62523 15.8718 9.00736 16.0083 10.3408 15.7432C11.6744 15.4779 12.8998 14.8228 13.8613 13.8613C14.8228 12.8998 15.4779 11.6744 15.7432 10.3408C16.0083 9.00736 15.8718 7.62523 15.3516 6.36914C14.8312 5.1129 13.9499 4.03864 12.8193 3.2832C11.6888 2.52792 10.3596 2.125 9 2.125C7.06829 2.125 5.21604 2.89096 3.82129 4.22949L3.00879 5.04199H5.66699C6.01202 5.04217 6.29199 5.32192 6.29199 5.66699C6.29182 6.01191 6.01191 6.29182 5.66699 6.29199H1.5C1.45939 6.29199 1.41889 6.28716 1.37891 6.2793C1.36148 6.27587 1.345 6.26949 1.32812 6.26465C1.267 6.24714 1.20782 6.22205 1.15332 6.18555C1.08536 6.14005 1.02604 6.08256 0.980469 6.01465C0.970244 5.99942 0.962841 5.98268 0.954102 5.9668C0.904937 5.87756 0.875056 5.77606 0.875 5.66699V1.5C0.875 1.15482 1.15482 0.875002 1.5 0.875C1.84518 0.875 2.125 1.15482 2.125 1.5V4.15723L2.94141 3.3418L2.9502 3.33301C4.57158 1.77433 6.73388 0.875 9 0.875ZM9.33301 4.20801C9.67808 4.20801 9.95783 4.48798 9.95801 4.83301V9.44727L12.9463 10.9414C13.2548 11.0958 13.3798 11.4707 13.2256 11.7793C13.0712 12.088 12.6955 12.213 12.3867 12.0586L9.05371 10.3926C8.84198 10.2867 8.70801 10.0697 8.70801 9.83301V4.83301C8.70818 4.48809 8.98809 4.20819 9.33301 4.20801Z`,fill:`currentcolor`}))}function zf(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`19`,height:`19`,viewBox:`0 0 19 19`,fill:`none`},O.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M0.712717 3.38039C1.14249 2.95062 1.72538 2.70917 2.33317 2.70917H8.1665C8.51168 2.70917 8.7915 2.989 8.7915 3.33417C8.7915 3.67935 8.51168 3.95917 8.1665 3.95917H2.33317C2.0569 3.95917 1.79195 4.06892 1.5966 4.26427C1.40125 4.45962 1.2915 4.72457 1.2915 5.00084V16.6675C1.2915 16.9438 1.40125 17.2087 1.5966 17.4041C1.79195 17.5994 2.0569 17.7092 2.33317 17.7092H13.9998C14.2761 17.7092 14.5411 17.5994 14.7364 17.4041C14.9318 17.2087 15.0415 16.9438 15.0415 16.6675V10.8342C15.0415 10.489 15.3213 10.2092 15.6665 10.2092C16.0117 10.2092 16.2915 10.489 16.2915 10.8342V16.6675C16.2915 17.2753 16.0501 17.8582 15.6203 18.288C15.1905 18.7177 14.6076 18.9592 13.9998 18.9592H2.33317C1.72538 18.9592 1.14249 18.7177 0.712717 18.288C0.282947 17.8582 0.0415039 17.2753 0.0415039 16.6675V5.00084C0.0415039 4.39305 0.282947 3.81016 0.712717 3.38039Z`,fill:`currentcolor`}),O.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.6665 2.19141C15.3634 2.19141 15.0728 2.3118 14.8584 2.52611L7.06419 10.3204L6.52548 12.4752L8.68031 11.9365L16.4746 4.14223C16.6889 3.92792 16.8093 3.63725 16.8093 3.33417C16.8093 3.03109 16.6889 2.74043 16.4746 2.52611C16.2603 2.3118 15.9696 2.19141 15.6665 2.19141ZM13.9746 1.64223C14.4233 1.1935 15.0319 0.941406 15.6665 0.941406C16.3011 0.941406 16.9097 1.1935 17.3584 1.64223C17.8072 2.09096 18.0593 2.69957 18.0593 3.33417C18.0593 3.96877 17.8072 4.57738 17.3584 5.02611L9.44178 12.9428C9.36168 13.0229 9.26132 13.0797 9.15142 13.1072L5.81809 13.9405C5.6051 13.9938 5.3798 13.9314 5.22456 13.7761C5.06932 13.6209 5.00692 13.3956 5.06016 13.1826L5.8935 9.84925C5.92097 9.73936 5.9778 9.639 6.0579 9.5589L13.9746 1.64223Z`,fill:`currentcolor`}))}var Bf,Vf=function(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},O.createElement(`path`,{d:`m5 12 7-7 7 7`}),O.createElement(`path`,{d:`M12 19V5`}))},Hf=function(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 13 13`,fill:`none`},O.createElement(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 0.5C8 0.223858 8.22386 0 8.5 0H12.5C12.7761 0 13 0.223858 13 0.5V4.5C13 4.77614 12.7761 5 12.5 5C12.2239 5 12 4.77614 12 4.5V1.70711L8.18689 5.52022C7.99162 5.71548 7.67504 5.71548 7.47978 5.52022C7.28452 5.32496 7.28452 5.00838 7.47978 4.81311L11.2929 1H8.5C8.22386 1 8 0.776142 8 0.5ZM5.52022 7.47978C5.71548 7.67504 5.71548 7.99162 5.52022 8.18689L1.70711 12H4.5C4.77614 12 5 12.2239 5 12.5C5 12.7761 4.77614 13 4.5 13H0.5C0.223858 13 0 12.7761 0 12.5V8.5C0 8.22386 0.223858 8 0.5 8C0.776142 8 1 8.22386 1 8.5V11.2929L4.81311 7.47978C5.00838 7.28452 5.32496 7.28452 5.52022 7.47978Z`,fill:`currentColor`}))},Uf=function(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},O.createElement(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}))},Wf=function(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},O.createElement(`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),O.createElement(`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`}))},Gf=function(e){var t=e.conversations,n=e.selectConversation,r=R(O.useState(function(){return t.getAll()}),2),i=r[0],a=r[1];return O.createElement(`div`,{className:`DocSearch-Sidepanel-ConversationHistoryScreen`},O.createElement(`ul`,null,i.map(function(e){return O.createElement(`li`,{key:e.objectID,className:`DocSearch-Sidepanel-RecentConversation`},O.createElement(`a`,{href:e.url,onClick:function(t){t.preventDefault(),t.stopPropagation(),n(e)}},O.createElement(`div`,{className:`DocSearch-Sidepanel-RecentConversation-container`},O.createElement(`div`,{className:`DocSearch-Sidepanel-RecentConversation-icon`},O.createElement(Mf,null)),O.createElement(`div`,{className:`DocSearch-Sidepanel-RecentConversation-content`},O.createElement(`span`,{className:`DocSearch-Sidepanel-RecentConversation-title`},e.hierarchy.lvl1)),O.createElement(`div`,{className:`DocSearch-Hit-action`},O.createElement(`button`,{className:`DocSearch-Hit-action-button`,type:`button`,title:`Remove conversation from history`,onClick:function(n){n.preventDefault(),n.stopPropagation(),function(e){t.remove(e),a(t.getAll())}(e)}},O.createElement(Nf,null))))))})))},Kf={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function qf(e){Kf=e}var Jf={exec:function(){return null}};function $(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:``,n=typeof e==`string`?e:e.source,r={replace:function(e,t){var i=typeof t==`string`?t:t.source;return i=i.replace(Xf.caret,`$1`),n=n.replace(e,i),r},getRegex:function(){return new RegExp(n,t)}};return r}var Yf=function(){try{return!0}catch{return!1}}(),Xf={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDD40-\uDD65\uDD6F-\uDD85\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDED0-\uDEE3\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0\uDFF0-\uDFF9]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDDB0-\uDDDB\uDDE0-\uDDE9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D\uDD30-\uDD39]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDD70-\uDD79\uDE40-\uDE96\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2-\uDFF6]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDDD0-\uDDED\uDDF0-\uDDFA\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:function(e){return RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|\$))`)},nextBulletRegex:function(e){return RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|\$))`)},hrRegex:function(e){return RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|\$)`)},fencesBeginRegex:function(e){return RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`)},headingBeginRegex:function(e){return RegExp(`^ {0,${Math.min(3,e-1)}}#`)},htmlBeginRegex:function(e){return RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)}},Zf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Qf=/(?:[*+-]|\d{1,9}[.)])/,$f=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ep=$($f).replace(/bull/g,Qf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),tp=$($f).replace(/bull/g,Qf).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),np=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ip=$(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,rp).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ap=$(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Qf).getRegex(),op=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,sp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cp=$(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,sp).replace(`tag`,op).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lp=$(np).replace(`hr`,Zf).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,op).getRegex(),up={blockquote:$(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,lp).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:ip,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Zf,html:cp,lheading:ep,list:ap,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:lp,table:Jf,text:/^[^\n]+/},dp=$(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Zf).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,op).getRegex(),fp=I(I({},up),{},{lheading:tp,table:dp,paragraph:$(np).replace(`hr`,Zf).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,dp).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,op).getRegex()}),pp=I(I({},up),{},{html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,sp).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Jf,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(np).replace(`hr`,Zf).replace(`heading`,` *#{1,6} *[^
]`).replace(`lheading`,ep).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()}),mp=/^( {2,}|\\)\n(?!\s*$)/,hp=/(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,gp=/(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,_p=/(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,vp=$(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,gp).getRegex(),yp=/(?!~)(?:[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/,bp=$(/link|precode-code|html/,`g`).replace(`link`,Rn(/\[(?:[^\[\]`]|(`+)[^`]+\1(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/,{a:1})).replace(`precode-`,Yf?"(?<!`)()":"(^^|[^`])").replace(`code`,Rn(/(`+)[^`]+\1(?!`)/,{b:1})).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),xp=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Sp=$(xp,`u`).replace(/punct/g,hp).getRegex(),Cp=$(xp,`u`).replace(/punct/g,yp).getRegex(),wp=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Tp=$(wp,`gu`).replace(/notPunctSpace/g,_p).replace(/punctSpace/g,gp).replace(/punct/g,hp).getRegex(),Ep=$(wp,`gu`).replace(/notPunctSpace/g,/(?:(?:[\0-\x08\x0E-\x1F0-9A-Za-z\x7F-\x9F\xAA\xAD\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376-\u037D\u037F-\u0383\u0386\u0388-\u03F5\u03F7-\u0481\u0483-\u0559\u0560-\u0588\u058B\u058C\u0590-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7-\u05F2\u05F5-\u0605\u0610-\u061A\u061C\u0620-\u0669\u066E-\u06D3\u06D5-\u06DD\u06DF-\u06E8\u06EA-\u06FC\u06FF\u070E-\u07F5\u07FA-\u07FD\u0800-\u082F\u083F-\u085D\u085F-\u0887\u0889-\u0963\u0966-\u096F\u0971-\u09F1\u09F4-\u09F9\u09FC\u09FE-\u0A75\u0A77-\u0AEF\u0AF2-\u0B6F\u0B71-\u0BF2\u0BFB-\u0C76\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0D4E\u0D50-\u0D78\u0D7A-\u0DF3\u0DF5-\u0E3E\u0E40-\u0E4E\u0E50-\u0E59\u0E5C-\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F84\u0F86-\u0FBD\u0FC6\u0FCD\u0FDB-\u1049\u1050-\u109D\u10A0-\u10FA\u10FC-\u135F\u1369-\u138F\u139A-\u13FF\u1401-\u166C\u166F-\u167F\u1681-\u169A\u169D-\u16EA\u16EE-\u1734\u1737-\u17D3\u17D7\u17DC-\u17FF\u180B-\u193F\u1941-\u1943\u1946-\u19DD\u1A00-\u1A1D\u1A20-\u1A9F\u1AA7\u1AAE-\u1B4D\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BFB\u1C00-\u1C3A\u1C40-\u1C7D\u1C80-\u1CBF\u1CC8-\u1CD2\u1CD4-\u1FBC\u1FBE\u1FC2-\u1FCC\u1FD0-\u1FDC\u1FE0-\u1FEC\u1FF0-\u1FFC\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u2079\u207F-\u2089\u208F-\u209F\u20C2-\u20FF\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u218C-\u218F\u242A-\u243F\u244B-\u249B\u24EA-\u24FF\u2776-\u2793\u2B74\u2B75\u2C00-\u2CE4\u2CEB-\u2CF8\u2CFD\u2D00-\u2D6F\u2D71-\u2DFF\u2E2F\u2E5E-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3040-\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u318F\u3192-\u3195\u31A0-\u31BF\u31E6-\u31EE\u31F0-\u31FF\u321F-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48F\uA4C7-\uA4FD\uA500-\uA60C\uA610-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA6F8-\uA6FF\uA717-\uA71F\uA722-\uA788\uA78B-\uA827\uA82C-\uA835\uA83A-\uA873\uA878-\uA8CD\uA8D0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA95E\uA960-\uA9C0\uA9CE-\uA9DD\uA9E0-\uAA5B\uAA60-\uAA76\uAA7A-\uAADD\uAAE0-\uAAEF\uAAF2-\uAB5A\uAB5C-\uAB69\uAB6C-\uABEA\uABEC-\uD7FF\uE000-\uFB28\uFB2A-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDD0-\uFDFB\uFE00-\uFE0F\uFE1A-\uFE2F\uFE53\uFE67\uFE6C-\uFEFE\uFF00\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]|\uD800[\uDC00-\uDCFF\uDD03-\uDD36\uDD40-\uDD78\uDD8A\uDD8B\uDD8F\uDD9D-\uDD9F\uDDA1-\uDDCF\uDDFD-\uDF9E\uDFA0-\uDFCF\uDFD1-\uDFFF]|\uD801[\uDC00-\uDD6E\uDD70-\uDFFF]|\uD802[\uDC00-\uDC56\uDC58-\uDC76\uDC79-\uDD1E\uDD20-\uDD3E\uDD40-\uDE4F\uDE59-\uDE7E\uDE80-\uDEC7\uDEC9-\uDEEF\uDEF7-\uDF38\uDF40-\uDF98\uDF9D-\uDFFF]|\uD803[\uDC00-\uDD6D\uDD6F-\uDD8D\uDD90-\uDEAC\uDEAE-\uDECF\uDED9-\uDF54\uDF5A-\uDF85\uDF8A-\uDFFF]|\uD804[\uDC00-\uDC46\uDC4E-\uDCBA\uDCBD\uDCC2-\uDD3F\uDD44-\uDD73\uDD76-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE0-\uDE37\uDE3E-\uDEA8\uDEAA-\uDFD3\uDFD6\uDFD9-\uDFFF]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5C\uDC5E-\uDCC5\uDCC7-\uDDC0\uDDD8-\uDE40\uDE44-\uDE5F\uDE6D-\uDEB8\uDEBA-\uDF3B\uDF40-\uDFFF]|\uD806[\uDC00-\uDC3A\uDC3C-\uDD43\uDD47-\uDDE1\uDDE3-\uDE3E\uDE47-\uDE99\uDE9D\uDEA3-\uDEFF\uDF0A-\uDFE0\uDFE2-\uDFFF]|\uD807[\uDC00-\uDC40\uDC46-\uDC6F\uDC72-\uDEF6\uDEF9-\uDF42\uDF50-\uDFD4\uDFF2-\uDFFE]|[\uD808\uD80A\uD80C-\uD819\uD81C-\uD82E\uD830-\uD832\uD837\uD83F-\uDBFF][\uDC00-\uDFFF]|\uD809[\uDC00-\uDC6F\uDC75-\uDFFF]|\uD80B[\uDC00-\uDFF0\uDFF3-\uDFFF]|\uD81A[\uDC00-\uDE6D\uDE70-\uDEF4\uDEF6-\uDF36\uDF40-\uDF43\uDF46-\uDFFF]|\uD81B[\uDC00-\uDD6C\uDD70-\uDE96\uDE9B-\uDFE1\uDFE3-\uDFFF]|\uD82F[\uDC00-\uDC9B\uDC9D\uDC9E\uDCA0-\uDFFF]|\uD833[\uDCF0-\uDCF9\uDCFD-\uDCFF\uDEB4-\uDEB9\uDED1-\uDEDF\uDEF1-\uDF4F\uDFC4-\uDFFF]|\uD834[\uDCF6-\uDCFF\uDD27\uDD28\uDD65-\uDD69\uDD6D-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDDEB-\uDDFF\uDE42-\uDE44\uDE46-\uDEFF\uDF57-\uDFFF]|\uD835[\uDC00-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE8C-\uDFFF]|\uD838[\uDC00-\uDD4E\uDD50-\uDEFE\uDF00-\uDFFF]|\uD839[\uDC00-\uDDFE\uDE00-\uDFFF]|\uD83A[\uDC00-\uDD5D\uDD60-\uDFFF]|\uD83B[\uDC00-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDD2D\uDD2F-\uDEEF\uDEF2-\uDFFF]|\uD83C[\uDC2C-\uDC2F\uDC94-\uDC9F\uDCAF\uDCB0\uDCC0\uDCD0\uDCF6-\uDD0C\uDDAE-\uDDE5\uDE03-\uDE0F\uDE3C-\uDE3F\uDE49-\uDE4F\uDE52-\uDE5F\uDE66-\uDEFF]|\uD83D[\uDED9-\uDEDB\uDEED-\uDEEF\uDEFD-\uDEFF\uDFDA-\uDFDF\uDFEC-\uDFEF\uDFF1-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE\uDCAF\uDCBC-\uDCBF\uDCC2-\uDCCF\uDCD9-\uDCFF\uDE58-\uDE5F\uDE6E\uDE6F\uDE7D-\uDE7F\uDE8B-\uDE8D\uDEC7\uDEC9-\uDECC\uDEDD\uDEDE\uDEEB-\uDEEE\uDEF9-\uDEFF\uDF93\uDFF0-\uDFF9\uDFFB-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])|~)/).replace(/punctSpace/g,/(?!~)(?:[\t-\r -\/:-@\[-`\{-~\xA0-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u200A\u2010-\u2029\u202F-\u205F\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD00-\uDD02\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDC77\uDC78\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEC8\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDD8E\uDD8F\uDEAD\uDED0-\uDED8\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3F]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFD5-\uDFF1\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3F\uDF44\uDF45]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F[\uDC9C\uDC9F]|\uD833[\uDC00-\uDCEF\uDCFA-\uDCFC\uDD00-\uDEB3\uDEBA-\uDED0\uDEE0-\uDEF0\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE8B]|\uD838[\uDD4F\uDEFF]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED8\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA])/).replace(/punct/g,yp).getRegex(),Dp=$(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,_p).replace(/punctSpace/g,gp).replace(/punct/g,hp).getRegex(),Op=$(/\\(punct)/,`gu`).replace(/punct/g,hp).getRegex(),kp=$(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ap=$(sp).replace(`(?:-->|$)`,`-->`).getRegex(),jp=$(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Ap).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Mp=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Np=$(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,Mp).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Pp=$(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Mp).replace(`ref`,rp).getRegex(),Fp=$(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,rp).getRegex(),Ip=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Lp={_backpedal:Jf,anyPunctuation:Op,autolink:kp,blockSkip:bp,br:mp,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:Jf,emStrongLDelim:Sp,emStrongRDelimAst:Tp,emStrongRDelimUnd:Dp,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Np,nolink:Fp,punctuation:vp,reflink:Pp,reflinkSearch:$(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Pp).replace(`nolink`,Fp).getRegex(),tag:jp,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:Jf},Rp=I(I({},Lp),{},{link:$(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Mp).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Mp).getRegex()}),zp=I(I({},Lp),{},{emStrongRDelimAst:Ep,emStrongLDelim:Cp,url:$(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Ip).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:$(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Ip).getRegex()}),Bp=I(I({},zp),{},{br:$(mp).replace(`{2,}`,`*`).getRegex(),text:$(zp.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()}),Vp={normal:up,gfm:fp,pedantic:pp},Hp={normal:Lp,gfm:zp,breaks:Bp,pedantic:Rp},Up={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Wp=function(e){return Up[e]};function Gp(e,t){if(t){if(Xf.escapeTest.test(e))return e.replace(Xf.escapeReplace,Wp)}else if(Xf.escapeTestNoEncode.test(e))return e.replace(Xf.escapeReplaceNoEncode,Wp);return e}function Kp(e){try{e=encodeURI(e).replace(Xf.percentDecode,`%`)}catch{return null}return e}function qp(e,t){var n,r=e.replace(Xf.findPipe,function(e,t,n){for(var r=!1,i=t;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Xf.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((n=r.at(-1))!=null&&n.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push(``);for(;i<r.length;i++)r[i]=r[i].trim().replace(Xf.slashPipe,`|`);return r}function Jp(e,t,n){var r=e.length;if(r===0)return``;for(var i=0;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function Yp(e,t,n,r,i){var a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;var c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}var Xp=M(function e(t){j(this,e),P(this,`options`,void 0),P(this,`rules`,void 0),P(this,`lexer`,void 0),this.options=t||Kf},[{key:`space`,value:function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}},{key:`code`,value:function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?n:Jp(n,`
`)}}}},{key:`fences`,value:function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t,n){var r=e.match(n.other.indentCodeCompensation);if(r===null)return t;var i=r[1];return t.split(`
`).map(function(e){var t=e.match(n.other.beginningSpace);return t===null?e:R(t,1)[0].length>=i.length?e.slice(i.length):e}).join(`
`)}(n,t[3]||``,this.rules);return{type:`code`,raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:r}}}},{key:`heading`,value:function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(this.rules.other.endingHash.test(n)){var r=Jp(n,`#`);(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}},{key:`hr`,value:function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Jp(t[0],`
`)}}},{key:`blockquote`,value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){for(var n=Jp(t[0],`
`).split(`
`),r=``,i=``,a=[];n.length>0;){var o=!1,s=[],c=void 0;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))s.push(n[c]),o=!0;else{if(o)break;s.push(n[c])}n=n.slice(c);var l=s.join(`
`),u=l.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);r=r?`${r}
${l}`:l,i=i?`${i}
${u}`:u;var d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,a,!0),this.lexer.state.top=d,n.length===0)break;var f=a.at(-1);if(f?.type===`code`)break;if(f?.type===`blockquote`){var p=f,m=p.raw+`
`+n.join(`
`),h=this.blockquote(m);a[a.length-1]=h,r=r.substring(0,r.length-p.raw.length)+h.raw,i=i.substring(0,i.length-p.text.length)+h.text;break}if(f?.type===`list`){var g=f,_=g.raw+`
`+n.join(`
`),v=this.list(_);a[a.length-1]=v,r=r.substring(0,r.length-f.raw.length)+v.raw,i=i.substring(0,i.length-g.raw.length)+v.raw,n=_.substring(a.at(-1).raw.length).split(`
`)}}return{type:`blockquote`,raw:r,tokens:a,text:i}}}},{key:`list`,value:function(e){var t=this,n=this.rules.block.list.exec(e);if(n){var r=n[1].trim(),i=r.length>1,a={type:`list`,raw:``,ordered:i,start:i?+r.slice(0,-1):``,loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:`[*+-]`);for(var o=this.rules.other.listItemRegex(r),s=!1;e;){var c=!1,l=``,u=``;if(!(n=o.exec(e))||this.rules.block.hr.test(e))break;l=n[0],e=e.substring(l.length);var d=n[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,function(e){return` `.repeat(3*e.length)}),f=e.split(`
`,1)[0],p=!d.trim(),m=0;if(this.options.pedantic?(m=2,u=d.trimStart()):p?m=n[1].length+1:(m=(m=n[2].search(this.rules.other.nonSpaceChar))>4?1:m,u=d.slice(m),m+=n[1].length),p&&this.rules.other.blankLine.test(f)&&(l+=f+`
`,e=e.substring(f.length+1),c=!0),!c)for(var h=this.rules.other.nextBulletRegex(m),g=this.rules.other.hrRegex(m),_=this.rules.other.fencesBeginRegex(m),v=this.rules.other.headingBeginRegex(m),y=this.rules.other.htmlBeginRegex(m);e;){var b=e.split(`
`,1)[0],x=void 0;if(f=b,x=this.options.pedantic?f=f.replace(this.rules.other.listReplaceNesting,` `):f.replace(this.rules.other.tabCharGlobal,` `),_.test(f)||v.test(f)||y.test(f)||h.test(f)||g.test(f))break;if(x.search(this.rules.other.nonSpaceChar)>=m||!f.trim())u+=`
`+x.slice(m);else{if(p||d.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||_.test(d)||v.test(d)||g.test(d))break;u+=`
`+f}!p&&!f.trim()&&(p=!0),l+=b+`
`,e=e.substring(b.length+1),d=x.slice(m)}a.loose||(s?a.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(s=!0));var S=null,C=void 0;this.options.gfm&&(S=this.rules.other.listIsTask.exec(u))&&(C=S[0]!==`[ ] `,u=u.replace(this.rules.other.listReplaceTask,``)),a.items.push({type:`list_item`,raw:l,task:!!S,checked:C,loose:!1,text:u,tokens:[]}),a.raw+=l}var w=a.items.at(-1);if(!w)return;w.raw=w.raw.trimEnd(),w.text=w.text.trimEnd(),a.raw=a.raw.trimEnd();for(var T=0;T<a.items.length;T++)if(this.lexer.state.top=!1,a.items[T].tokens=this.lexer.blockTokens(a.items[T].text,[]),!a.loose){var ee=a.items[T].tokens.filter(function(e){return e.type===`space`});a.loose=ee.length>0&&ee.some(function(e){return t.rules.other.anyLine.test(e.raw)})}if(a.loose)for(var E=0;E<a.items.length;E++)a.items[E].loose=!0;return a}}},{key:`html`,value:function(e){var t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}},{key:`def`,value:function(e){var t=this.rules.block.def.exec(e);if(t){var n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:n,raw:t[0],href:r,title:i}}}},{key:`table`,value:function(e){var t,n=this,r=this.rules.block.table.exec(e);if(r&&this.rules.other.tableDelimiter.test(r[2])){var i=qp(r[1]),a=r[2].replace(this.rules.other.tableAlignChars,``).split(`|`),o=(t=r[3])!=null&&t.trim()?r[3].replace(this.rules.other.tableRowBlankLine,``).split(`
`):[],s={type:`table`,raw:r[0],header:[],align:[],rows:[]};if(i.length===a.length){var c,l=N(a);try{for(l.s();!(c=l.n()).done;){var u=c.value;this.rules.other.tableAlignRight.test(u)?s.align.push(`right`):this.rules.other.tableAlignCenter.test(u)?s.align.push(`center`):this.rules.other.tableAlignLeft.test(u)?s.align.push(`left`):s.align.push(null)}}catch(e){l.e(e)}finally{l.f()}for(var d=0;d<i.length;d++)s.header.push({text:i[d],tokens:this.lexer.inline(i[d]),header:!0,align:s.align[d]});var f,p=N(o);try{for(p.s();!(f=p.n()).done;){var m=f.value;s.rows.push(qp(m,s.header.length).map(function(e,t){return{text:e,tokens:n.lexer.inline(e),header:!1,align:s.align[t]}}))}}catch(e){p.e(e)}finally{p.f()}return s}}}},{key:`lheading`,value:function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}},{key:`paragraph`,value:function(e){var t=this.rules.block.paragraph.exec(e);if(t){var n=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:n,tokens:this.lexer.inline(n)}}}},{key:`text`,value:function(e){var t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}},{key:`escape`,value:function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}},{key:`tag`,value:function(e){var t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}},{key:`link`,value:function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;var r=Jp(n.slice(0,-1),`\\`);if((n.length-r.length)%2==0)return}else{var i=function(e,t){if(e.indexOf(t[1])===-1)return-1;for(var n=0,r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return n>0?-2:-1}(t[2],`()`);if(i===-2)return;if(i>-1){var a=(t[0].indexOf(`!`)===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=``}}var o=t[2],s=``;if(this.options.pedantic){var c=this.rules.other.pedanticHrefTitle.exec(o);c&&(o=c[1],s=c[3])}else s=t[3]?t[3].slice(1,-1):``;return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(o=this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?o.slice(1):o.slice(1,-1)),Yp(t,{href:o&&o.replace(this.rules.inline.anyPunctuation,`$1`),title:s&&s.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}},{key:`reflink`,value:function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!r){var i=n[0].charAt(0);return{type:`text`,raw:i,text:i}}return Yp(n,r,n[0],this.lexer,this.rules)}}},{key:`emStrong`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:``,r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!r[1]&&!r[2]||!n||this.rules.inline.punctuation.exec(n))){var i,a,o=z(r[0]).length-1,s=o,c=0,l=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+o);(r=l.exec(t))!=null;)if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(a=z(i).length,r[3]||r[4])s+=a;else if(!((r[5]||r[6])&&o%3)||(o+a)%3){if(!((s-=a)>0)){a=Math.min(a,a+s+c);var u=z(r[0])[0].length,d=e.slice(0,o+r.index+u+a);if(Math.min(o,a)%2){var f=d.slice(1,-1);return{type:`em`,raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}var p=d.slice(2,-2);return{type:`strong`,raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}else c+=a}}},{key:`codespan`,value:function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(this.rules.other.newLineCharGlobal,` `),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:`codespan`,raw:t[0],text:n}}}},{key:`br`,value:function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}},{key:`del`,value:function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}},{key:`autolink`,value:function(e){var t,n,r=this.rules.inline.autolink.exec(e);if(r)return n=r[2]===`@`?`mailto:`+(t=r[1]):t=r[1],{type:`link`,raw:r[0],text:t,href:n,tokens:[{type:`text`,raw:t,text:t}]}}},{key:`url`,value:function(e){var t;if(t=this.rules.inline.url.exec(e)){var n,r;if(t[2]===`@`)r=`mailto:`+(n=t[0]);else{var i;do i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(i!==t[0]);n=t[0],r=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:n,href:r,tokens:[{type:`text`,raw:n,text:n}]}}}},{key:`inlineText`,value:function(e){var t=this.rules.inline.text.exec(e);if(t){var n=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:n}}}}]),Zp=function(){function e(t){j(this,e),P(this,`tokens`,void 0),P(this,`options`,void 0),P(this,`state`,void 0),P(this,`tokenizer`,void 0),P(this,`inlineQueue`,void 0),this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Kf,this.options.tokenizer=this.options.tokenizer||new Xp,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={other:Xf,block:Vp.normal,inline:Hp.normal};this.options.pedantic?(n.block=Vp.pedantic,n.inline=Hp.pedantic):this.options.gfm&&(n.block=Vp.gfm,this.options.breaks?n.inline=Hp.breaks:n.inline=Hp.gfm),this.tokenizer.rules=n}return M(e,[{key:`lex`,value:function(e){e=e.replace(Xf.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(var t=0;t<this.inlineQueue.length;t++){var n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}},{key:`blockTokens`,value:function(e){var t,n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=function(){var t,a,o;if((t=n.options.extensions)!=null&&(t=t.block)!=null&&t.some(function(t){return!!(o=t.call({lexer:n},e,r))&&(e=e.substring(o.raw.length),r.push(o),!0)}))return 0;if(o=n.tokenizer.space(e)){e=e.substring(o.raw.length);var s=r.at(-1);return o.raw.length===1&&s!==void 0?s.raw+=`
`:r.push(o),0}if(o=n.tokenizer.code(e)){e=e.substring(o.raw.length);var c=r.at(-1);return c?.type===`paragraph`||c?.type===`text`?(c.raw+=(c.raw.endsWith(`
`)?``:`
`)+o.raw,c.text+=`
`+o.text,n.inlineQueue.at(-1).src=c.text):r.push(o),0}if((o=n.tokenizer.fences(e))||(o=n.tokenizer.heading(e))||(o=n.tokenizer.hr(e))||(o=n.tokenizer.blockquote(e))||(o=n.tokenizer.list(e))||(o=n.tokenizer.html(e)))return e=e.substring(o.raw.length),r.push(o),0;if(o=n.tokenizer.def(e)){e=e.substring(o.raw.length);var l=r.at(-1);return l?.type===`paragraph`||l?.type===`text`?(l.raw+=(l.raw.endsWith(`
`)?``:`
`)+o.raw,l.text+=`
`+o.raw,n.inlineQueue.at(-1).src=l.text):n.tokens.links[o.tag]||(n.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o)),0}if((o=n.tokenizer.table(e))||(o=n.tokenizer.lheading(e)))return e=e.substring(o.raw.length),r.push(o),0;var u=e;if((a=n.options.extensions)!=null&&a.startBlock){var d,f=1/0,p=e.slice(1);n.options.extensions.startBlock.forEach(function(e){typeof(d=e.call({lexer:n},p))==`number`&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(u=e.substring(0,f+1))}if(n.state.top&&(o=n.tokenizer.paragraph(u))){var m=r.at(-1);return i&&m?.type===`paragraph`?(m.raw+=(m.raw.endsWith(`
`)?``:`
`)+o.raw,m.text+=`
`+o.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=m.text):r.push(o),i=u.length!==e.length,e=e.substring(o.raw.length),0}if(o=n.tokenizer.text(e)){e=e.substring(o.raw.length);var h=r.at(-1);return h?.type===`text`?(h.raw+=(h.raw.endsWith(`
`)?``:`
`)+o.raw,h.text+=`
`+o.text,n.inlineQueue.pop(),n.inlineQueue.at(-1).src=h.text):r.push(o),0}if(e){var g=`Infinite loop on byte: `+e.charCodeAt(0);if(n.options.silent)return console.error(g),1;throw Error(g)}};for(this.options.pedantic&&(e=e.replace(Xf.tabCharGlobal,` `).replace(Xf.spaceLine,``));e&&((t=a())===0||t!==1););return this.state.top=!0,r}},{key:`inline`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return this.inlineQueue.push({src:e,tokens:t}),t}},{key:`inlineTokens`,value:function(e){var t,n,r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=e,o=null;if(this.tokens.links){var s=Object.keys(this.tokens.links);if(s.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)s.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)n=o[2]?o[2].length:0,a=a.slice(0,o.index+n)+`[`+`a`.repeat(o[0].length-n-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=((t=this.options.hooks)==null||(t=t.emStrongMask)==null?void 0:t.call({lexer:this},a))??a;for(var c,l=!1,u=``,d=function(){var t,n,o;if(l||(u=``),l=!1,(t=r.options.extensions)!=null&&(t=t.inline)!=null&&t.some(function(t){return!!(o=t.call({lexer:r},e,i))&&(e=e.substring(o.raw.length),i.push(o),!0)}))return 0;if((o=r.tokenizer.escape(e))||(o=r.tokenizer.tag(e))||(o=r.tokenizer.link(e)))return e=e.substring(o.raw.length),i.push(o),0;if(o=r.tokenizer.reflink(e,r.tokens.links)){e=e.substring(o.raw.length);var s=i.at(-1);return o.type===`text`&&s?.type===`text`?(s.raw+=o.raw,s.text+=o.text):i.push(o),0}if((o=r.tokenizer.emStrong(e,a,u))||(o=r.tokenizer.codespan(e))||(o=r.tokenizer.br(e))||(o=r.tokenizer.del(e))||(o=r.tokenizer.autolink(e))||!r.state.inLink&&(o=r.tokenizer.url(e)))return e=e.substring(o.raw.length),i.push(o),0;var c=e;if((n=r.options.extensions)!=null&&n.startInline){var d,f=1/0,p=e.slice(1);r.options.extensions.startInline.forEach(function(e){typeof(d=e.call({lexer:r},p))==`number`&&d>=0&&(f=Math.min(f,d))}),f<1/0&&f>=0&&(c=e.substring(0,f+1))}if(o=r.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(u=o.raw.slice(-1)),l=!0;var m=i.at(-1);return m?.type===`text`?(m.raw+=o.raw,m.text+=o.text):i.push(o),0}if(e){var h=`Infinite loop on byte: `+e.charCodeAt(0);if(r.options.silent)return console.error(h),1;throw Error(h)}};e&&((c=d())===0||c!==1););return i}}],[{key:`rules`,get:function(){return{block:Vp,inline:Hp}}},{key:`lex`,value:function(t,n){return new e(n).lex(t)}},{key:`lexInline`,value:function(t,n){return new e(n).inlineTokens(t)}}])}(),Qp=M(function e(t){j(this,e),P(this,`options`,void 0),P(this,`parser`,void 0),this.options=t||Kf},[{key:`space`,value:function(e){return``}},{key:`code`,value:function(e){var t=e.text,n=e.lang,r=e.escaped,i=(n||``).match(Xf.notSpaceStart)?.[0],a=t.replace(Xf.endingNewline,``)+`
`;return i?`<pre><code class="language-`+Gp(i)+`">`+(r?a:Gp(a,!0))+`</code></pre>
`:`<pre><code>`+(r?a:Gp(a,!0))+`</code></pre>
`}},{key:`blockquote`,value:function(e){var t=e.tokens;return`<blockquote>
${this.parser.parse(t)}</blockquote>
`}},{key:`html`,value:function(e){return e.text}},{key:`def`,value:function(e){return``}},{key:`heading`,value:function(e){var t=e.tokens,n=e.depth;return`<h${n}>${this.parser.parseInline(t)}</h${n}>
`}},{key:`hr`,value:function(e){return`<hr>
`}},{key:`list`,value:function(e){for(var t=e.ordered,n=e.start,r=``,i=0;i<e.items.length;i++){var a=e.items[i];r+=this.listitem(a)}var o=t?`ol`:`ul`;return`<`+o+(t&&n!==1?` start="`+n+`"`:``)+`>
`+r+`</`+o+`>
`}},{key:`listitem`,value:function(e){var t=``;if(e.task){var n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+Gp(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
`}},{key:`checkbox`,value:function(e){return`<input `+(e.checked?`checked="" `:``)+`disabled="" type="checkbox">`}},{key:`paragraph`,value:function(e){var t=e.tokens;return`<p>${this.parser.parseInline(t)}</p>
`}},{key:`table`,value:function(e){for(var t=``,n=``,r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});for(var i=``,a=0;a<e.rows.length;a++){var o=e.rows[a];n=``;for(var s=0;s<o.length;s++)n+=this.tablecell(o[s]);i+=this.tablerow({text:n})}return i&&=`<tbody>${i}</tbody>`,`<table>
<thead>
`+t+`</thead>
`+i+`</table>
`}},{key:`tablerow`,value:function(e){return`<tr>
${e.text}</tr>
`}},{key:`tablecell`,value:function(e){var t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}},{key:`strong`,value:function(e){var t=e.tokens;return`<strong>${this.parser.parseInline(t)}</strong>`}},{key:`em`,value:function(e){var t=e.tokens;return`<em>${this.parser.parseInline(t)}</em>`}},{key:`codespan`,value:function(e){var t=e.text;return`<code>${Gp(t,!0)}</code>`}},{key:`br`,value:function(e){return`<br>`}},{key:`del`,value:function(e){var t=e.tokens;return`<del>${this.parser.parseInline(t)}</del>`}},{key:`link`,value:function(e){var t=e.href,n=e.title,r=e.tokens,i=this.parser.parseInline(r),a=Kp(t);if(a===null)return i;var o=`<a href="`+(t=a)+`"`;return n&&(o+=` title="`+Gp(n)+`"`),o+`>`+i+`</a>`}},{key:`image`,value:function(e){var t=e.href,n=e.title,r=e.text,i=e.tokens;i&&(r=this.parser.parseInline(i,this.parser.textRenderer));var a=Kp(t);if(a===null)return Gp(r);var o=`<img src="${t=a}" alt="${r}"`;return n&&(o+=` title="${Gp(n)}"`),o+`>`}},{key:`text`,value:function(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Gp(e.text)}}]),$p=M(function e(){j(this,e)},[{key:`strong`,value:function(e){return e.text}},{key:`em`,value:function(e){return e.text}},{key:`codespan`,value:function(e){return e.text}},{key:`del`,value:function(e){return e.text}},{key:`html`,value:function(e){return e.text}},{key:`text`,value:function(e){return e.text}},{key:`link`,value:function(e){return``+e.text}},{key:`image`,value:function(e){return``+e.text}},{key:`br`,value:function(){return``}}]),em=function(){function e(t){j(this,e),P(this,`options`,void 0),P(this,`renderer`,void 0),P(this,`textRenderer`,void 0),this.options=t||Kf,this.options.renderer=this.options.renderer||new Qp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $p}return M(e,[{key:`parse`,value:function(e){for(var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=``,r=0;r<e.length;r++){var i,a=e[r];if((i=this.options.extensions)!=null&&(i=i.renderers)!=null&&i[a.type]){var o=a,s=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==s||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(o.type)){n+=s||``;continue}}var c=a;switch(c.type){case`space`:n+=this.renderer.space(c);continue;case`hr`:n+=this.renderer.hr(c);continue;case`heading`:n+=this.renderer.heading(c);continue;case`code`:n+=this.renderer.code(c);continue;case`table`:n+=this.renderer.table(c);continue;case`blockquote`:n+=this.renderer.blockquote(c);continue;case`list`:n+=this.renderer.list(c);continue;case`html`:n+=this.renderer.html(c);continue;case`def`:n+=this.renderer.def(c);continue;case`paragraph`:n+=this.renderer.paragraph(c);continue;case`text`:for(var l=c,u=this.renderer.text(l);r+1<e.length&&e[r+1].type===`text`;)l=e[++r],u+=`
`+this.renderer.text(l);n+=t?this.renderer.paragraph({type:`paragraph`,raw:u,text:u,tokens:[{type:`text`,raw:u,text:u,escaped:!0}]}):u;continue;default:var d=`Token with "`+c.type+`" type was not found.`;if(this.options.silent)return console.error(d),``;throw Error(d)}}return n}},{key:`parseInline`,value:function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.renderer,n=``,r=0;r<e.length;r++){var i,a=e[r];if((i=this.options.extensions)!=null&&(i=i.renderers)!=null&&i[a.type]){var o=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==o||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(a.type)){n+=o||``;continue}}var s=a;switch(s.type){case`escape`:case`text`:n+=t.text(s);break;case`html`:n+=t.html(s);break;case`link`:n+=t.link(s);break;case`image`:n+=t.image(s);break;case`strong`:n+=t.strong(s);break;case`em`:n+=t.em(s);break;case`codespan`:n+=t.codespan(s);break;case`br`:n+=t.br(s);break;case`del`:n+=t.del(s);break;default:var c=`Token with "`+s.type+`" type was not found.`;if(this.options.silent)return console.error(c),``;throw Error(c)}}return n}}],[{key:`parse`,value:function(t,n){return new e(n).parse(t)}},{key:`parseInline`,value:function(t,n){return new e(n).parseInline(t)}}])}(),tm=(Bf=M(function e(t){j(this,e),P(this,`options`,void 0),P(this,`block`,void 0),this.options=t||Kf},[{key:`preprocess`,value:function(e){return e}},{key:`postprocess`,value:function(e){return e}},{key:`processAllTokens`,value:function(e){return e}},{key:`emStrongMask`,value:function(e){return e}},{key:`provideLexer`,value:function(){return this.block?Zp.lex:Zp.lexInline}},{key:`provideParser`,value:function(){return this.block?em.parse:em.parseInline}}]),P(Bf,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),P(Bf,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),Bf),nm=new(M(function e(){j(this,e),P(this,`defaults`,{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),P(this,`options`,this.setOptions),P(this,`parse`,this.parseMarkdown(!0)),P(this,`parseInline`,this.parseMarkdown(!1)),P(this,`Parser`,em),P(this,`Renderer`,Qp),P(this,`TextRenderer`,$p),P(this,`Lexer`,Zp),P(this,`Tokenizer`,Xp),P(this,`Hooks`,tm),this.use.apply(this,arguments)},[{key:`walkTokens`,value:function(e,t){var n,r=this,i=[],a=N(e);try{var o=function(){var e=n.value;switch(i=i.concat(t.call(r,e)),e.type){case`table`:var a,o=e,s=N(o.header);try{for(s.s();!(a=s.n()).done;){var c=a.value;i=i.concat(r.walkTokens(c.tokens,t))}}catch(e){s.e(e)}finally{s.f()}var l,u=N(o.rows);try{for(u.s();!(l=u.n()).done;){var d,f=N(l.value);try{for(f.s();!(d=f.n()).done;){var p=d.value;i=i.concat(r.walkTokens(p.tokens,t))}}catch(e){f.e(e)}finally{f.f()}}}catch(e){u.e(e)}finally{u.f()}break;case`list`:var m=e;i=i.concat(r.walkTokens(m.items,t));break;default:var h,g=e;(h=r.defaults.extensions)!=null&&(h=h.childTokens)!=null&&h[g.type]?r.defaults.extensions.childTokens[g.type].forEach(function(e){var n=g[e].flat(1/0);i=i.concat(r.walkTokens(n,t))}):g.tokens&&(i=i.concat(r.walkTokens(g.tokens,t)))}};for(a.s();!(n=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}return i}},{key:`use`,value:function(){for(var e=this,t=this.defaults.extensions||{renderers:{},childTokens:{}},n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];return r.forEach(function(n){var r=I({},n);if(r.async=e.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(function(e){if(!e.name)throw Error(`extension name required`);if(`renderer`in e){var n=t.renderers[e.name];t.renderers[e.name]=n?function(){var t=[...arguments],r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);var r=t[e.level];r?r.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),r.extensions=t),n.renderer){var i=e.defaults.renderer||new Qp(e.defaults),a=function(){if(!(o in i))throw Error(`renderer '${o}' does not exist`);if([`options`,`parser`].includes(o))return 1;var e=o,t=n.renderer[e],r=i[e];i[e]=function(){var e=[...arguments],n=t.apply(i,e);return!1===n&&(n=r.apply(i,e)),n||``}};for(var o in n.renderer)a();r.renderer=i}if(n.tokenizer){var s=e.defaults.tokenizer||new Xp(e.defaults),c=function(){if(!(l in s))throw Error(`tokenizer '${l}' does not exist`);if([`options`,`rules`,`lexer`].includes(l))return 1;var e=l,t=n.tokenizer[e],r=s[e];s[e]=function(){var e=[...arguments],n=t.apply(s,e);return!1===n&&(n=r.apply(s,e)),n}};for(var l in n.tokenizer)c();r.tokenizer=s}if(n.hooks){var u=e.defaults.hooks||new tm,d=function(t){if(!(t in u))throw Error(`hook '${t}' does not exist`);if([`options`,`block`].includes(t))return 1;var r=t,i=n.hooks[r],a=u[r];tm.passThroughHooks.has(t)?u[r]=function(n){if(e.defaults.async&&tm.passThroughHooksRespectAsync.has(t))return k(L().m(function e(){var t;return L().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,i.call(u,n);case 1:return t=e.v,e.a(2,a.call(u,t))}},e)}))();var r=i.call(u,n);return a.call(u,r)}:u[r]=function(){var t=[...arguments];if(e.defaults.async)return k(L().m(function e(){var n;return L().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,i.apply(u,t);case 1:if(!1!==(n=e.v)){e.n=3;break}return e.n=2,a.apply(u,t);case 2:n=e.v;case 3:return e.a(2,n)}},e)}))();var n=i.apply(u,t);return!1===n&&(n=a.apply(u,t)),n}};for(var f in n.hooks)d(f);r.hooks=u}if(n.walkTokens){var p=e.defaults.walkTokens,m=n.walkTokens;r.walkTokens=function(e){var t=[];return t.push(m.call(this,e)),p&&(t=t.concat(p.call(this,e))),t}}e.defaults=I(I({},e.defaults),r)}),this}},{key:`setOptions`,value:function(e){return this.defaults=I(I({},this.defaults),e),this}},{key:`lexer`,value:function(e,t){return Zp.lex(e,t??this.defaults)}},{key:`parser`,value:function(e,t){return em.parse(e,t??this.defaults)}},{key:`parseMarkdown`,value:function(e){var t=this;return function(n,r){var i=I({},r),a=I(I({},t.defaults),i),o=t.onError(!!a.silent,!!a.async);if(!0===t.defaults.async&&!1===i.async)return o(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(Fn(n)>`u`||n===null)return o(Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(a.hooks&&(a.hooks.options=a,a.hooks.block=e),a.async)return k(L().m(function r(){var i,o,s,c,l,u,d,f,p,m,h;return L().w(function(r){for(;;)switch(r.n){case 0:if(!a.hooks){r.n=2;break}return r.n=1,a.hooks.preprocess(n);case 1:l=r.v,r.n=3;break;case 2:l=n;case 3:if(i=l,!a.hooks){r.n=5;break}return r.n=4,a.hooks.provideLexer();case 4:u=r.v,r.n=6;break;case 5:u=e?Zp.lex:Zp.lexInline;case 6:return d=u,r.n=7,d(i,a);case 7:if(o=r.v,!a.hooks){r.n=9;break}return r.n=8,a.hooks.processAllTokens(o);case 8:f=r.v,r.n=10;break;case 9:f=o;case 10:if(s=f,!a.walkTokens){r.n=11;break}return r.n=11,Promise.all(t.walkTokens(s,a.walkTokens));case 11:if(!a.hooks){r.n=13;break}return r.n=12,a.hooks.provideParser();case 12:p=r.v,r.n=14;break;case 13:p=e?em.parse:em.parseInline;case 14:return m=p,r.n=15,m(s,a);case 15:if(c=r.v,!a.hooks){r.n=17;break}return r.n=16,a.hooks.postprocess(c);case 16:h=r.v,r.n=18;break;case 17:h=c;case 18:return r.a(2,h)}},r)}))().catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));var s=(a.hooks?a.hooks.provideLexer():e?Zp.lex:Zp.lexInline)(n,a);a.hooks&&(s=a.hooks.processAllTokens(s)),a.walkTokens&&t.walkTokens(s,a.walkTokens);var c=(a.hooks?a.hooks.provideParser():e?em.parse:em.parseInline)(s,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(e){return o(e)}}}},{key:`onError`,value:function(e,t){return function(n){if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){var r=`<p>An error occurred:</p><pre>`+Gp(n.message+``,!0)+`</pre>`;return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}]));function rm(e,t){return nm.parse(e,t)}function im(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}rm.options=rm.setOptions=function(e){return nm.setOptions(e),rm.defaults=nm.defaults,qf(rm.defaults),rm},rm.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},rm.defaults=Kf,rm.use=function(){return nm.use.apply(nm,arguments),rm.defaults=nm.defaults,qf(rm.defaults),rm},rm.walkTokens=function(e,t){return nm.walkTokens(e,t)},rm.parseInline=nm.parseInline,rm.Parser=em,rm.parser=em.parse,rm.Renderer=Qp,rm.TextRenderer=$p,rm.Lexer=Zp,rm.lexer=Zp.lex,rm.Tokenizer=Xp,rm.Hooks=tm,rm.parse=rm,rm.options,rm.setOptions,rm.use,rm.walkTokens,rm.parseInline,em.parse,Zp.lex;var am=new rm.Renderer;am.code=function(e){var t=e.text,n=e.lang,r=n===void 0?``:n,i=e.escaped,a=r?`language-${r}`:``,o=i?t:im(t);return`
<div class="DocSearch-CodeSnippet">
<button class="DocSearch-CodeSnippet-CopyButton" data-code="${encodeURIComponent(t)}" aria-label="copy code"><svg class="DocSearch-CodeSnippet-CopyIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" /></svg><svg class="DocSearch-CodeSnippet-CheckIcon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5" /></svg><span class="DocSearch-CodeSnippet-CopyButton-Label"></span></button>
<pre><code class="${a}">${o}</code></pre>
</div>
`},am.link=function(e){var t=e.href,n=e.title,r=e.text,i=n?` title="${im(n)}"`:``;return`<a href="${t?im(t):``}"${i} target="_blank" rel="noopener noreferrer">${im(r)}</a>`};var om=Ot(function(e){var t=e.content,n=e.copyButtonText,r=e.copyButtonCopiedText,i=e.isStreaming,a=ot(function(){return rm.parse(t,{gfm:!0,breaks:!0,renderer:am})},[t]),o=it(null);return nt(function(){var e=o.current;if(e)return Array.from(e.querySelectorAll(`.DocSearch-CodeSnippet-CopyButton`)).forEach(function(e){var t=e.querySelector(`.DocSearch-CodeSnippet-CopyButton-Label`);t&&(t.textContent=n),e.classList.remove(`DocSearch-CodeSnippet-CopyButton--copied`)}),e.addEventListener(`click`,t),function(){e.removeEventListener(`click`,t)};function t(e){var t=e.target.closest(`.DocSearch-CodeSnippet-CopyButton`);if(t){var i=t.getAttribute(`data-code`)??``;navigator.clipboard.writeText(decodeURIComponent(i)).catch(function(){});var a=t.querySelector(`.DocSearch-CodeSnippet-CopyButton-Label`);if(a){t.classList.add(`DocSearch-CodeSnippet-CopyButton--copied`);var o=n;a.textContent=r,setTimeout(function(){t.classList.remove(`DocSearch-CodeSnippet-CopyButton--copied`),a.textContent=o},1500)}}}},[a,n,r]),O.createElement(`div`,{ref:o,className:`DocSearch-Markdown-Content ${i?`DocSearch-Markdown-Content--streaming`:``}`,dangerouslySetInnerHTML:{__html:a}})});function sm(e){var t=e.part,n=e.translations,r=e.onSearchQueryClick,i=n.searchingText,a=n.preToolCallText,o=n.toolCallResultText;switch(t.state){case`input-streaming`:return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer`},O.createElement(Af,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),O.createElement(`span`,null,i));case`input-available`:return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer`},O.createElement(Af,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),O.createElement(`span`,null,a,` `,`"${t.input.query||``}" ...`));case`output-available`:var s=t.type===`tool-searchIndex`?t.output.query:t.input.query,c=t.output.hits?.length??0;return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--Result`},O.createElement(Pf,null),O.createElement(`span`,null,o,` `,r?O.createElement(`span`,{role:`button`,tabIndex:0,className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`,onKeyDown:function(e){e.key!==`Enter`&&e.key!==` `||(e.preventDefault(),r(s||``))},onClick:function(){return r(s||``)}},` `,`"`,s||``,`"`):O.createElement(`span`,{className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`},` "`,s||``,`"`),` `,`found `,c,` results`));default:return null}}function cm(e){var t=e.urlsToDisplay,n=e.relatedSourcesText;return O.createElement(`div`,{className:`DocSearch-AskAiScreen-RelatedSources`},O.createElement(`p`,{className:`DocSearch-AskAiScreen-RelatedSources-Title`},n||`Related sources`),O.createElement(`div`,{className:`DocSearch-AskAiScreen-RelatedSources-List`},t.length>0&&t.map(function(e){return O.createElement(`a`,{key:e.url,href:e.url,className:`DocSearch-AskAiScreen-RelatedSources-Item-Link`,target:`_blank`,rel:`noopener noreferrer`},O.createElement(lm,null),O.createElement(`span`,null,e.title||e.url))})))}function lm(){return O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`},O.createElement(`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`}),O.createElement(`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`}),O.createElement(`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`}),O.createElement(`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`}))}function um(e){var t=e.onClick,n=e.translations,r=n.copyButtonTitle,i=r===void 0?`Copy`:r,a=n.copyButtonCopiedText,o=a===void 0?`Copied!`:a,s=R(et(!1),2),c=s[0],l=s[1];return nt(function(){if(c){var e=setTimeout(function(){l(!1)},1500);return function(){return clearTimeout(e)}}},[c]),O.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ${c?`DocSearch-AskAiScreen-CopyButton--copied`:``}`,disabled:c,title:c?o:i,onClick:function(){t(),l(!0)}},c?O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`lucide lucide-check-icon lucide-check`},O.createElement(`path`,{d:`M20 6 9 17l-5-5`})):O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`lucide lucide-copy-icon lucide-copy`},O.createElement(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),O.createElement(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})))}function dm(e){var t=e.title,n=e.onClick;return O.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton`,title:t,onClick:n},O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`lucide lucide-thumbs-up-icon lucide-thumbs-up`},O.createElement(`path`,{d:`M7 10v12`}),O.createElement(`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`})))}function fm(e){var t=e.title,n=e.onClick;return O.createElement(`button`,{type:`button`,className:`DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton`,title:t,onClick:n},O.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`lucide lucide-thumbs-down-icon lucide-thumbs-down`},O.createElement(`path`,{d:`M17 14V2`}),O.createElement(`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`})))}function pm(e){var t=e.queries;return O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--AggregatedResult`},O.createElement(Pf,{size:18}),O.createElement(`span`,null,O.createElement(`span`,null,`Searched for `),t.map(function(e,n){return O.createElement(_e,{key:e+n},O.createElement(`span`,{className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`},`"`,e,`"`),n<t.length-2&&`, `,n===t.length-2&&` and `)}),``))}function mm(e){var t=e.translations,n=e.conversations,r=e.id,i=e.onFeedback,a=e.latestAssistantMessageContent,o=e.showActions,s=O.useMemo(function(){return n.getOne?.call(n,r)?.feedback??null},[n,r]),c=R(O.useState(s),2),l=c[0],u=c[1],d=R(O.useState(!1),2),f=d[0],p=d[1],m=R(O.useState(null),2),h=m[0],g=m[1],_=function(){var e=k(L().m(function e(t){var n;return L().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!f){e.n=1;break}return e.a(2);case 1:return g(null),p(!0),e.p=2,e.n=3,i?.(r,+(t===`like`));case 3:u(t),e.n=5;break;case 4:e.p=4,n=e.v,g(n);case 5:return e.p=5,p(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(t){return e.apply(this,arguments)}}(),v=t.likeButtonTitle,y=v===void 0?`Like`:v,b=t.dislikeButtonTitle,x=b===void 0?`Dislike`:b,S=t.thanksForFeedbackText,C=S===void 0?`Thanks for your feedback!`:S;return o&&a?O.createElement(`div`,{className:`DocSearch-AskAiScreen-Actions`},O.createElement(um,{translations:t,onClick:function(){return navigator.clipboard.writeText(a)}}),l===null?O.createElement(O.Fragment,null,f?O.createElement(Af,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}):O.createElement(O.Fragment,null,O.createElement(dm,{title:y,onClick:function(){return _(`like`)}}),O.createElement(fm,{title:x,onClick:function(){return _(`dislike`)}})),h&&O.createElement(`p`,{className:`DocSearch-AskAiScreen-FeedbackText`},h.message||`An error occured`)):O.createElement(`p`,{className:`DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible`},C)):null}om.displayName=`MemoizedMarkdown`;var hm=[`exchanges`,`translations`,`handleFeedback`],gm=O.forwardRef(function(e,t){var n,r=e.exchange,i=e.translations,a=i===void 0?{}:i,o=e.isLastExchange,s=e.conversations,c=e.onFeedback,l=e.status,u=e.streamError,d=e.agentStudio,f=r.userMessage,p=r.assistantMessage,m=a.reasoningText,h=m===void 0?`Reasoning...`:m,g=a.thinkingText,_=g===void 0?`Thinking...`:g,v=a.searchingText,y=v===void 0?`Searching...`:v,b=a.relatedSourcesText,x=b===void 0?`Related sources`:b,S=a.stoppedStreamingText,C=S===void 0?`You stopped this response`:S,w=a.preToolCallText,T=w===void 0?`Searching...`:w,ee=a.toolCallResultText,E=ee===void 0?`Searched for`:ee,te=a.copyButtonText,ne=te===void 0?`Copy`:te,re=a.copyButtonCopiedText,ie=re===void 0?`Copied!`:re,ae=a.errorTitleText,oe=ae===void 0?`Chat error`:ae,se=Bd(u,!!d),ce=ot(function(){return Ld(p)},[p]),D=ot(function(){return Ld(f)},[f]),le=ot(function(){return function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.type===`tool-searchIndex`&&r.state===`output-available`){for(var i=[],a=n;a<e.length;){var o=e[a];if(o.type!==`tool-searchIndex`||o.state!==`output-available`)break;var s=(o.output?.query??``).trim();s&&s.length>0&&i.push(s),a++}i.length>1?t.push({type:`aggregated-tool-call`,queries:i}):i.length===1&&t.push(r),n=a-1}else t.push(r)}return t}(p?.parts||[])},[p]),ue=O.useMemo(function(){return e=p,t=[],n=new Set,e?(e.parts.forEach(function(e){if(e.type===`text`&&e.text.length!==0){var r,i=e.text.replace(/```[\s\S]*?```/g,``).replace(/`[^`]*`/g,``),a=N(i.matchAll(/\[([^\]]*)\]\(([^)]+)\)/g));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=o[1].trim(),c=o[2];n.has(c)||(n.add(c),t.push({url:c,title:s||void 0}))}}catch(e){a.e(e)}finally{a.f()}var l,u=N(i.matchAll(/(?<!\]\()https?:\/\/[^\s<>"{}|\\^`[\]]+/g));try{for(u.s();!(l=u.n()).done;){var d=l.value[0].replace(/[.,;:!?]+$/,``);n.has(d)||(n.add(d),t.push({url:d}))}}catch(e){u.e(e)}finally{u.f()}}}),t):[];var e,t,n},[p]),de=f.metadata?.stopped||(p==null||(n=p.metadata)==null?void 0:n.stopped),fe=[`submitted`,`streaming`].includes(l)&&!le.some(function(e){return e.type!==`step-start`}),pe=!de&&(!o||o&&l===`ready`&&!!p),me=d?p?.id||r.id:f?.id||r.id;return O.createElement(`div`,{className:`DocSearch-AskAiScreen-Response-Container`,ref:t},O.createElement(`div`,{className:`DocSearch-AskAiScreen-Response`},O.createElement(`div`,{className:`DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user`},O.createElement(`p`,{className:`DocSearch-AskAiScreen-Query`},D?.text??``)),O.createElement(`div`,{className:`DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant`},O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent`},l===`error`&&u&&o&&!se&&O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error`},O.createElement(Ff,null),O.createElement(`div`,{className:`DocSearch-AskAiScreen-Error-Content`},O.createElement(`h4`,{className:`DocSearch-AskAiScreen-Error-Title`},oe),O.createElement(om,{content:u.message,copyButtonText:``,copyButtonCopiedText:``,isStreaming:!1}))),le.map(function(e,t){var n=t;return e.type===`reasoning`&&e.state===`streaming`?O.createElement(`div`,{key:n,className:`DocSearch-AskAiScreen-MessageContent-Reasoning shimmer`},O.createElement(Af,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),O.createElement(`span`,{className:`shimmer`},h)):e.type===`aggregated-tool-call`?O.createElement(pm,{key:n,queries:e.queries}):function(e){return e.type.startsWith(`tool-`)}(e)?O.createElement(sm,{key:n,part:e,translations:{preToolCallText:T,searchingText:y,toolCallResultText:E}}):typeof e==`string`?O.createElement(om,{key:n,content:e,copyButtonText:ne,copyButtonCopiedText:ie,isStreaming:!1}):e.type===`text`?O.createElement(om,{key:n,content:e.text,copyButtonText:ne,copyButtonCopiedText:ie,isStreaming:e.state===`streaming`}):null}),fe&&o&&le.length===0&&O.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Reasoning`},O.createElement(`span`,{className:`shimmer`},_))),de&&O.createElement(`p`,{className:`DocSearck-AskAiScreen-MessageContent-Stopped`},C)),O.createElement(`div`,{className:`DocSearch-AskAiScreen-Answer-Footer`},O.createElement(mm,{id:me,showActions:pe,latestAssistantMessageContent:ce?.text||null,translations:a,conversations:s,onFeedback:c}))),ue.length>0?O.createElement(cm,{urlsToDisplay:ue,relatedSourcesText:x}):null)}),_m=Ot(function(e){var t=e.exchanges,n=e.translations,r=n===void 0?{}:n,i=e.handleFeedback,a=jn(e,hm),o=r.conversationDisclaimer,s=o===void 0?`Answers are generated with AI which can make mistakes. Verify responses.`:o,c=O.useRef(null),l=t.length;return O.useEffect(function(){c.current&&c.current.scrollIntoView({behavior:`smooth`,block:`start`})},[l]),O.createElement(`div`,{className:`DocSearch-Sidepanel-ConversationScreen`},O.createElement(`p`,{className:`DocSearch-Sidepanel-ConversationScreen-disclaimer`},s),t.slice().map(function(e,n){var o=n===t.length-1;return O.createElement(gm,Dn({key:e.id,exchange:e,translations:r,isLastExchange:o,ref:o?c:null,onFeedback:i},a))}))}),vm=function(e){var t=e.suggestedQuestions,n=e.onSelectQuestion,r=e.translations,i=r===void 0?{}:r,a=i.titleText,o=a===void 0?`How can I help you today?`:a,s=i.introductionText,c=s===void 0?`I search through your documentation to help you find setup guides, feature details and troubleshooting tips, fast.`:s;return O.createElement(`div`,{className:`DocSearch-Sidepanel-NewConversationScreen`},O.createElement(`h4`,{className:`DocSearch-Sidepanel-Screen--title`},o),O.createElement(`p`,{className:`DocSearch-Sidepanel-Screen--introduction`},c),O.createElement(`div`,{className:`DocSearch-Sidepanel-List`},t.map(function(e){return O.createElement(`button`,{key:e.objectID,type:`button`,className:`DocSearch-Sidepanel-SuggestedQuestion`,title:`View conversation`,onClick:function(){n(e)}},O.createElement(`span`,null,e.question))})))},ym=O.forwardRef(function(e,t){var n=e.exchanges,r=e.isStreaming,i=e.translations,a=i===void 0?{}:i,o=e.onSend,s=e.onStopStreaming,c=e.showThreadDepthBanner,l=e.threadDepthApiMessage,u=e.showBlockingBannerNewConversationLink,d=u===void 0||u,f=e.onStartNewConversation,p=tf(),m=R(O.useState(``),2),h=m[0],g=m[1],_=O.useRef(null);O.useImperativeHandle(t,function(){return _.current});var v=a.promptPlaceholderText,y=v===void 0?`Ask a question`:v,b=a.promptAnsweringText,x=b===void 0?`Answering...`:b,S=a.promptAskAnotherQuestionText,C=S===void 0?`Ask another question`:S,w=a.promptDisclaimerText,T=w===void 0?`Answers are generated with AI which can make mistakes.`:w,ee=a.promptLabelText,E=ee===void 0?`Press Enter to send, or Shift and Enter for new line.`:ee,te=a.promptAriaLabelText,ne=te===void 0?`Prompt input`:te,re=a.threadDepthErrorPlaceholder,ie=re===void 0?`Conversation limit reached`:re,ae=a.startNewConversationButtonText,oe=ae===void 0?`Start a new conversation`:ae,se=a.threadDepthBannerContinueText,ce=se===void 0?`to continue.`:se,D=function(){if(_.current){var e=_.current,t=getComputedStyle(e),n=parseFloat(t.lineHeight),r=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom);e.style.height=`auto`;var i=e.scrollHeight,a=8*n+r;e.style.overflowY=i>a?`auto`:`hidden`,e.style.height=`${Math.min(i,a)}px`}},le=function(){if(!r&&!c){var e=h.trim();e!==``&&(o(e),g(``),requestAnimationFrame(function(){var e;(e=_.current)==null||e.focus(),D()}))}};O.useLayoutEffect(function(){D()},[p]);var ue=y;return c?ue=ie:r?ue=x:n.length>0&&(ue=C),O.createElement(`div`,{className:`DocSearch-Sidepanel-Prompt`},c?O.createElement(`div`,{className:`DocSearch-Sidepanel-ThreadDepthBanner`},l?O.createElement(`p`,{className:`DocSearch-Sidepanel-ThreadDepthBanner-apiMessage`},l):null,d?O.createElement(`p`,null,O.createElement(`button`,{type:`button`,className:`DocSearch-ThreadDepthError-Link`,onClick:f},oe),` `,ce):null):null,c?null:O.createElement(`form`,{className:`DocSearch-Sidepanel-Prompt--form`,onSubmit:function(e){e.preventDefault(),r||le()}},O.createElement(`textarea`,{ref:_,placeholder:ue,className:`DocSearch-Sidepanel-Prompt--textarea`,value:h,"aria-label":ne,"aria-labelledby":`prompt-label`,autoComplete:`off`,translate:`no`,rows:p?1:2,onKeyDown:function(e){r||c||e.key!==`Enter`||e.shiftKey||(e.preventDefault(),le())},onInput:D,onChange:function(e){return g(e.target.value)}}),O.createElement(`span`,{id:`prompt-label`,className:`sr-only`},E),O.createElement(`div`,{className:`DocSearch-Sidepanel-Prompt--actions`},r&&O.createElement(`button`,{type:`button`,title:`Stop streaming`,className:`DocSearch-Sidepanel-Prompt--stop`,onClick:s},O.createElement(If,null)),!r&&O.createElement(`button`,{type:`submit`,"aria-label":`Send question`,title:`Send question`,className:`DocSearch-Sidepanel-Prompt--submit`,"aria-disabled":h===``},O.createElement(Vf,null)))),O.createElement(`p`,{className:`DocSearch-Sidepanel-Prompt--disclaimer`},T))}),bm=function(e){return!1===/docsearch-sidepanel.js \(.*\)/.test(e.transporter.algoliaAgent.value)&&e.addAlgoliaAgent(`docsearch-sidepanel`,Of),e};function xm(e){var t=e.size,n=t===void 0?20:t,r=e.color,i=r===void 0?`currentColor`:r;return O.createElement(`svg`,{width:n,height:n,className:`DocSearch-Back-Icon`,viewBox:`0 0 24 24`,fill:`none`,stroke:i,strokeWidth:`1.6`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},O.createElement(`path`,{d:`m12 19-7-7 7-7`}),O.createElement(`path`,{d:`M19 12H5`}))}var Sm=[`children`,`className`,`onClick`],Cm=O.createContext({open:!1,setOpen:function(e){}});function wm(e){var t=e.children,n=R(O.useState(!1),2),r=n[0],i=n[1],a=O.useRef(null);return O.useEffect(function(){function e(e){var t;(t=a.current)!=null&&t.contains(e.target)||i(!1)}return r&&window.addEventListener(`click`,e),function(){window.removeEventListener(`click`,e)}},[r]),O.createElement(Cm.Provider,{value:{open:r,setOpen:i}},O.createElement(`div`,{ref:a,className:`DocSearch-Menu`},t))}wm.Trigger=function(e){var t=e.children,n=e.className,r=n===void 0?``:n,i=e.disabled,a=O.useContext(Cm),o=a.open,s=a.setOpen;return O.createElement(`button`,{type:`button`,className:`DocSearch-Menu-trigger ${r}${i?` disabled`:``}`,"aria-disabled":i,onClick:function(){i||s(!o)}},t)},wm.Content=function(e){var t=e.children,n=O.useContext(Cm).open;return O.createElement(`div`,{className:`DocSearch-Menu-content${n?` open`:``}`},t)},wm.Item=function(e){var t=e.children,n=e.className,r=n===void 0?``:n,i=e.onClick,a=jn(e,Sm),o=O.useContext(Cm).setOpen;return O.createElement(`button`,Dn({type:`button`,className:`DocSearch-Menu-item ${r}`,onClick:function(e){i&&(i(e),o(!1))}},a),t)};var Tm=function(e){var t=e.onBack,n=e.mobile,r=n!==void 0&&n,i=e.disabled,a=i!==void 0&&i;return O.createElement(`button`,{type:`button`,className:`DocSearch-Action DocSearch-Sidepanel-Action-back${r?` mobile`:``}`,title:`Go back to previous screen`,"aria-disabled":a,onClick:a?void 0:t},O.createElement(xm,null))},Em=O.memo(function(e){var t=e.sidepanelState,n=e.exchanges,r=e.setSidepanelState,i=e.onNewConversation,a=e.onToggleExpanded,o=e.onClose,s=e.translations,c=s===void 0?{}:s,l=e.hasConversations,u=e.isStreaming,d=c.title,f=d===void 0?`Ask AI`:d,p=c.conversationHistoryTitle,m=p===void 0?`My conversation history`:p,h=c.newConversationText,g=h===void 0?`Start a new conversation`:h,_=c.viewConversationHistoryText,v=_===void 0?`Conversation history`:_,y=tf(),b=function(){r(`conversation-history`)},x=O.useCallback(function(){n.length>0?r(`conversation`):r(`new-conversation`)},[n,r]),S=t===`new-conversation`&&n.length<1,C=f;return t===`conversation-history`&&(C=m),y&&(C=f),O.createElement(`header`,{className:`DocSearch-Sidepanel-Header`},O.createElement(`div`,{className:`DocSearch-Sidepanel-Header--left`},O.createElement(Tm,{mobile:!0,disabled:u,onBack:x}),t===`conversation-history`&&O.createElement(`div`,{className:`DocSearch-Divider`}),O.createElement(`button`,{type:`button`,className:`DocSearch-Action`,title:g,onClick:i},O.createElement(Wf,null)),O.createElement(`div`,{className:`DocSearch-Divider`}),O.createElement(`button`,{type:`button`,className:`DocSearch-Action`,title:v,onClick:b},O.createElement(Uf,null))),O.createElement(`div`,{className:`DocSearch-Sidepanel-Header--center`},O.createElement(Tm,{disabled:u,onBack:x}),O.createElement(jf,{className:`DocSearch-Sidepanel-Header-TitleIcon`}),O.createElement(`h2`,{className:`DocSearch-Sidepanel-Title`},C)),O.createElement(`div`,{className:`DocSearch-Sidepanel-Header--right`},t!==`conversation-history`&&(!S||l)&&O.createElement(wm,null,O.createElement(wm.Trigger,{className:`DocSearch-Action DocSearch-Sidepanel-Action-menu`,disabled:u},O.createElement(Lf,null)),O.createElement(wm.Content,null,!S&&O.createElement(wm.Item,{onClick:i},O.createElement(zf,null),g),l&&O.createElement(wm.Item,{onClick:b},O.createElement(Rf,null),v))),O.createElement(`button`,{type:`button`,className:`DocSearch-Action DocSearch-Sidepanel-Action-expand`,title:`Expand or collapse Sidepanel`,onClick:a},O.createElement(Hf,null)),O.createElement(`button`,{type:`button`,className:`DocSearch-Action DocSearch-Sidepanel-Action-close`,title:`Close Sidepanel`,onClick:o},O.createElement(Nf,null))))}),Dm=O.forwardRef(function(e,t){var n=e.isOpen,r=n!==void 0&&n,i=e.onOpen,a=e.onClose,o=e.assistantId,s=e.apiKey,c=e.appId,l=e.indexName,u=e.variant,d=u===void 0?`floating`:u,f=e.searchParameters,p=e.pushSelector,m=e.width,h=e.expandedWidth,g=e.suggestedQuestions,_=g!==void 0&&g,v=e.translations,y=v===void 0?{}:v,b=e.keyboardShortcuts,x=e.side,S=x===void 0?`right`:x,C=e.initialMessage,w=e.useStagingEnv,T=w!==void 0&&w,ee=e.agentStudio,E=ee!==void 0&&ee,te=R(O.useState(!1),2),ne=te[0],re=te[1],ie=R(O.useState(`new-conversation`),2),ae=ie[0],oe=ie[1],se=R(O.useState(!1),2),ce=se[0],D=se[1],le=O.useRef(null),ue=O.useRef(null),de=tf(),fe=function(e){var t=e.isExpanded,n=e.width,r=e.expandedWidth,i=O.useMemo(function(){return typeof n==`number`?`${n}px`:n??`360px`},[n]),a=O.useMemo(function(){return typeof r==`number`?`${r}px`:r??`580px`},[r]);return t?a:i}({isExpanded:ne,width:m,expandedWidth:h}),pe=O.useMemo(function(){return p??`#root, main, .app, body`},[p]),me=st(function(){re(!ne)},[ne]),he=kf(c,s,bm),ge=ef({appId:c,indexName:l,assistantId:o,apiKey:s,searchParameters:f,useStagingEnv:T,agentStudio:E}),_e=ge.status,ve=ge.sendMessage,ye=ge.stopAskAiStreaming,be=ge.isStreaming,xe=ge.exchanges,Se=ge.clearError,Ce=ge.resetAskAiChatSession,we=ge.conversations,Te=ge.messages,Ee=ge.sendFeedback,De=ge.askAiError,Oe=function(e){var t=e.assistantId,n=e.searchClient,r=e.suggestedQuestionsEnabled,i=r!==void 0&&r,a=R(et([]),2),o=a[0],s=a[1];return nt(function(){var e=function(){var e=k(L().m(function e(){var r,i,a;return L().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,n.search({requests:[{indexName:`algolia_ask_ai_suggested_questions`,filters:`state:published AND assistantId:${t}`,hitsPerPage:3}]});case 1:r=e.v,i=r.results,a=i[0],s(a.hits);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();i&&t&&t!==``&&e()},[i,t,n]),o}({assistantId:o,suggestedQuestionsEnabled:_,searchClient:he}),ke=O.useMemo(function(){return _e===`error`&&Bd(De,E)},[_e,De,E]),Ae=O.useMemo(function(){return xe},[xe,ke]),je=ae===`conversation`&&ke&&(!zd(De)||Te.some(function(e){return e.role===`assistant`})),Me=O.useMemo(function(){return function(e){if(e){if(Vd(e)){var t=Wd(e);return!t||(n=t.trim()).startsWith(`{`)&&n.endsWith(`}`)?`Could not complete response due to token output limits`:t}var n;return Wd(e)}}(De)},[De]),Ne=O.useMemo(function(){return I(I({},y.promptForm),y.conversationScreen?.startNewConversationButtonText===void 0?{}:{startNewConversationButtonText:y.conversationScreen.startNewConversationButtonText})},[y.promptForm,y.conversationScreen]),Pe=O.useRef(_e),Fe=function(){Se(),Ce(),oe(`new-conversation`)},Ie=O.useCallback(function(e){Se(),e.messages?Ce({kind:`setMessages`,messages:e.messages}):e.query&&Ce({kind:`sendText`,text:e.query}),oe(`conversation`)},[Se,Ce]);(function(e){var t=e.variant,n=e.selectors,r=e.isOpen,i=e.expectedWidth,a=e.side,o=it(null),s=it(null),c=tf();rt(function(){if(t!==`floating`&&!c){s.current!==n&&(o.current&&(a===`left`?o.current.style.marginLeft=``:o.current.style.marginRight=``,o.current.style.transition=``),o.current=Array.from(document.querySelectorAll(n))[0]||document.body,s.current=n,o.current&&(o.current.style.transition=`margin-${a} 280ms cubic-bezier(0.22, 1, 0.36, 1)`));var e=o.current;if(e){var l=r?i:`0px`;a===`left`?e.style.marginLeft=l:e.style.marginRight=l}}},[r,i,t,n,a,c]),rt(function(){return function(){o.current&&(a===`left`?o.current.style.marginLeft=``:o.current.style.marginRight=``,o.current.style.transition=``)}},[a])})({variant:d,expectedWidth:fe,selectors:pe,isOpen:r,side:S}),function(e){var t=e.onClose,n=e.onOpen,r=e.isOpen,i=e.keyboardShortcuts;nt(function(){function e(e){r&&e.code===`Escape`?t():!1!==i?.[`Ctrl/Cmd+I`]&&e.key?.toLowerCase()===`i`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),r?t():n())}return window.addEventListener(`keydown`,e),function(){window.removeEventListener(`keydown`,e)}},[r,t,n,i])}({onClose:a,onOpen:i,isOpen:r,keyboardShortcuts:b}),O.useImperativeHandle(t,function(){return{open:i,close:a,get isReady(){return!0},get isOpen(){return r}}},[i,a,r]),O.useEffect(function(){if(Pe.current===`streaming`&&_e===`ready`){ce&&Te.at(-1)&&(Te.at(-1).metadata={stopped:!0});var e=Te[0];if(e!=null&&e.parts){var t,n=N(e.parts);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.type===`text`&&we.add(Id(r.text,Te))}}catch(e){n.e(e)}finally{n.f()}}}Pe.current=_e},[we,_e,Te,ce]),O.useEffect(function(){function e(){if(le.current){var e=.01*window.innerHeight;le.current.style.setProperty(`--sp-vh`,`${e}px`)}}return e(),window.addEventListener(`resize`,e),function(){window.removeEventListener(`resize`,e)}},[]);var Le=O.useRef({clearError:Se,resetAskAiChatSession:Ce,conversations:we,handleSelectConversation:Ie});return Le.current={clearError:Se,resetAskAiChatSession:Ce,conversations:we,handleSelectConversation:Ie},O.useEffect(function(){if(C){var e,t=Le.current,n=t.clearError,r=t.resetAskAiChatSession,i=t.conversations,a=t.handleSelectConversation;C.messageId&&(e=i.getConversation?.call(i,C.messageId)),e?a(e):(n(),r(C.suggestedQuestionId?{kind:`sendText`,text:C.query,requestOptions:{body:{suggestedQuestionId:C.suggestedQuestionId}}}:{kind:`sendText`,text:C.query}),oe(`conversation`))}},[C]),O.useEffect(function(){var e,t;r&&!de&&((e=ue.current)==null||e.focus()),r||(t=ue.current)==null||t.blur()},[r,de]),O.createElement(`div`,{className:`DocSearch-Sidepanel-Container ${d} side-${S}${r?` is-open`:``}${ne?` is-expanded`:``}`,style:{"--sp-width":fe},role:`dialog`,tabIndex:-1,ref:le},O.createElement(`aside`,{id:`docsearch-sidepanel`,className:`DocSearch-Sidepanel ${ae}`},O.createElement(Em,{sidepanelState:ae,exchanges:Ae,setSidepanelState:oe,hasConversations:we.getAll().length>0,isStreaming:be,onNewConversation:Fe,onToggleExpanded:me,onClose:a}),O.createElement(`div`,{className:`DocSearch-Sidepanel-Content`},ae===`new-conversation`&&O.createElement(vm,{suggestedQuestions:Oe,translations:y.newConversationScreen,onSelectQuestion:function(e){D(!1),Se(),Ce({kind:`sendText`,text:e.question,requestOptions:{body:{suggestedQuestionId:e.objectID}}}),oe(`conversation`)}}),ae===`conversation`&&O.createElement(_m,{exchanges:Ae,status:_e,conversations:we,handleFeedback:Ee,translations:y.conversationScreen,streamError:De,agentStudio:E}),ae===`conversation-history`&&O.createElement(Gf,{conversations:we,selectConversation:Ie})),O.createElement(ym,{ref:ue,exchanges:Ae,isStreaming:be,showThreadDepthBanner:je,threadDepthApiMessage:Me,showBlockingBannerNewConversationLink:Hd(De,!!E),translations:Ne,onSend:function(e){D(!1),Se(),ve({text:e}),oe(`conversation`)},onStartNewConversation:Fe,onStopStreaming:function(){D(!0),ye()}}),O.createElement(`footer`,{className:`DocSearch-Sidepanel-Footer`},O.createElement(`span`,{className:`DocSearch-Logo DocSearch-Sidepanel--powered-by`},O.createElement(zn,{translations:y.logo})))))}),Om=`Ctrl`,km=[`variant`,`keyboardShortcuts`,`translations`],Am=function(e){var t=e.variant,n=t===void 0?`floating`:t,r=e.keyboardShortcuts,i=e.translations,a=i===void 0?{}:i,o=jn(e,km),s=a.buttonText,c=s===void 0?`Ask AI`:s,l=a.buttonAriaLabel,u=l===void 0?`Ask AI`:l,d=R(et(null),2),f=d[0],p=d[1];nt(function(){typeof navigator<`u`&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p(``):p(Om))},[]);var m=f===Om?`Control`:`Meta`,h=!1!==r?.[`Ctrl/Cmd+I`],g=`${m}+i`;return O.createElement(`button`,Dn({className:`DocSearch-SidepanelButton ${n}`,type:`button`,"aria-label":h?`${u} (${g})`:u,"aria-keyshortcuts":h?g:void 0},n===`floating`?{tabIndex:-1}:{},o),O.createElement(jf,null),n!==`floating`&&c)},jm=[`keyboardShortcuts`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],Mm=[`portalContainer`],Nm=[`button`,`panel`],Pm=O.forwardRef(function(e,t){var n=e.keyboardShortcuts,r=e.theme,i=e.onReady,a=e.onOpen,o=e.onClose,s=e.onSidepanelOpen,c=e.onSidepanelClose,l=jn(e,jm);return O.createElement(hn,{keyboardShortcuts:n,theme:r,ref:t,onReady:i,onOpen:a,onClose:o,onSidepanelOpen:s,onSidepanelClose:c},O.createElement(Fm,l))});function Fm(e){var t=e.button,n=t===void 0?{}:t,r=e.panel,i=r===void 0?{}:r,a=i.portalContainer,o=jn(i,Mm),s=jn(e,Nm),c=function(){var e=O.useContext(mn);if(e===void 0)throw Error("`useDocSearch` must be used within the `DocSearch` provider");return e}(),l=c.docsearchState,u=c.setDocsearchState,d=c.keyboardShortcuts,f=c.registerView,p=c.initialAskAiMessage,m=c.clearInitialAskAiMessage,h=O.useCallback(function(){u(l===`sidepanel`?`ready`:`sidepanel`)},[l,u]),g=O.useMemo(function(){return a??document.body},[a]);O.useEffect(function(){f(`sidepanel`)},[f]);var _=O.useMemo(function(){return O.createElement(Am,Dn({keyboardShortcuts:d,onClick:h},n))},[d,h,n]);return O.createElement(O.Fragment,null,n.variant===`inline`?_:zt(_,g),zt(O.createElement(Dm,Dn({initialMessage:p,isOpen:l===`sidepanel`,onClose:function(){m(),u(`ready`)},onOpen:function(){u(`sidepanel`)}},s,o,{keyboardShortcuts:d})),g))}var Im=[`container`,`environment`,`onReady`,`onOpen`,`onClose`];function Lm(e){var t=e.container,n=e.environment,r=e.onReady,i=e.onOpen,a=e.onClose,o=h(e,Im),s=function(e,t){if(typeof e!=`string`)return e;if(!t)throw Error(`Cannot resolve a selector without a browser environment.`);var n=t.document.querySelector(e);if(!n)throw Error(`Container selector did not match any element: "${e}"`);return n}(t,n||(typeof window<`u`?window:void 0)),c={current:null},l=!1;return Gt(me(Pm,m(m({},o),{},{ref:c,onReady:function(){l=!0,r?.()},onSidepanelOpen:i,onSidepanelClose:a})),s),{open:function(e){var t;(t=c.current)==null||t.openSidepanel(e)},close:function(){var e;(e=c.current)==null||e.close()},get isReady(){return l},get isOpen(){var e;return(e=c.current?.isSidepanelOpen)!=null&&e},destroy:function(){rn(s),l=!1}}}export{Lm as default};