New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

algoliasearch-helper

Package Overview
Dependencies
Maintainers
9
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

algoliasearch-helper - npm Package Compare versions

Comparing version 0.0.0-27095c0 to 0.0.0-6ac260d

index.d.ts

4

dist/algoliasearch.helper.min.js

@@ -1,3 +0,3 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.algoliasearchHelper=e()}}(function(){return function e(t,i,n){function r(a,c){if(!i[a]){if(!t[a]){var u="function"==typeof require&&require;if(!c&&u)return u(a,!0);if(s)return s(a,!0);var o=new Error("Cannot find module '"+a+"'");throw o.code="MODULE_NOT_FOUND",o}var f=i[a]={exports:{}};t[a][0].call(f.exports,function(e){var i=t[a][1][e];return r(i||e)},f,f.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(e,t,i){"use strict";function n(e,t,i){return new r(e,t,i)}var r=e("./src/algoliasearch.helper"),s=e("./src/SearchParameters"),a=e("./src/SearchResults");n.version=e("./src/version.js"),n.AlgoliaSearchHelper=r,n.SearchParameters=s,n.SearchResults=a,t.exports=n},{"./src/SearchParameters":5,"./src/SearchResults":7,"./src/algoliasearch.helper":8,"./src/version.js":22}],2:[function(e,t,i){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function s(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function c(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,i,n,s,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(i=this._events[e],c(i))return!1;if(r(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),i.apply(this,s)}else if(a(i))for(s=Array.prototype.slice.call(arguments,1),o=i.slice(),n=o.length,u=0;u<n;u++)o[u].apply(this,s);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(i=c(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var n=!1;return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var i,n,s,c;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=this._events[e],s=i.length,n=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(i)){for(c=s;c-- >0;)if(i[c]===t||i[c].listener&&i[c].listener===t){n=c;break}if(n<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,i;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(i=this._events[e],r(i))this.removeListener(e,i);else if(i)for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],3:[function(e,t,i){"use strict";function n(e,t){this.main=e,this.fn=t,this.lastResults=null}var r=e("events");e("../functions/inherits")(n,r.EventEmitter),n.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},n.prototype.getModifiedState=function(e){return this.fn(e)},t.exports=n},{"../functions/inherits":14,events:2}],4:[function(e,t,i){"use strict";var n=e("../functions/defaultsPure"),r=e("../functions/omit"),s=e("../functions/objectHasKeys"),a={addRefinement:function(e,t,i){if(a.isRefined(e,t,i))return e;var r=""+i,s=e[t]?e[t].concat(r):[r],c={};return c[t]=s,n({},c,e)},removeRefinement:function(e,t,i){if(void 0===i)return a.clearRefinement(e,t);var n=""+i;return a.clearRefinement(e,function(e,i){return t===i&&n===e})},toggleRefinement:function(e,t,i){if(void 0===i)throw new Error("toggleRefinement should be used with a value");return a.isRefined(e,t,i)?a.removeRefinement(e,t,i):a.addRefinement(e,t,i)},clearRefinement:function(e,t,i){if(void 0===t)return s(e)?{}:e;if("string"==typeof t)return e[t]&&e[t].length>0?r(e,t):e;if("function"==typeof t){var n=!1,a=Object.keys(e).reduce(function(r,s){var a=e[s]||[],c=a.filter(function(e){return!t(e,s,i)});return c.length>0?(c.length!==a.length&&(n=!0),r[s]=c):n=!0,r},{});return n?a:e}},isRefined:function(e,t,i){var n=!!e[t]&&e[t].length>0;if(void 0===i||!n)return n;var r=""+i;return-1!==e[t].indexOf(r)}};t.exports=a},{"../functions/defaultsPure":10,"../functions/objectHasKeys":17,"../functions/omit":18}],5:[function(e,t,i){"use strict";function n(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(e,i){return n(t[i],e)}):e===t}function r(e,t){return o(e,function(e){return n(e,t)})}function s(e){var t=e?s._parseNumbers(e):{};this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var i=this;Object.keys(t).forEach(function(e){var n=-1!==s.PARAMETERS.indexOf(e),r=void 0!==t[e];!n&&r&&(i[e]=t[e])})}var a=e("../functions/merge"),c=e("../functions/defaultsPure"),u=e("../functions/intersection"),o=e("../functions/find"),f=e("../functions/valToNumber"),h=e("../functions/omit"),l=e("../functions/objectHasKeys"),m=e("./RefinementList");s.PARAMETERS=Object.keys(new s),s._parseNumbers=function(e){if(e instanceof s)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(i){var n=e[i];if("string"==typeof n){var r=parseFloat(n);t[i]=isNaN(r)?n:r}}),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map(function(e){return e.map(function(e){return parseFloat(e)})})),e.numericRefinements){var i={};Object.keys(e.numericRefinements).forEach(function(t){var n=e.numericRefinements[t]||{};i[t]={},Object.keys(n).forEach(function(e){var r=n[e],s=r.map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});i[t][e]=s})}),t.numericRefinements=i}return a({},e,t)},s.make=function(e){var t=new s(e);return(e.hierarchicalFacets||[]).forEach(function(e){if(e.rootPath){var i=t.getHierarchicalRefinement(e.name);i.length>0&&0!==i[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),i=t.getHierarchicalRefinement(e.name),0===i.length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),t},s.validate=function(e,t){var i=t||{};return e.tagFilters&&i.tagRefinements&&i.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&i.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&&i.numericRefinements&&l(i.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."):l(e.numericRefinements)&&i.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},s.prototype={constructor:s,clearRefinements:function(e){var t=m.clearRefinement,i={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:t(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:t(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:t(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:t(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return i.numericRefinements===this.numericRefinements&&i.facetsRefinements===this.facetsRefinements&&i.facetsExcludes===this.facetsExcludes&&i.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&i.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(i)},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,i){var n=f(i);if(this.isNumericRefined(e,t,n))return this;var r=a({},this.numericRefinements);return r[e]=a({},r[e]),r[e][t]?(r[e][t]=r[e][t].slice(),r[e][t].push(n)):r[e][t]=[n],this.setQueryParameters({numericRefinements:r})},getConjunctiveRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,i){return void 0!==i?this.isNumericRefined(e,t,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(r,s){return s===e&&r.op===t&&n(r.val,f(i))})}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,n){return n===e&&i.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(t,i){return i===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return l(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return l(this.numericRefinements[e])?h(this.numericRefinements,e):this.numericRefinements;if("function"==typeof e){var t=!1,i=this.numericRefinements,n=Object.keys(i).reduce(function(n,r){var s=i[r],a={};return s=s||{},Object.keys(s).forEach(function(i){var n=s[i]||[],c=[];n.forEach(function(t){e({val:t,op:i},r,"numeric")||c.push(t)}),c.length>0?(c.length!==n.length&&(t=!0),a[i]=c):t=!0}),l(a)&&(n[r]=a),n},{});return t?n: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 m.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:m.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 m.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:m.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 m.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:m.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(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter(function(t){return t!==e})}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(t){return t!==e})}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(t){return t.name!==e})}):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 m.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:m.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 m.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:m.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 m.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:m.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter(function(t){return t!==e})};return this.setQueryParameters(t)},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:m.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:m.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:m.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 i=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+i))?-1===t.indexOf(i)?n[e]=[]:n[e]=[t.slice(0,t.lastIndexOf(i))]:n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:c({},n,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");var i={};return i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:c({},i,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))throw new Error(e+" is not refined.");var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:c({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return m.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return m.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return m.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var i=this.getHierarchicalRefinement(e);return t?-1!==i.indexOf(t):i.length>0},isNumericRefined:function(e,t,i){if(void 0===i&&void 0===t)return!!this.numericRefinements[e];var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===i||!n)return n;var s=f(i),a=void 0!==r(this.numericRefinements[e][t],s);return n&&a},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=u(Object.keys(this.numericRefinements),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).concat(e).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){return u(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(t){return-1===e.indexOf(t)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},i=this;return Object.keys(this).forEach(function(n){var r=i[n];-1===e.indexOf(n)&&void 0!==r&&(t[n]=r)}),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var i={};return i[e]=t,this.setQueryParameters(i)},setQueryParameters:function(e){if(!e)return this;var t=s.validate(this,e);if(t)throw t;var i=this,n=s._parseNumbers(e),r=Object.keys(this).reduce(function(e,t){return e[t]=i[t],e},{}),a=Object.keys(n).reduce(function(e,t){var i=void 0!==e[t],r=void 0!==n[t];return i&&!r?h(e,[t]):(r&&(e[t]=n[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(e){return o(this.hierarchicalFacets,function(t){return t.name===e})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))throw new Error("Cannot get the breadcrumb of an unknown hierarchical facet: `"+e+"`");var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var i=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(i).map(function(e){return e.trim()})},toString:function(){return JSON.stringify(this,null,2)}},t.exports=s},{"../functions/defaultsPure":10,"../functions/find":11,"../functions/intersection":15,"../functions/merge":16,"../functions/objectHasKeys":17,"../functions/omit":18,"../functions/valToNumber":20,"./RefinementList":4}],6:[function(e,t,i){"use strict";function n(e){return function(t,i){var n=e.hierarchicalFacets[i],s=e.hierarchicalFacetsRefinements[n.name]&&e.hierarchicalFacetsRefinements[n.name][0]||"",a=e._getHierarchicalFacetSeparator(n),c=e._getHierarchicalRootPath(n),u=e._getHierarchicalShowParentLevel(n),f=o(e._getHierarchicalFacetSortBy(n)),h=t.every(function(e){return e.exhaustive}),l=r(f,a,c,u,s),m=t;return c&&(m=t.slice(c.split(a).length)),m.reduce(l,{name:e.hierarchicalFacets[i].name,count:null,isRefined:!0,path:null,exhaustive:h,data:null})}}function r(e,t,i,n,r){return function(o,f,h){var l=o;if(h>0){var m=0;for(l=o;m<h;){var d=l&&Array.isArray(l.data)?l.data:[];l=u(d,function(e){return e.isRefined}),m++}}if(l){var v=Object.keys(f.data).map(function(e){return[e,f.data[e]]}).filter(function(e){return s(e[0],l.path||i,r,t,i,n)});l.data=c(v.map(function(e){var i=e[0];return a(e[1],i,t,r,f.exhaustive)}),e[0],e[1])}return o}}function s(e,t,i,n,r,s){return(!r||0===e.indexOf(r)&&r!==e)&&(!r&&-1===e.indexOf(n)||r&&e.split(n).length-r.split(n).length==1||-1===e.indexOf(n)&&-1===i.indexOf(n)||0===i.indexOf(e)||0===e.indexOf(t+n)&&(s||0===e.indexOf(i)))}function a(e,t,i,n,r){var s=t.split(i);return{name:s[s.length-1].trim(),path:t,count:e,isRefined:n===t||0===n.indexOf(t+i),exhaustive:r,data:null}}t.exports=n;var c=e("../functions/orderBy"),u=e("../functions/find"),o=e("../functions/formatSort")},{"../functions/find":11,"../functions/formatSort":13,"../functions/orderBy":19}],7:[function(e,t,i){"use strict";function n(e){var t={};return e.forEach(function(e,i){t[e]=i}),t}function r(e,t,i){t&&t[i]&&(e.stats=t[i])}function s(e,t){return g(e,function(e){return(e.attributes||[]).indexOf(t)>-1})}function a(e,t){var i=t[0];this._rawResults=t,this.query=i.query,this.parsedQuery=i.parsedQuery,this.hits=i.hits,this.index=i.index,this.hitsPerPage=i.hitsPerPage,this.nbHits=i.nbHits,this.nbPages=i.nbPages,this.page=i.page,this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.aroundLatLng=i.aroundLatLng,this.automaticRadius=i.automaticRadius,this.serverUsed=i.serverUsed,this.timeoutCounts=i.timeoutCounts,this.timeoutHits=i.timeoutHits,this.exhaustiveFacetsCount=i.exhaustiveFacetsCount,this.exhaustiveNbHits=i.exhaustiveNbHits,this.userData=i.userData,this.queryID=i.queryID,this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map(function(){return[]}),this.facets=[];var a=e.getRefinedDisjunctiveFacets(),c=n(e.facets),u=n(e.disjunctiveFacets),o=1,f=this,h=i.facets||{};Object.keys(h).forEach(function(t){var n=h[t],a=s(e.hierarchicalFacets,t);if(a){var o=a.attributes.indexOf(t),l=R(e.hierarchicalFacets,function(e){return e.name===a.name});f.hierarchicalFacets[l][o]={attribute:t,data:n,exhaustive:i.exhaustiveFacetsCount}}else{var m,d=-1!==e.disjunctiveFacets.indexOf(t),v=-1!==e.facets.indexOf(t);d&&(m=u[t],f.disjunctiveFacets[m]={name:t,data:n,exhaustive:i.exhaustiveFacetsCount},r(f.disjunctiveFacets[m],i.facets_stats,t)),v&&(m=c[t],f.facets[m]={name:t,data:n,exhaustive:i.exhaustiveFacetsCount},r(f.facets[m],i.facets_stats,t))}}),this.hierarchicalFacets=p(this.hierarchicalFacets),a.forEach(function(n){var s=t[o],a=s&&s.facets?s.facets:{},c=e.getHierarchicalFacetByName(n);Object.keys(a).forEach(function(t){var n,o=a[t];if(c){n=R(e.hierarchicalFacets,function(e){return e.name===c.name});var h=R(f.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1===h)return;f.hierarchicalFacets[n][h].data=m({},f.hierarchicalFacets[n][h].data,o)}else{n=u[t];var l=i.facets&&i.facets[t]||{};f.disjunctiveFacets[n]={name:t,data:d({},o,l),exhaustive:s.exhaustiveFacetsCount},r(f.disjunctiveFacets[n],s.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach(function(i){!f.disjunctiveFacets[n].data[i]&&e.disjunctiveFacetsRefinements[t].indexOf(i)>-1&&(f.disjunctiveFacets[n].data[i]=0)})}}),o++}),e.getRefinedHierarchicalFacets().forEach(function(i){var n=e.getHierarchicalFacetByName(i),r=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(i);if(!(0===s.length||s[0].split(r).length<2)){var a=t[o],c=a&&a.facets?a.facets:{};Object.keys(c).forEach(function(t){var i=c[t],a=R(e.hierarchicalFacets,function(e){return e.name===n.name}),u=R(f.hierarchicalFacets[a],function(e){return e.attribute===t});if(-1!==u){var o={};if(s.length>0){var h=s[0].split(r)[0];o[h]=f.hierarchicalFacets[a][u].data[h]}f.hierarchicalFacets[a][u].data=d(o,i,f.hierarchicalFacets[a][u].data)}}),o++}}),Object.keys(e.facetsExcludes).forEach(function(t){var n=e.facetsExcludes[t],r=c[t];f.facets[r]={name:t,data:i.facets[t],exhaustive:i.exhaustiveFacetsCount},n.forEach(function(e){f.facets[r]=f.facets[r]||{name:t},f.facets[r].data=f.facets[r].data||{},f.facets[r].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(F(e)),this.facets=p(this.facets),this.disjunctiveFacets=p(this.disjunctiveFacets),this._state=e}function c(e,t){function i(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=g(e.facets,i);return n?Object.keys(n.data).map(function(i){return{name:i,count:n.data[i],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,i)}}):[]}if(e._state.isDisjunctiveFacet(t)){var r=g(e.disjunctiveFacets,i);return r?Object.keys(r.data).map(function(i){return{name:i,count:r.data[i],isRefined:e._state.isDisjunctiveFacetRefined(t,i)}}):[]}if(e._state.isHierarchicalFacet(t))return g(e.hierarchicalFacets,i)}function u(e,t){if(!t.data||0===t.data.length)return t;var i=t.data.map(function(t){return u(e,t)}),n=e(i);return m({},t,{data:n})}function o(e,t){return t.sort(e)}function f(e,t){var i=g(e,function(e){return e.name===t});return i&&i.stats}function h(e,t,i,n,r){var s=g(r,function(e){return e.name===i}),a=s&&s.data&&s.data[n]?s.data[n]:0,c=s&&s.exhaustive||!1;return{type:t,attributeName:i,name:n,count:a,exhaustive:c}}function l(e,t,i,n){var r=e.getHierarchicalFacetByName(t),s=e._getHierarchicalFacetSeparator(r),a=i.split(s),c=g(n,function(e){return e.name===t}),u=a.reduce(function(e,t){var i=e&&g(e.data,function(e){return e.name===t});return void 0!==i?i:e},c),o=u&&u.count||0,f=u&&u.exhaustive||!1,h=u&&u.path||"";return{type:"hierarchical",attributeName:t,name:h,count:o,exhaustive:f}}var m=e("../functions/merge"),d=e("../functions/defaultsPure"),v=e("../functions/orderBy"),p=e("../functions/compact"),g=e("../functions/find"),R=e("../functions/findIndex"),y=e("../functions/formatSort"),F=e("./generate-hierarchical-tree");a.prototype.getFacetByName=function(e){function t(t){return t.name===e}return g(this.facets,t)||g(this.disjunctiveFacets,t)||g(this.hierarchicalFacets,t)},a.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],a.prototype.getFacetValues=function(e,t){var i=c(this,e);if(!i)throw new Error(e+" is not a retrieved facet.");var n=d({},t,{sortBy:a.DEFAULT_SORT});if(Array.isArray(n.sortBy)){var r=y(n.sortBy,a.DEFAULT_SORT);return Array.isArray(i)?v(i,r[0],r[1]):u(function(e){return v(e,r[0],r[1])},i)}if("function"==typeof n.sortBy)return Array.isArray(i)?i.sort(n.sortBy):u(function(e){return o(n.sortBy,e)},i);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},a.prototype.getFacetStats=function(e){if(this._state.isConjunctiveFacet(e))return f(this.facets,e);if(this._state.isDisjunctiveFacet(e))return f(this.disjunctiveFacets,e);throw new Error(e+" is not present in `facets` or `disjunctiveFacets`")},a.prototype.getRefinements=function(){var e=this._state,t=this,i=[];return Object.keys(e.facetsRefinements).forEach(function(n){e.facetsRefinements[n].forEach(function(r){i.push(h(e,"facet",n,r,t.facets))})}),Object.keys(e.facetsExcludes).forEach(function(n){e.facetsExcludes[n].forEach(function(r){i.push(h(e,"exclude",n,r,t.facets))})}),Object.keys(e.disjunctiveFacetsRefinements).forEach(function(n){e.disjunctiveFacetsRefinements[n].forEach(function(r){i.push(h(e,"disjunctive",n,r,t.disjunctiveFacets))})}),Object.keys(e.hierarchicalFacetsRefinements).forEach(function(n){e.hierarchicalFacetsRefinements[n].forEach(function(r){i.push(l(e,n,r,t.hierarchicalFacets))})}),Object.keys(e.numericRefinements).forEach(function(t){var n=e.numericRefinements[t];Object.keys(n).forEach(function(e){n[e].forEach(function(n){i.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})})})}),e.tagRefinements.forEach(function(e){i.push({type:"tag",attributeName:"_tags",name:e})}),i},t.exports=a},{"../functions/compact":9,"../functions/defaultsPure":10,"../functions/find":11,"../functions/findIndex":12,"../functions/formatSort":13,"../functions/merge":16,"../functions/orderBy":19,"./generate-hierarchical-tree":6}],8:[function(e,t,i){"use strict";function n(e,t,i){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.setClient(e);var n=i||{};n.index=t,this.state=a.make(n),this.lastResults=null,this._queryId=0,
this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function r(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function s(){return this.state.page}var a=e("./SearchParameters"),c=e("./SearchResults"),u=e("./DerivedHelper"),o=e("./requestBuilder"),f=e("events"),h=e("./functions/inherits"),l=e("./functions/objectHasKeys"),m=e("./version");h(n,f.EventEmitter),n.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},n.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},n.prototype.getQuery=function(){var e=this.state;return o._getHitsSearchParams(e)},n.prototype.searchOnce=function(e,t){var i=e?this.state.setQueryParameters(e):this.state,n=o._getQueries(i.index,i),r=this;return this._currentNbQueries++,this.emit("searchOnce",{state:i}),t?void this.client.search(n).then(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(null,new c(i,e.results),i)}).catch(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(e,null,i)}):this.client.search(n).then(function(e){return r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),{content:new c(i,e.results),state:i,_originalResponse:e}},function(e){throw r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),e})},n.prototype.searchForFacetValues=function(e,t,i,n){var r="function"==typeof this.client.searchForFacetValues;if(!r&&"function"!=typeof this.client.initIndex)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(n||{}),a=s.isDisjunctiveFacet(e),c=o.getSearchForFacetQuery(e,t,i,s);this._currentNbQueries++;var u=this;return this.emit("searchForFacetValues",{state:s,facet:e,query:t}),(r?this.client.searchForFacetValues([{indexName:s.index,params:c}]):this.client.initIndex(s.index).searchForFacetValues(c)).then(function(t){return u._currentNbQueries--,0===u._currentNbQueries&&u.emit("searchQueueEmpty"),t=Array.isArray(t)?t[0]:t,t.facetHits.forEach(function(t){t.isRefined=a?s.isDisjunctiveFacetRefined(e,t.value):s.isFacetRefined(e,t.value)}),t},function(e){throw u._currentNbQueries--,0===u._currentNbQueries&&u.emit("searchQueueEmpty"),e})},n.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},n.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},n.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},n.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},n.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.addNumericRefinement=function(e,t,i){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,i),isPageReset:!0}),this},n.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},n.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},n.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},n.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},n.prototype.removeNumericRefinement=function(e,t,i){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,i),isPageReset:!0}),this},n.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},n.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},n.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},n.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},n.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},n.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},n.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},n.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},n.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},n.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},n.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},n.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},n.prototype.setCurrentPage=r,n.prototype.setPage=r,n.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},n.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},n.prototype.setState=function(e){return this._change({state:a.make(e),isPageReset:!1}),this},n.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new a(e),this},n.prototype.isRefined=function(e,t){if(this.state.isConjunctiveFacet(e))return this.state.isFacetRefined(e,t);if(this.state.isDisjunctiveFacet(e))return this.state.isDisjunctiveFacetRefined(e,t);throw new Error(e+" is not properly defined in this helper configuration(use the facets or disjunctiveFacets keys to configure it)")},n.prototype.hasRefinements=function(e){return!!l(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))},n.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},n.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},n.prototype.hasTag=function(e){return this.state.isTagRefined(e)},n.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},n.prototype.getIndex=function(){return this.state.index},n.prototype.getCurrentPage=s,n.prototype.getPage=s,n.prototype.getTags=function(){return this.state.tagRefinements},n.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e)){this.state.getConjunctiveRefinements(e).forEach(function(e){t.push({value:e,type:"conjunctive"})});this.state.getExcludeRefinements(e).forEach(function(e){t.push({value:e,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var i=this.state.getDisjunctiveRefinements(e);i.forEach(function(e){t.push({value:e,type:"disjunctive"})})}var n=this.state.getNumericRefinements(e);return Object.keys(n).forEach(function(e){var i=n[e];t.push({value:i,operator:e,type:"numeric"})}),t},n.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},n.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},n.prototype._search=function(e){var t=this.state,i=[],n=[];e.onlyWithDerivedHelpers||(n=o._getQueries(t.index,t),i.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var r=this.derivedHelpers.map(function(e){var n=e.getModifiedState(t),r=o._getQueries(n.index,n);return i.push({state:n,queriesCount:r.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),r}),s=Array.prototype.concat.apply(n,r),a=this._queryId++;this._currentNbQueries++;try{this.client.search(s).then(this._dispatchAlgoliaResponse.bind(this,i,a)).catch(this._dispatchAlgoliaError.bind(this,a))}catch(e){this.emit("error",{error:e})}},n.prototype._dispatchAlgoliaResponse=function(e,t,i){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var n=i.results.slice();e.forEach(function(e){var t=e.state,i=e.queriesCount,r=e.helper,s=n.splice(0,i),a=r.lastResults=new c(t,s);r.emit("result",{results:a,state:t})})}},n.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"))},n.prototype.containsRefinement=function(e,t,i,n){return e||0!==t.length||0!==i.length||0!==n.length},n.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},n.prototype._change=function(e){var t=e.state,i=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:i}))},n.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},n.prototype.setClient=function(e){return this.client===e?this:("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.client=e,this)},n.prototype.getClient=function(){return this.client},n.prototype.derive=function(e){var t=new u(this,e);return this.derivedHelpers.push(t),t},n.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)},n.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},t.exports=n},{"./DerivedHelper":3,"./SearchParameters":5,"./SearchResults":7,"./functions/inherits":14,"./functions/objectHasKeys":17,"./requestBuilder":21,"./version":22,events:2}],9:[function(e,t,i){"use strict";t.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},{}],10:[function(e,t,i){"use strict";t.exports=function(){return Array.prototype.slice.call(arguments).reduceRight(function(e,t){return Object.keys(Object(t)).forEach(function(i){void 0!==t[i]&&(e[i]=t[i])}),e},{})}},{}],11:[function(e,t,i){"use strict";t.exports=function(e,t){if(Array.isArray(e))for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}},{}],12:[function(e,t,i){"use strict";t.exports=function(e,t){if(!Array.isArray(e))return-1;for(var i=0;i<e.length;i++)if(t(e[i]))return i;return-1}},{}],13:[function(e,t,i){"use strict";var n=e("./find");t.exports=function(e,t){var i=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var r=t.split(":"),s=n(i,function(e){return e[0]===r[0]});return r.length>1||!s?(e[0].push(r[0]),e[1].push(r[1]),e):(e[0].push(s[0]),e[1].push(s[1]),e)},[[],[]])}},{"./find":11}],14:[function(e,t,i){"use strict";function n(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}t.exports=n},{}],15:[function(e,t,i){"use strict";function n(e,t){return e.filter(function(i,n){return t.indexOf(i)>-1&&e.indexOf(i)===n})}t.exports=n},{}],16:[function(e,t,i){"use strict";function n(e){return"object"==typeof e&&null!==e?s(Array.isArray(e)?[]:{},e):e}function r(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){if(e===t)return e;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i],c=e[i];void 0!==c&&void 0===a||(r(c)&&r(a)?e[i]=s(c,a):e[i]=n(a))}return e}function a(e){r(e)||(e={});for(var t=1,i=arguments.length;t<i;t++){var n=arguments[t];r(n)&&s(e,n)}return e}t.exports=a},{}],17:[function(e,t,i){"use strict";function n(e){return e&&Object.keys(e).length>0}t.exports=n},{}],18:[function(e,t,i){"use strict";function n(e,t){if(null===e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}t.exports=n},{}],19:[function(e,t,i){"use strict";function n(e,t){if(e!==t){var i=void 0!==e,n=null===e,r=void 0!==t,s=null===t;if(!s&&e>t||n&&r||!i)return 1;if(!n&&e<t||s&&i||!r)return-1}return 0}function r(e,t,i){if(!Array.isArray(e))return[];Array.isArray(i)||(i=[]);var r=e.map(function(e,i){return{criteria:t.map(function(t){return e[t]}),index:i,value:e}});return r.sort(function(e,t){for(var r=-1;++r<e.criteria.length;){var s=n(e.criteria[r],t.criteria[r]);if(s)return r>=i.length?s:"desc"===i[r]?-s:s}return e.index-t.index}),r.map(function(e){return e.value})}t.exports=r},{}],20:[function(e,t,i){"use strict";function n(e){if("number"==typeof e)return e;if("string"==typeof e)return parseFloat(e);if(Array.isArray(e))return e.map(n);throw new Error("The value should be a number, a parsable string or an array of those.")}t.exports=n},{}],21:[function(e,t,i){"use strict";var n=e("./functions/merge"),r={_getQueries:function(e,t){var i=[];return i.push({indexName:e,params:r._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach(function(n){i.push({indexName:e,params:r._getDisjunctiveFacetSearchParams(t,n)})}),t.getRefinedHierarchicalFacets().forEach(function(n){var s=t.getHierarchicalFacetByName(n),a=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(s);a.length>0&&a[0].split(c).length>1&&i.push({indexName:e,params:r._getDisjunctiveFacetSearchParams(t,n,!0)})}),i},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(r._getHitsHierarchicalFacetsAttributes(e)),i=r._getFacetFilters(e),s=r._getNumericFilters(e),a=r._getTagFilters(e),c={facets:t,tagFilters:a};return i.length>0&&(c.facetFilters=i),s.length>0&&(c.numericFilters=s),n({},e.getQueryParams(),c)},_getDisjunctiveFacetSearchParams:function(e,t,i){var s=r._getFacetFilters(e,t,i),a=r._getNumericFilters(e,t),c=r._getTagFilters(e),u={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:c,analytics:!1,clickAnalytics:!1},o=e.getHierarchicalFacetByName(t);return u.facets=o?r._getDisjunctiveHierarchicalFacetAttribute(e,o,i):t,a.length>0&&(u.numericFilters=a),s.length>0&&(u.facetFilters=s),n({},e.getQueryParams(),u)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var i=[];return Object.keys(e.numericRefinements).forEach(function(n){var r=e.numericRefinements[n]||{};Object.keys(r).forEach(function(e){var s=r[e]||[];t!==n&&s.forEach(function(t){if(Array.isArray(t)){var r=t.map(function(t){return n+e+t});i.push(r)}else i.push(n+e+t)})})}),i},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,i){var n=[],r=e.facetsRefinements||{};Object.keys(r).forEach(function(e){(r[e]||[]).forEach(function(t){n.push(e+":"+t)})});var s=e.facetsExcludes||{};Object.keys(s).forEach(function(e){(s[e]||[]).forEach(function(t){n.push(e+":-"+t)})});var a=e.disjunctiveFacetsRefinements||{};Object.keys(a).forEach(function(e){var i=a[e]||[];if(e!==t&&i&&0!==i.length){var r=[];i.forEach(function(t){r.push(e+":"+t)}),n.push(r)}});var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).forEach(function(r){var s=c[r]||[],a=s[0];if(void 0!==a){var u,o,f=e.getHierarchicalFacetByName(r),h=e._getHierarchicalFacetSeparator(f),l=e._getHierarchicalRootPath(f);if(t===r){if(-1===a.indexOf(h)||!l&&!0===i||l&&l.split(h).length===a.split(h).length)return;l?(o=l.split(h).length-1,a=l):(o=a.split(h).length-2,a=a.slice(0,a.lastIndexOf(h))),u=f.attributes[o]}else o=a.split(h).length-1,u=f.attributes[o];u&&n.push([u+":"+a])}}),n},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return e.hierarchicalFacets.reduce(function(t,i){var n=e.getHierarchicalRefinement(i.name)[0];if(!n)return t.push(i.attributes[0]),t;var r=e._getHierarchicalFacetSeparator(i),s=n.split(r).length,a=i.attributes.slice(0,s+1);return t.concat(a)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,i){var n=e._getHierarchicalFacetSeparator(t);if(!0===i){var r=e._getHierarchicalRootPath(t),s=0;return r&&(s=r.split(n).length),[t.attributes[s]]}var a=e.getHierarchicalRefinement(t.name)[0]||"",c=a.split(n).length-1;return t.attributes.slice(0,c+1)},getSearchForFacetQuery:function(e,t,i,s){var a=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,c={facetQuery:t,facetName:e};return"number"==typeof i&&(c.maxFacetHits=i),n({},r._getHitsSearchParams(a),c)}};t.exports=r},{"./functions/merge":16}],22:[function(e,t,i){"use strict";t.exports="0.0.0-27095c0"},{}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.algoliasearchHelper=e()}}(function(){return function e(t,i,n){function r(a,c){if(!i[a]){if(!t[a]){var u="function"==typeof require&&require;if(!c&&u)return u(a,!0);if(s)return s(a,!0);var o=new Error("Cannot find module '"+a+"'");throw o.code="MODULE_NOT_FOUND",o}var f=i[a]={exports:{}};t[a][0].call(f.exports,function(e){var i=t[a][1][e];return r(i||e)},f,f.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(e,t,i){"use strict";function n(e,t,i){return new r(e,t,i)}var r=e("./src/algoliasearch.helper"),s=e("./src/SearchParameters"),a=e("./src/SearchResults");n.version=e("./src/version.js"),n.AlgoliaSearchHelper=r,n.SearchParameters=s,n.SearchResults=a,t.exports=n},{"./src/SearchParameters":5,"./src/SearchResults":7,"./src/algoliasearch.helper":8,"./src/version.js":22}],2:[function(e,t,i){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function s(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function c(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!s(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,i,n,s,u,o;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(i=this._events[e],c(i))return!1;if(r(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),i.apply(this,s)}else if(a(i))for(s=Array.prototype.slice.call(arguments,1),o=i.slice(),n=o.length,u=0;u<n;u++)o[u].apply(this,s);return!0},n.prototype.addListener=function(e,t){var i;if(!r(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,r(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(i=c(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var n=!1;return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var i,n,s,c;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=this._events[e],s=i.length,n=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(i)){for(c=s;c-- >0;)if(i[c]===t||i[c].listener&&i[c].listener===t){n=c;break}if(n<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,i;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(i=this._events[e],r(i))this.removeListener(e,i);else if(i)for(;i.length;)this.removeListener(e,i[i.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],3:[function(e,t,i){"use strict";function n(e,t){this.main=e,this.fn=t,this.lastResults=null}var r=e("events");e("../functions/inherits")(n,r.EventEmitter),n.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)},n.prototype.getModifiedState=function(e){return this.fn(e)},t.exports=n},{"../functions/inherits":14,events:2}],4:[function(e,t,i){"use strict";var n=e("../functions/defaultsPure"),r=e("../functions/omit"),s=e("../functions/objectHasKeys"),a={addRefinement:function(e,t,i){if(a.isRefined(e,t,i))return e;var r=""+i,s=e[t]?e[t].concat(r):[r],c={};return c[t]=s,n({},c,e)},removeRefinement:function(e,t,i){if(void 0===i)return a.clearRefinement(e,function(e,i){return t===i});var n=""+i;return a.clearRefinement(e,function(e,i){return t===i&&n===e})},toggleRefinement:function(e,t,i){if(void 0===i)throw new Error("toggleRefinement should be used with a value");return a.isRefined(e,t,i)?a.removeRefinement(e,t,i):a.addRefinement(e,t,i)},clearRefinement:function(e,t,i){if(void 0===t)return s(e)?{}:e;if("string"==typeof t)return e[t]&&e[t].length>0?r(e,t):e;if("function"==typeof t){var n=!1,a=Object.keys(e).reduce(function(r,s){var a=e[s]||[],c=a.filter(function(e){return!t(e,s,i)});return c.length!==a.length&&(n=!0),r[s]=c,r},{});return n?a:e}},isRefined:function(e,t,i){var n=!!e[t]&&e[t].length>0;if(void 0===i||!n)return n;var r=""+i;return-1!==e[t].indexOf(r)}};t.exports=a},{"../functions/defaultsPure":10,"../functions/objectHasKeys":17,"../functions/omit":18}],5:[function(e,t,i){"use strict";function n(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(e,i){return n(t[i],e)}):e===t}function r(e,t){return o(e,function(e){return n(e,t)})}function s(e){var t=e?s._parseNumbers(e):{};this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var i=this;Object.keys(t).forEach(function(e){var n=-1!==s.PARAMETERS.indexOf(e),r=void 0!==t[e];!n&&r&&(i[e]=t[e])})}var a=e("../functions/merge"),c=e("../functions/defaultsPure"),u=e("../functions/intersection"),o=e("../functions/find"),f=e("../functions/valToNumber"),h=e("../functions/omit"),l=e("../functions/objectHasKeys"),m=e("./RefinementList");s.PARAMETERS=Object.keys(new s),s._parseNumbers=function(e){if(e instanceof s)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach(function(i){var n=e[i];if("string"==typeof n){var r=parseFloat(n);t[i]=isNaN(r)?n:r}}),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map(function(e){return e.map(function(e){return parseFloat(e)})})),e.numericRefinements){var i={};Object.keys(e.numericRefinements).forEach(function(t){var n=e.numericRefinements[t]||{};i[t]={},Object.keys(n).forEach(function(e){var r=n[e],s=r.map(function(e){return Array.isArray(e)?e.map(function(e){return"string"==typeof e?parseFloat(e):e}):"string"==typeof e?parseFloat(e):e});i[t][e]=s})}),t.numericRefinements=i}return a({},e,t)},s.make=function(e){var t=new s(e);return(e.hierarchicalFacets||[]).forEach(function(e){if(e.rootPath){var i=t.getHierarchicalRefinement(e.name);i.length>0&&0!==i[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),i=t.getHierarchicalRefinement(e.name),0===i.length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}}),t},s.validate=function(e,t){var i=t||{};return e.tagFilters&&i.tagRefinements&&i.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&i.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&&i.numericRefinements&&l(i.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."):l(e.numericRefinements)&&i.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},s.prototype={constructor:s,clearRefinements:function(e){var t=m.clearRefinement,i={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:t(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:t(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:t(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:t(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return i.numericRefinements===this.numericRefinements&&i.facetsRefinements===this.facetsRefinements&&i.facetsExcludes===this.facetsExcludes&&i.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&i.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(i)},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,i){var n=f(i);if(this.isNumericRefined(e,t,n))return this;var r=a({},this.numericRefinements);return r[e]=a({},r[e]),r[e][t]?(r[e][t]=r[e][t].slice(),r[e][t].push(n)):r[e][t]=[n],this.setQueryParameters({numericRefinements:r})},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(e,t,i){return void 0!==i?this.isNumericRefined(e,t,i)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(r,s){return s===e&&r.op===t&&n(r.val,f(i))})}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,n){return n===e&&i.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(t,i){return i===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return l(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return l(this.numericRefinements[e])?h(this.numericRefinements,e):this.numericRefinements;if("function"==typeof e){var t=!1,i=this.numericRefinements,n=Object.keys(i).reduce(function(n,r){var s=i[r],a={};return s=s||{},Object.keys(s).forEach(function(i){var n=s[i]||[],c=[];n.forEach(function(t){e({val:t,op:i},r,"numeric")||c.push(t)}),c.length!==n.length&&(t=!0),a[i]=c}),n[r]=a,n},{});return t?n: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 m.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:m.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 m.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:m.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 m.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:m.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(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter(function(t){return t!==e})}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(t){return t!==e})}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(t){return t.name!==e})}):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 m.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:m.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 m.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:m.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 m.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:m.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter(function(t){return t!==e})};return this.setQueryParameters(t)},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:m.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:m.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:m.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 i=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+i))?-1===t.indexOf(i)?n[e]=[]:n[e]=[t.slice(0,t.lastIndexOf(i))]:n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:c({},n,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 i={};return i[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:c({},i,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))throw new Error(e+" is not refined.");var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:c({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&m.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&m.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&m.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var i=this.getHierarchicalRefinement(e);return t?-1!==i.indexOf(t):i.length>0},isNumericRefined:function(e,t,i){if(void 0===i&&void 0===t)return!!this.numericRefinements[e];var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===i||!n)return n;var s=f(i),a=void 0!==r(this.numericRefinements[e][t],s);return n&&a},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=u(Object.keys(this.numericRefinements).filter(function(t){return Object.keys(e.numericRefinements[t]).length>0}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(t){return e.disjunctiveFacetsRefinements[t].length>0}).concat(t).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var e=this;return u(this.hierarchicalFacets.map(function(e){return e.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(t){return e.hierarchicalFacetsRefinements[t].length>0}))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(t){return-1===e.indexOf(t)})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},i=this;return Object.keys(this).forEach(function(n){var r=i[n];-1===e.indexOf(n)&&void 0!==r&&(t[n]=r)}),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var i={};return i[e]=t,this.setQueryParameters(i)},setQueryParameters:function(e){if(!e)return this;var t=s.validate(this,e);if(t)throw t;var i=this,n=s._parseNumbers(e),r=Object.keys(this).reduce(function(e,t){return e[t]=i[t],e},{}),a=Object.keys(n).reduce(function(e,t){var i=void 0!==e[t],r=void 0!==n[t];return i&&!r?h(e,[t]):(r&&(e[t]=n[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(e){return o(this.hierarchicalFacets,function(t){return t.name===e})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var i=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(i).map(function(e){return e.trim()})},toString:function(){return JSON.stringify(this,null,2)}},t.exports=s},{"../functions/defaultsPure":10,"../functions/find":11,"../functions/intersection":15,"../functions/merge":16,"../functions/objectHasKeys":17,"../functions/omit":18,"../functions/valToNumber":20,"./RefinementList":4}],6:[function(e,t,i){"use strict";function n(e){return function(t,i){var n=e.hierarchicalFacets[i],s=e.hierarchicalFacetsRefinements[n.name]&&e.hierarchicalFacetsRefinements[n.name][0]||"",a=e._getHierarchicalFacetSeparator(n),c=e._getHierarchicalRootPath(n),u=e._getHierarchicalShowParentLevel(n),f=o(e._getHierarchicalFacetSortBy(n)),h=t.every(function(e){return e.exhaustive}),l=r(f,a,c,u,s),m=t;return c&&(m=t.slice(c.split(a).length)),m.reduce(l,{name:e.hierarchicalFacets[i].name,count:null,isRefined:!0,path:null,exhaustive:h,data:null})}}function r(e,t,i,n,r){return function(o,f,h){var l=o;if(h>0){var m=0;for(l=o;m<h;){var d=l&&Array.isArray(l.data)?l.data:[];l=u(d,function(e){return e.isRefined}),m++}}if(l){var v=Object.keys(f.data).map(function(e){return[e,f.data[e]]}).filter(function(e){return s(e[0],l.path||i,r,t,i,n)});l.data=c(v.map(function(e){var i=e[0];return a(e[1],i,t,r,f.exhaustive)}),e[0],e[1])}return o}}function s(e,t,i,n,r,s){return(!r||0===e.indexOf(r)&&r!==e)&&(!r&&-1===e.indexOf(n)||r&&e.split(n).length-r.split(n).length==1||-1===e.indexOf(n)&&-1===i.indexOf(n)||0===i.indexOf(e)||0===e.indexOf(t+n)&&(s||0===e.indexOf(i)))}function a(e,t,i,n,r){var s=t.split(i);return{name:s[s.length-1].trim(),path:t,count:e,isRefined:n===t||0===n.indexOf(t+i),exhaustive:r,data:null}}t.exports=n;var c=e("../functions/orderBy"),u=e("../functions/find"),o=e("../functions/formatSort")},{"../functions/find":11,"../functions/formatSort":13,"../functions/orderBy":19}],7:[function(e,t,i){"use strict";function n(e){var t={};return e.forEach(function(e,i){t[e]=i}),t}function r(e,t,i){t&&t[i]&&(e.stats=t[i])}function s(e,t){return g(e,function(e){return(e.attributes||[]).indexOf(t)>-1})}function a(e,t){var i=t[0];this._rawResults=t,this.query=i.query,this.parsedQuery=i.parsedQuery,this.hits=i.hits,this.index=i.index,this.hitsPerPage=i.hitsPerPage,this.nbHits=i.nbHits,this.nbPages=i.nbPages,this.page=i.page,this.processingTimeMS=t.reduce(function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS},0),this.aroundLatLng=i.aroundLatLng,this.automaticRadius=i.automaticRadius,this.serverUsed=i.serverUsed,this.timeoutCounts=i.timeoutCounts,this.timeoutHits=i.timeoutHits,this.exhaustiveFacetsCount=i.exhaustiveFacetsCount,this.exhaustiveNbHits=i.exhaustiveNbHits,this.userData=i.userData,this.queryID=i.queryID,this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map(function(){return[]}),this.facets=[];var a=e.getRefinedDisjunctiveFacets(),c=n(e.facets),u=n(e.disjunctiveFacets),o=1,f=this,h=i.facets||{};Object.keys(h).forEach(function(t){var n=h[t],a=s(e.hierarchicalFacets,t);if(a){var o=a.attributes.indexOf(t),l=R(e.hierarchicalFacets,function(e){return e.name===a.name});f.hierarchicalFacets[l][o]={attribute:t,data:n,exhaustive:i.exhaustiveFacetsCount}}else{var m,d=-1!==e.disjunctiveFacets.indexOf(t),v=-1!==e.facets.indexOf(t);d&&(m=u[t],f.disjunctiveFacets[m]={name:t,data:n,exhaustive:i.exhaustiveFacetsCount},r(f.disjunctiveFacets[m],i.facets_stats,t)),v&&(m=c[t],f.facets[m]={name:t,data:n,exhaustive:i.exhaustiveFacetsCount},r(f.facets[m],i.facets_stats,t))}}),this.hierarchicalFacets=p(this.hierarchicalFacets),a.forEach(function(n){var s=t[o],a=s&&s.facets?s.facets:{},c=e.getHierarchicalFacetByName(n);Object.keys(a).forEach(function(t){var n,o=a[t];if(c){n=R(e.hierarchicalFacets,function(e){return e.name===c.name});var h=R(f.hierarchicalFacets[n],function(e){return e.attribute===t});if(-1===h)return;f.hierarchicalFacets[n][h].data=m({},f.hierarchicalFacets[n][h].data,o)}else{n=u[t];var l=i.facets&&i.facets[t]||{};f.disjunctiveFacets[n]={name:t,data:d({},o,l),exhaustive:s.exhaustiveFacetsCount},r(f.disjunctiveFacets[n],s.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach(function(i){!f.disjunctiveFacets[n].data[i]&&e.disjunctiveFacetsRefinements[t].indexOf(i)>-1&&(f.disjunctiveFacets[n].data[i]=0)})}}),o++}),e.getRefinedHierarchicalFacets().forEach(function(i){var n=e.getHierarchicalFacetByName(i),r=e._getHierarchicalFacetSeparator(n),s=e.getHierarchicalRefinement(i);if(!(0===s.length||s[0].split(r).length<2)){var a=t[o],c=a&&a.facets?a.facets:{};Object.keys(c).forEach(function(t){var i=c[t],a=R(e.hierarchicalFacets,function(e){return e.name===n.name}),u=R(f.hierarchicalFacets[a],function(e){return e.attribute===t});if(-1!==u){var o={};if(s.length>0){var h=s[0].split(r)[0];o[h]=f.hierarchicalFacets[a][u].data[h]}f.hierarchicalFacets[a][u].data=d(o,i,f.hierarchicalFacets[a][u].data)}}),o++}}),Object.keys(e.facetsExcludes).forEach(function(t){var n=e.facetsExcludes[t],r=c[t];f.facets[r]={name:t,data:i.facets[t],exhaustive:i.exhaustiveFacetsCount},n.forEach(function(e){f.facets[r]=f.facets[r]||{name:t},f.facets[r].data=f.facets[r].data||{},f.facets[r].data[e]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(F(e)),this.facets=p(this.facets),this.disjunctiveFacets=p(this.disjunctiveFacets),this._state=e}function c(e,t){function i(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=g(e.facets,i);return n?Object.keys(n.data).map(function(i){return{name:i,count:n.data[i],isRefined:e._state.isFacetRefined(t,i),isExcluded:e._state.isExcludeRefined(t,i)}}):[]}if(e._state.isDisjunctiveFacet(t)){var r=g(e.disjunctiveFacets,i);return r?Object.keys(r.data).map(function(i){return{name:i,count:r.data[i],isRefined:e._state.isDisjunctiveFacetRefined(t,i)}}):[]}if(e._state.isHierarchicalFacet(t))return g(e.hierarchicalFacets,i)}function u(e,t){if(!t.data||0===t.data.length)return t;var i=t.data.map(function(t){return u(e,t)}),n=e(i);return m({},t,{data:n})}function o(e,t){return t.sort(e)}function f(e,t){var i=g(e,function(e){return e.name===t});return i&&i.stats}function h(e,t,i,n,r){var s=g(r,function(e){return e.name===i}),a=s&&s.data&&s.data[n]?s.data[n]:0,c=s&&s.exhaustive||!1;return{type:t,attributeName:i,name:n,count:a,exhaustive:c}}function l(e,t,i,n){var r=e.getHierarchicalFacetByName(t),s=e._getHierarchicalFacetSeparator(r),a=i.split(s),c=g(n,function(e){return e.name===t}),u=a.reduce(function(e,t){var i=e&&g(e.data,function(e){return e.name===t});return void 0!==i?i:e},c),o=u&&u.count||0,f=u&&u.exhaustive||!1,h=u&&u.path||"";return{type:"hierarchical",attributeName:t,name:h,count:o,exhaustive:f}}var m=e("../functions/merge"),d=e("../functions/defaultsPure"),v=e("../functions/orderBy"),p=e("../functions/compact"),g=e("../functions/find"),R=e("../functions/findIndex"),y=e("../functions/formatSort"),F=e("./generate-hierarchical-tree");a.prototype.getFacetByName=function(e){function t(t){return t.name===e}return g(this.facets,t)||g(this.disjunctiveFacets,t)||g(this.hierarchicalFacets,t)},a.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],a.prototype.getFacetValues=function(e,t){var i=c(this,e);if(i){var n=d({},t,{sortBy:a.DEFAULT_SORT});if(Array.isArray(n.sortBy)){var r=y(n.sortBy,a.DEFAULT_SORT);return Array.isArray(i)?v(i,r[0],r[1]):u(function(e){return v(e,r[0],r[1])},i)}if("function"==typeof n.sortBy)return Array.isArray(i)?i.sort(n.sortBy):u(function(e){return o(n.sortBy,e)},i);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}},a.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?f(this.facets,e):this._state.isDisjunctiveFacet(e)?f(this.disjunctiveFacets,e):void 0},a.prototype.getRefinements=function(){var e=this._state,t=this,i=[];return Object.keys(e.facetsRefinements).forEach(function(n){e.facetsRefinements[n].forEach(function(r){i.push(h(e,"facet",n,r,t.facets))})}),Object.keys(e.facetsExcludes).forEach(function(n){e.facetsExcludes[n].forEach(function(r){i.push(h(e,"exclude",n,r,t.facets))})}),Object.keys(e.disjunctiveFacetsRefinements).forEach(function(n){e.disjunctiveFacetsRefinements[n].forEach(function(r){i.push(h(e,"disjunctive",n,r,t.disjunctiveFacets))})}),Object.keys(e.hierarchicalFacetsRefinements).forEach(function(n){e.hierarchicalFacetsRefinements[n].forEach(function(r){i.push(l(e,n,r,t.hierarchicalFacets))})}),Object.keys(e.numericRefinements).forEach(function(t){var n=e.numericRefinements[t];Object.keys(n).forEach(function(e){n[e].forEach(function(n){i.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})})})}),e.tagRefinements.forEach(function(e){i.push({type:"tag",attributeName:"_tags",name:e})}),i},t.exports=a},{"../functions/compact":9,"../functions/defaultsPure":10,"../functions/find":11,"../functions/findIndex":12,"../functions/formatSort":13,"../functions/merge":16,"../functions/orderBy":19,"./generate-hierarchical-tree":6}],8:[function(e,t,i){"use strict";function n(e,t,i){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.setClient(e);var n=i||{};n.index=t,this.state=a.make(n),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function r(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function s(){return this.state.page}var a=e("./SearchParameters"),c=e("./SearchResults"),u=e("./DerivedHelper"),o=e("./requestBuilder"),f=e("events"),h=e("./functions/inherits"),l=e("./functions/objectHasKeys"),m=e("./version");h(n,f.EventEmitter),n.prototype.search=function(){return this._search({
onlyWithDerivedHelpers:!1}),this},n.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},n.prototype.getQuery=function(){var e=this.state;return o._getHitsSearchParams(e)},n.prototype.searchOnce=function(e,t){var i=e?this.state.setQueryParameters(e):this.state,n=o._getQueries(i.index,i),r=this;return this._currentNbQueries++,this.emit("searchOnce",{state:i}),t?void this.client.search(n).then(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(null,new c(i,e.results),i)}).catch(function(e){r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),t(e,null,i)}):this.client.search(n).then(function(e){return r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),{content:new c(i,e.results),state:i,_originalResponse:e}},function(e){throw r._currentNbQueries--,0===r._currentNbQueries&&r.emit("searchQueueEmpty"),e})},n.prototype.searchForFacetValues=function(e,t,i,n){var r="function"==typeof this.client.searchForFacetValues;if(!r&&"function"!=typeof this.client.initIndex)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(n||{}),a=s.isDisjunctiveFacet(e),c=o.getSearchForFacetQuery(e,t,i,s);this._currentNbQueries++;var u=this;return this.emit("searchForFacetValues",{state:s,facet:e,query:t}),(r?this.client.searchForFacetValues([{indexName:s.index,params:c}]):this.client.initIndex(s.index).searchForFacetValues(c)).then(function(t){return u._currentNbQueries--,0===u._currentNbQueries&&u.emit("searchQueueEmpty"),t=Array.isArray(t)?t[0]:t,t.facetHits.forEach(function(t){t.isRefined=a?s.isDisjunctiveFacetRefined(e,t.value):s.isFacetRefined(e,t.value)}),t},function(e){throw u._currentNbQueries--,0===u._currentNbQueries&&u.emit("searchQueueEmpty"),e})},n.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},n.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},n.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},n.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},n.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.addNumericRefinement=function(e,t,i){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,i),isPageReset:!0}),this},n.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},n.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},n.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},n.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},n.prototype.removeNumericRefinement=function(e,t,i){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,i),isPageReset:!0}),this},n.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},n.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},n.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},n.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},n.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},n.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},n.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},n.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},n.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},n.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},n.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},n.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},n.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},n.prototype.setCurrentPage=r,n.prototype.setPage=r,n.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},n.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},n.prototype.setState=function(e){return this._change({state:a.make(e),isPageReset:!1}),this},n.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new a(e),this},n.prototype.hasRefinements=function(e){return!!l(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))},n.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},n.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},n.prototype.hasTag=function(e){return this.state.isTagRefined(e)},n.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},n.prototype.getIndex=function(){return this.state.index},n.prototype.getCurrentPage=s,n.prototype.getPage=s,n.prototype.getTags=function(){return this.state.tagRefinements},n.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e)){this.state.getConjunctiveRefinements(e).forEach(function(e){t.push({value:e,type:"conjunctive"})});this.state.getExcludeRefinements(e).forEach(function(e){t.push({value:e,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var i=this.state.getDisjunctiveRefinements(e);i.forEach(function(e){t.push({value:e,type:"disjunctive"})})}var n=this.state.getNumericRefinements(e);return Object.keys(n).forEach(function(e){var i=n[e];t.push({value:i,operator:e,type:"numeric"})}),t},n.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},n.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},n.prototype._search=function(e){var t=this.state,i=[],n=[];e.onlyWithDerivedHelpers||(n=o._getQueries(t.index,t),i.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var r=this.derivedHelpers.map(function(e){var n=e.getModifiedState(t),r=o._getQueries(n.index,n);return i.push({state:n,queriesCount:r.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),r}),s=Array.prototype.concat.apply(n,r),a=this._queryId++;this._currentNbQueries++;try{this.client.search(s).then(this._dispatchAlgoliaResponse.bind(this,i,a)).catch(this._dispatchAlgoliaError.bind(this,a))}catch(e){this.emit("error",{error:e})}},n.prototype._dispatchAlgoliaResponse=function(e,t,i){if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,0===this._currentNbQueries&&this.emit("searchQueueEmpty");var n=i.results.slice();e.forEach(function(e){var t=e.state,i=e.queriesCount,r=e.helper,s=n.splice(0,i),a=r.lastResults=new c(t,s);r.emit("result",{results:a,state:t})})}},n.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"))},n.prototype.containsRefinement=function(e,t,i,n){return e||0!==t.length||0!==i.length||0!==n.length},n.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0},n.prototype._change=function(e){var t=e.state,i=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:i}))},n.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},n.prototype.setClient=function(e){return this.client===e?this:("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+m+")"),this.client=e,this)},n.prototype.getClient=function(){return this.client},n.prototype.derive=function(e){var t=new u(this,e);return this.derivedHelpers.push(t),t},n.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)},n.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},t.exports=n},{"./DerivedHelper":3,"./SearchParameters":5,"./SearchResults":7,"./functions/inherits":14,"./functions/objectHasKeys":17,"./requestBuilder":21,"./version":22,events:2}],9:[function(e,t,i){"use strict";t.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},{}],10:[function(e,t,i){"use strict";t.exports=function(){return Array.prototype.slice.call(arguments).reduceRight(function(e,t){return Object.keys(Object(t)).forEach(function(i){void 0!==t[i]&&(e[i]=t[i])}),e},{})}},{}],11:[function(e,t,i){"use strict";t.exports=function(e,t){if(Array.isArray(e))for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}},{}],12:[function(e,t,i){"use strict";t.exports=function(e,t){if(!Array.isArray(e))return-1;for(var i=0;i<e.length;i++)if(t(e[i]))return i;return-1}},{}],13:[function(e,t,i){"use strict";var n=e("./find");t.exports=function(e,t){var i=(t||[]).map(function(e){return e.split(":")});return e.reduce(function(e,t){var r=t.split(":"),s=n(i,function(e){return e[0]===r[0]});return r.length>1||!s?(e[0].push(r[0]),e[1].push(r[1]),e):(e[0].push(s[0]),e[1].push(s[1]),e)},[[],[]])}},{"./find":11}],14:[function(e,t,i){"use strict";function n(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}t.exports=n},{}],15:[function(e,t,i){"use strict";function n(e,t){return e.filter(function(i,n){return t.indexOf(i)>-1&&e.indexOf(i)===n})}t.exports=n},{}],16:[function(e,t,i){"use strict";function n(e){return"object"==typeof e&&null!==e?s(Array.isArray(e)?[]:{},e):e}function r(e){return"function"==typeof e||Array.isArray(e)||"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){if(e===t)return e;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var a=t[i],c=e[i];void 0!==c&&void 0===a||(r(c)&&r(a)?e[i]=s(c,a):e[i]=n(a))}return e}function a(e){r(e)||(e={});for(var t=1,i=arguments.length;t<i;t++){var n=arguments[t];r(n)&&s(e,n)}return e}t.exports=a},{}],17:[function(e,t,i){"use strict";function n(e){return e&&Object.keys(e).length>0}t.exports=n},{}],18:[function(e,t,i){"use strict";function n(e,t){if(null===e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}t.exports=n},{}],19:[function(e,t,i){"use strict";function n(e,t){if(e!==t){var i=void 0!==e,n=null===e,r=void 0!==t,s=null===t;if(!s&&e>t||n&&r||!i)return 1;if(!n&&e<t||s&&i||!r)return-1}return 0}function r(e,t,i){if(!Array.isArray(e))return[];Array.isArray(i)||(i=[]);var r=e.map(function(e,i){return{criteria:t.map(function(t){return e[t]}),index:i,value:e}});return r.sort(function(e,t){for(var r=-1;++r<e.criteria.length;){var s=n(e.criteria[r],t.criteria[r]);if(s)return r>=i.length?s:"desc"===i[r]?-s:s}return e.index-t.index}),r.map(function(e){return e.value})}t.exports=r},{}],20:[function(e,t,i){"use strict";function n(e){if("number"==typeof e)return e;if("string"==typeof e)return parseFloat(e);if(Array.isArray(e))return e.map(n);throw new Error("The value should be a number, a parsable string or an array of those.")}t.exports=n},{}],21:[function(e,t,i){"use strict";var n=e("./functions/merge"),r={_getQueries:function(e,t){var i=[];return i.push({indexName:e,params:r._getHitsSearchParams(t)}),t.getRefinedDisjunctiveFacets().forEach(function(n){i.push({indexName:e,params:r._getDisjunctiveFacetSearchParams(t,n)})}),t.getRefinedHierarchicalFacets().forEach(function(n){var s=t.getHierarchicalFacetByName(n),a=t.getHierarchicalRefinement(n),c=t._getHierarchicalFacetSeparator(s);a.length>0&&a[0].split(c).length>1&&i.push({indexName:e,params:r._getDisjunctiveFacetSearchParams(t,n,!0)})}),i},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(r._getHitsHierarchicalFacetsAttributes(e)),i=r._getFacetFilters(e),s=r._getNumericFilters(e),a=r._getTagFilters(e),c={facets:t,tagFilters:a};return i.length>0&&(c.facetFilters=i),s.length>0&&(c.numericFilters=s),n({},e.getQueryParams(),c)},_getDisjunctiveFacetSearchParams:function(e,t,i){var s=r._getFacetFilters(e,t,i),a=r._getNumericFilters(e,t),c=r._getTagFilters(e),u={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:c,analytics:!1,clickAnalytics:!1},o=e.getHierarchicalFacetByName(t);return u.facets=o?r._getDisjunctiveHierarchicalFacetAttribute(e,o,i):t,a.length>0&&(u.numericFilters=a),s.length>0&&(u.facetFilters=s),n({},e.getQueryParams(),u)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var i=[];return Object.keys(e.numericRefinements).forEach(function(n){var r=e.numericRefinements[n]||{};Object.keys(r).forEach(function(e){var s=r[e]||[];t!==n&&s.forEach(function(t){if(Array.isArray(t)){var r=t.map(function(t){return n+e+t});i.push(r)}else i.push(n+e+t)})})}),i},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,i){var n=[],r=e.facetsRefinements||{};Object.keys(r).forEach(function(e){(r[e]||[]).forEach(function(t){n.push(e+":"+t)})});var s=e.facetsExcludes||{};Object.keys(s).forEach(function(e){(s[e]||[]).forEach(function(t){n.push(e+":-"+t)})});var a=e.disjunctiveFacetsRefinements||{};Object.keys(a).forEach(function(e){var i=a[e]||[];if(e!==t&&i&&0!==i.length){var r=[];i.forEach(function(t){r.push(e+":"+t)}),n.push(r)}});var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).forEach(function(r){var s=c[r]||[],a=s[0];if(void 0!==a){var u,o,f=e.getHierarchicalFacetByName(r),h=e._getHierarchicalFacetSeparator(f),l=e._getHierarchicalRootPath(f);if(t===r){if(-1===a.indexOf(h)||!l&&!0===i||l&&l.split(h).length===a.split(h).length)return;l?(o=l.split(h).length-1,a=l):(o=a.split(h).length-2,a=a.slice(0,a.lastIndexOf(h))),u=f.attributes[o]}else o=a.split(h).length-1,u=f.attributes[o];u&&n.push([u+":"+a])}}),n},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return e.hierarchicalFacets.reduce(function(t,i){var n=e.getHierarchicalRefinement(i.name)[0];if(!n)return t.push(i.attributes[0]),t;var r=e._getHierarchicalFacetSeparator(i),s=n.split(r).length,a=i.attributes.slice(0,s+1);return t.concat(a)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,i){var n=e._getHierarchicalFacetSeparator(t);if(!0===i){var r=e._getHierarchicalRootPath(t),s=0;return r&&(s=r.split(n).length),[t.attributes[s]]}var a=e.getHierarchicalRefinement(t.name)[0]||"",c=a.split(n).length-1;return t.attributes.slice(0,c+1)},getSearchForFacetQuery:function(e,t,i,s){var a=s.isDisjunctiveFacet(e)?s.clearRefinements(e):s,c={facetQuery:t,facetName:e};return"number"==typeof i&&(c.maxFacetHits=i),n({},r._getHitsSearchParams(a),c)}};t.exports=r},{"./functions/merge":16}],22:[function(e,t,i){"use strict";t.exports="0.0.0-6ac260d"},{}]},{},[1])(1)});
//# sourceMappingURL=dist/algoliasearch.helper.min.js.map
{
"name": "algoliasearch-helper",
"version": "0.0.0-27095c0",
"version": "0.0.0-6ac260d",
"description": "Helper for implementing advanced search features with algolia",
"main": "index.js",
"types": "index.d.ts",
"homepage": "https://community.algolia.com/algoliasearch-helper-js/",

@@ -20,3 +21,3 @@ "scripts": {

"test:watch": "jest --watch",
"release": "git checkout dist/ && rm -rf node_modules && yarn && ./scripts/release.js",
"release": "./scripts/release.js",
"changelog:view-last": "conventional-changelog -u -n scripts/conventional-changelog/",

@@ -37,5 +38,7 @@ "changelog:update": "conventional-changelog -i CHANGELOG -s -u -n scripts/conventional-changelog/"

"src",
"index.js"
"index.js",
"index.d.ts"
],
"devDependencies": {
"@types/algoliasearch": "^3.30.12",
"algolia-frontend-components": "0.0.35",

@@ -42,0 +45,0 @@ "algoliasearch": "3.32.0",

@@ -936,17 +936,2 @@ 'use strict';

/**
* @deprecated since 2.4.0, see {@link AlgoliaSearchHelper#hasRefinements}
*/
AlgoliaSearchHelper.prototype.isRefined = function(facet, value) {
if (this.state.isConjunctiveFacet(facet)) {
return this.state.isFacetRefined(facet, value);
} else if (this.state.isDisjunctiveFacet(facet)) {
return this.state.isDisjunctiveFacetRefined(facet, value);
}
throw new Error(facet +
' is not properly defined in this helper configuration' +
'(use the facets or disjunctiveFacets keys to configure it)');
};
/**
* Check if an attribute has any numeric, conjunctive, disjunctive or hierarchical filters.

@@ -953,0 +938,0 @@ * @param {string} attribute the name of the attribute

@@ -539,3 +539,3 @@ 'use strict';

if (!this.isConjunctiveFacet(facetName)) {
throw new Error(facetName + ' is not defined in the facets attribute of the helper configuration');
return [];
}

@@ -551,5 +551,3 @@ return this.facetsRefinements[facetName] || [];

if (!this.isDisjunctiveFacet(facetName)) {
throw new Error(
facetName + ' is not defined in the disjunctiveFacets attribute of the helper configuration'
);
return [];
}

@@ -575,3 +573,3 @@ return this.disjunctiveFacetsRefinements[facetName] || [];

if (!this.isConjunctiveFacet(facetName)) {
throw new Error(facetName + ' is not defined in the facets attribute of the helper configuration');
return [];
}

@@ -672,12 +670,9 @@ return this.facetsExcludes[facetName] || [];

});
if (outValues.length > 0) {
if (outValues.length !== values.length) hasChanged = true;
operatorList[operator] = outValues;
if (outValues.length !== values.length) {
hasChanged = true;
}
else hasChanged = true;
operatorList[operator] = outValues;
});
if (objectHasKeys(operatorList)) {
memo[key] = operatorList;
}
memo[key] = operatorList;

@@ -1073,2 +1068,5 @@ return memo;

}
if (!this.isHierarchicalFacet(facet)) {
throw new Error(facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration.');
}
var mod = {};

@@ -1148,3 +1146,3 @@ mod[facet] = [path];

if (!this.isConjunctiveFacet(facet)) {
throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');
return false;
}

@@ -1165,3 +1163,3 @@ return RefinementList.isRefined(this.facetsRefinements, facet, value);

if (!this.isConjunctiveFacet(facet)) {
throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');
return false;
}

@@ -1181,4 +1179,3 @@ return RefinementList.isRefined(this.facetsExcludes, facet, value);

if (!this.isDisjunctiveFacet(facet)) {
throw new Error(
facet + ' is not defined in the disjunctiveFacets attribute of the helper configuration');
return false;
}

@@ -1198,4 +1195,3 @@ return RefinementList.isRefined(this.disjunctiveFacetsRefinements, facet, value);

if (!this.isHierarchicalFacet(facet)) {
throw new Error(
facet + ' is not defined in the hierarchicalFacets attribute of the helper configuration');
return false;
}

@@ -1258,9 +1254,15 @@

getRefinedDisjunctiveFacets: function getRefinedDisjunctiveFacets() {
var self = this;
// attributes used for numeric filter can also be disjunctive
var disjunctiveNumericRefinedFacets = intersection(
Object.keys(this.numericRefinements),
Object.keys(this.numericRefinements).filter(function(facet) {
return Object.keys(self.numericRefinements[facet]).length > 0;
}),
this.disjunctiveFacets
);
return Object.keys(this.disjunctiveFacetsRefinements)
return Object.keys(this.disjunctiveFacetsRefinements).filter(function(facet) {
return self.disjunctiveFacetsRefinements[facet].length > 0;
})
.concat(disjunctiveNumericRefinedFacets)

@@ -1277,2 +1279,3 @@ .concat(this.getRefinedHierarchicalFacets());

getRefinedHierarchicalFacets: function getRefinedHierarchicalFacets() {
var self = this;
return intersection(

@@ -1282,3 +1285,5 @@ // enforce the order between the two arrays,

this.hierarchicalFacets.map(function(facet) { return facet.name; }),
Object.keys(this.hierarchicalFacetsRefinements)
Object.keys(this.hierarchicalFacetsRefinements).filter(function(facet) {
return self.hierarchicalFacetsRefinements[facet].length > 0;
})
);

@@ -1459,4 +1464,3 @@ },

if (!this.isHierarchicalFacet(facetName)) {
throw new Error(
'Cannot get the breadcrumb of an unknown hierarchical facet: `' + facetName + '`');
return [];
}

@@ -1463,0 +1467,0 @@

@@ -55,3 +55,7 @@ 'use strict';

if (value === undefined) {
return lib.clearRefinement(refinementList, attribute);
// we use the "filter" form of clearRefinement, since it leaves empty values as-is
// the form with a string will remove the attribute completely
return lib.clearRefinement(refinementList, function(v, f) {
return attribute === f;
});
}

@@ -111,10 +115,7 @@

});
if (facetList.length > 0) {
if (facetList.length !== values.length) {
hasChanged = true;
}
memo[key] = facetList;
} else {
if (facetList.length !== values.length) {
hasChanged = true;
}
memo[key] = facetList;

@@ -121,0 +122,0 @@ return memo;

@@ -677,3 +677,3 @@ 'use strict';

* The default value for this attribute `['isRefined:desc', 'count:desc', 'name:asc']`
* @return {FacetValue[]|HierarchicalFacet} depending on the type of facet of
* @return {FacetValue[]|HierarchicalFacet|undefined} depending on the type of facet of
* the attribute requested (hierarchical, disjunctive or conjunctive)

@@ -697,3 +697,5 @@ * @example

var facetValues = extractNormalizedFacetValues(this, attribute);
if (!facetValues) throw new Error(attribute + ' is not a retrieved facet.');
if (!facetValues) {
return undefined;
}

@@ -739,3 +741,3 @@ var options = defaultsPure({}, opts, {sortBy: SearchResults.DEFAULT_SORT});

throw new Error(attribute + ' is not present in `facets` or `disjunctiveFacets`');
return undefined;
};

@@ -766,2 +768,5 @@

*
* Note that for a numeric refinement, results are grouped per operator, this
* means that it will return responses for operators which are empty.
*
* @return {Array.<Refinement>} all the refinements

@@ -768,0 +773,0 @@ */

'use strict';
module.exports = '0.0.0-27095c0';
module.exports = '0.0.0-6ac260d';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc