@iamproperty/components 5.1.0-beta → 5.1.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/js/components/accordion/accordion.component.min.js +1 -1
- package/assets/js/components/actionbar/actionbar.component.min.js +1 -1
- package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
- package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
- package/assets/js/components/card/card.component.min.js +1 -1
- package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
- package/assets/js/components/fileupload/fileupload.component.min.js +1 -1
- package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
- package/assets/js/components/header/header.component.min.js +1 -1
- package/assets/js/components/nav/nav.component.min.js +1 -1
- package/assets/js/components/notification/notification.component.min.js +1 -1
- package/assets/js/components/pagination/pagination.component.min.js +1 -1
- package/assets/js/components/table/table.component.min.js +1 -1
- package/assets/js/components/tabs/tabs.component.min.js +1 -1
- package/assets/js/dynamic.min.js +1 -1
- package/assets/js/modules/dynamicEvents.js +18 -11
- package/assets/js/scripts.bundle.js +1 -1
- package/assets/js/scripts.bundle.min.js +1 -1
- package/assets/ts/modules/dynamicEvents.ts +31 -22
- package/dist/components.es.js +11 -11
- package/dist/components.umd.js +11 -11
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function n(e){let r=e.querySelectorAll("details"),a=e.querySelectorAll("summary");if(r.forEach(o=>{o.classList.add("accordion-item")}),a.forEach(o=>{o.classList.add("accordion-header"),o.classList.add("accordion-button"),o.classList.add("h4")}),!e.classList.contains("accordion--keep-open")){const o=e.querySelectorAll(":scope > details");o.forEach(c=>{c.addEventListener("click",()=>{o.forEach(t=>{t!==c&&t.removeAttribute("open")})})})}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"accordion"});class i extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const r=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${r}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/const A=function(i){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var a=i.getAttribute("data-id"),d=i.getAttribute("id");if(typeof d>"u"||d==null){var n=String.fromCharCode(65+Math.floor(Math.random()*26));d=n+Date.now(),i.setAttribute("id",d)}function o(){window.player=new YT.Player(d,{height:"100%",width:"100%",videoId:a,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:u,onStateChange:e}})}o();function u(r){r.target.playVideo()}var t=!1;function e(r){if(r.data==YT.PlayerState.PLAYING&&!t){var s=document.getElementById(d);s.classList.add("player-ready"),t=!0}}},L=i=>(Array.from(i.querySelectorAll("dialog[open]")).forEach((a,d)=>{a.closest(".dialog__wrapper")||(a.removeAttribute("open"),a.showModal(),a.focus(),w(a))}),i.addEventListener("click",a=>{if(a.target.tagName=="IAM-ACTIONBAR")return!1;if(a&&a.target instanceof HTMLElement&&a.target.closest("[data-modal]")){const o=a.target.closest("[data-modal]"),u=o.hasAttribute("data-modal")?o.getAttribute("data-modal"):o.getAttribute("data-filter"),t=document.querySelector(`dialog#${u}`);w(t),t.showModal(),t.focus();let e=t.offsetWidth;t.setAttribute("style",`max-width: ${e}px;`),Array.from(t.querySelectorAll("[data-duplicate]")).forEach((r,s)=>{const b=r.getAttribute("data-duplicate"),c=document.getElementById(b);if(r.checked!=c.checked){r.checked=c.checked;let l=new Event("change");r.dispatchEvent(l)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:u})}if(a&&a.target instanceof HTMLElement&&a.target.closest("button.dialog__close")){const o=a.target.closest("dialog[open]");a.preventDefault(),o.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,t)=>{u.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest('button[formmethod="dialog"]')){const o=a.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,t)=>{u.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(a&&a.target instanceof HTMLElement&&a.target.closest("dialog[open]")){let o=a.target.closest("dialog[open]");var d=window.getComputedStyle(o);if(d.display==="contents"&&(o=o.parentNode.closest("dialog[open]")),!o.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||o.classList.contains("dialog--multi")){const u=o.getBoundingClientRect();(a.clientX<u.left||a.clientX>u.right||a.clientY<u.top||a.clientY>u.bottom)&&(a.target.closest('input[type="radio"]')||o.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")}))}}if(a&&a.target instanceof HTMLElement&&a.target.closest(".dialog__wrapper > button")){a.stopPropagation();let o=a.target.closest(".dialog__wrapper > button"),u=a.target.closest(".dialog__wrapper > button").parentNode,t="openPopover",e=u.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=e&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((c,l)=>{c.removeAttribute("aria-expanded")}),e.hasAttribute("open"))e.close(),t="closePopover",e.removeAttribute("style"),o.removeAttribute("aria-expanded");else{e.show(),o.setAttribute("aria-expanded",!0);var n=o.getBoundingClientRect();let c=n.top,l=n.left;if(o.closest("iam-table")){let h=o.closest("iam-table").parentNode.getBoundingClientRect();c-=h.top,l-=h.left}e.classList.contains("dialog--fix")&&e.setAttribute("style",`position:fixed;top: ${c}px; left: ${l}px; margin: 3rem 0 0 0;`)}let r=e.getBoundingClientRect(),s=r.bottom-window.scrollY,b=window.innerHeight-window.scrollY;if(s>b){let c=e.hasAttribute("style")?e.getAttribute("style")+" ":"";e.setAttribute("style",c+"transform: translate(0, calc(-100% - 4rem))"),r=e.getBoundingClientRect(),r.top-window.scrollY<100&&e.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:t,id:o.textContent})}a&&a.target instanceof HTMLElement&&!a.target.closest("dialog[open]")&&!a.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((o,u)=>{o.removeAttribute("aria-expanded")}))}),null),w=i=>{i.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!i.classList.contains("dialog--multi")&&i.addEventListener("cancel",d=>{d.preventDefault()});let a=i.querySelector(".youtube-embed a");if(a&&A(a),i.classList.contains("dialog--multi")&&!i.querySelector(":scope > .steps")&&_(i),!i.querySelector(":scope > .mh-lg")&&!i.classList.contains("dialog--multi")){i.innerHTML=`<div class="mh-lg">${i.innerHTML}</div>`;let d=i.querySelector(".mh-lg"),n=i.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(n){let o=n.previousSibling;d.before(n),o&&n.before(o)}}i.querySelector(":scope > button:first-child")||i.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},_=i=>{let a="",d=Array.from(i.querySelectorAll("fieldset[data-title]")),n=i.querySelector("form");d.forEach((t,e)=>{a+=`<button data-title="${t.getAttribute("data-title")}" type="button" class="${e==0?"active":""}" tabindex="-1">${t.getAttribute("data-title")}</button>`;const r=document.createElement("div");if(r.classList.add("btn--wrapper"),t.appendChild(r),e!=0&&(r.innerHTML+=`<button data-title="${d[e-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),e!=d.length-1&&(r.innerHTML+=`<button data-title="${d[e+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),e==d.length-1)if(n&&n.querySelector(':scope > button[type="submit"]')){let s=n.querySelector(':scope > button[type="submit"]');s.classList.add("mb-0"),r.insertAdjacentElement("beforeend",s)}else r.innerHTML+=`<button data-title="${d[e].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),i.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${a}</div>`);let o=Array.from(i.querySelectorAll("fieldset.was-validated"));for(let t=0;t<o.length;t++){let e=o[t],r=e.getAttribute("data-title");if(e.querySelector(".is-invalid")){Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((s,b)=>{s.classList.add("active")});break}else Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((s,b)=>{s.classList.add("valid")})}i.addEventListener("invalid",function(){return function(t){t.preventDefault()}}(),!0);function u(t){const e=i.querySelector("fieldset.active")?i.querySelector("fieldset.active"):i.querySelector("fieldset[data-title]"),r=e.getAttribute("data-title");let s=!0;if(e.classList.add("was-validated"),Array.from(e.querySelectorAll("input")).forEach((l,h)=>{l.checkValidity()||(s=!1)}),s?Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((l,h)=>{l.classList.add("valid")}):Array.from(i.querySelectorAll(`[data-title="${r}"]`)).forEach((l,h)=>{l.classList.remove("valid")}),s||!t.hasAttribute("data-next")){const l=i.querySelector(`fieldset[data-title="${t.getAttribute("data-title")}"]`),h=i.querySelector(`.steps button[data-title="${t.getAttribute("data-title")}"]`);Array.from(i.querySelectorAll("button")).forEach((g,m)=>{g.classList.remove("active")}),Array.from(i.querySelectorAll("fieldset")).forEach((g,m)=>{g.classList.remove("active")}),h.classList.add("active"),l.classList.add("active")}let b=Array.from(i.querySelectorAll("fieldset")).length,c=Array.from(i.querySelectorAll("fieldset.valid")).length;i.style.setProperty("--progress",`${c/(b-1)*100}%`)}i.addEventListener("keydown",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest("button")){const e=t.target.closest("button");t.keyCode==13&&e.getAttribute("type")!="submit"&&(t.preventDefault(),u(e))}t&&t.target instanceof HTMLElement&&t.target.closest("input")&&(t.target.closest("input").classList.remove("is-invalid"),t.keyCode==13&&t.preventDefault())}),i.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest('button[type="submit"]'))t.target.closest("form").classList.add("was-validated");else if(t&&t.target instanceof HTMLElement&&t.target.closest("button[data-title]")){const e=t.target.closest("button[data-title]");u(e)}return null})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"action bar"});function v(i,a){i&&a=="all"?(i.querySelector("input").indeterminate=!1,i.querySelector("input").checked=!0,i.querySelector("label").textContent="Select all"):i&&a==0?(i.querySelector("input").indeterminate=!1,i.querySelector("input").checked=!1,i.querySelector("label").textContent="Select all"):i&&a?(i.querySelector("input").indeterminate=!0,i.querySelector("input").checked=!1,i.querySelector("label").textContent=`${a} item${a>1?"s":""} selected`):i&&(i.querySelector("input").checked=!1,i.querySelector("input").indeterminate=!1,i.querySelector("label").textContent="Select all")}class S extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",d=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/import S from"js-cookie";var q=function(y,r,o,a){function m(n){return n instanceof o?n:new o(function(u){u(n)})}return new(o||(o=Promise))(function(n,u){function b(l){try{h(a.next(l))}catch(p){u(p)}}function v(l){try{h(a.throw(l))}catch(p){u(p)}}function h(l){l.done?n(l.value):m(l.value).then(b,v)}h((a=a.apply(y,r||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Address Lookup"});class A extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const r=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${r}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function h(d,m){function u(e,t){let l=!1,r=t.getAttribute("name");r.includes("[]")&&(r=r.replace("[]",`[${t.value}]`));let i=e.querySelector(`[data-name="${r}"]`);i&&t.getAttribute("type")=="checkbox"&&(l=!t.checked);let o=t.getAttribute("data-filter-text");if(i||(i=document.createElement("button"),e.appendChild(i)),i.setAttribute("type","button"),i.classList.add("filter"),i.setAttribute("data-name",r),i.innerHTML=o.replace("$value",t.value),(!t.value||l)&&i.remove(),t.parentNode.closest("[data-filter-text]")){let p=t.parentNode.closest("[data-filter-text]"),f=!0;if(r="",p.querySelectorAll("input").forEach((a,n)=>{let s=a.getAttribute("name");if(r+=`${n!=0?",":""}${s}`,e.querySelector(`[data-name="${s}"]`)&&e.querySelector(`[data-name="${s}"]`).remove(),a.value){let c=document.createElement("button");c.setAttribute("type","button"),c.classList.add("filter"),c.setAttribute("data-name",s),c.innerHTML=o.replace("$value",a.value),e.appendChild(c)}else f=!1}),e.querySelector(`[data-name="${r}"]`)&&e.querySelector(`[data-name="${r}"]`).remove(),f){let a=p.getAttribute("data-filter-text");p.querySelectorAll("input").forEach((s,c)=>{let b=s.getAttribute("name");e.querySelector(`[data-name="${b}"]`)&&e.querySelector(`[data-name="${b}"]`).remove(),a=a.replace(`$${c+1}`,s.value)});let n=document.createElement("button");n.setAttribute("type","button"),n.classList.add("filter"),n.setAttribute("data-name",r),n.innerHTML=a,e.appendChild(n)}}}Array.from(d.querySelectorAll('input[type="checkbox"]:checked')).forEach((e,t)=>{u(m,e)}),Array.from(d.querySelectorAll("input[data-filter-text]")).forEach((e,t)=>{e.addEventListener("change",function(l){u(m,e),l.stopPropagation()})}),d.addEventListener("change",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest("input[data-filter-text]")){let t=e.target.closest("input[data-filter-text]");u(m,t)}}),m.addEventListener("click",function(e){if(e&&e.target instanceof HTMLElement&&e.target.closest(".filter")){let r=e.target.closest(".filter"),i=r.getAttribute("data-name").split(",");for(var t=0;t<i.length;t++){let o=i[t],p=`[name="${o}"]`;o.match(/\[(.*)\]/)&&(o.replace(/\[(.*)\]/,"[]"),p=`[value="${o.replace(/.*\[(.*)\]/,"$1")}"]`);let f=d.querySelectorAll(p);for(var l=0;l<f.length;l++){let a=f[l];if(a.getAttribute("type")!="radio"&&a.getAttribute("type")!="checkbox")a.value="";else{a.checked=!1;var e=new Event("force");d.hasAttribute("data-nosubmit")||a.closest("form").dispatchEvent(e)}}}r.remove()}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Applied Filters"});class g extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const m=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",u=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${m}/css/core.min.css`;let e=this.classList.toString();const t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Card"});class h extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.querySelector('[class*="fa-"]')&&this.classList.add("card--has-icon");let e=this.classList.toString();const a=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${a}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class s extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function h(c,o){const r=o.querySelector(".files"),l=o.querySelector(".drop-area"),t=c.querySelector("input"),u=c.hasAttribute("data-maxsize")?c.getAttribute("data-maxsize"):0,a=t.cloneNode();l.append(a),o.addEventListener("click",e=>{e&&e.target instanceof HTMLElement&&e.target.closest(".btn-primary")&&(e.target.closest(".btn-primary"),(t.hasAttribute("multiple")?a:t).click())}),o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest(".files button")){const i=new DataTransfer,{files:d}=t,p=e.target.closest(".files button");for(let n=0;n<d.length;n++){const s=d[n];s.name!=p.getAttribute("data-file")&&i.items.add(s)}t.files=i.files;const m=new Event("change");t.dispatchEvent(m)}}),a.addEventListener("change",e=>{if(t.hasAttribute("multiple")){const d=[...t.files,...a.files];let p=[];const m=new DataTransfer;for(let n=0;n<d.length;n++){const s=d[n],f=s.size/1e3;!p.includes(s.name)&&(u==0||f<u)&&m.items.add(s),p.push(s.name)}t.files=m.files}else t.files=a.files;const i=new Event("change");t.dispatchEvent(i)}),a.addEventListener("dragenter",e=>{a.classList.add("focus")}),a.addEventListener("dragleave",e=>{a.classList.remove("focus")}),a.addEventListener("drop",e=>{a.classList.remove("focus")}),t.addEventListener("change",e=>{r.innerHTML="";for(const i of t.files)r.innerHTML+=`<span class="file">${i.name} <button data-file="${i.name}">Remove</button></span>`})}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class b extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,l=document.createElement("template");l.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function r(s,t){n(s,t)}function n(s,t){var e;t.addEventListener("keyup",a=>{clearTimeout(e),e=setTimeout(function(){o(s,t.value)},500)}),t.addEventListener("change",a=>{clearTimeout(e),o(s,t.value)})}const o=function(s,t){Array.from(s.querySelectorAll(":scope > li")).forEach((e,a)=>{let i=e.textContent.toLowerCase();e.classList.add("d-none"),i.includes(t.toLowerCase())&&e.classList.remove("d-none")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Filtered list",value:t})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"filterlist"});class l extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class p extends HTMLElement{constructor(){super();const d=this.attachShadow({mode:"open"}),n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",r=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style class="styles">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/function r(i){if(i.hasAttribute("data-type")&&i.getAttribute("data-type")=="toast"){let t=document.querySelector(".notification__holder");t||(t=document.createElement("div"),t.classList.add("notification__holder"),t.classList.add("container"),document.querySelector("body").appendChild(t)),i.closest(".notification__holder")||t.appendChild(i)}if(i.setAttribute("role","alert"),i.addEventListener("click",function(t){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(t.preventDefault(),a(i))},!1),i.hasAttribute("data-timeout")){let t=i.getAttribute("data-timeout");var n=new c(function(){a(i)},t);i.addEventListener("mouseenter",o=>{n.pause()}),i.addEventListener("mouseleave",o=>{n.resume()})}}function c(i,n){var t,o,e=n;this.pause=function(){window.clearTimeout(t),e-=new Date-o},this.resume=function(){o=new Date,window.clearTimeout(t),t=window.setTimeout(i,e)},this.resume()}const a=function(i){i.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class d extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const n=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${n}/css/core.min.css`,o=this.querySelectorAll("a,button");Array.from(o).forEach((s,l)=>{s.setAttribute("slot","btns"),s.classList.add("link")}),(o.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/class v extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",t=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/const B=function(a){return typeof a!="string"?!1:!isNaN(a)&&!isNaN(parseFloat(a))},Q=(a,e)=>String(a).padStart(e,"0"),X=a=>a.charAt(0).toUpperCase()+a.slice(1);var Y=function(a,e,o,r){function b(c){return c instanceof o?c:new o(function(i){i(c)})}return new(o||(o=Promise))(function(c,i){function n(u){try{t(r.next(u))}catch(s){i(s)}}function d(u){try{t(r.throw(u))}catch(s){i(s)}}function t(u){u.done?c(u.value):b(u.value).then(n,d)}t((r=r.apply(a,e||[])).next())})};const R=a=>{const e=Array.from(a.querySelectorAll("thead th"));Array.from(a.querySelectorAll("tbody tr")).forEach((r,b)=>{const c=Array.from(r.querySelectorAll("th, td")),i=["0","low","medium","high","unknown","n/a","pending","verified","due","overdue","incomplete","complete","completed","approval required","upcoming","requires approval","to do","on track","not started","warning","error"];c.forEach((n,d)=>{const t=e[d];if(typeof t<"u"){let u=document.createElement("div");u.innerHTML=t.innerHTML;let s=u.textContent||u.innerText||"";n.setAttribute("data-label",s),t.hasAttribute("data-td-class")&&n.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(n.setAttribute("data-format",t.getAttribute("data-format")),n.innerHTML=M(t.getAttribute("data-format"),n.textContent.trim())),i.includes(n.textContent.trim().toLowerCase())&&n.setAttribute("data-content",n.textContent.trim().toLowerCase())}})})},J=a=>{let e=0;return Array.from(a.querySelectorAll("tbody tr")).forEach((o,r)=>{let b=window.getComputedStyle(document.querySelector("html")),c=o.querySelector(":scope > *:last-child > *:first-child");if(c){c.classList.add("text-nowrap");let i=c.offsetWidth/parseFloat(b.fontSize);i+=1.7,e=e>i?e:i}}),e},G=(a,e)=>{if(e.classList.contains(".table--fullwidth")&&!e.hasAttribute("data-expandable")||a.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(a.querySelectorAll("thead tr")).forEach((o,r)=>{o.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(a.querySelectorAll("tbody tr")).forEach((o,r)=>{const b=o.getAttribute("data-view")==="full"?"aria-expanded":"";o.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${b}>Expand</button></td>`)})},K=a=>{a.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let o=e.target.closest("[data-expand-button]"),r=o.closest("tr");o.toggleAttribute("aria-expanded"),r.getAttribute("data-view")=="full"?r.setAttribute("data-view","default"):r.setAttribute("data-view","full"),o.blur()}})},N=(a,e)=>{let o=e.querySelector("[data-search]");if(!o)return!1;const r=o.getAttribute("id"),b=o.getAttribute("data-search").split(",");let c=o.parentNode,i={};b.forEach((n,d)=>{Array.from(a.querySelectorAll('td[data-label="'+n.trim()+'"]')).forEach((t,u)=>{t.querySelector(".td__content")?i[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:i[t.textContent]=t.textContent})}),o.setAttribute("list",`${r}_list`),o.setAttribute("autocomplete","off"),c.querySelector("datalist")||(c.innerHTML+=`<datalist id="${r}_list"></datalist>`),c.querySelector("datalist").innerHTML=`${Object.keys(i).map(n=>`<option value="${n}"></option>`).join("")}`},V=(a,e,o,r,b)=>{var c;let i=function(t,u=!1){if(e.classList.contains("processing"))return!1;if(t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((s,m)=>{const h=s.getAttribute("data-duplicate"),l=document.getElementById(h),g=document.querySelector(`[for="${h}"] iam-card`);if(l.checked!=s.checked)if(g){let y=new Event("click");g.dispatchEvent(y)}else l.checked=s.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!u){let s=e.querySelector("[data-pagination]");s.value=1,r.setAttribute("data-page",1)}z(a,e,o,r)}else e.hasAttribute("data-submit")?e.submit():(C(a,e,r),E(a,e));if(e.hasAttribute("data-ajax-post")){let s=new FormData(e),m=new URLSearchParams(s).toString();const h=new XMLHttpRequest;h.open("GET",`${window.location.href}?ajax=true&${m}`),h.send()}};e.addEventListener("keyup",t=>{clearTimeout(c),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&(c=setTimeout(function(){i(t)},500))}),e.addEventListener("change",t=>{clearTimeout(c),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(a,e,b),i(t)),t&&t.target instanceof HTMLElement&&t.target.closest("[data-search]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(a,e,r),E(a,e)):(t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&t.target.closest("form .dialog__wrapper > dialog")||t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter]")&&!t.target.closest("form dialog"))&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-show]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-mimic]")&&i(t)}),e.addEventListener("click",t=>{if(clearTimeout(c),t&&t.target instanceof HTMLElement&&t.target.closest('dialog button:not([type="button"])')&&t.target.closest('dialog button:not([type="button"])').closest("dialog").close(),t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__close")&&(t.preventDefault(),t.stopPropagation()),t&&t.target instanceof HTMLElement&&t.target.closest("[data-clear]")){e.classList.add("processing"),Array.from(e.querySelectorAll(".applied-filters")).forEach((s,m)=>{s.innerHTML=""});let u=e.elements;for(let s=0;s<u.length;s++)switch(u[s].type.toLowerCase()?u[s].type.toLowerCase():"text"){case"text":case"password":case"textarea":u[s].value="";break;case"radio":case"checkbox":if(u[s].checked){let h=u[s],l=h.getAttribute("id"),g=document.querySelector(`[for="${l}"`);if(g.querySelector("iam-card")){let y=g.querySelector("iam-card"),v=new Event("click");y.dispatchEvent(v)}h.checked=!1}break;case"select-one":case"select-multi":u[s].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(a,e,b),i(t)}}),e.addEventListener("submit",t=>{clearTimeout(c),e.hasAttribute("data-submit")||t.preventDefault(),i(t)}),e.addEventListener("force",t=>{i(t)}),e.addEventListener("paginate",t=>{i(t,!0)});let n=[],d=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,u)=>{let s=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${s}"]`)).forEach((m,h)=>{let l=m.closest("form");n.includes(l)||n.push(l),d.includes(s)||d.push(s)})}),n.forEach((t,u)=>{const s=function(){let m=[],h=new FormData(t);for(const[l,g]of h)document.querySelector(`[data-mimic="${l}"]`)&&!m.includes(l)?(m.push(l),document.querySelector(`[data-mimic="${l}"]`).value=g):document.querySelector(`[data-mimic="${l}"]`)&&(document.querySelector(`[data-mimic="${l}"]`).value+=","+g);for(const l of m){const g=new Event("force");e.dispatchEvent(g)}for(const l of d)if(!h.has(l)&&t.querySelector(`[name="${l}"]`)){document.querySelector(`[data-mimic="${l}"]`).value="";const g=new Event("force");e.dispatchEvent(g)}};t.addEventListener("force",m=>{s()}),t.addEventListener("change",m=>{s()})})},O=(a,e,o)=>{if(e.getAttribute("data-ajax"))return!1;let r=a.querySelector("tbody"),b=e.querySelector("[data-sort]"),c=b.querySelector(`option:nth-child(${b.selectedIndex+1})`),i=c.getAttribute("data-sort"),n=c.getAttribute("data-order"),d=c.getAttribute("data-format");if(!i)return r.innerHTML=o.innerHTML,R(a),!1;let t=[];["asc","desc","descending"].includes(n)||(t=n.split(","));let u=[];Array.from(r.querySelectorAll("tr")).forEach((m,h)=>{let l=m.querySelector('td[data-label="'+i+'"], th[data-label="'+i+'"]').textContent.trim();m.querySelector('[data-label="'+i+'"] .td__content')&&(l=m.querySelector('[data-label="'+i+'"] .td__content').textContent.trim()),t.length&&t.includes(l)&&(l=t.indexOf(l)),B(l)&&(l=Q(l,10)),d&&d=="date"&&(l=new Date(l));const g={index:l,row:m};u.push(g)}),u.sort((m,h)=>m.index>h.index?1:-1),(n=="descending"||n=="desc")&&(u=u.reverse());let s="";u.forEach((m,h)=>{s+=m.row.outerHTML}),r.innerHTML=s},C=(a,e,o)=>{a.classList.remove("table--filtered");let r=P(e),b=[],c=0,i=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,n=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(a.querySelectorAll("tbody tr")).forEach((t,u)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("[data-search]")){let t=e.querySelector("[data-search]");e.querySelector("[data-search]").getAttribute("data-search").split(",").forEach((s,m)=>{b.push({column:`${s.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,u)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let d=0;Object.values(r).forEach((t,u)=>{typeof t=="object"&&Object.values(t).length?d+=Object.values(t).length:d++}),d&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,u)=>{t.innerHTML+=`(${d})`,t.parentNode.classList.add("hover")}),a.classList.add("table--filtered");for(const[t,u]of Object.entries(r))Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((s,m)=>{let h=!1;u.forEach((l,g)=>{let y=s.querySelector(`[data-label="${t}"]`);if(l&&l=="$today")l=M("date",new Date);else if(l&&l=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),l=M("date",f)}else if(l&&(l=="$thisWeek"||l=="$lastWeek")){let f=new Date,x=new Date(f.setDate(f.getDate()-(f.getDay()-1))),w=new Date(f.setDate(f.getDate()-f.getDay()+7)),p=new Date(y.textContent.toLowerCase());if(f.setHours(0,0,0,0),x.setHours(0,0,0,0),w.setHours(0,0,0,0),p.setHours(0,0,0,0),l=="$thisWeek")h=p>=x&&p<=w;else{let T=new Date(x.setDate(x.getDate()-7)),A=new Date(w.setDate(w.getDate()-7));T.setHours(0,0,0,0),A.setHours(0,0,0,0),h=p>=T&&p<=A}}else if(l&&l=="$thisMonth"){let f=new Date,x=f.getFullYear(),w=f.getMonth();var v=new Date(x,w,1),S=new Date(x,w+1,0);let p=new Date(y.textContent.toLowerCase());v.setHours(0,0,0,0),S.setHours(0,0,0,0),p.setHours(0,0,0,0),h=p>=v&&p<=S}else if(l&&l=="$lastMonth"){let f=new Date,x=f.getFullYear(),w=f.getMonth();var k=new Date(x,w-1,1),L=new Date(x,w,0);let p=new Date(y.textContent.toLowerCase());k.setHours(0,0,0,0),L.setHours(0,0,0,0),p.setHours(0,0,0,0),h=p>=k&&p<=L}y&&y.textContent.toLowerCase().includes(l.toLowerCase())&&(h=!0)}),h||(s.classList.add("filtered"),s.setAttribute("data-filtered-by",t))});Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,u)=>{let s=!(b.length>0&&b[0].value.length>=3);b.forEach((m,h)=>{let l=t.querySelector(`[data-label="${m.column}"]`);l&&m.value.length>=3&&l.textContent.toLowerCase().includes(m.value.toLowerCase())&&(s=!0)}),s||t.classList.add("filtered")}),Array.from(a.querySelectorAll("tbody tr:not(.filtered")).forEach((t,u)=>{c++,t.classList.add("filtered--matched"),Math.ceil(c/n)==parseInt(i)&&t.classList.add("filtered--show")}),o&&(o.setAttribute("data-total",c),o.setAttribute("data-show",n),o.setAttribute("data-page",i))},E=(a,e,o)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((b,c)=>{let i=b.getAttribute("data-query"),n;if(i=="total")o.hasAttribute("data-total")?n=o.getAttribute("data-total"):n=(a.classList.contains("table--filtered"),a.querySelectorAll("tbody tr").length);else if(!i.includes(" == ")&&i.includes(" & ")){let d=i.split(" & "),t="";d.forEach(u=>{t+=`:not([data-filtered-by="${u}"])`}),n=Array.from(a.querySelectorAll(`tbody tr${t}`)).length}else if(!i.includes(" == "))n=Array.from(a.querySelectorAll(`tbody tr:not([data-filtered-by="${i}"])`)).length;else if(i.includes(" && ")){let d=i.split(" && ");n=Array.from(a.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let u=!0;for(const[s,m]of Object.entries(d)){let h=m.split(" == ");(!t.querySelector(`td[data-label="${h[0]}"]`)||t.querySelector(`td[data-label="${h[0]}"]`).textContent!=`${h[1]}`)&&(u=!1)}return u}).length}else{let d=i.split(" == ");n=Array.from(a.querySelectorAll(`tbody tr.filtered--matched td[data-label="${d[0]}"], tbody tr[data-filtered-by="${d[0]}"] td[data-label="${d[0]}"]`)).filter(function(t){return t.textContent===d[1]}).length}b.hasAttribute("data-total")?b.setAttribute("data-total",n):b.innerHTML=n})},Z=function(a,e,o,r){o.addEventListener("update-page",b=>{let c=e.querySelector("[data-pagination]"),i=b.detail.page;if(c.value=i,e.dispatchEvent(new Event("paginate")),r.setAttribute("data-page",i),a.hasAttribute("data-show-history")){const n=new URL(location);n.searchParams.set("page",i),history.pushState({type:"pagination",form:e.getAttribute("id"),page:i},"",n)}if(!r.hasAttribute("data-no-scroll")){const d=a.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:d,behavior:"smooth"})}}),o.addEventListener("update-show",b=>{let c=e.querySelector("[data-show]"),i=b.detail.show;c.value=i,r.setAttribute("data-show",i),e.dispatchEvent(new Event("submit"))})},tt=(a,e)=>{if(!a)return!1;a.addEventListener("click",o=>{et(e)})},et=function(a){for(var e=[],o=a.getElementsByTagName("tr"),r=0;r<o.length;r++){for(var b=o[r].querySelectorAll("td,th"),c=[],i=0;i<b.length;i++)c.push(`"${b[i].textContent}"`);e.push(c.join(","))}e=e.join(`
|
|
5
5
|
`);let n=new Blob([e],{type:"text/csv"});var d=document.createElement("a");d.download="export.csv";var t=window.URL.createObjectURL(n);d.href=t,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d)},I=function(a,e,o,r){if(R(a),G(a,r),E(a,e,r),r&&r.classList.contains("table--cta")){let c=function(){Array.from(a.querySelectorAll("tr")).forEach((i,n)=>{let d=i.offsetHeight;i.style.setProperty("--row-height",`${d}px`)})};const b=J(a);r.style.setProperty("--cta-width",`${b}rem`),new ResizeObserver(c).observe(a)}},P=function(a){let e=new Object;return Array.from(a.querySelectorAll("[data-filter]")).forEach((r,b)=>{if(!(r.type=="radio"&&!r.checked)&&!(r.type=="checkbox"&&!r.checked)&&r&&r.value){let c=r.getAttribute("data-filter");e[c]||(e[c]=new Array),e[c].push(r.value)}}),e},z=function(a,e,o,r){return Y(this,void 0,void 0,function*(){const b=(h,l,g)=>l.split(/[\.\[\]\'\"]/).filter(y=>y).reduce((y,v)=>y?y[v]:g,h);let c=new FormData(e),i=new URLSearchParams(c).toString(),n=a.querySelectorAll("thead tr th"),d=a.querySelector("tbody"),t=e.getAttribute("data-ajax");r.classList.add("table--loading");let u=P(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((h,l)=>{h.innerHTML="",h.parentNode.classList.remove("hover")});let s=0;Object.values(u).forEach((h,l)=>{typeof h=="object"&&Object.values(h).length?s+=Object.values(h).length:s++}),s&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((h,l)=>{h.innerHTML+=`(${s})`,h.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[t]&&window.controller[t].abort(),window.controller[t]=new AbortController;const{signal:m}=controller[t];o.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(t+"?"+i,{signal:m,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(h=>h.json()).then(h=>{let l=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",g=e.hasAttribute("data-schema-total")?e.getAttribute("data-schema-total"):"meta.total",y=e.hasAttribute("data-schema-page")?e.getAttribute("data-schema-page"):"meta.current_page",v=b(h,g,15),S=b(h,y,1),k=b(h,l),L=r.hasAttribute("data-empty-msg")?r.getAttribute("data-empty-msg"):"No results found";k?(d.innerHTML="",k.forEach((f,x)=>{var w=document.createElement("tr");n.forEach((p,T)=>{let A="";var _=document.createElement("td");if(_.setAttribute("data-label",p.innerText),p.getAttribute("data-output")){var $=p.getAttribute("data-output");A=$.replace(new RegExp(/{(.*?)}/,"gm"),function(D){return b(f,D.replace("{","").replace("}",""))})}if(p.hasAttribute("data-output-array")){var $=p.getAttribute("data-output");let F=b(f,$.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=p.getAttribute("data-output-array"),q="";if(p.hasAttribute("data-output-array-property")&&p.hasAttribute("data-output-array-transform")){const H=b(j,p.getAttribute("data-output-array-property")),U=JSON.parse(p.getAttribute("data-output-array-transform"))[H];q=W.replace(`{${p.getAttribute("data-output-array-property")}}`,U)}q=q.replace(new RegExp(/{(.*?)}/,"gm"),function(H){return b(j,H.replace("{","").replace("}",""))}),A+=q})}p.hasAttribute("data-transform")&&(A=JSON.parse(p.getAttribute("data-transform"))[A],!A&&p.hasAttribute("data-default")&&(A=p.getAttribute("data-default"))),_.innerHTML=A,w.appendChild(_)}),d.appendChild(w)}),N(a,e),r.setAttribute("data-total",parseInt(v)),r.setAttribute("data-page",parseInt(S)),I(a,e,o,r),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((f,x)=>{let w=b(h,f.getAttribute("data-ajax-query"),"");f.hasAttribute("data-total")?f.setAttribute("data-total",w):f.innerHTML=w}),parseInt(v)==0&&(d.innerHTML=`<tr><td colspan="100%"><span>${L}</span></td></tr>`),r.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:t,formData:i})):d.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',o.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(h){console.log(h)}})},M=(a,e)=>{switch(a){case"datetime":return new Date(e).toLocaleDateString("en-gb",{weekday:"short",year:"2-digit",month:"long",day:"numeric"})+" "+new Date(e).toLocaleTimeString("en-gb",{hour:"2-digit",minute:"2-digit"});case"date":return new Date(e).toLocaleDateString("en-gb",{year:"2-digit",month:"long",day:"numeric"});case"capitalise":return e=X(e)}};class at extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",o=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/const d=function(t){t.querySelectorAll(":scope > details");const o=t.querySelectorAll(":scope > details, :scope > a");t.querySelectorAll(":scope > details > summary");let a=t.querySelector(":scope > .tabs__links");if(t.shadowRoot&&t.shadowRoot.querySelector(".tabs__links")&&(a=t.shadowRoot.querySelector(".tabs__links")),!a){a=document.createElement("div"),a.classList.add("tabs__links");let e=document.createElement("div");e.classList.add("tabs__links__wrapper"),e.prepend(a),t.prepend(e)}let i=0;o.forEach((e,r)=>{let n=document.createElement("button");if(e.matches("details")){let s=e.querySelector(":scope > summary"),l=s.classList.contains("disabled");s.classList.add("visually-hidden"),e.hasAttribute("id")&&n.setAttribute("data-id",`${e.getAttribute("id")}`),e.hasAttribute("open")&&n.setAttribute("aria-pressed",!0),n.innerHTML=`${s.innerText}`,n.classList.add("link"),n.setAttribute("data-index",i),e.setAttribute("tabindex","-1"),l&&n.classList.add("disabled"),i++}else e.matches("a")&&(n=e);n.classList.add("link"),a.appendChild(n)})},c=function(t){let o=t.querySelectorAll(":scope > details"),a=t.querySelectorAll(":scope > details > summary"),i=t.querySelectorAll(":scope .tabs__links > button");t.shadowRoot&&(i=t.shadowRoot.querySelectorAll(".tabs__links > button")),i.forEach(e=>{e.addEventListener("click",r=>{if(r.preventDefault(),e.classList.contains("disabled"))return!1;i.forEach(n=>{let s=n==e;n.setAttribute("aria-pressed",s)}),o.forEach((n,s)=>{let l=e.getAttribute("data-index")==s;l?n.setAttribute("open",l):n.removeAttribute("open")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openTab",tabTitle:e.textContent})})}),a.forEach((e,r)=>{e.addEventListener("click",n=>{n.preventDefault(),i[r].click()})})},p=function(t){if(!t.querySelector(":scope > details"))return!1;let o=t.querySelectorAll(":scope > details"),a=t.shadowRoot.querySelectorAll(".tabs__links > button");location.hash&&t.shadowRoot.querySelector(`.tabs__links [data-id="${location.hash.replace("#","")}"]`)?(t.shadowRoot.querySelector(`[data-id="${location.hash.replace("#","")}"]`).setAttribute("aria-pressed",!0),t.querySelector(`details[id="${location.hash.replace("#","")}"]`).setAttribute("open",!0)):t.querySelector("details[open]")||(o[0].setAttribute("open",!0),a[0].setAttribute("aria-pressed",!0))},b=function(t){d(t),c(t),p(t)};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"tabs"});class u extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",a=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|
package/assets/js/dynamic.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/(function(b){typeof define=="function"&&define.amd?define(b):b()})(function(){"use strict";const b=t=>(t.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&t.classList.add("ie"),null),L=t=>{const o=function(e){const a=document.querySelector(`label[for="${e.replace("#","")}"]`),i=document.querySelector(e+" summary"),l=document.querySelector(`dialog${e}`);a instanceof HTMLElement?a.click():i instanceof HTMLElement?i.click():l instanceof HTMLElement&&l.showModal()};return location.hash&&o(location.hash),window.addEventListener("hashchange",function(){o(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state&&e.state.type&&e.state.type=="pagination"){let a=document.querySelector(`#${e.state.form}`),i=document.querySelector(`#${e.state.form} [data-pagination]`);i?i.value=e.state.page:a.innerHTML+=`<input name="page" type="hidden" data-pagination="true" value="${e.state.page}" />`,a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){let a=e.target;a.querySelector(":invalid")&&(a.classList.add("was-validated"),e.preventDefault())}}),null};class v{constructor(o){document.body.classList.contains("youtubeLoaded")?o.addEventListener("click",function(e){for(var a=e.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){e.preventDefault(),y(a);break}},!1):this.loadScripts(o,this.createEmbed)}loadScripts(o){return new Promise((e,a)=>{const i=new Image;i.onload=function(){var l=document.createElement("script");l.src="https://www.youtube.com/iframe_api";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(l,s),document.body.classList.add("youtubeLoaded"),e(!0),l.onload=()=>{o.addEventListener("click",function(r){console.log("click"),r&&r.target instanceof HTMLElement&&r.target.closest("a")&&(r.preventDefault(),y(r.target.closest("a")))},!1)}},i.onerror=function(){a(!1)},i.src="https://youtube.com/favicon.ico"})}}const y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var o=t.getAttribute("data-id"),e=t.getAttribute("id");if(typeof e>"u"||e==null){var a=String.fromCharCode(65+Math.floor(Math.random()*26));e=a+Date.now(),t.setAttribute("id",e)}function i(){window.player=new YT.Player(e,{height:"100%",width:"100%",videoId:o,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:l,onStateChange:r}})}i();function l(n){n.target.playVideo()}var s=!1;function r(n){if(n.data==YT.PlayerState.PLAYING&&!s){var c=document.getElementById(e);c.classList.add("player-ready"),s=!0}}},S=t=>(Array.from(t.querySelectorAll("dialog[open]")).forEach((o,e)=>{o.closest(".dialog__wrapper")||(o.removeAttribute("open"),o.showModal(),o.focus(),A(o))}),t.addEventListener("click",o=>{if(o.target.tagName=="IAM-ACTIONBAR")return!1;if(o&&o.target instanceof HTMLElement&&o.target.closest("[data-modal]")){const i=o.target.closest("[data-modal]"),l=i.hasAttribute("data-modal")?i.getAttribute("data-modal"):i.getAttribute("data-filter"),s=document.querySelector(`dialog#${l}`);A(s),s.showModal(),s.focus();let r=s.offsetWidth;s.setAttribute("style",`max-width: ${r}px;`),Array.from(s.querySelectorAll("[data-duplicate]")).forEach((n,c)=>{const d=n.getAttribute("data-duplicate"),u=document.getElementById(d);if(n.checked!=u.checked){n.checked=u.checked;let f=new Event("change");n.dispatchEvent(f)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:l})}if(o&&o.target instanceof HTMLElement&&o.target.closest("button.dialog__close")){const i=o.target.closest("dialog[open]");o.preventDefault(),i.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((l,s)=>{l.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(o&&o.target instanceof HTMLElement&&o.target.closest('button[formmethod="dialog"]')){const i=o.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((l,s)=>{l.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")})}if(o&&o.target instanceof HTMLElement&&o.target.closest("dialog[open]")){let i=o.target.closest("dialog[open]");var e=window.getComputedStyle(i);if(e.display==="contents"&&(i=i.parentNode.closest("dialog[open]")),!i.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||i.classList.contains("dialog--multi")){const l=i.getBoundingClientRect();(o.clientX<l.left||o.clientX>l.right||o.clientY<l.top||o.clientY>l.bottom)&&(o.target.closest('input[type="radio"]')||i.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:i.getAttribute("id")}))}}if(o&&o.target instanceof HTMLElement&&o.target.closest(".dialog__wrapper > button")){o.stopPropagation();let i=o.target.closest(".dialog__wrapper > button"),l=o.target.closest(".dialog__wrapper > button").parentNode,s="openPopover",r=l.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=r&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((u,f)=>{u.removeAttribute("aria-expanded")}),r.hasAttribute("open"))r.close(),s="closePopover",r.removeAttribute("style"),i.removeAttribute("aria-expanded");else{r.show(),i.setAttribute("aria-expanded",!0);var a=i.getBoundingClientRect();let u=a.top,f=a.left;if(i.closest("iam-table")){let m=i.closest("iam-table").parentNode.getBoundingClientRect();u-=m.top,f-=m.left}r.classList.contains("dialog--fix")&&r.setAttribute("style",`position:fixed;top: ${u}px; left: ${f}px; margin: 3rem 0 0 0;`)}let n=r.getBoundingClientRect(),c=n.bottom-window.scrollY,d=window.innerHeight-window.scrollY;if(c>d){let u=r.hasAttribute("style")?r.getAttribute("style")+" ":"";r.setAttribute("style",u+"transform: translate(0, calc(-100% - 4rem))"),n=r.getBoundingClientRect(),n.top-window.scrollY<100&&r.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:s,id:i.textContent})}o&&o.target instanceof HTMLElement&&!o.target.closest("dialog[open]")&&!o.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((i,l)=>{i.removeAttribute("aria-expanded")}))}),null),A=t=>{t.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!t.classList.contains("dialog--multi")&&t.addEventListener("cancel",e=>{e.preventDefault()});let o=t.querySelector(".youtube-embed a");if(o&&y(o),t.classList.contains("dialog--multi")&&!t.querySelector(":scope > .steps")&&q(t),!t.querySelector(":scope > .mh-lg")&&!t.classList.contains("dialog--multi")){t.innerHTML=`<div class="mh-lg">${t.innerHTML}</div>`;let e=t.querySelector(".mh-lg"),a=t.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){let i=a.previousSibling;e.before(a),i&&a.before(i)}}t.querySelector(":scope > button:first-child")||t.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},q=t=>{let o="",e=Array.from(t.querySelectorAll("fieldset[data-title]")),a=t.querySelector("form");e.forEach((s,r)=>{o+=`<button data-title="${s.getAttribute("data-title")}" type="button" class="${r==0?"active":""}" tabindex="-1">${s.getAttribute("data-title")}</button>`;const n=document.createElement("div");if(n.classList.add("btn--wrapper"),s.appendChild(n),r!=0&&(n.innerHTML+=`<button data-title="${e[r-1].getAttribute("data-title")}" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>`),r!=e.length-1&&(n.innerHTML+=`<button data-title="${e[r+1].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="button">Next</button>`),r==e.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){let c=a.querySelector(':scope > button[type="submit"]');c.classList.add("mb-0"),n.insertAdjacentElement("beforeend",c)}else n.innerHTML+=`<button data-title="${e[r].getAttribute("data-title")}" class="btn btn-primary mb-0" data-next type="submit">Submit</button>`}),t.insertAdjacentHTML("afterbegin",`<div class="steps bg-primary">${o}</div>`);let i=Array.from(t.querySelectorAll("fieldset.was-validated"));for(let s=0;s<i.length;s++){let r=i[s],n=r.getAttribute("data-title");if(r.querySelector(".is-invalid")){Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((c,d)=>{c.classList.add("active")});break}else Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((c,d)=>{c.classList.add("valid")})}t.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function l(s){const r=t.querySelector("fieldset.active")?t.querySelector("fieldset.active"):t.querySelector("fieldset[data-title]"),n=r.getAttribute("data-title");let c=!0;if(r.classList.add("was-validated"),Array.from(r.querySelectorAll("input")).forEach((f,m)=>{f.checkValidity()||(c=!1)}),c?Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((f,m)=>{f.classList.add("valid")}):Array.from(t.querySelectorAll(`[data-title="${n}"]`)).forEach((f,m)=>{f.classList.remove("valid")}),c||!s.hasAttribute("data-next")){const f=t.querySelector(`fieldset[data-title="${s.getAttribute("data-title")}"]`),m=t.querySelector(`.steps button[data-title="${s.getAttribute("data-title")}"]`);Array.from(t.querySelectorAll("button")).forEach((g,O)=>{g.classList.remove("active")}),Array.from(t.querySelectorAll("fieldset")).forEach((g,O)=>{g.classList.remove("active")}),m.classList.add("active"),f.classList.add("active")}let d=Array.from(t.querySelectorAll("fieldset")).length,u=Array.from(t.querySelectorAll("fieldset.valid")).length;t.style.setProperty("--progress",`${u/(d-1)*100}%`)}t.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){const r=s.target.closest("button");s.keyCode==13&&r.getAttribute("type")!="submit"&&(s.preventDefault(),l(r))}s&&s.target instanceof HTMLElement&&s.target.closest("input")&&(s.target.closest("input").classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault())}),t.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]'))s.target.closest("form").classList.add("was-validated");else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){const r=s.target.closest("button[data-title]");l(r)}return null})};function E(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",t=>{const o=t.target.closest("[open] summary");if(o)window.dataLayer.push({event:"closeDetails",detailsTitle:o.textContent||""});else{const e=t.target.closest("summary"),a=t.target.closest("a"),i=t.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),i&&window.dataLayer.push({event:"buttonClicked",buttonText:i.textContent||"",class:i.hasAttribute("class")&&i.getAttribute("class")||""})}})}const x=t=>{function o(){if(Array.from(document.querySelectorAll("input[maxlength]")).forEach((e,a)=>{e.parentElement,T(e)}),document.querySelector('input[type="date"]')){let a=function(i){const l=i.getFullYear(),s=String(i.getMonth()+1).padStart(2,"0"),r=String(i.getDate()).padStart(2,"0");return`${l}-${s}-${r}`};const e=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((i,l)=>{let s=e;if(i.hasAttribute("data-start")&&(s.setDate(s.getDate()+parseInt(i.getAttribute("data-start"))),i.setAttribute("min",a(s))),i.hasAttribute("data-period")){let r=parseInt(i.getAttribute("data-period")),n=new Date;n.setDate(s.getDate()+r),i.setAttribute("max",a(n))}if(i.hasAttribute("data-allowed-days")){let r=JSON.parse(`[${i.getAttribute("data-allowed-days")}]`);i.addEventListener("input",function(n){var c=new Date(this.value).getUTCDay();r.includes(c)?i.setCustomValidity(""):i.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&o(),document.onreadystatechange=()=>{document.readyState==="complete"&&o()},t.addEventListener("input",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("input,textarea,select")){const a=e.target.closest("input,textarea,select");a.parentElement,a.hasAttribute("type")&&a.getAttribute("type")=="color"&&(a.nextElementSibling.value=a.value),a.hasAttribute("maxlength")&&a.nextElementSibling&&a.nextElementSibling.setAttribute("data-count",a.value.length)}}),t.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("select")){const a=e.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){const i=document.getElementById(a.getAttribute("data-input")),l=a.value;w(i,l)}}if(e&&e.target instanceof HTMLElement&&e.target.closest('dialog [type="radio"]')){const a=e.target.closest("dialog");e.target.closest('dialog [type="radio"]'),Array.from(a.querySelectorAll('[type="radio"][autofocus]')).forEach((i,l)=>{i.removeAttribute("autofocus")}),Array.from(a.querySelectorAll('[type="radio"]:checked')).forEach((i,l)=>{i.setAttribute("autofocus",!0)})}}),t.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-type][data-input]:not(select)")){const a=e.target.closest("[data-change-type]"),i=document.getElementById(a.getAttribute("data-input")),l=a.getAttribute("data-change-type");if(a.setAttribute("data-change-type",i.getAttribute("type")),w(i,l),a.hasAttribute("data-alt-class")){const s=a.getAttribute("data-alt-class");a.setAttribute("data-alt-class",a.getAttribute("class")),a.setAttribute("class",s)}}})},T=t=>{let o=t.parentElement,e=t.getAttribute("maxlength");o.style.setProperty("--maxlength",e);let a=t.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),o.insertBefore(a,t.nextSibling)),a.setAttribute("data-count",t.value.length)},w=(t,o)=>{t.setAttribute("type",o)},_=t=>{Array.from(t.querySelectorAll("details")).forEach((o,e)=>{o.addEventListener("mouseenter",function(a){window.matchMedia("(min-width: 62em)").matches&&o.setAttribute("open","true")},!1),o.addEventListener("mouseleave",function(a){window.matchMedia("(min-width: 62em)").matches&&o.removeAttribute("open")},!1)}),"IntersectionObserver"in window&&new IntersectionObserver(([e])=>e.target.classList.toggle("is-stuck",e.intersectionRatio<1),{threshold:[1]}).observe(t)};function M(t){var o;const e=t.querySelector(".testimonial__images"),a=e.querySelectorAll("img").length;if(a==1)return!1;t.classList.add("testimonial--multi");const i=function(l){const s=t.querySelector(".btn-next"),r=t.querySelector(".btn-prev");s.setAttribute("data-go",l+1),r.setAttribute("data-go",l-1),s.removeAttribute("disabled"),r.removeAttribute("disabled"),l==1?r.setAttribute("disabled",!0):l==a&&s.setAttribute("disabled",!0)};e.addEventListener("scroll",function(l){clearTimeout(o),o=setTimeout(function(){let s=e.scrollWidth,r=e.scrollHeight,n=e.scrollLeft,c=e.scrollTop,d=Math.round(n/s*a)+1;n==0&&c!=0&&(d=Math.round(c/r*a)+1),t.setAttribute("data-show",d),i(d)},300)},!1),t.addEventListener("click",function(l){for(var s=l.target;s&&s!=this;s=s.parentNode)if(s.matches("[data-go]")){let r=parseInt(s.getAttribute("data-go")),n=0,c=0,d=e.scrollWidth,u=e.scrollHeight;d>u?c=Math.floor(d*((r-1)/a)):n=Math.floor(u*((r-1)/a)),e.scroll({top:n,left:c,behavior:"smooth"});break}},!1)}function k(t){var o;let e=t.querySelector(".carousel__inner"),a=t.querySelectorAll(".carousel__item").length;t.getAttribute("data-cols");let i=t.getAttribute("data-sm-cols"),l=t.getAttribute("data-md-cols");t.querySelector(".carousel__controls a").setAttribute("aria-current",!0),e.addEventListener("scroll",function(s){clearTimeout(o),o=setTimeout(function(){let r=e.clientWidth,n=e.scrollWidth,c=e.scrollLeft,d=Math.round(c/n*a)+1,u=t.querySelector(".carousel__item:last-child").offsetLeft;Array.from(t.querySelectorAll(".carousel__controls a")).forEach((f,m)=>{f.removeAttribute("aria-current")}),t.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?t.querySelector(".btn-prev").setAttribute("disabled","disabled"):t.querySelector(".btn-prev").removeAttribute("disabled"),e.scrollLeft+r>u?t.querySelector(".btn-next").setAttribute("disabled","disabled"):t.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),t.addEventListener("click",function(s){for(var r=s.target;r&&r!=this;r=r.parentNode)if(r.matches(".carousel__controls a")){s.preventDefault(),Array.from(t.querySelectorAll(".carousel__controls a")).forEach((c,d)=>{c.removeAttribute("aria-current")}),r.setAttribute("aria-current",!0);const n=document.querySelector(r.getAttribute("href"));e.scroll({top:0,left:n.offsetLeft,behavior:"smooth"});break}},!1),t.addEventListener("click",function(s){for(var r=s.target;r&&r!=this;r=r.parentNode)if(r.matches(".btn-next, .btn-prev")){s.preventDefault();let n=r.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:n,behavior:"smooth"});break}},!1),a==1&&t.classList.add("hide-btns"),i>=a&&t.classList.add("hide-sm-btns"),l>=a&&t.classList.add("hide-md-btns")}function $(t){t.addEventListener("change",function(o){var e=parseInt(t.querySelector("[data-min] select,[data-min] input").value),a=parseInt(t.querySelector("[data-max] select,[data-max] input").value);Array.from(t.querySelectorAll("[data-min] input")).forEach((i,l)=>{i.setAttribute("max",a)}),Array.from(t.querySelectorAll("[data-max] input")).forEach((i,l)=>{i.setAttribute("min",e)}),Array.from(t.querySelectorAll("[data-min] select option")).forEach((i,l)=>{parseInt(i.getAttribute("value"))>a?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(t.querySelectorAll("[data-max] select option")).forEach((i,l)=>{parseInt(i.getAttribute("value"))<e?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function C(t){t.addEventListener("change",function(o){if(t.matches("[data-value-if]")){const e=t.getAttribute("data-redirect"),a=t.getAttribute("data-value-if");t.value==a&&(document.location.href=e)}else typeof t.value<"u"&&(document.location.href=t.value)},!1)}function H(t){const e=t.querySelector(".row").cloneNode(!0),a=t.querySelector("[data-add]");t.addEventListener("click",function(i){for(var l=i.target;l&&l!=this;l=l.parentNode){if(l.matches("[data-add]")){const s=e.cloneNode(!0);t.insertBefore(s,l),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(l.matches("[data-delete]")){l.closest(".row").remove(),a.matches("[data-maxfiles]")&&Array.from(t.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function D(t){Array.from(t.querySelectorAll("[data-input-range]")).forEach((o,e)=>{$(o)}),Array.from(t.querySelectorAll("[data-redirect]")).forEach((o,e)=>{C(o)}),Array.from(t.querySelectorAll(".multiple-file-uploads")).forEach((o,e)=>{H(o)}),t.addEventListener("change",function(o){for(var e=o.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){const a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}},!1),t.addEventListener("change",function(o){Array.from(t.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,a)=>{let i=e.closest("[data-group]")?e.closest("[data-group]"):t,l=e.dataset.activeif,s=e.dataset.equals;i.querySelector(`select[data-id="${l}"],input[data-id="${l}"]`).value==s?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(t.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,a)=>{let i=e.closest("[data-group]")?e.closest("[data-group]"):t,l=e.dataset.activeif,s=e.dataset.equals;i.querySelector(`select[data-id="${l}"],input[data-id="${l}"]`).value==s?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}function I(t){if(t.hasAttribute("data-type")&&t.getAttribute("data-type")=="toast"){let e=document.querySelector(".notification__holder");e||(e=document.createElement("div"),e.classList.add("notification__holder"),e.classList.add("container"),document.querySelector("body").appendChild(e)),t.closest(".notification__holder")||e.appendChild(t)}if(t.setAttribute("role","alert"),t.addEventListener("click",function(e){event&&event.target instanceof HTMLElement&&event.target.closest("[data-dismiss-button]")&&(e.preventDefault(),p(t))},!1),t.hasAttribute("data-timeout")){let e=t.getAttribute("data-timeout");var o=new B(function(){p(t)},e);t.addEventListener("mouseenter",a=>{o.pause()}),t.addEventListener("mouseleave",a=>{o.resume()})}}function B(t,o){var e,a,i=o;this.pause=function(){window.clearTimeout(e),i-=new Date-a},this.resume=function(){a=new Date,window.clearTimeout(e),e=window.setTimeout(t,i)},this.resume()}const p=function(t){t.classList.add("d-none")};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Notification"});class N extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,a=`@import "${o}/css/components/notification.css";`,i=`@import "${o}/css/components/notification.global.css";`,l=this.querySelectorAll("a,button");Array.from(l).forEach((r,n)=>{r.setAttribute("slot","btns"),r.classList.add("link")}),(l.length||this.hasAttribute("data-dismiss"))&&this.classList.add("notification--dismissable");const s=document.createElement("template");s.innerHTML=`
|
|
5
5
|
<style>
|
|
@@ -59,19 +59,23 @@ const runEvent = (element, event, eventType) => {
|
|
|
59
59
|
return false;
|
|
60
60
|
switch (event[eventType]) {
|
|
61
61
|
case "hide":
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
if (document.querySelector(event['target'])) {
|
|
63
|
+
let hideElement = document.querySelector(event['target']);
|
|
64
|
+
hideElement.classList.add('js-hide');
|
|
65
|
+
Array.from(hideElement.querySelectorAll('[data-required]')).forEach((input, index) => {
|
|
66
|
+
input.removeAttribute('required');
|
|
67
|
+
});
|
|
68
|
+
}
|
|
67
69
|
break;
|
|
68
70
|
case "show":
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
input.
|
|
74
|
-
|
|
71
|
+
if (document.querySelector(event['target'])) {
|
|
72
|
+
let showElement = document.querySelector(event['target']);
|
|
73
|
+
showElement.classList.remove('js-hide');
|
|
74
|
+
Array.from(showElement.querySelectorAll('[data-required]')).forEach((input, index) => {
|
|
75
|
+
if (!input.closest('.js-hide'))
|
|
76
|
+
input.setAttribute('required', 'true');
|
|
77
|
+
});
|
|
78
|
+
}
|
|
75
79
|
break;
|
|
76
80
|
case "populate-form":
|
|
77
81
|
populateForm(element, event);
|
|
@@ -91,6 +95,9 @@ const runEvent = (element, event, eventType) => {
|
|
|
91
95
|
let changeEvent = new Event('change');
|
|
92
96
|
document.querySelector(`${event['target']}`).dispatchEvent(changeEvent);
|
|
93
97
|
break;
|
|
98
|
+
case "submitForm":
|
|
99
|
+
document.querySelector(`${event['target']}`).submit();
|
|
100
|
+
break;
|
|
94
101
|
default:
|
|
95
102
|
break;
|
|
96
103
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* iamKey v5.1.0-
|
|
2
|
+
* iamKey v5.1.0-beta2
|
|
3
3
|
* Copyright 2022-2023 iamproperty
|
|
4
4
|
*/(function(R){typeof define=="function"&&define.amd?define(R):R()})(function(){"use strict";var R=r=>(r.classList.add("js-enabled"),(navigator.userAgent.indexOf("MSIE")!==-1||navigator.appVersion.indexOf("Trident/")>0)&&r.classList.add("ie"),null),rt=r=>{var t=function(a){var i=document.querySelector('label[for="'.concat(a.replace("#",""),'"]')),c=document.querySelector(a+" summary"),n=document.querySelector("dialog".concat(a));i instanceof HTMLElement?i.click():c instanceof HTMLElement?c.click():n instanceof HTMLElement&&n.showModal()};return location.hash&&t(location.hash),window.addEventListener("hashchange",function(){t(location.hash)},!1),addEventListener("popstate",e=>{if(e&&e.state&&e.state.type&&e.state.type=="pagination"){var a=document.querySelector("#".concat(e.state.form)),i=document.querySelector("#".concat(e.state.form," [data-pagination]"));i?i.value=e.state.page:a.innerHTML+='<input name="page" type="hidden" data-pagination="true" value="'.concat(e.state.page,'" />'),a.dispatchEvent(new Event("submit"))}}),document.addEventListener("submit",e=>{if(e&&e.target instanceof HTMLElement&&e.target.matches("form")){var a=e.target;a.querySelector(":invalid")&&(a.classList.add("was-validated"),e.preventDefault())}}),null},it=function(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))},st=(r,t)=>String(r).padStart(t,"0"),ot=r=>r.charAt(0).toUpperCase()+r.slice(1);class nt{constructor(t){document.body.classList.contains("youtubeLoaded")?t.addEventListener("click",function(e){for(var a=e.target;a&&a!=this;a=a.parentNode)if(a.matches("a")){e.preventDefault(),Y(a);break}},!1):this.loadScripts(t,this.createEmbed)}loadScripts(t){return new Promise((e,a)=>{var i=new Image;i.onload=function(){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(c,n),document.body.classList.add("youtubeLoaded"),e(!0),c.onload=()=>{t.addEventListener("click",function(o){console.log("click"),o&&o.target instanceof HTMLElement&&o.target.closest("a")&&(o.preventDefault(),Y(o.target.closest("a")))},!1)}},i.onerror=function(){a(!1)},i.src="https://youtube.com/favicon.ico"})}}var Y=function(t){typeof window.player<"u"&&typeof window.player.pauseVideo=="function"&&window.player.pauseVideo();var e=t.getAttribute("data-id"),a=t.getAttribute("id");if(typeof a>"u"||a==null){var i=String.fromCharCode(65+Math.floor(Math.random()*26));a=i+Date.now(),t.setAttribute("id",a)}function c(){window.player=new YT.Player(a,{height:"100%",width:"100%",videoId:e,playerVars:{modestbranding:1,playsinline:1,rel:0,showinfo:0},events:{onReady:n,onStateChange:d}})}c();function n(s){s.target.playVideo()}var o=!1;function d(s){if(s.data==YT.PlayerState.PLAYING&&!o){var l=document.getElementById(a);l.classList.add("player-ready"),o=!0}}},ct=r=>(Array.from(r.querySelectorAll("dialog[open]")).forEach((t,e)=>{var a=t.closest(".dialog__wrapper");a||(t.removeAttribute("open"),t.showModal(),t.focus(),J(t))}),r.addEventListener("click",t=>{if(t.target.tagName=="IAM-ACTIONBAR")return!1;if(t&&t.target instanceof HTMLElement&&t.target.closest("[data-modal]")){var e=t.target.closest("[data-modal]"),a=e.hasAttribute("data-modal")?e.getAttribute("data-modal"):e.getAttribute("data-filter"),i=document.querySelector("dialog#".concat(a));J(i),i.showModal(),i.focus();var c=i.offsetWidth;i.setAttribute("style","max-width: ".concat(c,"px;")),Array.from(i.querySelectorAll("[data-duplicate]")).forEach((g,A)=>{var C=g.getAttribute("data-duplicate"),S=document.getElementById(C);if(g.checked!=S.checked){g.checked=S.checked;var E=new Event("change");g.dispatchEvent(E)}}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"openModal",id:a})}if(t&&t.target instanceof HTMLElement&&t.target.closest("button.dialog__close")){var n=t.target.closest("dialog[open]");t.preventDefault(),n.close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((g,A)=>{g.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:n.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest('button[formmethod="dialog"]')){var o=t.target.closest("dialog[open]");Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((g,A)=>{g.classList.remove("active")}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:o.getAttribute("id")})}if(t&&t.target instanceof HTMLElement&&t.target.closest("dialog[open]")){var d=t.target.closest("dialog[open]"),s=window.getComputedStyle(d);if(s.display==="contents"&&(d=d.parentNode.closest("dialog[open]")),!d.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")||d.classList.contains("dialog--multi")){var l=d.getBoundingClientRect();(t.clientX<l.left||t.clientX>l.right||t.clientY<l.top||t.clientY>l.bottom)&&(t.target.closest('input[type="radio"]')||d.close(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"closeModal",id:d.getAttribute("id")}))}}if(t&&t.target instanceof HTMLElement&&t.target.closest(".dialog__wrapper > button")){t.stopPropagation();var h=t.target.closest(".dialog__wrapper > button"),f=t.target.closest(".dialog__wrapper > button").parentNode,b="openPopover",u=f.querySelector(":scope > dialog");if(document.querySelector("*:not([data-keep-open]) > dialog[open]")&&document.querySelector("*:not([data-keep-open]) > dialog[open]")!=u&&document.querySelector("*:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper > button")).forEach((g,A)=>{g.removeAttribute("aria-expanded")}),u.hasAttribute("open"))u.close(),b="closePopover",u.removeAttribute("style"),h.removeAttribute("aria-expanded");else{u.show(),h.setAttribute("aria-expanded",!0);var m=h.getBoundingClientRect(),v=m.top,p=m.left;if(h.closest("iam-table")){var L=h.closest("iam-table").parentNode.getBoundingClientRect();v-=L.top,p-=L.left}u.classList.contains("dialog--fix")&&u.setAttribute("style","position:fixed;top: ".concat(v,"px; left: ").concat(p,"px; margin: 3rem 0 0 0;"))}var w=u.getBoundingClientRect(),y=w.bottom-window.scrollY,x=window.innerHeight-window.scrollY;if(y>x){var q=u.hasAttribute("style")?u.getAttribute("style")+" ":"";u.setAttribute("style",q+"transform: translate(0, calc(-100% - 4rem))"),w=u.getBoundingClientRect();var T=w.top-window.scrollY;T<100&&u.removeAttribute("style")}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:b,id:h.textContent})}t&&t.target instanceof HTMLElement&&!t.target.closest("dialog[open]")&&!t.target.closest(".dialog__wrapper > button")&&(document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]")&&document.querySelector(".dialog__wrapper:not([data-keep-open]) > dialog[open]").close(),Array.from(document.querySelectorAll(".dialog__wrapper:not([data-keep-open]) > button")).forEach((g,A)=>{g.removeAttribute("aria-expanded")}))}),null),J=r=>{r.querySelector(":scope > .mh-lg > form:last-child > button:last-child, :scope > .mh-lg > button:last-child")&&!r.classList.contains("dialog--multi")&&r.addEventListener("cancel",c=>{c.preventDefault()});var t=r.querySelector(".youtube-embed a");if(t&&Y(t),r.classList.contains("dialog--multi")&&!r.querySelector(":scope > .steps")&&dt(r),!r.querySelector(":scope > .mh-lg")&&!r.classList.contains("dialog--multi")){r.innerHTML='<div class="mh-lg">'.concat(r.innerHTML,"</div>");var e=r.querySelector(".mh-lg"),a=r.querySelector(".mh-lg :is(.h1,.h2,.h3,.h4,.h5,.h6)");if(a){var i=a.previousSibling;e.before(a),i&&a.before(i)}}r.querySelector(":scope > button:first-child")||r.insertAdjacentHTML("afterbegin",'<button class="dialog__close">Close</button>')},dt=r=>{var t="",e=Array.from(r.querySelectorAll("fieldset[data-title]")),a=r.querySelector("form");e.forEach((s,l)=>{t+='<button data-title="'.concat(s.getAttribute("data-title"),'" type="button" class="').concat(l==0?"active":"",'" tabindex="-1">').concat(s.getAttribute("data-title"),"</button>");var h=document.createElement("div");if(h.classList.add("btn--wrapper"),s.appendChild(h),l!=0&&(h.innerHTML+='<button data-title="'.concat(e[l-1].getAttribute("data-title"),'" class="btn btn-secondary mb-0" data-previous type="button">Previous</button>')),l!=e.length-1&&(h.innerHTML+='<button data-title="'.concat(e[l+1].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="button">Next</button>')),l==e.length-1)if(a&&a.querySelector(':scope > button[type="submit"]')){var f=a.querySelector(':scope > button[type="submit"]');f.classList.add("mb-0"),h.insertAdjacentElement("beforeend",f)}else h.innerHTML+='<button data-title="'.concat(e[l].getAttribute("data-title"),'" class="btn btn-primary mb-0" data-next type="submit">Submit</button>')}),r.insertAdjacentHTML("afterbegin",'<div class="steps bg-primary">'.concat(t,"</div>"));for(var i=Array.from(r.querySelectorAll("fieldset.was-validated")),c=0;c<i.length;c++){var n=i[c],o=n.getAttribute("data-title");if(n.querySelector(".is-invalid")){Array.from(r.querySelectorAll('[data-title="'.concat(o,'"]'))).forEach((s,l)=>{s.classList.add("active")});break}else Array.from(r.querySelectorAll('[data-title="'.concat(o,'"]'))).forEach((s,l)=>{s.classList.add("valid")})}r.addEventListener("invalid",function(){return function(s){s.preventDefault()}}(),!0);function d(s){var l=r.querySelector("fieldset.active")?r.querySelector("fieldset.active"):r.querySelector("fieldset[data-title]"),h=l.getAttribute("data-title"),f=!0;if(l.classList.add("was-validated"),Array.from(l.querySelectorAll("input")).forEach((p,L)=>{p.checkValidity()||(f=!1)}),f?Array.from(r.querySelectorAll('[data-title="'.concat(h,'"]'))).forEach((p,L)=>{p.classList.add("valid")}):Array.from(r.querySelectorAll('[data-title="'.concat(h,'"]'))).forEach((p,L)=>{p.classList.remove("valid")}),f||!s.hasAttribute("data-next")){var b=r.querySelector('fieldset[data-title="'.concat(s.getAttribute("data-title"),'"]')),u=r.querySelector('.steps button[data-title="'.concat(s.getAttribute("data-title"),'"]'));Array.from(r.querySelectorAll("button")).forEach((p,L)=>{p.classList.remove("active")}),Array.from(r.querySelectorAll("fieldset")).forEach((p,L)=>{p.classList.remove("active")}),u.classList.add("active"),b.classList.add("active")}var m=Array.from(r.querySelectorAll("fieldset")).length,v=Array.from(r.querySelectorAll("fieldset.valid")).length;r.style.setProperty("--progress","".concat(v/(m-1)*100,"%"))}r.addEventListener("keydown",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest("button")){var l=s.target.closest("button");s.keyCode==13&&l.getAttribute("type")!="submit"&&(s.preventDefault(),d(l))}if(s&&s.target instanceof HTMLElement&&s.target.closest("input")){var h=s.target.closest("input");h.classList.remove("is-invalid"),s.keyCode==13&&s.preventDefault()}}),r.addEventListener("click",s=>{if(s&&s.target instanceof HTMLElement&&s.target.closest('button[type="submit"]')){var l=s.target.closest("form");l.classList.add("was-validated")}else if(s&&s.target instanceof HTMLElement&&s.target.closest("button[data-title]")){var h=s.target.closest("button[data-title]");d(h)}return null})};function lt(){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Pageview",pageTitle:document.title}),document.addEventListener("click",r=>{var t=r.target.closest("[open] summary");if(t)window.dataLayer.push({event:"closeDetails",detailsTitle:t.textContent||""});else{var e=r.target.closest("summary"),a=r.target.closest("a"),i=r.target.closest("button");e&&window.dataLayer.push({event:"openDetails",detailsTitle:e.textContent||""}),a&&window.dataLayer.push({event:"linkClicked",linkText:a.hasAttribute("title")?a.getAttribute("title")||"":a.textContent||"",class:a.hasAttribute("class")&&a.getAttribute("class")||"",href:a.getAttribute("href")||""}),i&&window.dataLayer.push({event:"buttonClicked",buttonText:i.textContent||"",class:i.hasAttribute("class")&&i.getAttribute("class")||""})}})}var ut=r=>{function t(){if(Array.from(document.querySelectorAll("input[maxlength]")).forEach((a,i)=>{a.parentElement,ht(a)}),document.querySelector('input[type="date"]')){let a=function(i){var c=i.getFullYear(),n=String(i.getMonth()+1).padStart(2,"0"),o=String(i.getDate()).padStart(2,"0");return"".concat(c,"-").concat(n,"-").concat(o)};var e=new Date;Array.from(document.querySelectorAll('input[type="date"]')).forEach((i,c)=>{var n=e;if(i.hasAttribute("data-start")&&(n.setDate(n.getDate()+parseInt(i.getAttribute("data-start"))),i.setAttribute("min",a(n))),i.hasAttribute("data-period")){var o=parseInt(i.getAttribute("data-period")),d=new Date;d.setDate(n.getDate()+o),i.setAttribute("max",a(d))}if(i.hasAttribute("data-allowed-days")){var s=JSON.parse("[".concat(i.getAttribute("data-allowed-days"),"]"));i.addEventListener("input",function(l){var h=new Date(this.value).getUTCDay();s.includes(h)?i.setCustomValidity(""):i.setCustomValidity("That day of the week is not allowed")})}})}}document.readyState==="complete"&&t(),document.onreadystatechange=()=>{document.readyState==="complete"&&t()},r.addEventListener("input",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("input,textarea,select")){var a=e.target.closest("input,textarea,select");a.parentElement,a.hasAttribute("type")&&a.getAttribute("type")=="color"&&(a.nextElementSibling.value=a.value),a.hasAttribute("maxlength")&&a.nextElementSibling&&a.nextElementSibling.setAttribute("data-count",a.value.length)}}),r.addEventListener("change",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("select")){var a=e.target.closest("select");if(a.hasAttribute("data-change-type")&&a.hasAttribute("data-input")){var i=document.getElementById(a.getAttribute("data-input")),c=a.value;Q(i,c)}}if(e&&e.target instanceof HTMLElement&&e.target.closest('dialog [type="radio"]')){var n=e.target.closest("dialog");e.target.closest('dialog [type="radio"]'),Array.from(n.querySelectorAll('[type="radio"][autofocus]')).forEach((o,d)=>{o.removeAttribute("autofocus")}),Array.from(n.querySelectorAll('[type="radio"]:checked')).forEach((o,d)=>{o.setAttribute("autofocus",!0)})}}),r.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-change-type][data-input]:not(select)")){var a=e.target.closest("[data-change-type]"),i=document.getElementById(a.getAttribute("data-input")),c=a.getAttribute("data-change-type");if(a.setAttribute("data-change-type",i.getAttribute("type")),Q(i,c),a.hasAttribute("data-alt-class")){var n=a.getAttribute("data-alt-class");a.setAttribute("data-alt-class",a.getAttribute("class")),a.setAttribute("class",n)}}})},ht=r=>{var t=r.parentElement,e=r.getAttribute("maxlength");t.style.setProperty("--maxlength",e);var a=r.nextElementSibling;(!a||a&&a.classList.contains("invalid-feedback"))&&(a=document.createElement("span"),t.insertBefore(a,r.nextSibling)),a.setAttribute("data-count",r.value.length)},Q=(r,t)=>{r.setAttribute("type",t)},ft=r=>{if(Array.from(r.querySelectorAll("details")).forEach((e,a)=>{e.addEventListener("mouseenter",function(i){window.matchMedia("(min-width: 62em)").matches&&e.setAttribute("open","true")},!1),e.addEventListener("mouseleave",function(i){window.matchMedia("(min-width: 62em)").matches&&e.removeAttribute("open")},!1)}),"IntersectionObserver"in window){var t=new IntersectionObserver(e=>{var[a]=e;return a.target.classList.toggle("is-stuck",a.intersectionRatio<1)},{threshold:[1]});t.observe(r)}};function mt(r){var t,e=r.querySelector(".testimonial__images"),a=e.querySelectorAll("img").length;if(a==1)return!1;r.classList.add("testimonial--multi");var i=function(n){var o=r.querySelector(".btn-next"),d=r.querySelector(".btn-prev");o.setAttribute("data-go",n+1),d.setAttribute("data-go",n-1),o.removeAttribute("disabled"),d.removeAttribute("disabled"),n==1?d.setAttribute("disabled",!0):n==a&&o.setAttribute("disabled",!0)};e.addEventListener("scroll",function(c){clearTimeout(t),t=setTimeout(function(){var n=e.scrollWidth,o=e.scrollHeight,d=e.scrollLeft,s=e.scrollTop,l=Math.round(d/n*a)+1;d==0&&s!=0&&(l=Math.round(s/o*a)+1),r.setAttribute("data-show",l),i(l)},300)},!1),r.addEventListener("click",function(c){for(var n=c.target;n&&n!=this;n=n.parentNode)if(n.matches("[data-go]")){var o=parseInt(n.getAttribute("data-go")),d=0,s=0,l=e.scrollWidth,h=e.scrollHeight;l>h?s=Math.floor(l*((o-1)/a)):d=Math.floor(h*((o-1)/a)),e.scroll({top:d,left:s,behavior:"smooth"});break}},!1)}function bt(r){var t,e=r.querySelector(".carousel__inner"),a=r.querySelectorAll(".carousel__item").length;r.getAttribute("data-cols");var i=r.getAttribute("data-sm-cols"),c=r.getAttribute("data-md-cols");r.querySelector(".carousel__controls a").setAttribute("aria-current",!0),e.addEventListener("scroll",function(n){clearTimeout(t),t=setTimeout(function(){var o=e.clientWidth,d=e.scrollWidth,s=e.scrollLeft,l=Math.round(s/d*a)+1,h=r.querySelector(".carousel__item:last-child").offsetLeft;Array.from(r.querySelectorAll(".carousel__controls a")).forEach((f,b)=>{f.removeAttribute("aria-current")}),r.querySelector(".control-"+l).setAttribute("aria-current",!0),l==1?r.querySelector(".btn-prev").setAttribute("disabled","disabled"):r.querySelector(".btn-prev").removeAttribute("disabled"),e.scrollLeft+o>h?r.querySelector(".btn-next").setAttribute("disabled","disabled"):r.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),r.addEventListener("click",function(n){for(var o=n.target;o&&o!=this;o=o.parentNode)if(o.matches(".carousel__controls a")){n.preventDefault(),Array.from(r.querySelectorAll(".carousel__controls a")).forEach((s,l)=>{s.removeAttribute("aria-current")}),o.setAttribute("aria-current",!0);var d=document.querySelector(o.getAttribute("href"));e.scroll({top:0,left:d.offsetLeft,behavior:"smooth"});break}},!1),r.addEventListener("click",function(n){for(var o=n.target;o&&o!=this;o=o.parentNode)if(o.matches(".btn-next, .btn-prev")){n.preventDefault();var d=o.classList.contains("btn-prev")?e.scrollLeft-e.clientWidth:e.scrollLeft+e.clientWidth;e.scroll({top:0,left:d,behavior:"smooth"});break}},!1),a==1&&r.classList.add("hide-btns"),i>=a&&r.classList.add("hide-sm-btns"),c>=a&&r.classList.add("hide-md-btns")}function vt(r){r.addEventListener("change",function(t){var e=parseInt(r.querySelector("[data-min] select,[data-min] input").value),a=parseInt(r.querySelector("[data-max] select,[data-max] input").value);Array.from(r.querySelectorAll("[data-min] input")).forEach((i,c)=>{i.setAttribute("max",a)}),Array.from(r.querySelectorAll("[data-max] input")).forEach((i,c)=>{i.setAttribute("min",e)}),Array.from(r.querySelectorAll("[data-min] select option")).forEach((i,c)=>{parseInt(i.getAttribute("value"))>a?i.classList.add("d-none"):i.classList.remove("d-none")}),Array.from(r.querySelectorAll("[data-max] select option")).forEach((i,c)=>{parseInt(i.getAttribute("value"))<e?i.classList.add("d-none"):i.classList.remove("d-none")})},!1)}function pt(r){r.addEventListener("change",function(t){if(r.matches("[data-value-if]")){var e=r.getAttribute("data-redirect"),a=r.getAttribute("data-value-if");r.value==a&&(document.location.href=e)}else typeof r.value<"u"&&(document.location.href=r.value)},!1)}function yt(r){var t=r.querySelector(".row"),e=t.cloneNode(!0),a=r.querySelector("[data-add]");r.addEventListener("click",function(i){for(var c=i.target;c&&c!=this;c=c.parentNode){if(c.matches("[data-add]")){var n=e.cloneNode(!0);r.insertBefore(n,c),a.matches("[data-maxfiles]")&&Array.from(r.querySelectorAll(":scope > .row")).length>=a.dataset.maxfiles&&a.setAttribute("disabled","disabled");break}if(c.matches("[data-delete]")){var o=c.closest(".row");o.remove(),a.matches("[data-maxfiles]")&&Array.from(r.querySelectorAll(":scope > .row")).length<a.dataset.maxfiles&&a.removeAttribute("disabled");break}}},!1)}function gt(r){Array.from(r.querySelectorAll("[data-input-range]")).forEach((t,e)=>{vt(t)}),Array.from(r.querySelectorAll("[data-redirect]")).forEach((t,e)=>{pt(t)}),Array.from(r.querySelectorAll(".multiple-file-uploads")).forEach((t,e)=>{yt(t)}),r.addEventListener("change",function(t){for(var e=t.target;e&&e!=this;e=e.parentNode)if(e.matches('[type="file"][data-filesize]')&&e.files&&e.files[0]){var a=e.dataset.filesize;e.files[0].size>a&&(e.value="",alert("File too large"));break}},!1),r.addEventListener("change",function(t){Array.from(r.querySelectorAll("select[data-activeif][data-equals],input[data-activeif][data-equals]")).forEach((e,a)=>{var i=e.closest("[data-group]")?e.closest("[data-group]"):r,c=e.dataset.activeif,n=e.dataset.equals,o=i.querySelector('select[data-id="'.concat(c,'"],input[data-id="').concat(c,'"]'));o.value==n?e.removeAttribute("disabled"):(e.setAttribute("disabled","disabled"),e.value="")}),Array.from(r.querySelectorAll(".form-control__wrapper[data-displayif][data-equals]")).forEach((e,a)=>{var i=e.closest("[data-group]")?e.closest("[data-group]"):r,c=e.dataset.activeif,n=e.dataset.equals,o=i.querySelector('select[data-id="'.concat(c,'"],input[data-id="').concat(c,'"]'));o.value==n?e.classList.remove("d-none"):e.classList.add("d-none")})},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class At extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});var t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",e=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):"".concat(t,"/css/core.min.css"),a='@import "'.concat(t,'/css/components/header.css";'),i=document.createElement("template");i.innerHTML=`
|
|
5
5
|
<style>
|