1var AWN;!function(e){const t={};function n(e,n){t[n]?MoyaLoader.all(t[n].deps||[]).then(t[n].init.bind(e,e,{dispatch:function(t,n,i){const o=new CustomEvent(t,{bubbles:!!i,detail:n});return e.dispatchEvent(o),o.detail}})):console.warn('No component "'+n+'" found')}e.register=function(e,n,i){"function"==typeof n&&(i=n,n=[]),t[e]={deps:n,init:i}},e.run=function(e){if(!(e=e||document.body).querySelectorAll)return;const t=Array.from(e.querySelectorAll("[data-moya-component]"));e.dataset.moyaComponent&&t.push(e);for(let e=t.length-1;e>=0;e--){let i=t[e].dataset.moyaComponent;(i.indexOf(";")?i.split(";"):[i]).forEach(n.bind(t[e],t[e]))}},window.addEventListener("DOMContentLoaded",()=>{e.run()})}(window.MoyaComponents={}),function(e){const t={},n={};let i=[];e.set=function(e,n){t[e]=n},e.addModifier=function(e,t){"function"==typeof e&&(t=e,e=null),i.push({method:e,modifier:t})},e._resetModifier=function(){i=[]},e.register=function(e,i){"function"==typeof i?n[e]=i:t[e]=i},e.get=function(o){if(n[o]&&(t[o]=n[o](e),delete n[o]),t[o]){const e=t[o];if(i.length)for(let t=0,n=i.length;t<n;t++)i[t].method&&e[i[t].method]?e[i[t].method](i[t].modifier):"function"==typeof i[t].modifier&&i[t].modifier(e);return e}}}(("undefined"==typeof window?global:window).MoyaContainer={}),function(e){e.dispatchEvent=function(e){return document.dispatchEvent(e),e},e.dispatch=function(e,t){const n=new CustomEvent(e,{bubbles:!1,detail:t});return document.dispatchEvent(n),n.detail},e.on=function(e,t){document.addEventListener(e,e=>{t(new Proxy(e.detail,{get:(t,n)=>"preventDefault"===n||"stopImmediatePropagation"===n||"stopPropagation"===n?e[n].bind(e):t[n]}))},!1)}}(window.MoyaEventHandler={}),function(e){let t=[],n={};const i=e=>{if(e.startsWith("http")||e.startsWith("//"))return e;const t=document.body.dataset.staticVersion??(()=>{const e=document.querySelector('link[href*="theme.css"]');if(!e)return null;const t=e.getAttribute("href").match(/v=([^&]*)/);return t?t[1]:null})();if(!t)return e;const n=new URL(e,location.origin);return n.searchParams.set("v",t),n.pathname+"?"+n.searchParams.toString()};e.js=function(e){return new Promise(function(o,s){if(t.includes(e))return o();if(e in n)return void n[e].push([o,s]);n[e]=[[o,s]];const a=document.createElement("script");a.src=i(e),a.type="text/javascript",a.charset="utf-8",a.addEventListener("load",()=>{t.push(e),n[e].forEach(e=>e[0]())}),a.addEventListener("error",()=>{t.push(e),n[e].forEach(e=>e[1]())}),document.body.appendChild(a)})},e.css=function(e){return new Promise(function(o,s){if(t.includes(e))return o();if(e in n)return void n[e].push([o,s]);n[e]=[[o,s]];const a=document.createElement("link");a.href=i(e),a.type="text/css",a.rel="stylesheet",a.addEventListener("load",()=>{t.push(e),n[e].forEach(e=>e[0]())}),a.addEventListener("error",()=>{t.push(e),n[e].forEach(e=>e[1]())}),document.head.appendChild(a)})},e.all=function(t){const n=[];return t.forEach(t=>{t.endsWith(".js")?n.push(e.js(t)):t.endsWith(".css")?n.push(e.css(t)):console.warn("Loader don't support file ending with \""+t+'"')}),Promise.all(n)}}(window.MoyaLoader={}),function(){var e=function(e){"use strict";const t={container:"moya-select",title:"moya-select--title",list:"moya-select--list",optGroup:"moya-select--optgroup",open:"is-open",dropdown:"moya-select--dropdown",search:"moya-select--search-input",searchWrap:"moya-select--search-wrap",pseudoSelected:"pseudo-selected"};var n;!function(e){e.Enter="Enter",e.ArrowUp="ArrowUp",e.ArrowDown="ArrowDown",e.Escape="Escape",e.Tab="Tab"}(n||(n={}));const i={};document.body.addEventListener("click",e=>{for(let t in i){if(!i.hasOwnProperty(t))continue;let n=i[t];n.isOpen()&&!n.getContainer().contains(e.target)&&n.close()}});class o{constructor(e,n){var i;this.options=[],this.elem=e.elem,this.bubbles=null!==(i=e.bubbles)&&void 0!==i&&i,this.hasSearch=e.hasSearch,this.classNames=Object.assign(t,n),this.key=e.key,this.labelElm=document.querySelector(`label[for="${this.elem.id}"]`),this.labelElm&&(this.labelElm.id=this.labelElm.getAttribute("for")+"-label")}static create(e,t){var n;e.key=null!==(n=e.key)&&void 0!==n?n:"moya-select-"+e.elem.id;let s=i[e.key];if(s){if(s.container.closest("body"))return s.container.innerHTML="",s.options=[],s.createHTML(),s;s.container.parentElement.removeChild(s.container)}return s=new o(e,t),s.createContainer(),s.createHTML(),s.delegateEvents(),i[s.key]=s,s}toggle(){this.container.classList.contains(this.classNames.open)?this.close():this.open()}open(){this.container.classList.add(this.classNames.open),this.button.setAttribute("aria-expanded","true"),this.hasSearch?this.searchInput.focus():this.button.focus()}close(e){if(this.container.classList.remove(this.classNames.open),this.button.removeAttribute("aria-expanded"),e){const e=new CustomEvent("change",{bubbles:this.bubbles});this.elem.dispatchEvent(e)}}isOpen(){return this.button.hasAttribute("aria-expanded")}getContainer(){return this.container}createHTML(){this.createMainButtonHTML(),this.container.appendChild(this.button),this.hasSearch&&this.createSearchHTML(),this.createUlHTML(),this.createOptGroupsHTML(),this.createOptionsHTML(),this.createDropdownHTML(),this.container.appendChild(this.dropdown),this.elem.insertAdjacentElement("afterend",this.container),this.elem.style.display="none"}createDropdownHTML(){const e=document.createElement("div");e.classList.add(this.classNames.dropdown),this.hasSearch&&e.appendChild(this.searchWra
1p),e.appendChild(this.ul),this.dropdown=e}createSearchHTML(){const e=document.createElement("input");e.classList.add(this.classNames.search),e.type="text",e.autocomplete="off",e.autocapitalize="off",e.spellcheck=!1,e.setAttribute("aria-label","Filter"),e.setAttribute("aria-expanded","true"),e.setAttribute("aria-autocomplete","list");const t=document.createElement("div");t.classList.add(this.classNames.searchWrap),t.appendChild(e),this.searchInput=e,this.searchWrap=t}createContainer(){this.container=document.createElement("div"),this.container.className=this.classNames.container,this.elem.id&&(this.container.id=this.key)}createMainButtonHTML(){this.button=document.createElement("button"),this.button.className=this.classNames.title,this.button.textContent=this.elem.options[0].textContent,this.button.id=this.key+"-button",this.labelElm&&this.button.setAttribute("aria-labelledby",this.labelElm.id+" "+this.button.id)}createUlHTML(){this.ul=document.createElement("ul"),this.ul.id=this.key+"-list",this.ul.className=this.classNames.list,this.ul.setAttribute("role","listbox"),this.ul.setAttribute("tabindex","-1"),this.labelElm&&this.ul.setAttribute("aria-labelledby",this.labelElm.id),this.button.setAttribute("aria-haspopup",this.ul.id),this.elem.getAttribute("required")&&this.ul.setAttribute("aria-required","true")}createOptGroupsHTML(){if(this.getOptGroups().length)for(let e=0;e<this.getOptGroups().length;e++){const t=document.createElement("div");t.innerHTML=this.getOptGroups()[e].label,t.classList.add(this.classNames.optGroup),this.ul.appendChild(t),this.generateOptions(this.getOptGroups()[e].querySelectorAll("option"))}}createOptionsHTML(){this.generateOptions(this.elem.querySelectorAll(":not(optgroup) > option"))}delegateEvents(){const e=MoyaContainer.get("core.util");e.delegate(this.container,"click","button",e=>{e.preventDefault(),this.toggle()}),e.delegate(this.container,"keydown","button",e=>{this.handleKeydownEvent(e)}),this.hasSearch&&(e.delegate(this.container,"keydown","."+this.classNames.search,e=>{this.handleKeydownEvent(e)}),e.delegate(this.container,"keyup","."+this.classNames.search,e=>{e instanceof KeyboardEvent&&(Array.from(Object.values(n)).includes(e.key)||this.doSearch(e))})),e.delegate(this.container,"click","li",e=>{e.preventDefault(),this.button.focus(),this.updateSelection(e.delegateTarget,e),this.close(!0)})}generateOptions(e){e.forEach((e,t)=>{const n=document.createElement("li");n.innerHTML=e.innerHTML,n.setAttribute("role","option"),n.setAttribute("data-index",t.toString()),n.setAttribute("data-value",e.value),n.id=this.getOptionKey(e),this.elem.value===e.value&&(n.setAttribute("aria-selected","true"),n.classList.add("active"),this.button.innerHTML=e.innerHTML,this.button.setAttribute("aria-activedescendant",n.id)),this.options.push(n),this.ul.appendChild(n)})}getOptionKey(e){return this.key+"-"+e.value}getOptGroups(){return this.elem.getElementsByTagName("optgroup")}getAriaSelectedOption(){const e=this.options.filter(e=>e.hasAttribute("aria-selected"));return e.length?e[0]:null}updateSelection(e,t,n=!0){"keydown"===t.type&&e.scrollIntoView(!1),n&&(this.button.innerHTML=e.innerHTML,this.elem.value=e.getAttribute("data-value"),this.options.forEach(e=>{e.classList.remove("active")}),e.classList.add("active")),this.options.forEach(e=>{e.removeAttribute("aria-selected")}),e.setAttribute("aria-selected","true"),this.button.setAttribute("aria-activedescendant",e.id),this.hasSearch&&this.searchInput.setAttribute("aria-activedescendant",e.id)}handleKeydownEvent(e){if(!(e instanceof KeyboardEvent)||e.key===n.Tab)return void(this.isOpen()&&this.close());const t=this.getAriaSelectedOption();if(e.key===n.ArrowDown||e.key===n.ArrowUp)if(e.preventDefault(),this.isOpen()){let i=e.key===n.ArrowDown?t.nextElementSibling:t.previousElementSibling;for(;i&&"none"===i.style.display;)i=e.key===n.ArrowDown?i.nextElementSibling:i.previousElementSibling;i&&this.updateSelection(i,e,!1)}else this.open();else if(e.key===n.Enter)if(e.preventDefault(),this.isOpen()){const t=this.getAriaSelectedOption();t&&this.updateSelection(t,e),this.close(!0),this.button.focus()}else this.open();else e.key===n.Escape&&(e.preventDefault(),this.isOpen()&&this.close())}doSearch(e){const t=this.searchInput.value.trim().toLowerCase(),n=""===t;let i;
1this.options.forEach(e=>{if(n)return void e.style.removeProperty("display");e.textContent.trim().toLowerCase().includes(t)?(i||(i=e),e.style.removeProperty("display")):e.style.display="none"}),i&&this.updateSelection(i,e,!1)}}return MoyaComponents.register("core.custom-select",["/_moya/styles/libs/custom-select.css"],e=>{const t=!e.hasAttribute("data-bubbles")||!!e.getAttribute("data-bubbles"),n=e.hasAttribute("data-has-search");if(e instanceof HTMLSelectElement){const i={elem:e,bubbles:t,hasSearch:n};o.create(i,{})}else{e.querySelectorAll("select").forEach(e=>{const i={elem:e,bubbles:t,hasSearch:n};o.create(i,{})})}}),e.CustomSelect=o,e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.custom-select",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.custom-select",e))}(),function(){var e=function(e){"use strict";function t(e){return(new DOMParser).parseFromString(e,"text/html")}function n(e,t="GET",n){return"string"==typeof e?{url:e,data:n,method:t}:e}function i(e,i="GET",o){const s=n(e,i,o);return window.fetch(s.url,{method:s.method||"GET",mode:"same-origin",body:s.data}).then(e=>e.text()).then(t)}return MoyaComponents.register("core.fetchLazy",function(e,t){const n=t.dispatch("fetchLazy.setup",{url:e.dataset.action,mode:e.dataset.mode||"inject",selector:e.dataset.selector},!1);i(n.url).then(i=>{let o=i.body.firstElementChild;if(n.selector&&(o=i.querySelector(n.selector)),!o)throw new Error("Component(fetchLazy): Element not found in response");const s=t.dispatch("fetchLazy.render",{element:o,component:e,mode:n.mode});o=s.element;let a=e;"replace"===s.mode?(e.parentNode.replaceChild(o,e),a=o):e.appendChild(o),MoyaComponents.run(o),t.dispatch("fetchLazy.completed",{element:o,component:a})})}),e.fetchAndReplace=function(e,t){return i(e).then(e=>{const n=e.body.firstElementChild;return t.parentNode.replaceChild(n,t),MoyaComponents.run(n),n})},e.fetchHtml=i,e.fetchJson=function(e,t="GET",i){const o=n(e,t,i);return window.fetch(o.url,{method:o.method||"GET",mode:"same-origin",body:o.data,headers:{Accept:"application/json"}}).then(e=>e.json())},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.fetch",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.fetch",e))}(),function(){"use strict";MoyaComponents.register("core.file-maxsize",e=>{var t;if(!(e instanceof HTMLInputElement)||"file"!==e.type)return;const n=parseInt(null!==(t=e.dataset.maxsize)&&void 0!==t?t:"0");n<=0||e.addEventListener("change",()=>{var t,i;const o=null!==(t=e.files.item(0))&&void 0!==t?t:null;if((null!==(i=null==o?void 0:o.size)&&void 0!==i?i:0)>n){const t=`${(n/1024/1024).toFixed(2)} MB`;alert(`File size exceeds maximum allowed size (${t}).`),e.value=""}})})}(),"undefined"!=typeof __bundle&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof __bundle&&1===Object.keys(__bundle).length?window.MoyaContainer.set("core.file-maxsize",__bundle[Object.keys(__bundle)[0]]):window.MoyaContainer.register("core.file-maxsize",__bundle)),function(){"use strict";MoyaComponents.register("core.form.label-focus",function(e,t){const n=MoyaContainer.get("core.util"),i=['input[type="text"]','input[type="email"]','input[type="password"]','input[type="number"]',"textarea","select"],o=i.map(e=>".elm "+e).join(", "),s=i.join(", "),a=e=>{e.delegateTarget.closest(".elm").classList.add("focus")};["focusin","input"].forEach(t=>{n.delegate(e,t,o,a)}),n.delegate(e,"focusout",o,e=>{const t=e.delegateTarget;""===t.value&&t.closest(".elm").classList.remove("focus")}),e.querySelectorAll(s).forEach(e=>{""!==e.value&&e.closest(".elm").classList.add("focus")})})}(),"undefined"!=typeof __bundle&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof __bundle&&1===Object.keys(__bundle).length?window.MoyaContainer.set("core.form",__bundle[Object.keys(__bundle)[0]]):window.MoyaContainer.register("core.form",__bundle)),function(){var e=function(e){"use strict";
1var t={se:{currency:{symbol:"kr",format:"%v %s",decimal:",",thousand:" ",precision:2},number:{precision:0,thousand:" ",decimal:","}},is:{currency:{symbol:"kr.",format:"%v %s",decimal:",",thousand:".",precision:0},number:{precision:0,thousand:".",decimal:","}}};let n="is";function i(e,t){e=e||{},t=t||{};for(let n in t)t.hasOwnProperty(n)&&null==e[n]&&(e[n]=t[n]);return e}function o(e,t){const n=Math.pow(10,t);return(Math.round((e+1e-8)*n)/n).toFixed(t)}function s(e,s,a,r){const l=i({precision:s,thousand:a,decimal:r},t[n].number),d=e<0?"-":"",c=parseInt(o(Math.abs(e||0),l.precision),10)+"",u=c.length>3?c.length%3:0;return d+(u?c.substr(0,u)+l.thousand:"")+c.substr(u).replace(/(\d{3})(?=\d)/g,"$1"+l.thousand)+(l.precision?l.decimal+o(Math.abs(e),l.precision).split(".")[1]:"")}return e.addLocale=function(e,n){t[e]=n},e.formatMoney=function(e,o){const a=i(o&&"[object Object]"===Object.prototype.toString.call(o)?o:{symbol:o},t[n].currency),r=a.format;return(e>0?r:e<0?r.replace("-","").replace("%v","-%v"):r).replace("%s",a.symbol).replace("%v",s(Math.abs(e),a.precision,a.thousand,a.decimal))},e.formatNumber=s,e.setLocale=function(e){return t[e]?(n=e,!0):(console.warn('Configuration for locale "'+e+'" not found'),!1)},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.formatter",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.formatter",e))}(),function(){var e=function(){"use strict";return{se:{currency:{symbol:"kr",format:"%v %s",decimal:",",thousand:" ",precision:2},number:{precision:0,thousand:" ",decimal:","}},is:{currency:{symbol:"kr.",format:"%v %s",decimal:",",thousand:".",precision:0},number:{precision:0,thousand:".",decimal:","}}}}();void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.locales",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.locales",e))}(),function(){var e=function(e){"use strict";let t,n=[];function i(){n.forEach(e=>{e.style.maxHeight!==e.scrollHeight&&(e.style.maxHeight=e.scrollHeight+"px")})}return window.addEventListener("resize",()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(i)}),window.addEventListener("load",i),MoyaComponents.register("core.max-height",function(e){e.dataset.maxHeightSelector?n.push(...e.querySelectorAll(e.dataset.maxHeightSelector)):n.push(e),i()}),e.init=function(e){n.push(...document.body.querySelectorAll(e))},e.reset=function(){n=[]},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.max-height",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.max-height",e))}(),function(){var e=function(e){"use strict";var t,n;!function(e){e.DARK="dark",e.LIGHT="light"}(t||(t={})),function(e){e.SPINNER="spinner",e.NONE="none"}(n||(n={})),n.SPINNER,n.NONE;const i=MoyaContainer.get("core.fetch");MoyaComponents.register("core.modal",["https://static.stefna.is/js/micromodal/0.4.10/micromodal.min.js","/_moya/styles/libs/micromodal.css","/_moya/styles/libs/awn.css"],function(e,t){if(!e.dataset.href&&"A"!==e.tagName)return void console.error("Element need to have either be an a tag or have data-href attribute");const n={};e.dataset.loading&&(n.loading=e.dataset.loading),e.dataset.modalClass&&(n.classes=e.dataset.modalClass.split(" ")),e.dataset.modalDelay&&(n.delay=parseInt(e.dataset.modalDelay,10)),e.dataset.modalPreventScroll&&(n.preventBodyScroll=!!parseInt(e.dataset.modalPreventScroll,10)),e.dataset.modalDisableOverlayClose&&(n.disableOverlayClose=!!parseInt(e.dataset.modalDisableOverlayClose,10)),e.dataset.modalClosingDelay&&(n.closingDelay=parseInt(e.dataset.modalClosingDelay,10)),e.addEventListener("click",i=>{i.preventDefault();const o=t.dispatch("modal.preFetch",{url:e.dataset.href||e.getAttribute("href"),options:n});r(o.url,o.options).then(e=>{t.dispatch("modal.opened",{modal:e},!0)})})}),MoyaEventHandler.on("modal.show",e=>{(!e.options.hasOwnProperty("preventBodyScroll")&&document.body.dataset.modalPreventScroll||e.options.preventBodyScroll)&&document.documentElement.classList.add("prevent-scroll")}),MoyaEventHandler.on("modal.hide",()=>{document.documentElement.classList.remove("prevent-scroll")});const o='<div class="moya-modal__overlay" tabindex="-1" data-micromodal-close=""><div><div class="moya-modal__container" role="dialog" aria-modal="true"><div class="moya-modal__content"></div>
1<button aria-label="Close modal" data-micromodal-close="" class="moya-modal__close">â</button></div></div></div>';let s=1;function a(e){const t=document.createElement("div");t.id="modal-id-"+s++,t.className="moya-modal moya-modal--dark",t.innerHTML=o,t.setAttribute("aria-hidden","true");const n=t.querySelector(".moya-modal__content");e instanceof HTMLElement?n.appendChild(e):n.innerHTML=e,n.dataset.modal=t.id;const i=n.querySelector("#cancel");return i&&(i.setAttribute("data-micromodal-close",""),i.removeAttribute("onclick")),document.body.appendChild(t),n}function r(e,t){return MoyaContainer.get("core.overlay").execute(o=>(o.show(t.loading||n.SPINNER),i.fetchHtml(e).then(e=>{const n=a(e.body.innerHTML);if(t.classes&&n.parentElement.classList.add(...t.classes),t.disableOverlayClose){const e=n.closest(".moya-modal__overlay");e&&e.removeAttribute("data-micromodal-close")}return new Promise(e=>{setTimeout(()=>{o.hide();const i={close:MicroModal.close.bind(this,n.dataset.modal),element:n};MicroModal.show(n.dataset.modal,{onShow:()=>MoyaEventHandler.dispatch("modal.show",{modal:i,options:t}),onClose:()=>{MoyaEventHandler.dispatch("modal.hide",{modal:i,options:t});const e=document.getElementById(n.dataset.modal);e&&(t.closingDelay?setTimeout(()=>{e.parentElement.removeChild(e)},t.closingDelay):e.parentElement.removeChild(e))}}),MoyaComponents.run(n),e(i)},t.delay||0)})})))}return e.close=function(e){MicroModal.close(e)},e.get=function(e){const t=document.getElementById(e);if(t)return{close:MicroModal.close.bind(this,t.dataset.modal),element:t.querySelector(".moya-modal__content")};throw new Error("No modal found with id: "+e)},e.open=r,e.show=function(e,t){return new Promise(i=>{MoyaContainer.get("core.overlay").execute(o=>{t.delay&&o.show(t.loading||n.SPINNER);const s=a(e);t.classes&&s.parentElement.classList.add(...t.classes),setTimeout(()=>{t.delay&&o.hide();const n={close:MicroModal.close.bind(this,e.dataset.modal),element:e};MicroModal.show(s.dataset.modal,{onShow:()=>MoyaEventHandler.dispatch("modal.show",{modal:n,options:t}),onClose:()=>{MoyaEventHandler.dispatch("modal.hide",{modal:n,options:t});const e=document.getElementById(s.dataset.modal);e&&e.parentElement.removeChild(e)}}),MoyaComponents.run(s),i(n)},t.delay||0)})})},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.modal",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.modal",e))}(),function(){var e=function(e){"use strict";var t,n;function i(e,t,n){const i=function(e,t,n){let i={durations:{},labels:{},icons:{}};return i.labels[e]=t,n.position&&(i.position=n.position),n.duration&&(i.durations[e]=n.duration),n.animationDuration&&(i.animationDuration=n.animationDuration),n.icons&&(i.icons.enabled=n.icons.enabled,i.icons[e]=n.icons.icon),i}(e,t,n);return new AWN(i)[e](function(e){if(!e.message)return" ";const t=document.createElement("div");if(e.image){const n=document.createElement("div");n.classList.add("notification-image"),t.appendChild(n);const i=document.createElement("img");i.setAttribute("src",e.image),n.appendChild(i)}const n=document.createElement("div");if(n.innerHTML=e.message,n.classList.add("notification-message"),t.appendChild(n),e.buttons){const n=document.createElement("div");n.classList.add("notification-buttons"),t.appendChild(n),e.buttons.forEach(e=>{e.tag=e.tag||"a";const t=document.createElement(e.tag);t.innerText=e.label,"a"===e.tag&&(t.setAttribute("href",e.href),e.target&&t.setAttribute("target",e.target)),t.classList.add("notification-button"),e.classes&&t.classList.add(...e.classes),n.appendChild(t)})}return t.innerHTML}(n),i)}return function(e){e.SUCCESS="success",e.ERROR="alert",e.WARNING="warning",e.INFO="info",e.TIP="tip"}(t||(t={})),e.NotificationPosition=void 0,(n=e.NotificationPosition||(e.NotificationPosition={})).TOP_LEFT="top-left",n.TOP_RIGHT="top-right",n.BOTTOM_LEFT="bottom-left",n.BOTTOM_RIGHT="bottom-right",e.closeAll=function(){AWN.closeAll()},e.error=function(e,n={}){return i(t.ERROR,e,n)},e.info=function(e,n={}){return i(t.INFO,e,n)},e.success=function(e,n={}){return i(t.SUCCESS,e,n)},e.warning=function(e,n={}){return i(t.WARNING,e,n)},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.notification",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.notification",e))}(),function(){var e=function(e){"use strict";var t,n;e.OverlayStyle=void 0,(t=e.OverlayStyle||(e.OverlayStyle={})).DARK="dark",t.LIGHT="light",e.OverlayLoading=void 0,(n=e.OverlayLoading||(e.OverlayLoading={})).SPINNER="spinner",n.NONE="none";const i={[e.OverlayLoading.SPINNER]:'<div class="lds-ring"><div></div><div></div><div></div><div></div></div>',[e.OverlayLoading.NONE]:""};class o{constructor(e,t={}){this.options=t,this.element=e,MoyaLoader.css("/_moya/styles/libs/micromodal.css")}createOverlay(){const e=document.createElement("div");e.setAttribute("aria-hidden","true"),e.className="moya-modal",this.options.style&&e.classList.add("moya-modal--"+this.options.style);const t=document.createElement("div");t.className="moya-modal__overlay",t.tabIndex=-1,this.options.hideOnClick&&t.setAttribute("data-micromodal-close",""),e.appendChild(t);const n=document.createElement("div");n.className="moya-modal__container moya-modal__overlay-text",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),t.appendChild(n),this.element.appendChild(e),this.overlay=e,this.elementPosition=window.getComputedStyle(this.element).position}show(e){this.overlay||this.createOverlay(),e=e||this.options.message;const t=i[e]||null;t&&(e=t),this.overlay.firstElementChild.firstElementChild.innerHTML=e||"",this.overlay.classList.add("is-open"),"static"===this.elementPosition&&(this.element.style.position="relative")}hide(){this.overlay.classList.remove("is-open"),"relative"===this.elementPosition&&(this.element.style.position="")}}let s;return e.OverlayClass=o,e.execute=function(e){return s||(s=new o(document.body,{hideOnClick:!1})),e(s)},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.overlay",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.overlay",e))}(),function(){var e=function(e){"use strict";
1const t={triggerClickEvent:!0,closeOnBodyClick:!0,closeOnEsc:!0,openingDelay:400,closingDelay:400,openingClassPostfix:"opening",closingClassPostfix:"closing",closeOthers:!1},n={};class i{static create(e,t,o,s){if(!e||!t||!o)return null;if(n[o]&&document.body.contains(n[o].getToggleElement()))return n[o];const a=new i(e,t,o,s);return n[o]=a,a}constructor(e,n,i,o){this.shouldStopPropagation=function(e){const t=["fancybox"];if(e.target instanceof HTMLElement)for(let n=0;n<t.length;n++){const i="."+t[n];if(e.target.classList.contains(t[n]))return!1;if(e.target.closest(i))return!1}return!0},this.toggleElement=e,this.openElement=n,this.toggleKey=i,this.options=Object.assign({},t,o||{}),this.onOpen=o.onOpen||(()=>{}),this.onClose=o.onClose||(()=>{}),this.bodyClassOpen=i+"-open",this.bodyClassOpening=i+"-opening",this.bodyClassClosing=i+"-closing",this.setupAria(),this.setupToggleElementListeners(),this.setupOpenElementListeners(),this.setupBodyListeners()}isOpen(){return document.body.classList.contains(this.bodyClassOpen)}getToggleElement(){return this.toggleElement}getOpenElement(){return this.openElement}open(){document.body.classList.contains(this.bodyClassOpen)||document.body.classList.add(this.bodyClassOpen),this.toggleElement.setAttribute("aria-expanded","true"),this.onOpen(this),this.options.openingDelay>0&&(document.body.classList.add(this.bodyClassOpening),setTimeout(()=>{document.body.classList.remove(this.bodyClassOpening)},this.options.openingDelay)),!0===this.options.closeOthers&&Array.from(document.body.classList).filter(e=>e.endsWith("-open")).filter(e=>e!==this.bodyClassOpen).map(e=>document.body.classList.remove(e))}close(){document.body.classList.remove(this.bodyClassOpen),this.toggleElement.setAttribute("aria-expanded","false"),this.onClose(this),this.options.closingDelay>0&&(document.body.classList.add(this.bodyClassClosing),setTimeout(()=>{document.body.classList.remove(this.bodyClassClosing)},this.options.closingDelay))}getDefaultOptions(){return t}setupBodyListeners(){this.options.closeOnBodyClick&&document.addEventListener("click",()=>{this.isOpen()&&this.close()}),this.options.closeOnEsc&&document.addEventListener("keydown",e=>{"Escape"===e.code&&this.isOpen()&&this.close()})}setupOpenElementListeners(){this.openElement.addEventListener("click",e=>{this.shouldStopPropagation(e)&&e.stopPropagation()})}setupToggleElementListeners(){this.options.triggerClickEvent&&this.toggleElement.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),document.body.classList.toggle(this.bodyClassOpen),document.body.classList.contains(this.bodyClassOpen)?this.open():this.close()})}setupAria(){let e=this.openElement.getAttribute("id");e||(e=this.toggleKey+"OpenElement",this.openElement.setAttribute("id",e)),this.toggleElement.setAttribute("aria-haspopup","true"),this.options.triggerClickEvent?this.toggleElement.setAttribute("aria-controls",e):this.toggleElement.setAttribute("aria-owns",e)}}return e.Toggle=i,e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.toggle",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.toggle",e))}(),function(){var e=function(e){"use strict";var t,n;!function(e){e.DARK="dark",e.LIGHT="light"}(t||(t={})),function(e){e.SPINNER="spinner",e.NONE="none"}(n||(n={}));const i={[n.SPINNER]:'<div class="lds-ring"><div></div><div></div><div></div><div></div></div>',[n.NONE]:""};class o{constructor(e,t={}){this.options=t,this.element=e,MoyaLoader.css("/_moya/styles/libs/micromodal.css")}createOverlay(){const e=document.createElement("div");e.setAttribute("aria-hidden","true"),e.className="moya-modal",this.options.style&&e.classList.add("moya-modal--"+this.options.style);const t=document.createElement("div");t.className="moya-modal__overlay",t.tabIndex=-1,this.options.hideOnClick&&t.setAttribute("data-micromodal-close",""),e.appendChild(t);const n=document.createElement("div");n.className="moya-modal__container moya-modal__overlay-text",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),t.appendChild(n),this.element.appendChild(e),this.overlay=e,this.elementPosition=window.getComputedStyle(this.element).position}show(e){this.overlay||this.createOverlay(),e=e||this.options.message;const t=i[e]||null;t&&(e=t),this.overlay.firstElementChild.firstElementChild.innerHTML=e||"",this.overlay.classList.add("is-open"),"static"===this.elementPosition&&(this.element.style.position="relative")}hide(){this.overlay.classList.remove("is-open"),"relative"===this.elementPosition&&(this.element.style.position="")}}class s{constructor(e,t){this.uploadingFiles=[],this.container=e,this.options=t,this.overlay=new o(this.container,{hideOnClick:!1,message:this.options.lang.uploading}),this.files=[...this.options.initialFiles],this.injectStyles(),this.init()}isValidFile(e){return!!(e&&e.data&&void 0!==e.data.id&&e.urls)}injectStyles(){if(s.stylesInjected)return;const e=document.createElement("style");e.textContent='\n .moya-uploader { margin-bottom: 30px; font-family: sans-serif; }\n .el-upload { width: 100%; cursor: pointer; }\n .el-upload-dragger { background-color: #fff; border: 1px dashed #d9d9d9; border-radius: 6px; box-sizing: border-box; width: 100%; height: 180px; text-align: center; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; }\n .el-upload-dragger:hover { border-color: #409eff; }\n .el-upload-dragger.is-dragover { background-color: rgba(32,159,255,.06); border: 2px dashed #409eff; }\n .el-icon-upload { font-size: 67px; color: #c0c4cc; margin: 20px 0 16px; line-height: 50px; }\n .el-icon-upload::before { content: "â"; display: block; font-size: 50px; }\n .el-upload__text { color: #606266; font-size: 14px; text-align: center; }\n .el-upload__text em { color: #409eff; font-style: normal; }\n .fa-bars::before { content: "â¡"; }
1\n .fa-trash::before { content: "ð"; }\n .file-list, .uploading-list { margin-top: 10px; }\n .file { position: relative; border-top: 1px solid #dedede; border-bottom: 1px solid #dedede; display: flex; margin-bottom: -1px; padding: 10px 0; background: #fff; }\n .file__handle { display: flex; align-items: center; justify-content: center; padding-right: 15px; padding-left: 15px; font-size: 24px; cursor: grab; }\n .file__image { position: relative; flex: 0 0 100px; width: 100px; height: 100px; background-position: center; background-size: cover; background-repeat: no-repeat; border: 1px solid #eee; overflow: hidden; }\n .file__image img { width: 100%; height: 100%; object-fit: cover; }\n .file__info { flex: 1; padding-left: 15px; display: flex; flex-direction: column; justify-content: center; }\n .file__info div { margin-bottom: 5px; font-size: 14px; }\n .file__controls { display: flex; align-items: center; padding: 0 15px; }\n .file__remove { background-color: #f56c6c; border: none; color: white; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 16px; }\n .file__remove:hover { background-color: #f78989; }\n .progress-bar { width: 100%; background-color: #ebeef5; border-radius: 100px; height: 6px; margin-top: 10px; overflow: hidden; }\n .progress-bar-inner { height: 100%; background-color: #409eff; transition: width 0.3s; }\n .file--uploading .file__info { justify-content: flex-start; padding-top: 10px; }\n .file__exception { color: #f56c6c; font-size: 12px; margin-top: 5px; }\n .file.dragging { opacity: 0.5; background: #f5f7fa; }\n ',document.head.appendChild(e),s.stylesInjected=!0}init(){this.overlay.show(n.SPINNER),this.buildBaseDOM(),this.setupEventListeners(),this.renderFileList(),this.overlay.hide()}buildBaseDOM(){this.container.innerHTML="";const e=document.createElement("div");e.className="moya-uploader";const t=document.createElement("div");
1t.className="el-upload el-upload--text",this.dropZone=document.createElement("div"),this.dropZone.className="el-upload-dragger";const n=document.createElement("i");n.className="el-icon-upload";const i=document.createElement("div");i.className="el-upload__text",i.innerHTML=this.options.lang.dropZoneText,this.dropZone.append(n,i),this.fileInput=document.createElement("input"),this.fileInput.type="file",this.fileInput.style.display="none",this.fileInput.multiple=this.options.uploadOptions.multiple,this.fileInput.name=this.options.uploadOptions.name,t.append(this.dropZone,this.fileInput),this.fileListContainer=document.createElement("div"),this.fileListContainer.className="file-list",this.uploadingListContainer=document.createElement("div"),this.uploadingListContainer.className="uploading-list",e.append(t,this.fileListContainer,this.uploadingListContainer),this.container.appendChild(e)}setupEventListeners(){this.dropZone.addEventListener("click",()=>this.fileInput.click()),this.fileInput.addEventListener("change",()=>{this.fileInput.files&&this.handleFiles(this.fileInput.files),this.fileInput.value=""}),this.dropZone.addEventListener("dragover",e=>{e.preventDefault(),this.dropZone.classList.add("is-dragover")}),this.dropZone.addEventListener("dragleave",()=>this.dropZone.classList.remove("is-dragover")),this.dropZone.addEventListener("drop",e=>{var t;e.preventDefault(),this.dropZone.classList.remove("is-dragover"),(null===(t=e.dataTransfer)||void 0===t?void 0:t.files)&&this.handleFiles(e.dataTransfer.files)})}handleFiles(e){Array.from(e).forEach(e=>this.uploadFile(e))}uploadFile(e){var t;const i=(null===(t=crypto.randomUUID)||void 0===t?void 0:t.call(crypto))||Math.random().toString(36).substring(2),o=URL.createObjectURL(e),s={uid:i,name:e.name,percentage:0,status:"uploading",url:o};this.uploadingFiles.push(s),this.renderUploadingList();const a=new FormData;a.append(this.options.uploadOptions.name,e),this.overlay.show(n.SPINNER);const r=new XMLHttpRequest;r.open("POST",this.options.uploadUrl,!0),r.upload.onprogress=e=>{e.lengthComputable&&(s.percentage=e.loaded/e.total*100,this.updateProgressUI(i,s.percentage))},r.onload=()=>{if(this.overlay.hide(),r.status>=200&&r.status<300)try{const e=JSON.parse(r.responseText);if(this.isValidFile(e))return this.files.push(e),this.removeUploadingFile(i),void this.renderFileList()}catch(e){console.error("Upload response parsing failed",{error:e,uid:i,status:r.status,responseText:r.responseText})}this.handleUploadError(i)},r.onerror=()=>{this.overlay.hide(),this.handleUploadError(i)},r.send(a)}updateProgressUI(e,t){const n=this.container.querySelector(`[data-uid="${e}"] .progress-bar-inner`);n&&(n.style.width=`${t}%`)}handleUploadError(e){const t=this.uploadingFiles.find(t=>t.uid===e);t&&(t.status="fail",this.renderUploadingList())}removeUploadingFile(e){const t=this.uploadingFiles.findIndex(t=>t.uid===e);t>-1&&(URL.revokeObjectURL(this.uploadingFiles[t].url),this.uploadingFiles.splice(t,1),this.renderUploadingList())}renderFileList(){this.fileListContainer.innerHTML="",this.files.forEach((e,t)=>{const n=document.createElement("div");n.className="file",n.draggable=!!this.options.sortUrl,n.dataset.id=String(e.data.id),n.dataset.index=String(t),this.options.sortUrl&&n.appendChild(this.createDragHandle());const i=document.createElement("div");i.className="file__image";const o=this.sanitizeURL(e.urls.thumb||e.urls.xs||"");if(o){const t=document.createElement("img");t.src=o,t.alt=e.data.title||"",i.appendChild(t)}n.appendChild(i);const s=document.createElement("div");s.className="file__info";["title","filename","description"].forEach(t=>{const n=e.data[t];if(n){const e=document.createElement("div");e.textContent=String(n),s.appendChild(e)}}),n.appendChild(s);const a=document.createElement("div");if(a.className="file__controls",this.options.deleteUrl){const t=document.createElement("button");t.className="file__remove",t.title=this.options.lang.deleteBtnTitle;const n=document.createElement("i");
1n.className="fa fa-trash",t.appendChild(n),t.onclick=()=>this.handleDelete(e),a.appendChild(t)}n.appendChild(a),this.options.sortUrl&&this.setupSortEvents(n),this.fileListContainer.appendChild(n)})}createDragHandle(){const e=document.createElement("div");e.className="file__handle";const t=document.createElement("i");return t.className="fa fa-bars",e.appendChild(t),e}renderUploadingList(){this.uploadingListContainer.innerHTML="",this.uploadingFiles.forEach(e=>{const t=document.createElement("div");if(t.className="file file--uploading",t.dataset.uid=e.uid,this.options.sortUrl){const e=document.createElement("div");e.className="file__handle";const n=document.createElement("i");n.className="fa fa-bars",e.appendChild(n),t.appendChild(e)}const n=document.createElement("div");n.className="file__image",n.style.backgroundImage=`url('${this.sanitizeURL(e.url)}')`,t.appendChild(n);const i=document.createElement("div");i.className="file__info";const o=document.createElement("div");o.className="progress-bar";const s=document.createElement("div");if(s.className="progress-bar-inner",s.style.width=`${e.percentage}%`,o.appendChild(s),i.appendChild(o),"fail"===e.status){const e=document.createElement("div");e.className="file__exception",e.textContent=this.options.lang.uploadFailed,i.appendChild(e)}t.appendChild(i),this.uploadingListContainer.appendChild(t)})}sanitizeURL(e){if(!e)return"";try{const t=new URL(e,window.location.origin);return["http:","https:","blob:"].includes(t.protocol)?t.href:""}catch(e){return""}}handleDelete(e){confirm(this.options.lang.deleteConfirm)&&fetch(`${this.options.deleteUrl}/${encodeURIComponent(e.data.id)}`,{method:"POST"}).then(t=>{t.ok&&(this.files=this.files.filter(t=>t.data.id!==e.data.id),this.renderFileList())})}setupSortEvents(e){e.addEventListener("dragstart",t=>{var n;null===(n=t.dataTransfer)||void 0===n||n.setData("text/plain",e.dataset.index),e.classList.add("dragging")}),e.addEventListener("dragend",()=>e.classList.remove("dragging")),e.addEventListener("dragover",t=>{t.preventDefault();const n=this.fileListContainer.querySelector(".dragging");if(n&&n!==e){const i=e.getBoundingClientRect(),o=(t.clientY-i.top)/(i.bottom-i.top)>.5;this.fileListContainer.insertBefore(n,o?e.nextSibling:e)}}),e.addEventListener("drop",()=>this.handleSortUpdate())}handleSortUpdate(){const e=Array.from(this.fileListContainer.querySelectorAll(".file"));this.files=e.map(e=>this.files.find(t=>String(t.data.id)===e.dataset.id)).filter(e=>!!e),this.renderFileList();const t=new FormData;this.files.forEach(e=>t.append("sort[]",String(e.data.id))),fetch(this.options.sortUrl,{method:"POST",body:t}).catch(e=>console.error("Sort failed",e))}}return s.stylesInjected=!1,MoyaComponents.register("core.uploader",e=>{const t=e.querySelector("moya-uploader")||e,n="is"===moya.lang,i={uploading:t.getAttribute("lang-uploading")||(n?"Hleð inn":"Uploading"),deleteConfirm:t.getAttribute("lang-delete-confirm")||(n?"Ertu viss um að þú viljir eyða þessari mynd?":"Are you sure you want to delete this image?"),uploadFailed:t.getAttribute("lang-upload-failed")||(n?"Gat ekki skrifað à gagnagrunn":"Could not write to database"),dropZoneText:t.getAttribute("lang-dropzone-text")||(n?"Dragðu skrár hingað inn eða smelltu til að velja":"Drop files here or click to upload."),deleteBtnTitle:t.getAttribute("lang-delete-btn-title")||(n?"Eyða":"Delete")},o=t.getAttribute("initial-files");let a=[];if(o)try{a=JSON.parse(o),Array.isArray(a)||(console.warn('Moya Uploader: "initial-files" is not a JSON array; ignoring value.',o),a=[])}catch(e){console.error('Moya Uploader: failed to parse the "initial-files" attribute. Expected JSON array.',e,o),a=[]}new s(t,{uploadUrl:t.getAttribute("upload-url")||"",deleteUrl:t.getAttribute("delete-url")||"",sortUrl:t.getAttribute("sort-url")||"",initialFiles:a,lang:i,uploadOptions:{name:t.getAttribute("upload-name")||"Filedata",multiple:t.hasAttribute("multiple")}})}),e.Uploader=s,e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.uploader",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.uploader",e))}(),function(){var e=function(e){"use strict";return e.delegate=function(e,t,n,i,o=!1){const s=function(t){t.delegateTarget=t.target.closest(n),t.delegateTarget&&i.call(e,t)};return e.addEventListener(t,s,!!o),{destroy(){e.removeEventListener(t,s,o)}}}
1,e.version=function(){return"1.0.0"},e}({});void 0!==e&&"undefined"!=typeof window&&void 0!==window.MoyaContainer&&("object"==typeof e&&1===Object.keys(e).length?window.MoyaContainer.set("core.util",e[Object.keys(e)[0]]):window.MoyaContainer.register("core.util",e))}(),(()=>{var e={628:(e,t,n)=>{"use strict";n.d(t,{default:()=>f});const i={maxNotifications:10,animationDuration:300,position:"bottom-right",labels:{tip:"Tip",info:"Info",success:"Success",warning:"Attention",alert:"Error",async:"Loading",confirm:"Confirmation required",confirmOk:"OK",confirmCancel:"Cancel"},icons:{tip:"question-circle",info:"info-circle",success:"check-circle",warning:"exclamation-circle",alert:"exclamation-triangle",async:"cog fa-spin",confirm:"exclamation-triangle",prefix:"<i class='fa fas fa-fw fa-",suffix:"'></i>",enabled:!0},replacements:{tip:null,info:null,success:null,warning:null,alert:null,async:null,"async-block":null,modal:null,confirm:null,general:{"<script>":"","<\/script>":""}},messages:{tip:"",info:"",success:"Action has been succeeded",warning:"",alert:"Action has been failed",confirm:"This action can't be undone. Continue?",async:"Please, wait...","async-block":"Loading"},formatError(e){if(e.response){if(!e.response.data)return"500 API Server Error";if(e.response.data.errors)return e.response.data.errors.map(e=>e.detail).join("<br>");if(e.response.statusText)return`${e.response.status} ${e.response.statusText}: ${e.response.data}`}return e.message?e.message:e},durations:{global:5e3,success:null,info:null,tip:null,warning:null,alert:null},minDurations:{async:1e3,"async-block":1e3}};class o{constructor(e={},t=i){Object.assign(this,this.defaultsDeep(t,e))}icon(e){return this.icons.enabled?`${this.icons.prefix}${this.icons[e]}${this.icons.suffix}`:""}label(e){return this.labels[e]}duration(e){let t=this.durations[e];return null===t?this.durations.global:t}toSecs(e){return e/1e3+"s"}applyReplacements(e,t){if(!e)return this.messages[t]||"";for(const n of["general",t])if(this.replacements[n])for(const t in this.replacements[n])e=e.replace(t,this.replacements[n][t]);return e}override(e){return e?new o(e,this):this}defaultsDeep(e,t){let n={};for(const i in e)t.hasOwnProperty(i)?n[i]="object"==typeof e[i]&&null!==e[i]?this.defaultsDeep(e[i],t[i]):t[i]:n[i]=e[i];return n}}const s="awn-popup",a="awn-toast",r="awn-btn",l="awn-confirm",d={prefix:a,klass:{label:`${a}-label`,content:`${a}-content`,icon:`${a}-icon`,progressBar:`${a}-progress-bar`,progressBarPause:`${a}-progress-bar-paused`},ids:{container:`${a}-container`}},c={prefix:s,klass:{buttons:"awn-buttons",button:r,successBtn:`${r}-success`,cancelBtn:`${r}-cancel`,title:`${s}-title`,body:`${s}-body`,content:`${s}-content`,dotAnimation:`${s}-loading-dots`},ids:{wrapper:`${s}-wrapper`,confirmOk:`${l}-ok`,confirmCancel:`${l}-cancel`}},u="awn-hiding",h=class{constructor(e,t,n,i,o){this.newNode=document.createElement("div"),t&&(this.newNode.id=t),n&&(this.newNode.className=n),i&&(this.newNode.style.cssText=i),this.parent=e,this.options=o}beforeInsert(){}afterInsert(){}insert(){return this.beforeInsert(),this.el=this.parent.appendChild(this.newNode),this.afterInsert(),this}replace(e){if(this.getElement())return this.beforeDelete().then(()=>(this.updateType(e.type),this.parent.replaceChild(e.newNode,this.el),this.el=this.getElement(e.newNode),this.afterInsert(),this))}beforeDelete(e=this.el){let t=0;return this.start&&(t=this.options.minDurations[this.type]+this.start-Date.now(),t<0&&(t=0)),new Promise(n=>{setTimeout(()=>{e.classList.add(u),setTimeout(n,this.options.animationDuration)},t)})}delete(e=this.el){return this.getElement(e)?this.beforeDelete(e).then(()=>{e.remove(),this.afterDelete()}):null}afterDelete(){}getElement(e=this.el){return e?document.getElementById(e.id):null}addEvent(e,t){this.el.addEventListener(e,t)}toggleClass(e){this.el.classList.toggle(e)}updateType(e){this.type=e,this.duration=this.options.duration(this.type)}},p=class extends h{constructor(e,t,n,i){super(i,`${d.prefix}-${Math.floor(Date.now()-100*Math.random())}`,`${d.prefix} ${d.prefix}-${t}`,`animation-duration: ${n.toSecs(n.animationDuration)};`,n),this.updateType(t),this.setInnerHtml(e)}setInnerHtml(e){"alert"===this.type&&e&&(e=this.options.formatError(e)),e=this.options.applyReplacements(e,this.type),this.newNode.innerHTML=`<div class="awn-toast-wrapper">${this.progressBar}${this.label}<div class="${d.klass.content}">${e}</div><span class="${d.klass.icon}">${this.options.icon(this.type)}</span></div>`}beforeInsert(){if(this.parent.childElementCount>=this.options.maxNotifications){let e=Array.from(this.parent.getElementsByClassName(
1d.prefix));this.delete(e.find(e=>!this.isDeleted(e)))}}afterInsert(){if("async"==this.type)return this.start=Date.now();if(this.addEvent("click",()=>this.delete()),!(this.duration<=0)){this.timer=new class{constructor(e,t){this.callback=e,this.remaining=t,this.resume()}pause(){this.paused=!0,window.clearTimeout(this.timerId),this.remaining-=new Date-this.start}resume(){this.paused=!1,this.start=new Date,window.clearTimeout(this.timerId),this.timerId=window.setTimeout(()=>{window.clearTimeout(this.timerId),this.callback()},this.remaining)}toggle(){this.paused?this.resume():this.pause()}}(()=>this.delete(),this.duration);for(const e of["mouseenter","mouseleave"])this.addEvent(e,()=>{this.isDeleted()||(this.toggleClass(d.klass.progressBarPause),this.timer.toggle())})}}isDeleted(e=this.el){return e.classList.contains(u)}get progressBar(){return this.duration<=0||"async"===this.type?"":`<div class='${d.klass.progressBar}' style="animation-duration:${this.options.toSecs(this.duration)};"></div>`}get label(){return`<b class="${d.klass.label}">${this.options.label(this.type)}</b>`}},m=class extends h{constructor(e,t="modal",n,i,o){let s=`animation-duration: ${n.toSecs(n.animationDuration)};`;super(document.body,c.ids.wrapper,null,s,n),this[c.ids.confirmOk]=i,this[c.ids.confirmCancel]=o,this.className=`${c.prefix}-${t}`,["confirm","async-block","modal"].includes(t)||(t="modal"),this.updateType(t),this.setInnerHtml(e),this.insert()}setInnerHtml(e){let t=this.options.applyReplacements(e,this.type);switch(this.type){case"confirm":let e=[`<button class='${c.klass.button} ${c.klass.successBtn}'id='${c.ids.confirmOk}'>${this.options.labels.confirmOk}</button>`];!1!==this[c.ids.confirmCancel]&&e.push(`<button class='${c.klass.button} ${c.klass.cancelBtn}'id='${c.ids.confirmCancel}'>${this.options.labels.confirmCancel}</button>`),t=`${this.options.icon(this.type)}<div class='${c.klass.title}'>${this.options.label(this.type)}</div><div class="${c.klass.content}">${t}</div><div class='${c.klass.buttons} ${c.klass.buttons}-${e.length}'>${e.join("")}</div>`;break;case"async-block":t=`${t}<div class="${c.klass.dotAnimation}"></div>`}this.newNode.innerHTML=`<div class="${c.klass.body} ${this.className}">${t}</div>`}keyupListener(e){if("async-block"===this.type)return e.preventDefault();switch(e.code){case"Escape":e.preventDefault(),this.delete();case"Tab":if(e.preventDefault(),"confirm"!==this.type||!1===this[c.ids.confirmCancel])return!0;let t=this.okBtn;e.shiftKey?document.activeElement.id==c.ids.confirmOk&&(t=this.cancelBtn):document.activeElement.id!==c.ids.confirmCancel&&(t=this.cancelBtn),t.focus()}}afterInsert(){switch(this.listener=e=>this.keyupListener(e),window.addEventListener("keydown",this.listener),this.type){case"async-block":this.start=Date.now();break;case"confirm":this.okBtn.focus(),this.addEvent("click",e=>{if("BUTTON"!==e.target.nodeName)return!1;this.delete(),this[e.target.id]&&this[e.target.id]()});break;default:document.activeElement.blur(),this.addEvent("click",e=>{e.target.id===this.newNode.id&&this.delete()})}}afterDelete(){window.removeEventListener("keydown",this.listener)}get okBtn(){return document.getElementById(c.ids.confirmOk)}get cancelBtn(){return document.getElementById(c.ids.confirmCancel)}};class f{constructor(e={}){this.options=new o(e)}tip(e,t){return this._addToast(e,"tip",t).el}info(e,t){return this._addToast(e,"info",t).el}success(e,t){return this._addToast(e,"success",t).el}warning(e,t){return this._addToast(e,"warning",t).el}alert(e,t){return this._addToast(e,"alert",t).el}async(e,t,n,i,o){let s=this._addToast(i,"async",o);return this._afterAsync(e,t,n,o,s)}confirm(e,t,n,i){return this._addPopup(e,"confirm",i,t,n)}asyncBlock(e,t,n,i,o){let s=this._addPopup(i,"async-block",o);return this._afterAsync(e,t,n,o,s)}modal(e,t,n){return this._addPopup(e,t,n)}closeToasts(){let e=this.container;for(;e.firstChild;)e.removeChild(e.firstChild)}_addPopup(e,t,n,i,o){return new m(e,t,this.options.override(n),i,o)}_addToast(e,t,n,i){n=this.options.override(n);let o=new p(e,t,n,this.container);return i?i instanceof m?i.delete().then(()=>
1o.insert()):i.replace(o):o.insert()}_afterAsync(e,t,n,i,o){return e.then(this._responseHandler(t,"success",i,o),this._responseHandler(n,"alert",i,o))}_responseHandler(e,t,n,i){return o=>{switch(typeof e){case"undefined":case"string":let s="alert"===t?e||o:e;this._addToast(s,t,n,i);break;default:i.delete().then(()=>{e&&e(o)})}}}_createContainer(){return new h(document.body,d.ids.container,`awn-${this.options.position}`).insert().el}get container(){return document.getElementById(d.ids.container)||this._createContainer()}}},612:(e,t,n)=>{e.exports=n(628).default}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i=n(612);AWN=i})(),window.moya=window.moya||{},window.moya.lang&&(window.moya._locale=window.moya.lang),Object.defineProperties(window.moya,{lang:{get:function(){return this._locale},set:function(e){if(e){this._locale=e;const t=new CustomEvent("moya.locale",{detail:e});document.dispatchEvent(t)}}}}),MoyaContainer.addModifier(function(e){e.setLocale&&(e.setLocale(window.moya.lang||"is"),document.addEventListener("moya.locale",t=>e.setLocale(t.detail)))}),MoyaLoader.css("/_moya/styles/libs/awn.css");
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.