PageSourceSearch

https://www.tax-free.no/chunk-3SDC52M5.js

js tax-free.no collected 2026-10-06 15:03:28 UTC 10,447 bytes, 1 lines download raw bytes

1import{a as G,b as ae,c as ee,h as O}from"./chunk-4KNFSRE5.js";import{d as M,e as W}from"./chunk-YMDDGZ5U.js";import{a as Z}from"./chunk-UNHUUWFF.js";import{a as X}from"./chunk-7OWGJP2F.js";import{e as J}from"./chunk-OT5BIL5I.js";import{d as Y}from"./chunk-DL3JVWPO.js";import{a as K}from"./chunk-4Z5MUJO3.js";import{a as P}from"./chunk-A3QLZGQA.js";import{$ as N,A as I,D as j,F as m,Fd as L,Ha as H,J as w,L as C,Pa as V,V as o,Y as E,Z as y,ca as h,d as g,fa as S,ga as l,ia as k,j as _,ka as v,lf as D,n as q,o as b,ph as U,qa as B,se as A,sg as z,u as c,ua as u,v as p,y as T}from"./chunk-PMSJWPYZ.js";import{a as Q,h as F}from"./chunk-NIF3MU5U.js";var te=F(ae()),f=F(K());var s=F(K());var R=class{siteContext=u(X);http=u(L);occEndPointService=u(D);activeRoute=u(A);warehouseContextService=u(J);shopService=u(Y);routingService=u(z);cmsService=u(U);facetsService=u(ee);facets$=this.facetsService.getFacets$(this.facetType()).pipe(l(i=>this.facetsInterceptor$(i)),l(i=>p({currency:this.siteContext.currency$,locale:this.siteContext.locale$}).pipe(c(({currency:e,locale:t})=>this.mapFacets(i,e,t)))),o((i,e)=>(0,s.isEqual)(i,e)),h({bufferSize:1,refCount:!0}));queryParams$=this.activeRoute.queryParams.pipe(o((i,e)=>(0,s.isEqual)(i,e)),h(1));filters$=p({airport:this.shopService.shops$.pipe(c(i=>i?.airport),o()),warehouse:this.warehouseContextService.getActive()}).pipe(l(({airport:i,warehouse:e})=>{let t=[].concat(e?{attr:"availableInCodes",value:e}:null).concat(!e&&i?{attr:"availableInAirportCodes",value:i}:null).filter(Boolean);return this.filtersInterceptor$(t,{airport:i,warehouse:e})}),o(s.isEqual),h({bufferSize:1,refCount:!0}));refinements$=this.queryParams$.pipe(l(i=>this.queryParamsToRefinements$(i)),l(i=>this.refinementsInterceptor$(i)),o(s.isEqual),h({bufferSize:1,refCount:!0}));facetRefinements$=p({facets:this.facets$,refinements:this.refinements$}).pipe(c(({facets:i,refinements:e})=>e.filter(t=>i.some(r=>r.id===t.attributeName))),o(s.isEqual));refinementCount$=this.facetRefinements$.pipe(c(i=>i?.length??0),o());queryParamsPage$=this.queryParams$.pipe(c(({page:i})=>i&&parseInt(i)||0),o());queryParamsSearchQuery$=this.queryParams$.pipe(c(({query:i})=>i||""),o(),h(1));queryParamsSort$=this.queryParams$.pipe(c(({sort:i})=>i||"relevance"),o());nextPageQueryParams$=this.queryParamsPage$.pipe(l(i=>this.mergeQueryParams$({page:i+1})));clearFilterLink$=p({queryParams:this.queryParams$,facets:this.facets$,facetRefinements:this.facetRefinements$}).pipe(l(({facetRefinements:i,facets:e})=>p(i.map(t=>{let r=e?.find(a=>a.id===t.attributeName);return this.getFilterLink$(r?.type==="hierarchical"?r.name:t.attributeName,t.value,"clear")})).pipe(S([]),c(t=>{let r=t.map(a=>Object.keys(a.query));return{query:(0,s.omit)((0,s.pick)((0,s.last)(t)?.query||{},(0,s.intersection)(...r)),"category"),url:(0,s.last)(t)?.url||"."}}))),h({bufferSize:1,refCount:!0}));getFilters(i){return Object.entries((0,s.groupBy)(i,"attributeName")).map(([,e])=>e.some(t=>t.type==="numeric"&&t.operator)?e.map(t=>`${t.attributeName}${t.operator||"="}${t.value}`).join(" AND "):e.map(t=>t.value?`${t.attributeName}:"${t.value}"`:void 0).filter(Boolean).join(" OR ")).filter(Boolean).map(e=>e.includes("OR")?`(${e})`:e).join(" AND ")}changeQueryParams(i,e="merge"){return this.routingService.go([],{relativeTo:this.activeRoute,queryParams:i,queryParamsHandling:e})}removeQueryParams(i){this.queryParams$.pipe(y()).subscribe(e=>this.changeQueryParams((0,s.omit)(e,i),""))}clearQueryParams(){this.changeQueryParams({},"preserve")}setSearchQueryParam(i){i?this.changeQueryParams({query:i,page:null}):this.removeQueryParams(["query","page"])}mergeQueryParams$(i){return this.queryParams$.pipe(c(e=>Object.assign({},e,i)))}queryParamsToRefinements$(i={}){return this.facets$.pipe(c(e=>Object.entries(i).reduce((t,[r,a])=>{let n=e.find(d=>d.id===r);return n?n.type==="DOUBLE"||n.type==="INTEGER"||M(n)?t.concat(this.stringToNumericRefinements(a,r)):n.type==="hierarchical"?t.concat({attributeName:r,type:"hierarchical"}):t.concat(this.stringToRefinements(a,r,n.type==="hierarchical"?n.type:"disjunctive")):t},[])))}stringToNumericRefinements(i,e){return(i?i.split(","):[]).map(r=>{let a={type:"numeric",attributeName:e};if(W.includes(r))return Object.assign({},a,{operator:r});let n=parseFloat(r);return!Number.isFinite(n)||n<0?null:Object.assign({},a,{value:n})}).filter(r=>r!==null).reduce((r,a)=>{let n=(0,s.last)(r);return!(0,s.isUndefined)(a.value)&&(0,s.isUndefined)(n?.value)&&n?.operator?(0,s.dropRight)(r,1).concat(Object.assign({},n,{value:a.value})):r.concat(a)},[])}stringToRefinements(i,e,t="disjunctive"){return(i?i.split(","):[]).map(a=>({type:t,attributeName:e,value:a}))}mapFacets(i,e,t){return i?.reduce((r,a)=>a.id==="price"?r.concat([Object.assign({},a,{id:`${a.id}.${e}`})]):a.localized?r.concat([Object.assign({},a,{id:`${a.id.split(".").slice(0,-1).concat(t).join(".")}`})]):r.concat([a]),[])}navigateByLink$(i){return this.routingService.go(i.url==="."?[]:[i.url],{relativeTo:this.activeRoute,queryParams:i.query})}getFilterLink$(i,e,t="toggle"){return p({facets:this.facets$,queryParams:this.queryParams$.pipe(c(r=>(0,s.omit)(r,"page")))}).pipe(c(({facets:r,queryParams:a})=>r.find(d=>d.name===i)?.type==="hierarchical"&&t==="remove"?{url:".",query:O(a,i,(0,s.dropRight)(e?.split(" > "),1).join(" > "),"replace")}:{url:".",query:O(a,i,e,t)}),l(r=>this.linkInterceptor$(r,{attr:i,value:e,action:t})))}changeFilter$(i,e,t="toggle"){return this.getFilterLink$(i,e,t).pipe(y(),l(r=>this.navigateByLink$(r)))}};var Fe=(()=>{class $ extends R{transferStateService=u(Z);errorHandler=u(H);index$(){return this.queryParamsSort$.pipe(c(e=>P.algoliaConfig.index[this.indexKey][e]||P.algoliaConfig.index[this.indexKey].relevance),o())}client=G(P.algoliaConfig.appId,P.algoliaConfig.apiKey);helper=(0,te.default)(this.client,P.algoliaConfig.index.products.relevance,{clickAnalytics:!0});algoliaResultEvent$=I(this.helper,"result").pipe(c(e=>e?.results),y());paused$=new g(!1);handlePause$(e){let t=this.paused$.asObservable().pipe(o());return t.pipe(m(r=>!r),l(()=>e.pipe(k(t.pipe(m(Boolean))))))}_loaded$=new g(!1);loaded$=this._loaded$.asObservable().pipe(o());_loadError$=new g(!1);loadError$=this._loadError$.asObservable();_hasSubscription$=new g(!1);searchResultsParams$=p({query:this.queryParamsSearchQuery$,indexName:this.index$(),refinements:this.refinements$,facets:this.facets$,filters:this.filters$,page:this.queryParamsPage$,analyticsTag:T(()=>this.analyticsTag$())}).pipe(w(1),h());cachedSearchResults$=this.handlePause$(this.searchResultsParams$.pipe(m(()=>this._hasSubscription$.getValue()))).pipe(o(f.isEqual),v(()=>{this._loaded$.next(!1),this._loadError$.next(!1)}),S(null),N(),c(([e,t])=>((0,f.isEqual)((0,f.omit)(e,"page"),(0,f.omit)(t,"page"))||(this._hits$.
1next([]),this._minPage$.next(null)),this._minPage$.getValue()===null&&this._minPage$.next(t.page),t)),l(({query:e,indexName:t,refinements:r,facets:a,filters:n,page:d,analyticsTag:re})=>{this.helper.setIndex(t),this.helper.setQuery(e),this.helper.setQueryParameter("analyticsTags",[re]);let ie=this.setPagination(d);return this.setFilters(n),this.setDisjunctiveFacets(a),this.setHierarchicalFacets(a),this.setRefinements(r,a),ie?q(this.helper.searchOnce({})).pipe(c(x=>x?.content),C(x=>this.handleSearchError(x))):_}),h());handleSearchError(e){return this.errorHandler.handleError(e),this._loadError$.next(!0),this._loaded$.next(!0),_}searchResults$=this.transferStateService.withTransfer$("algoliaSearchResults",j(b(null),this.cachedSearchResults$)).pipe(m(Boolean),h());_minPage$=new g(null);minPage$=this._minPage$.asObservable();canLoadPrevious$=p({minPage:this._minPage$,loaded:this._loaded$}).pipe(c(({minPage:e,loaded:t})=>t&&e!==null&&e>0),o());_hits$=new g([]);cachedHits$=this.searchResults$.pipe(o((e,t)=>e?.queryID===t?.queryID),v(e=>{this._hits$.next(this._hits$.getValue().concat(e?.hits||[])),this._loaded$.next(!0)}),l(()=>this._hits$),E(()=>this._loaded$.next(!1)),h());hits$=b(null).pipe(v(()=>this._hasSubscription$.next(!0)),l(()=>this.transferStateService.withTransfer$("algoliaHits",this.cachedHits$)),m(Boolean),E(()=>this._hasSubscription$.next(!1)),h({bufferSize:1,refCount:!0}));loadedHits$=this.loaded$.pipe(m(Boolean),c(()=>this._hits$.getValue()));setPagination(e){let t=this.hitsPerPage*(e+1);this._hits$.next(this._hits$.getValue().slice(0,t));let r=e>0?this.hitsPerPage*e:this._hits$.getValue().length,a=t-r;return this.helper.setQueryParameter("length",a),this.helper.setQueryParameter("offset",r),a}loadPreviousPage(){let e=this._minPage$.getValue();if(e===null||e<=0)return;let t=e-1;this._minPage$.next(t),this._loaded$.next(!1),q(this.helper.searchOnce({offset:t*this.hitsPerPage,length:this.hitsPerPage})).pipe(v(r=>{let a=r.content.hits;this._hits$.next([...a,...this._hits$.getValue()]),this._loaded$.next(!0)}),C(r=>(this._minPage$.next(e),this.handleSearchError(r))),y()).subscribe()}setFilters(e){let t=e.map(r=>`${r.attr}:${r.value}`).join(" AND ");this.helper.setQueryParameter("filters",t)}setDisjunctiveFacets(e){let t=e.filter(r=>r.type!=="hierarchical");this.helper.setQueryParameter("disjunctiveFacets",t.map(r=>r.id))}setHierarchicalFacets(e){let t=e.filter(a=>a.type==="hierarchical"),r=(0,f.groupBy)(t,"name");this.helper.setQueryParameter("hierarchicalFacets",Object.entries(r).map(([a,n])=>({name:a,attributes:n.map(d=>d.id)})))}setRefinements(e=[],t){this.helper.clearRefinements(),e.forEach(r=>{switch(r.type){case"disjunctive":this.helper.addDisjunctiveFacetRefinement(r.attributeName,r.value);break;case"hierarchical":let a=t.find(n=>n.id===r.attributeName);a&&this.helper.addHierarchicalFacetRefinement(a.name,r.value);break;case"numeric":this.helper.addNumericRefinement(r.attributeName,r.operator,r.value);break;case"facet":this.helper.addFacetRefinement(r.attributeName,r.value);break;case"exclude":this.helper.addFacetExclusion(r.attributeName,r.value);break}})}posAwareFacets=["inStockIn","inStockInCodes","inPhysicalStockInCodes","potentialPromotionsOffers"];getFacetValues$(e,t){let r=this.searchResults$.pipe(c(a=>a.getFacetValues?.(e,Q({facetOrdering:!0},t?{sortBy:[t]}:{}))));return this.transferStateService.withTransfer$(`facet_values_${e}_${t}`,j(b(null),r)).pipe(m(Boolean))}isPosAwareFacet(e){return this.posAwareFacets.includes(e)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=V($)))(r||$)}})();static \u0275prov=B({token:$,factory:$.\u0275fac})}return $})();export{Fe as a};

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.