mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-20 23:35:37 +08:00
110 lines
479 KiB
JavaScript
110 lines
479 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(
|
||
|
|
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,D,te,ne,re,ie,ae,oe,se,O={},ce=[],le=Array.isArray,ue=ce.slice,de=Object.assign;function fe(e){e&&e.parentNode&&e.remove()}function pe(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?ue.call(arguments,2):n),me(e,o,r,i,null)}function me(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 he(){return{current:null}}function ge(e){return e.children}function _e(e,t){this.props=e,this.context=t,this.__g=0}function ve(e,t){if(t==null)return e.__?ve(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`?ve(e):null}function ye(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 ye(e)}}function be(e){(8&e.__g||!(e.__g|=8)||!E.push(e)||te++)&&D==T.debounceRendering||((D=T.debounceRendering)||queueMicrotask)(xe)}function xe(){for(var e,t,n,r,i,a,o,s,c=1;E.length;)E.length>c&&E.sort(ne),e=E.shift(),c=E.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=de({},r)).__v=r.__v+1,T.vnode&&T.vnode(n),ke(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??ve(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,je(a,n,o),n.__e!=i&&ye(n)));te=0}function Se(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||ce,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?me(null,o,null,null,null):le(o)?me(ge,{children:o},null,null,null):o.constructor==null&&o.__b>0?me(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=Te(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=ve(s)),Pe(s,s));return r}(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?O:y[m.__i]||O,m.__i=f,_=ke(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&Ne(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var ln={"Ctrl/Cmd+K":!0,"/":!0,"Ctrl/Cmd+I":!0};function un(e){return sn(sn({},ln),e)}function dn(e){var t=e.isOpen,n=e.isAskAiActive,r=e.onAskAiToggle,i=e.onClose,a=e.onOpen,o=e.keyboardShortcuts,s=o===void 0?ln:o;k.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 fn=[`children`,`theme`,`onReady`,`onOpen`,`onClose`,`onSidepanelOpen`,`onSidepanelClose`],pn=k.createContext(void 0);pn.displayName=`DocSearchContext`;var mn=k.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,fn),u=cn(k.useState(`ready`),2),d=u[0],f=u[1],p=cn(k.useState(l.initialQuery||``),2),m=p[0],h=p[1],g=k.useRef(null),_=un(l.keyboardShortcuts),v=cn(k.useState(),2),y=v[0],b=v[1],x=cn(k.useState(function(){return new Set}),2),S=x[0],C=x[1],w=function(){var e=cn(k.useState(!1),2),t=e[0],n=e[1];return k.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=k.useRef(`ready`),ee=[`modal-search`,`modal-askai`].includes(d),E=d===`modal-askai`,D=!w&&S.has(`sidepanel`),te=d===`sidepanel`;k.useEffect(function(){i?.()},[i]),k.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 ne=k.useCallback(function(){f(`modal-search`)},[]),re=k.useCallback(function(){var e;f(`ready`),(e=g.current)==null||e.focus(),h(l.initialQuery??``)},[f,l.initialQuery]),ie=k.useCallback(function(e,t){if(!w&&e&&D)return b(t),void f(`sidepanel`);f(e?`modal-askai`:`modal-search`)},[f,w,D]),ae=k.useCallback(function(e){S.has(`sidepanel`)&&(b(e),f(`sidepanel`))},[f,S]);k.useCallback(function(e){f(`modal-search`),h(e.key)},[f,h]);var oe=k.useCallback(function(){b(void 0)},[]),se=k.useCallback(function(e){S.has(e)||C(function(t){var n=new Set(t);return n.add(e),n})},[S]);k.useImperativeHandle(t,function(){return{open:ne,close:re,openAskAi:function(e){return ie(!0,e)},openSidepanel:ae,get isReady(){return!0},get isOpen(){return ee},get isSidepanelOpen(){return te},get isSidepanelSupported(){return D}}},[ne,re,ie,ae,ee,te,D]),function(e){var t=e.theme;tt(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}),dn({isOpen:ee,onOpen:ne,onClose:re,onAskAiToggle:ie,isAskAiActive:E,keyboardShortcuts:_});var O=k.useMemo(function(){return{docsearchState:d,setDocsearchState:f,searchButtonRef:g,initialQuery:m,keyboardShortcuts:_,openModal:ne,closeModal:re,isAskAiActive:E,isModalActive:ee,onAskAiToggle:ie,initialAskAiMessage:y,clearInitialAskAiMessage:oe,registerView:se,isHybridModeSupported:D}},[d,g,m,_,ne,re,E,ee,ie,y,oe,se,D]);return k.createElement(pn.Provider,{value:O},n)});mn.displayName=`DocSearch`;var hn=[`type`],gn=[`type
|
||
|
|
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 F(e,t,n){return(t=Nn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function En(){return En=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},En.apply(null,arguments)}function Dn(e){return Dn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dn(e)}function I(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&&Mn(e,t)}function On(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(On=function(){return!!e})()}function kn(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 L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kn(Object(n),!0).forEach(function(t){F(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function An(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 R(){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 jn(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]())):(jn(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,jn(e,i,`GeneratorFunction`)),e.prototype=Object.create(d),e}return c.prototype=l,jn(d,`constructor`,l),jn(l,`constructor`,c),c.displayName=`GeneratorFunction`,jn(l,i,`GeneratorFunction`),jn(d),jn(d,i,`Generator`),jn(d,r,function(){return this}),jn(d,`toString`,function(){return`[object Generator]`}),(R=function(){return{w:a,m:f}})()}function jn(e,t,n,r){var i=Object.defineProperty;try{i({},``,{})}catch{i=0}jn=function(e,t,n,r){function a(t,n){jn(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,config
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function B(e){return function(e){if(Array.isArray(e))return Sn(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||Fn(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 Nn(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 Pn(e){return Pn=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)},Pn(e)}function Fn(e,t){if(e){if(typeof e==`string`)return Sn(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)?Sn(e,t):void 0}}function In(e){var t=typeof Map==`function`?new Map:void 0;return In=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 wn(e,arguments,Dn(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Mn(n,e)},In(e)}function Ln(){Ln=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)),Mn(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 I(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)},Ln.apply(this,arguments)}var Rn=new Set([`AI-203`,`AI-205`,`AI-224`,`AI-225`]);function zn(e,t){for(var n=0,r=Object.entries(e);n<r.length;n++){var i=z(r[n],2),a=i[0],o=i[1];if(a.toLowerCase()===t.toLowerCase()&&typeof o==`string`&&o.trim()!==``)return o.trim()}}function Bn(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 Vn(e){return/\brequest blocked for this domain\b/.test(e)||/\bblocked for this domain\b/.test(e)}var Hn=[{matches:function(e){return typeof e.extractedCodeUpper==`string`&&Rn.has(e.extractedCodeUpper)}},{matches:function(e){return e.parsedJson!==null&&Vn(((t=zn(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=zn(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=zn(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 function(e){return/\bTokenOutputLimitError\b/i.test(e)}(e.message)},showNewConversationLink:!1},{matches:function(e){return function(e){return/\b429\b/.test(e)||/\brate\s*limit/i.tes
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Dr(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 Or(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kr(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 Ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kr(Object(n),!0).forEach(function(t){jr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jr(e,t,n){return(t=function(e){var t=function(e,t){if(Tr(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Tr(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return Tr(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mr(e){return e.map(function(e){var t=e.items,n=Or(e,Cr);return Ar(Ar({},n),{},{objectIDs:t?.map(function(e){return e.objectID})||n.objectIDs})})}function Nr(e){var t,n,r,i=(t=function(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 Sr(e,t);var n=Object.prototype.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)?Sr(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.`)}()}((e.version||``).split(`.`).map(Number),2),n=t[0],r=t[1],n>=3||n===2&&r>=4||n===1&&r>=10);function a(t,n,r){if(i&&r!==void 0){var a=r[0].__autocomplete_algoliaCredentials,o={"X-Algolia-Application-Id":a.appId,"X-Algolia-API-Key":a.apiKey};e.apply(void 0,[t].concat(Er(n),[{headers:o}]))}else e.apply(void 0,[t].concat(Er(n)))}return{init:function(t,n){e(`init`,{appId:t,apiKey:n})},setAuthenticatedUserToken:function(t){e(`setAuthenticatedUserToken`,t)},setUserToken:function(t){e(`setUserToken`,t)},clickedObjectIDsAfterSearch:function(){var e=[...arguments];e.length>0&&a(`clickedObjectIDsAfterSearch`,Mr(e),e[0].items)},clickedObjectIDs:function(){var e=[...arguments];e.length>0&&a(`clickedObjectIDs`,Mr(e),e[0].items)},clickedFilters:function(){var t=[...arguments];t.length>0&&e.apply(void 0,[`clickedFilters`].concat(t))},convertedObjectIDsAfterSearch:function(){var e=[...arguments];e.length>0&&a(`convertedObjectIDsAfterSearch`,Mr(e),e[0].items)},convertedObjectIDs:function(){var e=[...arguments];e.length>0&&a(`convertedObjectIDs`,Mr(e),e[0].items)},convertedFilters:function(){var t=[...arguments];t.length>0&&e.apply(void 0,[`convertedFilters`].concat(t))},viewedObjectIDs:function(){var e=[...arguments];e.length>0&&e.reduce(function(e,t){var n=t.items,r=Or(t,wr);return[].concat(Er(e),Er(function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,n=[],r=0;r<e.objectIDs.length;r+=t)n.push(Ar(Ar({},e),{},{objectIDs:e.objectIDs.slice(r,r+t)}));return n}(Ar(Ar({},r),{},{objectIDs:n?.map(function(e){return e.objectID})||r.objectIDs})).map(function(e){return{items:n,payload:e}})))},[]).forEach(function(e){var t=e.items;return a(`viewedObjectIDs`,[e.payload],t)})},viewedFilters:function(){var t=[...arguments];t.length>0&&e.apply(void 0,[`viewedFilters`].concat(t))}}}function Pr(e){var t=e.items.reduce(function(e,t){return e[t.__autocomplete_indexName]=(e[t.__autocomplete_indexName]??[]).concat(t),e},{});return Object.keys(t).map(function(e){return{index:e,items:t[e],algoliaSource:[`autocomplete`]}})}function Fr(e){return e.objectID&&e.__autocomplete_indexName&&e.__autocomplete_queryID}function Ir(e){return Ir=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)},Ir(e)}function Lr(e){return function(e){if(Array.isArray(e))return Rr(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||function(e,t){if(e){if(typeof e==`string`)return Rr(e,t);var n=Object.prototype.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)?Rr(e,t):void 0}}(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 Rr(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 zr(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 Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?zr(Object(n),!0).forEach(function(t){Vr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vr(e,t,n){return(t=function(e){var t=function(e,t){if(Ir(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ir(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return Ir(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hr=`2.15.0`,Ur=`https://cdn.jsdelivr.net/npm/search-insights@${Hr}/dist/search-insights.min.js`,Wr=pr(function(e){var t=e.onItemsChange,n=e.items,r=e.insights,i=e.state;t({insights:r,insightsEvents:Pr({items:n}).map(function(e){return Br({eventName:`Items Viewed`},e)}),state:i})},400);function Gr(e){var t=function(e){return Br({onItemsChange:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.viewedObjectIDs.apply(t,Lr(n.map(function(e){return Br(Br({},e),{},{algoliaSource:Kr(e.algoliaSource,r.context)})})))},onSelect:function(e){var t=e.insights,n=e.insightsEvents,r=e.state;t.clickedObjectIDsAfterSearch.apply(t,Lr(n.map(function(e){return Br(Br({},e),{},{algoliaSource:Kr(e.algoliaSource,r.context)})})))},onActive:yr,__autocomplete_clickAnalytics:!0},e)}(e),n=t.insightsClient,r=t.insightsInitParams,i=t.onItemsChange,a=t.onSelect,o=t.onActive,s=t.__autocomplete_clickAnalytics,c=n;if(n||typeof window<`u`&&function(e){var t=e.window,n=t.AlgoliaAnalyticsObject||`aa`;typeof n==`string`&&(c=t[n]),c||(t.AlgoliaAnalyticsObject=n,t[n]||(t[n]=function(){t[n].queue||(t[n].queue=[]);var e=[...arguments];t[n].queue.push(e)}),t[n].version=Hr,c=t[n],function(e){var t=`[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete`;try{var n=e.document.createElement(`script`);n.async=!0,n.src=Ur,n.onerror=function(){console.error(t)},document.body.appendChild(n)}catch{console.error(t)}}(t))}({window}),!c)return{};r&&c(`init`,Br({partial:!0},r));var l=Nr(c),u={current:[]},d=pr(function(e){var t=e.state;if(t.isOpen){var n=t.collections.reduce(function(e,t){return[].concat(Lr(e),Lr(t.items))},[]).filter(Fr);vr(u.current.map(function(e){return e.objectID}),n.map(function(e){return e.objectID}))||(u.current=n,n.length>0&&Wr({onItemsChange:i,items:n,insights:l,state:t}))}},0);return{name:`aa.algoliaInsightsPlugin`,subscribe:function(e){var t=e.setContext,n=e.onSelect,r=e.onActive;function i(e){t({algoliaInsightsPlugin:{__algoliaSearchParameters:Br(Br({},s?{clickAnalytics:!0}:{}),e?{userToken:qr(e)}:{}),insights:l}})}c(`addAlgoliaAgent`,`insights-plugin`),i(),c(`onUserTokenChange`,function(e){i(e)}),c(`getUserToken`,null,function(e,t){i(t)}),n(function(e){var t=e.item,n=e.state,r=e.event,i=e.source;Fr(t)&&a({state:n,event:r,insights:l,item:t,insightsEvents:[Br({eventName:`Item Selected`},xr({item:t,items:i.getItems().filter(Fr)}))]})}),r(function(e){var t=e.item,n=e.source,r=e.state,i=e.event;Fr(t)&&o({state:r,event:i,insights:l,item:t,insightsEvents:[Br({eventName:`Item Active`},xr({item:t,items:n.getItems().filter(Fr)}))]})})},onStateChange:function(e){var t=e.state;d({state:t})},__autocomplete_pluginOptions:e}}function Kr(){var e,t=arguments.length>1?arguments[1]:void 0;return[].concat(Lr(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]),[`autocomplete-internal`],Lr((e=t.algoliaInsightsPlugin)!=null&&e.
|
||
|
|
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}}}}(e);try{for(a.s();!(n=a.n()).done;){var o,s,c,l=(o=n.value.__autocomplete_pluginOptions)==null||(s=(c=o).awaitSubmit)==null?void 0:s.call(c);if(typeof l==`number`)i.push(l);else if(!0===l){r=!0;break}}}catch(e){a.e(e)}finally{a.f()}return r?t.wait():i.length>0?t.wait(Math.max.apply(Math,i)):void 0};function oi(e){var t=function(e){var t=e.collections.map(function(e){return e.items.length}).reduce(function(e,t,n){var r=(e[n-1]||0)+t;return e.push(r),e},[]).reduce(function(t,n){return n<=e.activeItemId?t+1:t},0);return e.collections[t]}(e);if(!t)return null;var n=t.items[function(e){for(var t=e.state,n=e.collection,r=!1,i=0,a=0;!1===r;){var o=t.collections[i];if(o===n){r=!0;break}a+=o.items.length,i++}return t.activeItemId-a}({state:e,collection:t})],r=t.source;return{item:n,itemInputValue:r.getItemInputValue({item:n,state:e}),itemUrl:r.getItemUrl({item:n,state:e}),source:r}}function si(e,t,n){return[e,n?.sourceId,t].filter(Boolean).join(`-`).replace(/\s/g,``)}var ci=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i;function li(e){return e.nativeEvent||e}function ui(e){return ui=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)},ui(e)}function di(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 fi(e,t,n){return(t=function(e){var t=function(e,t){if(ui(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ui(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return ui(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pi(e){return pi=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)},pi(e)}function mi(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 hi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?mi(Object(n),!0).forEach(function(t){gi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gi(e,t,n){return(t=function(e){var t=function(e,t){if(pi(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pi(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return pi(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _i(e){return _i=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)},_i(e)}function vi(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 yi(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 bi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?yi(Object(n),!0).forEach(function(t)
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}(r.map(function(e){return e.getSources})),[e.getSources]).filter(Boolean).map(function(e){return function(e,t){var n=[];return Promise.resolve(e(t)).then(function(e){return Promise.all(e.filter(function(e){return!!e}).map(function(e){if(e.sourceId,n.includes(e.sourceId))throw Error(`[Autocomplete] The \`sourceId\` ${JSON.stringify(e.sourceId)} is not unique.`);n.push(e.sourceId);var t={getItemInputValue:function(e){return e.state.query},getItemUrl:function(){},onSelect:function(e){(0,e.setIsOpen)(!1)},onActive:yr,onResolve:yr};Object.keys(t).forEach(function(e){t[e].__default=!0});var r=ti(ti({},t),e);return Promise.resolve(r)}))})}(e,n)})).then(function(e){return mr(e)}).then(function(e){return e.map(function(e){return bi(bi({},e),{},{onSelect:function(n){e.onSelect(n),t.forEach(function(e){return e.onSelect?.call(e,n)})},onActive:function(n){e.onActive(n),t.forEach(function(e){return e.onActive?.call(e,n)})},onResolve:function(n){e.onResolve(n),t.forEach(function(e){return e.onResolve?.call(e,n)})}})})})},navigator:bi({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl;n.open(t,`_blank`,`noopener`)?.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,`_blank`,`noopener`)}},e.navigator)})}function Ci(e){return Ci=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)},Ci(e)}function wi(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 Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wi(Object(n),!0).forEach(function(t){Ei(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ei(e,t,n){return(t=function(e){var t=function(e,t){if(Ci(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ci(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return Ci(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Di(e){return Di=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)},Di(e)}function Oi(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 ki(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Oi(Object(n),!0).forEach(function(t){Ai(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ai(e,t,n){return(t=function(e){var t=function(e,t){if(Di(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Di(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return Di(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ji(e){return function(e){if(Array.isArray(e))return Mi(e)}(e)||function(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}(e)||function(e,t){if(e){if(typeof e==`string`)return Mi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n===`Object`&&e.c
|
||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Mi(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 Ni(e){return!!e.execute}function Pi(e){var t=e.reduce(function(e,t){if(!Ni(t))return e.push(t),e;var n=t.searchClient,r=t.execute,i=t.requesterId,a=t.requests,o=e.find(function(e){return Ni(t)&&Ni(e)&&e.searchClient===n&&!!i&&e.requesterId===i});if(o){var s;(s=o.items).push.apply(s,ji(a))}else{var c={execute:r,requesterId:i,items:a,searchClient:n};e.push(c)}return e},[]).map(function(e){if(!Ni(e))return Promise.resolve(e);var t=e,n=t.execute,r=t.items;return n({searchClient:t.searchClient,requests:r})});return Promise.all(t).then(function(e){return mr(e)})}function Fi(e){return Fi=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)},Fi(e)}var Ii=[`event`,`nextState`,`props`,`query`,`refresh`,`store`];function Li(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 Ri(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Li(Object(n),!0).forEach(function(t){zi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Li(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function zi(e,t,n){return(t=function(e){var t=function(e,t){if(Fi(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fi(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return Fi(t)===`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Bi,Vi,Hi,Ui=null,Wi=(Bi=-1,Vi=-1,Hi=void 0,function(e){var t=++Bi;return Promise.resolve(e).then(function(e){return Hi&&t<Vi?Hi:(Vi=t,Hi=e,e)})});function Gi(e){var t=e.event,n=e.nextState,r=n===void 0?{}:n,i=e.props,a=e.query,o=e.refresh,s=e.store,c=function(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Ii);Ui&&i.environment.clearTimeout(Ui);var l=c.setCollections,u=c.setIsOpen,d=c.setQuery,f=c.setActiveItemId,p=c.setStatus,m=c.setContext;if(d(a),f(i.defaultActiveItemId),!a&&!1===i.openOnFocus){var h=s.getState().collections.map(function(e){return Ri(Ri({},e),{},{items:[]})});p(`idle`),l(h),u(r.isOpen??i.shouldPanelOpen({state:s.getState()}));var g=Yr(Wi(h).then(function(){return Promise.resolve()}));return s.pendingRequests.add(g)}p(`loading`),Ui=i.environment.setTimeout(function(){p(`stalled`)},i.stallThreshold);var _=Yr(Wi(i.getSources(Ri({query:a,refresh:o,state:s.getState()},c)).then(function(e){return Promise.all(e.map(function(e){return Promise.resolve(e.getItems(Ri({query:a,refresh:o,state:s.getState()},c))).then(function(t){return function(e,t,n){if(i=e,i?.execute){var r=e.requesterId===`algolia`?Object.assign.apply(Object,[{}].concat(ji(Object.keys(n.context).map(function(e){return n.context[e]?.__algoliaSearchParameters})))):{};return ki(ki({},e),{},{requests:e.queries.map(function(n){return{query:e.requesterId===`algolia`?ki(ki({},n),{},{params:ki(ki({},r),n.params)}):n,sourceId:t,transformResponse:e.transformResponse}})})}var i;return{items:e,sourceId:t}}(t,e.sourceId,s.getState())})})).then(Pi).then(function(t){var n=t.some(function(e){return function(e){return!Array.isArray(e)&&!!e?._automaticInsights}(e.items)});return n&&m({algoliaInsightsPlugin:Ri(Ri({},s.getState().context?.algoliaInsigh
|
||
|
|
]`).replace(`lheading`,ao).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()}),bo=/^( {2,}|\\)\n(?!\s*$)/,xo=/(?:[!-\/:-@\[-`\{-~\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-\uD
|
||
|
|
`)}}}},{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:z(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=es(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:es(t[0],`
|
||
|
|
`)}}},{key:`blockquote`,value:function(e){var t=this.rules.block.blockquote.exec(e);if(t){for(var n=es(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=$o(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=P(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=P(o);try{for(p.s();!(f=p.n()).done;){var m=f.value;s.rows.push($o(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=es(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)),ts(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 ts(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=B(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=B(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=B(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{va
|
||
|
|
`),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(to.tabCharGlobal,` `).replace(to.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:qo,inline:Jo}}},{key:`lex`,value:function(t,n){return new e(n).lex(t)}},{key:`lexInline`,value:function(t,n){return new e(n).inlineTokens(t)}}])}(),is=N(function e(t){M(this,e),F(this,`options`,void 0),F(this,`parser`,void 0),this.options=t||Xa},[{key:`space`,value:function(e){return``}},{key:`code`,value:function(e){var t=e.text,n=e.lang,r=e.escaped,i=(n||``).match(to.notSpaceStart)?.[0],a=t.replace(to.endingNewline,``)+`
|
||
|
|
`;return i?`<pre><code class="language-`+Zo(i)+`">`+(r?a:Zo(a,!0))+`</code></pre>
|
||
|
|
`:`<pre><code>`+(r?a:Zo(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+` `+Zo(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>${Zo(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=Qo(t);if(a===null)return i;var o=`<a href="`+(t=a)+`"`;return n&&(o+=` title="`+Zo(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=Qo(t);if(a===null)return Zo(r);var o=`<img src="${t=a}" alt="${r}"`;return n&&(o+=` title="${Zo(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:Zo(e.text)}}]),as=N(function e(){M(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``}}]),os=function(){function e(t){M(this,e),F(this,`options`,void 0),F(this,`renderer`,void 0),F(this,`textRenderer`,void 0),this.options=t||Xa,this.options.renderer=this.options.renderer||new is,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new as}return N(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)}}])}(),ss=(qa=N(function e(t){M(this,e),F(this,`options`,void 0),F(this,`block`,void 0),this.options=t||Xa},[{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?rs.lex:rs.lexInline}},{key:`provideParser`,value:function(){return this.block?os.parse:os.parseInline}}]),F(qa,`passThroughHooks`,new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`])),F(qa,`passThroughHooksRespectAsync`,new Set([`preprocess`,`postprocess`,`processAllTokens`])),qa),cs=new(N(function e(){M(this,e),F(this,`defaults`,{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),F(this,`options`,this.setOptions),F(this,`parse`,this.parseMarkdown(!0)),F(this,`parseInline`,this.parseMarkdown(!1)),F(this,`Parser`,os),F(this,`Renderer`,is),F(this,`TextRenderer`,as),F(this,`Lexer`,rs),F(this,`Tokenizer`,ns),F(this,`Hooks`,ss),this.use.apply(this,arguments)},[{key:`walkTokens`,value:function(e,t){var n,r=this,i=[],a=P(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=P(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=P(o.rows);try{for(u.s();!(l=u.n()).done;){var d,f=P(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=L({},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
|
||
|
|
Please report this to https://github.com/markedjs/marked.`,e){var r=`<p>An error occurred:</p><pre>`+Zo(n.message+``,!0)+`</pre>`;return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}]));function ls(e,t){return cs.parse(e,t)}function us(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}ls.options=ls.setOptions=function(e){return cs.setOptions(e),ls.defaults=cs.defaults,Za(ls.defaults),ls},ls.getDefaults=function(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}},ls.defaults=Xa,ls.use=function(){return cs.use.apply(cs,arguments),ls.defaults=cs.defaults,Za(ls.defaults),ls},ls.walkTokens=function(e,t){return cs.walkTokens(e,t)},ls.parseInline=cs.parseInline,ls.Parser=os,ls.parser=os.parse,ls.Renderer=is,ls.TextRenderer=as,ls.Lexer=rs,ls.lexer=rs.lex,ls.Tokenizer=ns,ls.Hooks=ss,ls.parse=ls,ls.options,ls.setOptions,ls.use,ls.walkTokens,ls.parseInline,os.parse,rs.lex;var ds=new ls.Renderer;ds.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:us(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>
|
||
|
|
`},ds.link=function(e){var t=e.href,n=e.title,r=e.text,i=n?` title="${us(n)}"`:``;return`<a href="${t?us(t):``}"${i} target="_blank" rel="noopener noreferrer">${us(r)}</a>`};var fs=Dt(function(e){var t=e.content,n=e.copyButtonText,r=e.copyButtonCopiedText,i=e.isStreaming,a=at(function(){return ls.parse(t,{gfm:!0,breaks:!0,renderer:ds})},[t]),o=rt(null);return tt(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]),k.createElement(`div`,{ref:o,className:`DocSearch-Markdown-Content ${i?`DocSearch-Markdown-Content--streaming`:``}`,dangerouslySetInnerHTML:{__html:a}})});function ps(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 k.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer`},k.createElement(Aa,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),k.createElement(`span`,null,i));case`input-available`:return k.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer`},k.createElement(Aa,{className:`DocSearch-AskAiScreen-SmallerLoadingIcon`}),k.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 k.createElement(`div`,{className:`DocSearch-AskAiScreen-MessageContent-Tool Tool--Result`},k.createElement(tr,null),k.createElement(`span`,null,o,` `,r?k.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||``,`"`):k.createElement(`span`,{className:`DocSearch-AskAiScreen-MessageContent-Tool-Query`},` "`,s||``,`"`),` `,`found `,c,` results`));default:return null}}fs.displayName=`MemoizedMarkdown`;var ms=[`translations`];function hs(e){var t=e.disclaimerText;return k.createElement(`p`,{className:`DocSearch-AskAiScreen-Disclaimer`},t)}function gs(e){var t,n=e.exchange,r=e.askAiError,i=e.isLastExchange,a=e.loadingStatus,o=e.onSearchQueryClick,s=e.translations,c=e.conversations,l=e.onFeedback,u=e.agentStudio,d=n.userMessage,f=n.assistantMessage,p=s.stoppedStreamingText,m=p===void 0?`You stopped this response`:p,h=s.errorTitleText,g=h===void 0?`Chat error`:h,_=s.preToolCallText,v=_===void 0?`Searching...`:_,y=s.afterToolCallText,b=y===void 0?`Searched for`:y,x=s.duringToolCallText,S=x===void 0?`Searching...`:x,C=Yn(r,!!u),w=at(function(){return Kn(f)},[f]),T=at(function(){return Kn(d)},[d]),ee=k.useMemo(function(){return e=f,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=P(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=P(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},[f]),E=k.useMemo(function(){return function(e){for(var t=[],n=0;n<e.length;n++){var
|
||
|
|
Error message: ${ac(o)}`,cause:o}]))[dc]=!0,n.text=r,n}return d(e,ic),s(e,null,[{key:`isInstance`,value:function(e){return ic.hasMarker(e,pc)}}])}();dc=mc;var gc,_c=`AI_TypeValidationError`,vc=`vercel.ai.error.${_c}`;gc=Symbol.for(vc);var yc=function(){function e(t){var n,r=t.value,o=t.cause;return a(this,e),(n=i(this,e,[{name:_c,message:`Type validation failed: Value: ${JSON.stringify(r)}.
|
||
|
|
Error message: ${ac(o)}`,cause:o}]))[gc]=!0,n.value=r,n}return d(e,ic),s(e,null,[{key:`isInstance`,value:function(e){return ic.hasMarker(e,vc)}},{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})}}])}(),bc=function(){function e(t,n){var r;return M(this,e),(r=j(this,e,[t])).name=`ParseError`,r.type=n.type,r.field=n.field,r.value=n.value,r.line=n.line,r}return I(e,In(Error)),N(e)}();function xc(e){}var Sc=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 M(this,e),j(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?xc:n,i=e.onError,a=i===void 0?xc:i,o=e.onRetry,s=o===void 0?xc: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 bc(`Invalid \`retry\` value: "${n}"`,{type:`invalid-retry`,value:n,line:r}));break;default:a(new bc(`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=z(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=P(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 I(e,In(TransformStream)),N(e)}();function H(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 M(this,t),j(this,t,arguments)}return I(t,e),N(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=P(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 Cc=function(){function e(){return M(this,e),j(this,e,[`Encountered Promise during synchronous parse. Use .parseAsync() instead.`])}return I(e,In(Error)),N(e)}(),wc=function(){function e(t){var n;return M(this,e),(n=j(this,e,[`Encountered unidirectional transform during encode: ${t}`])).name=`ZodEncodeError`,n}return I(e,In(Error)),N(e)}(),Tc={};function Ec(e){return Tc}function Dc(e){var t=Object.values(e).filter(function(e){return typeof e==`number`});return Object.entries(e).filter(function(e){var n=z(e,2),r=n[0];return n[1],t.indexOf(+r)===-1}).map(function(e){var t=z(e,2);return t[0],t[1]})}function Oc(e,t){return typeof t==`bigint`?t.toString():t}function kc(e){return{get value(){var t=e();return Object.defineProperty(this,"value",{value:t}),t}}}function Ac(e){return e==null}function jc(e){var t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var Mc=Symbol(`evaluating`);function Nc(e,t,n){var r=void 0;Object.defineProperty(e,t,{get:function(){if(r!==Mc)return r===void 0&&(r=Mc,r=n()),r},set:function(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Pc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fc(){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 Ic(e){return JSON.stringify(e)}var Lc=`captureStackTrace`in Error?Error.captureStackTrace:function(){};function Rc(e){return Pn(e)===`object`&&e!==null&&!Array.isArray(e)}var zc=kc(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 Bc(e){if(!1===Rc(e))return!1;var t=e.constructor;if(t===void 0)return!0;var n=t.prototype;return!1!==Rc(n)&&!1!==Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)}function Vc(e){return Bc(e)?L({},e):Array.isArray(e)?B(e):e}var Hc=new Set([`string`,`number`,`symbol`]);function Uc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Wc(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 U(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`?L(L({},t),{},{error:function(){return t.error}}):t}var Gc={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,3402823
|
||
|
|
`).filter(function(e){return e}),i=Math.min.apply(Math,B(r.map(function(e){return e.length-e.trimStart().length}))),a=P(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=B(((this==null?void 0:this.content)??[``]).map(function(e){return` ${e}`}));return wn(e,B(t).concat([n.join(`
|
||
|
|
`)]))}}]),au={major:4,minor:1,patch:12},ou=H(`$ZodType`,function(e,t){var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=au;var r=B(e._zod.def.checks??[]);e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);var i,a=P(r);try{for(a.s();!(i=a.n()).done;){var o,s=P(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=Kc(e),o=P(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 Cc;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(A(R().m(function t(){return R().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||=Kc(e,o);case 3:return t.a(2)}},t)})));else{if(e.issues.length===o)return 0;a||=Kc(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(Kc(t))return t.aborted=!0,t;var a=l(n,r,i);if(a instanceof Promise){if(!1===i.async)throw new Cc;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:[]},L(L({},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 Cc;return a.then(function(e){return l(e,r,n)})}return l(a,r,n)}}e[`~standard`]={validate:function(t){try{var n=al(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return sl(e,t).then(function(e){return e.success?{value:e.data}:{issues:e.error?.issues}})}},vendor:`zod`,version:1}}),su=H(`$ZodString`,function(e,t){var n;ou.init(e,t),e._zod.pattern=B((e==null||(n=e._zod.bag)==null?void 0:n.patterns)??[]).pop()??function(e){var t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}\$`)}(e._zod.bag),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}}),cu=H(`$ZodStringFormat`,function(e,t){ql.init(e,t),su.init(e,t)}),lu=H(`$ZodGUID`,function(e,t){t.pattern??=hl,cu.init(e,t)}),uu=H(`$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??=gl(n)}else t.pattern??=gl();cu.init(e,t)}),du=H(`$ZodEmail`,function(e,t){t.pattern??=_l,cu.init(e,t)}),fu=H(`$ZodURL`,function(e,t){cu.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:wl.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})}}}),pu=H(`$ZodEmoji`,function(e,t){t.pattern??=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),cu.init(e,t)}),mu=H(`$ZodNanoID`,function(e,t){t.pattern??=pl,cu.init(e,t)}),hu=H(`$ZodCUID`,function(e,t){t.pattern??=cl,cu.init(e,t)}),gu=H(`$ZodCUID2`,function(e,t){t.pattern??=ll,cu.init(e,t)}),_u=H(`$ZodULID`,function(e,t){t.pattern??=ul,cu.init(e,t)}),vu=H(`$ZodXID`,function(e,t){t.pattern??=dl,cu.init(e,t)}),yu=H(`$ZodKSUID`,function(e,t){t.pattern??=fl,cu.init(e,t)}),bu=H(`$ZodISODateTime`,function(e,t){t.pattern??=functi
|
||
|
|
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?Uu([],f,u,d,r,e):u):i(u,d):(u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u)}});function Ku(e,t,n,r){var i,a=P(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!Kc(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 Yc(e,r,Ec())})})}),t)}var qu=H(`$ZodUnion`,function(e,t){ou.init(e,t),Nc(e._zod,`optin`,function(){return t.options.some(function(e){return e._zod.optin===`optional`})?`optional`:void 0}),Nc(e._zod,`optout`,function(){return t.options.some(function(e){return e._zod.optout===`optional`})?`optional`:void 0}),Nc(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)}))}),Nc(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 jc(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=P(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 Ku(t,i,e,a)}):Ku(c,i,e,a)}}),Ju=H(`$ZodDiscriminatedUnion`,function(e,t){qu.init(e,t);var n=e._zod.parse;Nc(e._zod,`propValues`,function(){var e,n={},r=P(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=z(s[o],2),l=c[0],u=c[1];n[l]||(n[l]=new Set);var d,f=P(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=kc(function(){var e,n=t.options,r=new Map,i=P(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=P(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(!Rc(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)}}),Yu=H(`$ZodIntersection`,function(e,t){ou.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=z(t,2),r=n[0],i=n[1];return Zu(e,r,i)}):Zu(e,i,a)}});function Xu(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Bc(e)&&Bc(t)){var n,r=Object.keys(t),i=Object.keys(e).filter(function(e){return r.indexOf(e)!==-1}),a=L(L({},e),t),o=P(i);try{for(o.s();!(n=o.n()).done;){var s=n.value,c=Xu(e[s],t[s]);if(!c.valid)return{valid:!1,mergeErrorPath:[s].concat(B(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=Xu(e[u],t[u]);if(!d.valid)return{valid:!1,mergeErrorPath:
|
||
|
|
|
||
|
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}}catch(e){c.e(e)}finally{c.f()}}var u,d=P(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=L({},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=P(B(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=P(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 Vd(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 Vd(r.element,n);case`object`:for(var i in r.shape)if(Vd(r.shape[i],n))return!0;return!1;case`union`:var a,o=P(r.options);try{for(o.s();!(a=o.n()).done;)if(Vd(a.value,n))return!0}catch(e){o.e(e)}finally{o.f()}return!1;case`intersection`:return Vd(r.left,n)||Vd(r.right,n);case`tuple`:var s,c=P(r.items);try{for(c.s();!(s=c.n()).done;)if(Vd(s.value,n))return!0}catch(e){c.e(e)}finally{c.f()}return!(!r.rest||!Vd(r.rest,n));case`record`:case`map`:return Vd(r.keyType,n)||Vd(r.valueType,n);case`set`:return Vd(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:case`default`:case`prefault`:return Vd(r.innerType,n);case`lazy`:return Vd(r.getter(),n);case`transform`:return!0;case`pipe`:return Vd(r.in,n)||Vd(r.out,n)}throw Error(`Unknown schema type: ${r.type}`)}var Hd=Object.freeze({__proto__:null,endsWith:Pd,gt:Cd,gte:wd,includes:Md,length:Od,lowercase:Ad,lt:xd,lte:Sd,maxLength:Ed,maxSize:function(e,t){return new Vl(L(L({check:`max_size`},U(t)),{},{maximum:e}))},mime:function(e,t){return new nu(L({check:`mime_type`,mime:e},U(t)))},minLength:Dd,minSize:function(e,t){return new Hl(L(L({check:`min_size`},U(t)),{},{minimum:e}))},multipleOf:Td,negative:function(e){return xd(0,e)},nonnegative:function(e){return wd(0,e)},nonpositive:function(e){return Sd(0,e)},normalize:Id,overwrite:Fd,positive:function(e){return Cd(0,e)},property:function(e,t,n){return new tu(L({check:`property`,property:e,schema:t},U(n)))},regex:kd,size:function(e,t){return new Ul(L(L({check:`size_equals`},U(t)),{},{size:e}))},startsWith:Nd,toLowerCase:Rd,toUpperCase:zd,trim:Ld,uppercase:jd}),Ud=H(`ZodISODateTime`,function(e,t){bu.init(e,t),uf.init(e,t)}),Wd=H(`ZodISODate`,function(e,t){xu.init(e,t),uf.init(e,t)}),Gd=H(`ZodISOTime`,function(e,t){Su.init(e,t),uf.init(e,t)}),Kd=H(`ZodISODuration`,function(e,t){Cu.init(e,t),uf.init(e,t)}),qd=H(`Zo
|
||
|
|
]))`;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 Nh(e,t){var n={type:`object`,additionalProperties:Lh(e.valueType._def,m(m({},t),{},{currentPath:[].concat(b(t.currentPath),[`additionalProperties`])}))??t.allowedAdditionalProperties};if(e.keyType?._def.typeName===$.ZodString&&e.keyType._def.checks?.length){var r=Dh(e.keyType._def,t);r.type;var i=h(r,hn);return m(m({},n),{},{propertyNames:i})}if(e.keyType?._def.typeName===$.ZodEnum)return m(m({},n),{},{propertyNames:{enum:e.keyType._def.values}});if(e.keyType?._def.typeName===$.ZodBranded&&e.keyType._def.type._def.typeName===$.ZodString&&e.keyType._def.type._def.checks?.length){var a=fh(e.keyType._def,t);a.type;var o=h(a,gn);return m(m({},n),{},{propertyNames:o})}return n}var Ph={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function Fh(e){try{return e.isOptional()}catch{return!0}}var Ih=function(e,t,n){switch(t){case $.ZodString:return Dh(e,n);case $.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 $.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=Fh(o),c=Lh(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 Lh(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 $.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 $.ZodBoolean:return{type:`boolean`};case $.ZodDate:return ph(e,n);case $.ZodUndefined:return{not:{}};case $.ZodNull:return{type:`null`};case $.ZodArray:return function(e,t){var n,r={type:`array`};return(n=e.type)!=null&&n._def&&e.type?._def?.typeName!==$.ZodAny&&(r.items=Lh(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 $.ZodUnion:case $.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 Ph&&(!e._def.checks||!e._def.checks.length)})){var r=n.reduce(function(e,t){var n=Ph[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`]);def
|
||
|
|
`||t===`\r`?(s(),r=2):i+=t),r===3&&i===`!--`&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}.bind(pe);function F_(e){if(e)return function(t){var n=e(t,{html:P_});return tn(n)?n:typeof n==`function`?n(t):typeof n==`string`?pe(`span`,null,n):n}}function I_(e){var t=e.container,n=e.environment,r=e.transformSearchClient,i=e.hitComponent,a=e.resultsFooterComponent,o=h(e,N_),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 Wt(pe(k_,m(m({},o),{},{ref:c,hitComponent:F_(i),resultsFooterComponent:F_(a),transformSearchClient:function(e){return e!=null&&e.addAlgoliaAgent&&e.addAlgoliaAgent(`docsearch.js`,C_),typeof r==`function`?r(e):e}})),s),l=!0,{open:function(){var e;(e=c.current)==null||e.open()},close:function(){var e;(e=c.current)==null||e.close()},openAskAi:function(e){var t;(t=c.current)==null||t.openAskAi(e)},get isReady(){return l},get isOpen(){var e;return(e=c.current?.isOpen)!=null&&e},destroy:function(){nn(s),l=!1}}}export{I_ as default};
|