react-instantsearch-core 6.34.0 → 6.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- /*! React InstantSearchCore 6.34.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactInstantSearchCore={},e.React)}(this,function(e,s){"use strict";var c="default"in s?s.default:s;function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m="undefined"!=typeof Element,g="function"==typeof Map,v="function"==typeof Set,y="function"==typeof ArrayBuffer;var x=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,a,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(g&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1;for(s=t.entries();!(i=s.next()).done;)if(!e(i.value[1],n.get(i.value[0])))return!1;return!0}if(v&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1;return!0}if(y&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;if(m&&t instanceof Element)return!1;for(i=r;0!=i--;)if(!("_owner"===a[i]&&t.$$typeof||e(t[a[i]],n[a[i]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}};function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var R=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,a=0;a<n.length;a++)if(!i.call(t,n[a])||e[n[a]]!==t[n[a]])return!1;return!0},P=function(e){return e.displayName||e.name||"UnknownComponent"},t=Promise.resolve(),S=function(e){t.then(e)},j=function r(i){return Object.keys(i).forEach(function(e){var t,n=i[e];"object"!==o(t=n)||null===t||Array.isArray(t)||(I(n)?r(n):delete i[e])}),i};function C(e,n,r){return e.map(function(e,t){return b(b({},e),{},{__position:n*r+t+1})})}function w(e,t){return t?e.map(function(e){return b(b({},e),{},{__queryID:t})}):e}function V(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function I(e){return e&&0<Object.keys(e).length}function _(e,t){if(null==e)return{};for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];0<=t.indexOf(a)||(n[a]=e[a])}return n}var E=function(e,t){return(Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".")).reduce(function(e,t){return e?e[t]:void 0},e)};function A(e){return e.replace(/^\\-/,"-")}var N=s.createContext({onInternalStateUpdate:function(){},createHrefForState:function(){return"#"},onSearchForFacetValues:function(){},onSearchStateChange:function(){},onSearchParameters:function(){},store:{},widgetsManager:{},mainTargetedIndex:""}),D=N.Consumer,T=N.Provider,H=s.createContext(void 0),k=H.Consumer,M=H.Provider,$=["contextValue"];function Q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function L(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}var q=function(n){return function(e,t){var r=function(l){if(!l.displayName)throw new Error("`createConnector` requires you to provide a `displayName` property.");var r="function"==typeof l.getSearchParameters||"function"==typeof l.getMetadata||"function"==typeof l.transitionState;return function(a){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=function(e){p(n,s.Component);var t=L(n);function n(e){var i;return f(this,n),O(d(i=t.call(this,e)),"unsubscribe",void 0),O(d(i),"unregisterWidget",void 0),O(d(i),"isUnmounting",!1),O(d(i),"state",{providedProps:i.getProvidedProps(i.props)}),O(d(i),"refine",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onInternalStateUpdate((e=l.refine).call.apply(e,[d(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),O(d(i),"createURL",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i.props.contextValue.createHrefForState((e=l.refine).call.apply(e,[d(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),O(d(i),"searchForFacetValues",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onSearchForFacetValues((e=l.searchForFacetValues).call.apply(e,[d(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),l.getSearchParameters&&i.props.contextValue.onSearchParameters(l.getSearchParameters.bind(d(i)),{ais:i.props.contextValue,multiIndexContext:i.props.indexContextValue},i.props,l.getMetadata&&l.getMetadata.bind(d(i)),l.displayName),i}return h(n,[{key:"componentDidMount",value:function(){var e=this;this.unsubscribe=this.props.contextValue.store.subscribe(function(){e.isUnmounting||e.setState({providedProps:e.getProvidedProps(e.props)})}),r&&(this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this))}},{key:"shouldComponentUpdate",value:function(e,t){if("function"==typeof l.shouldComponentUpdate)return l.shouldComponentUpdate.call(this,this.props,e,this.state,t);var n=R(this.props,e);return null===this.state.providedProps||null===t.providedProps?this.state.providedProps!==t.providedProps||!n:!n||!R(this.state.providedProps,t.providedProps)}},{key:"componentDidUpdate",value:function(e){x(e,this.props)||(this.setState({providedProps:this.getProvidedProps(this.props)}),r&&(this.props.contextValue.widgetsManager.update(),"function"==typeof l.transitionState&&this.props.contextValue.onSearchStateChange(l.transitionState.call(this,this.props,this.props.contextValue.store.getState().widgets,this.props.contextValue.store.getState().widgets))))}},{key:"componentWillUnmount",value:function(){if(this.isUnmounting=!0,this.unsubscribe&&this.unsubscribe(),this.unregisterWidget&&(this.unregisterWidget(),"function"==typeof l.cleanUp)){var e=l.cleanUp.call(this,this.props,this.props.contextValue.store.getState().widgets);this.props.contextValue.store.setState(B(B({},this.props.contextValue.store.getState()),{},{widgets:e})),this.props.contextValue.onSearchStateChange(j(e))}}},{key:"getProvidedProps",value:function(e){var t=this.props.contextValue.store.getState(),n=t.widgets,r=t.results,i=t.resultsFacetValues,a=t.searching,s=t.searchingForFacetValues,o=t.isSearchStalled,c=t.metadata,u={results:r,searching:a,searchingForFacetValues:s,isSearchStalled:o,error:t.error};return l.getProvidedProps.call(this,e,n,u,c,i)}},{key:"getSearchParameters",value:function(e){return"function"==typeof l.getSearchParameters?l.getSearchParameters.call(this,e,this.props,this.props.contextValue.store.getState().widgets):null}},{key:"getMetadata",value:function(e){return"function"==typeof l.getMetadata?l.getMetadata.call(this,this.props,e):{}}},{key:"transitionState",value:function(e,t){return"function"==typeof l.transitionState?l.transitionState.call(this,this.props,e,t):t}},{key:"render",value:function(){var e=this.props,t=(e.contextValue,F(e,$)),n=this.state.providedProps;if(null===n)return null;var r="function"==typeof l.refine?{refine:this.refine,createURL:this.createURL}:{},i="function"==typeof l.searchForFacetValues?{searchForItems:this.searchForFacetValues}:{};return c.createElement(a,u({},t,n,r,i))}}]),n}();return O(t,"displayName","".concat(l.displayName,"(").concat(P(a),")")),O(t,"$$type",l.$$type),O(t,"$$widgetType",e.$$widgetType),O(t,"defaultProps",l.defaultProps),O(t,"_connectorDesc",l),t}}(n)(e,t);return function(n){return c.createElement(D,null,function(t){return c.createElement(k,null,function(e){return c.createElement(r,u({contextValue:t,indexContextValue:e},n))})})}}},U={highlightPreTag:"<ais-highlight-0000000000>",highlightPostTag:"</ais-highlight-0000000000>"};function W(e){var t=e.preTag,n=e.postTag,r=e.highlightedValue,i=(void 0===r?"":r).split(t),a=i.shift(),s=""===a?[]:[{value:a,isHighlighted:!1}];if(n===t){var o=!0;i.forEach(function(e){s.push({value:e,isHighlighted:o}),o=!o})}else i.forEach(function(e){var t=e.split(n);s.push({value:t[0],isHighlighted:!0}),""!==t[1]&&s.push({value:t[1],isHighlighted:!1})});return s}var z="6.34.0";function J(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function K(e){return Z(e)?e.multiIndexContext.targetedIndex:e.ais.mainTargetedIndex}function X(e,t){if(e.results){if(e.results.hits)return e.results;var n=K(t);if(e.results[n])return e.results[n]}return null}function Z(e){return e&&e.multiIndexContext}function ee(t,e,n,r,i){if(Z(n)){var a=K(n);return i?(y=e,x=a,b=i,P=r?{page:1}:void 0,F=(v=t).indices&&v.indices[x]?G(G({},v.indices),{},O({},x,G(G({},v.indices[x]),{},(O(R={},b,G(G({},v.indices[x][b]),y)),O(R,"page",1),R)))):G(G({},v.indices),{},O({},x,G(O({},b,y),P))),G(G({},v),{},{indices:F})):(d=e,p=a,m=r?{page:1}:void 0,g=(h=t).indices&&h.indices[p]?G(G({},h.indices),{},O({},p,G(G(G({},h.indices[p]),d),m))):G(G({},h.indices),{},O({},p,G(G({},d),m))),G(G({},h),{},{indices:g}))}return t.indices&&r&&Object.keys(t.indices).forEach(function(e){t=ee(t,{page:1},{multiIndexContext:{targetedIndex:e}},!0,i)}),i?(u=e,l=i,f=r?{page:1}:void 0,G(G({},c=t),{},O({},l,G(G({},c[l]),u)),f)):(s=e,o=r?{page:1}:void 0,G(G(G({},t),s),o));var s,o,c,u,l,f,h,d,p,m,g,v,y,x,b,R,P,F}function te(e){var t=e.match(/^([^.]*)\.(.*)/);return{namespace:t&&t[1],attributeName:t&&t[2]}}function ne(e,t,n,r,i){var a,s,o,c,u,l,f,h,d,p,m,g,v,y,x=K(n),b=te(r),R=b.namespace,P=b.attributeName,F={multiIndex:Z(n),indexId:x,namespace:R,attributeName:P,id:r,searchState:t};return(s=(a=F).multiIndex,o=a.indexId,c=a.namespace,u=a.attributeName,l=a.id,f=a.searchState,s&&c?f.indices&&f.indices[o]&&f.indices[o][c]&&Object.hasOwnProperty.call(f.indices[o][c],u):s?f.indices&&f.indices[o]&&Object.hasOwnProperty.call(f.indices[o],l):c?f[c]&&Object.hasOwnProperty.call(f[c],u):Object.hasOwnProperty.call(f,l))?(d=(h=F).multiIndex,p=h.indexId,m=h.namespace,g=h.attributeName,v=h.id,y=h.searchState,d&&m?y.indices[p][m][g]:d?y.indices[p][v]:m?y[m][g]:y[v]):e.defaultRefinement?e.defaultRefinement:i}function re(e,t,n){var r=K(t),i=te(n),a=i.namespace,s=i.attributeName;return Z(t)&&Boolean(e.indices)?function(e){var t=e.searchState,n=e.indexId,r=e.id,i=e.namespace,a=e.attribute,s=t.indices[n];if(i&&s)return G(G({},t),{},{indices:G(G({},t.indices),{},O({},n,G(G({},s),{},O({},i,_(s[i],[a])))))});if(s)return G(G({},t),{},{indices:G(G({},t.indices),{},O({},n,_(s,[r])))});return t}({attribute:s,searchState:e,indexId:r,id:n,namespace:a}):function(e){var t=e.searchState,n=e.id,r=e.namespace,i=e.attribute;if(r)return G(G({},t),{},O({},r,_(t[r],[i])));return _(t,[n])}({attribute:s,searchState:e,id:n,namespace:a})}var ie=["children","contextValue","indexContextValue"],ae=["children","contextValue","indexContextValue"];function se(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?se(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var ce=q({displayName:"AlgoliaConfigure",$$type:"ais.configure",getProvidedProps:function(){return{}},getSearchParameters:function(e,t){t.children,t.contextValue,t.indexContextValue;var n=F(t,ie);return e.setQueryParameters(n)},transitionState:function(e,t,n){var r="configure",i=(e.children,e.contextValue,e.indexContextValue,F(e,ae)),a=Object.keys(e),s=this._props?Object.keys(this._props).filter(function(e){return-1===a.indexOf(e)}):[];return this._props=e,ee(n,O({},r,oe(oe({},_(n[r],s)),i)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(n,e){var r="configure",t=K({ais:n.contextValue,multiIndexContext:n.indexContextValue}),i=Z({ais:n.contextValue,multiIndexContext:n.indexContextValue})&&e.indices?e.indices[t]:e,a=(i&&i[r]?Object.keys(i[r]):[]).reduce(function(e,t){return n[t]||(e[t]=i[r][t]),e},{});return ee(e,O({},r,a),{ais:n.contextValue,multiIndexContext:n.indexContextValue})}}),ue=ce(function(){return null},{$$widgetType:"ais.configure"});function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fe(e,t){if(e){if("string"==typeof e)return le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}function he(e){return function(e){if(Array.isArray(e))return le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function pe(e,t){if(e===t)return e;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&"__proto__"!==n){var r=t[n],i=e[n];void 0!==i&&void 0===r||(de(i)&&de(r)?e[n]=pe(i,r):e[n]="object"==typeof(a=r)&&null!==a?pe(Array.isArray(a)?[]:{},a):a)}var a;return e}var me=function(e){de(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];de(r)&&pe(e,r)}return e},ge=function(){return Array.prototype.slice.call(arguments).reduceRight(function(t,n){return Object.keys(Object(n)).forEach(function(e){void 0!==n[e]&&(void 0!==t[e]&&delete t[e],t[e]=n[e])}),t},{})};var ve=function(n,r){return n.filter(function(e,t){return-1<r.indexOf(e)&&n.indexOf(e)===t})},ye=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]};var xe=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")};var be=function(e,t){if(null===e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i};var Re=function(e){return e&&0<Object.keys(e).length},Pe=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)},Fe={addRefinement:function(e,t,n){if(Fe.isRefined(e,t,n))return e;var r=""+n,i=e[t]?e[t].concat(r):[r],a={};return a[t]=i,ge({},a,e)},removeRefinement:function(e,n,t){if(void 0===t)return Fe.clearRefinement(e,function(e,t){return n===t});var r=""+t;return Fe.clearRefinement(e,function(e,t){return n===t&&r===e})},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return Fe.isRefined(e,t,n)?Fe.removeRefinement(e,t,n):Fe.addRefinement(e,t,n)},clearRefinement:function(i,a,s){if(void 0===a)return Re(i)?{}:i;if("string"==typeof a)return be(i,[a]);if("function"==typeof a){var o=!1,e=Object.keys(i).reduce(function(e,t){var n=i[t]||[],r=n.filter(function(e){return!a(e,t,s)});return r.length!==n.length&&(o=!0),e[t]=r,e},{});return o?e:i}},isRefined:function(e,t,n){var r=!!e[t]&&0<e[t].length;if(void 0===n||!r)return r;var i=""+n;return-1!==e[t].indexOf(i)}},Oe=Fe;function Se(e,n){return Array.isArray(e)&&Array.isArray(n)?e.length===n.length&&e.every(function(e,t){return Se(n[t],e)}):e===n}function je(e){var r=e?je._parseNumbers(e):{};void 0===r.userToken||Pe(r.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=r.facets||[],this.disjunctiveFacets=r.disjunctiveFacets||[],this.hierarchicalFacets=r.hierarchicalFacets||[],this.facetsRefinements=r.facetsRefinements||{},this.facetsExcludes=r.facetsExcludes||{},this.disjunctiveFacetsRefinements=r.disjunctiveFacetsRefinements||{},this.numericRefinements=r.numericRefinements||{},this.tagRefinements=r.tagRefinements||[],this.hierarchicalFacetsRefinements=r.hierarchicalFacetsRefinements||{};var i=this;Object.keys(r).forEach(function(e){var t=-1!==je.PARAMETERS.indexOf(e),n=void 0!==r[e];!t&&n&&(i[e]=r[e])})}je.PARAMETERS=Object.keys(new je),je._parseNumbers=function(i){if(i instanceof je)return i;var r={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(e){var t=i[e];if("string"==typeof t){var n=parseFloat(t);r[e]=isNaN(n)?t:n}}),Array.isArray(i.insideBoundingBox)&&(r.insideBoundingBox=i.insideBoundingBox.map(function(e){return Array.isArray(e)?e.map(function(e){return parseFloat(e)}):e})),i.numericRefinements){var a={};Object.keys(i.numericRefinements).forEach(function(n){var r=i.numericRefinements[n]||{};a[n]={},Object.keys(r).forEach(function(e){var t=r[e].map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});a[n][e]=t})}),r.numericRefinements=a}return me({},i,r)},je.make=function(e){var n=new je(e);return(e.hierarchicalFacets||[]).forEach(function(e){if(e.rootPath){var t=n.getHierarchicalRefinement(e.name);0<t.length&&0!==t[0].indexOf(e.rootPath)&&(n=n.clearRefinements(e.name)),0===(t=n.getHierarchicalRefinement(e.name)).length&&(n=n.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),n},je.validate=function(e,t){var n=t||{};return e.tagFilters&&n.tagRefinements&&0<n.tagRefinements.length?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."):0<e.tagRefinements.length&&n.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."):e.numericFilters&&n.numericRefinements&&Re(n.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."):Re(e.numericRefinements)&&n.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},je.prototype={constructor:je,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:Oe.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:Oe.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:Oe.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:Oe.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r=xe(n);if(this.isNumericRefined(e,t,r))return this;var i=me({},this.numericRefinements);return i[e]=me({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(r)):i[e][t]=[r],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(n,r,i){return void 0!==i?this.isNumericRefined(n,r,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r&&Se(e.val,xe(i))})}):this:void 0!==r?this.isNumericRefined(n,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r})}):this:this.isNumericRefined(n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(s){if(void 0===s)return Re(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof s)return be(this.numericRefinements,[s]);if("function"==typeof s){var o=!1,t=this.numericRefinements,e=Object.keys(t).reduce(function(e,r){var i=t[r],a={};return i=i||{},Object.keys(i).forEach(function(t){var e=i[t]||[],n=[];e.forEach(function(e){s({val:e,op:t},r,"numeric")||n.push(e)}),n.length!==e.length&&(o=!0),a[t]=n}),e[r]=a,e},{});return o?e:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:Oe.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:Oe.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Oe.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:Oe.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(t){return this.isConjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({facets:this.facets.filter(function(e){return e!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(e){return e!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(e){return e.name!==t})}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:Oe.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:Oe.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Oe.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:Oe.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(t){if(!this.isTagRefined(t))return this;var e={tagRefinements:this.tagRefinements.filter(function(e){return e!==t})};return this.setQueryParameters(e)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:Oe.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:Oe.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:Oe.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={};return void 0!==this.hierarchicalFacetsRefinements[e]&&0<this.hierarchicalFacetsRefinements[e].length&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:ge({},r,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var n={};return n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:ge({},n,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:ge({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return-1<this.disjunctiveFacets.indexOf(e)},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return-1<this.facets.indexOf(e)},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&Oe.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&Oe.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&Oe.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var n=this.getHierarchicalRefinement(e);return t?-1!==n.indexOf(t):0<n.length},isNumericRefined:function(e,t,n){if(void 0===n&&void 0===t)return!!this.numericRefinements[e];var r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===n||!r)return r;var i,a,s=xe(n),o=void 0!==(i=this.numericRefinements[e][t],a=s,ye(i,function(e){return Se(e,a)}));return r&&o},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var t=this,e=ve(Object.keys(this.numericRefinements).filter(function(e){return 0<Object.keys(t.numericRefinements[e]).length}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(e){return 0<t.disjunctiveFacetsRefinements[e].length}).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var t=this;return ve(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(e){return 0<t.hierarchicalFacetsRefinements[e].length}))},getUnrefinedDisjunctiveFacets:function(){var t=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(e){return-1===t.indexOf(e)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var n=this.managedParameters,r={},i=this;return Object.keys(this).forEach(function(e){var t=i[e];-1===n.indexOf(e)&&void 0!==t&&(r[e]=t)}),r},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){if(!e)return this;var t=je.validate(this,e);if(t)throw t;var n=this,i=je._parseNumbers(e),r=Object.keys(this).reduce(function(e,t){return e[t]=n[t],e},{}),a=Object.keys(i).reduce(function(e,t){var n=void 0!==e[t],r=void 0!==i[t];return n&&!r?be(e,[t]):(r&&(e[t]=i[t]),e)},r);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(t){return ye(this.hierarchicalFacets,function(e){return e.name===t})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(n).map(function(e){return e.trim()})},toString:function(){return JSON.stringify(this,null,2)}};var Ce=je;function we(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&t<e||r&&i||!n)return 1;if(!r&&e<t||a&&n||!i)return-1}return 0}var Ve=function(e,n,i){if(!Array.isArray(e))return[];Array.isArray(i)||(i=[]);var t=e.map(function(t,e){return{criteria:n.map(function(e){return t[e]}),index:e,value:t}});return t.sort(function(e,t){for(var n=-1;++n<e.criteria.length;){var r=we(e.criteria[n],t.criteria[n]);if(r)return n>=i.length?r:"desc"===i[n]?-r:r}return e.index-t.index}),t.map(function(e){return e.value})},Ie=function(e){return Array.isArray(e)?e.filter(Boolean):[]},_e=function(e,t){if(!Array.isArray(e))return-1;for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},Ee=function(e,t){var i=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var n=t.split(":"),r=ye(i,function(e){return e[0]===n[0]});return 1<n.length||!r?(e[0].push(n[0]),e[1].push(n[1])):(e[0].push(r[0]),e[1].push(r[1])),e},[[],[]])};var Ae=function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},Ne=function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")},De=function(g){return function(e,t){var a,l,f,h,d,n=g.hierarchicalFacets[t],r=g.hierarchicalFacetsRefinements[n.name]&&g.hierarchicalFacetsRefinements[n.name][0]||"",i=g._getHierarchicalFacetSeparator(n),s=g._getHierarchicalRootPath(n),o=g._getHierarchicalShowParentLevel(n),c=Ee(g._getHierarchicalFacetSortBy(n)),u=e.every(function(e){return e.exhaustive}),p=(a=c,l=i,f=s,h=o,d=r,function(e,u,t){var c=e;if(0<t){var n=0;for(c=e;n<t;){var r=c&&Array.isArray(c.data)?c.data:[];c=ye(r,function(e){return e.isRefined}),n++}}if(c){var i=Object.keys(u.data).map(function(e){return[e,u.data[e]]}).filter(function(e){var t,n,r,i,a,s,o=e[0];return t=o,n=c.path||f,r=d,i=l,s=h,(!(a=f)||0===t.indexOf(a)&&a!==t)&&(!a&&-1===t.indexOf(i)||a&&t.split(i).length-a.split(i).length==1||-1===t.indexOf(i)&&-1===r.indexOf(i)||0===r.indexOf(t)||0===t.indexOf(n+i)&&(s||0===t.indexOf(r)))});c.data=Ve(i.map(function(e){var t,n,r,i,a,s,o=e[0],c=e[1];return t=c,n=o,r=l,i=He(d),a=u.exhaustive,{name:(s=n.split(r))[s.length-1].trim(),path:n,escapedValue:Te(n),count:t,isRefined:i===n||0===i.indexOf(n+r),exhaustive:a,data:null}}),a[0],a[1])}return e}),m=e;return s&&(m=e.slice(s.split(i).length)),m.reduce(p,{name:g.hierarchicalFacets[t].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:u,data:null})}},Te=Ae,He=Ne;var ke=Ae,Me=Ne;function $e(e){var n={};return e.forEach(function(e,t){n[e]=t}),n}function Qe(e,t,n){t&&t[n]&&(e.stats=t[n])}function Be(l,t,n){var f=t[0];this._rawResults=t;var h=this;Object.keys(f).forEach(function(e){h[e]=f[e]}),Object.keys(n||{}).forEach(function(e){h[e]=n[e]}),this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=l.hierarchicalFacets.map(function(){return[]}),this.facets=[];var e=l.getRefinedDisjunctiveFacets(),d=$e(l.facets),p=$e(l.disjunctiveFacets),r=1,m=f.facets||{};Object.keys(m).forEach(function(e){var t,n,r=m[e],i=(t=l.hierarchicalFacets,n=e,ye(t,function(e){return-1<(e.attributes||[]).indexOf(n)}));if(i){var a=i.attributes.indexOf(e),s=_e(l.hierarchicalFacets,function(e){return e.name===i.name});h.hierarchicalFacets[s][a]={attribute:e,data:r,exhaustive:f.exhaustiveFacetsCount}}else{var o,c=-1!==l.disjunctiveFacets.indexOf(e),u=-1!==l.facets.indexOf(e);c&&(o=p[e],h.disjunctiveFacets[o]={name:e,data:r,exhaustive:f.exhaustiveFacetsCount},Qe(h.disjunctiveFacets[o],f.facets_stats,e)),u&&(o=d[e],h.facets[o]={name:e,data:r,exhaustive:f.exhaustiveFacetsCount},Qe(h.facets[o],f.facets_stats,e))}}),this.hierarchicalFacets=Ie(this.hierarchicalFacets),e.forEach(function(e){var a=t[r],s=a&&a.facets?a.facets:{},o=l.getHierarchicalFacetByName(e);Object.keys(s).forEach(function(t){var n,e=s[t];if(o){n=_e(l.hierarchicalFacets,function(e){return e.name===o.name});var r=_e(h.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1===r)return;h.hierarchicalFacets[n][r].data=me({},h.hierarchicalFacets[n][r].data,e)}else{n=p[t];var i=f.facets&&f.facets[t]||{};h.disjunctiveFacets[n]={name:t,data:ge({},e,i),exhaustive:a.exhaustiveFacetsCount},Qe(h.disjunctiveFacets[n],a.facets_stats,t),l.disjunctiveFacetsRefinements[t]&&l.disjunctiveFacetsRefinements[t].forEach(function(e){!h.disjunctiveFacets[n].data[e]&&-1<l.disjunctiveFacetsRefinements[t].indexOf(Me(e))&&(h.disjunctiveFacets[n].data[e]=0)})}}),r++}),l.getRefinedHierarchicalFacets().forEach(function(e){var o=l.getHierarchicalFacetByName(e),c=l._getHierarchicalFacetSeparator(o),u=l.getHierarchicalRefinement(e);0===u.length||u[0].split(c).length<2||t.slice(r).forEach(function(e){var s=e&&e.facets?e.facets:{};Object.keys(s).forEach(function(t){var e=s[t],n=_e(l.hierarchicalFacets,function(e){return e.name===o.name}),r=_e(h.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1!==r){var i={};if(0<u.length){var a=u[0].split(c)[0];i[a]=h.hierarchicalFacets[n][r].data[a]}h.hierarchicalFacets[n][r].data=ge(i,e,h.hierarchicalFacets[n][r].data)}}),r++})}),Object.keys(l.facetsExcludes).forEach(function(t){var e=l.facetsExcludes[t],n=d[t];h.facets[n]={name:t,data:f.facets[t],exhaustive:f.exhaustiveFacetsCount},e.forEach(function(e){h.facets[n]=h.facets[n]||{name:t},h.facets[n].data=h.facets[n].data||{},h.facets[n].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(De(l)),this.facets=Ie(this.facets),this.disjunctiveFacets=Ie(this.disjunctiveFacets),this._state=l}function Le(e,t){var n=ye(e,function(e){return e.name===t});return n&&n.stats}function qe(e,t,n,r,i){var a=ye(i,function(e){return e.name===n}),s=a&&a.data&&a.data[r]?a.data[r]:0,o=a&&a.exhaustive||!1;return{type:t,attributeName:n,name:r,count:s,exhaustive:o}}Be.prototype.getFacetByName=function(t){function e(e){return e.name===t}return ye(this.facets,e)||ye(this.disjunctiveFacets,e)||ye(this.hierarchicalFacets,e)},Be.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],Be.prototype.getFacetValues=function(e,t){var n=function(n,r){function e(e){return e.name===r}if(n._state.isConjunctiveFacet(r)){var i=ye(n.facets,e);return i?Object.keys(i.data).map(function(e){var t=ke(e);return{name:e,escapedValue:t,count:i.data[e],isRefined:n._state.isFacetRefined(r,t),isExcluded:n._state.isExcludeRefined(r,e)}}):[]}if(n._state.isDisjunctiveFacet(r)){var a=ye(n.disjunctiveFacets,e);return a?Object.keys(a.data).map(function(e){var t=ke(e);return{name:e,escapedValue:t,count:a.data[e],isRefined:n._state.isDisjunctiveFacetRefined(r,t)}}):[]}if(n._state.isHierarchicalFacet(r))return ye(n.hierarchicalFacets,e)}(this,e);if(n){var r,o=ge({},t,{sortBy:Be.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),c=this;if(Array.isArray(n))r=[e];else r=c._state.getHierarchicalFacetByName(n.name).attributes;return function t(n,e,r,i){if(i=i||0,Array.isArray(e))return n(e,r[i]);if(!e.data||0===e.data.length)return e;var a=e.data.map(function(e){return t(n,e,r,i+1)}),s=n(a,r[i]);return ge({data:s},e)}(function(e,t){if(o.facetOrdering){var n=(i=t,(r=c).renderingContent&&r.renderingContent.facetOrdering&&r.renderingContent.facetOrdering.values&&r.renderingContent.facetOrdering.values[i]);if(Boolean(n))return function(e,t){var n=[],r=[],i=(t.order||[]).reduce(function(e,t,n){return e[t]=n,e},{});e.forEach(function(e){var t=e.path||e.name;void 0!==i[t]?n[i[t]]=e:r.push(e)}),n=n.filter(function(e){return e});var a,s=t.sortRemainingBy;return"hidden"===s?n:(a="alpha"===s?[["path","name"],["asc","asc"]]:[["count"],["desc"]],n.concat(Ve(r,a[0],a[1])))}(e,n)}var r,i,a;if(Array.isArray(o.sortBy)){var s=Ee(o.sortBy,Be.DEFAULT_SORT);return Ve(e,s[0],s[1])}if("function"==typeof o.sortBy)return a=o.sortBy,e.sort(a);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},n,r)}},Be.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?Le(this.facets,e):this._state.isDisjunctiveFacet(e)?Le(this.disjunctiveFacets,e):void 0},Be.prototype.getRefinements=function(){var p=this._state,m=this,g=[];return Object.keys(p.facetsRefinements).forEach(function(t){p.facetsRefinements[t].forEach(function(e){g.push(qe(p,"facet",t,e,m.facets))})}),Object.keys(p.facetsExcludes).forEach(function(t){p.facetsExcludes[t].forEach(function(e){g.push(qe(p,"exclude",t,e,m.facets))})}),Object.keys(p.disjunctiveFacetsRefinements).forEach(function(t){p.disjunctiveFacetsRefinements[t].forEach(function(e){g.push(qe(p,"disjunctive",t,e,m.disjunctiveFacets))})}),Object.keys(p.hierarchicalFacetsRefinements).forEach(function(d){p.hierarchicalFacetsRefinements[d].forEach(function(e){var t,n,r,i,a,s,o,c,u,l,f,h;g.push((t=p,n=d,r=e,i=m.hierarchicalFacets,a=t.getHierarchicalFacetByName(n),s=t._getHierarchicalFacetSeparator(a),o=r.split(s),c=ye(i,function(e){return e.name===n}),u=o.reduce(function(e,t){var n=e&&ye(e.data,function(e){return e.name===t});return void 0!==n?n:e},c),l=u&&u.count||0,f=u&&u.exhaustive||!1,h=u&&u.path||"",{type:"hierarchical",attributeName:n,name:h,count:l,exhaustive:f}))})}),Object.keys(p.numericRefinements).forEach(function(n){var e=p.numericRefinements[n];Object.keys(e).forEach(function(t){e[t].forEach(function(e){g.push({type:"numeric",attributeName:n,name:e,numericValue:e,operator:t})})})}),p.tagRefinements.forEach(function(e){g.push({type:"tag",attributeName:"_tags",name:e})}),g};var Ue=Be;function We(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var ze=We;function Je(e){return"function"==typeof e}function Ye(e){return"object"==typeof e&&null!==e}function Ge(e){return void 0===e}We.prototype._events=void 0,We.prototype._maxListeners=void 0,We.defaultMaxListeners=10,We.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},We.prototype.emit=function(e){var t,n,r,i,a,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||Ye(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var o=new Error('Uncaught, unspecified "error" event. ('+t+")");throw o.context=t,o}if(Ge(n=this._events[e]))return!1;if(Je(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),n.apply(this,i)}else if(Ye(n))for(i=Array.prototype.slice.call(arguments,1),r=(s=n.slice()).length,a=0;a<r;a++)s[a].apply(this,i);return!0},We.prototype.on=We.prototype.addListener=function(e,t){var n;if(!Je(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Je(t.listener)?t.listener:t),this._events[e]?Ye(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ye(this._events[e])&&!this._events[e].warned&&(n=Ge(this._maxListeners)?We.defaultMaxListeners:this._maxListeners)&&0<n&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},We.prototype.once=function(e,t){if(!Je(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},We.prototype.removeListener=function(e,t){var n,r,i,a;if(!Je(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Je(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Ye(n)){for(a=i;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},We.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(Je(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},We.prototype.listeners=function(e){return this._events&&this._events[e]?Je(this._events[e])?[this._events[e]]:this._events[e].slice():[]},We.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(Je(t))return 1;if(t)return t.length}return 0},We.listenerCount=function(e,t){return e.listenerCount(t)};var Ke=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function Xe(e,t){this.main=e,this.fn=t,this.lastResults=null}Ke(Xe,ze),Xe.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},Xe.prototype.getModifiedState=function(e){return this.fn(e)};var Ze=Xe;function et(n){return Object.keys(n).sort(function(e,t){return e.localeCompare(t)}).reduce(function(e,t){return e[t]=n[t],e},{})}var tt={_getQueries:function(c,u){var l=[];return l.push({indexName:c,params:tt._getHitsSearchParams(u)}),u.getRefinedDisjunctiveFacets().forEach(function(e){l.push({indexName:c,params:tt._getDisjunctiveFacetSearchParams(u,e)})}),u.getRefinedHierarchicalFacets().forEach(function(e){var s=u.getHierarchicalFacetByName(e),t=u.getHierarchicalRefinement(e),r=u._getHierarchicalFacetSeparator(s);if(0<t.length&&1<t[0].split(r).length){var o=t[0].split(r).slice(0,-1).reduce(function(e,t,n){return e.concat({attribute:s.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(r)})},[]);o.forEach(function(e,t){var n=tt._getDisjunctiveFacetSearchParams(u,e.attribute,0===t);function r(t){return s.attributes.some(function(e){return e===t.split(":")[0]})}var i=(n.facetFilters||[]).reduce(function(e,t){if(Array.isArray(t)){var n=t.filter(function(e){return!r(e)});0<n.length&&e.push(n)}return"string"!=typeof t||r(t)||e.push(t),e},[]),a=o[t-1];n.facetFilters=0<t?i.concat(a.attribute+":"+a.value):0<i.length?i:void 0,l.push({indexName:c,params:n})})}}),l},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(tt._getHitsHierarchicalFacetsAttributes(e)),n=tt._getFacetFilters(e),r=tt._getNumericFilters(e),i=tt._getTagFilters(e),a={facets:-1<t.indexOf("*")?["*"]:t,tagFilters:i};return 0<n.length&&(a.facetFilters=n),0<r.length&&(a.numericFilters=r),et(me({},e.getQueryParams(),a))},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=tt._getFacetFilters(e,t,n),i=tt._getNumericFilters(e,t),a=tt._getTagFilters(e),s={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};0<a.length&&(s.tagFilters=a);var o=e.getHierarchicalFacetByName(t);return s.facets=o?tt._getDisjunctiveHierarchicalFacetAttribute(e,o,n):t,0<i.length&&(s.numericFilters=i),0<r.length&&(s.facetFilters=r),et(me({},e.getQueryParams(),s))},_getNumericFilters:function(e,i){if(e.numericFilters)return e.numericFilters;var a=[];return Object.keys(e.numericRefinements).forEach(function(r){var t=e.numericRefinements[r]||{};Object.keys(t).forEach(function(n){var e=t[n]||[];i!==r&&e.forEach(function(e){if(Array.isArray(e)){var t=e.map(function(e){return r+n+e});a.push(t)}else a.push(r+n+e)})})}),a},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(o,c,u){var l=[],e=o.facetsRefinements||{};Object.keys(e).forEach(function(t){(e[t]||[]).forEach(function(e){l.push(t+":"+e)})});var n=o.facetsExcludes||{};Object.keys(n).forEach(function(t){(n[t]||[]).forEach(function(e){l.push(t+":-"+e)})});var r=o.disjunctiveFacetsRefinements||{};Object.keys(r).forEach(function(t){var e=r[t]||[];if(t!==c&&e&&0!==e.length){var n=[];e.forEach(function(e){n.push(t+":"+e)}),l.push(n)}});var f=o.hierarchicalFacetsRefinements||{};return Object.keys(f).forEach(function(e){var t=(f[e]||[])[0];if(void 0!==t){var n,r,i=o.getHierarchicalFacetByName(e),a=o._getHierarchicalFacetSeparator(i),s=o._getHierarchicalRootPath(i);if(c===e){if(-1===t.indexOf(a)||!s&&!0===u||s&&s.split(a).length===t.split(a).length)return;t=s?(r=s.split(a).length-1,s):(r=t.split(a).length-2,t.slice(0,t.lastIndexOf(a))),n=i.attributes[r]}else r=t.split(a).length-1,n=i.attributes[r];n&&l.push([n+":"+t])}}),l},_getHitsHierarchicalFacetsAttributes:function(s){return s.hierarchicalFacets.reduce(function(e,t){var n=s.getHierarchicalRefinement(t.name)[0];if(!n)return e.push(t.attributes[0]),e;var r=s._getHierarchicalFacetSeparator(t),i=n.split(r).length,a=t.attributes.slice(0,i+1);return e.concat(a)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(!0===n){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(r).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(r).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,n,r){var i=r.isDisjunctiveFacet(e)?r.clearRefinements(e):r,a={facetQuery:t,facetName:e};return"number"==typeof n&&(a.maxFacetHits=n),et(me({},tt._getHitsSearchParams(i),a))}},nt=tt,rt="3.11.1",it=Ae;function at(e,t,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.1)"),this.setClient(e);var r=n||{};r.index=t,this.state=Ce.make(r),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function st(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function ot(){return this.state.page}Ke(at,ze),at.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},at.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},at.prototype.getQuery=function(){var e=this.state;return nt._getHitsSearchParams(e)},at.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,r=nt._getQueries(n.index,n),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(r).then(function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new Ue(n,e.results),state:n,_originalResponse:e}},function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e});this.client.search(r).then(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new Ue(n,e.results),n)}).catch(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,n)})},at.prototype.findAnswers=function(e){var t=this.state,n=this.derivedHelpers[0];if(!n)return Promise.resolve([]);var r=n.getModifiedState(t),i=me({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:be(nt._getHitsSearchParams(r),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(r.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(r.query,e.queryLanguages,i)},at.prototype.searchForFacetValues=function(t,e,n,r){var i="function"==typeof this.client.searchForFacetValues,a="function"==typeof this.client.initIndex;if(!i&&!a&&"function"!=typeof this.client.search)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 s=this.state.setQueryParameters(r||{}),o=s.isDisjunctiveFacet(t),c=nt.getSearchForFacetQuery(t,e,n,s);this._currentNbQueries++;var u,l=this;return u=i?this.client.searchForFacetValues([{indexName:s.index,params:c}]):a?this.client.initIndex(s.index).searchForFacetValues(c):(delete c.facetName,this.client.search([{type:"facet",facet:t,indexName:s.index,params:c}]).then(function(e){return e.results[0]})),this.emit("searchForFacetValues",{state:s,facet:t,query:e}),u.then(function(e){return l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),(e=Array.isArray(e)?e[0]:e).facetHits.forEach(function(e){e.escapedValue=it(e.value),e.isRefined=o?s.isDisjunctiveFacetRefined(t,e.escapedValue):s.isFacetRefined(t,e.escapedValue)}),e},function(e){throw l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),e})},at.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},at.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},at.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},at.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},at.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},at.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},at.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},at.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},at.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},at.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},at.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},at.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},at.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},at.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},at.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},at.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},at.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},at.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},at.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},at.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},at.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},at.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},at.prototype.setCurrentPage=st,at.prototype.setPage=st,at.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},at.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},at.prototype.setState=function(e){return this._change({state:Ce.make(e),isPageReset:!1}),this},at.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new Ce(e),this},at.prototype.hasRefinements=function(e){return!!Re(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},at.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},at.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},at.prototype.hasTag=function(e){return this.state.isTagRefined(e)},at.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},at.prototype.getIndex=function(){return this.state.index},at.prototype.getCurrentPage=ot,at.prototype.getPage=ot,at.prototype.getTags=function(){return this.state.tagRefinements},at.prototype.getRefinements=function(e){var n=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"conjunctive"})}),this.state.getExcludeRefinements(e).forEach(function(e){n.push({value:e,type:"exclude"})});else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"disjunctive"})})}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach(function(e){var t=r[e];n.push({value:t,operator:e,type:"numeric"})}),n},at.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},at.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},at.prototype._search=function(e){var r=this.state,i=[],t=[];e.onlyWithDerivedHelpers||(t=nt._getQueries(r.index,r),i.push({state:r,queriesCount:t.length,helper:this}),this.emit("search",{state:r,results:this.lastResults}));var n=this.derivedHelpers.map(function(e){var t=e.getModifiedState(r),n=nt._getQueries(t.index,t);return i.push({state:t,queriesCount:n.length,helper:e}),e.emit("search",{state:t,results:e.lastResults}),n}),a=Array.prototype.concat.apply(t,n),s=this._queryId++;this._currentNbQueries++;try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,i,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(e){this.emit("error",{error:e})}},at.prototype._dispatchAlgoliaResponse=function(e,t,n){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var s=n.results.slice();e.forEach(function(e){var t=e.state,n=e.queriesCount,r=e.helper,i=s.splice(0,n),a=r.lastResults=new Ue(t,i);r.emit("result",{results:a,state:t})})}},at.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},at.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},at.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},at.prototype._change=function(e){var t=e.state,n=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:n}))},at.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},at.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.1)"),this.client=e),this},at.prototype.getClient=function(){return this.client},at.prototype.derive=function(e){var t=new Ze(this,e);return this.derivedHelpers.push(t),t},at.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},at.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var ct=at;function ut(e,t,n){return new ct(e,t,n)}ut.version=rt,ut.AlgoliaSearchHelper=ct,ut.SearchParameters=Ce,ut.SearchResults=Ue;var lt=ut;function ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ht(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function dt(e){var t=e.attributeName,n=e.attributeValue,r=e.attributeScore;return"".concat(t,":").concat(n,"<score=").concat(r||1,">")}function pt(a){var e=Object.keys(a.matchingPatterns).reduce(function(e,t){var n=a.matchingPatterns[t],r=E(a.hit,t),i=n.score;return Array.isArray(r)?[].concat(he(e),[r.map(function(e){return dt({attributeName:t,attributeValue:e,attributeScore:i})})]):"string"==typeof r?[].concat(he(e),[dt({attributeName:t,attributeValue:r,attributeScore:i})]):e},[]);return a.transformSearchParameters(new lt.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.hit.objectID)],optionalFilters:e}))}var mt=q({displayName:"AlgoliaConfigureRelatedItems",$$type:"ais.configureRelatedItems",defaultProps:{transformSearchParameters:function(e){return ht({},e)}},getProvidedProps:function(){return{}},getSearchParameters:function(e,t){return e.setQueryParameters(pt(t))},transitionState:function(e,t,n){var r,i="configure",a=(r=j(pt(e)),Object.keys(r).forEach(function(e){var t=r[e];Array.isArray(t)&&0===t.length&&delete r[e]}),r),s=Object.keys(a),o=this._searchParameters?Object.keys(this._searchParameters).filter(function(e){return-1===s.indexOf(e)}):[];return this._searchParameters=a,ee(n,O({},i,ht(ht({},_(n[i],o)),a)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){var n=this,r="configure",i=K({ais:e.contextValue,multiIndexContext:e.indexContextValue}),a=Z({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&t.indices?t.indices[i]:t,s=(a&&a[r]?Object.keys(a[r]):[]).reduce(function(e,t){return n._searchParameters[t]||(e[t]=a[r][t]),e},{});return ee(t,O({},r,s),{ais:e.contextValue,multiIndexContext:e.indexContextValue})}}),gt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};gt.setTimeout,gt.clearTimeout;var vt=gt.performance||{};vt.now||vt.mozNow||vt.msNow||vt.oNow||vt.webkitNow;function yt(e,t){return e(t={exports:{}},t.exports),t.exports}var xt="function"==typeof Symbol&&Symbol.for,bt=xt?Symbol.for("react.element"):60103,Rt=xt?Symbol.for("react.portal"):60106,Pt=xt?Symbol.for("react.fragment"):60107,Ft=xt?Symbol.for("react.strict_mode"):60108,Ot=xt?Symbol.for("react.profiler"):60114,St=xt?Symbol.for("react.provider"):60109,jt=xt?Symbol.for("react.context"):60110,Ct=xt?Symbol.for("react.async_mode"):60111,wt=xt?Symbol.for("react.concurrent_mode"):60111,Vt=xt?Symbol.for("react.forward_ref"):60112,It=xt?Symbol.for("react.suspense"):60113,_t=xt?Symbol.for("react.suspense_list"):60120,Et=xt?Symbol.for("react.memo"):60115,At=xt?Symbol.for("react.lazy"):60116,Nt=xt?Symbol.for("react.block"):60121,Dt=xt?Symbol.for("react.fundamental"):60117,Tt=xt?Symbol.for("react.responder"):60118,Ht=xt?Symbol.for("react.scope"):60119;function kt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case bt:switch(e=e.type){case Ct:case wt:case Pt:case Ot:case Ft:case It:return e;default:switch(e=e&&e.$$typeof){case jt:case Vt:case At:case Et:case St:return e;default:return t}}case Rt:return t}}}function Mt(e){return kt(e)===wt}var $t={AsyncMode:Ct,ConcurrentMode:wt,ContextConsumer:jt,ContextProvider:St,Element:bt,ForwardRef:Vt,Fragment:Pt,Lazy:At,Memo:Et,Portal:Rt,Profiler:Ot,StrictMode:Ft,Suspense:It,isAsyncMode:function(e){return Mt(e)||kt(e)===Ct},isConcurrentMode:Mt,isContextConsumer:function(e){return kt(e)===jt},isContextProvider:function(e){return kt(e)===St},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===bt},isForwardRef:function(e){return kt(e)===Vt},isFragment:function(e){return kt(e)===Pt},isLazy:function(e){return kt(e)===At},isMemo:function(e){return kt(e)===Et},isPortal:function(e){return kt(e)===Rt},isProfiler:function(e){return kt(e)===Ot},isStrictMode:function(e){return kt(e)===Ft},isSuspense:function(e){return kt(e)===It},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Pt||e===wt||e===Ot||e===Ft||e===It||e===_t||"object"==typeof e&&null!==e&&(e.$$typeof===At||e.$$typeof===Et||e.$$typeof===St||e.$$typeof===jt||e.$$typeof===Vt||e.$$typeof===Dt||e.$$typeof===Tt||e.$$typeof===Ht||e.$$typeof===Nt)},typeOf:kt},Qt=yt(function(e,t){});Qt.AsyncMode,Qt.ConcurrentMode,Qt.ContextConsumer,Qt.ContextProvider,Qt.Element,Qt.ForwardRef,Qt.Fragment,Qt.Lazy,Qt.Memo,Qt.Portal,Qt.Profiler,Qt.StrictMode,Qt.Suspense,Qt.isAsyncMode,Qt.isConcurrentMode,Qt.isContextConsumer,Qt.isContextProvider,Qt.isElement,Qt.isForwardRef,Qt.isFragment,Qt.isLazy,Qt.isMemo,Qt.isPortal,Qt.isProfiler,Qt.isStrictMode,Qt.isSuspense,Qt.isValidElementType,Qt.typeOf,yt(function(e){e.exports=$t});function Bt(){}function Lt(){}Lt.resetWarningCache=Bt;var qt=yt(function(e){e.exports=function(){function e(e,t,n,r,i,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}var n={array:e.isRequired=e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Lt,resetWarningCache:Bt};return n.PropTypes=n}()});function Ut(){return null}Ut.propTypes={hit:qt.object.isRequired,matchingPatterns:qt.object.isRequired,transformSearchParameters:qt.func};var Wt=mt(Ut,{$$widgetType:"ais.configureRelatedItems"}),zt=q({displayName:"AlgoliaDynamicWidgets",$$type:"ais.dynamicWidgets",defaultProps:{transformItems:function(e){return e},maxValuesPerFacet:20},propTypes:{transformItems:qt.func,facets:qt.arrayOf(qt.string),maxValuesPerFacet:qt.number},getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(e.facets&&(!(Array.isArray(e.facets)&&e.facets.length<=1)||"*"!==e.facets[0]&&void 0!==e.facets[0]))throw new Error('The `facets` prop only accepts [] or ["*"], you passed '.concat(JSON.stringify(e.facets)));if(!r)return{attributesToRender:[]};var i=r.renderingContent&&r.renderingContent.facetOrdering&&r.renderingContent.facetOrdering.facets&&r.renderingContent.facetOrdering.facets.order||[],a=e.transformItems(i,{results:r});return 20<a.length&&!e.facets&&console.warn("More than ".concat(20," facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \"facets\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.")),e.maxValuesPerFacet<r._state.maxValuesPerFacet&&console.warn("The maxValuesPerFacet set by dynamic widgets (".concat(e.maxValuesPerFacet,") is smaller than one of the limits set by a widget (").concat(r._state.maxValuesPerFacet,"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.")),{attributesToRender:a}},getSearchParameters:function(e,t){return(t.facets||["*"]).reduce(function(e,t){return e.addFacet(t)},e.setQueryParameters({maxValuesPerFacet:Math.max(t.maxValuesPerFacet||0,e.maxValuesPerFacet||0)}))}});function Jt(e){var t;if("object"===o(t=e)&&t.props)return e.props.attribute?e.props.attribute:Array.isArray(e.props.attributes)?e.props.attributes[0]:e.props.children?Jt(c.Children.only(e.props.children)):void 0}var Yt=zt(function(e){var t=e.children,n=e.attributesToRender,r=e.fallbackComponent,i=void 0===r?function(){return null}:r,a=new Map;return c.Children.forEach(t,function(e){var t=Jt(e);if(!t)throw new Error('Could not find "attribute" prop for '.concat(P(e),"."));a.set(t,e)}),c.createElement(c.Fragment,null,n.map(function(e){return c.createElement(s.Fragment,{key:e},a.get(e)||c.createElement(i,{attribute:e}))}))},{$$widgetType:"ais.dynamicWidgets"});function Gt(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(n).filter(function(e){return void 0!==n[e]&&void 0!==n[e][t]}).map(function(e){return function(t,e,n){var r=n[e];switch(e){case"range":return Object.keys(r[t]).map(function(e){return r[t][e]});case"refinementList":return r[t];case"hierarchicalMenu":case"menu":return[r[t]];case"multiRange":return r[t].split(":");case"toggle":return[r[t]];default:return[]}}(t,e,n)}).reduce(function(e,t){return e.concat(t)},[])}var Kt=q({displayName:"AlgoliaQueryRules",$$type:"ais.queryRules",defaultProps:{transformItems:function(e){return e},transformRuleContexts:function(e){return e},trackedFilters:{}},getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(null===r)return{items:[],canRefine:!1};var i=r.userData,a=void 0===i?[]:i,s=(0,e.transformItems)(a);return{items:s,canRefine:0<s.length}},getSearchParameters:function(e,t,n){if(0===Object.keys(t.trackedFilters).length)return e;var r,i,a,s=Z({ais:t.contextValue,multiIndexContext:t.indexContextValue})&&n.indices?n.indices[K({ais:t.contextValue,multiIndexContext:t.indexContextValue})]:n,o=(r={searchState:s,trackedFilters:t.trackedFilters},i=r.searchState,a=r.trackedFilters,Object.keys(a).reduce(function(e,t){var n=Gt(t,i),r=(0,a[t])(n);return[].concat(he(e),he(n.filter(function(e){return r.includes(e)}).map(function(e){return"ais-".concat(t,"-").concat(e).replace(/[^a-z0-9-_]+/gi,"_")})))},[])),c=e.ruleContexts||[],u=[].concat(he(c),he(o)),l=t.transformRuleContexts(u).slice(0,10);return e.setQueryParameter("ruleContexts",l)}}),Xt=Kt(function(){return null},{$$widgetType:"ais.queryRuleContext"});function Zt(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}function en(e){return{targetedIndex:e.indexId}}var tn=function(e){p(r,s.Component);var n=Zt(r);function r(e){var t;return f(this,r),O(d(t=n.call(this,e)),"state",{indexContext:en(t.props)}),O(d(t),"unregisterWidget",void 0),t.props.contextValue.onSearchParameters(t.getSearchParameters.bind(d(t)),{ais:t.props.contextValue,multiIndexContext:t.state.indexContext},t.props,void 0,r.displayName),t}return h(r,[{key:"componentDidMount",value:function(){this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this)}},{key:"componentDidUpdate",value:function(e){this.props.indexName!==e.indexName&&this.props.contextValue.widgetsManager.update()}},{key:"componentWillUnmount",value:function(){"function"==typeof this.unregisterWidget&&this.unregisterWidget()}},{key:"getSearchParameters",value:function(e,t){return e.setIndex(this.props?this.props.indexName:t.indexName)}},{key:"render",value:function(){return 0===s.Children.count(this.props.children)?null:c.createElement(M,{value:this.state.indexContext},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e){return{indexContext:en(e)}}}]),r}();O(tn,"displayName","AlgoliaIndex"),O(tn,"$$type","ais.index"),O(tn,"$$widgetType","ais.index");var nn=["resultsFacetValues"],rn=["resultsFacetValues"],an=["resultsFacetValues"];function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function on(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function cn(e){"function"==typeof e.addAlgoliaAgent&&(e.addAlgoliaAgent("react (".concat(s.version,")")),e.addAlgoliaAgent("react-instantsearch (".concat(z,")")))}var un=function(e){return Z({ais:e.props.contextValue,multiIndexContext:e.props.indexContextValue})},ln=function(e,t){return e.props.indexContextValue.targetedIndex===t},fn=function(e){return Boolean(e.props.indexId)},hn=function(e,t){return e.props.indexId===t},dn=function(e,t){var n=fn(e),r=fn(t);return n&&!r?-1:!n&&r?1:0};function pn(n){return Object.keys(n).map(function(e){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0;return e.replace(/%s/g,function(){return encodeURIComponent(n[i++])})}("%s=%s",e,(t=n[e],"[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?JSON.stringify(n[e]):n[e]));var t}).join("&")}function mn(e){var r=e.indexName,t=e.initialState,n=void 0===t?{}:t,i=e.searchClient,a=e.resultsState,s=e.stalledSearchDelay,c=lt(i,r,on({},U));cn(i),c.on("search",function(){l||(l=setTimeout(function(){var e=v.getState(),t=(e.resultsFacetValues,F(e,an));v.setState(on(on({},t),{},{isSearchStalled:!0}))},s))}).on("result",R({indexId:r})).on("error",P);var u,o=!1,l=null,f=c.state,h=function(e){var t=[],n=!1;function r(){n||(n=!0,S(function(){n=!1,e()}))}return{registerWidget:function(e){return t.push(e),r(),function(){t.splice(t.indexOf(e),1),r()}},update:r,getWidgets:function(){return t}}}(function(){var e=y(v.getState().widgets);v.setState(on(on({},v.getState()),{},{metadata:e,searching:!0})),b()});!function(a,e){if(!e)return;if((!a.transporter||a._cacheHydrated)&&(!a._useCache||"function"!=typeof a.addAlgoliaAgent))return;if(a.transporter&&!a._cacheHydrated){a._cacheHydrated=!0;var s=a.search;a.search=function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=e.map(function(e){return on(on({},e),{},{params:pn(e.params)})});return a.transporter.responsesCache.get({method:"search",args:[i].concat(n)},function(){return s.apply(void 0,[e].concat(n))})}}if(Array.isArray(e.results))return function(e,t){if(e.transporter)return e.transporter.responsesCache.set({method:"search",args:[t.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])]},{results:t.reduce(function(e,t){return e.concat(t.rawResults)},[])});var n="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:t.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])}));e.cache=on(on({},e.cache),{},O({},n,JSON.stringify({results:t.reduce(function(e,t){return e.concat(t.rawResults)},[])})))}(a,e.results);!function(e,t){if(e.transporter)return e.transporter.responsesCache.set({method:"search",args:[t.rawResults.map(function(e){return{indexName:e.index,params:e.params}})]},{results:t.rawResults});var n="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:t.rawResults.map(function(e){return{indexName:e.index,params:e.params}})}));e.cache=on(on({},e.cache),{},O({},n,JSON.stringify({results:t.rawResults})))}(a,e)}(i,a);var d,p,m,g,v=(d={widgets:n,metadata:(g=a,g?g.metadata.map(function(e){return on(on({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return on(on({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return on({value:function(){return{}}},e)})})})})}):[]),results:function(e){if(!e)return null;if(Array.isArray(e.results))return e.results.reduce(function(e,t){return on(on({},e),{},O({},t._internalIndexId,new lt.SearchResults(new lt.SearchParameters(t.state),t.rawResults)))},{});return new lt.SearchResults(new lt.SearchParameters(e.state),e.rawResults)}(a),error:null,searching:!1,isSearchStalled:!0,searchingForFacetValues:!1},p=d,m=[],{getState:function(){return p},setState:function(e){p=e,m.forEach(function(e){return e()})},subscribe:function(e){return m.push(e),function(){m.splice(m.indexOf(e),1)}}});function y(t){return h.getWidgets().filter(function(e){return Boolean(e.getMetadata)}).map(function(e){return e.getMetadata(t)})}function x(){var t=h.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){return!un(e)&&!fn(e)}).reduce(function(e,t){return t.getSearchParameters(e)},f),e=h.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=un(e)&&ln(e,r),n=fn(e)&&hn(e,r);return t||n}).sort(dn).reduce(function(e,t){return t.getSearchParameters(e)},t),n=h.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=un(e)&&!ln(e,r),n=fn(e)&&!hn(e,r);return t||n}).sort(dn).reduce(function(e,t){var n=un(t)?t.props.indexContextValue.targetedIndex:t.props.indexId,r=e[n]||[];return on(on({},e),{},O({},n,r.concat(t)))},{});return{mainParameters:e,derivedParameters:Object.keys(n).map(function(e){return{parameters:n[e].reduce(function(e,t){return t.getSearchParameters(e)},t),indexId:e}})}}function b(){if(!o){var e=x(),t=e.mainParameters,n=e.derivedParameters;u=n.length+1,c.derivedHelpers.slice().forEach(function(e){e.detach()}),n.forEach(function(e){var t=e.indexId,n=e.parameters;c.derive(function(){return n}).on("result",R({indexId:t})).on("error",P)}),c.setState(t),c.search()}}function R(e){var o=e.indexId;return function(e){u--;var t=v.getState(),n=!c.derivedHelpers.length,r=t.results?t.results:{};r=!n&&r.getFacetByName?{}:r,r=n?e.results:on(on({},r),{},O({},o,e.results));var i=v.getState(),a=i.isSearchStalled;c.hasPendingRequests()||(clearTimeout(l),l=null,a=!1);i.resultsFacetValues;var s=F(i,nn);v.setState(on(on({},s),{},{results:r,isSearchStalled:a,searching:0<u,error:null}))}}function P(e){var t=e.error,n=v.getState(),r=n.isSearchStalled;c.hasPendingRequests()||(clearTimeout(l),r=!1);n.resultsFacetValues;var i=F(n,rn);v.setState(on(on({},i),{},{isSearchStalled:r,error:t,searching:!1}))}return{store:v,widgetsManager:h,getWidgetsIds:function(){return v.getState().metadata.reduce(function(e,t){return void 0!==t.id?e.concat(t.id):e},[])},getSearchParameters:x,onSearchForFacetValues:function(e){var n=e.facetName,r=e.query,t=e.maxFacetHits,i=void 0===t?10:t,a=Math.max(1,Math.min(i,100));v.setState(on(on({},v.getState()),{},{searchingForFacetValues:!0})),c.searchForFacetValues(n,r,a).then(function(e){var t;v.setState(on(on({},v.getState()),{},{error:null,searchingForFacetValues:!1,resultsFacetValues:on(on({},v.getState().resultsFacetValues),{},(t={},O(t,n,e.facetHits),O(t,"query",r),t))}))},function(e){v.setState(on(on({},v.getState()),{},{searchingForFacetValues:!1,error:e}))}).catch(function(e){setTimeout(function(){throw e})})},onExternalStateUpdate:function(e){var t=y(e);v.setState(on(on({},v.getState()),{},{widgets:e,metadata:t,searching:!0})),b()},transitionState:function(e){var n=v.getState().widgets;return h.getWidgets().filter(function(e){return Boolean(e.transitionState)}).reduce(function(e,t){return t.transitionState(n,e)},e)},updateClient:function(e){cn(e),c.setClient(e),b()},updateIndex:function(e){f=f.setIndex(e)},clearCache:function(){c.clearCache(),b()},skipSearch:function(){o=!0}}}function gn(e,t){var n=document.createElement("meta"),r=document.querySelector("head");n.name="algolia:metadata";var i,o,a,s,c=(i=t,o=["contextValue","indexContextValue"],a=e.map(function(e){var t=e.props,n=e.constructor,r=n._connectorDesc||{},i=r.defaultProps,a=void 0===i?{}:i,s=r.displayName;return{displayName:void 0===s?n.displayName:s,$$type:n.$$type,$$widgetType:n.$$widgetType,params:Object.keys(t).filter(function(e){return!o.includes(e)&&a[e]!==t[e]&&void 0!==t[e]})}}),{ua:(s=i).transporter&&s.transporter.userAgent?s.transporter.userAgent.value:s._ua,widgets:a});n.content=JSON.stringify(c),r.appendChild(n)}function vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function yn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xn(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}function bn(e){return Boolean(e.searchState)}var Rn=function(e){p(a,s.Component);var i=xn(a);function a(e){var t;f(this,a),O(d(t=i.call(this,e)),"isUnmounting",!1);var n=mn({indexName:t.props.indexName,searchClient:t.props.searchClient,initialState:t.props.searchState||{},resultsState:t.props.resultsState,stalledSearchDelay:t.props.stalledSearchDelay}),r={store:n.store,widgetsManager:n.widgetsManager,mainTargetedIndex:t.props.indexName,onInternalStateUpdate:t.onWidgetsInternalStateUpdate.bind(d(t)),createHrefForState:t.createHrefForState.bind(d(t)),onSearchForFacetValues:t.onSearchForFacetValues.bind(d(t)),onSearchStateChange:t.onSearchStateChange.bind(d(t)),onSearchParameters:t.onSearchParameters.bind(d(t))};return t.state={isControlled:bn(t.props),instantSearchManager:n,contextValue:r},t}return h(a,[{key:"componentDidUpdate",value:function(e){var t=bn(e);if(t&&!this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled");if(!t&&this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled");this.props.refresh!==e.refresh&&this.props.refresh&&this.state.instantSearchManager.clearCache(),e.indexName!==this.props.indexName&&this.state.instantSearchManager.updateIndex(this.props.indexName),e.searchClient!==this.props.searchClient&&this.state.instantSearchManager.updateClient(this.props.searchClient)}},{key:"componentDidMount",value:function(){"object"===("undefined"==typeof window?"undefined":o(window))&&"object"===o(window.navigator)&&"string"==typeof window.navigator.userAgent&&window.navigator.userAgent.includes("Algolia Crawler")&&"object"===o(window.document)&&gn(this.state.instantSearchManager.widgetsManager.getWidgets(),this.props.searchClient)}},{key:"componentWillUnmount",value:function(){this.isUnmounting=!0,this.state.instantSearchManager.skipSearch()}},{key:"createHrefForState",value:function(e){return e=this.state.instantSearchManager.transitionState(e),this.state.isControlled&&this.props.createURL?this.props.createURL(e,this.getKnownKeys()):"#"}},{key:"onWidgetsInternalStateUpdate",value:function(e){e=this.state.instantSearchManager.transitionState(e),this.onSearchStateChange(e),this.state.isControlled||this.state.instantSearchManager.onExternalStateUpdate(e)}},{key:"onSearchStateChange",value:function(e){this.props.onSearchStateChange&&!this.isUnmounting&&this.props.onSearchStateChange(e)}},{key:"onSearchParameters",value:function(e,t,n,r,i){if(this.props.onSearchParameters){var a=this.props.searchState?this.props.searchState:{};this.props.onSearchParameters(e,t,n,a)}if(this.props.widgetsCollector){var s=this.props.searchState?this.props.searchState:{};this.props.widgetsCollector({getSearchParameters:e,getMetadata:r,context:t,props:n,searchState:s,displayName:i})}}},{key:"onSearchForFacetValues",value:function(e){this.state.instantSearchManager.onSearchForFacetValues(e)}},{key:"getKnownKeys",value:function(){return this.state.instantSearchManager.getWidgetsIds()}},{key:"render",value:function(){return 0===s.Children.count(this.props.children)?null:c.createElement(T,{value:this.state.contextValue},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=bn(e),r=t.instantSearchManager.store.getState().widgets,i=e.searchState;return n&&!x(r,i)&&t.instantSearchManager.onExternalStateUpdate(e.searchState),{isControlled:n,contextValue:yn(yn({},t.contextValue),{},{mainTargetedIndex:e.indexName})}}}]),a}();O(Rn,"defaultProps",{stalledSearchDelay:200,refresh:!1});function Pn(e,t,n){var r=ne(e,t,n,"query","");return r||""}var Fn=q({displayName:"AlgoliaAutoComplete",$$type:"ais.autoComplete",getProvidedProps:function(e,t,n){return{hits:(r=n,r.results?r.results.hits&&Array.isArray(r.results.hits)?C(w(r.results.hits,r.results.queryID),r.results.hitsPerPage,r.results.page):Object.keys(r.results).reduce(function(e,t){return[].concat(he(e),[{index:t,hits:C(w(r.results[t].hits,r.results[t].queryID),r.results[t].hitsPerPage,r.results[t].page)}])},[]):[]),currentRefinement:Pn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue})};var r},refine:function(e,t,n){return r=t,i=n,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},ee(r,O({},"query",i),a,!0);var r,i,a},cleanUp:function(e,t){return n=t,r={ais:e.contextValue,multiIndexContext:e.indexContextValue},re(n,r,"query");var n,r},getSearchParameters:function(e,t,n){return e.setQuery(Pn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))}}),On=function(e){return e.attributes[0]};var Sn=q({displayName:"AlgoliaBreadcrumb",$$type:"ais.breadcrumb",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},transformItems:qt.func},getProvidedProps:function(e,t,n){var r=On(e),i=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!(Boolean(i)&&Boolean(i.getFacetByName(r))))return{items:[],canRefine:!1};var a=i.getFacetValues(r),s=a.data?function n(e){return e.reduce(function(e,t){return t.isRefined&&(e.push({label:t.name,value:t.escapedValue}),t.data&&(e=e.concat(n(t.data)))),e},[])}(a.data):[],o=e.transformItems?e.transformItems(s):s;return{canRefine:0<o.length,items:o}},refine:function(e,t,n){return i=t,a=n,s={ais:(r=e).contextValue,multiIndexContext:e.indexContextValue},ee(i,O({},On(r),a||""),s,!0,"hierarchicalMenu");var r,i,a,s}});function jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Cn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var wn=q({displayName:"AlgoliaCurrentRefinements",$$type:"ais.currentRefinements",propTypes:{transformItems:qt.func},getProvidedProps:function(n,e,t,r){var i=r.reduce(function(e,t){return void 0!==t.items&&(n.clearsQuery||"query"!==t.id)?n.clearsQuery&&"query"===t.id&&""===t.items[0].currentRefinement?e:e.concat(t.items.map(function(e){return Cn(Cn({},e),{},{id:t.id,index:t.index})})):e},[]),a=n.transformItems?n.transformItems(i):i;return{items:a,canRefine:0<a.length}},refine:function(e,t,n){return(n instanceof Array?n.map(function(e){return e.value}):[n]).reduce(function(e,t){return t(e)},t)}}),Vn=["defaultRefinement"],In=function(e){return[e.northEast.lat,e.northEast.lng,e.southWest.lat,e.southWest.lng].join()},_n=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/,En=function(e){var t=e.match(_n);return{lat:parseFloat(t[1]),lng:parseFloat(t[2])}},An=function(e,t,n){var r=ne(e,t,n,"boundingBox",{});if(I(r))return{northEast:{lat:parseFloat(r.northEast.lat),lng:parseFloat(r.northEast.lng)},southWest:{lat:parseFloat(r.southWest.lat),lng:parseFloat(r.southWest.lng)}}},Nn=function(e,t,n){return ee(e,O({},"boundingBox",t),n,!0)},Dn=q({displayName:"AlgoliaGeoSearch",$$type:"ais.geoSearch",getProvidedProps:function(e,t,n){var r,i,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},s=X(n,a),o=An(e,t,a),c=s&&s._state.insideBoundingBox&&(r=s._state.insideBoundingBox,i=r.split(","),{northEast:{lat:parseFloat(i[0]),lng:parseFloat(i[1])},southWest:{lat:parseFloat(i[2]),lng:parseFloat(i[3])}})||void 0,u=function(e,t,n){e.defaultRefinement;var r=F(e,Vn),i=ne(r,t,n,"aroundLatLng");if(i)return i;var a=ne(r,t,n,"configure.aroundLatLng");return a&&En(a)}(e,t,a),l=s&&s._state.aroundLatLng&&En(s._state.aroundLatLng)||void 0,f=o||c,h=u||l;return{hits:s?s.hits.filter(function(e){return Boolean(e._geoloc)}):[],isRefinedWithMap:Boolean(f),currentRefinement:f,position:h}},refine:function(e,t,n){return Nn(t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},getSearchParameters:function(e,t,n){var r=An(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return r?e.setQueryParameter("insideBoundingBox",In(r)):e},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"boundingBox")},getMetadata:function(e,t){var n=[],r="boundingBox",i={ais:e.contextValue,multiIndexContext:e.indexContextValue},a=K(i),s={},o=An(e,t,i);return o&&n.push({label:"".concat(r,": ").concat(In(o)),value:function(e){return Nn(e,s,i)},currentRefinement:o}),{id:r,index:a,items:n}},shouldComponentUpdate:function(){return!0}});function Tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Hn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var kn=function(e){return e.attributes[0]},Mn="hierarchicalMenu";function $n(e,t,n){var r=ne(e,t,n,"".concat(Mn,".").concat(kn(e)),null);return""===r?null:r}function Qn(e,f,h,d){return e.map(function(e){return{label:e.name,value:(t=e.escapedValue,n=f,r=h,i=d,a=n.id,s=n.attributes,o=n.separator,c=n.rootPath,u=n.showParentLevel,l=$n(n,r,i),null===l?t:new lt.SearchParameters({hierarchicalFacets:[{name:a,attributes:s,separator:o,rootPath:c,showParentLevel:u}]}).toggleHierarchicalFacetRefinement(a,l).toggleHierarchicalFacetRefinement(a,t).getHierarchicalRefinement(a)[0]),count:e.count,isRefined:e.isRefined,items:e.data&&Qn(e.data,f,h,d)};var t,n,r,i,a,s,o,c,u,l})}function Bn(e,t,n,r){return ee(t,O({},kn(e),n||""),r,!0,Mn)}var Ln=["name:asc"],qn=q({displayName:"AlgoliaHierarchicalMenu",$$type:"ais.hierarchicalMenu",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},separator:qt.string,rootPath:qt.string,showParentLevel:qt.bool,defaultRefinement:qt.string,showMore:qt.bool,limit:qt.number,showMoreLimit:qt.number,transformItems:qt.func,facetOrdering:qt.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,separator:" > ",rootPath:null,showParentLevel:!0,facetOrdering:!0},getProvidedProps:function(e,t,n){var r=e.showMore,i=e.limit,a=e.showMoreLimit,s=e.facetOrdering,o=kn(e),c=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!(Boolean(c)&&Boolean(c.getFacetByName(o))))return{items:[],currentRefinement:$n(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:!1};var u=r?a:i,l=c.getFacetValues(o,{sortBy:Ln,facetOrdering:s}),f=l.data?Qn(l.data,e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}):[],h=e.transformItems?e.transformItems(f):f;return{items:function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e.slice(0,n).map(function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(e.items)?Hn(Hn({},e),{},{items:t(e.items,n)}):e})}(h,u),currentRefinement:$n(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:0<h.length}},refine:function(e,t,n){return Bn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(Mn,".").concat(kn(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attributes,i=t.separator,a=t.rootPath,s=t.showParentLevel,o=t.showMore,c=t.limit,u=t.showMoreLimit,l=t.contextValue,f=kn(t),h=o?u:c;e=e.addHierarchicalFacet({name:f,attributes:r,separator:i,rootPath:a,showParentLevel:s}).setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,h)});var d=$n(t,n,{ais:l,multiIndexContext:t.indexContextValue});return null!==d&&(e=e.toggleHierarchicalFacetRefinement(f,d)),e},getMetadata:function(t,e){var n=t.attributes[0],r=kn(t),i=$n(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=i?[{label:"".concat(n,": ").concat(A(i)),attribute:n,value:function(e){return Bn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:i}]:[];return{id:r,index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:a}}}),Un=function(e){var t=e.attribute,n=e.hit,r=e.highlightProperty,i=e.preTag,a=void 0===i?U.highlightPreTag:i,s=e.postTag;return function(e){var t=e.preTag,n=void 0===t?"<em>":t,r=e.postTag,i=void 0===r?"</em>":r,a=e.highlightProperty,s=e.attribute,o=e.hit;if(!o)throw new Error("`hit`, the matching record, must be provided");var c=E(o[a],s)||{};return Array.isArray(c)?c.map(function(e){return W({preTag:n,postTag:i,highlightedValue:e.value})}):W({preTag:n,postTag:i,highlightedValue:c.value})}({attribute:t,highlightProperty:r,hit:n,preTag:a,postTag:void 0===s?U.highlightPostTag:s})},Wn=q({displayName:"AlgoliaHighlighter",$$type:"ais.highlighter",propTypes:{},getProvidedProps:function(){return{highlight:Un}}}),zn=q({displayName:"AlgoliaHits",$$type:"ais.hits",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return r?{hits:w(C(r.hits,r.hitsPerPage,r.page),r.queryID)}:{hits:[]}},getSearchParameters:function(e){return e}});function Jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Gn(e,t,n){var r=ne(e,t,n,"hitsPerPage",null);return"string"==typeof r?parseInt(r,10):r}var Kn=q({displayName:"AlgoliaHitsPerPage",$$type:"ais.hitsPerPage",propTypes:{defaultRefinement:qt.number.isRequired,items:qt.arrayOf(qt.shape({label:qt.string,value:qt.number.isRequired})).isRequired,transformItems:qt.func},getProvidedProps:function(e,t){var n=Gn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),r=e.items.map(function(e){return e.value===n?Yn(Yn({},e),{},{isRefined:!0}):Yn(Yn({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(r):r,currentRefinement:n}},refine:function(e,t,n){return ee(t,O({},"hitsPerPage",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"hitsPerPage")},getSearchParameters:function(e,t,n){return e.setHitsPerPage(Gn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(){return{id:"hitsPerPage"}}}),Xn=["page"];function Zn(e){var t=e||{};t.page;return F(t,Xn)}var er=q({displayName:"AlgoliaInfiniteHits",$$type:"ais.infiniteHits",getProvidedProps:function(e,t,n){var r=this,i=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!i)return{hits:[],hasPrevious:!1,hasMore:!1,refine:function(){},refinePrevious:function(){},refineNext:function(){}};var a,s,o=i.page,c=i.hits,u=i.hitsPerPage,l=i.nbPages,f=i._state;this._cache=e.cache?e.cache:this._cache||(s=a=void 0,{read:function(e){var t=e.state;return x(s,Zn(t))?a:null},write:function(e){var t=e.state,n=e.hits;s=Zn(t),a=n}});var h=this._cache.read({state:f})||{},d=w(C(c,u,o),i.queryID);h[o]=d,this._cache.write({state:f,hits:h});var p,m=Math.min.apply(Math,he(Object.keys(h).map(Number))),g=Math.max.apply(Math,he(Object.keys(h).map(Number))),v=0<m,y=g<l-1;return{hits:(p=h,Object.keys(p).map(Number).sort(function(e,t){return e-t}).reduce(function(e,t){return e.concat(p[t])},[])),hasPrevious:v,hasMore:y,refinePrevious:function(e){return r.refine(e,m-1)},refineNext:function(e){return r.refine(e,g+1)}}},getSearchParameters:function(e,t,n){return e.setQueryParameters({page:(r=t,i=n,a={ais:t.contextValue,multiIndexContext:t.indexContextValue},s=ne(r,i,a,"page",1),("string"==typeof s?parseInt(s,10):s)-1)});var r,i,a,s},refine:function(e,t,n,r){return ee(t,O({},"page",r+1),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!1)}}),tr="menu";function nr(e){return e.attribute}function rr(e,t,n){var r=ne(e,t,n,"".concat(tr,".").concat(nr(e)),null);return""===r?null:r}function ir(e,t,n,r){return e===rr(t,n,r)?"":e}function ar(e){var t=e.showMore,n=e.limit,r=e.showMoreLimit;return t?r:n}function sr(e,t,n,r){return ee(t,O({},nr(e),n||""),r,!0,tr)}var or=["count:desc","name:asc"],cr=q({displayName:"AlgoliaMenu",$$type:"ais.menu",propTypes:{attribute:qt.string.isRequired,showMore:qt.bool,limit:qt.number,showMoreLimit:qt.number,defaultRefinement:qt.string,transformItems:qt.func,searchable:qt.bool,facetOrdering:qt.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a,s=t.attribute,o=t.searchable,c=t.indexContextValue,u=t.facetOrdering,l=X(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),f=Boolean(l)&&Boolean(l.getFacetByName(s)),h=Boolean(i&&i[s]&&""!==i.query);if(o&&c)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");if(!f)return{items:[],currentRefinement:rr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:h,searchable:o,canRefine:f};a=h?i[s].map(function(e){return{label:e.value,value:ir(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):l.getFacetValues(s,{sortBy:o?void 0:or,facetOrdering:u}).map(function(e){return{label:e.name,value:ir(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}});var d=t.transformItems?t.transformItems(a):a;return{items:d.slice(0,ar(t)),currentRefinement:rr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:h,searchable:o,canRefine:0<d.length}},refine:function(e,t,n){return sr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:ar(e)}},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(tr,".").concat(nr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute;e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,ar(t))})).addDisjunctiveFacet(r);var i=rr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return null!==i&&(e=e.addDisjunctiveFacetRefinement(r,i)),e},getMetadata:function(t,e){var n=nr(t),r=rr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:n,index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===r?[]:[{label:"".concat(t.attribute,": ").concat(A(r)),attribute:t.attribute,value:function(e){return sr(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:r}]}}});function ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],s=!0,o=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){o=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(o)throw i}}return a}}(e,t)||fe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(e){if(void 0===e.start&&void 0===e.end)return"";var t=void 0!==e.start?e.start:"",n=void 0!==e.end?e.end:"";return"".concat(t,":").concat(n)}var fr="multiRange";function hr(e){return e.attribute}function dr(e,t,n){return ne(e,t,n,"".concat(fr,".").concat(hr(e)),"")}function pr(e,t,n,r){return ee(t,O({},hr(e),n),r,!0,fr)}var mr=q({displayName:"AlgoliaNumericMenu",$$type:"ais.numericMenu",propTypes:{id:qt.string,attribute:qt.string.isRequired,items:qt.arrayOf(qt.shape({label:qt.node,start:qt.number,end:qt.number})).isRequired,transformItems:qt.func},getProvidedProps:function(m,e,t){var n=m.attribute,g=dr(m,e,{ais:m.contextValue,multiIndexContext:m.indexContextValue}),v=X(t,{ais:m.contextValue,multiIndexContext:m.indexContextValue}),r=m.items.map(function(e){var t,n,r,i,a,s,o,c,u,l,f,h,d,p=lr(e);return{label:e.label,value:p,isRefined:p===g,noRefinement:!!v&&(t=hr(m),n=v,r=p,l=n.getFacetByName(t)?n.getFacetStats(t):null,f=r.split(":"),h=0===Number(f[0])||""===r?Number.NEGATIVE_INFINITY:Number(f[0]),d=0===Number(f[1])||""===r?Number.POSITIVE_INFINITY:Number(f[1]),!(Boolean(l)&&(c=h,u=d,(o=l).min>=c&&o.min<=u||o.max>=c&&o.max<=u||(s=d,(a=h)>=(i=l).min&&a<=i.max||s>=i.min&&s<=i.max))))}}),i=v&&v.getFacetByName(n)?v.getFacetStats(n):null,a=V(r,function(e){return!0===e.isRefined});r.some(function(e){return""===e.value})||r.push({value:"",isRefined:void 0===a,noRefinement:!i,label:"All"});var s=m.transformItems?m.transformItems(r):r;return{items:s,currentRefinement:g,canRefine:0<s.length&&s.some(function(e){return!1===e.noRefinement})}},refine:function(e,t,n){return pr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(fr,".").concat(hr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i=function(e){if(0===e.length)return{start:null,end:null};var t=ur(e.split(":"),2),n=t[0],r=t[1];return{start:0<n.length?parseFloat(n):null,end:0<r.length?parseFloat(r):null}}(dr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})),a=i.start,s=i.end;return e=e.addDisjunctiveFacet(r),"number"==typeof a&&(e=e.addNumericRefinement(r,">=",a)),"number"==typeof s&&(e=e.addNumericRefinement(r,"<=",s)),e},getMetadata:function(t,e){var n=hr(t),r=dr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),i=[],a=K({ais:t.contextValue,multiIndexContext:t.indexContextValue});if(""!==r){var s=V(t.items,function(e){return lr(e)===r}).label;i.push({label:"".concat(t.attribute,": ").concat(s),attribute:t.attribute,currentRefinement:s,value:function(e){return pr(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})}})}return{id:n,index:a,items:i}}});function gr(e,t,n){var r=ne(e,t,n,"page",1);return"string"==typeof r?parseInt(r,10):r}var vr=q({displayName:"AlgoliaPagination",$$type:"ais.pagination",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!r)return null;var i=r.nbPages;return{nbPages:i,currentRefinement:gr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:1<i}},refine:function(e,t,n){return r=t,i=n,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},ee(r,O({},"page",i),a,!1);var r,i,a},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"page")},getSearchParameters:function(e,t,n){return e.setPage(gr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})-1)},getMetadata:function(){return{id:"page"}}}),yr=q({displayName:"AlgoliaPoweredBy",$$type:"ais.poweredBy",getProvidedProps:function(){var e="undefined"==typeof window||void 0===window.location?"":window.location.hostname;return{url:"https://www.algolia.com/?utm_source=react-instantsearch&utm_medium=website&"+"utm_content=".concat(e,"&")+"utm_campaign=poweredby"}}});function xr(e){return e.attribute}var br="range";function Rr(e,t,n,r){var i=ne(e,t,r,"".concat(br,".").concat(xr(e)),{}),a=i.min,s=i.max,o=Boolean(e.precision),c=a;"string"==typeof c&&(c=o?parseFloat(c):parseInt(c,10));var u=s;"string"==typeof u&&(u=o?parseFloat(u):parseInt(u,10));var l={min:c,max:u},f=void 0!==e.min,h=void 0!==e.max,d=void 0!==l.min,p=void 0!==l.max;if(f&&d&&l.min<n.min)throw Error("You can't provide min value lower than range.");if(h&&p&&l.max>n.max)throw Error("You can't provide max value greater than range.");return f&&!d&&(l.min=n.min),h&&!p&&(l.max=n.max),l}function Pr(e,t){return{min:void 0!==e.min?e.min:t.min,max:void 0!==e.max?e.max:t.max}}function Fr(e,t,n,r){return e||n!==r?e&&t?n:r:void 0}function Or(e,t,n,r,i){var a=n.min,s=n.max,o=r.min,c=r.max,u=void 0===a||""===a,l=void 0===s||""===s,f=u?void 0:parseFloat(a),h=l?void 0:parseFloat(s),d=u||isFinite(f),p=l||isFinite(h);if(!d||!p)throw Error("You can't provide non finite values to the range connector.");if(f<o)throw Error("You can't provide min value lower than range.");if(c<h)throw Error("You can't provide max value greater than range.");return ee(t,O({},xr(e),{min:Fr(void 0!==e.min,u,o,f),max:Fr(void 0!==e.max,l,c,h)}),i,!0,br)}var Sr=q({displayName:"AlgoliaRange",$$type:"ais.range",propTypes:{id:qt.string,attribute:qt.string.isRequired,defaultRefinement:qt.shape({min:qt.number,max:qt.number}),min:qt.number,max:qt.number,precision:qt.number,header:qt.node,footer:qt.node},defaultProps:{precision:0},getProvidedProps:function(e,t,n){var r,i,a,s,o,c,u=e.attribute,l=e.precision,f=e.min,h=e.max,d=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),p=d&&d.getFacetByName(u),m=p&&d.getFacetStats(u)||{},g=(p?d.getFacetValues(u):[]).map(function(e){return{value:e.name,count:e.count}}),v=(r={min:f,max:h},i=m,a=l,c=Math.pow(10,a),s="number"==typeof r.min&&isFinite(r.min)?r.min:"number"==typeof i.min&&isFinite(i.min)?i.min:void 0,o="number"==typeof r.max&&isFinite(r.max)?r.max:"number"==typeof i.max&&isFinite(i.max)?i.max:void 0,{min:void 0!==s?Math.floor(s*c)/c:s,max:void 0!==o?Math.ceil(o*c)/c:o}),y=v.min,x=v.max;this._currentRange={min:y,max:x};var b=Rr(e,t,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{min:y,max:x,canRefine:0<g.length,currentRefinement:Pr(b,this._currentRange),count:g,precision:l}},refine:function(e,t,n){return Or(e,t,n,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(br,".").concat(xr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i=Rr(t,n,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=i.min,s=i.max;return e=e.addDisjunctiveFacet(r),void 0!==a&&(e=e.addNumericRefinement(r,">=",a)),void 0!==s&&(e=e.addNumericRefinement(r,"<=",s)),e},getMetadata:function(t,e){var n=this,r=this._currentRange,i=r.min,a=r.max,s=Rr(t,e,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),o=s.min,c=s.max,u=[],l=void 0!==o,f=void 0!==c;if(l&&o!==i||f&&c!==a){var h=[l?"".concat(o," <= "):"",t.attribute,f?" <= ".concat(c):""];u.push({label:h.join(""),attribute:t.attribute,value:function(e){return Or(t,e,{},n._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:Pr({min:o,max:c},{min:i,max:a})})}return{id:xr(t),index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:u}}}),jr="refinementList";function Cr(e){return e.attribute}function wr(e,t,n){var r=ne(e,t,n,"".concat(jr,".").concat(Cr(e)),[]);return"string"!=typeof r?r:r?[r]:[]}function Vr(t,e,n,r){var i=wr(e,n,r);return-1===i.indexOf(t)?i.concat([t]):i.filter(function(e){return e!==t})}function Ir(e){var t=e.showMore,n=e.limit,r=e.showMoreLimit;return t?r:n}function _r(e,t,n,r){return ee(t,O({},Cr(e),0<n.length?n:""),r,!0,jr)}var Er=["isRefined","count:desc","name:asc"],Ar=q({displayName:"AlgoliaRefinementList",$$type:"ais.refinementList",propTypes:{id:qt.string,attribute:qt.string.isRequired,operator:qt.oneOf(["and","or"]),showMore:qt.bool,limit:qt.number,showMoreLimit:qt.number,defaultRefinement:qt.arrayOf(qt.oneOfType([qt.string,qt.number])),searchable:qt.bool,transformItems:qt.func,facetOrdering:qt.bool},defaultProps:{operator:"or",showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a=t.attribute,s=t.searchable,o=t.indexContextValue,c=t.facetOrdering,u=X(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),l=Boolean(u)&&Boolean(u.getFacetByName(a)),f=Boolean(i&&i[a]&&""!==i.query);if(s&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");if(!l)return{items:[],currentRefinement:wr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),canRefine:l,isFromSearch:f,searchable:s};var h=f?i[a].map(function(e){return{label:e.value,value:Vr(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):u.getFacetValues(a,{sortBy:Er,facetOrdering:c}).map(function(e){return{label:e.name,value:Vr(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),d=t.transformItems?t.transformItems(h):h;return{items:d.slice(0,Ir(t)),currentRefinement:wr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:f,searchable:s,canRefine:0<d.length}},refine:function(e,t,n){return _r(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:Ir(e)}},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(jr,".").concat(Cr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i="and"===t.operator?"addFacet":"addDisjunctiveFacet",a="".concat(i,"Refinement");return e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,Ir(t))}))[i](r),wr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}).reduce(function(e,t){return e[a](r,t)},e)},getMetadata:function(r,i){var e=Cr(r),a={ais:r.contextValue,multiIndexContext:r.indexContextValue};return{id:e,index:K(a),items:0<wr(r,i,a).length?[{attribute:r.attribute,label:"".concat(r.attribute,": "),currentRefinement:wr(r,i,a),value:function(e){return _r(r,e,[],a)},items:wr(r,i,a).map(function(n){return{label:A("".concat(n)),value:function(e){var t=wr(r,e,a).filter(function(e){return e!==n});return _r(r,i,t,a)}}})}]:[]}}}),Nr=q({displayName:"AlgoliaScrollTo",$$type:"ais.scrollTo",propTypes:{scrollOn:qt.string},defaultProps:{scrollOn:"page"},getProvidedProps:function(e,t){var n=e.scrollOn,r=ne(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},n,null);this._prevSearchState||(this._prevSearchState={}),Z({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&(t=t.indices?t.indices[K({ais:e.contextValue,multiIndexContext:e.indexContextValue})]:{});var i=_(t,["configure",n]),a=R(this._prevSearchState,i);return this._prevSearchState=i,{value:r,hasNotChanged:a}}});function Dr(e,t,n){var r=ne(e,t,n,"query","");return r||""}function Tr(e,t,n,r){return ee(t,O({},"query",n),r,!0)}var Hr=q({displayName:"AlgoliaSearchBox",$$type:"ais.searchBox",propTypes:{defaultRefinement:qt.string},getProvidedProps:function(e,t,n){return{currentRefinement:Dr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return Tr(0,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,r={ais:e.contextValue,multiIndexContext:e.indexContextValue},re(n,r,"query");var n,r},getSearchParameters:function(e,t,n){return e.setQuery(Dr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(t,e){var n=Dr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===n?[]:[{label:"".concat("query",": ").concat(n),value:function(e){return Tr(0,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:n}]}}});var kr=q({displayName:"AlgoliaRelevantSort",$$type:"ais.relevantSort",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return r?{isVirtualReplica:void 0!==r.appliedRelevancyStrictness,isRelevantSorted:void 0!==r.appliedRelevancyStrictness&&0<r.appliedRelevancyStrictness}:{isVirtualReplica:!1,isRelevantSorted:!1}},getSearchParameters:function(e,t,n){return e.setQueryParameter("relevancyStrictness",(i=n,a={ais:(r=t).contextValue,multiIndexContext:t.indexContextValue},ne(r,i,a,"relevancyStrictness")));var r,i,a},refine:function(e,t,n){return ee(t,O({},"relevancyStrictness",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)}});function Mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function $r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mr(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Qr(e,t,n){var r=ne(e,t,n,"sortBy",null);return r||null}var Br=q({displayName:"AlgoliaSortBy",$$type:"ais.sortBy",propTypes:{defaultRefinement:qt.string,items:qt.arrayOf(qt.shape({label:qt.string,value:qt.string.isRequired})).isRequired,transformItems:qt.func},getProvidedProps:function(e,t){var n=Qr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),r=e.items.map(function(e){return e.value===n?$r($r({},e),{},{isRefined:!0}):$r($r({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(r):r,currentRefinement:n}},refine:function(e,t,n){return ee(t,O({},"sortBy",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"sortBy")},getSearchParameters:function(e,t,n){var r=Qr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return e.setIndex(r)},getMetadata:function(){return{id:"sortBy"}}}),Lr=q({displayName:"AlgoliaStateResults",$$type:"ais.stateResults",getProvidedProps:function(e,t,n){return{searchState:t,searchResults:X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),allSearchResults:n.results,searching:n.searching,isSearchStalled:n.isSearchStalled,error:n.error,searchingForFacetValues:n.searchingForFacetValues,props:e}}}),qr=q({displayName:"AlgoliaStats",$$type:"ais.stats",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return r?{areHitsSorted:void 0!==r.appliedRelevancyStrictness&&0<r.appliedRelevancyStrictness&&r.nbHits!==r.nbSortedHits,nbHits:r.nbHits,nbSortedHits:r.nbSortedHits,processingTimeMS:r.processingTimeMS}:null}});function Ur(e){return e.attribute}var Wr="toggle",zr=["0","false","null","undefined"];function Jr(e,t,n){var r=ne(e,t,n,"".concat(Wr,".").concat(Ur(e)),!1);return-1===zr.indexOf(r)&&Boolean(r)}function Yr(e,t,n,r){return ee(t,O({},Ur(e),n||!1),r,!0,Wr)}var Gr=q({displayName:"AlgoliaToggle",$$type:"ais.toggle",propTypes:{label:qt.string.isRequired,attribute:qt.string.isRequired,value:qt.any.isRequired,filter:qt.func,defaultRefinement:qt.bool},getProvidedProps:function(e,t,n){var r=e.attribute,i=e.value,a=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),s=Jr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),o=a&&a.getFacetByName(r)?a.getFacetValues(r):null,c=o&&o.length?V(o,function(e){return e.name===i.toString()}):null,u=c&&c.count,l=o&&o.length?o.reduce(function(e,t){return e+t.count},0):null;return{currentRefinement:s,canRefine:s?null!==l&&0<l:null!==u&&0<u,count:{checked:l,unchecked:u}}},refine:function(e,t,n){return Yr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(Wr,".").concat(Ur(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i=t.value,a=t.filter,s=Jr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),o=e.addDisjunctiveFacet(r);return s&&(o=o.addDisjunctiveFacetRefinement(r,i),a&&(o=a(o))),o},getMetadata:function(t,e){var n=Ur(t),r=Jr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),i=[],a=K({ais:t.contextValue,multiIndexContext:t.indexContextValue});return r&&i.push({label:t.label,currentRefinement:r,attribute:t.attribute,value:function(e){return Yr(t,e,!1,{ais:t.contextValue,multiIndexContext:t.indexContextValue})}}),{id:n,index:a,items:i}}});function Kr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Xr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kr(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Zr=function(r,i,a){return function(e,t){if("function"!=typeof r)throw new TypeError("Expected insightsClient to be a Function");var n=function(e){var t=e.method,n=e.results,r=e.currentHit,i=n.index,a=r.__queryID,s=[r.objectID];if(!a)throw new Error("Could not infer `queryID`. Ensure `clickAnalytics: true` was added with the Configure widget.\nSee: https://alg.li/VpPpLt");switch(t){case"clickedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s,positions:[r.__position]};case"convertedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s};default:throw new Error('Unsupported method "'.concat(t,'" passed to the insights function. The supported methods are: "clickedObjectIDsAfterSearch", "convertedObjectIDsAfterSearch".'))}}({method:e,results:i,currentHit:a});r(e,Xr(Xr({},n),t))}};function ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ti(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ei(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ni(e,t,n){var r=ne(e,t,n,"query","");return r||""}function ri(e,t,n,r){var i,a=e.language?{queryLanguages:[e.language.split("-")[0]]}:{},s="function"==typeof e.additionalQueryParameters?ti({ignorePlurals:!0,removeStopWords:!0,optionalWords:n},e.additionalQueryParameters({query:n})):{};return ee(t,(O(i={},"query",n),O(i,"additionalVoiceParameters",ti(ti({},a),s)),i),r,!0)}var ii=q({displayName:"AlgoliaVoiceSearch",$$type:"ais.voiceSearch",propTypes:{defaultRefinement:qt.string},getProvidedProps:function(e,t,n){return{currentRefinement:ni(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return ri(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,r={ais:e.contextValue,multiIndexContext:e.indexContextValue},re(re(n,r,"query"),r,"additionalVoiceParameters");var n,r},getSearchParameters:function(e,t,n){var r,i,a,s=ni(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),o=(i=n,a={ais:(r=t).contextValue,multiIndexContext:t.indexContextValue},ne(r,i,a,"additionalVoiceParameters","")||{});return e.setQuery(s).setQueryParameters(o)},getMetadata:function(t,e){var n=ni(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===n?[]:[{label:"".concat("query",": ").concat(n),value:function(e){return ri(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:n}]}}}),ai=Yt,si=zt;e.Configure=ue,e.DynamicWidgets=Yt,e.EXPERIMENTAL_connectConfigureRelatedItems=mt,e.EXPERIMENTAL_connectDynamicWidgets=si,e.ExperimentalConfigureRelatedItems=Wt,e.ExperimentalDynamicWidgets=ai,e.HIGHLIGHT_TAGS=U,e.Index=function(t){var n=t.indexName;return c.createElement(D,null,function(e){return c.createElement(tn,u({contextValue:e,indexId:n},t))})},e.InstantSearch=Rn,e.InstantSearchConsumer=D,e.InstantSearchProvider=T,e.QueryRuleContext=Xt,e.connectAutoComplete=Fn,e.connectBreadcrumb=Sn,e.connectConfigure=ce,e.connectCurrentRefinements=wn,e.connectDynamicWidgets=zt,e.connectGeoSearch=Dn,e.connectHierarchicalMenu=qn,e.connectHighlight=Wn,e.connectHitInsights=function(i){return q({displayName:"AlgoliaInsights",$$type:"ais.insights",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{insights:Zr(i,r,e.hit)}}})},e.connectHits=zn,e.connectHitsPerPage=Kn,e.connectInfiniteHits=er,e.connectMenu=cr,e.connectNumericMenu=mr,e.connectPagination=vr,e.connectPoweredBy=yr,e.connectQueryRules=Kt,e.connectRange=Sr,e.connectRefinementList=Ar,e.connectRelevantSort=kr,e.connectScrollTo=Nr,e.connectSearchBox=Hr,e.connectSortBy=Br,e.connectStateResults=Lr,e.connectStats=qr,e.connectToggleRefinement=Gr,e.connectVoiceSearch=ii,e.createConnector=q,e.instantSearchContext=N,e.translatable=function(o){return function(t){var e=function(e){p(i,s.Component);var r=J(i);function i(){var s;f(this,i);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O(d(s=r.call.apply(r,[this].concat(t))),"translate",function(e){var t=s.props.translations,n=t&&t.hasOwnProperty(e)?t[e]:o[e];if("function"!=typeof n)return n;for(var r=arguments.length,i=new Array(1<r?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return n.apply(void 0,i)}),s}return h(i,[{key:"render",value:function(){return c.createElement(t,u({translate:this.translate},this.props))}}]),i}(),n=t.displayName||t.name||"UnknownComponent";return e.displayName="Translatable(".concat(n,")"),e}},e.version=z,Object.defineProperty(e,"__esModule",{value:!0})});
1
+ /*! React InstantSearchCore 6.36.0 | © Algolia, inc. | https://github.com/algolia/react-instantsearch */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e=e||self).ReactInstantSearchCore={},e.React)}(this,function(e,s){"use strict";var c="default"in s?s.default:s;function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function F(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m="undefined"!=typeof Element,g="function"==typeof Map,v="function"==typeof Set,y="function"==typeof ArrayBuffer;var x=function(e,t){try{return function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,i,a,s;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if(g&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1;for(s=t.entries();!(i=s.next()).done;)if(!e(i.value[1],n.get(i.value[0])))return!1;return!0}if(v&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(s=t.entries();!(i=s.next()).done;)if(!n.has(i.value[0]))return!1;return!0}if(y&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;if(m&&t instanceof Element)return!1;for(i=r;0!=i--;)if(!("_owner"===a[i]&&t.$$typeof||e(t[a[i]],n[a[i]])))return!1;return!0}return t!=t&&n!=n}(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}};function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function b(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var R=function(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,a=0;a<n.length;a++)if(!i.call(t,n[a])||e[n[a]]!==t[n[a]])return!1;return!0},P=function(e){return e.displayName||e.name||"UnknownComponent"},t=Promise.resolve(),S=function(e){t.then(e)},j=function r(i){return Object.keys(i).forEach(function(e){var t,n=i[e];"object"!==o(t=n)||null===t||Array.isArray(t)||(I(n)?r(n):delete i[e])}),i};function C(e,n,r){return e.map(function(e,t){return b(b({},e),{},{__position:n*r+t+1})})}function w(e,t){return t?e.map(function(e){return b(b({},e),{},{__queryID:t})}):e}function V(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function I(e){return e&&0<Object.keys(e).length}function _(e,t){if(null==e)return{};for(var n={},r=Object.keys(e),i=0;i<r.length;i++){var a=r[i];0<=t.indexOf(a)||(n[a]=e[a])}return n}var E=function(e,t){return(Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".")).reduce(function(e,t){return e?e[t]:void 0},e)};function A(e){return e.replace(/^\\-/,"-")}var N=s.createContext({onInternalStateUpdate:function(){},createHrefForState:function(){return"#"},onSearchForFacetValues:function(){},onSearchStateChange:function(){},onSearchParameters:function(){},store:{},widgetsManager:{},mainTargetedIndex:""}),D=N.Consumer,T=N.Provider,H=s.createContext(void 0),k=H.Consumer,M=H.Provider,$=["contextValue"];function Q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function B(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Q(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function L(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}var q=function(n){return function(e,t){var r=function(l){if(!l.displayName)throw new Error("`createConnector` requires you to provide a `displayName` property.");var r="function"==typeof l.getSearchParameters||"function"==typeof l.getMetadata||"function"==typeof l.transitionState;return function(a){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=function(e){p(n,s.Component);var t=L(n);function n(e){var i;return f(this,n),O(d(i=t.call(this,e)),"unsubscribe",void 0),O(d(i),"unregisterWidget",void 0),O(d(i),"isUnmounting",!1),O(d(i),"state",{providedProps:i.getProvidedProps(i.props)}),O(d(i),"refine",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onInternalStateUpdate((e=l.refine).call.apply(e,[d(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),O(d(i),"createURL",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return i.props.contextValue.createHrefForState((e=l.refine).call.apply(e,[d(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),O(d(i),"searchForFacetValues",function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.props.contextValue.onSearchForFacetValues((e=l.searchForFacetValues).call.apply(e,[d(i),i.props,i.props.contextValue.store.getState().widgets].concat(n)))}),l.getSearchParameters&&i.props.contextValue.onSearchParameters(l.getSearchParameters.bind(d(i)),{ais:i.props.contextValue,multiIndexContext:i.props.indexContextValue},i.props,l.getMetadata&&l.getMetadata.bind(d(i)),l.displayName),i}return h(n,[{key:"componentDidMount",value:function(){var e=this;this.unsubscribe=this.props.contextValue.store.subscribe(function(){e.isUnmounting||e.setState({providedProps:e.getProvidedProps(e.props)})}),r&&(this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this))}},{key:"shouldComponentUpdate",value:function(e,t){if("function"==typeof l.shouldComponentUpdate)return l.shouldComponentUpdate.call(this,this.props,e,this.state,t);var n=R(this.props,e);return null===this.state.providedProps||null===t.providedProps?this.state.providedProps!==t.providedProps||!n:!n||!R(this.state.providedProps,t.providedProps)}},{key:"componentDidUpdate",value:function(e){x(e,this.props)||(this.setState({providedProps:this.getProvidedProps(this.props)}),r&&(this.props.contextValue.widgetsManager.update(),"function"==typeof l.transitionState&&this.props.contextValue.onSearchStateChange(l.transitionState.call(this,this.props,this.props.contextValue.store.getState().widgets,this.props.contextValue.store.getState().widgets))))}},{key:"componentWillUnmount",value:function(){if(this.isUnmounting=!0,this.unsubscribe&&this.unsubscribe(),this.unregisterWidget&&(this.unregisterWidget(),"function"==typeof l.cleanUp)){var e=l.cleanUp.call(this,this.props,this.props.contextValue.store.getState().widgets);this.props.contextValue.store.setState(B(B({},this.props.contextValue.store.getState()),{},{widgets:e})),this.props.contextValue.onSearchStateChange(j(e))}}},{key:"getProvidedProps",value:function(e){var t=this.props.contextValue.store.getState(),n=t.widgets,r=t.results,i=t.resultsFacetValues,a=t.searching,s=t.searchingForFacetValues,o=t.isSearchStalled,c=t.metadata,u={results:r,searching:a,searchingForFacetValues:s,isSearchStalled:o,error:t.error};return l.getProvidedProps.call(this,e,n,u,c,i)}},{key:"getSearchParameters",value:function(e){return"function"==typeof l.getSearchParameters?l.getSearchParameters.call(this,e,this.props,this.props.contextValue.store.getState().widgets):null}},{key:"getMetadata",value:function(e){return"function"==typeof l.getMetadata?l.getMetadata.call(this,this.props,e):{}}},{key:"transitionState",value:function(e,t){return"function"==typeof l.transitionState?l.transitionState.call(this,this.props,e,t):t}},{key:"render",value:function(){var e=this.props,t=(e.contextValue,F(e,$)),n=this.state.providedProps;if(null===n)return null;var r="function"==typeof l.refine?{refine:this.refine,createURL:this.createURL}:{},i="function"==typeof l.searchForFacetValues?{searchForItems:this.searchForFacetValues}:{};return c.createElement(a,u({},t,n,r,i))}}]),n}();return O(t,"displayName","".concat(l.displayName,"(").concat(P(a),")")),O(t,"$$type",l.$$type),O(t,"$$widgetType",e.$$widgetType),O(t,"defaultProps",l.defaultProps),O(t,"_connectorDesc",l),t}}(n)(e,t);return function(n){return c.createElement(D,null,function(t){return c.createElement(k,null,function(e){return c.createElement(r,u({contextValue:t,indexContextValue:e},n))})})}}},U={highlightPreTag:"<ais-highlight-0000000000>",highlightPostTag:"</ais-highlight-0000000000>"};function W(e){var t=e.preTag,n=e.postTag,r=e.highlightedValue,i=(void 0===r?"":r).split(t),a=i.shift(),s=""===a?[]:[{value:a,isHighlighted:!1}];if(n===t){var o=!0;i.forEach(function(e){s.push({value:e,isHighlighted:o}),o=!o})}else i.forEach(function(e){var t=e.split(n);s.push({value:t[0],isHighlighted:!0}),""!==t[1]&&s.push({value:t[1],isHighlighted:!1})});return s}var z="6.36.0";function J(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Y(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function K(e){return Z(e)?e.multiIndexContext.targetedIndex:e.ais.mainTargetedIndex}function X(e,t){if(e.results){if(e.results.hits)return e.results;var n=K(t);if(e.results[n])return e.results[n]}return null}function Z(e){return e&&e.multiIndexContext}function ee(t,e,n,r,i){if(Z(n)){var a=K(n);return i?(y=e,x=a,b=i,P=r?{page:1}:void 0,F=(v=t).indices&&v.indices[x]?G(G({},v.indices),{},O({},x,G(G({},v.indices[x]),{},(O(R={},b,G(G({},v.indices[x][b]),y)),O(R,"page",1),R)))):G(G({},v.indices),{},O({},x,G(O({},b,y),P))),G(G({},v),{},{indices:F})):(d=e,p=a,m=r?{page:1}:void 0,g=(h=t).indices&&h.indices[p]?G(G({},h.indices),{},O({},p,G(G(G({},h.indices[p]),d),m))):G(G({},h.indices),{},O({},p,G(G({},d),m))),G(G({},h),{},{indices:g}))}return t.indices&&r&&Object.keys(t.indices).forEach(function(e){t=ee(t,{page:1},{multiIndexContext:{targetedIndex:e}},!0,i)}),i?(u=e,l=i,f=r?{page:1}:void 0,G(G({},c=t),{},O({},l,G(G({},c[l]),u)),f)):(s=e,o=r?{page:1}:void 0,G(G(G({},t),s),o));var s,o,c,u,l,f,h,d,p,m,g,v,y,x,b,R,P,F}function te(e){var t=e.match(/^([^.]*)\.(.*)/);return{namespace:t&&t[1],attributeName:t&&t[2]}}function ne(e,t,n,r,i){var a,s,o,c,u,l,f,h,d,p,m,g,v,y,x=K(n),b=te(r),R=b.namespace,P=b.attributeName,F={multiIndex:Z(n),indexId:x,namespace:R,attributeName:P,id:r,searchState:t};return(s=(a=F).multiIndex,o=a.indexId,c=a.namespace,u=a.attributeName,l=a.id,f=a.searchState,s&&c?f.indices&&f.indices[o]&&f.indices[o][c]&&Object.hasOwnProperty.call(f.indices[o][c],u):s?f.indices&&f.indices[o]&&Object.hasOwnProperty.call(f.indices[o],l):c?f[c]&&Object.hasOwnProperty.call(f[c],u):Object.hasOwnProperty.call(f,l))?(d=(h=F).multiIndex,p=h.indexId,m=h.namespace,g=h.attributeName,v=h.id,y=h.searchState,d&&m?y.indices[p][m][g]:d?y.indices[p][v]:m?y[m][g]:y[v]):e.defaultRefinement?e.defaultRefinement:i}function re(e,t,n){var r=K(t),i=te(n),a=i.namespace,s=i.attributeName;return Z(t)&&Boolean(e.indices)?function(e){var t=e.searchState,n=e.indexId,r=e.id,i=e.namespace,a=e.attribute,s=t.indices[n];if(i&&s)return G(G({},t),{},{indices:G(G({},t.indices),{},O({},n,G(G({},s),{},O({},i,_(s[i],[a])))))});if(s)return G(G({},t),{},{indices:G(G({},t.indices),{},O({},n,_(s,[r])))});return t}({attribute:s,searchState:e,indexId:r,id:n,namespace:a}):function(e){var t=e.searchState,n=e.id,r=e.namespace,i=e.attribute;if(r)return G(G({},t),{},O({},r,_(t[r],[i])));return _(t,[n])}({attribute:s,searchState:e,id:n,namespace:a})}var ie=["children","contextValue","indexContextValue"],ae=["children","contextValue","indexContextValue"];function se(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function oe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?se(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var ce=q({displayName:"AlgoliaConfigure",$$type:"ais.configure",getProvidedProps:function(){return{}},getSearchParameters:function(e,t){t.children,t.contextValue,t.indexContextValue;var n=F(t,ie);return e.setQueryParameters(n)},transitionState:function(e,t,n){var r="configure",i=(e.children,e.contextValue,e.indexContextValue,F(e,ae)),a=Object.keys(e),s=this._props?Object.keys(this._props).filter(function(e){return-1===a.indexOf(e)}):[];return this._props=e,ee(n,O({},r,oe(oe({},_(n[r],s)),i)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(n,e){var r="configure",t=K({ais:n.contextValue,multiIndexContext:n.indexContextValue}),i=Z({ais:n.contextValue,multiIndexContext:n.indexContextValue})&&e.indices?e.indices[t]:e,a=(i&&i[r]?Object.keys(i[r]):[]).reduce(function(e,t){return n[t]||(e[t]=i[r][t]),e},{});return ee(e,O({},r,a),{ais:n.contextValue,multiIndexContext:n.indexContextValue})}}),ue=ce(function(){return null},{$$widgetType:"ais.configure"});function le(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fe(e,t){if(e){if("string"==typeof e)return le(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?le(e,t):void 0}}function he(e){return function(e){if(Array.isArray(e))return le(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||fe(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function de(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function pe(e,t){if(e===t)return e;for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&"__proto__"!==n){var r=t[n],i=e[n];void 0!==i&&void 0===r||(de(i)&&de(r)?e[n]=pe(i,r):e[n]="object"==typeof(a=r)&&null!==a?pe(Array.isArray(a)?[]:{},a):a)}var a;return e}var me=function(e){de(e)||(e={});for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];de(r)&&pe(e,r)}return e},ge=function(){return Array.prototype.slice.call(arguments).reduceRight(function(t,n){return Object.keys(Object(n)).forEach(function(e){void 0!==n[e]&&(void 0!==t[e]&&delete t[e],t[e]=n[e])}),t},{})};var ve=function(n,r){return n.filter(function(e,t){return-1<r.indexOf(e)&&n.indexOf(e)===t})},ye=function(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]};var xe=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")};var be=function(e,t){if(null===e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],0<=t.indexOf(n)||(i[n]=e[n]);return i};var Re=function(e){return e&&0<Object.keys(e).length},Pe=function(e){return null!==e&&/^[a-zA-Z0-9_-]{1,64}$/.test(e)},Fe={addRefinement:function(e,t,n){if(Fe.isRefined(e,t,n))return e;var r=""+n,i=e[t]?e[t].concat(r):[r],a={};return a[t]=i,ge({},a,e)},removeRefinement:function(e,n,t){if(void 0===t)return Fe.clearRefinement(e,function(e,t){return n===t});var r=""+t;return Fe.clearRefinement(e,function(e,t){return n===t&&r===e})},toggleRefinement:function(e,t,n){if(void 0===n)throw new Error("toggleRefinement should be used with a value");return Fe.isRefined(e,t,n)?Fe.removeRefinement(e,t,n):Fe.addRefinement(e,t,n)},clearRefinement:function(i,a,s){if(void 0===a)return Re(i)?{}:i;if("string"==typeof a)return be(i,[a]);if("function"==typeof a){var o=!1,e=Object.keys(i).reduce(function(e,t){var n=i[t]||[],r=n.filter(function(e){return!a(e,t,s)});return r.length!==n.length&&(o=!0),e[t]=r,e},{});return o?e:i}},isRefined:function(e,t,n){var r=!!e[t]&&0<e[t].length;if(void 0===n||!r)return r;var i=""+n;return-1!==e[t].indexOf(i)}},Oe=Fe;function Se(e,n){return Array.isArray(e)&&Array.isArray(n)?e.length===n.length&&e.every(function(e,t){return Se(n[t],e)}):e===n}function je(e){var r=e?je._parseNumbers(e):{};void 0===r.userToken||Pe(r.userToken)||console.warn("[algoliasearch-helper] The `userToken` parameter is invalid. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=r.facets||[],this.disjunctiveFacets=r.disjunctiveFacets||[],this.hierarchicalFacets=r.hierarchicalFacets||[],this.facetsRefinements=r.facetsRefinements||{},this.facetsExcludes=r.facetsExcludes||{},this.disjunctiveFacetsRefinements=r.disjunctiveFacetsRefinements||{},this.numericRefinements=r.numericRefinements||{},this.tagRefinements=r.tagRefinements||[],this.hierarchicalFacetsRefinements=r.hierarchicalFacetsRefinements||{};var i=this;Object.keys(r).forEach(function(e){var t=-1!==je.PARAMETERS.indexOf(e),n=void 0!==r[e];!t&&n&&(i[e]=r[e])})}je.PARAMETERS=Object.keys(new je),je._parseNumbers=function(i){if(i instanceof je)return i;var r={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(e){var t=i[e];if("string"==typeof t){var n=parseFloat(t);r[e]=isNaN(n)?t:n}}),Array.isArray(i.insideBoundingBox)&&(r.insideBoundingBox=i.insideBoundingBox.map(function(e){return Array.isArray(e)?e.map(function(e){return parseFloat(e)}):e})),i.numericRefinements){var a={};Object.keys(i.numericRefinements).forEach(function(n){var r=i.numericRefinements[n]||{};a[n]={},Object.keys(r).forEach(function(e){var t=r[e].map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});a[n][e]=t})}),r.numericRefinements=a}return me({},i,r)},je.make=function(e){var n=new je(e);return(e.hierarchicalFacets||[]).forEach(function(e){if(e.rootPath){var t=n.getHierarchicalRefinement(e.name);0<t.length&&0!==t[0].indexOf(e.rootPath)&&(n=n.clearRefinements(e.name)),0===(t=n.getHierarchicalRefinement(e.name)).length&&(n=n.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),n},je.validate=function(e,t){var n=t||{};return e.tagFilters&&n.tagRefinements&&0<n.tagRefinements.length?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."):0<e.tagRefinements.length&&n.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."):e.numericFilters&&n.numericRefinements&&Re(n.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."):Re(e.numericRefinements)&&n.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},je.prototype={constructor:je,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:Oe.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:Oe.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:Oe.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:Oe.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,n){var r=xe(n);if(this.isNumericRefined(e,t,r))return this;var i=me({},this.numericRefinements);return i[e]=me({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(r)):i[e][t]=[r],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(n,r,i){return void 0!==i?this.isNumericRefined(n,r,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r&&Se(e.val,xe(i))})}):this:void 0!==r?this.isNumericRefined(n,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n&&e.op===r})}):this:this.isNumericRefined(n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(e,t){return t===n})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(s){if(void 0===s)return Re(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof s)return be(this.numericRefinements,[s]);if("function"==typeof s){var o=!1,t=this.numericRefinements,e=Object.keys(t).reduce(function(e,r){var i=t[r],a={};return i=i||{},Object.keys(i).forEach(function(t){var e=i[t]||[],n=[];e.forEach(function(e){s({val:e,op:t},r,"numeric")||n.push(e)}),n.length!==e.length&&(o=!0),a[t]=n}),e[r]=a,e},{});return o?e:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:Oe.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:Oe.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Oe.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:Oe.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(t){return this.isConjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({facets:this.facets.filter(function(e){return e!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(e){return e!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(e){return e.name!==t})}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:Oe.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return Oe.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:Oe.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Oe.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:Oe.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(t){if(!this.isTagRefined(t))return this;var e={tagRefinements:this.tagRefinements.filter(function(e){return e!==t})};return this.setQueryParameters(e)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:Oe.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:Oe.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:Oe.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),r={};return void 0!==this.hierarchicalFacetsRefinements[e]&&0<this.hierarchicalFacetsRefinements[e].length&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+n))?-1===t.indexOf(n)?r[e]=[]:r[e]=[t.slice(0,t.lastIndexOf(n))]:r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:ge({},r,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var n={};return n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:ge({},n,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:ge({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return-1<this.disjunctiveFacets.indexOf(e)},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return-1<this.facets.indexOf(e)},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&Oe.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&Oe.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&Oe.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var n=this.getHierarchicalRefinement(e);return t?-1!==n.indexOf(t):0<n.length},isNumericRefined:function(e,t,n){if(void 0===n&&void 0===t)return!!this.numericRefinements[e];var r=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===n||!r)return r;var i,a,s=xe(n),o=void 0!==(i=this.numericRefinements[e][t],a=s,ye(i,function(e){return Se(e,a)}));return r&&o},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var t=this,e=ve(Object.keys(this.numericRefinements).filter(function(e){return 0<Object.keys(t.numericRefinements[e]).length}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(e){return 0<t.disjunctiveFacetsRefinements[e].length}).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var t=this;return ve(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(e){return 0<t.hierarchicalFacetsRefinements[e].length}))},getUnrefinedDisjunctiveFacets:function(){var t=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(e){return-1===t.indexOf(e)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var n=this.managedParameters,r={},i=this;return Object.keys(this).forEach(function(e){var t=i[e];-1===n.indexOf(e)&&void 0!==t&&(r[e]=t)}),r},setQueryParameter:function(e,t){if(this[e]===t)return this;var n={};return n[e]=t,this.setQueryParameters(n)},setQueryParameters:function(e){if(!e)return this;var t=je.validate(this,e);if(t)throw t;var n=this,i=je._parseNumbers(e),r=Object.keys(this).reduce(function(e,t){return e[t]=n[t],e},{}),a=Object.keys(i).reduce(function(e,t){var n=void 0!==e[t],r=void 0!==i[t];return n&&!r?be(e,[t]):(r&&(e[t]=i[t]),e)},r);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(t){return ye(this.hierarchicalFacets,function(e){return e.name===t})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(n).map(function(e){return e.trim()})},toString:function(){return JSON.stringify(this,null,2)}};var Ce=je;function we(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=void 0!==t,a=null===t;if(!a&&t<e||r&&i||!n)return 1;if(!r&&e<t||a&&n||!i)return-1}return 0}var Ve=function(e,n,i){if(!Array.isArray(e))return[];Array.isArray(i)||(i=[]);var t=e.map(function(t,e){return{criteria:n.map(function(e){return t[e]}),index:e,value:t}});return t.sort(function(e,t){for(var n=-1;++n<e.criteria.length;){var r=we(e.criteria[n],t.criteria[n]);if(r)return n>=i.length?r:"desc"===i[n]?-r:r}return e.index-t.index}),t.map(function(e){return e.value})},Ie=function(e){return Array.isArray(e)?e.filter(Boolean):[]},_e=function(e,t){if(!Array.isArray(e))return-1;for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1},Ee=function(e,t){var i=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var n=t.split(":"),r=ye(i,function(e){return e[0]===n[0]});return 1<n.length||!r?(e[0].push(n[0]),e[1].push(n[1])):(e[0].push(r[0]),e[1].push(r[1])),e},[[],[]])};var Ae=function(e){return"string"!=typeof e?e:String(e).replace(/^-/,"\\-")},Ne=function(e){return"string"!=typeof e?e:e.replace(/^\\-/,"-")},De=function(g){return function(e,t){var a,l,f,h,d,n=g.hierarchicalFacets[t],r=g.hierarchicalFacetsRefinements[n.name]&&g.hierarchicalFacetsRefinements[n.name][0]||"",i=g._getHierarchicalFacetSeparator(n),s=g._getHierarchicalRootPath(n),o=g._getHierarchicalShowParentLevel(n),c=Ee(g._getHierarchicalFacetSortBy(n)),u=e.every(function(e){return e.exhaustive}),p=(a=c,l=i,f=s,h=o,d=r,function(e,u,t){var c=e;if(0<t){var n=0;for(c=e;n<t;){var r=c&&Array.isArray(c.data)?c.data:[];c=ye(r,function(e){return e.isRefined}),n++}}if(c){var i=Object.keys(u.data).map(function(e){return[e,u.data[e]]}).filter(function(e){var t,n,r,i,a,s,o=e[0];return t=o,n=c.path||f,r=d,i=l,s=h,(!(a=f)||0===t.indexOf(a)&&a!==t)&&(!a&&-1===t.indexOf(i)||a&&t.split(i).length-a.split(i).length==1||-1===t.indexOf(i)&&-1===r.indexOf(i)||0===r.indexOf(t)||0===t.indexOf(n+i)&&(s||0===t.indexOf(r)))});c.data=Ve(i.map(function(e){var t,n,r,i,a,s,o=e[0],c=e[1];return t=c,n=o,r=l,i=He(d),a=u.exhaustive,{name:(s=n.split(r))[s.length-1].trim(),path:n,escapedValue:Te(n),count:t,isRefined:i===n||0===i.indexOf(n+r),exhaustive:a,data:null}}),a[0],a[1])}return e}),m=e;return s&&(m=e.slice(s.split(i).length)),m.reduce(p,{name:g.hierarchicalFacets[t].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:u,data:null})}},Te=Ae,He=Ne;var ke=Ae,Me=Ne;function $e(e){var n={};return e.forEach(function(e,t){n[e]=t}),n}function Qe(e,t,n){t&&t[n]&&(e.stats=t[n])}function Be(l,t,n){var f=t[0];this._rawResults=t;var h=this;Object.keys(f).forEach(function(e){h[e]=f[e]}),Object.keys(n||{}).forEach(function(e){h[e]=n[e]}),this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=l.hierarchicalFacets.map(function(){return[]}),this.facets=[];var e=l.getRefinedDisjunctiveFacets(),d=$e(l.facets),p=$e(l.disjunctiveFacets),r=1,m=f.facets||{};Object.keys(m).forEach(function(e){var t,n,r=m[e],i=(t=l.hierarchicalFacets,n=e,ye(t,function(e){return-1<(e.attributes||[]).indexOf(n)}));if(i){var a=i.attributes.indexOf(e),s=_e(l.hierarchicalFacets,function(e){return e.name===i.name});h.hierarchicalFacets[s][a]={attribute:e,data:r,exhaustive:f.exhaustiveFacetsCount}}else{var o,c=-1!==l.disjunctiveFacets.indexOf(e),u=-1!==l.facets.indexOf(e);c&&(o=p[e],h.disjunctiveFacets[o]={name:e,data:r,exhaustive:f.exhaustiveFacetsCount},Qe(h.disjunctiveFacets[o],f.facets_stats,e)),u&&(o=d[e],h.facets[o]={name:e,data:r,exhaustive:f.exhaustiveFacetsCount},Qe(h.facets[o],f.facets_stats,e))}}),this.hierarchicalFacets=Ie(this.hierarchicalFacets),e.forEach(function(e){var a=t[r],s=a&&a.facets?a.facets:{},o=l.getHierarchicalFacetByName(e);Object.keys(s).forEach(function(t){var n,e=s[t];if(o){n=_e(l.hierarchicalFacets,function(e){return e.name===o.name});var r=_e(h.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1===r)return;h.hierarchicalFacets[n][r].data=me({},h.hierarchicalFacets[n][r].data,e)}else{n=p[t];var i=f.facets&&f.facets[t]||{};h.disjunctiveFacets[n]={name:t,data:ge({},e,i),exhaustive:a.exhaustiveFacetsCount},Qe(h.disjunctiveFacets[n],a.facets_stats,t),l.disjunctiveFacetsRefinements[t]&&l.disjunctiveFacetsRefinements[t].forEach(function(e){!h.disjunctiveFacets[n].data[e]&&-1<l.disjunctiveFacetsRefinements[t].indexOf(Me(e))&&(h.disjunctiveFacets[n].data[e]=0)})}}),r++}),l.getRefinedHierarchicalFacets().forEach(function(e){var o=l.getHierarchicalFacetByName(e),c=l._getHierarchicalFacetSeparator(o),u=l.getHierarchicalRefinement(e);0===u.length||u[0].split(c).length<2||t.slice(r).forEach(function(e){var s=e&&e.facets?e.facets:{};Object.keys(s).forEach(function(t){var e=s[t],n=_e(l.hierarchicalFacets,function(e){return e.name===o.name}),r=_e(h.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1!==r){var i={};if(0<u.length){var a=u[0].split(c)[0];i[a]=h.hierarchicalFacets[n][r].data[a]}h.hierarchicalFacets[n][r].data=ge(i,e,h.hierarchicalFacets[n][r].data)}}),r++})}),Object.keys(l.facetsExcludes).forEach(function(t){var e=l.facetsExcludes[t],n=d[t];h.facets[n]={name:t,data:f.facets[t],exhaustive:f.exhaustiveFacetsCount},e.forEach(function(e){h.facets[n]=h.facets[n]||{name:t},h.facets[n].data=h.facets[n].data||{},h.facets[n].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(De(l)),this.facets=Ie(this.facets),this.disjunctiveFacets=Ie(this.disjunctiveFacets),this._state=l}function Le(e,t){var n=ye(e,function(e){return e.name===t});return n&&n.stats}function qe(e,t,n,r,i){var a=ye(i,function(e){return e.name===n}),s=a&&a.data&&a.data[r]?a.data[r]:0,o=a&&a.exhaustive||!1;return{type:t,attributeName:n,name:r,count:s,exhaustive:o}}Be.prototype.getFacetByName=function(t){function e(e){return e.name===t}return ye(this.facets,e)||ye(this.disjunctiveFacets,e)||ye(this.hierarchicalFacets,e)},Be.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],Be.prototype.getFacetValues=function(e,t){var n=function(n,r){function e(e){return e.name===r}if(n._state.isConjunctiveFacet(r)){var i=ye(n.facets,e);return i?Object.keys(i.data).map(function(e){var t=ke(e);return{name:e,escapedValue:t,count:i.data[e],isRefined:n._state.isFacetRefined(r,t),isExcluded:n._state.isExcludeRefined(r,e)}}):[]}if(n._state.isDisjunctiveFacet(r)){var a=ye(n.disjunctiveFacets,e);return a?Object.keys(a.data).map(function(e){var t=ke(e);return{name:e,escapedValue:t,count:a.data[e],isRefined:n._state.isDisjunctiveFacetRefined(r,t)}}):[]}if(n._state.isHierarchicalFacet(r))return ye(n.hierarchicalFacets,e)}(this,e);if(n){var r,o=ge({},t,{sortBy:Be.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),c=this;if(Array.isArray(n))r=[e];else r=c._state.getHierarchicalFacetByName(n.name).attributes;return function t(n,e,r,i){if(i=i||0,Array.isArray(e))return n(e,r[i]);if(!e.data||0===e.data.length)return e;var a=e.data.map(function(e){return t(n,e,r,i+1)}),s=n(a,r[i]);return ge({data:s},e)}(function(e,t){if(o.facetOrdering){var n=(i=t,(r=c).renderingContent&&r.renderingContent.facetOrdering&&r.renderingContent.facetOrdering.values&&r.renderingContent.facetOrdering.values[i]);if(Boolean(n))return function(e,t){var n=[],r=[],i=(t.order||[]).reduce(function(e,t,n){return e[t]=n,e},{});e.forEach(function(e){var t=e.path||e.name;void 0!==i[t]?n[i[t]]=e:r.push(e)}),n=n.filter(function(e){return e});var a,s=t.sortRemainingBy;return"hidden"===s?n:(a="alpha"===s?[["path","name"],["asc","asc"]]:[["count"],["desc"]],n.concat(Ve(r,a[0],a[1])))}(e,n)}var r,i,a;if(Array.isArray(o.sortBy)){var s=Ee(o.sortBy,Be.DEFAULT_SORT);return Ve(e,s[0],s[1])}if("function"==typeof o.sortBy)return a=o.sortBy,e.sort(a);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},n,r)}},Be.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?Le(this.facets,e):this._state.isDisjunctiveFacet(e)?Le(this.disjunctiveFacets,e):void 0},Be.prototype.getRefinements=function(){var p=this._state,m=this,g=[];return Object.keys(p.facetsRefinements).forEach(function(t){p.facetsRefinements[t].forEach(function(e){g.push(qe(p,"facet",t,e,m.facets))})}),Object.keys(p.facetsExcludes).forEach(function(t){p.facetsExcludes[t].forEach(function(e){g.push(qe(p,"exclude",t,e,m.facets))})}),Object.keys(p.disjunctiveFacetsRefinements).forEach(function(t){p.disjunctiveFacetsRefinements[t].forEach(function(e){g.push(qe(p,"disjunctive",t,e,m.disjunctiveFacets))})}),Object.keys(p.hierarchicalFacetsRefinements).forEach(function(d){p.hierarchicalFacetsRefinements[d].forEach(function(e){var t,n,r,i,a,s,o,c,u,l,f,h;g.push((t=p,n=d,r=e,i=m.hierarchicalFacets,a=t.getHierarchicalFacetByName(n),s=t._getHierarchicalFacetSeparator(a),o=r.split(s),c=ye(i,function(e){return e.name===n}),u=o.reduce(function(e,t){var n=e&&ye(e.data,function(e){return e.name===t});return void 0!==n?n:e},c),l=u&&u.count||0,f=u&&u.exhaustive||!1,h=u&&u.path||"",{type:"hierarchical",attributeName:n,name:h,count:l,exhaustive:f}))})}),Object.keys(p.numericRefinements).forEach(function(n){var e=p.numericRefinements[n];Object.keys(e).forEach(function(t){e[t].forEach(function(e){g.push({type:"numeric",attributeName:n,name:e,numericValue:e,operator:t})})})}),p.tagRefinements.forEach(function(e){g.push({type:"tag",attributeName:"_tags",name:e})}),g};var Ue=Be;function We(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var ze=We;function Je(e){return"function"==typeof e}function Ye(e){return"object"==typeof e&&null!==e}function Ge(e){return void 0===e}We.prototype._events=void 0,We.prototype._maxListeners=void 0,We.defaultMaxListeners=10,We.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},We.prototype.emit=function(e){var t,n,r,i,a,s;if(this._events||(this._events={}),"error"===e&&(!this._events.error||Ye(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var o=new Error('Uncaught, unspecified "error" event. ('+t+")");throw o.context=t,o}if(Ge(n=this._events[e]))return!1;if(Je(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),n.apply(this,i)}else if(Ye(n))for(i=Array.prototype.slice.call(arguments,1),r=(s=n.slice()).length,a=0;a<r;a++)s[a].apply(this,i);return!0},We.prototype.on=We.prototype.addListener=function(e,t){var n;if(!Je(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,Je(t.listener)?t.listener:t),this._events[e]?Ye(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Ye(this._events[e])&&!this._events[e].warned&&(n=Ge(this._maxListeners)?We.defaultMaxListeners:this._maxListeners)&&0<n&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},We.prototype.once=function(e,t){if(!Je(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},We.prototype.removeListener=function(e,t){var n,r,i,a;if(!Je(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||Je(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Ye(n)){for(a=i;0<a--;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},We.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(Je(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},We.prototype.listeners=function(e){return this._events&&this._events[e]?Je(this._events[e])?[this._events[e]]:this._events[e].slice():[]},We.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(Je(t))return 1;if(t)return t.length}return 0},We.listenerCount=function(e,t){return e.listenerCount(t)};var Ke=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})};function Xe(e,t){this.main=e,this.fn=t,this.lastResults=null}Ke(Xe,ze),Xe.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},Xe.prototype.getModifiedState=function(e){return this.fn(e)};var Ze=Xe;function et(n){return Object.keys(n).sort(function(e,t){return e.localeCompare(t)}).reduce(function(e,t){return e[t]=n[t],e},{})}var tt={_getQueries:function(c,u){var l=[];return l.push({indexName:c,params:tt._getHitsSearchParams(u)}),u.getRefinedDisjunctiveFacets().forEach(function(e){l.push({indexName:c,params:tt._getDisjunctiveFacetSearchParams(u,e)})}),u.getRefinedHierarchicalFacets().forEach(function(e){var s=u.getHierarchicalFacetByName(e),t=u.getHierarchicalRefinement(e),r=u._getHierarchicalFacetSeparator(s);if(0<t.length&&1<t[0].split(r).length){var o=t[0].split(r).slice(0,-1).reduce(function(e,t,n){return e.concat({attribute:s.attributes[n],value:0===n?t:[e[e.length-1].value,t].join(r)})},[]);o.forEach(function(e,t){var n=tt._getDisjunctiveFacetSearchParams(u,e.attribute,0===t);function r(t){return s.attributes.some(function(e){return e===t.split(":")[0]})}var i=(n.facetFilters||[]).reduce(function(e,t){if(Array.isArray(t)){var n=t.filter(function(e){return!r(e)});0<n.length&&e.push(n)}return"string"!=typeof t||r(t)||e.push(t),e},[]),a=o[t-1];n.facetFilters=0<t?i.concat(a.attribute+":"+a.value):0<i.length?i:void 0,l.push({indexName:c,params:n})})}}),l},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(tt._getHitsHierarchicalFacetsAttributes(e)),n=tt._getFacetFilters(e),r=tt._getNumericFilters(e),i=tt._getTagFilters(e),a={facets:-1<t.indexOf("*")?["*"]:t,tagFilters:i};return 0<n.length&&(a.facetFilters=n),0<r.length&&(a.numericFilters=r),et(me({},e.getQueryParams(),a))},_getDisjunctiveFacetSearchParams:function(e,t,n){var r=tt._getFacetFilters(e,t,n),i=tt._getNumericFilters(e,t),a=tt._getTagFilters(e),s={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};0<a.length&&(s.tagFilters=a);var o=e.getHierarchicalFacetByName(t);return s.facets=o?tt._getDisjunctiveHierarchicalFacetAttribute(e,o,n):t,0<i.length&&(s.numericFilters=i),0<r.length&&(s.facetFilters=r),et(me({},e.getQueryParams(),s))},_getNumericFilters:function(e,i){if(e.numericFilters)return e.numericFilters;var a=[];return Object.keys(e.numericRefinements).forEach(function(r){var t=e.numericRefinements[r]||{};Object.keys(t).forEach(function(n){var e=t[n]||[];i!==r&&e.forEach(function(e){if(Array.isArray(e)){var t=e.map(function(e){return r+n+e});a.push(t)}else a.push(r+n+e)})})}),a},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(o,c,u){var l=[],e=o.facetsRefinements||{};Object.keys(e).forEach(function(t){(e[t]||[]).forEach(function(e){l.push(t+":"+e)})});var n=o.facetsExcludes||{};Object.keys(n).forEach(function(t){(n[t]||[]).forEach(function(e){l.push(t+":-"+e)})});var r=o.disjunctiveFacetsRefinements||{};Object.keys(r).forEach(function(t){var e=r[t]||[];if(t!==c&&e&&0!==e.length){var n=[];e.forEach(function(e){n.push(t+":"+e)}),l.push(n)}});var f=o.hierarchicalFacetsRefinements||{};return Object.keys(f).forEach(function(e){var t=(f[e]||[])[0];if(void 0!==t){var n,r,i=o.getHierarchicalFacetByName(e),a=o._getHierarchicalFacetSeparator(i),s=o._getHierarchicalRootPath(i);if(c===e){if(-1===t.indexOf(a)||!s&&!0===u||s&&s.split(a).length===t.split(a).length)return;t=s?(r=s.split(a).length-1,s):(r=t.split(a).length-2,t.slice(0,t.lastIndexOf(a))),n=i.attributes[r]}else r=t.split(a).length-1,n=i.attributes[r];n&&l.push([n+":"+t])}}),l},_getHitsHierarchicalFacetsAttributes:function(s){return s.hierarchicalFacets.reduce(function(e,t){var n=s.getHierarchicalRefinement(t.name)[0];if(!n)return e.push(t.attributes[0]),e;var r=s._getHierarchicalFacetSeparator(t),i=n.split(r).length,a=t.attributes.slice(0,i+1);return e.concat(a)},[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,n){var r=e._getHierarchicalFacetSeparator(t);if(!0===n){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(r).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(r).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,n,r){var i=r.isDisjunctiveFacet(e)?r.clearRefinements(e):r,a={facetQuery:t,facetName:e};return"number"==typeof n&&(a.maxFacetHits=n),et(me({},tt._getHitsSearchParams(i),a))}},nt=tt,rt="3.11.1",it=Ae;function at(e,t,n){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.1)"),this.setClient(e);var r=n||{};r.index=t,this.state=Ce.make(r),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function st(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function ot(){return this.state.page}Ke(at,ze),at.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},at.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},at.prototype.getQuery=function(){var e=this.state;return nt._getHitsSearchParams(e)},at.prototype.searchOnce=function(e,t){var n=e?this.state.setQueryParameters(e):this.state,r=nt._getQueries(n.index,n),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:n}),!t)return this.client.search(r).then(function(e){return i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),{content:new Ue(n,e.results),state:n,_originalResponse:e}},function(e){throw i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),e});this.client.search(r).then(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(null,new Ue(n,e.results),n)}).catch(function(e){i._currentNbQueries--,0===i._currentNbQueries&&i.emit("searchQueueEmpty"),t(e,null,n)})},at.prototype.findAnswers=function(e){var t=this.state,n=this.derivedHelpers[0];if(!n)return Promise.resolve([]);var r=n.getModifiedState(t),i=me({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:be(nt._getHitsSearchParams(r),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if("function"!=typeof this.client.initIndex)throw new Error(a);var s=this.client.initIndex(r.index);if("function"!=typeof s.findAnswers)throw new Error(a);return s.findAnswers(r.query,e.queryLanguages,i)},at.prototype.searchForFacetValues=function(t,e,n,r){var i="function"==typeof this.client.searchForFacetValues,a="function"==typeof this.client.initIndex;if(!i&&!a&&"function"!=typeof this.client.search)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 s=this.state.setQueryParameters(r||{}),o=s.isDisjunctiveFacet(t),c=nt.getSearchForFacetQuery(t,e,n,s);this._currentNbQueries++;var u,l=this;return u=i?this.client.searchForFacetValues([{indexName:s.index,params:c}]):a?this.client.initIndex(s.index).searchForFacetValues(c):(delete c.facetName,this.client.search([{type:"facet",facet:t,indexName:s.index,params:c}]).then(function(e){return e.results[0]})),this.emit("searchForFacetValues",{state:s,facet:t,query:e}),u.then(function(e){return l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),(e=Array.isArray(e)?e[0]:e).facetHits.forEach(function(e){e.escapedValue=it(e.value),e.isRefined=o?s.isDisjunctiveFacetRefined(t,e.escapedValue):s.isFacetRefined(t,e.escapedValue)}),e},function(e){throw l._currentNbQueries--,0===l._currentNbQueries&&l.emit("searchQueueEmpty"),e})},at.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},at.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},at.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},at.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},at.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.addNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,n),isPageReset:!0}),this},at.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},at.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},at.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},at.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},at.prototype.removeNumericRefinement=function(e,t,n){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,n),isPageReset:!0}),this},at.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},at.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},at.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},at.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},at.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},at.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},at.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},at.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},at.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},at.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},at.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},at.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},at.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},at.prototype.setCurrentPage=st,at.prototype.setPage=st,at.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},at.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},at.prototype.setState=function(e){return this._change({state:Ce.make(e),isPageReset:!1}),this},at.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new Ce(e),this},at.prototype.hasRefinements=function(e){return!!Re(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},at.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},at.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},at.prototype.hasTag=function(e){return this.state.isTagRefined(e)},at.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},at.prototype.getIndex=function(){return this.state.index},at.prototype.getCurrentPage=ot,at.prototype.getPage=ot,at.prototype.getTags=function(){return this.state.tagRefinements},at.prototype.getRefinements=function(e){var n=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"conjunctive"})}),this.state.getExcludeRefinements(e).forEach(function(e){n.push({value:e,type:"exclude"})});else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach(function(e){n.push({value:e,type:"disjunctive"})})}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach(function(e){var t=r[e];n.push({value:t,operator:e,type:"numeric"})}),n},at.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},at.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},at.prototype._search=function(e){var r=this.state,i=[],t=[];e.onlyWithDerivedHelpers||(t=nt._getQueries(r.index,r),i.push({state:r,queriesCount:t.length,helper:this}),this.emit("search",{state:r,results:this.lastResults}));var n=this.derivedHelpers.map(function(e){var t=e.getModifiedState(r),n=nt._getQueries(t.index,t);return i.push({state:t,queriesCount:n.length,helper:e}),e.emit("search",{state:t,results:e.lastResults}),n}),a=Array.prototype.concat.apply(t,n),s=this._queryId++;this._currentNbQueries++;try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,i,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(e){this.emit("error",{error:e})}},at.prototype._dispatchAlgoliaResponse=function(e,t,n){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var s=n.results.slice();e.forEach(function(e){var t=e.state,n=e.queriesCount,r=e.helper,i=s.splice(0,n),a=r.lastResults=new Ue(t,i);r.emit("result",{results:a,state:t})})}},at.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),0===this._currentNbQueries&&this.emit("searchQueueEmpty"))},at.prototype.containsRefinement=function(e,t,n,r){return e||0!==t.length||0!==n.length||0!==r.length},at.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&0<this.state.disjunctiveRefinements[e].length},at.prototype._change=function(e){var t=e.state,n=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:n}))},at.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},at.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper (3.11.1)"),this.client=e),this},at.prototype.getClient=function(){return this.client},at.prototype.derive=function(e){var t=new Ze(this,e);return this.derivedHelpers.push(t),t},at.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},at.prototype.hasPendingRequests=function(){return 0<this._currentNbQueries};var ct=at;function ut(e,t,n){return new ct(e,t,n)}ut.version=rt,ut.AlgoliaSearchHelper=ct,ut.SearchParameters=Ce,ut.SearchResults=Ue;var lt=ut;function ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ht(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function dt(e){var t=e.attributeName,n=e.attributeValue,r=e.attributeScore;return"".concat(t,":").concat(n,"<score=").concat(r||1,">")}function pt(a){var e=Object.keys(a.matchingPatterns).reduce(function(e,t){var n=a.matchingPatterns[t],r=E(a.hit,t),i=n.score;return Array.isArray(r)?[].concat(he(e),[r.map(function(e){return dt({attributeName:t,attributeValue:e,attributeScore:i})})]):"string"==typeof r?[].concat(he(e),[dt({attributeName:t,attributeValue:r,attributeScore:i})]):e},[]);return a.transformSearchParameters(new lt.SearchParameters({sumOrFiltersScores:!0,facetFilters:["objectID:-".concat(a.hit.objectID)],optionalFilters:e}))}var mt=q({displayName:"AlgoliaConfigureRelatedItems",$$type:"ais.configureRelatedItems",defaultProps:{transformSearchParameters:function(e){return ht({},e)}},getProvidedProps:function(){return{}},getSearchParameters:function(e,t){return e.setQueryParameters(pt(t))},transitionState:function(e,t,n){var r,i="configure",a=(r=j(pt(e)),Object.keys(r).forEach(function(e){var t=r[e];Array.isArray(t)&&0===t.length&&delete r[e]}),r),s=Object.keys(a),o=this._searchParameters?Object.keys(this._searchParameters).filter(function(e){return-1===s.indexOf(e)}):[];return this._searchParameters=a,ee(n,O({},i,ht(ht({},_(n[i],o)),a)),{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){var n=this,r="configure",i=K({ais:e.contextValue,multiIndexContext:e.indexContextValue}),a=Z({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&t.indices?t.indices[i]:t,s=(a&&a[r]?Object.keys(a[r]):[]).reduce(function(e,t){return n._searchParameters[t]||(e[t]=a[r][t]),e},{});return ee(t,O({},r,s),{ais:e.contextValue,multiIndexContext:e.indexContextValue})}}),gt="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};gt.setTimeout,gt.clearTimeout;var vt=gt.performance||{};vt.now||vt.mozNow||vt.msNow||vt.oNow||vt.webkitNow;function yt(e,t){return e(t={exports:{}},t.exports),t.exports}var xt="function"==typeof Symbol&&Symbol.for,bt=xt?Symbol.for("react.element"):60103,Rt=xt?Symbol.for("react.portal"):60106,Pt=xt?Symbol.for("react.fragment"):60107,Ft=xt?Symbol.for("react.strict_mode"):60108,Ot=xt?Symbol.for("react.profiler"):60114,St=xt?Symbol.for("react.provider"):60109,jt=xt?Symbol.for("react.context"):60110,Ct=xt?Symbol.for("react.async_mode"):60111,wt=xt?Symbol.for("react.concurrent_mode"):60111,Vt=xt?Symbol.for("react.forward_ref"):60112,It=xt?Symbol.for("react.suspense"):60113,_t=xt?Symbol.for("react.suspense_list"):60120,Et=xt?Symbol.for("react.memo"):60115,At=xt?Symbol.for("react.lazy"):60116,Nt=xt?Symbol.for("react.block"):60121,Dt=xt?Symbol.for("react.fundamental"):60117,Tt=xt?Symbol.for("react.responder"):60118,Ht=xt?Symbol.for("react.scope"):60119;function kt(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case bt:switch(e=e.type){case Ct:case wt:case Pt:case Ot:case Ft:case It:return e;default:switch(e=e&&e.$$typeof){case jt:case Vt:case At:case Et:case St:return e;default:return t}}case Rt:return t}}}function Mt(e){return kt(e)===wt}var $t={AsyncMode:Ct,ConcurrentMode:wt,ContextConsumer:jt,ContextProvider:St,Element:bt,ForwardRef:Vt,Fragment:Pt,Lazy:At,Memo:Et,Portal:Rt,Profiler:Ot,StrictMode:Ft,Suspense:It,isAsyncMode:function(e){return Mt(e)||kt(e)===Ct},isConcurrentMode:Mt,isContextConsumer:function(e){return kt(e)===jt},isContextProvider:function(e){return kt(e)===St},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===bt},isForwardRef:function(e){return kt(e)===Vt},isFragment:function(e){return kt(e)===Pt},isLazy:function(e){return kt(e)===At},isMemo:function(e){return kt(e)===Et},isPortal:function(e){return kt(e)===Rt},isProfiler:function(e){return kt(e)===Ot},isStrictMode:function(e){return kt(e)===Ft},isSuspense:function(e){return kt(e)===It},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===Pt||e===wt||e===Ot||e===Ft||e===It||e===_t||"object"==typeof e&&null!==e&&(e.$$typeof===At||e.$$typeof===Et||e.$$typeof===St||e.$$typeof===jt||e.$$typeof===Vt||e.$$typeof===Dt||e.$$typeof===Tt||e.$$typeof===Ht||e.$$typeof===Nt)},typeOf:kt},Qt=yt(function(e,t){});Qt.AsyncMode,Qt.ConcurrentMode,Qt.ContextConsumer,Qt.ContextProvider,Qt.Element,Qt.ForwardRef,Qt.Fragment,Qt.Lazy,Qt.Memo,Qt.Portal,Qt.Profiler,Qt.StrictMode,Qt.Suspense,Qt.isAsyncMode,Qt.isConcurrentMode,Qt.isContextConsumer,Qt.isContextProvider,Qt.isElement,Qt.isForwardRef,Qt.isFragment,Qt.isLazy,Qt.isMemo,Qt.isPortal,Qt.isProfiler,Qt.isStrictMode,Qt.isSuspense,Qt.isValidElementType,Qt.typeOf,yt(function(e){e.exports=$t});function Bt(){}function Lt(){}Lt.resetWarningCache=Bt;var qt=yt(function(e){e.exports=function(){function e(e,t,n,r,i,a){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==a){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}var n={array:e.isRequired=e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Lt,resetWarningCache:Bt};return n.PropTypes=n}()});function Ut(){return null}Ut.propTypes={hit:qt.object.isRequired,matchingPatterns:qt.object.isRequired,transformSearchParameters:qt.func};var Wt=mt(Ut,{$$widgetType:"ais.configureRelatedItems"}),zt=q({displayName:"AlgoliaDynamicWidgets",$$type:"ais.dynamicWidgets",defaultProps:{transformItems:function(e){return e},maxValuesPerFacet:20},propTypes:{transformItems:qt.func,facets:qt.arrayOf(qt.string),maxValuesPerFacet:qt.number},getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(e.facets&&(!(Array.isArray(e.facets)&&e.facets.length<=1)||"*"!==e.facets[0]&&void 0!==e.facets[0]))throw new Error('The `facets` prop only accepts [] or ["*"], you passed '.concat(JSON.stringify(e.facets)));if(!r)return{attributesToRender:[]};var i=r.renderingContent&&r.renderingContent.facetOrdering&&r.renderingContent.facetOrdering.facets&&r.renderingContent.facetOrdering.facets.order||[],a=e.transformItems(i,{results:r});return 20<a.length&&!e.facets&&console.warn("More than ".concat(20," facets are requested to be displayed without explicitly setting which facets to retrieve. This could have a performance impact. Set \"facets\" to [] to do two smaller network requests, or explicitly to ['*'] to avoid this warning.")),e.maxValuesPerFacet<r._state.maxValuesPerFacet&&console.warn("The maxValuesPerFacet set by dynamic widgets (".concat(e.maxValuesPerFacet,") is smaller than one of the limits set by a widget (").concat(r._state.maxValuesPerFacet,"). This causes a mismatch in query parameters and thus an extra network request when that widget is mounted.")),{attributesToRender:a}},getSearchParameters:function(e,t){return(t.facets||["*"]).reduce(function(e,t){return e.addFacet(t)},e.setQueryParameters({maxValuesPerFacet:Math.max(t.maxValuesPerFacet||0,e.maxValuesPerFacet||0)}))}});function Jt(e){var t;if("object"===o(t=e)&&t.props)return e.props.attribute?e.props.attribute:Array.isArray(e.props.attributes)?e.props.attributes[0]:e.props.children?Jt(c.Children.only(e.props.children)):void 0}var Yt=zt(function(e){var t=e.children,n=e.attributesToRender,r=e.fallbackComponent,i=void 0===r?function(){return null}:r,a=new Map;return c.Children.forEach(t,function(e){var t=Jt(e);if(!t)throw new Error('Could not find "attribute" prop for '.concat(P(e),"."));a.set(t,e)}),c.createElement(c.Fragment,null,n.map(function(e){return c.createElement(s.Fragment,{key:e},a.get(e)||c.createElement(i,{attribute:e}))}))},{$$widgetType:"ais.dynamicWidgets"});function Gt(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(n).filter(function(e){return void 0!==n[e]&&void 0!==n[e][t]}).map(function(e){return function(t,e,n){var r=n[e];switch(e){case"range":return Object.keys(r[t]).map(function(e){return r[t][e]});case"refinementList":return r[t];case"hierarchicalMenu":case"menu":return[r[t]];case"multiRange":return r[t].split(":");case"toggle":return[r[t]];default:return[]}}(t,e,n)}).reduce(function(e,t){return e.concat(t)},[])}var Kt=q({displayName:"AlgoliaQueryRules",$$type:"ais.queryRules",defaultProps:{transformItems:function(e){return e},transformRuleContexts:function(e){return e},trackedFilters:{}},getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(null===r)return{items:[],canRefine:!1};var i=r.userData,a=void 0===i?[]:i,s=(0,e.transformItems)(a);return{items:s,canRefine:0<s.length}},getSearchParameters:function(e,t,n){if(0===Object.keys(t.trackedFilters).length)return e;var r,i,a,s=Z({ais:t.contextValue,multiIndexContext:t.indexContextValue})&&n.indices?n.indices[K({ais:t.contextValue,multiIndexContext:t.indexContextValue})]:n,o=(r={searchState:s,trackedFilters:t.trackedFilters},i=r.searchState,a=r.trackedFilters,Object.keys(a).reduce(function(e,t){var n=Gt(t,i),r=(0,a[t])(n);return[].concat(he(e),he(n.filter(function(e){return r.includes(e)}).map(function(e){return"ais-".concat(t,"-").concat(e).replace(/[^a-z0-9-_]+/gi,"_")})))},[])),c=e.ruleContexts||[],u=[].concat(he(c),he(o)),l=t.transformRuleContexts(u).slice(0,10);return e.setQueryParameter("ruleContexts",l)}}),Xt=Kt(function(){return null},{$$widgetType:"ais.queryRuleContext"});function Zt(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}function en(e){return{targetedIndex:e.indexId}}var tn=function(e){p(r,s.Component);var n=Zt(r);function r(e){var t;return f(this,r),O(d(t=n.call(this,e)),"state",{indexContext:en(t.props)}),O(d(t),"unregisterWidget",void 0),t.props.contextValue.onSearchParameters(t.getSearchParameters.bind(d(t)),{ais:t.props.contextValue,multiIndexContext:t.state.indexContext},t.props,void 0,r.displayName),t}return h(r,[{key:"componentDidMount",value:function(){this.unregisterWidget=this.props.contextValue.widgetsManager.registerWidget(this)}},{key:"componentDidUpdate",value:function(e){this.props.indexName!==e.indexName&&this.props.contextValue.widgetsManager.update()}},{key:"componentWillUnmount",value:function(){"function"==typeof this.unregisterWidget&&this.unregisterWidget()}},{key:"getSearchParameters",value:function(e,t){return e.setIndex(this.props?this.props.indexName:t.indexName)}},{key:"render",value:function(){return 0===s.Children.count(this.props.children)?null:c.createElement(M,{value:this.state.indexContext},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e){return{indexContext:en(e)}}}]),r}();O(tn,"displayName","AlgoliaIndex"),O(tn,"$$type","ais.index"),O(tn,"$$widgetType","ais.index");var nn=["resultsFacetValues"],rn=["resultsFacetValues"],an=["resultsFacetValues"];function sn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function on(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?sn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function cn(e){"function"==typeof e.addAlgoliaAgent&&(e.addAlgoliaAgent("react (".concat(s.version,")")),e.addAlgoliaAgent("react-instantsearch (".concat(z,")")))}var un=function(e){return Z({ais:e.props.contextValue,multiIndexContext:e.props.indexContextValue})},ln=function(e,t){return e.props.indexContextValue.targetedIndex===t},fn=function(e){return Boolean(e.props.indexId)},hn=function(e,t){return e.props.indexId===t},dn=function(e,t){var n=fn(e),r=fn(t);return n&&!r?-1:!n&&r?1:0};function pn(n){return Object.keys(n).map(function(e){return function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=0;return e.replace(/%s/g,function(){return encodeURIComponent(n[i++])})}("%s=%s",e,(t=n[e],"[object Object]"===Object.prototype.toString.call(t)||"[object Array]"===Object.prototype.toString.call(t)?JSON.stringify(n[e]):n[e]));var t}).join("&")}function mn(e){var r=e.indexName,t=e.initialState,n=void 0===t?{}:t,i=e.searchClient,a=e.resultsState,s=e.stalledSearchDelay,c=lt(i,r,on({},U));cn(i),c.on("search",function(){l||(l=setTimeout(function(){var e=v.getState(),t=(e.resultsFacetValues,F(e,an));v.setState(on(on({},t),{},{isSearchStalled:!0}))},s))}).on("result",R({indexId:r})).on("error",P);var u,o=!1,l=null,f=c.state,h=function(e){var t=[],n=!1;function r(){n||(n=!0,S(function(){n=!1,e()}))}return{registerWidget:function(e){return t.push(e),r(),function(){t.splice(t.indexOf(e),1),r()}},update:r,getWidgets:function(){return t}}}(function(){var e=y(v.getState().widgets);v.setState(on(on({},v.getState()),{},{metadata:e,searching:!0})),b()});!function(a,e){if(!e)return;if((!a.transporter||a._cacheHydrated)&&(!a._useCache||"function"!=typeof a.addAlgoliaAgent))return;if(a.transporter&&!a._cacheHydrated){a._cacheHydrated=!0;var s=a.search;a.search=function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=e.map(function(e){return on(on({},e),{},{params:pn(e.params)})});return a.transporter.responsesCache.get({method:"search",args:[i].concat(n)},function(){return s.apply(void 0,[e].concat(n))})}}if(Array.isArray(e.results))return function(e,t){if(e.transporter)return e.transporter.responsesCache.set({method:"search",args:[t.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])]},{results:t.reduce(function(e,t){return e.concat(t.rawResults)},[])});var n="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:t.reduce(function(e,t){return e.concat(t.rawResults.map(function(e){return{indexName:e.index,params:e.params}}))},[])}));e.cache=on(on({},e.cache),{},O({},n,JSON.stringify({results:t.reduce(function(e,t){return e.concat(t.rawResults)},[])})))}(a,e.results);!function(e,t){if(e.transporter)return e.transporter.responsesCache.set({method:"search",args:[t.rawResults.map(function(e){return{indexName:e.index,params:e.params}})]},{results:t.rawResults});var n="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:t.rawResults.map(function(e){return{indexName:e.index,params:e.params}})}));e.cache=on(on({},e.cache),{},O({},n,JSON.stringify({results:t.rawResults})))}(a,e)}(i,a);var d,p,m,g,v=(d={widgets:n,metadata:(g=a,g?g.metadata.map(function(e){return on(on({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return on(on({value:function(){return{}}},e),{},{items:e.items&&e.items.map(function(e){return on({value:function(){return{}}},e)})})})})}):[]),results:function(e){if(!e)return null;if(Array.isArray(e.results))return e.results.reduce(function(e,t){return on(on({},e),{},O({},t._internalIndexId,new lt.SearchResults(new lt.SearchParameters(t.state),t.rawResults)))},{});return new lt.SearchResults(new lt.SearchParameters(e.state),e.rawResults)}(a),error:null,searching:!1,isSearchStalled:!0,searchingForFacetValues:!1},p=d,m=[],{getState:function(){return p},setState:function(e){p=e,m.forEach(function(e){return e()})},subscribe:function(e){return m.push(e),function(){m.splice(m.indexOf(e),1)}}});function y(t){return h.getWidgets().filter(function(e){return Boolean(e.getMetadata)}).map(function(e){return e.getMetadata(t)})}function x(){var t=h.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){return!un(e)&&!fn(e)}).reduce(function(e,t){return t.getSearchParameters(e)},f),e=h.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=un(e)&&ln(e,r),n=fn(e)&&hn(e,r);return t||n}).sort(dn).reduce(function(e,t){return t.getSearchParameters(e)},t),n=h.getWidgets().filter(function(e){return Boolean(e.getSearchParameters)}).filter(function(e){var t=un(e)&&!ln(e,r),n=fn(e)&&!hn(e,r);return t||n}).sort(dn).reduce(function(e,t){var n=un(t)?t.props.indexContextValue.targetedIndex:t.props.indexId,r=e[n]||[];return on(on({},e),{},O({},n,r.concat(t)))},{});return{mainParameters:e,derivedParameters:Object.keys(n).map(function(e){return{parameters:n[e].reduce(function(e,t){return t.getSearchParameters(e)},t),indexId:e}})}}function b(){if(!o){var e=x(),t=e.mainParameters,n=e.derivedParameters;u=n.length+1,c.derivedHelpers.slice().forEach(function(e){e.detach()}),n.forEach(function(e){var t=e.indexId,n=e.parameters;c.derive(function(){return n}).on("result",R({indexId:t})).on("error",P)}),c.setState(t),c.search()}}function R(e){var o=e.indexId;return function(e){u--;var t=v.getState(),n=!c.derivedHelpers.length,r=t.results?t.results:{};r=!n&&r.getFacetByName?{}:r,r=n?e.results:on(on({},r),{},O({},o,e.results));var i=v.getState(),a=i.isSearchStalled;c.hasPendingRequests()||(clearTimeout(l),l=null,a=!1);i.resultsFacetValues;var s=F(i,nn);v.setState(on(on({},s),{},{results:r,isSearchStalled:a,searching:0<u,error:null}))}}function P(e){var t=e.error,n=v.getState(),r=n.isSearchStalled;c.hasPendingRequests()||(clearTimeout(l),r=!1);n.resultsFacetValues;var i=F(n,rn);v.setState(on(on({},i),{},{isSearchStalled:r,error:t,searching:!1}))}return{store:v,widgetsManager:h,getWidgetsIds:function(){return v.getState().metadata.reduce(function(e,t){return void 0!==t.id?e.concat(t.id):e},[])},getSearchParameters:x,onSearchForFacetValues:function(e){var n=e.facetName,r=e.query,t=e.maxFacetHits,i=void 0===t?10:t,a=Math.max(1,Math.min(i,100));v.setState(on(on({},v.getState()),{},{searchingForFacetValues:!0})),c.searchForFacetValues(n,r,a).then(function(e){var t;v.setState(on(on({},v.getState()),{},{error:null,searchingForFacetValues:!1,resultsFacetValues:on(on({},v.getState().resultsFacetValues),{},(t={},O(t,n,e.facetHits),O(t,"query",r),t))}))},function(e){v.setState(on(on({},v.getState()),{},{searchingForFacetValues:!1,error:e}))}).catch(function(e){setTimeout(function(){throw e})})},onExternalStateUpdate:function(e){var t=y(e);v.setState(on(on({},v.getState()),{},{widgets:e,metadata:t,searching:!0})),b()},transitionState:function(e){var n=v.getState().widgets;return h.getWidgets().filter(function(e){return Boolean(e.transitionState)}).reduce(function(e,t){return t.transitionState(n,e)},e)},updateClient:function(e){cn(e),c.setClient(e),b()},updateIndex:function(e){f=f.setIndex(e)},clearCache:function(){c.clearCache(),b()},skipSearch:function(){o=!0}}}function gn(e,t){var n=document.createElement("meta"),r=document.querySelector("head");n.name="algolia:metadata";var i,o,a,s,c=(i=t,o=["contextValue","indexContextValue"],a=e.map(function(e){var t=e.props,n=e.constructor,r=n._connectorDesc||{},i=r.defaultProps,a=void 0===i?{}:i,s=r.displayName;return{displayName:void 0===s?n.displayName:s,$$type:n.$$type,$$widgetType:n.$$widgetType,params:Object.keys(t).filter(function(e){return!o.includes(e)&&a[e]!==t[e]&&void 0!==t[e]})}}),{ua:(s=i).transporter&&s.transporter.userAgent?s.transporter.userAgent.value:s._ua,widgets:a});n.content=JSON.stringify(c),r.appendChild(n)}function vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function yn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?vn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xn(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t=l(r);if(i){var n=l(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return a(this,e)}}function bn(e){return Boolean(e.searchState)}var Rn=function(e){p(a,s.Component);var i=xn(a);function a(e){var t;f(this,a),O(d(t=i.call(this,e)),"isUnmounting",!1);var n=mn({indexName:t.props.indexName,searchClient:t.props.searchClient,initialState:t.props.searchState||{},resultsState:t.props.resultsState,stalledSearchDelay:t.props.stalledSearchDelay}),r={store:n.store,widgetsManager:n.widgetsManager,mainTargetedIndex:t.props.indexName,onInternalStateUpdate:t.onWidgetsInternalStateUpdate.bind(d(t)),createHrefForState:t.createHrefForState.bind(d(t)),onSearchForFacetValues:t.onSearchForFacetValues.bind(d(t)),onSearchStateChange:t.onSearchStateChange.bind(d(t)),onSearchParameters:t.onSearchParameters.bind(d(t))};return t.state={isControlled:bn(t.props),instantSearchManager:n,contextValue:r},t}return h(a,[{key:"componentDidUpdate",value:function(e){var t=bn(e);if(t&&!this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being controlled to uncontrolled");if(!t&&this.state.isControlled)throw new Error("You can't switch <InstantSearch> from being uncontrolled to controlled");this.props.refresh!==e.refresh&&this.props.refresh&&this.state.instantSearchManager.clearCache(),e.indexName!==this.props.indexName&&this.state.instantSearchManager.updateIndex(this.props.indexName),e.searchClient!==this.props.searchClient&&this.state.instantSearchManager.updateClient(this.props.searchClient)}},{key:"componentDidMount",value:function(){"object"===("undefined"==typeof window?"undefined":o(window))&&"object"===o(window.navigator)&&"string"==typeof window.navigator.userAgent&&window.navigator.userAgent.includes("Algolia Crawler")&&"object"===o(window.document)&&gn(this.state.instantSearchManager.widgetsManager.getWidgets(),this.props.searchClient)}},{key:"componentWillUnmount",value:function(){this.isUnmounting=!0,this.state.instantSearchManager.skipSearch()}},{key:"createHrefForState",value:function(e){return e=this.state.instantSearchManager.transitionState(e),this.state.isControlled&&this.props.createURL?this.props.createURL(e,this.getKnownKeys()):"#"}},{key:"onWidgetsInternalStateUpdate",value:function(e){e=this.state.instantSearchManager.transitionState(e),this.onSearchStateChange(e),this.state.isControlled||this.state.instantSearchManager.onExternalStateUpdate(e)}},{key:"onSearchStateChange",value:function(e){this.props.onSearchStateChange&&!this.isUnmounting&&this.props.onSearchStateChange(e)}},{key:"onSearchParameters",value:function(e,t,n,r,i){if(this.props.onSearchParameters){var a=this.props.searchState?this.props.searchState:{};this.props.onSearchParameters(e,t,n,a)}if(this.props.widgetsCollector){var s=this.props.searchState?this.props.searchState:{};this.props.widgetsCollector({getSearchParameters:e,getMetadata:r,context:t,props:n,searchState:s,displayName:i})}}},{key:"onSearchForFacetValues",value:function(e){this.state.instantSearchManager.onSearchForFacetValues(e)}},{key:"getKnownKeys",value:function(){return this.state.instantSearchManager.getWidgetsIds()}},{key:"render",value:function(){return 0===s.Children.count(this.props.children)?null:c.createElement(T,{value:this.state.contextValue},this.props.children)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=bn(e),r=t.instantSearchManager.store.getState().widgets,i=e.searchState;return n&&!x(r,i)&&t.instantSearchManager.onExternalStateUpdate(e.searchState),{isControlled:n,contextValue:yn(yn({},t.contextValue),{},{mainTargetedIndex:e.indexName})}}}]),a}();O(Rn,"defaultProps",{stalledSearchDelay:200,refresh:!1});function Pn(e,t,n){var r=ne(e,t,n,"query","");return r||""}var Fn=q({displayName:"AlgoliaAutoComplete",$$type:"ais.autoComplete",getProvidedProps:function(e,t,n){return{hits:(r=n,r.results?r.results.hits&&Array.isArray(r.results.hits)?C(w(r.results.hits,r.results.queryID),r.results.hitsPerPage,r.results.page):Object.keys(r.results).reduce(function(e,t){return[].concat(he(e),[{index:t,hits:C(w(r.results[t].hits,r.results[t].queryID),r.results[t].hitsPerPage,r.results[t].page)}])},[]):[]),currentRefinement:Pn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue})};var r},refine:function(e,t,n){return r=t,i=n,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},ee(r,O({},"query",i),a,!0);var r,i,a},cleanUp:function(e,t){return n=t,r={ais:e.contextValue,multiIndexContext:e.indexContextValue},re(n,r,"query");var n,r},getSearchParameters:function(e,t,n){return e.setQuery(Pn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))}}),On=function(e){return e.attributes[0]};var Sn=q({displayName:"AlgoliaBreadcrumb",$$type:"ais.breadcrumb",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},transformItems:qt.func},getProvidedProps:function(e,t,n){var r=On(e),i=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!(Boolean(i)&&Boolean(i.getFacetByName(r))))return{items:[],canRefine:!1};var a=i.getFacetValues(r),s=a.data?function n(e){return e.reduce(function(e,t){return t.isRefined&&(e.push({label:t.name,value:t.escapedValue}),t.data&&(e=e.concat(n(t.data)))),e},[])}(a.data):[],o=e.transformItems?e.transformItems(s):s;return{canRefine:0<o.length,items:o}},refine:function(e,t,n){return i=t,a=n,s={ais:(r=e).contextValue,multiIndexContext:e.indexContextValue},ee(i,O({},On(r),a||""),s,!0,"hierarchicalMenu");var r,i,a,s}});function jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Cn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?jn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var wn=q({displayName:"AlgoliaCurrentRefinements",$$type:"ais.currentRefinements",propTypes:{transformItems:qt.func},getProvidedProps:function(n,e,t,r){var i=r.reduce(function(e,t){return void 0!==t.items&&(n.clearsQuery||"query"!==t.id)?n.clearsQuery&&"query"===t.id&&""===t.items[0].currentRefinement?e:e.concat(t.items.map(function(e){return Cn(Cn({},e),{},{id:t.id,index:t.index})})):e},[]),a=n.transformItems?n.transformItems(i):i;return{items:a,canRefine:0<a.length}},refine:function(e,t,n){return(n instanceof Array?n.map(function(e){return e.value}):[n]).reduce(function(e,t){return t(e)},t)}}),Vn=["defaultRefinement"],In=function(e){return[e.northEast.lat,e.northEast.lng,e.southWest.lat,e.southWest.lng].join()},_n=/^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/,En=function(e){var t=e.match(_n);return{lat:parseFloat(t[1]),lng:parseFloat(t[2])}},An=function(e,t,n){var r=ne(e,t,n,"boundingBox",{});if(I(r))return{northEast:{lat:parseFloat(r.northEast.lat),lng:parseFloat(r.northEast.lng)},southWest:{lat:parseFloat(r.southWest.lat),lng:parseFloat(r.southWest.lng)}}},Nn=function(e,t,n){return ee(e,O({},"boundingBox",t),n,!0)},Dn=q({displayName:"AlgoliaGeoSearch",$$type:"ais.geoSearch",getProvidedProps:function(e,t,n){var r,i,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},s=X(n,a),o=An(e,t,a),c=s&&s._state.insideBoundingBox&&(r=s._state.insideBoundingBox,i=r.split(","),{northEast:{lat:parseFloat(i[0]),lng:parseFloat(i[1])},southWest:{lat:parseFloat(i[2]),lng:parseFloat(i[3])}})||void 0,u=function(e,t,n){e.defaultRefinement;var r=F(e,Vn),i=ne(r,t,n,"aroundLatLng");if(i)return i;var a=ne(r,t,n,"configure.aroundLatLng");return a&&En(a)}(e,t,a),l=s&&s._state.aroundLatLng&&En(s._state.aroundLatLng)||void 0,f=o||c,h=u||l;return{hits:s?s.hits.filter(function(e){return Boolean(e._geoloc)}):[],isRefinedWithMap:Boolean(f),currentRefinement:f,position:h}},refine:function(e,t,n){return Nn(t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},getSearchParameters:function(e,t,n){var r=An(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return r?e.setQueryParameter("insideBoundingBox",In(r)):e},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"boundingBox")},getMetadata:function(e,t){var n=[],r="boundingBox",i={ais:e.contextValue,multiIndexContext:e.indexContextValue},a=K(i),s={},o=An(e,t,i);return o&&n.push({label:"".concat(r,": ").concat(In(o)),value:function(e){return Nn(e,s,i)},currentRefinement:o}),{id:r,index:a,items:n}},shouldComponentUpdate:function(){return!0}});function Tn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Hn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var kn=function(e){return e.attributes[0]},Mn="hierarchicalMenu";function $n(e,t,n){var r=ne(e,t,n,"".concat(Mn,".").concat(kn(e)),null);return""===r?null:r}function Qn(e,f,h,d){return e.map(function(e){return{label:e.name,value:(t=e.escapedValue,n=f,r=h,i=d,a=n.id,s=n.attributes,o=n.separator,c=n.rootPath,u=n.showParentLevel,l=$n(n,r,i),null===l?t:new lt.SearchParameters({hierarchicalFacets:[{name:a,attributes:s,separator:o,rootPath:c,showParentLevel:u}]}).toggleHierarchicalFacetRefinement(a,l).toggleHierarchicalFacetRefinement(a,t).getHierarchicalRefinement(a)[0]),count:e.count,isRefined:e.isRefined,items:e.data&&Qn(e.data,f,h,d)};var t,n,r,i,a,s,o,c,u,l})}function Bn(e,t,n,r){return ee(t,O({},kn(e),n||""),r,!0,Mn)}var Ln=["name:asc"],qn=q({displayName:"AlgoliaHierarchicalMenu",$$type:"ais.hierarchicalMenu",propTypes:{attributes:function(e,t,n){if(!Array.isArray(e[t])||e[t].some(function(e){return"string"!=typeof e})||e[t].length<1)return new Error("Invalid prop ".concat(t," supplied to ").concat(n,". Expected an Array of Strings"))},separator:qt.string,rootPath:qt.string,showParentLevel:qt.bool,defaultRefinement:qt.string,showMore:qt.bool,limit:qt.number,showMoreLimit:qt.number,transformItems:qt.func,facetOrdering:qt.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,separator:" > ",rootPath:null,showParentLevel:!0,facetOrdering:!0},getProvidedProps:function(e,t,n){var r=e.showMore,i=e.limit,a=e.showMoreLimit,s=e.facetOrdering,o=kn(e),c=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!(Boolean(c)&&Boolean(c.getFacetByName(o))))return{items:[],currentRefinement:$n(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:!1};var u=r?a:i,l=c.getFacetValues(o,{sortBy:Ln,facetOrdering:s}),f=l.data?Qn(l.data,e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}):[],h=e.transformItems?e.transformItems(f):f;return{items:function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:10;return e.slice(0,n).map(function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Array.isArray(e.items)?Hn(Hn({},e),{},{items:t(e.items,n)}):e})}(h,u),currentRefinement:$n(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:0<h.length}},refine:function(e,t,n){return Bn(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(Mn,".").concat(kn(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attributes,i=t.separator,a=t.rootPath,s=t.showParentLevel,o=t.showMore,c=t.limit,u=t.showMoreLimit,l=t.contextValue,f=kn(t),h=o?u:c;e=e.addHierarchicalFacet({name:f,attributes:r,separator:i,rootPath:a,showParentLevel:s}).setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,h)});var d=$n(t,n,{ais:l,multiIndexContext:t.indexContextValue});return null!==d&&(e=e.toggleHierarchicalFacetRefinement(f,d)),e},getMetadata:function(t,e){var n=t.attributes[0],r=kn(t),i=$n(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=i?[{label:"".concat(n,": ").concat(A(i)),attribute:n,value:function(e){return Bn(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:i}]:[];return{id:r,index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:a}}}),Un=function(e){var t=e.attribute,n=e.hit,r=e.highlightProperty,i=e.preTag,a=void 0===i?U.highlightPreTag:i,s=e.postTag;return function(e){var t=e.preTag,n=void 0===t?"<em>":t,r=e.postTag,i=void 0===r?"</em>":r,a=e.highlightProperty,s=e.attribute,o=e.hit;if(!o)throw new Error("`hit`, the matching record, must be provided");var c=E(o[a],s)||{};return Array.isArray(c)?c.map(function(e){return W({preTag:n,postTag:i,highlightedValue:e.value})}):W({preTag:n,postTag:i,highlightedValue:c.value})}({attribute:t,highlightProperty:r,hit:n,preTag:a,postTag:void 0===s?U.highlightPostTag:s})},Wn=q({displayName:"AlgoliaHighlighter",$$type:"ais.highlighter",propTypes:{},getProvidedProps:function(){return{highlight:Un}}}),zn=q({displayName:"AlgoliaHits",$$type:"ais.hits",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return r?{hits:w(C(r.hits,r.hitsPerPage,r.page),r.queryID)}:{hits:[]}},getSearchParameters:function(e){return e}});function Jn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jn(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Gn(e,t,n){var r=ne(e,t,n,"hitsPerPage",null);return"string"==typeof r?parseInt(r,10):r}var Kn=q({displayName:"AlgoliaHitsPerPage",$$type:"ais.hitsPerPage",propTypes:{defaultRefinement:qt.number.isRequired,items:qt.arrayOf(qt.shape({label:qt.string,value:qt.number.isRequired})).isRequired,transformItems:qt.func},getProvidedProps:function(e,t){var n=Gn(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),r=e.items.map(function(e){return e.value===n?Yn(Yn({},e),{},{isRefined:!0}):Yn(Yn({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(r):r,currentRefinement:n}},refine:function(e,t,n){return ee(t,O({},"hitsPerPage",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"hitsPerPage")},getSearchParameters:function(e,t,n){return e.setHitsPerPage(Gn(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(){return{id:"hitsPerPage"}}}),Xn=["page"];function Zn(e){var t=e||{};t.page;return F(t,Xn)}var er=q({displayName:"AlgoliaInfiniteHits",$$type:"ais.infiniteHits",getProvidedProps:function(e,t,n){var r=this,i=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!i)return{hits:[],hasPrevious:!1,hasMore:!1,refine:function(){},refinePrevious:function(){},refineNext:function(){}};var a,s,o=i.page,c=i.hits,u=i.hitsPerPage,l=i.nbPages,f=i._state;this._cache=e.cache?e.cache:this._cache||(s=a=void 0,{read:function(e){var t=e.state;return x(s,Zn(t))?a:null},write:function(e){var t=e.state,n=e.hits;s=Zn(t),a=n}});var h=this._cache.read({state:f})||{},d=w(C(c,u,o),i.queryID);h[o]=d,this._cache.write({state:f,hits:h});var p,m=Math.min.apply(Math,he(Object.keys(h).map(Number))),g=Math.max.apply(Math,he(Object.keys(h).map(Number))),v=0<m,y=g<l-1;return{hits:(p=h,Object.keys(p).map(Number).sort(function(e,t){return e-t}).reduce(function(e,t){return e.concat(p[t])},[])),hasPrevious:v,hasMore:y,refinePrevious:function(e){return r.refine(e,m-1)},refineNext:function(e){return r.refine(e,g+1)}}},getSearchParameters:function(e,t,n){return e.setQueryParameters({page:(r=t,i=n,a={ais:t.contextValue,multiIndexContext:t.indexContextValue},s=ne(r,i,a,"page",1),("string"==typeof s?parseInt(s,10):s)-1)});var r,i,a,s},refine:function(e,t,n,r){return ee(t,O({},"page",r+1),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!1)}}),tr="menu";function nr(e){return e.attribute}function rr(e,t,n){var r=ne(e,t,n,"".concat(tr,".").concat(nr(e)),null);return""===r?null:r}function ir(e,t,n,r){return e===rr(t,n,r)?"":e}function ar(e){var t=e.showMore,n=e.limit,r=e.showMoreLimit;return t?r:n}function sr(e,t,n,r){return ee(t,O({},nr(e),n||""),r,!0,tr)}var or=["count:desc","name:asc"],cr=q({displayName:"AlgoliaMenu",$$type:"ais.menu",propTypes:{attribute:qt.string.isRequired,showMore:qt.bool,limit:qt.number,showMoreLimit:qt.number,defaultRefinement:qt.string,transformItems:qt.func,searchable:qt.bool,facetOrdering:qt.bool},defaultProps:{showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a,s=t.attribute,o=t.searchable,c=t.indexContextValue,u=t.facetOrdering,l=X(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),f=Boolean(l)&&Boolean(l.getFacetByName(s)),h=Boolean(i&&i[s]&&""!==i.query);if(o&&c)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");if(!f)return{items:[],currentRefinement:rr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:h,searchable:o,canRefine:f};a=h?i[s].map(function(e){return{label:e.value,value:ir(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):l.getFacetValues(s,{sortBy:o?void 0:or,facetOrdering:u}).map(function(e){return{label:e.name,value:ir(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}});var d=t.transformItems?t.transformItems(a):a;return{items:d.slice(0,ar(t)),currentRefinement:rr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:h,searchable:o,canRefine:0<d.length}},refine:function(e,t,n){return sr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:ar(e)}},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(tr,".").concat(nr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute;e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,ar(t))})).addDisjunctiveFacet(r);var i=rr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return null!==i&&(e=e.addDisjunctiveFacetRefinement(r,i)),e},getMetadata:function(t,e){var n=nr(t),r=rr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:n,index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===r?[]:[{label:"".concat(t.attribute,": ").concat(A(r)),attribute:t.attribute,value:function(e){return sr(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:r}]}}});function ur(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],s=!0,o=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);s=!0);}catch(e){o=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(o)throw i}}return a}}(e,t)||fe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lr(e){if(void 0===e.start&&void 0===e.end)return"";var t=void 0!==e.start?e.start:"",n=void 0!==e.end?e.end:"";return"".concat(t,":").concat(n)}var fr="multiRange";function hr(e){return e.attribute}function dr(e,t,n){return ne(e,t,n,"".concat(fr,".").concat(hr(e)),"")}function pr(e,t,n,r){return ee(t,O({},hr(e),n),r,!0,fr)}var mr=q({displayName:"AlgoliaNumericMenu",$$type:"ais.numericMenu",propTypes:{id:qt.string,attribute:qt.string.isRequired,items:qt.arrayOf(qt.shape({label:qt.node,start:qt.number,end:qt.number})).isRequired,transformItems:qt.func},getProvidedProps:function(m,e,t){var n=m.attribute,g=dr(m,e,{ais:m.contextValue,multiIndexContext:m.indexContextValue}),v=X(t,{ais:m.contextValue,multiIndexContext:m.indexContextValue}),r=m.items.map(function(e){var t,n,r,i,a,s,o,c,u,l,f,h,d,p=lr(e);return{label:e.label,value:p,isRefined:p===g,noRefinement:!!v&&(t=hr(m),n=v,r=p,l=n.getFacetByName(t)?n.getFacetStats(t):null,f=r.split(":"),h=0===Number(f[0])||""===r?Number.NEGATIVE_INFINITY:Number(f[0]),d=0===Number(f[1])||""===r?Number.POSITIVE_INFINITY:Number(f[1]),!(Boolean(l)&&(c=h,u=d,(o=l).min>=c&&o.min<=u||o.max>=c&&o.max<=u||(s=d,(a=h)>=(i=l).min&&a<=i.max||s>=i.min&&s<=i.max))))}}),i=v&&v.getFacetByName(n)?v.getFacetStats(n):null,a=V(r,function(e){return!0===e.isRefined});r.some(function(e){return""===e.value})||r.push({value:"",isRefined:void 0===a,noRefinement:!i,label:"All"});var s=m.transformItems?m.transformItems(r):r;return{items:s,currentRefinement:g,canRefine:0<s.length&&s.some(function(e){return!1===e.noRefinement})}},refine:function(e,t,n){return pr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(fr,".").concat(hr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i=function(e){if(0===e.length)return{start:null,end:null};var t=ur(e.split(":"),2),n=t[0],r=t[1];return{start:0<n.length?parseFloat(n):null,end:0<r.length?parseFloat(r):null}}(dr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})),a=i.start,s=i.end;return e=e.addDisjunctiveFacet(r),"number"==typeof a&&(e=e.addNumericRefinement(r,">=",a)),"number"==typeof s&&(e=e.addNumericRefinement(r,"<=",s)),e},getMetadata:function(t,e){var n=hr(t),r=dr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),i=[],a=K({ais:t.contextValue,multiIndexContext:t.indexContextValue});if(""!==r){var s=V(t.items,function(e){return lr(e)===r}).label;i.push({label:"".concat(t.attribute,": ").concat(s),attribute:t.attribute,currentRefinement:s,value:function(e){return pr(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})}})}return{id:n,index:a,items:i}}});function gr(e,t,n){var r=ne(e,t,n,"page",1);return"string"==typeof r?parseInt(r,10):r}var vr=q({displayName:"AlgoliaPagination",$$type:"ais.pagination",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});if(!r)return null;var i=r.nbPages;return{nbPages:i,currentRefinement:gr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),canRefine:1<i}},refine:function(e,t,n){return r=t,i=n,a={ais:e.contextValue,multiIndexContext:e.indexContextValue},ee(r,O({},"page",i),a,!1);var r,i,a},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"page")},getSearchParameters:function(e,t,n){return e.setPage(gr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue})-1)},getMetadata:function(){return{id:"page"}}}),yr=q({displayName:"AlgoliaPoweredBy",$$type:"ais.poweredBy",getProvidedProps:function(){var e="undefined"==typeof window||void 0===window.location?"":window.location.hostname;return{url:"https://www.algolia.com/?utm_source=react-instantsearch&utm_medium=website&"+"utm_content=".concat(e,"&")+"utm_campaign=poweredby"}}});function xr(e){return e.attribute}var br="range";function Rr(e,t,n,r){var i=ne(e,t,r,"".concat(br,".").concat(xr(e)),{}),a=i.min,s=i.max,o=Boolean(e.precision),c=a;"string"==typeof c&&(c=o?parseFloat(c):parseInt(c,10));var u=s;"string"==typeof u&&(u=o?parseFloat(u):parseInt(u,10));var l={min:c,max:u},f=void 0!==e.min,h=void 0!==e.max,d=void 0!==l.min,p=void 0!==l.max;if(f&&d&&l.min<n.min)throw Error("You can't provide min value lower than range.");if(h&&p&&l.max>n.max)throw Error("You can't provide max value greater than range.");return f&&!d&&(l.min=n.min),h&&!p&&(l.max=n.max),l}function Pr(e,t){return{min:void 0!==e.min?e.min:t.min,max:void 0!==e.max?e.max:t.max}}function Fr(e,t,n,r){return e||n!==r?e&&t?n:r:void 0}function Or(e,t,n,r,i){var a=n.min,s=n.max,o=r.min,c=r.max,u=void 0===a||""===a,l=void 0===s||""===s,f=u?void 0:parseFloat(a),h=l?void 0:parseFloat(s),d=u||isFinite(f),p=l||isFinite(h);if(!d||!p)throw Error("You can't provide non finite values to the range connector.");if(f<o)throw Error("You can't provide min value lower than range.");if(c<h)throw Error("You can't provide max value greater than range.");return ee(t,O({},xr(e),{min:Fr(void 0!==e.min,u,o,f),max:Fr(void 0!==e.max,l,c,h)}),i,!0,br)}var Sr=q({displayName:"AlgoliaRange",$$type:"ais.range",propTypes:{id:qt.string,attribute:qt.string.isRequired,defaultRefinement:qt.shape({min:qt.number,max:qt.number}),min:qt.number,max:qt.number,precision:qt.number,header:qt.node,footer:qt.node},defaultProps:{precision:0},getProvidedProps:function(e,t,n){var r,i,a,s,o,c,u=e.attribute,l=e.precision,f=e.min,h=e.max,d=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),p=d&&d.getFacetByName(u),m=p&&d.getFacetStats(u)||{},g=(p?d.getFacetValues(u):[]).map(function(e){return{value:e.name,count:e.count}}),v=(r={min:f,max:h},i=m,a=l,c=Math.pow(10,a),s="number"==typeof r.min&&isFinite(r.min)?r.min:"number"==typeof i.min&&isFinite(i.min)?i.min:void 0,o="number"==typeof r.max&&isFinite(r.max)?r.max:"number"==typeof i.max&&isFinite(i.max)?i.max:void 0,{min:void 0!==s?Math.floor(s*c)/c:s,max:void 0!==o?Math.ceil(o*c)/c:o}),y=v.min,x=v.max;this._currentRange={min:y,max:x};var b=Rr(e,t,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{min:y,max:x,canRefine:0<g.length,currentRefinement:Pr(b,this._currentRange),count:g,precision:l}},refine:function(e,t,n){return Or(e,t,n,this._currentRange,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(br,".").concat(xr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i=Rr(t,n,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),a=i.min,s=i.max;return e=e.addDisjunctiveFacet(r),void 0!==a&&(e=e.addNumericRefinement(r,">=",a)),void 0!==s&&(e=e.addNumericRefinement(r,"<=",s)),e},getMetadata:function(t,e){var n=this,r=this._currentRange,i=r.min,a=r.max,s=Rr(t,e,this._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),o=s.min,c=s.max,u=[],l=void 0!==o,f=void 0!==c;if(l&&o!==i||f&&c!==a){var h=[l?"".concat(o," <= "):"",t.attribute,f?" <= ".concat(c):""];u.push({label:h.join(""),attribute:t.attribute,value:function(e){return Or(t,e,{},n._currentRange,{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:Pr({min:o,max:c},{min:i,max:a})})}return{id:xr(t),index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:u}}}),jr="refinementList";function Cr(e){return e.attribute}function wr(e,t,n){var r=ne(e,t,n,"".concat(jr,".").concat(Cr(e)),[]);return"string"!=typeof r?r:r?[r]:[]}function Vr(t,e,n,r){var i=wr(e,n,r);return-1===i.indexOf(t)?i.concat([t]):i.filter(function(e){return e!==t})}function Ir(e){var t=e.showMore,n=e.limit,r=e.showMoreLimit;return t?r:n}function _r(e,t,n,r){return ee(t,O({},Cr(e),0<n.length?n:""),r,!0,jr)}var Er=["isRefined","count:desc","name:asc"],Ar=q({displayName:"AlgoliaRefinementList",$$type:"ais.refinementList",propTypes:{id:qt.string,attribute:qt.string.isRequired,operator:qt.oneOf(["and","or"]),showMore:qt.bool,limit:qt.number,showMoreLimit:qt.number,defaultRefinement:qt.arrayOf(qt.oneOfType([qt.string,qt.number])),searchable:qt.bool,transformItems:qt.func,facetOrdering:qt.bool},defaultProps:{operator:"or",showMore:!1,limit:10,showMoreLimit:20,facetOrdering:!0},getProvidedProps:function(t,n,e,r,i){var a=t.attribute,s=t.searchable,o=t.indexContextValue,c=t.facetOrdering,u=X(e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),l=Boolean(u)&&Boolean(u.getFacetByName(a)),f=Boolean(i&&i[a]&&""!==i.query);if(s&&o)throw new Error("react-instantsearch: searching in *List is not available when used inside a multi index context");if(!l)return{items:[],currentRefinement:wr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),canRefine:l,isFromSearch:f,searchable:s};var h=f?i[a].map(function(e){return{label:e.value,value:Vr(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),_highlightResult:{label:{value:e.highlighted}},count:e.count,isRefined:e.isRefined}}):u.getFacetValues(a,{sortBy:Er,facetOrdering:c}).map(function(e){return{label:e.name,value:Vr(e.escapedValue,t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),count:e.count,isRefined:e.isRefined}}),d=t.transformItems?t.transformItems(h):h;return{items:d.slice(0,Ir(t)),currentRefinement:wr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),isFromSearch:f,searchable:s,canRefine:0<d.length}},refine:function(e,t,n){return _r(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},searchForFacetValues:function(e,t,n){return{facetName:e.attribute,query:n,maxFacetHits:Ir(e)}},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(jr,".").concat(Cr(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i="and"===t.operator?"addFacet":"addDisjunctiveFacet",a="".concat(i,"Refinement");return e=(e=e.setQueryParameters({maxValuesPerFacet:Math.max(e.maxValuesPerFacet||0,Ir(t))}))[i](r),wr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}).reduce(function(e,t){return e[a](r,t)},e)},getMetadata:function(r,i){var e=Cr(r),a={ais:r.contextValue,multiIndexContext:r.indexContextValue};return{id:e,index:K(a),items:0<wr(r,i,a).length?[{attribute:r.attribute,label:"".concat(r.attribute,": "),currentRefinement:wr(r,i,a),value:function(e){return _r(r,e,[],a)},items:wr(r,i,a).map(function(n){return{label:A("".concat(n)),value:function(e){var t=wr(r,e,a).filter(function(e){return e!==n});return _r(r,i,t,a)}}})}]:[]}}}),Nr=q({displayName:"AlgoliaScrollTo",$$type:"ais.scrollTo",propTypes:{scrollOn:qt.string},defaultProps:{scrollOn:"page"},getProvidedProps:function(e,t){var n=e.scrollOn,r=ne(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},n,null);this._prevSearchState||(this._prevSearchState={}),Z({ais:e.contextValue,multiIndexContext:e.indexContextValue})&&(t=t.indices?t.indices[K({ais:e.contextValue,multiIndexContext:e.indexContextValue})]:{});var i=_(t,["configure",n]),a=R(this._prevSearchState,i);return this._prevSearchState=i,{value:r,hasNotChanged:a}}});function Dr(e,t,n){var r=ne(e,t,n,"query","");return r||""}function Tr(e,t,n,r){return ee(t,O({},"query",n),r,!0)}var Hr=q({displayName:"AlgoliaSearchBox",$$type:"ais.searchBox",propTypes:{defaultRefinement:qt.string},getProvidedProps:function(e,t,n){return{currentRefinement:Dr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return Tr(0,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,r={ais:e.contextValue,multiIndexContext:e.indexContextValue},re(n,r,"query");var n,r},getSearchParameters:function(e,t,n){return e.setQuery(Dr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}))},getMetadata:function(t,e){var n=Dr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===n?[]:[{label:"".concat("query",": ").concat(n),value:function(e){return Tr(0,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:n}]}}});var kr=q({displayName:"AlgoliaRelevantSort",$$type:"ais.relevantSort",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return r?{isVirtualReplica:void 0!==r.appliedRelevancyStrictness,isRelevantSorted:void 0!==r.appliedRelevancyStrictness&&0<r.appliedRelevancyStrictness}:{isVirtualReplica:!1,isRelevantSorted:!1}},getSearchParameters:function(e,t,n){return e.setQueryParameter("relevancyStrictness",(i=n,a={ais:(r=t).contextValue,multiIndexContext:t.indexContextValue},ne(r,i,a,"relevancyStrictness")));var r,i,a},refine:function(e,t,n){return ee(t,O({},"relevancyStrictness",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)}});function Mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function $r(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mr(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Qr(e,t,n){var r=ne(e,t,n,"sortBy",null);return r||null}var Br=q({displayName:"AlgoliaSortBy",$$type:"ais.sortBy",propTypes:{defaultRefinement:qt.string,items:qt.arrayOf(qt.shape({label:qt.string,value:qt.string.isRequired})).isRequired,transformItems:qt.func},getProvidedProps:function(e,t){var n=Qr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),r=e.items.map(function(e){return e.value===n?$r($r({},e),{},{isRefined:!0}):$r($r({},e),{},{isRefined:!1})});return{items:e.transformItems?e.transformItems(r):r,currentRefinement:n}},refine:function(e,t,n){return ee(t,O({},"sortBy",n),{ais:e.contextValue,multiIndexContext:e.indexContextValue},!0)},cleanUp:function(e,t){return re(t,{ais:e.contextValue,multiIndexContext:e.indexContextValue},"sortBy")},getSearchParameters:function(e,t,n){var r=Qr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return e.setIndex(r)},getMetadata:function(){return{id:"sortBy"}}}),Lr=q({displayName:"AlgoliaStateResults",$$type:"ais.stateResults",getProvidedProps:function(e,t,n){return{searchState:t,searchResults:X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),allSearchResults:n.results,searching:n.searching,isSearchStalled:n.isSearchStalled,error:n.error,searchingForFacetValues:n.searchingForFacetValues,props:e}}}),qr=q({displayName:"AlgoliaStats",$$type:"ais.stats",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return r?{areHitsSorted:void 0!==r.appliedRelevancyStrictness&&0<r.appliedRelevancyStrictness&&r.nbHits!==r.nbSortedHits,nbHits:r.nbHits,nbSortedHits:r.nbSortedHits,processingTimeMS:r.processingTimeMS}:null}});function Ur(e){return e.attribute}var Wr="toggle",zr=["0","false","null","undefined"];function Jr(e,t,n){var r=ne(e,t,n,"".concat(Wr,".").concat(Ur(e)),!1);return-1===zr.indexOf(r)&&Boolean(r)}function Yr(e,t,n,r){return ee(t,O({},Ur(e),n||!1),r,!0,Wr)}var Gr=q({displayName:"AlgoliaToggle",$$type:"ais.toggle",propTypes:{label:qt.string.isRequired,attribute:qt.string.isRequired,value:qt.any.isRequired,filter:qt.func,defaultRefinement:qt.bool},getProvidedProps:function(e,t,n){var r=e.attribute,i=e.value,a=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),s=Jr(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),o=a&&a.getFacetByName(r)?a.getFacetValues(r):null,c=o&&o.length?V(o,function(e){return e.name===i.toString()}):null,u=c&&c.count,l=o&&o.length?o.reduce(function(e,t){return e+t.count},0):null;return{currentRefinement:s,canRefine:s?null!==l&&0<l:null!==u&&0<u,count:{checked:l,unchecked:u}}},refine:function(e,t,n){return Yr(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return r=t,i={ais:(n=e).contextValue,multiIndexContext:e.indexContextValue},re(r,i,"".concat(Wr,".").concat(Ur(n)));var n,r,i},getSearchParameters:function(e,t,n){var r=t.attribute,i=t.value,a=t.filter,s=Jr(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),o=e.addDisjunctiveFacet(r);return s&&(o=o.addDisjunctiveFacetRefinement(r,i),a&&(o=a(o))),o},getMetadata:function(t,e){var n=Ur(t),r=Jr(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),i=[],a=K({ais:t.contextValue,multiIndexContext:t.indexContextValue});return r&&i.push({label:t.label,currentRefinement:r,attribute:t.attribute,value:function(e){return Yr(t,e,!1,{ais:t.contextValue,multiIndexContext:t.indexContextValue})}}),{id:n,index:a,items:i}}});function Kr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function Xr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kr(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var Zr=function(r,i,a){return function(e,t){if("function"!=typeof r)throw new TypeError("Expected insightsClient to be a Function");var n=function(e){var t=e.method,n=e.results,r=e.currentHit,i=n.index,a=r.__queryID,s=[r.objectID];if(!a)throw new Error("Could not infer `queryID`. Ensure `clickAnalytics: true` was added with the Configure widget.\nSee: https://alg.li/VpPpLt");switch(t){case"clickedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s,positions:[r.__position]};case"convertedObjectIDsAfterSearch":return{index:i,queryID:a,objectIDs:s};default:throw new Error('Unsupported method "'.concat(t,'" passed to the insights function. The supported methods are: "clickedObjectIDsAfterSearch", "convertedObjectIDsAfterSearch".'))}}({method:e,results:i,currentHit:a});r(e,Xr(Xr({},n),t))}};function ei(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function ti(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ei(Object(n),!0).forEach(function(e){O(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ei(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function ni(e,t,n){var r=ne(e,t,n,"query","");return r||""}function ri(e,t,n,r){var i,a=e.language?{queryLanguages:[e.language.split("-")[0]]}:{},s="function"==typeof e.additionalQueryParameters?ti({ignorePlurals:!0,removeStopWords:!0,optionalWords:n},e.additionalQueryParameters({query:n})):{};return ee(t,(O(i={},"query",n),O(i,"additionalVoiceParameters",ti(ti({},a),s)),i),r,!0)}var ii=q({displayName:"AlgoliaVoiceSearch",$$type:"ais.voiceSearch",propTypes:{defaultRefinement:qt.string},getProvidedProps:function(e,t,n){return{currentRefinement:ni(e,t,{ais:e.contextValue,multiIndexContext:e.indexContextValue}),isSearchStalled:n.isSearchStalled}},refine:function(e,t,n){return ri(e,t,n,{ais:e.contextValue,multiIndexContext:e.indexContextValue})},cleanUp:function(e,t){return n=t,r={ais:e.contextValue,multiIndexContext:e.indexContextValue},re(re(n,r,"query"),r,"additionalVoiceParameters");var n,r},getSearchParameters:function(e,t,n){var r,i,a,s=ni(t,n,{ais:t.contextValue,multiIndexContext:t.indexContextValue}),o=(i=n,a={ais:(r=t).contextValue,multiIndexContext:t.indexContextValue},ne(r,i,a,"additionalVoiceParameters","")||{});return e.setQuery(s).setQueryParameters(o)},getMetadata:function(t,e){var n=ni(t,e,{ais:t.contextValue,multiIndexContext:t.indexContextValue});return{id:"query",index:K({ais:t.contextValue,multiIndexContext:t.indexContextValue}),items:null===n?[]:[{label:"".concat("query",": ").concat(n),value:function(e){return ri(t,e,"",{ais:t.contextValue,multiIndexContext:t.indexContextValue})},currentRefinement:n}]}}}),ai=Yt,si=zt;e.Configure=ue,e.DynamicWidgets=Yt,e.EXPERIMENTAL_connectConfigureRelatedItems=mt,e.EXPERIMENTAL_connectDynamicWidgets=si,e.ExperimentalConfigureRelatedItems=Wt,e.ExperimentalDynamicWidgets=ai,e.HIGHLIGHT_TAGS=U,e.Index=function(t){var n=t.indexName;return c.createElement(D,null,function(e){return c.createElement(tn,u({contextValue:e,indexId:n},t))})},e.InstantSearch=Rn,e.InstantSearchConsumer=D,e.InstantSearchProvider=T,e.QueryRuleContext=Xt,e.connectAutoComplete=Fn,e.connectBreadcrumb=Sn,e.connectConfigure=ce,e.connectCurrentRefinements=wn,e.connectDynamicWidgets=zt,e.connectGeoSearch=Dn,e.connectHierarchicalMenu=qn,e.connectHighlight=Wn,e.connectHitInsights=function(i){return q({displayName:"AlgoliaInsights",$$type:"ais.insights",getProvidedProps:function(e,t,n){var r=X(n,{ais:e.contextValue,multiIndexContext:e.indexContextValue});return{insights:Zr(i,r,e.hit)}}})},e.connectHits=zn,e.connectHitsPerPage=Kn,e.connectInfiniteHits=er,e.connectMenu=cr,e.connectNumericMenu=mr,e.connectPagination=vr,e.connectPoweredBy=yr,e.connectQueryRules=Kt,e.connectRange=Sr,e.connectRefinementList=Ar,e.connectRelevantSort=kr,e.connectScrollTo=Nr,e.connectSearchBox=Hr,e.connectSortBy=Br,e.connectStateResults=Lr,e.connectStats=qr,e.connectToggleRefinement=Gr,e.connectVoiceSearch=ii,e.createConnector=q,e.instantSearchContext=N,e.translatable=function(o){return function(t){var e=function(e){p(i,s.Component);var r=J(i);function i(){var s;f(this,i);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return O(d(s=r.call.apply(r,[this].concat(t))),"translate",function(e){var t=s.props.translations,n=t&&t.hasOwnProperty(e)?t[e]:o[e];if("function"!=typeof n)return n;for(var r=arguments.length,i=new Array(1<r?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return n.apply(void 0,i)}),s}return h(i,[{key:"render",value:function(){return c.createElement(t,u({translate:this.translate},this.props))}}]),i}(),n=t.displayName||t.name||"UnknownComponent";return e.displayName="Translatable(".concat(n,")"),e}},e.version=z,Object.defineProperty(e,"__esModule",{value:!0})});
3
3
  //# sourceMappingURL=ReactInstantSearchCore.min.js.map