UNPKG

@algolia/sitesearch

Version:

Opinionated site search modal for the web. Ships zero-build CDN bundles (JS + CSS) and a one-line init API. Powered by Algolia InstantSearch.

1 lines 465 kB
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SiteSearchAskAI={}))})(this,function(exports){Object.defineProperty(exports,`__esModule`,{value:!0});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),c=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},d=(e,r,i)=>(i=e==null?{}:t(a(e)),u(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),f=e=>u(n({},`__esModule`,{value:!0}),e);function p(e,t){for(var n in t)e[n]=t[n];return e}function m(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function h(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?be.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return g(e,o,r,i,null)}function g(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??++xe,__i:-1,__u:0};return i==null&&w.vnode!=null&&w.vnode(a),a}function _(){return{current:null}}function v(e){return e.children}function y(e,t){this.props=e,this.context=t}function b(e,t){if(t==null)return e.__?b(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`?b(e):null}function x(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return x(e)}}function S(e){(!e.__d&&(e.__d=!0)&&Ce.push(e)&&!C.__r++||we!=w.debounceRendering)&&((we=w.debounceRendering)||Te)(C)}function C(){for(var e,t,n,r,i,a,o,s=1;Ce.length;)Ce.length>s&&Ce.sort(Ee),e=Ce.shift(),s=Ce.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,a=[],o=[],t.__P&&((n=p({},r)).__v=r.__v+1,w.vnode&&w.vnode(n),ce(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,a,i??b(r),!!(32&r.__u),o),n.__v=r.__v,n.__.__k[n.__i]=n,ue(a,n,o),r.__e=r.__=null,n.__e!=i&&x(n)));C.__r=0}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=r&&r.__k||Ne,y=t.length;for(c=te(n,t,v,c,y),d=0;d<y;d++)(p=n.__k[d])!=null&&(f=p.__i==-1?Me:v[p.__i]||Me,p.__i=d,g=ce(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&pe(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(_=!!(4&p.__u))||f.__k===p.__k?c=ne(p,c,e,_):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function te(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?g(null,o,null,null,null):Fe(o)?g(v,{children:o},null,null,null):o.constructor==null&&o.__b>0?g(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=ie(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=b(s)),me(s,s));return r}function ne(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=ne(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=b(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function re(e,t){return t||=[],e==null||typeof e==`boolean`||(Fe(e)?e.some(function(e){re(e,t)}):t.push(e)),t}function ie(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ae(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||Pe.test(t)?n:n+`px`}function oe(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ae(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ae(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(De,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n.u=r.u:(n.u=Oe,e.addEventListener(t,a?Ae:ke,a)):e.removeEventListener(t,a?Ae:ke,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function se(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=Oe++;else if(t.t<n.u)return;return n(w.event?w.event(t):t)}}}function ce(e,t,n,r,i,a,o,s,c,l){var u,d,f,h,g,_,b,x,S,C,te,ne,re,ie,ae,oe,se,ce=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),a=[s=t.__e=n.__e]),(u=w.__b)&&u(t);n:if(typeof ce==`function`)try{if(x=t.props,S=`prototype`in ce&&ce.prototype.render,C=(u=ce.contextType)&&r[u.__c],te=u?C?C.props.value:u.__:r,n.__c?b=(d=t.__c=n.__c).__=d.__E:(S?t.__c=d=new ce(x,te):(t.__c=d=new y(x,te),d.constructor=ce,d.render=he),C&&C.sub(d),d.props=x,d.state||={},d.context=te,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),S&&d.__s==null&&(d.__s=d.state),S&&ce.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=p({},d.__s)),p(d.__s,ce.getDerivedStateFromProps(x,d.__s))),h=d.props,g=d.state,d.__v=t,f)S&&ce.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),S&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(S&&ce.getDerivedStateFromProps==null&&x!==h&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,te),!d.__e&&d.shouldComponentUpdate!=null&&!1===d.shouldComponentUpdate(x,d.__s,te)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),ne=0;ne<d._sb.length;ne++)d.__h.push(d._sb[ne]);d._sb=[],d.__h.length&&o.push(d);break n}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,te),S&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(h,g,_)})}if(d.context=te,d.props=x,d.__P=e,d.__e=!1,re=w.__r,ie=0,S){for(d.state=d.__s,d.__d=!1,re&&re(t),u=d.render(d.props,d.state,d.context),ae=0;ae<d._sb.length;ae++)d.__h.push(d._sb[ae]);d._sb=[]}else do d.__d=!1,re&&re(t),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++ie<25);d.state=d.__s,d.getChildContext!=null&&(r=p(p({},r),d.getChildContext())),S&&!f&&d.getSnapshotBeforeUpdate!=null&&(_=d.getSnapshotBeforeUpdate(h,g)),oe=u,u!=null&&u.type===v&&u.key==null&&(oe=de(u.props.children)),s=ee(e,Fe(oe)?oe:[oe],t,n,r,i,a,o,s,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),b&&(d.__E=d.__=null)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(t.__u|=c?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__e=s}else{for(se=a.length;se--;)m(a[se]);le(t)}else t.__e=n.__e,t.__k=n.__k,e.then||le(t);w.__e(e,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):s=t.__e=fe(n.__e,t,n,r,i,a,o,c,l);return(u=w.diffed)&&u(t),128&t.__u?void 0:s}function le(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(le)}function ue(e,t,n){for(var r=0;r<n.length;r++)pe(n[r],n[++r],n[++r]);w.__c&&w.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){w.__e(e,t.__v)}})}function de(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Fe(e)?e.map(de):p({},e)}function fe(e,t,n,r,i,a,o,s,c){var l,u,d,f,p,h,g,_=n.props,v=t.props,y=t.type;if(y==`svg`?i=`http://www.w3.org/2000/svg`:y==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(l=0;l<a.length;l++)if((p=a[l])&&`setAttribute`in p==!!y&&(y?p.localName==y:p.nodeType==3)){e=p,a[l]=null;break}}if(e==null){if(y==null)return document.createTextNode(v);e=document.createElementNS(i,y,v.is&&v),s&&(w.__m&&w.__m(t,a),s=!1),a=null}if(y==null)_===v||s&&e.data==v||(e.data=v);else{if(a&&=be.call(e.childNodes),_=n.props||Me,!s&&a!=null)for(_={},l=0;l<e.attributes.length;l++)_[(p=e.attributes[l]).name]=p.value;for(l in _)if(p=_[l],l!=`children`){if(l==`dangerouslySetInnerHTML`)d=p;else if(!(l in v)){if(l==`value`&&`defaultValue`in v||l==`checked`&&`defaultChecked`in v)continue;oe(e,l,null,p,i)}}for(l in v)p=v[l],l==`children`?f=p:l==`dangerouslySetInnerHTML`?u=p:l==`value`?h=p:l==`checked`?g=p:s&&typeof p!=`function`||_[l]===p||oe(e,l,p,_[l],i);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=``),ee(t.type==`template`?e.content:e,Fe(f)?f:[f],t,n,r,y==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&b(n,0),s,c),a!=null)for(l=a.length;l--;)m(a[l]);s||(l=`value`,y==`progress`&&h==null?e.removeAttribute(`value`):h!=null&&(h!==e[l]||y==`progress`&&!h||y==`option`&&h!=_[l])&&oe(e,l,h,_[l],i),l=`checked`,g!=null&&g!=e[l]&&oe(e,l,g,_[l],i))}return e}function pe(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){w.__e(e,n)}}function me(e,t,n){var r,i;if(w.unmount&&w.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||pe(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){w.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&me(r[i],t,n||typeof e.type!=`function`);n||m(e.__e),e.__c=e.__=e.__e=void 0}function he(e,t,n){return this.constructor(e,n)}function ge(e,t,n){var r,i,a,o;t==document&&(t=document.documentElement),w.__&&w.__(e,t),i=(r=typeof n==`function`)?null:n&&n.__k||t.__k,a=[],o=[],ce(t,e=(!r&&n||t).__k=h(v,null,[e]),i||Me,Me,t.namespaceURI,!r&&n?[n]:i?null:t.firstChild?be.call(t.childNodes):null,a,!r&&n?n:i?i.__e:t.firstChild,r,o),ue(a,e,o)}function _e(e,t){ge(e,t,_e)}function ve(e,t,n){var r,i,a,o,s=p({},e.props);for(a in e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)a==`key`?r=t[a]:a==`ref`?i=t[a]:s[a]=t[a]===void 0&&o!=null?o[a]:t[a];return arguments.length>2&&(s.children=arguments.length>3?be.call(arguments,2):n),g(e.type,s,r||e.key,i||e.ref,null)}function ye(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,S(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ je++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}var be,w,xe,Se,Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie=s(()=>{Me={},Ne=[],Pe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Fe=Array.isArray,be=Ne.slice,w={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},xe=0,Se=function(e){return e!=null&&e.constructor==null},y.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=p({},this.state),typeof e==`function`&&(e=e(p({},n),this.props)),e&&p(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),S(this))},y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),S(this))},y.prototype.render=v,Ce=[],Te=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ee=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,De=/(PointerCapture)$|Capture$/i,Oe=0,ke=se(!1),Ae=se(!0),je=0});function Le(){function e(e){return new Promise(t=>{let n=new XMLHttpRequest;n.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>n.setRequestHeader(t,e.headers[t]));let r=(e,r)=>setTimeout(()=>{n.abort(),t({status:0,content:r,isTimedOut:!0})},e),i=r(e.connectTimeout,`Connection timeout`),a;n.onreadystatechange=()=>{n.readyState>n.OPENED&&a===void 0&&(clearTimeout(i),a=r(e.responseTimeout,`Socket timeout`))},n.onerror=()=>{n.status===0&&(clearTimeout(i),clearTimeout(a),t({content:n.responseText||`Network request failed`,status:n.status,isTimedOut:!1}))},n.onload=()=>{clearTimeout(i),clearTimeout(a),t({content:n.responseText,status:n.status,isTimedOut:!1})},n.send(e.data)})}return{send:e}}function Re(e){let t,n=`algolia-client-js-${e.key}`;function r(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function i(){return JSON.parse(r().getItem(n)||`{}`)}function a(e){r().setItem(n,JSON.stringify(e))}function o(){let t=e.timeToLive?e.timeToLive*1e3:null,n=i(),r=Object.fromEntries(Object.entries(n).filter(([,e])=>e.timestamp!==void 0));if(a(r),!t)return;let o=Object.fromEntries(Object.entries(r).filter(([,e])=>{let n=new Date().getTime(),r=e.timestamp+t<n;return!r}));a(o)}return{get(e,t,n={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(o(),i()[JSON.stringify(e)])).then(e=>Promise.all([e?e.value:t(),e!==void 0])).then(([e,t])=>Promise.all([e,t||n.miss(e)])).then(([e])=>e)},set(e,t){return Promise.resolve().then(()=>{let a=i();return a[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},r().setItem(n,JSON.stringify(a)),t})},delete(e){return Promise.resolve().then(()=>{let t=i();delete t[JSON.stringify(e)],r().setItem(n,JSON.stringify(t))})},clear(){return Promise.resolve().then(()=>{r().removeItem(n)})}}}function ze(){return{get(e,t,n={miss:()=>Promise.resolve()}){let r=t();return r.then(e=>Promise.all([e,n.miss(e)])).then(([e])=>e)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function Be(e){let t=[...e.caches],n=t.shift();return n===void 0?ze():{get(e,r,i={miss:()=>Promise.resolve()}){return n.get(e,r,i).catch(()=>Be({caches:t}).get(e,r,i))},set(e,r){return n.set(e,r).catch(()=>Be({caches:t}).set(e,r))},delete(e){return n.delete(e).catch(()=>Be({caches:t}).delete(e))},clear(){return n.clear().catch(()=>Be({caches:t}).clear())}}}function Ve(e={serializable:!0}){let t={};return{get(n,r,i={miss:()=>Promise.resolve()}){let a=JSON.stringify(n);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);let o=r();return o.then(e=>i.miss(e)).then(()=>o)},set(n,r){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function He(e){let t={value:`Algolia for JavaScript (${e})`,add(e){let n=`; ${e.segment}${e.version===void 0?``:` (${e.version})`}`;return t.value.indexOf(n)===-1&&(t.value=`${t.value}${n}`),t}};return t}function Ue(e,t,n=`WithinHeaders`){let r={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return n===`WithinHeaders`?r:{}},queryParameters(){return n===`WithinQueryParameters`?r:{}}}}function We({algoliaAgents:e,client:t,version:n}){let r=He(n).add({segment:t,version:n});return e.forEach(e=>r.add(e)),r}function Ge(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Ke=2*60*1e3;function qe(e,t=`up`){let n=Date.now();function r(){return t===`up`||Date.now()-n>Ke}function i(){return t===`timed out`&&Date.now()-n<=Ke}return{...e,status:t,lastUpdate:n,isUp:r,isTimedOut:i}}var Je=class extends Error{name=`AlgoliaError`;constructor(e,t){super(e),t&&(this.name=t)}},Ye=class extends Je{stackTrace;constructor(e,t,n){super(e,n),this.stackTrace=t}},Xe=class extends Ye{constructor(e){super(`Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support`,e,`RetryError`)}},Ze=class extends Ye{status;constructor(e,t,n,r=`ApiError`){super(e,n,r),this.status=t}},Qe=class extends Je{response;constructor(e,t){super(e,`DeserializationError`),this.response=t}},$e=class extends Ze{error;constructor(e,t,n,r){super(e,t,r,`DetailedApiError`),this.error=n}};function et(e){let t=e;for(let n=e.length-1;n>0;n--){let r=Math.floor(Math.random()*(n+1)),i=e[n];t[n]=e[r],t[r]=i}return t}function tt(e,t,n){let r=nt(n),i=`${e.protocol}://${e.url}${e.port?`:${e.port}`:``}/${t.charAt(0)===`/`?t.substring(1):t}`;return r.length&&(i+=`?${r}`),i}function nt(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])===`[object Array]`?e[t].join(`,`):e[t]).replace(/\+/g,`%20`)}`).join(`&`)}function rt(e,t){if(e.method===`GET`||e.data===void 0&&t.data===void 0)return;let n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}function it(e,t,n){let r={Accept:`application/json`,...e,...t,...n},i={};return Object.keys(r).forEach(e=>{let t=r[e];i[e.toLowerCase()]=t}),i}function at(e){try{return JSON.parse(e.content)}catch(t){throw new Qe(t.message,e)}}function ot({content:e,status:t},n){try{let r=JSON.parse(e);return`error`in r?new $e(r.message,t,r.error,n):new Ze(r.message,t,n)}catch{}return new Ze(e,t,n)}function st({isTimedOut:e,status:t}){return!e&&~~t===0}function ct({isTimedOut:e,status:t}){return e||st({isTimedOut:e,status:t})||~~(t/100)!=2&&~~(t/100)!=4}function lt({status:e}){return~~(e/100)==2}function ut(e){return e.map(e=>dt(e))}function dt(e){let t=e.request.headers[`x-algolia-api-key`]?{"x-algolia-api-key":`*****`}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function ft({hosts:e,hostsCache:t,baseHeaders:n,logger:r,baseQueryParameters:i,algoliaAgent:a,timeouts:o,requester:s,requestsCache:c,responsesCache:l}){async function u(e){let n=await Promise.all(e.map(e=>t.get(e,()=>Promise.resolve(qe(e))))),r=n.filter(e=>e.isUp()),i=n.filter(e=>e.isTimedOut()),a=[...r,...i],o=a.length>0?a:e;return{hosts:o,getTimeout(e,t){let n=i.length===0&&e===0?1:i.length+3+e;return n*t}}}async function d(c,l,d=!0){let f=[],p=rt(c,l),m=it(n,c.headers,l.headers),h=c.method===`GET`?{...c.data,...l.data}:{},g={...i,...c.queryParameters,...h};if(a.value&&(g[`x-algolia-agent`]=a.value),l&&l.queryParameters)for(let e of Object.keys(l.queryParameters))!l.queryParameters[e]||Object.prototype.toString.call(l.queryParameters[e])===`[object Object]`?g[e]=l.queryParameters[e]:g[e]=l.queryParameters[e].toString();let _=0,v=async(e,n)=>{let i=e.pop();if(i===void 0)throw new Xe(ut(f));let a={...o,...l.timeouts},u={data:p,headers:m,method:c.method,url:tt(i,c.path,g),connectTimeout:n(_,a.connect),responseTimeout:n(_,d?a.read:a.write)},h=t=>{let n={request:u,response:t,host:i,triesLeft:e.length};return f.push(n),n},y=await s.send(u);if(ct(y)){let a=h(y);return y.isTimedOut&&_++,r.info(`Retryable failure`,dt(a)),await t.set(i,qe(i,y.isTimedOut?`timed out`:`down`)),v(e,n)}if(lt(y))return at(y);throw h(y),ot(y,f)},y=e.filter(e=>e.accept===`readWrite`||(d?e.accept===`read`:e.accept===`write`)),b=await u(y);return v([...b.hosts].reverse(),b.getTimeout)}function f(e,t={}){let r=e.useReadTransporter||e.method===`GET`;if(!r)return d(e,t,r);let a=()=>d(e,t),o=t.cacheable||e.cacheable;if(o!==!0)return a();let s={request:e,requestOptions:t,transporter:{queryParameters:i,headers:n}};return l.get(s,()=>c.get(s,()=>c.set(s,a()).then(e=>Promise.all([c.delete(s),e]),e=>Promise.all([c.delete(s),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>l.set(s,e)})}return{hostsCache:t,requester:s,timeouts:o,logger:r,algoliaAgent:a,baseHeaders:n,baseQueryParameters:i,hosts:e,request:f,requestsCache:c,responsesCache:l}}var pt=`5.40.0`;function mt(e){return[{url:`${e}-dsn.algolia.net`,accept:`read`,protocol:`https`},{url:`${e}.algolia.net`,accept:`write`,protocol:`https`}].concat(et([{url:`${e}-1.algolianet.com`,accept:`readWrite`,protocol:`https`},{url:`${e}-2.algolianet.com`,accept:`readWrite`,protocol:`https`},{url:`${e}-3.algolianet.com`,accept:`readWrite`,protocol:`https`}]))}function ht({appId:e,apiKey:t,authMode:n,algoliaAgents:r,...i}){let a=Ue(e,t,n),o=ft({hosts:mt(e),...i,algoliaAgent:We({algoliaAgents:r,client:`Lite`,version:pt}),baseHeaders:{"content-type":`text/plain`,...a.headers(),...i.baseHeaders},baseQueryParameters:{...a.queryParameters(),...i.baseQueryParameters}});return{transporter:o,appId:e,apiKey:t,clearCache(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>void 0)},get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,t){o.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!n||n===`WithinHeaders`?o.baseHeaders[`x-algolia-api-key`]=e:o.baseQueryParameters[`x-algolia-api-key`]=e},searchForHits(e,t){return this.search(e,t)},searchForFacets(e,t){return this.search(e,t)},customPost({path:e,parameters:t,body:n},r){if(!e)throw Error("Parameter `path` is required when calling `customPost`.");let i=`/{path}`.replace(`{path}`,e),a={},s=t||{},c={method:`POST`,path:i,queryParameters:s,headers:a,data:n||{}};return o.request(c,r)},getRecommendations(e,t){if(e&&Array.isArray(e)){let t={requests:e};e=t}if(!e)throw Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");let n=`/1/indexes/*/recommendations`,r={},i={},a={method:`POST`,path:n,queryParameters:i,headers:r,data:e,useReadTransporter:!0,cacheable:!0};return o.request(a,t)},search(e,t){if(e&&Array.isArray(e)){let t={requests:e.map(({params:e,...t})=>t.type===`facet`?{...t,...e,type:`facet`}:{...t,...e,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})};e=t}if(!e)throw Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw Error("Parameter `searchMethodParams.requests` is required when calling `search`.");let n=`/1/indexes/*/queries`,r={},i={},a={method:`POST`,path:n,queryParameters:i,headers:r,data:e,useReadTransporter:!0,cacheable:!0};return o.request(a,t)}}}function gt(e,t,n){if(!e||typeof e!=`string`)throw Error("`appId` is missing.");if(!t||typeof t!=`string`)throw Error("`apiKey` is missing.");return ht({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:Ge(),requester:Le(),algoliaAgents:[{segment:`Browser`}],authMode:`WithinQueryParameters`,responsesCache:Ve(),requestsCache:Ve({serializable:!1}),hostsCache:Be({caches:[Re({key:`${pt}-${e}`}),Ve()]}),...n})}function _t(e,t){Bt.__h&&Bt.__h(E,e,Rt||t),Rt=0;var n=E.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function vt(e){return Rt=1,yt(Pt,e)}function yt(e,t,n){var r=_t(Ft++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Pt(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=E,!E.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};E.__f=!0;var a=E.shouldComponentUpdate,o=E.componentWillUpdate;E.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},E.shouldComponentUpdate=i}return r.__N||r.__}function T(e,t){var n=_t(Ft++,3);!Bt.__s&&Nt(n.__H,t)&&(n.__=e,n.u=t,E.__H.__h.push(n))}function bt(e,t){var n=_t(Ft++,4);!Bt.__s&&Nt(n.__H,t)&&(n.__=e,n.u=t,E.__h.push(n))}function xt(e){return Rt=5,Ct(function(){return{current:e}},[])}function St(e,t,n){Rt=6,bt(function(){if(typeof e==`function`){var n=e(t());return function(){e(null),n&&typeof n==`function`&&n()}}if(e)return e.current=t(),function(){return e.current=null}},n==null?n:n.concat(e))}function Ct(e,t){var n=_t(Ft++,7);return Nt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function wt(e,t){return Rt=8,Ct(function(){return e},t)}function Tt(e){var t=E.context[e.__c],n=_t(Ft++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(E)),t.props.value):e.__}function Et(e,t){Bt.useDebugValue&&Bt.useDebugValue(t?t(e):e)}function Dt(e){var t=_t(Ft++,10),n=vt();return t.__=e,E.componentDidCatch||=function(e,r){t.__&&t.__(e,r),n[1](e)},[n[0],function(){n[1](void 0)}]}function Ot(){var e=_t(Ft++,11);if(!e.__){for(var t=E.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||=[0,0];e.__=`P`+n[0]+`-`+ n[1]++}return e.__}function kt(){for(var e;e=zt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(jt),e.__H.__h.forEach(Mt),e.__H.__h=[]}catch(t){e.__H.__h=[],Bt.__e(t,e.__v)}}function At(e){var t,n=function(){clearTimeout(r),qt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);qt&&(t=requestAnimationFrame(n))}function jt(e){var t=E,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),E=t}function Mt(e){var t=E;e.__c=e.__(),E=t}function Nt(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Pt(e,t){return typeof t==`function`?t(e):t}var Ft,E,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt=s(()=>{Ie(),Rt=0,zt=[],Bt=w,Vt=Bt.__b,Ht=Bt.__r,Ut=Bt.diffed,Wt=Bt.__c,Gt=Bt.unmount,Kt=Bt.__,Bt.__b=function(e){E=null,Vt&&Vt(e)},Bt.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Kt&&Kt(e,t)},Bt.__r=function(e){Ht&&Ht(e),Ft=0;var t=(E=e.__c).__H;t&&(It===E?(t.__h=[],E.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(jt),t.__h.forEach(Mt),t.__h=[],Ft=0)),It=E},Bt.diffed=function(e){Ut&&Ut(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zt.push(t)!==1&&Lt===Bt.requestAnimationFrame||((Lt=Bt.requestAnimationFrame)||At)(kt)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),It=E=null},Bt.__c=function(e,t){t.some(function(e){try{e.__h.forEach(jt),e.__h=e.__h.filter(function(e){return!e.__||Mt(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Bt.__e(n,e.__v)}}),Wt&&Wt(e,t)},Bt.unmount=function(e){Gt&&Gt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{jt(e)}catch(e){t=e}}),n.__H=void 0,t&&Bt.__e(t,n.__v))},qt=typeof requestAnimationFrame==`function`}),Yt={};l(Yt,{Children:()=>Mn,Component:()=>y,Fragment:()=>v,PureComponent:()=>rn,StrictMode:()=>Qn,Suspense:()=>ln,SuspenseList:()=>fn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>Jn,cloneElement:()=>Tn,createContext:()=>ye,createElement:()=>h,createFactory:()=>xn,createPortal:()=>hn,createRef:()=>_,default:()=>er,findDOMNode:()=>Dn,flushSync:()=>Zn,forwardRef:()=>on,hydrate:()=>_n,isElement:()=>$n,isFragment:()=>Cn,isMemo:()=>wn,isValidElement:()=>Sn,lazy:()=>dn,memo:()=>an,render:()=>gn,startTransition:()=>en,unmountComponentAtNode:()=>En,unstable_batchedUpdates:()=>Xn,useCallback:()=>wt,useContext:()=>Tt,useDebugValue:()=>Et,useDeferredValue:()=>tn,useEffect:()=>T,useErrorBoundary:()=>Dt,useId:()=>Ot,useImperativeHandle:()=>St,useInsertionEffect:()=>On,useLayoutEffect:()=>bt,useMemo:()=>Ct,useReducer:()=>yt,useRef:()=>xt,useState:()=>vt,useSyncExternalStore:()=>Qt,useTransition:()=>nn,version:()=>Yn});function Xt(e,t){for(var n in t)e[n]=t[n];return e}function Zt(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function Qt(e,t){var n=t(),r=vt({t:{__:n,u:t}}),i=r[0].t,a=r[1];return bt(function(){i.__=n,i.u=t,$t(i)&&a({t:i})},[e,n,t]),T(function(){return $t(i)&&a({t:i}),e(function(){$t(i)&&a({t:i})})},[e]),n}function $t(e){var t,n,r=e.u,i=e.__;try{var a=r();return!((t=i)===(n=a)&&(t!==0||1/t==1/n)||t!=t&&n!=n)}catch{return!0}}function en(e){e()}function tn(e){return e}function nn(){return[!1,en]}function rn(e,t){this.props=e,this.context=t}function an(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Zt(this.props,e)}function r(t){return this.shouldComponentUpdate=n,h(e,t)}return r.displayName=`Memo(`+(e.displayName||e.name)+`)`,r.prototype.isReactComponent=!0,r.__f=!0,r.type=e,r}function on(e){function t(t){var n=Xt({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=An,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t}function sn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=Xt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return sn(e,t,n)})),e}function cn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return cn(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function ln(){this.__u=0,this.o=null,this.__b=null}function un(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function dn(e){var t,n,r;function i(i){if(t||(t=e()).then(function(e){n=e.default||e},function(e){r=e}),r)throw r;if(!n)throw t;return h(n,i)}return i.displayName=`Lazy`,i.__f=!0,i}function fn(){this.i=null,this.l=null}function pn(e){return this.getChildContext=function(){return e.context},e.children}function mn(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){ge(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}ge(h(pn,{context:t.context},e.__v),t.v)}function hn(e,t){var n=h(mn,{__v:e,h:t});return n.containerInfo=t,n}function gn(e,t,n){return t.__k??(t.textContent=``),ge(e,t),typeof n==`function`&&n(),e?e.__c:null}function _n(e,t,n){return _e(e,t),typeof n==`function`&&n(),e?e.__c:null}function vn(){}function yn(){return this.cancelBubble}function bn(){return this.defaultPrevented}function xn(e){return h.bind(null,e)}function Sn(e){return!!e&&e.$$typeof===In}function Cn(e){return Sn(e)&&e.type===v}function wn(e){return!!e&&!!e.displayName&&(typeof e.displayName==`string`||e.displayName instanceof String)&&e.displayName.startsWith(`Memo(`)}function Tn(e){return Sn(e)?ve.apply(null,arguments):e}function En(e){return!!e.__k&&(ge(null,e),!0)}function Dn(e){return e&&(e.base||e.nodeType===1&&e)||null}var On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,D=s(()=>{Ie(),Jt(),Jt(),On=bt,(rn.prototype=new y).isPureReactComponent=!0,rn.prototype.shouldComponentUpdate=function(e,t){return Zt(this.props,e)||Zt(this.state,t)},kn=w.__b,w.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),kn&&kn(e)},An=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.forward_ref`)||3911,jn=function(e,t){return e==null?null:re(re(e).map(t))},Mn={map:jn,forEach:jn,count:function(e){return e?re(e).length:0},only:function(e){var t=re(e);if(t.length!==1)throw`Children.only`;return t[0]},toArray:re},Nn=w.__e,w.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}Nn(e,t,n,r)},Pn=w.unmount,w.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pn&&Pn(e)},(ln.prototype=new y).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=un(r.__v),a=!1,o=function(){a||(a=!0,n.__R=null,i?i(s):s())};n.__R=o;var s=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=cn(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},ln.prototype.componentWillUnmount=function(){this.o=[]},ln.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=sn(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&h(v,null,e.fallback);return i&&(i.__u&=-33),[h(v,null,t.__a?null:e.children),i]},Fn=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}},(fn.prototype=new y).__a=function(e){var t=this,n=un(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Fn(t,e,r)):i()};n?n(a):a()}},fn.prototype.render=function(e){this.i=null,this.l=new Map;var t=re(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},fn.prototype.componentDidUpdate=fn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Fn(e,n,t)})},In=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Ln=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Rn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,zn=/[A-Z0-9]/g,Bn=typeof document<`u`,Vn=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)},y.prototype.isReactComponent={},[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(y.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}),Hn=w.event,w.event=function(e){return Hn&&(e=Hn(e)),e.persist=vn,e.isPropagationStopped=yn,e.isDefaultPrevented=bn,e.nativeEvent=e},Wn={enumerable:!1,configurable:!0,get:function(){return this.class}},Gn=w.vnode,w.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)===-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Bn&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||Vn(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Rn.test(a)&&(a=s):s=a=`oninput`:i&&Ln.test(a)?a=a.replace(zn,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&r.multiple&&Array.isArray(r.value)&&(r.value=re(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),n==`select`&&r.defaultValue!=null&&(r.value=re(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,Wn)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=In,Gn&&Gn(e)},Kn=w.__r,w.__r=function(e){Kn&&Kn(e),Un=e.__c},qn=w.diffed,w.diffed=function(e){qn&&qn(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value),Un=null},Jn={ReactCurrentDispatcher:{current:{readContext:function(e){return Un.__n[e.__c].props.value},useCallback:wt,useContext:Tt,useDebugValue:Et,useDeferredValue:tn,useEffect:T,useId:Ot,useImperativeHandle:St,useInsertionEffect:On,useLayoutEffect:bt,useMemo:Ct,useReducer:yt,useRef:xt,useState:vt,useSyncExternalStore:Qt,useTransition:nn}}},Yn=`18.3.1`,Xn=function(e,t){return e(t)},Zn=function(e,t){return e(t)},Qn=v,$n=Sn,er={useState:vt,useId:Ot,useReducer:yt,useEffect:T,useLayoutEffect:bt,useInsertionEffect:On,useTransition:nn,useDeferredValue:tn,useSyncExternalStore:Qt,startTransition:en,useRef:xt,useImperativeHandle:St,useMemo:Ct,useCallback:wt,useContext:Tt,useDebugValue:Et,version:`18.3.1`,Children:Mn,render:gn,hydrate:_n,unmountComponentAtNode:En,createPortal:hn,createElement:h,createContext:ye,createFactory:xn,cloneElement:Tn,createRef:_,Fragment:v,isValidElement:Sn,isElement:$n,isFragment:Cn,isMemo:wn,findDOMNode:Dn,Component:y,PureComponent:rn,memo:an,forwardRef:on,flushSync:Zn,unstable_batchedUpdates:Xn,StrictMode:Qn,Suspense:ln,SuspenseList:fn,lazy:dn,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Jn}}),tr=`7.16.3`,nr=c((exports,t)=>{function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}t.exports=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError(`n must be a positive number`);return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,c,l;if(this._events||={},e===`error`&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var u=Error(`Uncaught, unspecified "error" event. (`+t+`)`);throw u.context=t,u}if(n=this._events[e],o(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(a(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,c=0;c<i;c++)l[c].apply(this,s);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError(`listener must be a function`);return this._events||={},this._events.newListener&&this.emit(`newListener`,e,r(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(i=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error(`(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.`,this._events[e].length),typeof console.trace==`function`&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){if(!r(t))throw TypeError(`listener must be a function`);var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var n,i,o,s;if(!r(t))throw TypeError(`listener must be a function`);if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit(`removeListener`,e,t);else if(a(n)){for(s=o;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;n.length===1?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit(`removeListener`,e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events){if(t===`removeListener`)continue;this.removeAllListeners(t)}return this.removeAllListeners(`removeListener`),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=!this._events||!this._events[e]?[]:r(this._events[e])?[this._events[e]]:this._events[e].slice(),t},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)};function r(e){return typeof e==`function`}function i(e){return typeof e==`number`}function a(e){return typeof e==`object`&&!!e}function o(e){return e===void 0}}),rr=c((exports,t)=>{function n(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}t.exports=n}),ir=c((exports,t)=>{var n=nr(),r=rr();function i(e,t,n){this.main=e,this.fn=t,this.recommendFn=n,this.lastResults=null,this.lastRecommendResults=null}r(i,n),i.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},i.prototype.getModifiedState=function(e){return this.fn(e)},i.prototype.getModifiedRecommendState=function(e){return this.recommendFn(e)},t.exports=i}),ar=c((exports,t)=>{function n(e){return typeof e==`string`?String(e).replace(/^-/,`\\-`):e}function r(e){return typeof e==`string`?e.replace(/^\\-/,`-`):e}t.exports={escapeFacetValue:n,unescapeFacetValue:r}}),or=c((exports,t)=>{function n(e){return typeof e==`object`&&e?i(Array.isArray(e)?[]:{},e):e}function r(e){return typeof e==`function`||Array.isArray(e)||Object.prototype.toString.call(e)===`[object Object]`}function i(e,t){if(e===t)return e;for(var a in t){if(!Object.prototype.hasOwnProperty.call(t,a)||a===`__proto__`||a===`constructor`)continue;var o=t[a],s=e[a];if(s!==void 0&&o===void 0)continue;r(s)&&r(o)?e[a]=i(s,o):e[a]=n(o)}return e}function a(e){r(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var a=arguments[t];r(a)&&i(e,a)}return e}t.exports=a}),sr=c((exports,t)=>{function n(e){return e&&Object.keys(e).length>0}t.exports=n}),cr=c((exports,t)=>{function n(e,t){if(e===null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}t.exports=n}),lr=c((exports,t)=>{function n(e){e||={},this.params=e.params||[]}n.prototype={constructor:n,addParams:function(e){var t=this.params.slice();return t.push(e),new n({params:t})},removeParams:function(e){return new n({params:this.params.filter(function(t){return t.$$id!==e})})},addFrequentlyBoughtTogether:function(e){return this.addParams(Object.assign({},e,{model:`bought-together`}))},addRelatedProducts:function(e){return this.addParams(Object.assign({},e,{model:`related-products`}))},addTrendingItems:function(e){return this.addParams(Object.assign({},e,{model:`trending-items`}))},addTrendingFacets:function(e){return this.addParams(Object.assign({},e,{model:`trending-facets`}))},addLookingSimilar:function(e){return this.addParams(Object.assign({},e,{model:`looking-similar`}))},_buildQueries:function(e,t){return this.params.filter(function(e){return t[e.$$id]===void 0}).map(function(t){var n=Object.assign({},t,{indexName:e,threshold:t.threshold||0});return delete n.$$id,n})}},t.exports=n}),ur=c((exports,t)=>{function n(e,t){this._state=e,this._rawResults={};var n=this;e.params.forEach(function(e){var r=e.$$id;n[r]=t[r],n._rawResults[r]=t[r]})}n.prototype={constructor:n},t.exports=n}),dr=c((exports,t)=>{var n=or();function r(e){return Object.keys(e).sort().reduce(function(t,n){return t[n]=e[n],t},{})}var i={_getQueries:function(e,t){var n=[];return n.push({indexName:e,params:i._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach(function(r){n.push({indexName:e,params:i._getDisjunctiveFacetSearchParams(t,r)})}),t.getRefinedHierarchicalFacets().forEach(function(r){var a=t.getHierarchicalFacetByName(r),o=t.getHierarchicalRefinement(r),s=t._getHierarchicalFacetSeparator(a);if(o.length>0&&o[0].split(s).length>1){var c=o[0].split(s).slice(0,-1).reduce(function(e,t,n){return e.concat({attribute:a.attributes[n],value:n===0?t:[e[e.length-1].value,t].join(s)})},[]);c.forEach(function(r,o){var s=i._getDisjunctiveFacetSearchParams(t,r.attribute,o===0);function l(e){return a.attributes.some(function(t){return t===e.split(`:`)[0]})}var u=(s.facetFilters||[]).reduce(function(e,t){if(Array.isArray(t)){var n=t.filter(function(e){return!l(e)});n.length>0&&e.push(n)}return typeof t==`string`&&!l(t)&&e.push(t),e},[]),d=c[o-1];o>0?s.facetFilters=u.concat(d.attribute+`:`+d.value):u.length>0?s.facetFilters=u:delete s.facetFilters,n.push({indexName:e,params:s})})}}),n},_getCompositionQueries:function(e){return[{compositionID:e.index,requestBody:{params:i._getCompositionHitsSearchParams(e)}}]},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(i._getHitsHierarchicalFacetsAttributes(e)).sort(),a=i._getFacetFilters(e),o=i._getNumericFilters(e),s=i._getTagFilters(e),c={};return t.length>0&&(c.facets=t.indexOf(`*`)>-1?[`*`]:t),s.length>0&&(c.tagFilters=s),a.length>0&&(c.facetFilters=a),o.length>0&&(c.numericFilters=o),r(n({},e.getQueryParams(),c))},_getCompositionHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets.map(function(t){return e.disjunctiveFacetsRefinements&&e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].length>0?`disjunctive(`+t+`)`:t})).concat(i._getHitsHierarchicalFacetsAttributes(e)).sort(),a=i._getFacetFilters(e),o=i._getNumericFilters(e),s=i._getTagFilters(e),c={};t.length>0&&(c.facets=t.indexOf(`*`)>-1?[`*`]:t),s.length>0&&(c.tagFilters=s),a.length>0&&(c.facetFilters=a),o.length>0&&(c.numericFilters=o);var l=e.getQueryParams();return delete l.highlightPreTag,delete l.highlightPostTag,delete l.index,r(n({},l,c))},_getDisjunctiveFacetSearchParams:function(e,t,a){var o=i._getFacetFilters(e,t,a),s=i._getNumericFilters(e,t),c=i._getTagFilters(e),l={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};c.length>0&&(l.tagFilters=c);var u=e.getHierarchicalFacetByName(t);return u?l.facets=i._getDisjunctiveHierarchicalFacetAttribute(e,u,a):l.facets=t,s.length>0&&(l.numericFilters=s),o.length>0&&(l.facetFilters=o),r(n({},e.getQueryParams(),l))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var n=[];return Object.keys(e.numericRefinements).forEach(function(r){var i=e.numericRefinements[r]||{};Object.keys(i).forEach(function(e){var a=i[e]||[];t!==r&&a.forEach(function(t){if(Array.isArray(t)){var i=t.map(function(t){return r+e+t});n.push(i)}else n.push(r+e+t)})})}),n},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(`,`)},_getFacetFilters:function(e,t,n){var r=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach(function(e){var t=i[e]||[];t.slice().sort().forEach(function(t){r.push(e+`:`+t)})});var a=e.facetsExcludes||{};Object.keys(a).sort().forEach(function(e){var t=a[e]||[];t.sort().forEach(function(t){r.push(e+`:-`+t)})});var o=e.disjunctiveFacetsRefinements||{};Object.keys(o).sort().forEach(function(e){var n=o[e]||[];if(!(e===t||!n||n.length===0)){var i=[];n.slice().sort().forEach(function(t){i.push(e+`:`+t)}),r.push(i)}});var s=e.hierarchicalFacetsRefinements||{};return Object.keys(s).sort().forEach(function(i){var a=s[i]||[],o=a[0];if(o!==void 0){var c=e.getHierarchicalFacetByName(i),l=e._getHierarchicalFacetSeparator(c),u=e._getHierarchicalRootPath(c),d,f;if(t===i){if(o.indexOf(l)===-1||!u&&n===!0||u&&u.split(l).length===o.split(l).length)return;u?(f=u.split(l).length-1,o=u):(f=o.split(l).length-2,o=o.slice(0,o.lastIndexOf(l))),d=c.attributes[f]}else f=o.split(l).length-1,d=c.attributes[f];d&&r.push([d+`:`+o])}}),r},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return e.hierarchicalFacets.reduce(function(t,n){var r=e.getHierarchicalRefinement(n.name)[0];if(!r)return t.push(n.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(n),a=r.split(i).length,o=n.attributes.slice(0,a+1);return t.concat(o)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(n===!0){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(r).length),[t.attributes[a]]}var o=e.getHierarchicalRefinement(t.name)[0]||``,s=o.split(r).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,a,o){var s=o.isDisjunctiveFacet(e)?o.clearRefinements(e):o,c={facetQuery:t,facetName:e};return typeof a==`number`&&(c.maxFacetHits=a),r(n({},i._getHitsSearchParams(s),c))}};t.exports=i}),fr=c((exports,t)=>{t.exports=function(){var e=Array.prototype.slice.call(arguments);return e.reduceRight(function(e,t){return Object.keys(Object(t)).forEach(function(n){t[n]!==void 0&&(e[n]!==void 0&&delete e[n],e[n]=t[n])}),e},{})}}),pr=c((exports,t)=>{t.exports=function(e,t){if(Array.isArray(e)){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}}}),mr=c((exports,t)=>{function n(e,t){return e.filter(function(n,r){return t.indexOf(n)>-1&&e.indexOf(n)===r})}t.exports=n}),hr=c((exports,t)=>{function n(e){if(typeof e==`number`)return e;if(typeof e==`string`)return parseFloat(e);if(Array.isArray(e))return e.map(n);throw Error(`The value should be a number, a parsable string or an array of those.`)}t.exports=n}),gr=c((exports,t)=>{t.exports=function(e){return e===null?!1:/^[a-zA-Z0-9_-]{1,64}$/.test(e)}}),_r=c((exports,t)=>{var n=fr(),r=sr(),i=cr(),a={addRefinement:function(e,t,r){if(a.isRefined(e,t,r))return e;var i=``+r,o=e[t]?e[t].concat(i):[i],s={};return s[t]=o,n(s,e)},removeRefinement:function(e,t,n){if(n===void 0)return a.clearRefinement(e,function(e,n){return t===n});var r=``+n;return a.clearRefinement(e,function(e,n){return t===n&&r===e})},toggleRefinement:function(e,t,n){if(n===void 0)throw Error(`toggleRefinement should be used with a value`);return a.isRefined(e,t,n)?a.removeRefinement(e,t,n):a.addRefinement(e,t,n)},clearRefinement:function(e,t,n){if(t===void 0)return r(e)?{}:e;if(typeof t==`string`)return i(e,[t]);if(typeof t==`function`){var a=!1,o=Object.keys(e).reduce(function(r,i){var o=e[i]||[],s=o.filter(function(e){return!t(e,i,n)});return s.length!==o.length&&(a=!0),r[i]=s,r},{});return a?o:e}},isRefined:function(e,t,n){var r=!!e[t]&&e[t].length>0;if(n===void 0||!r)return r;var i=``+