(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
	typeof define === 'function' && define.amd ? define(['exports'], factory) :
	(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.algoliasearch = {}));
})(this, (function (exports) { 'use strict';

	function v(){function c(u){return new Promise(d=>{let m=new XMLHttpRequest;m.open(u.method,u.url,true),Object.keys(u.headers).forEach(t=>m.setRequestHeader(t,u.headers[t]));let q=(t,e)=>setTimeout(()=>{m.abort(),d({status:0,content:e,isTimedOut:true});},t),f=q(u.connectTimeout,"Connection timeout"),l;m.onreadystatechange=()=>{m.readyState>m.OPENED&&l===void 0&&(clearTimeout(f),l=q(u.responseTimeout,"Socket timeout"));},m.onerror=()=>{m.status===0&&(clearTimeout(f),clearTimeout(l),d({content:m.responseText||"Network request failed",status:m.status,isTimedOut:false}));},m.onload=()=>{clearTimeout(f),clearTimeout(l),d({content:m.responseText,status:m.status,isTimedOut:false});},m.send(u.data);})}return {send:c}}function I(c){let u,d=`algolia-client-js-${c.key}`;function m(){return u===void 0&&(u=c.localStorage||window.localStorage),u}function q(){return JSON.parse(m().getItem(d)||"{}")}function f(t){m().setItem(d,JSON.stringify(t));}function l(){let t=c.timeToLive?c.timeToLive*1e3:null,e=q(),r=Object.fromEntries(Object.entries(e).filter(([,s])=>s.timestamp!==void 0));if(f(r),!t)return;let a=Object.fromEntries(Object.entries(r).filter(([,s])=>{let o=new Date().getTime();return !(s.timestamp+t<o)}));f(a);}return {get(t,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(l(),q()[JSON.stringify(t)])).then(a=>Promise.all([a?a.value:e(),a!==void 0])).then(([a,s])=>Promise.all([a,s||r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve().then(()=>{let r=q();return r[JSON.stringify(t)]={timestamp:new Date().getTime(),value:e},m().setItem(d,JSON.stringify(r)),e})},delete(t){return Promise.resolve().then(()=>{let e=q();delete e[JSON.stringify(t)],m().setItem(d,JSON.stringify(e));})},clear(){return Promise.resolve().then(()=>{m().removeItem(d);})}}}function ye(){return {get(c,u,d={miss:()=>Promise.resolve()}){return u().then(q=>Promise.all([q,d.miss(q)])).then(([q])=>q)},set(c,u){return Promise.resolve(u)},delete(c){return Promise.resolve()},clear(){return Promise.resolve()}}}function T(c){let u=[...c.caches],d=u.shift();return d===void 0?ye():{get(m,q,f={miss:()=>Promise.resolve()}){return d.get(m,q,f).catch(()=>T({caches:u}).get(m,q,f))},set(m,q){return d.set(m,q).catch(()=>T({caches:u}).set(m,q))},delete(m){return d.delete(m).catch(()=>T({caches:u}).delete(m))},clear(){return d.clear().catch(()=>T({caches:u}).clear())}}}function E(c={serializable:true}){let u={};return {get(d,m,q={miss:()=>Promise.resolve()}){let f=JSON.stringify(d);if(f in u)return Promise.resolve(c.serializable?JSON.parse(u[f]):u[f]);let l=m();return l.then(t=>q.miss(t)).then(()=>l)},set(d,m){return u[JSON.stringify(d)]=c.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(d){return delete u[JSON.stringify(d)],Promise.resolve()},clear(){return u={},Promise.resolve()}}}function Ee(c){let u={value:`Algolia for JavaScript (${c})`,add(d){let m=`; ${d.segment}${d.version!==void 0?` (${d.version})`:""}`;return u.value.indexOf(m)===-1&&(u.value=`${u.value}${m}`),u}};return u}function R(c,u,d="WithinHeaders"){let m={"x-algolia-api-key":u,"x-algolia-application-id":c};return {headers(){return d==="WithinHeaders"?m:{}},queryParameters(){return d==="WithinQueryParameters"?m:{}}}}function U({func:c,validate:u,aggregator:d,error:m,timeout:q=()=>0}){let f=l=>new Promise((t,e)=>{c(l).then(async r=>(d&&await d(r),await u(r)?t(r):m&&await m.validate(r)?e(new Error(await m.message(r))):setTimeout(()=>{f(r).then(t).catch(e);},await q()))).catch(r=>{e(r);});});return f()}function C({algoliaAgents:c,client:u,version:d}){let m=Ee(d).add({segment:u,version:d});return c.forEach(q=>m.add(q)),m}function A(){return {debug(c,u){return Promise.resolve()},info(c,u){return Promise.resolve()},error(c,u){return Promise.resolve()}}}var V=2*60*1e3;function _(c,u="up"){let d=Date.now();function m(){return u==="up"||Date.now()-d>V}function q(){return u==="timed out"&&Date.now()-d<=V}return {...c,status:u,lastUpdate:d,isUp:m,isTimedOut:q}}var M=class extends Error{name="AlgoliaError";constructor(c,u){super(c),u&&(this.name=u);}};var K=class extends M{stackTrace;constructor(c,u,d){super(c,d),this.stackTrace=u;}},Se=class extends K{constructor(c){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",c,"RetryError");}},N=class extends K{status;constructor(c,u,d,m="ApiError"){super(c,d,m),this.status=u;}},Te=class extends M{response;constructor(c,u){super(c,"DeserializationError"),this.response=u;}},ve=class extends N{error;constructor(c,u,d,m){super(c,u,m,"DetailedApiError"),this.error=d;}};function G(c){let u=c;for(let d=c.length-1;d>0;d--){let m=Math.floor(Math.random()*(d+1)),q=c[d];u[d]=c[m],u[m]=q;}return u}function Ie(c,u,d){let m=Re(d),q=`${c.protocol}://${c.url}${c.port?`:${c.port}`:""}/${u.charAt(0)==="/"?u.substring(1):u}`;return m.length&&(q+=`?${m}`),q}function Re(c){return Object.keys(c).filter(u=>c[u]!==void 0).sort().map(u=>`${u}=${encodeURIComponent(Object.prototype.toString.call(c[u])==="[object Array]"?c[u].join(","):c[u]).replace(/\+/g,"%20")}`).join("&")}function Ce(c,u){if(c.method==="GET"||c.data===void 0&&u.data===void 0)return;let d=Array.isArray(c.data)?c.data:{...c.data,...u.data};return JSON.stringify(d)}function Ae(c,u,d){let m={Accept:"application/json",...c,...u,...d},q={};return Object.keys(m).forEach(f=>{let l=m[f];q[f.toLowerCase()]=l;}),q}function be(c){try{return JSON.parse(c.content)}catch(u){throw new Te(u.message,c)}}function De({content:c,status:u},d){try{let m=JSON.parse(c);return "error"in m?new ve(m.message,u,m.error,d):new N(m.message,u,d)}catch{}return new N(c,u,d)}function xe({isTimedOut:c,status:u}){return !c&&~~u===0}function ke({isTimedOut:c,status:u}){return c||xe({isTimedOut:c,status:u})||~~(u/100)!==2&&~~(u/100)!==4}function Ue({status:c}){return ~~(c/100)===2}function Oe(c){return c.map(u=>J(u))}function J(c){let u=c.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...c,request:{...c.request,headers:{...c.request.headers,...u}}}}function b({hosts:c,hostsCache:u,baseHeaders:d,logger:m,baseQueryParameters:q,algoliaAgent:f,timeouts:l,requester:t,requestsCache:e,responsesCache:r}){async function a(n){let i=await Promise.all(n.map(y=>u.get(y,()=>Promise.resolve(_(y))))),h=i.filter(y=>y.isUp()),g=i.filter(y=>y.isTimedOut()),P=[...h,...g];return {hosts:P.length>0?P:n,getTimeout(y,w){return (g.length===0&&y===0?1:g.length+3+y)*w}}}async function s(n,i,h=true){let g=[],P=Ce(n,i),p=Ae(d,n.headers,i.headers),y=n.method==="GET"?{...n.data,...i.data}:{},w={...q,...n.queryParameters,...y};if(f.value&&(w["x-algolia-agent"]=f.value),i&&i.queryParameters)for(let x of Object.keys(i.queryParameters))!i.queryParameters[x]||Object.prototype.toString.call(i.queryParameters[x])==="[object Object]"?w[x]=i.queryParameters[x]:w[x]=i.queryParameters[x].toString();let S=0,D=async(x,B)=>{let O=x.pop();if(O===void 0)throw new Se(Oe(g));let F={...l,...i.timeouts},$={data:P,headers:p,method:n.method,url:Ie(O,n.path,w),connectTimeout:B(S,F.connect),responseTimeout:B(S,h?F.read:F.write)},W=L=>{let z={request:$,response:L,host:O,triesLeft:x.length};return g.push(z),z},k=await t.send($);if(ke(k)){let L=W(k);return k.isTimedOut&&S++,m.info("Retryable failure",J(L)),await u.set(O,_(O,k.isTimedOut?"timed out":"down")),D(x,B)}if(Ue(k))return be(k);throw W(k),De(k,g)},j=c.filter(x=>x.accept==="readWrite"||(h?x.accept==="read":x.accept==="write")),Q=await a(j);return D([...Q.hosts].reverse(),Q.getTimeout)}function o(n,i={}){let h=n.useReadTransporter||n.method==="GET";if(!h)return s(n,i,h);let g=()=>s(n,i);if((i.cacheable||n.cacheable)!==true)return g();let p={request:n,requestOptions:i,transporter:{queryParameters:q,headers:d}};return r.get(p,()=>e.get(p,()=>e.set(p,g()).then(y=>Promise.all([e.delete(p),y]),y=>Promise.all([e.delete(p),Promise.reject(y)])).then(([y,w])=>w)),{miss:y=>r.set(p,y)})}return {hostsCache:u,requester:t,timeouts:l,logger:m,algoliaAgent:f,baseHeaders:d,baseQueryParameters:q,hosts:c,request:o,requestsCache:e,responsesCache:r}}var Y="5.25.0",X=["de","us"];function Ne(c){return [{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Ge({appId:c,apiKey:u,authMode:d,algoliaAgents:m,region:q,...f}){let l=R(c,u,d),t=b({hosts:Ne(q),...f,algoliaAgent:C({algoliaAgents:m,client:"Abtesting",version:Y}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return {transporter:t,appId:c,apiKey:u,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e;},addABTests(e,r){if(!e)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!e.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!e.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");let n={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return t.request(n,r)},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},customPut({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},deleteABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");let n={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},estimateABTest(e,r){if(!e)throw new Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!e.configuration)throw new Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!e.variants)throw new Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");let n={method:"POST",path:"/2/abtests/estimate",queryParameters:{},headers:{},data:e};return t.request(n,r)},getABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");let n={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},listABTests({offset:e,limit:r,indexPrefix:a,indexSuffix:s}={},o=void 0){let n="/2/abtests",i={},h={};e!==void 0&&(h.offset=e.toString()),r!==void 0&&(h.limit=r.toString()),a!==void 0&&(h.indexPrefix=a.toString()),s!==void 0&&(h.indexSuffix=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},scheduleABTest(e,r){if(!e)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!e.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!e.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!e.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!e.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");let n={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:e};return t.request(n,r)},stopABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");let n={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)}}}function Z(c,u,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!X.includes(d)))throw new Error(`\`region\` must be one of the following: ${X.join(", ")}`);return Ge({appId:c,apiKey:u,region:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${Y}-${c}`}),E()]}),...m})}var re="5.25.0",ee=["de","us"];function je(c){return [{url:c?"analytics.{region}.algolia.com".replace("{region}",c):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Be({appId:c,apiKey:u,authMode:d,algoliaAgents:m,region:q,...f}){let l=R(c,u,d),t=b({hosts:je(q),...f,algoliaAgent:C({algoliaAgents:m,client:"Analytics",version:re}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return {transporter:t,appId:c,apiKey:u,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e;},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},customPut({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},getAddToCartRate({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let n="/2/conversions/addToCartRate",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getAverageClickPosition({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let n="/2/clicks/averageClickPosition",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getClickPositions({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let n="/2/clicks/positions",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getClickThroughRate({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let n="/2/clicks/clickThroughRate",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getConversionRate({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let n="/2/conversions/conversionRate",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getNoClickRate({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let n="/2/searches/noClickRate",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getNoResultsRate({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let n="/2/searches/noResultRate",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getPurchaseRate({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let n="/2/conversions/purchaseRate",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getRevenue({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let n="/2/conversions/revenue",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getSearchesCount({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let n="/2/searches/count",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},getSearchesNoClicks({index:e,startDate:r,endDate:a,limit:s,offset:o,tags:n},i){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let h="/2/searches/noClicks",g={},P={};e!==void 0&&(P.index=e.toString()),r!==void 0&&(P.startDate=r.toString()),a!==void 0&&(P.endDate=a.toString()),s!==void 0&&(P.limit=s.toString()),o!==void 0&&(P.offset=o.toString()),n!==void 0&&(P.tags=n.toString());let p={method:"GET",path:h,queryParameters:P,headers:g};return t.request(p,i)},getSearchesNoResults({index:e,startDate:r,endDate:a,limit:s,offset:o,tags:n},i){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let h="/2/searches/noResults",g={},P={};e!==void 0&&(P.index=e.toString()),r!==void 0&&(P.startDate=r.toString()),a!==void 0&&(P.endDate=a.toString()),s!==void 0&&(P.limit=s.toString()),o!==void 0&&(P.offset=o.toString()),n!==void 0&&(P.tags=n.toString());let p={method:"GET",path:h,queryParameters:P,headers:g};return t.request(p,i)},getStatus({index:e},r){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let a="/2/status",s={},o={};e!==void 0&&(o.index=e.toString());let n={method:"GET",path:a,queryParameters:o,headers:s};return t.request(n,r)},getTopCountries({index:e,startDate:r,endDate:a,limit:s,offset:o,tags:n},i){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let h="/2/countries",g={},P={};e!==void 0&&(P.index=e.toString()),r!==void 0&&(P.startDate=r.toString()),a!==void 0&&(P.endDate=a.toString()),s!==void 0&&(P.limit=s.toString()),o!==void 0&&(P.offset=o.toString()),n!==void 0&&(P.tags=n.toString());let p={method:"GET",path:h,queryParameters:P,headers:g};return t.request(p,i)},getTopFilterAttributes({index:e,search:r,startDate:a,endDate:s,limit:o,offset:n,tags:i},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let g="/2/filters",P={},p={};e!==void 0&&(p.index=e.toString()),r!==void 0&&(p.search=r.toString()),a!==void 0&&(p.startDate=a.toString()),s!==void 0&&(p.endDate=s.toString()),o!==void 0&&(p.limit=o.toString()),n!==void 0&&(p.offset=n.toString()),i!==void 0&&(p.tags=i.toString());let y={method:"GET",path:g,queryParameters:p,headers:P};return t.request(y,h)},getTopFilterForAttribute({attribute:e,index:r,search:a,startDate:s,endDate:o,limit:n,offset:i,tags:h},g){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!r)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let P="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),p={},y={};r!==void 0&&(y.index=r.toString()),a!==void 0&&(y.search=a.toString()),s!==void 0&&(y.startDate=s.toString()),o!==void 0&&(y.endDate=o.toString()),n!==void 0&&(y.limit=n.toString()),i!==void 0&&(y.offset=i.toString()),h!==void 0&&(y.tags=h.toString());let w={method:"GET",path:P,queryParameters:y,headers:p};return t.request(w,g)},getTopFiltersNoResults({index:e,search:r,startDate:a,endDate:s,limit:o,offset:n,tags:i},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let g="/2/filters/noResults",P={},p={};e!==void 0&&(p.index=e.toString()),r!==void 0&&(p.search=r.toString()),a!==void 0&&(p.startDate=a.toString()),s!==void 0&&(p.endDate=s.toString()),o!==void 0&&(p.limit=o.toString()),n!==void 0&&(p.offset=n.toString()),i!==void 0&&(p.tags=i.toString());let y={method:"GET",path:g,queryParameters:p,headers:P};return t.request(y,h)},getTopHits({index:e,search:r,clickAnalytics:a,revenueAnalytics:s,startDate:o,endDate:n,limit:i,offset:h,tags:g},P){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let p="/2/hits",y={},w={};e!==void 0&&(w.index=e.toString()),r!==void 0&&(w.search=r.toString()),a!==void 0&&(w.clickAnalytics=a.toString()),s!==void 0&&(w.revenueAnalytics=s.toString()),o!==void 0&&(w.startDate=o.toString()),n!==void 0&&(w.endDate=n.toString()),i!==void 0&&(w.limit=i.toString()),h!==void 0&&(w.offset=h.toString()),g!==void 0&&(w.tags=g.toString());let S={method:"GET",path:p,queryParameters:w,headers:y};return t.request(S,P)},getTopSearches({index:e,clickAnalytics:r,revenueAnalytics:a,startDate:s,endDate:o,orderBy:n,direction:i,limit:h,offset:g,tags:P},p){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let y="/2/searches",w={},S={};e!==void 0&&(S.index=e.toString()),r!==void 0&&(S.clickAnalytics=r.toString()),a!==void 0&&(S.revenueAnalytics=a.toString()),s!==void 0&&(S.startDate=s.toString()),o!==void 0&&(S.endDate=o.toString()),n!==void 0&&(S.orderBy=n.toString()),i!==void 0&&(S.direction=i.toString()),h!==void 0&&(S.limit=h.toString()),g!==void 0&&(S.offset=g.toString()),P!==void 0&&(S.tags=P.toString());let D={method:"GET",path:y,queryParameters:S,headers:w};return t.request(D,p)},getUsersCount({index:e,startDate:r,endDate:a,tags:s},o){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let n="/2/users/count",i={},h={};e!==void 0&&(h.index=e.toString()),r!==void 0&&(h.startDate=r.toString()),a!==void 0&&(h.endDate=a.toString()),s!==void 0&&(h.tags=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)}}}function te(c,u,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!ee.includes(d)))throw new Error(`\`region\` must be one of the following: ${ee.join(", ")}`);return Be({appId:c,apiKey:u,region:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${re}-${c}`}),E()]}),...m})}var se="5.25.0",ae=["de","us"];function Fe(c){return [{url:c?"insights.{region}.algolia.io".replace("{region}",c):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Le({appId:c,apiKey:u,authMode:d,algoliaAgents:m,region:q,...f}){let l=R(c,u,d),t=b({hosts:Fe(q),...f,algoliaAgent:C({algoliaAgents:m,client:"Insights",version:se}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return {transporter:t,appId:c,apiKey:u,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e;},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},customPut({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},deleteUserToken({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");let n={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},pushEvents(e,r){if(!e)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!e.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");let n={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e};return t.request(n,r)}}}function ne(c,u,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(d&&(typeof d!="string"||!ae.includes(d)))throw new Error(`\`region\` must be one of the following: ${ae.join(", ")}`);return Le({appId:c,apiKey:u,region:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${se}-${c}`}),E()]}),...m})}var ie="5.25.0",oe=["eu","us"];function He(c){return [{url:"personalization.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]}function Qe({appId:c,apiKey:u,authMode:d,algoliaAgents:m,region:q,...f}){let l=R(c,u,d),t=b({hosts:He(q),...f,algoliaAgent:C({algoliaAgents:m,client:"Personalization",version:ie}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return {transporter:t,appId:c,apiKey:u,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e;},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},customPut({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},deleteUserProfile({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");let n={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getPersonalizationStrategy(e){let o={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return t.request(o,e)},getUserTokenProfile({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");let n={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},setPersonalizationStrategy(e,r){if(!e)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!e.eventsScoring)throw new Error("Parameter `personalizationStrategyParams.eventsScoring` is required when calling `setPersonalizationStrategy`.");if(!e.facetsScoring)throw new Error("Parameter `personalizationStrategyParams.facetsScoring` is required when calling `setPersonalizationStrategy`.");if(!e.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");let n={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e};return t.request(n,r)}}}function ce(c,u,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!oe.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${oe.join(", ")}`);return Qe({appId:c,apiKey:u,region:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${ie}-${c}`}),E()]}),...m})}var he="5.25.0",ue=["eu","us"];function $e(c){return [{url:"query-suggestions.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]}function We({appId:c,apiKey:u,authMode:d,algoliaAgents:m,region:q,...f}){let l=R(c,u,d),t=b({hosts:$e(q),...f,algoliaAgent:C({algoliaAgents:m,client:"QuerySuggestions",version:he}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return {transporter:t,appId:c,apiKey:u,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e;},createConfig(e,r){if(!e)throw new Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");let n={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return t.request(n,r)},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},customPut({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},deleteConfig({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");let n={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getAllConfigs(e){let o={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return t.request(o,e)},getConfig({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfig`.");let n={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getConfigStatus({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");let n={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getLogFile({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");let n={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},updateConfig({indexName:e,configuration:r},a){if(!e)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!r)throw new Error("Parameter `configuration` is required when calling `updateConfig`.");if(!r.sourceIndices)throw new Error("Parameter `configuration.sourceIndices` is required when calling `updateConfig`.");let i={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)}}}function de(c,u,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!ue.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${ue.join(", ")}`);return We({appId:c,apiKey:u,region:d,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${he}-${c}`}),E()]}),...m})}var H="5.25.0";function ze(c){return [{url:`${c}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${c}.algolia.net`,accept:"write",protocol:"https"}].concat(G([{url:`${c}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Ve({appId:c,apiKey:u,authMode:d,algoliaAgents:m,...q}){let f=R(c,u,d),l=b({hosts:ze(c),...q,algoliaAgent:C({algoliaAgents:m,client:"Search",version:H}),baseHeaders:{"content-type":"text/plain",...f.headers(),...q.baseHeaders},baseQueryParameters:{...f.queryParameters(),...q.baseQueryParameters}});return {transporter:l,appId:c,apiKey:u,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(t,e){l.algoliaAgent.add({segment:t,version:e});},setClientApiKey({apiKey:t}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=t:l.baseQueryParameters["x-algolia-api-key"]=t;},waitForTask({indexName:t,taskID:e,maxRetries:r=50,timeout:a=o=>Math.min(o*200,5e3)},s){let o=0;return U({func:()=>this.getTask({indexName:t,taskID:e},s),validate:n=>n.status==="published",aggregator:()=>o+=1,error:{validate:()=>o>=r,message:()=>`The maximum number of retries exceeded. (${o}/${r})`},timeout:()=>a(o)})},waitForAppTask({taskID:t,maxRetries:e=50,timeout:r=s=>Math.min(s*200,5e3)},a){let s=0;return U({func:()=>this.getAppTask({taskID:t},a),validate:o=>o.status==="published",aggregator:()=>s+=1,error:{validate:()=>s>=e,message:()=>`The maximum number of retries exceeded. (${s}/${e})`},timeout:()=>r(s)})},waitForApiKey({operation:t,key:e,apiKey:r,maxRetries:a=50,timeout:s=n=>Math.min(n*200,5e3)},o){let n=0,i={aggregator:()=>n+=1,error:{validate:()=>n>=a,message:()=>`The maximum number of retries exceeded. (${n}/${a})`},timeout:()=>s(n)};if(t==="update"){if(!r)throw new Error("`apiKey` is required when waiting for an `update` operation.");return U({...i,func:()=>this.getApiKey({key:e},o),validate:h=>{for(let g of Object.keys(r)){let P=r[g],p=h[g];if(Array.isArray(P)&&Array.isArray(p)){if(P.length!==p.length||P.some((y,w)=>y!==p[w]))return  false}else if(P!==p)return  false}return  true}})}return U({...i,func:()=>this.getApiKey({key:e},o).catch(h=>{if(h.status!==404)throw h}),validate:h=>t==="add"?h!==void 0:h===void 0})},browseObjects({indexName:t,browseParams:e,...r},a){return U({func:s=>this.browse({indexName:t,browseParams:{cursor:s?s.cursor:void 0,hitsPerPage:1e3,...e}},a),validate:s=>s.cursor===void 0,...r})},browseRules({indexName:t,searchRulesParams:e,...r},a){let s={hitsPerPage:1e3,...e};return U({func:o=>this.searchRules({indexName:t,searchRulesParams:{...s,page:o?o.page+1:s.page||0}},a),validate:o=>o.hits.length<s.hitsPerPage,...r})},browseSynonyms({indexName:t,searchSynonymsParams:e,...r},a){let s={page:0,...e,hitsPerPage:1e3};return U({func:o=>{let n=this.searchSynonyms({indexName:t,searchSynonymsParams:{...s,page:s.page}},a);return s.page+=1,n},validate:o=>o.hits.length<s.hitsPerPage,...r})},async chunkedBatch({indexName:t,objects:e,action:r="addObject",waitForTasks:a,batchSize:s=1e3},o){let n=[],i=[],h=e.entries();for(let[g,P]of h)n.push({action:r,body:P}),(n.length===s||g===e.length-1)&&(i.push(await this.batch({indexName:t,batchWriteParams:{requests:n}},o)),n=[]);if(a)for(let g of i)await this.waitForTask({indexName:t,taskID:g.taskID});return i},async saveObjects({indexName:t,objects:e,waitForTasks:r,batchSize:a},s){return await this.chunkedBatch({indexName:t,objects:e,action:"addObject",waitForTasks:r,batchSize:a},s)},async deleteObjects({indexName:t,objectIDs:e,waitForTasks:r,batchSize:a},s){return await this.chunkedBatch({indexName:t,objects:e.map(o=>({objectID:o})),action:"deleteObject",waitForTasks:r,batchSize:a},s)},async partialUpdateObjects({indexName:t,objects:e,createIfNotExists:r,waitForTasks:a,batchSize:s},o){return await this.chunkedBatch({indexName:t,objects:e,action:r?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:s,waitForTasks:a},o)},async replaceAllObjects({indexName:t,objects:e,batchSize:r,scopes:a},s){let o=Math.floor(Math.random()*1e6)+1e5,n=`${t}_tmp_${o}`;a===void 0&&(a=["settings","rules","synonyms"]);try{let i=await this.operationIndex({indexName:t,operationIndexParams:{operation:"copy",destination:n,scope:a}},s),h=await this.chunkedBatch({indexName:n,objects:e,waitForTasks:!0,batchSize:r},s);await this.waitForTask({indexName:n,taskID:i.taskID}),i=await this.operationIndex({indexName:t,operationIndexParams:{operation:"copy",destination:n,scope:a}},s),await this.waitForTask({indexName:n,taskID:i.taskID});let g=await this.operationIndex({indexName:n,operationIndexParams:{operation:"move",destination:t}},s);return await this.waitForTask({indexName:n,taskID:g.taskID}),{copyOperationResponse:i,batchResponses:h,moveOperationResponse:g}}catch(i){throw await this.deleteIndex({indexName:n}),i}},async indexExists({indexName:t}){try{await this.getSettings({indexName:t});}catch(e){if(e instanceof N&&e.status===404)return  false;throw e}return  true},searchForHits(t,e){return this.search(t,e)},searchForFacets(t,e){return this.search(t,e)},addApiKey(t,e){if(!t)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!t.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");let o={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:t};return l.request(o,e)},addOrUpdateObject({indexName:t,objectID:e,body:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");let i={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return l.request(i,a)},appendSource(t,e){if(!t)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!t.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");let o={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:t};return l.request(o,e)},assignUserId({xAlgoliaUserID:t,assignUserIdParams:e},r){if(!t)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!e)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!e.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");let a="/1/clusters/mapping",s={},o={};t!==void 0&&(s["X-Algolia-User-ID"]=t.toString());let n={method:"POST",path:a,queryParameters:o,headers:s,data:e};return l.request(n,r)},batch({indexName:t,batchWriteParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!e)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!e.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");let n={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(n,r)},batchAssignUserIds({xAlgoliaUserID:t,batchAssignUserIdsParams:e},r){if(!t)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!e)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!e.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!e.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");let a="/1/clusters/mapping/batch",s={},o={};t!==void 0&&(s["X-Algolia-User-ID"]=t.toString());let n={method:"POST",path:a,queryParameters:o,headers:s,data:e};return l.request(n,r)},batchDictionaryEntries({dictionaryName:t,batchDictionaryEntriesParams:e},r){if(!t)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!e)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!e.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");let n={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(n,r)},browse({indexName:t,browseParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `browse`.");let n={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:true};return l.request(n,r)},clearObjects({indexName:t},e){if(!t)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");let o={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},clearRules({indexName:t,forwardToReplicas:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `clearRules`.");let a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(t)),s={},o={};e!==void 0&&(o.forwardToReplicas=e.toString());let n={method:"POST",path:a,queryParameters:o,headers:s};return l.request(n,r)},clearSynonyms({indexName:t,forwardToReplicas:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `clearSynonyms`.");let a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(t)),s={},o={};e!==void 0&&(o.forwardToReplicas=e.toString());let n={method:"POST",path:a,queryParameters:o,headers:s};return l.request(n,r)},customDelete({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let n={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(n,r)},customGet({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let n={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(n,r)},customPost({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let i={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},customPut({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let i={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},deleteApiKey({key:t},e){if(!t)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");let o={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},deleteBy({indexName:t,deleteByParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!e)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");let n={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(n,r)},deleteIndex({indexName:t},e){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");let o={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},deleteObject({indexName:t,objectID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");let n={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(n,r)},deleteRule({indexName:t,objectID:e,forwardToReplicas:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");let s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),o={},n={};r!==void 0&&(n.forwardToReplicas=r.toString());let i={method:"DELETE",path:s,queryParameters:n,headers:o};return l.request(i,a)},deleteSource({source:t},e){if(!t)throw new Error("Parameter `source` is required when calling `deleteSource`.");let o={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},deleteSynonym({indexName:t,objectID:e,forwardToReplicas:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");let s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),o={},n={};r!==void 0&&(n.forwardToReplicas=r.toString());let i={method:"DELETE",path:s,queryParameters:n,headers:o};return l.request(i,a)},getApiKey({key:t},e){if(!t)throw new Error("Parameter `key` is required when calling `getApiKey`.");let o={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getAppTask({taskID:t},e){if(!t)throw new Error("Parameter `taskID` is required when calling `getAppTask`.");let o={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getDictionaryLanguages(t){let s={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return l.request(s,t)},getDictionarySettings(t){let s={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return l.request(s,t)},getLogs({offset:t,length:e,indexName:r,type:a}={},s=void 0){let o="/1/logs",n={},i={};t!==void 0&&(i.offset=t.toString()),e!==void 0&&(i.length=e.toString()),r!==void 0&&(i.indexName=r.toString()),a!==void 0&&(i.type=a.toString());let h={method:"GET",path:o,queryParameters:i,headers:n};return l.request(h,s)},getObject({indexName:t,objectID:e,attributesToRetrieve:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getObject`.");let s="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),o={},n={};r!==void 0&&(n.attributesToRetrieve=r.toString());let i={method:"GET",path:s,queryParameters:n,headers:o};return l.request(i,a)},getObjects(t,e){if(!t)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!t.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");let o={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return l.request(o,e)},getRule({indexName:t,objectID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getRule`.");let n={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(n,r)},getSettings({indexName:t},e){if(!t)throw new Error("Parameter `indexName` is required when calling `getSettings`.");let o={method:"GET",path:"/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getSources(t){let s={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return l.request(s,t)},getSynonym({indexName:t,objectID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");let n={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(n,r)},getTask({indexName:t,taskID:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let n={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(t)).replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(n,r)},getTopUserIds(t){let s={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return l.request(s,t)},getUserId({userID:t},e){if(!t)throw new Error("Parameter `userID` is required when calling `getUserId`.");let o={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},hasPendingMappings({getClusters:t}={},e=void 0){let r="/1/clusters/mapping/pending",a={},s={};t!==void 0&&(s.getClusters=t.toString());let o={method:"GET",path:r,queryParameters:s,headers:a};return l.request(o,e)},listApiKeys(t){let s={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return l.request(s,t)},listClusters(t){let s={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return l.request(s,t)},listIndices({page:t,hitsPerPage:e}={},r=void 0){let a="/1/indexes",s={},o={};t!==void 0&&(o.page=t.toString()),e!==void 0&&(o.hitsPerPage=e.toString());let n={method:"GET",path:a,queryParameters:o,headers:s};return l.request(n,r)},listUserIds({page:t,hitsPerPage:e}={},r=void 0){let a="/1/clusters/mapping",s={},o={};t!==void 0&&(o.page=t.toString()),e!==void 0&&(o.hitsPerPage=e.toString());let n={method:"GET",path:a,queryParameters:o,headers:s};return l.request(n,r)},multipleBatch(t,e){if(!t)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!t.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");let o={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:t};return l.request(o,e)},operationIndex({indexName:t,operationIndexParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!e)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!e.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!e.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");let n={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(n,r)},partialUpdateObject({indexName:t,objectID:e,attributesToUpdate:r,createIfNotExists:a},s){if(!t)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!e)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");let o="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),n={},i={};a!==void 0&&(i.createIfNotExists=a.toString());let h={method:"POST",path:o,queryParameters:i,headers:n,data:r};return l.request(h,s)},removeUserId({userID:t},e){if(!t)throw new Error("Parameter `userID` is required when calling `removeUserId`.");let o={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},replaceSources({source:t},e){if(!t)throw new Error("Parameter `source` is required when calling `replaceSources`.");let o={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:t};return l.request(o,e)},restoreApiKey({key:t},e){if(!t)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");let o={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},saveObject({indexName:t,body:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!e)throw new Error("Parameter `body` is required when calling `saveObject`.");let n={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(n,r)},saveRule({indexName:t,objectID:e,rule:r,forwardToReplicas:a},s){if(!t)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!e)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!r.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");if(!r.consequence)throw new Error("Parameter `rule.consequence` is required when calling `saveRule`.");let o="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),n={},i={};a!==void 0&&(i.forwardToReplicas=a.toString());let h={method:"PUT",path:o,queryParameters:i,headers:n,data:r};return l.request(h,s)},saveRules({indexName:t,rules:e,forwardToReplicas:r,clearExistingRules:a},s){if(!t)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!e)throw new Error("Parameter `rules` is required when calling `saveRules`.");let o="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(t)),n={},i={};r!==void 0&&(i.forwardToReplicas=r.toString()),a!==void 0&&(i.clearExistingRules=a.toString());let h={method:"POST",path:o,queryParameters:i,headers:n,data:e};return l.request(h,s)},saveSynonym({indexName:t,objectID:e,synonymHit:r,forwardToReplicas:a},s){if(!t)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!e)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!r.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!r.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");let o="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{objectID}",encodeURIComponent(e)),n={},i={};a!==void 0&&(i.forwardToReplicas=a.toString());let h={method:"PUT",path:o,queryParameters:i,headers:n,data:r};return l.request(h,s)},saveSynonyms({indexName:t,synonymHit:e,forwardToReplicas:r,replaceExistingSynonyms:a},s){if(!t)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!e)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");let o="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(t)),n={},i={};r!==void 0&&(i.forwardToReplicas=r.toString()),a!==void 0&&(i.replaceExistingSynonyms=a.toString());let h={method:"POST",path:o,queryParameters:i,headers:n,data:e};return l.request(h,s)},search(t,e){if(t&&Array.isArray(t)&&(t={requests:t.map(({params:i,...h})=>h.type==="facet"?{...h,...i,type:"facet"}:{...h,...i,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!t)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!t.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");let o={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return l.request(o,e)},searchDictionaryEntries({dictionaryName:t,searchDictionaryEntriesParams:e},r){if(!t)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!e)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!e.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");let n={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e,useReadTransporter:true,cacheable:true};return l.request(n,r)},searchForFacetValues({indexName:t,facetName:e,searchForFacetValuesRequest:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!e)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");let i={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(t)).replace("{facetName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:true,cacheable:true};return l.request(i,a)},searchRules({indexName:t,searchRulesParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `searchRules`.");let n={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:true,cacheable:true};return l.request(n,r)},searchSingleIndex({indexName:t,searchParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");let n={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:true,cacheable:true};return l.request(n,r)},searchSynonyms({indexName:t,searchSynonymsParams:e},r){if(!t)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");let n={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e||{},useReadTransporter:true,cacheable:true};return l.request(n,r)},searchUserIds(t,e){if(!t)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!t.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");let o={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return l.request(o,e)},setDictionarySettings(t,e){if(!t)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!t.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");let o={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:t};return l.request(o,e)},setSettings({indexName:t,indexSettings:e,forwardToReplicas:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!e)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");let s="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(t)),o={},n={};r!==void 0&&(n.forwardToReplicas=r.toString());let i={method:"PUT",path:s,queryParameters:n,headers:o,data:e};return l.request(i,a)},updateApiKey({key:t,apiKey:e},r){if(!t)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!e)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!e.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");let n={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(t)),queryParameters:{},headers:{},data:e};return l.request(n,r)}}}function le(c,u,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");return Ve({appId:c,apiKey:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${H}-${c}`}),E()]}),...d})}var qe="1.25.0",me=["eu","us"];function _e(c){return [{url:"data.{region}.algolia.com".replace("{region}",c),accept:"readWrite",protocol:"https"}]}function Or(c){return c.type==="onDemand"}function Nr(c){return c.type==="schedule"}function Gr(c){return c.type==="subscription"}function Me({appId:c,apiKey:u,authMode:d,algoliaAgents:m,region:q,...f}){let l=R(c,u,d),t=b({hosts:_e(q),...f,algoliaAgent:C({algoliaAgents:m,client:"Ingestion",version:qe}),baseHeaders:{"content-type":"text/plain",...l.headers(),...f.baseHeaders},baseQueryParameters:{...l.queryParameters(),...f.baseQueryParameters}});return {transporter:t,appId:c,apiKey:u,clearCache(){return Promise.all([t.requestsCache.clear(),t.responsesCache.clear()]).then(()=>{})},get _ua(){return t.algoliaAgent.value},addAlgoliaAgent(e,r){t.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?t.baseHeaders["x-algolia-api-key"]=e:t.baseQueryParameters["x-algolia-api-key"]=e;},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");let n={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return t.request(n,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");let n={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return t.request(n,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");let n={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return t.request(n,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");let n={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return t.request(n,r)},createTaskV1(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");let n={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return t.request(n,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let n={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return t.request(n,r)},customDelete({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let i={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customGet({path:e,parameters:r},a){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let i={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return t.request(i,a)},customPost({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},customPut({path:e,parameters:r,body:a},s){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:a||{}};return t.request(h,s)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let n={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let n={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let n={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let n={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let n={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let n={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let n={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let n={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let n={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let n={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let n={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let n={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getEvent({runID:e,eventID:r},a){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");let i={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return t.request(i,a)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let n={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let n={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let n={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let n={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let n={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},listAuthentications({itemsPerPage:e,page:r,type:a,platform:s,sort:o,order:n}={},i=void 0){let h="/1/authentications",g={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),r!==void 0&&(P.page=r.toString()),a!==void 0&&(P.type=a.toString()),s!==void 0&&(P.platform=s.toString()),o!==void 0&&(P.sort=o.toString()),n!==void 0&&(P.order=n.toString());let p={method:"GET",path:h,queryParameters:P,headers:g};return t.request(p,i)},listDestinations({itemsPerPage:e,page:r,type:a,authenticationID:s,transformationID:o,sort:n,order:i}={},h=void 0){let g="/1/destinations",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),a!==void 0&&(p.type=a.toString()),s!==void 0&&(p.authenticationID=s.toString()),o!==void 0&&(p.transformationID=o.toString()),n!==void 0&&(p.sort=n.toString()),i!==void 0&&(p.order=i.toString());let y={method:"GET",path:g,queryParameters:p,headers:P};return t.request(y,h)},listEvents({runID:e,itemsPerPage:r,page:a,status:s,type:o,sort:n,order:i,startDate:h,endDate:g},P){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let p="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),y={},w={};r!==void 0&&(w.itemsPerPage=r.toString()),a!==void 0&&(w.page=a.toString()),s!==void 0&&(w.status=s.toString()),o!==void 0&&(w.type=o.toString()),n!==void 0&&(w.sort=n.toString()),i!==void 0&&(w.order=i.toString()),h!==void 0&&(w.startDate=h.toString()),g!==void 0&&(w.endDate=g.toString());let S={method:"GET",path:p,queryParameters:w,headers:y};return t.request(S,P)},listRuns({itemsPerPage:e,page:r,status:a,type:s,taskID:o,sort:n,order:i,startDate:h,endDate:g}={},P=void 0){let p="/1/runs",y={},w={};e!==void 0&&(w.itemsPerPage=e.toString()),r!==void 0&&(w.page=r.toString()),a!==void 0&&(w.status=a.toString()),s!==void 0&&(w.type=s.toString()),o!==void 0&&(w.taskID=o.toString()),n!==void 0&&(w.sort=n.toString()),i!==void 0&&(w.order=i.toString()),h!==void 0&&(w.startDate=h.toString()),g!==void 0&&(w.endDate=g.toString());let S={method:"GET",path:p,queryParameters:w,headers:y};return t.request(S,P)},listSources({itemsPerPage:e,page:r,type:a,authenticationID:s,sort:o,order:n}={},i=void 0){let h="/1/sources",g={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),r!==void 0&&(P.page=r.toString()),a!==void 0&&(P.type=a.toString()),s!==void 0&&(P.authenticationID=s.toString()),o!==void 0&&(P.sort=o.toString()),n!==void 0&&(P.order=n.toString());let p={method:"GET",path:h,queryParameters:P,headers:g};return t.request(p,i)},listTasks({itemsPerPage:e,page:r,action:a,enabled:s,sourceID:o,sourceType:n,destinationID:i,triggerType:h,withEmailNotifications:g,sort:P,order:p}={},y=void 0){let w="/2/tasks",S={},D={};e!==void 0&&(D.itemsPerPage=e.toString()),r!==void 0&&(D.page=r.toString()),a!==void 0&&(D.action=a.toString()),s!==void 0&&(D.enabled=s.toString()),o!==void 0&&(D.sourceID=o.toString()),n!==void 0&&(D.sourceType=n.toString()),i!==void 0&&(D.destinationID=i.toString()),h!==void 0&&(D.triggerType=h.toString()),g!==void 0&&(D.withEmailNotifications=g.toString()),P!==void 0&&(D.sort=P.toString()),p!==void 0&&(D.order=p.toString());let j={method:"GET",path:w,queryParameters:D,headers:S};return t.request(j,y)},listTasksV1({itemsPerPage:e,page:r,action:a,enabled:s,sourceID:o,destinationID:n,triggerType:i,sort:h,order:g}={},P=void 0){let p="/1/tasks",y={},w={};e!==void 0&&(w.itemsPerPage=e.toString()),r!==void 0&&(w.page=r.toString()),a!==void 0&&(w.action=a.toString()),s!==void 0&&(w.enabled=s.toString()),o!==void 0&&(w.sourceID=o.toString()),n!==void 0&&(w.destinationID=n.toString()),i!==void 0&&(w.triggerType=i.toString()),h!==void 0&&(w.sort=h.toString()),g!==void 0&&(w.order=g.toString());let S={method:"GET",path:p,queryParameters:w,headers:y};return t.request(S,P)},listTransformations({itemsPerPage:e,page:r,sort:a,order:s}={},o=void 0){let n="/1/transformations",i={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),a!==void 0&&(h.sort=a.toString()),s!==void 0&&(h.order=s.toString());let g={method:"GET",path:n,queryParameters:h,headers:i};return t.request(g,o)},pushTask({taskID:e,pushTaskPayload:r,watch:a},s){if(!e)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let o="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),n={},i={};a!==void 0&&(i.watch=a.toString());let h={method:"POST",path:o,queryParameters:i,headers:n,data:r};return s={timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},t.request(h,s)},runSource({sourceID:e,runSourcePayload:r},a){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let i={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return t.request(i,a)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let n={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},runTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let n={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t.request(n,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");let n={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return t.request(n,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");let n={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return t.request(n,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");let n={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return t.request(n,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");let n={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return t.request(n,r)},searchTasksV1(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");let n={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return t.request(n,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");let n={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return t.request(n,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let n={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},t.request(n,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let n={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return t.request(n,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},a){if(!e)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!r.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let i={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateAuthentication({authenticationID:e,authenticationUpdate:r},a){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let i={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateDestination({destinationID:e,destinationUpdate:r},a){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let i={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateSource({sourceID:e,sourceUpdate:r},a){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let i={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateTask({taskID:e,taskUpdate:r},a){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");let i={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateTaskV1({taskID:e,taskUpdate:r},a){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let i={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},updateTransformation({transformationID:e,transformationCreate:r},a){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let i={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t.request(i,a)},validateSource(e,r=void 0){let n={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},t.request(n,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},a){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let i={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return a={timeouts:{connect:18e4,read:18e4,write:18e4,...a?.timeouts}},t.request(i,a)}}}function ge(c,u,d,m){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!me.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${me.join(", ")}`);return Me({appId:c,apiKey:u,region:d,timeouts:{connect:25e3,read:25e3,write:25e3},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${qe}-${c}`}),E()]}),...m})}var Pe="1.25.0";function Ke(){return [{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function Je({appId:c,apiKey:u,authMode:d,algoliaAgents:m,...q}){let f=R(c,u,d),l=b({hosts:Ke(),...q,algoliaAgent:C({algoliaAgents:m,client:"Monitoring",version:Pe}),baseHeaders:{"content-type":"text/plain",...f.headers(),...q.baseHeaders},baseQueryParameters:{...f.queryParameters(),...q.baseQueryParameters}});return {transporter:l,appId:c,apiKey:u,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(t,e){l.algoliaAgent.add({segment:t,version:e});},setClientApiKey({apiKey:t}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=t:l.baseQueryParameters["x-algolia-api-key"]=t;},customDelete({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let n={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(n,r)},customGet({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let n={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(n,r)},customPost({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let i={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},customPut({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let i={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},getClusterIncidents({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");let o={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getClusterStatus({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");let o={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getIncidents(t){let s={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return l.request(s,t)},getIndexingTime({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");let o={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getLatency({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getLatency`.");let o={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getMetrics({metric:t,period:e},r){if(!t)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!e)throw new Error("Parameter `period` is required when calling `getMetrics`.");let n={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(t)).replace("{period}",encodeURIComponent(e)),queryParameters:{},headers:{}};return l.request(n,r)},getReachability({clusters:t},e){if(!t)throw new Error("Parameter `clusters` is required when calling `getReachability`.");let o={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(t)),queryParameters:{},headers:{}};return l.request(o,e)},getServers(t){let s={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return l.request(s,t)},getStatus(t){let s={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return l.request(s,t)}}}function pe(c,u,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");return Je({appId:c,apiKey:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${Pe}-${c}`}),E()]}),...d})}var we="5.25.0";function Xe(c){return [{url:`${c}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${c}.algolia.net`,accept:"write",protocol:"https"}].concat(G([{url:`${c}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${c}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function Ye({appId:c,apiKey:u,authMode:d,algoliaAgents:m,...q}){let f=R(c,u,d),l=b({hosts:Xe(c),...q,algoliaAgent:C({algoliaAgents:m,client:"Recommend",version:we}),baseHeaders:{"content-type":"text/plain",...f.headers(),...q.baseHeaders},baseQueryParameters:{...f.queryParameters(),...q.baseQueryParameters}});return {transporter:l,appId:c,apiKey:u,clearCache(){return Promise.all([l.requestsCache.clear(),l.responsesCache.clear()]).then(()=>{})},get _ua(){return l.algoliaAgent.value},addAlgoliaAgent(t,e){l.algoliaAgent.add({segment:t,version:e});},setClientApiKey({apiKey:t}){!d||d==="WithinHeaders"?l.baseHeaders["x-algolia-api-key"]=t:l.baseQueryParameters["x-algolia-api-key"]=t;},batchRecommendRules({indexName:t,model:e,recommendRule:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!e)throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");let i={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return l.request(i,a)},customDelete({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customDelete`.");let n={method:"DELETE",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(n,r)},customGet({path:t,parameters:e},r){if(!t)throw new Error("Parameter `path` is required when calling `customGet`.");let n={method:"GET",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{}};return l.request(n,r)},customPost({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPost`.");let i={method:"POST",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},customPut({path:t,parameters:e,body:r},a){if(!t)throw new Error("Parameter `path` is required when calling `customPut`.");let i={method:"PUT",path:"/{path}".replace("{path}",t),queryParameters:e||{},headers:{},data:r||{}};return l.request(i,a)},deleteRecommendRule({indexName:t,model:e,objectID:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!e)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");let i={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(i,a)},getRecommendRule({indexName:t,model:e,objectID:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!e)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");let i={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(i,a)},getRecommendStatus({indexName:t,model:e,taskID:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!e)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");let i={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return l.request(i,a)},getRecommendations(t,e){if(t&&Array.isArray(t)&&(t={requests:t}),!t)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!t.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");let o={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:t,useReadTransporter:true,cacheable:true};return l.request(o,e)},searchRecommendRules({indexName:t,model:e,searchRecommendRulesParams:r},a){if(!t)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!e)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");let i={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(t)).replace("{model}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:true,cacheable:true};return l.request(i,a)}}}function fe(c,u,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");return Ye({appId:c,apiKey:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:A(),requester:v(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:E(),requestsCache:E({serializable:false}),hostsCache:T({caches:[I({key:`${we}-${c}`}),E()]}),...d})}function lt(c,u,d){if(!c||typeof c!="string")throw new Error("`appId` is missing.");if(!u||typeof u!="string")throw new Error("`apiKey` is missing.");let m=le(c,u,d);return {...m,get _ua(){return m.transporter.algoliaAgent.value},initAbtesting:q=>Z(q.appId||c,q.apiKey||u,q.region,q.options),initAnalytics:q=>te(q.appId||c,q.apiKey||u,q.region,q.options),initIngestion:q=>ge(q.appId||c,q.apiKey||u,q.region,q.options),initInsights:q=>ne(q.appId||c,q.apiKey||u,q.region,q.options),initMonitoring:(q={})=>pe(q.appId||c,q.apiKey||u,q.options),initPersonalization:q=>ce(q.appId||c,q.apiKey||u,q.region,q.options),initQuerySuggestions:q=>de(q.appId||c,q.apiKey||u,q.region,q.options),initRecommend:(q={})=>fe(q.appId||c,q.apiKey||u,q.options)}}

	exports.abtestingClient = Z;
	exports.algoliasearch = lt;
	exports.analyticsClient = te;
	exports.apiClientVersion = H;
	exports.ingestionClient = ge;
	exports.insightsClient = ne;
	exports.isOnDemandTrigger = Or;
	exports.isScheduleTrigger = Nr;
	exports.isSubscriptionTrigger = Gr;
	exports.monitoringClient = pe;
	exports.personalizationClient = ce;
	exports.querySuggestionsClient = de;
	exports.recommendClient = fe;
	exports.searchClient = le;

}));
