@algolia/client-analytics
Advanced tools
@@ -12,3 +12,3 @@ // builds/browser.ts | ||
| import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -15,0 +15,0 @@ function getDefaultHosts(region) { |
@@ -1,2 +0,2 @@ | ||
| function W(o){let r,u=`algolia-client-js-${o.key}`;function a(){return r===void 0&&(r=o.localStorage||window.localStorage),r}function g(){return JSON.parse(a().getItem(u)||"{}")}function R(f){a().setItem(u,JSON.stringify(f))}function y(){let f=o.timeToLive?o.timeToLive*1e3:null,e=g(),s=Object.fromEntries(Object.entries(e).filter(([,i])=>i.timestamp!==void 0));if(R(s),!f)return;let n=Object.fromEntries(Object.entries(s).filter(([,i])=>{let d=new Date().getTime();return!(i.timestamp+f<d)}));R(n)}return{get(f,e,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(y(),g()[JSON.stringify(f)])).then(n=>Promise.all([n?n.value:e(),n!==void 0])).then(([n,i])=>Promise.all([n,i||s.miss(n)])).then(([n])=>n)},set(f,e){return Promise.resolve().then(()=>{let s=g();return s[JSON.stringify(f)]={timestamp:new Date().getTime(),value:e},a().setItem(u,JSON.stringify(s)),e})},delete(f){return Promise.resolve().then(()=>{let e=g();delete e[JSON.stringify(f)],a().setItem(u,JSON.stringify(e))})},clear(){return Promise.resolve().then(()=>{a().removeItem(u)})}}}function re(){return{get(o,r,u={miss:()=>Promise.resolve()}){return r().then(g=>Promise.all([g,u.miss(g)])).then(([g])=>g)},set(o,r){return Promise.resolve(r)},delete(o){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(o){let r=[...o.caches],u=r.shift();return u===void 0?re():{get(a,g,R={miss:()=>Promise.resolve()}){return u.get(a,g,R).catch(()=>E({caches:r}).get(a,g,R))},set(a,g){return u.set(a,g).catch(()=>E({caches:r}).set(a,g))},delete(a){return u.delete(a).catch(()=>E({caches:r}).delete(a))},clear(){return u.clear().catch(()=>E({caches:r}).clear())}}}function v(o={serializable:!0}){let r={};return{get(u,a,g={miss:()=>Promise.resolve()}){let R=JSON.stringify(u);if(R in r)return Promise.resolve(o.serializable?JSON.parse(r[R]):r[R]);let y=a();return y.then(f=>g.miss(f)).then(()=>y)},set(u,a){return r[JSON.stringify(u)]=o.serializable?JSON.stringify(a):a,Promise.resolve(a)},delete(u){return delete r[JSON.stringify(u)],Promise.resolve()},clear(){return r={},Promise.resolve()}}}function oe(o){let r={value:`Algolia for JavaScript (${o})`,add(u){let a=`; ${u.segment}${u.version!==void 0?` (${u.version})`:""}`;return r.value.indexOf(a)===-1&&(r.value=`${r.value}${a}`),r}};return r}function z(o,r,u="WithinHeaders"){let a={"x-algolia-api-key":r,"x-algolia-application-id":o};return{headers(){return u==="WithinHeaders"?a:{}},queryParameters(){return u==="WithinQueryParameters"?a:{}}}}function J({algoliaAgents:o,client:r,version:u}){let a=oe(u).add({segment:r,version:u});return o.forEach(g=>a.add(g)),a}function M(){return{debug(o,r){return Promise.resolve()},info(o,r){return Promise.resolve()},error(o,r){return Promise.resolve()}}}var se=750,$=120*1e3;function j(o,r="up"){let u=Date.now();function a(){return r==="up"||Date.now()-u>$}function g(){return r==="timed out"&&Date.now()-u<=$}return{...o,status:r,lastUpdate:u,isUp:a,isTimedOut:g}}var B=class extends Error{name="AlgoliaError";constructor(o,r){super(o),r&&(this.name=r)}};var X=class extends B{stackTrace;constructor(o,r,u){super(o,u),this.stackTrace=r}},ne=class extends X{constructor(o){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",o,"RetryError")}},H=class extends X{status;constructor(o,r,u,a="ApiError"){super(o,u,a),this.status=r}},ie=class extends B{response;constructor(o,r){super(o,"DeserializationError"),this.response=r}},ae=class extends H{error;constructor(o,r,u,a){super(o,r,a,"DetailedApiError"),this.error=u}};function ue(o,r,u){let a=ce(u),g=`${o.protocol}://${o.url}${o.port?`:${o.port}`:""}/${r.charAt(0)==="/"?r.substring(1):r}`;return a.length&&(g+=`?${a}`),g}function ce(o){return Object.keys(o).filter(r=>o[r]!==void 0).sort().map(r=>`${r}=${encodeURIComponent(Object.prototype.toString.call(o[r])==="[object Array]"?o[r].join(","):o[r]).replace(/\+/g,"%20")}`).join("&")}function de(o,r){if(o.method==="GET"||o.data===void 0&&r.data===void 0)return;let u=Array.isArray(o.data)?o.data:{...o.data,...r.data};return JSON.stringify(u)}function le(o,r,u){let a={Accept:"application/json",...o,...r,...u},g={};return Object.keys(a).forEach(R=>{let y=a[R];g[R.toLowerCase()]=y}),g}function fe(o){try{return JSON.parse(o.content)}catch(r){throw new ie(r.message,o)}}function pe({content:o,status:r},u){try{let a=JSON.parse(o);return"error"in a?new ae(a.message,r,a.error,u):new H(a.message,r,u)}catch{}return new H(o,r,u)}function me({isTimedOut:o,status:r}){return!o&&~~r===0}function he({isTimedOut:o,status:r}){return o||me({isTimedOut:o,status:r})||~~(r/100)!==2&&~~(r/100)!==4}function ge({status:o}){return~~(o/100)===2}function Pe(o){return o.map(r=>K(r))}function K(o){let r=o.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...o,request:{...o.request,headers:{...o.request.headers,...r}}}}function V({hosts:o,hostsCache:r,baseHeaders:u,logger:a,baseQueryParameters:g,algoliaAgent:R,timeouts:y,requester:f,requestsCache:e,responsesCache:s,compress:n,compression:i}){async function d(t){let c=await Promise.all(t.map(P=>r.get(P,()=>Promise.resolve(j(P))))),m=c.filter(P=>P.isUp()),h=c.filter(P=>P.isTimedOut()),S=[...m,...h];return{hosts:S.length>0?S:t,getTimeout(P,w){return(h.length===0&&P===0?1:h.length+3+P)*w}}}async function l(t,c,m){let h=[],S=de(t,c),q=le(u,t.headers,c.headers),P=i==="gzip"&&S!==void 0&&S.length>se&&(t.method==="POST"||t.method==="PUT");P&&n===void 0&&a.info("Compression is disabled because no compress method is available.");let w=P&&n!==void 0,I=w?await n(S):S;w&&(q["content-encoding"]="gzip");let ee=t.method==="GET"?{...t.data,...c.data}:{},x={...g,...t.queryParameters,...ee};if(R.value&&(x["x-algolia-agent"]=R.value),c&&c.queryParameters)for(let T of Object.keys(c.queryParameters))!c.queryParameters[T]||Object.prototype.toString.call(c.queryParameters[T])==="[object Object]"?x[T]=c.queryParameters[T]:x[T]=c.queryParameters[T].toString();let O=0,D=async(T,N)=>{let G=T.pop();if(G===void 0)throw new ne(Pe(h));let k={...y,...c.timeouts},Q={data:I,headers:q,method:t.method,url:ue(G,t.path,x),connectTimeout:N(O,k.connect),responseTimeout:N(O,m?k.read:k.write)},U=b=>{let L={request:Q,response:b,host:G,triesLeft:T.length};return h.push(L),L},C=await f.send(Q);if(he(C)){let b=U(C);return C.isTimedOut&&O++,a.info("Retryable failure",K(b)),await r.set(G,j(G,C.isTimedOut?"timed out":"down")),D(T,N)}if(ge(C))return fe(C);throw U(C),pe(C,h)},te=o.filter(T=>T.accept==="readWrite"||(m?T.accept==="read":T.accept==="write")),_=await d(te);return D([..._.hosts].reverse(),_.getTimeout)}function p(t,c={}){let m=()=>l(t,c,h),h=t.useReadTransporter||t.method==="GET";if((c.cacheable||t.cacheable)!==!0)return m();let q={request:t,requestOptions:c,transporter:{queryParameters:g,headers:u}};return s.get(q,()=>e.get(q,()=>e.set(q,m()).then(P=>Promise.all([e.delete(q),P]),P=>Promise.all([e.delete(q),Promise.reject(P)])).then(([P,w])=>w)),{miss:P=>s.set(q,P)})}return{hostsCache:r,requester:f,timeouts:y,logger:a,algoliaAgent:R,baseHeaders:u,baseQueryParameters:g,hosts:o,request:p,requestsCache:e,responsesCache:s}}function Y(){function o(r){return new Promise(u=>{let a=new XMLHttpRequest;a.open(r.method,r.url,!0),Object.keys(r.headers).forEach(f=>a.setRequestHeader(f,r.headers[f]));let g=(f,e)=>setTimeout(()=>{a.abort(),u({status:0,content:e,isTimedOut:!0})},f),R=g(r.connectTimeout,"Connection timeout"),y;a.onreadystatechange=()=>{a.readyState>a.OPENED&&y===void 0&&(clearTimeout(R),y=g(r.responseTimeout,"Socket timeout"))},a.onerror=()=>{a.status===0&&(clearTimeout(R),clearTimeout(y),u({content:a.responseText||"Network request failed",status:a.status,isTimedOut:!1}))},a.onload=()=>{clearTimeout(R),clearTimeout(y),u({content:a.responseText,status:a.status,isTimedOut:!1})},a.send(r.data)})}return{send:o}}var A="5.51.0",F=["de","us"];function Re(o){return[{url:o?"analytics.{region}.algolia.com".replace("{region}",o):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Z({appId:o,apiKey:r,authMode:u,algoliaAgents:a,region:g,...R}){let y=z(o,r,u),f=V({hosts:Re(g),...R,algoliaAgent:J({algoliaAgents:a,client:"Analytics",version:A}),baseHeaders:{"content-type":"text/plain",...y.headers(),...R.baseHeaders},baseQueryParameters:{...y.queryParameters(),...R.baseQueryParameters}});return{transporter:f,appId:o,apiKey:r,clearCache(){return Promise.all([f.requestsCache.clear(),f.responsesCache.clear()]).then(()=>{})},get _ua(){return f.algoliaAgent.value},addAlgoliaAgent(e,s){f.algoliaAgent.add({segment:e,version:s})},setClientApiKey({apiKey:e}){!u||u==="WithinHeaders"?f.baseHeaders["x-algolia-api-key"]=e:f.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let p={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customGet({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let p={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customPost({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let t={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},customPut({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let t={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},getAddToCartRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let l="/2/conversions/addToCartRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getAverageClickPosition({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let l="/2/clicks/averageClickPosition",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickPositions({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let l="/2/clicks/positions",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickThroughRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let l="/2/clicks/clickThroughRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getConversionRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let l="/2/conversions/conversionRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoClickRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let l="/2/searches/noClickRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoResultsRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let l="/2/searches/noResultRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getPurchaseRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let l="/2/conversions/purchaseRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getRevenue({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let l="/2/conversions/revenue",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let l="/2/searches/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesNoClicks({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let t="/2/searches/noClicks",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getSearchesNoResults({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let t="/2/searches/noResults",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getStatus({index:e},s){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let n="/2/status",i={},d={};e!==void 0&&(d.index=e.toString());let l={method:"GET",path:n,queryParameters:d,headers:i};return f.request(l,s)},getTopCountries({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let t="/2/countries",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getTopFilterAttributes({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let c="/2/filters",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopFilterForAttribute({attribute:e,index:s,search:n,startDate:i,endDate:d,limit:l,offset:p,tags:t},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!s)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let m="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),h={},S={};s!==void 0&&(S.index=s.toString()),n!==void 0&&(S.search=n.toString()),i!==void 0&&(S.startDate=i.toString()),d!==void 0&&(S.endDate=d.toString()),l!==void 0&&(S.limit=l.toString()),p!==void 0&&(S.offset=p.toString()),t!==void 0&&(S.tags=t.toString());let q={method:"GET",path:m,queryParameters:S,headers:h};return f.request(q,c)},getTopFiltersNoResults({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let c="/2/filters/noResults",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopHits({index:e,search:s,clickAnalytics:n,revenueAnalytics:i,startDate:d,endDate:l,limit:p,offset:t,tags:c},m){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let h="/2/hits",S={},q={};e!==void 0&&(q.index=e.toString()),s!==void 0&&(q.search=s.toString()),n!==void 0&&(q.clickAnalytics=n.toString()),i!==void 0&&(q.revenueAnalytics=i.toString()),d!==void 0&&(q.startDate=d.toString()),l!==void 0&&(q.endDate=l.toString()),p!==void 0&&(q.limit=p.toString()),t!==void 0&&(q.offset=t.toString()),c!==void 0&&(q.tags=c.toString());let P={method:"GET",path:h,queryParameters:q,headers:S};return f.request(P,m)},getTopSearches({index:e,clickAnalytics:s,revenueAnalytics:n,startDate:i,endDate:d,orderBy:l,direction:p,limit:t,offset:c,tags:m},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let S="/2/searches",q={},P={};e!==void 0&&(P.index=e.toString()),s!==void 0&&(P.clickAnalytics=s.toString()),n!==void 0&&(P.revenueAnalytics=n.toString()),i!==void 0&&(P.startDate=i.toString()),d!==void 0&&(P.endDate=d.toString()),l!==void 0&&(P.orderBy=l.toString()),p!==void 0&&(P.direction=p.toString()),t!==void 0&&(P.limit=t.toString()),c!==void 0&&(P.offset=c.toString()),m!==void 0&&(P.tags=m.toString());let w={method:"GET",path:S,queryParameters:P,headers:q};return f.request(w,h)},getUsersCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let l="/2/users/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)}}}function Ft(o,r,u,a){if(!o||typeof o!="string")throw new Error("`appId` is missing.");if(!r||typeof r!="string")throw new Error("`apiKey` is missing.");if(u&&(typeof u!="string"||!F.includes(u)))throw new Error(`\`region\` must be one of the following: ${F.join(", ")}`);let{compression:g,...R}=a||{};return Z({appId:o,apiKey:r,region:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:M(),requester:Y(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:v(),requestsCache:v({serializable:!1}),hostsCache:E({caches:[W({key:`${A}-${o}`}),v()]}),...R})}export{Ft as analyticsClient,A as apiClientVersion}; | ||
| function W(o){let r,u=`algolia-client-js-${o.key}`;function a(){return r===void 0&&(r=o.localStorage||window.localStorage),r}function g(){return JSON.parse(a().getItem(u)||"{}")}function R(f){a().setItem(u,JSON.stringify(f))}function y(){let f=o.timeToLive?o.timeToLive*1e3:null,e=g(),s=Object.fromEntries(Object.entries(e).filter(([,i])=>i.timestamp!==void 0));if(R(s),!f)return;let n=Object.fromEntries(Object.entries(s).filter(([,i])=>{let d=new Date().getTime();return!(i.timestamp+f<d)}));R(n)}return{get(f,e,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(y(),g()[JSON.stringify(f)])).then(n=>Promise.all([n?n.value:e(),n!==void 0])).then(([n,i])=>Promise.all([n,i||s.miss(n)])).then(([n])=>n)},set(f,e){return Promise.resolve().then(()=>{let s=g();return s[JSON.stringify(f)]={timestamp:new Date().getTime(),value:e},a().setItem(u,JSON.stringify(s)),e})},delete(f){return Promise.resolve().then(()=>{let e=g();delete e[JSON.stringify(f)],a().setItem(u,JSON.stringify(e))})},clear(){return Promise.resolve().then(()=>{a().removeItem(u)})}}}function re(){return{get(o,r,u={miss:()=>Promise.resolve()}){return r().then(g=>Promise.all([g,u.miss(g)])).then(([g])=>g)},set(o,r){return Promise.resolve(r)},delete(o){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(o){let r=[...o.caches],u=r.shift();return u===void 0?re():{get(a,g,R={miss:()=>Promise.resolve()}){return u.get(a,g,R).catch(()=>E({caches:r}).get(a,g,R))},set(a,g){return u.set(a,g).catch(()=>E({caches:r}).set(a,g))},delete(a){return u.delete(a).catch(()=>E({caches:r}).delete(a))},clear(){return u.clear().catch(()=>E({caches:r}).clear())}}}function v(o={serializable:!0}){let r={};return{get(u,a,g={miss:()=>Promise.resolve()}){let R=JSON.stringify(u);if(R in r)return Promise.resolve(o.serializable?JSON.parse(r[R]):r[R]);let y=a();return y.then(f=>g.miss(f)).then(()=>y)},set(u,a){return r[JSON.stringify(u)]=o.serializable?JSON.stringify(a):a,Promise.resolve(a)},delete(u){return delete r[JSON.stringify(u)],Promise.resolve()},clear(){return r={},Promise.resolve()}}}function oe(o){let r={value:`Algolia for JavaScript (${o})`,add(u){let a=`; ${u.segment}${u.version!==void 0?` (${u.version})`:""}`;return r.value.indexOf(a)===-1&&(r.value=`${r.value}${a}`),r}};return r}function z(o,r,u="WithinHeaders"){let a={"x-algolia-api-key":r,"x-algolia-application-id":o};return{headers(){return u==="WithinHeaders"?a:{}},queryParameters(){return u==="WithinQueryParameters"?a:{}}}}function J({algoliaAgents:o,client:r,version:u}){let a=oe(u).add({segment:r,version:u});return o.forEach(g=>a.add(g)),a}function M(){return{debug(o,r){return Promise.resolve()},info(o,r){return Promise.resolve()},error(o,r){return Promise.resolve()}}}var se=750,$=120*1e3;function j(o,r="up"){let u=Date.now();function a(){return r==="up"||Date.now()-u>$}function g(){return r==="timed out"&&Date.now()-u<=$}return{...o,status:r,lastUpdate:u,isUp:a,isTimedOut:g}}var B=class extends Error{name="AlgoliaError";constructor(o,r){super(o),r&&(this.name=r)}};var X=class extends B{stackTrace;constructor(o,r,u){super(o,u),this.stackTrace=r}},ne=class extends X{constructor(o){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",o,"RetryError")}},H=class extends X{status;constructor(o,r,u,a="ApiError"){super(o,u,a),this.status=r}},ie=class extends B{response;constructor(o,r){super(o,"DeserializationError"),this.response=r}},ae=class extends H{error;constructor(o,r,u,a){super(o,r,a,"DetailedApiError"),this.error=u}};function ue(o,r,u){let a=ce(u),g=`${o.protocol}://${o.url}${o.port?`:${o.port}`:""}/${r.charAt(0)==="/"?r.substring(1):r}`;return a.length&&(g+=`?${a}`),g}function ce(o){return Object.keys(o).filter(r=>o[r]!==void 0).sort().map(r=>`${r}=${encodeURIComponent(Object.prototype.toString.call(o[r])==="[object Array]"?o[r].join(","):o[r]).replace(/\+/g,"%20")}`).join("&")}function de(o,r){if(o.method==="GET"||o.data===void 0&&r.data===void 0)return;let u=Array.isArray(o.data)?o.data:{...o.data,...r.data};return JSON.stringify(u)}function le(o,r,u){let a={Accept:"application/json",...o,...r,...u},g={};return Object.keys(a).forEach(R=>{let y=a[R];g[R.toLowerCase()]=y}),g}function fe(o){try{return JSON.parse(o.content)}catch(r){throw new ie(r.message,o)}}function pe({content:o,status:r},u){try{let a=JSON.parse(o);return"error"in a?new ae(a.message,r,a.error,u):new H(a.message,r,u)}catch{}return new H(o,r,u)}function me({isTimedOut:o,status:r}){return!o&&~~r===0}function he({isTimedOut:o,status:r}){return o||me({isTimedOut:o,status:r})||~~(r/100)!==2&&~~(r/100)!==4}function ge({status:o}){return~~(o/100)===2}function Pe(o){return o.map(r=>K(r))}function K(o){let r=o.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...o,request:{...o.request,headers:{...o.request.headers,...r}}}}function V({hosts:o,hostsCache:r,baseHeaders:u,logger:a,baseQueryParameters:g,algoliaAgent:R,timeouts:y,requester:f,requestsCache:e,responsesCache:s,compress:n,compression:i}){async function d(t){let c=await Promise.all(t.map(P=>r.get(P,()=>Promise.resolve(j(P))))),m=c.filter(P=>P.isUp()),h=c.filter(P=>P.isTimedOut()),S=[...m,...h];return{hosts:S.length>0?S:t,getTimeout(P,w){return(h.length===0&&P===0?1:h.length+3+P)*w}}}async function l(t,c,m){let h=[],S=de(t,c),q=le(u,t.headers,c.headers),P=i==="gzip"&&S!==void 0&&S.length>se&&(t.method==="POST"||t.method==="PUT");P&&n===void 0&&a.info("Compression is disabled because no compress method is available.");let w=P&&n!==void 0,I=w?await n(S):S;w&&(q["content-encoding"]="gzip");let ee=t.method==="GET"?{...t.data,...c.data}:{},x={...g,...t.queryParameters,...ee};if(R.value&&(x["x-algolia-agent"]=R.value),c&&c.queryParameters)for(let T of Object.keys(c.queryParameters))!c.queryParameters[T]||Object.prototype.toString.call(c.queryParameters[T])==="[object Object]"?x[T]=c.queryParameters[T]:x[T]=c.queryParameters[T].toString();let O=0,D=async(T,N)=>{let G=T.pop();if(G===void 0)throw new ne(Pe(h));let k={...y,...c.timeouts},Q={data:I,headers:q,method:t.method,url:ue(G,t.path,x),connectTimeout:N(O,k.connect),responseTimeout:N(O,m?k.read:k.write)},U=b=>{let L={request:Q,response:b,host:G,triesLeft:T.length};return h.push(L),L},C=await f.send(Q);if(he(C)){let b=U(C);return C.isTimedOut&&O++,a.info("Retryable failure",K(b)),await r.set(G,j(G,C.isTimedOut?"timed out":"down")),D(T,N)}if(ge(C))return fe(C);throw U(C),pe(C,h)},te=o.filter(T=>T.accept==="readWrite"||(m?T.accept==="read":T.accept==="write")),_=await d(te);return D([..._.hosts].reverse(),_.getTimeout)}function p(t,c={}){let m=()=>l(t,c,h),h=t.useReadTransporter||t.method==="GET";if((c.cacheable||t.cacheable)!==!0)return m();let q={request:t,requestOptions:c,transporter:{queryParameters:g,headers:u}};return s.get(q,()=>e.get(q,()=>e.set(q,m()).then(P=>Promise.all([e.delete(q),P]),P=>Promise.all([e.delete(q),Promise.reject(P)])).then(([P,w])=>w)),{miss:P=>s.set(q,P)})}return{hostsCache:r,requester:f,timeouts:y,logger:a,algoliaAgent:R,baseHeaders:u,baseQueryParameters:g,hosts:o,request:p,requestsCache:e,responsesCache:s}}function Y(){function o(r){return new Promise(u=>{let a=new XMLHttpRequest;a.open(r.method,r.url,!0),Object.keys(r.headers).forEach(f=>a.setRequestHeader(f,r.headers[f]));let g=(f,e)=>setTimeout(()=>{a.abort(),u({status:0,content:e,isTimedOut:!0})},f),R=g(r.connectTimeout,"Connection timeout"),y;a.onreadystatechange=()=>{a.readyState>a.OPENED&&y===void 0&&(clearTimeout(R),y=g(r.responseTimeout,"Socket timeout"))},a.onerror=()=>{a.status===0&&(clearTimeout(R),clearTimeout(y),u({content:a.responseText||"Network request failed",status:a.status,isTimedOut:!1}))},a.onload=()=>{clearTimeout(R),clearTimeout(y),u({content:a.responseText,status:a.status,isTimedOut:!1})},a.send(r.data)})}return{send:o}}var A="5.52.0",F=["de","us"];function Re(o){return[{url:o?"analytics.{region}.algolia.com".replace("{region}",o):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Z({appId:o,apiKey:r,authMode:u,algoliaAgents:a,region:g,...R}){let y=z(o,r,u),f=V({hosts:Re(g),...R,algoliaAgent:J({algoliaAgents:a,client:"Analytics",version:A}),baseHeaders:{"content-type":"text/plain",...y.headers(),...R.baseHeaders},baseQueryParameters:{...y.queryParameters(),...R.baseQueryParameters}});return{transporter:f,appId:o,apiKey:r,clearCache(){return Promise.all([f.requestsCache.clear(),f.responsesCache.clear()]).then(()=>{})},get _ua(){return f.algoliaAgent.value},addAlgoliaAgent(e,s){f.algoliaAgent.add({segment:e,version:s})},setClientApiKey({apiKey:e}){!u||u==="WithinHeaders"?f.baseHeaders["x-algolia-api-key"]=e:f.baseQueryParameters["x-algolia-api-key"]=e},customDelete({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let p={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customGet({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let p={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customPost({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let t={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},customPut({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let t={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},getAddToCartRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let l="/2/conversions/addToCartRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getAverageClickPosition({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let l="/2/clicks/averageClickPosition",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickPositions({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let l="/2/clicks/positions",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickThroughRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let l="/2/clicks/clickThroughRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getConversionRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let l="/2/conversions/conversionRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoClickRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let l="/2/searches/noClickRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoResultsRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let l="/2/searches/noResultRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getPurchaseRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let l="/2/conversions/purchaseRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getRevenue({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let l="/2/conversions/revenue",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let l="/2/searches/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesNoClicks({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let t="/2/searches/noClicks",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getSearchesNoResults({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let t="/2/searches/noResults",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getStatus({index:e},s){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let n="/2/status",i={},d={};e!==void 0&&(d.index=e.toString());let l={method:"GET",path:n,queryParameters:d,headers:i};return f.request(l,s)},getTopCountries({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let t="/2/countries",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getTopFilterAttributes({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let c="/2/filters",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopFilterForAttribute({attribute:e,index:s,search:n,startDate:i,endDate:d,limit:l,offset:p,tags:t},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!s)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let m="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),h={},S={};s!==void 0&&(S.index=s.toString()),n!==void 0&&(S.search=n.toString()),i!==void 0&&(S.startDate=i.toString()),d!==void 0&&(S.endDate=d.toString()),l!==void 0&&(S.limit=l.toString()),p!==void 0&&(S.offset=p.toString()),t!==void 0&&(S.tags=t.toString());let q={method:"GET",path:m,queryParameters:S,headers:h};return f.request(q,c)},getTopFiltersNoResults({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let c="/2/filters/noResults",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopHits({index:e,search:s,clickAnalytics:n,revenueAnalytics:i,startDate:d,endDate:l,limit:p,offset:t,tags:c},m){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let h="/2/hits",S={},q={};e!==void 0&&(q.index=e.toString()),s!==void 0&&(q.search=s.toString()),n!==void 0&&(q.clickAnalytics=n.toString()),i!==void 0&&(q.revenueAnalytics=i.toString()),d!==void 0&&(q.startDate=d.toString()),l!==void 0&&(q.endDate=l.toString()),p!==void 0&&(q.limit=p.toString()),t!==void 0&&(q.offset=t.toString()),c!==void 0&&(q.tags=c.toString());let P={method:"GET",path:h,queryParameters:q,headers:S};return f.request(P,m)},getTopSearches({index:e,clickAnalytics:s,revenueAnalytics:n,startDate:i,endDate:d,orderBy:l,direction:p,limit:t,offset:c,tags:m},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let S="/2/searches",q={},P={};e!==void 0&&(P.index=e.toString()),s!==void 0&&(P.clickAnalytics=s.toString()),n!==void 0&&(P.revenueAnalytics=n.toString()),i!==void 0&&(P.startDate=i.toString()),d!==void 0&&(P.endDate=d.toString()),l!==void 0&&(P.orderBy=l.toString()),p!==void 0&&(P.direction=p.toString()),t!==void 0&&(P.limit=t.toString()),c!==void 0&&(P.offset=c.toString()),m!==void 0&&(P.tags=m.toString());let w={method:"GET",path:S,queryParameters:P,headers:q};return f.request(w,h)},getUsersCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let l="/2/users/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)}}}function Ft(o,r,u,a){if(!o||typeof o!="string")throw new Error("`appId` is missing.");if(!r||typeof r!="string")throw new Error("`apiKey` is missing.");if(u&&(typeof u!="string"||!F.includes(u)))throw new Error(`\`region\` must be one of the following: ${F.join(", ")}`);let{compression:g,...R}=a||{};return Z({appId:o,apiKey:r,region:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:M(),requester:Y(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:v(),requestsCache:v({serializable:!1}),hostsCache:E({caches:[W({key:`${A}-${o}`}),v()]}),...R})}export{Ft as analyticsClient,A as apiClientVersion}; | ||
| //# sourceMappingURL=browser.min.js.map |
@@ -7,3 +7,3 @@ (function (global, factory) { | ||
| function W(o){let r,u=`algolia-client-js-${o.key}`;function a(){return r===void 0&&(r=o.localStorage||window.localStorage),r}function g(){return JSON.parse(a().getItem(u)||"{}")}function R(f){a().setItem(u,JSON.stringify(f));}function y(){let f=o.timeToLive?o.timeToLive*1e3:null,e=g(),s=Object.fromEntries(Object.entries(e).filter(([,i])=>i.timestamp!==void 0));if(R(s),!f)return;let n=Object.fromEntries(Object.entries(s).filter(([,i])=>{let d=new Date().getTime();return !(i.timestamp+f<d)}));R(n);}return {get(f,e,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(y(),g()[JSON.stringify(f)])).then(n=>Promise.all([n?n.value:e(),n!==void 0])).then(([n,i])=>Promise.all([n,i||s.miss(n)])).then(([n])=>n)},set(f,e){return Promise.resolve().then(()=>{let s=g();return s[JSON.stringify(f)]={timestamp:new Date().getTime(),value:e},a().setItem(u,JSON.stringify(s)),e})},delete(f){return Promise.resolve().then(()=>{let e=g();delete e[JSON.stringify(f)],a().setItem(u,JSON.stringify(e));})},clear(){return Promise.resolve().then(()=>{a().removeItem(u);})}}}function re(){return {get(o,r,u={miss:()=>Promise.resolve()}){return r().then(g=>Promise.all([g,u.miss(g)])).then(([g])=>g)},set(o,r){return Promise.resolve(r)},delete(o){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(o){let r=[...o.caches],u=r.shift();return u===void 0?re():{get(a,g,R={miss:()=>Promise.resolve()}){return u.get(a,g,R).catch(()=>E({caches:r}).get(a,g,R))},set(a,g){return u.set(a,g).catch(()=>E({caches:r}).set(a,g))},delete(a){return u.delete(a).catch(()=>E({caches:r}).delete(a))},clear(){return u.clear().catch(()=>E({caches:r}).clear())}}}function v(o={serializable:true}){let r={};return {get(u,a,g={miss:()=>Promise.resolve()}){let R=JSON.stringify(u);if(R in r)return Promise.resolve(o.serializable?JSON.parse(r[R]):r[R]);let y=a();return y.then(f=>g.miss(f)).then(()=>y)},set(u,a){return r[JSON.stringify(u)]=o.serializable?JSON.stringify(a):a,Promise.resolve(a)},delete(u){return delete r[JSON.stringify(u)],Promise.resolve()},clear(){return r={},Promise.resolve()}}}function oe(o){let r={value:`Algolia for JavaScript (${o})`,add(u){let a=`; ${u.segment}${u.version!==void 0?` (${u.version})`:""}`;return r.value.indexOf(a)===-1&&(r.value=`${r.value}${a}`),r}};return r}function z(o,r,u="WithinHeaders"){let a={"x-algolia-api-key":r,"x-algolia-application-id":o};return {headers(){return u==="WithinHeaders"?a:{}},queryParameters(){return u==="WithinQueryParameters"?a:{}}}}function J({algoliaAgents:o,client:r,version:u}){let a=oe(u).add({segment:r,version:u});return o.forEach(g=>a.add(g)),a}function M(){return {debug(o,r){return Promise.resolve()},info(o,r){return Promise.resolve()},error(o,r){return Promise.resolve()}}}var se=750,$=120*1e3;function j(o,r="up"){let u=Date.now();function a(){return r==="up"||Date.now()-u>$}function g(){return r==="timed out"&&Date.now()-u<=$}return {...o,status:r,lastUpdate:u,isUp:a,isTimedOut:g}}var B=class extends Error{name="AlgoliaError";constructor(o,r){super(o),r&&(this.name=r);}};var X=class extends B{stackTrace;constructor(o,r,u){super(o,u),this.stackTrace=r;}},ne=class extends X{constructor(o){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",o,"RetryError");}},H=class extends X{status;constructor(o,r,u,a="ApiError"){super(o,u,a),this.status=r;}},ie=class extends B{response;constructor(o,r){super(o,"DeserializationError"),this.response=r;}},ae=class extends H{error;constructor(o,r,u,a){super(o,r,a,"DetailedApiError"),this.error=u;}};function ue(o,r,u){let a=ce(u),g=`${o.protocol}://${o.url}${o.port?`:${o.port}`:""}/${r.charAt(0)==="/"?r.substring(1):r}`;return a.length&&(g+=`?${a}`),g}function ce(o){return Object.keys(o).filter(r=>o[r]!==void 0).sort().map(r=>`${r}=${encodeURIComponent(Object.prototype.toString.call(o[r])==="[object Array]"?o[r].join(","):o[r]).replace(/\+/g,"%20")}`).join("&")}function de(o,r){if(o.method==="GET"||o.data===void 0&&r.data===void 0)return;let u=Array.isArray(o.data)?o.data:{...o.data,...r.data};return JSON.stringify(u)}function le(o,r,u){let a={Accept:"application/json",...o,...r,...u},g={};return Object.keys(a).forEach(R=>{let y=a[R];g[R.toLowerCase()]=y;}),g}function fe(o){try{return JSON.parse(o.content)}catch(r){throw new ie(r.message,o)}}function pe({content:o,status:r},u){try{let a=JSON.parse(o);return "error"in a?new ae(a.message,r,a.error,u):new H(a.message,r,u)}catch{}return new H(o,r,u)}function me({isTimedOut:o,status:r}){return !o&&~~r===0}function he({isTimedOut:o,status:r}){return o||me({isTimedOut:o,status:r})||~~(r/100)!==2&&~~(r/100)!==4}function ge({status:o}){return ~~(o/100)===2}function Pe(o){return o.map(r=>K(r))}function K(o){let r=o.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...o,request:{...o.request,headers:{...o.request.headers,...r}}}}function V({hosts:o,hostsCache:r,baseHeaders:u,logger:a,baseQueryParameters:g,algoliaAgent:R,timeouts:y,requester:f,requestsCache:e,responsesCache:s,compress:n,compression:i}){async function d(t){let c=await Promise.all(t.map(P=>r.get(P,()=>Promise.resolve(j(P))))),m=c.filter(P=>P.isUp()),h=c.filter(P=>P.isTimedOut()),S=[...m,...h];return {hosts:S.length>0?S:t,getTimeout(P,w){return (h.length===0&&P===0?1:h.length+3+P)*w}}}async function l(t,c,m){let h=[],S=de(t,c),q=le(u,t.headers,c.headers),P=i==="gzip"&&S!==void 0&&S.length>se&&(t.method==="POST"||t.method==="PUT");P&&n===void 0&&a.info("Compression is disabled because no compress method is available.");let w=P&&n!==void 0,I=w?await n(S):S;w&&(q["content-encoding"]="gzip");let ee=t.method==="GET"?{...t.data,...c.data}:{},x={...g,...t.queryParameters,...ee};if(R.value&&(x["x-algolia-agent"]=R.value),c&&c.queryParameters)for(let T of Object.keys(c.queryParameters))!c.queryParameters[T]||Object.prototype.toString.call(c.queryParameters[T])==="[object Object]"?x[T]=c.queryParameters[T]:x[T]=c.queryParameters[T].toString();let O=0,D=async(T,N)=>{let G=T.pop();if(G===void 0)throw new ne(Pe(h));let k={...y,...c.timeouts},Q={data:I,headers:q,method:t.method,url:ue(G,t.path,x),connectTimeout:N(O,k.connect),responseTimeout:N(O,m?k.read:k.write)},U=b=>{let L={request:Q,response:b,host:G,triesLeft:T.length};return h.push(L),L},C=await f.send(Q);if(he(C)){let b=U(C);return C.isTimedOut&&O++,a.info("Retryable failure",K(b)),await r.set(G,j(G,C.isTimedOut?"timed out":"down")),D(T,N)}if(ge(C))return fe(C);throw U(C),pe(C,h)},te=o.filter(T=>T.accept==="readWrite"||(m?T.accept==="read":T.accept==="write")),_=await d(te);return D([..._.hosts].reverse(),_.getTimeout)}function p(t,c={}){let m=()=>l(t,c,h),h=t.useReadTransporter||t.method==="GET";if((c.cacheable||t.cacheable)!==true)return m();let q={request:t,requestOptions:c,transporter:{queryParameters:g,headers:u}};return s.get(q,()=>e.get(q,()=>e.set(q,m()).then(P=>Promise.all([e.delete(q),P]),P=>Promise.all([e.delete(q),Promise.reject(P)])).then(([P,w])=>w)),{miss:P=>s.set(q,P)})}return {hostsCache:r,requester:f,timeouts:y,logger:a,algoliaAgent:R,baseHeaders:u,baseQueryParameters:g,hosts:o,request:p,requestsCache:e,responsesCache:s}}function Y(){function o(r){return new Promise(u=>{let a=new XMLHttpRequest;a.open(r.method,r.url,true),Object.keys(r.headers).forEach(f=>a.setRequestHeader(f,r.headers[f]));let g=(f,e)=>setTimeout(()=>{a.abort(),u({status:0,content:e,isTimedOut:true});},f),R=g(r.connectTimeout,"Connection timeout"),y;a.onreadystatechange=()=>{a.readyState>a.OPENED&&y===void 0&&(clearTimeout(R),y=g(r.responseTimeout,"Socket timeout"));},a.onerror=()=>{a.status===0&&(clearTimeout(R),clearTimeout(y),u({content:a.responseText||"Network request failed",status:a.status,isTimedOut:false}));},a.onload=()=>{clearTimeout(R),clearTimeout(y),u({content:a.responseText,status:a.status,isTimedOut:false});},a.send(r.data);})}return {send:o}}var A="5.51.0",F=["de","us"];function Re(o){return [{url:o?"analytics.{region}.algolia.com".replace("{region}",o):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Z({appId:o,apiKey:r,authMode:u,algoliaAgents:a,region:g,...R}){let y=z(o,r,u),f=V({hosts:Re(g),...R,algoliaAgent:J({algoliaAgents:a,client:"Analytics",version:A}),baseHeaders:{"content-type":"text/plain",...y.headers(),...R.baseHeaders},baseQueryParameters:{...y.queryParameters(),...R.baseQueryParameters}});return {transporter:f,appId:o,apiKey:r,clearCache(){return Promise.all([f.requestsCache.clear(),f.responsesCache.clear()]).then(()=>{})},get _ua(){return f.algoliaAgent.value},addAlgoliaAgent(e,s){f.algoliaAgent.add({segment:e,version:s});},setClientApiKey({apiKey:e}){!u||u==="WithinHeaders"?f.baseHeaders["x-algolia-api-key"]=e:f.baseQueryParameters["x-algolia-api-key"]=e;},customDelete({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let p={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customGet({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let p={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customPost({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let t={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},customPut({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let t={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},getAddToCartRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let l="/2/conversions/addToCartRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getAverageClickPosition({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let l="/2/clicks/averageClickPosition",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickPositions({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let l="/2/clicks/positions",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickThroughRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let l="/2/clicks/clickThroughRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getConversionRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let l="/2/conversions/conversionRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoClickRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let l="/2/searches/noClickRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoResultsRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let l="/2/searches/noResultRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getPurchaseRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let l="/2/conversions/purchaseRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getRevenue({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let l="/2/conversions/revenue",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let l="/2/searches/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesNoClicks({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let t="/2/searches/noClicks",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getSearchesNoResults({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let t="/2/searches/noResults",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getStatus({index:e},s){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let n="/2/status",i={},d={};e!==void 0&&(d.index=e.toString());let l={method:"GET",path:n,queryParameters:d,headers:i};return f.request(l,s)},getTopCountries({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let t="/2/countries",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getTopFilterAttributes({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let c="/2/filters",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopFilterForAttribute({attribute:e,index:s,search:n,startDate:i,endDate:d,limit:l,offset:p,tags:t},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!s)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let m="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),h={},S={};s!==void 0&&(S.index=s.toString()),n!==void 0&&(S.search=n.toString()),i!==void 0&&(S.startDate=i.toString()),d!==void 0&&(S.endDate=d.toString()),l!==void 0&&(S.limit=l.toString()),p!==void 0&&(S.offset=p.toString()),t!==void 0&&(S.tags=t.toString());let q={method:"GET",path:m,queryParameters:S,headers:h};return f.request(q,c)},getTopFiltersNoResults({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let c="/2/filters/noResults",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopHits({index:e,search:s,clickAnalytics:n,revenueAnalytics:i,startDate:d,endDate:l,limit:p,offset:t,tags:c},m){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let h="/2/hits",S={},q={};e!==void 0&&(q.index=e.toString()),s!==void 0&&(q.search=s.toString()),n!==void 0&&(q.clickAnalytics=n.toString()),i!==void 0&&(q.revenueAnalytics=i.toString()),d!==void 0&&(q.startDate=d.toString()),l!==void 0&&(q.endDate=l.toString()),p!==void 0&&(q.limit=p.toString()),t!==void 0&&(q.offset=t.toString()),c!==void 0&&(q.tags=c.toString());let P={method:"GET",path:h,queryParameters:q,headers:S};return f.request(P,m)},getTopSearches({index:e,clickAnalytics:s,revenueAnalytics:n,startDate:i,endDate:d,orderBy:l,direction:p,limit:t,offset:c,tags:m},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let S="/2/searches",q={},P={};e!==void 0&&(P.index=e.toString()),s!==void 0&&(P.clickAnalytics=s.toString()),n!==void 0&&(P.revenueAnalytics=n.toString()),i!==void 0&&(P.startDate=i.toString()),d!==void 0&&(P.endDate=d.toString()),l!==void 0&&(P.orderBy=l.toString()),p!==void 0&&(P.direction=p.toString()),t!==void 0&&(P.limit=t.toString()),c!==void 0&&(P.offset=c.toString()),m!==void 0&&(P.tags=m.toString());let w={method:"GET",path:S,queryParameters:P,headers:q};return f.request(w,h)},getUsersCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let l="/2/users/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)}}}function Ft(o,r,u,a){if(!o||typeof o!="string")throw new Error("`appId` is missing.");if(!r||typeof r!="string")throw new Error("`apiKey` is missing.");if(u&&(typeof u!="string"||!F.includes(u)))throw new Error(`\`region\` must be one of the following: ${F.join(", ")}`);let{compression:g,...R}=a||{};return Z({appId:o,apiKey:r,region:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:M(),requester:Y(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:v(),requestsCache:v({serializable:false}),hostsCache:E({caches:[W({key:`${A}-${o}`}),v()]}),...R})} | ||
| function W(o){let r,u=`algolia-client-js-${o.key}`;function a(){return r===void 0&&(r=o.localStorage||window.localStorage),r}function g(){return JSON.parse(a().getItem(u)||"{}")}function R(f){a().setItem(u,JSON.stringify(f));}function y(){let f=o.timeToLive?o.timeToLive*1e3:null,e=g(),s=Object.fromEntries(Object.entries(e).filter(([,i])=>i.timestamp!==void 0));if(R(s),!f)return;let n=Object.fromEntries(Object.entries(s).filter(([,i])=>{let d=new Date().getTime();return !(i.timestamp+f<d)}));R(n);}return {get(f,e,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(y(),g()[JSON.stringify(f)])).then(n=>Promise.all([n?n.value:e(),n!==void 0])).then(([n,i])=>Promise.all([n,i||s.miss(n)])).then(([n])=>n)},set(f,e){return Promise.resolve().then(()=>{let s=g();return s[JSON.stringify(f)]={timestamp:new Date().getTime(),value:e},a().setItem(u,JSON.stringify(s)),e})},delete(f){return Promise.resolve().then(()=>{let e=g();delete e[JSON.stringify(f)],a().setItem(u,JSON.stringify(e));})},clear(){return Promise.resolve().then(()=>{a().removeItem(u);})}}}function re(){return {get(o,r,u={miss:()=>Promise.resolve()}){return r().then(g=>Promise.all([g,u.miss(g)])).then(([g])=>g)},set(o,r){return Promise.resolve(r)},delete(o){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(o){let r=[...o.caches],u=r.shift();return u===void 0?re():{get(a,g,R={miss:()=>Promise.resolve()}){return u.get(a,g,R).catch(()=>E({caches:r}).get(a,g,R))},set(a,g){return u.set(a,g).catch(()=>E({caches:r}).set(a,g))},delete(a){return u.delete(a).catch(()=>E({caches:r}).delete(a))},clear(){return u.clear().catch(()=>E({caches:r}).clear())}}}function v(o={serializable:true}){let r={};return {get(u,a,g={miss:()=>Promise.resolve()}){let R=JSON.stringify(u);if(R in r)return Promise.resolve(o.serializable?JSON.parse(r[R]):r[R]);let y=a();return y.then(f=>g.miss(f)).then(()=>y)},set(u,a){return r[JSON.stringify(u)]=o.serializable?JSON.stringify(a):a,Promise.resolve(a)},delete(u){return delete r[JSON.stringify(u)],Promise.resolve()},clear(){return r={},Promise.resolve()}}}function oe(o){let r={value:`Algolia for JavaScript (${o})`,add(u){let a=`; ${u.segment}${u.version!==void 0?` (${u.version})`:""}`;return r.value.indexOf(a)===-1&&(r.value=`${r.value}${a}`),r}};return r}function z(o,r,u="WithinHeaders"){let a={"x-algolia-api-key":r,"x-algolia-application-id":o};return {headers(){return u==="WithinHeaders"?a:{}},queryParameters(){return u==="WithinQueryParameters"?a:{}}}}function J({algoliaAgents:o,client:r,version:u}){let a=oe(u).add({segment:r,version:u});return o.forEach(g=>a.add(g)),a}function M(){return {debug(o,r){return Promise.resolve()},info(o,r){return Promise.resolve()},error(o,r){return Promise.resolve()}}}var se=750,$=120*1e3;function j(o,r="up"){let u=Date.now();function a(){return r==="up"||Date.now()-u>$}function g(){return r==="timed out"&&Date.now()-u<=$}return {...o,status:r,lastUpdate:u,isUp:a,isTimedOut:g}}var B=class extends Error{name="AlgoliaError";constructor(o,r){super(o),r&&(this.name=r);}};var X=class extends B{stackTrace;constructor(o,r,u){super(o,u),this.stackTrace=r;}},ne=class extends X{constructor(o){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",o,"RetryError");}},H=class extends X{status;constructor(o,r,u,a="ApiError"){super(o,u,a),this.status=r;}},ie=class extends B{response;constructor(o,r){super(o,"DeserializationError"),this.response=r;}},ae=class extends H{error;constructor(o,r,u,a){super(o,r,a,"DetailedApiError"),this.error=u;}};function ue(o,r,u){let a=ce(u),g=`${o.protocol}://${o.url}${o.port?`:${o.port}`:""}/${r.charAt(0)==="/"?r.substring(1):r}`;return a.length&&(g+=`?${a}`),g}function ce(o){return Object.keys(o).filter(r=>o[r]!==void 0).sort().map(r=>`${r}=${encodeURIComponent(Object.prototype.toString.call(o[r])==="[object Array]"?o[r].join(","):o[r]).replace(/\+/g,"%20")}`).join("&")}function de(o,r){if(o.method==="GET"||o.data===void 0&&r.data===void 0)return;let u=Array.isArray(o.data)?o.data:{...o.data,...r.data};return JSON.stringify(u)}function le(o,r,u){let a={Accept:"application/json",...o,...r,...u},g={};return Object.keys(a).forEach(R=>{let y=a[R];g[R.toLowerCase()]=y;}),g}function fe(o){try{return JSON.parse(o.content)}catch(r){throw new ie(r.message,o)}}function pe({content:o,status:r},u){try{let a=JSON.parse(o);return "error"in a?new ae(a.message,r,a.error,u):new H(a.message,r,u)}catch{}return new H(o,r,u)}function me({isTimedOut:o,status:r}){return !o&&~~r===0}function he({isTimedOut:o,status:r}){return o||me({isTimedOut:o,status:r})||~~(r/100)!==2&&~~(r/100)!==4}function ge({status:o}){return ~~(o/100)===2}function Pe(o){return o.map(r=>K(r))}function K(o){let r=o.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...o,request:{...o.request,headers:{...o.request.headers,...r}}}}function V({hosts:o,hostsCache:r,baseHeaders:u,logger:a,baseQueryParameters:g,algoliaAgent:R,timeouts:y,requester:f,requestsCache:e,responsesCache:s,compress:n,compression:i}){async function d(t){let c=await Promise.all(t.map(P=>r.get(P,()=>Promise.resolve(j(P))))),m=c.filter(P=>P.isUp()),h=c.filter(P=>P.isTimedOut()),S=[...m,...h];return {hosts:S.length>0?S:t,getTimeout(P,w){return (h.length===0&&P===0?1:h.length+3+P)*w}}}async function l(t,c,m){let h=[],S=de(t,c),q=le(u,t.headers,c.headers),P=i==="gzip"&&S!==void 0&&S.length>se&&(t.method==="POST"||t.method==="PUT");P&&n===void 0&&a.info("Compression is disabled because no compress method is available.");let w=P&&n!==void 0,I=w?await n(S):S;w&&(q["content-encoding"]="gzip");let ee=t.method==="GET"?{...t.data,...c.data}:{},x={...g,...t.queryParameters,...ee};if(R.value&&(x["x-algolia-agent"]=R.value),c&&c.queryParameters)for(let T of Object.keys(c.queryParameters))!c.queryParameters[T]||Object.prototype.toString.call(c.queryParameters[T])==="[object Object]"?x[T]=c.queryParameters[T]:x[T]=c.queryParameters[T].toString();let O=0,D=async(T,N)=>{let G=T.pop();if(G===void 0)throw new ne(Pe(h));let k={...y,...c.timeouts},Q={data:I,headers:q,method:t.method,url:ue(G,t.path,x),connectTimeout:N(O,k.connect),responseTimeout:N(O,m?k.read:k.write)},U=b=>{let L={request:Q,response:b,host:G,triesLeft:T.length};return h.push(L),L},C=await f.send(Q);if(he(C)){let b=U(C);return C.isTimedOut&&O++,a.info("Retryable failure",K(b)),await r.set(G,j(G,C.isTimedOut?"timed out":"down")),D(T,N)}if(ge(C))return fe(C);throw U(C),pe(C,h)},te=o.filter(T=>T.accept==="readWrite"||(m?T.accept==="read":T.accept==="write")),_=await d(te);return D([..._.hosts].reverse(),_.getTimeout)}function p(t,c={}){let m=()=>l(t,c,h),h=t.useReadTransporter||t.method==="GET";if((c.cacheable||t.cacheable)!==true)return m();let q={request:t,requestOptions:c,transporter:{queryParameters:g,headers:u}};return s.get(q,()=>e.get(q,()=>e.set(q,m()).then(P=>Promise.all([e.delete(q),P]),P=>Promise.all([e.delete(q),Promise.reject(P)])).then(([P,w])=>w)),{miss:P=>s.set(q,P)})}return {hostsCache:r,requester:f,timeouts:y,logger:a,algoliaAgent:R,baseHeaders:u,baseQueryParameters:g,hosts:o,request:p,requestsCache:e,responsesCache:s}}function Y(){function o(r){return new Promise(u=>{let a=new XMLHttpRequest;a.open(r.method,r.url,true),Object.keys(r.headers).forEach(f=>a.setRequestHeader(f,r.headers[f]));let g=(f,e)=>setTimeout(()=>{a.abort(),u({status:0,content:e,isTimedOut:true});},f),R=g(r.connectTimeout,"Connection timeout"),y;a.onreadystatechange=()=>{a.readyState>a.OPENED&&y===void 0&&(clearTimeout(R),y=g(r.responseTimeout,"Socket timeout"));},a.onerror=()=>{a.status===0&&(clearTimeout(R),clearTimeout(y),u({content:a.responseText||"Network request failed",status:a.status,isTimedOut:false}));},a.onload=()=>{clearTimeout(R),clearTimeout(y),u({content:a.responseText,status:a.status,isTimedOut:false});},a.send(r.data);})}return {send:o}}var A="5.52.0",F=["de","us"];function Re(o){return [{url:o?"analytics.{region}.algolia.com".replace("{region}",o):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Z({appId:o,apiKey:r,authMode:u,algoliaAgents:a,region:g,...R}){let y=z(o,r,u),f=V({hosts:Re(g),...R,algoliaAgent:J({algoliaAgents:a,client:"Analytics",version:A}),baseHeaders:{"content-type":"text/plain",...y.headers(),...R.baseHeaders},baseQueryParameters:{...y.queryParameters(),...R.baseQueryParameters}});return {transporter:f,appId:o,apiKey:r,clearCache(){return Promise.all([f.requestsCache.clear(),f.responsesCache.clear()]).then(()=>{})},get _ua(){return f.algoliaAgent.value},addAlgoliaAgent(e,s){f.algoliaAgent.add({segment:e,version:s});},setClientApiKey({apiKey:e}){!u||u==="WithinHeaders"?f.baseHeaders["x-algolia-api-key"]=e:f.baseQueryParameters["x-algolia-api-key"]=e;},customDelete({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let p={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customGet({path:e,parameters:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let p={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{}};return f.request(p,n)},customPost({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let t={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},customPut({path:e,parameters:s,body:n},i){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let t={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:s||{},headers:{},data:n||{}};return f.request(t,i)},getAddToCartRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");let l="/2/conversions/addToCartRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getAverageClickPosition({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");let l="/2/clicks/averageClickPosition",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickPositions({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickPositions`.");let l="/2/clicks/positions",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getClickThroughRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");let l="/2/clicks/clickThroughRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getConversionRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getConversionRate`.");let l="/2/conversions/conversionRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoClickRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");let l="/2/searches/noClickRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getNoResultsRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");let l="/2/searches/noResultRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getPurchaseRate({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");let l="/2/conversions/purchaseRate",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getRevenue({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getRevenue`.");let l="/2/conversions/revenue",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");let l="/2/searches/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)},getSearchesNoClicks({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");let t="/2/searches/noClicks",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getSearchesNoResults({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");let t="/2/searches/noResults",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getStatus({index:e},s){if(!e)throw new Error("Parameter `index` is required when calling `getStatus`.");let n="/2/status",i={},d={};e!==void 0&&(d.index=e.toString());let l={method:"GET",path:n,queryParameters:d,headers:i};return f.request(l,s)},getTopCountries({index:e,startDate:s,endDate:n,limit:i,offset:d,tags:l},p){if(!e)throw new Error("Parameter `index` is required when calling `getTopCountries`.");let t="/2/countries",c={},m={};e!==void 0&&(m.index=e.toString()),s!==void 0&&(m.startDate=s.toString()),n!==void 0&&(m.endDate=n.toString()),i!==void 0&&(m.limit=i.toString()),d!==void 0&&(m.offset=d.toString()),l!==void 0&&(m.tags=l.toString());let h={method:"GET",path:t,queryParameters:m,headers:c};return f.request(h,p)},getTopFilterAttributes({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");let c="/2/filters",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopFilterForAttribute({attribute:e,index:s,search:n,startDate:i,endDate:d,limit:l,offset:p,tags:t},c){if(!e)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!s)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");let m="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(e)),h={},S={};s!==void 0&&(S.index=s.toString()),n!==void 0&&(S.search=n.toString()),i!==void 0&&(S.startDate=i.toString()),d!==void 0&&(S.endDate=d.toString()),l!==void 0&&(S.limit=l.toString()),p!==void 0&&(S.offset=p.toString()),t!==void 0&&(S.tags=t.toString());let q={method:"GET",path:m,queryParameters:S,headers:h};return f.request(q,c)},getTopFiltersNoResults({index:e,search:s,startDate:n,endDate:i,limit:d,offset:l,tags:p},t){if(!e)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");let c="/2/filters/noResults",m={},h={};e!==void 0&&(h.index=e.toString()),s!==void 0&&(h.search=s.toString()),n!==void 0&&(h.startDate=n.toString()),i!==void 0&&(h.endDate=i.toString()),d!==void 0&&(h.limit=d.toString()),l!==void 0&&(h.offset=l.toString()),p!==void 0&&(h.tags=p.toString());let S={method:"GET",path:c,queryParameters:h,headers:m};return f.request(S,t)},getTopHits({index:e,search:s,clickAnalytics:n,revenueAnalytics:i,startDate:d,endDate:l,limit:p,offset:t,tags:c},m){if(!e)throw new Error("Parameter `index` is required when calling `getTopHits`.");let h="/2/hits",S={},q={};e!==void 0&&(q.index=e.toString()),s!==void 0&&(q.search=s.toString()),n!==void 0&&(q.clickAnalytics=n.toString()),i!==void 0&&(q.revenueAnalytics=i.toString()),d!==void 0&&(q.startDate=d.toString()),l!==void 0&&(q.endDate=l.toString()),p!==void 0&&(q.limit=p.toString()),t!==void 0&&(q.offset=t.toString()),c!==void 0&&(q.tags=c.toString());let P={method:"GET",path:h,queryParameters:q,headers:S};return f.request(P,m)},getTopSearches({index:e,clickAnalytics:s,revenueAnalytics:n,startDate:i,endDate:d,orderBy:l,direction:p,limit:t,offset:c,tags:m},h){if(!e)throw new Error("Parameter `index` is required when calling `getTopSearches`.");let S="/2/searches",q={},P={};e!==void 0&&(P.index=e.toString()),s!==void 0&&(P.clickAnalytics=s.toString()),n!==void 0&&(P.revenueAnalytics=n.toString()),i!==void 0&&(P.startDate=i.toString()),d!==void 0&&(P.endDate=d.toString()),l!==void 0&&(P.orderBy=l.toString()),p!==void 0&&(P.direction=p.toString()),t!==void 0&&(P.limit=t.toString()),c!==void 0&&(P.offset=c.toString()),m!==void 0&&(P.tags=m.toString());let w={method:"GET",path:S,queryParameters:P,headers:q};return f.request(w,h)},getUsersCount({index:e,startDate:s,endDate:n,tags:i},d){if(!e)throw new Error("Parameter `index` is required when calling `getUsersCount`.");let l="/2/users/count",p={},t={};e!==void 0&&(t.index=e.toString()),s!==void 0&&(t.startDate=s.toString()),n!==void 0&&(t.endDate=n.toString()),i!==void 0&&(t.tags=i.toString());let c={method:"GET",path:l,queryParameters:t,headers:p};return f.request(c,d)}}}function Ft(o,r,u,a){if(!o||typeof o!="string")throw new Error("`appId` is missing.");if(!r||typeof r!="string")throw new Error("`apiKey` is missing.");if(u&&(typeof u!="string"||!F.includes(u)))throw new Error(`\`region\` must be one of the following: ${F.join(", ")}`);let{compression:g,...R}=a||{};return Z({appId:o,apiKey:r,region:u,timeouts:{connect:1e3,read:2e3,write:3e4},logger:M(),requester:Y(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:v(),requestsCache:v({serializable:false}),hostsCache:E({caches:[W({key:`${A}-${o}`}),v()]}),...R})} | ||
@@ -10,0 +10,0 @@ exports.analyticsClient = Ft; |
@@ -8,3 +8,3 @@ // builds/fetch.ts | ||
| import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -11,0 +11,0 @@ function getDefaultHosts(region) { |
@@ -33,3 +33,3 @@ "use strict"; | ||
| var import_client_common = require("@algolia/client-common"); | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -36,0 +36,0 @@ function getDefaultHosts(region) { |
@@ -8,3 +8,3 @@ // builds/node.ts | ||
| import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -11,0 +11,0 @@ function getDefaultHosts(region) { |
@@ -7,3 +7,3 @@ // builds/worker.ts | ||
| import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -10,0 +10,0 @@ function getDefaultHosts(region) { |
@@ -29,3 +29,3 @@ "use strict"; | ||
| var import_client_common = require("@algolia/client-common"); | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -32,0 +32,0 @@ function getDefaultHosts(region) { |
| // src/analyticsClient.ts | ||
| import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
| var apiClientVersion = "5.51.0"; | ||
| var apiClientVersion = "5.52.0"; | ||
| var REGIONS = ["de", "us"]; | ||
@@ -5,0 +5,0 @@ function getDefaultHosts(region) { |
+6
-6
| { | ||
| "version": "5.51.0", | ||
| "version": "5.52.0", | ||
| "repository": { | ||
@@ -57,6 +57,6 @@ "type": "git", | ||
| "dependencies": { | ||
| "@algolia/client-common": "5.51.0", | ||
| "@algolia/requester-browser-xhr": "5.51.0", | ||
| "@algolia/requester-fetch": "5.51.0", | ||
| "@algolia/requester-node-http": "5.51.0" | ||
| "@algolia/client-common": "5.52.0", | ||
| "@algolia/requester-browser-xhr": "5.52.0", | ||
| "@algolia/requester-fetch": "5.52.0", | ||
| "@algolia/requester-node-http": "5.52.0" | ||
| }, | ||
@@ -74,3 +74,3 @@ "devDependencies": { | ||
| }, | ||
| "gitHead": "442b543382061403f5b12c9619d8970ec33cdea9" | ||
| "gitHead": "53bf423966e49affd4786207f159eba913365c5f" | ||
| } |
+4
-4
@@ -43,7 +43,7 @@ <p align="center"> | ||
| ```bash | ||
| yarn add @algolia/client-analytics@5.51.0 | ||
| yarn add @algolia/client-analytics@5.52.0 | ||
| # or | ||
| npm install @algolia/client-analytics@5.51.0 | ||
| npm install @algolia/client-analytics@5.52.0 | ||
| # or | ||
| pnpm add @algolia/client-analytics@5.51.0 | ||
| pnpm add @algolia/client-analytics@5.52.0 | ||
| ``` | ||
@@ -56,3 +56,3 @@ | ||
| ```html | ||
| <script src="https://cdn.jsdelivr.net/npm/@algolia/client-analytics@5.51.0/dist/builds/browser.umd.js"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/@algolia/client-analytics@5.52.0/dist/builds/browser.umd.js"></script> | ||
| ``` | ||
@@ -59,0 +59,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed