1import{_ as Ch}from"./ContentSection.vue_vue_type_script_setup_true_lang-CVW8I8Tr.js";import{_ as Ri}from"./Heading.vue_vue_type_script_setup_true_lang-CQvGYBt_.js";import{_ as Fh}from"./index-DoN7AYIr.js";import{_ as Oh}from"./Input.vue_vue_type_script_setup_true_lang-C9sJDZBH.js";import{S as Ah,_ as Ih}from"./AppLayout.vue_vue_type_script_setup_true_lang-DAcGhRNL.js";import{r as Th,e as Si,Z as Wa,u as Ga,w as to,S as ro,aj as jh,g as ge,m as Nh,j as We,I as gt,Y as ut,i as et,ar as no,l as al,Q as Me,$ as Hh,n as Ve,k as qh,an as Xe,p as Dh,W as Lr,ak as Mh,M as Uh,ac as Ze,y as Lh,h as bi,F as Lt,J as $h,v as Wh,a4 as Zt,X as wi,G as kh,B as Bh,f as $r}from"./app-D2sWpjwb.js";import{u as Qh}from"./index-5T4h8oqj.js";import{X as Vh}from"./x-C2aOu3wz.js";import"./utils-DclmTqRz.js";import"./Primitive-NKXmE_Uq.js";import"./index-Cm347cjZ.js";import"./chevron-right-DTajtPA0.js";import"./createLucideIcon-DJAYtcQO.js";import"./useLocalizedRoute-DzjYWE9x.js";import"./AppLogoIcon.vue_vue_type_script_setup_true_lang-BGDPsR6B.js";import"./VisuallyHidden-vR59i0Iz.js";import"./nullish-BrVh-0ov.js";import"./useForwardExpose-B5ZZHSYu.js";import"./Teleport-Dc_LuH2Q.js";import"./handleAndDispatchCustomEvent-ChOKVcqp.js";import"./utils-Bth9D9QL.js";import"./chevron-left-CNe_HfET.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Card.vue_vue_type_script_setup_true_lang-ds6DUVaX.js";import"./CardContent.vue_vue_type_script_setup_true_lang-DovhrHXs.js";var Pi={},Ei={exports:{}},io;function br(){return io||(io=1,(function(e){function r(n){return n&&n.__esModule?n:{default:n}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Ei)),Ei.exports}var xi={exports:{}},Ci={exports:{}},ao;function sl(){return ao||(ao=1,(function(e){function r(n,t){this.v=n,this.k=t}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Ci)),Ci.exports}var Fi={exports:{}},Oi={exports:{}},so;function ol(){return so||(so=1,(function(e){function r(n,t,i,a){var o=Object.defineProperty;try{o({},"",{})}catch{o=0}e.exports=r=function(d,g,m,v){function h(u,s){r(d,u,function(f){return this._invoke(u,s,f)})}g?o?o(d,g,{value:m,enumerable:!v,configurable:!v,writable:!v}):d[g]=m:(h("next",0),h("throw",1),h("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,r(n,t,i,a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Oi)),Oi.exports}var oo;function ul(){return oo||(oo=1,(function(e){var r=ol();function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,i,a=typeof Symbol=="function"?Symbol:{},o=a.iterator||"@@iterator",l=a.toStringTag||"@@toStringTag";function d(p,c,y,R){var b=c&&c.prototype instanceof m?c:m,w=Object.create(b.prototype);return r(w,"_invoke",(function(C,O,x){var F,T,A,D=0,W=x||[],Q=!1,J={p:0,n:0,v:t,a:k,f:k.bind(t,4),d:function($,B){return F=$,T=0,A=t,J.n=B,g}};function k(M,$){for(T=M,A=$,i=0;!Q&&D&&!B&&i<W.length;i++){var B,V=W[i],z=J.p,ne=V[2];M>3?(B=ne===$)&&(A=V[(T=V[4])?5:(T=3,3)],V[4]=V[5]=t):V[0]<=z&&((B=M<2&&z<V[1])?(T=0,J.v=$,J.n=V[1]):z<ne&&(B=M<3||V[0]>$||$>ne)&&(V[4]=M,V[5]=$,J.n=ne,T=0))}if(B||M>1)return g;throw Q=!0,$}return function(M,$,B){if(D>1)throw TypeError("Generator is already running");for(Q&&$===1&&k($,B),T=$,A=B;(i=T<2?t:A)||!Q;){F||(T?T<3?(T>1&&(J.n=-1),k(T,A)):J.n=A:J.v=A);try{if(D=2,F){if(T||(M="next"),i=F[M]){if(!(i=i.call(F,A)))throw TypeError("iterator result is not an object");if(!i.done)return i;A=i.value,T<2&&(T=0)}else T===1&&(i=F.return)&&i.call(F),T<2&&(A=TypeError("The iterator does not provide a '"+M+"' method"),T=1);F=t}else if((i=(Q=J.n<0)?A:C.call(O,J))!==g)break}catch(V){F=t,T=1,A=V}finally{D=1}}return{value:i,done:Q}}})(p,y,R),!0),w}var g={};function m(){}function v(){}function h(){}i=Object.getPrototypeOf;var u=[][o]?i(i([][o]())):(r(i={},o,function(){return this}),i),s=h.prototype=m.prototype=Object.create(u);function f(p){return Object.setPrototypeOf?Object.setPrototypeOf(p,h):(p.__proto__=h,r(p,l,"GeneratorFunction")),p.prototype=Object.create(s),p}return v.prototype=h,r(s,"constructor",h),r(h,"constructor",v),v.displayName="GeneratorFunction",r(h,l,"GeneratorFunction"),r(s),r(s,l,"Generator"),r(s,o,function(){return this}),r(s,"toString",function(){return"[object Generator]"}),(e.exports=n=function(){return{w:d,m:f}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Fi)),Fi.exports}
1var Ai={exports:{}},Ii={exports:{}},Ti={exports:{}},uo;function cl(){return uo||(uo=1,(function(e){var r=sl(),n=ol();function t(i,a){function o(d,g,m,v){try{var h=i[d](g),u=h.value;return u instanceof r?a.resolve(u.v).then(function(s){o("next",s,m,v)},function(s){o("throw",s,m,v)}):a.resolve(u).then(function(s){h.value=s,m(h)},function(s){return o("throw",s,m,v)})}catch(s){v(s)}}var l;this.next||(n(t.prototype),n(t.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(d,g,m){function v(){return new a(function(h,u){o(d,m,h,u)})}return l=l?l.then(v,v):v()},!0)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ti)),Ti.exports}var co;function ll(){return co||(co=1,(function(e){var r=ul(),n=cl();function t(i,a,o,l,d){return new n(r().w(i,a,o,l),d||Promise)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ii)),Ii.exports}var lo;function zh(){return lo||(lo=1,(function(e){var r=ll();function n(t,i,a,o,l){var d=r(t,i,a,o,l);return d.next().then(function(g){return g.done?g.value:d.next()})}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Ai)),Ai.exports}var ji={exports:{}},fo;function Kh(){return fo||(fo=1,(function(e){function r(n){var t=Object(n),i=[];for(var a in t)i.unshift(a);return function o(){for(;i.length;)if((a=i.pop())in t)return o.value=a,o.done=!1,o;return o.done=!0,o}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ji)),ji.exports}var Ni={exports:{}},Hi={exports:{}},ho;function Xn(){return ho||(ho=1,(function(e){function r(n){"@babel/helpers - typeof";return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e.exports.__esModule=!0,e.exports.default=e.exports,r(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Hi)),Hi.exports}var po;function Jh(){return po||(po=1,(function(e){var r=Xn().default;function n(t){if(t!=null){var i=t[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],a=0;if(i)return i.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length))return{next:function(){return t&&a>=t.length&&(t=void 0),{value:t&&t[a++],done:!t}}}}throw new TypeError(r(t)+" is not iterable")}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Ni)),Ni.exports}var go;function Gh(){return go||(go=1,(function(e){var r=sl(),n=ul(),t=zh(),i=ll(),a=cl(),o=Kh(),l=Jh();function d(){var g=n(),m=g.m(d),v=(Object.getPrototypeOf?Object.getPrototypeOf(m):m.__proto__).constructor;function h(f){var p=typeof f=="function"&&f.constructor;return!!p&&(p===v||(p.displayName||p.name)==="GeneratorFunction")}var u={throw:1,return:2,break:3,continue:3};function s(f){var p,c;return function(y){p||(p={stop:function(){return c(y.a,2)},catch:function(){return y.v},abrupt:function(b,w){return c(y.a,u[b],w)},delegateYield:function(b,w,C){return p.resultName=w,c(y.d,l(b),C)},finish:function(b){return c(y.f,b)}},c=function(b,w,C){y.p=p.prev,y.n=p.next;try{return b(w,C)}finally{p.next=y.n}}),p.resultName&&(p[p.resultName]=y.v,p.resultName=void 0),p.sent=y.v,p.next=y.n;try{return f.call(this,p)}finally{y.p=p.prev,y.n=p.next}}}return(e.exports=d=function(){return{wrap:function(c,y,R,b){return g.w(s(c),y,R,b&&b.reverse())},isGeneratorFunction:h,mark:g.m,awrap:function(c,y){return new r(c,y)},AsyncIterator:a,async:function(c,y,R,b,w){return(h(y)?i:t)(s(c),y,R,b,w)},keys:o,values:l}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=d,e.exports.__esModule=!0,e.exports.default=e.exports})(xi)),xi.exports}var qi,mo;function fl(){if(mo)return qi;mo=1;var e=Gh()();qi=e;try{regeneratorRuntime=e}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}return qi}var Di={exports:{}},vo;function dl(){return vo||(vo=1,(function(e){function r(t,i,a,o,l,d,g){try{var m=t[d](g),v=m.value}catch(h){return void a(h)}m.done?i(v):Promise.resolve(v).then(o,l)}function n(t){return function(){var i=this,a=arguments;return new Promise(function(o,l){var d=t.apply(i,a);function g(v){r(d,o,l,g,m,"next",v)}function m(v){r(d,o,l,g,m,"throw",v)}g(void 0)})}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Di)),Di.exports}var Mi={exports:{}},yo;function wr(){return yo||(yo=1,(function(e){function r(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Mi)),Mi.exports}var Ui={exports:{}},Li={exports:{}},$i={exports:{}},_o;function Xh(){return _o||(_o=1,(function(e){var r=Xn().default;function n(t,i){if(r(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var o=a.call(t,i||"default");if(r(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}
1)($i)),$i.exports}var Ro;function hl(){return Ro||(Ro=1,(function(e){var r=Xn().default,n=Xh();function t(i){var a=n(i,"string");return r(a)=="symbol"?a:a+""}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Li)),Li.exports}var So;function Pr(){return So||(So=1,(function(e){var r=hl();function n(i,a){for(var o=0;o<a.length;o++){var l=a[o];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(i,r(l.key),l)}}function t(i,a,o){return a&&n(i.prototype,a),o&&n(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(Ui)),Ui.exports}var er={},bo;function Yh(){if(bo)return er;bo=1;var e=br();Object.defineProperty(er,"__esModule",{value:!0}),er.Configuration=void 0;var r=e(wr()),n=e(Pr());return er.Configuration=(function(){function t(){var i,a,o,l,d,g,m,v,h,u,s,f,p,c=this,y,R,b,w,C,O,x,F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(0,r.default)(this,t),this.server=F.server||{nodes:[{host:"localhost",port:"8108",path:"",protocol:"http"}]},this.server.cacheSearchResultsForSeconds=(i=this.server.cacheSearchResultsForSeconds)!==null&&i!==void 0?i:120,this.additionalSearchParameters=(a=F.additionalSearchParameters)!==null&&a!==void 0?a:{},this.additionalSearchParameters.query_by=(o=(l=this.additionalSearchParameters.queryBy)!==null&&l!==void 0?l:this.additionalSearchParameters.query_by)!==null&&o!==void 0?o:"",this.additionalSearchParameters.preset=(d=(g=this.additionalSearchParameters.preset)!==null&&g!==void 0?g:this.additionalSearchParameters.preset)!==null&&d!==void 0?d:"",this.additionalSearchParameters.sort_by=(m=(v=this.additionalSearchParameters.sortBy)!==null&&v!==void 0?v:this.additionalSearchParameters.sort_by)!==null&&m!==void 0?m:"",this.additionalSearchParameters.highlight_full_fields=(h=(u=this.additionalSearchParameters.highlightFullFields)!==null&&u!==void 0?u:this.additionalSearchParameters.highlight_full_fields)!==null&&h!==void 0?h:this.additionalSearchParameters.query_by,this.geoLocationField=(s=F.geoLocationField)!==null&&s!==void 0?s:"_geoloc",this.facetableFieldsWithSpecialCharacters=(f=F.facetableFieldsWithSpecialCharacters)!==null&&f!==void 0?f:[],this.collectionSpecificSearchParameters=(p=F.collectionSpecificSearchParameters)!==null&&p!==void 0?p:{},Object.keys(this.collectionSpecificSearchParameters).forEach(function(T){var A,D,W,Q,J,k,M=c.collectionSpecificSearchParameters[T];M.query_by=(A=M.queryBy)!==null&&A!==void 0?A:M.query_by,M.preset=(D=M.preset)!==null&&D!==void 0?D:M.preset,M.sort_by=(W=M.sortBy)!==null&&W!==void 0?W:M.sort_by,M.highlight_full_fields=(Q=(J=(k=M.highlightFullFields)!==null&&k!==void 0?k:M.highlight_full_fields)!==null&&J!==void 0?J:c.additionalSearchParameters.highlight_full_fields)!==null&&Q!==void 0?Q:M.query_by,Object.keys(M).forEach(function($){return M[$]===void 0?delete M[$]:{}})}),this.renderingContent=F.renderingContent,this.flattenGroupedHits=(y=F.flattenGroupedHits)!==null&&y!==void 0?y:!0,this.facetByOptions=(R=F.facetByOptions)!==null&&R!==void 0?R:{},this.filterByOptions=(b=F.filterByOptions)!==null&&b!==void 0?b:{},this.sortByOptions=(w=F.sortByOptions)!==null&&w!==void 0?w:{},this.collectionSpecificFacetByOptions=(C=F.collectionSpecificFacetByOptions)!==null&&C!==void 0?C:{},this.collectionSpecificFilterByOptions=(O=F.collectionSpecificFilterByOptions)!==null&&O!==void 0?O:{},this.collectionSpecificSortByOptions=(x=F.collectionSpecificSortByOptions)!==null&&x!==void 0?x:{}}return(0,n.default)(t,[{key:"validate",value:function(){if((this.additionalSearchParameters.queryBy||Object.values(this.collectionSpecificSearchParameters).some(function(a){return a.queryBy}))&&console.warn("[typesense-instantsearch-adapter] Please use snake_cased versions of parameters in additionalSearchParameters instead of camelCased parameters. For example: Use query_by instead of queryBy. camelCased parameters will be deprecated
1in a future version. We're making this change so that parameter names are identical to the ones sent to Typesense (which are all snake_cased), and to also keep the types for these parameters in sync with the types defined in typesense-js."),this.additionalSearchParameters.query_by.length===0&&this.additionalSearchParameters.preset.length===0&&(Object.keys(this.collectionSpecificSearchParameters).length===0||Object.values(this.collectionSpecificSearchParameters).some(function(a){return(a.query_by||"").length===0&&(a.preset||"").length===0})))throw new Error("[typesense-instantsearch-adapter] Missing parameter: One of additionalSearchParameters.query_by or additionalSearchParameters.preset needs to be set, or all collectionSpecificSearchParameters need to have either .query_by or .preset set.")}}])})(),er}var ot={},ka=function(e,r){return ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},ka(e,r)};function pl(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");ka(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}var Bn=function(){return Bn=Object.assign||function(r){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])}return r},Bn.apply(this,arguments)};function gl(e,r){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(n[t]=e[t]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,t=Object.getOwnPropertySymbols(e);i<t.length;i++)r.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]]);return n}function ml(e,r,n,t){var i=arguments.length,a=i<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,n):t,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,r,n,t);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(i<3?o(a):i>3?o(r,n,a):o(r,n))||a);return i>3&&a&&Object.defineProperty(r,n,a),a}function vl(e,r){return function(n,t){r(n,t,e)}}function yl(e,r,n,t,i,a){function o(c){if(c!==void 0&&typeof c!="function")throw new TypeError("Function expected");return c}for(var l=t.kind,d=l==="getter"?"get":l==="setter"?"set":"value",g=!r&&e?t.static?e:e.prototype:null,m=r||(g?Object.getOwnPropertyDescriptor(g,t.name):{}),v,h=!1,u=n.length-1;u>=0;u--){var s={};for(var f in t)s[f]=f==="access"?{}:t[f];for(var f in t.access)s.access[f]=t.access[f];s.addInitializer=function(c){if(h)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(c||null))};var p=(0,n[u])(l==="accessor"?{get:m.get,set:m.set}:m[d],s);if(l==="accessor"){if(p===void 0)continue;if(p===null||typeof p!="object")throw new TypeError("Object expected");(v=o(p.get))&&(m.get=v),(v=o(p.set))&&(m.set=v),(v=o(p.init))&&i.unshift(v)}else(v=o(p))&&(l==="field"?i.unshift(v):m[d]=v)}g&&Object.defineProperty(g,t.name,m),h=!0}function _l(e,r,n){for(var t=arguments.length>2,i=0;i<r.length;i++)n=t?r[i].call(e,n):r[i].call(e);return t?n:void 0}function Rl(e){return typeof e=="symbol"?e:"".concat(e)}function Sl(e,r,n){return typeof r=="symbol"&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",r):r})}function bl(e,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,r)}function wl(e,r,n,t){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(m){try{g(t.next(m))}catch(v){o(v)}}function d(m){try{g(t.throw(m))}catch(v){o(v)}}function g(m){m.done?a(m.value):i(m.value).then(l,d)}g((t=t.apply(e,r||[])).next())})}function Pl(e,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},t,i,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(g){return function(m){return d([g,m])}}function d(g){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,g[0]&&(n=0)),n;)try{if(t=1,i&&(a=g[0]&2?i.return:g[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,g[1])).done)return a;switch(i=0,a&&(g=[g[0]&2,a.value]),g[0]){case 0:case 1:a=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,i=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!a||g[1]>a[0]&&g[1]<a[3])){n.label=g[1];break}if(g[0]===6&&n.label<a[1]){n.label=a[1],a=g;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(g);break}a[2]&&n.ops.pop(),n.trys.pop();continue}g=r.call(e,n)}catch(m){g=[6,m],i=0}finally{t=a=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}}var Yn=Object.create?(function(e,r,n,t){t===void 0&&(t=n);var i=Object.getOwnPropertyDescriptor(r,n);
vendor: 5,419 bytes, line 1
1(!i||("get"in i?!r.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return r[n]}}),Object.defineProperty(e,t,i)}):(function(e,r,n,t){t===void 0&&(t=n),e[t]=r[n]});function El(e,r){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(r,n)&&Yn(r,e,n)}function Qn(e){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&e[r],t=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&t>=e.length&&(e=void 0),{value:e&&e[t++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xa(e,r){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var t=n.call(e),i,a=[],o;try{for(;(r===void 0||r-- >0)&&!(i=t.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(n=t.return)&&n.call(t)}finally{if(o)throw o.error}}return a}function xl(){for(var e=[],r=0;r<arguments.length;r++)e=e.concat(Xa(arguments[r]));return e}function Cl(){for(var e=0,r=0,n=arguments.length;r<n;r++)e+=arguments[r].length;for(var t=Array(e),i=0,r=0;r<n;r++)for(var a=arguments[r],o=0,l=a.length;o<l;o++,i++)t[i]=a[o];return t}function Fl(e,r,n){if(n||arguments.length===2)for(var t=0,i=r.length,a;t<i;t++)(a||!(t in r))&&(a||(a=Array.prototype.slice.call(r,0,t)),a[t]=r[t]);return e.concat(a||Array.prototype.slice.call(r))}function Qt(e){return this instanceof Qt?(this.v=e,this):new Qt(e)}function Ol(e,r,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n.apply(e,r||[]),i,a=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(u){return function(s){return Promise.resolve(s).then(u,v)}}function l(u,s){t[u]&&(i[u]=function(f){return new Promise(function(p,c){a.push([u,f,p,c])>1||d(u,f)})},s&&(i[u]=s(i[u])))}function d(u,s){try{g(t[u](s))}catch(f){h(a[0][3],f)}}function g(u){u.value instanceof Qt?Promise.resolve(u.value.v).then(m,v):h(a[0][2],u)}function m(u){d("next",u)}function v(u){d("throw",u)}function h(u,s){u(s),a.shift(),a.length&&d(a[0][0],a[0][1])}}function Al(e){var r,n;return r={},t("next"),t("throw",function(i){throw i}),t("return"),r[Symbol.iterator]=function(){return this},r;function t(i,a){r[i]=e[i]?function(o){return(n=!n)?{value:Qt(e[i](o)),done:!1}:a?a(o):o}:a}}function Il(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],n;return r?r.call(e):(e=typeof Qn=="function"?Qn(e):e[Symbol.iterator](),n={},t("next"),t("throw"),t("return"),n[Symbol.asyncIterator]=function(){return this},n);function t(a){n[a]=e[a]&&function(o){return new Promise(function(l,d){o=e[a](o),i(l,d,o.done,o.value)})}}function i(a,o,l,d){Promise.resolve(d).then(function(g){a({value:g,done:l})},o)}}function Tl(e,r){return Object.defineProperty?Object.defineProperty(e,"raw",{value:r}):e.raw=r,e}var Zh=Object.create?(function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}):function(e,r){e.default=r},Ba=function(e){return Ba=Object.getOwnPropertyNames||function(r){var n=[];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(n[n.length]=t);return n},Ba(e)};function jl(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=Ba(e),t=0;t<n.length;t++)n[t]!=="default"&&Yn(r,e,n[t]);return Zh(r,e),r}function Nl(e){return e&&e.__esModule?e:{default:e}}function Hl(e,r,n,t){if(n==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!t:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?t:n==="a"?t.call(e):t?t.value:r.get(e)}function ql(e,r,n,t,i){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!i:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?i.call(e,n):i?i.value=n:r.set(e,n),n}function Dl(e,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?r===e:e.has(r)}function Ml(e,r,n){if(r!=null){if(typeof r!="object"&&typeof r!="function")throw new TypeError("Object expected.");var t,i;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");t=r[Symbol.asyncDispose]}if(t===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");t=r[Symbol.dispose],n&&(i=t)}if(typeof t!="function")throw new TypeError("Object not disposable.");i&&(t=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.stack.push({value:r,dispose:t,async:n})}else n&&e.stack.push({async:!0});return r}var ep=typeof SuppressedError=="function"?SuppressedError:function(e,r,n){var t=new Error(n);return t.name="SuppressedError",t.error=e,t.suppressed=r,t};function Ul(e){function r(a){e.error=e.hasError?new ep(a,e.error,"An error was suppressed during disposal."):a,e.hasError=!0}var n,t=0;function i(){for(;n=e.stack.pop();)try{if(!n.async&&t===1)return t=0,e.stack.push(n),Promise.resolve().then(i);if(n.dispose){var a=n.dispose.call(n.value);if(n.async)return t|=2,Promise.resolve(a).then(i,function(o){return r(o),i()})}else t|=1}catch(o){r(o)}
1if(t===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return i()}function Ll(e,r){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,t,i,a,o){return t?r?".jsx":".js":i&&(!a||!o)?n:i+a+"."+o.toLowerCase()+"js"}):e}const tp={__extends:pl,__assign:Bn,__rest:gl,__decorate:ml,__param:vl,__esDecorate:yl,__runInitializers:_l,__propKey:Rl,__setFunctionName:Sl,__metadata:bl,__awaiter:wl,__generator:Pl,__createBinding:Yn,__exportStar:El,__values:Qn,__read:Xa,__spread:xl,__spreadArrays:Cl,__spreadArray:Fl,__await:Qt,__asyncGenerator:Ol,__asyncDelegator:Al,__asyncValues:Il,__makeTemplateObject:Tl,__importStar:jl,__importDefault:Nl,__classPrivateFieldGet:Hl,__classPrivateFieldSet:ql,__classPrivateFieldIn:Dl,__addDisposableResource:Ml,__disposeResources:Ul,__rewriteRelativeImportExtension:Ll},rp=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Ml,get __assign(){return Bn},__asyncDelegator:Al,__asyncGenerator:Ol,__asyncValues:Il,__await:Qt,__awaiter:wl,__classPrivateFieldGet:Hl,__classPrivateFieldIn:Dl,__classPrivateFieldSet:ql,__createBinding:Yn,__decorate:ml,__disposeResources:Ul,__esDecorate:yl,__exportStar:El,__extends:pl,__generator:Pl,__importDefault:Nl,__importStar:jl,__makeTemplateOb
1ject:Tl,__metadata:bl,__param:vl,__propKey:Rl,__read:Xa,__rest:gl,__rewriteRelativeImportExtension:Ll,__runInitializers:_l,__setFunctionName:Sl,__spread:xl,__spreadArray:Fl,__spreadArrays:Cl,__values:Qn,default:tp},Symbol.toStringTag,{value:"Module"})),ae=Th(rp);var Wr={},kr={},kn={exports:{}},np=kn.exports,wo;function ip(){return wo||(wo=1,(function(e){(function(r,n){e.exports?e.exports=n():r.log=n()})(np,function(){var r=function(){},n="undefined",t=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],a={},o=null;function l(f,p){var c=f[p];if(typeof c.bind=="function")return c.bind(f);try{return Function.prototype.bind.call(c,f)}catch{return function(){return Function.prototype.apply.apply(c,[f,arguments])}}}function d(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function g(f){return f==="debug"&&(f="log"),typeof console===n?!1:f==="trace"&&t?d:console[f]!==void 0?l(console,f):console.log!==void 0?l(console,"log"):r}function m(){for(var f=this.getLevel(),p=0;p<i.length;p++){var c=i[p];this[c]=p<f?r:this.methodFactory(c,f,this.name)}if(this.log=this.debug,typeof console===n&&f<this.levels.SILENT)return"No console available for logging"}function v(f){return function(){typeof console!==n&&(m.call(this),this[f].apply(this,arguments))}}
1function h(f,p,c){return g(f)||v.apply(this,arguments)}function u(f,p){var c=this,y,R,b,w="loglevel";typeof f=="string"?w+=":"+f:typeof f=="symbol"&&(w=void 0);function C(A){var D=(i[A]||"silent").toUpperCase();if(!(typeof window===n||!w)){try{window.localStorage[w]=D;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+D+";"}catch{}}}function O(){var A;if(!(typeof window===n||!w)){try{A=window.localStorage[w]}catch{}if(typeof A===n)try{var D=window.document.cookie,W=encodeURIComponent(w),Q=D.indexOf(W+"=");Q!==-1&&(A=/^([^;]+)/.exec(D.slice(Q+W.length+1))[1])}catch{}return c.levels[A]===void 0&&(A=void 0),A}}function x(){if(!(typeof window===n||!w)){try{window.localStorage.removeItem(w)}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function F(A){var D=A;if(typeof D=="string"&&c.levels[D.toUpperCase()]!==void 0&&(D=c.levels[D.toUpperCase()]),typeof D=="number"&&D>=0&&D<=c.levels.SILENT)return D;throw new TypeError("log.setLevel() called with invalid level: "+A)}c.name=f,c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=p||h,c.getLevel=function(){return b??R??y},c.setLevel=function(A,D){return b=F(A),D!==!1&&C(b),m.call(c)},c.setDefaultLevel=function(A){R=F(A),O()||c.setLevel(A,!1)},c.resetLevel=function(){b=null,x(),m.call(c)},c.enableAll=function(A){c.setLevel(c.levels.TRACE,A)},c.disableAll=function(A){c.setLevel(c.levels.SILENT,A)},c.rebuild=function(){if(o!==c&&(y=F(o.getLevel())),m.call(c),o===c)for(var A in a)a[A].rebuild()},y=F(o?o.getLevel():"WARN");var T=O();T!=null&&(b=F(T)),m.call(c)}o=new u,o.getLogger=function(p){if(typeof p!="symbol"&&typeof p!="string"||p==="")throw new TypeError("You must supply a name when creating a logger.");var c=a[p];return c||(c=a[p]=new u(p,o.methodFactory)),c};var s=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=s),o},o.getLoggers=function(){return a},o.default=o,o})})(kn)),kn.exports}var Ie={},Br={},Qr={},Po;function it(){if(Po)return Qr;Po=1,Object.defineProperty(Qr,"__esModule",{value:!0});var e=ae,r=(function(n){e.__extends(t,n);function t(i,a,o){var l=this.constructor,d=n.call(this,i)||this;return d.name=l.name,d.httpBody=a,d.httpStatus=o,Object.setPrototypeOf(d,l.prototype),d}return t})(Error);return Qr.default=r,Qr}var Eo;function ap(){if(Eo)return Br;Eo=1,Object.defineProperty(Br,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Br.default=n,Br}var Vr={},xo;function sp(){if(xo)return Vr;xo=1,Object.defineProperty(Vr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Vr.default=n,Vr}var zr={},Co;function op(){if(Co)return zr;Co=1,Object.defineProperty(zr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return zr.default=n,zr}var Kr={},Fo;function up(){if(Fo)return Kr;
1Fo=1,Object.defineProperty(Kr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Kr.default=n,Kr}var Jr={},Oo;function cp(){if(Oo)return Jr;Oo=1,Object.defineProperty(Jr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Jr.default=n,Jr}var Gr={},Ao;function lp(){if(Ao)return Gr;Ao=1,Object.defineProperty(Gr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Gr.default=n,Gr}var Xr={},Io;function fp(){if(Io)return Xr;Io=1,Object.defineProperty(Xr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Xr.default=n,Xr}var Yr={},To;function dp(){if(To)return Yr;To=1,Object.defineProperty(Yr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(){return t!==null&&t.apply(this,arguments)||this}return i})(r.default);return Yr.default=n,Yr}var Zr={},jo;function hp(){if(jo)return Zr;jo=1,Object.defineProperty(Zr,"__esModule",{value:!0});var e=ae,r=e.__importDefault(it()),n=(function(t){e.__extends(i,t);function i(a,o,l){var d=t.call(this,a)||this;return d.importResults=o,d.payload=l,d}return i})(r.default);return Zr.default=n,Zr}var No;function Er(){if(No)return Ie;No=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.ImportError=Ie.TypesenseError=Ie.ServerError=Ie.RequestUnauthorized=Ie.RequestMalformed=Ie.ObjectUnprocessable=Ie.ObjectNotFound=Ie.ObjectAlreadyExists=Ie.MissingConfigurationError=Ie.HTTPError=void 0;var e=ae,r=e.__importDefault(ap());Ie.HTTPError=r.default;var n=e.__importDefault(sp());Ie.MissingConfigurationError=n.default;var t=e.__importDefault(op());Ie.ObjectAlreadyExists=t.default;var i=e.__importDefault(up());Ie.ObjectNotFound=i.default;var a=e.__importDefault(cp());Ie.ObjectUnprocessable=a.default;var o=e.__importDefault(lp());Ie.RequestMalformed=o.default;var l=e.__importDefault(fp());Ie.RequestUnauthorized=l.default;var d=e.__importDefault(dp());Ie.ServerError=d.default;var g=e.__importDefault(hp());Ie.ImportError=g.default;var m=e.__importDefault(it());return Ie.TypesenseError=m.default,Ie}var Ho;function $l(){if(Ho)return kr;Ho=1,Object.defineProperty(kr,"__esModule",{value:!0});var e=ae,r=e.__importStar(ip()),n=Er(),t=(function(){function i(a){var o=this;this.nodes=a.nodes||[],this.nodes=this.nodes.map(function(l){return o.setDefaultPathInNode(l)}).map(function(l){return o.setDefaultPortInNode(l)}).map(function(l){return e.__assign({},l)}),a.randomizeNodes==null&&(a.randomizeNodes=!0),a.randomizeNodes===!0&&this.shuffleArray(this.nodes),this.nearestNode=a.nearestNode,this.nearestNode=this.setDefaultPathInNode(this.nearestNode),this.nearestNode=this.setDefaultPortInNode(this.nearestNode),this.connectionTimeoutSeconds=a.connectionTimeoutSeconds||a.timeoutSeconds||5,this.healthcheckIntervalSeconds=a.healthcheckIntervalSeconds||60,this.numRetries=(a.numRetries!==void 0&&a.numRetries>=0?a.numRetries:this.nodes.length+(this.nearestNode==null?0:1))||3,this.retryIntervalSeconds=a.retryIntervalSeconds||.1,this.apiKey=a.apiKey,this.sendApiKeyAsQueryParam=a.sendApiKeyAsQueryParam,this.cacheSearchResultsForSeconds=a.cacheSearchResultsForSeconds||0,this.useServerSideSearchCache=a.useServerSideSearchCache||!1,this.axiosAdapter=a.axiosAdapter,this.logger=a.logger||r,this.logLevel=a.logLevel||"warn",this.logger.setLevel(this.logLevel),this.additionalHeaders=a.additionalHeaders,this.httpAgent=a.httpAgent,this.httpsAgent=a.httpsAgent,this.paramsSerializer=a.paramsSerializer,this.showDeprecationWarnings(a),this.validate()}return i.prototype.validate=function(){if(this.nodes==null||this.nodes.length===0||this.validateNodes())throw new n.MissingConfigurationError("Ensure that nodes[].protocol, nodes[].host and nodes[].port are set");if(this.nearestNode!=null&&this.isNodeMissingAnyParameters(this.nearestNode))throw new n.MissingConfigurationError("Ensure that nearestNodes.protocol, nearestNodes.host and nearestNodes.port are set");if(this.apiKey==null)throw new n.MissingConfigurationError("Ensure that apiKey is set");return!0},i.prototype.validateNodes=function(){var a=this;return this.nodes.some(function(o){return a.isNodeMissingAnyParameters(o)})},i.prototype.isNodeMissingAnyParameters=function(a){return!["protocol","host","port","path"].every(function(o){return a.hasOwnProperty(o)})&&a.url==null},i.prototype.setDefaultPathInNode=function(a){return a!=null&&!a.hasOwnProperty("path")&&(a.path=""),a}
vendor: 7,093 bytes, line 1
1,i.prototype.setDefaultPortInNode=function(a){if(a!=null&&!a.hasOwnProperty("port")&&a.hasOwnProperty("protocol"))switch(a.protocol){case"https":a.port=443;break;case"http":a.port=80;break}return a},i.prototype.showDeprecationWarnings=function(a){a.timeoutSeconds&&this.logger.warn("Deprecation warning: timeoutSeconds is now renamed to connectionTimeoutSeconds"),a.masterNode&&this.logger.warn("Deprecation warning: masterNode is now consolidated to nodes, starting with Typesense Server v0.12"),a.readReplicaNodes&&this.logger.warn("Deprecation warning: readReplicaNodes is now consolidated to nodes, starting with Typesense Server v0.12")},i.prototype.shuffleArray=function(a){for(var o,l=a.length-1;l>0;l--){var d=Math.floor(Math.random()*(l+1));o=[a[d],a[l]],a[l]=o[0],a[d]=o[1]}},i})();return kr.default=t,kr}var en={};/*! Axios v1.18.1 Copyright (c) 2026 Matt Zabriskie and contributors */var Wi,qo;function pp(){if(qo)return Wi;qo=1;function e(_,S){return function(){return _.apply(S,arguments)}}const{toString:r}=Object.prototype,{getPrototypeOf:n}=Object,{iterator:t,toStringTag:i}=Symbol,a=(({hasOwnProperty:_})=>(S,P)=>_.call(S,P))(Object.prototype),o=(_,S)=>{let P=_;const E=[];for(;P!=null&&P!==Object.prototype;){if(E.indexOf(P)!==-1)return!1;if(E.push(P),a(P,S))return!0;P=n(P)}return!1},l=(_,S)=>_!=null&&o(_,S)?_[S]:void 0,d=(_=>S=>{const P=r.call(S);return _[P]||(_[P]=P.slice(8,-1).toLowerCase())})(Object.create(null)),g=_=>(_=_.toLowerCase(),S=>d(S)===_),m=_=>S=>typeof S===_,{isArray:v}=Array,h=m("undefined");function u(_){return _!==null&&!h(_)&&_.constructor!==null&&!h(_.constructor)&&c(_.constructor.isBuffer)&&_.constructor.isBuffer(_)}const s=g("ArrayBuffer");function f(_){let S;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?S=ArrayBuffer.isView(_):S=_&&_.buffer&&s(_.buffer),S}const p=m("string"),c=m("function"),y=m("number"),R=_=>_!==null&&typeof _=="object",b=_=>_===!0||_===!1,w=_=>{if(!R(_))return!1;const S=n(_);return(S===null||S===Object.prototype||n(S)===null)&&!o(_,i)&&!o(_,t)},C=_=>{if(!R(_)||u(_))return!1;try{return Object.keys(_).length===0&&Object.getPrototypeOf(_)===Object.prototype}catch{return!1}},O=g("Date"),x=g("File"),F=_=>!!(_&&typeof _.uri<"u"),T=_=>_&&typeof _.getParts<"u",A=g("Blob"),D=g("FileList"),W=_=>R(_)&&c(_.pipe);function Q(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof Si<"u"?Si:{}}const J=Q(),k=typeof J.FormData<"u"?J.FormData:void 0,M=_=>{if(!_)return!1;if(k&&_ instanceof k)return!0;const S=n(_);if(!S||S===Object.prototype||!c(_.append))return!1;const P=d(_);return P==="formdata"||P==="object"&&c(_.toString)&&_.toString()==="[object FormData]"},$=g("URLSearchParams"),[B,V,z,ne]=["ReadableStream","Request","Response","Headers"].map(g),ie=_=>_.trim?_.trim():_.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ue(_,S,{allOwnKeys:P=!1}={}){if(_===null||typeof _>"u")return;let E,I;if(typeof _!="object"&&(_=[_]),v(_))for(E=0,I=_.length;E<I;E++)S.call(null,_[E],E,_);else{if(u(_))return;const j=P?Object.getOwnPropertyNames(_):Object.keys(_),q=j.length;let U;for(E=0;E<q;E++)U=j[E],S.call(null,_[U],U,_)}}function Z(_,S){if(u(_))return null;S=S.toLowerCase();const P=Object.keys(_);let E=P.length,I;for(;E-- >0;)if(I=P[E],S===I.toLowerCase())return I;return null}const se=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Si,ve=_=>!h(_)&&_!==se;function pe(..._){const{caseless:S,skipUndefined:P}=ve(this)&&this||{},E={},I=(j,q)=>{if(q==="__proto__"||q==="constructor"||q==="prototype")return;const U=S&&typeof q=="string"&&Z(E,q)||q,K=a(E,U)?E[U]:void 0;w(K)&&w(j)?E[U]=pe(K,j):w(j)?E[U]=pe({},j):v(j)?E[U]=j.slice():(!P||!h(j))&&(E[U]=j)};for(let j=0,q=_.length;j<q;j++){const U=_[j];if(!U||u(U)||(ue(U,I),typeof U!="object"||v(U)))continue;const K=Object.getOwnPropertySymbols(U);for(let Y=0;Y<K.length;Y++){const X=K[Y];Or.call(U,X)&&I(U[X],X)}}return E}const Ne=(_,S,P,{allOwnKeys:E}={})=>(ue(S,(I,j)=>{P&&c(I)?Object.defineProperty(_,j,{__proto__:null,value:e(I,P),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(_,j,{__proto__:null,value:I,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:E}),_),Oe=_=>(_.charCodeAt(0)===65279&&(_=_.slice(1)),_),He=(_,S,P,E)=>{_.prototype=Object.create(S.prototype,E),Object.defineProperty(_.prototype,"constructor",{__proto__:null,value:_,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(_,"super",{__proto__:null,value:S.prototype}),P&&Object.assign(_.prototype,P)},ye=(_,S,P,E)=>{let I,j,q;const U={};if(S=S||{},_==null)return S;do{for(I=Object.getOwnPropertyNames(_),j=I.length;j-- >0;)q=I[j],(!E||E(q,_,S))&&!U[q]&&(S[q]=_[q],U[q]=!0);_=P!==!1&&n(_)}while(_&&(!P||P(_,S))&&_!==Object.prototype);return S},at=(_,S,P)=>{_=String(_),(P===void 0||P>_.length)&&(P=_.length),P-=S.length;const E=_.indexOf(S,P);return E!==-1&&E===P},At=_=>{if(!_)return null;if(v(_))return _;let S=_.length;if(!y(S))return null;const P=new Array(S);for(;S-- >0;)P[S]=_[S];return P},qe=(_=>S=>_&&S instanceof _)(typeof Uint8Array<"u"&&n(Uint8Array)),Je=(_,S)=>{const E=(_&&_[t]).call(_);let I;for(;(I=E.next())&&!I.done;){const j=I.value;S.call(_,j[0],j[1])}},yt=(_,S)=>{let P;const E=[];for(;(P=_.exec(S))!==null;)E.push(P);return E},It=g("HTMLFormElement"),Vt=_=>_.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(P,E,I){return E.toUpperCase()+I}),{propertyIsEnumerable:Or}=Object.prototype,ud=g("RegExp"),ms=(_,S)=>{const P=Object.getOwnPropertyDescriptors(_),E={};ue(P,(I,j)=>{let q;(q=S(I,j,_))!==!1&&(E[j]=q||I)}),Object.defineProperties(_,E)},cd=_=>{ms(_,(S,P)=>{if(c(_)&&["arguments","caller","callee"].includes(P))return!1;const E=_[P];if(c(E)){if(S.enumerable=!1,"writable"in S){S.writable=!1;return}S.set||(S.set=()=>{throw Error("Can not rewrite read-only method '"+P+"'")})}})},ld=(_,S)=>{const P={},E=I=>{I.forEach(j=>{P[j]=!0})};return v(_)?E(_):E(String(_).split(S)),P},fd=()=>{},dd=(_,S)=>_!=null&&Number.isFinite(_=+_)?_:S;function hd(_){return!!(_&&c(_.append)&&_[i]==="FormData"&&_[t])}const pd=_=>{const S=new WeakSet,P=E=>{if(R(E)){if(S.has(E))return;if(u(E))return E;if(!("toJSON"in E)){S.add(E);const I=v(E)?[]:{};return ue(E,(j,q)=>{const U=P(j);!h(U)&&(I[q]=U)}),S.delete(E),I}}return E};return P(_)},gd=g("AsyncFunction"),md=_=>_&&(R(_)||c(_))&&c(_.then)&&c(_.catch),vs=((_,S)=>_?setImmediate:S?((P,E)=>(se.addEventListener("message",({source:I,data:j})=>{I===se&&j===P&&E.length&&E.shift()()},!1),I=>{E.push(I),se.postMessage(P,"*")}))(`axios@${Math.random()}`,[]):P=>setTimeout(P))(typeof setImmediate=="function",c(se.postMessage)),vd=typeof queueMicrotask<"u"?queueMicrotask.bind(se):typeof process<"u"&&process.nextTick||vs,ys=_=>_!=null&&c(_[t]);var H={isArray:v,isArrayBuffer:s,isBuffer:u,isFormData:M,isArrayBufferView:f,isString:p,isNumber:y,isBoolean:b,isObject:R,isPlainObject:w,isEmptyObject:C,isReadableStream:B,isRequest:V,isResponse:z,isHeaders:ne,isUndefined:h,isDate:O,isFile:x,isReactNativeBlob:F,isReactNative:T,isBlob:A,isRegExp:ud,isFunction:c,isStream:W,isURLSearchParams:$,isTypedArray:qe,isFileList:D,forEac
vendor: 38,632 bytes, lines 1-9
1h:ue,merge:pe,extend:Ne,trim:ie,stripBOM:Oe,inherits:He,toFlatObject:ye,kindOf:d,kindOfTest:g,endsWith:at,toArray:At,forEachEntry:Je,matchAll:yt,isHTMLForm:It,hasOwnProperty:a,hasOwnProp:a,hasOwnInPrototypeChain:o,getSafeProp:l,reduceDescriptors:ms,freezeMethods:cd,toObjectSet:ld,toCamelCase:Vt,noop:fd,toFiniteNumber:dd,findKey:Z,global:se,isContextDefined:ve,isSpecCompliantForm:hd,toJSONObject:pd,isAsyncFn:gd,isThenable:md,setImmediate:vs,asap:vd,isIterable:ys,isSafeIterable:_=>_!=null&&o(_,t)&&ys(_)};const yd=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var _d=_=>{const S={};let P,E,I;return _&&_.split(` 2`).forEach(function(q){I=q.indexOf(":"),P=q.substring(0,I).trim().toLowerCase(),E=q.substring(I+1).trim(),!(!P||S[P]&&yd[P])&&(P==="set-cookie"?S[P]?S[P].push(E):S[P]=[E]:S[P]=S[P]?S[P]+", "+E:E)}),S};function Rd(_){let S=0,P=_.length;for(;S<P;){const E=_.charCodeAt(S);if(E!==9&&E!==32)break;S+=1}for(;P>S;){const E=_.charCodeAt(P-1);if(E!==9&&E!==32)break;P-=1}return S===0&&P===_.length?_:_.slice(S,P)}const Sd=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),bd=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ri(_,S){return H.isArray(_)?_.map(P=>ri(P,S)):Rd(String(_).replace(S,""))}const wd=_=>ri(_,Sd),Pd=_=>ri(_,bd);function _s(_){const S=Object.create(null);return H.forEach(_.toJSON(),(P,E)=>{S[E]=Pd(P)}),S}const Rs=Symbol("internals");function zt(_){return _&&String(_).trim().toLowerCase()}function Ar(_){return _===!1||_==null?_:H.isArray(_)?_.map(Ar):wd(String(_))}function Ed(_){const S=Object.create(null),P=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let E;for(;E=P.exec(_);)S[E[1]]=E[2];return S}const xd=_=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(_.trim());function ni(_,S,P,E,I){if(H.isFunction(E))return E.call(this,S,P);if(I&&(S=P),!!H.isString(S)){if(H.isString(E))return S.indexOf(E)!==-1;if(H.isRegExp(E))return E.test(S)}}function Cd(_){return _.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(S,P,E)=>P.toUpperCase()+E)}function Fd(_,S){const P=H.toCamelCase(" "+S);["get","set","has"].forEach(E=>{Object.defineProperty(_,E+P,{__proto__:null,value:function(I,j,q){return this[E].call(this,S,I,j,q)},configurable:!0})})}class ke{constructor(S){S&&this.set(S)}set(S,P,E){const I=this;function j(U,K,Y){const X=zt(K);if(!X)return;const te=H.findKey(I,X);(!te||I[te]===void 0||Y===!0||Y===void 0&&I[te]!==!1)&&(I[te||K]=Ar(U))}const q=(U,K)=>H.forEach(U,(Y,X)=>j(Y,X,K));if(H.isPlainObject(S)||S instanceof this.constructor)q(S,P);else if(H.isString(S)&&(S=S.trim())&&!xd(S))q(_d(S),P);else if(H.isObject(S)&&H.isSafeIterable(S)){let U=Object.create(null),K,Y;for(const X of S){if(!H.isArray(X))throw new TypeError("Object iterator must return a key-value pair");Y=X[0],H.hasOwnProp(U,Y)?(K=U[Y],U[Y]=H.isArray(K)?[...K,X[1]]:[K,X[1]]):U[Y]=X[1]}q(U,P)}else S!=null&&j(P,S,E);return this}get(S,P){if(S=zt(S),S){const E=H.findKey(this,S);if(E){const I=this[E];if(!P)return I;if(P===!0)return Ed(I);if(H.isFunction(P))return P.call(this,I,E);if(H.isRegExp(P))return P.exec(I);throw new TypeError("parser must be boolean|regexp|function")}}}has(S,P){if(S=zt(S),S){const E=H.findKey(this,S);return!!(E&&this[E]!==void 0&&(!P||ni(this,this[E],E,P)))}return!1}delete(S,P){const E=this;let I=!1;function j(q){if(q=zt(q),q){const U=H.findKey(E,q);U&&(!P||ni(E,E[U],U,P))&&(delete E[U],I=!0)}}return H.isArray(S)?S.forEach(j):j(S),I}clear(S){const P=Object.keys(this);let E=P.length,I=!1;for(;E--;){const j=P[E];(!S||ni(this,this[j],j,S,!0))&&(delete this[j],I=!0)}return I}normalize(S){const P=this,E={};return H.forEach(this,(I,j)=>{const q=H.findKey(E,j);if(q){P[q]=Ar(I),delete P[j];return}const U=S?Cd(j):String(j).trim();U!==j&&delete P[j],P[U]=Ar(I),E[U]=!0}),this}concat(...S){return this.constructor.concat(this,...S)}toJSON(S){const P=Object.create(null);return H.forEach(this,(E,I)=>{E!=null&&E!==!1&&(P[I]=S&&H.isArray(E)?E.join(", "):E)}),P}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([S,P])=>S+": "+P).join(` 3`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(S){return S instanceof this?S:new this(S)}static concat(S,...P){const E=new this(S);return P.forEach(I=>E.set(I)),E}static accessor(S){const E=(this[Rs]=this[Rs]={accessors:{}}).accessors,I=this.prototype;function j(q){const U=zt(q);E[U]||(Fd(I,q),E[U]=!0)}return H.isArray(S)?S.forEach(j):j(S),this}}ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),H.reduceDescriptors(ke.prototype,({value:_},S)=>{let P=S[0].toUpperCase()+S.slice(1);return{get:()=>_,set(E){this[P]=E}}}),H.freezeMethods(ke);const Od="[REDACTED ****]";function Ad(_){if(H.hasOwnProp(_,"toJSON"))return!0;let S=Object.getPrototypeOf(_);for(;S&&S!==Object.prototype;){if(H.hasOwnProp(S,"toJSON"))return!0;S=Object.getPrototypeOf(S)}return!1}function Id(_,S){const P=new Set(S.map(j=>String(j).toLowerCase())),E=[],I=j=>{if(j===null||typeof j!="object"||H.isBuffer(j))return j;if(E.indexOf(j)!==-1)return;j instanceof ke&&(j=j.toJSON()),E.push(j);let q;if(H.isArray(j))q=[],j.forEach((U,K)=>{const Y=I(U);H.isUndefined(Y)||(q[K]=Y)});else{if(!H.isPlainObject(j)&&Ad(j))return E.pop(),j;q=Object.create(null);for(const[U,K]of Object.entries(j)){const Y=P.has(U.toLowerCase())?Od:I(K);H.isUndefined(Y)||(q[U]=Y)}}return E.pop(),q};return I(_)}class re extends Error{static from(S,P,E,I,j,q){const U=new re(S.message,P||S.code,E,I,j);return Object.defineProperty(U,"cause",{__proto__:null,value:S,writable:!0,enumerable:!1,configurable:!0}),U.name=S.name,S.status!=null&&U.status==null&&(U.status=S.status),q&&Object.assign(U,q),U}constructor(S,P,E,I,j){super(S),Object.defineProperty(this,"message",{__proto__:null,value:S,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,P&&(this.code=P),E&&(this.config=E),I&&(this.request=I),j&&(this.response=j,this.status=j.status)}toJSON(){const S=this.config,P=S&&H.hasOwnProp(S,"redact")?S.redact:void 0,E=H.isArray(P)&&P.length>0?Id(S,P):H.toJSONObject(S);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E,code:this.code,status:this.status}}}re.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",re.ERR_BAD_OPTION="ERR_BAD_OPTION",re.ECONNABORTED="ECONNABORTED",re.ETIMEDOUT="ETIMEDOUT",re.ECONNREFUSED="ECONNREFUSED",re.ERR_NETWORK="ERR_NETWORK",re.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",re.ERR_DEPRECATED="ERR_DEPRECATED",re.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",re.ERR_BAD_REQUEST="ERR_BAD_REQUEST",re.ERR_CANCELED="ERR_CANCELED",re.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",re.ERR_INVALID_URL="ERR_INVALID_URL",re.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Td=null;const Ss=100;function ii(_){return H.isPlainObject(_)||H.isArray(_)}function bs(_){return H.endsWith(_,"[]")?_.slice(0,-2):_}function ai(_,S,P){return _?_.concat(S).map(function(I,j){return I=bs(I),!P&&j?"["+I+"]":I}).join(P?".":""):S}function jd(_){return H.isArray(_)&&!_.some(ii)}const Nd=H.toFlatObject(H,{},null,function(S){return/^is[A-Z]/.test(S)});function Ir(_,S,P){if(!H.isObject(_))throw new TypeError("target must be an object");S=S||new FormData,P=H.toFlatObject(P,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ce,de){return!H.isUndefined(de[ce])});const E=P.metaTokens,I=P.visitor||Re,j=P.dots,q=P.indexes,U=P.Blob||typeof Blob<"u"&&Blob,K=P.maxDepth===void 0?Ss:P.maxDepth,Y=U&&H.isSpecCompliantForm(S),X=[];if(!H.isFunction(I))throw new TypeError("visitor must be a function");function te(ee){if(ee===null)return"";if(H.isDate(ee))return ee.toISOString();if(H.isBoolean(ee))return ee.toString();if(!Y&&H.isBlob(ee))throw new re("Blob is not supported. Use a Buffer instead.");if(H.isArrayBuffer(ee)||H.isTypedArray(ee)){if(Y&&typeof U=="function")return new U([ee]);if(typeof Buffer<"u")return Buffer.from(ee);throw new re("Blob is not supported. Use a Buffer instead.",re.ERR_NOT_SUPPORT)}return ee}function le(ee){if(ee>K)throw new re("Object is too deeply nested ("+ee+" levels). Max depth: "+K,re.ERR_FORM_DATA_DEPTH_EXCEEDED)}function fe(ee,ce){if(K===1/0)return JSON.stringify(ee);const de=[];return JSON.stringify(ee,function(Qe,Te){if(!H.isObject(Te))return Te;for(;de.length&&de[de.length-1]!==this;)de.pop();return de.push(Te),le(ce+de.length-1),Te})}function Re(ee,ce,de){let be=ee;if(H.isReactNative(S)&&H.isReactNativeBlob(ee))return S.append(ai(de,ce,j),te(ee)),!1;if(ee&&!de&&typeof ee=="object"){if(H.endsWith(ce,"{}"))ce=E?ce:ce.slice(0,-2),ee=fe(ee,1);else if(H.isArray(ee)&&jd(ee)||(H.isFileList(ee)||H.endsWith(ce,"[]"))&&(be=H.toArray(ee)))return ce=bs(ce),be.forEach(function(Te,_t){!(H.isUndefined(Te)||Te===null)&&S.append(q===!0?ai([ce],_t,j):q===null?ce:ce+"[]",te(Te))}),!1}return ii(ee)?!0:(S.append(ai(de,ce,j),te(ee)),!1)}const Se=Object.assign(Nd,{defaultVisitor:Re,convertValue:te,isVisitable:ii});function oe(ee,ce,de=0){if(!H.isUndefined(ee)){if(le(de),X.indexOf(ee)!==-1)throw new Error("Circular reference detected in "+ce.join("."));X.push(ee),H.forEach(ee,function(Qe,Te){(!(H.isUndefined(Qe)||Qe===null)&&I.call(S,Qe,H.isString(Te)?Te.trim():Te,ce,Se))===!0&&oe(Qe,ce?ce.concat(Te):[Te],de+1)}),X.pop()}}if(!H.isObject(_))throw new TypeError("data must be an object");return oe(_),S}function ws(_){const S={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(_).replace(/[!'()~]|%20/g,function(E){return S[E]})}function si(_,S){this._pairs=[],_&&Ir(_,this,S)}const Ps=si.prototype;Ps.append=function(S,P){this._pairs.push([S,P])},Ps.toString=function(S){const P=S?E=>S.call(this,E,ws):ws;return this._pairs.map(function(I){return P(I[0])+"="+P(I[1])},"").join("&")};function Hd(_){return encodeURIComponent(_).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Es(_,S,P){if(!S)return _;_=_||"";const E=H.isFunction(P)?{serialize:P}:P,I=H.getSafeProp(E,"encode")||Hd,j=H.getSafeProp(E,"serialize");let q;if(j?q=j(S,E):q=H.isURLSearchParams(S)?S.toString():new si(S,E).toString(I),q){const U=_.indexOf("#");U!==-1&&(_=_.slice(0,U)),_+=(_.indexOf("?")===-1?"?":"&")+q}return _}class xs{constructor(){this.handlers=[]}use(S,P,E){return this.handlers.push({fulfilled:S,rejected:P,synchronous:E?E.synchronous:!1,runWhen:E?E.runWhen:null}),this.handlers.length-1}eject(S){this.handlers[S]&&(this.handlers[S]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(S){H.forEach(this.handlers,function(E){E!==null&&S(E)})}}var oi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},qd=typeof URLSearchParams<"u"?URLSearchParams:si,Dd=typeof FormData<"u"?FormData:null,Md=typeof Blob<"u"?Blob:null,Ud={isBrowser:!0,classes:{URLSearchParams:qd,FormData:Dd,Blob:Md},protocols:["http","https","file","blob","url","data"]};const ui=typeof window<"u"&&typeof document<"u",ci=typeof navigator=="object"&&navigator||void 0,Ld=ui&&(!ci||["ReactNative","NativeScript","NS"].indexOf(ci.product)<0),$d=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wd=ui&&window.location.href||"http://localhost";var kd=Object.freeze({__proto__:null,hasBrowserEnv:ui,hasStandardBrowserEnv:Ld,hasStandardBrowserWebWorkerEnv:$d,navigator:ci,origin:Wd}),Le={...kd,...Ud};function Bd(_,S){return Ir(_,new Le.classes.URLSearchParams,{visitor:function(P,E,I,j){return Le.isNode&&H.isBuffer(P)?(this.append(E,P.toString("base64")),!1):j.defaultVisitor.apply(this,arguments)},...S})}const Cs=Ss;function Fs(_){if(_>Cs)throw new re("FormData field is too deeply nested ("+_+" levels). Max depth: "+Cs,re.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Qd(_){const S=[],P=/\w+|\[(\w*)]/g;let E;for(;(E=P.exec(_))!==null;)Fs(S.length),S.push(E[0]==="[]"?"":E[1]||E[0]);return S}function Vd(_){const S={},P=Object.keys(_);let E;const I=P.length;let j;for(E=0;E<I;E++)j=P[E],S[j]=_[j];return S}function Os(_){function S(P,E,I,j){Fs(j);let q=P[j++];if(q==="__proto__")return!0;const U=Number.isFinite(+q),K=j>=P.length;return q=!q&&H.isArray(I)?I.length:q,K?(H.hasOwnProp(I,q)?I[q]=H.isArray(I[q])?I[q].concat(E):[I[q],E]:I[q]=E,!U):((!H.hasOwnProp(I,q)||!H.isObject(I[q]))&&(I[q]=[]),S(P,E,I[q],j)&&H.isArray(I[q])&&(I[q]=Vd(I[q])),!U)}if(H.isFormData(_)&&H.isFunction(_.entries)){const P={};return H.forEachEntry(_,(E,I)=>{S(Qd(E),I,P,0)}),P}return null}const Mt=(_,S)=>_!=null&&H.hasOwnProp(_,S)?_[S]:void 0;function zd(_,S,P){if(H.isString(_))try{return(S||JSON.parse)(_),H.trim(_)}catch(E){if(E.name!=="SyntaxError")throw E}return(P||JSON.stringify)(_)}const Kt={transitional:oi,adapter:["xhr","http","fetch"],transformRequest:[function(S,P){const E=P.getContentType()||"",I=E.indexOf("application/json")>-1,j=H.isObject(S);if(j&&H.isHTMLForm(S)&&(S=new FormData(S)),H.isFormData(S))return I?JSON.stringify(Os(S)):S;if(H.isArrayBuffer(S)||H.isBuffer(S)||H.isStream(S)||H.isFile(S)||H.isBlob(S)||H.isReadableStream(S))return S;if(H.isArrayBufferView(S))return S.buffer;if(H.isURLSearchParams(S))return P.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),S.toString();let U;if(j){const K=Mt(this,"formSerializer");if(E.indexOf("application/x-www-form-urlencoded")>-1)return Bd(S,K).toString();if((U=H.isFileList(S))||E.indexOf("multipart/form-data")>-1){const Y=Mt(this,"env"),X=Y&&Y.FormData;return Ir(U?{"files[]":S}:S,X&&new X,K)}}return j||I?(P.setContentType("application/json",!1),zd(S)):S}],transformResponse:[function(S){const P=Mt(this,"transitional")||Kt.transitional,E=P&&P.forcedJSONParsing,I=Mt(this,"responseType"),j=I==="json";if(H.isResponse(S)||H.isReadableStream(S))return S;if(S&&H.isString(S)&&(E&&!I||j)){const U=!(P&&P.silentJSONParsing)&&j;try{return JSON.parse(S,Mt(this,"parseReviver"))}catch(K){if(U)throw K.name==="SyntaxError"?re.from(K,re.ERR_BAD_RESPONSE,this,null,Mt(this,"response")):K}}return S}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Le.classes.FormData,Blob:Le.classes.Blob},validateStatus:function(S){return S>=200&&S<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch","query"],_=>{Kt.headers[_]={}});function li(_,S){const P=this||Kt,E=S||P,I=ke.from(E.headers);let j=E.data;return H.forEach(_,function(U){j=U.call(P,j,I.normalize(),S?S.status:void 0)}),I.normalize(),j}function As(_){return!!(_&&_.__CANCEL__)}class Jt extends re{constructor(S,P,E){super(S??"canceled",re.ERR_CANCELED,P,E),this.name="CanceledError",this.__CANCEL__=!0}}function Is(_,S,P){const E=P.config.validateStatus;!P.status||!E||E(P.status)?_(P):S(new re("Request failed with status code "+P.status,P.status>=400&&P.status<500?re.ERR_BAD_REQUEST:re.ERR_BAD_RESPONSE,P.config,P.request,P))}function Kd(_){const S=/^([-+\w]{1,25}):(?:\/\/)?/.exec(_);return S&&S[1]||""}function Jd(_,S){_=_||10;const P=new Array(_),E=new Array(_);let I=0,j=0,q;return S=S!==void 0?S:1e3,function(K){const Y=Date.now(),X=E[j];q||(q=Y),P[I]=K,E[I]=Y;let te=j,le=0;for(;te!==I;)le+=P[te++],te=te%_;if(I=(I+1)%_,I===j&&(j=(j+1)%_),Y-q<S)return;const fe=X&&Y-X;return fe?Math.round(le*1e3/fe):void 0}}function Gd(_,S){let P=0,E=1e3/S,I,j;const q=(Y,X=Date.now())=>{P=X,I=null,j&&(clearTimeout(j),j=null),_(...Y)};return[(...Y)=>{const X=Date.now(),te=X-P;te>=E?q(Y,X):(I=Y,j||(j=setTimeout(()=>{j=null,q(I)},E-te)))},()=>I&&q(I)]}const Tr=(_,S,P=3)=>{let E=0;const I=Jd(50,250);return Gd(j=>{if(!j||typeof j.loaded!="number")return;const q=j.loaded,U=j.lengthComputable?j.total:void 0,K=U!=null?Math.min(q,U):q,Y=Math.max(0,K-E),X=I(Y);E=Math.max(E,K);const te={loaded:K,total:U,progress:U?K/U:void 0,bytes:Y,rate:X||void 0,estimated:X&&U?(U-K)/X:void 0,event:j,lengthComputable:U!=null,[S?"download":"upload"]:!0};_(te)},P)},Ts=(_,S)=>{const P=_!=null;return[E=>S[0]({lengthComputable:P,total:_,loaded:E}),S[1]]},js=_=>(...S)=>H.asap(()=>_(...S));var Xd=Le.hasStandardBrowserEnv?((_,S)=>P=>(P=new URL(P,Le.origin),_.protocol===P.protocol&&_.host===P.host&&(S||_.port===P.port)))(new URL(Le.origin),Le.navigator&&/(msie|trident)/i.test(Le.navigator.userAgent)):()=>!0,Yd=Le.hasStandardBrowserEnv?{write(_,S,P,E,I,j,q){if(typeof document>"u")return;const U=[`${_}=${encodeURIComponent(S)}`];H.isNumber(P)&&U.push(`expires=${new Date(P).toUTCString()}`),H.isString(E)&&U.push(`path=${E}`),H.isString(I)&&U.push(`domain=${I}`),j===!0&&U.push("secure"),H.isString(q)&&U.push(`SameSite=${q}`),document.cookie=U.join("; ")},read(_){if(typeof document>"u")return null;const S=document.cookie.split(";");for(let P=0;P<S.length;P++){const E=S[P].replace(/^\s+/,""),I=E.indexOf("=");if(I!==-1&&E.slice(0,I)===_)try{return decodeURIComponent(E.slice(I+1))}catch{return E.slice(I+1)}}return null},remove(_){this.write(_,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Zd(_){return typeof _!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(_)}function eh(_,S){return S?_.replace(/\/?\/$/,"")+"/"+S.replace(/^\/+/,""):_}const th=/^https?:(?!\/\/)/i,rh=/[\t\n\r]/g;function nh(_){let S=0;for(;S<_.length&&_.charCodeAt(S)<=32;)S++;return _.slice(S)}function ih(_){return nh(_).replace(rh,"")}function Ns(_,S){if(typeof _=="string"&&th.test(ih(_)))throw new re('Invalid URL: missing "//" after protocol',re.ERR_INVALID_URL,S)}function Hs(_,S,P,E){Ns(S,E);let I=!Zd(S);return _&&(I||P===!1)?(Ns(_,E),eh(_,S)):S}const qs=_=>_ instanceof ke?{..._}:_;function Tt(_,S){_=_||{},S=S||{};const P=Object.create(null);Object.defineProperty(P,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function E(X,te,le,fe){return H.isPlainObject(X)&&H.isPlainObject(te)?H.merge.call({caseless:fe},X,te):H.isPlainObject(te)?H.merge({},te):H.isArray(te)?te.slice():te}function I(X,te,le,fe){if(H.isUndefined(te)){if(!H.isUndefined(X))return E(void 0,X,le,fe)}else return E(X,te,le,fe)}function j(X,te){if(!H.isUndefined(te))return E(void 0,te)}function q(X,te){if(H.isUndefined(te)){if(!H.isUndefined(X))return E(void 0,X)}else return E(void 0,te)}function U(X){const te=H.hasOwnProp(S,"transitional")?S.transitional:void 0;if(!H.isUndefined(te))if(H.isPlainObject(te)){if(H.hasOwnProp(te,X))return te[X]}else return;const le=H.hasOwnProp(_,"transitional")?_.transitional:void 0;if(H.isPlainObject(le)&&H.hasOwnProp(le,X))return le[X]}function K(X,te,le){if(H.hasOwnProp(S,le))return E(X,te);if(H.hasOwnProp(_,le))return E(void 0,X)}const Y={url:j,method:j,data:j,baseURL:q,transformRequest:q,transformResponse:q,paramsSerializer:q,timeout:q,timeoutMessage:q,withCredentials:q,withXSRFToken:q,adapter:q,responseType:q,xsrfCookieName:q,xsrfHeaderName:q,onUploadProgress:q,onDownloadProgress:q,decompress:q,maxContentLength:q,maxBodyLength:q,beforeRedirect:q,transport:q,httpAgent:q,httpsAgent:q,cancelToken:q,socketPath:q,allowedSocketPaths:q,responseEncoding:q,validateStatus:K,headers:(X,te,le)=>I(qs(X),qs(te),le,!0)};return H.forEach(Object.keys({..._,...S}),function(te){if(te==="__proto__"||te==="constructor"||te==="prototype")return;const le=H.hasOwnProp(Y,te)?Y[te]:I,fe=H.hasOwnProp(_,te)?_[te]:void 0,Re=H.hasOwnProp(S,te)?S[te]:void 0,Se=le(fe,Re,te);H.isUndefined(Se)&&le!==K||(P[te]=Se)}),H.hasOwnProp(S,"validateStatus")&&H.isUndefined(S.validateStatus)&&U("validateStatusUndefinedResolves")===!1&&(H.hasOwnProp(_,"validateStatus")?P.validateStatus=E(void 0,_.validateStatus):delete P.validateStatus),P}const ah=["content-type","content-length"];function sh(_,S,P){if(P!=="content-only"){_.set(S);return}Object.entries(S||{}).forEach(([E,I])=>{ah.includes(E.toLowerCase())&&_.set(E,I)})}const oh=_=>encodeURIComponent(_).replace(/%([0-9A-F]{2})/gi,(S,P)=>String.fromCharCode(parseInt(P,16)));function Ds(_){const S=Tt({},_),P=le=>H.hasOwnProp(S,le)?S[le]:void 0,E=P("data");let I=P("withXSRFToken");const j=P("xsrfHeaderName"),q=P("xsrfCookieName");let U=P("headers");const K=P("auth"),Y=P("baseURL"),X=P("allowAbsoluteUrls"),te=P("url");if(S.headers=U=ke.from(U),S.url=Es(Hs(Y,te,X,S),P("params"),P("paramsSerializer")),K){const le=H.getSafeProp(K,"username")||"",fe=H.getSafeProp(K,"password")||"";try{U.set("Authorization","Basic "+btoa(le+":"+(fe?oh(fe):"")))}catch(Re){throw re.from(Re,re.ERR_BAD_OPTION_VALUE,_)}}if(H.isFormData(E)&&(Le.hasStandardBrowserEnv||Le.hasStandardBrowserWebWorkerEnv||H.isReactNative(E)?U.setContentType(void 0):H.isFunction(E.getHeaders)&&sh(U,E.getHeaders(),P("formDataHeaderPolicy"))),Le.hasStandardBrowserEnv&&(H.isFunction(I)&&(I=I(S)),I===!0||I==null&&Xd(S.url))){const fe=j&&q&&Yd.read(q);fe&&U.set(j,fe)}return S}var uh=typeof XMLHttpRequest<"u"&&function(_){return new Promise(function(P,E){const I=Ds(_);let j=I.data;const q=ke.from(I.headers).normalize();let{responseType:U,onUploadProgress:K,onDownloadProgress:Y}=I,X,te,le,fe,Re;function Se(){fe&&fe(),Re&&Re(),I.cancelToken&&I.cancelToken.unsubscribe(X),I.signal&&I.signal.removeEventListener("abort",X)}let oe=new XMLHttpRequest;oe.open(I.method.toUpperCase(),I.url,!0),oe.timeout=I.timeout;function ee(){if(!oe)return;const de=ke.from("getAllResponseHeaders"in oe&&oe.getAllResponseHeaders()),Qe={data:!U||U==="text"||U==="json"?oe.responseText:oe.response,status:oe.status,statusText:oe.statusText,headers:de,config:_,request:oe};Is(function(_t){P(_t),Se()},function(_t){E(_t),Se()},Qe),oe=null}"onloadend"in oe?oe.onloadend=ee:oe.onreadystatechange=function(){!oe||oe.readyState!==4||oe.status===0&&!(oe.responseURL&&oe.responseURL.startsWith("file:"))||setTimeout(ee)},oe.onabort=function(){oe&&(E(new re("Request aborted",re.ECONNABORTED,_,oe)),Se(),oe=null)},oe.onerror=function(be){const Qe=be&&be.message?be.message:"Network Error",Te=new re(Qe,re.ERR_NETWORK,_,oe);Te.event=be||null,E(Te),Se(),oe=null},oe.ontimeout=function(){let be=I.timeout?"timeout of "+I.timeout+"ms exceeded":"timeout exceeded";const Qe=I.transitional||oi;I.timeoutErrorMessage&&(be=I.timeoutErrorMessage),E(new re(be,Qe.clarifyTimeoutError?re.ETIMEDOUT:re.ECONNABORTED,_,oe)),Se(),oe=null},j===void 0&&q.setContentType(null),"setRequestHeader"in oe&&H.forEach(_s(q),function(be,Qe){oe.setRequestHeader(Qe,be)}),H.isUndefined(I.withCredentials)||(oe.withCredentials=!!I.withCredentials),U&&U!=="json"&&(oe.responseType=I.responseType),Y&&([le,Re]=Tr(Y,!0),oe.addEventListener("progress",le)),K&&oe.upload&&([te,fe]=Tr(K),oe.upload.addEventListener("progress",te),oe.upload.addEventListener("loadend",fe)),(I.cancelToken||I.signal)&&(X=de=>{oe&&(E(!de||de.type?new Jt(null,_,oe):de),oe.abort(),Se(),oe=null)},I.cancelToken&&I.cancelToken.subscribe(X),I.signal&&(I.signal.aborted?X():I.signal.addEventListener("abort",X)));const ce=Kd(I.url);if(ce&&!Le.protocols.includes(ce)){E(new re("Unsupported protocol "+ce+":",re.ERR_BAD_REQUEST,_)),Se();return}oe.send(j||null)})};const ch=(_,S)=>{if(_=_?_.filter(Boolean):[],!S&&!_.length)return;const P=new AbortController;let E=!1;const I=function(K){if(!E){E=!0,q();const Y=K instanceof Error?K:this.reason;P.abort(Y instanceof re?Y:new Jt(Y instanceof Error?Y.message:Y))}};let j=S&&setTimeout(()=>{j=null,I(new re(`timeout of ${S}ms exceeded`,re.ETIMEDOUT))},S);const q=()=>{_&&(j&&clearTimeout(j),j=null,_.forEach(K=>{K.unsubscribe?K.unsubscribe(I):K.removeEventListener("abort",I)}),_=null)};_.forEach(K=>K.addEventListener("abort",I,{once:!0}));const{signal:U}=P;return U.unsubscribe=()=>H.asap(q),U},lh=function*(_,S){let P=_.byteLength;if(P<S){yield _;return}let E=0,I;for(;E<P;)I=E+S,yield _.slice(E,I),E=I},fh=async function*(_,S){for await(const P of dh(_))yield*lh(P,S)},dh=async function*(_){if(_[Symbol.asyncIterator]){yield*_;return}const S=_.getReader();try{for(;;){const{done:P,value:E}=await S.read();if(P)break;yield E}}finally{await S.cancel()}},Ms=(_,S,P,E)=>{const I=fh(_,S);let j=0,q,U=K=>{q||(q=!0,E&&E(K))};return new ReadableStream({async pull(K){try{const{done:Y,value:X}=await I.next();if(Y){U(),K.close();return}let te=X.byteLength;if(P){let le=j+=te;P(le)}K.enqueue(new Uint8Array(X))}catch(Y){throw U(Y),Y}},cancel(K){return U(K),I.return()}},{highWaterMark:2})},jr=_=>_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102,hh=(_,S,P)=>S+2<P&&jr(_.charCodeAt(S+1))&&jr(_.charCodeAt(S+2));function ph(_){if(!_||typeof _!="string"||!_.startsWith("data:"))return 0;const S=_.indexOf(",");if(S<0)return 0;const P=_.slice(5,S),E=_.slice(S+1);if(/;base64/i.test(P)){let q=E.length;const U=E.length;for(let fe=0;fe<U;fe++)if(E.charCodeAt(fe)===37&&fe+2<U){const Re=E.charCodeAt(fe+1),Se=E.charCodeAt(fe+2);jr(Re)&&jr(Se)&&(q-=2,fe+=2)}let K=0,Y=U-1;const X=fe=>fe>=2&&E.charCodeAt(fe-2)===37&&E.charCodeAt(fe-1)===51&&(E.charCodeAt(fe)===68||E.charCodeAt(fe)===100);Y>=0&&(E.charCodeAt(Y)===61?(K++,Y--):X(Y)&&(K++,Y-=3)),K===1&&Y>=0&&(E.charCodeAt(Y)===61||X(Y))&&K++;const le=Math.floor(q/4)*3-(K||0);return le>0?le:0}let j=0;for(let q=0,U=E.length;q<U;q++){const K=E.charCodeAt(q);if(K===37&&hh(E,q,U))j+=1,q+=2;else if(K<128)j+=1;else if(K<2048)j+=2;else if(K>=55296&&K<=56319&&q+1<U){const Y=E.charCodeAt(q+1);Y>=56320&&Y<=57343?(j+=4,q++):j+=3}else j+=3}return j}const fi="1.18.1",Us=64*1024,{isFunction:Nr}=H,gh=_=>encodeURIComponent(_).replace(/%([0-9A-F]{2})/gi,(S,P)=>String.fromCharCode(parseInt(P,16))),Ls=_=>{if(!H.isString(_))return _;try{return decodeURIComponent(_)}catch{return _}},$s=(_,...S)=>{try{return!!_(...S)}catch{return!1}},mh=_=>{const S=_.indexOf("://");let P=_;return S!==-1&&(P=P.slice(S+3)),P.includes("@")||P.includes(":")},vh=_=>{const S=H.global!==void 0&&H.global!==null?H.global:globalThis,{ReadableStream:P,TextEncoder:E}=S;_=H.merge.call({skipUndefined:!0},{Request:S.Request,Response:S.Response},_);const{fetch:I,Request:j,Response:q}=_,U=I?Nr(I):typeof fetch=="function",K=Nr(j),Y=Nr(q);if(!U)return!1;const X=U&&Nr(P),te=U&&(typeof E=="function"?(ee=>ce=>ee.encode(ce))(new E):async ee=>new Uint8Array(await new j(ee).arrayBuffer())),le=K&&X&&$s(()=>{let ee=!1;const ce=new j(Le.origin,{body:new P,method:"POST",get duplex(){return ee=!0,"half"}}),de=ce.headers.has("Content-Type");return ce.body!=null&&ce.body.cancel(),ee&&!de}),fe=Y&&X&&$s(()=>H.isReadableStream(new q("").body)),Re={stream:fe&&(ee=>ee.body)};U&&["text","arrayBuffer","blob","formData","stream"].forEach(ee=>{!Re[ee]&&(Re[ee]=(ce,de)=>{let be=ce&&ce[ee];if(be)return be.call(ce);throw new re(`Response type '${ee}' is not supported`,re.ERR_NOT_SUPPORT,de)})});const Se=async ee=>{if(ee==null)return 0;if(H.isBlob(ee))return ee.size;if(H.isSpecCompliantForm(ee))return(await new j(Le.origin,{method:"POST",body:ee}).arrayBuffer()).byteLength;if(H.isArrayBufferView(ee)||H.isArrayBuffer(ee))return ee.byteLength;if(H.isURLSearchParams(ee)&&(ee=ee+""),H.isString(ee))return(await te(ee)).byteLength},oe=async(ee,ce)=>{const de=H.toFiniteNumber(ee.getContentLength());return de??Se(ce)};return async ee=>{let{url:ce,method:de,data:be,signal:Qe,cancelToken:Te,timeout:_t,onDownloadProgress:mi,onUploadProgress:vi,responseType:Rt,headers:St,withCredentials:Dr="same-origin",fetchOptions:Ks,maxContentLength:st,maxBodyLength:Mr}=Ds(ee);const Gt=H.isNumber(st)&&st>-1,yi=H.isNumber(Mr)&&Mr>-1,Ph=Ee=>H.hasOwnProp(ee,Ee)?ee[Ee]:void 0;let Js=I||fetch;Rt=Rt?(Rt+"").toLowerCase():"text";let bt=ch([Qe,Te&&Te.toAbortSignal()],_t),$e=null;const Nt=bt&&bt.unsubscribe&&(()=>{bt.unsubscribe()});let Ut,Xt=null;const Gs=()=>new re("Request body larger than maxBodyLength limit",re.ERR_BAD_REQUEST,ee,$e);try{let Ee;const Ye=Ph("auth");if(Ye){const he=H.getSafeProp(Ye,"username")||"",Ge=H.getSafeProp(Ye,"password")||"";Ee={username:he,password:Ge}}if(mh(ce)){const he=new URL(ce,Le.origin);if(!Ee&&(he.username||he.password)){const Ge=Ls(he.username),wt=Ls(he.password);Ee={username:Ge,password:wt}}(he.username||he.password)&&(he.username="",he.password="",ce=he.href)}if(Ee&&(St.delete("authorization"),St.set("Authorization","Basic "+btoa(gh((Ee.username||"")+":"+(Ee.password||""))))),Gt&&typeof ce=="string"&&ce.startsWith("data:")&&ph(ce)>st)throw new re("maxContentLength size of "+st+" exceeded",re.ERR_BAD_RESPONSE,ee,$e);if(yi&&de!=="get"&&de!=="head"){const he=await Se(be);if(typeof he=="number"&&isFinite(he)&&(Ut=he,he>Mr))throw Gs()}const Ur=yi&&(H.isReadableStream(be)||H.isStream(be)),Xs=(he,Ge,wt)=>Ms(he,Us,Ht=>{if(yi&&Ht>Mr)throw Xt=Gs();Ge&&Ge(Ht)},wt);if(le&&de!=="get"&&de!=="head"&&(vi||Ur)){if(Ut=Ut??await oe(St,be),Ut!==0||Ur){let he=new j(ce,{method:"POST",body:be,duplex:"half"}),Ge;if(H.isFormData(be)&&(Ge=he.headers.get("content-type"))&&St.setContentType(Ge),he.body){const[wt,Ht]=vi&&Ts(Ut,Tr(js(vi)))||[];be=Xs(he.body,wt,Ht)}}}else if(Ur&&!K&&X&&de!=="get"&&de!=="head")be=Xs(be);else if(Ur&&K&&!le&&de!=="get"&&de!=="head")throw new re("Stream request bodies are not supported by the current fetch implementation",re.ERR_NOT_SUPPORT,ee,$e);H.isString(Dr)||(Dr=Dr?"include":"omit");const Eh=K&&"credentials"in j.prototype;if(H.isFormData(be)){const he=St.getContentType();he&&/^multipart\/form-data/i.test(he)&&!/boundary=/i.test(he)&&St.delete("content-type")}St.set("User-Agent","axios/"+fi,!1);const Ys={...Ks,signal:bt,method:de.toUpperCase(),headers:_s(St.normalize()),body:be,duplex:"half",credentials:Eh?Dr:void 0};$e=K&&new j(ce,Ys);let dt=await(K?Js($e,Ks):Js(ce,Ys));const Zs=ke.from(dt.headers);if(Gt){const he=H.toFiniteNumber(Zs.getContentLength());if(he!=null&&he>st)throw new re("maxContentLength size of "+st+" exceeded",re.ERR_BAD_RESPONSE,ee,$e)}const _i=fe&&(Rt==="stream"||Rt==="response");if(fe&&dt.body&&(mi||Gt||_i&&Nt)){const he={};["status","statusText","headers"].forEach(Yt=>{he[Yt]=dt[Yt]});const Ge=H.toFiniteNumber(Zs.getContentLength()),[wt,Ht]=mi&&Ts(Ge,Tr(js(mi),!0))||[];let eo=0;const xh=Yt=>{if(Gt&&(eo=Yt,eo>st))throw new re("maxContentLength size of "+st+" exceeded",re.ERR_BAD_RESPONSE,ee,$e);wt&&wt(Yt)};dt=new q(Ms(dt.body,Us,xh,()=>{Ht&&Ht(),Nt&&Nt()}),he)}Rt=Rt||"text";let ht=await Re[H.findKey(Re,Rt)||"text"](dt,ee);if(Gt&&!fe&&!_i){let he;if(ht!=null&&(typeof ht.byteLength=="number"?he=ht.byteLength:typeof ht.size=="number"?he=ht.size:typeof ht=="string"&&(he=typeof E=="function"?new E().encode(ht).byteLength:ht.length)),typeof he=="number"&&he>st)throw new re("maxContentLength size of "+st+" exceeded",re.ERR_BAD_RESPONSE,ee,$e)}return!_i&&Nt&&Nt(),await new Promise((he,Ge)=>{Is(he,Ge,{data:ht,headers:ke.from(dt.headers),status:dt.status,statusText:dt.statusText,config:ee,request:$e})})}catch(Ee){if(Nt&&Nt(),bt&&bt.aborted&&bt.reason instanceof re){const Ye=bt.reason;throw Ye.config=ee,$e&&(Ye.request=$e),Ee!==Ye&&Object.defineProperty(Ye,"cause",{__proto__:null,value:Ee,writable:!0,enumerable:!1,configurable:!0}),Ye}if(Xt)throw $e&&!Xt.request&&(Xt.request=$e),Xt;if(Ee instanceof re)throw $e&&!Ee.request&&(Ee.request=$e),Ee;if(Ee&&Ee.name==="TypeError"&&/Load failed|fetch/i.test(Ee.message)){const Ye=new re("Network Error",re.ERR_NETWORK,ee,$e,Ee&&Ee.response);throw Object.defineProperty(Ye,"cause",{__proto__:null,value:Ee.cause||Ee,writable:!0,enumerable:!1,configurable:!0}),Ye}throw re.from(Ee,Ee&&Ee.code,ee,$e,Ee&&Ee.response)}}},yh=new Map,Ws=_=>{let S=_&&_.env||{};const{fetch:P,Request:E,Response:I}=S,j=[E,I,P];let q=j.length,U=q,K,Y,X=yh;for(;U--;)K=j[U],Y=X.get(K),Y===void 0&&X.set(K,Y=U?new Map:vh(S)),X=Y;return Y};Ws();const di={http:Td,xhr:uh,fetch:{get:Ws}};H.forEach(di,(_,S)=>{if(_){try{Object.defineProperty(_,"name",{__proto__:null,value:S})}catch{}Object.defineProperty(_,"adapterName",{__proto__:null,value:S})}});const ks=_=>`- ${_}`,_h=_=>H.isFunction(_)||_===null||_===!1;function Rh(_,S){_=H.isArray(_)?_:[_];const{length:P}=_;let E,I;const j={};for(let q=0;q<P;q++){E=_[q];let U;if(I=E,!_h(E)&&(I=di[(U=String(E)).toLowerCase()],I===void 0))throw new re(`Unknown adapter '${U}'`);if(I&&(H.isFunction(I)||(I=I.get(S))))break;j[U||"#"+q]=I}if(!I){const q=Object.entries(j).map(([K,Y])=>`adapter ${K} `+(Y===!1?"is not supported by the environment":"is not available in the build"));let U=P?q.length>1?`since : 4`+q.map(ks).join(` 5`):" "+ks(q[0]):"as no adapter specified";throw new re("There is no suitable adapter to dispatch the request "+U,re.ERR_NOT_SUPPORT)}return I}var Bs={getAdapter:Rh,adapters:di};function hi(_){if(_.cancelToken&&_.cancelToken.throwIfRequested(),_.signal&&_.signal.aborted)throw new Jt(null,_)}function Qs(_){return hi(_),_.headers=ke.from(_.headers),_.data=li.call(_,_.transformRequest),["post","put","patch"].indexOf(_.method)!==-1&&_.headers.setContentType("application/x-www-form-urlencoded",!1),Bs.getAdapter(_.adapter||Kt.adapter,_)(_).then(function(E){hi(_),_.response=E;try{E.data=li.call(_,_.transformResponse,E)}finally{delete _.response}return E.headers=ke.from(E.headers),E},function(E){if(!As(E)&&(hi(_),E&&E.response)){_.response=E.response;try{E.response.data=li.call(_,_.transformResponse,E.response)}finally{delete _.response}E.response.headers=ke.from(E.response.headers)}return Promise.reject(E)})}const Hr={};["object","boolean","number","function","string","symbol"].forEach((_,S)=>{Hr[_]=function(E){return typeof E===_||"a"+(S<1?"n ":" ")+_}});const Vs={};Hr.transitional=function(S,P,E){function I(j,q){return"[Axios v"+fi+"] Transitional option '"+j+"'"+q+(E?". "+E:"")}return(j,q,U)=>{if(S===!1)throw new re(I(q," has been removed"+(P?" in "+P:"")),re.ERR_DEPRECATED);return P&&!Vs[q]&&(Vs[q]=!0,console.warn(I(q," has been deprecated since v"+P+" and will be removed in the near future"))),S?S(j,q,U):!0}},Hr.spelling=function(S){return(P,E)=>(console.warn(`${E} is likely a misspelling of ${S}`),!0)};function Sh(_,S,P){if(typeof _!="object"||_===null)throw new re("options must be an object",re.ERR_BAD_OPTION_VALUE);const E=Object.keys(_);let I=E.length;for(;I-- >0;){const j=E[I],q=Object.prototype.hasOwnProperty.call(S,j)?S[j]:void 0;if(q){const U=_[j],K=U===void 0||q(U,j,_);if(K!==!0)throw new re("option "+j+" must be "+K,re.ERR_BAD_OPTION_VALUE);continue}if(P!==!0)throw new re("Unknown option "+j,re.ERR_BAD_OPTION)}}var qr={assertOptions:Sh,validators:Hr};const Be=qr.validators;class jt{constructor(S){this.defaults=S||{},this.interceptors={request:new xs,response:new xs}}async request(S,P){try{return await this._request(S,P)}catch(E){if(E instanceof Error){let I={};Error.captureStackTrace?Error.captureStackTrace(I):I=new Error;const j=(()=>{if(!I.stack)return"";const q=I.stack.indexOf(` 6`);return q===-1?"":I.stack.slice(q+1)})();try{if(!E.stack)E.stack=j;else if(j){const q=j.indexOf(` 7`),U=q===-1?-1:j.indexOf(` 8`,q+1),K=U===-1?"":j.slice(U+1);String(E.stack).endsWith(K)||(E.stack+=` 9`+j)}}catch{}}throw E}}_request(S,P){typeof S=="string"?(P=P||{},P.url=S):P=S||{},P=Tt(this.defaults,P);const{transitional:E,paramsSerializer:I,headers:j}=P;E!==void 0&&qr.assertOptions(E,{silentJSONParsing:Be.transitional(Be.boolean),forcedJSONParsing:Be.transitional(Be.boolean),clarifyTimeoutError:Be.transitional(Be.boolean),legacyInterceptorReqResOrdering:Be.transitional(Be.boolean),advertiseZstdAcceptEncoding:Be.transitional(Be.boolean),validateStatusUndefinedResolves:Be.transitional(Be.boolean)},!1),I!=null&&(H.isFunction(I)?P.paramsSerializer={serialize:I}:qr.assertOptions(I,{encode:Be.function,serialize:Be.function},!0)),P.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?P.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:P.allowAbsoluteUrls=!0),qr.assertOptions(P,{baseUrl:Be.spelling("baseURL"),withXsrfToken:Be.spelling("withXSRFToken")},!0),P.method=(P.method||this.defaults.method||"get").toLowerCase();let q=j&&H.merge(j.common,j[P.method]);j&&H.forEach(["delete","get","head","post","put","patch","query","common"],Re=>{delete j[Re]}),P.headers=ke.concat(q,j);const U=[];let K=!0;this.interceptors.request.forEach(function(Se){if(typeof Se.runWhen=="function"&&Se.runWhen(P)===!1)return;K=K&&Se.synchronous;const oe=P.transitional||oi;oe&&oe.legacyInterceptorReqResOrdering?U.unshift(Se.fulfilled,Se.rejected):U.push(Se.fulfilled,Se.rejected)});const Y=[];this.interceptors.response.forEach(function(Se){Y.push(Se.fulfilled,Se.rejected)});let X,te=0,le;if(!K){const Re=[Qs.bind(this),void 0];for(Re.unshift(...U),Re.push(...Y),le=Re.length,X=Promise.resolve(P);te<le;)X=X.then(Re[te++],Re[te++]);return X}le=U.length;let fe=P;for(;te<le;){const Re=U[te++],Se=U[te++];try{fe=Re(fe)}catch(oe){Se.call(this,oe);break}}try{X=Qs.call(this,fe)}catch(Re){return Promise.reject(Re)}for(te=0,le=Y.length;te<le;)X=X.then(Y[te++],Y[te++]);return X}getUri(S){S=Tt(this.defaults,S);const P=Hs(S.baseURL,S.url,S.allowAbsoluteUrls,S);return Es(P,S.params,S.paramsSerializer)}}H.forEach(["delete","get","head","options"],function(S){jt.prototype[S]=function(P,E){return this.request(Tt(E||{},{method:S,url:P,data:E&&H.hasOwnProp(E,"data")?E.data:void 0}))}}),H.forEach(["post","put","patch","query"],function(S){function P(E){return function(j,q,U){return this.request(Tt(U||{},{method:S,headers:E?{"Content-Type":"multipart/form-data"}:{},url:j,data:q}))}}jt.prototype[S]=P(),S!=="query"&&(jt.prototype[S+"Form"]=P(!0))});class pi{constructor(S){if(typeof S!="function")throw new TypeError("executor must be a function.");let P;this.promise=new Promise(function(j){P=j});const E=this;this.promise.then(I=>{if(!E._listeners)return;let j=E._listeners.length;for(;j-- >0;)E._listeners[j](I);E._listeners=null}),this.promise.then=I=>{let j;const q=new Promise(U=>{E.subscribe(U),j=U}).then(I);return q.cancel=function(){E.unsubscribe(j)},q},S(function(j,q,U){E.reason||(E.reason=new Jt(j,q,U),P(E.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(S){if(this.reason){S(this.reason);return}this._listeners?this._listeners.push(S):this._listeners=[S]}unsubscribe(S){if(!this._listeners)return;const P=this._listeners.indexOf(S);P!==-1&&this._listeners.splice(P,1)}toAbortSignal(){const S=new AbortController,P=E=>{S.abort(E)};return this.subscribe(P),S.signal.unsubscribe=()=>this.unsubscribe(P),S.signal}static source(){let S;return{token:new pi(function(I){S=I}),cancel:S}}}function bh(_){return function(P){return _.apply(null,P)}}function wh(_){return H.isObject(_)&&_.isAxiosError===!0}const gi={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
9alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(gi).forEach(([_,S])=>{gi[S]=_});function zs(_){const S=new jt(_),P=e(jt.prototype.request,S);return H.extend(P,jt.prototype,S,{allOwnKeys:!0}),H.extend(P,S,null,{allOwnKeys:!0}),P.create=function(I){return zs(Tt(_,I))},P}const De=zs(Kt);return De.Axios=jt,De.CanceledError=Jt,De.CancelToken=pi,De.isCancel=As,De.VERSION=fi,De.toFormData=Ir,De.AxiosError=re,De.Cancel=De.CanceledError,De.all=function(S){return Promise.all(S)},De.spread=bh,De.isAxiosError=wh,De.mergeConfig=Tt,De.AxiosHeaders=ke,De.formToJSON=_=>Os(H.isHTMLForm(_)?new FormData(_):_),De.getAdapter=Bs.getAdapter,De.HttpStatusCode=gi,De.default=De,Wi=De,Wi}var qt={},tr={},Do;function gp(){return Do||(Do=1,Object.defineProperty(tr,"__esModule",{value:!0}),tr.arrayableParams=void 0,tr.arrayableParams={query_by:"query_by",query_by_weights:"query_by_weights",facet_by:"facet_by",group_by:"group_by",include_fields:"include_fields",exclude_fields:"exclude_fields",highlight_fields:"highlight_fields",highlight_full_fields:"highlight_full_fields",pinned_hits:"pinned_hits",hidden_hits:"hidden_hits",infix:"infix",override_tags:"override_tags",num_typos:"num_typos",prefix:"prefix",sort_by:"sort_by"}),tr}var Mo;function xr(){if(Mo)return qt;Mo=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.toErrorWithMessage=qt.normalizeArrayableParams=void 0;var e=ae,r=gp();function n(l){return Object.keys(r.arrayableParams).filter(function(d){return l[d]!==void 0}).every(function(d){return i(l[d])})}function t(l){var d=e.__assign({},l),g=Object.keys(r.arrayableParams).filter(function(m){return Array.isArray(d[m])}).map(function(m){return d[m]=d[m].join(","),m});if(!g.length&&n(d))return d;if(!n(d))throw new Error("Failed to normalize arrayable params: ".concat(JSON.stringify(d)));return d}qt.normalizeArrayableParams=t;function i(l){return!Array.isArray(l)}function a(l){return typeof l=="object"&&l!==null&&"message"in l&&typeof l.message=="string"}function o(l){if(a(l))return l;try{return typeof l=="string"?new Error(l):new Error(JSON.stringify(l))}catch{return new Error(String(l))}}return qt.toErrorWithMessage=o,qt}var Uo;function Wl(){if(Uo)return en;Uo=1,Object.defineProperty(en,"__esModule",{value:!0});var e=ae,r=e.__importDefault(pp()),n=Wa,t=Wa,i=Er(),a=e.__importDefault(it()),o=xr(),l="X-TYPESENSE-API-KEY",d=!0,g=!1,m=typeof process<"u"&&process.versions!=null&&process.versions.node!=null&&typeof window>"u",v=(function(){function h(u){this.configuration=u,this.apiKey=this.configuration.apiKey,this.nodes=this.configuration.nodes==null?this.configuration.nodes:JSON.parse(JSON.stringify(this.configuration.nodes)),this.nearestNode=this.configuration.nearestNode==null?this.configuration.nearestNode:JSON.parse(JSON.stringify(this.configuration.nearestNode)),this.connectionTimeoutSeconds=this.configuration.connectionTimeoutSeconds,this.healthcheckIntervalSeconds=this.configuration.healthcheckIntervalSeconds,this.numRetriesPerRequest=this.configuration.numRetries,this.retryIntervalSeconds=this.configuration.retryIntervalSeconds,this.sendApiKeyAsQueryParam=this.configuration.sendApiKeyAsQueryParam,this.additionalUserHeaders=this.configuration.additionalHeaders,this.logger=this.configuration.logger,this.initializeMetadataForNodes(),this.currentNodeIndex=-1}return h.prototype.get=function(u,s,f){s===void 0&&(s={});var p=f===void 0?{}:f,c=p.abortSignal,y=c===void 0?null:c,R=p.responseType,b=R===void 0?void 0:R,w=p.streamConfig,C=w===void 0?void 0:w,O=p.isStreamingRequest;return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(x){return[2,this.performRequest("get",u,{queryParameters:s,abortSignal:y,responseType:b,streamConfig:C,isStreamingRequest:O})]})})},h.prototype.delete=function(u,s){return s===void 0&&(s={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(f){return[2,this.performRequest("delete",u,{queryParameters:s,isStreamingRequest:!1})]})})},h.prototype.post=function(u,s,f,p,c){s===void 0&&(s={}),f===void 0&&(f={}),p===void 0&&(p={});var y=c===void 0?{}
9:c,R=y.abortSignal,b=R===void 0?null:R,w=y.responseType,C=w===void 0?void 0:w,O=y.streamConfig,x=O===void 0?void 0:O,F=y.isStreamingRequest;return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(T){return[2,this.performRequest("post",u,{queryParameters:f,bodyParameters:s,additionalHeaders:p,abortSignal:b,responseType:C,streamConfig:x,isStreamingRequest:F})]})})},h.prototype.put=function(u,s,f){return s===void 0&&(s={}),f===void 0&&(f={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(p){return[2,this.performRequest("put",u,{queryParameters:f,bodyParameters:s,isStreamingRequest:!1})]})})},h.prototype.patch=function(u,s,f){return s===void 0&&(s={}),f===void 0&&(f={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(p){return[2,this.performRequest("patch",u,{queryParameters:f,bodyParameters:s,isStreamingRequest:!1})]})})},h.prototype.getAdapter=function(){if(this.configuration.axiosAdapter){if(typeof this.configuration.axiosAdapter=="function")return this.configuration.axiosAdapter;var u=typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers";return u?r.default.getAdapter(this.configuration.axiosAdapter).bind(globalThis):r.default.getAdapter(this.configuration.axiosAdapter)}},h.prototype.performRequest=function(u,s,f){var p,c,y,R,b=f.queryParameters,w=b===void 0?null:b,C=f.bodyParameters,O=C===void 0?null:C,x=f.additionalHeaders,F=x===void 0?{}:x,T=f.abortSignal,A=T===void 0?null:T,D=f.responseType,W=D===void 0?void 0:D,Q=f.skipConnectionTimeout,J=Q===void 0?!1:Q,k=f.enableKeepAlive,M=k===void 0?void 0:k,$=f.streamConfig,B=$===void 0?void 0:$,V=f.isStreamingRequest;return e.__awaiter(this,void 0,void 0,function(){var z,ne,ie,ue,Z,se,ve;return e.__generator(this,function(pe){switch(pe.label){case 0:this.configuration.validate(),V&&(this.logger.debug("Request: Performing streaming request to ".concat(s)),!m&&typeof fetch<"u"&&(this.logger.debug("Using fetch adapter for browser streaming"),W="stream")),z=Date.now(),ie=!1,this.logger.debug("Request #".concat(z,": Performing ").concat(u.toUpperCase()," request: ").concat(s)),ue=function(Ne){var Oe,He,ye,at,At,qe,Je;return e.__generator(this,function(yt){switch(yt.label){case 0:if(Oe=Z.getNextNode(z),Z.logger.debug("Request #".concat(z,": Attempting ").concat(u.toUpperCase()," request Try #").concat(Ne," to Node ").concat(Oe.index)),A&&A.aborted)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];He=void 0,yt.label=1;case 1:return yt.trys.push([1,3,5,6]),ye={method:u,url:Z.uriFor(s,Oe),headers:Object.assign({},Z.defaultHeaders(),F,Z.additionalUserHeaders),maxContentLength:1/0,maxBodyLength:1/0,validateStatus:function(It){return It>0},transformResponse:[function(It,Vt){var Or=It;return Vt!==void 0&&typeof It=="string"&&Vt["content-type"]&&Vt["content-type"].startsWith("application/json")&&(Or=JSON.parse(It)),Or}]},ye.adapter=V&&!m?"fetch":Z.getAdapter(),J!==!0&&(ye.timeout=Z.connectionTimeoutSeconds*1e3),w&&Object.keys(w).length!==0&&(ye.params=w),Z.sendApiKeyAsQueryParam&&(ye.params=ye.params||{},ye.params["x-typesense-api-key"]=Z.apiKey),Z.configuration.httpAgent?(Z.logger.debug("Request #".concat(z,": Using custom httpAgent")),ye.httpAgent=Z.configuration.httpAgent):M===!0&&(m?(Z.logger.debug("Request #".concat(z,": Enabling KeepAlive")),ye.httpAgent=new n.Agent({keepAlive:!0})):Z.logger.warn("Request #".concat(z,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),Z.configuration.httpsAgent?(Z.logger.debug("Request #".concat(z,": Using custom httpsAgent")),ye.httpsAgent=Z.configuration.httpsAgent):M===!0&&(m?(Z.logger.debug("Request #".concat(z,": Enabling keepAlive")),ye.httpsAgent=new t.Agent({keepAlive:!0})):Z.logger.warn("Request #".concat(z,": Cannot use custom httpAgent in a browser environment to enable keepAlive"))),Z.configuration.paramsSerializer&&(Z.logger.debug("Request #".concat(z,": Using custom paramsSerializer")),ye.paramsSerializer=Z.configuration.paramsSerializer),O&&(typeof O=="string"&&O.length!==0||typeof O=="object"&&Object.keys(O).length!==0)&&(ye.data=O),A&&(at=r.default.CancelToken,At=at.source(),He
9=function(){ie=!0,At.cancel()},A.addEventListener("abort",He),ye.cancelToken=At.token),V?(ye.responseType="stream",m||(ye.headers=e.__assign(e.__assign({},ye.headers),{Accept:"text/event-stream"}))):W&&(ye.responseType=W),[4,(0,r.default)(ye)];case 2:if(qe=yt.sent(),qe.status>=1&&qe.status<=499&&Z.setNodeHealthcheck(Oe,d),Z.logger.debug("Request #".concat(z,": Request to Node ").concat(Oe.index," was made. Response Code was ").concat(qe.status,".")),qe.status>=200&&qe.status<300)return V?[2,{value:Z.handleStreamingResponse(qe,B)}]:[2,{value:Promise.resolve(qe.data)}];if(qe.status<500)return[2,{value:Promise.reject(Z.customErrorForResponse(qe,(p=qe.data)===null||p===void 0?void 0:p.message,ye.data))}];throw Z.customErrorForResponse(qe,(c=qe.data)===null||c===void 0?void 0:c.message,ye.data);case 3:if(Je=yt.sent(),ie||Z.setNodeHealthcheck(Oe,g),ne=Je,Z.logger.warn("Request #".concat(z,": Request to Node ").concat(Oe.index,' failed due to "').concat((y=Je==null?void 0:Je.code)!==null&&y!==void 0?y:""," ").concat(Je.message).concat(Je.response==null?"":" - "+JSON.stringify((R=Je.response)===null||R===void 0?void 0:R.data),'"')),ie)return[2,{value:Promise.reject(new Error("Request aborted by caller."))}];if(V&&Z.invokeOnErrorCallback(Je,B),Ne<Z.numRetriesPerRequest+1)Z.logger.warn("Request #".concat(z,": Sleeping for ").concat(Z.retryIntervalSeconds,"s and then retrying request..."));else return Z.logger.debug("Request #".concat(z,": No retries left. Raising last error")),[2,{value:Promise.reject(ne)}];return[4,Z.timer(Z.retryIntervalSeconds)];case 4:return yt.sent(),[3,6];case 5:return A&&He&&A.removeEventListener("abort",He),[7];case 6:return[2]}})},Z=this,se=1,pe.label=1;case 1:return se<=this.numRetriesPerRequest+1?[5,ue(se)]:[3,4];case 2:if(ve=pe.sent(),typeof ve=="object")return[2,ve.value];pe.label=3;case 3:return se++,[3,1];case 4:return this.logger.debug("Request #".concat(z,": No retries left. Raising last error")),[2,Promise.reject(ne)]}})})},h.prototype.processStreamingLine=function(u){if(!u.trim()||u==="data: [DONE]")return null;if(u.startsWith("data: "))return this.processDataLine(u.slice(6).trim());if(u.trim().startsWith("{"))try{var s=JSON.parse(u.trim());return s&&typeof s=="object"?(s.conversation_id||(s.conversation_id="unknown"),!s.message&&s.message!==""&&(s.message=""),s):{conversation_id:"unknown",message:JSON.stringify(s)}}catch{return{conversation_id:"unknown",message:u.trim()}}return{conversation_id:"unknown",message:u.trim()}},h.prototype.processDataLine=function(u){if(!u)return null;if(u.startsWith("{"))try{var s=JSON.parse(u);return s&&typeof s=="object"?(s.conversation_id||(s.conversation_id="unknown"),!s.message&&s.message!==""&&(s.message=""),s):{conversation_id:"unknown",message:JSON.stringify(s)}}catch{return{conversation_id:"unknown",message:u}}return{conversation_id:"unknown",message:u}},h.prototype.handleStreamingResponse=function(u,s){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(f){return this.logger.debug("Handling streaming response. Env
9ironment: ".concat(m?"Node.js":"Browser")),m&&u.data?[2,this.handleNodeStreaming(u,s)]:m?(this.logger.debug("Processing non-streaming response"),this.invokeOnCompleteCallback(u.data,s),[2,Promise.resolve(u.data)]):[2,this.handleBrowserStreaming(u,s)]})})},h.prototype.handleNodeStreaming=function(u,s){var f=this;return this.logger.debug("Processing Node.js stream"),new Promise(function(p,c){var y=u.data,R=[],b="";y.on("data",function(w){var C;try{var O=w.toString();b+=O;var x=b.split(` 10`);b=(C=x.pop())!==null&&C!==void 0?C:"",f.processStreamLines(x,R,s)}catch(F){c(F)}}),y.on("end",function(){if(b.trim().length>0){var w=b.split(` 11`);f.processStreamLines(w,R,s)}f.finalizeStreamResult(R,p,u,s)}),y.on("error",function(w){f.logger.error("Stream error: ".concat(w)),f.invokeOnErrorCallback(w,s),c(w)})})},h.prototype.handleBrowserStreaming=function(u,s){var f=this;return this.logger.debug("Processing browser stream"),new Promise(function(p,c){return e.__awaiter(f,void 0,void 0,function(){return e.__generator(this,function(y){try{return u.data&&typeof u.data.getReader=="function"?[2,this.handleBrowserReadableStream(u.data,p,c,u,s)]:typeof u.data=="string"?[2,this.handleBrowserStringResponse(u.data,p,u,s)]:typeof u.data=="object"&&u.data!==null?(this.logger.debug("No stream found, but data object is available"),this.invokeOnCompleteCallback(u.data,s),[2,p(u.data)]):(this.logger.error("No usable data found in response"),[2,c(new Error("No usable data found in response"))])}catch(R){this.logger.error("Error processing streaming response: ".concat(R)),this.invokeOnErrorCallback(R,s),c(R)}return[2]})})})},h.prototype.handleBrowserReadableStream=function(u,s,f,p,c){return e.__awaiter(this,void 0,void 0,function(){var y,R,b,w,C,O,x,F,T,A;return e.__generator(this,function(D){switch(D.label){case 0:this.logger.debug("Found ReadableStream in response.data"),y=u.getReader(),R=[],b="",D.label=1;case 1:D.trys.push([1,5,,6]),D.label=2;case 2:return[4,y.read()];case 3:return w=D.sent(),C=w.done,O=w.value,C?(this.logger.debug("Stream reading complete"),b.trim()&&(x=b.split(` 12`),this.processStreamLines(x,R,c)),[3,4]):(F=new TextDecoder().decode(O),this.logger.debug("Received chunk: ".concat(F.length," bytes")),b+=F,T=b.split(` 13`),b=T.pop()||"",this.processStreamLines(T,R,c),[3,2]);case 4:return this.finalizeStreamResult(R,s,p,c),[3,6];case 5:return A=D.sent(),this.logger.error("Stream error: ".concat(A)),this.invokeOnErrorCallback(A,c),f(A),[3,6];case 6:return[2]}})})},h.prototype.handleBrowserStringResponse=function(u,s,f,p){this.logger.debug("Processing text response as stream data");var c=[],y=u.split(` 14`);if(this.processStreamLines(y,c,p),c.length>0){var R=this.combineStreamingChunks(c);this.invokeOnCompleteCallback(R,p),s(R)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(f.data,p),s(f.data)},h.prototype.processStreamLines=function(u,s,f){for(var p=0,c=u;p<c.length;p++){var y=c[p];if(y.trim()&&y!=="data: [DONE]"){var R=this.processStreamingLine(y);R!==null&&(this.invokeOnChunkCallback(R,f),s.push(R))}}},h.prototype.finalizeStreamResult=function(u,s,f,p){if(u.length>0){var c=this.combineStreamingChunks(u);this.logger.debug("Stream processing complete"),this.invokeOnCompleteCallback(c,p),s(c)}else this.logger.debug("No chunks processed, returning original API response"),this.invokeOnCompleteCallback(f.data,p),s(f.data)},h.prototype.combineStreamingChunks=function(u){if(u.length===0)return{};if(u.length===1)return u[0];var s=this.getMessageChunks(u);if(s.length>0)return this.combineMessageChunks(u,s);var f=u[u.length-1];if(!this.isCompleteSearchResponse(f))throw new Error("Last chunk is not a complete search response");return f},h.prototype.getMessageChunks=function(u){return u.filter(this.isChunkMessage)},h.prototype.isChunkMessage=function(u){return typeof u=="object"&&u!==null&&"message"in u&&"conversation_id"in u},h.prototype.combineMessageChunks=function(u,s){this.logger.debug("Found ".concat(s.length," message chunks to combine"));var f=u[u.length-1];if(this.isCompleteSearchResponse(f))return f;var p=u.find(this.isCompleteSearchResponse);
14if(!p)throw new Error("No metadata chunk found");return p},h.prototype.isCompleteSearchResponse=function(u){return typeof u=="object"&&u!==null&&Object.keys(u).length>0?"results"in u||"found"in u||"hits"in u||"page"in u||"search_time_ms"in u:!1},h.prototype.getNextNode=function(u){if(u===void 0&&(u=0),this.nearestNode!=null){if(this.logger.debug("Request #".concat(u,": Nodes Health: Node ").concat(this.nearestNode.index," is ").concat(this.nearestNode.isHealthy===!0?"Healthy":"Unhealthy")),this.nearestNode.isHealthy===!0||this.nodeDueForHealthcheck(this.nearestNode,u))return this.logger.debug("Request #".concat(u,": Updated current node to Node ").concat(this.nearestNode.index)),this.nearestNode;this.logger.debug("Request #".concat(u,": Falling back to individual nodes"))}this.logger.debug("Request #".concat(u,": Nodes Health: ").concat(this.nodes.map(function(p){return"Node ".concat(p.index," is ").concat(p.isHealthy===!0?"Healthy":"Unhealthy")}).join(" || ")));for(var s=this.nodes[0],f=0;f<=this.nodes.length;f++)if(this.currentNodeIndex=(this.currentNodeIndex+1)%this.nodes.length,s=this.nodes[this.currentNodeIndex],s.isHealthy===!0||this.nodeDueForHealthcheck(s,u))return this.logger.debug("Request #".concat(u,": Updated current node to Node ").concat(s.index)),s;return this.logger.debug("Request #".concat(u,": No healthy nodes were found. Returning the next node, Node ").concat(s.index)),s},h.prototype.nodeDueForHealthcheck=function(u,s){s===void 0&&(s=0);var f=Date.now()-u.lastAccessTimestamp>this.healthcheckIntervalSeconds*1e3;return f&&this.logger.debug("Request #".concat(s,": Node ").concat(u.index," has exceeded healtcheckIntervalSeconds of ").concat(this.healthcheckIntervalSeconds,". Adding it back into rotation.")),f},h.prototype.initializeMetadataForNodes=function(){var u=this;this.nearestNode!=null&&(this.nearestNode.index="nearestNode",this.setNodeHealthcheck(this.nearestNode,d)),this.nodes.forEach(function(s,f){s.index=f,u.setNodeHealthcheck(s,d)})},h.prototype.setNodeHealthcheck=function(u,s){u.isHealthy=s,u.lastAccessTimestamp=Date.now()},h.prototype.uriFor=function(u,s){return s.url!=null?"".concat(s.url).concat(u):"".concat(s.protocol,"://").concat(s.host,":").concat(s.port).concat(s.path).concat(u)},h.prototype.defaultHeaders=function(){var u={};return this.sendApiKeyAsQueryParam||(u[l]=this.apiKey),u["Content-Type"]="application/json",u},h.prototype.timer=function(u){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(s){return[2,new Promise(function(f){return setTimeout(f,u*1e3)})]})})},h.prototype.customErrorForResponse=function(u,s,f){var p="Request failed with HTTP code ".concat(u.status);typeof s=="string"&&s.trim()!==""&&(p+=" | Server said: ".concat(s));var c=new a.default(p,f,u.status);return u.status===400?c=new i.RequestMalformed(p,f,u.status):u.status===401?c=new i.RequestUnauthorized(p,f,u.status):u.status===404?c=new i.ObjectNotFound(p,f,u.status):u.status===409?c=new i.ObjectAlreadyExists(p,f,u.status):u.status===422?c=new i.ObjectUnprocessable(p,f,u.status):u.status>=500&&u.status<=599?c=new i.ServerError(p,f,u.status):c=new i.HTTPError(p,f,u.status),c},h.prototype.invokeOnChunkCallback=function(u,s){if(s!=null&&s.onChunk)try{s.onChunk(u)}catch(f){this.logger.warn("Error in onChunk callback: ".concat(f))}},h.prototype.invokeOnCompleteCallback=function(u,s){if(s!=null&&s.onComplete)try{s.onComplete(u)}catch(f){this.logger.warn("Error in onComplete callback: ".concat(f))}},h.prototype.invokeOnErrorCallback=function(u,s){if(s!=null&&s.onError){var f=(0,o.toErrorWithMessage)(u);try{s.onError(f)}catch(p){this.logger.warn("Error in onError callback: ".concat(p))}}},h})();return en.default=v,en}var tn={},Lo;function Ct(){if(Lo)return tn;Lo=1,Object.defineProperty(tn,"__esModule",{value:!0});var e=ae,r="/collections",n=(function(){function t(i){this.apiCall=i}return t.prototype.create=function(i,a){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.post(r,i,a)]})})},t.prototype.retrieve=function(i){return i===void 0&&(i={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(r,i)]})})},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r}
14,enumerable:!1,configurable:!0}),t})();return tn.default=n,tn}var rn={},nn={},rr={},an={},$o;function kl(){if($o)return an;$o=1,Object.defineProperty(an,"__esModule",{value:!0});var e=ae,r=120,n=100,t=(function(){function i(){this.responseCache=new Map,this.responsePromiseCache=new Map}return i.prototype.clearCache=function(){this.responseCache=new Map,this.responsePromiseCache=new Map},i.prototype.perform=function(a,o,l,d){return e.__awaiter(this,void 0,void 0,function(){var g,m,v,h,u,s,f,p,c,y,R,b,w,C,O,x,F,A,T,A,D,W,Q,k,J,k;return e.__generator(this,function(M){switch(M.label){case 0:if(g=d||{},m=g.cacheResponseForSeconds,v=m===void 0?r:m,h=g.maxSize,u=h===void 0?n:h,s=d===void 0||v<=0||u<=0,f=l.path,p=l.queryParams,c=l.body,y=l.headers,R=l.streamConfig,b=l.abortSignal,w=l.responseType,C=l.isStreamingRequest,s)return[2,this.executeRequest(a,o,f,p,c,y,{abortSignal:b,responseType:w,streamConfig:R,isStreamingRequest:C})];if(O=JSON.stringify(l),x=this.responseCache.get(O),F=Date.now(),x){if(A=F-x.requestTimestamp<v*1e3,A)return this.responseCache.delete(O),this.responseCache.set(O,x),[2,x.response];this.responseCache.delete(O)}if(T=this.responsePromiseCache.get(O),T){if(A=F-T.requestTimestamp<v*1e3,A)return this.responsePromiseCache.delete(O),this.responsePromiseCache.set(O,T),[2,T.responsePromise];this.responsePromiseCache.delete(O)}return D=this.executeRequest(a,o,f,p,c,y,{abortSignal:b,responseType:w,streamConfig:R,isStreamingRequest:C}),this.responsePromiseCache.set(O,{requestTimestamp:F,responsePromise:D}),[4,D];case 1:return W=M.sent(),this.responseCache.set(O,{requestTimestamp:F,response:W}),Q=this.responseCache.size>u,Q&&(k=this.responseCache.keys().next().value,k&&this.responseCache.delete(k)),J=this.responsePromiseCache.size>u,J&&(k=this.responsePromiseCache.keys().next().value,k&&this.responsePromiseCache.delete(k)),[2,W]}})})},i.prototype.executeRequest=function(a,o,l,d,g,m,v){d===void 0&&(d={});var h=a[o];switch(o){case"get":return h.call(a,l,d,{abortSignal:v==null?void 0:v.abortSignal,responseType:v==null?void 0:v.responseType,streamConfig:v==null?void 0:v.streamConfig,isStreamingRequest:v==null?void 0:v.isStreamingRequest});case"delete":return h.call(a,l,d);case"post":return h.call(a,l,g,d,m||{},{abortSignal:v==null?void 0:v.abortSignal,responseType:v==null?void 0:v.responseType,streamConfig:v==null?void 0:v.streamConfig,isStreamingRequest:v==null?void 0:v.isStreamingRequest});case"put":case"patch":return h.call(a,l,g,d);default:throw new Error("Unsupported method: ".concat(String(o)))}},i})();return an.default=t,an}var Wo;function Bl(){if(Wo)return rr;Wo=1,Object.defineProperty(rr,"__esModule",{value:!0}),rr.SearchOnlyDocuments=void 0;var e=ae,r=e.__importDefault(kl()),n=e.__importDefault(Ct()),t=xr(),i="/documents",a=(function(){function o(l,d,g){this.collectionName=l,this.apiCall=d,this.configuration=g,this.requestWithCache=new r.default}return o.prototype.clearCache=function(){this.requestWithCache.clearCache()},o.prototype.search=function(l,d){var g=d===void 0?{}:d,m=g.cacheSearchResultsForSeconds,v=m===void 0?this.configuration.cacheSearchResultsForSeconds:m,h=g.abortSignal,u=h===void 0?null:h;return e.__awaiter(this,void 0,void 0,function(){var s,f,p,c,y,R;return e.__generator(this,function(b){return s={},this.configuration.useServerSideSearchCache===!0&&(s.use_cache=!0),f=(0,t.normalizeArrayableParams)(l),p=f.streamConfig,c=e.__rest(f,["streamConfig"]),y=e.__assign(e.__assign({},s),c),R=y.conversation_stream===!0,[2,this.requestWithCache.perform(this.apiCall,"get",{path:this.endpointPath("search"),queryParams:y,streamConfig:p,abortSignal:u,isStreamingRequest:R},{cacheResponseForSeconds:v})]})})},o.prototype.endpointPath=function(l){return"".concat(n.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(i).concat(l===void 0?"":"/"+l)},Object.defineProperty(o,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),o})();return rr.SearchOnlyDocuments=a,rr}var ko;function Ql(){if(ko)return nn;ko=1,Object.defineProperty(nn,"__esModule",{value:!0});var e=ae,r=Er(),n=Bl(),t=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(function(o){e.__extends(l,o);function l(d,g,m){return o.call(this,d,g,m)||this}return l.prototype.create=function(d,g){return g===void 0&&(g={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(m){if(!d)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),d,g)]})})},l.prototype.upsert=function(d,g){return g===void 0&&(g={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(m){if(!d)throw new Error("No document provided");return[2,this.apiCall.post(this.endpointPath(),d,Object.assign({},g,{action:"upsert"}))]})})},l.prototype.update=function(d,g){return g===void 0&&(g={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(m){if(!d)throw new Error("No document provided");return g.filter_by!=null?[2,this.apiCall.patch(this.endpointPath(),d,Object.assign({},g))]:[2,this.apiCall.post(this.endpointPath(),d,Object.assign({},g,{action:"update"}))]})})},l.prototype.delete=function(d){return d===void 0&&(d={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(g){return[2,this.apiCall.delete(this.endpointPath(),d)]})})},l.prototype.createMany=function(d,g){return g===void 0&&(g={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(m){return this.configuration.logger.warn("createMany is deprecated and will be removed in a future version. Use import instead, which now takes both an array of documents or a JSONL string of documents"),[2,this.import(d,g)]})})},l.prototype.import=function(d,g){return g===void 0&&(g={}),e.__awaiter(this,void 0,void 0,function(){var m,v,h,u,s;return e.__generator(this,function(f){switch(f.label){case 0:if(m=e.__assign({throwOnFail:!0},g),Array.isArray(d)){if(d.length===0)throw new r.RequestMalformed("No documents provided");try{v=d.map(function(p){return JSON.stringify(p)}).join(` 15`)}catch(p){throw p instanceof RangeError&&p.message.includes("Too many properties to enumerate")?new Error("".concat(p,` 16 It looks like you have reached a Node.js limit that restricts the number of keys in an Object: https://stackoverflow.com/questions/9282869/are-there-limits-to-the-number-of-properties-in-a-javascript-object 17 18 Please try reducing the number of keys in your document, or using CURL to import your data. 19 `)):new Error(p)}}else if(v=d,a(v))throw new r.RequestMalformed("No documents provided");return[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:m,bodyParameters:v,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!t})];case 1:if(h=f.sent(),Array.isArray(d)){if(u=h.split(` 20`).map(function(p){return JSON.parse(p)}),s=u.filter(function(p){return p.success===!1}),s.length>0&&m.throwOnFail)throw new r.ImportError("".concat(u.length-s.length," documents imported successfully, ").concat(s.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),u,{documentsInJSONLFormat:v,options:m,failedItems:s,successCount:u.length-s.length});return[2,u]}else return[2,h]}})})},l.prototype.importStream=function(d,g){return g===void 0&&(g={}),e.__awaiter(this,void 0,void 0,function(){var m,v,h,u;return e.__generator(this,function(s){switch(s.label){case 0:return m=e.__assign({throwOnFail:!0},g),[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:m,bodyParameters:d,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0,enableKeepAlive:!!t})];case 1:if(v=s.sent(),h=v.split(` 21`).map(function(f){return JSON.parse(f)}),u=h.filter(function(f){return f.success===!1}),u.length>0&&m.throwOnFail)throw new r.ImportError("".concat(h.length-u.length," documents imported successfully, ").concat(u.length," documents failed during import. Use `error.importResults` from the raised exception to get a detailed error reason for each document."),h,{documentsInJSONLFormat:d,options:m,failedItems:u,successCount:h.length-u.length});return[2,h]}})})}
21,l.prototype.export=function(d){return d===void 0&&(d={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(g){return[2,this.apiCall.get(this.endpointPath("export"),d)]})})},l.prototype.exportStream=function(d){return d===void 0&&(d={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(g){return[2,this.apiCall.get(this.endpointPath("export"),d,{responseType:"stream"})]})})},l})(n.SearchOnlyDocuments);nn.default=i;function a(o){return o==null||o===""||o.length===0}return nn}var sn={},Bo;function Vl(){if(Bo)return sn;Bo=1,Object.defineProperty(sn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Ct()),n="/overrides",t=(function(){function i(a,o){this.collectionName=a,this.apiCall=o}return i.prototype.upsert=function(a,o){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(l){return[2,this.apiCall.put(this.endpointPath(a),o)]})})},i.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(this.endpointPath())]})})},i.prototype.endpointPath=function(a){return"".concat(r.default.RESOURCEPATH,"/").concat(this.collectionName).concat(i.RESOURCEPATH).concat(a===void 0?"":"/"+encodeURIComponent(a))},Object.defineProperty(i,"RESOURCEPATH",{get:function(){return n},enumerable:!1,configurable:!0}),i})();return sn.default=t,sn}var on={},Qo;function mp(){if(Qo)return on;Qo=1,Object.defineProperty(on,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Ct()),n=e.__importDefault(Vl()),t=(function(){function i(a,o,l){this.collectionName=a,this.overrideId=o,this.apiCall=l}return i.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(this.endpointPath())]})})},i.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.delete(this.endpointPath())]})})},i.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(n.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.overrideId))},i})();return on.default=t,on}var un={},Vo;function zl(){if(Vo)return un;Vo=1,Object.defineProperty(un,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Ct()),n="/synonyms",t=(function(){function i(a,o){this.collectionName=a,this.apiCall=o}return i.prototype.upsert=function(a,o){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(l){return[2,this.apiCall.put(this.endpointPath(a),o)]})})},i.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(this.endpointPath())]})})},i.prototype.endpointPath=function(a){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(i.RESOURCEPATH).concat(a===void 0?"":"/"+encodeURIComponent(a))},Object.defineProperty(i,"RESOURCEPATH",{get:function(){return n},enumerable:!1,configurable:!0}),i})();return un.default=t,un}var cn={},zo;function vp(){if(zo)return cn;zo=1,Object.defineProperty(cn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Ct()),n=e.__importDefault(zl()),t=(function(){function i(a,o,l){this.collectionName=a,this.synonymId=o,this.apiCall=l}return i.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(this.endpointPath())]})})},i.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.delete(this.endpointPath())]})})},i.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(n.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.synonymId))},i})();return cn.default=t,cn}var nr={},Ko;function yp(){if(Ko)return nr;Ko=1,Object.defineProperty(nr,"__esModule",{value:!0}),nr.Document=void 0;var e=ae,r=e.__importDefault(Ct()),n=e.__importDefault(Ql()),t=(function(){function i(a,o,l){this.collectionName=a,this.documentId=o,this.apiCall=l}return i.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(this.endpointPath())]})})},i.prototype.delete=function(a){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.delete(this.endpointPath(),a)]})})},i.prototype.update=function(a,o){return o===void 0&&(o={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(l){return[2,this.apiCall.patch(this.endpointPath(),a,o)]})})},i.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.collectionName)).concat(n.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.documentId))},i})();return nr.Document=t,nr}var Jo;function _p(){if(Jo)return rn;Jo=1,Object.defineProperty(rn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Ct()),n=e.__importDefault(Ql()),t=Er(),i=e.__importDefault(Vl()),a=e.__importDefault(mp()),o=e.__importDefault(zl(
21)),l=e.__importDefault(vp()),d=yp(),g=(function(){function m(v,h,u){this.name=v,this.apiCall=h,this.configuration=u,this.individualDocuments={},this.individualOverrides={},this.individualSynonyms={},this.name=v,this.apiCall=h,this.configuration=u,this._documents=new n.default(this.name,this.apiCall,this.configuration),this._overrides=new i.default(this.name,this.apiCall),this._synonyms=new o.default(this.name,this.apiCall)}return m.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(v){return[2,this.apiCall.get(this.endpointPath())]})})},m.prototype.update=function(v){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(h){return[2,this.apiCall.patch(this.endpointPath(),v)]})})},m.prototype.delete=function(v){return v===void 0&&(v={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(h){return[2,this.apiCall.delete(this.endpointPath(),v)]})})},m.prototype.exists=function(){return e.__awaiter(this,void 0,void 0,function(){var v;return e.__generator(this,function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4,this.retrieve()];case 1:return h.sent(),[2,!0];case 2:if(v=h.sent(),v instanceof t.ObjectNotFound)return[2,!1];throw v;case 3:return[2]}})})},m.prototype.documents=function(v){return v?(this.individualDocuments[v]===void 0&&(this.individualDocuments[v]=new d.Document(this.name,v,this.apiCall)),this.individualDocuments[v]):this._documents},m.prototype.overrides=function(v){return v===void 0?this._overrides:(this.individualOverrides[v]===void 0&&(this.individualOverrides[v]=new a.default(this.name,v,this.apiCall)),this.individualOverrides[v])},m.prototype.synonyms=function(v){return v===void 0?this._synonyms:(this.individualSynonyms[v]===void 0&&(this.individualSynonyms[v]=new l.default(this.name,v,this.apiCall)),this.individualSynonyms[v])},m.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},m})();return rn.default=g,rn}var ln={},Go;function Kl(){if(Go)return ln;Go=1,Object.defineProperty(ln,"__esModule",{value:!0});var e=ae,r="/aliases",n=(function(){function t(i){this.apiCall=i}return t.prototype.upsert=function(i,a){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.put(this.endpointPath(i),a)]})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(r)]})})},t.prototype.endpointPath=function(i){return"".concat(t.RESOURCEPATH,"/").concat(encodeURIComponent(i))},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return ln.default=n,ln}var fn={},Xo;function Rp(){if(Xo)return fn;Xo=1,Object.defineProperty(fn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Kl()),n=(function(){function t(i,a){this.name=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},t})();return fn.default=n,fn}var dn={},Yo;function Jl(){if(Yo)return dn;Yo=1,Object.defineProperty(dn,"__esModule",{value:!0});var e=ae,r=Wa,n=xr(),t="/keys",i=(function(){function a(o){this.apiCall=o,this.apiCall=o}return a.prototype.create=function(o){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(l){return[2,this.apiCall.post(a.RESOURCEPATH,o)]})})},a.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.get(t)]})})},a.prototype.generateScopedSearchKey=function(o,l){var d=(0,n.normalizeArrayableParams)(l),g=JSON.stringify(d),m=Buffer.from((0,r.createHmac)("sha256",o).update(g).digest("base64")),v=o.substr(0,4),h="".concat(m).concat(v).concat(g);return Buffer.from(h).toString("base64")},Object.defineProperty(a,"RESOURCEPATH",{get:function(){return t}
21,enumerable:!1,configurable:!0}),a})();return dn.default=i,dn}var hn={},Zo;function Sp(){if(Zo)return hn;Zo=1,Object.defineProperty(hn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Jl()),n=(function(){function t(i,a){this.id=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},t})();return hn.default=n,hn}var pn={},eu;function bp(){if(eu)return pn;eu=1,Object.defineProperty(pn,"__esModule",{value:!0});var e=ae,r="/debug",n=(function(){function t(i){this.apiCall=i}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(r)]})})},t})();return pn.default=n,pn}var gn={},tu;function wp(){if(tu)return gn;tu=1,Object.defineProperty(gn,"__esModule",{value:!0});var e=ae,r="/metrics.json",n=(function(){function t(i){this.apiCall=i}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(r)]})})},t})();return gn.default=n,gn}var mn={},ru;function Pp(){if(ru)return mn;ru=1,Object.defineProperty(mn,"__esModule",{value:!0});var e=ae,r="/stats.json",n=(function(){function t(i){this.apiCall=i}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(r)]})})},t})();return mn.default=n,mn}var vn={},nu;function Ep(){if(nu)return vn;nu=1,Object.defineProperty(vn,"__esModule",{value:!0});var e=ae,r="/health",n=(function(){function t(i){this.apiCall=i}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(r)]})})},t})();return vn.default=n,vn}var yn={},iu;function xp(){if(iu)return yn;iu=1,Object.defineProperty(yn,"__esModule",{value:!0});var e=ae,r="/operations",n=(function(){function t(i){this.apiCall=i}return t.prototype.perform=function(i,a){return a===void 0&&(a={}),e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.post("".concat(r,"/").concat(i),{},a)]})})},t})();return yn.default=n,yn}var _n={},au;function Gl(){if(au)return _n;au=1,Object.defineProperty(_n,"__esModule",{value:!0});var e=ae,r=e.__importDefault(kl()),n=xr(),t="/multi_search",i=(function(){function a(o,l,d){d===void 0&&(d=!1),this.apiCall=o,this.configuration=l,this.useTextContentType=d,this.requestWithCache=new r.default}return a.prototype.clearCache=function(){this.requestWithCache.clearCache()},a.prototype.perform=function(o,l,d){return e.__awaiter(this,void 0,void 0,function(){var g,m,v,h,u;return e.__generator(this,function(s){return g=l?e.__assign({},l):{},this.configuration.useServerSideSearchCache===!0&&(g.use_cache=!0),m={union:o.union,searches:o.searches.map(n.normalizeArrayableParams)},v=g.streamConfig,h=e.__rest(g,["streamConfig"]),u=(0,n.normalizeArrayableParams)(h),[2,this.requestWithCache.perform(this.apiCall,"post",{path:t,body:m,queryParams:u,headers:this.useTextContentType?{"content-type":"text/plain"}:{},streamConfig:v,abortSignal:d==null?void 0:d.abortSignal,isStreamingRequest:this.isStreamingRequest(g)},(d==null?void 0:d.cacheSearchResultsForSeconds)!==void 0?{cacheResponseForSeconds:d.cacheSearchResultsForSeconds}:void 0)]})})},a.prototype.isStreamingRequest=function(o){return o.streamConfig!==void 0},a})();return _n.default=i,_n}var Rn={},su;function Xl(){if(su)return Rn;su=1,Object.defineProperty(Rn,"__esModule",{value:!0});var e=ae,r=xr(),n="/presets",t=(function(){function i(a){this.apiCall=a}return i.prototype.upsert=function(a,o){return e.__awaiter(this,void 0,void 0,function(){var l,d;return e.__generator(this,function(g){return typeof o.value=="object"&&"searches"in o.value?(l=o.value.searches.map(function(m){return(0,r.normalizeArrayableParams)(m)}),[2,this.apiCall.put(this.endpointPath(a),{value:{searches:l}})]):(d=(0,r.normalizeArrayableParams)(o.value),[2,this.apiCall.put(this.endpointPath(a),{value:d})])})})},i.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.get(this.endpointPath())]})})},i.prototype.endpointPath=function(a){return"".concat(i.RESOURCEPATH).concat(a===void 0?"":"/"+encodeURIComponent(a))},Object.defineProperty(i,"RESOURCEPATH",{get:function(){return n}
21,enumerable:!1,configurable:!0}),i})();return Rn.default=t,Rn}var Sn={},ou;function Cp(){if(ou)return Sn;ou=1,Object.defineProperty(Sn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Xl()),n=(function(){function t(i,a){this.presetId=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.presetId))},t})();return Sn.default=n,Sn}var bn={},wn={},uu;function Yl(){if(uu)return wn;uu=1,Object.defineProperty(wn,"__esModule",{value:!0});var e=ae,r="/analytics/rules",n=(function(){function t(i){this.apiCall=i,this.apiCall=i}return t.prototype.upsert=function(i,a){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.put(this.endpointPath(i),a)]})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.endpointPath=function(i){return"".concat(t.RESOURCEPATH).concat(i===void 0?"":"/"+encodeURIComponent(i))},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return wn.default=n,wn}var Pn={},cu;function Fp(){if(cu)return Pn;cu=1,Object.defineProperty(Pn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Yl()),n=(function(){function t(i,a){this.name=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.name))},t})();return Pn.default=n,Pn}var En={},lu;function Op(){if(lu)return En;lu=1,Object.defineProperty(En,"__esModule",{value:!0});var e=ae,r="/analytics/events",n=(function(){function t(i){this.apiCall=i,this.apiCall=i}return t.prototype.create=function(i){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.post(this.endpointPath(),i)]})})},t.prototype.endpointPath=function(i){return"".concat(t.RESOURCEPATH).concat(i===void 0?"":"/"+encodeURIComponent(i))},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return En.default=n,En}var fu;function Ap(){if(fu)return bn;fu=1,Object.defineProperty(bn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Yl()),n=e.__importDefault(Fp()),t=e.__importDefault(Op()),i="/analytics",a=(function(){function o(l){this.apiCall=l,this.individualAnalyticsRules={},this.apiCall=l,this._analyticsRules=new r.default(this.apiCall),this._analyticsEvents=new t.default(this.apiCall)}return o.prototype.rules=function(l){return l===void 0?this._analyticsRules:(this.individualAnalyticsRules[l]===void 0&&(this.individualAnalyticsRules[l]=new n.default(l,this.apiCall)),this.individualAnalyticsRules[l])},o.prototype.events=function(){return this._analyticsEvents},Object.defineProperty(o,"RESOURCEPATH",{get:function(){return i},enumerable:!1,configurable:!0}),o})();return bn.default=a,bn}var xn={},du;function Zl(){if(du)return xn;du=1,Object.defineProperty(xn,"__esModule",{value:!0});var e=ae,r="/stopwords",n=(function(){function t(i){this.apiCall=i}return t.prototype.upsert=function(i,a){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.put(this.endpointPath(i),a)]})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.endpointPath=function(i){return"".concat(t.RESOURCEPATH).concat(i===void 0?"":"/"+encodeURIComponent(i))}
21,Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return xn.default=n,xn}var Cn={},hu;function Ip(){if(hu)return Cn;hu=1,Object.defineProperty(Cn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(Zl()),n=(function(){function t(i,a){this.stopwordId=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.stopwordId))},t})();return Cn.default=n,Cn}var Fn={},On={},pu;function ef(){if(pu)return On;pu=1,Object.defineProperty(On,"__esModule",{value:!0});var e=ae,r="/conversations/models",n=(function(){function t(i){this.apiCall=i,this.apiCall=i}return t.prototype.create=function(i){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.post(this.endpointPath(),i)]})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.endpointPath=function(i){return"".concat(t.RESOURCEPATH).concat(i===void 0?"":"/"+encodeURIComponent(i))},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return On.default=n,On}var An={},gu;function Tp(){if(gu)return An;gu=1,Object.defineProperty(An,"__esModule",{value:!0});var e=ae,r=e.__importDefault(ef()),n=(function(){function t(i,a){this.id=i,this.apiCall=a}return t.prototype.update=function(i){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.put(this.endpointPath(),i)]})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},t})();return An.default=n,An}var mu;function tf(){if(mu)return Fn;mu=1,Object.defineProperty(Fn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(ef()),n=e.__importDefault(Tp()),t="/conversations",i=(function(){function a(o){this.apiCall=o,this.individualConversationModels={},this.apiCall=o,this._conversationsModels=new r.default(this.apiCall)}return a.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(o){return[2,this.apiCall.get(t)]})})},a.prototype.models=function(o){return o===void 0?this._conversationsModels:(this.individualConversationModels[o]===void 0&&(this.individualConversationModels[o]=new n.default(o,this.apiCall)),this.individualConversationModels[o])},Object.defineProperty(a,"RESOURCEPATH",{get:function(){return t},enumerable:!1,configurable:!0}),a})();return Fn.default=i,Fn}var In={},vu;function jp(){if(vu)return In;vu=1,Object.defineProperty(In,"__esModule",{value:!0});var e=ae,r=e.__importDefault(tf()),n=(function(){function t(i,a){this.id=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.update=function(i){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.put(this.endpointPath(),i)]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id
21))},t})();return In.default=n,In}var Tn={},jn={},yu;function rf(){if(yu)return jn;yu=1,Object.defineProperty(jn,"__esModule",{value:!0});var e=ae,r="/stemming/dictionaries",n=(function(){function t(i){this.apiCall=i,this.apiCall=i}return t.prototype.upsert=function(i,a){return e.__awaiter(this,void 0,void 0,function(){var o,l;return e.__generator(this,function(d){switch(d.label){case 0:return o=Array.isArray(a)?a.map(function(g){return JSON.stringify(g)}).join(` 22`):a,[4,this.apiCall.performRequest("post",this.endpointPath("import"),{queryParameters:{id:i},bodyParameters:o,additionalHeaders:{"Content-Type":"text/plain"},skipConnectionTimeout:!0})];case 1:return l=d.sent(),[2,Array.isArray(a)?l.split(` 23`).map(function(g){return JSON.parse(g)}):l]}})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.endpointPath=function(i){return i===void 0?"".concat(t.RESOURCEPATH):"".concat(t.RESOURCEPATH,"/").concat(encodeURIComponent(i))},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return jn.default=n,jn}var Nn={},_u;function Np(){if(_u)return Nn;_u=1,Object.defineProperty(Nn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(rf()),n=(function(){function t(i,a){this.id=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},t})();return Nn.default=n,Nn}var Ru;function Hp(){if(Ru)return Tn;Ru=1,Object.defineProperty(Tn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(rf()),n=e.__importDefault(Np()),t="/stemming",i=(function(){function a(o){this.apiCall=o,this.individualStemmingDictionaries={},this.apiCall=o,this._stemmingDictionaries=new r.default(this.apiCall)}return a.prototype.dictionaries=function(o){return o===void 0?this._stemmingDictionaries:(this.individualStemmingDictionaries[o]===void 0&&(this.individualStemmingDictionaries[o]=new n.default(o,this.apiCall)),this.individualStemmingDictionaries[o])},Object.defineProperty(a,"RESOURCEPATH",{get:function(){return t},enumerable:!1,configurable:!0}),a})();return Tn.default=i,Tn}var Hn={},Su;function nf(){if(Su)return Hn;Su=1,Object.defineProperty(Hn,"__esModule",{value:!0});var e=ae,r="/nl_search_models",n=(function(){function t(i){this.apiCall=i}return t.prototype.create=function(i){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.post(this.endpointPath(),i)]})})},t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.endpointPath=function(){return t.RESOURCEPATH},Object.defineProperty(t,"RESOURCEPATH",{get:function(){return r},enumerable:!1,configurable:!0}),t})();return Hn.default=n,Hn}var qn={},bu;function qp(){if(bu)return qn;bu=1,Object.defineProperty(qn,"__esModule",{value:!0});var e=ae,r=e.__importDefault(nf()),n=(function(){function t(i,a){this.id=i,this.apiCall=a}return t.prototype.retrieve=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.get(this.endpointPath())]})})},t.prototype.update=function(i){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(a){return[2,this.apiCall.put(this.endpointPath(),i)]})})},t.prototype.delete=function(){return e.__awaiter(this,void 0,void 0,function(){return e.__generator(this,function(i){return[2,this.apiCall.delete(this.endpointPath())]})})},t.prototype.endpointPath=function(){return"".concat(r.default.RESOURCEPATH,"/").concat(encodeURIComponent(this.id))},t})();return qn.default=n,qn}var wu;function Dp(){if(wu)return Wr;wu=1,Object.defineProperty(Wr,"__esModule",{value:!0});var e=ae,r=e.__importDefault($l()),n=e.__importDefault(Wl()),t=e.__importDefault(Ct()),i=e.__importDefault(_p()),a=e.__importDefault(Kl()),o=e.__importDefault(Rp()),l=e.__importDefault(Jl()),d=e.__importDefault(Sp()),g=e.__importDefault(bp()),m=e.__importDefault(wp()),v=e.__importDefault(Pp()),h=e.__importDefault(Ep()),u=e.__importDefault(xp()),s=e.__importDefault(Gl()),f=e.__importDefault(Xl()),p=e.__importDefault(Cp()),c=e.__importDefault(Ap()),y=e.__importDefault(Zl()),R=e.__importDefault(Ip()),b=e.__importDefault(tf()),w=e.__importDefault(jp()),C=e.__importDefault(Hp()),O=e.__importDefault(nf()),x=e.__importDefault(qp()),F=(function(){function T(A){var D;A.sendApiKeyAsQueryParam=(D=A.sendApiKeyAsQueryParam)!==null&&D!==void 0?D:!1,this.configuration=new r.default(A),this.apiCall=new n.default(this.configuration),this.debug=new g.default(this.apiCall),this.metrics=new m.default(this.apiCall),this.stats=new v.default(this.apiCall),this.health=new h.default(this.apiCall),this.operations=new u.default(this.apiCall),this.multiSearch=new s.default(this.apiCall,this.configuration),this._collections=new t.default(this.apiCall),this.individualCollections={},this._aliases=new a.default(this.apiCall),this.individualAliases={},this._keys=new l.default(this.apiCall),this.individualKeys={},this._presets=new f.default(this.apiCall),this.individualPresets={},this._stopwords=new y.default(this.apiCall),this.individualStopwords={},this.analytics=new c.default(this.apiCall),this.stemming=new C.default(this.apiCall),this._conversations=new b.default(this.apiCall),this.individualConversations={},this._nlSearchModels=new O.default(this.apiCall),this.individualNLSearchModels={}}return T.prototype.collections=function(A){return A===void 0?this._collections:(this.individualCollections[A]===void 0&&(this.individualCollections[A]=new i.default(A,this.apiCall,this.configuration)),this.individualCollections[A])},T.prototype.aliases=function(A){return A===void 0?this._aliases:(this.individualAliases[A]===void 0&&(this.individualAliases[A]=new o.default(A,this.apiCall)),this.individualAliases[A])},T.prototype.keys=function(A){return A===void 0?this._keys:(this.individualKeys[A]===void 0&&(this.individualKeys[A]=new d.default(A,this.apiCall)),this.individualKeys[A])},T.prototype.presets=function(A){return A===void 0?this._presets:(this.individualPresets[A]===void 0&&(this.individualPresets[A]=new p.default(A,this.apiCall)),this.individualPresets[A])},T.prototype.stopwords=function(A){return A===void 0?this._stopwords:(this.individualStopwords[A]===void 0&&(this.individualStopwords[A]=new R.default(A,this.apiCall)),this.individualStopwords[A])},T.prototype.conversations=function(A){return A===void 0?this._conversations:(this.individualConversations[A]===void 0&&(this.individualConversations[A]=new w.default(A,this.apiCall)),this.individualConversations[A])},T.prototype.nlSearchModels=function(A){return A===void 0?this._nlSearchModels:(this.individualNLSearchModels[A]===void 0&&(this.individualNLSearchModels[A]=new x.default(A,this.apiCall)),this.individualNLSearchModels[A])},T})();return Wr.default=F,Wr}var Dn={},ir={},Pu;function Mp(){if(Pu)return ir;
23Pu=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.SearchOnlyCollection=void 0;var e=Bl(),r=(function(){function n(t,i,a){this.name=t,this.apiCall=i,this.configuration=a,this._documents=new e.SearchOnlyDocuments(this.name,this.apiCall,this.configuration)}return n.prototype.documents=function(){return this._documents},n})();return ir.SearchOnlyCollection=r,ir}var Eu;function Up(){if(Eu)return Dn;Eu=1,Object.defineProperty(Dn,"__esModule",{value:!0});var e=ae,r=e.__importDefault($l()),n=e.__importDefault(Wl()),t=e.__importDefault(Gl()),i=Mp(),a=(function(){function o(l){var d;l.sendApiKeyAsQueryParam=(d=l.sendApiKeyAsQueryParam)!==null&&d!==void 0?d:!0,l.sendApiKeyAsQueryParam===!0&&(l.apiKey||"").length>2e3&&(console.warn("[typesense] API Key is longer than 2000 characters which is over the allowed limit, so disabling sending it as a query parameter."),l.sendApiKeyAsQueryParam=!1),this.configuration=new r.default(l),this.apiCall=new n.default(this.configuration),this.multiSearch=new t.default(this.apiCall,this.configuration,!0),this.individualCollections={}}return o.prototype.clearCache=function(){this.multiSearch.clearCache(),Object.entries(this.individualCollections).forEach(function(l){l[0];var d=l[1];d.documents().clearCache()})},o.prototype.collections=function(l){if(l)return this.individualCollections[l]===void 0&&(this.individualCollections[l]=new i.SearchOnlyCollection(l,this.apiCall,this.configuration)),this.individualCollections[l];throw new Error("Typesense.SearchClient only supports search operations, so the collectionName that needs to be searched must be specified. Use Typesense.Client if you need to access the collection object.")},o})();return Dn.default=a,Dn}var xu;function Lp(){if(xu)return ot;
23xu=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.Errors=ot.SearchClient=ot.Client=void 0;var e=ae,r=e.__importDefault(Dp());ot.Client=r.default;var n=e.__importDefault(Up());ot.SearchClient=n.default;var t=e.__importStar(Er());return ot.Errors=t,ot.default={Client:r.default,SearchClient:n.default,Errors:t},ot}var ar={},ki={exports:{}},Bi={exports:{}},Cu;function $p(){return Cu||(Cu=1,(function(e){function r(n,t){if(n==null)return{};var i={};for(var a in n)if({}.hasOwnProperty.call(n,a)){if(t.indexOf(a)!==-1)continue;i[a]=n[a]}return i}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Bi)),Bi.exports}var Fu;function Wp(){return Fu||(Fu=1,(function(e){var r=$p();function n(t,i){if(t==null)return{};var a,o,l=r(t,i);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(o=0;o<d.length;o++)a=d[o],i.indexOf(a)===-1&&{}.propertyIsEnumerable.call(t,a)&&(l[a]=t[a])}return l}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ki)),ki.exports}var Qi={exports:{}},Vi={exports:{}},Ou;function kp(){return Ou||(Ou=1,(function(e){function r(n){if(Array.isArray(n))return n}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Vi)),Vi.exports}var zi={exports:{}},Au;function Bp(){return Au||(Au=1,(function(e){function r(n,t){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var a,o,l,d,g=[],m=!0,v=!1;try{if(l=(i=i.call(n)).next,t===0){if(Object(i)!==i)return;m=!1}else for(;!(m=(a=l.call(i)).done)&&(g.push(a.value),g.length!==t);m=!0);}catch(h){v=!0,o=h}finally{try{if(!m&&i.return!=null&&(d=i.return(),Object(d)!==d))return}finally{if(v)throw o}}return g}}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(zi)),zi.exports}var Ki={exports:{}},Ji={exports:{}},Iu;function af(){return Iu||(Iu=1,(function(e){function r(n,t){(t==null||t>n.length)&&(t=n.length);for(var i=0,a=Array(t);i<t;i++)a[i]=n[i];return a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Ji)),Ji.exports}var Tu;function sf(){return Tu||(Tu=1,(function(e){var r=af();function n(t,i){if(t){if(typeof t=="string")return r(t,i);var a={}.toString.call(t).slice(8,-1);return a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set"?Array.from(t):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(t,i):void 0}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Ki)),Ki.exports}var Gi={exports:{}},ju;function Qp(){return ju||(ju=1,(function(e){function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 24In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Gi)),Gi.exports}var Nu;function of(){return Nu||(Nu=1,(function(e){var r=kp(),n=Bp(),t=sf(),i=Qp();function a(o,l){return r(o)||n(o,l)||t(o,l)||i()}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(Qi)),Qi.exports}var Hu;function Vp(){if(Hu)return ar;Hu=1;var e=br();Object.defineProperty(ar,"__esModule",{value:!0}),ar.SearchRequestAdapter=void 0;var r=e(fl()),n=e(Wp()),t=e(dl()),i=e(of()),a=e(wr()),o=e(Pr()),l=["q","conversation","conversation_id","conversation_model_id"];return ar.SearchRequestAdapter=(function(){function d(g,m,v){(0,a.default)(this,d),this.instantsearchRequests=g,this.typesenseClient=m,this.configuration=v,this.additionalSearchParameters=v.additionalSearchParameters,this.collectionSpecificSearchParameters=v.collectionSpecificSearchParameters}return(0,o.default)(d,[{key:"_shouldUseExactMatchForField",value:function(m,v){var h,u;return!(((h=this.configuration.collectionSpecificFilterByOptions)===null||h===void 0||(h=h[v])===null||h===void 0||(h=h[m])===null||h===void 0?void 0:h.exactMatch)===!1||((u=this.configuration.filterByOptions)===null||u===void 0||(u=u[m])===null||u===void 0?void 0:u.exactMatch)===!1)}},{key:"_adaptFacetFilters",value:function(m,v){var h=this,u="";if(!m)return u;var s=m.map(function(f){if(Array.isArray(f)){var p={};f.forEach(function(M){var $=h._parseFacetFilter(M),B=$.fieldName,V=$.fieldValue;p[B]=p[B]||[],p[B].push(V)}),Object.keys(p).length>1&&console.error("[Typesense-Instantsearch-Adapter] Typesense does not support cross-field ORs at the moment. The adapter could not OR values between these fields: ".concat(Object.keys(p).join(",")));var c=Object.keys(p)[0],y=p[c],R=y.reduce(function(M,$){return $.startsWith("-")&&!h._isNumber($)?M[0].push($.substring(1)):M[1].push($),M},[[],[]]),b=(0,i.default)(R,2),w=b[0],C=b[1],O=[];if(C.length>0){var x=h._shouldUseExactMatchForField(c,v)?":=":":";O.push("".concat(c).concat(x,"[").concat(C.map(function(M){return h._escapeFacetValue(M)}).join(","),"]"))}if(w.length>0){var F=h._shouldUseExactMatchForField(c,v)?":!=":":!";O.push("".concat(c).concat(F,"[").concat(w.map(function(M){return h._escapeFacetValue(M)}).join(","),"]"))}var T=O.filter(function(M){return M}).join(" && ");return T}else{var A=h._parseFacetFilter(f),D=A.fieldName,W=A.fieldValue,Q;if(W.startsWith("-")&&!h._isNumber(W)){var J=h._shouldUseExactMatchForField(D,v)?":!=":":!";Q="".concat(D).concat(J,"[").concat(h._escapeFacetValue(W.substring(1)),"]")}else{var k=h._shouldUseExactMatchForField(D,v)?":=":":";Q="".concat(D).concat(k,"[").concat(h._escapeFacetValue(W),"]")}return Q}});return u=s.join(" && "),u}},{key:"_parseFacetFilter",value:function(m){var v,h,u,s,f;if(((v=this.configuration.facetableFieldsWithSpecialCharacters)===null||v===void 0?void 0:v.length)>0){var p=this.configuration.facetableFieldsWithSpecialCharacters.flat().map(function(c){return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(h=new RegExp("^(".concat(p.join("|"),"):(.*)$")),u=m.match(h),u!=null)return s="".concat(u[1]),f="".concat(u[2]),{fieldName:s,fieldValue:f}}return h=this.constructor.DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX,u=m.match(h),u==null?console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a facet filter `".concat(m,"` with the Regex `").concat(h,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter.")):(s="".concat(u[1]).concat(u[2]),f="".concat(u[3])),{fieldName:s,fieldValue:f}}},{key:"_escapeFacetValue",value:function(m){return typeof m=="boolean"||m==="true"||m==="false"||this._isNumber(m)?m:"`".concat(m,"`")}},{key:"_isNumber",value:function(m){return Number.isInteger(m%1)||!!(m%1)}},{key:"_adaptNumericFilters",value:function(m){var v=this,h="";if(!m)return h;var u={};m.forEach(function(f){var p=v._parseNumericFilter(f),c=p.fieldName,y=p.operator,R=p.fieldValue;u[c]=u[c]||{},u[c][y]=R});var s=[];return Object.keys(u).forEach(function(f){u[f]["<="]!=null&&u[f][">="]!=null?s.push("".concat(f,":=[").concat(u[f][">="],"..").concat(u[f]["<="],"]")):u[f]["<="]!=null?s.push("".concat(f,":<=").concat(u[f]["<="])):u[f][">="]!=null?s.push("".concat(f,":>=").concat(u[f][">="])):u[f]["="]!=null?s.push("".concat(f,":=").concat(u[f]["="])):console.warn("[Typesense-Instantsearch-Adapter] Unsupported operator found ".concat(JSON.stringify(u[f])))}),h=s.join(" && "),h}},{key:"_parseNumericFilter",value:function(m){var v,h,u,s,f,p;if(((v=this.configuration.facetableFieldsWithSpecialCharacters)===null||v===void 0?void 0:v.length)>0){var c=this.configuration.facetableFieldsWithSpecialCharacters.map(function(C){return C.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(h=new RegExp("^(".concat(c.join("|"),")(<=|>=|>|<|=)(.*)$")),u=m.match(h),u!=null){var y=u,R=(0,i.default)(y,4);return s=R[1],f=R[2],p=R[3],{fieldName:s,operator:f,fieldValue:p}}}if(h=this.constructor.DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX,u=m.match(h),u==null)console.error("[Typesense-Instantsearch-Adapter] Parsing failed for a numeric filter `".concat(m,"` with the Regex `").concat(h,"`. If you have field names with special characters, be sure to add them to a parameter called `facetableFieldsWithSpecialCharacters` when instantiating the adapter."));else{var b=u,w=(0,i.default)(b,4);s=w[1],f=w[2],p=w[3]}return{fieldName:s,operator:f,fieldValue:p}}},{key:"_adaptGeoFilter",value:function(m){var v=m.insideBoundingBox,h=m.aroundRadius,u=m.aroundLatLng,s=m.insidePolygon;
24if(v){var f,p,c,y;if(Array.isArray(v)){var R=v.flat(),b=(0,i.default)(R,4);f=b[0],p=b[1],c=b[2],y=b[3]}else{var w=v.split(","),C=(0,i.default)(w,4);f=C[0],p=C[1],c=C[2],y=C[3]}return"".concat(this.configuration.geoLocationField,":(").concat(f,", ").concat(p,", ").concat(f,", ").concat(y,", ").concat(c,", ").concat(y,", ").concat(c,", ").concat(p,")")}if(u||h){if(!h||h==="all")throw new Error("[Typesense-Instantsearch-Adapter] In Typesense, geo-filtering around a lat/lng also requires a numerical radius. So the `aroundRadius` parameter is required when `aroundLatLng` is used. If you intend to just geo-sort around a lat/long, you want to use the sortBy InstantSearch widget (or a virtual sortBy custom widget).");var O="".concat(parseFloat(h)/1e3," km");return"".concat(this.configuration.geoLocationField,":(").concat(u,", ").concat(O,")")}if(s){var x=s;return Array.isArray(s)&&(x=s.flat().join(",")),"".concat(this.configuration.geoLocationField,":(").concat(x,")")}}},{key:"_adaptFilters",value:function(m,v){var h=[];return m.filters&&h.push(m.filters),h.push(this._adaptFacetFilters(m.facetFilters,v)),h.push(this._adaptNumericFilters(m.numericFilters)),h.push(this._adaptGeoFilter(m)),h.filter(function(u){return u&&u!==""}).join(" && ")}},{key:"_adaptIndexName",value:function(m){return m.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[1]}},{key:"_adaptSortBy",value:function(m){return m.match(this.constructor.INDEX_NAME_MATCHING_REGEX)[3]}},{key:"_adaptFacetBy",value:function(m,v){var h=this;return[m].flat().map(function(u){var s;return(s=h.configuration.collectionSpecificFacetByOptions)!==null&&s!==void 0&&(s=s[v])!==null&&s!==void 0&&s[u]?"".concat(u).concat(h.configuration.collectionSpecificFacetByOptions[v][u]):h.configuration.facetByOptions[u]?"".concat(u).concat(h.configuration.facetByOptions[u]):u}).join(",")}},{key:"_adaptRulesContextsToOverrideTags",value:function(m){return m.join(",")}},{key:"_buildSearchParameters",value:function(m){for(var v,h,u=m.params,s=m.indexName,f=this._adaptIndexName(s),p={},c=0,y=Object.entries(this.additionalSearchParameters);c<y.length;c++){var R=(0,i.default)(y[c],2),b=R[0],w=R[1];p[this._camelToSnakeCase(b)]=w}if(this.collectionSpecificSearchParameters[f])for(var C=0,O=Object.entries(this.collectionSpecificSearchParameters[f]);C<O.length;C++){var x=(0,i.default)(O[C],2),F=x[0],T=x[1];p[this._camelToSnakeCase(F)]=T}var A=Object.assign({},p),D=this._adaptSortBy(s);Object.assign(A,{collection:f,q:u.query===""||u.query===void 0?"*":u.query,facet_by:p.facet_by||this._adaptFacetBy(u.facets,f),filter_by:this._adaptFilters(u,f)||p.filter_by,sort_by:D||p.sort_by,max_facet_values:u.maxValuesPerFacet,page:(u.page||0)+1}),u.hitsPerPage!=null&&(A.per_page=u.hitsPerPage),u.facetQuery&&(A.facet_query="".concat(u.facetName,":").concat(u.facetQuery),A.per_page=0),u.ruleContexts&&u.ruleContexts.length>0&&(A.override_tags=this._adaptRulesContextsToOverrideTags(u.ruleContexts)),u.typesenseVectorQuery&&(A.vector_query=u.typesenseVectorQuery);var W=((v=this.configuration.collectionSpecificSortByOptions)===null||v===void 0||(v=v[f])===null||v===void 0?void 0:v[A.sort_by])||((h=this.configuration.sortByOptions)===null||h===void 0?void 0:h[A.sort_by]);return(W==null?void 0:W.enable_overrides)!=null&&(A.enable_overrides=W.enable_overrides),Object.fromEntries(Object.entries(A).filter(function(Q){var J=(0,i.default)(Q,2);J[0];var k=J[1];return k!=null&&k!==""}))}},{key:"_camelToSnakeCase",value:function(m){return m.split(/(?=[A-Z])/).join("_").toLowerCase()}},{key:"request",value:(function(){var g=(0,t.default)(r.default.mark(function v(){var h=this,u,s,f,p,c,y,R,b,w;return r.default.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return f=this.instantsearchRequests.map(function(x){return h._buildSearchParameters(x)}),p={},(((u=f[0])===null||u===void 0?void 0:u.conversation)===!0||((s=f[0])===null||s===void 0?void 0:s.conversation)==="true")&&(c=f[0],y=c.q,R=c.conversation,b=c.conversation_id,w=c.conversation_model_id,p={q:y,conversation:R,conversation_id:b,conversation_model_id:w},f=f.map(function(x){x.q,x.conversation,x.conversation_id,x.conversation_model_id;var F=(0,n.default)(x,l);return F})),O.abrupt("return",this.typesenseClient.multiSearch.perform({searches:f},p));case 4:case"end":return O.stop()}},v,this)}));function m(){return g.apply(this,arguments)}return m})()}],[{key:"INDEX_NAME_MATCHING_REGEX",get:function(){return new RegExp("^(.+?)(?=(/sort/(.*))|$)")}},{key:"DEFAULT_FACET_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*)((?!:).):(?!:)(.*)")}},{key:"DEFAULT_NUMERIC_FILTER_STRING_MATCHING_REGEX",get:function(){return new RegExp("(.*?)(<=|>=|>|<|=)(.*)")}}])})(),ar}var sr={},Xi={exports:{}},Yi={exports:{}},qu;function zp(){return qu||(qu=1,(function(e){var r=af();function n(t){if(Array.isArray(t))return r(t)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(Yi)),Yi.exports}var Zi={exports:{}},Du;function Kp(){return Du||(Du=1,(function(e){function r(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(Zi)),Zi.exports}var ea={exports:{}},Mu;function Jp(){return Mu||(Mu=1,(function(e){function r(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 25In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports})(ea)),ea.exports}var Uu;
25function Gp(){return Uu||(Uu=1,(function(e){var r=zp(),n=Kp(),t=sf(),i=Jp();function a(o){return r(o)||n(o)||t(o)||i()}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports})(Xi)),Xi.exports}var ta={exports:{}},Lu;function Xp(){return Lu||(Lu=1,(function(e){var r=hl();function n(t,i,a){return(i=r(i))in t?Object.defineProperty(t,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[i]=a,t}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(ta)),ta.exports}var or={},$u;function uf(){return $u||($u=1,Object.defineProperty(or,"__esModule",{value:!0}),or.utils=void 0,or.utils={_adaptHighlightTag:function(r,n,t){return r.replace(new RegExp("<mark>","g"),n||"<mark>").replace(new RegExp("</mark>","g"),t||"</mark>")},_adaptNumberOfPages:function(){var r=this.typesenseResponse.found/this.typesenseResponse.request_params.per_page;return Number.isFinite(r)?Math.ceil(r):1}}),or}var Wu;function Yp(){if(Wu)return sr;Wu=1;var e=br();Object.defineProperty(sr,"__esModule",{value:!0}),sr.SearchResponseAdapter=void 0;var r=e(Xn()),n=e(of()),t=e(Gp()),i=e(Xp()),a=e(wr()),o=e(Pr()),l=uf();function d(v,h){var u=Object.keys(v);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(v);h&&(s=s.filter(function(f){return Object.getOwnPropertyDescriptor(v,f).enumerable})),u.push.apply(u,s)}return u}function g(v){for(var h=1;h<arguments.length;h++){var u=arguments[h]!=null?arguments[h]:{};h%2?d(Object(u),!0).forEach(function(s){(0,i.default)(v,s,u[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(v,Object.getOwnPropertyDescriptors(u)):d(Object(u)).forEach(function(s){Object.defineProperty(v,s,Object.getOwnPropertyDescriptor(u,s))})}return v}var m=sr.SearchResponseAdapter=(function(){function v(h,u,s){var f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{};(0,a.default)(this,v),this.typesenseResponse=h,this.instantsearchRequest=u,this.configuration=s,this.allTypesenseResults=f,this.fullTypesenseResponse=p}return(0,o.default)(v,[{key:"_adaptGroupedHits",value:function(u){var s=this,f=[];return f=u.map(function(p){var c=s._adaptHits(p.hits);return c.forEach(function(y){y.group_key=y._group_key=p.group_key,p.found&&(y._group_found=p.found)}),c}),this.configuration.flattenGroupedHits?f=f.flat():f=f.map(function(p){return g(g({},p[0]),{},{_grouped_hits:p})}),f}},{key:"_adaptHits",value:function(u){var s=this,f=[];return f=u.map(function(p){var c=g({},p.document);c.objectID=p.document.id,c._snippetResult=s._adaptHighlightResult(p,"snippet"),c._highlightResult=s._adaptHighlightResult(p,"value"),c._rawTypesenseHit=p,s.fullTypesenseResponse.conversation&&(c._rawTypesenseConversation=s.fullTypesenseResponse.conversation),["text_match","geo_distance_meters","curated","text_match_info","hybrid_search_info","vector_distance"].forEach(function(R){Object.keys(p).includes(R)&&!Object.keys(c).includes(R)&&(c[R]=p[R])});var y=c[s.configuration.geoLocationField];return y&&(c._geoloc={lat:y[0],lng:y[1]}),c}),f}},{key:"_adaptHighlightResult",value:function(u,s){var f={};return u.highlight!=null&&this.isHighlightPost0240RCN32Format(u.highlight)?this.adaptHighlightObject(u,f,s):this.adaptHighlightsArray(u,f,s),f}},{key:"isHighlightPost0240RCN32Format",value:function(u){return u.full==null&&u.snippet==null}},{key:"adaptHighlightsArray",value:function(u,s,f){var p=this;Object.assign.apply(Object,[s].concat((0,t.default)(Object.entries(u.document).map(function(c){var y=(0,n.default)(c,2),R=y[0],b=y[1];return(0,i.default)({},R,{value:b,matchLevel:"none",matchedWords:[]})})))),u.highlights.forEach(function(c){s[c.field]={value:c[f]||c["".concat(f,"s")],matchLevel:"full",matchedWords:c.matched_tokens},c.indices&&(s[c.field].matchedIndices=c.indices)}),Object.entries(s).forEach(function(c){var y=(0,n.default)(c,2),R=y[0],b=y[1],w=R,C=b.value,O=b.matchLevel,x=b.matchedWords,F=b.matchedIndices;C==null?s[w]=p._adaptHighlightNullValue():Array.isArray(C)?(s[w]=[],u.document[w].forEach(function(T,A){F&&F.includes(A)?s[w].push({value:p._adaptHighlightTag("".concat(C[F.indexOf(A)]),p.instantsearchRequest.params.highlightPreTag,p.instantsearchRequest.params.highlightPostTag),matchLevel:O,matchedWords:x[A]}):(0,r.default)(T)==="object"?s[w].push(p._adaptHighlightInObjectValue(T,{},f)):s[w].push({value:"".concat(T),matchLevel:"none",matchedWords:[]})})):(0,r.default)(C)==="object"?s[w]=p._adaptHighlightInObjectValue(C,{},f):s[w].value=p._adaptHighlightTag("".concat(C),p.instantsearchRequest.params.highlightPreTag,p.instantsearchRequest.params.highlightPostTag)})}},{key:"adaptHighlightObject",value:function(u,s,f){Object.assign(s,this._adaptHighlightInObjectValue(u.document,u.highlight,f))}},{key:"_adaptHighlightInObjectValue",value:function(u,s,f){var p=this;return Object.assign.apply(Object,[{}].concat((0,t.default)(Object.entries(u).map(function(c){var y=(0,n.default)(c,2),R=y[0],b=y[1],w;if(b==null)w=p._adaptHighlightNullValue();else if(Array.isArray(b)){var C;
25w=p._adaptHighlightInArrayValue(b,(C=s==null?void 0:s[R])!==null&&C!==void 0?C:[],f)}else if((0,r.default)(b)==="object"){var O;w=p._adaptHighlightInObjectValue(b,(O=s==null?void 0:s[R])!==null&&O!==void 0?O:{},f)}else w=p._adaptHighlightInPrimitiveValue(b,s==null?void 0:s[R],f);return(0,i.default)({},R,w)}))))}},{key:"_adaptHighlightInArrayValue",value:function(u,s,f){var p=this;return u.map(function(c,y){var R;if(c==null)R=p._adaptHighlightNullValue();else if(Array.isArray(c)){var b;R=p._adaptHighlightInArrayValue(c,(b=s==null?void 0:s[y])!==null&&b!==void 0?b:[],f)}else if((0,r.default)(c)==="object"){var w;R=p._adaptHighlightInObjectValue(c,(w=s==null?void 0:s[y])!==null&&w!==void 0?w:{},f)}else R=p._adaptHighlightInPrimitiveValue(c,s==null?void 0:s[y],f);return R})}},{key:"_adaptHighlightInPrimitiveValue",value:function(u,s,f){if(s!=null){var p,c;return{value:this._adaptHighlightTag("".concat((p=(c=s[f])!==null&&c!==void 0?c:s.highlight)!==null&&p!==void 0?p:s.snippet),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:(s.matched_tokens||[]).length>0?"full":"none",matchedWords:s.matched_tokens||[]}}else return{value:this._adaptHighlightTag("".concat(u),this.instantsearchRequest.params.highlightPreTag,this.instantsearchRequest.params.highlightPostTag),matchLevel:"none",matchedWords:[]}}},{key:"_adaptHighlightNullValue",value:function(){return{value:"",matchLevel:"none",matchedWords:[]}}},{key:"_adaptFacets",value:function(u){var s={};return u.forEach(function(f){Object.assign(s,(0,i.default)({},f.field_name,Object.assign.apply(Object,[{}].concat((0,t.default)(f.counts.map(function(p){return(0,i.default)({},p.value,p.count)}))))))}),s}},{key:"_adaptFacetStats",value:function(u){var s={};return u.forEach(function(f){Object.keys(f.stats).length>0&&Object.assign(s,(0,i.default)({},f.field_name,f.stats))}),s}},{key:"_adaptRenderingContent",value:function(u){var s,f=Object.assign({},this.configuration.renderingContent);return((s=f.facetOrdering)===null||s===void 0||(s=s.facets)===null||s===void 0?void 0:s.order)==null&&(f.facetOrdering=f.facetOrdering||{},f.facetOrdering.facets=f.facetOrdering.facets||{},f.facetOrdering.facets.order=(0,t.default)(new Set(u.map(function(p){return p.field_name}).concat(this.allTypesenseResults.map(function(p){return p.facet_counts||[]}).flat().map(function(p){return p.field_name}).filter(function(p){return p}))))),f}},{key:"_adaptUserData",value:function(u){return u?Array.isArray(u)?u:[u]:[]}},{key:"adapt",value:function(){var u=this._adaptRenderingContent(this.typesenseResponse.facet_counts||[]),s=g({hits:this.typesenseResponse.grouped_hits?this._adaptGroupedHits(this.typesenseResponse.grouped_hits):this._adaptHits(this.typesenseResponse.hits),nbHits:this.typesenseResponse.found,page:this.typesenseResponse.page-1,nbPages:this._adaptNumberOfPages(),hitsPerPage:this.typesenseResponse.request_params.per_page,facets:this._adaptFacets(this.typesenseResponse.facet_counts||[]),facets_stats:this._adaptFacetStats(this.typesenseResponse.facet_counts||{}),query:this.typesenseResponse.request_params.q,processingTimeMS:this.typesenseResponse.search_time_ms},Object.keys(u).length>0?{renderingContent:u}:null);return this.typesenseResponse.metadata&&(s.appliedRules=["typesense-override"],s.userData=this._adaptUserData(this.typesenseResponse.metadata)),this.fullTypesenseResponse.conversation&&s.hits.length===0&&(s.hits=[{_rawTypesenseConversation:this.fullTypesenseResponse.conversation}]),s}}])})();return Object.assign(m.prototype,l.utils),sr}var ur={},ku;function Zp(){if(ku)return ur;ku=1;var e=br();Object.defineProperty(ur,"__esModule",{value:!0}),ur.FacetSearchResponseAdapter=void 0;var r=e(wr()),n=e(Pr()),t=uf(),i=ur.FacetSearchResponseAdapter=(function(){function a(o,l){(0,r.default)(this,a),this.typesenseResponse=o,this.instantsearchRequest=l}return(0,n.default)(a,[{key:"_adaptFacetHits",value:function(l){var d=this,g={},m=l.find(function(v){return v.field_name===d.instantsearchRequest.params.facetName});return g=m.counts.map(function(v){return{value:v.value,highlighted:d._adaptHighlightTag(v.highlighted,d.instantsearchRequest.params.highlightPreTag,d.instantsearchRequest.params.highlightPostTag),count:v.count}}),g}},{key:"adapt",value:function(){var l={facetHits:this._adaptFacetHits(this.typesenseResponse.facet_counts),exhaustiveFacetsCount:!0,processingTimeMS:this.typesenseResponse.search_time_ms};return l}}])})();return Object.assign(i.prototype,t.utils),ur}var Bu;function eg(){return Bu||(Bu=1,(function(e){var r=br();
25Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(fl()),t=r(dl()),i=r(wr()),a=r(Pr()),o=Yh(),l=Lp(),d=Vp(),g=Yp(),m=Zp();e.default=(function(){function v(h){var u=this;(0,i.default)(this,v),this.updateConfiguration(h),this.searchClient={clearCache:function(){return u.clearCache()},search:function(f){return u.searchTypesenseAndAdapt(f)},searchForFacetValues:function(f){return u.searchTypesenseForFacetValuesAndAdapt(f)}}}return(0,a.default)(v,[{key:"searchTypesenseAndAdapt",value:(function(){var h=(0,t.default)(n.default.mark(function s(f){var p=this,c,y;return n.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.prev=0,b.next=3,this._adaptAndPerformTypesenseRequest(f);case 3:return c=b.sent,y=c.results.map(function(w,C){p._validateTypesenseResult(w);var O=new g.SearchResponseAdapter(w,f[C],p.configuration,c.results,c),x=O.adapt();return x}),b.abrupt("return",{results:y});case 8:throw b.prev=8,b.t0=b.catch(0),console.error(b.t0),b.t0;case 12:case"end":return b.stop()}},s,this,[[0,8]])}));function u(s){return h.apply(this,arguments)}return u})()},{key:"searchTypesenseForFacetValuesAndAdapt",value:(function(){var h=(0,t.default)(n.default.mark(function s(f){var p=this,c,y;return n.default.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.prev=0,b.next=3,this._adaptAndPerformTypesenseRequest(f);case 3:return c=b.sent,y=c.results.map(function(w,C){p._validateTypesenseResult(w);var O=new m.FacetSearchResponseAdapter(w,f[C],p.configuration);return O.adapt()}),b.abrupt("return",y);case 8:throw b.prev=8,b.t0=b.catch(0),console.error(b.t0),b.t0;case 12:case"end":return b.stop()}},s,this,[[0,8]])}));function u(s){return h.apply(this,arguments)}return u})()},{key:"_adaptAndPerformTypesenseRequest",value:(function(){var h=(0,t.default)(n.default.mark(function s(f){var p,c;return n.default.wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return p=new d.SearchRequestAdapter(f,this.typesenseClient,this.configuration),R.next=3,p.request();case 3:return c=R.sent,R.abrupt("return",c);case 5:case"end":return R.stop()}},s,this)}));function u(s){return h.apply(this,arguments)}return u})()},{key:"clearCache",value:function(){return this.typesenseClient=new l.SearchClient(this.configuration.server),this.searchClient}},{key:"updateConfiguration",value:function(u){return this.configuration=new o.Configuration(u),this.configuration.validate(),this.typesenseClient=new l.SearchClient(this.configuration.server),!0}},{key:"_validateTypesenseResult",value:function(u){if(u.error)throw new Error("".concat(u.code," - ").concat(u.error));if(!u.hits&&!u.grouped_hits)throw new Error("Did not find any hits. ".concat(u.code," - ").concat(u.error))}}])})()})(Pi)),Pi}var tg=eg();const rg=Ga(tg);function ng(e,r,n){if(!e)throw new Error("You need to provide `widgetName` in your data");var t=["ais-".concat(e)];return r&&t.push("-".concat(r)),n&&t.push("--".concat(n)),t.join("")}var me=function(e){var r=e.name;return{props:{classNames:{type:Object,default:void 0}},methods:{suit:function(n,t){var i=ng(r,n,t),a=this.classNames&&this.classNames[i];return a?[i,a].join(" "):i}}}};function Ue(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Sr(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},t=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(t=t.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),t.forEach(function(i){ig(e,i,n[i])})}return e}function ig(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function cf(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Qu=new Set;function Wt(e){Qu.has(e)||(Qu.add(e),console.warn(e))}var Pe=function(){var e,r=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).connector,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ue(e={inject:{instantSearchInstance:{from:"$_ais_instantSearchInstance",default:function(){var t=this.$options._componentTag;throw new TypeError('It looks like you forgot to wrap your Algolia search component "<'.concat(t,'>" inside of an "<ais-instant-search>" component.'))}},getParentIndex:{from:"$_ais_getParentIndex",default:function(){var t=this;return function(){return t.instantSearchInstance.mainIndex}}}},data:function(){return{state:null}},created:function(){if(typeof r=="function"){if(this.factory=r(this.updateState,function(){}),this.widget=Sr(this.factory(this.widgetParams),n),this.getParentIndex().addWidgets([this.widget]),this.instantSearchInstance._initialResults&&!this.instantSearchInstance.started){if(typeof this.instantSearchInstance.__forceRender!="function")throw new Error("You are using server side rendering with <ais-instant-search> instead of <ais-instant-search-ssr>.");this.instantSearchInstance.__forceRender(this.widget,this.getParentIndex())}}else r!==!0&&Wt(`You are using the InstantSearch widget mixin, but didn't provide a connector. 26While this is technically possible, and will give you access to the Helper, 27it's not the recommended way of making custom components. 28 29If you want to disable this message, pass { connector: true } to the mixin. 30 31Read more on using connectors: https://alg.li/vue-custom`)}},"beforeUnmount",function(){this.widget&&this.getParentIndex().removeWidgets([this.widget])}),Ue(e,"watch",{widgetParams:{handler:function(t){this.state=null,this.getParentIndex().removeWidgets([this.widget]),this.widget=Sr(this.factory(t),n),this.getParentIndex().addWidgets([this.widget])},deep:!0}}),Ue(e,"methods",{updateState:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};arguments.length>1&&arguments[1]||(this.state=t)}}),e};function G(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function N(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},t=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(t=t.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),t.forEach(function(i){G(e,i,n[i])})}return e}function ag(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n}function L(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ag(Object(r)).forEac
31h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function sg(e){var r=e.name,n=e.connector,t=n===void 0?!1:n;return["https://www.algolia.com/doc/api-reference/widgets/",r,"/js/",t?"#connector":""].join("")}function Fe(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var t=r.map(function(i){return sg(i)}).join(", ");return function(i){return[i,"See documentation: ".concat(t)].filter(Boolean).join(` 32 33`)}}function og(e){return Object.prototype.toString.call(e).slice(8,-1)}function je(e,r){if(e===void 0||typeof e!="function")throw new Error("The render function is not valid (received type ".concat(og(e),`). 34 35`).concat(r))}function Qa(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function ug(e){if(Array.isArray(e))return Qa(e)}function cg(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lg(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 36In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lf(e,r){if(e){if(typeof e=="string")return Qa(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qa(e,r)}}function Ae(e){return ug(e)||cg(e)||lf(e)||lg()}function Va(){return Va=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},Va.apply(this,arguments)}function fg(e){if(e==null)throw new TypeError("Cannot destructure "+e);return e}var dg={"&":"&","<":"<",">":">",'"':""","'":"'"},ff=/[&<>"']/g,hg=RegExp(ff.source);function pg(e){return e&&hg.test(e)?e.replace(ff,function(r){return dg[r]}):e}function Ft(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function gg(e){return e===null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function mg(e){return(typeof e>"u"?"undefined":Ft(e))==="object"&&e!==null}function df(e){if(!mg(e)||gg(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}var ft={highlightPreTag:"__ais-highlight__",highlightPostTag:"__/ais-highlight__"},Vn={highlightPreTag:"<mark>",highlightPostTag:"</mark>"};function hf(e){return pg(e).replace(new RegExp(ft.highlightPreTag,"g"),Vn.highlightPreTag).replace(new RegExp(ft.highlightPostTag,"g"),Vn.highlightPostTag)}function zn(e){return df(e)&&typeof e.value!="string"?Object.keys(e).reduce(function(r,n){return L(N({},r),G({},n,zn(e[n])))},{}):Array.isArray(e)?e.map(zn):L(N({},e),{value:hf(e.value)})}function Ya(e){return e.__escaped===void 0&&(e=e.map(function(r){fg(r);var n=Va({},r);return n._highlightResult&&(n._highlightResult=zn(n._highlightResult)),n._snippetResult&&(n._snippetResult=zn(n._snippetResult)),n}),e.__escaped=!0),e}function vg(e){return e.map(function(r){return L(N({},r),{highlighted:hf(r.highlighted)})})}function Za(e,r,n){return e.map(function(t,i){return L(N({},t),{__position:n*r+i+1})})}function es(e,r){return r?e.map(function(n){return L(N({},n),{__queryID:r})}):e}function Ce(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n]}var ra,Vu;function ts(){if(Vu)return ra;Vu=1;function e(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}ra=e,e.prototype._events=void 0,e.prototype._maxListeners=void 0,e.defaultMaxListeners=10,e.prototype.setMaxListeners=function(a){if(!n(a)||a<0||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},e.prototype.emit=function(a){var o,l,d,g,m,v;if(this._events||(this._events={}),a==="error"&&(!this._events.error||t(this._events.error)&&!this._events.error.length)){if(o=arguments[1],o instanceof Error)throw o;var h=new Error('Uncaught, unspecified "error" event. ('+o+")");throw h.context=o,h}if(l=this._events[a],i(l))return!1;if(r(l))switch(arguments.length){case 1:l.call(this);break;case 2:l.call(this,arguments[1]);break;case 3:l.call(this,arguments[1],arguments[2]);break;
36default:g=Array.prototype.slice.call(arguments,1),l.apply(this,g)}else if(t(l))for(g=Array.prototype.slice.call(arguments,1),v=l.slice(),d=v.length,m=0;m<d;m++)v[m].apply(this,g);return!0},e.prototype.addListener=function(a,o){var l;if(!r(o))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,r(o.listener)?o.listener:o),this._events[a]?t(this._events[a])?this._events[a].push(o):this._events[a]=[this._events[a],o]:this._events[a]=o,t(this._events[a])&&!this._events[a].warned&&(i(this._maxListeners)?l=e.defaultMaxListeners:l=this._maxListeners,l&&l>0&&this._events[a].length>l&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),typeof console.trace=="function"&&console.trace())),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(a,o){if(!r(o))throw TypeError("listener must be a function");var l=!1;function d(){this.removeListener(a,d),l||(l=!0,o.apply(this,arguments))}return d.listener=o,this.on(a,d),this},e.prototype.removeListener=function(a,o){var l,d,g,m;if(!r(o))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(l=this._events[a],g=l.length,d=-1,l===o||r(l.listener)&&l.listener===o)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,o);else if(t(l)){for(m=g;m-- >0;)if(l[m]===o||l[m].listener&&l[m].listener===o){d=m;break}if(d<0)return this;l.length===1?(l.length=0,delete this._events[a]):l.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,o)}return this},e.prototype.removeAllListeners=function(a){var o,l;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[a]&&delete this._events[a],this;if(arguments.length===0){for(o in this._events)o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events={},this}if(l=this._events[a],r(l))this.removeListener(a,l);else if(l)for(;l.length;)this.removeListener(a,l[l.length-1]);return delete this._events[a],this},e.prototype.listeners=function(a){var o;return!this._events||!this._events[a]?o=[]:r(this._events[a])?o=[this._events[a]]:o=this._events[a].slice(),o},e.prototype.listenerCount=function(a){if(this._events){var o=this._events[a];if(r(o))return 1;if(o)return o.length}return 0},e.listenerCount=function(a,o){return a.listenerCount(o)};function r(a){return typeof a=="function"}function n(a){return typeof a=="number"}function t(a){return typeof a=="object"&&a!==null}function i(a){return a===void 0}return ra}var na,zu;function pf(){if(zu)return na;zu=1;function e(r,n){r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}return na=e,na}var ia,Ku;function yg(){if(Ku)return ia;Ku=1;var e=ts(),r=pf();function n(t,i,a){this.main=t,this.fn=i,this.recommendFn=a,this.lastResults=null,this.lastRecommendResults=null}return r(n,e),n.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},n.prototype.getModifiedState=function(t){return this.fn(t)},n.prototype.getModifiedRecommendState=function(t){return this.recommendFn(t)},ia=n,ia}var aa,Ju;function rs(){if(Ju)return aa;Ju=1;function e(n){return typeof n!="string"?n:String(n).replace(/^-/,"\\-")}function r(n){return typeof n!="string"?n:n.replace(/^\\-/,"-")}return aa={escapeFacetValue:e,unescapeFacetValue:r},aa}var sa,Gu;function ns(){if(Gu)return sa;Gu=1;function e(i){return typeof i=="object"&&i!==null?n(Array.isArray(i)?[]:{},i):i}function r(i){return typeof i=="function"||Array.isArray(i)||Object.prototype.toString.call(i)==="[object Object]"}function n(i,a){if(i===a)return i;for(var o in a)if(!(!Object.prototype.hasOwnProperty.call(a,o)||o==="__proto__"||o==="constructor")){var l=a[o],d=i[o];typeof d<"u"&&typeof l>"u"||(r(d)&&r(l)?i[o]=n(d,l):i[o]=e(l))}return i}function t(i){r(i)||(i={});for(var a=1,o=arguments.length;a<o;a++){var l=arguments[a];r(l)&&n(i,l)}return i}return sa=t,sa}var oa,Xu;function is(){if(Xu)return oa;Xu=1;function e(r){return r&&Object.keys(r).length>0}return oa=e,oa}var ua,Yu;function as(){if(Yu)return ua;Yu=1;function e(r,n){if(r===null)return{};var t={},i=Object.keys(r),a,o;for(o=0;o<i.length;o++)a=i[o],!(n.indexOf(a)>=0)&&(t[a]=r[a]);return t}return ua=e,ua}var ca,Zu;function gf(){if(Zu)return ca;Zu=1;function e(r){r=r||{},this.params=r.params||[]}return e.prototype={constructor:e,addParams:function(r){var n=this.params.slice();return n.push(r),new e({params:n})}
36,removeParams:function(r){return new e({params:this.params.filter(function(n){return n.$$id!==r})})},addFrequentlyBoughtTogether:function(r){return this.addParams(Object.assign({},r,{model:"bought-together"}))},addRelatedProducts:function(r){return this.addParams(Object.assign({},r,{model:"related-products"}))},addTrendingItems:function(r){return this.addParams(Object.assign({},r,{model:"trending-items"}))},addTrendingFacets:function(r){return this.addParams(Object.assign({},r,{model:"trending-facets"}))},addLookingSimilar:function(r){return this.addParams(Object.assign({},r,{model:"looking-similar"}))},_buildQueries:function(r,n){return this.params.filter(function(t){return n[t.$$id]===void 0}).map(function(t){var i=Object.assign({},t,{indexName:r,threshold:t.threshold||0});return delete i.$$id,i})}},ca=e,ca}var la,ec;function mf(){if(ec)return la;ec=1;function e(r,n){this._state=r,this._rawResults={};var t=this;r.params.forEach(function(i){var a=i.$$id;t[a]=n[a],t._rawResults[a]=n[a]})}return e.prototype={constructor:e},la=e,la}var fa,tc;function _g(){if(tc)return fa;tc=1;var e=ns();function r(t){return Object.keys(t).sort().reduce(function(i,a){return i[a]=t[a],i},{})}var n={_getQueries:function(i,a){var o=[];return o.push({indexName:i,params:n._getHitsSearchParams(a)}),a.getRefinedDisjunctiveFacets().forEach(function(l){o.push({indexName:i,params:n._getDisjunctiveFacetSearchParams(a,l)})}),a.getRefinedHierarchicalFacets().forEach(function(l){var d=a.getHierarchicalFacetByName(l),g=a.getHierarchicalRefinement(l),m=a._getHierarchicalFacetSeparator(d);if(g.length>0&&g[0].split(m).length>1){var v=g[0].split(m).slice(0,-1).reduce(function(u,s,f){return u.concat({attribute:d.attributes[f],value:f===0?s:[u[u.length-1].value,s].join(m)})},[]);v.forEach(function(h,u){var s=n._getDisjunctiveFacetSearchParams(a,h.attribute,u===0);function f(y){return d.attributes.some(function(R){return R===y.split(":")[0]})}var p=(s.facetFilters||[]).reduce(function(y,R){if(Array.isArray(R)){var b=R.filter(function(w){return!f(w)});b.length>0&&y.push(b)}return typeof R=="string"&&!f(R)&&y.push(R),y},[]),c=v[u-1];u>0?s.facetFilters=p.concat(c.attribute+":"+c.value):p.length>0?s.facetFilters=p:delete s.facetFilters,o.push({indexName:i,params:s})})}}),o},_getCompositionQueries:function(i){return[{compositionID:i.index,requestBody:{params:n._getCompositionHitsSearchParams(i)}}]},_getHitsSearchParams:function(t){var i=t.facets.concat(t.disjunctiveFacets).concat(n._getHitsHierarchicalFacetsAttributes(t)).sort(),a=n._getFacetFilters(t),o=n._getNumericFilters(t),l=n._getTagFilters(t),d={};return i.length>0&&(d.facets=i.indexOf("*")>-1?["*"]:i),l.length>0&&(d.tagFilters=l),a.length>0&&(d.facetFilters=a),o.length>0&&(d.numericFilters=o),r(e({},t.getQueryParams(),d))},_getCompositionHitsSearchParams:function(t){var i=t.facets.concat(t.disjunctiveFacets.map(function(m){return t.disjunctiveFacetsRefinements&&t.disjunctiveFacetsRefinements[m]&&t.disjunctiveFacetsRefinements[m].length>0?"disjunctive("+m+")":m})).concat(n._getHitsHierarchicalFacetsAttributes(t)).sort(),a=n._getFacetFilters(t),o=n._getNumericFilters(t),l=n._getTagFilters(t),d={};i.length>0&&(d.facets=i.indexOf("*")>-1?["*"]:i),l.length>0&&(d.tagFilters=l),a.length>0&&(d.facetFilters=a),o.length>0&&(d.numericFilters=o);var g=t.getQueryParams();return delete g.highlightPreTag,delete g.highlightPostTag,delete g.index,r(e({},g,d))},_getDisjunctiveFacetSearchParams:function(t,i,a){var o=n._getFacetFilters(t,i,a),l=n._getNumericFilters(t,i),d=n._getTagFilters(t),g={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};d.length>0&&(g.tagFilters=d);var m=t.getHierarchicalFacetByName(i);return m?g.facets=n._getDisjunctiveHierarchicalFacetAttribute(t,m,a):g.facets=i,l.length>0&&(g.numericFilters=l),o.length>0&&(g.facetFilters=o),r(e({},t.getQueryParams(),g))},_getNumericFilters:function(t,i){if(t.numericFilters)return t.numericFilters;var a=[];return Object.keys(t.numericRefinements).forEach(function(o){var l=t.numericRefinements[o]||{};Object.keys(l).forEach(function(d){var g=l[d]||[];i!==o&&g.forEach(function(m){if(Array.isArray(m)){var v=m.map(function(h){return o+d+h});a.push(v)}else a.push(o+d+m)})})}),a},_getTagFilters:function(t){return t.tagFilters?t.tagFilters:t.tagRefinements.join(",")},_getFacetFilters:function(t,i,a){var o=[],l=t.facetsRefinements||{};
36Object.keys(l).sort().forEach(function(v){var h=l[v]||[];h.slice().sort().forEach(function(u){o.push(v+":"+u)})});var d=t.facetsExcludes||{};Object.keys(d).sort().forEach(function(v){var h=d[v]||[];h.sort().forEach(function(u){o.push(v+":-"+u)})});var g=t.disjunctiveFacetsRefinements||{};Object.keys(g).sort().forEach(function(v){var h=g[v]||[];if(!(v===i||!h||h.length===0)){var u=[];h.slice().sort().forEach(function(s){u.push(v+":"+s)}),o.push(u)}});var m=t.hierarchicalFacetsRefinements||{};return Object.keys(m).sort().forEach(function(v){var h=m[v]||[],u=h[0];if(u!==void 0){var s=t.getHierarchicalFacetByName(v),f=t._getHierarchicalFacetSeparator(s),p=t._getHierarchicalRootPath(s),c,y;if(i===v){if(u.indexOf(f)===-1||!p&&a===!0||p&&p.split(f).length===u.split(f).length)return;p?(y=p.split(f).length-1,u=p):(y=u.split(f).length-2,u=u.slice(0,u.lastIndexOf(f))),c=s.attributes[y]}else y=u.split(f).length-1,c=s.attributes[y];c&&o.push([c+":"+u])}}),o},_getHitsHierarchicalFacetsAttributes:function(t){var i=[];return t.hierarchicalFacets.reduce(function(o,l){var d=t.getHierarchicalRefinement(l.name)[0];if(!d)return o.push(l.attributes[0]),o;var g=t._getHierarchicalFacetSeparator(l),m=d.split(g).length,v=l.attributes.slice(0,m+1);return o.concat(v)},i)},_getDisjunctiveHierarchicalFacetAttribute:function(t,i,a){var o=t._getHierarchicalFacetSeparator(i);if(a===!0){var l=t._getHierarchicalRootPath(i),d=0;return l&&(d=l.split(o).length),[i.attributes[d]]}var g=t.getHierarchicalRefinement(i.name)[0]||"",m=g.split(o).length-1;return i.attributes.slice(0,m+1)},getSearchForFacetQuery:function(t,i,a,o){var l=o.isDisjunctiveFacet(t)?o.clearRefinements(t):o,d={facetQuery:i,facetName:t};return typeof a=="number"&&(d.maxFacetHits=a),r(e({},n._getHitsSearchParams(l),d))}};return fa=n,fa}var da,rc;function ss(){return rc||(rc=1,da=function(){var r=Array.prototype.slice.call(arguments);return r.reduceRight(function(n,t){return Object.keys(Object(t)).forEach(function(i){t[i]!==void 0&&(n[i]!==void 0&&delete n[i],n[i]=t[i])}),n},{})}),da}var ha,nc;function Cr(){return nc||(nc=1,ha=function(r,n){if(Array.isArray(r)){for(var t=0;t<r.length;t++)if(n(r[t]))return r[t]}}),ha}var pa,ic;function Rg(){if(ic)return pa;ic=1;function e(r,n){return r.filter(function(t,i){return n.indexOf(t)>-1&&r.indexOf(t)===i})}return pa=e,pa}var ga,ac;function Sg(){if(ac)return ga;ac=1;function e(r){if(typeof r=="number")return r;if(typeof r=="string")return parseFloat(r);if(Array.isArray(r))return r.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}return ga=e,ga}var ma,sc;function bg(){return sc||(sc=1,ma=function(r){return r===null?!1:/^[a-zA-Z0-9_-]{1,64}$/.test(r)}),ma}var va,oc;function wg(){if(oc)return va;oc=1;var e=ss(),r=is(),n=as(),t={addRefinement:function(a,o,l){if(t.isRefined(a,o,l))return a;var d=""+l,g=a[o]?a[o].concat(d):[d],m={};return m[o]=g,e(m,a)},removeRefinement:function(a,o,l){if(l===void 0)return t.clearRefinement(a,function(g,m){return o===m});var d=""+l;return t.clearRefinement(a,function(g,m){return o===m&&d===g})},toggleRefinement:function(a,o,l){if(l===void 0)throw new Error("toggleRefinement should be used with a value");return t.isRefined(a,o,l)?t.removeRefinement(a,o,l):t.addRefinement(a,o,l)},clearRefinement:function(a,o,l){if(o===void 0)return r(a)?{}:a;if(typeof o=="string")return n(a,[o]);if(typeof o=="function"){var d=!1,g=Object.keys(a).reduce(function(m,v){var h=a[v]||[],u=h.filter(function(s){return!o(s,v,l)});return u.length!==h.length&&(d=!0),m[v]=u,m},{});return d?g:a}},isRefined:function(a,o,l){var d=!!a[o]&&a[o].length>0;if(l===void 0||!d)return d;var g=""+l;return a[o].indexOf(g)!==-1}};return va=t,va}var ya,uc;function vf(){if(uc)return ya;uc=1;var e=ss(),r=Cr(),n=Rg(),t=ns(),i=is(),a=as(),o=Sg(),l=bg(),d=wg();function g(u,s){return Array.isArray(u)&&Array.isArray(s)?u.length===s.length&&u.every(function(f,p){return g(s[p],f)}):u===s}function m(u,s){return r(u,function(f){return g(f,s)})}function v(u){var s=u?v._parseNumbers(u):{};s.userToken!==void 0&&!l(s.userToken)&&console.warn("[algoliasearch-helper] The `userToken` parameter is invali
36d. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=s.facets||[],this.disjunctiveFacets=s.disjunctiveFacets||[],this.hierarchicalFacets=s.hierarchicalFacets||[],this.facetsRefinements=s.facetsRefinements||{},this.facetsExcludes=s.facetsExcludes||{},this.disjunctiveFacetsRefinements=s.disjunctiveFacetsRefinements||{},this.numericRefinements=s.numericRefinements||{},this.tagRefinements=s.tagRefinements||[],this.hierarchicalFacetsRefinements=s.hierarchicalFacetsRefinements||{};var f=this;Object.keys(s).forEach(function(p){var c=v.PARAMETERS.indexOf(p)!==-1,y=s[p]!==void 0;!c&&y&&(f[p]=s[p])})}v.PARAMETERS=Object.keys(new v);function h(u){var s=parseFloat(u);return isFinite(s)?s:null}return v._parseNumbers=function(u){if(u instanceof v)return u;var s={},f=["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"];if(f.forEach(function(c){var y=u[c];if(typeof y=="string"){var R=parseFloat(y);isNaN(R)?s[c]=y:isFinite(R)?s[c]=R:s[c]=null}else typeof y=="number"&&!isFinite(y)&&(s[c]=null)}),Array.isArray(u.insideBoundingBox)&&(s.insideBoundingBox=u.insideBoundingBox.map(function(c){return Array.isArray(c)?c.map(function(y){return typeof y=="string"?h(y):typeof y=="number"&&!isFinite(y)?null:y}):c})),u.numericRefinements){var p={};Object.keys(u.numericRefinements).forEach(function(c){var y=u.numericRefinements[c]||{};p[c]={},Object.keys(y).forEach(function(R){var b=y[R],w=b.map(function(C){return Array.isArray(C)?C.map(function(O){return typeof O=="string"?h(O):typeof O=="number"&&!isFinite(O)?null:O}):typeof C=="string"?h(C):typeof C=="number"&&!isFinite(C)?null:C});p[c][R]=w})}),s.numericRefinements=p}return t(u,s)},v.make=function(s){var f=new v(s),p=s.hierarchicalFacets||[];return p.forEach(function(c){if(c.rootPath){var y=f.getHierarchicalRefinement(c.name);y.length>0&&y[0].indexOf(c.rootPath)!==0&&(f=f.clearRefinements(c.name)),y=f.getHierarchicalRefinement(c.name),y.length===0&&(f=f.toggleHierarchicalFacetRefinement(c.name,c.rootPath))}}),f},v.validate=function(u,s){var f=s||{};return u.tagFilters&&f.tagRefinements&&f.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):u.tagRefinements.length>0&&f.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):u.numericFilters&&f.numericRefinements&&i(f.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):i(u.numericRefinements)&&f.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},v.prototype={constructor:v,clearRefinements:function(s){var f={numericRefinements:this._clearNumericRefinements(s),facetsRefinements:d.clearRefinement(this.facetsRefinements,s,"conjunctiveFacet"),facetsExcludes:d.clearRefinement(this.facetsExcludes,s,"exclude"),disjunctiveFacetsRefinements:d.clearRefinement(this.disjunctiveFacetsRefinements,s,"disjunctiveFacet"),hierarchicalFacetsRefinements:d.clearRefinement(this.hierarchicalFacetsRefinements,s,"hierarchicalFacet")};return f.numericRefinements===this.numericRefinements&&f.facetsRefinements===this.facetsRefinements&&f.facetsExcludes===this.facetsExcludes&&f.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&f.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(f)},clearTags:function(){return this.tagFilters===void 0&&this.tagRefinements.length===0?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(s){return s===this.index?this:this.setQueryParameters({index:s})},setQuery:function(s){return s===this.query?this:this.setQueryParameters({query:s})},setPage:function(s){return s===this.page?this:this.setQueryParameters({page:s})},setFacets:function(s){return this.setQueryParameters({facets:s})},setDisjunctiveFacets:function(s){return this.setQueryParameters({disjunctiveFacets:s})},setHitsPerPage:function(s){return this.hitsPerPage===s?this:this.setQueryParameters({hitsPerPage:s})},setTypoTolerance:function(s){return this.typoTolerance===s?this:this.setQueryParameters({typoTolerance:s})},addNumericRefinement:function(u,s,f){var p=o(f);if(this.isNumericRefined(u,s,p))return this;var c=t({},this.numericRefinements);return c[u]=t({}
36,c[u]),c[u][s]?(c[u][s]=c[u][s].slice(),c[u][s].push(p)):c[u][s]=[p],this.setQueryParameters({numericRefinements:c})},getConjunctiveRefinements:function(u){return this.isConjunctiveFacet(u)?this.facetsRefinements[u]||[]:[]},getDisjunctiveRefinements:function(u){return this.isDisjunctiveFacet(u)?this.disjunctiveFacetsRefinements[u]||[]:[]},getHierarchicalRefinement:function(u){return this.hierarchicalFacetsRefinements[u]||[]},getExcludeRefinements:function(u){return this.isConjunctiveFacet(u)?this.facetsExcludes[u]||[]:[]},removeNumericRefinement:function(u,s,f){var p=f;return p!==void 0?this.isNumericRefined(u,s,p)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(c,y){return y===u&&c.op===s&&g(c.val,o(p))})}):this:s!==void 0?this.isNumericRefined(u,s)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(c,y){return y===u&&c.op===s})}):this:this.isNumericRefined(u)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(c,y){return y===u})}):this},getNumericRefinements:function(u){return this.numericRefinements[u]||{}},getNumericRefinement:function(u,s){return this.numericRefinements[u]&&this.numericRefinements[u][s]},_clearNumericRefinements:function(s){if(s===void 0)return i(this.numericRefinements)?{}:this.numericRefinements;if(typeof s=="string")return a(this.numericRefinements,[s]);if(typeof s=="function"){var f=!1,p=this.numericRefinements,c=Object.keys(p).reduce(function(y,R){var b=p[R],w={};return b=b||{},Object.keys(b).forEach(function(C){var O=b[C]||[],x=[];O.forEach(function(F){var T=s({val:F,op:C},R,"numeric");T||x.push(F)}),x.length!==O.length&&(f=!0),w[C]=x}),y[R]=w,y},{});return f?c:this.numericRefinements}},addFacet:function(s){return this.isConjunctiveFacet(s)?this:this.setQueryParameters({facets:this.facets.concat([s])})},addDisjunctiveFacet:function(s){return this.isDisjunctiveFacet(s)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([s])})},addHierarchicalFacet:function(s){if(this.isHierarchicalFacet(s.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+s.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([s])})},addFacetRefinement:function(s,f){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return d.isRefined(this.facetsRefinements,s,f)?this:this.setQueryParameters({facetsRefinements:d.addRefinement(this.facetsRefinements,s,f)})},addExcludeRefinement:function(s,f){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return d.isRefined(this.facetsExcludes,s,f)?this:this.setQueryParameters({facetsExcludes:d.addRefinement(this.facetsExcludes,s,f)})},addDisjunctiveFacetRefinement:function(s,f){if(!this.isDisjunctiveFacet(s))throw new Error(s+" is not defined in the disjunctiveFacets attribute of the helper configuration");return d.isRefined(this.disjunctiveFacetsRefinements,s,f)?this:this.setQueryParameters({disjunctiveFacetsRefinements:d.addRefinement(this.disjunctiveFacetsRefinements,s,f)})},addTagRefinement:function(s){if(this.isTagRefined(s))return this;var f={tagRefinements:this.tagRefinements.concat(s)};return this.setQueryParameters(f)},removeFacet:function(s){return this.isConjunctiveFacet(s)?this.clearRefinements(s).setQueryParameters({facets:this.facets.filter(function(f){return f!==s})}):this},removeDisjunctiveFacet:function(s){return this.isDisjunctiveFacet(s)?this.clearRefinements(s).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(f){return f!==s})}):this},removeHierarchicalFacet:function(s){return this.isHierarchicalFacet(s)?this.clearRefinements(s).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(f){return f.name!==s})}):this},removeFacetRefinement:function(s,f){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return d.isRefined(this.facetsRefinements,s,f)?this.setQueryParameters({facetsRefinements:d.removeRefinement(this.facetsRefinements,s,f)}):this},removeExcludeRefinement:function(s,f){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");
36return d.isRefined(this.facetsExcludes,s,f)?this.setQueryParameters({facetsExcludes:d.removeRefinement(this.facetsExcludes,s,f)}):this},removeDisjunctiveFacetRefinement:function(s,f){if(!this.isDisjunctiveFacet(s))throw new Error(s+" is not defined in the disjunctiveFacets attribute of the helper configuration");return d.isRefined(this.disjunctiveFacetsRefinements,s,f)?this.setQueryParameters({disjunctiveFacetsRefinements:d.removeRefinement(this.disjunctiveFacetsRefinements,s,f)}):this},removeTagRefinement:function(s){if(!this.isTagRefined(s))return this;var f={tagRefinements:this.tagRefinements.filter(function(p){return p!==s})};return this.setQueryParameters(f)},toggleRefinement:function(s,f){return this.toggleFacetRefinement(s,f)},toggleFacetRefinement:function(s,f){if(this.isHierarchicalFacet(s))return this.toggleHierarchicalFacetRefinement(s,f);if(this.isConjunctiveFacet(s))return this.toggleConjunctiveFacetRefinement(s,f);if(this.isDisjunctiveFacet(s))return this.toggleDisjunctiveFacetRefinement(s,f);throw new Error("Cannot refine the undeclared facet "+s+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(s,f){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:d.toggleRefinement(this.facetsRefinements,s,f)})},toggleExcludeFacetRefinement:function(s,f){if(!this.isConjunctiveFacet(s))throw new Error(s+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:d.toggleRefinement(this.facetsExcludes,s,f)})},toggleDisjunctiveFacetRefinement:function(s,f){if(!this.isDisjunctiveFacet(s))throw new Error(s+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:d.toggleRefinement(this.disjunctiveFacetsRefinements,s,f)})},toggleHierarchicalFacetRefinement:function(s,f){if(!this.isHierarchicalFacet(s))throw new Error(s+" is not defined in the hierarchicalFacets attribute of the helper configuration");var p=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(s)),c={},y=this.hierarchicalFacetsRefinements[s]!==void 0&&this.hierarchicalFacetsRefinements[s].length>0&&(this.hierarchicalFacetsRefinements[s][0]===f||this.hierarchicalFacetsRefinements[s][0].indexOf(f+p)===0);return y?f.indexOf(p)===-1?c[s]=[]:c[s]=[f.slice(0,f.lastIndexOf(p))]:c[s]=[f],this.setQueryParameters({hierarchicalFacetsRefinements:e(c,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(u,s){if(this.isHierarchicalFacetRefined(u))throw new Error(u+" is already refined.");if(!this.isHierarchicalFacet(u))throw new Error(u+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var f={};return f[u]=[s],this.setQueryParameters({hierarchicalFacetsRefinements:e(f,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(u){if(!this.isHierarchicalFacetRefined(u))return this;var s={};return s[u]=[],this.setQueryParameters({hierarchicalFacetsRefinements:e(s,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(s){return this.isTagRefined(s)?this.removeTagRefinement(s):this.addTagRefinement(s)},isDisjunctiveFacet:function(u){return this.disjunctiveFacets.indexOf(u)>-1},isHierarchicalFacet:function(u){return this.getHierarchicalFacetByName(u)!==void 0},isConjunctiveFacet:function(u){return this.facets.indexOf(u)>-1},isFacetRefined:function(s,f){return this.isConjunctiveFacet(s)?d.isRefined(this.facetsRefinements,s,f):!1},isExcludeRefined:function(s,f){return this.isConjunctiveFacet(s)?d.isRefined(this.facetsExcludes,s,f):!1},isDisjunctiveFacetRefined:function(s,f){return this.isDisjunctiveFacet(s)?d.isRefined(this.disjunctiveFacetsRefinements,s,f):!1},isHierarchicalFacetRefined:function(s,f){if(!this.isHierarchicalFacet(s))return!1;var p=this.getHierarchicalRefinement(s);return f?p.indexOf(f)!==-1:p.length>0},isNumericRefined:function(s,f,p){if(p===void 0&&f===void 0)return!!this.numericRefinements[s];var c=this.numericRefinements[s]&&this.numericRefinements[s][f]!==void 0;if(p===void 0||!c)return c;var y=o(p),R=m(this.numericRefinements[s][f],y)!==void 0;return c&&R},isTagRefined:function(s){return this.tagRefinements.indexOf(s)!==-1},getRefinedDisjunctiveFacets:function(){var s=this,f=n(Object.keys(this.numericRefinements).filter(function(p){return Object.keys(s.numericRefinements[p]).length>0}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(p){return s.disjunctiveFacetsRefinements[p].length>0}).concat(f).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var s=this;return n(this.hierarchicalFacets.map(function(f){return f.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(f){return s.hierarchicalFacetsRefinements[f].length>0})).sort()},getUnrefinedDisjunctiveFacets:function(){var u=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(s){return u.indexOf(s)===-1})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var s=this.managedParameters,f={},p=this;
36return Object.keys(this).forEach(function(c){var y=p[c];s.indexOf(c)===-1&&y!==void 0&&(f[c]=y)}),f},setQueryParameter:function(s,f){if(this[s]===f)return this;var p={};return p[s]=f,this.setQueryParameters(p)},setQueryParameters:function(s){if(!s)return this;var f=v.validate(this,s);if(f)throw f;var p=this,c=v._parseNumbers(s),y=Object.keys(this).reduce(function(b,w){return b[w]=p[w],b},{}),R=Object.keys(c).reduce(function(b,w){var C=b[w]!==void 0,O=c[w]!==void 0;return C&&!O?a(b,[w]):(O&&(b[w]=c[w]),b)},y);return new this.constructor(R)},resetPage:function(){return this.page===void 0?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(u){return u.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(u){return u.separator||" > "},_getHierarchicalRootPath:function(u){return u.rootPath||null},_getHierarchicalShowParentLevel:function(u){return typeof u.showParentLevel=="boolean"?u.showParentLevel:!0},getHierarchicalFacetByName:function(u){return r(this.hierarchicalFacets,function(s){return s.name===u})},getHierarchicalFacetBreadcrumb:function(u){if(!this.isHierarchicalFacet(u))return[];var s=this.getHierarchicalRefinement(u)[0];if(!s)return[];var f=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(u)),p=s.split(f);return p.map(function(c){return c.trim()})},toString:function(){return JSON.stringify(this,null,2)}},ya=v,ya}var _a,cc;function Pg(){return cc||(cc=1,_a=function(r){return Array.isArray(r)?r.filter(Boolean):[]}),_a}var Ra,lc;function Eg(){return lc||(lc=1,Ra=function(r,n){if(!Array.isArray(r))return-1;for(var t=0;t<r.length;t++)if(n(r[t]))return t;return-1}),Ra}var Sa,fc;function yf(){if(fc)return Sa;fc=1;var e=Cr();return Sa=function(n,t){var i=(t||[]).map(function(a){return a.split(":")});return n.reduce(function(o,l){var d=l.split(":"),g=e(i,function(m){return m[0]===d[0]});return d.length>1||!g?(o[0].push(d[0]),o[1].push(d[1]),o):(o[0].push(g[0]),o[1].push(g[1]),o)},[[],[]])},Sa}var ba,dc;function xg(){if(dc)return ba;dc=1;function e(){var r=Array.prototype.slice.call(arguments);return r.reduceRight(function(n,t){return Object.keys(Object(t)).forEach(function(i){var a=typeof n[i]=="number"?n[i]:0,o=t[i];o!==void 0&&o>=a&&(n[i]!==void 0&&delete n[i],n[i]=o)}),n},{})}return ba=e,ba}var wa,hc;function _f(){if(hc)return wa;hc=1;function e(n,t){if(n!==t){var i=n!==void 0,a=n===null,o=t!==void 0,l=t===null;if(!l&&n>t||a&&o||!i)return 1;if(!a&&n<t||l&&i||!o)return-1}return 0}function r(n,t,i){if(!Array.isArray(n))return[];Array.isArray(i)||(i=[]);var a=n.map(function(o,l){return{criteria:t.map(function(d){return o[d]}),index:l,value:o}});return a.sort(function(l,d){for(var g=-1;++g<l.criteria.length;){var m=e(l.criteria[g],d.criteria[g]);if(m)return g>=i.length?m:i[g]==="desc"?-m:m}return l.index-d.index}),a.map(function(o){return o.value})}return wa=r,wa}var Pa,pc;function Cg(){if(pc)return Pa;pc=1,Pa=o;var e=rs(),r=Cr(),n=yf(),t=_f(),i=e.escapeFacetValue,a=e.unescapeFacetValue;function o(m){return function(h,u){var s=m.hierarchicalFacets[u],f=m.hierarchicalFacetsRefinements[s.name]&&m.hierarchicalFacetsRefinements[s.name][0]||"",p=m._getHierarchicalFacetSeparator(s),c=m._getHierarchicalRootPath(s),y=m._getHierarchicalShowParentLevel(s),R=n(m._getHierarchicalFacetSortBy(s)),b=h.every(function(O){return O.exhaustive}),w=l(R,p,c,y,f),C=h;return c&&(C=h.slice(c.split(p).length)),C.reduce(w,{name:m.hierarchicalFacets[u].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:b,data:null})}}function l(m,v,h,u,s){return function(p,c,y){var R=p;if(y>0){var b=0;for(R=p;b<y;){var w=R&&Array.isArray(R.data)?R.data:[];R=r(w,function(O){return O.isRefined}),b++}}if(R){var C=Object.keys(c.data).map(function(O){return[O,c.data[O]]}).filter(function(O){var x=O[0];return d(x,R.path||h,s,v,h,u)});R.data=t(C.map(function(O){var x=O[0],F=O[1];return g(F,x,v,a(s),c.exhaustive)}),m[0],m[1])}return p}}function d(m,v,h,u,s,f){return s&&(m.indexOf(s)!==0||s===m)?!1:!s&&m.indexOf(u)===-1||s&&m.split(u).length-s.split(u).length===1||m.indexOf(u)===-1&&h.indexOf(u)===-1||h.indexOf(m)===0||m.indexOf(v+u)===0&&(f||m.indexOf(h)===0)}function g(m,v,h,u,s){var f=v.split(h);return{name:f[f.length-1].trim(),path:v,escapedValue:i(v),count:m,isRefined:u===v||u.indexOf(v+h)===0,exhaustive:s,data:null}}return Pa}var Ea,gc;function Rf(){if(gc)return Ea;gc=1;var e=Pg(),r=ss(),n=rs(),t=Cr(),i=Eg(),a=yf(),o=xg(),l=_f(),d=n.escapeFacetValue,g=n.unescapeFacetValue,m=Cg();function v(x){var F={};return x.forEach(function(T,A){F[T]=A}),F}function h(x,F,T){F&&F[T]&&(x.stats=F[T])}function u(x,F){return t(x,function(A){var D=A.attributes||[];return D.indexOf(F)>-1})}function s(x,F,T){var A=F[0]||{};this._rawResults=F;var D=this;Object.keys(A).forEach(function(B){D[B]=A[B]});var W=r(T,{persistHierarchicalRootCount:!1});Object.keys(W).forEach(function(B){D[B]=W[B]}),this.processingTimeMS=F.reduce(function(B,V){return V.processingTimeMS===void 0?B:B+V.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=x.hierarchicalFacets.map(function(){return[]}),this.facets=[];var Q=x.getRefinedDisjunctiveFacets(),J=v(x.facets),k=v(x.disjunctiveFacets),M=1,$=A.facets||{};Object.keys($).forEach(function(B){var V=$[B],z=u(x.hierarchicalFacets,B);if(z){var ne=z.attributes.indexOf(B),ie=i(x.hierarchicalFacets,function(ve){return ve.name===z.name});D.hierarchicalFacets[ie][ne]={attribute:B,data:V,exhaustive:A.exhaustiveFacetsCount}}else{var ue=x.disjunctiveFacets.indexOf(B)!==-1,Z=x.facets.indexOf(B)!==-1,se;ue&&(se=k[B],D.disjunctiveFacets[se]={name:B,data:V,exhaustive:A.exhaustiveFacetsCount},h(D.disjunctiveFacets[se],A.facets_stats,B)),Z&&(se=J[B],D.facets[se]={name:B,data:V,exhaustive:A.exhaustiveFacetsCount},h(D.facets[se],A.facets_stats,B))}}),this.hierarchicalFacets=e(this.hierarchicalFacets),Q.forEach(function(B){var V=F[M],z=V&&V.facets?V.facets:{},ne=x.getHierarchicalFacetByName(B);Object.keys(z).forEach(function(ie){var ue=z[ie],Z;if(ne){Z=i(x.hierarchicalFacets,function(pe){return pe.name===ne.name});var se=i(D.hierarchicalFacets[Z],function(pe){return pe.attribute===ie});if(se===-1)return;D.hierarchicalFacets[Z][se].data=D.persistHierarchicalRootCount?o(D.hierarchicalFacets[Z][se].data,ue):r(ue,D.hierarchicalFacets[Z][se].data)}else{Z=k[ie];var ve=A.facets&&A.facets[ie]||{};D.disjunctiveFacets[Z]={name:ie,data:o(ve,ue),exhaustive:V.exhaustiveFacetsCount},h(D.disjunctiveFacets[Z],V.facets_stats,ie),x.disjunctiveFacetsRefinements[ie]&&x.disjunctiveFacetsRefinements[ie].forEach(function(pe){!D.disjunctiveFacets[Z].data[pe]&&x.disjunctiveFacetsRefinements[ie].indexOf(g(pe))>-1&&(D.disjunctiveFacets[Z].data[pe]=0)})}}),M++}
36),x.getRefinedHierarchicalFacets().forEach(function(B){var V=x.getHierarchicalFacetByName(B),z=x._getHierarchicalFacetSeparator(V),ne=x.getHierarchicalRefinement(B);ne.length===0||ne[0].split(z).length<2||F.slice(M).forEach(function(ie){var ue=ie&&ie.facets?ie.facets:{};Object.keys(ue).forEach(function(Z){var se=ue[Z],ve=i(x.hierarchicalFacets,function(He){return He.name===V.name}),pe=i(D.hierarchicalFacets[ve],function(He){return He.attribute===Z});if(pe!==-1){var Ne={};if(ne.length>0&&!D.persistHierarchicalRootCount){var Oe=ne[0].split(z)[0];Ne[Oe]=D.hierarchicalFacets[ve][pe].data[Oe]}D.hierarchicalFacets[ve][pe].data=r(Ne,se,D.hierarchicalFacets[ve][pe].data)}}),M++})}),Object.keys(x.facetsExcludes).forEach(function(B){var V=x.facetsExcludes[B],z=J[B];D.facets[z]={name:B,data:$[B],exhaustive:A.exhaustiveFacetsCount},V.forEach(function(ne){D.facets[z]=D.facets[z]||{name:B},D.facets[z].data=D.facets[z].data||{},D.facets[z].data[ne]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(m(x)),this.facets=e(this.facets),this.disjunctiveFacets=e(this.disjunctiveFacets),this._state=x}s.prototype.getFacetByName=function(x){function F(T){return T.name===x}return t(this.facets,F)||t(this.disjunctiveFacets,F)||t(this.hierarchicalFacets,F)};function f(x,F){function T($){return $.name===F}if(x._state.isConjunctiveFacet(F)){var A=t(x.facets,T);return A?Object.keys(A.data).map(function($){var B=d($);return{name:$,escapedValue:B,count:A.data[$],isRefined:x._state.isFacetRefined(F,B),isExcluded:x._state.isExcludeRefined(F,$)}}):[]}else if(x._state.isDisjunctiveFacet(F)){var D=t(x.disjunctiveFacets,T);return D?Object.keys(D.data).map(function($){var B=d($);return{name:$,escapedValue:B,count:D.data[$],isRefined:x._state.isDisjunctiveFacetRefined(F,B)}}):[]}else if(x._state.isHierarchicalFacet(F)){var W=t(x.hierarchicalFacets,T);if(!W)return W;var Q=x._state.getHierarchicalFacetByName(F),J=x._state._getHierarchicalFacetSeparator(Q),k=g(x._state.getHierarchicalRefinement(F)[0]||"");k.indexOf(Q.rootPath)===0&&(k=k.replace(Q.rootPath+J,""));var M=k.split(J);return M.unshift(F),p(W,M,0),W}}function p(x,F,T){x.isRefined=x.name===(F[T]&&F[T].trim()),x.data&&x.data.forEach(function(A){p(A,F,T+1)})}function c(x,F,T,A){if(A=A||0,Array.isArray(F))return x(F,T[A]);if(!F.data||F.data.length===0)return F;var D=F.data.map(function(J){return c(x,J,T,A+1)}),W=x(D,T[A]),Q=r({data:W},F);return Q}s.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"];function y(x,F){return F.sort(x)}function R(x,F){var T=[],A=[],D=F.hide||[],W=F.order||[],Q=W.reduce(function(M,$,B){return M[$]=B,M},{});x.forEach(function(M){var $=M.path||M.name,B=D.indexOf($)>-1;!B&&Q[$]!==void 0?T[Q[$]]=M:B||A.push(M)}),T=T.filter(function(M){return M});var J=F.sortRemainingBy,k;return J==="hidden"?T:(J==="alpha"?k=[["path","name"],["asc","asc"]]:k=[["count"],["desc"]],T.concat(l(A,k[0],k[1])))}function b(x,F){return x.renderingContent&&x.renderingContent.facetOrdering&&x.renderingContent.facetOrdering.values&&x.renderingContent.facetOrdering.values[F]}s.prototype.getFacetValues=function(x,F){var T=f(this,x);if(T){var A=r(F,{sortBy:s.DEFAULT_SORT,facetOrdering:!(F&&F.sortBy)}),D=this,W;if(Array.isArray(T))W=[x];else{var Q=D._state.getHierarchicalFacetByName(T.name);W=Q.attributes}return c(function(J,k){var M=b(D,k);if(A.facetOrdering&&M)return R(J,M);if(Array.isArray(A.sortBy)){var $=a(A.sortBy,s.DEFAULT_SORT),B=l(J,$[0],$[1]),V=M&&M.hide?M.hide:[];if(V.length>0){var z=[];return B.forEach(function(ne){var ie=ne.path||ne.name;V.indexOf(ie)===-1&&z.push(ne)}),z}return B}else if(typeof A.sortBy=="function")return y(A.sortBy,J);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},T,W)}},s.prototype.getFacetStats=function(x){if(this._state.isConjunctiveFacet(x))return w(this.facets,x);if(this._state.isDisjunctiveFacet(x))return w(this.disjunctiveFacets,x)};function w(x,F){var T=t(x,function(A){return A.name===F});return T&&T.stats}s.prototype.getRefinements=function(){var x=this._state,F=this,T=[];
36return Object.keys(x.facetsRefinements).forEach(function(A){x.facetsRefinements[A].forEach(function(D){T.push(C(x,"facet",A,D,F.facets))})}),Object.keys(x.facetsExcludes).forEach(function(A){x.facetsExcludes[A].forEach(function(D){T.push(C(x,"exclude",A,D,F.facets))})}),Object.keys(x.disjunctiveFacetsRefinements).forEach(function(A){x.disjunctiveFacetsRefinements[A].forEach(function(D){T.push(C(x,"disjunctive",A,D,F.disjunctiveFacets))})}),Object.keys(x.hierarchicalFacetsRefinements).forEach(function(A){x.hierarchicalFacetsRefinements[A].forEach(function(D){T.push(O(x,A,D,F.hierarchicalFacets))})}),Object.keys(x.numericRefinements).forEach(function(A){var D=x.numericRefinements[A];Object.keys(D).forEach(function(W){D[W].forEach(function(Q){T.push({type:"numeric",attributeName:A,name:Q,numericValue:Q,operator:W})})})}),x.tagRefinements.forEach(function(A){T.push({type:"tag",attributeName:"_tags",name:A})}),T};function C(x,F,T,A,D){var W=t(D,function(k){return k.name===T}),Q=W&&W.data&&W.data[A]?W.data[A]:0,J=W&&W.exhaustive||!1;return{type:F,attributeName:T,name:A,count:Q,exhaustive:J}}function O(x,F,T,A){var D=x.getHierarchicalFacetByName(F),W=x._getHierarchicalFacetSeparator(D),Q=T.split(W),J=t(A,function(V){return V.name===F}),k=Q.reduce(function(V,z){var ne=V&&t(V.data,function(ie){return ie.name===z});return ne!==void 0?ne:V},J),M=k&&k.count||0,$=k&&k.exhaustive||!1,B=k&&k.path||"";return{type:"hierarchical",attributeName:F,name:B,count:M,exhaustive:$}}return Ea=s,Ea}var xa,mc;function Fg(){return mc||(mc=1,xa=function(r){return r.reduce(function(n,t){return n.concat(t)},[])}),xa}var Ca,vc;function Og(){if(vc)return Ca;vc=1;var e=Cr(),r=Fg();function n(i,a){var o=[];
36return Object.keys(i).forEach(function(l){i[l].count<2&&(i[l].indexSum+=100),o.push({objectID:l,avgOfIndices:i[l].indexSum/a})}),o.sort(function(l,d){return l.avgOfIndices>d.avgOfIndices?1:-1})}function t(i,a){var o={};a.forEach(function(g){g.forEach(function(m,v){i.includes(m.objectID)||(o[m.objectID]?o[m.objectID]={indexSum:o[m.objectID].indexSum+v,count:o[m.objectID].count+1}:o[m.objectID]={indexSum:v,count:1})})});var l=n(o,a.length),d=l.reduce(function(g,m){var v=e(r(a),function(h){return h.objectID===m.objectID});return v?g.concat(v):g},[]);return d}return Ca=t,Ca}var Fa,yc;function Sf(){return yc||(yc=1,Fa="3.29.1"),Fa}var Oa,_c;function Ag(){if(_c)return Oa;_c=1;var e=ts(),r=yg(),n=rs().escapeFacetValue,t=pf(),i=ns(),a=is(),o=as(),l=gf(),d=mf(),g=_g(),m=vf(),v=Rf(),h=Og(),u=Sf();function s(c,y,R,b){typeof c.addAlgoliaAgent=="function"&&c.addAlgoliaAgent("JS Helper ("+u+")"),this.setClient(c);var w=R||{};w.index=y,this.state=m.make(w),this.recommendState=new l({params:w.recommendState}),this.lastResults=null,this.lastRecommendResults=null,this._queryId=0,this._recommendQueryId=0,this._lastQueryIdReceived=-1,this._lastRecommendQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._currentNbRecommendQueries=0,this._searchResultsOptions=b,this._recommendCache={}}t(s,e),s.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},s.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},s.prototype.searchWithComposition=function(){return this._runComposition({onlyWithDerivedHelpers:!0}),this},s.prototype.recommend=function(){return this._recommend(),this},s.prototype.getQuery=function(){var c=this.state;return g._getHitsSearchParams(c)},s.prototype.searchOnce=function(c,y){var R=c?this.state.setQueryParameters(c):this.state,b=g._getQueries(R.index,R),w=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:R}),y){this.client.search(b).then(function(C){w._currentNbQueries--,w._currentNbQueries===0&&w.emit("searchQueueEmpty"),y(null,new v(R,C.results),R)}).catch(function(C){w._currentNbQueries--,w._currentNbQueries===0&&w.emit("searchQueueEmpty"),y(C,null,R)});return}return this.client.search(b).then(function(C){return w._currentNbQueries--,w._currentNbQueries===0&&w.emit("searchQueueEmpty"),{content:new v(R,C.results),state:R,_originalResponse:C}},function(C){throw w._currentNbQueries--,w._currentNbQueries===0&&w.emit("searchQueueEmpty"),C})},s.prototype.findAnswers=function(c){console.warn("[algoliasearch-helper] answers is no longer supported");var y=this.state,R=this.derivedHelpers[0];if(!R)return Promise.resolve([]);var b=R.getModifiedState(y),w=i({attributesForPrediction:c.attributesForPrediction,nbHits:c.nbHits},{params:o(g._getHitsSearchParams(b),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),C="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if(typeof this.client.initIndex!="function")throw new Error(C);var O=this.client.initIndex(b.index);if(typeof O.findAnswers!="function")throw new Error(C);return O.findAnswers(b.query,c.queryLanguages,w)},s.prototype.searchForFacetValues=function(c,y,R,b){var w=typeof this.client.searchForFacetValues=="function"&&typeof this.client.searchForFacets!="function",C=typeof this.client.initIndex=="function";if(!w&&!C&&typeof this.client.search!="function")throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var O=this.state.setQueryParameters(b||{}),x=O.isDisjunctiveFacet(c),F=g.getSearchForFacetQuery(c,y,R,O);this._currentNbQueries++;var T=this,A;w?A=this.client.searchForFacetValues([{indexName:O.index,params:F}]):C?A=this.client.initIndex(O.index).searchForFacetValues(F):(delete F.facetName,A=this.client.search([{type:"facet",facet:c,indexName:O.index,params:F}]).then(function(Q){return Q.results[0]})),this.emit("searchForFacetValues",{state:O,facet:c,query:y});var D=this.lastResults&&this.lastResults.index===O.index&&this.lastResults.renderingContent&&this.lastResults.renderingContent.facetOrdering&&this.lastResults.renderingContent.facetOrdering.values&&this.lastResults.renderingContent.facetOrdering.values[c]&&this.lastResults.renderingContent.facetOrdering.values[c].hide||[];return A.then(function(Q){return T._currentNbQueries--,T._currentNbQueries===0&&T.emit("searchQueueEmpty"),Q=Array.isArray(Q)?Q[0]:Q,Q.facetHits=Q.facetHits.reduce(function(J,k){return D.indexOf(k.value)>-1||(k.escapedValue=n(k.value),k.isRefined=x?O.isDisjunctiveFacetRefined(c,k.escapedValue):O.isFacetRefined(c,k.escapedValue),J.push(k)),J},[]),Q},function(W){throw T._currentNbQueries--,T._currentNbQueries===0&&T.emit("searchQueueEmpty"),W})},s.prototype.searchForCompositionFacetValues=function(c,y,R,b){if(typeof this.client.searchForFacetValues!="function")throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues");var w=this.state.setQueryParameters(b||{}),C=w.isDisjunctiveFacet(c);this._currentNbQueries++;var O=this,x;return x=this.client.searchForFacetValues({compositionID:w.index,facetName:c,searchForFacetValuesRequest:{params:{query:y,maxFacetHits:R,searchQuery:g._getCompositionHitsSearchParams(w)}}}
36),this.emit("searchForFacetValues",{state:w,facet:c,query:y}),x.then(function(T){return O._currentNbQueries--,O._currentNbQueries===0&&O.emit("searchQueueEmpty"),T=T.results[0],T.facetHits.forEach(function(A){A.escapedValue=n(A.value),A.isRefined=C?w.isDisjunctiveFacetRefined(c,A.escapedValue):w.isFacetRefined(c,A.escapedValue)}),T},function(F){throw O._currentNbQueries--,O._currentNbQueries===0&&O.emit("searchQueueEmpty"),F})},s.prototype.setQuery=function(c){return this._change({state:this.state.resetPage().setQuery(c),isPageReset:!0}),this},s.prototype.clearRefinements=function(c){return this._change({state:this.state.resetPage().clearRefinements(c),isPageReset:!0}),this},s.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},s.prototype.addDisjunctiveFacetRefinement=function(c,y){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},s.prototype.addHierarchicalFacetRefinement=function(c,y){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.addNumericRefinement=function(c,y,R){return this._change({state:this.state.resetPage().addNumericRefinement(c,y,R),isPageReset:!0}),this},s.prototype.addFacetRefinement=function(c,y){return this._change({state:this.state.resetPage().addFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},s.prototype.addFacetExclusion=function(c,y){return this._change({state:this.state.resetPage().addExcludeRefinement(c,y),isPageReset:!0}),this},s.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},s.prototype.addTag=function(c){return this._change({state:this.state.resetPage().addTagRefinement(c),isPageReset:!0}),this},s.prototype.addFrequentlyBoughtTogether=function(c){return this._recommendChange({state:this.recommendState.addFrequentlyBoughtTogether(c)}),this},s.prototype.addRelatedProducts=function(c){return this._recommendChange({state:this.recommendState.addRelatedProducts(c)}),this},s.prototype.addTrendingItems=function(c){return this._recommendChange({state:this.recommendState.addTrendingItems(c)}),this},s.prototype.addTrendingFacets=function(c){return this._recommendChange({state:this.recommendState.addTrendingFacets(c)}),this},s.prototype.addLookingSimilar=function(c){return this._recommendChange({state:this.recommendState.addLookingSimilar(c)}),this},s.prototype.removeNumericRefinement=function(c,y,R){return this._change({state:this.state.resetPage().removeNumericRefinement(c,y,R),isPageReset:!0}),this},s.prototype.removeDisjunctiveFacetRefinement=function(c,y){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},s.prototype.removeHierarchicalFacetRefinement=function(c){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(c),isPageReset:!0}),this},s.prototype.removeFacetRefinement=function(c,y){return this._change({state:this.state.resetPage().removeFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},s.prototype.removeFacetExclusion=function(c,y){return this._change({state:this.state.resetPage().removeExcludeRefinement(c,y),isPageReset:!0}),this},s.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},s.prototype.removeTag=function(c){return this._change({state:this.state.resetPage().removeTagRefinement(c),isPageReset:!0}),this},s.prototype.removeFrequentlyBoughtTogether=function(c){return this._recommendChange({state:this.recommendState.removeParams(c)}),this},s.prototype.removeRelatedProducts=function(c){return this._recommendChange({state:this.recommendState.removeParam
36s(c)}),this},s.prototype.removeTrendingItems=function(c){return this._recommendChange({state:this.recommendState.removeParams(c)}),this},s.prototype.removeTrendingFacets=function(c){return this._recommendChange({state:this.recommendState.removeParams(c)}),this},s.prototype.removeLookingSimilar=function(c){return this._recommendChange({state:this.recommendState.removeParams(c)}),this},s.prototype.toggleFacetExclusion=function(c,y){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},s.prototype.toggleRefinement=function(c,y){return this.toggleFacetRefinement(c,y)},s.prototype.toggleFacetRefinement=function(c,y){return this._change({state:this.state.resetPage().toggleFacetRefinement(c,y),isPageReset:!0}),this},s.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},s.prototype.toggleTag=function(c){return this._change({state:this.state.resetPage().toggleTagRefinement(c),isPageReset:!0}),this},s.prototype.nextPage=function(){var c=this.state.page||0;return this.setPage(c+1)},s.prototype.previousPage=function(){var c=this.state.page||0;return this.setPage(c-1)};function f(c){if(c<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(c),isPageReset:!1}),this}s.prototype.setCurrentPage=f,s.prototype.setPage=f,s.prototype.setIndex=function(c){return this._change({state:this.state.resetPage().setIndex(c),isPageReset:!0}),this},s.prototype.setQueryParameter=function(c,y){return this._change({state:this.state.resetPage().setQueryParameter(c,y),isPageReset:!0}),this},s.prototype.setState=function(c){return this._change({state:m.make(c),isPageReset:!1}),this},s.prototype.overrideStateWithoutTriggeringChangeEvent=function(c){return this.state=new m(c),this},s.prototype.hasRefinements=function(c){return a(this.state.getNumericRefinements(c))?!0:this.state.isConjunctiveFacet(c)?this.state.isFacetRefined(c):this.state.isDisjunctiveFacet(c)?this.state.isDisjunctiveFacetRefined(c):this.state.isHierarchicalFacet(c)?this.state.isHierarchicalFacetRefined(c):!1},s.prototype.isExcluded=function(c,y){return this.state.isExcludeRefined(c,y)},s.prototype.isDisjunctiveRefined=function(c,y){return this.state.isDisjunctiveFacetRefined(c,y)},s.prototype.hasTag=function(c){return this.state.isTagRefined(c)},s.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},s.prototype.getIndex=function(){return this.state.index};function p(){return this.state.page}return s.prototype.getCurrentPage=p,s.prototype.getPage=p,s.prototype.getTags=function(){return this.state.tagRefinements},s.prototype.getRefinements=function(c){var y=[];if(this.state.isConjunctiveFacet(c)){var R=this.state.getConjunctiveRefinements(c);R.forEach(function(O){y.push({value:O,type:"conjunctive"})});var b=this.state.getExcludeRefinements(c);b.forEach(function(O){y.push({value:O,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(c)){var w=this.state.getDisjunctiveRefinements(c);w.forEach(function(O){y.push({value:O,type:"disjunctive"})})}var C=this.state.getNumericRefinements(c);return Object.keys(C).forEach(function(O){var x=C[O];y.push({value:x,operator:O,type:"numeric"})}),y},s.prototype.getNumericRefinement=function(c,y){return this.state.getNumericRefinement(c,y)},s.prototype.getHierarchicalFacetBreadcrumb=function(c){return this.state.getHierarchicalFacetBreadcrumb(c)},s.prototype._search=function(c){var y=this.state,R=[],b=[];c.onlyWithDerivedHelpers||(b=g._getQueries(y.index,y),R.push({state:y,queriesCount:b.length,helper:this}),this.emit("search",{state:y,results:this.lastResults}));var w=this.derivedHelpers.map(function(x){var F=x.getModifiedState(y),T=F.index?g._getQueries(F.index,F):[];return R.push({state:F,queriesCount:T.length,helper:x}),x.emit("search",{state:F,results:x.lastResults}),T}),C=Array.prototype.concat.apply(b,w),O=this._queryId++;if(this._currentNbQueries++,!C.length)return Promise.resolve({results:[]}
36).then(this._dispatchAlgoliaResponse.bind(this,R,O));try{this.client.search(C).then(this._dispatchAlgoliaResponse.bind(this,R,O)).catch(this._dispatchAlgoliaError.bind(this,O))}catch(x){this.emit("error",{error:x})}},s.prototype._runComposition=function(){var c=this.state,y=[],R=[],b=this.derivedHelpers.map(function(x){var F=x.getModifiedState(c),T=g._getCompositionQueries(F);return y.push({state:F,helper:x}),x.emit("search",{state:F,results:x.lastResults}),T}),w=Array.prototype.concat.apply(R,b),C=this._queryId++;if(this._currentNbQueries++,!w.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,y,C));if(w.length>1)throw new Error("Only one query is allowed when using a composition.");var O=w[0];try{this.client.search(O).then(this._dispatchAlgoliaResponse.bind(this,y,C)).catch(this._dispatchAlgoliaError.bind(this,C))}catch(x){this.emit("error",{error:x})}},s.prototype._recommend=function(){var c=this.state,y=this.recommendState,R=this.getIndex(),b=[{state:y,index:R,helper:this}],w=y.params.map(function(T){return T.$$id});this.emit("fetch",{recommend:{state:y,results:this.lastRecommendResults}});var C=this._recommendCache,O=this.derivedHelpers.map(function(T){var A=T.getModifiedState(c).index;if(!A)return[];var D=T.getModifiedRecommendState(new l);return b.push({state:D,index:A,helper:T}),w=Array.prototype.concat.apply(w,D.params.map(function(W){return W.$$id})),T.emit("fetch",{recommend:{state:D,results:T.lastRecommendResults}}),D._buildQueries(A,C)}),x=Array.prototype.concat.apply(this.recommendState._buildQueries(R,C),O);if(x.length!==0){if(x.length>0&&typeof this.client.getRecommendations>"u"){console.warn("Please update algoliasearch/lite to the latest version in order to use recommend widgets.");return}var F=this._recommendQueryId++;this._currentNbRecommendQueries++;try{this.client.getRecommendations(x).then(this._dispatchRecommendResponse.bind(this,F,b,w)).catch(this._dispatchRecommendError.bind(this,F))}catch(T){this.emit("error",{error:T})}}},s.prototype._dispatchAlgoliaResponse=function(c,y,R){var b=this;if(!(y<this._lastQueryIdReceived)){this._currentNbQueries-=y-this._lastQueryIdReceived,this._lastQueryIdReceived=y,this._currentNbQueries===0&&this.emit("searchQueueEmpty");var w=R.results.slice(),C=Object.keys(R).reduce(function(O,x){return x!=="results"&&(O[x]=R[x]),O},{});Object.keys(C).length<=0&&(C=void 0),c.forEach(function(O){var x=O.state,F=O.queriesCount,T=O.helper,A=F!==void 0?w.splice(0,F):w;if(!x.index){T.emit("result",{results:null,state:x});return}if(A.length>0&&A[0].feedID){var D=A.map(function(W){var Q=new v(x,[W],b._searchResultsOptions);return C!==void 0&&(Q._rawContent=C),Q});T.lastResults=new v(x,[A[0]],b._searchResultsOptions),T.lastResults.feeds=D,C!==void 0&&(T.lastResults._rawContent=C)}else T.lastResults=new v(x,A,b._searchResultsOptions),C!==void 0&&(T.lastResults._rawContent=C);T.emit("result",{results:T.lastResults,state:x})})}},s.prototype._dispatchRecommendResponse=function(c,y,R,b){if(!(c<this._lastRecommendQueryIdReceived)){this._currentNbRecommendQueries-=c-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=c,this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty");var w=this._recommendCache,C={};R.filter(function(x){return w[x]===void 0}).forEach(function(x,F){C[x]||(C[x]=[]),C[x].push(F)}),Object.keys(C).forEach(function(x){var F=C[x],T=b.results[F[0]];if(F.length===1){w[x]=T;return}w[x]=Object.assign({},T,{hits:h(R,F.map(function(A){return b.results[A].hits}))})});var O={};R.forEach(function(x){O[x]=w[x]}),y.forEach(function(x){var F=x.state,T=x.helper;if(!x.index){T.emit("recommend:result",{results:null,state:F});return}T.lastRecommendResults=new d(F,O),T.emit("recommend:result",{recommend:{results:T.lastRecommendResults,state:F}})})}},s.prototype._dispatchAlgoliaError=function(c,y){c<this._lastQueryIdReceived||(this._currentNbQueries-=c-this._lastQueryIdReceived,this._lastQueryIdReceived=c,this.emit("error",{error:y}),this._currentNbQueries===0&&this.emit("searchQueueEmpty"))},s.prototype._dispatchRecommendError=function(c,y){c<this._lastRecommendQueryId
36Received||(this._currentNbRecommendQueries-=c-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=c,this.emit("error",{error:y}),this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty"))},s.prototype.containsRefinement=function(c,y,R,b){return c||y.length!==0||R.length!==0||b.length!==0},s.prototype._hasDisjunctiveRefinements=function(c){return this.state.disjunctiveRefinements[c]&&this.state.disjunctiveRefinements[c].length>0},s.prototype._change=function(c){var y=c.state,R=c.isPageReset;y!==this.state&&(this.state=y,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:R}))},s.prototype._recommendChange=function(c){var y=c.state;y!==this.recommendState&&(this.recommendState=y,this.emit("recommend:change",{search:{results:this.lastResults,state:this.state},recommend:{results:this.lastRecommendResults,state:this.recommendState}}))},s.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},s.prototype.setClient=function(c){return this.client===c?this:(typeof c.addAlgoliaAgent=="function"&&c.addAlgoliaAgent("JS Helper ("+u+")"),this.client=c,this)},s.prototype.getClient=function(){return this.client},s.prototype.derive=function(c,y){var R=new r(this,c,y);return this.derivedHelpers.push(R),R},s.prototype.detachDerivedHelper=function(c){var y=this.derivedHelpers.indexOf(c);if(y===-1)throw new Error("Derived helper already detached");this.derivedHelpers.splice(y,1)},s.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},Oa=s,Oa}var Aa,Rc;function Ig(){if(Rc)return Aa;Rc=1;var e=Ag(),r=gf(),n=mf(),t=vf(),i=Rf();function a(o,l,d,g){return new e(o,l,d,g)}return a.version=Sf(),a.AlgoliaSearchHelper=e,a.SearchParameters=t,a.RecommendParameters=r,a.SearchResults=i,a.RecommendResults=n,Aa=a,Aa}var Tg=Ig();const _e=Ga(Tg);function jg(e,r){if(e==null)return{};var n={},t=Object.getOwnPropertyNames(e),i,a;for(a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function ze(e,r){if(e==null)return{};var n={},t,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(t=Reflect.ownKeys(e),a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}if(n=jg(e,r),Object.getOwnPropertySymbols)for(t=Object.getOwnPropertySymbols(e),a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function Ng(e,r){if(!Array.isArray(e))return-1;for(var n=0;n<e.length;n++)if(r(e[n]))return n;return-1}function os(e){return e.filter(function(r,n,t){return t.indexOf(r)===n})}var Hg=function(r,n){n.facets,n.disjunctiveFacets,n.facetsRefinements,n.facetsExcludes,n.disjunctiveFacetsRefinements,n.numericRefinements,n.tagRefinements,n.hierarchicalFacets,n.hierarchicalFacetsRefinements,n.ruleContexts;var t=ze(n,["facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements","ruleContexts"]);return r.setQueryParameters(t)},qg=function(r,n){return n.facets.reduce(function(t,i){return t.addFacet(i)},r)},Dg=function(r,n){return n.disjunctiveFacets.reduce(function(t,i){return t.addDisjunctiveFacet(i)},r)},Mg=function(r,n){return r.setQueryParameters({hierarchicalFacets:n.hierarchicalFacets.reduce(function(t,i){var a=Ng(t,function(l){return l.name===i.name});if(a===-1)return t.concat(i);var o=t.slice();return o.splice(a,1,i),o},r.hierarchicalFacets)})},Ug=function(r,n){return n.tagRefinements.reduce(function(t,i){return t.addTagRefinement(i)},r)},Lg=function(r,n){return r.setQueryParameters({facetsRefinements:N({},r.facetsRefinements,n.facetsRefinements)})},$g=function(r,n){return r.setQueryParameters({facetsExcludes:N({},r.facetsExcludes,n.facetsExcludes)})},Wg=function(r,n){return r.setQueryParameters({disjunctiveFacetsRefinements:N({},r.disjunctiveFacetsRefinements,n.disjunctiveFacetsRefinements)})},kg=function(r,n){return r.setQueryParameters({numericRefinements:N({},r.numericRefinements,n.numericRefinements)})},Bg=function(r,n){return r.setQueryParameters({hierarchicalFacetsRefinements:N({},r.hierarchicalFacetsRefinements,n.hierarchicalFacetsRefinements)})},Qg=function(r,n){var t=os([].concat(r.ruleContexts).concat(n.ruleContexts).filter(
36Boolean));return t.length>0?r.setQueryParameters({ruleContexts:t}):r},kt=function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];return n.reduce(function(i,a){var o=Bg(i,a),l=Mg(o,a),d=Ug(l,a),g=kg(d,a),m=Wg(g,a),v=$g(m,a),h=Lg(v,a),u=Dg(h,a),s=Qg(u,a),f=qg(s,a);return Hg(f,a)})},Vg=Fe({name:"configure",connector:!0});function Sc(e,r){return e.setQueryParameters(Object.keys(r.searchParameters).reduce(function(n,t){return L(N({},n),G({},t,void 0))},{}))}var bf=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ce,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return function(t){if(!t||!df(t.searchParameters))throw new Error(Vg("The `searchParameters` option expects an object."));var i={};function a(o){return function(l){var d=Sc(o.state,t),g=kt(d,new _e.SearchParameters(l));t.searchParameters=l,o.setState(g).search()}}return{$$type:"ais.configure",init:function(l){var d=l.instantSearchInstance;r(L(N({},this.getWidgetRenderState(l)),{instantSearchInstance:d}),!0)},render:function(l){var d=l.instantSearchInstance;r(L(N({},this.getWidgetRenderState(l)),{instantSearchInstance:d}),!1)},dispose:function(l){var d=l.state;return n(),Sc(d,t)},getRenderState:function(l,d){var g,m=this.getWidgetRenderState(d);return L(N({},l),{configure:L(N({},m),{widgetParams:L(N({},m.widgetParams),{searchParameters:kt(new _e.SearchParameters((g=l.configure)===null||g===void 0?void 0:g.widgetParams.searchParameters),new _e.SearchParameters(m.widgetParams.searchParameters)).getQueryParams()})})})},getWidgetRenderState:function(l){var d=l.helper;return i.refine||(i.refine=a(d)),{refine:i.refine,widgetParams:t}},getWidgetSearchParameters:function(l,d){var g=d.uiState;return kt(l,new _e.SearchParameters(N({},g.configure,t.searchParameters)))},getWidgetUiState:function(l){return L(N({},l),{configure:N({},l.configure,t.searchParameters)})}}}};function zg(e,r){var n=Array.isArray(r)?r:r.split(".");return n.reduce(function(t,i){return t&&t[i]},e)}var bc=Fe({name:"configure-related-items",connector:!0});function wc(e){var r=e.attributeName,n=e.attributeValue,t=e.attributeScore;return"".concat(r,":").concat(n,"<score=").concat(t||1,">")}var Kg=function(r,n){return function(t){var i=t||{},a=i.hit,o=i.matchingPatterns,l=i.transformSearchParameters,d=l===void 0?function(h){return h}:l;if(!a)throw new Error(bc("The `hit` option is required."));if(!o)throw new Error(bc("The `matchingPatterns` option is required."));var g=Object.keys(o).reduce(function(h,u){var s=o[u],f=zg(a,u),p=s.score;return Array.isArray(f)?Ae(h).concat([f.map(function(c){return wc({attributeName:u,attributeValue:c,attributeScore:p})})]):typeof f=="string"?Ae(h).concat([wc({attributeName:u,attributeValue:f,attributeScore:p})]):h},[]),m=N({},d(new _e.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.objectID)],optionalFilters:g}))),v=bf(r,n);return L(N({},v({searchParameters:m})),{$$type:"ais.configureRelatedItems"})}};function Jg(e,r){var n,t=(n=e.getWidgetRenderState)===null||n===void 0?void 0:n.call(e,r),i=null;if(t&&t.widgetParams){var a=t.widgetParams;a.attribute?i=a.attribute:Array.isArray(a.attributes)&&(i=a.attributes[0])}if(typeof i!="string")throw new Error(`Could not find the attribute of the widget: 37 38`.concat(JSON.stringify(e),` 39 40Please check whether the widget's getWidgetRenderState returns widgetParams.attribute correctly.`));return i}var Mn=Fe({name:"dynamic-widgets",connector:!0}),Gg=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Mn()),function(t){var i=t.widgets,a=t.maxValuesPerFacet,o=a===void 0?20:a,l=t.facets,d=l===void 0?["*"]:l,g=t.transformItems,m=g===void 0?function(u){return u}:g,v=t.fallbackWidget;if(!(i&&Array.isArray(i)&&i.every(function(u){return(typeof u>"u"?"undefined":Ft(u))==="object"})))throw new Error(Mn("The `widgets` option expects an array of widgets."));if(!Array.isArray(d))throw new Error(Mn("The `facets` option only accepts an array of facets, you passed ".concat(JSON.stringify(d))));var h=new Map;
40return{$$type:"ais.dynamicWidgets",init:function(s){i.forEach(function(f){var p=Jg(f,s);h.set(p,{widget:f,isMounted:!1})}),r(L(N({},this.getWidgetRenderState(s)),{instantSearchInstance:s.instantSearchInstance}),!0)},render:function(s){var f=s.parent,p=this.getWidgetRenderState(s),c=[],y=[];v&&p.attributesToRender.forEach(function(R){if(!h.has(R)){var b=v({attribute:R});h.set(R,{widget:b,isMounted:!1})}}),h.forEach(function(R,b){var w=R.widget,C=R.isMounted,O=p.attributesToRender.indexOf(b)>-1;!C&&O?(y.push(w),h.set(b,{widget:w,isMounted:!0})):C&&!O&&(c.push(w),h.set(b,{widget:w,isMounted:!1}))}),f.addWidgets(y),setTimeout(function(){return f.removeWidgets(c)},0),r(L(N({},p),{instantSearchInstance:s.instantSearchInstance}),!1)},dispose:function(s){var f=s.parent,p=[];h.forEach(function(c){var y=c.widget,R=c.isMounted;R&&p.push(y)}),f.removeWidgets(p),n()},getWidgetSearchParameters:function(s){return d.reduce(function(f,p){return f.addFacet(p)},s.setQueryParameters({maxValuesPerFacet:Math.max(o||0,s.maxValuesPerFacet||0)}))},getRenderState:function(s,f){return L(N({},s),{dynamicWidgets:this.getWidgetRenderState(f)})},getWidgetRenderState:function(s){var f=s.results;s.state;var p,c,y,R;if(!f)return{attributesToRender:[],widgetParams:t};var b=m((p=(R=f.renderingContent)===null||R===void 0||(y=R.facetOrdering)===null||y===void 0||(c=y.facets)===null||c===void 0?void 0:c.order)!==null&&p!==void 0?p:[],{results:f});if(!Array.isArray(b))throw new Error(Mn("The `transformItems` option expects a function that returns an Array."));return{attributesToRender:b,widgetParams:t}}}}};function Xg(e){return typeof e=="string"?e.replace(/^\\-/,"-"):e}function yr(e){return typeof e=="number"&&e<0||typeof e=="string"?String(e).replace(/^-/,"\\-"):e}function Dt(e,r){for(var n,t=0;t<e.length;t++)if(n=e[t],r(n,t,e))return n}function Ia(e,r,n,t){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a={type:r,attribute:n,name:t,escapedValue:yr(t)},o=Dt(i,function(u){return u.name===n}),l;if(r==="hierarchical"){for(var d=function(u){o=o&&o.data&&Dt(Object.keys(o.data).map(v(o.data)),function(s){return s.name===m[u]})},g=e.getHierarchicalFacetByName(n),m=t.split(g.separator),v=function(s){return function(f){return s[f]}},h=0;o!==void 0&&h<m.length;++h)d(h);l=o&&o.count}else l=o&&o.data&&o.data[a.name];return l!==void 0&&(a.count=l),o&&o.exhaustive!==void 0&&(a.exhaustive=o.exhaustive),a}function us(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,t=e||{},i=[],a=r.facetsRefinements,o=a===void 0?{}:a,l=r.facetsExcludes,d=l===void 0?{}:l,g=r.disjunctiveFacetsRefinements,m=g===void 0?{}:g,v=r.hierarchicalFacetsRefinements,h=v===void 0?{}:v,u=r.numericRefinements,s=u===void 0?{}:u,f=r.tagRefinements,p=f===void 0?[]:f;return Object.keys(o).forEach(function(c){var y=o[c];y.forEach(function(R){i.push(Ia(r,"facet",c,R,t.facets))})}),Object.keys(d).forEach(function(c){var y=d[c];y.forEach(function(R){i.push({type:"exclude",attribute:c,name:R,exclude:!0})})}),Object.keys(m).forEach(function(c){var y=m[c];y.forEach(function(R){i.push(Ia(r,"disjunctive",c,Xg(R),t.disjunctiveFacets))})}),Object.keys(h).forEach(function(c){var y=h[c];y.forEach(function(R){i.push(Ia(r,"hierarchical",c,R,t.hierarchicalFacets))})}),Object.keys(s).forEach(function(c){var y=s[c];Object.keys(y).forEach(function(R){var b=R,w=y[b],C=Array.isArray(w)?w:[w];C.forEach(function(O){i.push({type:"numeric",attribute:c,name:"".concat(O),numericValue:O,operator:b})})})}),p.forEach(function(c){i.push({type:"tag",attribute:"_tags",name:c})}),n&&r.query&&r.query.trim()&&i.push({attribute:"query",type:"query",name:r.query,query:r.query}),i}function Pc(e){var r=e.helper,n=e.attributesToClear,t=n===void 0?[]:n,i=r.state.setPage(0);return i=t.reduce(function(a,o){return i.isNumericRefined(o)?a.removeNumericRefinement(o):i.isHierarchicalFacet(o)?a.removeHierarchicalFacetRefinement(o):i.isDisjunctiveFacet(o)?a.removeDisjunctiveFacetRefinement(o):i.isConjunctiveFacet(o)?a.removeFacetRefinement(o):a},i),t.indexOf("query")!==-1&&(i=i.setQuery("")),i}var Ec=Fe({name:"clear-refinements",connector:!0}),Yg=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Ec()),function(t){var i=t||{},a=i.includedAttributes,o=a===void 0?[]:a,l=i.excludedAttributes,d=l===void 0?["query"]:l,g=i.transformItems,m=g===void 0?function(s){return s}:g;if(t&&t.includedAttributes&&t.excludedAttributes)throw new Error(Ec("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var v={refine:Ce,createURL:function(){return""},attributesToClear:[]},h=function(){return v.refine()},u=function(){return v.createURL()};return{$$type:"ais.clearRefinements",init:function(f){var p=f.instantSearchInstance;r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:p}),!0)},render:function(f){var p=f.instantSearchInstance;r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:p}),!1)},dispose:function(){n()},getRenderState:function(f,p){return L(N({},f),{clearRefinements:this.getWidgetRenderState(p)})},getWidgetRenderState:function(f){var p=f.createURL,c=f.scopedResults,y=f.results;v.attributesToClear=c.reduce(function(b,w){return b.concat(Zg({scopedResult:w,includedAttributes:o,excludedAttributes:d,transformItems:m,results:y}))},[]),v.refine=function(){v.attributesToClear.forEach(function(b){var w=b.helper,C=b.items;w.setState(Pc({helper:w,attributesToClear:C})).search()})},v.createURL=function(){return p(kt.apply(void 0,Ae(v.attributesToClear.map(function(b){var w=b.helper,C=b.items;return Pc({helper:w,attributesToClear:C})}))))};var R=v.attributesToClear.some(function(b){return b.items.length>0});return{canRefine:R,hasRefinements:R,refine:h,createURL:u,widgetParams:t}}}}};function Zg(e){var r=e.scopedResult,n=e.includedAttributes,t=e.excludedAttributes,i=e.transformItems,a=e.results,o=n.indexOf("query")!==-1||t.indexOf("query")===-1;return{helper:r.helper,items:i(os(us(r.results,r.helper.state,o).map(function(l){return l.attribute}).filter(function(l){return n.length===0||n.indexOf(l)!==-1}).filter(function(l){return l==="query"&&o||t.indexOf(l)===-1})),{results:a})}}var xc=Fe({name:"current-refinements",connector:!0}),em=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,xc()),function(t){if((t||{}).includedAttributes&&(t||{}).excludedAttributes)throw new Error(xc("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var i=t||{},a=i.includedAttributes,o=i.excludedAttributes,l=o===void 0?["query"]:o,d=i.transformItems,g=d===void 0?function(m){return m}:d;return{$$type:"ais.currentRefinements",init:function(v){var h=v.instantSearchInstance;r(L(N({},this.getWidgetRenderState(v)),{instantSearchInstance:h}),!0)},render:function(v){var h=v.instantSearchInstance;r(L(N({},this.getWidgetRenderState(v)),{instantSearchInstance:h}),!1)},dispose:function(){n()},getRenderState:function(v,h){return L(N({},v),{currentRefinements:this.getWidgetRenderState(h)})},getWidgetRenderState:function(v){var h=v.results,u=v.scopedResults,s=v.createURL,f=v.helper;function p(){return h?u.reduce(function(y,R){return y.concat(g(Cc({results:R.results,helper:R.helper,indexId:R.indexId,includedAttributes:a,excludedAttributes:l}),{results:h}))},[]):g(Cc({results:null,helper:f,indexId:f.state.index,includedAttributes:a,excludedAttributes:l}),{results:h})}var c=p();return{items:c,canRefine:c.length>0,refine:function(R){return Pf(f,R)},createURL:function(R){return s(wf(f.state,R))},widgetParams:t}}}}};function Cc(e){var r=e.results,n=e.helper,t=e.indexId,i=e.includedAttributes,a=e.excludedAttributes,o=(i||[]).indexOf("query")!==-1||(a||[]).indexOf("query")===-1,l=i?function(g){return i.indexOf(g.attribute)!==-1}:function(g){return a.indexOf(g.attribute)===-1},d=us(r,n.state,o).map(rm).filter(l);return d.reduce(function(g,m){return Ae(g.filter(function(v){return v.attribute!==m.attribute})).concat([{indexName:n.state.index,indexId:t,attribute:m.attribute,label:m.attribute,refinements:d.filter(function(v){return v.attribute===m.attribute}).sort(function(v,h){return v.type==="numeric"?v.value-h.value:0}),refine:function(h){return Pf(n,h)}}])},[])}function wf(e,r){switch(e=e.resetPage(),r.type){case"facet":return e.removeFacetRefinement(r.attribute,String(r.value));case"disjunctive":return e.removeDisjunctiveFacetRefinement(r.attribute,String(r.value));case"hierarchical":return e.removeHierarchicalFacetRefinement(r.attribute);case"exclude":return e.removeExcludeRefinement(r.attribute,String(r.value));case"numeric":return e.removeNumericRefinement(r.attribute,r.operator,String(r.value));case"tag":return e.removeTagRefinement(String(r.value));case"query":return e.setQueryParameter("query","");default:return e}}function Pf(e,r){e.setState(wf(e.state,r)).search()}function tm(e){switch(e){case">=":return"â¥";case"<=":return"â¤";default:return e}}function rm(e){var r=nm(e),n=e.operator?"".concat(tm(e.operator)," ").concat(e.name):e.name,t={attribute:e.attribute,type:e.type,value:r,label:n};return e.operator!==void 0&&(t.operator=e.operator),e.count!==void 0&&(t.count=e.count),e.exhaustive!==void 0&&(t.exhaustive=e.exhaustive),t}function nm(e){return e.type==="numeric"?Number(e.name):"escapedValue"in e?e.escapedValue:e.name}function im(e){if(Array.isArray(e))return e}function am(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var t=[],i=!0,a=!1,o,l;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(t.push(o.value),!(r&&t.length===r));i=!0);}catch(d){a=!0,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw l}}return t}}
40function sm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 41In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function we(e,r){return im(e)||am(e,r)||lf(e,r)||sm()}function om(e,r,n){return e.state.isHierarchicalFacet(r)?e.state.isHierarchicalFacetRefined(r,n):e.state.isConjunctiveFacet(r)?e.state.isFacetRefined(r,n):e.state.isDisjunctiveFacetRefined(r,n)}function cs(e){var r=e.instantSearchInstance,n=e.helper,t=e.attribute,i=e.widgetType,a=function(){for(var l=arguments.length,d=new Array(l),g=0;g<l;g++)d[g]=arguments[g];var m=we(d,4),v=m[1],h=m[2],u=h===void 0?"Filter Applied":h,s=m[3],f=s===void 0?{}:s,p=we(d[0].split(":"),2),c=p[0],y=p[1],R=typeof t=="string"?t:t(v);if(d.length===1&&Ft(d[0])==="object")r.sendEventToInsights(d[0]);else if(c==="click"&&d.length>=2&&d.length<=4&&!om(n,R,v)){var b;r.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:i,eventType:c,eventModifier:y,payload:N({eventName:u,index:((b=n.lastResults)===null||b===void 0?void 0:b.index)||n.state.index,filters:["".concat(R,":").concat(v)]},f),attribute:R})}};return a}var Ta=Fe({name:"hierarchical-menu",connector:!0}),Fc=["name:asc"],um=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Ta()),function(t){var i=t||{},a=i.attributes,o=i.separator,l=o===void 0?" > ":o,d=i.rootPath,g=d===void 0?null:d,m=i.showParentLevel,v=m===void 0?!0:m,h=i.limit,u=h===void 0?10:h,s=i.showMore,f=s===void 0?!1:s,p=i.showMoreLimit,c=p===void 0?20:p,y=i.sortBy,R=y===void 0?Fc:y,b=i.transformItems,w=b===void 0?function(M){return M}:b;if(!a||!Array.isArray(a)||a.length===0)throw new Error(Ta("The `attributes` option expects an array of strings."));if(f===!0&&c<=u)throw new Error(Ta("The `showMoreLimit` option must be greater than `limit`."));var C=we(a,1),O=C[0],x,F=function(){};function T(){F()}var A,D=!1;function W(M,$){return function(){D=!D,$.render(M)}}function Q(){return D?c:u}function J(M){return M.slice(0,Q()).map(function($){var B=$.name,V=$.escapedValue,z=$.data;$.path;var ne=ze($,["name","escapedValue","data","path"]),ie=L(N({},ne),{value:V,label:B,data:null});return Array.isArray(z)&&(ie.data=J(z)),ie})}function k(M,$){var B=Q();return!($>B?M.length<=B:M.length<B)||M.slice(0,u).some(function(V){return Array.isArray(V.data)&&V.data.length>0&&k(V.data,$)})}return{$$type:"ais.hierarchicalMenu",init:function($){var B=$.instantSearchInstance;r(L(N({},this.getWidgetRenderState($)),{instantSearchInstance:B}),!0)},render:function($){var B=$.instantSearchInstance;F=W($,this),r(L(N({},this.getWidgetRenderState($)),{instantSearchInstance:B}),!1)},dispose:function($){var B=$.state;return n(),B.removeHierarchicalFacet(O).setQueryParameter("maxValuesPerFacet",void 0)},getRenderState:function($,B){return L(N({},$),{hierarchicalMenu:L(N({},$.hierarchicalMenu),G({},O,this.getWidgetRenderState(B)))})},getWidgetRenderState:function($){var B=this,V=$.results,z=$.state,ne=$.createURL,ie=$.instantSearchInstance,ue=$.helper,Z=[],se=!1,ve=function(ye){return ne(function(at){return B.getWidgetUiState(at,{searchParameters:z.resetPage().toggleFacetRefinement(O,ye),helper:ue})})};if(x||(x=cs({instantSearchInstance:ie,helper:ue,attribute:function(ye){var at=ye.split(l).length-1;return a[at]},widgetType:this.$$type})),A||(A=function(ye){x("click:internal",ye),ue.toggleFacetRefinement(O,ye).search()}),V){var pe=V.getFacetValues(O,{sortBy:R,facetOrdering:R===Fc}),Ne=pe&&!Array.isArray(pe)&&pe.data?pe.data:[],Oe=k(Ne,z.maxValuesPerFacet||0);se=f&&(D||Oe),Z=w(J(Ne),{results:V})}return{items:Z,refine:A,canRefine:Z.length>0,createURL:ve,sendEvent:x,widgetParams:t,isShowingMore:D,toggleShowMore:T,canToggleShowMore:se}},getWidgetUiState:function($,B){var V=B.searchParameters,z=V.getHierarchicalFacetBreadcrumb(O);return cm(L(N({},$),{hierarchicalMenu:L(N({},$.hierarchicalMenu),G({},O,z))}),O)},getWidgetSearchParameters:function($,B){var V=B.uiState,z=V.hierarchicalMenu&&V.hierarchicalMenu[O];if($.isConjunctiveFacet(O)||$.isDisjunctiveFacet(O))return $;$.isHierarchicalFacet(O)&&$.getHierarchicalFacetByName(O);var ne=$.removeHierarchicalFacet(O).addHierarchicalFacet({name:O,attributes:a,separator:l,rootPath:g,showParentLevel:v}),ie=ne.maxValuesPerFacet||0,ue=Math.max(ie,f?c:u),Z=ne.setQueryParameter("maxValuesPerFacet",ue);return z?Z.addHierarchicalFacetRefinement(O,z.join(l)):Z.setQueryParameters({hierarchicalFacetsRefinements:L(N({},Z.hierarchicalFacetsRefinements),G({},O,[]))})}}}};function cm(e,r){return e.hierarchicalMenu&&((!e.hierarchicalMenu[r]||e.hierarchicalMenu[r].length===0)&&delete e.hierarchicalMenu[r],Object.keys(e.hierarchicalMenu).length===0&&delete e.hierarchicalMenu),e}function lm(e){return btoa(encodeURIComponent(JSON.stringify(e)))}function fm(e){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,n=[],t=0;t<Math.ceil(e.length/r);t++)n.push(e.slice(t*r,(t+1)*r));return n}function Ef(e){var r=e.helper,n=e.widgetType;e.methodName;var t=e.args,i=e.instantSearchInstance;if(t.length===1&&Ft(t[0])==="object")return[t[0]];var a=we(t[0].split(":"),2),o=a[0],l=a[1],d=t[1],g=t[2],m=t[3]||{};if(!d)return[];if((o==="click"||o==="conversion")&&!g)return[];var v=Array.isArray(d)?d:[d];if(v.length===0)return[];var h=v[0].__queryID,u=fm(v),s=u.map(function(p){return p.map(function(c){return c.objectID})}),f=u.map(function(p){return p.map(function(c){return c.__position})});return o==="view"?i.status!=="idle"?[]:u.map(function(p,c){var y;return{insightsMethod:"viewedObjectIDs",widgetType:n,eventType:o,payload:N({eventName:g||"Hits Viewed",index:((y=r.lastResults)===null||y===void 0?void 0:y.index)||r.state.index,objectIDs:s[c]},m),hits:p,eventModifier:l}}):o==="click"?u.map(function(p,c){var y;return{insightsMethod:"clickedObjectIDsAfterSearch",widgetType:n,eventType:o,payload:N({eventName:g||"Hit Clicked",index:((y=r.lastResults)===null||y===void 0?void 0:y.index)||r.state.index,queryID:h,objectIDs:s[c],positions:f[c]},m),hits:p,eventModifier:l}}):o==="conversion"?u.map(function(p,c){var y;return{insightsMethod:"convertedObjectIDsAfterSearch",widgetType:n,eventType:o,payload:N({eventName:g||"Hit Converted",index:((y=r.lastResults)===null||y===void 0?void 0:y.index)||r.state.index,queryID:h,objectIDs:s[c]},m),hits:p,eventModifier:l}}):[]}function ls(e){var r=e.instantSearchInstance,n=e.helper,t=e.widgetType,i={},a=void 0,o=function(){for(var d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];var v=Ef({widgetType:t,helper:n,methodName:"sendEvent",args:g,instantSearchInstance:r});v.forEach(function(h){h.eventType==="click"&&h.eventModifier==="internal"&&i[h.eventType]||(i[h.eventType]=!0,r.sendEventToInsights(h))}),clearTimeout(a),a=setTimeout(function(){i={}},0)};return o}function xf(e){var r=e.helper,n=e.widgetType,t=e.instantSearchInstance,i=function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];var g=Ef({widgetType:n,helper:r,methodName:"bindEvent",args:l,instantSearchInstance:t});return g.length?"data-insights-event=".concat(lm(g)):""};return i}var dm=Fe({name:"hits",connector:!0}),hm=(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,dm()),function(t){var i=t||{},a=i.escapeHTML,o=a===void 0?!0:a,l=i.transformItems,d=l===void 0?function(v){return v}:l,g,m;return{$$type:"ais.hits",init:function(h){r(L(N({},this.getWidgetRenderState(h)),{instantSearchInstance:h.instantSearchInstance}),!0)},render:function(h){var u=this.getWidgetRenderState(h);r(L(N({},u),{instantSearchInstance:h.instantSearchInstance}),!1),u.sendEvent("view:internal",u.items)},getRenderState:function(h,u){return L(N({},h),{hits:this.getWidgetRenderState(u)})},getWidgetRenderState:function(h){var u=h.results,s=h.helper,f=h.instantSearchInstance,p,c,y;if(g||(g=ls({instantSearchInstance:f,helper:s,widgetType:this.$$type})),m||(m=xf({helper:s,widgetType:this.$$type,instantSearchInstance:f})),!u)return{hits:[],items:[],results:void 0,banner:void 0,sendEvent:g,bindEvent:m,widgetParams:t};o&&u.hits.length>0&&(u.hits=Ya(u.hits));var R=Za(u.hits,u.page,u.hitsPerPage),b=es(R,u.queryID),w=d(b,{results:u}),C=(y=u.renderingContent)===null||y===void 0||(c=y.widgets)===null||c===void 0||(p=c.banners)===null||p===void 0?void 0:p[0];return{hits:w,items:w,results:u,banner:C,sendEvent:g,bindEvent:m,widgetParams:t}},dispose:function(h){var u=h.state;return n(),o?u.setQueryParameters(Object.keys(ft).reduce(function(s,f){return L(N({},s),G({},f,void 0))},{})):u},getWidgetSearchParameters:function(h,u){return o?h.setQueryParameters(ft):h}}}}),pm=function(r,n){return n.map(function(t){var i=Dt(r,function(a){return a.objectID===t});if(typeof i>"u")throw new Error('Could not find objectID "'.concat(t,'" passed to `clickedObjectIDsAfterSearch` in the returned hits. This is necessary to infer the absolute position and the query ID.'));return i})},gm=function(r){var n=os(r.map(function(i){return i.__queryID}));if(n.length>
411)throw new Error("Insights currently allows a single `queryID`. The `objectIDs` provided map to multiple `queryID`s.");var t=n[0];if(typeof t!="string")throw new Error("Could not infer `queryID`. Ensure InstantSearch `clickAnalytics: true` was added with the Configure widget.\n\nSee: https://alg.li/lNiZZ7");return t},mm=function(r){return r.map(function(n){return n.__position})},vm=function(r){var n=r.method,t=r.results,i=r.hits,a=r.objectIDs,o=t.index,l=pm(i,a),d=gm(l);switch(n){case"clickedObjectIDsAfterSearch":{var g=mm(l);return{index:o,queryID:d,objectIDs:a,positions:g}}case"convertedObjectIDsAfterSearch":return{index:o,queryID:d,objectIDs:a};default:throw new Error('Unsupported method passed to insights: "'.concat(n,'".'))}},ym=function(r,n,t){return function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];var d=we(o,1),g=d[0];if(!r){var m=Fe({name:"instantsearch"});throw new Error(m("The `insightsClient` option has not been provided to `instantsearch`."))}if(!Array.isArray(g.objectIDs))throw new TypeError("Expected `objectIDs` to be an array.");var v=vm({method:i,results:n,hits:t,objectIDs:g.objectIDs});r(i,N({},v,g))}};function Cf(e){return function(r,n){return e(function(t,i){var a=t.results,o=t.hits,l=t.instantSearchInstance;if(a&&o&&l){var d=ym(l.insightsClient,a,o);return r(L(N({},t),{insights:d}),i)}return r(t,i)},n)}}var _m=Cf(hm),Un=Fe({name:"hits-per-page",connector:!0}),Rm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Un()),function(t){var i=t||{},a=i.items,o=i.transformItems,l=o===void 0?function(u){return u}:o;if(!Array.isArray(a))throw new Error(Un("The `items` option expects an array of objects."));var d=a,g=d.filter(function(u){return u.default===!0});if(g.length===0)throw new Error(Un("A default value must be specified in `items`."));if(g.length>1)throw new Error(Un("More than one default value is specified in `items`."));var m=g[0],v=function(s){var f=s.hitsPerPage;return d.map(function(p){return L(N({},p),{isRefined:Number(p.value)===Number(f)})})},h={getRefine:function(s){return function(f){return!f&&f!==0?s.setQueryParameter("hitsPerPage",void 0).search():s.setQueryParameter("hitsPerPage",f).search()}},createURLFactory:function(s){var f=s.state,p=s.createURL,c=s.getWidgetUiState,y=s.helper;return function(R){return p(function(b){return c(b,{searchParameters:f.resetPage().setQueryParameter("hitsPerPage",!R&&R!==0?void 0:R),helper:y})})}}};return{$$type:"ais.hitsPerPage",init:function(s){var f=s.state,p=s.instantSearchInstance,c=d.some(function(y){return Number(f.hitsPerPage)===Number(y.value)});c||(d=[{value:"",label:""}].concat(Ae(d))),r(L(N({},this.getWidgetRenderState(s)),{instantSearchInstance:p}),!0)},render:function(s){var f=s.instantSearchInstance;r(L(N({},this.getWidgetRenderState(s)),{instantSearchInstance:f}),!1)},dispose:function(s){var f=s.state;return n(),f.setQueryParameter("hitsPerPage",void 0)},getRenderState:function(s,f){return L(N({},s),{hitsPerPage:this.getWidgetRenderState(f)})},getWidgetRenderState:function(s){var f=s.state,p=s.results,c=s.createURL,y=s.helper,R=p?p.nbHits>0:!1;return{items:l(v(f),{results:p}),refine:h.getRefine(y),createURL:h.createURLFactory({state:f,createURL:c,getWidgetUiState:this.getWidgetUiState,helper:y}),hasNoResults:!R,canRefine:R,widgetParams:t}},getWidgetUiState:function(s,f){var p=f.searchParameters,c=p.hitsPerPage;return c===void 0||c===m.value?s:L(N({},s),{hitsPerPage:c})},getWidgetSearchParameters:function(s,f){var p=f.uiState;return s.setQueryParameters({hitsPerPage:p.hitsPerPage||m.value})}}}},Sm=["ais.index","ais.feedContainer"];function lt(e){return Sm.includes(e.$$type)}function Ff(e,r){r(e),e.getWidgets().forEach(function(n){lt(n)&&Ff(n,r)})}function bm(e){return e.$$type==="ais.dynamicWidgets"||e.$$type==="ais.feeds"}function Oc(e){return e!==Object(e)}function fs(e,r){if(e===r)return!0;if(Oc(e)||Oc(r)||typeof e=="function"||typeof r=="function")return e===r;if(Object.keys(e).length!==Object.keys(r).length)return!1;var n=!0,t=!1,i=void 0;try{for(var a=Object.keys(e)[Symbol.iterator](),o;!(n=(o=a.next()).done);
41n=!0){var l=o.value;if(!(l in r)||!fs(e[l],r[l]))return!1}}catch(d){t=!0,i=d}finally{try{!n&&a.return!=null&&a.return()}finally{if(t)throw i}}return!0}var wm=Fe({name:"infinite-hits",connector:!0});function Ac(e){var r=e||{};r.page;var n=ze(r,["page"]);return n}function Ic(e){var r=e||{};r.clickAnalytics,r.userToken;var n=ze(r,["clickAnalytics","userToken"]);return n}function Pm(){var e=null,r=null;return{read:function(t){var i=t.state;return fs(r,Ac(i))?e:null},write:function(t){var i=t.state,a=t.hits;r=Ac(i),e=a}}}function Em(e){return Object.keys(e).map(Number).sort(function(r,n){return r-n}).reduce(function(r,n){return r.concat(e[n])},[])}var xm=(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,wm()),function(t){var i=t||{},a=i.escapeHTML,o=a===void 0?!0:a,l=i.transformItems,d=l===void 0?function(R){return R}:l,g=i.cache,m=g===void 0?Pm():g,v,h,u,s,f=function(b,w){var C=b.page,O=C===void 0?0:C,x=Object.keys(w).map(Number);if(x.length===0)return O;var F;return(F=Math).min.apply(F,[O].concat(Ae(x)))},p=function(b,w){var C=b.page,O=C===void 0?0:C,x=Object.keys(w).map(Number);if(x.length===0)return O;var F;return(F=Math).max.apply(F,[O].concat(Ae(x)))},c=function(b,w){return function(){var C=w();b.overrideStateWithoutTriggeringChangeEvent(L(N({},b.state),{page:f(b.state,C)-1})).searchWithoutTriggeringOnStateChange()}},y=function(b,w){return function(){var C=w();b.setPage(p(b.state,C)+1).search()}};return{$$type:"ais.infiniteHits",init:function(b){r(L(N({},this.getWidgetRenderState(b)),{instantSearchInstance:b.instantSearchInstance}),!0)},render:function(b){var w=b.instantSearchInstance,C=this.getWidgetRenderState(b);r(L(N({},C),{instantSearchInstance:w}),!1),u("view:internal",C.currentPageHits)},getRenderState:function(b,w){return L(N({},b),{infiniteHits:this.getWidgetRenderState(w)})},getWidgetRenderState:function(b){var w=b.results,C=b.helper,O=b.parent,x=b.state,F=b.instantSearchInstance,T,A,D,W=function(){var He=O.getPreviousState()||x;return m.read({state:Ic(He)})||{}},Q,J=[],k=O.getPreviousState()||x,M=W(),$=w==null||(D=w.renderingContent)===null||D===void 0||(A=D.widgets)===null||A===void 0||(T=A.banners)===null||T===void 0?void 0:T[0];if(v||(v=function(){return c(C,W)()},h=function(){return y(C,W)()}),u||(u=ls({instantSearchInstance:F,helper:C,widgetType:this.$$type}),s=xf({helper:C,widgetType:this.$$type,instantSearchInstance:F})),!w)Q=k.page===void 0||f(k,M)===0;else{var B,V,z=k.page,ne=z===void 0?0:z;o&&w.hits.length>0&&(w.hits=Ya(w.hits));var ie=Za(w.hits,w.page,w.hitsPerPage),ue=es(ie,w.queryID),Z=d(ue,{results:w}),se=!1;Ff(F.mainIndex,function(Oe){!se&&Oe.getWidgets().some(bm)&&(se=!0)});var ve=!(!((B=k.disjunctiveFacets)===null||B===void 0)&&B.length)&&!(k.facets||[]).filter(function(Oe){return Oe!=="*"}).length&&!(!((V=k.hierarchicalFacets)===null||V===void 0)&&V.length);M[ne]===void 0&&!w.__isArtificial&&F.status==="idle"&&!(se&&ve)&&(M[ne]=Z,m.write({state:Ic(k),hits:M})),J=Z,Q=f(k,M)===0}var pe=Em(M),Ne=w?w.nbPages<=p(k,M)+1:!0;return{hits:pe,items:pe,currentPageHits:J,sendEvent:u,bindEvent:s,banner:$,results:w||void 0,showPrevious:v,showMore:h,isFirstPage:Q,isLastPage:Ne,widgetParams:t}},dispose:function(b){var w=b.state;n();var C=w.setQueryParameter("page",void 0);return o?C.setQueryParameters(Object.keys(ft).reduce(function(O,x){return L(N({},O),G({},x,void 0))},{})):C},getWidgetUiState:function(b,w){var C=w.searchParameters,O=C.page||0;return O?L(N({},b),{page:O+1}):b},getWidgetSearchParameters:function(b,w){var C=w.uiState,O=b;o&&(O=b.setQueryParameters(ft));var x=C.page?C.page-1:0;return O.setQueryParameter("page",x)}}}}),Cm=Cf(xm),ja=Fe({name:"menu",connector:!0}),Tc=["isRefined","name:asc"],Of=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,ja()),function(t){var i=t||{},a=i.attribute,o=i.limit,l=o===void 0?10:o,d=i.showMore,g=d===void 0?!1:d,m=i.showMoreLimit,v=m===void 0?20:m,h=i.sortBy,u=h===void 0?Tc:h,s=i.transformItems,f=s===void 0?function(x){return x}:s;if(!a)throw new Error(ja("The `attribute` option is required."));if(g===!0&&v<=l)throw new Error(ja("The `showMoreLimit` option must be greater than `limit`."));var p,c,y,R=!1,b=function(){};function w(x,F){return function(){R=!R,F.render(x)}}function C(){b()}function O(){return R?v:l}return{$$type:"ais.menu",init:function(F){var T=F.instantSearchInstance;r(L(N({},this.getWidgetRenderState(F)),{instantSearchInstance:T}),!0)},render:function(F){var T=F.instantSearchInstance;r(L(N({},this.getWidgetRenderState(F)),{instantSearchInstance:T}),!1)},dispose:function(F){var T=F.state;return n(),T.removeHierarchicalFacet(a).setQueryParameter("maxValuesPerFacet",void 0)},getRenderState:function(F,T){return L(N({},F),{menu:L(N({},F.menu),G({},a,this.getWidgetRenderState(T)))})},getWidgetRenderState:function(F){var T=this,A=F.results,D=F.createURL,W=F.instantSearchInstance,Q=F.helper,J=[],k=!1;if(p||(p=cs({instantSearchInstance:W,helper:Q,attribute:a,widgetType:this.$$type})),c||(c=function(V){return D(function(z){return T.getWidgetUiState(z,{searchParameters:Q.state.resetPage().toggleFacetRefinement(a,V),helper:Q})})}),y||(y=function(V){var z=we(Q.getHierarchicalFacetBreadcrumb(a),1),ne=z[0];p("click:internal",V||ne),Q.toggleFacetRefinement(a,V||ne).search()}),F.results&&(b=w(F,this)),A){var M=A.getFacetValues(a,{sortBy:u,facetOrdering:u===Tc}),$=M&&!Array.isArray(M)&&M.data?M.data:[];k=g&&(R||$.length>
41O()),J=f($.slice(0,O()).map(function(B){var V=B.name,z=B.escapedValue;B.path;var ne=ze(B,["name","escapedValue","path"]);return L(N({},ne),{label:V,value:z})}),{results:A})}return{items:J,createURL:c,refine:y,sendEvent:p,canRefine:J.length>0,widgetParams:t,isShowingMore:R,toggleShowMore:C,canToggleShowMore:k}},getWidgetUiState:function(F,T){var A=T.searchParameters,D=we(A.getHierarchicalFacetBreadcrumb(a),1),W=D[0];return Fm(L(N({},F),{menu:L(N({},F.menu),G({},a,W))}),a)},getWidgetSearchParameters:function(F,T){var A=T.uiState,D=A.menu&&A.menu[a];if(F.isConjunctiveFacet(a)||F.isDisjunctiveFacet(a))return F;var W=F.removeHierarchicalFacet(a).addHierarchicalFacet({name:a,attributes:[a]}),Q=W.maxValuesPerFacet||0,J=Math.max(Q,g?v:l),k=W.setQueryParameter("maxValuesPerFacet",J);return D?k.addHierarchicalFacetRefinement(a,D):k.setQueryParameters({hierarchicalFacetsRefinements:L(N({},k.hierarchicalFacetsRefinements),G({},a,[]))})}}}};function Fm(e,r){return e.menu&&(e.menu[r]===void 0&&delete e.menu[r],Object.keys(e.menu).length===0&&delete e.menu),e}function xe(e){return typeof e=="number"&&isFinite(e)}var Na=Fe({name:"numeric-menu",connector:!0}),Om="ais.numericMenu",Am=function(r){var n=r.instantSearchInstance;return function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];if(i.length===1){n.sendEventToInsights(i[0]);return}}},Im=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Na()),function(t){var i=t||{},a=i.attribute,o=a===void 0?"":a,l=i.items,d=l===void 0?[]:l,g=i.transformItems,m=g===void 0?function(u){return u}:g;if(o==="")throw new Error(Na("The `attribute` option is required."));if(!d||d.length===0)throw new Error(Na("The `items` option expects an array of objects."));var v=function(s){return d.map(function(f){var p=f.start,c=f.end,y=f.label;return{label:y,value:encodeURI(JSON.stringify({start:p,end:c})),isRefined:Af(s,o,{start:p,end:c})}})},h={};return{$$type:Om,init:function(s){var f=s.instantSearchInstance;r(L(N({},this.getWidgetRenderState(s)),{instantSearchInstance:f}),!0)},render:function(s){var f=s.instantSearchInstance;r(L(N({},this.getWidgetRenderState(s)),{instantSearchInstance:f}),!1)},dispose:function(s){var f=s.state;return n(),f.removeNumericRefinement(o)},getWidgetUiState:function(s,f){var p=f.searchParameters,c=p.getNumericRefinements(o),y=c["="]&&c["="][0];if(y||y===0)return L(N({},s),{numericMenu:L(N({},s.numericMenu),G({},o,"".concat(c["="])))});var R=c[">="]&&c[">="][0]||"",b=c["<="]&&c["<="][0]||"";return Tm(L(N({},s),{numericMenu:L(N({},s.numericMenu),G({},o,"".concat(R,":").concat(b)))}),o)},getWidgetSearchParameters:function(s,f){var p=f.uiState,c=p.numericMenu&&p.numericMenu[o],y=s.setQueryParameters({numericRefinements:L(N({},s.numericRefinements),G({},o,{}))});if(!c)return y;var R=c.indexOf(":")===-1;if(R)return y.addNumericRefinement(o,"=",Number(c));var b=we(c.split(":").map(parseFloat),2),w=b[0],C=b[1],O=xe(w)?y.addNumericRefinement(o,">=",w):y,x=xe(C)?O.addNumericRefinement(o,"<=",C):O;return x},getRenderState:function(s,f){return L(N({},s),{numericMenu:L(N({},s.numericMenu),G({},o,this.getWidgetRenderState(f)))})},getWidgetRenderState:function(s){var f=this,p=s.results,c=s.state,y=s.instantSearchInstance,R=s.helper,b=s.createURL;h.refine||(h.refine=function(Q){var J=jc(R.state,o,Q);h.sendEvent("click:internal",Q),R.setState(J).search()}),h.createURL||(h.createURL=function(Q){return function(J){return b(function(k){return f.getWidgetUiState(k,{searchParameters:jc(Q,o,J),helper:R})})}}),h.sendEvent||(h.sendEvent=Am({instantSearchInstance:y}));var w=p?p.nbHits===0:!0,C=v(c),O=!0,x=!0,F=!1,T=void 0;try{for(var A=C[Symbol.iterator](),D;!(x=(D=A.next()).done);x=!0){var W=D.value;if(W.isRefined&&decodeURI(W.value)!=="{}"){O=!1;break}}}catch(Q){F=!0,T=Q}finally{try{!x&&A.return!=null&&A.return()}finally{if(F)throw T}}return{createURL:h.createURL(c),items:m(C,{results:p}),hasNoResults:w,canRefine:!(w&&O),refine:h.refine,sendEvent:h.sendEvent,widgetParams:t}}}}};function Af(e,r,n){var t=e.getNumericRefinements(r);return n.start!==void 0&&n.end!==void 0?n.start===n.end?Pt(t,"=",n.start):Pt(t,">=",n.start)&&Pt(t,"<=",n.end):n.start!==void 0?Pt(t,">=",n.start):n.end!==void 0?Pt(t,"<=",n.end):n.start===void 0&&n.end===void 0?Object.keys(t).every(function(i){return(t[i]||[]).length===0}):!1}function jc(e,r,n){var t=e,i=JSON.parse(decodeURI(n)),a=t.getNumericRefinements(r);if(i.start===void 0&&i.end===void 0)return t.removeNumericRefinement(r);if(Af(t,r,i)||(t=t.removeNumericRefinement(r)),i.start!==void 0&&i.end!==void 0){if(i.start>i.end)throw new Error("option.start should be > to option.end");if(i.start===i.end)return Pt(a,"=",i.start)?t=t.removeNumericRefinement(r,"=",i.start):t=t.addNumericRefinement(r,"=",i.start),t}return i.start!==void 0&&(Pt(a,">=",i.start)&&(t=t.removeNumericRefinement(r,">=",i.start)),t=t.addNumericRefinement(r,">=",i.start)),i.end!==void 0&&(Pt(a,"<=",i.end)&&(t=t.removeNumericRefinement(r,"<=",i.end)),t=t.addNumericRefinement(r,"<=",i.end)),typeof t.page=="number"&&(t.page=0),t}function Pt(e,r,n){var t=e[r];return t!==void 0&&t.includes(n)}function Tm(e,r){return e.numericMenu&&(e.numericMenu[r]===":"&&delete e.numericMenu[r],Object.keys(e.numericMenu).length===0&&delete e.numericMenu),e}function ds(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function jm(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}function hs(e,r,n){return r&&jm(e.prototype,r),e}function Nc(e){var r=e.start,n=r===void 0?0:r,t=e.end,i=e.step,a=i===void 0?1:i,o=a===0?1:a,l=Math.round((t-n)/o);return Ae(Array(l)).map(function(d,g){return n+g*o})}var Nm=(function(){function e(r){ds(this,e),G(this,"currentPage",void 0),G(this,"total",void 0),G(this,"padding",void 0),this.currentPage=r.currentPage,this.total=r.total,this.padding=r.padding}return hs(e,[{key:"pages",value:function(){var n=this,t=n.total,i=n.currentPage,a=n.padding;if(t===0)return[0];var o=this.nbPagesDisplayed(a,t);
41if(o===t)return Nc({end:t});var l=this.calculatePaddingLeft(i,a,t,o),d=o-l,g=i-l,m=i+d;return Nc({start:g,end:m})}},{key:"nbPagesDisplayed",value:function(n,t){return Math.min(2*n+1,t)}},{key:"calculatePaddingLeft",value:function(n,t,i,a){return n<=t?n:n>=i-t?a-(i-n):t}},{key:"isLastPage",value:function(){return this.currentPage>=this.total-1}},{key:"isFirstPage",value:function(){return this.currentPage<=0}}]),e})(),Hm=Fe({name:"pagination",connector:!0}),qm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Hm()),function(t){var i=t||{},a=i.totalPages,o=i.padding,l=o===void 0?3:o,d=new Nm({currentPage:0,total:0,padding:l}),g={};function m(v){var h=v.nbPages;return a!==void 0?Math.min(a,h):h}return{$$type:"ais.pagination",init:function(h){var u=h.instantSearchInstance;r(L(N({},this.getWidgetRenderState(h)),{instantSearchInstance:u}),!0)},render:function(h){var u=h.instantSearchInstance;r(L(N({},this.getWidgetRenderState(h)),{instantSearchInstance:u}),!1)},dispose:function(h){var u=h.state;return n(),u.setQueryParameter("page",void 0)},getWidgetUiState:function(h,u){var s=u.searchParameters,f=s.page||0;return f?L(N({},h),{page:f+1}):h},getWidgetSearchParameters:function(h,u){var s=u.uiState,f=s.page?s.page-1:0;return h.setQueryParameter("page",f)},getWidgetRenderState:function(h){var u=h.results,s=h.helper,f=h.state,p=h.createURL;g.refine||(g.refine=function(R){s.setPage(R),s.search()}),g.createURL||(g.createURL=function(R){return p(function(b){return L(N({},b),{page:R+1})})});var c=f.page||0,y=m(u||{nbPages:0});return d.currentPage=c,d.total=y,{createURL:g.createURL,refine:g.refine,canRefine:y>1,currentRefinement:c,nbHits:(u==null?void 0:u.nbHits)||0,nbPages:y,pages:u?d.pages():[],isFirstPage:d.isFirstPage(),isLastPage:d.isLastPage(),widgetParams:t}},getRenderState:function(h,u){return L(N({},h),{pagination:this.getWidgetRenderState(u)})}}}},Ha=Fe({name:"range-input",connector:!0},{name:"range-slider",connector:!0}),Dm="ais.range";function Hc(e){var r=e.min,n=e.max,t=e.precision,i=Math.pow(10,t);return{min:r&&Math.floor(r*i)/i,max:n&&Math.ceil(n*i)/i}}var Mm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Ha()),function(t){var i=t||{},a=i.attribute,o=a===void 0?"":a,l=i.min,d=i.max,g=i.precision,m=g===void 0?0:g;if(!o)throw new Error(Ha("The `attribute` option is required."));if(xe(l)&&xe(d)&&l>d)throw new Error(Ha("The `max` option can't be lower than `min`."));var v=function(R){return Number(Number(R).toFixed(m))},h={from:function(R){return R.toLocaleString()},to:function(R){return v(R).toLocaleString()}},u=function(R,b,w,C){var O=R.state,x=b.min,F=b.max,T=we(O.getNumericRefinement(o,">=")||[],1),A=T[0],D=we(O.getNumericRefinement(o,"<=")||[],1),W=D[0],Q=w===void 0||w==="",J=C===void 0||C==="",k=Hc({min:Q?void 0:parseFloat(w),max:J?void 0:parseFloat(C),precision:m}),M=k.min,$=k.max,B;!xe(l)&&x===M?B=void 0:xe(l)&&Q?B=l:B=M;var V;!xe(d)&&F===$?V=void 0:xe(d)&&J?V=d:V=$;var z=B===void 0,ne=xe(x)&&x<=B,ie=z||xe(B)&&(!xe(x)||ne),ue=V===void 0,Z=xe(V)&&F>=V,se=ue||xe(V)&&(!xe(F)||Z),ve=A!==B,pe=W!==V;return(ve||pe)&&ie&&se?(O=O.removeNumericRefinement(o),xe(B)&&(O=O.addNumericRefinement(o,">=",B)),xe(V)&&(O=O.addNumericRefinement(o,"<=",V)),O.resetPage()):null},s=function(R){return function(){for(var b=arguments.length,w=new Array(b),C=0;C<b;C++)w[C]=arguments[C];if(w.length===1){R.sendEventToInsights(w[0]);return}}};function f(y){var R;xe(l)?R=l:xe(y.min)?R=y.min:R=0;var b;return xe(d)?b=d:xe(y.max)?b=y.max:b=0,Hc({min:R,max:b,precision:m})}function p(y){var R=we(y.getNumericRefinement(o,">=")||[],1),b=R[0],w=we(y.getNumericRefinement(o,"<=")||[],1),C=w[0],O=xe(b)?b:-1/0,x=xe(C)?C:1/0;return[O,x]}function c(y,R){return function(){var b=we(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[void 0,void 0],2),w=b[0],C=b[1],O=u(y,R,w,C);O&&y.setState(O).search()}}return{$$type:Dm,init:function(R){r(L(N({},this.getWidgetRenderState(R)),{instantSearchInstance:R.instantSearchInstance}),!0)},render:function(R){r(L(N({},this.getWidgetRenderState(R)),{instantSearchInstance:R.instantSearchInstance}),!1)},getRenderState:function(R,b){return L(N({},R),{range:L(N({},R.range),G({},o,this.getWidgetRenderState(b)))})},getWidgetRenderState:function(R){var b=R.results,w=R.helper,C=R.instantSearchInstance,O=b&&b.disjunctiveFacets||[],x=Dt(O,function(W){return W.name===o}),F=x&&x.stats||{min:void 0,max:void 0},T=f(F),A=p(w),D;return b?D=c(w,T):D=c(w,{min:void 0,max:void 0}),{refine:D,canRefine:T.min!==T.max,format:h,range:T,sendEvent:s(C),widgetParams:L(N({},t),{precision:m}),start:A}},dispose:function(R){var b=R.state;return n(),b.removeDisjunctiveFacet(o).removeNumericRefinement(o)},getWidgetUiState:function(R,b){var w=b.searchParameters,C=w.getNumericRefinements(o),O=C[">="],x=O===void 0?[]:O,F=C["<="],T=F===void 0?[]:F;return x.length===0&&T.length===0?R:L(N({},R),{range:L(N({},R.range),G({},o,"".concat(x,":").concat(T)))})},getWidgetSearchParameters:function(R,b){var w=b.uiState,C=R.addDisjunctiveFacet(o).setQueryParameters({numericRefinements:L(N({},R.numericRefinements),G({},o,{}))});xe(l)&&(C=C.addNumericRefinement(o,">=",l)),xe(d)&&(C=C.addNumericRefinement(o,"<=",d));var O=w.range&&w.range[o];if(!O||O.indexOf(":")===-1)return C;var x=we(O.split(":").map(parseFloat),2),F=x[0],T=x[1];return xe(F)&&(!xe(l)||l<F)&&(C=C.removeNumericRefinement(o,">="),C=C.addNumericRefinement(o,">=",F)),xe(T)&&(!xe(d)||T<d)&&(C=C.removeNumericRefinement(o,"<="),C=C.addNumericRefinement(o,"<=",T)),C}}}},Ln=Fe({name:"refinement-list",connector:!0}
41),qc=["isRefined","count:desc","name:asc"],Um=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Ln()),function(t){var i=t||{},a=i.attribute,o=i.operator,l=o===void 0?"or":o,d=i.limit,g=d===void 0?10:d,m=i.showMore,v=m===void 0?!1:m,h=i.showMoreLimit,u=h===void 0?20:h,s=i.sortBy,f=s===void 0?qc:s,p=i.escapeFacetValues,c=p===void 0?!0:p,y=i.transformItems,R=y===void 0?function(M){return M}:y;if(!a)throw new Error(Ln("The `attribute` option is required."));if(!/^(and|or)$/.test(l))throw new Error(Ln('The `operator` must one of: `"and"`, `"or"` (got "'.concat(l,'").')));if(v===!0&&u<=g)throw new Error(Ln("`showMoreLimit` should be greater than `limit`."));var b=function($){var B=$.name,V=$.escapedValue,z=ze($,["name","escapedValue"]);return L(N({},z),{value:V,label:B,highlighted:B})},w,C=[],O=!0,x,F,T=!1,A=function(){};function D(){A()}function W(M,$){return function(){T=!T,$.render(M)}}function Q(){return T?u:g}var J=function(){return function(){}},k=function($,B){return function(V){return function(z){var ne=V.instantSearchInstance,ie=V.results;if(z===""&&C)r(L(N({},B.getWidgetRenderState(L(N({},V),{results:w}))),{instantSearchInstance:ne}),!1);else{var ue={highlightPreTag:c?ft.highlightPreTag:Vn.highlightPreTag,highlightPostTag:c?ft.highlightPostTag:Vn.highlightPostTag};$.searchForFacetValues(a,z,Math.min(Q(),100),ue).then(function(Z){var se=c?vg(Z.facetHits):Z.facetHits,ve=R(se.map(function(pe){var Ne=pe.escapedValue,Oe=pe.value,He=ze(pe,["escapedValue","value"]);return L(N({},He),{value:Ne,label:Oe})}),{results:ie});r(L(N({},B.getWidgetRenderState(L(N({},V),{results:w}))),{items:ve,canToggleShowMore:!1,canRefine:!0,isFromSearch:!0,instantSearchInstance:ne}),!1)})}}}};return{$$type:"ais.refinementList",init:function($){r(L(N({},this.getWidgetRenderState($)),{instantSearchInstance:$.instantSearchInstance}),!0)},render:function($){r(L(N({},this.getWidgetRenderState($)),{instantSearchInstance:$.instantSearchInstance}),!1)},getRenderState:function($,B){return L(N({},$),{refinementList:L(N({},$.refinementList),G({},a,this.getWidgetRenderState(B)))})},getWidgetRenderState:function($){var B=this,V=$.results,z=$.state,ne=$.createURL,ie=$.instantSearchInstance,ue=$.helper,Z=[],se=[];if((!F||!x||!J)&&(F=cs({instantSearchInstance:ie,helper:ue,attribute:a,widgetType:this.$$type}),x=function(qe){F("click:internal",qe),ue.toggleFacetRefinement(a,qe).search()},J=k(ue,this)),V){var ve=V.getFacetValues(a,{sortBy:f,facetOrdering:f===qc});se=ve&&Array.isArray(ve)?ve:[],Z=R(se.slice(0,Q()).map(b),{results:V});var pe=z.maxValuesPerFacet,Ne=Q();O=pe>Ne?se.length<=Ne:se.length<Ne,w=V,C=Z,$.results&&(A=W($,this))}var Oe=J&&J($),He=T&&C.length>g,ye=v&&!O,at=He||ye;return{createURL:function(qe){return ne(function(Je){return B.getWidgetUiState(Je,{searchParameters:z.resetPage().toggleFacetRefinement(a,qe),helper:ue})})},items:Z,refine:x,searchForItems:Oe,isFromSearch:!1,canRefine:Z.length>0,widgetParams:t,isShowingMore:T,canToggleShowMore:at,toggleShowMore:D,sendEvent:F,hasExhaustiveItems:O}},dispose:function($){var B=$.state;n();var V=B.setQueryParameter("maxValuesPerFacet",void 0);return l==="and"?V.removeFacet(a):V.removeDisjunctiveFacet(a)},getWidgetUiState:function($,B){var V=B.searchParameters,z=l==="or"?V.getDisjunctiveRefinements(a):V.getConjunctiveRefinements(a);return Lm(L(N({},$),{refinementList:L(N({},$.refinementList),G({},a,z))}),a)},getWidgetSearchParameters:function($,B){var V=B.uiState,z=l==="or";if($.isHierarchicalFacet(a)||z&&$.isConjunctiveFacet(a)||!z&&$.isDisjunctiveFacet(a))return $;var ne=V.refinementList&&V.refinementList[a],ie=z?$.addDisjunctiveFacet(a).removeDisjunctiveFacetRefinement(a):$.addFacet(a).removeFacetRefinement(a),ue=ie.maxValuesPerFacet||0,Z=Math.max(ue,v?u:g),se=ie.setQueryParameter("maxValuesPerFacet",Z);if(!ne){var ve=z?"disjunctiveFacetsRefinements":"facetsRefinements";return se.setQueryParameters(G({},ve,L(N({},se[ve]),G({},a,[]))))}return ne.reduce(function(pe,Ne){return z?pe.addDisjunctiveFacetRefinement(a,Ne):pe.addFacetRefinement(a,Ne)},se)}}}};function Lm(e,r){return e.refinementList&&((!e.refinementList[r]||e.refinementList[r].length===0)&&delete e.refinementList[r],Object.keys(e.refinementList).length===0&&delete e.refinementList),e}var $m=Fe({name:"search-box",connector:!0}),Wm=function(r,n){return n(r)},km=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,$m()),function(t){var i=t||{},a=i.queryHook,o=a===void 0?Wm:a,l,d;return{$$type:"ais.searchBox",init:function(m){var v=m.instantSearchInstance;r(L(N({},this.getWidgetRenderState(m)),{instantSearchInstance:v}),!0)},render:function(m){var v=m.instantSearchInstance;r(L(N({},this.getWidgetRenderState(m)),{instantSearchInstance:v}),!1)},dispose:function(m){var v=m.state;return n(),v.setQueryParameter("query",void 0)},getRenderState:function(m,v){return L(N({},m),{searchBox:this.getWidgetRenderState(v)})},getWidgetRenderState:function(m){var v=m.helper,h=m.instantSearchInstance,u=m.state;return l||(l=function(f){o(f,function(p){return v.setQuery(p).search()})},d=function(){v.setQuery("").search()}),{query:u.query||"",refine:l,clear:d,widgetParams:t,isSearchStalled:h.status==="stalled"}},getWidgetUiState:function(m,v){var h=v.searchParameters,u=h.query||"";return u===""||m&&m.query===u?m:L(N({},m),{query:u})},getWidgetSearchParameters:function(m,v){var h=v.uiState;return m.setQueryParameter("query",h.query||"")}}}},cr=Fe({name:"sort-by",connector:!0});function ps(e){return"strategy"in e&&e.strategy!==void 0}function qa(e){return ps(e)?e.strategy:e.value}function Da(e,r){if(!r)return!1;var n=e[r];return n!==void 0&&ps(n)}var Bm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;je(r,cr());var t={};return function(i){var a=i||{},o=a.items,l=a.transformItems,d=l===void 0?function(m){return m}:l;if(!Array.isArray(o))throw new Error(cr("The `items` option expects an array of objects."));var g={};return o.forEach(function(m,v){var h="value"in m&&m.value!==void 0,u="strategy"in m&&m.strategy!==void 0;if(h&&u)throw new Error(cr("Item at index ".concat(v,' cannot have both "value" and "strategy" properties.')));if(!h&&!u)throw new Error(cr("Item at index ".concat(v,' must have either a "value" or "strategy" property.')));var s=qa(m);g[s]=m}),t.itemsLookup=g,{$$type:"ais.sortBy",init:function(v){var h=v.instantSearchInstance,u=o.some(function(p){return"strategy"in p&&p.strategy});if(u&&!h.compositionID)throw new Error(cr('Sorting strategies can only be used in composition mode. Please provide a "compositionID" to your InstantSearch instance.'));var s=this.getWidgetRenderState(v),f=s.currentRefinement;Dt(o,function(p){return qa(p)===f}),r(L(N({},s),{instantSearchInstance:h}),!0)},render:function(v){var h=v.instantSearchInstance;r(L(N({},this.getWidgetRenderState(v)),{instantSearchInstance:h}),!1)},dispose:function(v){var h=v.state;return n(),t.isUsingComposition&&h.sortBy&&(h=h.setQueryParameter("sortBy",void 0)),t.initialValue&&h.index!==t.initialValue?h.setIndex(t.initialValue):h},getRenderState:function(v,h){return L(N({},v),{sortBy:this.getWidgetRenderState(h)})},getWidgetRenderState:function(v){var h=v.results,u=v.helper,s=v.state,f=v.parent,p=v.instantSearchInstance;!t.initialValue&&f&&(t.initialValue=f.getIndexName()),t.refine||(t.isUsingComposition=!!(p!=null&&p.compositionID),t.refine=function(w){var C=t.itemsLookup[w];C&&ps(C)?u.setQueryParameter("sortBy",C.strategy).search():u.setQueryParameter("sortBy",void 0).setIndex(w).search()});var c=d(o,{results:h}),y=c.map(function(w){return{label:w.label,value:qa(w)}}),R=t.isUsingComposition&&Da(t.itemsLookup,s.sortBy)?s.sortBy:s.index,b=h?h.nbHits===0:!0;return{currentRefinement:R,options:y,refine:t.refine,hasNoResults:b,canRefine:!b&&o.length>0,widgetParams:i}},getWidgetUiState:function(v,h){var u=h.searchParameters,s=t.isUsingComposition&&Da(t.itemsLookup,u.sortBy)?u.sortBy:u.index;return L(N({},v),{sortBy:s!==t.initialValue?s:void 0})},getWidgetSearchParameters:function(v,h){var u=h.uiState,s=!u.sortBy||Object.prototype.hasOwnProperty.call(t.itemsLookup,u.sortBy),f=(s?u.sortBy:void 0)||t.initialValue||v.
41index;if(Da(t.itemsLookup,f)){var p=t.itemsLookup[f];return v.setQueryParameter("sortBy",p.strategy)}return v.setQueryParameter("index",f)}}}},Dc=Fe({name:"rating-menu",connector:!0}),If="ais.ratingMenu",$n=1,Qm=function(r){var n=r.instantSearchInstance,t=r.helper,i=r.getRefinedStar,a=r.attribute;return function(){for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];if(l.length===1){n.sendEventToInsights(l[0]);return}var g=we(l,3),m=g[1],v=g[2],h=v===void 0?"Filter Applied":v,u=we(l[0].split(":"),2),s=u[0],f=u[1];if(s==="click"){var p=i()===Number(m);if(!p){var c;n.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:If,eventType:s,eventModifier:f,payload:{eventName:h,index:((c=t.lastResults)===null||c===void 0?void 0:c.index)||t.state.index,filters:["".concat(a,">=").concat(m)]},attribute:a})}}}},Vm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Dc()),function(t){var i=t||{},a=i.attribute,o=i.max,l=o===void 0?5:o,d;if(!a)throw new Error(Dc("The `attribute` option is required."));var g=function(f){var p,c=f.getNumericRefinements(a);if(!((p=c[">="])===null||p===void 0)&&p.length)return c[">="][0]},m=function(f){var p=0;return f.forEach(function(c){var y=we(c.name.split("."),2),R=y[1],b=R===void 0?"":R;p=Math.max(p,b.length)}),p};function v(s,f){var p=g(s)===Number(f),c=s.resetPage().removeNumericRefinement(a);return p?c:c.addNumericRefinement(a,"<=",l).addNumericRefinement(a,">=",Number(f))}var h=function(f,p){d("click:internal",p),f.setState(v(f.state,p)).search()},u={toggleRefinementFactory:function(f){return h.bind(null,f)},createURLFactory:function(f){var p=f.state,c=f.createURL,y=f.getWidgetUiState,R=f.helper;return function(b){return c(function(w){return y(w,{searchParameters:v(p,b),helper:R})})}}};return{$$type:If,init:function(f){var p=f.instantSearchInstance;r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:p}),!0)},render:function(f){var p=f.instantSearchInstance;r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:p}),!1)},getRenderState:function(f,p){return L(N({},f),{ratingMenu:L(N({},f.ratingMenu),G({},a,this.getWidgetRenderState(p)))})},getWidgetRenderState:function(f){var p=f.helper,c=f.results,y=f.state,R=f.instantSearchInstance,b=f.createURL,w=[];d||(d=Qm({instantSearchInstance:R,helper:p,getRefinedStar:function(){return g(p.state)},attribute:a}));var C=!1,O=0,x=c==null?void 0:c.getFacetValues(a,{});if(c&&x){var F=function(W){var Q=T===W;C=C||Q;var J=x.filter(function(M){return Number(M.name)>=W&&Number(M.name)<=l}).map(function(M){return M.count}).reduce(function(M,$){return M+$},0);if(O+=J,T&&!Q&&J===0)return"continue";var k=Ae(new Array(Math.floor(l/$n))).map(function(M,$){return $*$n<W});w.push({stars:k,name:String(W),label:String(W),value:String(W),count:J,isRefined:Q})};x.length,m(x);for(var T=g(y),A=$n;A<l;A+=$n)F(A)}w=w.reverse();var D=c?c.nbHits===0:!0;return{items:w,hasNoResults:D,canRefine:(!D||C)&&O>0,refine:u.toggleRefinementFactory(p),sendEvent:d,createURL:u.createURLFactory({state:y,createURL:b,helper:p,getWidgetUiState:this.getWidgetUiState}),widgetParams:t}},dispose:function(f){var p=f.state;return n(),p.removeNumericRefinement(a)},getWidgetUiState:function(f,p){var c=p.searchParameters,y=g(c);return zm(L(N({},f),{ratingMenu:L(N({},f.ratingMenu),G({},a,typeof y=="number"?y:void 0))}),a)},getWidgetSearchParameters:function(f,p){var c=p.uiState,y=c.ratingMenu&&c.ratingMenu[a],R=f.addDisjunctiveFacet(a).removeNumericRefinement(a).removeDisjunctiveFacetRefinement(a);return y?R.addNumericRefinement(a,"<=",l).addNumericRefinement(a,">=",y):R.setQueryParameters({numericRefinements:L(N({},R.numericRefinements),G({},a,{}))})}}}};function zm(e,r){return e.ratingMenu&&(typeof e.ratingMenu[r]!="number"&&delete e.ratingMenu[r],Object.keys(e.ratingMenu).length===0&&delete e.ratingMenu),e}var Km=Fe({name:"stats",connector:!0}),Jm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Km()),function(t){return{$$type:"ais.stats",init:function(a){var o=a.instantSearchInstance;r(L(N({},this.getWidgetRenderState(a)),{instantSearchInstance:o}),!0)},render:function(a){var o=a.instantSearchInstance;r(L(N({},this.getWidgetRenderState(a)),{instantSearchInstance:o}),!1)},dispose:function(){n()},getRenderState:function(a,o){return L(N({},a),{stats:this.getWidgetRenderState(o)})},getWidgetRenderState:function(a){var o=a.results,l=a.state;return o?{hitsPerPage:o.hitsPerPage,nbHits:o.nbHits,nbSortedHits:o.nbSortedHits,areHitsSorted:typeof o.appliedRelevancyStrictness<"u"&&o.appliedRelevancyStrictness>0&&o.nbSortedHits!==o.nbHits,nbPages:o.nbPages,page:o.page,processingTimeMS:o.processingTimeMS,query:o.query,widgetParams:t}:{hitsPerPage:l.hitsPerPage,nbHits:0,nbSortedHits:void 0,areHitsSorted:!1,nbPages:0,page:l.page||0,processingTimeMS:-1,query:l.query||"",widgetParams:t}}}}};function Ma(e){return Array.isArray(e)?e:[e]}var Mc=Fe({name:"toggle-refinement",connector:!0}),Tf="ais.toggleRefinement",Gm=function(r){var n=r.instantSearchInstance,t=r.helper,i=r.attribute,a=r.on,o=function(){for(var d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];if(g.length===1){n.sendEventToInsights(g[0]);return}var v=we(g,3),h=v[1],u=v[2],s=u===void 0?"Filter Applied":u,f=we(g[0].split(":"),2),p=f[0],c=f[1];if(!(p!=="click"||a===void 0)&&!h){var y;n.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:Tf,eventType:p,eventModifier:c,payload:{eventName:s,index:((y=t.lastResults)===null||y===void 0?void 0:y.index)||t.state.index,filters:a.map(function(R){return"".concat(i,":").concat(R)})},attribute:i})}};return o},Xm=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Mc()),function(t){var i=t||{},a=i.attribute,o=i.on,l=o===void 0?!0:o,d=i.off;if(!a)throw new Error(Mc("The `attribute` option is required."));var g=d!==void 0,m=Ma(l).map(yr),v=g?Ma(d).map(yr):void 0,h,u=function(p){return function(){var c=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{isRefined:!1}).isRefined;c?(m.forEach(function(y){return p.removeDisjunctiveFacetRefinement(a,y)}),g&&v.forEach(function(y){return p.addDisjunctiveFacetRefinement(a,y)})):(h("click:internal",c),g&&v.forEach(function(y){return p.removeDisjunctiveFacetRefinement(a,y)}),m.forEach(function(y){return p.addDisjunctiveFacetRefinement(a,y)})),p.search()}},s={createURLFactory:function(p,c){var y=c.state,R=c.createURL,b=c.getWidgetUiState,w=c.helper;return function(){y=y.resetPage();var C=p?m:v;
41C&&C.forEach(function(x){y=y.removeDisjunctiveFacetRefinement(a,x)});var O=p?v:m;return O&&O.forEach(function(x){y=y.addDisjunctiveFacetRefinement(a,x)}),R(function(x){return b(x,{searchParameters:y,helper:w})})}}};return{$$type:Tf,init:function(p){var c=p.instantSearchInstance;r(L(N({},this.getWidgetRenderState(p)),{instantSearchInstance:c}),!0)},render:function(p){var c=p.instantSearchInstance;r(L(N({},this.getWidgetRenderState(p)),{instantSearchInstance:c}),!1)},dispose:function(p){var c=p.state;return n(),c.removeDisjunctiveFacet(a)},getRenderState:function(p,c){return L(N({},p),{toggleRefinement:L(N({},p.toggleRefinement),G({},a,this.getWidgetRenderState(c)))})},getWidgetRenderState:function(p){var c=p.state,y=p.helper,R=p.results,b=p.createURL,w=p.instantSearchInstance,C=R?m.every(function(Q){return c.isDisjunctiveFacetRefined(a,Q)}):m.every(function(Q){return c.isDisjunctiveFacetRefined(a,Q)}),O={isRefined:C,count:0},x={isRefined:g&&!C,count:0};if(R){var F=Ma(v||!1),T=R.getFacetValues(a,{})||[],A=m.map(function(Q){return Dt(T,function(J){var k=J.escapedValue;return k===yr(String(Q))})}).filter(function(Q){return Q!==void 0}),D=g?F.map(function(Q){return Dt(T,function(J){var k=J.escapedValue;return k===yr(String(Q))})}).filter(function(Q){return Q!==void 0}):[];O={isRefined:A.length?A.every(function(Q){return Q.isRefined}):!1,count:A.reduce(function(Q,J){return Q+J.count},0)||null},x={isRefined:D.length?D.every(function(Q){return Q.isRefined}):!1,count:D.reduce(function(Q,J){return Q+J.count},0)||T.reduce(function(Q,J){var k=J.count;return Q+k},0)}}h||(h=Gm({instantSearchInstance:w,attribute:a,on:m,helper:y}));var W=C?x:O;return{value:{name:a,isRefined:C,count:R?W.count:null,onFacetValue:O,offFacetValue:x},createURL:s.createURLFactory(C,{state:c,createURL:b,helper:y,getWidgetUiState:this.getWidgetUiState}),sendEvent:h,canRefine:!!(R&&W.count),refine:u(y),widgetParams:t}},getWidgetUiState:function(p,c){var y=c.searchParameters,R=m&&m.every(function(w){return y.isDisjunctiveFacetRefined(a,w)});if(!R){var b;return(b=p.toggle)===null||b===void 0||delete b[a],p}return L(N({},p),{toggle:L(N({},p.toggle),G({},a,R))})},getWidgetSearchParameters:function(p,c){var y=c.uiState;if(p.isHierarchicalFacet(a)||p.isConjunctiveFacet(a))return p;var R=p.addDisjunctiveFacet(a).removeDisjunctiveFacetRefinement(a),b=!!(y.toggle&&y.toggle[a]);return b?(m&&m.forEach(function(w){R=R.addDisjunctiveFacetRefinement(a,w)}),R):g?(v&&v.forEach(function(w){R=R.addDisjunctiveFacetRefinement(a,w)}),R):R.setQueryParameters({disjunctiveFacetsRefinements:L(N({},p.disjunctiveFacetsRefinements),G({},a,[]))})}}}},Uc=Fe({name:"breadcrumb",connector:!0}),Ym=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;je(r,Uc());var t={};return function(i){var a=i||{},o=a.attributes,l=a.separator,d=l===void 0?" > ":l,g=a.rootPath,m=g===void 0?null:g,v=a.transformItems,h=v===void 0?function(p){return p}:v;if(!o||!Array.isArray(o)||o.length===0)throw new Error(Uc("The `attributes` option expects an array of strings."));var u=we(o,1),s=u[0];function f(p,c){if(!c){var y=p.getHierarchicalFacetBreadcrumb(s);return y.length===0?p:p.resetPage().toggleFacetRefinement(s,y[0])}return p.resetPage().toggleFacetRefinement(s,c)}return{$$type:"ais.breadcrumb",init:function(c){r(L(N({},this.getWidgetRenderState(c)),{instantSearchInstance:c.instantSearchInstance}),!0)},render:function(c){r(L(N({},this.getWidgetRenderState(c)),{instantSearchInstance:c.instantSearchInstance}),!1)},dispose:function(){n()},getRenderState:function(c,y){return L(N({},c),{breadcrumb:L(N({},c.breadcrumb),G({},s,this.getWidgetRenderState(y)))})},getWidgetRenderState:function(c){var y=this,R=c.helper,b=c.createURL,w=c.results,C=c.state;function O(){if(!w||C.hierarchicalFacets.length===0)return[];var F=w.getFacetValues(s,{}),T=F&&!Array.isArray(F)&&F.data?F.data:[],A=h(Zm(jf(T)),{results:w});return A}var x=O();return t.createURL||(t.createURL=function(F){return b(function(T){return y.getWidgetUiState(T,{searchParameters:f(R.state,F),helper:R})})}),t.refine||(t.refine=function(F){R.setState(f(R.state,F)).search()}
41),{canRefine:x.length>0,createURL:t.createURL,items:x,refine:t.refine,widgetParams:i}},getWidgetUiState:function(c,y){var R=y.searchParameters,b=R.getHierarchicalFacetBreadcrumb(s);return ev(L(N({},c),{hierarchicalMenu:L(N({},c.hierarchicalMenu),G({},s,b))}),s)},getWidgetSearchParameters:function(c,y){var R=y.uiState,b=R.hierarchicalMenu&&R.hierarchicalMenu[s];if(c.isConjunctiveFacet(s)||c.isDisjunctiveFacet(s))return c;c.isHierarchicalFacet(s)&&c.getHierarchicalFacetByName(s);var w=c.removeHierarchicalFacet(s).addHierarchicalFacet({name:s,attributes:o,separator:d,rootPath:m});return b?w.addHierarchicalFacetRefinement(s,b.join(d)):w.setQueryParameters({hierarchicalFacetsRefinements:L(N({},w.hierarchicalFacetsRefinements),G({},s,[]))})}}}};function jf(e){return e.reduce(function(r,n){return n.isRefined&&(r.push({label:n.name,value:n.escapedValue}),Array.isArray(n.data)&&(r=r.concat(jf(n.data)))),r},[])}function Zm(e){return e.map(function(r,n){return{label:r.label,value:n+1===e.length?null:e[n+1].value}})}function ev(e,r){return e.hierarchicalMenu&&((!e.hierarchicalMenu[r]||!e.hierarchicalMenu[r].length)&&delete e.hierarchicalMenu[r],Object.keys(e.hierarchicalMenu).length===0&&delete e.hierarchicalMenu),e}var tv=Fe({name:"autocomplete",connector:!0}),rv=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,tv()),function(t){var i=t||{},a=i.escapeHTML,o=a===void 0?!0:a,l=i.transformItems,d=l===void 0?function(s){return s}:l,g=i.future,m=g===void 0?{}:g,v=m.undefinedEmptyQuery,h=v===void 0?!1:v,u={};return{$$type:"ais.autocomplete",init:function(f){var p=f.instantSearchInstance;r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:p}),!0)},render:function(f){var p=f.instantSearchInstance,c=this.getWidgetRenderState(f);c.indices.forEach(function(y){var R=y.sendEvent,b=y.hits;R("view:internal",b)}),r(L(N({},c),{instantSearchInstance:p}),!1)},getRenderState:function(f,p){return L(N({},f),{autocomplete:this.getWidgetRenderState(p)})},getWidgetRenderState:function(f){var p=this,c=f.helper,y=f.state,R=f.scopedResults,b=f.instantSearchInstance;u.refine||(u.refine=function(O){c.setQuery(O).search()});var w={},C=R.map(function(O){var x;O.results&&(O.results.hits=o?Ya(O.results.hits):O.results.hits),w[O.indexId]=ls({instantSearchInstance:b,helper:O.helper,widgetType:p.$$type});var F=O.results?es(Za(O.results.hits,O.results.page,O.results.hitsPerPage),O.results.queryID):[];return{indexId:O.indexId,indexName:((x=O.results)===null||x===void 0?void 0:x.index)||"",hits:F,results:O.results||{}}});return{currentRefinement:h?y.query:y.query||"",indices:d(C).map(function(O){return L(N({},O),{sendEvent:w[O.indexId]})}),refine:u.refine,widgetParams:t}},getWidgetUiState:function(f,p){var c=p.searchParameters,y=h?c.query:c.query||"";return!y||y===""||f&&f.query===y?f:L(N({},f),{query:y})},getWidgetSearchParameters:function(f,p){var c=p.uiState,y={query:h?c.query:c.query||""};return o?f.setQueryParameters(N({},y,ft)):f.setQueryParameters(y)},dispose:function(f){var p=f.state;n();var c=p.setQueryParameter("query",void 0);return o?c.setQueryParameters(Object.keys(ft).reduce(function(y,R){return L(N({},y),G({},R,void 0))},{})):c}}}},Lc=Fe({name:"query-rules",connector:!0});function nv(e){return[e.disjunctiveFacetsRefinements,e.facetsRefinements,e.hierarchicalFacetsRefinements,e.numericRefinements].some(function(r){return!!(r&&Object.keys(r).length>0)})}function iv(e){return e.replace(/[^a-z0-9-_]+/gi,"_")}function av(e){var r=e.helper,n=e.sharedHelperState,t=e.trackedFilters,i=Object.keys(t).reduce(function(a,o){var l=us(r.lastResults||{},n,!0).filter(function(m){return m.attribute===o}).map(function(m){return m.numericValue||m.name}),d=t[o],g=d(l);return Ae(a).concat(Ae(l.filter(function(m){return g.includes(m)}).map(function(m){return iv("ais-".concat(o,"-").concat(m))})))},[]);return i}function sv(e){var r=this,n=r.helper,t=r.initialRuleContexts,i=r.trackedFilters,a=r.transformRuleContexts,o=e.state,l=o.ruleContexts||[],d=av({helper:n,sharedHelperState:o,trackedFilters:i}),g=Ae(t).concat(Ae(d)),m=a(g).slice(0,10);fs(l,m)||n.overrideStateWithoutTriggeringChangeEvent(L(N({},o),{ruleContexts:m}))}var Nf=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,Lc()),function(t){var i=t||{},a=i.trackedFilters,o=a===void 0?{}:a,l=i.transformRuleContexts,d=l===void 0?function(s){return s}:l,g=i.transformItems,m=g===void 0?function(s){return s}:g;
41Object.keys(o).forEach(function(s){if(typeof o[s]!="function")throw new Error(Lc(`'The "`.concat(s,'" filter value in the `trackedFilters` option expects a function.')))});var v=Object.keys(o).length>0,h=[],u;return{$$type:"ais.queryRules",init:function(f){var p=f.helper,c=f.state,y=f.instantSearchInstance;h=c.ruleContexts||[],u=sv.bind({helper:p,initialRuleContexts:h,trackedFilters:o,transformRuleContexts:d}),v&&((nv(c)||t.transformRuleContexts)&&u({state:c}),p.on("change",u)),r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:y}),!0)},render:function(f){var p=f.instantSearchInstance;r(L(N({},this.getWidgetRenderState(f)),{instantSearchInstance:p}),!1)},getWidgetRenderState:function(f){var p=f.results,c=p||{},y=c.userData,R=y===void 0?[]:y,b=m(R,{results:p});return{items:b,widgetParams:t}},getRenderState:function(f,p){return L(N({},f),{queryRules:this.getWidgetRenderState(p)})},dispose:function(f){var p=f.helper,c=f.state;return n(),v?(p.removeListener("change",u),c.setQueryParameter("ruleContexts",h)):c}}}},ov=function(r){var n=r.searchAsYouSpeak,t=r.language,i=r.onQueryChange,a=r.onStateChange,o=window.webkitSpeechRecognition||window.SpeechRecognition,l=function(O){return{status:O,transcript:"",isSpeechFinal:!1,errorCode:void 0}},d=l("initial"),g,m=function(){return!!o},v=function(){return d.status==="askingPermission"||d.status==="waiting"||d.status==="recognizing"},h=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};d=N({},d,O),a()},u=function(){return d},s=function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"initial";h(l(O))},f=function(){h({status:"waiting"})},p=function(O){h({status:"error",errorCode:O.error})},c=function(O){h({status:"recognizing",transcript:O.results[0]&&O.results[0][0]&&O.results[0][0].transcript||"",isSpeechFinal:O.results[0]&&O.results[0].isFinal}),n&&d.transcript&&i(d.transcript)},y=function(){!d.errorCode&&d.transcript&&!n&&i(d.transcript),d.status!=="error"&&h({status:"finished"})},R=function(){g=new o,g&&(s("askingPermission"),g.interimResults=!0,t&&(g.lang=t),g.addEventListener("start",f),g.addEventListener("error",p),g.addEventListener("result",c),g.addEventListener("end",y),g.start())},b=function(){g&&(g.stop(),g.removeEventListener("start",f),g.removeEventListener("error",p),g.removeEventListener("result",c),g.removeEventListener("end",y),g=void 0)},w=function(){b(),s("finished")};return{getState:u,isBrowserSupported:m,isListening:v,startListening:R,stopListening:w,dispose:b}},uv=Fe({name:"voice-search",connector:!0}),cv=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,uv()),function(t){var i=t.searchAsYouSpeak,a=i===void 0?!1:i,o=t.language,l=t.additionalQueryParameters,d=t.createVoiceSearchHelper,g=d===void 0?ov:d;return{$$type:"ais.voiceSearch",init:function(v){var h=v.instantSearchInstance;r(L(N({},this.getWidgetRenderState(v)),{instantSearchInstance:h}),!0)},render:function(v){var h=v.instantSearchInstance;r(L(N({},this.getWidgetRenderState(v)),{instantSearchInstance:h}),!1)},getRenderState:function(v,h){return L(N({},v),{voiceSearch:this.getWidgetRenderState(h)})},getWidgetRenderState:function(v){var h=this,u=v.helper,s=v.instantSearchInstance;this._refine||(this._refine=function(w){if(w!==u.state.query){var C=o?[o.split("-")[0]]:void 0;u.setQueryParameter("queryLanguages",C),typeof l=="function"&&u.setState(u.state.setQueryParameters(N({ignorePlurals:!0,removeStopWords:!0,optionalWords:w},l({query:w})))),u.setQuery(w).search()}}),this._voiceSearchHelper||(this._voiceSearchHelper=g({searchAsYouSpeak:a,language:o,onQueryChange:function(C){return h._refine(C)},onStateChange:function(){r(L(N({},h.getWidgetRenderState(v)),{instantSearchInstance:s}),!1)}}));var f=this._voiceSearchHelper,p=f.isBrowserSupported,c=f.isListening,y=f.startListening,R=f.stopListening,b=f.getState;return{isBrowserSupported:p(),isListening:c(),toggleListening:function(){p()&&(c()?R():y())},voiceListeningState:b(),widgetParams:t}},dispose:function(v){var h=v.state;this._voiceSearchHelper.dispose(),n();var u=h;if(typeof l=="function"){var s=l({query:""}),f=s?Object.keys(s).reduce(function(p,c){return p[c]=void 0,p},{}):{};u=h.setQueryParameters(N({queryLanguages:void 0,ignorePlurals:void 0,removeStopWords:void 0,optionalWords:void 0},f))}return u.setQueryParameter("query",void 0)},getWidgetUiState:function(v,h){var u=h.searchParameters,s=u.query||"";return s?L(N({},v),{query:s}):v},getWidgetSearchParameters:function(v,h){var u=h.uiState;return v.setQueryParameter("query",u.query||"")}}}},lv=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ce,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return function(t){var i={};return{$$type:"ais.relevantSort",init:function(o){var l=o.instantSearchInstance;r(L(N({},this.getWidgetRenderState(o)),{instantSearchInstance:l}),!0)},render:function(o){var l=o.instantSearchInstance;r(L(N({},this.getWidgetRenderState(o)),{instantSearchInstance:l}),!1)},dispose:function(o){var l=o.state;return n(),l.setQueryParameter("relevancyStrictness",void 0)},getRenderState:function(o,l){return L(N({},o),{relevantSort:this.getWidgetRenderState(l)})},getWidgetRenderState:function(o){var l=o.results,d=o.helper;i.refine||(i.refine=function(v){d.setQueryParameter("relevancyStrictness",v).search()});var g=(l||{}).appliedRelevancyStrictness,m=g!==void 0;return{isRelevantSorted:typeof g<"u"&&g>0,isVirtualReplica:m,canRefine:m,refine:i.refine,widgetParams:t}},getWidgetSearchParameters:function(o,l){var d=l.uiState,g;return o.setQueryParameter("relevancyStrictness",(g=d.relevantSort)!==null&&g!==void 0?g:o.relevancyStrictness)},getWidgetUiState:function(o,l){var d=l.searchParameters;return L(N({},o),{relevantSort:d.relevancyStrictness||o.relevantSort})}}}};
41function Kn(e){return Kn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Kn(e)}function Hf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hf=function(){return!!e})()}function fv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dv(e,r){return r&&(Ft(r)==="object"||typeof r=="function")?r:fv(e)}function hv(e,r,n){return r=Kn(r),dv(e,Hf()?Reflect.construct(r,[],Kn(e).constructor):r.apply(e,n))}function za(e,r){return za=Object.setPrototypeOf||function(t,i){return t.__proto__=i,t},za(e,r)}function pv(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&za(e,r)}function xt(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function qf(e,r){return Object.assign(new _e.SearchResults(e,[r]),{feedID:r.feedID})}function gv(e,r){var n,t,i=(n=e._initialResults)===null||n===void 0?void 0:n[r.getIndexId()],a=(i==null?void 0:i.compositionFeedsResults)||[];if(a.length!==0){var o=(t=r.getHelper())===null||t===void 0?void 0:t.lastResults;o&&(o.feeds&&o.feeds.length>0||(o.feeds=a.map(function(l){return qf(o._state,l)})))}}var lr=Fe({name:"feeds",connector:!0}),mv=function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce;return je(r,lr()),function(t){var i=t.isolated,a=t.transformFeeds,o=a===void 0?function(l){return l}:a;if(i!==!1)throw new Error(lr("The `isolated` option currently only supports `false`."));return{$$type:"ais.feeds",$$widgetType:"ais.feeds",init:function(d){var g=d.instantSearchInstance;if(!g.compositionID)throw new Error(lr("The `feeds` widget requires a composition-based InstantSearch instance (compositionID must be set)."));gv(g,d.parent),r(L(N({},this.getWidgetRenderState(d)),{instantSearchInstance:g}),!0)},render:function(d){var g=d.instantSearchInstance;r(L(N({},this.getWidgetRenderState(d)),{instantSearchInstance:g}),!1)},dispose:function(){n()},getWidgetSearchParameters:function(d){return d},getRenderState:function(d,g){return L(N({},d),{feeds:this.getWidgetRenderState(g)})},getWidgetRenderState:function(d){var g=d.results;if(!g)return{feedIDs:[],widgetParams:t};Array.isArray(g.feeds)&&g.feeds.length>0&&!g.feeds.every(function(v){return xt(v,_e.SearchResults)})&&(g.feeds=g.feeds.map(function(v){return xt(v,_e.SearchResults)?v:qf(g._state,v)}));var m=g.feeds?g.feeds.map(function(v){return v.feedID}):[""];if(m=o(m),!Array.isArray(m))throw new Error(lr("The `transformFeeds` option expects a function that returns an Array."));if(!m.every(function(v){return typeof v=="string"}))throw new Error(lr("The `transformFeeds` option expects a function that returns an array of feed IDs (strings)."));return{feedIDs:m,widgetParams:t}}}}},vv=function(r,n){return r},yv=vv(Kg),_v=!1,Rv=!0;function Ot(e){function r(n,t){for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];var l=a.length>0?a:void 0;if((t===void 0?"undefined":cf(t))==="object"&&(t.attrs||t.props||t.scopedSlots||t.on)){var d=Object.keys(t.on||{}),g=Object.assign({},t,t.attrs,t.props,d.reduce(function(m,v){return m["on".concat(v[0].toUpperCase()).concat(v.slice(1))]=t.on[v],m},{}));return delete g.attrs,delete g.props,delete g.scopedSlots,d.forEach(function(m){return delete g.on[m]}),g.on&&Object.keys(g.on).length===0&&delete g.on,to(n,g,t.scopedSlots?Object.assign({default:function(){return l}},t.scopedSlots):l)}return to(n,t,l)}return function(){return e.call(this,r)}}function Zn(e){var r=e.$slots||e.slots;return typeof r.default=="function"?r.default():r.default}function Rr(e,r){return(e.$slots||e.slots||{})[r]}var $c={inheritAttrs:!1,name:"AisConfigure",mixins:[me({name:"Configure"}),Pe({connector:bf},{$$widgetType:"ais.configure"})],computed:{widgetParams:function(){return{searchParameters:Object.assign({},this.$attrs)}}},render:Ot(function(e){var r=this.$slots.default;return this.state&&r?e("div",{class:this.suit()},[r({refine:this.state.refine,searchParameters:this.state.widgetParams.searchParameters})]):null})};Pe({connector:yv},{$$widgetType:"ais.configureRelatedItems"});function Sv(e,r){if(e==null)return{};var n={},t=Object.getOwnPropertyNames(e),i,a;for(a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function bv(e,r){if(e==null)return{};var n={},t,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(t=Reflect.ownKeys(e),a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}if(n=Sv(e,r),Object.getOwnPropertySymbols)for(t=Object.getOwnPropertySymbols(e),a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function wv(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Pv(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{},t=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(t=t.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),t.forEach(function(i){wv(e,i,n[i])})}return e}function Ev(e,r){if(e==null)return{};var n={},t=Object.getOwnPropertyNames(e),i,a;for(a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function xv(e,r){if(e==null)return{};var n={},t,i,a;if(typeof Reflect<"u"&&Reflect.ownKeys){for(t=Reflect.ownKeys(e),a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}if(n=Ev(e,r),Object.getOwnPropertySymbols)for(t=Object.getOwnPropertySymbols(e),a=0;a<t.length;a++)i=t[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function vt(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.reduce(function(t,i){return Array.isArray(i)?t.concat(i):t.concat([i])}
41,[]).filter(Boolean).join(" ")}function Cv(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n}function Fv(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}),e}function Ov(e){var r=e.createElement;return function(t){var i=t.classNames,a=t.banner;return a.image.urls[0].url?r("aside",{className:vt("ais-Hits-banner",i.bannerRoot)},a.link?r("a",{className:vt("ais-Hits-banner-link",i.bannerLink),href:a.link.url,target:a.link.target},r("img",{className:vt("ais-Hits-banner-image",i.bannerImage),src:a.image.urls[0].url,alt:a.image.title})):r("img",{className:vt("ais-Hits-banner-image",i.bannerImage),src:a.image.urls[0].url,alt:a.image.title})):null}}function Av(e){var r=e.createElement,n=Ov({createElement:r});return function(i){var a=i.classNames,o=a===void 0?{}:a,l=i.hits,d=i.itemComponent,g=i.sendEvent,m=i.emptyComponent,v=i.banner,h=i.bannerComponent,u=xv(i,["classNames","hits","itemComponent","sendEvent","emptyComponent","banner","bannerComponent"]);return r("div",Fv(Pv({},u),{className:vt("ais-Hits",o.root,l.length===0&&vt("ais-Hits--empty",o.emptyRoot),u.className)}),v&&(h?r(h,{className:vt("ais-Hits-banner",o.bannerRoot),banner:v}):r(n,{classNames:o,banner:v})),l.length===0&&m?r(m,null):r("ol",{className:vt("ais-Hits-list",o.list)},l.map(function(s,f){return r(d,{key:s.objectID,hit:s,index:f,className:vt("ais-Hits-item",o.item),onClick:function(){g("click:internal",s,"Hit Clicked")},onAuxClick:function(){g("click:internal",s,"Hit Clicked")}})})))}}var Wc={name:"AisHits",mixins:[Pe({connector:_m},{$$widgetType:"ais.hits"}),me({name:"Hits"})],props:{showBanner:{type:Boolean,default:!0},escapeHTML:{type:Boolean,default:!0},transformItems:{type:Function,default:void 0}},computed:{widgetParams:function(){return{showBanner:this.showBanner,escapeHTML:this.escapeHTML,transformItems:this.transformItems}}},render:Ot(function(e){var r=this;if(!this.state)return null;var n=Rr(this,"default"),t=Rr(this,"item"),i=Rr(this,"banner");return t||i||!n?e(Av({createElement:e}),{hits:this.state.items,itemComponent:function(a){var o=a.hit,l=a.index,d=a.onClick,g=a.onAuxClick;a.key;var m=bv(a,["hit","index","onClick","onAuxClick","key"]);return e("li",{key:o.objectID,attrs:m,on:{click:d,auxclick:g}},[t&&t({item:o,index:l,insights:r.state.insights,sendEvent:r.state.sendEvent})||"objectID: ".concat(o.objectID,", index: ").concat(l)])},banner:this.showBanner?this.state.banner:void 0,bannerComponent:i,sendEvent:this.state.sendEvent,classNames:this.classNames&&{root:this.classNames["ais-Hits"],list:this.classNames["ais-Hits-list"],item:this.classNames["ais-Hits-item"],bannerRoot:this.classNames["ais-Hits-banner"],bannerImage:this.classNames["ais-Hits-banner-image"],bannerLink:this.classNames["ais-Hits-banner-link"]}}):e("div",{attrs:{class:this.suit()}},[n({banner:this.state.banner,items:this.state.items,insights:this.state.insights,sendEvent:this.state.sendEvent})])})},Iv=0;function Tv(e){e.dependsOn==="recommend"&&(e.$$id=Iv++)}var jv=Promise.resolve();function Nv(e){var r=null,n=!1,t=function(){for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];r===null&&(r=jv.then(function(){if(r=null,n){n=!1;return}e.apply(void 0,Ae(o))}))};return t.wait=function(){if(r===null)throw new Error("The deferred function should be called before calling `wait()`");return r},t.cancel=function(){r!==null&&(n=!0)},t}function kc(e){for(var r=e.getParent(),n=[e.getHelper().state];r!==null;)n=[r.getHelper().state].concat(n),r=r.getParent();return n}function Et(e,r,n){var t=r.getHelper();return{uiState:n,helper:t,parent:r,instantSearchInstance:e,state:t.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:r.createURL,scopedResults:[],searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Jn(e,r,n){var t=r.getResultsForWidget(n),i=r.getHelper();return{helper:i,parent:r,instantSearchInstance:e,results:t,scopedResults:r.getScopedResults(),state:t&&"_state"in t?t._state:i.state,render
41State:e.renderState,templatesConfig:e.templatesConfig,createURL:r.createURL,searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Bt(e){var r=e.renderState,n=e.instantSearchInstance,t=e.parent,i=t?t.getIndexId():n.mainIndex.getIndexId();n.renderState=L(N({},n.renderState),G({},i,N({},n.renderState[i],r)))}var fr=Fe({name:"index-widget"});function Df(e,r){var n=r.state,t=r.recommendState,i=r.isPageReset,a=r._uiState;n!==e.state&&(e.state=n,e.emit("change",{state:e.state,results:e.lastResults,isPageReset:i,_uiState:a})),t!==e.recommendState&&(e.recommendState=t)}function dr(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.reduce(function(t,i){return lt(i)||!i.getWidgetUiState&&!i.getWidgetState?t:i.getWidgetUiState?i.getWidgetUiState(t,r):i.getWidgetState(t,r)},n)}function hr(e,r){var n=r.initialSearchParameters,t=ze(r,["initialSearchParameters"]);return e.reduce(function(i,a){return!a.getWidgetSearchParameters||lt(a)?i:a.dependsOn==="search"&&a.getWidgetParameters?a.getWidgetParameters(i,t):a.getWidgetSearchParameters(i,t)},n)}function Bc(e,r){var n=r.initialRecommendParameters,t=ze(r,["initialRecommendParameters"]);return e.reduce(function(i,a){return!lt(a)&&a.dependsOn==="recommend"&&a.getWidgetParameters?a.getWidgetParameters(i,t):i},n)}function Mf(e){var r=e.filter(lt);r.length!==0&&r.forEach(function(n){var t=n.getHelper();Df(t,{state:t.state.resetPage(),recommendState:t.recommendState,isPageReset:!0}),Mf(n.getWidgets())})}function Uf(e){var r=e.filter(lt);return r.reduce(function(n,t){var i;return(i=n).concat.apply(i,[{indexId:t.getIndexId(),results:t.getResults(),helper:t.getHelper()}].concat(Ae(Uf(t.getWidgets()))))},[])}var Hv=function(r){if(r===void 0||r.indexName===void 0&&!r.EXPERIMENTAL_isolated)throw new Error(fr("The `indexName` option is required."));var n=r.indexName,t=n===void 0?"":n,i=r.indexId,a=i===void 0?t:i,o=r.EXPERIMENTAL_isolated,l=o===void 0?!1:o,d=[],g={},m=null,v=null,h=null,u=null,s=null,f=!1,p=!1;return{$$type:"ais.index",$$widgetType:"ais.index",_isolated:l,getIndexName:function(){return t},getIndexId:function(){return a},getHelper:function(){return h},getResults:function(){return u!=null&&u.lastResults?(u.lastResults._state=h.state,u.lastResults):null},getResultsForWidget:function(y){return y.dependsOn!=="recommend"||lt(y)||y.$$id===void 0?this.getResults():h!=null&&h.lastRecommendResults?h.lastRecommendResults[y.$$id]:null},getPreviousState:function(){return s},getScopedResults:function(){var y=this.getParent(),R;return y?R=y.getWidgets():t.length===0?R=this.getWidgets():R=[this],Uf(R)},getParent:function(){return l?null:v},createURL:function(y){return typeof y=="function"?m._createURL(G({},a,y(g))):m._createURL(G({},a,dr(d,{searchParameters:y,helper:h})))},scheduleLocalSearch:Nv(function(){l&&(h==null||h.search())}),getWidgets:function(){return d},addWidgets:function(y){var R=this;if(!Array.isArray(y))throw new Error(fr("The `addWidgets` method expects an array of widgets."));var b=y.reduce(function(w,C){return w.concat(Array.isArray(C)?C:[C])},[]);if(b.some(function(w){return typeof w.init!="function"&&typeof w.render!="function"}))throw new Error(fr("The widget definition expects a `render` and/or an `init` method."));return b.forEach(function(w){w.parent=R,!lt(w)&&(m&&w.dependsOn==="recommend"?m._hasRecommendWidget=!0:m?m._hasSearchWidget=!0:w.dependsOn==="recommend"?f=!0:p=!0,Tv(w))}),d=d.concat(b),m&&b.length&&(Df(h,{state:hr(d,{uiState:g,initialSearchParameters:h.state}),recommendState:Bc(d,{uiState:g,initialRecommendParameters:h.recommendState}),_uiState:g}),b.forEach(function(w){if(w.getRenderState){var C=w.getRenderState(m.renderState[R.getIndexId()]||{},Et(m,R,m._initialUiState));Bt({renderState:C,instantSearchInstance:m,parent:R})}}),b.forEach(function(w){w.init&&w.init(Et(m,R,m._initialUiState))}),l?this.scheduleLocalSearch():m.scheduleSearch()),this},removeWidgets:function(y){var R=this;if(!Array.isArray(y))throw new Error(fr("The `removeWidgets` method expects an array of widgets."));var b=y.reduce(function(F,T){return F.concat(Array.isArray(T)?T:[T])},[]);if(b.some(function(F){return typeof F.dispose!="function"}))throw new Error(fr("The widget definition expects a `dispose` method."));if(d=d.filter(function(F){return b.indexOf(F)===-1}),d.forEach(function(F){F.parent=void 0,!lt(F)&&(m&&F.dependsOn==="recommend"?m._hasRecommendWidget=!0:m?m._hasSearchWidget=!0:F.dependsOn==="recommend"?f=!0:p=!0)}),m&&b.length){var w=b.reduce(function(F,T){var A=T.dispose({helper:h,state:F.cleanedSearchState,recommendState:F.cleanedRecommendState,parent:R});return xt(A,_e.RecommendParameters)?F.cleanedRecommendState=A:A&&(F.cleanedSearchState=A),F},{cleanedSearchState:h.state,cleanedRecommendState:h.recommendState}),C=w.cleanedSearchState,O=w.cleanedRecommendState,x=m.future.preserveSharedStateOnUnmount?hr(d,{uiState:g,initialSearchParameters:new _e.SearchParameters({index:this.getIndexName()})}):hr(d,{uiState:dr(d,{searchParameters:C,helper:h}),initialSearchParameters:C});g=dr(d,{searchParameters:x,helper:h}),h.setState(x),h.recommendState=O,d.length&&(l?this.scheduleLocalSearch():m.scheduleSearch())}return this},init:function(y){var R=this,b=y.instantSearchInstance,w=y.parent,C=y.uiState,O;if(h===null){m=b,v=w,g=C[a]||{};var x=b.mainHelper,F=hr(d,{uiState:g,initialSearchParameters:new _e.SearchParameters({index:t})}),T=Bc(d,{uiState:g,initialRecommendParameters:new _e.RecommendParameters});h=_e(x.getClient(),F.index,F),h.recommendState=T,h.search=function(){return l?(b.status="loading",R.render({instantSearchInstance:b}),b.compositionID?h.searchWithComposition():h.searchOnlyWithDerivedHelpers()):b.onStateChange?(b.onStateChange({uiState:b.mainIndex.getWidgetUiState({}),setUiState:function(M){return b.setUiState(M,!1)}}),x):x.search()},h.searchWithoutTriggeringOnStateChange=function(){return x.search()},h.searchForFacetValues=function(k,M,$,B){var V=kt.apply(void 0,[x.state].concat(Ae(kc(R)))).setQueryParameters(B);return x.searchForFacetValues(k,M,$,V)};var A=t?h:_e({},"__empty_index__",{}),D=l?A:qv(w,x);u=D.derive(function(){return kt.apply(void 0,[x.state].concat(Ae(kc(R))))},function(){return R.getHelper().recommendState});var W=(O=b._initialResults)===null||O===void 0?void 0:O[this.getIndexId()];if(W!=null&&W.results){var Q=new _e.SearchResults(new _e.SearchParameters(W.state),W.results);u.lastResults=Q,h.lastResults=Q}if(W!=null&&W.recommendResults){var J=new _e.RecommendResults(new _e.RecommendParameters({params:W.recommendResults.params}),W.recommendResults.results);u.lastRecommendResults=J,h.lastRecommendResults=J}h.on("change",function(k){var M=k.isPageReset;M&&Mf(d)}),u.on("search",function(){b.scheduleStalledRender()}),u.on("result",function(k){var M=k.results;b.scheduleRender(),h.lastResults=M,s=M==null?void 0:M._state}),u.on("recommend:result",function(k){var M=k.recommend;b.scheduleRender(),h.lastRecommendResults=M.results}),d.forEach(function(k){if(k.getRenderState){var M=k.getRenderState(b.render
41State[R.getIndexId()]||{},Et(b,R,C));Bt({renderState:M,instantSearchInstance:b,parent:R})}}),d.forEach(function(k){k.init&&k.init(Et(b,R,C))}),h.on("change",function(k){var M=k.state,$=k._uiState;g=dr(d,{searchParameters:M,helper:h},$||{}),b.onStateChange||b.onInternalStateChange()}),W&&b.scheduleRender(),f&&(b._hasRecommendWidget=!0),p&&(b._hasSearchWidget=!0)}},render:function(y){var R=this,b=y.instantSearchInstance;b.status==="error"&&!b.mainHelper.hasPendingRequests()&&s&&h.setState(s);var w=this.getResults()||u!=null&&u.lastRecommendResults||l&&!t?d:d.filter(function(C){return C.shouldRender});w=w.filter(function(C){return C.shouldRender?C.shouldRender({instantSearchInstance:b}):!0}),w.forEach(function(C){if(C.getRenderState){var O=C.getRenderState(b.renderState[R.getIndexId()]||{},Jn(b,R,C));Bt({renderState:O,instantSearchInstance:b,parent:R})}}),w.forEach(function(C){C.render&&C.render(Jn(b,R,C))})},dispose:function(){var y=this;d.forEach(function(R){R.dispose&&h&&R.dispose({helper:h,state:h.state,recommendState:h.recommendState,parent:y})}),m=null,v=null,h==null||h.removeAllListeners(),h=null,u==null||u.detach(),u=null},getWidgetUiState:function(y){return d.filter(lt).filter(function(R){return!R._isolated}).reduce(function(R,b){return b.getWidgetUiState(R)},L(N({},y),G({},a,N({},y[a],g))))},getWidgetState:function(y){return this.getWidgetUiState(y)},getWidgetSearchParameters:function(y,R){var b=R.uiState;return hr(d,{uiState:b,initialSearchParameters:y})},shouldRender:function(){return!0},refreshUiState:function(){g=dr(d,{searchParameters:this.getHelper().state,helper:this.getHelper()},g)},setIndexUiState:function(y){var R=typeof y=="function"?y(g):y;m.setUiState(function(b){return L(N({},b),G({},a,R))})}}};function qv(e,r){for(;e;){if(e._isolated)return e.getHelper();e=e.getParent()}return r}var Dv={name:"AisIndex",mixins:[me({name:"Index"}),Pe({connector:function(){return Hv}},{$$widgetType:"ais.index"})],provide:function(){var e=this;return{$_ais_getParentIndex:function(){return e.widget}}},props:{indexName:{type:String,required:!0},indexId:{type:String,required:!1}},render:Ot(function(e){return e("div",{},Zn(this))}),computed:{widgetParams:function(){return{indexName:this.indexName,indexId:this.indexId}}}},Mv="ais",ei=function(r){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=n.descendantName,i=n.modifierName,a=t?"-".concat(t):"",o=i?"--".concat(i):"";return"".concat(Mv,"-").concat(r).concat(a).concat(o)}},rt={highlightPreTag:"<mark>",highlightPostTag:"</mark>"},Uv=Promise.resolve();function $t(e){var r=null,n=!1,t=function(){for(var a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];r===null&&(r=Uv.then(function(){if(r=null,n){n=!1;return}e.apply(void 0,Ae(o))}))};return t.wait=function(){if(r===null)throw new Error("The deferred function should be called before calling `wait()`");return r},t.cancel=function(){r!==null&&(n=!0)},t}function ti(e,r){var n=Array.isArray(r)?r:r.split(".");return n.reduce(function(t,i){return t&&t[i]},e)}var Lv=ei("Highlight");function Lf(e){var r=e.attribute,n=e.highlightedTagName,t=n===void 0?"mark":n,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,l=ti(i._highlightResult,r),d=l||{},g=d.value,m=g===void 0?"":g,v=Lv({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return m.replace(new RegExp(rt.highlightPreTag,"g"),"<".concat(t,' class="').concat(v,'">')).replace(new RegExp(rt.highlightPostTag,"g"),"</".concat(t,">"))}function $f(e){var r=rt.highlightPreTag,n=rt.highlightPostTag;return e.map(function(t){return t.isHighlighted?r+t.value+n:t.value}).join("")}function Wf(e){var r=rt.highlightPostTag,n=rt.highlightPreTag,t=e.split(n),i=t.shift(),a=i?[{value:i,isHighlighted:!1}]:[];return t.forEach(function(o){var l=o.split(r);a.push({value:l[0],isHighlighted:!0}),l[1]!==""&&a.push({value:l[1],isHighlighted:!1})}),a}var $v={"&":"&","<":"<",">":">",""":'"',"'":"'"},kf=/&(amp|quot|lt|gt|#39);/g,Wv=RegExp(kf.source);function kv(e){return e&&Wv.test(e)?e.replace(kf,function(r){return $v[r]}):e}var Bv=new RegExp(/\w/i);function Qv(e,r){var n,t,i=e[r],a=((n=e[r+1])===null||n===void 0?void 0:n.isHighlighted)||!0,o=((t=e[r-1])===null||t===void 0?void 0:t.isHighlighted)||!0;return!Bv.test(kv(i.value))&&o===a?o:i.isHighlighted}function Bf(e){return e.some(function(r){return r.isHighlighted})?e.map(function(r,n){return L(N({},r),{isHighlighted:!Qv(e,n)})}):e.map(function(r){return L(N({},r),{isHighlighted:!1})})}var Vv=ei("ReverseHighlight");function Qf(e){var r=e.attribute,n=e.highlightedTagName,t=n===void 0?"mark":n,i=e.hit,a=e.cssClasse
41s,o=a===void 0?{}:a,l=ti(i._highlightResult,r),d=l||{},g=d.value,m=g===void 0?"":g,v=Vv({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):""),h=$f(Bf(Wf(m)));return h.replace(new RegExp(rt.highlightPreTag,"g"),"<".concat(t,' class="').concat(v,'">')).replace(new RegExp(rt.highlightPostTag,"g"),"</".concat(t,">"))}var zv=ei("Snippet");function Vf(e){var r=e.attribute,n=e.highlightedTagName,t=n===void 0?"mark":n,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,l=ti(i._snippetResult,r),d=l||{},g=d.value,m=g===void 0?"":g,v=zv({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):"");return m.replace(new RegExp(rt.highlightPreTag,"g"),"<".concat(t,' class="').concat(v,'">')).replace(new RegExp(rt.highlightPostTag,"g"),"</".concat(t,">"))}var Kv=ei("ReverseSnippet");function zf(e){var r=e.attribute,n=e.highlightedTagName,t=n===void 0?"mark":n,i=e.hit,a=e.cssClasses,o=a===void 0?{}:a,l=ti(i._snippetResult,r),d=l||{},g=d.value,m=g===void 0?"":g,v=Kv({descendantName:"highlighted"})+(o.highlighted?" ".concat(o.highlighted):""),h=$f(Bf(Wf(m)));return h.replace(new RegExp(rt.highlightPreTag,"g"),"<".concat(t,' class="').concat(v,'">')).replace(new RegExp(rt.highlightPostTag,"g"),"</".concat(t,">"))}function Jv(e){return btoa(encodeURIComponent(JSON.stringify(e)))}function Gv(e){var r=e.method,n=e.payload;if((typeof n>"u"?"undefined":Ft(n))!=="object")throw new Error("The insights helper expects the payload to be an object.");var t;try{t=Jv(n)}catch{throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(r,'" data-insights-payload="').concat(t,'"')}function Kf(e,r){return Gv({method:e,payload:r})}var Xv="_ALGOLIA";function Yv(e){if(!((typeof document>"u"?"undefined":Ft(document))!=="object"||typeof document.cookie!="string"))for(var r="".concat(e,"="),n=document.cookie.split(";"),t=0;t<n.length;t++){for(var i=n[t];i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(r)===0)return i.substring(r.length,i.length)}}function Jf(){return Yv(Xv)}function Zv(){return Jf()}function Qc(e){return e!==Object(e)}function gs(e,r){if(e===r)return!0;if(Qc(e)||Qc(r)||typeof e=="function"||typeof r=="function")return e===r;if(Object.keys(e).length!==Object.keys(r).length)return!1;var n=!0,t=!1,i=void 0;try{for(var a=Object.keys(e)[Symbol.iterator](),o;!(n=(o=a.next()).done);n=!0){var l=o.value;if(!(l in r)||!gs(e[l],r[l]))return!1}}catch(d){t=!0,i=d}finally{try{!n&&a.return!=null&&a.return()}finally{if(t)throw i}}return!0}function ct(e){var r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{fallback:function(){}}).fallback;return typeof window>"u"?r():e({window})}function Vc(e){var r=e||{};r.page;var n=ze(r,["page"]);return n}function ey(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}
41).key,r=["ais.infiniteHits",e].filter(Boolean).join(":");return{read:function(t){var i=t.state,a=ct(function(l){var d=l.window;return d.sessionStorage});if(!a)return null;try{var o=JSON.parse(a.getItem(r));return o&&gs(o.state,Vc(i))?o.hits:null}catch(l){if(xt(l,SyntaxError))try{a.removeItem(r)}catch{}return null}},write:function(t){var i=t.state,a=t.hits,o=ct(function(l){var d=l.window;return d.sessionStorage});if(o)try{o.setItem(r,JSON.stringify({state:Vc(i),hits:a}))}catch{}}}}var ty=ts();const ry=Ga(ty);function mt(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n]}function zc(e,r){for(var n,t=0;t<e.length;t++)if(n=e[t],r(n,t,e))return n}function Kc(e){if(e.appId&&e.apiKey)return[e.appId,e.apiKey];if(e.transporter){var r=e.transporter,n=r.headers||r.baseHeaders,t=r.queryParameters||r.baseQueryParameters,i="x-algolia-application-id",a="x-algolia-api-key",o=n[i]||t[i],l=n[a]||t[a];return[o,l]}else return[e.applicationID,e.apiKey]}function ny(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var r=Math.random()*16|0,n=e==="x"?r:r&3|8;return n.toString(16)})}var Gf="2.17.2",iy="https://cdn.jsdelivr.net/npm/search-insights@".concat(Gf,"/dist/search-insights.min.js");function Jc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.insightsClient,n=e.insightsInitParams,t=e.onEvent,i=e.$$internal,a=i===void 0?!1:i,o=e.$$automatic,l=o===void 0?!1:o,d=r;!r&&r!==null&&ct(function(m){var v=m.window,h=v.AlgoliaAnalyticsObject||"aa";typeof h=="string"&&(d=v[h]),d||(v.AlgoliaAnalyticsObject=h,v[h]||(v[h]=function(){for(var u=arguments.length,s=new Array(u),f=0;f<u;f++)s[f]=arguments[f];v[h].queue||(v[h].queue=[]),v[h].queue.push(s)},v[h].version=Gf,v[h].shouldAddScript=!0),d=v[h])});var g=d||mt;return function(m){var v=m.instantSearchInstance,h,u=v.middleware.filter(function(x){return x.instance.$$type==="ais.insights"&&x.instance.$$internal}).map(function(x){return x.creator});(h=v).unuse.apply(h,Ae(u));var s=we(Kc(v.client),2),f=s[0],p=s[1],c=void 0,y=void 0,R=void 0,b=g.queue;if(Array.isArray(b)){var w;w=we(["setUserToken","init"].map(function(x){var F=we(zc(b.slice().reverse(),function(A){var D=we(A,1),W=D[0];return W===x})||[],2),T=F[1];return T}),2),y=w[0],c=w[1]}g("getUserToken",null,function(x,F){R=Xc(F)}),(n||!Gc(g))&&g("init",N({appId:f,apiKey:p,partial:!0},n));var C,O;return{$$type:"ais.insights",$$internal:a,$$automatic:l,onStateChange:function(){},subscribe:function(){if(g.shouldAddScript){var F="[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init";try{var T=document.createElement("script");T.async=!0,T.src=iy,T.onerror=function(){v.emit("error",new Error(F))},document.body.appendChild(T),g.shouldAddScript=!1}catch{g.shouldAddScript=!1,v.emit("error",new Error(F))}}},started:function(){g("addAlgoliaAgent","insights-middleware"),O=v.mainHelper;var F=g.queue;if(Array.isArray(F)){var T;T=we(["setUserToken","init"].map(function(z){var ne=we(zc(F.slice().reverse(),function(ue){var Z=we(ue,1),se=Z[0];return se===z})||[],2),ie=ne[1];return ie}),2),y=T[0],c=T[1]}C=ay(v),l||O.overrideStateWithoutTriggeringChangeEvent(L(N({},O.state),{clickAnalytics:!0})),a||v.scheduleSearch();var A=function(ne){var ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ue=Xc(ne);if(!ue)return;var Z=O.state.userToken;function se(){O.overrideStateWithoutTriggeringChangeEvent(L(N({},O.state),{userToken:ue})),Z&&Z!==ne&&v.scheduleSearch()}ie?se():setTimeout(se,0)};function D(z){A(z,!0),g("setUserToken",z)}var W=void 0,Q=Jf();if(Q)W=Q;else{var J="anonymous-".concat(ny());W=J}var k,M=C.userToken;n!=null&&n.userToken&&(k=n.userToken),k?D(k):M?D(M):R?D(R):y?D(y):W&&(D(W),(n!=null&&n.useCookie||c!=null&&c.useCookie)&&sy(W,(n==null?void 0:n.cookieDuration)||(c==null?void 0:c.cookieDuration))),g("onUserTokenChange",function(z){return A(z,!0)},{immediate:!0});var $=g;Gc(g)&&($=function(ne,ie){var ue=we(Kc(v.client),2),Z=ue[0],se=ue[1],ve={headers:{"X-Algolia-Application-Id":Z,"X-Algolia-API-Key":se}};return g(ne,ie,ve)});var B=new Set,V;v.mainHelper.derivedHelpers[0].on("result",function(z){var ne=z.results;ne&&(!ne.queryID||ne.queryID!==V)&&(V=ne.queryID,B.clear())}),v.sendEventToInsights=function(z){if(t)t(z,$);else if(z.insightsMethod){if(z.insightsMethod==="viewedObjectIDs"){var ne=z.payload,ie=ne.objectIDs.filter(function(ue){return!B.has(ue)});if(ie.length===0)return;ie.forEach(function(ue){return B.add(ue)}),ne.objectIDs=ie}z.payload.algoliaSource=["instantsearch"],l&&z.payload.algoliaSource.pu
41sh("instantsearch-automatic"),z.eventModifier==="internal"&&z.payload.algoliaSource.push("instantsearch-internal"),$(z.insightsMethod,z.payload)}}},unsubscribe:function(){g("onUserTokenChange",void 0),v.sendEventToInsights=mt,O&&C&&(O.overrideStateWithoutTriggeringChangeEvent(N({},O.state,C)),v.scheduleSearch())}}}}function ay(e){var r,n,t=((n=e._initialResults)===null||n===void 0||(r=n[e.indexName])===null||r===void 0?void 0:r.state)||{},i=e.mainHelper.state;return{userToken:t.userToken||i.userToken,clickAnalytics:t.clickAnalytics||i.clickAnalytics}}function sy(e,r){var n=2592e6,t=new Date;t.setTime(t.getTime()+(r||n*6));var i="expires=".concat(t.toUTCString());document.cookie="_ALGOLIA=".concat(e,";").concat(i,";path=/")}function Gc(e){var r=we((e.version||"").split(".").map(Number),2),n=r[0],t=r[1],i=n>=3,a=n===2&&t>=6,o=n===1&&t>=10;return i||a||o}function Xc(e){if(e)return typeof e=="number"?e.toString():e}var oy=["ais.index","ais.feedContainer"];function tt(e){return oy.includes(e.$$type)}function uy(e){var r=e;return r.transporter&&r.transporter.userAgent?r.transporter.userAgent.value:r._ua}function _r(e,r,n){var t=r.getHelper();return{uiState:n,helper:t,parent:r,instantSearchInstance:e,state:t.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:r.createURL,scopedResults:[],searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Yc(e,r,n){var t=r.getResultsForWidget(n),i=r.getHelper();return{helper:i,parent:r,instantSearchInstance:e,results:t,scopedResults:r.getScopedResults(),state:t&&"_state"in t?t._state:i.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:r.createURL,searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Ua(e){var r=e.renderState,n=e.instantSearchInstance,t=e.parent,i=t?t.getIndexId():n.mainIndex.getIndexId();n.renderState=L(N({},n.renderState),G({},i,N({},n.renderState[i],r)))}function Xf(e,r,n){var t=_r(r,r.mainIndex,r._initialUiState);e.forEach(function(i){var a={};if(i.getWidgetRenderState){var o=i.getWidgetRenderState(t);o&&o.widgetParams&&(a=o.widgetParams)}var l=Object.keys(a).filter(function(d){return a[d]!==void 0});n.widgets.push({type:i.$$type,widgetType:i.$$widgetType,params:l}),tt(i)&&Xf(i.getWidgets(),r,n)})}function cy(){return ct(function(e){var r=e.window,n,t;return((t=r.navigator)===null||t===void 0||(n=t.userAgent)===null||n===void 0?void 0:n.indexOf("Algolia Crawler"))>-1},{fallback:function(){return!1}})}function ly(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.$$internal,n=r===void 0?!1:r;return function(t){var i=t.instantSearchInstance,a={widgets:[]},o=document.createElement("meta"),l=document.querySelector("head");return o.name="instantsearch:widgets",{$$type:"ais.metadata",$$internal:n,onStateChange:function(){},subscribe:function(){setTimeout(function(){a.ua=uy(i.client),Xf(i.mainIndex.getWidgets(),i,a),i.middleware.forEach(function(g){return a.widgets.push({middleware:!0,type:g.instance.$$type,internal:g.instance.$$internal})}),o.content=JSON.stringify(a),l.appendChild(o)},0)},started:function(){},unsubscribe:function(){o.remove()}}}}var Zc=function(r){r&&(window.document.title=r)},fy=(function(){function e(r){var n=this,t=r.windowTitle,i=r.writeDelay,a=i===void 0?400:i,o=r.createURL,l=r.parseURL,d=r.getLocation,g=r.start,m=r.dispose,v=r.push,h=r.cleanUrlOnDispose;ds(this,e),G(this,"$$type","ais.browser"),G(this,"windowTitle",void 0),G(this,"writeDelay",void 0),G(this,"_createURL",void 0),G(this,"parseURL",void 0),G(this,"getLocation",void 0),G(this,"writeTimer",void 0),G(this,"_onPopState",void 0),G(this,"inPopState",!1),G(this,"isDisposed",!1),G(this,"latestAcknowledgedHistory",0),G(this,"_start",void 0),G(this,"_dispose",void 0),G(this,"_push",void 0),G(this,"_cleanUrlOnDispose",void 0),this.windowTitle=t,this.writeTimer=void 0,this.writeDelay=a,this._createURL=o,this.parseURL=l,this.getLocation=d,this._start=g,this._dispose=m,this._push=v,this._cleanUrlOnDispose=typeof h>"u"?!0:h,ct(function(u){var s=u.window,f=n.windowTitle&&n.windowTitle(n.read());Zc(f),n.latestAcknowledgedHistory=s.history.length})}return hs(e,[{key:"read",value:function(){return this.parseURL({qsModule:ro,location:this.getLocation()})}},{key:"write",value:function(n){var t=this;ct(function(i){var a=i.window,o=t.createURL(n),l=t.windowTitle&&t.windowTitle(n);t.writeTimer&&clearTimeout(t.writeTimer),t.writeTimer=setTimeout(function(){Zc(l),t.shouldWrite(o)&&(t._push?t._push(o):a.history.pushState(n,l||"",o),t.latestAcknowledgedHistory=a.history.length),t.inPopState=!1,t.writeTimer=void 0},t.writeDelay)})}}
41,{key:"onUpdate",value:function(n){var t=this;this._start&&this._start(function(){n(t.read())}),this._onPopState=function(){t.writeTimer&&(clearTimeout(t.writeTimer),t.writeTimer=void 0),t.inPopState=!0,n(t.read())},ct(function(i){var a=i.window;a.addEventListener("popstate",t._onPopState)})}},{key:"createURL",value:function(n){var t=this._createURL({qsModule:ro,routeState:n,location:this.getLocation()});return t}},{key:"dispose",value:function(){var n=this;this._dispose&&this._dispose(),this.isDisposed=!0,ct(function(t){var i=t.window;n._onPopState&&i.removeEventListener("popstate",n._onPopState)}),this.writeTimer&&clearTimeout(this.writeTimer),this._cleanUrlOnDispose&&this.write({})}},{key:"start",value:function(){this.isDisposed=!1}},{key:"shouldWrite",value:function(n){var t=this;return ct(function(i){var a=i.window;if(t.isDisposed&&!t._cleanUrlOnDispose)return!1;var o=!(t.isDisposed&&t.latestAcknowledgedHistory!==a.history.length);return!t.inPopState&&o&&n!==a.location.href})}}]),e})();function dy(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.createURL,n=r===void 0?function(s){var f=s.qsModule,p=s.routeState,c=s.location,y=c.protocol,R=c.hostname,b=c.port,w=b===void 0?"":b,C=c.pathname,O=c.hash,x=f.stringify(p),F=w===""?"":":".concat(w);return x?"".concat(y,"//").concat(R).concat(F).concat(C,"?").concat(x).concat(O):"".concat(y,"//").concat(R).concat(F).concat(C).concat(O)}:r,t=e.parseURL,i=t===void 0?function(s){var f=s.qsModule,p=s.location;return f.parse(p.search.slice(1),{arrayLimit:99})}:t,a=e.writeDelay,o=a===void 0?400:a,l=e.windowTitle,d=e.getLocation,g=d===void 0?function(){return ct(function(s){var f=s.window;return f.location},{fallback:function(){throw new Error("You need to provide `getLocation` to the `history` router in environments where `window` does not exist.")}})}:d,m=e.start,v=e.dispose,h=e.push,u=e.cleanUrlOnDispose;return new fy({createURL:n,parseURL:i,writeDelay:o,windowTitle:l,getLocation:g,start:m,dispose:v,push:h,cleanUrlOnDispose:u})}function el(e){e.configure;var r=ze(e,["configure"]);return r}function hy(){return{$$type:"ais.simple",stateToRoute:function(r){return Object.keys(r).reduce(function(n,t){return L(N({},n),G({},t,el(r[t])))},{})},routeToState:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(r).reduce(function(n,t){var i=r[t];return(typeof i>"u"?"undefined":Ft(i))!=="object"||i===null?n:L(N({},n),G({},t,el(i)))},{})}}}var py=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.router,t=n===void 0?dy():n,i=r.stateMapping,a=i===void 0?hy():i,o=r.$$internal,l=o===void 0?!1:o;return function(d){var g=d.instantSearchInstance;function m(u){var s=g.mainIndex.getWidgets().length===0?g._initialUiState:g.mainIndex.getWidgetUiState({}),f=Object.keys(u).reduce(function(c,y){return L(N({},c),G({},y,u[y]))},s),p=a.stateToRoute(f);return t.createURL(p)}g._createURL=m;var v=void 0,h=g._initialUiState;return{$$type:"ais.router({router:".concat(t.$$type||"__unknown__",", stateMapping:").concat(a.$$type||"__unknown__","})"),$$internal:l,onStateChange:function(s){var f=s.uiState,p=a.stateToRoute(f);(v===void 0||!gs(v,p))&&(t.write(p),v=p)},subscribe:function(){g._initialUiState=N({},h,a.routeToState(t.read())),t.onUpdate(function(s){g.mainIndex.getWidgets().length>0&&g.setUiState(a.routeToState(s))})},started:function(){var s;(s=t.start)===null||s===void 0||s.call(t)},unsubscribe:function(){t.dispose()}}}},gy=0;function my(e){e.dependsOn==="recommend"&&(e.$$id=gy++)}function vy(e){var r=e.name,n=e.connector,t=n===void 0?!1:n;return["https://www.algolia.com/doc/api-reference/widgets/",r,"/js/",t?"#connector":""].join("")}function Yf(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var t=r.map(function(i){return vy(i)}).join(", ");return function(i){return[i,"See documentation: ".concat(t)].filter(Boolean).join(` 42 43`)}}function yy(e,r){if(!Array.isArray(e))return-1;for(var n=0;n<e.length;n++)if(r(e[n]))return n;return-1}function _y(e){return e.filter(function(r,n,t){return t.indexOf(r)===n})}var Ry=function(r,n){n.facets,n.disjunctiveFacets,n.facetsRefinements,n.facetsExcludes,n.disjunctiveFacetsRefinements,n.numericRefinements,n.tagRefinements,n.hierarchicalFacets,n.hierarchicalFacetsRefinements,n.ruleContexts;var t=ze(n,["facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements","ruleContexts"]);return r.setQueryParameters(t)},Sy=function(r,n){return n.facets.reduce(function(t,i){return t.addFacet(i)},r)},by=function(r,n){return n.disjunctiveFacets.reduce(function(t,i){return t.addDisjunctiveFacet(i)},r)},wy=function(r,n){return r.setQueryParameters({hierarchicalFacets:n.hierarchicalFacets.reduce(function(t,i){var a=yy(t,function(l){return l.name===i.name});if(a===-1)return t.concat(i);var o=t.slice();return o.splice(a,1,i),o},r.hierarchicalFacets)})},Py=function(r,n){return n.tagRefinements.reduce(function(t,i){return t.addTagRefinement(i)},r)},Ey=function(r,n){return r.setQueryParameters({facetsRefinements:N({},r.facetsRefinements,n.facetsRefinements)})},xy=function(r,n){return r.setQueryParameters({facetsExcludes:N({},r.facetsExcludes,n.facetsExcludes)})},Cy=function(r,n){return r.setQueryParameters({disjunctiveFacetsRefinements:N({},r.disjunctiveFacetsRefinements,n.disjunctiveFacetsRefinements)})},Fy=function(r,n){return r.setQueryParameters({numericRefinements:N({},r.numericRefinements,n.numericRefinements)})},Oy=function(r,n){return r.setQueryParameters({hierarchicalFacetsRefinements:N({},r.hierarchicalFacetsRefinements,n.hierarchicalFacetsRefinements)})},Ay=function(r,n){var t=_y([].concat(r.ruleContexts).concat(n.ruleContexts).filter(
43Boolean));return t.length>0?r.setQueryParameters({ruleContexts:t}):r},tl=function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];return n.reduce(function(i,a){var o=Oy(i,a),l=wy(o,a),d=Py(l,a),g=Fy(d,a),m=Cy(g,a),v=xy(m,a),h=Ey(v,a),u=by(h,a),s=Ay(u,a),f=Sy(s,a);return Ry(f,a)})};function rl(e){for(var r=e.getParent(),n=[e.getHelper().state];r!==null;)n=[r.getHelper().state].concat(n),r=r.getParent();return n}var pr=Yf({name:"index-widget"});function Zf(e,r){var n=r.state,t=r.recommendState,i=r.isPageReset,a=r._uiState;n!==e.state&&(e.state=n,e.emit("change",{state:e.state,results:e.lastResults,isPageReset:i,_uiState:a})),t!==e.recommendState&&(e.recommendState=t)}function gr(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.reduce(function(t,i){return tt(i)||!i.getWidgetUiState&&!i.getWidgetState?t:i.getWidgetUiState?i.getWidgetUiState(t,r):i.getWidgetState(t,r)},n)}function mr(e,r){var n=r.initialSearchParameters,t=ze(r,["initialSearchParameters"]);return e.reduce(function(i,a){return!a.getWidgetSearchParameters||tt(a)?i:a.dependsOn==="search"&&a.getWidgetParameters?a.getWidgetParameters(i,t):a.getWidgetSearchParameters(i,t)},n)}function nl(e,r){var n=r.initialRecommendParameters,t=ze(r,["initialRecommendParameters"]);return e.reduce(function(i,a){return!tt(a)&&a.dependsOn==="recommend"&&a.getWidgetParameters?a.getWidgetParameters(i,t):i},n)}function ed(e){var r=e.filter(tt);r.length!==0&&r.forEach(function(n){var t=n.getHelper();Zf(t,{state:t.state.resetPage(),recommendState:t.recommendState,isPageReset:!0}),ed(n.getWidgets())})}function td(e){var r=e.filter(tt);return r.reduce(function(n,t){var i;return(i=n).concat.apply(i,[{indexId:t.getIndexId(),results:t.getResults(),helper:t.getHelper()}].concat(Ae(td(t.getWidgets()))))},[])}var Iy=function(r){if(r===void 0||r.indexName===void 0&&!r.EXPERIMENTAL_isolated)throw new Error(pr("The `indexName` option is required."));var n=r.indexName,t=n===void 0?"":n,i=r.indexId,a=i===void 0?t:i,o=r.EXPERIMENTAL_isolated,l=o===void 0?!1:o,d=[],g={},m=null,v=null,h=null,u=null,s=null,f=!1,p=!1;return{$$type:"ais.index",$$widgetType:"ais.index",_isolated:l,getIndexName:function(){return t},getIndexId:function(){return a},getHelper:function(){return h},getResults:function(){return u!=null&&u.lastResults?(u.lastResults._state=h.state,u.lastResults):null},getResultsForWidget:function(y){return y.dependsOn!=="recommend"||tt(y)||y.$$id===void 0?this.getResults():h!=null&&h.lastRecommendResults?h.lastRecommendResults[y.$$id]:null},getPreviousState:function(){return s},getScopedResults:function(){var y=this.getParent(),R;return y?R=y.getWidgets():t.length===0?R=this.getWidgets():R=[this],td(R)},getParent:function(){return l?null:v},createURL:function(y){return typeof y=="function"?m._createURL(G({},a,y(g))):m._createURL(G({},a,gr(d,{searchParameters:y,helper:h})))},scheduleLocalSearch:$t(function(){l&&(h==null||h.search())}),getWidgets:function(){return d},addWidgets:function(y){var R=this;if(!Array.isArray(y))throw new Error(pr("The `addWidgets` method expects an array of widgets."));var b=y.reduce(function(w,C){return w.concat(Array.isArray(C)?C:[C])},[]);if(b.some(function(w){return typeof w.init!="function"&&typeof w.render!="function"}))throw new Error(pr("The widget definition expects a `render` and/or an `init` method."));return b.forEach(function(w){w.parent=R,!tt(w)&&(m&&w.dependsOn==="recommend"?m._hasRecommendWidget=!0:m?m._hasSearchWidget=!0:w.dependsOn==="recommend"?f=!0:p=!0,my(w))}),d=d.concat(b),m&&b.length&&(Zf(h,{state:mr(d,{uiState:g,initialSearchParameters:h.state}),recommendState:nl(d,{uiState:g,initialRecommendParameters:h.recommendState}),_uiState:g}),b.forEach(function(w){if(w.getRenderState){var C=w.getRenderState(m.renderState[R.getIndexId()]||{},_r(m,R,m._initialUiState));Ua({renderState:C,instantSearchInstance:m,parent:R})}}),b.forEach(function(w){w.init&&w.init(_r(m,R,m._initialUiState))}),l?this.scheduleLocalSearch():m.scheduleSearch()),this},removeWidgets:function(y){var R=this;if(!Array.isArray(y))throw new Error(pr("The `removeWidgets` method expects an array of widgets."));var b=y.reduce(function(F,T){return F.concat(Array.isArray(T)?T:[T])},[]);if(b.some(function(F){return typeof F.dispose!="function"}))throw new Error(pr("The widget definition expects a `dispose` method."));if(d=d.filter(function(F){return b.indexOf(F)===-1}),d.forEach(function(F){F.parent=void 0,!tt(F)&&(m&&F.dependsOn==="recommend"?m._hasRecommendWidget=!0:m?m._hasSearchWidget=!0:F.dependsOn==="recommend"?f=!0:p=!0)}),m&&b.length){var w=b.reduce(function(F,T){var A=T.dispose({helper:h,state:F.cleanedSearchState,recommendState:F.cleanedRecommendState,parent:R});return xt(A,_e.RecommendParameters)?F.cleanedRecommendState=A:A&&(F.cleanedSearchState=A),F},{cleanedSearchState:h.state,cleanedRecommendState:h.recommendState}),C=w.cleanedSearchState,O=w.cleanedRecommendState,x=m.future.preserveSharedStateOnUnmount?mr(d,{uiState:g,initialSearchParameters:new _e.SearchParameters({index:this.getIndexName()})}):mr(d,{uiState:gr(d,{searchParameters:C,helper:h}),initialSearchParameters:C});g=gr(d,{searchParameters:x,helper:h}),h.setState(x),h.recommendState=O,d.length&&(l?this.scheduleLocalSearch():m.scheduleSearch())}return this},init:function(y){var R=this,b=y.instantSearchInstance,w=y.parent,C=y.uiState,O;if(h===null){m=b,v=w,g=C[a]||{};var x=b.mainHelper,F=mr(d,{uiState:g,initialSearchParameters:new _e.SearchParameters({index:t})}),T=nl(d,{uiState:g,initialRecommendParameters:new _e.RecommendParameters});h=_e(x.getClient(),F.index,F),h.recommendState=T,h.search=function(){return l?(b.status="loading",R.render({instantSearchInstance:b}),b.compositionID?h.searchWithComposition():h.searchOnlyWithDerivedHelpers()):b.onStateChange?(b.onStateChange({uiState:b.mainIndex.getWidgetUiState({}),setUiState:function(M){return b.setUiState(M,!1)}}),x):x.search()},h.searchWithoutTriggeringOnStateChange=function(){return x.search()},h.searchForFacetValues=function(k,M,$,B){var V=tl.apply(void 0,[x.state].concat(Ae(rl(R)))).setQueryParameters(B);return x.searchForFacetValues(k,M,$,V)};var A=t?h:_e({},"__empty_index__",{}),D=l?A:Ty(w,x);u=D.derive(function(){return tl.apply(void 0,[x.state].concat(Ae(rl(R))))},function(){return R.getHelper().recommendState});var W=(O=b._initialResults)===null||O===void 0?void 0:O[this.getIndexId()];if(W!=null&&W.results){var Q=new _e.SearchResults(new _e.SearchParameters(W.state),W.results);u.lastResults=Q,h.lastResults=Q}if(W!=null&&W.recommendResults){var J=new _e.RecommendResults(new _e.RecommendParameters({params:W.recommendResults.params}),W.recommendResults.results);u.lastRecommendResults=J,h.lastRecommendResults=J}h.on("change",function(k){var M=k.isPageReset;M&&ed(d)}),u.on("search",function(){b.scheduleStalledRender()}),u.on("result",function(k){var M=k.results;b.scheduleRender(),h.lastResults=M,s=M==null?void 0:M._state}),u.on("recommend:result",function(k){var M=k.recommend;b.scheduleRender(),h.lastRecommendResults=M.results}),d.forEach(function(k){if(k.getRenderState){var M=k.getRenderState(b.render
43State[R.getIndexId()]||{},_r(b,R,C));Ua({renderState:M,instantSearchInstance:b,parent:R})}}),d.forEach(function(k){k.init&&k.init(_r(b,R,C))}),h.on("change",function(k){var M=k.state,$=k._uiState;g=gr(d,{searchParameters:M,helper:h},$||{}),b.onStateChange||b.onInternalStateChange()}),W&&b.scheduleRender(),f&&(b._hasRecommendWidget=!0),p&&(b._hasSearchWidget=!0)}},render:function(y){var R=this,b=y.instantSearchInstance;b.status==="error"&&!b.mainHelper.hasPendingRequests()&&s&&h.setState(s);var w=this.getResults()||u!=null&&u.lastRecommendResults||l&&!t?d:d.filter(function(C){return C.shouldRender});w=w.filter(function(C){return C.shouldRender?C.shouldRender({instantSearchInstance:b}):!0}),w.forEach(function(C){if(C.getRenderState){var O=C.getRenderState(b.renderState[R.getIndexId()]||{},Yc(b,R,C));Ua({renderState:O,instantSearchInstance:b,parent:R})}}),w.forEach(function(C){C.render&&C.render(Yc(b,R,C))})},dispose:function(){var y=this;d.forEach(function(R){R.dispose&&h&&R.dispose({helper:h,state:h.state,recommendState:h.recommendState,parent:y})}),m=null,v=null,h==null||h.removeAllListeners(),h=null,u==null||u.detach(),u=null},getWidgetUiState:function(y){return d.filter(tt).filter(function(R){return!R._isolated}).reduce(function(R,b){return b.getWidgetUiState(R)},L(N({},y),G({},a,N({},y[a],g))))},getWidgetState:function(y){return this.getWidgetUiState(y)},getWidgetSearchParameters:function(y,R){var b=R.uiState;return mr(d,{uiState:b,initialSearchParameters:y})},shouldRender:function(){return!0},refreshUiState:function(){g=gr(d,{searchParameters:this.getHelper().state,helper:this.getHelper()},g)},setIndexUiState:function(y){var R=typeof y=="function"?y(g):y;m.setUiState(function(b){return L(N({},b),G({},a,R))})}}};function Ty(e,r){for(;e;){if(e._isolated)return e.getHelper();e=e.getParent()}return r}function jy(e,r){return e.toLocaleString(r)}function Ny(e){var r=e.numberLocale;return{formatNumber:function(t,i){return jy(Number(i(t)),r)},highlight:function(t,i){try{var a=JSON.parse(t);return i(Lf(L(N({},a),{hit:this})))}catch{throw new Error(` 44The highlight helper expects a JSON object of the format: 45{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseHighlight:function(t,i){try{var a=JSON.parse(t);return i(Qf(L(N({},a),{hit:this})))}catch{throw new Error(` 46 The reverseHighlight helper expects a JSON object of the format: 47 { "attribute": "name", "highlightedTagName": "mark" }`)}},snippet:function(t,i){try{var a=JSON.parse(t);return i(Vf(L(N({},a),{hit:this})))}catch{throw new Error(` 48The snippet helper expects a JSON object of the format: 49{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseSnippet:function(t,i){try{var a=JSON.parse(t);return i(zf(L(N({},a),{hit:this})))}catch{throw new Error(` 50 The reverseSnippet helper expects a JSON object of the format: 51 { "attribute": "name", "highlightedTagName": "mark" }`)}},insights:function(t,i){try{var a=JSON.parse(t),o=a.method,l=a.payload;return i(Kf(o,N({objectIDs:[this.objectID]},l)))}catch{throw new Error(` 52The insights helper expects a JSON object of the format: 53{ "method": "method-name", "payload": { "eventName": "name of the event" } }`)}}}}function Ka(e,r){var n=e[r.getIndexId()]||{};r.getHelper().setState(r.getWidgetSearchParameters(r.getHelper().state,{uiState:n})),r.getWidgets().filter(tt).forEach(function(t){return Ka(e,t)})}function Hy(e,r){var n=Object.keys(r).reduce(function(t,i){var a=r[i];return a.recommendResults?N({},t,a.recommendResults.results):t},{});e._recommendCache=n}function La(e){var r;return!((r=e.compositionFeedsResults)===null||r===void 0)&&r.length?e.compositionFeedsResults:e.results||[]}function qy(e,r){if(r&&!((!("transporter"in e)||e._cacheHydrated)&&(!e._useCache||typeof e.addAlgoliaAgent!="function"))){var n=[Object.keys(r).reduce(function(o,l){var d=r[l],g=d.state,m=d.requestParams,v=La(d),h=v&&g?v.map(function(u,s){return N({indexName:g.index||u.index},m!=null&&m[s]||u.params?{params:$a((m==null?void 0:m[s])||Dy(u.params))}:{})}):[];return o.concat(h)},[])],t=Object.keys(r).reduce(function(o,l){var d=La(r[l]);return d?o.concat(d):o},[]);if("transporter"in e&&!e._cacheHydrated){e._cacheHydrated=!0;var i=e.search.bind(e);e.search=function(o){for(var l=arguments.length,d=new Array(l>1?l-1:0),g=1;g<l;g++)d[g-1]=arguments[g];var m=Array.isArray(o)?o.map(function(v){return L(N({},v),{params:$a(v.params)})}):$a(o.requestBody.params);return e.transporter.responsesCache.get({method:"search",args:[m].concat(Ae(d))},function(){return i.apply(void 0,[o].concat(Ae(d)))})},e.transporter.responsesCache.set({method:"search",args:n},{results:t})}if(!("transporter"in e)){var a="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:n}));e.cache=L(N({},e.cache),G({},a,JSON.stringify({results:Object.keys(r).map(function(o){return La(r[o])})})))}}}function Dy(e){return e.split("&").reduce(function(r,n){var t=we(n.split("="),2),i=t[0],a=t[1];return r[i]=a?decodeURIComponent(a):"",r},{})}function $a(e){var r=function(i){return Object.prototype.toString.call(i)==="[object Object]"||Object.prototype.toString.call(i)==="[object Array]"},n=function(i){for(var a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];var d=0;return i.replace(/%s/g,function(){return encodeURIComponent(o[d++])})};return Object.keys(e).map(function(t){return n("%s=%s",t,r(e[t])?JSON.stringify(e[t]):e[t])}).join("&")}var rd="4.99.0",pt=Yf({name:"instantsearch"});function My(){return"#"}var Uy={preserveSharedStateOnUnmount:!1,persistHierarchicalRootCount:!1},Ly=(function(e){pv(r,e);function r(n){ds(this,r);var t;t=hv(this,r),G(t,"client",void 0),G(t,"indexName",void 0),G(t,"compositionID",void 0),G(t,"insightsClient",void 0),G(t,"onStateChange",null),G(t,"future",void 0),G(t,"helper",void 0),G(t,"mainHelper",void 0),G(t,"mainIndex",void 0),G(t,"started",void 0),G(t,"templatesConfig",void 0),G(t,"render
53State",{}),G(t,"_stalledSearchDelay",void 0),G(t,"_searchStalledTimer",void 0),G(t,"_initialUiState",void 0),G(t,"_initialResults",void 0),G(t,"_manuallyResetScheduleSearch",!1),G(t,"_resetScheduleSearch",void 0),G(t,"_createURL",void 0),G(t,"_searchFunction",void 0),G(t,"_mainHelperSearch",void 0),G(t,"_hasSearchWidget",!1),G(t,"_hasRecommendWidget",!1),G(t,"_insights",void 0),G(t,"middleware",[]),G(t,"sendEventToInsights",void 0),G(t,"status","idle"),G(t,"error",void 0),G(t,"scheduleSearch",$t(function(){t.started&&t.mainHelper.search()})),G(t,"scheduleRender",$t(function(){var A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,D;!((D=t.mainHelper)===null||D===void 0)&&D.hasPendingRequests()||(clearTimeout(t._searchStalledTimer),t._searchStalledTimer=null,A&&(t.status="idle",t.error=void 0)),t.mainIndex.render({instantSearchInstance:t}),t.emit("render")})),G(t,"onInternalStateChange",$t(function(){var A=t.mainIndex.getWidgetUiState({});t.middleware.forEach(function(D){var W=D.instance;W.onStateChange({uiState:A})})})),t.setMaxListeners(100);var i=n.indexName,a=i===void 0?"":i,o=n.compositionID,l=n.numberLocale,d=n.initialUiState,g=d===void 0?{}:d,m=n.routing,v=m===void 0?null:m,h=n.insights,u=h===void 0?void 0:h,s=n.searchFunction,f=n.stalledSearchDelay,p=f===void 0?200:f,c=n.searchClient,y=c===void 0?null:c,R=n.insightsClient,b=R===void 0?null:R,w=n.onStateChange,C=w===void 0?null:w,O=n.future,x=O===void 0?N({},Uy,n.future||{}):O;if(y===null)throw new Error(pt("The `searchClient` option is required."));if(typeof y.search!="function")throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");if(typeof y.addAlgoliaAgent=="function"&&y.addAlgoliaAgent("instantsearch.js (".concat(rd,")")),b&&typeof b!="function")throw new Error(pt("The `insightsClient` option should be a function."));if(t.client=y,t.future=x,t.insightsClient=b,t.indexName=a,t.compositionID=o,t.helper=null,t.mainHelper=null,t.mainIndex=Iy({indexName:t.compositionID||t.indexName}),t.onStateChange=C,t.started=!1,t.templatesConfig={helpers:Ny({numberLocale:l}),compileOptions:{}},t._stalledSearchDelay=p,t._searchStalledTimer=null,t._createURL=My,t._initialUiState=g,t._initialResults=null,t._insights=u,s&&(t._searchFunction=s),t.sendEventToInsights=mt,v){var F=typeof v=="boolean"?{}:v;F.$$internal=!0,t.use(py(F))}if(u){var T=typeof u=="boolean"?{}:u;T.$$internal=!0,t.use(Jc(T))}return cy()&&t.use(ly({$$internal:!0})),t}return hs(r,[{key:"_isSearchStalled",get:function(){return this.status==="stalled"}},{key:"use",value:function(){for(var t=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];var l=a.map(function(d){var g=N({$$type:"__unknown__",$$internal:!1,subscribe:mt,started:mt,unsubscribe:mt,onStateChange:mt},d({instantSearchInstance:t}));return t.middleware.push({creator:d,instance:g}),g});return this.started&&l.forEach(function(d){d.subscribe(),d.started()}),this}},{key:"unuse",value:function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.middleware.filter(function(o){return i.includes(o.creator)}).forEach(function(o){return o.instance.unsubscribe()}),this.middleware=this.middleware.filter(function(o){return!i.includes(o.creator)}),this}},{key:"EXPERIMENTAL_use",value:function(){for(var t=arguments.length,i=new Array(t),a=0;a<t;a++)i[a]=arguments[a];return this.use.apply(this,Ae(i))}},{key:"addWidget",value:function(t){return this.addWidgets([t])}},{key:"addWidgets",value:function(t){if(!Array.isArray(t))throw new Error(pt("The `addWidgets` method expects an array of widgets. Please use `addWidget`."));if(this.compositionID&&t.some(function(i){return!Array.isArray(i)&&tt(i)&&!i._isolated}))throw new Error(pt("The `index` widget cannot be used with a composition-based InstantSearch implementation."));return this.mainIndex.addWidgets(t),this}},{key:"removeWidget",value:function(t){return this.removeWidgets([t])}},{key:"removeWidgets",value:function(t){if(!Array.isArray(t))throw new Error(pt("The `removeWidgets` method expects an array of widgets. Please use `removeWidget`."));return this.mainIndex.removeWidgets(t),this}},{key:"start",value:function(){var t=this;if(this.started)throw new Error(pt("The `start` method has already been called once."));var i=this.mainHelper||_e(this.client,this.indexName,void 0,{persistHierarchicalRootCount:this.future.persistHierarchicalRootCount});if(this.compositionID&&(i.searchForFacetValues=i.searchForCompositionFacetValues.bind(i)),i.search=function(){return t.status="loading",t.scheduleRender(!1),t._hasSearchWidget&&(t.compositionID?i.searchWithComposition():i.searchOnlyWithDerivedHelpers()),t._hasRecommendWidget&&i.recommend(),i},this._searchFunction){var a={search:function(){return new Promise(mt)}};this._mainHelperSearch=i.search.bind(i),i.search=function(){var l=t.mainIndex.getHelper(),d=_e(a,l.state.index,l.state);return d.once("search",function(g){var m=g.state;l.overrideStateWithoutTriggeringChangeEvent(m),t._mainHelperSearch()}),d.on("change",function(g){var m=g.state;l.setState(m)}),t._searchFunction(d),i}}if(i.on("error",function(l){var d=l.error;if(!xt(d,Error)){var g=d;d=Object.keys(g).reduce(function(m,v){return m[v]=g[v],m},new Error(g.message))}d.error=d,t.error=d,t.status="error",t.scheduleRender(!1),t.emit("error",d)}),this.mainHelper=i,this.middleware.forEach(function(l){var d=l.instance;d.subscribe()}),this.mainIndex.init({instantSearchInstance:this,parent:null,uiState:this._initialUiState}),this._initialResults){qy(this.client,this._initialResults),Hy(this.mainHelper,this._initialResults);var o=this.scheduleSearch;this.scheduleSearch=$t(mt),this._manuallyResetScheduleSearch?this._resetScheduleSearch=function(){t.sc
53heduleSearch=o}:$t(function(){t.scheduleSearch=o})()}else this.mainIndex.getWidgets().length>0&&this.scheduleSearch();this.helper=this.mainIndex.getHelper(),this.started=!0,this.middleware.forEach(function(l){var d=l.instance;d.started()}),typeof this._insights>"u"&&i.derivedHelpers[0].once("result",function(){var l=t.mainIndex.getScopedResults().some(function(d){var g=d.results;return g==null?void 0:g._automaticInsights});l&&t.use(Jc({$$internal:!0,$$automatic:!0}))})}},{key:"dispose",value:function(){var t;this.scheduleSearch.cancel(),this.scheduleRender.cancel(),clearTimeout(this._searchStalledTimer),this.removeWidgets(this.mainIndex.getWidgets()),this.mainIndex.dispose(),this.started=!1,this.removeAllListeners(),(t=this.mainHelper)===null||t===void 0||t.removeAllListeners(),this.mainHelper=null,this.helper=null,this.middleware.forEach(function(i){var a=i.instance;a.unsubscribe()})}},{key:"scheduleStalledRender",value:function(){var t=this;this._searchStalledTimer||(this._searchStalledTimer=setTimeout(function(){t.status="stalled",t.scheduleRender()},this._stalledSearchDelay))}},{key:"setUiState",value:function(t){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!this.mainHelper)throw new Error(pt("The `start` method needs to be called before `setUiState`."));this.mainIndex.refreshUiState();var o=typeof t=="function"?t(this.mainIndex.getWidgetUiState({})):t;this.onStateChange&&a?this.onStateChange({uiState:o,setUiState:function(d){Ka(typeof d=="function"?d(o):d,i.mainIndex),i.scheduleSearch(),i.onInternalStateChange()}}):(Ka(o,this.mainIndex),this.scheduleSearch(),this.onInternalStateChange())}},{key:"getUiState",value:function(){return this.started&&this.mainIndex.refreshUiState(),this.mainIndex.getWidgetUiState({})}},{key:"createURL",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.started)throw new Error(pt("The `start` method needs to be called before `createURL`."));return this._createURL(t)}},{key:"refresh",value:function(){if(!this.mainHelper)throw new Error(pt("The `start` method needs to be called before `refresh`."));this.mainHelper.clearCache().search()}}]),r})(ry),Fr=function(r,n){return r},nt=function(r){return new Ly(r)};nt.version=rd;nt.createInfiniteHitsSessionStorageCache=Fr(ey);nt.highlight=Fr(Lf);nt.reverseHighlight=Fr(Qf);nt.snippet=Fr(Vf);nt.reverseSnippet=Fr(zf);nt.insights=Kf;nt.getInsightsAnonymousUserToken=Zv;Object.defineProperty(nt,"widgets",{get:function(){throw new ReferenceError(`"instantsearch.widgets" are not available from the ES build. 54 55To import the widgets: 56 57import { searchBox } from 'instantsearch.js/es/widgets/index.js'`)}});Object.defineProperty(nt,"connectors",{get:function(){throw new ReferenceError(`"instantsearch.connectors" are not available from the ES build. 58 59To import the connectors: 60 61import { connectSearchBox } from 'instantsearch.js/es/connectors/index.js'`)}});Object.defineProperty(nt,"templates",{get:function(){throw new ReferenceError(`"instantsearch.templates" are not available from the ES build. 62 63To import the templates: 64 65import { carousel } from 'instantsearch.js/es/templates/index.js'`)}});Fe({name:"instantsearch"});var $y={preserveSharedStateOnUnmount:!1,persistHierarchicalRootCount:!1},Wy="4.26.5",nd=function(e){return Sr(Ue({mixins:[me({name:"InstantSearch"})],provide:function(){return{$_ais_instantSearchInstance:this.instantSearchInstance}},watch:{searchClient:function(r){Wt(!1),this.instantSearchInstance.helper.setClient(r).search()},indexName:function(r){this.instantSearchInstance.helper.setIndex(r||"").search()},compositionID:function(r){this.instantSearchInstance.helper.setIndex(r||"").search()},stalledSearchDelay:function(r){this.instantSearchInstance._stalledSearchDelay=r},routing:function(){throw new Error(`routing configuration can not be changed dynamically at this point. 66 67Please open a new issue: https://github.com/algolia/instantsearch/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props`)},onStateChange:function(){throw new Error(`onStateChange configuration can not be changed dynamically at this point. 68 69Please open a new issue: https://github.com/algolia/instantsearch/discussions/new?category=ideas&labels=triage%2cLibrary%3A+Vue+InstantSearch&title=Feature%20request%3A%20dynamic%20props`)},searchFunction:function(r){this.instantSearchInstance._searchFunction=r},middlewares:{immediate:!0,handler:function(r,n){var t=this;(n||[]).filter(function(i){return(r||[]).indexOf(i)===-1}
69).forEach(function(i){t.instantSearchInstance.unuse(i)}),(r||[]).filter(function(i){return(n||[]).indexOf(i)===-1}).forEach(function(i){t.instantSearchInstance.use(i)})}},future:function(r){this.instantSearchInstance.future=Object.assign($y,r)}},created:function(){var r=this.instantSearchInstance.client;typeof r.addAlgoliaAgent=="function"&&(r.addAlgoliaAgent("Vue (".concat(jh,")")),r.addAlgoliaAgent("Vue InstantSearch (".concat(Wy,")")))},mounted:function(){var r=this;this.$nextTick(function(){r.instantSearchInstance.started||r.instantSearchInstance.start()})}},"beforeUnmount",function(){this.instantSearchInstance.started&&this.instantSearchInstance.dispose(),this.instantSearchInstance.__initialSearchResults=void 0}),e)},il=`Vue InstantSearch: You used the prop api-key or app-id. 70These have been replaced by search-client. 71 72See more info here: https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-search-client`,ky=nd({name:"AisInstantSearch",props:{searchClient:{type:Object,required:!0},insightsClient:{type:Function,default:void 0},indexName:{type:String,required:!1},compositionID:{type:String,required:!1},routing:{default:void 0,validator:function(e){return!(typeof e=="boolean"||!e.router&&!e.stateMapping)||(Wt("The `routing` option expects an object with `router` and/or `stateMapping`.\n\nSee https://www.algolia.com/doc/api-reference/widgets/instantsearch/vue/#widget-param-routing"),!1)}},insights:{default:void 0,validator:function(e){return e===void 0||typeof e=="boolean"||(e===void 0?"undefined":cf(e))==="object"}},stalledSearchDelay:{type:Number,default:void 0},searchFunction:{type:Function,default:void 0},onStateChange:{type:Function,default:void 0},initialUiState:{type:Object,default:void 0},apiKey:{type:String,default:void 0,validator:function(e){return e&&Wt(il),!1}},appId:{type:String,default:void 0,validator:function(e){return e&&Wt(il),!1}},middlewares:{type:Array,default:null},future:{type:Object,default:void 0}},data:function(){return{instantSearchInstance:nt({searchClient:this.searchClient,insightsClient:this.insightsClient,insights:this.insights,indexName:this.indexName,compositionID:this.compositionID,routing:this.routing,stalledSearchDelay:this.stalledSearchDelay,searchFunction:this.searchFunction,onStateChange:this.onStateChange,initialUiState:this.initialUiState,future:this.future})}},render:Ot(function(e){var r;return e("div",{class:(r={},Ue(r,this.suit(),!0),Ue(r,this.suit("","ssr"),!1),r)},Zn(this))})});nd({name:"AisInstantSearchSsr",inject:{$_ais_ssrInstantSearchInstance:{default:function(){throw new Error("`createServerRootMixin` is required when using SSR.")}}},data:function(){return{instantSearchInstance:this.$_ais_ssrInstantSearchInstance}},render:Ot(function(e){var r;return e("div",{class:(r={},Ue(r,this.suit(),!0),Ue(r,this.suit("","ssr"),!0),r)},Zn(this))})});me({name:"QueryRuleContext"}),Pe({connector:Nf},{$$widgetType:"ais.queryRuleContext"});function id(e){var r,n=e.props;if(n){if(n.attribute)return n.attribute;if(Array.isArray(n.attributes))return n.attributes[0]}if(r=e.children&&e.children.default&&e.children.default(),Array.isArray(r))return r.reduce(function(t,i){return t||id(i)},void 0)}var By={name:"AisDynamicWidgets",mixins:[Pe({connector:Gg},{$$widgetType:"ais.dynamicWidgets"}),me({name:"DynamicWidgets"})],props:{transformItems:{type:Function,default:void 0},facets:{type:Array,default:void 0},maxValuesPerFacet:{type:Number,default:void 0}},render:Ot(function(e){var r=this,n=new Map;if((Zn(this)||[]).forEach(function(i){var a=id(i);a&&n.set(a,e("div",{key:a,class:[r.suit("widget")]},[i]))}),!this.state){var t=[];return n.forEach(function(i){return t.push(i)}),e("div",Sr({class:[this.suit()]},{attrs:{hidden:!0}}),t)}return e("div",{class:[this.suit()]},this.state.attributesToRender.map(function(i){return n.get(i)}))}),computed:{widgetParams:function(){return{transformItems:this.transformItems,facets:this.facets,maxValuesPerFacet:this.maxValuesPerFacet,widgets:[]}}}};Object.assign({},By,{name:"AisExperimentalDynamicWidgets",mounted:function(){Wt("Use AisDynamicWidgets instead of AisExperimentalDynamicWidgets.")}});function Qy(e){if(Array.isArray(e))return e}function Vy(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var t=[],i=!0,a=!1,o,l;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(t.push(o.value),!(r&&t.length===r));i=!0);}catch(d){a=!0,l=d}finally{try{!i&&n.return!=null&&n.return()}finally{if(a)throw l}}return t}}
72function zy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 73In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ja(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function ad(e,r){if(e){if(typeof e=="string")return Ja(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ja(e,r)}}function Ky(e,r){return Qy(e)||Vy(e,r)||ad(e,r)||zy()}function Jy(e){if(Array.isArray(e))return Ja(e)}function Gy(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Xy(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 74In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gn(e){return Jy(e)||Gy(e)||ad(e)||Xy()}function Yy(e,r,n){var t=[],i=!1,a={$$type:"ais.feedContainer",$$widgetType:"ais.feedContainer",_isolated:!0,getIndexName:function(){return r.getIndexName()},getIndexId:function(){return e},getHelper:function(){return r.getHelper()},getResults:function(){var l=r.getResults();if(!l)return null;if(!l.feeds)return e===""?(l._state=r.getHelper().state,l):null;var d=l.feeds.find(function(g){return g.feedID===e});return d?(d._state=r.getHelper().state,d):null},getResultsForWidget:function(){return this.getResults()},getParent:function(){return r},getWidgets:function(){return t},getScopedResults:function(){return r.getScopedResults()},getPreviousState:function(){return null},createURL:function(l){return r.createURL(l)},scheduleLocalSearch:function(){return r.scheduleLocalSearch()},addWidgets:function(l){var d=l.reduce(function(v,h){return v.concat(Array.isArray(h)?h:[h])},[]);if(d.forEach(function(v){v.parent=a}),t=t.concat(d),i){d.forEach(function(v){if(v.getRenderState){var h=v.getRenderState(n.renderState[a.getIndexId()]||{},Et(n,a,n._initialUiState));Bt({renderState:h,instantSearchInstance:n,parent:a})}}),d.forEach(function(v){v.init&&v.init(Et(n,a,n._initialUiState))});var g=r.getHelper(),m=a.getWidgetSearchParameters(g.state,{uiState:{}});m!==g.state&&g.setState(m)}return a},removeWidgets:function(l){var d=l.reduce(function(v,h){return v.concat(Array.isArray(h)?h:[h])},[]),g=r.getHelper();if(!g)return t=t.filter(function(v){return!d.includes(v)}),a;var m=g.state;return d.forEach(function(v){if(v.dispose){var h=v.dispose({helper:g,state:m,recommendState:g.recommendState,parent:a});xt(h,_e.RecommendParameters)||h&&(m=h)}}),t=t.filter(function(v){return!d.includes(v)}),m!==g.state&&g.setState(m),a},init:function(){i=!0,t.forEach(function(l){if(l.getRenderState){var d=l.getRenderState(n.renderState[a.getIndexId()]||{},Et(n,a,n._initialUiState));Bt({renderState:d,instantSearchInstance:n,parent:a})}}),t.forEach(function(l){l.init&&l.init(Et(n,a,n._initialUiState))})},render:function(){t.forEach(function(l){if(l.getRenderState){var d=l.getRenderState(n.renderState[a.getIndexId()]||{},Jn(n,a,l));Bt({renderState:d,instantSearchInstance:n,parent:a})}}),t.forEach(function(l){l.render&&l.render(Jn(n,a,l))})},dispose:function(l){var d,g=r.getHelper(),m=(d=l==null?void 0:l.state)!==null&&d!==void 0?d:g==null?void 0:g.state;return t.forEach(function(v){if(v.dispose&&g){var h=v.dispose({helper:g,state:m,recommendState:g.recommendState,parent:a});xt(h,_e.RecommendParameters)||h&&(m=h)}}),t=[],i=!1,m},getWidgetState:function(l){return this.getWidgetUiState(l)},getWidgetUiState:function(l){var d=r.getHelper(),g={searchParameters:d.state,helper:d};return t.reduce(function(m,v){return v.getWidgetUiState?v.getWidgetUiState(m,g):m},l)},getWidgetSearchParameters:function(l,d){var g=d.uiState;return t.reduce(function(m,v){return v.getWidgetSearchParameters?v.getWidgetSearchParameters(m,{uiState:g}):m},l)},refreshUiState:function(){},setIndexUiState:function(){}};return a}var vr,Zy={name:"AisFeedProvider",props:{feedContainer:{type:Object,required:!0}},provide:function(){var e=this;return{$_ais_getParentIndex:function(){return e.feedContainer}}
74},render:Ot(function(e){var r=Rr(this,"default");return e("div",{},r?r():[])})};Ue(vr={name:"AisFeeds",mixins:[Pe({connector:mv},{$$widgetType:"ais.feeds"}),me({name:"Feeds"})],props:{isolated:{type:Boolean,required:!0},transformFeeds:{type:Function,default:void 0}},data:function(){return{feedContainers:new Map,removalTimer:null,pendingRemovals:new Map}},watch:{state:function(e){e&&this.reconcileContainers(e.feedIDs||[])}}},"beforeUnmount",function(){this.removalTimer!==null&&(clearTimeout(this.removalTimer),this.removalTimer=null);var e=Array.from(new Set(Gn(this.feedContainers.values()).concat(Gn(this.pendingRemovals.values()))));this.pendingRemovals.clear(),this.feedContainers.clear(),e.length>0&&this.getParentIndex().removeWidgets(e)}),Ue(vr,"methods",{reconcileContainers:function(e){var r=this,n=this.getParentIndex(),t=new Set(e),i=[];this.feedContainers.forEach(function(o,l){t.has(l)||(i.push([l,o]),r.feedContainers.delete(l))}),i.length>0&&(i.forEach(function(o){var l=Ky(o,2),d=l[0],g=l[1];r.pendingRemovals.set(d,g)}),this.removalTimer!==null&&clearTimeout(this.removalTimer),this.removalTimer=setTimeout(function(){var o=Array.from(r.pendingRemovals.values());r.pendingRemovals.clear(),r.removalTimer=null,o.length>0&&n.removeWidgets(o)},0));var a=[];e.forEach(function(o){if(!r.feedContainers.has(o)){var l=r.pendingRemovals.get(o);if(l)return r.pendingRemovals.delete(o),void r.feedContainers.set(o,l);var d=Yy(o,n,r.instantSearchInstance);r.feedContainers.set(o,d),a.push(d)}}),a.length>0&&n.addWidgets(a)}}),Ue(vr,"render",Ot(function(e){var r=this;if(!this.state)return e("div",{class:[this.suit()]});var n=this.state.feedIDs||[],t=Rr(this,"default"),i=n.map(function(a){var o=r.feedContainers.get(a);if(!o||!t)return null;var l=t({feedID:a});return e(Zy,{key:a,feedContainer:o,scopedSlots:{default:function(){return l}}},l)});return e("div",{class:[this.suit()]},i)})),Ue(vr,"computed",{widgetParams:function(){return{isolated:this.isolated,transformFeeds:this.transformFeeds}}});Pe({connector:rv},{$$widgetType:"ais.autocomplete"}),me({name:"Autocomplete"});ge("p",null," This widget doesn't render anything without a filled in default slot. ",-1);ge("p",null,"query, function to refine and results are provided.",-1);ge("pre",null,"refine: Function",-1);ge("summary",null,[ge("code",null,"indices"),Nh(":")],-1);function e_(e){return{all:e=e||new Map,on:function(r,n){var t=e.get(r);t&&t.push(n)||e.set(r,[n])},off:function(r,n){var t=e.get(r);t&&t.splice(t.indexOf(n)>>>0,1)},emit:function(r,n){(e.get(r)||[]).slice().map(function(t){t(n)}),(e.get("*")||[]).slice().map(function(t){t(r,n)})}}}var sd="instantSearchPanelEmitter",od="PANEL_CHANGE_EVENT",t_=function(){var e;return e={props:{emitter:{type:Object,required:!1,default:function(){return e_()}}},provide:function(){return Ue({},sd,this.emitter)},data:function(){return{canRefine:!0}},created:function(){var r=this;this.emitter.on(od,function(n){r.updateCanRefine(n)})}},Ue(e,"beforeUnmount",function(){this.emitter.all.clear()}),Ue(e,"methods",{updateCanRefine:function(r){this.canRefine=r}}),e},Ke=function(){var e=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).mapStateToCanRefine,r=e===void 0?function(n){return!!n.canRefine}:e;return{inject:{emitter:{from:sd,default:function(){return{emit:function(){}}}}},data:function(){return{state:null,hasAlreadyEmitted:!1}},watch:{state:{immediate:!0,handler:function(n,t){if(n){var i=r(t||{}),a=r(n);this.hasAlreadyEmitted&&i===a||(this.emitter.emit(od,a),this.hasAlreadyEmitted=!0)}}}}}};Pe({connector:Ym},{$$widgetType:"ais.breadcrumb"}),Ke(),me({name:"Breadcrumb"});Pe({connector:Yg},{$$widgetType:"ais.clearRefinements"}),Ke(),me({name:"ClearRefinements"});me({name:"CurrentRefinements"}),Pe({connector:em},{$$widgetType:"ais.currentRefinements"}),Ke();me({name:"HierarchicalMenu"}),Pe({connector:um},{$$widgetType:"ais.hierarchicalMenu"}),Ke();me({name:"Highlight"});me({name:"HitsPerPage"}),Pe({connector:Rm},{$$widgetType:"ais.hitsPerPage"}),Ke();Pe({connector:Cm},{$$widgetType:"ais.infiniteHits"}),me({name:"InfiniteHits"});me({name:"Menu"}),Pe({connector:Of},{$$widgetType:"ais.menu"}),Ke();me({name:"MenuSelect"}),Pe({connector:Of},{$$widgetType:"ais.menuSelect"}),Ke();Pe({connector:Im},{$$widgetType:"ais.numericMenu"}),me({name:"NumericMenu"}),Ke();me({name:"Pagination"}),Pe({connector:qm},{$$widgetType:"ais.pagination"}),Ke();me({name:"Panel"}),t_();me({name:"PoweredBy"});me({name:"QueryRuleCustomData"}),Pe({connector:Nf},{$$widgetType:"ais.queryRuleCustomData"});me({name:"RangeInput"}),Pe({connector:Mm},{$$widgetType:"ais.rangeInput"}),Ke();me({name:"RatingMenu"}),Pe({connector:Vm},{$$widgetType:"ais.ratingMenu"}),Ke();ge("symbol",{id:"ais-RatingMenu-starSymbol",viewBox:"0 0 24 24"},[ge("path",{d:"M12 .288l2.833 8.718h9.167l-7.417 5.389 2.833 8.718-7.416-5.388-7.417 5.388 2.833-8.718-7.416-5.389h9.167z"})],-1),ge("symbol",{id:"ais-RatingMenu-starEmptySymbol",viewBox:"0 0 24 24"},[ge("path",{d:"M12 6.76l1.379 4.246h4.465l-3.612 2.625 1.379 4.246-3.611-2.625-3.612 2.625 1.379-4.246-3.612-2.625h4.465l1.38-4.246zm0-6.472l-2.833 8.718h-9.167l7.416 5.389-2.833 8.718 7.417-5.388 7.416 5.388-2.833-8.718 7.417-5.389h-9.167l-2.833-8.718z"})],-1);ge("use",{"xlink:href":"#ais-RatingMenu-starSymbol"},null,-1);ge("use",{"xlink:href":"#ais-RatingMenu-starEmptySymbol"},null,-1);var r_={name:"SearchInput",mixins:[me({name:"SearchBox"})],props:{placeholder:{type:String,default:"Search hereâ¦"},autofocus:{type:Boolean,default:!1},showLoadingIndicator:{type:Boolean,default:!1},shouldShowLoadingIndicator:{type:Boolean,default:!1},ignoreCompositionEvents:{type:Boolean,default:!1},submitTitle:{type:String,default:"Search"},resetTitle:{type:String,default:"Clear"},value:{type:String,required:!1,default:void 0},modelValue:{type:String,required:!1,default:void 0}},emits:["input","update:modelValue","blur","focus","reset"],data:function(){return{query:""}},methods:{isFocused:function(){return document.activeElement===this.$refs.input},onInput:function(e){this.ignoreCompositionEvents&&e.isComposing||(this.$emit("input",e.target.value),this.$emit("update:modelValue",e.target.value))},onFormSubmit:function(){this.$refs.input.blur()},onFormReset:function(){this.$emit("input",""),this.$emit("update:modelValue",""),this.$emit("reset")}}},n_=["placeholder","autofocus","value"],i_=["title","hidden"],a_=[ge("path",{d:"M26.804 29.01c-2.832 2.34-6.465 3.746-10.426 3.746C7.333 32.756 0 25.424 0 16.378 0 7.333 7.333 0 16.378 0c9.046 0 16.378 7.333 16.378 16.378 0 3.96-1.406 7.594-3.746 10.426l10.534 10.534c.607.607.61 1.59-.004 2.202-.61.61-1.597.61-2.202.004L26.804 29.01zm-10.426.627c7.323 0 13.26-5.936 13.26-13.26 0-7.32-5.937-13.257-13.26-13.257C9.056 3.12 3.12 9.056 3.12 16.378c0 7.323 5.936 13.26 13.258 13.26z"},null,-1)],s_=["title","hidden"],o_=[ge("path",{d:"M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"},null,-1)],u_=["hidden"],c_=["aria-hidden"],l_=[al('<g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indef
74inite"></animateTransform></path></g></g>',1)];function f_(e,r,n,t,i,a){var o,l;return Me(),We("form",{action:"",role:"search",novalidate:"",class:gt(e.suit("form")),onSubmit:r[4]||(r[4]=no(function(){for(var d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];return a.onFormSubmit&&(o=a).onFormSubmit.apply(o,Gn(g))},["prevent"])),onReset:r[5]||(r[5]=no(function(){for(var d=arguments.length,g=new Array(d),m=0;m<d;m++)g[m]=arguments[m];return a.onFormReset&&(l=a).onFormReset.apply(l,Gn(g))},["prevent"]))},[ge("input",{type:"search",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellcheck:"false",maxlength:"512","aria-label":"Search",placeholder:n.placeholder,autofocus:n.autofocus,class:gt(e.suit("input")),value:n.value||n.modelValue,onFocus:r[0]||(r[0]=function(d){return e.$emit("focus",d)}),onBlur:r[1]||(r[1]=function(d){return e.$emit("blur",d)}),onInput:r[2]||(r[2]=function(d){return a.onInput(d)}),onCompositionend:r[3]||(r[3]=function(d){return a.onInput(d)}),ref:"input"},null,42,n_),ge("button",{type:"submit",title:n.submitTitle,class:gt(e.suit("submit")),hidden:n.showLoadingIndicator&&n.shouldShowLoadingIndicator},[ut(e.$slots,"submit-icon",{},function(){return[(Me(),We("svg",{"aria-hidden":"true",width:"10",height:"10",viewBox:"0 0 40 40",class:gt(e.suit("submitIcon"))},a_,2))]})],10,i_),ge("button",{type:"reset",title:n.resetTitle,class:gt(e.suit("reset")),hidden:!n.value&&!n.modelValue||n.showLoadingIndicator&&n.shouldShowLoadingIndicator},[ut(e.$slots,"reset-icon",{},function(){return[(Me(),We("svg",{"aria-hidden":"true",height:"10",viewBox:"0 0 20 20",class:gt(e.suit("resetIcon")),width:"10"},o_,2))]})],10,s_),n.showLoadingIndicator?(Me(),We("span",{key:0,hidden:!n.shouldShowLoadingIndicator,class:gt(e.suit("loadingIndicator"))},[ut(e.$slots,"loading-indicator",{},function(){return[(Me(),We("svg",{"aria-hidden":!n.shouldShowLoadingIndicator,"aria-label":"Results are loading",width:"16",height:"16",stroke:"#444",viewBox:"0 0 38 38",class:gt(e.suit("loadingIcon"))},l_,10,c_))]})],10,u_)):et("",!0)],34)}const d_={...r_,render:f_};me({name:"RefinementList"}),Pe({connector:Um},{$$widgetType:"ais.refinementList"}),Ke();var Wn,h_=(Ue(Wn={name:"AisStateResults",mixins:[Pe({connector:!0}),me({name:"StateResults"})],props:{catchError:{type:Boolean,default:!1}},data:function(){var e=this;return{renderFn:function(){var r=e.instantSearchInstance,n=r.status,t=r.error,i=e.getParentIndex().getResults(),a=e.getParentIndex().getHelper(),o=a?a.state:null;e.state={results:i,state:o,status:n,error:t}}}},created:function(){this.instantSearchInstance.addListener("render",this.renderFn),this.renderFn()}},"beforeUnmount",function(){this.widget&&(this.instantSearchInstance.removeListener("render",this.renderFn),this.errorFn&&this.instantSearchInstance.removeListener("error",this.errorFn))}),Ue(Wn,"watch",{catchError:{immediate:!0,handler:function(e){e?(this.errorFn=function(){},this.instantSearchInstance.addListener("error",this.errorFn)):this.errorFn&&(this.instantSearchInstance.removeListener("error",this.errorFn),this.errorFn=void 0)}}}),Ue(Wn,"computed",{stateResults:function(){var e=this.state,r=e.results,n=e.state,t=e.status,i=e.error;return Sr({},r,{results:r,state:n,status:t,error:i})}}),Wn);ge("p",null," Use this component to have a different layout based on a certain state. ",-1);ge("p",null,"Fill in the slot, and get access to the following things:",-1);({...h_});var p_={name:"AisSearchBox",mixins:[Pe({connector:km},{$$widgetType:"ais.searchBox"}),me({name:"SearchBox"})],components:{SearchInput:d_},props:{placeholder:{type:String,default:""},autofocus:{type:Boolean,default:!1},showLoadingIndicator:{type:Boolean,default:!0},ignoreCompositionEvents:{type:Boolean,default:!1},submitTitle:{type:String,default:"Submit the search query"},resetTitle:{type:String,default:"Clear the search query"},value:{type:String,default:void 0},modelValue:{type:String,default:void 0},queryHook:{type:Function,default:void 0}},data:function(){return{localValue:"",isVue2:_v,isVue3:Rv}},computed:{widgetParams:function(){return{queryHook:this.queryHook}},isControlled:function(){return this.value!==void 0||this.modelValue!==void 0},model:function(){return this.value||this.modelValue},currentRefinement:{get:function(){this.isControlled&&this.model!==this.localValue&&(this.localValue=this.model,this.$emit("input",this.model),this.$emit("update:modelValue",this.model),this.state.refine(this.model));var e=this.$refs.searchInput;return e&&e.isFocused()?this.localValue:this.model||this.state.query||""},set:function(e){this.localValue=e,this.state.refine(e),this.isControlled&&(this.$emit("input",e),this.$emit("update:modelValue",e))}}}};function g_(e,r,n,t,i,a){var o=Hh("search-input");return e.state?(Me(),We("div",{key:0,class:gt(e.suit())},[ut(e.$slots,"default",{currentRefinement:a.currentRefinement,isSearchStalled:e.state.isSearchStalled,refine:e.state.refine},function(){return[Ve(o,{onFocus:r[0]||(r[0]=function(l){return e.$emit("focus",l)}),onBlur:r[1]||(r[1]=function(l){return e.$emit("blur",l)}),onReset:r[2]||(r[2]=function(l){return e.$emit("reset")}),placeholder:n.placeholder,autofocus:n.autofocus,"show-loading-indicator":n.showLoadingIndicator,"should-show-loading-indicator":e.state.isSearchStalled,"ignore-composition-events":n.ignoreCompositionEvents,"submit-title":n.submitTitle,"reset-title":n.resetTitle,"class-names":e.classNames,modelValue:a.currentRefinement,"onUpdate:modelValue":r[3]||(r[3]=function(l){return a.currentRefinement=l}),ref:"searchInput"},qh({default:Xe(function(){return[i.isVue2?ut(e.$slots,"loading-indicator",{key:0,slot:"loading-indicator"}):et("",!0),i.isVue2?ut(e.$slots,"submit-icon",{key:1,slot:"submit-icon"}):et("",!0),i.isVue2?ut(e.$slots,"reset-icon",{key:2,slot:"reset-icon"}):et("",!0)]}),_:2},[i.isVue3?{name:"loading-indicator",fn:Xe(function(){return[ut(e.$slots,"loading-indicator")]}),key:"0"}:void 0,i.isVue3?{name:"submit-icon",fn:Xe(function(){return[ut(e.$slots,"submit-icon")]}),key:"1"}:void 0,i.isVue3?{name:"reset-icon",fn:Xe(function(){return[ut(e.$slots,"reset-icon")]}),key:"2"}:void 0]),1032,["placeholder","autofocus","show-loading-indicator","should-show-loading-indicator","
74ignore-composition-events","submit-title","reset-title","class-names","modelValue"])]})],2)):et("",!0)}const m_={...p_,render:g_};me({name:"Snippet"});me({name:"SortBy"}),Pe({connector:Bm},{$$widgetType:"ais.sortBy"}),Ke();Pe({connector:Jm},{$$widgetType:"ais.stats"}),me({name:"Stats"});me({name:"ToggleRefinement"}),Pe({connector:Xm},{$$widgetType:"ais.toggleRefinement"}),Ke();Pe({connector:cv},{$$widgetType:"ais.voiceSearch"}),me({name:"VoiceSearch"});al('<line x1="1" y1="1" x2="23" y2="23"></line><path d="M9 9v3a3 3 0 0 0 5.12 2.12M15 9.34V4a3 3 0 0 0-5.94-.6"></path><path d="M17 16.95A7 7 0 0 1 5 12v-2m14 0v2a7 7 0 0 1-.11 1.23"></path><line x1="12" y1="19" x2="12" y2="23"></line><line x1="8" y1="23" x2="16" y2="23"></line>',5);ge("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"},null,-1);ge("line",{x1:"12",y1:"19",x2:"12",y2:"23"},null,-1);ge("line",{x1:"8",y1:"23",x2:"16",y2:"23"},null,-1);me({name:"RelevantSort"}),Pe({connector:lv},{$$widgetType:"ais.relevantSort"});const v_=[{key:"countries",collection:"countries",displayName:"Countries",sortBy:"_text_match:desc"},{key:"events_upcoming",collection:"events",displayName:"Upcoming Events",sortBy:"started_at:asc",eventWindow:"upcoming"},{key:"scholarships",collection:"scholarships",displayName:"Scholarships",sortBy:"_text_match:desc"},{key:"articles",collection:"articles",displayName:"Articles",sortBy:"published_at:desc"},{key:"pages",collection:"pages",displayName:"Pages",sortBy:"hierarchy_level:asc,_text_match:desc"},{key:"petitions",collection:"petitions",displayName:"Petitions",sortBy:"_text_match:desc"},{key:"fellows",collection:"fellows",displayName:"Fellows",sortBy:"_text_match:desc"},{key:"photo_books",collection:"photo_books",displayName:"Photo Books",sortBy:"published_at:desc"},{key:"events_past",collection:"events",displayName:"Past Events",sortBy:"started_at:desc",eventWindow:"past"}],y_={class:"relative mb-8"},__={key:0,class:"mb-8"},R_={class:"[&_mark]:bg-primary/20 [&_mark]:text-primary grid gap-6 [&_mark]:font-semibold",role:"list"},S_={class:"grid grid-cols-1 gap-3 md:grid-cols-3 md:gap-6"},b_={class:"order-2 md:order-1 md:col-span-2"},w_=["innerHTML"],P_={class:"my-6 line-clamp-4 font-sans text-lg leading-5 tracking-normal lg:text-xl lg:leading-7"},E_={class:"font-title text-lg leading-none font-bold tracking-wide lg:text-xl"},x_=["datetime"],C_={key:0,class:"order-1 md:order-2 md:col-span-1"},F_={class:"aspect-video border"},O_=["srcset","src","alt"],A_={key:0,class:"text-gray-500"},I_=10,aR=Dh({__name:"Search",setup(e){const r=Math.floor(Date.now()/1e3),n=[{name:"search_tags",weight:5},{name:"title",weight:3},{name:"body",weight:1}],t={upcoming:p=>`ended_at:>=${p}`,past:p=>`ended_at:<${p}`},i=v_.map((p,c)=>({key:p.key,collection:p.collection,displayName:p.displayName,displayOrder:c+1,searchFields:n,sortBy:p.sortBy,filterBy:p.eventWindow?t[p.eventWindow]:void 0,resultRef:Lr([])})),a=p=>p.sortBy?`${p.collection}/sort/${p.sortBy}`:p.collection,o=p=>{const c={hitsPerPage:p.hitsPerPage??I_};return p.filterBy&&(c.filters=p.filterBy(r)),c},l=$r(()=>i[0]),d=$r(()=>i.filter(p=>{var c;return p.key!==((c=l.value)==null?void 0:c.key)})),g=p=>p.map(c=>c.name).join(","),m=p=>p.map(c=>c.weight||1).join(","),v=Lr(null),h=Lr(null);Mh(h,p=>{var c;(c=p==null?void 0:p.$el)==null||c.focus()},{once:!0}),Uh(()=>{const p=i.reduce((y,R)=>(y[R.collection]={query_by:g(R.searchFields),query_by_weights:m(R.searchFields)},y),{}),c=new rg({server:{apiKey:"pgC3PZG0dgoyeHPeH5SZCpzz5WLwis4s",nodes:[{host:"search.reporter-ohne-grenzen.de",port:parseInt("443"),protocol:"https"}],cacheSearchResultsForSeconds:120},additionalSearchParameters:{query_by:g(i[0].searchFields),query_by_weights:m(i[0].searchFields)},collectionSpecificSearchParameters:p});v.value=c.searchClient});const u=Lr(""),s=$r(()=>[...i].sort((p,c)=>p.displayOrder-c.displayOrder)),f=$r(()=>i.reduce((p,c)=>p+c.resultRef.value.length,0));return(p,c)=>(Me(),We(Lt,null,[Ve(Ze(Lh),{title:p.$t("Search")},null,8,["title"]),Ve(Ih,null,{default:Xe(()=>[Ve(Ch,{class:"mt-12 min-h-screen"},{default:Xe(()=>[Ve(Ri,{title:p.$t("Search")},null,8,["title"]),v.value?(Me(),bi(Ze(ky),{key:0,"search-client":v.value,"index-name":a(l.value),future:{preserveSharedStateOnUnmount:!0}},{default:Xe(()=>[ge("div",null,[Ve(Ze(m_),null,{default:Xe(({currentRefinement:y,refine:R})=>[ge("div",y_,[Ve(Ze(Ah),{class:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2"}),Ve(Oh,{ref_key:"searchInputRef",ref:h,"model-value":y,onInput:b=>{const w=b.target.value;u.value=w,R(w)},placeholder:p.$t("Search..."),class:"pr-10 pl-10"},null,8,["model-value","onInput","placeholder"]),y?(Me(),bi(Fh,{key:0,variant:"ghost",size:"icon",class:"absolute top-1/2 right-1 h-7 w-7 -translate-y-1/2",onClick:()=>{u.value="",R("")}},{default:Xe(()=>[Ve(Ze(Vh),{class:"h-4 w-4"})]),_:1},8,["onClick"])):et("",!0)])]),_:1}),u.value.trim()?(Me(),We(Lt,{key:0},[Ve(Ze($c),$h(Wh(o(l.value))),null,16),Ve(Ze(Wc),{class:"hidden"},{default:Xe(({items:y})=>[ge("div",null,Zt(l.value.resultRef.value=y),1)]),_:1}),Ve(Ri,{variant:"h2",title:p.$t(":count results for ':query'",{count:String(f.value),query:u.value})},null,8,["title"]),(Me(!0),We(Lt,null,wi(d.value,y=>(Me(),bi(Ze(Dv),{key:y.key,"index-name":a(y),"index-id":y.key,class:"hidden"},{default:Xe(()=>[Ve(Ze($c),kh({ref_for:!0},o(y)),null,16),Ve(Ze(Wc),null,{default:Xe(({items:R})=>[ge("div",null,Zt(y.resultRef.value=R),1)]),_:2},1024)]),_:2},1032,["index-name","index-id"]))),128)),(Me(!0),We(Lt,null,wi(s.value,y=>(Me(),We(Lt,{key:y.key},[y.resultRef.value.length>0?(Me(),We("div",__,[Ve(Ri,{variant:"h3",class:"md:text-md text-sm",title:p.$t(y.displayName)},null,8,["title"]),ge("ul",R_,[(Me(!0),We(Lt,null,wi(y.resultRef.value,R=>(Me(),We("li",{key:R.objectID},[Ve(Ze(Bh),{class:"group border-gray-150 focus:outline-blue-550 block overflow-hidden border-b pb-6",href:R.url},{default:Xe(()=>{var b,w;return[ge("div",S_,[ge("div",b_,[ge("div",null,[ge("h2",{class:"group-hover:text-primary font-title text-xl leading-none font-bold tracking-normal lg:text-3xl",innerHTML:((w=(b=R._highlightResult)==null?void 0:b.title)==null?void 0:w.value)||R.title},null,8,w_)]),ge("p",P_,Zt(R.excerpt),1),ge("div",E_,[R.published_at?(Me(),We("time",{key:0,datetime:new Date(R.published_at*1e3).toISOString()},Zt(Ze(Qh)(new Date(R.published_at*1e3),"DD.MM.YYYY")),9,x_)):et("",!0)])]),R.preview_image&&R.preview_image.srcset?(Me(),We("div",C_,[ge("div",F_,[ge("picture",null,[ge("img",{class:"block h-full w-full object-cover",srcset:R.preview_image.srcset,src:R.preview_image.src,loading:"lazy",decoding:"async",alt:R.preview_image.alt_text||R.title},null,8,O_)])])])):et("",!0)])]}),_:2},1032,["href"])]))),128))])])):et("",!0)],64))),128)),s.value.some(y=>y.resultRef.value.length>0)?et("",!0):(Me(),We("p",A_,Zt(p.$t("No search results found.")),1))],64)):et("",!0)])]),_:1}
74,8,["search-client","index-name"])):et("",!0)]),_:1})]),_:1})],64))}});export{aR as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.