PageSourceSearch

https://employmenthero.com/wp-content/plugins/employmentherocom202…/view.js?ver=f485173f610c88482fc5

js employmenthero.com collected 2026-09-24 08:35:26 UTC 124,871 bytes, 1 lines download raw bytes

1import{getConfig as e,getContext as r,store as t}from"@wordpress/interactivity";var a={d:(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};a.r(n),a.d(n,{abtestingV3Client:()=>F,apiClientVersion:()=>j});var s={};a.r(s),a.d(s,{abtestingClient:()=>B,apiClientVersion:()=>G});var i={};a.r(i),a.d(i,{analyticsClient:()=>H,apiClientVersion:()=>$});var o={};a.r(o),a.d(o,{apiClientVersion:()=>z,insightsClient:()=>Q});var d={};a.r(d),a.d(d,{apiClientVersion:()=>V,personalizationClient:()=>J});var c={};a.r(c),a.d(c,{apiClientVersion:()=>X,querySuggestionsClient:()=>Y});var l={};a.r(l),a.d(l,{apiClientVersion:()=>ee,searchClient:()=>re});var u={};a.r(u),a.d(u,{apiClientVersion:()=>te,ingestionClient:()=>oe,isOnDemandTrigger:()=>ne,isScheduleTrigger:()=>se,isSubscriptionTrigger:()=>ie});var h={};a.r(h),a.d(h,{apiClientVersion:()=>de,monitoringClient:()=>ce});var m={};a.r(m),a.d(m,{apiClientVersion:()=>le,recommendClient:()=>ue});const p={wrapperSel:".learn-filter-panel__tabs-wrapper",tabsSel:".learn-filter-panel__tabs",arrowLeftSel:".learn-filter-panel__tabs-arrow--left",arrowRightSel:".learn-filter-panel__tabs-arrow--right",scrollStep:150};!function(e={}){const r={...p,...e};document.querySelectorAll(r.wrapperSel).forEach(e=>function(e,r){const t=e.querySelector(r.tabsSel),a=e.querySelector(r.arrowLeftSel),n=e.querySelector(r.arrowRightSel);if(!t||!a||!n)return;const s=()=>{const{scrollLeft:e,scrollWidth:r,clientWidth:s}=t;a.hidden=e<=0,n.hidden=Math.ceil(e+s)>=r};a.addEventListener("click",()=>t.scrollBy({left:-r.scrollStep,behavior:"smooth"})),n.addEventListener("click",()=>t.scrollBy({left:r.scrollStep,behavior:"smooth"})),t.addEventListener("scroll",s,{passive:!0}),"undefined"!=typeof ResizeObserver?new ResizeObserver(s).observe(t):window.addEventListener("resize",s),requestAnimationFrame(()=>{s(),setTimeout(s,300)})}(e,r))}();const g=e=>{e.hasExitedTabMode=!0,e.activeTabId&&(e.activeTabId="",e.pendingFilters={learn_topic:[],resource_type:[],industry:[],company_size:[],audience:[],post_features:[]})};function w(){return{send:function(e){return new Promise(r=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(r=>t.setRequestHeader(r,e.headers[r]));let a,n=(e,a)=>setTimeout(()=>{t.abort(),r({status:0,content:a,isTimedOut:!0})},e),s=n(e.connectTimeout,"Connection timeout");t.onreadystatechange=()=>{t.readyState>t.OPENED&&void 0===a&&(clearTimeout(s),a=n(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{0===t.status&&(clearTimeout(s),clearTimeout(a),r({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(s),clearTimeout(a),r({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)})}}}function P(e){let r;const t=`algolia-client-js-${e.key}`;function a(){return void 0===r&&(r=e.localStorage||window.localStorage),r}function n(){return JSON.parse(a().getItem(t)||"{}")}function s(e){a().setItem(t,JSON.stringify(e))}return{get:(r,t,a={miss:()=>Promise.resolve()})=>Promise.resolve().then(()=>(function(){const r=e.timeToLive?1e3*e.timeToLive:null,t=n(),a=Object.fromEntries(Object.entries(t).filter(([,e])=>void 0!==e.timestamp));s(a),r&&s(Object.fromEntries(Object.entries(a).filter(([,e])=>{const t=(new Date).getTime();return!(e.timestamp+r<t)})))}(),n()[JSON.stringify(r)])).then(e=>Promise.all([e?e.value:t(),void 0!==e])).then(([e,r])=>Promise.all([e,r||a.miss(e)])).then(([e])=>e),set:(e,r)=>Promise.resolve().then(()=>{const s=n();return s[JSON.stringify(e)]={timestamp:(new Date).getTime(),value:r},a().setItem(t,JSON.stringify(s)),r}),delete:e=>Promise.resolve().then(()=>{const r=n();delete r[JSON.stringify(e)],a().setItem(t,JSON.stringify(r))}),clear:()=>Promise.resolve().then(()=>{a().removeItem(t)})}}function y(e){const r=[...e.caches],t=r.shift();return void 0===t?{get:(e,r,t={miss:()=>Promise.resolve()})=>r().then(e=>Promise.all([e,t.miss(e)])).then(([e])=>e),set:(e,r)=>Promise.resolve(r),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>t.get(e,a,n).catch(()=>y({caches:r}).get(e,a,n)),set:(e,a)=>t.set(e,a).catch(()=>y({caches:r}).set(e,a)),delete:e=>t.delete(e).catch(()=>y({caches:r}).delete(e)),clear:()=>
1t.clear().catch(()=>y({caches:r}).clear())}}function f(e={serializable:!0}){let r={};return{get(t,a,n={miss:()=>Promise.resolve()}){const s=JSON.stringify(t);if(s in r)return Promise.resolve(e.serializable?JSON.parse(r[s]):r[s]);const i=a();return i.then(e=>n.miss(e)).then(()=>i)},set:(t,a)=>(r[JSON.stringify(t)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete r[JSON.stringify(e)],Promise.resolve()),clear:()=>(r={},Promise.resolve())}}function q(e,r,t="WithinHeaders"){const a={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===t?a:{},queryParameters:()=>"WithinQueryParameters"===t?a:{}}}function E({func:e,validate:r,aggregator:t,error:a,timeout:n=()=>0}){const s=i=>new Promise((o,d)=>{e(i).then(async e=>(t&&await t(e),await r(e)?o(e):a&&await a.validate(e)?d(new Error(await a.message(e))):setTimeout(()=>{s(e).then(o).catch(d)},await n()))).catch(e=>{d(e)})});return s()}function I({algoliaAgents:e,client:r,version:t}){const a=function(e){const r={value:`Algolia for JavaScript (${e})`,add(e){const t=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===r.value.indexOf(t)&&(r.value=`${r.value}${t}`),r}};return r}(t).add({segment:r,version:t});return e.forEach(e=>a.add(e)),a}function v(){return{debug:(e,r)=>Promise.resolve(),info:(e,r)=>Promise.resolve(),error:(e,r)=>Promise.resolve()}}var T=12e4;function b(e,r="up"){const t=Date.now();return{...e,status:r,lastUpdate:t,isUp:function(){return"up"===r||Date.now()-t>T},isTimedOut:function(){return"timed out"===r&&Date.now()-t<=T}}}var S=class extends Error{name="AlgoliaError";constructor(e,r){super(e),r&&(this.name=r)}},D=class extends S{stackTrace;constructor(e,r,t){super(e,t),this.stackTrace=r}},x=class extends D{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError")}},k=class extends D{status;constructor(e,r,t,a="ApiError"){super(e,t,a),this.status=r}},R=class extends S{response;constructor(e,r){super(e,"DeserializationError"),this.response=r}},C=class extends k{error;constructor(e,r,t,a){super(e,r,a,"DetailedApiError"),this.error=t}};function A(e){const r=e;for(let t=e.length-1;t>0;t--){const a=Math.floor(Math.random()*(t+1)),n=e[t];r[t]=e[a],r[a]=n}return r}function N(e,r,t){const a=(n=t,Object.keys(n).filter(e=>void 0!==n[e]).sort().map(e=>`${e}=${encodeURIComponent("[object Array]"===Object.prototype.toString.call(n[e])?n[e].join(","):n[e]).replace(/\+/g,"%20")}`).join("&"));var n;let s=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${"/"===r.charAt(0)?r.substring(1):r}`;return a.length&&(s+=`?${a}`),s}function U(e){const r=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...r}}}}function O({hosts:e,hostsCache:r,baseHeaders:t,logger:a,baseQueryParameters:n,algoliaAgent:s,timeouts:i,requester:o,requestsCache:d,responsesCache:c}){async function l(d,c,l=!0){const u=[],h=function(e,r){if("GET"===e.method||void 0===e.data&&void 0===r.data)return;const t=Array.isArray(e.data)?e.data:{...e.data,...r.data};return JSON.stringify(t)}(d,c),m=function(e,r,t){const a={Accept:"application/json",...e,...r,...t},n={};return Object.keys(a).forEach(e=>{const r=a[e];n[e.toLowerCase()]=r}),n}(t,d.headers,c.headers),p="GET"===d.method?{...d.data,...c.data}:{},g={...n,...d.queryParameters,...p};if(s.value&&(g["x-algolia-agent"]=s.value),c&&c.queryParameters)for(const e of Object.keys(c.queryParameters))c.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(c.queryParameters[e])?g[e]=c.queryParameters[e].toString():g[e]=c.queryParameters[e];let w=0;const P=async(e,t)=>{const n=e.pop();if(void 0===n)throw new x(function(e){return e.map(e=>U(e))}(u));const s={...i,...c.timeouts},p={data:h,headers:m,method:d.method,url:N(n,d.path,g),connectTimeout:t(w,s.connect),responseTimeout:t(w,l?s.read:s.write)},y=r=>{const t={request:p,response:r,host:n,triesLeft:e.length};return u.push(t),t},f=await o.send(p);if(function({isTimedOut:e,status:r}){return e||function({isTimedOut:e,status:r}){return!e&&0===~~r}({isTimedOut:e,status:r})||2!=~~(r/100)&&4!=~~(r/100)}(f)){const s=y(f);return f.isTimedOut&&w++,a.info("Retryable failure",U(s)),await r.set(n,b(n,f.isTimedOut?"timed out":"down")),P(e,t)}if(function({status:e}){return 2==~~(e/100)}(f))return function(e){try{return JSON.parse(e.content)}catch(r){throw new R(r.message,e)}}(f);throw y(f),function({content:e,status:r},t){try{const a=JSON.parse(e);return"error"in a?new C(a.message,r,a.error,t):new k(a.message,r,t)}catch{}return new k(e,r,t)}(f,u)},y=e.filter(e=>"readWrite"===e.accept||(l?"read"===e.accept:"write"===e.accept)),f=await async function(e){const t=await Promise.all(e.map(e=>r.get(e,()=>Promise.resolve(b(e))))),a=t.filter(e=>e.isUp()),n=t.filter(e=>e.isTimedOut()),s=[...a,...n];return{hosts:s.length>0?s:e,getTimeout:(e,r)=>(0===n.length&&0===e?1:n.length+3+e)*r}}(y);return P([...f.hosts].reverse(),f.getTimeout)}return{hostsCache:r,requester:o,timeouts:i,logger:a,algoliaAgent:s,baseHeaders:t,baseQueryParameters:n,hosts:e,request:function(e,r={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return l(e,r,a);const s=()=>l(e,r);if(!0!==(r.cacheable||e.cacheable))return s();const i={request:e,requestOptions:r,transporter:{queryParameters:n,headers:t}};return c.get(i,()=>d.get(i,()=>d.set(i,s()).then(e=>Promise.all([d.delete(i),e]),e=>Promise.all([d.delete(i),Promise.reject(e)])).then(([e,r])=>r)),{miss:e=>c.set(i,e)})},requestsCache:d,responsesCache:c}}var j="1.9.0",_=["de","us"];function F(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(t&&("string"!=typeof t||!_.includes(t)))throw new Error(`\`region\` must be one of the following: ${_.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:d?"analytics.{region}.algolia.com".replace("{region}",d):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"AbtestingV3",version:j}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["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.metrics)throw new Error("Parameter `addABTestsRequest.metrics` is required when calling `addABTests`.");if(!e.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const t={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:e};return o.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},deleteABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const t={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,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`.");const t={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:e};return o.request(t,r)},getABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");const t={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getTimeseries({id:e,startDate:r,endDate:t,metric:a},n){if(!e)throw new Error("Parameter `id` is required when calling `getTimeseries`.");const s="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(e)),i={};void 0!==r&&(i.startDate=r.toString()),void 0!==t&&(i.endDate=t.toString()),void 0!==a&&(i.metric=a.toString());const d={method:"GET",path:s,queryParameters:i,headers:{}};return o.request(d,n)},listABTests({offset:e,limit:r,indexPrefix:t,indexSuffix:a,direction:n}={},s=void 0){const i={};void 0!==e&&(i.offset=e.toString()),void 0!==r&&(i.limit=r.toString()),void 0!==t&&(i.indexPrefix=t.toString()),void 0!==a&&(i.indexSuffix=a.toString()),void 0!==n&&(i.direction=n.toString());const d={method:"GET",path:"/3/abtests",queryParameters:i,headers:{}};return o.request(d,s)},stopABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const t={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${j}-${e}`}),f()]}),...a}
1)}var G="5.43.0",K=["de","us"];function B(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(t&&("string"!=typeof t||!K.includes(t)))throw new Error(`\`region\` must be one of the following: ${K.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:d?"analytics.{region}.algolia.com".replace("{region}",d):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"Abtesting",version:G}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["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`.");const t={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:e};return o.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},deleteABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const t={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,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`.");const t={method:"POST",path:"/2/abtests/estimate",queryParameters:{},headers:{},data:e};return o.request(t,r)},getABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `getABTest`.");const t={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},listABTests({offset:e,limit:r,indexPrefix:t,indexSuffix:a}={},n=void 0){const s={};void 0!==e&&(s.offset=e.toString()),void 0!==r&&(s.limit=r.toString()),void 0!==t&&(s.indexPrefix=t.toString()),void 0!==a&&(s.indexSuffix=a.toString());const i={method:"GET",path:"/2/abtests",queryParameters:s,headers:{}};return o.request(i,n)},stopABTest({id:e},r){if(!e)throw new Error("Parameter `id` is required when calling `stopABTest`.");const t={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${G}-${e}`}),f()]}),...a}
1)}var $="5.43.0",L=["de","us"];function H(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(t&&("string"!=typeof t||!L.includes(t)))throw new Error(`\`region\` must be one of the following: ${L.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:d?"analytics.{region}.algolia.com".replace("{region}",d):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"Analytics",version:$}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},getAddToCartRate({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/conversions/addToCartRate",queryParameters:s,headers:{}};return o.request(i,n)},getAverageClickPosition({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/clicks/averageClickPosition",queryParameters:s,headers:{}};return o.request(i,n)},getClickPositions({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/clicks/positions",queryParameters:s,headers:{}};return o.request(i,n)},getClickThroughRate({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/clicks/clickThroughRate",queryParameters:s,headers:{}};return o.request(i,n)},getConversionRate({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/conversions/conversionRate",queryParameters:s,headers:{}};return o.request(i,n)},getNoClickRate({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/searches/noClickRate",queryParameters:s,headers:{}};return o.request(i,n)},getNoResultsRate({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/searches/noResultRate",queryParameters:s,headers:{}};return o.request(i,n)},getPurchaseRate({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/conversions/purchaseRate",queryParameters:s,headers:{}};return o.request(i,n)},getRevenue({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/conversions/revenue",queryParameters:s,headers:{}};return o.request(i,n)},getSearchesCount({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/searches/count",queryParameters:s,headers:{}};return o.request(i,n)},getSearchesNoClicks({index:e,startDate:r,endDate:t,limit:a,offset:n,tags:s},i){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==r&&(d.startDate=r.toString()),void 0!==t&&(d.endDate=t.toString()),void 0!==a&&(d.limit=a.toString()),void 0!==n&&(d.offset=n.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/searches/noClicks",queryParameters:d,headers:{}};return o.request(c,i)},getSearchesNoResults({index:e,startDate:r,endDate:t,limit:a,offset:n,tags:s},i){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==r&&(d.startDate=r.toString()),void 0!==t&&(d.endDate=t.toString()),void 0!==a&&(d.limit=a.toString()),void 0!==n&&(d.offset=n.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/searches/noResults",queryParameters:d,headers:{}};return o.request(c,i)},getStatus({index:e},r){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");const t={};void 0!==e&&(t.index=e.toString());const a={method:"GET",path:"/2/status",queryParameters:t,headers:{}};return o.request(a,r)},getTopCountries({index:e,startDate:r,endDate:t,limit:a,offset:n,tags:s},i){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");const d={};void 0!==e&&(d.index=e.toString()),void 0!==r&&(d.startDate=r.toString()),void 0!==t&&(d.endDate=t.toString()),void 0!==a&&(d.limit=a.toString()),void 0!==n&&(d.offset=n.toString()),void 0!==s&&(d.tags=s.toString());const c={method:"GET",path:"/2/countries",queryParameters:d,headers:{}};return o.request(c,i)},getTopFilterAttributes({index:e,search:r,startDate:t,endDate:a,limit:n,offset:s,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");const c={};void 0!==e&&(c.index=e.toString()),void 0!==r&&(c.search=r.toString()),void 0!==t&&(c.startDate=t.toString()),void 0!==a&&(c.endDate=a.toString()),void 0!==n&&(c.limit=n.toString()),void 0!==s&&(c.offset=s.toString()),void 0!==i&&(c.tags=i.toString());const l={method:"GET",path:"/2/filters",queryParameters:c,headers:{}};return o.request(l,d)},getTopFilterForAttribute({attribute:e,index:r,search:t,startDate:a,endDate:n,limit:s,offset:i,tags:d},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!r)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");const l="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),u={};void 0!==r&&(u.index=r.toString()),void 0!==t&&(u.search=t.toString()),void 0!==a&&(u.startDate=a.toString()),void 0!==n&&(u.endDate=n.toString()),void 0!==s&&(u.limit=s.toString()),void 0!==i&&(u.offset=i.toString()),void 0!==d&&(u.tags=d.toString());const h={method:"GET",path:l,queryParameters:u,headers:{}};return o.request(h,c)},getTopFiltersNoResults({index:e,search:r,startDate:t,endDate:a,limit:n,offset:s,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");const c={};void 0!==e&&(c.index=e.toString()),void 0!==r&&(c.search=r.toString()),void 0!==t&&(c.startDate=t.toString()),void 0!==a&&(c.endDate=a.toString()),void 0!==n&&(c.limit=n.toString()),void 0!==s&&(c.offset=s.toString()),void 0!==i&&(c.tags=i.toString());const l={method:"GET",path:"/2/filters/noResults",queryParameters:c,headers:{}};return o.request(l,d)},getTopHits({index:e,search:r,clickAnalytics:t,revenueAnalytics:a,startDate:n,endDate:s,limit:i,offset:d,tags:c},l){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");const u={};void 0!==e&&(u.index=e.toString()),void 0!==r&&(u.search=r.toString()),void 0!==t&&(u.clickAnalytics=t.toString()),void 0!==a&&(u.revenueAnalytics=a.toString()),void 0!==n&&(u.startDate=n.toString()),void 0!==s&&(u.endDate=s.toString()),void 0!==i&&(u.limit=i.toString()),void 0!==d&&(u.offset=d.toString()),void 0!==c&&(u.tags=c.toString());const h={method:"GET",path:"/2/hits",queryParameters:u,headers:{}};return o.request(h,l)},getTopSearches({index:e,clickAnalytics:r,revenueAnalytics:t,startDate:a,endDate:n,orderBy:s,direction:i,limit:d,offset:c,tags:l},u){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");const h={};void 0!==e&&(h.index=e.toString()),void 0!==r&&(h.clickAnalytics=r.toString()),void 0!==t&&(h.revenueAnalytics=t.toString()),void 0!==a&&(h.startDate=a.toString()),void 0!==n&&(h.endDate=n.toString()),void 0!==s&&(h.orderBy=s.toString()),void 0!==i&&(h.direction=i.toString()),void 0!==d&&(h.limit=d.toString()),void 0!==c&&(h.offset=c.toString()),void 0!==l&&(h.tags=l.toString());const m={method:"GET",path:"/2/searches",queryParameters:h,headers:{}};return o.request(m,u)},getUsersCount({index:e,startDate:r,endDate:t,tags:a},n){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");const s={};void 0!==e&&(s.index=e.toString()),void 0!==r&&(s.startDate=r.toString()),void 0!==t&&(s.endDate=t.toString()),void 0!==a&&(s.tags=a.toString());const i={method:"GET",path:"/2/users/count",queryParameters:s,headers:{}};return o.request(i,n)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${$}-${e}`}),f()]}),...a}
1)}var z="5.43.0",M=["de","us"];function Q(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(t&&("string"!=typeof t||!M.includes(t)))throw new Error(`\`region\` must be one of the following: ${M.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:d?"insights.{region}.algolia.io".replace("{region}",d):"insights.algolia.io",accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"Insights",version:z}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},deleteUserToken({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");const t={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,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`.");const t={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e};return o.request(t,r)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${z}-${e}`}),f()]}),...a})}var V="5.43.0",W=["eu","us"];function J(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(!t||t&&("string"!=typeof t||!W.includes(t)))throw new Error(`\`region\` is required and must be one of the following: ${W.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:"personalization.{region}.algolia.com".replace("{region}",d),accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"Personalization",version:V}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},deleteUserProfile({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");const t={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getPersonalizationStrategy:e=>o.request({method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}},e),getUserTokenProfile({userToken:e},r){if(!e)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");const t={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,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`.");const t={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:e};return o.request(t,r)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${V}-${e}`}),f()]}),...a}
1)}var X="5.43.0",Z=["eu","us"];function Y(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(!t||t&&("string"!=typeof t||!Z.includes(t)))throw new Error(`\`region\` is required and must be one of the following: ${Z.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:"query-suggestions.{region}.algolia.com".replace("{region}",d),accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"QuerySuggestions",version:X}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},createConfig(e,r){if(!e)throw new Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");const t={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return o.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},deleteConfig({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");const t={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getAllConfigs:e=>o.request({method:"GET",path:"/1/configs",queryParameters:{},headers:{}},e),getConfig({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfig`.");const t={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getConfigStatus({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");const t={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getLogFile({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");const t={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},updateConfig({indexName:e,configuration:r},t){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`.");const a={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${X}-${e}`}),f()]}),...a}
1)}var ee="5.43.0";function re(e,r,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,...n}){const s=q(e,r,t),i=O({hosts:(o=e,[{url:`${o}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${o}.algolia.net`,accept:"write",protocol:"https"}].concat(A([{url:`${o}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${o}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${o}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))),...n,algoliaAgent:I({algoliaAgents:a,client:"Search",version:ee}),baseHeaders:{"content-type":"text/plain",...s.headers(),...n.baseHeaders},baseQueryParameters:{...s.queryParameters(),...n.baseQueryParameters}});var o;return{transporter:i,appId:e,apiKey:r,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{}),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?i.baseQueryParameters["x-algolia-api-key"]=e:i.baseHeaders["x-algolia-api-key"]=e},waitForTask({indexName:e,taskID:r,maxRetries:t=50,timeout:a=e=>Math.min(200*e,5e3)},n){let s=0;return E({func:()=>this.getTask({indexName:e,taskID:r},n),validate:e=>"published"===e.status,aggregator:()=>s+=1,error:{validate:()=>s>=t,message:()=>`The maximum number of retries exceeded. (${s}/${t})`},timeout:()=>a(s)})},waitForAppTask({taskID:e,maxRetries:r=50,timeout:t=e=>Math.min(200*e,5e3)},a){let n=0;return E({func:()=>this.getAppTask({taskID:e},a),validate:e=>"published"===e.status,aggregator:()=>n+=1,error:{validate:()=>n>=r,message:()=>`The maximum number of retries exceeded. (${n}/${r})`},timeout:()=>t(n)})},waitForApiKey({operation:e,key:r,apiKey:t,maxRetries:a=50,timeout:n=e=>Math.min(200*e,5e3)},s){let i=0;const o={aggregator:()=>i+=1,error:{validate:()=>i>=a,message:()=>`The maximum number of retries exceeded. (${i}/${a})`},timeout:()=>n(i)};if("update"===e){if(!t)throw new Error("`apiKey` is required when waiting for an `update` operation.");return E({...o,func:()=>this.getApiKey({key:r},s),validate:e=>{for(const r of Object.keys(t)){const a=t[r],n=e[r];if(Array.isArray(a)&&Array.isArray(n)){if(a.length!==n.length||a.some((e,r)=>e!==n[r]))return!1}else if(a!==n)return!1}return!0}})}return E({...o,func:()=>this.getApiKey({key:r},s).catch(e=>{if(404!==e.status)throw e}),validate:r=>"add"===e?void 0!==r:void 0===r})},browseObjects({indexName:e,browseParams:r,...t},a){return E({func:t=>this.browse({indexName:e,browseParams:{cursor:t?t.cursor:void 0,hitsPerPage:1e3,...r}},a),validate:e=>void 0===e.cursor,...t})},browseRules({indexName:e,searchRulesParams:r,...t},a){const n={...r,hitsPerPage:r?.hitsPerPage||1e3};return E({func:r=>this.searchRules({indexName:e,searchRulesParams:{...n,page:r?r.page+1:n.page||0}},a),validate:e=>e.hits.length<n.hitsPerPage,...t})},browseSynonyms({indexName:e,searchSynonymsParams:r,...t},a){const n={...r,page:r?.page||0,hitsPerPage:1e3};return E({func:r=>{const t=this.searchSynonyms({indexName:e,searchSynonymsParams:{...n,page:n.page}},a);return n.page+=1,t},validate:e=>e.hits.length<n.hitsPerPage,...t})},async chunkedBatch({indexName:e,objects:r,action:t="addObject",waitForTasks:a,batchSize:n=1e3},s){let i=[];const o=[],d=r.entries();for(const[a,c]of d)i.push({action:t,body:c}),i.length!==n&&a!==r.length-1||(o.push(await this.batch({indexName:e,batchWriteParams:{requests:i}},s)),i=[]);if(a)for(const r of o)await this.waitForTask({indexName:e,taskID:r.taskID});return o},async saveObjects({indexName:e,objects:r,waitForTasks:t,batchSize:a},n){return await this.chunkedBatch({indexName:e,objects:r,action:"addObject",waitForTasks:t,batchSize:a},n)},async deleteObjects({indexName:e,objectIDs:r,waitForTasks:t,batchSize:a},n){return await this.chunkedBatch({indexName:e,objects:r.map(e=>({objectID:e})),action:"deleteObject",waitForTasks:t,batchSize:a},n)},async partialUpdateObjects({indexName:e,objects:r,createIfNotExists:t,waitForTasks:a,batchSize:n},s){return await this.chunkedBatch({indexName:e,objects:r,action:t?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:n,waitForTasks:a},s)}
1,async replaceAllObjects({indexName:e,objects:r,batchSize:t,scopes:a},n){const s=`${e}_tmp_${Math.floor(1e6*Math.random())+1e5}`;void 0===a&&(a=["settings","rules","synonyms"]);try{let i=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:s,scope:a}},n);const o=await this.chunkedBatch({indexName:s,objects:r,waitForTasks:!0,batchSize:t},n);await this.waitForTask({indexName:s,taskID:i.taskID}),i=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:s,scope:a}},n),await this.waitForTask({indexName:s,taskID:i.taskID});const d=await this.operationIndex({indexName:s,operationIndexParams:{operation:"move",destination:e}},n);return await this.waitForTask({indexName:s,taskID:d.taskID}),{copyOperationResponse:i,batchResponses:o,moveOperationResponse:d}}catch(e){throw await this.deleteIndex({indexName:s}),e}},async indexExists({indexName:e}){try{await this.getSettings({indexName:e})}catch(e){if(e instanceof k&&404===e.status)return!1;throw e}return!0},searchForHits(e,r){return this.search(e,r)},searchForFacets(e,r){return this.search(e,r)},addApiKey(e,r){if(!e)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!e.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");const t={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e};return i.request(t,r)},addOrUpdateObject({indexName:e,objectID:r,body:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!t)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");const n={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t};return i.request(n,a)},appendSource(e,r){if(!e)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!e.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");const t={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e};return i.request(t,r)},assignUserId({xAlgoliaUserID:e,assignUserIdParams:r},t){if(!e)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!r)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!r.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");const a={};void 0!==e&&(a["X-Algolia-User-ID"]=e.toString());const n={method:"POST",path:"/1/clusters/mapping",queryParameters:{},headers:a,data:r};return i.request(n,t)},batch({indexName:e,batchWriteParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!r)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!r.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");const a={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},batchAssignUserIds({xAlgoliaUserID:e,batchAssignUserIdsParams:r},t){if(!e)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!r)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!r.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!r.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");const a={};void 0!==e&&(a["X-Algolia-User-ID"]=e.toString());const n={method:"POST",path:"/1/clusters/mapping/batch",queryParameters:{},headers:a,data:r};return i.request(n,t)},batchDictionaryEntries({dictionaryName:e,batchDictionaryEntriesParams:r},t){if(!e)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!r)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!r.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");const a={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},browse({indexName:e,browseParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `browse`.");const a={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0};return i.request(a,t)},clearObjects({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");const t={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},clearRules({indexName:e,forwardToReplicas:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `clearRules`.");const a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.forwardToReplicas=r.toString());const s={method:"POST",path:a,queryParameters:n,headers:{}};return i.request(s,t)},clearSynonyms({indexName:e,forwardToReplicas:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `clearSynonyms`.");const a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.forwardToReplicas=r.toString());const s={method:"POST",path:a,queryParameters:n,headers:{}};return i.request(s,t)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},deleteApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");const t={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteBy({indexName:e,deleteByParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!r)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");const a={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},deleteIndex({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");const t={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteObject({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");const a={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},deleteRule({indexName:e,objectID:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");const n="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const o={method:"DELETE",path:n,queryParameters:s,headers:{}};return i.request(o,a)},deleteSource({source:e},r){if(!e)throw new Error("Parameter `source` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteSynonym({indexName:e,objectID:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");const n="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const o={method:"DELETE",path:n,queryParameters:s,headers:{}};return i.request(o,a)},getApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `getApiKey`.");const t={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getAppTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getAppTask`.");const t={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getDictionaryLanguages:e=>i.request({method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}},e),getDictionarySettings:e=>i.request({method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}},e),getLogs({offset:e,length:r,indexName:t,type:a}={},n=void 0){const s={};void 0!==e&&(s.offset=e.toString()),void 0!==r&&(s.length=r.toString()),void 0!==t&&(s.indexName=t.toString()),void 0!==a&&(s.type=a.toString());const o={method:"GET",path:"/1/logs",queryParameters:s,headers:{}};return i.request(o,n)},getObject({indexName:e,objectID:r,attributesToRetrieve:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getObject`.");const n="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.attributesToRetrieve=t.toString());const o={method:"GET",path:n,queryParameters:s,headers:{}};return i.request(o,a)},getObjects(e,r){if(!e)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!e.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");const t={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return i.request(t,r)},getRule({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRule`.");const a={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getSettings({indexName:e,getVersion:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getSettings`.");const a="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.getVersion=r.toString());const s={method:"GET",path:a,queryParameters:n,headers:{}};return i.request(s,t)},getSources:e=>i.request({method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}},e),getSynonym({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");const a={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getTask({indexName:e,taskID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const a={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getTopUserIds:e=>i.request({method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}},e),getUserId({userID:e},r){if(!e)throw new Error("Parameter `userID` is required when calling `getUserId`.");const t={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},hasPendingMappings({getClusters:e}={},r=void 0){const t={};void 0!==e&&(t.getClusters=e.toString());const a={method:"GET",path:"/1/clusters/mapping/pending",queryParameters:t,headers:{}};return i.request(a,r)},listApiKeys:e=>i.request({method:"GET",path:"/1/keys",queryParameters:{},headers:{}}
1,e),listClusters:e=>i.request({method:"GET",path:"/1/clusters",queryParameters:{},headers:{}},e),listIndices({page:e,hitsPerPage:r}={},t=void 0){const a={};void 0!==e&&(a.page=e.toString()),void 0!==r&&(a.hitsPerPage=r.toString());const n={method:"GET",path:"/1/indexes",queryParameters:a,headers:{}};return i.request(n,t)},listUserIds({page:e,hitsPerPage:r}={},t=void 0){const a={};void 0!==e&&(a.page=e.toString()),void 0!==r&&(a.hitsPerPage=r.toString());const n={method:"GET",path:"/1/clusters/mapping",queryParameters:a,headers:{}};return i.request(n,t)},multipleBatch(e,r){if(!e)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!e.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");const t={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e};return i.request(t,r)},operationIndex({indexName:e,operationIndexParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!r)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!r.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!r.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");const a={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},partialUpdateObject({indexName:e,objectID:r,attributesToUpdate:t,createIfNotExists:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!t)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");const s="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),o={};void 0!==a&&(o.createIfNotExists=a.toString());const d={method:"POST",path:s,queryParameters:o,headers:{},data:t};return i.request(d,n)},removeUserId({userID:e},r){if(!e)throw new Error("Parameter `userID` is required when calling `removeUserId`.");const t={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},replaceSources({source:e},r){if(!e)throw new Error("Parameter `source` is required when calling `replaceSources`.");const t={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return i.request(t,r)},restoreApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");const t={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},saveObject({indexName:e,body:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!r)throw new Error("Parameter `body` is required when calling `saveObject`.");const a={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)},saveRule({indexName:e,objectID:r,rule:t,forwardToReplicas:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!t)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!t.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");if(!t.consequence)throw new Error("Parameter `rule.consequence` is required when calling `saveRule`.");const s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),o={};void 0!==a&&(o.forwardToReplicas=a.toString());const d={method:"PUT",path:s,queryParameters:o,headers:{},data:t};return i.request(d,n)},saveRules({indexName:e,rules:r,forwardToReplicas:t,clearExistingRules:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!r)throw new Error("Parameter `rules` is required when calling `saveRules`.");const s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),o={};void 0!==t&&(o.forwardToReplicas=t.toString()),void 0!==a&&(o.clearExistingRules=a.toString());const d={method:"POST",path:s,queryParameters:o,headers:{},data:r};return i.request(d,n)},saveSynonym({indexName:e,objectID:r,synonymHit:t,forwardToReplicas:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!t)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!t.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!t.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");const s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),o={};void 0!==a&&(o.forwardToReplicas=a.toString());const d={method:"PUT",path:s,queryParameters:o,headers:{},data:t};return i.request(d,n)},saveSynonyms({indexName:e,synonymHit:r,forwardToReplicas:t,replaceExistingSynonyms:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");const s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),o={};void 0!==t&&(o.forwardToReplicas=t.toString()),void 0!==a&&(o.replaceExistingSynonyms=a.toString());const d={method:"POST",path:s,queryParameters:o,headers:{},data:r};return i.request(d,n)},search(e,r){if(e&&Array.isArray(e)){const r={requests:e.map(({params:e,...r})=>"facet"===r.type?{...r,...e,type:"facet"}:{...r,...e,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})};e=r}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");const t={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return i.request(t,r)},searchDictionaryEntries({dictionaryName:e,searchDictionaryEntriesParams:r},t){if(!e)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!r)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!r.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");const a={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return i.request(a,t)},searchForFacetValues({indexName:e,facetName:r,searchForFacetValuesRequest:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!r)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");const n={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0};return i.request(n,a)},searchRules({indexName:e,searchRulesParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRules`.");const a={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return i.request(a,t)},searchSingleIndex({indexName:e,searchParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");const a={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return i.request(a,t)},searchSynonyms({indexName:e,searchSynonymsParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");const a={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return i.request(a,t)},searchUserIds(e,r){if(!e)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!e.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");const t={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return i.request(t,r)},setDictionarySettings(e,r){if(!e)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!e.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");const t={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e};return i.request(t,r)},setSettings({indexName:e,indexSettings:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!r)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");const n="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const o={method:"PUT",path:n,queryParameters:s,headers:{},data:r};return i.request(o,a)},updateApiKey({key:e,apiKey:r},t){if(!e)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!r)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!r.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");const a={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(a,t)}}}({appId:e,apiKey:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${ee}-${e}`}),f()]}),...t})}var te="1.43.0",ae=["eu","us"];function ne(e){return"onDemand"===e.type}function se(e){return"schedule"===e.type}function ie(e){return"subscription"===e.type}function oe(e,r,t,a){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");if(!t||t&&("string"!=typeof t||!ae.includes(t)))throw new Error(`\`region\` is required and must be one of the following: ${ae.join(", ")}`);return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,region:n,...s}){const i=q(e,r,t),o=O({hosts:(d=n,[{url:"data.{region}.algolia.com".replace("{region}",d),accept:"readWrite",protocol:"https"}]),...s,algoliaAgent:I({algoliaAgents:a,client:"Ingestion",version:te}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});var d;return{transporter:o,appId:e,apiKey:r,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{}),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?o.baseQueryParameters["x-algolia-api-key"]=e:o.baseHeaders["x-algolia-api-key"]=e},async chunkedPush({indexName:e,objects:r,action:t="addObject",waitForTasks:a,batchSize:n=1e3,referenceIndexName:s},i){let o=[],d=0;const c=[],l=Math.floor(n/10)||n,u=r.entries();for(const[h,m]of u)if(o.push(m),o.length!==n&&h!==r.length-1||(c.push(await this.push({indexName:e,pushTaskPayload:{action:t,records:o},referenceIndexName:s},i)),o=[]),a&&c.length>0&&(c.length%l===0||h===r.length-1)){for(const e of c.slice(d,d+l)){if(!e.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let r=0;await E({func:async()=>
1{if(void 0===e.eventID||!e.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:e.runID,eventID:e.eventID}).catch(e=>{if(404!==e.status)throw e})},validate:e=>void 0!==e,aggregator:()=>r+=1,error:{validate:()=>r>=50,message:()=>`The maximum number of retries exceeded. (${r}/50)`},timeout:()=>Math.min(500*r,5e3)})}d+=l}return c},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`.");const t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return o.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");const t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return o.request(t,r)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const t={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");const t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");const t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const t={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");const t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const t={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");const t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getEvent({runID:e,eventID:r},t){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const a={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");const t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");const t={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");const t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");const t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},listAuthentications({itemsPerPage:e,page:r,type:t,platform:a,sort:n,order:s}={},i=void 0){const d={};void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==r&&(d.page=r.toString()),void 0!==t&&(d.type=t.toString()),void 0!==a&&(d.platform=a.toString()),void 0!==n&&(d.sort=n.toString()),void 0!==s&&(d.order=s.toString());const c={method:"GET",path:"/1/authentications",queryParameters:d,headers:{}};return o.request(c,i)},listDestinations({itemsPerPage:e,page:r,type:t,authenticationID:a,transformationID:n,sort:s,order:i}={},d=void 0){const c={};void 0!==e&&(c.itemsPerPage=e.toString()),void 0!==r&&(c.page=r.toString()),void 0!==t&&(c.t
1ype=t.toString()),void 0!==a&&(c.authenticationID=a.toString()),void 0!==n&&(c.transformationID=n.toString()),void 0!==s&&(c.sort=s.toString()),void 0!==i&&(c.order=i.toString());const l={method:"GET",path:"/1/destinations",queryParameters:c,headers:{}};return o.request(l,d)},listEvents({runID:e,itemsPerPage:r,page:t,status:a,type:n,sort:s,order:i,startDate:d,endDate:c},l){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");const u="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),h={};void 0!==r&&(h.itemsPerPage=r.toString()),void 0!==t&&(h.page=t.toString()),void 0!==a&&(h.status=a.toString()),void 0!==n&&(h.type=n.toString()),void 0!==s&&(h.sort=s.toString()),void 0!==i&&(h.order=i.toString()),void 0!==d&&(h.startDate=d.toString()),void 0!==c&&(h.endDate=c.toString());const m={method:"GET",path:u,queryParameters:h,headers:{}};return o.request(m,l)},listRuns({itemsPerPage:e,page:r,status:t,type:a,taskID:n,sort:s,order:i,startDate:d,endDate:c}={},l=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.status=t.toString()),void 0!==a&&(u.type=a.toString()),void 0!==n&&(u.taskID=n.toString()),void 0!==s&&(u.sort=s.toString()),void 0!==i&&(u.order=i.toString()),void 0!==d&&(u.startDate=d.toString()),void 0!==c&&(u.endDate=c.toString());const h={method:"GET",path:"/1/runs",queryParameters:u,headers:{}};return o.request(h,l)},listSources({itemsPerPage:e,page:r,type:t,authenticationID:a,sort:n,order:s}={},i=void 0){const d={};void 0!==e&&(d.itemsPerPage=e.toString()),void 0!==r&&(d.page=r.toString()),void 0!==t&&(d.type=t.toString()),void 0!==a&&(d.authenticationID=a.toString()),void 0!==n&&(d.sort=n.toString()),void 0!==s&&(d.order=s.toString());const c={method:"GET",path:"/1/sources",queryParameters:d,headers:{}};return o.request(c,i)},listTasks({itemsPerPage:e,page:r,action:t,enabled:a,sourceID:n,sourceType:s,destinationID:i,triggerType:d,withEmailNotifications:c,sort:l,order:u}={},h=void 0){const m={};void 0!==e&&(m.itemsPerPage=e.toString()),void 0!==r&&(m.page=r.toString()),void 0!==t&&(m.action=t.toString()),void 0!==a&&(m.enabled=a.toString()),void 0!==n&&(m.sourceID=n.toString()),void 0!==s&&(m.sourceType=s.toString()),void 0!==i&&(m.destinationID=i.toString()),void 0!==d&&(m.triggerType=d.toString()),void 0!==c&&(m.withEmailNotifications=c.toString()),void 0!==l&&(m.sort=l.toString()),void 0!==u&&(m.order=u.toString());const p={method:"GET",path:"/2/tasks",queryParameters:m,headers:{}};return o.request(p,h)},listTasksV1({itemsPerPage:e,page:r,action:t,enabled:a,sourceID:n,destinationID:s,triggerType:i,sort:d,order:c}={},l=void 0){const u={};void 0!==e&&(u.itemsPerPage=e.toString()),void 0!==r&&(u.page=r.toString()),void 0!==t&&(u.action=t.toString()),void 0!==a&&(u.enabled=a.toString()),void 0!==n&&(u.sourceID=n.toString()),void 0!==s&&(u.destinationID=s.toString()),void 0!==i&&(u.triggerType=i.toString()),void 0!==d&&(u.sort=d.toString()),void 0!==c&&(u.order=c.toString());const h={method:"GET",path:"/1/tasks",queryParameters:u,headers:{}};return o.request(h,l)},listTransformations({itemsPerPage:e,page:r,sort:t,order:a,type:n}={},s=void 0){const i={};void 0!==e&&(i.itemsPerPage=e.toString()),void 0!==r&&(i.page=r.toString()),void 0!==t&&(i.sort=t.toString()),void 0!==a&&(i.order=a.toString()),void 0!==n&&(i.type=n.toString());const d={method:"GET",path:"/1/transformations",queryParameters:i,headers:{}};return o.request(d,s)},push({indexName:e,pushTaskPayload:r,watch:t,referenceIndexName:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `push`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");const s="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),i={};void 0!==t&&(i.watch=t.toString()),void 0!==a&&(i.referenceIndexName=a.toString());const d={method:"POST",path:s,queryParameters:i,headers:{},data:r};return n={timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},o.request(d,n)},pushTask({taskID:e,pushTaskPayload:r,watch:t},a){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`.");const n="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),s={};void 0!==t&&(s.watch=t.toString());const i={method:"POST",path:n,queryParameters:s,headers:{},data:r};return a={timeouts:{connect:18e4,read:18e4,write:18e4,...a?.timeouts}},o.request(i,a)},replaceTask({taskID:e,taskReplace:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `replaceTask`.");if(!r)throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");if(!r.destinationID)throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");if(!r.action)throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");const a={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},runSource({sourceID:e,runSourcePayload:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");const a={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return o.request(a,t)},runTask({taskID:e,runTaskPayload:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");const a={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return o.request(a,t)},runTaskV1({taskID:e,runTaskPayload:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");const a={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return o.request(a,t)},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`.");const t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return o.request(t,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`.");const t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return o.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},o.request(t,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");const t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return o.request(t,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},t){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.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");const a={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},updateAuthentication({authenticationID:e,authenticationUpdate:r},t){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const a={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},updateDestination({destinationID:e,destinationUpdate:r},t){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const a={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},updateSource({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const a={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},updateTask({taskID:e,taskUpdate:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");
1if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const a={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},updateTaskV1({taskID:e,taskUpdate:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");const a={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},updateTransformation({transformationID:e,transformationCreate:r},t){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.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");const a={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},validateSource(e,r=void 0){const t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},o.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},t){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");const a={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},o.request(a,t)}}}({appId:e,apiKey:r,region:t,timeouts:{connect:25e3,read:25e3,write:25e3},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${te}-${e}`}),f()]}),...a})}var de="1.43.0";function ce(e,r,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,...n}){const s=q(e,r,t),i=O({hosts:[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}],...n,algoliaAgent:I({algoliaAgents:a,client:"Monitoring",version:de}),baseHeaders:{"content-type":"text/plain",...s.headers(),...n.baseHeaders},baseQueryParameters:{...s.queryParameters(),...n.baseQueryParameters}});return{transporter:i,appId:e,apiKey:r,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{}),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?i.baseQueryParameters["x-algolia-api-key"]=e:i.baseHeaders["x-algolia-api-key"]=e},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},getClusterIncidents({clusters:e}
1,r){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");const t={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getClusterStatus({clusters:e},r){if(!e)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");const t={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getIncidents:e=>i.request({method:"GET",path:"/1/incidents",queryParameters:{},headers:{}},e),getIndexingTime({clusters:e},r){if(!e)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");const t={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getLatency({clusters:e},r){if(!e)throw new Error("Parameter `clusters` is required when calling `getLatency`.");const t={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getMetrics({metric:e,period:r},t){if(!e)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!r)throw new Error("Parameter `period` is required when calling `getMetrics`.");const a={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(e)).replace("{period}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(a,t)},getReachability({clusters:e},r){if(!e)throw new Error("Parameter `clusters` is required when calling `getReachability`.");const t={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getServers:e=>i.request({method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}},e),getStatus:e=>i.request({method:"GET",path:"/1/status",queryParameters:{},headers:{}},e)}}({appId:e,apiKey:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${de}-${e}`}),f()]}),...t})}var le="5.43.0";function ue(e,r,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:r,authMode:t,algoliaAgents:a,...n}){const s=q(e,r,t),i=O({hosts:(o=e,[{url:`${o}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${o}.algolia.net`,accept:"write",protocol:"https"}].concat(A([{url:`${o}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${o}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${o}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))),...n,algoliaAgent:I({algoliaAgents:a,client:"Recommend",version:le}),baseHeaders:{"content-type":"text/plain",...s.headers(),...n.baseHeaders},baseQueryParameters:{...s.queryParameters(),...n.baseQueryParameters}});var o;return{transporter:i,appId:e,apiKey:r,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{}),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){t&&"WithinHeaders"!==t?i.baseQueryParameters["x-algolia-api-key"]=e:i.baseHeaders["x-algolia-api-key"]=e},batchRecommendRules({indexName:e,model:r,recommendRule:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!r)throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");const n={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t||{}};return i.request(n,a)},customDelete({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");const a={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customGet({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");const a={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(a,t)},customPost({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");const n={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},customPut({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");const n={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(n,a)},deleteRecommendRule({indexName:e,model:r,objectID:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!t)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const n={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return i.request(n,a)},getRecommendRule({indexName:e,model:r,objectID:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!t)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const n={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return i.request(n,a)},getRecommendStatus({indexName:e,model:r,taskID:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!t)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const n={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(r)).replace("{taskID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return i.request(n,a)},getRecommendations(e,r){if(e&&Array.isArray(e)&&(e={requests:e}),!e)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!e.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const t={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return i.request(t,r)},searchRecommendRules({indexName:e,model:r,searchRecommendRulesParams:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!r)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const n={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(e)).replace("{model}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0};return i.request(n,a)}}}({appId:e,apiKey:r,timeouts:{connect:1e3,read:2e3,write:3e4},logger:v(),requester:w(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:f(),requestsCache:f({serializable:!1}),hostsCache:y({caches:[P({key:`${le}-${e}`}),f()]}),...t})}var he=Object.defineProperty,me=Object.getOwnPropertyDescriptor,pe=Object.getOwnPropertyNames,ge=Object.prototype.hasOwnProperty,we=(e,r)=>{for(var t in r)he(e,t,{get:r[t],enumerable:!0})},Pe=(e,r,t,a)=>{if(r&&"object"==typeof r||"function"==typeof r)for(let n of pe(r))ge.call(e,n)||n===t||he(e,n,{get:()=>r[n],enumerable:!(a=me(r,n))||a.enumerable});return e},ye=(e,r,t)=>(Pe(e,r,"default"),t&&Pe(t,r,"default")),fe={};we(fe,{algoliasearch:()=>Ee,apiClientVersion:()=>ee});var qe={};function Ee(e,r,t){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!r||"string"!=typeof r)throw new Error("`apiKey` is missing.");const a=re(e,r,t);let n;if(t?.transformation){if(!t.transformation.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");n=oe(e,r,t.transformation.region,t)}return{...a,async saveObjectsWithTransformation({indexName:e,objects:r,waitForTasks:a},s){if(!n)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!t?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");return n.chunkedPush({indexName:e,objects:r,action:"addObject",waitForTasks:a},s)},async partialUpdateObjectsWithTransformation({indexName:e,objects:r,createIfNotExists:a,waitForTasks:s},i){if(!n)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!t?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");return n.chunkedPush({indexName:e,objects:r,action:a?"partialUpdateObject":"partialUpdateObjectNoCreate",waitForTasks:s},i)}
1,async replaceAllObjectsWithTransformation({indexName:e,objects:r,batchSize:a,scopes:s},i){if(!n)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!t?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");const o=`${e}_tmp_${Math.floor(1e6*Math.random())+1e5}`;void 0===s&&(s=["settings","rules","synonyms"]);try{let t=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:o,scope:s}},i);const d=await n.chunkedPush({indexName:o,objects:r,waitForTasks:!0,batchSize:a,referenceIndexName:e},i);await this.waitForTask({indexName:o,taskID:t.taskID}),t=await this.operationIndex({indexName:e,operationIndexParams:{operation:"copy",destination:o,scope:s}},i),await this.waitForTask({indexName:o,taskID:t.taskID});const c=await this.operationIndex({indexName:o,operationIndexParams:{operation:"move",destination:e}},i);return await this.waitForTask({indexName:o,taskID:c.taskID}),{copyOperationResponse:t,watchResponses:d,moveOperationResponse:c}}catch(e){throw await this.deleteIndex({indexName:o}),e}},get _ua(){return a.transporter.algoliaAgent.value},initAbtesting:t=>B(t.appId||e,t.apiKey||r,t.region,t.options),initAbtestingV3:t=>F(t.appId||e,t.apiKey||r,t.region,t.options),initAnalytics:t=>H(t.appId||e,t.apiKey||r,t.region,t.options),initIngestion:t=>oe(t.appId||e,t.apiKey||r,t.region,t.options),initInsights:t=>Q(t.appId||e,t.apiKey||r,t.region,t.options),initMonitoring:(t={})=>ce(t.appId||e,t.apiKey||r,t.options),initPersonalization:t=>J(t.appId||e,t.apiKey||r,t.region,t.options),initQuerySuggestions:t=>Y(t.appId||e,t.apiKey||r,t.region,t.options),initRecommend:(t={})=>ue(t.appId||e,t.apiKey||r,t.options)}}we(qe,{apiClientVersion:()=>ee}),ye(qe,n),ye(qe,s),ye(qe,i),ye(qe,o),ye(qe,d),ye(qe,c),ye(qe,l),ye(qe,u),ye(qe,h),ye(qe,m),ye(fe,qe);const Ie="eh-learn-filter",ve=e=>{void 0!==window.dataLayer&&window.dataLayer.push(e)},Te="eh-learn-results",be=`[data-wp-interactive="${Te}"]`,Se=`${Te}:load-more`,De=e(Ie);let xe=24,ke=0,Re=0;const Ce=e=>JSON.parse(JSON.stringify(e)),Ae=window.algolia,Ne=String(De.algoliaApplicationId||Ae?.application_id||""),Ue=String(De.algoliaSearchApiKey||Ae?.search_api_key||""),Oe=String(De.algoliaIndexName||Ae?.indices?.searchable_posts?.name||""),je=(e="newest_first")=>"oldest_first"===e?`${Oe}_date_asc`:Oe,_e=(()=>{if(!Ne||!Ue||!Oe)return null;try{return Ee(Ne,Ue)}catch(e){return console.error("Failed to initialize Algolia client:",e),null}})(),Fe=(e,r)=>({learn_topic:e.learn_topic??[],resource_type:e.resource_type??[],industry:e.industry??[],company_
1size:e.company_size??[],audience:r.length?r:e.audience??[],post_features:e.post_features??[]}),Ge={setAlgoliaResults:()=>{},appendAlgoliaResults:()=>{},reset:()=>{},showLoading:()=>{},hideLoading:()=>{}},Ke=()=>{const e=t(Te).actions;return"function"==typeof e?.setAlgoliaResults?e:Ge},Be={learn_topic:"taxonomies.learn_topic",resource_type:"search_post_type",industry:"taxonomies.industry",company_size:"taxonomies.business-size",audience:"taxonomies.audience",post_features:"taxonomies.post_features"},$e=["Resources","News","Videos"],Le=(e,r,t="",a="",n=!0)=>{const s=[`domain:${r}`],i=a?Ze[a]??[]:[],o=Object.entries(e).filter(([,e])=>e.length>0).filter(([e])=>!!Be[e]).map(([e,r])=>(t&&"audience"===e?r.filter(e=>!i.includes(e)):r).map(r=>`${Be[e]}:${r}`)).filter(e=>e.length>0);return[s,...n&&De.featuredOnly&&!t?[["taxonomies.post_features:Featured Post"]]:[],...n&&De.trendingOnly&&!t?[["taxonomies.post_features:Trending"]]:[],...t?[$e.map(e=>`post_type_label:${e}`)]:[],...o,"taxonomies.post_features:-Trending video"]},He=e=>Object.entries(e).map(([e,r])=>({value:e,label:e,count:r})),ze=e=>{const r={};return Object.entries(e).forEach(([e,t])=>{const a=["on demand","video"].includes(e.toLowerCase())?"On Demand":e;r[a]=(r[a]||0)+t}),He(r)},Me=e=>{const r=Le(e.appliedFilters,De.domain,e.searchQuery,e.audiencePreset,(e=>!e.hasExitedTabMode)(e));return _e.searchSingleIndex({indexName:je(e.sortBy),searchParams:{query:e.searchQuery,hitsPerPage:xe,page:e.currentPage,facetingAfterDistinct:!0,facetFilters:r}})},Qe=e=>{const r=String(e??"").trim();if(!r)return"";const t=r.match(/(?:medias\/|embed\/(?:iframe\/|medias\/)?)([A-Za-z0-9_-]+)/)??r.match(/wi\.st\/(?:medias\/)?([A-Za-z0-9_-]+)/);return t?.[1]?t[1]:/^[A-Za-z0-9_-]+$/.test(r)?r:""},Ve=async e=>{const r=[...new Set(e.filter(e=>(e=>{const r=String(e.search_post_type??"").toLowerCase();return r.includes("video")||r.includes("webinar")||r.includes("on demand")})(e)&&!(e.wistia_video_id??e.wistia_media_id)).map(e=>Number(e.post_id??e.objectID)).filter(e=>Number.isInteger(e)&&e>0))];if(!r.length||!De.resourcesApiUrl)return e;const t=new URLSearchParams({include:r.join(","),per_page:String(Math.min(r.length,100)),_fields:"id,meta.wistia_video_id,meta.link_video"}),a=await window.fetch(`${De.resourcesApiUrl}?${t}`,{headers:{"X-WP-Nonce":De.restNonce}});if(!a.ok)return e;const n=await a.json(),s=new Map(n.map(e=>[e.id,Qe(e.meta?.wistia_video_id||e.meta?.link_video)]));return e.map(e=>{const r=Number(e.post_id??e.objectID),t=s.get(r);return t?{...e,wistia_video_id:t}:e})},We=e=>{const r=e.currentTarget,t=r.querySelector("wistia-player");return t?{root:r,player:t}:null},Je=e=>{(e=>{["controls-visible-on-load","controlsvisibleonload","play-bar","playbar","play-button","playbutton","small-play-button","smallplaybutton","volume-control","volumecontrol","settings-control","settingscontrol","fullscreen-button","fullscreenbutton","play-pause-notifier","playpausenotifier","big-play-button","bigplaybutton","copy-link-and-thumbnail"].forEach(r=>e.setAttribute(r,"false")),e.setAttribute("rounded-player","0"),e.controlsVisibleOnLoad=!1,e.playbar=!1,e.playButton=!1,e.smallPlayButton=!1,e.volumeControl=!1,e.settingsControl=!1,e.fullscreenButton=!1,e.playPauseNotifier=!1,e.bigPlayButton=!1,e.copyLinkAndThumbnail=!1,e.roundedPlayer=0})(e),(e=>{e.setAttribute("muted",""),e.setAttribute("volume","0"),e.muted=!0,e.volume=0,"function"==typeof e.mute&&e.mute()})(e),(e=>{const r=e.shadowRoot;if(!r||r.querySelector("style[data-eh-preview-links]"))return;const t=document.createElement("style");t.dataset.ehPreviewLinks="",t.textContent=".w-bottom-bar-right.w-css-reset { display: none !important; }",r.appendChild(t)})(e)},Xe=e=>{Je(e),"true"!==e.dataset.ehPreviewConfigured&&(e.dataset.ehPreviewConfigured="true",e.addEventListener("api-ready",()=>Je(e)),e.addEventListener("play",()=>Je(e)))},Ze={business:["Businesses"],personal:["Employees","Job Seekers"]},Ye=()=>t(Ie);t(Ie,{state:{isOpen:!1,currentPage:0,maxPages:0,nbHits:0,sortBy:"newest_first",pendingSort:"newest_first",searchQuery:"",error:null,activeTabId:"",activeTabLabel:"",hasExitedTabMode:!1,audiencePreset:"",videoSpotlightTabId:De.videoSpotlightTabId??"",videoSpotlightCards:[],showSpotlightFiltered:!1,isSpotlightLoading:!1,pendingFilters:Ce(De.defaultFilters),appliedFilters:Ce(De.defaultFilters),completeFacets:{},get facetOptions(){const{completeFacets:e}=Ye().state;return{learn_topic:He(e["taxonomies.learn_topic"]||{}),resource_type:ze(e.search_post_type||{}),industry:He(e["taxonomies.industry"]||{}
1),company_size:He(e["taxonomies.business-size"]||{}),audience:He(e["taxonomies.audience"]||{})}},get isGroupEmpty(){const e=r(),{state:t}=Ye();return 0===(t.pendingFilters[e.group]||[]).length},get isPendingChecked(){const e=r(),{state:t}=Ye(),{group:a}=e,n=e.item?.value;return!(!a||!n)&&(t.pendingFilters[a]||[]).includes(n)},get isSortSelected(){const e=r(),{state:t}=Ye();return t.pendingSort===e.sortValue},get hasPendingFilters(){const{state:e}=Ye();return Object.values(e.pendingFilters).some(e=>e.length>0)},get isTabActive(){const e=r(),{state:t}=Ye();return t.activeTabId===e.tab?.id},get isPillsRowHidden(){const{state:e}=Ye();return!!e.activeTabId||!e.hasActivePills},get tabIndex(){const e=r(),{state:t}=Ye();return t.activeTabId===e.tab?.id?0:-1},get isSpotlightVisible(){const{state:e}=Ye();return!!e.videoSpotlightTabId&&e.activeTabId===e.videoSpotlightTabId&&(e.isSpotlightLoading||e.hasSpotlightResults)},get isSpotlightSsrHidden(){const{state:e}=Ye();return e.showSpotlightFiltered||e.isSpotlightLoading},get isSpotlightFilteredVisible(){const{state:e}=Ye();return e.showSpotlightFiltered&&!e.isSpotlightLoading},get activePills(){const{state:e}=Ye(),r=De.defaultFilters??{},t=[];for(const[a,n]of Object.entries(e.appliedFilters)){const e=r[a]??[];for(const r of n)e.includes(r)||t.push({group:a,term:r,label:r,key:`${a}:${r}`})}return t},get hasActivePills(){const{state:e}=Ye(),r=De.defaultFilters??{};return Object.entries(e.appliedFilters).some(([e,t])=>{const a=r[e]??[];return t.some(e=>!a.includes(e))})}},actions:{openPanel:()=>{const{state:e}=Ye();e.isOpen=!e.isOpen},closePanel:()=>{Ye().state.isOpen=!1},clearGroup:()=>{const e=r(),{state:t}=Ye();g(t),t.pendingFilters[e.group]=[],t.pendingFilters={...t.pendingFilters}},toggleFilter:()=>{const e=r(),{state:t}=Ye(),{group:a}=e,n=e.item?.value;a&&n&&(g(t),t.pendingFilters[a]||(t.pendingFilters[a]=[]),t.pendingFilters[a]=t.pendingFilters[a].includes(n)?t.pendingFilters[a].filter(e=>e!==n):[...t.pendingFilters[a],n],t.pendingFilters={...t.pendingFilters})},setPendingSort:()=>{const e=r(),{state:t}=Ye();t.pendingSort=e.sortValue},setSearchQuery:e=>{const{state:r}=Ye();r.searchQuery=e.target.value},*handleSearchKeydown(e){if("Enter"!==e.key)return;const{actions:r}=Ye();yield r.applyFilters()},*applyFilters(){const{state:e,actions:r}=Ye();if(e.activeTabId="",e.hasExitedTabMode=!0,e.searchQuery){const r={learn_topic:[],resource_type:[],industry:[],company_size:[],audience:[],post_features:[],...De.defaultFilters??{}};e.appliedFilters=Ce(r),e.pendingFilters=Ce(r)}else{const r=e.pendingFilters;r.learn_topic||(r.learn_topic=[]),r.audience||(r.audience=[]),r.post_features||(r.post_features=[]),e.appliedFilters=Ce(r)}e.sortBy=e.pendingSort,e.currentPage=0,e.isOpen=!1,yield r.queryResults()},*selectAudiencePreset(e){const{state:r,actions:t}=Ye(),a=e.target.value;r.audiencePreset=a;const n=a?Ze[a]??[]:[];r.appliedFilters={...r.appliedFilters,audience:n},r.pendingFilters=Ce(r.appliedFilters),r.activeTabId="",r.hasExitedTabMode=!0,r.currentPage=0,r.searchQuery="",yield t.queryResults()},clearFilters(){const{state:e}=Ye(),r=De.initialTabFilters??{},t=document.querySelector(be),a=t?.dataset?.audiencePreset??"",n=a?Ze[a]??[]:[],s=Fe(r,n);e.activeTabId=De.initialTabId??"",e.hasExitedTabMode=!1,e.audiencePreset=a,e.pendingFilters=Ce(s),e.appliedFilters=Ce(s),e.pendingSort="newest_first",e.sortBy="newest_first",e.searchQuery="",e.currentPage=0,e.isOpen=!1,e.showSpotlightFiltered=!1,e.isSpotlightLoading=!1,Ke().reset()},*queryResults(){const{state:e}=Ye(),r=Ke();if(!_e)return console.error("Algolia client not initialized"),e.error="Failed to query Algolia",void r.hideLoading();r.showLoading();try{e.error=null;const t=yield Me(e),a=Array.isArray(t.hits)?t.hits:[],n=yield Ve(a);e.maxPages=t.nbPages||0,e.nbHits=t.nbHits??0,e.searchQuery&&ve({event:"learn_block_search",search_term:e.searchQuery,results_count:e.nbHits});const s=e.currentPage<e.maxPages-1;r.setAlgoliaResults(n,{hasMore:s,page:e.currentPage,filtered:!0,nbHits:e.nbHits})}catch(t){e.error="Failed to query Algolia",console.error("[learn-filter] queryResults error:",t),e.maxPages=0,e.nbHits=0,r.setAlgoliaResults([],{hasMore:!1,page:e.currentPage,filtered:!0,nbHits:0})}},async loadMorePage(e){const{state:r}=Ye(),t=Ke();if(_e)try{r.currentPage=e;const a=await Me(r),n=Array.isArray(a.hits)?a.hits:[],s=await Ve(n);r.maxPages=a.nbPages||0,r.nbHits=a.nbHits??r.nbHits;const i=r.currentPage<r.maxPages-1;
1t.appendAlgoliaResults(s,i)}catch(e){console.error("[learn-filter] loadMorePage error:",e),t.appendAlgoliaResults([],!1)}else t.appendAlgoliaResults([],!1)},*removePill(){const e=r(),{state:t,actions:a}=Ye(),{group:n,term:s}=e.pill;t.appliedFilters[n]=(t.appliedFilters[n]??[]).filter(e=>e!==s),t.appliedFilters={...t.appliedFilters},"audience"===n&&(t.audiencePreset=""),t.pendingFilters=Ce(t.appliedFilters),t.currentPage=0,yield a.queryResults()},*selectTab(){const e=r(),{state:t,actions:a}=Ye(),{tab:n}=e;if(t.activeTabId===n.id)return;ve({event:"learn_block_cta_click",cta_text:n.label||"",cta_destination:"",content_section:n.label||""});const s=n.filters??{},i=t.audiencePreset?Ze[t.audiencePreset]??[]:[];t.activeTabId=n.id,t.activeTabLabel=n.label||"",t.hasExitedTabMode=!1;const o={...s,resource_type:s.resource_type??s["resource-type"]??s.format??[]};t.appliedFilters=Fe(o,i),t.pendingFilters=Ce(t.appliedFilters),t.searchQuery="",t.sortBy="newest_first",t.pendingSort="newest_first",t.currentPage=0,t.isOpen=!1;const d=n.id===t.videoSpotlightTabId,c=d?(e=>(ke+=1,Re=Date.now(),e.isSpotlightLoading=!0,ke))(t):0;yield a.queryResults(),d&&(yield a.fetchVideoSpotlight()),c&&(yield((e,r)=>{if(r!==ke)return Promise.resolve();const t=Date.now()-Re,a=Math.max(0,1501-t);return new Promise(t=>{window.setTimeout(()=>{r===ke&&(Re=0,e.isSpotlightLoading=!1),t()},a)})})(t,c))},handleTabKeydown(e){if(!["ArrowLeft","ArrowRight","Home","End"].includes(e.key))return;const r=e.currentTarget,t=r.closest('[role="tablist"]'),a=Array.from(t?.querySelectorAll('[role="tab"]')??[]),n=a.indexOf(r);if(n<0||!a.length)return;e.preventDefault();let s="Home"===e.key?0:a.length-1;"ArrowLeft"===e.key&&(s=(n-1+a.length)%a.length),"ArrowRight"===e.key&&(s=(n+1)%a.length),a[s].focus(),a[s].click()},*fetchVideoSpotlight(){const{state:e}=Ye();try{const r=yield(async(e=[],r=[])=>{const t=new URLSearchParams;e.length&&t.set("audience",e.join(",")),r.length&&t.set("learn_topic",r.join(","));const a=await window.fetch(`${De.videoSpotlightApiUrl}?${t}`,{headers:{"X-WP-Nonce":De.restNonce}});if(!a.ok)throw new Error(`Video spotlight request failed: ${a.status}`);const n=await a.json();return Array.isArray(n.cards)?n.cards:[]})(e.appliedFilters.audience??[],e.appliedFilters.learn_topic??[]);e.videoSpotlightCards=r,e.hasSpotlightResults=r.length>0,e.showSpotlightFiltered=!0}catch(r){e.hasSpotlightResults=!1,console.error("[learn-filter] fetchVideoSpotlight error:",r)}},hoverSpotlightCard(e){if(!window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: 769px)").matches)return;const r=We(e);r&&customElements.whenDefined("wistia-player").then(()=>{if(r.root.matches(":hover")&&(Xe(r.player),"function"==typeof r.player.play)){const e=r.player.play();e&&"function"==typeof e.catch&&e.then(()=>Xe(r.player)).catch(()=>{})}})},unhoverSpotlightCard(e){const r=We(e);r&&customElements.whenDefined("wistia-player").then(()=>{"function"==typeof r.player.pause&&r.player.pause(),"function"==typeof r.player.time&&r.player.time(0)})},trackSpotlightClick(){const{card:e}=r();e&&ve({event:"learn_block_video_click",video_id:e.wistiaMediaId,video_title:e.title,content_position:1,click_destination:e.permalink})},trackCtaClick(e){const{state:r}=Ye(),t=e.currentTarget;ve({event:"learn_block_cta_click",cta_text:t.textContent?.trim()||"",cta_destination:t.href||"",content_section:r.activeTabLabel})}}
1,callbacks:{spotlightBackgroundImage(){const{card:e}=r();return t=e?.thumbUrl,t?`url(${JSON.stringify(String(t))})`:"";var t},init(){const{state:e,actions:r}=Ye();(()=>{if(document.querySelector('main, [role="main"]'))return;const e=document.querySelector(`[data-wp-interactive="${Ie}"]`);e?.closest(".wp-block-post-content")?.setAttribute("role","main")})();const t=document.querySelector(`[data-wp-interactive="${Ie}"]`);if(t){const r=new IntersectionObserver(([e])=>{e.isIntersecting&&(ve({event:"learn_block_view"}),r.disconnect())},{threshold:.5});r.observe(t),t.addEventListener("click",r=>{const t=r.target.closest(".view-all-link");t&&ve({event:"learn_block_cta_click",cta_text:t.textContent?.trim()||"",cta_destination:t.href||"",content_section:e.activeTabLabel})})}!e.activeTabId&&De.initialTabId&&(e.activeTabId=De.initialTabId);const a=document.querySelector(be);if(!e.audiencePreset){const r=a?.dataset?.audiencePreset??"";r&&(e.audiencePreset=r)}const n=Number.parseInt(a?.dataset?.perPage??"",10);n>0&&(xe=n);const s=e.audiencePreset?Ze[e.audiencePreset]??[]:[],i=De.initialTabFilters??{};e.appliedFilters=Fe(i,s),e.pendingFilters=Ce(e.appliedFilters),_e?_e.searchSingleIndex({indexName:je(),searchParams:{query:"",hitsPerPage:0,maxValuesPerFacet:100,facetingAfterDistinct:!0,facets:De.facetsParam,facetFilters:Le(De.defaultFilters,De.domain)}}).then(r=>{e.completeFacets=r.facets||{}}).catch(e=>{console.error("Error fetching initial facets:",e)}):console.error("Algolia client not initialized"),document.addEventListener(Se,e=>{const{page:t}=e.detail;r.loadMorePage(t)})}}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.