(function(e){var t;if(typeof window!=="undefined"){t=window}else if(typeof self!=="undefined"){t=self}t.ALGOLIA_MIGRATION_LAYER=e()})(function(){var e,t,r;return function n(e,t,r){function o(a,s){if(!t[a]){if(!e[a]){var u=typeof require=="function"&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=t[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,n,e,t,r)}return t[a].exports}var i=typeof require=="function"&&require;for(var a=0;awindow.ALGOLIA_SUPPORTS_DOCWRITE = true");if(window.ALGOLIA_SUPPORTS_DOCWRITE===true){document.write('');o("document.write")()}else{r(n,o("DOMElement"))}}catch(a){r(n,o("DOMElement"))}}function o(e){return function t(){var t="AlgoliaSearch: loaded V2 script using "+e;window.console&&window.console.log&&window.console.log(t)}}},{1:1}],4:[function(e,t,r){t.exports=n;function n(){var e="-- AlgoliaSearch V2 => V3 error --\n"+"You are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\n"+"Please read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n"+"-- /AlgoliaSearch V2 => V3 error --";window.AlgoliaSearch=function(){throw new Error(e)};window.AlgoliaSearchHelper=function(){throw new Error(e)};AlgoliaExplainResults=function(){throw new Error(e)}}},{}],5:[function(e,t,r){n("algoliasearch");function n(t){var r=e(2);var n=e(3);var o=e(4);if(r(t)){n(t)}else{o()}}},{2:2,3:3,4:4}]},{},[5])(5)});(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.algoliasearch=e()}})(function(){var e,t,r;return function n(e,t,r){function o(a,s){if(!t[a]){if(!e[a]){var u=typeof require=="function"&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=t[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,n,e,t,r)}return t[a].exports}var i=typeof require=="function"&&require;for(var a=0;a0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(e,t){if(!o(t))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(e,n);if(!r){r=true;t.apply(this,arguments)}}n.listener=t;this.on(e,n);return this};n.prototype.removeListener=function(e,t){var r,n,i,s;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];i=r.length;n=-1;if(r===t||o(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(a(r)){for(s=i;s-->0;){if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(o(r)){this.removeListener(e,r)}else{while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};n.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(o(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};n.listenerCount=function(e,t){var r;if(!e._events||!e._events[t])r=0;else if(o(e._events[t]))r=1;else r=e._events[t].length;return r};function o(e){return typeof e==="function"}function i(e){return typeof e==="number"}function a(e){return typeof e==="object"&&e!==null}function s(e){return e===void 0}},{}],2:[function(e,t,r){var n=t.exports={};var o=[];var i=false;var a;var s=-1;function u(){i=false;if(a.length){o=a.concat(o)}else{s=-1}if(o.length){c()}}function c(){if(i){return}var e=setTimeout(u);i=true;var t=o.length;while(t){a=o;o=[];while(++s1){for(var r=1;r0&&c>u){c=u}for(var l=0;l=0){h=f.substr(0,d);p=f.substr(d+1)}else{h=f;p=""}v=decodeURIComponent(h);y=decodeURIComponent(p);if(!n(a,v)){a[v]=y}else if(o(a[v])){a[v].push(y)}else{a[v]=[a[v],y]}}return a};var o=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},{}],4:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){t=t||"&";r=r||"=";if(e===null){e=undefined}if(typeof e==="object"){return i(a(e),function(a){var s=encodeURIComponent(n(a))+r;if(o(e[a])){return i(e[a],function(e){return s+encodeURIComponent(n(e))}).join(t)}else{return s+encodeURIComponent(n(e[a]))}}).join(t)}if(!s)return"";return encodeURIComponent(n(s))+r+encodeURIComponent(n(e))};var o=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function i(e,t){if(e.map)return e.map(t);var r=[];for(var n=0;n=31}r.formatters.j=function(e){return JSON.stringify(e)};function o(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0;var i=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;o++;if("%c"===e){i=o}});e.splice(i,0,n);return e}function i(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function s(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(s());function u(){try{return window.localStorage}catch(e){}}},{7:7}],7:[function(e,t,r){r=t.exports=a;r.coerce=l;r.disable=u;r.enable=s;r.enabled=c;r.humanize=e(8);r.names=[];r.skips=[];r.formatters={};var n=0;var o;function i(){return r.colors[n++%r.colors.length]}function a(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var a=t-(o||t);e.diff=a;e.prev=o;e.curr=t;o=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=i();var s=Array.prototype.slice.call(arguments);s[0]=r.coerce(s[0]);if("string"!==typeof s[0]){s=["%o"].concat(s)}var u=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;u++;var o=r.formatters[n];if("function"===typeof o){var i=s[u];t=o.call(e,i);s.splice(u,1);u--}return t});if("function"===typeof r.formatArgs){s=r.formatArgs.apply(e,s)}var c=n.log||r.log||console.log.bind(console);c.apply(e,s)}n.enabled=true;var a=r.enabled(e)?n:t;a.namespace=e;return a}function s(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var o=0;o1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var u=(t[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return r*s;case"days":case"day":case"d":return r*a;case"hours":case"hour":case"hrs":case"hr":case"h":return r*i;case"minutes":case"minute":case"mins":case"min":case"m":return r*o;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function c(e){if(e>=a)return Math.round(e/a)+"d";if(e>=i)return Math.round(e/i)+"h";if(e>=o)return Math.round(e/o)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function l(e){return f(e,a,"day")||f(e,i,"hour")||f(e,o,"minute")||f(e,n,"second")||e+" ms"}function f(e,t,r){if(e2?r[a-2]:undefined,u=a>2?r[2]:undefined,c=a>1?r[a-1]:undefined;if(typeof s=="function"){s=n(s,c,5);a-=2}else{s=typeof c=="function"?c:undefined;a-=s?1:0}if(u&&o(r[0],r[1],u)){s=a<3?undefined:s;a=1}while(++i-1&&e%1==0&&e-1&&e%1==0&&e<=n}t.exports=o},{}],43:[function(e,t,r){function n(e){return!!e&&typeof e=="object"}t.exports=n},{}],44:[function(e,t,r){var n=e(20),o=e(49),i=e(39),a=e(43),s=e(62);var u="[object Object]";var c=Object.prototype;var l=c.hasOwnProperty;var f=c.toString;function d(e){var t;if(!(a(e)&&f.call(e)==u&&!i(e))||!l.call(e,"constructor")&&(t=e.constructor,typeof t=="function"&&!(t instanceof t))||!s.argsTag&&o(e)){return false}var r;if(s.ownLast){n(e,function(e,t,n){r=l.call(n,t);return false});return r!==false}n(e,function(e,t){r=t});return r===undefined||l.call(e,r)}t.exports=d},{20:20,39:39,43:43,49:49,62:62}],45:[function(e,t,r){var n=e(49),o=e(50),i=e(40),a=e(42),s=e(55),u=e(59);var c=Object.prototype;var l=c.hasOwnProperty;function f(e){var t=u(e),r=t.length,c=r&&e.length;var f=!!c&&a(c)&&(o(e)||n(e)||s(e));var d=-1,h=[];while(++d0,m=f.enumErrorProps&&(e===_||e instanceof Error),b=f.enumPrototypes&&a(e);while(++n=s.hosts[t.hostType].length||s.useFallback&&!l){if(!t.fallback||!s._request.fallback||l){o("could not get any response");return s._promise.reject(new n.AlgoliaSearchError("Cannot connect to the AlgoliaSearch API."+" Send an email to support@algolia.com to report and resolve the issue."+" Application id was: "+s.applicationID))}o("switching to fallback");u=0;c.method=t.fallback.method;c.url=t.fallback.url;c.jsonBody=t.fallback.body;if(c.jsonBody){c.body=JSON.stringify(c.jsonBody)}c.timeout=s.requestTimeout*(u+1);s.hostIndex[t.hostType]=0;l=true;return f(s._request.fallback,c)}var h=s.hosts[t.hostType][s.hostIndex[t.hostType]]+c.url;var p={body:i,jsonBody:t.body,method:c.method,headers:s._computeRequestHeaders(),timeout:c.timeout,debug:o};o("method: %s, url: %s, headers: %j, timeout: %d",p.method,h,p.headers,p.timeout);if(e===s._request.fallback){o("using fallback")}return e.call(s,h,p).then(v,y);function v(e){var t=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200;o("received response: statusCode: %s, computed statusCode: %d, headers: %j",e.statusCode,t,e.headers);if(r.env.DEBUG&&r.env.DEBUG.indexOf("debugBody")!==-1){o("body: %j",e.body)}var i=t===200||t===201;var c=!i&&Math.floor(t/100)!==4&&Math.floor(t/100)!==1;if(s._useCache&&i&&a){a[d]=e.body}if(i){return e.body}if(c){u+=1;return m()}var l=new n.AlgoliaSearchError(e.body&&e.body.message);return s._promise.reject(l)}function y(r){o("error: %s, stack: %s",r.message,r.stack);if(!(r instanceof n.AlgoliaSearchError)){r=new n.Unknown(r&&r.message,r)}u+=1;if(r instanceof n.Unknown||r instanceof n.UnparsableJSON||!e.fallback&&r instanceof n.Network||u>=s.hosts[t.hostType].length&&(l||!t.fallback||!s._request.fallback)){return s._promise.reject(r)}s.hostIndex[t.hostType]=++s.hostIndex[t.hostType]%s.hosts[t.hostType].length;if(r instanceof n.RequestTimeout){return m()}else if(s._request.fallback&&!s.useFallback){s.useFallback=true}return f(e,c)}function m(){s.hostIndex[t.hostType]=++s.hostIndex[t.hostType]%s.hosts[t.hostType].length;c.timeout=s.requestTimeout*(u+1);return f(e,c)}}var d=s.useFallback&&t.fallback;var h=d?t.fallback:t;var p=f(d?s._request.fallback:s._request,{url:h.url,method:h.method,body:i,jsonBody:t.body,timeout:s.requestTimeout*(u+1)});if(t.callback){p.then(function v(e){c(function(){t.callback(null,e)},s._setTimeout||setTimeout)},function y(e){c(function(){t.callback(e)},s._setTimeout||setTimeout)})}else{return p}},_getSearchParams:function(e,t){if(this._isUndefined(e)||e===null){return t}for(var r in e){if(r!==null&&e[r]!==undefined&&e.hasOwnProperty(r)){t+=t===""?"":"&";t+=r+"="+encodeURIComponent(Object.prototype.toString.call(e[r])==="[object Array]"?JSON.stringify(e[r]):e[r])}}return t},_isUndefined:function(e){return e===void 0},_computeRequestHeaders:function(){var t=e(11);var r={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-algolia-agent":this._ua};if(this.userToken){r["x-algolia-usertoken"]=this.userToken}if(this.securityTags){r["x-algolia-tagfilters"]=this.securityTags}if(this.extraHeaders){t(this.extraHeaders,function n(e){r[e.name]=e.value})}return r}};o.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(e,t,r){var n=this;if(arguments.length===1||typeof t==="function"){r=t;t=undefined}return this.as._jsonRequest({method:t!==undefined?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(n.indexName)+(t!==undefined?"/"+encodeURIComponent(t):""),body:e,hostType:"write",callback:r})},addObjects:function(e,t){var r=this;var n={requests:[]};for(var o=0;on){t=n}if(e.status!=="published"){return a._promise.delay(t).then(function(){return u()})}return e})}if(!t){return s}s.then(l,f);function l(e){c(function(){t(null,e)},a._setTimeout||setTimeout)}function f(e){c(function(){t(e)},a._setTimeout||setTimeout)}},clearIndex:function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},getSettings:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings",hostType:"read",callback:e})},setSettings:function(e,t){var r=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/settings",hostType:"write",body:e,callback:t})},listUserKeys:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){var r=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,r){if(arguments.length===1||typeof t==="function"){r=t;t=null}var n={acl:e};if(t){n.validity=t.validity;n.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour;n.maxHitsPerQuery=t.maxHitsPerQuery;n.description=t.description;if(t.queryParameters){n.queryParameters=this.as._getSearchParams(t.queryParameters,"")}n.referers=t.referers}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:n,hostType:"write",callback:r})},addUserKeyWithValidity:l(function(e,t,r){return this.addUserKey(e,t,r)},u("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(e,t,r,n){if(arguments.length===2||typeof r==="function"){n=r;r=null}var o={acl:t};if(r){o.validity=r.validity;o.maxQueriesPerIPPerHour=r.maxQueriesPerIPPerHour;o.maxHitsPerQuery=r.maxHitsPerQuery;o.description=r.description;if(r.queryParameters){o.queryParameters=this.as._getSearchParams(r.queryParameters,"")}o.referers=r.referers}return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+e,body:o,hostType:"write",callback:n})},_search:function(e,t){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:t})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null};function i(e,t){var r=[];for(var n=0;n was loaded but did not call our provided callback"),JSONPScriptError:i("JSONPScriptError","