vendor: 1,568 bytes, line 1
1import{i as f,_ as I,S as Se,a as _e,b as re,c as F,d as xe,e as Oe,O as d,o as ne,f as Ie,g as ie,h as k,r as Ce,j as qe,k as Le,l as ke,m as se,n as Pe,p as Ee,t as Re,E as Te,q as N,s as oe,D as ae,x as h,u as z,v as R,w as _,y as le,z as T,A,B as C,C as M}from"./main-D9p2ehdz.js";function Fe(e){return f(e?.lift)}function b(e){return function(t){if(Fe(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function g(e,t,r,n,i){return new Ne(e,t,r,n,i)}var Ne=(function(e){I(t,e);function t(r,n,i,s,o,l){var a=e.call(this,r)||this;return a.onFinalize=o,a.shouldUnsubscribe=l,a._next=n?function(u){try{n(u)}catch(c){r.error(c)}}:e.prototype._next,a._error=s?function(u){try{s(u)}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=i?function(){try{i()}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._complete,a}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})(Se),Me=(function(e){I(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return this},t})(_e),V={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,re([e,t],F(r)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},De=(function(e){I(t,e);function t(r,n){var i=e.call(this,r,n)||this;
vendor: 3,319 bytes, line 1
1return i.scheduler=r,i.work=n,i.pending=!1,i}return t.prototype.schedule=function(r,n){var i;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,n)),this.pending=!0,this.delay=n,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,n),this},t.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),V.setInterval(r.flush.bind(r,this),i)},t.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return n;n!=null&&V.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var i=!1,s;try{this.work(r)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,i=r.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,xe(s,this),n!=null&&(this.id=this.recycleAsyncId(i,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(Me),G=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=Oe.now,e})(),Ue=(function(e){I(t,e);function t(r,n){n===void 0&&(n=G.now);var i=e.call(this,r,n)||this;return i.actions=[],i._active=!1,i}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var i;this._active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},t})(G),je=new Ue(De),He=new d(function(e){return e.complete()});function Ke(e){return e&&f(e.schedule)}function ue(e){return e[e.length-1]}function Be(e){return Ke(ue(e))?e.pop():void 0}function ze(e,t){return typeof ue(e)=="number"?e.pop():t}var D=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function ce(e){return f(e?.then)}function he(e){return f(e[ne])}function fe(e){return Symbol.asyncIterator&&f(e?.[Symbol.asyncIterator])}function de(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ve(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var ve=Ve();function pe(e){return f(e?.[ve])}function me(e){return Ie(this,arguments,function(){var r,n,i,s;return ie(this,function(o){switch(o.label){case 0:r=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,k(r.read())];case 3:return n=o.sent(),i=n.value,s=n.done,s?[4,k(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,k(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function ye(e){return f(e?.getReader)}function w(e){if(e instanceof d)return e;if(e!=null){if(he(e))return Ge(e);if(D(e))return Ye(e);if(ce(e))return We(e);
1if(fe(e))return ge(e);if(pe(e))return Je(e);if(ye(e))return Qe(e)}throw de(e)}function Ge(e){return new d(function(t){var r=e[ne]();if(f(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ye(e){return new d(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function We(e){return new d(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Ce)})}function Je(e){return new d(function(t){var r,n;try{for(var i=qe(e),s=i.next();!s.done;s=i.next()){var o=s.value;if(t.next(o),t.closed)return}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()})}function ge(e){return new d(function(t){Xe(e,t).catch(function(r){return t.error(r)})})}function Qe(e){return ge(me(e))}function Xe(e,t){var r,n,i,s;return Le(this,void 0,void 0,function(){var o,l;return ie(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),r=ke(e),a.label=1;case 1:return[4,r.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(o=n.value,t.next(o),t.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=a.sent(),i={error:l},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function y(e,t,r,n,i){n===void 0&&(n=0),i===void 0&&(i=!1);var s=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!i)return s}function be(e,t){return t===void 0&&(t=0),b(function(r,n){r.subscribe(g(n,function(i){return y(n,e,function(){return n.next(i)},t)},function(){return y(n,e,function(){return n.complete()},t)},function(i){return y(n,e,function(){return n.error(i)},t)}))})}function we(e,t){return t===void 0&&(t=0),b(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function Ze(e,t){return w(e).pipe(we(t),be(t))}function et(e,t){return w(e).pipe(we(t),be(t))}function tt(e,t){return new d(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}function rt(e,t){return new d(function(r){var n;return y(r,t,function(){n=e[ve](),y(r,t,function(){var i,s,o;try{i=n.next(),s=i.value,o=i.done}catch(l){r.error(l);return}o?r.complete():r.next(s)},0,!0)}),function(){return f(n?.return)&&n.return()}})}function Ae(e,t){if(!e)throw new Error("Iterable cannot be null");return new d(function(r){y(r,t,function(){var n=e[Symbol.asyncIterator]();y(r,t,function(){n.next().then(function(i){i.done?r.complete():r.next(i.value)})},0,!0)})})}function nt(e,t){return Ae(me(e),t)}function it(e,t){if(e!=null){if(he(e))return Ze(e,t);if(D(e))return tt(e,t);if(ce(e))return et(e,t);if(fe(e))return Ae(e,t);if(pe(e))return rt(e,t);if(ye(e))return nt(e,t)}throw de(e)}function st(e,t){return t?it(e,t):w(e)}function U(e,t){return b(function(r,n){var i=0;r.subscribe(g(n,function(s){n.next(e.call(t,s,i++))}))})}var ot=Array.isArray;function at(e,t){return ot(t)?e.apply(void 0,re([],F(t))):e(t)}function lt(e){return U(function(t){return at(e,t)})}function ut(e,t,r,n,i,s,o,l){var a=[],u=0,c=0,$=!1,p=function(){$&&!a.length&&!u&&t.complete()},$e=function(S){return u<n?K(S):a.push(S)},K=function(S){u++;var B=!1;w(r(S,c++)).subscribe(g(t,function(q){t.next(q)},function(){B=!0},void 0,function(){if(B)try{u--;for(var q=function(){var L=a.shift();o||K(L)};a.length&&u<n;)q();p()}catch(L){t.error(L)}}))};return e.subscribe(g(t,$e,function(){$=!0,p()})),function(){}}function j(e,t,r){return r===void 0&&(r=1/0),f(t)?j(function(n,i){return U(function(s,o){return t(n,s,i,o)})(w(e(n,i)))},r):(typeof t=="number"&&(r=t),b(function(n,i){return ut(n,i,e,r)}))}function ct(e){return e===void 0&&(e=1/0),j(se,e)}var ht=["addListener","removeListener"],ft=["addEventListener","removeEventListener"],dt=["on","off"];function x(e,t,r,n){if(f(r)&&(n=r,r=void 0),n)return x(e,t,r).pipe(lt(n));var i=F(mt(e)?ft.map(function(l){return function(a){return e[l](t,a,r)}}):vt(e)?ht.map(Y(e,t)):pt(e)?dt.map(Y(e,t)):[],2),s=i[0],o=i[1];if(!s&&D(e))return j(function(l){return x(l,t,r)})(w(e));if(!s)throw new TypeError("Invalid event target");return new d(function(l){var a=function(){for(var u=[],c=0;c<arguments.length;c++)u[c]=arguments[c];return l.next(1<u.length?u:u[0])};return s(a),function(){return o(a)}})}function Y(e,t){return function(r){return function(n){return e[r](t,n)}}}function vt(e){return f(e.addListener)&&f(e.removeListener)}function pt(e){return f(e.on)&&f(e.off)}function mt(e){return f(e.addEventListener)&&f(e.removeEventListener)}function yt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Be(e),n=ze(e,1/0),i=e;return i.length?i.length===1?w(i[0]):ct(n)(st(i,r)):He}function gt(e,t){return b(function(r,n){var i=0;r.subscribe(g(n,function(s){return e.call(t,s,i++)&&n.next(s)}))})}function bt(e,t){return t===void 0&&(t=je),b(function(r,n){var i=null,s=null,o=null,l=function(){if(i){i.unsubscribe(),i=null;var u=s;s=null,n.next(u)}};function a(){var u=o+e,c=t.now();if(c<u){i=this.schedule(void 0,u-c),n.add(i);return}l()}r.subscribe(g(n,function(u){s=u,o=t.now(),i||(i=t.schedule(a,e),n.add(i))},function(){l(),n.complete()},void 0,function(){s=i=null}))})}function wt(e,t){return t===void 0&&(t=se),e=e??At,b(function(r,n){var i,s=!0;
vendor: 5,513 bytes, line 1
1r.subscribe(g(n,function(o){var l=t(o);(s||!e(i,l))&&(s=!1,i=l,n.next(o))}))})}function At(e,t){return e===t}const $t=new WeakMap;let W=0;const P=new Map,J=new WeakSet,Q=()=>new Promise((e=>requestAnimationFrame(e))),St=[{opacity:0}],_t=[{opacity:0},{opacity:1}],X=(e,t)=>{const r=e-t;return r===0?void 0:r},Z=(e,t)=>{const r=e/t;return r===1?void 0:r},E={left:(e,t)=>{const r=X(e,t);return{value:r,transform:r==null||isNaN(r)?void 0:`translateX(${r}px)`}},top:(e,t)=>{const r=X(e,t);return{value:r,transform:r==null||isNaN(r)?void 0:`translateY(${r}px)`}},width:(e,t)=>{let r;t===0&&(t=1,r={width:"1px"});const n=Z(e,t);return{value:n,overrideFrom:r,transform:n==null||isNaN(n)?void 0:`scaleX(${n})`}},height:(e,t)=>{let r;t===0&&(t=1,r={height:"1px"});const n=Z(e,t);return{value:n,overrideFrom:r,transform:n==null||isNaN(n)?void 0:`scaleY(${n})`}}},xt={duration:333,easing:"ease-in-out"},Ot=["left","top","width","height","opacity","color","background"],ee=new WeakMap;class It extends Ee{constructor(t){if(super(t),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,t.type===Re.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise((t=>{this.l=t}))}async resolveFinished(){this.l?.(),this.l=void 0}render(t){return Te}getController(){return $t.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(t,[r]){const n=this.u===void 0;return n&&(this.u=t.options?.host,this.u.addController(this),this.u.updateComplete.then((i=>this.t=!0)),this.element=t.element,ee.set(this.element,this)),this.optionsOrCallback=r,(n||typeof r!="function")&&this.p(r),this.render(r)}p(t){t=t??{};const r=this.getController();r!==void 0&&((t={...r.defaultOptions,...t}).keyframeOptions={...r.defaultOptions.keyframeOptions,...t.keyframeOptions}),t.properties??=Ot,this.options=t}m(){const t={},r=this.element.getBoundingClientRect(),n=getComputedStyle(this.element);return this.options.properties.forEach((i=>{const s=r[i]??(E[i]?void 0:n[i]),o=Number(s);t[i]=isNaN(o)?s+"":o})),t}v(){let t,r=!0;return this.options.guard&&(t=this.options.guard(),r=((n,i)=>{if(Array.isArray(n)){if(Array.isArray(i)&&i.length===n.length&&n.every(((s,o)=>s===i[o])))return!1}else if(i===n)return!1;return!0})(t,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&r&&this.element.isConnected,this.h&&(this._=Array.isArray(t)?Array.from(t):t),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let t;this.prepare(),await Q;const r=this.O(),n=this.j(this.options.keyframeOptions,r),i=this.m();if(this.A!==void 0){const{from:s,to:o}=this.N(this.A,i,r);this.log("measured",[this.A,i,s,o]),t=this.calculateKeyframes(s,o)}else{const s=P.get(this.options.inId);if(s){P.delete(this.options.inId);const{from:o,to:l}=this.N(s,i,r);t=this.calculateKeyframes(o,l),t=this.options.in?[{...this.options.in[0],...t[0]},...this.options.in.slice(1),t[1]]:t,W++,t.forEach((a=>a.zIndex=W))}else this.options.in&&(t=[...this.options.in,{}])}this.animate(t,n)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){this.P=this.element.getAttribute("style"),this.webAnimation?.commitStyles(),this.webAnimation?.cancel()}reconnected(){}async disconnected(){if(!this.h||(this.options.id!==void 0&&P.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await Q(),this.i?.isConnected){const r=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,r),this.options.stabilizeOut){const n=this.m();this.log("stabilizing out");const i=this.A.left-n.left,s=this.A.top-n.top;getComputedStyle(this.element).position!=="static"||i===0&&s===0||(this.element.style.position="relative"),i!==0&&(this.element.style.left=i+"px"),s!==0&&(this.element.style.top=s+"px")}}const t=this.j(this.options.keyframeOptions);await this.animate(this.options.out,t),this.element.remove()}prepare(){this.createFinished()}start(){this.options.onStart?.(this)}didFinish(t){t&&this.options.onComplete?.(this),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const t=[];for(let r=this.element.parentNode;r;r=r?.parentNode){const n=ee.get(r);n&&!n.isDisabled()&&n&&t.push(n)}return t}get isHostRendered(){const t=J.has(this.u);return t||this.u.updateComplete.then((()=>{J.add(this.u)})),t}j(t,r=this.O()){const n={...xt};return r.forEach((i=>Object.assign(n,i.options.keyframeOptions))),Object.assign(n,t),n}N(t,r,n){t={...t},r={...r};const i=n.map((l=>l.animatingProperties)).filter((l=>l!==void 0));let s=1,o=1;return i.length>0&&(i.forEach((l=>{l.width&&(s/=l.width),l.height&&(o/=l.height)})),t.left!==void 0&&r.left!==void 0&&(t.left=s*t.left,r.left=s*r.left),t.top!==void 0&&r.top!==void 0&&(t.top=o*t.top,r.top=o*r.top)),{from:t,to:r}}calculateKeyframes(t,r,n=!1){const i={},s={};let o=!1;const l={};for(const a in r){const u=t[a],c=r[a];if(a in E){const $=E[a];if(u===void 0||c===void 0)continue;const p=$(u,c);p.transform!==void 0&&(l[a]=p.value,o=!0,i.transform=`${i.transform??""} ${p.transform}`,p.overrideFrom!==void 0&&Object.assign(i,p.overrideFrom))}else u!==c&&u!==void 0&&c!==void 0&&(o=!0,i[a]=u,s[a]=c)}
1return i.transformOrigin=s.transformOrigin=n?"center center":"top left",this.animatingProperties=l,o?[i,s]:void 0}async animate(t,r=this.options.keyframeOptions){this.start(),this.frames=t;let n=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=t=this.options.onFrames(this),this.log("modified frames",t)),t!==void 0)){this.log("animate",[t,r]),n=!0,this.webAnimation=this.element.animate(t,r);const i=this.getController();i?.add(this);try{await this.webAnimation.finished}catch{}i?.remove(this)}return this.didFinish(n),n}isAnimating(){return this.webAnimation?.playState==="running"||this.webAnimation?.pending}log(t,r){this.shouldLog&&!this.isDisabled()&&console.log(t,this.options.id,r)}}const Ct=Pe(It);var qt=Object.defineProperty,Lt=Object.getOwnPropertyDescriptor,m=(e,t,r,n)=>{for(var i=n>1?void 0:n?Lt(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&qt(t,r,i),i};let v=class extends N{constructor(){super(...arguments),this.parentKey="",this.resourceUri="",this.global=!1,this.result=null,this.busy=!1,this.cleared=!1,this.searchRef=oe(),this.dictionary=ae.getInstance(),this.resultsLabel=this.dictionary.get("resultsLabel","result[s]").replace(/\[.*]/g,""),this.resultsLabelPlural=this.dictionary.get("resultsLabel","result[s]").replace(/[[\]]/g,""),this.culture=document.documentElement.lang,this.searchTermHistoryService=null,this.searchInputChanged=e=>{e&&(yt(x(e,"keyup"),x(e,"change")).pipe(U(()=>e.value),gt(t=>t.length===0||t.length>=2),bt(400),wt()).subscribe(t=>{t.length!==0&&(this.updateUrl("query",t),this.request={...this.request,query:t},this.search(!0))}),this.global&&!this.request.query&&setTimeout(()=>{e.focus({preventScroll:!0})}
1))}}InitSearchTermHistory(e){this.searchTermHistoryService=e}connectedCallback(){super.connectedCallback();const e=new URL(document.location.toString()),t=e.searchParams.has("query")?e.searchParams.get("query"):"";this.request={query:t??"",page:1,culture:this.culture,includeFacets:!0},this.global||(this.request.filter={rootId:this.parentKey}),!(this.global&&!this.request.query)&&this.search()}createRenderRoot(){return this}render(){return this.renderSearchList()}renderSearchList(){return h` ${this.renderForm()} ${this.renderResultContainer()} ${this.renderLoadMore()} `}renderForm(){return h` 2 <form class="search__form grid" @submit="${e=>e.preventDefault()}"> 3 <div 4 class="g-col-12 search__query ${z({"--is-active":!this.cleared&&this.request!=null&&this.request.query.length>0,"g-col-sm-6":!this.global})}" 5 > 6 <label for="query" class="form-label --is-label ${z({"d-none":this.global})}" 7 >${this.dictionary.get("enterKeywordsLabel","Hvad søger du efter?")}</label 8 > 9 <input 10 ${R(this.searchInputChanged)} 11 ${R(this.searchRef)} 12 name="query" 13 value="${this.request?.query}" 14 type="text" 15 id="query" 16 class="search__query-form" 17 placeholder="${this.dictionary.get("enterKeywordsLabel","Hvad søger du efter?")}" 18 /> 19 <div class="search__input-search-icon"><i class="fa-regular fa-magnifying-glass"></i></div> 20 <button 21 type="button" 22 @click="${e=>this.clearQuery(e)}" 23 class="search__input-clear-icon" 24 aria-label="${this.dictionary.get("clearSearchLabel","Ryd søgning")}" 25 > 26 <i class="fa-solid fa-circle-xmark"></i> 27 </button> 28 </div> 29 <input class="btn btn-primary search__submit" type="submit" value="${this.dictionary.get("searchButton","Søg")}" /> 30 </form> 31 `}renderResultContainer(){return h` 32 ${_(this.result?.meta,()=>h` 33 <div class="search__results"> 34 ${_(this.busy,()=>h` 35 <div class="spinner" role="status" style="--spinner-border-width: 3px;"> 36 <span class="visually-hidden">${this.dictionary.get("loadingVisuallyHidden","Loading...")}</span> 37 </div> 38 <span class="spinner__status">${this.dictionary.get("loadingLabel","Henter resultater")}</span> 39 `,()=>h` 40 ${this.result?.meta.page.totalResults} 41 ${this.result?.meta.page.totalResults===1?this.resultsLabel:this.resultsLabelPlural} 42 <strong>“${this.request.query}”</strong> 43 `)} 44 </div> 45 ${_(this.result?.meta?.page?.totalResults??!1,()=>h` <ul class="search__list"> 46 ${le(this.result?.results??[],e=>e.id,e=>h` <li 47 class="search__list-item" 48 ${Ct({in:_t,out:St,stabilizeOut:!0,keyframeOptions:{duration:300,easing:"ease"}})} 49 > 50 <search-item 51 .item="${e}" 52 .isGlobalSearch="${this.global}" 53 @clicked="${t=>this.trackClick(t)}" 54 ></search-item> 55 </li>`)} 56 </ul>`,()=>h` <div class="rte">${T(this.dictionary.get("noResultsText",""))}</div> `)} 57 `,()=>null)} 58 `}search(e=!1){this.busy=!0,this.cleared=!1,e&&(this.request={...this.request,page:1}),fetch(this.resourceUri,{method:"POST",body:JSON.stringify(this.request),headers:{"Content-Type":"application/json"}}).then(t=>t.json()).then(t=>{this.request.page===1?this.result=t:this.result={...t,results:[...this.result?.results??[],...t.results]},this.busy=!1}),e&&this.searchTermHistoryService?.savePreviousSuggestions(this.request.query)}
58updateUrl(e,t){const r=new URL(document.location.toString());t?r.searchParams.set(e,t):r.searchParams.delete(e),history.replaceState(null,"",r.toString())}clearQuery(e){this.request&&this.result&&this.searchRef.value&&(e?.preventDefault(),this.searchRef.value.value="",this.cleared=!0)}trackClick(e){if(!this.request||!this.result)return;const t={query:this.request.query,documentId:e.detail.item.id,requestId:this.result.meta.requestId,culture:this.culture};fetch("/api/search/click",{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}).then(()=>{window.open(e.detail.item.url,e.detail.targetBlank?"_blank":"_self")})}renderLoadMore(){if(this.request&&this.result)return this.request?.page<this.result?.meta?.page?.totalPages?h`<search-list-load-more @load-more="${()=>this.loadMore()}"></search-list-load-more>`:null}loadMore(){this.request&&this.result&&this.request.page<this.result.meta.page.totalPages&&(this.request={...this.request,page:this.request.page+1},this.search())}};m([A({attribute:"parent-key"})],v.prototype,"parentKey",2);m([A({attribute:"resource-uri"})],v.prototype,"resourceUri",2);m([A({type:Boolean})],v.prototype,"global",2);m([C()],v.prototype,"result",2);m([C()],v.prototype,"request",2);m([C()],v.prototype,"busy",2);m([C()],v.prototype,"cleared",2);v=m([M("search-list")],v);var kt=Object.defineProperty,Pt=Object.getOwnPropertyDescriptor,H=(e,t,r,n)=>{for(var i=n>1?void 0:n?Pt(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=(n?o(t,r,i):o(i))||i);return n&&i&&kt(t,r,i),i};let O=class extends N{connectedCallback(){super.connectedCallback(),this.classList.add("search-item")}createRenderRoot(){return this}render(){if(!this.item)return h``;const e=this.item,t=h`<svg xmlns="http://www.w3.org/2000/svg" width="5" height="10" viewBox="0 0 5 10" fill="none"> 59 <path 60 d="M4.55078 4.66797C4.73307 4.88932 4.73307 5.11068 4.55078 5.33203L0.800781 9.08203C0.579427 9.26432 0.358073 9.26432 0.136719 9.08203C-0.0455729 8.86068 -0.0455729 8.63932 0.136719 8.41797L3.55469 5L0.136719 1.58203C-0.0455729 1.36068 -0.0455729 1.13932 0.136719 0.917969C0.358073 0.735677 0.579427 0.735677 0.800781 0.917969L4.55078 4.66797Z" 61 fill="#151515" 62 /> 63 </svg>`;let r=h``;return e.type===1&&(r=h`<i class="fa-regular fa-file-pdf"></i> `),h` 64 <div class="search-item__content"> 65 <h4 class="search-item__heading line-clamp-1">${r}${T(e?.title)}</h4> 66 67 <p class="small line-clamp-3 search-item__description"> 68 ${T(this.cleanContentSnippet(e.contentSnippet))} 69 </p> 70 71 ${_(e.breadcrumbs.length>0,()=>h` <div class="search-item__breadcrumb"> 72 ${le(e.breadcrumbs,(n,i)=>h` 73 <span>${n}</span> 74 ${i<e.breadcrumbs.length-1?t:""} 75 `)} 76 </div>`)} 77 </div> 78 79 <a class="link-overlay" href="${e.url}" title="${e.listLinkText}" @click="${n=>this.dispatchClick(n)}"> 80 <span class="visually-hidden-focusable">${e.listLinkText}</span> 81 </a> 82 `}dispatchClick(e){if(e.preventDefault(),!this.item)return;const r={detail:{item:this.item,targetBlank:e.ctrlKey},bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("clicked",r))}cleanContentSnippet(e){return e=e.replaceAll(";","").replaceAll(")","").replaceAll(":",""),e.charAt(0)===","&&(e=e.substring(1)),e.charAt(0)==="."&&(e=e.substring(1)),e.charAt(0)===" "&&(e=e.substring(1)),e}};H([A({type:Object})],O.prototype,"item",2);H([A({type:Boolean})],O.prototype,"isGlobalSearch",2);O=H([M("search-item")],O);var Et=Object.getOwnPropertyDescriptor,Rt=(e,t,r,n)=>{for(var i=n>1?void 0:n?Et(t,r):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(i=o(i)||i);return i};let te=class extends N{constructor(){super(...arguments),this.btnRef=oe(),this.dictionary=ae.getInstance()}createRenderRoot(){return this}firstUpdated(e){super.firstUpdated(e)}disconnectedCallback(){super.disconnectedCallback(),this.observer&&this.observer.disconnect()}render(){return h` 83 <button ${R(this.btnRef)} class="btn btn-primary --plus" @click="${()=>this.loadMore()}"> 84 ${this.dictionary.get("loadMore","Vis flere")} 85 </button> 86 `}loadMore(){this.dispatchEvent(new CustomEvent("load-more"))}};te=Rt([M("search-list-load-more")],te);
86export{O as SearchItem,v as SearchList,te as SearchListLoadMore};
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.