PageSourceSearch

https://www.jala-helsekost.dk/theme/dbbc5e6514acac3ed5245d8f35349b…/base-theme.m4m-offcanvas.plugin.129247.js

js jala-helsekost.dk collected 2026-10-08 02:30:50 UTC 12,791 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkMGDBaseTheme=self.webpackChunkMGDBaseTheme||[]).push([[23751],{3751:(t,e,s)=>{s.r(e),s.d(e,{default:()=>o});var n=s(4049),i=s(9062),r=s(7);let{PluginBaseClass:a}=window;class o extends a{init(){this._registerEvents()}_registerEvents(){this.el.addEventListener("click",this._onClick.bind(this))}_onClick(){this._openOffCanvas()}_openOffCanvas(){let t=this._getOffCanvasContentElement();t?i.Z.open(t.innerHTML,this._onOpenOffCanvas.bind(this),this.options.offCanvasPosition):this.options.offCanvasContentUrl&&r.Z.open(this.options.offCanvasContentUrl,!1,this._onOpenOffCanvas.bind(this),this.options.offCanvasPosition)}_onOpenOffCanvas(){window.PluginManager.initializePlugins(),this.$emitter.publish("m4mAfterOpenOffCanvas")}_getOffCanvasContentElement(){return n.Z.querySelector(document,this.options.offCanvasContentSelector,!1)}}o.options={offCanvasContentSelector:null,offCanvasContentUrl:null,offCanvasPosition:"right"}},4049:(t,e,s)=>{s.d(e,{Z:()=>i});var n=s(5140);class i{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!i.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!1===i.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(s)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=e.replace(/^data(|-)/,""),a=n.Z.toLowerCamelCase(r,"-");if(!i.isNode(t)){if(s)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(s)throw Error("This node doesn't support the dataset attribute!");return}let o=t.dataset[a];if(void 0===o){if(s)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return o}return n.Z.parsePrimitive(o)}static querySelector(t,e){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelector(e)||!1;if(s&&!1===n)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return n}static querySelectorAll(t,e){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let n=t.querySelectorAll(e);if(0===n.length&&(n=!1),s&&!1===n)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return n}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n            input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n            select:not([tabindex^="-"]):not([disabled]),\n            textarea:not([tabindex^="-"]):not([disabled]),\n            button:not([tabindex^="-"]):not([disabled]),\n            a[href]:not([tabindex^="-"]):not([disabled]),\n            [tabindex]:not([tabindex^="-"]):not([disabled])\n        ')}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}},4830:(t,e,s)=>{s.d(e,{Z:()=>n});class n{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=new CustomEvent(t,{detail:e,cancelable:s});return this.el.dispatchEvent(n),n}subscribe(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this,i=t.split("."),r=s.scope?e.bind(s.scope):e;if(s.once&&!0===s.once){let e=r;r=function(s){n.unsubscribe(t),e(s)}}return this.el.addEventListener(i[0],r),this.listeners.push({splitEventName:i,opts:s,cb:r}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,s)=>([...s.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(s.splitEventName[0],s.cb):t.push(s),t),[]),!0}
1reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}},3266:(t,e,s)=>{s.d(e,{Z:()=>n});class n{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var s of t.entries())e(s[1],s[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(s=>{e(t[s],s)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}},5140:(t,e,s)=>{s.d(e,{Z:()=>n});class n{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let s=n.toUpperCamelCase(t,e);return n.lcFirst(s)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>n.ucFirst(t.toLowerCase())).join(""):n.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},7:(t,e,s)=>{s.d(e,{Z:()=>o});var n=s(9062),i=s(3107),r=s(2363);let a=null;class o extends n.Z{static open(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"left",r=!(arguments.length>4)||void 0===arguments[4]||arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:n.Z.REMOVE_OFF_CANVAS_DELAY(),o=arguments.length>6&&void 0!==arguments[6]&&arguments[6],l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";if(!t)throw Error("A url must be given!");n.r._removeExistingOffCanvas();let c=n.r._createOffCanvas(i,o,l,r);this.setContent(t,e,s,r,a),n.r._openOffcanvas(c)}static setContent(t,e,s,n,l){let c=new i.Z;super.setContent('<div class="offcanvas-body">'.concat(r.Z.getTemplate(),"</div>"),n,l),a&&a.abort();let d=t=>{super.setContent(t,n,l),"function"==typeof s&&s(t)};a=e?c.post(t,e,o.executeCallback.bind(this,d)):c.get(t,o.executeCallback.bind(this,d))}static executeCallback(t,e){"function"==typeof t&&t(e),window.PluginManager.initializePlugins()}}},9062:(t,e,s)=>{s.d(e,{Z:()=>l,r:()=>o});var n=s(4830),i=s(3266);let r="js-offcanvas-singleton";class a{open(t,e,s,n,i,r,a){this._removeExistingOffCanvas();let o=this._createOffCanvas(s,r,a,n);this.setContent(t,i),this._openOffcanvas(o,e)}setContent(t,e){let s=this.getOffCanvas();s[0]&&(s[0].innerHTML=t,this._registerEvents(e),this._setAriaAttrs())}setAdditionalClassName(t){this.getOffCanvas()[0].classList.add(t)}getOffCanvas(){return document.querySelectorAll(".".concat(r))}close(t){let e=this.getOffCanvas();i.Z.iterate(e,t=>{bootstrap.Offcanvas.getInstance(t).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:e})},t)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(t,e){window.focusHandler.saveFocusState("offcanvas"),a.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof e&&e()}_registerEvents(t){let e=this.getOffCanvas();i.Z.iterate(e,s=>{let n=()=>{setTimeout(()=>{s.remove(),window.focusHandler.resumeFocusState("offcanvas"),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:e})},t),s.removeEventListener("hide.bs.offcanvas",n)};s.addEventListener("hide.bs.offcanvas",n)}),window.addEventListener("popstate",this.close.bind(this,t),{once:!0});let s=document.querySelectorAll(".".concat("js-offcanvas-close"));i.Z.iterate(s,e=>e.addEventListener("click",this.close.bind(this,t)))}_setAriaAttrs(){let t=this.getOffCanvas()[0],e="off-canvas-headline",s=t.querySelector('[data-id="'.concat(e,'"]'));s&&!t.hasAttribute("aria-labelledby")&&(s.setAttribute("id",e),t.setAttribute("aria-labelledby",e))}_removeExistingOffCanvas(){a.bsOffcanvas=null;let t=this.getOffCanvas();return i.Z.iterate(t,t=>t.remove())}_getPositionClass(t){return"left"===t?"offcanvas-start":"right"===t?"offcanvas-end":"offcanvas-".concat(t)}_createOffCanvas(t,e,s,n){let i=document.createElement("div");if(i.classList.add("offcanvas",r),i.classList.add(this._getPositionClass(t)),i.setAttribute("tabindex","-1"),!0===e&&i.classList.add("is-fullwidth"),s){let t=typeof s;if("string"===t)i.classList.add(s);else if(Array.isArray(s))s.forEach(t=>{i.classList.add(t)});else throw Error('The type "'.concat(t,'" is not supported. Please pass an array or a string.'))}return document.body.appendChild(i),a.bsOffcanvas=new bootstrap.Offcanvas(i,{backdrop:!1!==n||"static"}),i}constructor(){this.$emitter=new n.Z}}let o=Object.freeze(new a);class l{static open(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,r=arguments.length>5&&void 0!==arguments[5]&&arguments[5],a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";o.open(t,e,s,n,i,r,a)}static setContent(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;o.setContent(t,e,s)}static setAdditionalClassName(t){o.setAdditionalClassName(t)}static close(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;o.close(t)}static exists(){return o.exists()}static getOffCanvas(){return o.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}},3107:(t,e,s)=>{s.d(e,{Z:()=>n});
1class n{get(t,e){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",n=this._createPreparedRequest("GET",t,s);return this._sendRequest(n,null,e)}post(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("POST",t,n);return this._sendRequest(i,e,s)}delete(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("DELETE",t,n);return this._sendRequest(i,e,s)}patch(t,e,s){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";n=this._getContentType(e,n);let i=this._createPreparedRequest("PATCH",t,n);return this._sendRequest(i,e,s)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn("the request to ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,s){return this._registerOnLoaded(t,s),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,s){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),s&&this._request.setRequestHeader("Content-type",s),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}},2363:(t,e,s)=>{s.d(e,{Z:()=>a});var n=s(3266);let i="loader",r={BEFORE:"before",INNER:"inner"};class a{create(){if(!this.exists()){if(this.position===r.INNER){this.parent.innerHTML=a.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),a.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(i));n.Z.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(i)).length>0}_getPosition(){return this.position===r.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(i,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return i}constructor(t,e=r.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}}}]);

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.