(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[424],{91043:function(t){t.exports=function(){"use strict";function t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function e(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function r(t,e){if(null==t)return{};var r,n,a=function(t,e){if(null==t)return{};var r,n,a={},o=Object.keys(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||(a[r]=t[r]);return a}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],n=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){a=!0,o=t}finally{try{n||null==u.return||u.return()}finally{if(a)throw o}}return r}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(t){return function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance")}()}function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},e={};return{get:function(r,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},o=JSON.stringify(r);if(o in e)return Promise.resolve(t.serializable?JSON.parse(e[o]):e[o]);var i=n(),u=a&&a.miss||function(){return Promise.resolve()};return i.then(function(t){return u(t)}).then(function(){return i})},set:function(r,n){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(t){return delete e[JSON.stringify(t)],Promise.resolve()},clear:function(){return e={},Promise.resolve()}}}function i(t,e,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:function(){return t===d.WithinHeaders?n:{}},queryParameters:function(){return t===d.WithinQueryParameters?n:{}}}}function u(t){var e=0;return t(function r(){return e++,new Promise(function(n){setTimeout(function(){n(t(r))},Math.min(100*e,1e3))})})}function s(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return Promise.resolve()};return Object.assign(t,{wait:function(r){return s(t.then(function(t){return Promise.all([e(t,r),t])}).then(function(t){return t[1]}))}})}function c(t,e){return e&&Object.keys(e).forEach(function(r){t[r]=e[r](t)}),t}function f(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var a=0;return t.replace(/%s/g,function(){return encodeURIComponent(r[a++])})}var d={WithinQueryParameters:0,WithinHeaders:1};function l(t,e){var r=t||{},n=r.data||{};return Object.keys(r).forEach(function(t){-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(t)&&(n[t]=r[t])}),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var p={Read:1,Write:2,Any:3};function h(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e(e({},t),{},{status:r,lastUpdate:Date.now()})}function m(t){return"string"==typeof t?{protocol:"https",url:t,accept:p.Any}:{protocol:t.protocol||"https",url:t.url,accept:t.accept||p.Any}}var y="DELETE",g="POST";function v(t,r,n,o){var i,u,s,c=[],f=function(t,r){if("GET"!==t.method&&(void 0!==t.data||void 0!==r.data))return JSON.stringify(Array.isArray(t.data)?t.data:e(e({},t.data),r.data))}(n,o),d=(i=e(e({},t.headers),o.headers),u={},Object.keys(i).forEach(function(t){var e=i[t];u[t.toLowerCase()]=e}),u),l=n.method,p="GET"!==n.method?{}:e(e({},n.data),o.data),y=e(e(e({"x-algolia-agent":t.userAgent.value},t.queryParameters),p),o.queryParameters),g=0,v=function e(r,a){var i,u,s,p,m=r.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:O(c)};var v={data:f,headers:d,method:l,url:(i=m,u=n.path,s=P(y),p="".concat(i.protocol,"://").concat(i.url,"/").concat("/"===u.charAt(0)?u.substr(1):u),s.length&&(p+="?".concat(s)),p),connectTimeout:a(g,t.timeouts.connect),responseTimeout:a(g,o.timeout)},b=function(t){var e={request:v,response:t,host:m,triesLeft:r.length};return c.push(e),e},j={onSuccess:function(t){return function(t){try{return JSON.parse(t.content)}catch(e){throw{name:"DeserializationError",message:e.message,response:t}}}(t)},onRetry:function(n){var o=b(n);return n.isTimedOut&&g++,Promise.all([t.logger.info("Retryable failure",w(o)),t.hostsCache.set(m,h(m,n.isTimedOut?3:2))]).then(function(){return e(r,a)})},onFail:function(t){throw b(t),function(t,e){var r=t.content,n=t.status,a=r;try{a=JSON.parse(r).message}catch(t){}return{name:"ApiError",message:a,status:n,transporterStackTrace:e}}(t,O(c))}};return t.requester.send(v).then(function(t){var e,r,n;return(e=t.status,t.isTimedOut||(r=t.isTimedOut,n=t.status,!r&&0==~~n)||2!=~~(e/100)&&4!=~~(e/100))?j.onRetry(t):2==~~(t.status/100)?j.onSuccess(t):j.onFail(t)})};return(s=t.hostsCache,Promise.all(r.map(function(t){return s.get(t,function(){return Promise.resolve(h(t))})})).then(function(t){var e=t.filter(function(t){return 1===t.status||Date.now()-t.lastUpdate>12e4}),n=t.filter(function(t){return 3===t.status&&Date.now()-t.lastUpdate<=12e4}),o=[].concat(a(e),a(n));return{getTimeout:function(t,e){return(0===n.length&&0===t?1:n.length+3+t)*e},statelessHosts:o.length>0?o.map(function(t){return m(t)}):r}})).then(function(t){return v(a(t.statelessHosts).reverse(),t.getTimeout)})}function b(t){var e=t.hostsCache,r=t.logger,a=t.requester,o=t.requestsCache,i=t.responsesCache,u=t.timeouts,s=t.userAgent,c=t.hosts,f=t.queryParameters,d={hostsCache:e,logger:r,requester:a,requestsCache:o,responsesCache:i,timeouts:u,userAgent:s,headers:t.headers,queryParameters:f,hosts:c.map(function(t){return m(t)}),read:function(t,e){var r=l(e,d.timeouts.read),a=function(){return v(d,d.hosts.filter(function(t){return 0!=(t.accept&p.Read)}),t,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:t.cacheable))return a();var o={request:t,mappedRequestOptions:r,transporter:{queryParameters:d.queryParameters,headers:d.headers}};return d.responsesCache.get(o,function(){return d.requestsCache.get(o,function(){return d.requestsCache.set(o,a()).then(function(t){return Promise.all([d.requestsCache.delete(o),t])},function(t){return Promise.all([d.requestsCache.delete(o),Promise.reject(t)])}).then(function(t){var e=n(t,2);return e[0],e[1]})})},{miss:function(t){return d.responsesCache.set(o,t)}})},write:function(t,e){return v(d,d.hosts.filter(function(t){return 0!=(t.accept&p.Write)}),t,l(e,d.timeouts.write))}};return d}function P(t){return Object.keys(t).map(function(e){var r;return f("%s=%s",e,(r=t[e],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(t[e]):t[e]))}).join("&")}function O(t){return t.map(function(t){return w(t)})}function w(t){var r=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return e(e({},t),{},{request:e(e({},t.request),{},{headers:e(e({},t.request.headers),r)})})}var j=function(t){return function(e,r){return t.transporter.write({method:g,path:"2/abtests",data:e},r)}},I=function(t){return function(e,r){return t.transporter.write({method:y,path:f("2/abtests/%s",e)},r)}},x=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("2/abtests/%s",e)},r)}},T=function(t){return function(e){return t.transporter.read({method:"GET",path:"2/abtests"},e)}},D=function(t){return function(e,r){return t.transporter.write({method:g,path:f("2/abtests/%s/stop",e)},r)}},q=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/strategies/personalization"},e)}},k=function(t){return function(e,r){return t.transporter.write({method:g,path:"1/strategies/personalization",data:e},r)}};function E(t){return function e(r){return t.request(r).then(function(n){if(void 0!==t.batch&&t.batch(n.hits),!t.shouldStop(n))return n.cursor?e({cursor:n.cursor}):e({page:(r.page||0)+1})})}({})}var S=function(t){return function(n,a){var o=a||{},i=o.queryParameters,c=r(o,["queryParameters"]),f=e({acl:n},void 0!==i?{queryParameters:i}:{});return s(t.transporter.write({method:g,path:"1/keys",data:f},c),function(e,r){return u(function(n){return M(t)(e.key,r).catch(function(t){if(404!==t.status)throw t;return n()})})})}},N=function(t){return function(e,r,n){var a=l(n);return a.queryParameters["X-Algolia-User-ID"]=e,t.transporter.write({method:g,path:"1/clusters/mapping",data:{cluster:r}},a)}},R=function(t){return function(e,r,n){return t.transporter.write({method:g,path:"1/clusters/mapping/batch",data:{users:e,cluster:r}},n)}},A=function(t){return function(e,r){return s(t.transporter.write({method:g,path:f("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},r),function(e,r){return tp(t)(e.taskID,r)})}},C=function(t){return function(e,r,n){return s(t.transporter.write({method:g,path:f("1/indexes/%s/operation",e),data:{operation:"copy",destination:r}},n),function(r,n){return V(t)(e,{methods:{waitTask:t$}}).waitTask(r.taskID,n)})}},G=function(t){return function(r,n,a){return C(t)(r,n,e(e({},a),{},{scope:[t0.Rules]}))}},U=function(t){return function(r,n,a){return C(t)(r,n,e(e({},a),{},{scope:[t0.Settings]}))}},z=function(t){return function(r,n,a){return C(t)(r,n,e(e({},a),{},{scope:[t0.Synonyms]}))}},J=function(t){return function(e,r){return"GET"===e.method?t.transporter.read(e,r):t.transporter.write(e,r)}},F=function(t){return function(e,r){return s(t.transporter.write({method:y,path:f("1/keys/%s",e)},r),function(r,n){return u(function(r){return M(t)(e,n).then(r).catch(function(t){if(404!==t.status)throw t})})})}},H=function(t){return function(e,r,n){var a=r.map(function(t){return{action:"deleteEntry",body:{objectID:t}}});return s(t.transporter.write({method:g,path:f("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!1,requests:a}},n),function(e,r){return tp(t)(e.taskID,r)})}},M=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("1/keys/%s",e)},r)}},K=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("1/task/%s",e.toString())},r)}},W=function(t){return function(e){return t.transporter.read({method:"GET",path:"/1/dictionaries/*/settings"},e)}},B=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/logs"},e)}},Q=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/clusters/mapping/top"},e)}},L=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("1/clusters/mapping/%s",e)},r)}},_=function(t){return function(e){var n=e||{},a=n.retrieveMappings,o=r(n,["retrieveMappings"]);return!0===a&&(o.getClusters=!0),t.transporter.read({method:"GET",path:"1/clusters/mapping/pending"},o)}},V=function(t){return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return c({transporter:t.transporter,appId:t.appId,indexName:e},r.methods)}},X=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/keys"},e)}},Y=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/clusters"},e)}},Z=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/indexes"},e)}},$=function(t){return function(e){return t.transporter.read({method:"GET",path:"1/clusters/mapping"},e)}},tt=function(t){return function(e,r,n){return s(t.transporter.write({method:g,path:f("1/indexes/%s/operation",e),data:{operation:"move",destination:r}},n),function(r,n){return V(t)(e,{methods:{waitTask:t$}}).waitTask(r.taskID,n)})}},te=function(t){return function(e,r){return s(t.transporter.write({method:g,path:"1/indexes/*/batch",data:{requests:e}},r),function(e,r){return Promise.all(Object.keys(e.taskID).map(function(n){return V(t)(n,{methods:{waitTask:t$}}).waitTask(e.taskID[n],r)}))})}},tr=function(t){return function(e,r){return t.transporter.read({method:g,path:"1/indexes/*/objects",data:{requests:e}},r)}},tn=function(t){return function(r,n){var a=r.map(function(t){return e(e({},t),{},{params:P(t.params||{})})});return t.transporter.read({method:g,path:"1/indexes/*/queries",data:{requests:a},cacheable:!0},n)}},ta=function(t){return function(n,a){return Promise.all(n.map(function(n){var o=n.params,i=o.facetName,u=o.facetQuery,s=r(o,["facetName","facetQuery"]);return V(t)(n.indexName,{methods:{searchForFacetValues:tV}}).searchForFacetValues(i,u,e(e({},a),s))}))}},to=function(t){return function(e,r){var n=l(r);return n.queryParameters["X-Algolia-User-ID"]=e,t.transporter.write({method:y,path:"1/clusters/mapping"},n)}},ti=function(t){return function(e,r,n){var a=r.map(function(t){return{action:"addEntry",body:t}});return s(t.transporter.write({method:g,path:f("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!0,requests:a}},n),function(e,r){return tp(t)(e.taskID,r)})}},tu=function(t){return function(e,r){return s(t.transporter.write({method:g,path:f("1/keys/%s/restore",e)},r),function(r,n){return u(function(r){return M(t)(e,n).catch(function(t){if(404!==t.status)throw t;return r()})})})}},ts=function(t){return function(e,r,n){var a=r.map(function(t){return{action:"addEntry",body:t}});return s(t.transporter.write({method:g,path:f("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!1,requests:a}},n),function(e,r){return tp(t)(e.taskID,r)})}},tc=function(t){return function(e,r,n){return t.transporter.read({method:g,path:f("/1/dictionaries/%s/search",e),data:{query:r},cacheable:!0},n)}},tf=function(t){return function(e,r){return t.transporter.read({method:g,path:"1/clusters/mapping/search",data:{query:e}},r)}},td=function(t){return function(e,r){return s(t.transporter.write({method:"PUT",path:"/1/dictionaries/*/settings",data:e},r),function(e,r){return tp(t)(e.taskID,r)})}},tl=function(t){return function(e,n){var a=Object.assign({},n),o=n||{},i=o.queryParameters,c=r(o,["queryParameters"]),d=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"];return s(t.transporter.write({method:"PUT",path:f("1/keys/%s",e),data:i?{queryParameters:i}:{}},c),function(r,n){return u(function(r){return M(t)(e,n).then(function(t){return Object.keys(a).filter(function(t){return -1!==d.indexOf(t)}).every(function(e){if(Array.isArray(t[e])&&Array.isArray(a[e])){var r=t[e];return r.length===a[e].length&&r.every(function(t,r){return t===a[e][r]})}return t[e]===a[e]})?Promise.resolve():r()})})})}},tp=function(t){return function(e,r){return u(function(n){return K(t)(e,r).then(function(t){return"published"!==t.status?n():void 0})})}},th=function(t){return function(e,r){return s(t.transporter.write({method:g,path:f("1/indexes/%s/batch",t.indexName),data:{requests:e}},r),function(e,r){return t$(t)(e.taskID,r)})}},tm=function(t){return function(r){return E(e(e({shouldStop:function(t){return void 0===t.cursor}},r),{},{request:function(e){return t.transporter.read({method:g,path:f("1/indexes/%s/browse",t.indexName),data:e},r)}}))}},ty=function(t){return function(r){var n=e({hitsPerPage:1e3},r);return E(e(e({shouldStop:function(t){return t.hits.length<n.hitsPerPage}},n),{},{request:function(r){return tX(t)("",e(e({},n),r)).then(function(t){return e(e({},t),{},{hits:t.hits.map(function(t){return delete t._highlightResult,t})})})}}))}},tg=function(t){return function(r){var n=e({hitsPerPage:1e3},r);return E(e(e({shouldStop:function(t){return t.hits.length<n.hitsPerPage}},n),{},{request:function(r){return tY(t)("",e(e({},n),r)).then(function(t){return e(e({},t),{},{hits:t.hits.map(function(t){return delete t._highlightResult,t})})})}}))}},tv=function(t){return function(e,n,a){var o=a||{},i=o.batchSize,u=r(o,["batchSize"]),c={taskIDs:[],objectIDs:[]};return s(function r(){var a,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s=[];for(a=o;a<e.length&&(s.push(e[a]),s.length!==(i||1e3));a++);return 0===s.length?Promise.resolve(c):th(t)(s.map(function(t){return{action:n,body:t}}),u).then(function(t){return c.objectIDs=c.objectIDs.concat(t.objectIDs),c.taskIDs.push(t.taskID),r(++a)})}(),function(e,r){return Promise.all(e.taskIDs.map(function(e){return t$(t)(e,r)}))})}},tb=function(t){return function(e){return s(t.transporter.write({method:g,path:f("1/indexes/%s/clear",t.indexName)},e),function(e,r){return t$(t)(e.taskID,r)})}},tP=function(t){return function(e){var n=e||{},a=n.forwardToReplicas,o=l(r(n,["forwardToReplicas"]));return a&&(o.queryParameters.forwardToReplicas=1),s(t.transporter.write({method:g,path:f("1/indexes/%s/rules/clear",t.indexName)},o),function(e,r){return t$(t)(e.taskID,r)})}},tO=function(t){return function(e){var n=e||{},a=n.forwardToReplicas,o=l(r(n,["forwardToReplicas"]));return a&&(o.queryParameters.forwardToReplicas=1),s(t.transporter.write({method:g,path:f("1/indexes/%s/synonyms/clear",t.indexName)},o),function(e,r){return t$(t)(e.taskID,r)})}},tw=function(t){return function(e,r){return s(t.transporter.write({method:g,path:f("1/indexes/%s/deleteByQuery",t.indexName),data:e},r),function(e,r){return t$(t)(e.taskID,r)})}},tj=function(t){return function(e){return s(t.transporter.write({method:y,path:f("1/indexes/%s",t.indexName)},e),function(e,r){return t$(t)(e.taskID,r)})}},tI=function(t){return function(e,r){return s(tx(t)([e],r).then(function(t){return{taskID:t.taskIDs[0]}}),function(e,r){return t$(t)(e.taskID,r)})}},tx=function(t){return function(e,r){var n=e.map(function(t){return{objectID:t}});return tv(t)(n,t1.DeleteObject,r)}},tT=function(t){return function(e,n){var a=n||{},o=a.forwardToReplicas,i=l(r(a,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),s(t.transporter.write({method:y,path:f("1/indexes/%s/rules/%s",t.indexName,e)},i),function(e,r){return t$(t)(e.taskID,r)})}},tD=function(t){return function(e,n){var a=n||{},o=a.forwardToReplicas,i=l(r(a,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),s(t.transporter.write({method:y,path:f("1/indexes/%s/synonyms/%s",t.indexName,e)},i),function(e,r){return t$(t)(e.taskID,r)})}},tq=function(t){return function(e){return tC(t)(e).then(function(){return!0}).catch(function(t){if(404!==t.status)throw t;return!1})}},tk=function(t){return function(e,r,n){return t.transporter.read({method:g,path:f("1/answers/%s/prediction",t.indexName),data:{query:e,queryLanguages:r},cacheable:!0},n)}},tE=function(t){return function(a,o){var i=o||{},u=i.query,s=i.paginate,c=r(i,["query","paginate"]),f=0;return function r(){return t_(t)(u||"",e(e({},c),{},{page:f})).then(function(t){for(var e=0,o=Object.entries(t.hits);e<o.length;e++){var i=n(o[e],2),u=i[0],c=i[1];if(a(c))return{object:c,position:parseInt(u,10),page:f}}if(f++,!1===s||f>=t.nbPages)throw{name:"ObjectNotFoundError",message:"Object not found."};return r()})}()}},tS=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("1/indexes/%s/%s",t.indexName,e)},r)}},tN=function(){return function(t,e){for(var r=0,a=Object.entries(t.hits);r<a.length;r++){var o=n(a[r],2),i=o[0];if(o[1].objectID===e)return parseInt(i,10)}return -1}},tR=function(t){return function(n,a){var o=a||{},i=o.attributesToRetrieve,u=r(o,["attributesToRetrieve"]),s=n.map(function(r){return e({indexName:t.indexName,objectID:r},i?{attributesToRetrieve:i}:{})});return t.transporter.read({method:g,path:"1/indexes/*/objects",data:{requests:s}},u)}},tA=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("1/indexes/%s/rules/%s",t.indexName,e)},r)}},tC=function(t){return function(e){return t.transporter.read({method:"GET",path:f("1/indexes/%s/settings",t.indexName),data:{getVersion:2}},e)}},tG=function(t){return function(e,r){return t.transporter.read({method:"GET",path:f("1/indexes/%s/synonyms/%s",t.indexName,e)},r)}},tU=function(t){return function(e,r){return s(tz(t)([e],r).then(function(t){return{objectID:t.objectIDs[0],taskID:t.taskIDs[0]}}),function(e,r){return t$(t)(e.taskID,r)})}},tz=function(t){return function(e,n){var a=n||{},o=a.createIfNotExists,i=r(a,["createIfNotExists"]),u=o?t1.PartialUpdateObject:t1.PartialUpdateObjectNoCreate;return tv(t)(e,u,i)}},tJ=function(t){return function(o,i){var u=i||{},c=u.safe,d=u.autoGenerateObjectIDIfNotExist,l=u.batchSize,p=r(u,["safe","autoGenerateObjectIDIfNotExist","batchSize"]),h=function(e,r,n,a){return s(t.transporter.write({method:g,path:f("1/indexes/%s/operation",e),data:{operation:n,destination:r}},a),function(e,r){return t$(t)(e.taskID,r)})},m=Math.random().toString(36).substring(7),y="".concat(t.indexName,"_tmp_").concat(m),v=tK({appId:t.appId,transporter:t.transporter,indexName:y}),b=[],P=h(t.indexName,y,"copy",e(e({},p),{},{scope:["settings","synonyms","rules"]}));return b.push(P),s((c?P.wait(p):P).then(function(){var t=v(o,e(e({},p),{},{autoGenerateObjectIDIfNotExist:d,batchSize:l}));return b.push(t),c?t.wait(p):t}).then(function(){var e=h(y,t.indexName,"move",p);return b.push(e),c?e.wait(p):e}).then(function(){return Promise.all(b)}).then(function(t){var e=n(t,3),r=e[0],o=e[1],i=e[2];return{objectIDs:o.objectIDs,taskIDs:[r.taskID].concat(a(o.taskIDs),[i.taskID])}}),function(t,e){return Promise.all(b.map(function(t){return t.wait(e)}))})}},tF=function(t){return function(r,n){return tB(t)(r,e(e({},n),{},{clearExistingRules:!0}))}},tH=function(t){return function(r,n){return tL(t)(r,e(e({},n),{},{clearExistingSynonyms:!0}))}},tM=function(t){return function(e,r){return s(tK(t)([e],r).then(function(t){return{objectID:t.objectIDs[0],taskID:t.taskIDs[0]}}),function(e,r){return t$(t)(e.taskID,r)})}},tK=function(t){return function(e,n){var a=n||{},o=a.autoGenerateObjectIDIfNotExist,i=r(a,["autoGenerateObjectIDIfNotExist"]),u=o?t1.AddObject:t1.UpdateObject;if(u===t1.UpdateObject){var c=!0,f=!1,d=void 0;try{for(var l,p=e[Symbol.iterator]();!(c=(l=p.next()).done);c=!0)if(void 0===l.value.objectID)return s(Promise.reject({name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}))}catch(t){f=!0,d=t}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}}return tv(t)(e,u,i)}},tW=function(t){return function(e,r){return tB(t)([e],r)}},tB=function(t){return function(e,n){var a=n||{},o=a.forwardToReplicas,i=a.clearExistingRules,u=l(r(a,["forwardToReplicas","clearExistingRules"]));return o&&(u.queryParameters.forwardToReplicas=1),i&&(u.queryParameters.clearExistingRules=1),s(t.transporter.write({method:g,path:f("1/indexes/%s/rules/batch",t.indexName),data:e},u),function(e,r){return t$(t)(e.taskID,r)})}},tQ=function(t){return function(e,r){return tL(t)([e],r)}},tL=function(t){return function(e,n){var a=n||{},o=a.forwardToReplicas,i=a.clearExistingSynonyms,u=a.replaceExistingSynonyms,c=l(r(a,["forwardToReplicas","clearExistingSynonyms","replaceExistingSynonyms"]));return o&&(c.queryParameters.forwardToReplicas=1),(u||i)&&(c.queryParameters.replaceExistingSynonyms=1),s(t.transporter.write({method:g,path:f("1/indexes/%s/synonyms/batch",t.indexName),data:e},c),function(e,r){return t$(t)(e.taskID,r)})}},t_=function(t){return function(e,r){return t.transporter.read({method:g,path:f("1/indexes/%s/query",t.indexName),data:{query:e},cacheable:!0},r)}},tV=function(t){return function(e,r,n){return t.transporter.read({method:g,path:f("1/indexes/%s/facets/%s/query",t.indexName,e),data:{facetQuery:r},cacheable:!0},n)}},tX=function(t){return function(e,r){return t.transporter.read({method:g,path:f("1/indexes/%s/rules/search",t.indexName),data:{query:e}},r)}},tY=function(t){return function(e,r){return t.transporter.read({method:g,path:f("1/indexes/%s/synonyms/search",t.indexName),data:{query:e}},r)}},tZ=function(t){return function(e,n){var a=n||{},o=a.forwardToReplicas,i=l(r(a,["forwardToReplicas"]));return o&&(i.queryParameters.forwardToReplicas=1),s(t.transporter.write({method:"PUT",path:f("1/indexes/%s/settings",t.indexName),data:e},i),function(e,r){return t$(t)(e.taskID,r)})}},t$=function(t){return function(e,r){return u(function(n){var a,o;return(a=e,o=r,t.transporter.read({method:"GET",path:f("1/indexes/%s/task/%s",t.indexName,a.toString())},o)).then(function(t){return"published"!==t.status?n():void 0})})}},t1={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject"},t0={Settings:"settings",Synonyms:"synonyms",Rules:"rules"};function t2(t,r,u){var s,f,l,h,m,y,g,v,P,O,w,E,tv={appId:t,apiKey:r,timeouts:{connect:1,read:2,write:30},requester:{send:function(t){return new Promise(function(e){var r=new XMLHttpRequest;r.open(t.method,t.url,!0),Object.keys(t.headers).forEach(function(e){return r.setRequestHeader(e,t.headers[e])});var n,a=function(t,n){return setTimeout(function(){r.abort(),e({status:0,content:n,isTimedOut:!0})},1e3*t)},o=a(t.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(o),n=a(t.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(o),clearTimeout(n),e({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(o),clearTimeout(n),e({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(t.data)})}},logger:{debug:function(t,e){return Promise.resolve()},info:function(t,e){return Promise.resolve()},error:function(t,e){return console.error(t,e),Promise.resolve()}},responsesCache:o(),requestsCache:o({serializable:!1}),hostsCache:function t(e){var r=a(e.caches),o=r.shift();return void 0===o?{get:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return e().then(function(t){return Promise.all([t,r.miss(t)])}).then(function(t){return n(t,1)[0]})},set:function(t,e){return Promise.resolve(e)},delete:function(t){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return o.get(e,n,a).catch(function(){return t({caches:r}).get(e,n,a)})},set:function(e,n){return o.set(e,n).catch(function(){return t({caches:r}).set(e,n)})},delete:function(e){return o.delete(e).catch(function(){return t({caches:r}).delete(e)})},clear:function(){return o.clear().catch(function(){return t({caches:r}).clear()})}}}({caches:[(s={key:"".concat("4.18.0","-").concat(t)},l="algoliasearch-client-js-".concat(s.key),h=function(){return void 0===f&&(f=s.localStorage||window.localStorage),f},m=function(){return JSON.parse(h().getItem(l)||"{}")},y=function(t){h().setItem(l,JSON.stringify(t))},g=function(){var t=s.timeToLive?1e3*s.timeToLive:null,e=Object.fromEntries(Object.entries(m()).filter(function(t){return void 0!==n(t,2)[1].timestamp}));y(e),t&&y(Object.fromEntries(Object.entries(e).filter(function(e){var r=n(e,2)[1],a=(new Date).getTime();return!(r.timestamp+t<a)})))},{get:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then(function(){g();var e=JSON.stringify(t);return m()[e]}).then(function(t){return Promise.all([t?t.value:e(),void 0!==t])}).then(function(t){var e=n(t,2),a=e[0];return Promise.all([a,e[1]||r.miss(a)])}).then(function(t){return n(t,1)[0]})},set:function(t,e){return Promise.resolve().then(function(){var r=m();return r[JSON.stringify(t)]={timestamp:(new Date).getTime(),value:e},h().setItem(l,JSON.stringify(r)),e})},delete:function(t){return Promise.resolve().then(function(){var e=m();delete e[JSON.stringify(t)],h().setItem(l,JSON.stringify(e))})},clear:function(){return Promise.resolve().then(function(){h().removeItem(l)})}}),o()]}),userAgent:(v={value:"Algolia for JavaScript (".concat("4.18.0",")"),add:function(t){var e="; ".concat(t.segment).concat(void 0!==t.version?" (".concat(t.version,")"):"");return -1===v.value.indexOf(e)&&(v.value="".concat(v.value).concat(e)),v}}).add({segment:"Browser"})},t1=e(e({},tv),u),t0=function(){return function(t){var r,n,a,o;return n=(r=e(e(e({},tv),t),{},{methods:{getPersonalizationStrategy:q,setPersonalizationStrategy:k}})).region||"us",a=i(d.WithinHeaders,r.appId,r.apiKey),o=b(e(e({hosts:[{url:"personalization.".concat(n,".algolia.com")}]},r),{},{headers:e(e(e({},a.headers()),{"content-type":"application/json"}),r.headers),queryParameters:e(e({},a.queryParameters()),r.queryParameters)})),c({appId:r.appId,transporter:o},r.methods)}};return O=(P=e(e({},t1),{},{methods:{search:tn,searchForFacetValues:ta,multipleBatch:te,multipleGetObjects:tr,multipleQueries:tn,copyIndex:C,copySettings:U,copySynonyms:z,copyRules:G,moveIndex:tt,listIndices:Z,getLogs:B,listClusters:Y,multipleSearchForFacetValues:ta,getApiKey:M,addApiKey:S,listApiKeys:X,updateApiKey:tl,deleteApiKey:F,restoreApiKey:tu,assignUserID:N,assignUserIDs:R,getUserID:L,searchUserIDs:tf,listUserIDs:$,getTopUserIDs:Q,removeUserID:to,hasPendingMappings:_,clearDictionaryEntries:A,deleteDictionaryEntries:H,getDictionarySettings:W,getAppTask:K,replaceDictionaryEntries:ti,saveDictionaryEntries:ts,searchDictionaryEntries:tc,setDictionarySettings:td,waitAppTask:tp,customRequest:J,initIndex:function(t){return function(e){return V(t)(e,{methods:{batch:th,delete:tj,findAnswers:tk,getObject:tS,getObjects:tR,saveObject:tM,saveObjects:tK,search:t_,searchForFacetValues:tV,waitTask:t$,setSettings:tZ,getSettings:tC,partialUpdateObject:tU,partialUpdateObjects:tz,deleteObject:tI,deleteObjects:tx,deleteBy:tw,clearObjects:tb,browseObjects:tm,getObjectPosition:tN,findObject:tE,exists:tq,saveSynonym:tQ,saveSynonyms:tL,getSynonym:tG,searchSynonyms:tY,browseSynonyms:tg,deleteSynonym:tD,clearSynonyms:tO,replaceAllObjects:tJ,replaceAllSynonyms:tH,searchRules:tX,getRule:tA,deleteRule:tT,saveRule:tW,saveRules:tB,replaceAllRules:tF,browseRules:ty,clearRules:tP}})}},initAnalytics:function(){return function(t){var r,n,a,o;return n=(r=e(e(e({},tv),t),{},{methods:{addABTest:j,getABTest:x,getABTests:T,stopABTest:D,deleteABTest:I}})).region||"us",a=i(d.WithinHeaders,r.appId,r.apiKey),o=b(e(e({hosts:[{url:"analytics.".concat(n,".algolia.com")}]},r),{},{headers:e(e(e({},a.headers()),{"content-type":"application/json"}),r.headers),queryParameters:e(e({},a.queryParameters()),r.queryParameters)})),c({appId:r.appId,transporter:o},r.methods)}},initPersonalization:t0,initRecommendation:function(){return function(t){return t1.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),t0()(t)}}}})).appId,w=i(void 0!==P.authMode?P.authMode:d.WithinHeaders,O,P.apiKey),c({transporter:E=b(e(e({hosts:[{url:"".concat(O,"-dsn.algolia.net"),accept:p.Read},{url:"".concat(O,".algolia.net"),accept:p.Write}].concat(function(t){for(var e=t.length-1;e>0;e--){var r=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[r],t[r]=n}return t}([{url:"".concat(O,"-1.algolianet.com")},{url:"".concat(O,"-2.algolianet.com")},{url:"".concat(O,"-3.algolianet.com")}]))},P),{},{headers:e(e(e({},w.headers()),{"content-type":"application/x-www-form-urlencoded"}),P.headers),queryParameters:e(e({},w.queryParameters()),P.queryParameters)})),appId:O,addAlgoliaAgent:function(t,e){E.userAgent.add({segment:t,version:e})},clearCache:function(){return Promise.all([E.requestsCache.clear(),E.responsesCache.clear()]).then(function(){})}},P.methods)}return t2.version="4.18.0",t2}()}}]);