@iamproperty/components 5.6.1-beta17 → 5.6.1-beta19

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.
Files changed (42) hide show
  1. package/assets/css/components/carousel.css +1 -1
  2. package/assets/css/components/carousel.css.map +1 -1
  3. package/assets/js/components/accordion/accordion.component.min.js +1 -1
  4. package/assets/js/components/actionbar/actionbar.component.min.js +3 -3
  5. package/assets/js/components/actionbar/actionbar.component.min.js.map +1 -1
  6. package/assets/js/components/address-lookup/address-lookup.component.min.js +1 -1
  7. package/assets/js/components/applied-filters/applied-filters.component.min.js +1 -1
  8. package/assets/js/components/card/card.component.min.js +1 -1
  9. package/assets/js/components/carousel/carousel.component.js +14 -1
  10. package/assets/js/components/carousel/carousel.component.min.js +5 -5
  11. package/assets/js/components/carousel/carousel.component.min.js.map +1 -1
  12. package/assets/js/components/collapsible-side/collapsible-side.component.min.js +1 -1
  13. package/assets/js/components/fileupload/fileupload.component.min.js +2 -2
  14. package/assets/js/components/fileupload/fileupload.component.min.js.map +1 -1
  15. package/assets/js/components/filterlist/filterlist.component.min.js +1 -1
  16. package/assets/js/components/header/header.component.min.js +1 -1
  17. package/assets/js/components/inline-edit/inline-edit.component.min.js +1 -1
  18. package/assets/js/components/marketing/marketing.component.min.js +1 -1
  19. package/assets/js/components/multiselect/multiselect.component.min.js +1 -1
  20. package/assets/js/components/nav/nav.component.min.js +1 -1
  21. package/assets/js/components/notification/notification.component.min.js +1 -1
  22. package/assets/js/components/pagination/pagination.component.min.js +1 -1
  23. package/assets/js/components/search/search.component.min.js +1 -1
  24. package/assets/js/components/slider/slider.component.min.js +1 -1
  25. package/assets/js/components/table/table.component.min.js +1 -1
  26. package/assets/js/components/tabs/tabs.component.min.js +1 -1
  27. package/assets/js/dynamic.min.js +5 -5
  28. package/assets/js/dynamic.min.js.map +1 -1
  29. package/assets/js/modules/dialogs.js +6 -0
  30. package/assets/js/modules/fileupload.js +1 -1
  31. package/assets/js/scripts.bundle.js +10 -10
  32. package/assets/js/scripts.bundle.js.map +1 -1
  33. package/assets/js/scripts.bundle.min.js +2 -2
  34. package/assets/js/scripts.bundle.min.js.map +1 -1
  35. package/assets/sass/components/carousel.scss +32 -7
  36. package/assets/ts/components/carousel/carousel.component.ts +17 -1
  37. package/assets/ts/modules/dialogs.ts +8 -0
  38. package/assets/ts/modules/fileupload.ts +1 -1
  39. package/dist/components.es.js +179 -173
  40. package/dist/components.umd.js +34 -34
  41. package/package.json +1 -1
  42. package/src/components/Carousel/Carousel.vue +5 -1
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
- */function f(r,l){var e;let s=r.querySelector(".carousel__inner"),i=r.querySelector(".carousel__controls"),n=l.querySelectorAll(":scope > .col").length;s.addEventListener("scroll",function(o){clearTimeout(e),e=setTimeout(function(){let t=s.clientWidth,c=s.scrollWidth,d=s.scrollLeft,a=Math.round(d/c*n)+1,u=l.querySelector(":scope > .col:last-child").offsetLeft-50,b=l.querySelector(":scope > .col").scrollWidth,h=Math.round(t/b);s.scrollLeft+t>=u&&(a=Math.floor(n/h)*h+1),Array.from(r.querySelectorAll(".carousel__controls button")).forEach((m,p)=>{m.removeAttribute("aria-current")}),r.querySelector(".control-"+a).setAttribute("aria-current",!0),a==1?r.querySelector(".btn-prev").setAttribute("disabled","disabled"):r.querySelector(".btn-prev").removeAttribute("disabled"),a==n?r.querySelector(".btn-next").setAttribute("disabled","disabled"):r.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),i.addEventListener("click",function(o){for(var t=o.target;t&&t!=this;t=t.parentNode)if(typeof t.matches=="function"&&t.matches("button")){o.preventDefault(),Array.from(i.querySelectorAll("button")).forEach((d,a)=>{d.removeAttribute("aria-current")}),t.setAttribute("aria-current",!0);const c=l.querySelector(`:scope > *:nth-child(${t.getAttribute("data-slide")})`);s.scroll({top:0,left:c.offsetLeft-100,behavior:"smooth"});break}},!1),r.addEventListener("click",function(o){for(var t=o.target;t&&t!=this;t=t.parentNode)if(typeof t.matches=="function"&&t.matches(".btn-next, .btn-prev")){o.preventDefault();let c=t.classList.contains("btn-prev")?s.scrollLeft-s.clientWidth:s.scrollLeft+s.clientWidth;s.scroll({top:0,left:c,behavior:"smooth"});break}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"carousel"});class _ extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const l=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"):`${l}/css/core.min.css`,s=document.createElement("template");s.innerHTML=`
4
+ */function f(l,o){var n;let s=l.querySelector(".carousel__inner"),c=l.querySelector(".carousel__controls"),i=o.querySelectorAll(":scope > .col").length;s.addEventListener("scroll",function(r){clearTimeout(n),n=setTimeout(function(){let t=s.clientWidth,a=s.scrollWidth,e=s.scrollLeft,d=Math.round(e/a*i)+1,u=o.querySelector(":scope > .col:last-child").offsetLeft-50,b=o.querySelector(":scope > .col").scrollWidth,h=Math.round(t/b);s.scrollLeft+t>=u&&(d=Math.floor(i/h)*h+1),Array.from(l.querySelectorAll(".carousel__controls button")).forEach((m,p)=>{m.removeAttribute("aria-current")}),l.querySelector(".control-"+d).setAttribute("aria-current",!0),d==1?l.querySelector(".btn-prev").setAttribute("disabled","disabled"):l.querySelector(".btn-prev").removeAttribute("disabled"),d==i?l.querySelector(".btn-next").setAttribute("disabled","disabled"):l.querySelector(".btn-next").removeAttribute("disabled")},100)},!1),c.addEventListener("click",function(r){for(var t=r.target;t&&t!=this;t=t.parentNode)if(typeof t.matches=="function"&&t.matches("button")){r.preventDefault(),Array.from(c.querySelectorAll("button")).forEach((e,d)=>{e.removeAttribute("aria-current")}),t.setAttribute("aria-current",!0);const a=o.querySelector(`:scope > *:nth-child(${t.getAttribute("data-slide")})`);s.scroll({top:0,left:a.offsetLeft-100,behavior:"smooth"});break}},!1),l.addEventListener("click",function(r){for(var t=r.target;t&&t!=this;t=t.parentNode)if(typeof t.matches=="function"&&t.matches(".btn-next, .btn-prev")){r.preventDefault();let a=t.classList.contains("btn-prev")?s.scrollLeft-s.clientWidth:s.scrollLeft+s.clientWidth;s.scroll({top:0,left:a,behavior:"smooth"});break}},!1)}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"carousel"});class _ extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const o=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",n=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${o}/css/core.min.css`,s=document.createElement("template");s.innerHTML=`
5
5
  <style>
6
- @import "${e}";
7
- .carousel .carousel__wrapper{position:relative}.carousel .carousel__inner{--gutter-x: 1rem;overflow:auto;scroll-snap-type:x mandatory}.carousel .col>*:last-child{margin-bottom:0;padding-bottom:0}.carousel__inner{scrollbar-width:none;-ms-overflow-style:none}.carousel__inner::-webkit-scrollbar{display:none}.btn-next,.btn-prev{--marker-bg: var(--colour-secondary);text-indent:100%;white-space:nowrap;overflow:hidden;background:var(--marker-bg);border-radius:100%;width:2.25rem;max-width:2.25rem;height:2.25rem;text-indent:-300rem;overflow:hidden;border:none;position:relative;margin:0 0.5rem;padding:0;position:absolute;top:50%;left:0rem;transform:translate(0, -50%)}.btn-next:disabled,.btn-prev:disabled{opacity:.8;pointer-events:none}.btn-next:after,.btn-prev:after{content:"";position:absolute;right:0;top:0;height:100%;width:100%;background:currentColor;mask-image:var(--icon-arrow);mask-size:50%;mask-repeat:no-repeat;mask-position:50% 60%;-webkit-mask-image:var(--icon-arrow);-webkit-mask-size:50%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:55% 50%;transform:rotate(0deg)}.btn-next:hover,.btn-next:focus,.btn-prev:hover,.btn-prev:focus{background:var(--colour-warning);color:var(--colour-hover);border-radius:100%}.btn-next:active,.btn-prev:active{border-radius:100%}.btn-next{left:auto;right:0}@media screen and (min-width: 62em){.btn-next{margin-right:-3rem}}@media screen and (min-width: 62em){.btn-prev{margin-left:-3rem}}.btn-prev:after{transform:rotate(180deg)}.carousel .carousel__controls{text-align:center;width:10rem;max-height:1rem;overflow:hidden;margin-inline:auto}@media screen and (min-width: 36em){.carousel .carousel__controls{width:100%}}.carousel .carousel__controls button{width:1rem;height:1rem;min-height:1rem;border-radius:50%;text-indent:-50rem;overflow:hidden;background:var(--colour-primary-theme);padding:0;margin:0 .5rem .5rem .5rem;border:none}.carousel .carousel__controls button:before{display:none}.carousel .carousel__controls button:first-child:last-child{display:none}.carousel__controls>button[aria-current]{background:var(--colour-success)}.carousel.hide-btns .carousel__wrapper>.btn{display:none}.carousel.hide-controls .carousel__controls{display:none}@media screen and (min-width: 36em){[data-row-class*=cols-sm-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-sm-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-sm-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-sm-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-sm-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none}[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}@media screen and (min-width: 62em){.carousel__controls>button{display:inline-block !important}[data-row-class*=cols-md-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-md-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-md-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-md-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-md-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none !important}[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}/*# sourceMappingURL=assets/css/components/carousel.css.map */
6
+ @import "${n}";
7
+ .carousel .carousel__wrapper{position:relative}.carousel .carousel__inner{--gutter-x: 1rem;overflow:auto;scroll-snap-type:x mandatory}.carousel .col>*:last-child{margin-bottom:0;padding-bottom:0}.carousel__inner{scrollbar-width:none;-ms-overflow-style:none}.carousel__inner::-webkit-scrollbar{display:none}.btn-next,.btn-prev{--marker-bg: var(--colour-secondary);text-indent:100%;white-space:nowrap;overflow:hidden;background:var(--marker-bg);border-radius:100%;width:2.25rem;max-width:2.25rem;height:2.25rem;text-indent:-300rem;overflow:hidden;border:none;position:relative;margin:0 0.5rem;padding:0;position:absolute;top:50%;left:0rem;transform:translate(0, -50%)}.btn-next:disabled,.btn-prev:disabled{opacity:.8;pointer-events:none}.btn-next:after,.btn-prev:after{content:"";position:absolute;right:0;top:0;height:100%;width:100%;background:currentColor;mask-image:var(--icon-arrow);mask-size:50%;mask-repeat:no-repeat;mask-position:50% 60%;-webkit-mask-image:var(--icon-arrow);-webkit-mask-size:50%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:55% 50%;transform:rotate(0deg)}.btn-next:hover,.btn-next:focus,.btn-prev:hover,.btn-prev:focus{background:var(--colour-warning);color:var(--colour-hover);border-radius:100%}.btn-next:active,.btn-prev:active{border-radius:100%}.btn-next{left:auto;right:0}@media screen and (min-width: 62em){.btn-next{margin-right:-3rem}}@media screen and (min-width: 62em){.btn-prev{margin-left:-3rem}}.btn-prev:after{transform:rotate(180deg)}.carousel .carousel__controls{overflow:hidden;margin-inline:auto}.carousel .carousel__controls:not(.thumbnails){max-height:1rem;width:10rem;text-align:center}.carousel .carousel__controls.thumbnails{margin-block-start:2rem}@media screen and (min-width: 36em){.carousel .carousel__controls{width:100%}}.carousel .carousel__controls button{padding:0;margin:0 .2rem .2rem;border:3px solid var(--colour-canvas);border-radius:4px}.carousel .carousel__controls button.has-thumbnail{height:4.625rem}.carousel .carousel__controls button.has-thumbnail img{height:100%;width:auto}.carousel .carousel__controls button:not(.has-thumbnail){width:1rem;height:1rem;min-height:1rem;border-radius:50%;text-indent:-50rem;overflow:hidden;background:var(--colour-primary-theme);margin:0 .5rem .5rem .5rem;border:none}.carousel .carousel__controls button:not(.has-thumbnail):before{display:none}.carousel .carousel__controls button:first-child:last-child{display:none}.carousel__controls>button[aria-current]{--colour-active-thumbnail: var(--colour-info);border-color:var(--colour-active-thumbnail)}.carousel__controls>button[aria-current]:not(.has-thumbnail){background:var(--colour-success)}.carousel.hide-btns .carousel__wrapper>.btn{display:none}.carousel.hide-controls .carousel__controls{display:none}@media screen and (min-width: 36em){[data-row-class*=cols-sm-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-sm-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-sm-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-sm-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-sm-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none}[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-sm-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-sm-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-sm-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-sm-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-sm-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}@media screen and (min-width: 62em){.carousel__controls>button{display:inline-block !important}[data-row-class*=cols-md-2] .carousel__controls>button:not(:nth-child(odd)),[data-row-class*=cols-md-3] .carousel__controls>button:not(:nth-child(3n+1)),[data-row-class*=cols-md-4] .carousel__controls>button:not(:nth-child(4n+1)),[data-row-class*=cols-md-5] .carousel__controls>button:not(:nth-child(5n+1)),[data-row-class*=cols-md-6] .carousel__controls>button:not(:nth-child(6n+1)){display:none !important}[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2)),[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3))),[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4))),[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5))),[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6))),[data-row-class*=cols-md-2] .carousel__controls:has(button:first-child:nth-last-child(2))~.btn,[data-row-class*=cols-md-3] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3)))~.btn,[data-row-class*=cols-md-4] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4)))~.btn,[data-row-class*=cols-md-5] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5)))~.btn,[data-row-class*=cols-md-6] .carousel__controls:has(:is(button:first-child:nth-last-child(2),button:first-child:nth-last-child(3),button:first-child:nth-last-child(4),button:first-child:nth-last-child(5),button:first-child:nth-last-child(6)))~.btn{display:none}}/*# sourceMappingURL=assets/css/components/carousel.css.map */
8
8
 
9
9
  ${this.hasAttribute("css")?`@import "${this.getAttribute("css")}";`:""}
10
10
  </style>
@@ -24,5 +24,5 @@
24
24
 
25
25
  </div>
26
26
  </div>
27
- `,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){const l=this.shadowRoot.querySelector(".carousel"),e=this.querySelector(".row"),s=this.shadowRoot.querySelector(".carousel__controls");let i=this.querySelectorAll(":scope > .row > .col").length;l.setAttribute("data-row-class",e.className),this.classList.contains("hide-btns")&&l.classList.add("hide-btns"),this.classList.contains("hide-controls")&&l.classList.add("hide-controls");let n="";for(let o=1;o<=i;o++)n+=`<button class="control-${o}" data-slide="${o}" ${o==1?"aria-current":""}>Slide ${o}</button>`;s.innerHTML=n,f(l,e)}}export{_ as default};
27
+ `,this.shadowRoot.appendChild(s.content.cloneNode(!0))}connectedCallback(){const o=this.shadowRoot.querySelector(".carousel"),n=this.querySelector(".row"),s=JSON.parse(this.dataset.thumbnails),c=this.shadowRoot.querySelector(".carousel__controls");let i=this.querySelectorAll(":scope > .row > .col").length;o.setAttribute("data-row-class",n.className),this.classList.contains("hide-btns")&&o.classList.add("hide-btns"),this.classList.contains("hide-controls")&&o.classList.add("hide-controls"),s?.length&&c.classList.add("thumbnails");let r="";for(let t=1;t<=i;t++){let a=null,e="";s.length?(e="has-thumbnail",a=`<img src="${s[t-1].src}" alt="Slide ${t}" height="148"/>`):a=`Slide ${t}`,r+=`<button class="control-${t} ${e}" data-slide="${t}" ${t==1?"aria-current":""}>${a}</button>`}c.innerHTML=r,f(o,n)}}export{_ as default};
28
28
  //# sourceMappingURL=carousel.component.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.component.min.js","sources":["../../modules/carousel.js","carousel.component.js"],"sourcesContent":["// @ts-nocheck\nfunction carousel(carouselElement, row) {\n var scrollTimeout;\n let carouselInner = carouselElement.querySelector('.carousel__inner');\n let carouselControls = carouselElement.querySelector('.carousel__controls');\n let itemCount = row.querySelectorAll(':scope > .col').length;\n // On scroll we need to make sure the buttons get corrected and the next testimonial is shown\n carouselInner.addEventListener('scroll', function (e) {\n clearTimeout(scrollTimeout);\n scrollTimeout = setTimeout(function () {\n let scrollArea = carouselInner.clientWidth;\n let scrollWidth = carouselInner.scrollWidth;\n let scrollLeft = carouselInner.scrollLeft;\n let targetSlide = Math.round((scrollLeft / scrollWidth) * itemCount) + 1;\n let lastItemOffset = row.querySelector(':scope > .col:last-child').offsetLeft - 50;\n let itemWidth = row.querySelector(':scope > .col').scrollWidth;\n let visibleItems = Math.round(scrollArea / itemWidth);\n if (carouselInner.scrollLeft + scrollArea >= lastItemOffset) {\n targetSlide = (Math.floor(itemCount / visibleItems) * visibleItems) + 1;\n }\n Array.from(carouselElement.querySelectorAll('.carousel__controls button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n carouselElement.querySelector('.control-' + targetSlide).setAttribute('aria-current', true);\n // Disable the previous button\n if (targetSlide == 1)\n carouselElement.querySelector('.btn-prev').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-prev').removeAttribute('disabled');\n // Disable the next button if the last item is in view\n if (targetSlide == itemCount)\n carouselElement.querySelector('.btn-next').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-next').removeAttribute('disabled');\n }, 100);\n }, false);\n // when the buttons are used we need to make sure the carousel scrolls to the correct place\n carouselControls.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('button')) {\n e.preventDefault();\n Array.from(carouselControls.querySelectorAll('button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n target.setAttribute('aria-current', true);\n const el = row.querySelector(`:scope > *:nth-child(${target.getAttribute('data-slide')})`);\n carouselInner.scroll({\n top: 0,\n left: el.offsetLeft - 100,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n carouselElement.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('.btn-next, .btn-prev')) {\n e.preventDefault();\n let scrollTo = target.classList.contains('btn-prev') ? carouselInner.scrollLeft - carouselInner.clientWidth : carouselInner.scrollLeft + carouselInner.clientWidth;\n carouselInner.scroll({\n top: 0,\n left: scrollTo,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n}\nexport default carousel;\n","// @ts-nocheck\nimport carousel from \"../../modules/carousel.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"carousel\"\n});\nclass iamCarousel extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/carousel.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"carousel\" :id=\"'carousel'+id\">\n <div class=\"carousel__wrapper\">\n <div class=\"carousel__inner\">\n \n <slot></slot>\n </div>\n \n <div class=\"carousel__controls\" part=\"controls\">\n \n </div>\n\n <button class=\"btn btn-prev\" data-go=\"0\" disabled part=\"prev\">Prev</button>\n <button class=\"btn btn-next\" data-go=\"2\" part=\"next\">Next</button>\n\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n const carouselElement = this.shadowRoot.querySelector('.carousel');\n const row = this.querySelector('.row');\n const carouselControls = this.shadowRoot.querySelector('.carousel__controls');\n let itemCount = this.querySelectorAll(':scope > .row > .col').length;\n carouselElement.setAttribute('data-row-class', row.className);\n if (this.classList.contains('hide-btns'))\n carouselElement.classList.add('hide-btns');\n if (this.classList.contains('hide-controls'))\n carouselElement.classList.add('hide-controls');\n // populate the pips\n let pips = \"\";\n for (let i = 1; i <= itemCount; i++) {\n pips += `<button class=\"control-${i}\" data-slide=\"${i}\" ${i == 1 ? \"aria-current\" : \"\"}>Slide ${i}</button>`;\n }\n carouselControls.innerHTML = pips;\n carousel(carouselElement, row);\n }\n}\nexport default iamCarousel;\n"],"names":["carousel","carouselElement","row","scrollTimeout","carouselInner","carouselControls","itemCount","e","scrollArea","scrollWidth","scrollLeft","targetSlide","lastItemOffset","itemWidth","visibleItems","button","index","target","el","scrollTo","iamCarousel","assetLocation","coreCSS","template","pips","i"],"mappings":";;;IACA,SAASA,EAASC,EAAiBC,EAAK,CACpC,IAAIC,EACJ,IAAIC,EAAgBH,EAAgB,cAAc,kBAAkB,EAChEI,EAAmBJ,EAA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AQ,UAAU,EAAI,CAAC,CAC/D,CACD,mBAAoB,CAChB,MAAMtB,EAAkB,KAAK,WAAW,cAAc,WAAW,EAC3DC,EAAM,KAAK,cAAc,MAAM,EAC/BG,EAAmB,KAAK,WAAW,cAAc,qBAAqB,EAC5E,IAAIC,EAAY,KAAK,iBAAiB,sBAAsB,EAAE,OAC9DL,EAAgB,aAAa,iBAAkBC,EAAI,SAAS,EACxD,KAAK,UAAU,SAAS,WAAW,GACnCD,EAAgB,UAAU,IAAI,WAAW,EACzC,KAAK,UAAU,SAAS,eAAe,GACvCA,EAAgB,UAAU,IAAI,eAAe,EAEjD,IAAIuB,EAAO,GACX,QAASC,EAAI,EAAGA,GAAKnB,EAAWmB,IAC5BD,GAAQ,0BAA0BC,kBAAkBA,MAAMA,GAAK,EAAI,eAAiB,YAAYA,aAEpGpB,EAAiB,UAAYmB,EAC7BxB,EAASC,EAAiBC,CAAG,CAChC,CACL"}
1
+ {"version":3,"file":"carousel.component.min.js","sources":["../../modules/carousel.js","carousel.component.js"],"sourcesContent":["// @ts-nocheck\nfunction carousel(carouselElement, row) {\n var scrollTimeout;\n let carouselInner = carouselElement.querySelector('.carousel__inner');\n let carouselControls = carouselElement.querySelector('.carousel__controls');\n let itemCount = row.querySelectorAll(':scope > .col').length;\n // On scroll we need to make sure the buttons get corrected and the next testimonial is shown\n carouselInner.addEventListener('scroll', function (e) {\n clearTimeout(scrollTimeout);\n scrollTimeout = setTimeout(function () {\n let scrollArea = carouselInner.clientWidth;\n let scrollWidth = carouselInner.scrollWidth;\n let scrollLeft = carouselInner.scrollLeft;\n let targetSlide = Math.round((scrollLeft / scrollWidth) * itemCount) + 1;\n let lastItemOffset = row.querySelector(':scope > .col:last-child').offsetLeft - 50;\n let itemWidth = row.querySelector(':scope > .col').scrollWidth;\n let visibleItems = Math.round(scrollArea / itemWidth);\n if (carouselInner.scrollLeft + scrollArea >= lastItemOffset) {\n targetSlide = (Math.floor(itemCount / visibleItems) * visibleItems) + 1;\n }\n Array.from(carouselElement.querySelectorAll('.carousel__controls button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n carouselElement.querySelector('.control-' + targetSlide).setAttribute('aria-current', true);\n // Disable the previous button\n if (targetSlide == 1)\n carouselElement.querySelector('.btn-prev').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-prev').removeAttribute('disabled');\n // Disable the next button if the last item is in view\n if (targetSlide == itemCount)\n carouselElement.querySelector('.btn-next').setAttribute('disabled', 'disabled');\n else\n carouselElement.querySelector('.btn-next').removeAttribute('disabled');\n }, 100);\n }, false);\n // when the buttons are used we need to make sure the carousel scrolls to the correct place\n carouselControls.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('button')) {\n e.preventDefault();\n Array.from(carouselControls.querySelectorAll('button')).forEach((button, index) => {\n button.removeAttribute('aria-current');\n });\n target.setAttribute('aria-current', true);\n const el = row.querySelector(`:scope > *:nth-child(${target.getAttribute('data-slide')})`);\n carouselInner.scroll({\n top: 0,\n left: el.offsetLeft - 100,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n carouselElement.addEventListener('click', function (e) {\n for (var target = e.target; target && target != this; target = target.parentNode) {\n if (typeof target.matches == \"function\" && target.matches('.btn-next, .btn-prev')) {\n e.preventDefault();\n let scrollTo = target.classList.contains('btn-prev') ? carouselInner.scrollLeft - carouselInner.clientWidth : carouselInner.scrollLeft + carouselInner.clientWidth;\n carouselInner.scroll({\n top: 0,\n left: scrollTo,\n behavior: 'smooth'\n });\n break;\n }\n }\n }, false);\n}\nexport default carousel;\n","// @ts-nocheck\nimport carousel from \"../../modules/carousel.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"carousel\"\n});\nclass iamCarousel extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/carousel.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"carousel\" :id=\"'carousel'+id\">\n <div class=\"carousel__wrapper\">\n <div class=\"carousel__inner\">\n \n <slot></slot>\n </div>\n \n <div class=\"carousel__controls\" part=\"controls\">\n \n </div>\n\n <button class=\"btn btn-prev\" data-go=\"0\" disabled part=\"prev\">Prev</button>\n <button class=\"btn btn-next\" data-go=\"2\" part=\"next\">Next</button>\n\n </div>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n const carouselElement = this.shadowRoot.querySelector('.carousel');\n const row = this.querySelector('.row');\n const thumbnailImages = JSON.parse(this.dataset.thumbnails);\n const carouselControls = this.shadowRoot.querySelector('.carousel__controls');\n let itemCount = this.querySelectorAll(':scope > .row > .col').length;\n carouselElement.setAttribute('data-row-class', row.className);\n if (this.classList.contains('hide-btns'))\n carouselElement.classList.add('hide-btns');\n if (this.classList.contains('hide-controls'))\n carouselElement.classList.add('hide-controls');\n if (thumbnailImages === null || thumbnailImages === void 0 ? void 0 : thumbnailImages.length) {\n carouselControls.classList.add('thumbnails');\n }\n // populate the pips\n let pips = \"\";\n for (let i = 1; i <= itemCount; i++) {\n let pipContent = null;\n let pipClass = '';\n if (thumbnailImages.length) {\n pipClass = 'has-thumbnail';\n pipContent = `<img src=\"${thumbnailImages[i - 1].src}\" alt=\"Slide ${i}\" height=\"148\"/>`;\n }\n else {\n pipContent = `Slide ${i}`;\n }\n pips += `<button class=\"control-${i} ${pipClass}\" data-slide=\"${i}\" ${i == 1 ? \"aria-current\" : \"\"}>${pipContent}</button>`;\n }\n carouselControls.innerHTML = pips;\n carousel(carouselElement, row);\n }\n}\nexport default iamCarousel;\n"],"names":["carousel","carouselElement","row","scrollTimeout","carouselInner","carouselControls","itemCount","e","scrollArea","scrollWidth","scrollLeft","targetSlide","lastItemOffset","itemWidth","visibleItems","button","index","target","el","scrollTo","iamCarousel","assetLocation","coreCSS","template","thumbnailImages","pips","i","pipContent","pipClass"],"mappings":";;;IACA,SAASA,EAASC,EAAiBC,EAAK,CACpC,IAAIC,EACJ,IAAIC,EAAgBH,EAAgB,cAAc,kBAAkB,EAChEI,EAAmBJ,EAAgB,cAAc,qBAAqB,EACtEK,EAAYJ,EAAI,iBAAiB,eAAe,EAAE,OAEtDE,EAAc,iBAAiB,SAAU,SAAUG,EAAG,CAClD,aAAaJ,CAAa,EAC1BA,EAAgB,WAAW,UAAY,CACnC,IAAIK,EAAaJ,EAAc,YAC3BK,EAAcL,EAAc,YAC5BM,EAAaN,EAAc,WAC3BO,EAAc,KAAK,MAAOD,EAAaD,EAAeH,CAAS,EAAI,EACnEM,EAAiBV,EAAI,cAAc,0BAA0B,EAAE,WAAa,GAC5EW,EAAYX,EAAI,cAAc,eAAe,EAAE,YAC/CY,EAAe,KAAK,MAAMN,EAAaK,CAAS,EAChDT,EAAc,WAAaI,GAAcI,IACzCD,EAAe,KAAK,MAAML,EAAYQ,CAAY,EAAIA,EAAgB,GAE1E,MAAM,KAAKb,EAAgB,iBAAiB,4BAA4B,CAAC,EAAE,QAAQ,CAACc,EAAQC,IAAU,CAClGD,EAAO,gBAAgB,cAAc,CACrD,CAAa,EACDd,EAAgB,cAAc,YAAcU,CAAW,EAAE,aAAa,eAAgB,EAAI,EAEtFA,GAAe,EACfV,EAAgB,cAAc,WAAW,EAAE,aAAa,WAAY,UAAU,EAE9EA,EAAgB,cAAc,WAAW,EAAE,gBAAgB,UAAU,EAErEU,GAAeL,EACfL,EAAgB,cAAc,WAAW,EAAE,aAAa,WAAY,UAAU,EAE9EA,EAAgB,cAAc,WAA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ey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"collapsible side menu"});class a 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,7 +1,7 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
- */function v(d,i){const o=i.querySelector(".files"),n=i.querySelector(".drop-area"),e=d.querySelector("input"),f=d.hasAttribute("data-maxsize")?d.getAttribute("data-maxsize"):0,u=i.querySelector(".invalid-feedback.size"),h=i.querySelector(".invalid-feedback.ext"),s=e.cloneNode();n.append(s);let b=function(t){if(!e.hasAttribute("accept"))return!0;const r=t.split(".").pop();return!!e.getAttribute("accept").includes(r)};if(i.addEventListener("click",t=>{t&&t.target instanceof HTMLElement&&t.target.closest(".btn-primary")&&(t.target.closest(".btn-primary"),h.classList.remove("d-block"),u.classList.remove("d-block"),(e.hasAttribute("multiple")?s:e).click())}),i.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest(".files button")){const r=new DataTransfer,{files:a}=e,m=t.target.closest(".files button");for(let p=0;p<a.length;p++){const l=a[p];l.name!=m.getAttribute("data-file")&&r.items.add(l)}e.files=r.files;const c=new Event("change");e.dispatchEvent(c)}}),s.addEventListener("change",t=>{if(e.hasAttribute("multiple")){const a=[...e.files,...s.files];let m=[];const c=new DataTransfer;for(let p=0;p<a.length;p++){const l=a[p],g=l.size/1e3;!m.includes(l.name)&&(f==0||g<f)&&b(l.name)&&c.items.add(l),b(l.name)||h.classList.add("d-block"),g>f&&u.classList.add("d-block"),m.push(l.name)}e.files=c.files}else e.files=s.files;const r=new Event("change");e.dispatchEvent(r)}),s.addEventListener("dragenter",t=>{s.classList.add("focus")}),s.addEventListener("dragleave",t=>{s.classList.remove("focus")}),s.addEventListener("drop",t=>{s.classList.remove("focus")}),e.addEventListener("change",t=>{if(e.files.length==1){let a=e.files[0];const m=a.size/1e3;if(!b(a.name)){h.classList.add("d-block");const c=new DataTransfer;e.files=c.files}if(m>f){u.classList.add("d-block");const c=new DataTransfer;e.files=c.files}}o.innerHTML="";for(const a of e.files)o.innerHTML+=`<span class="file" part="file">${a.name} <button data-file="${a.name}">Remove</button></span>`;const r=new CustomEvent("elementchange",{detail:{files:e.files}});if(d.dispatchEvent(r),e.files.length==0){const a=new CustomEvent("empty");d.dispatchEvent(a)}}),d.hasAttribute("data-filename")){let t=d.getAttribute("data-filename");t&&(o.innerHTML+=`<span class="file">${t} <button data-file="${t}">Remove</button></span>`)}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class y extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=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"):`${i}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
4
+ */function v(d,i){const o=i.querySelector(".files"),n=i.querySelector(".drop-area"),e=d.querySelector("input"),f=d.hasAttribute("data-maxsize")?d.getAttribute("data-maxsize"):0,u=i.querySelector(".invalid-feedback.size"),h=i.querySelector(".invalid-feedback.ext"),s=e.cloneNode();n.append(s);let b=function(t){if(!e.hasAttribute("accept"))return!0;const r=t.split(".").pop();return!!e.getAttribute("accept").includes(r)};if(i.addEventListener("click",t=>{t&&t.target instanceof HTMLElement&&t.target.closest(".btn-primary")&&(t.target.closest(".btn-primary"),h.classList.remove("d-block"),u.classList.remove("d-block"),(e.hasAttribute("multiple")?s:e).click())}),i.addEventListener("click",t=>{if(t&&t.target instanceof HTMLElement&&t.target.closest(".files button")){const r=new DataTransfer,{files:a}=e,m=t.target.closest(".files button");for(let p=0;p<a.length;p++){const l=a[p];l.name!=m.getAttribute("data-file")&&r.items.add(l)}e.files=r.files;const c=new Event("change");e.dispatchEvent(c)}}),s.addEventListener("change",t=>{if(e.hasAttribute("multiple")){const a=[...e.files,...s.files];let m=[];const c=new DataTransfer;for(let p=0;p<a.length;p++){const l=a[p],g=l.size/1e3;!m.includes(l.name)&&(f==0||g<f)&&b(l.name)&&c.items.add(l),b(l.name)||h.classList.add("d-block"),g>f&&u.classList.add("d-block"),m.push(l.name)}e.files=c.files}else e.files=s.files;const r=new Event("change");e.dispatchEvent(r)}),s.addEventListener("dragenter",t=>{s.classList.add("focus")}),s.addEventListener("dragleave",t=>{s.classList.remove("focus")}),s.addEventListener("drop",t=>{s.classList.remove("focus")}),e.addEventListener("change",t=>{if(e.files.length==1){let a=e.files[0];const m=a.size/1e3;if(!b(a.name)){h.classList.add("d-block");const c=new DataTransfer;e.files=c.files}if(m>f){u.classList.add("d-block");const c=new DataTransfer;e.files=c.files}}o.innerHTML="";for(const a of e.files)o.innerHTML+=`<span class="file" part="file">${a.name} <button data-file="${a.name}">Remove</button></span>`;const r=new CustomEvent("elementchange",{detail:{files:e.files}});if(d.dispatchEvent(r),e.files.length==0){const a=new CustomEvent("empty");d.dispatchEvent(a)}}),d.hasAttribute("data-filename")){let t=d.getAttribute("data-filename");t&&(o.innerHTML=`<span class="file">${t} <button data-file="${t}">Remove</button></span>`)}}window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"fileupload"});class y extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const i=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"):`${i}/css/core.min.css`,n=document.createElement("template");n.innerHTML=`
5
5
  <style>
6
6
  @import "${o}";
7
7
  .file-upload{max-width:25rem !important;padding-bottom:1rem}.file-upload .drop-area>input{display:none}.file-upload .file-upload__title{margin-top:0;margin-bottom:0;font-family:var(--font-heading);font-style:normal;font-weight:var(--heading-weight);line-height:2rem;color:var(--colour-heading);clear:both;display:block;padding-bottom:2rem;font-size:1.5rem;line-height:2rem;padding-bottom:2rem;max-width:var(--content-max-width)}.file-upload .helper-text{max-width:16.875rem}.files span{display:block;width:100%;padding:var(--input-padding-block, 0.75rem) var(--input-padding-inline, 1rem);font-size:var(--input-fs, 1rem);line-height:var(--input-lh, 1.25rem);border:2px solid var(--colour-primary-theme);appearance:none;border-radius:0.5rem;margin-bottom:1rem;color:var(--colour-primary);border-color:#d8d8d8;background:#d8d8d8;max-width:25rem !important;position:relative}@media(forced-colors: active){.files span{padding-right:5rem}.files span button{padding:0;width:3.7rem !important;text-indent:0% !important}.files span button:after{display:none !important}}.files span button{position:absolute;top:calc(50% - 0.5625rem);right:0.875rem;z-index:var(--index-floating);text-indent:300%;overflow:hidden;border:none;height:1.125rem;width:1.125rem;background:rgba(0,0,0,0)}.files span button:after{content:"";top:0;left:0;position:absolute;display:block;height:1.125rem;width:1.125rem;z-index:var(--index-focus);background:currentColor;mask-image:var(--icon-close);mask-size:100%;mask-repeat:no-repeat;mask-position:50% 50%;-webkit-mask-image:var(--icon-close);-webkit-mask-size:100%;-webkit-mask-repeat:no-repeat;-webkit-mask-position:50% 50%}:host(.fileupload--drag-drop) .file-upload{max-width:50rem !important}:host(.fileupload--drag-drop) .file-upload .helper-text{max-width:50rem !important}:host(.fileupload--drag-drop) .file-upload .drop-area>input{display:block;min-height:12.5rem;border:2px dashed var(--colour-primary-theme);color:rgba(0,0,0,0);position:relative;padding:1.5rem 2rem 1.5rem 2rem;user-select:none;max-width:100%;min-width:100%;margin-bottom:1rem}:host(.fileupload--drag-drop) .file-upload .drop-area>input.focus{border:2px solid var(--colour-info)}:host(.fileupload--drag-drop) .file-upload .drop-area{position:relative}:host(.fileupload--drag-drop) .file-upload .drop-area::before{content:"Drag and drop files here or click to upload";position:absolute;inset:1.5rem 2rem 1.5rem 2rem;z-index:1;pointer-events:none}:host(.fileupload--drag-drop) .file-upload ::file-selector-button{position:absolute;inset:0;opacity:0}/*# sourceMappingURL=assets/css/components/fileupload.css.map */
@@ -1 +1 @@
1
- {"version":3,"file":"fileupload.component.min.js","sources":["../../modules/fileupload.js","fileupload.component.js"],"sourcesContent":["// @ts-nocheck\nfunction fileupload(fileupload, wrapper) {\n const filesWrapper = wrapper.querySelector('.files');\n const dropArea = wrapper.querySelector('.drop-area');\n const input = fileupload.querySelector('input');\n const maxSize = fileupload.hasAttribute('data-maxsize') ? fileupload.getAttribute('data-maxsize') : 0;\n const errorMsgSize = wrapper.querySelector('.invalid-feedback.size');\n const errorMsgExt = wrapper.querySelector('.invalid-feedback.ext');\n // We clone the input field to work as a buffer input field, this allows us to add new files without losing the old ones\n const cloneInput = input.cloneNode();\n dropArea.append(cloneInput);\n let checkFileExt = function (filename) {\n if (!input.hasAttribute('accept'))\n return true;\n const nameExtension = filename.split('.').pop();\n const acceptedTypes = input.getAttribute('accept');\n if (acceptedTypes.includes(nameExtension))\n return true;\n return false;\n };\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.btn-primary')) {\n const button = event.target.closest('.btn-primary');\n // If the input allows multiples then use the buffer clone input\n errorMsgExt.classList.remove('d-block');\n errorMsgSize.classList.remove('d-block');\n const inputTrigger = input.hasAttribute('multiple') ? cloneInput : input;\n inputTrigger.click();\n }\n });\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.files button')) {\n const dt = new DataTransfer();\n const { files } = input;\n const button = event.target.closest('.files button');\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n if (file.name != button.getAttribute('data-file'))\n dt.items.add(file); // here you exclude the file. thus removing it.\n }\n input.files = dt.files; // Assign the updates list\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n }\n });\n // Buffer input change event\n cloneInput.addEventListener('change', (event) => {\n if (input.hasAttribute('multiple')) {\n const filesArray = [...input.files, ...cloneInput.files];\n let fileNames = [];\n const dt = new DataTransfer();\n for (let i = 0; i < filesArray.length; i++) {\n const file = filesArray[i];\n const size = file.size / 1000;\n if (!fileNames.includes(file.name) && (maxSize == 0 || size < maxSize) && checkFileExt(file.name))\n dt.items.add(file); // here you exclude the file. thus removing it.\n if (!checkFileExt(file.name)) {\n errorMsgExt.classList.add('d-block');\n }\n if (size > maxSize) {\n errorMsgSize.classList.add('d-block');\n }\n fileNames.push(file.name);\n }\n input.files = dt.files;\n }\n else {\n input.files = cloneInput.files;\n }\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n });\n cloneInput.addEventListener('dragenter', (event) => {\n cloneInput.classList.add('focus');\n });\n cloneInput.addEventListener('dragleave', (event) => {\n cloneInput.classList.remove('focus');\n });\n cloneInput.addEventListener('drop', (event) => {\n cloneInput.classList.remove('focus');\n });\n input.addEventListener('change', (event) => {\n if (input.files.length == 1) {\n let file = input.files[0];\n const size = file.size / 1000;\n if (!checkFileExt(file.name)) {\n errorMsgExt.classList.add('d-block');\n const dt = new DataTransfer();\n input.files = dt.files;\n }\n if (size > maxSize) {\n errorMsgSize.classList.add('d-block');\n const dt = new DataTransfer();\n input.files = dt.files;\n }\n }\n // Reset\n filesWrapper.innerHTML = '';\n for (const file of input.files) {\n filesWrapper.innerHTML += `<span class=\"file\" part=\"file\">${file.name} <button data-file=\"${file.name}\">Remove</button></span>`;\n }\n const elementChangeEvent = new CustomEvent('elementchange', { detail: { \"files\": input.files } });\n fileupload.dispatchEvent(elementChangeEvent);\n if (input.files.length == 0) {\n const emptyEvent = new CustomEvent('empty');\n fileupload.dispatchEvent(emptyEvent);\n }\n });\n if (fileupload.hasAttribute('data-filename')) {\n let filename = fileupload.getAttribute('data-filename');\n if (filename)\n filesWrapper.innerHTML += `<span class=\"file\">${filename} <button data-file=\"${filename}\">Remove</button></span>`;\n }\n}\nexport default fileupload;\n","// @ts-nocheck\nimport fileupload from \"../../modules/fileupload.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"fileupload\"\n});\nclass iamFileupload extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/fileupload.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"file-upload\">\n <span class=\"file-upload__title\" part=\"title\">Upload file</span>\n <p class=\"helper-text\"><slot name=\"helper\"></slot></p>\n <button class=\"btn btn-primary\" type=\"button\" part=\"button\"><slot name=\"btn\"></slot> Upload ${this.hasAttribute('data-filetype') ? this.getAttribute('data-filetype') : 'file'}</button>\n <div class=\"drop-area\"></div>\n <hr/>\n <slot></slot>\n <div class=\"files\" part=\"files\"><slot name=\"files\"></slot></div>\n <span class=\"invalid-feedback ext\">Some files did not match the accpeted extension type.</span>\n <span class=\"invalid-feedback size\">Some files Were too large to upload.</span>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n this.innerHTML += '<i class=\"fa-regular fa-arrow-up-from-bracket me-2\" aria-hidden=\"true\" slot=\"btn\"></i>';\n const wrapper = this.shadowRoot.querySelector('.file-upload');\n const input = this.querySelector('input');\n const helperText = this.shadowRoot.querySelector('.helper-text');\n if (!this.querySelector('[slot=\"helper\"]'))\n helperText.innerHTML = `${this.hasAttribute('data-maxsize') ? `Max file size is ${this.getAttribute('data-maxsize')}kb. ` : ''}${input.hasAttribute('accept') ? `Supported file types are ${input.getAttribute('accept')}` : ''}`;\n fileupload(this, wrapper);\n }\n static get observedAttributes() {\n return [\"data-filename\"];\n }\n attributeChangedCallback(attrName, oldVal, newVal) {\n switch (attrName) {\n case \"data-filename\": {\n if (oldVal != newVal) {\n const filesWrapper = this.shadowRoot.querySelector('.files');\n filesWrapper.innerHTML = `<span class=\"file\">${newVal} <button data-file=\"${newVal}\">Remove</button></span>`;\n }\n break;\n }\n }\n }\n}\nexport default iamFileupload;\n"],"names":["fileupload","wrapper","filesWrapper","dropArea","input","maxSize","errorMsgSize","errorMsgExt","cloneInput","checkFileExt","filename","nameExtension","event","dt","files","button","i","file","changeEvent","filesArray","fileNames","size","elementChangeEvent","emptyEvent","iamFileupload","assetLocation","coreCSS","template","helperText","attrName","oldVal","newVal"],"mappings":";;;IACA,SAASA,EAAWA,EAAYC,EAAS,CACrC,MAAMC,EAAeD,EAAQ,cAAc,QAAQ,EAC7CE,EAAWF,EAAQ,cAAc,YAAY,EAC7CG,EAAQJ,EAAW,cAAc,OAAO,EACxCK,EAAUL,EAAW,aAAa,cAAc,EAAIA,EAAW,aAAa,cAAc,EAAI,EAC9FM,EAAeL,EAAQ,cAAc,wBAAwB,EAC7DM,EAAcN,EAAQ,cAAc,uBAAuB,EAE3DO,EAAaJ,EAAM,YACzBD,EAAS,OAAOK,CAAU,EAC1B,IAAIC,EAAe,SAAUC,EAAU,CACnC,GAAI,CAACN,EAAM,aAAa,QAAQ,EAC5B,MAAO,GACX,MAAMO,EAAgBD,EAAS,MAAM,GAAG,EAAE,IAAG,EAE7C,MAAI,EADkBN,EAAM,aAAa,QAAQ,EAC/B,SAASO,CAAa,CAGhD,EAyFI,GAxFAV,EAAQ,iBAAiB,QAAUW,GAAU,CACrCA,GAASA,EAAM,kBAAkB,aAAeA,EAAM,OAAO,QAAQ,cAAc,IACpEA,EAAM,OAAO,QAAQ,cAAc,EAElDL,EAAY,UAAU,OAAO,SAAS,EACtCD,EAAa,UAAU,OAAO,SAAS,GAClBF,EAAM,aAAa,UAAU,EAAII,EAAaJ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fileupload(fileupload, wrapper) {\n const filesWrapper = wrapper.querySelector('.files');\n const dropArea = wrapper.querySelector('.drop-area');\n const input = fileupload.querySelector('input');\n const maxSize = fileupload.hasAttribute('data-maxsize') ? fileupload.getAttribute('data-maxsize') : 0;\n const errorMsgSize = wrapper.querySelector('.invalid-feedback.size');\n const errorMsgExt = wrapper.querySelector('.invalid-feedback.ext');\n // We clone the input field to work as a buffer input field, this allows us to add new files without losing the old ones\n const cloneInput = input.cloneNode();\n dropArea.append(cloneInput);\n let checkFileExt = function (filename) {\n if (!input.hasAttribute('accept'))\n return true;\n const nameExtension = filename.split('.').pop();\n const acceptedTypes = input.getAttribute('accept');\n if (acceptedTypes.includes(nameExtension))\n return true;\n return false;\n };\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.btn-primary')) {\n const button = event.target.closest('.btn-primary');\n // If the input allows multiples then use the buffer clone input\n errorMsgExt.classList.remove('d-block');\n errorMsgSize.classList.remove('d-block');\n const inputTrigger = input.hasAttribute('multiple') ? cloneInput : input;\n inputTrigger.click();\n }\n });\n wrapper.addEventListener('click', (event) => {\n if (event && event.target instanceof HTMLElement && event.target.closest('.files button')) {\n const dt = new DataTransfer();\n const { files } = input;\n const button = event.target.closest('.files button');\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n if (file.name != button.getAttribute('data-file'))\n dt.items.add(file); // here you exclude the file. thus removing it.\n }\n input.files = dt.files; // Assign the updates list\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n }\n });\n // Buffer input change event\n cloneInput.addEventListener('change', (event) => {\n if (input.hasAttribute('multiple')) {\n const filesArray = [...input.files, ...cloneInput.files];\n let fileNames = [];\n const dt = new DataTransfer();\n for (let i = 0; i < filesArray.length; i++) {\n const file = filesArray[i];\n const size = file.size / 1000;\n if (!fileNames.includes(file.name) && (maxSize == 0 || size < maxSize) && checkFileExt(file.name))\n dt.items.add(file); // here you exclude the file. thus removing it.\n if (!checkFileExt(file.name)) {\n errorMsgExt.classList.add('d-block');\n }\n if (size > maxSize) {\n errorMsgSize.classList.add('d-block');\n }\n fileNames.push(file.name);\n }\n input.files = dt.files;\n }\n else {\n input.files = cloneInput.files;\n }\n const changeEvent = new Event('change');\n input.dispatchEvent(changeEvent);\n });\n cloneInput.addEventListener('dragenter', (event) => {\n cloneInput.classList.add('focus');\n });\n cloneInput.addEventListener('dragleave', (event) => {\n cloneInput.classList.remove('focus');\n });\n cloneInput.addEventListener('drop', (event) => {\n cloneInput.classList.remove('focus');\n });\n input.addEventListener('change', (event) => {\n if (input.files.length == 1) {\n let file = input.files[0];\n const size = file.size / 1000;\n if (!checkFileExt(file.name)) {\n errorMsgExt.classList.add('d-block');\n const dt = new DataTransfer();\n input.files = dt.files;\n }\n if (size > maxSize) {\n errorMsgSize.classList.add('d-block');\n const dt = new DataTransfer();\n input.files = dt.files;\n }\n }\n // Reset\n filesWrapper.innerHTML = '';\n for (const file of input.files) {\n filesWrapper.innerHTML += `<span class=\"file\" part=\"file\">${file.name} <button data-file=\"${file.name}\">Remove</button></span>`;\n }\n const elementChangeEvent = new CustomEvent('elementchange', { detail: { \"files\": input.files } });\n fileupload.dispatchEvent(elementChangeEvent);\n if (input.files.length == 0) {\n const emptyEvent = new CustomEvent('empty');\n fileupload.dispatchEvent(emptyEvent);\n }\n });\n if (fileupload.hasAttribute('data-filename')) {\n let filename = fileupload.getAttribute('data-filename');\n if (filename)\n filesWrapper.innerHTML = `<span class=\"file\">${filename} <button data-file=\"${filename}\">Remove</button></span>`;\n }\n}\nexport default fileupload;\n","// @ts-nocheck\nimport fileupload from \"../../modules/fileupload.js\";\n// Data layer Web component created\nwindow.dataLayer = window.dataLayer || [];\nwindow.dataLayer.push({\n \"event\": \"customElementRegistered\",\n \"element\": \"fileupload\"\n});\nclass iamFileupload extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n const assetLocation = document.body.hasAttribute('data-assets-location') ? document.body.getAttribute('data-assets-location') : '/assets';\n const coreCSS = document.body.hasAttribute('data-core-css') ? document.body.getAttribute('data-core-css') : `${assetLocation}/css/core.min.css`;\n const loadCSS = `@import \"${assetLocation}/css/components/fileupload.css\";`;\n const template = document.createElement('template');\n template.innerHTML = `\n <style>\n @import \"${coreCSS}\";\n ${loadCSS}\n ${this.hasAttribute('css') ? `@import \"${this.getAttribute('css')}\";` : ``}\n </style>\n <div class=\"file-upload\">\n <span class=\"file-upload__title\" part=\"title\">Upload file</span>\n <p class=\"helper-text\"><slot name=\"helper\"></slot></p>\n <button class=\"btn btn-primary\" type=\"button\" part=\"button\"><slot name=\"btn\"></slot> Upload ${this.hasAttribute('data-filetype') ? this.getAttribute('data-filetype') : 'file'}</button>\n <div class=\"drop-area\"></div>\n <hr/>\n <slot></slot>\n <div class=\"files\" part=\"files\"><slot name=\"files\"></slot></div>\n <span class=\"invalid-feedback ext\">Some files did not match the accpeted extension type.</span>\n <span class=\"invalid-feedback size\">Some files Were too large to upload.</span>\n </div>\n `;\n this.shadowRoot.appendChild(template.content.cloneNode(true));\n }\n connectedCallback() {\n this.innerHTML += '<i class=\"fa-regular fa-arrow-up-from-bracket me-2\" aria-hidden=\"true\" slot=\"btn\"></i>';\n const wrapper = this.shadowRoot.querySelector('.file-upload');\n const input = this.querySelector('input');\n const helperText = this.shadowRoot.querySelector('.helper-text');\n if (!this.querySelector('[slot=\"helper\"]'))\n helperText.innerHTML = `${this.hasAttribute('data-maxsize') ? `Max file size is ${this.getAttribute('data-maxsize')}kb. ` : ''}${input.hasAttribute('accept') ? `Supported file types are ${input.getAttribute('accept')}` : ''}`;\n fileupload(this, wrapper);\n }\n static get observedAttributes() {\n return [\"data-filename\"];\n }\n attributeChangedCallback(attrName, oldVal, newVal) {\n switch (attrName) {\n case \"data-filename\": {\n if (oldVal != newVal) {\n const filesWrapper = this.shadowRoot.querySelector('.files');\n filesWrapper.innerHTML = `<span class=\"file\">${newVal} <button data-file=\"${newVal}\">Remove</button></span>`;\n }\n break;\n }\n }\n }\n}\nexport default iamFileupload;\n"],"names":["fileupload","wrapper","filesWrapper","dropArea","input","maxSize","errorMsgSize","errorMsgExt","cloneInput","checkFileExt","filename","nameExtension","event","dt","files","button","i","file","changeEvent","filesArray","fileNames","size","elementChangeEvent","emptyEvent","iamFileupload","assetLocation","coreCSS","template","helperText","attrName","oldVal","newVal"],"mappings":";;;IACA,SAASA,EAAWA,EAAYC,EAAS,CACrC,MAAMC,EAAeD,EAAQ,cAAc,QAAQ,EAC7CE,EAAWF,EAAQ,cAAc,YAAY,EAC7CG,EAAQJ,EAAW,cAAc,OAAO,EACxCK,EAAUL,EAAW,aAAa,cAAc,EAAIA,EAAW,aAAa,cAAc,EAAI,EAC9FM,EAAeL,EAAQ,cAAc,wBAAwB,EAC7DM,EAAcN,EAAQ,cAAc,uBAAuB,EAE3DO,EAAaJ,EAAM,YACzBD,EAAS,OAAOK,CAAU,EAC1B,IAAIC,EAAe,SAAUC,EAAU,CACnC,GAAI,CAACN,EAAM,aAAa,QAAQ,EAC5B,MAAO,GACX,MAAMO,EAAgBD,EAAS,MAAM,GAAG,EAAE,IAAG,EAE7C,MAAI,EADkBN,EAAM,aAAa,QAAQ,EAC/B,SAASO,CAAa,CAGhD,EAyFI,GAxFAV,EAAQ,iBAAiB,QAAUW,GAAU,CACrCA,GAASA,EAAM,kBAAkB,aAAeA,EAAM,OAAO,QAAQ,cAAc,IACpEA,EAAM,OAAO,QAAQ,cAAc,EAElDL,EAAY,UAAU,OAAO,SAAS,EACtCD,EAAa,UAAU,OAAO,SAAS,GAClBF,EAAM,aAAa,UAAU,EAAII,EAAaJ,GACtD,MAAK,EAE9B,CAAK,EACDH,EAAQ,iBAAiB,QAAUW,GAAU,CACzC,GAAIA,GAASA,EAAM,kBAAkB,aAAeA,EAAM,OAAO,QAAQ,eAAe,EAAG,CACvF,MAAMC,EAAK,IAAI,aACT,CAAE,MAAAC,CAAO,EAAGV,EACZW,EAASH,EAAM,OAAO,QAAQ,eAAe,EACnD,QAASI,E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AA,MAET,KAAK,aAAa,KAAK,EAAI,YAAY,KAAK,aAAa,KAAK,MAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,oGAKwB,KAAK,aAAa,eAAe,EAAI,KAAK,aAAa,eAAe,EAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAStK,KAAK,WAAW,YAAYC,EAAS,QAAQ,UAAU,EAAI,CAAC,CAC/D,CACD,mBAAoB,CAChB,KAAK,WAAa,yFAClB,MAAM1B,EAAU,KAAK,WAAW,cAAc,cAAc,EACtDG,EAAQ,KAAK,cAAc,OAAO,EAClCwB,EAAa,KAAK,WAAW,cAAc,cAAc,EAC1D,KAAK,cAAc,iBAAiB,IACrCA,EAAW,UAAY,GAAG,KAAK,aAAa,cAAc,EAAI,oBAAoB,KAAK,aAAa,cAAc,QAAU,KAAKxB,EAAM,aAAa,QAAQ,EAAI,4BAA4BA,EAAM,aAAa,QAAQ,IAAM,MACjOJ,EAAW,KAAMC,CAAO,CAC3B,CACD,WAAW,oBAAqB,CAC5B,MAAO,CAAC,eAAe,CAC1B,CACD,yBAAyB4B,EAAUC,EAAQC,EAAQ,CAC/C,OAAQF,EAAQ,CACZ,IAAK,gBAAiB,CAClB,GAAIC,GAAUC,EAAQ,CAClB,MAAM7B,EAAe,KAAK,WAAW,cAAc,QAAQ,EAC3DA,EAAa,UAAY,sBAAsB6B,wBAA6BA,4BAEhF,KACH,CACJ,CACJ,CACL"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */function i(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 r=e.textContent.toLowerCase();e.classList.add("d-none"),r.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.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"header"});class o 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.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"inline edit"});class b extends HTMLElement{constructor(){super();const t=this.attachShadow({mode:"open"}),i=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"):`${i}/css/core.min.css`,e=document.createElement("template");e.innerHTML=`
5
5
  <style class="styles">
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Marketing"});class o extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const e=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",i=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,t=document.createElement("template");t.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"mutliselect"});class b extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",s=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,r=document.createElement("template");r.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"nav"});class v extends HTMLElement{constructor(){super();const s=this.attachShadow({mode:"open"}),n=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"):`${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.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 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.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 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.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */import k from"js-cookie";const q=e=>e.replace(/ /g,"_"),x=function(e){return e=e.toLowerCase(),e=q(e),e=e.replace(/\W/g,""),e},m=(e,s,a)=>s.split(/[\.\[\]\'\"]/).filter(o=>o).reduce((o,d)=>o?o[d]:a,e),S=e=>Array.isArray(e)||e!==null&&["function","object"].includes(typeof e);var L=function(e,s,a,o){function d(c){return c instanceof a?c:new a(function(n){n(c)})}return new(a||(a=Promise))(function(c,n){function v(r){try{u(o.next(r))}catch(i){n(i)}}function t(r){try{u(o.throw(r))}catch(i){n(i)}}function u(r){r.done?c(r.value):d(r.value).then(v,t)}u((o=o.apply(e,s||[])).next())})};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Search"});class C extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const s=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"):`${s}/css/core.min.css`,o=document.createElement("template");o.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"customElementRegistered",element:"Slider"});class f extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"});const t=document.body.hasAttribute("data-assets-location")?document.body.getAttribute("data-assets-location"):"/assets",p=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${t}/css/core.min.css`,i=document.createElement("template");i.innerHTML=`
5
5
  <style>
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 iamproperty
4
4
  */const B=function(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))},Q=(o,e)=>String(o).padStart(e,"0"),X=o=>o.charAt(0).toUpperCase()+o.slice(1),S=(o,e,n)=>e.split(/[\.\[\]\'\"]/).filter(a=>a).reduce((a,h)=>a?a[h]:n,o);var Y=function(o,e,n,a){function h(d){return d instanceof n?d:new n(function(i){i(d)})}return new(n||(n=Promise))(function(d,i){function l(c){try{t(a.next(c))}catch(r){i(r)}}function s(c){try{t(a.throw(c))}catch(r){i(r)}}function t(c){c.done?d(c.value):h(c.value).then(l,s)}t((a=a.apply(o,e||[])).next())})};const R=o=>{const e=Array.from(o.querySelectorAll("thead th"));Array.from(o.querySelectorAll("tbody tr")).forEach((a,h)=>{const d=Array.from(a.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"];d.forEach((l,s)=>{const t=e[s];if(typeof t<"u"){let c=document.createElement("div");c.innerHTML=t.innerHTML;let r=c.textContent||c.innerText||"";l.setAttribute("data-label",r),t.hasAttribute("data-td-class")&&l.setAttribute("class",t.getAttribute("data-td-class")),t.hasAttribute("data-format")&&(l.setAttribute("data-format",t.getAttribute("data-format")),l.innerHTML=D(t.getAttribute("data-format"),l.textContent.trim())),i.includes(l.textContent.trim().toLowerCase())&&l.setAttribute("data-content",l.textContent.trim().toLowerCase())}})})},J=o=>{let e=0;return Array.from(o.querySelectorAll("tbody tr")).forEach((n,a)=>{let h=window.getComputedStyle(document.querySelector("html")),d=n.querySelector(":scope > *:last-child > *:first-child");if(d){d.classList.add("text-nowrap");let i=d.offsetWidth/parseFloat(h.fontSize);i+=1.7,e=e>i?e:i}}),e},G=(o,e)=>{if(e.classList.contains("table--fullwidth")&&!e.hasAttribute("data-expandable")||o.querySelectorAll("thead tr th").length<4&&!e.hasAttribute("data-expandable"))return!1;Array.from(o.querySelectorAll("thead tr")).forEach((n,a)=>{o.querySelectorAll("thead tr th.expand-button-heading").length||n.insertAdjacentHTML("afterbegin",'<th class="th--fixed expand-button-heading"></th>')}),Array.from(o.querySelectorAll("tbody tr")).forEach((n,a)=>{const h=n.getAttribute("data-view")==="full"?"aria-expanded":"";n.insertAdjacentHTML("afterbegin",`<td class="td--fixed td--expand"><button class="btn btn-compact btn-secondary" data-expand-button ${h}>Expand</button></td>`)})},V=o=>{o.addEventListener("click",e=>{if(e&&e.target instanceof HTMLElement&&e.target.closest("[data-expand-button]")){let n=e.target.closest("[data-expand-button]"),a=n.closest("tr");n.toggleAttribute("aria-expanded"),a.getAttribute("data-view")=="full"?a.setAttribute("data-view","default"):a.setAttribute("data-view","full"),n.blur()}})},N=(o,e)=>{let n=e.querySelector("input[data-search]");if(!n)return!1;const a=n.getAttribute("id"),h=n.getAttribute("data-search").split(",");let d=n.parentNode,i={};h.forEach((l,s)=>{Array.from(o.querySelectorAll('td[data-label="'+l.trim()+'"]')).forEach((t,c)=>{t.querySelector(".td__content")?i[t.querySelector(".td__content").textContent]=t.querySelector(".td__content").textContent:i[t.textContent]=t.textContent})}),n.setAttribute("list",`${a}_list`),n.setAttribute("autocomplete","off"),d.querySelector("datalist")||(d.innerHTML+=`<datalist id="${a}_list"></datalist>`),d.querySelector("datalist").innerHTML=`${Object.keys(i).map(l=>`<option value="${l}"></option>`).join("")}`},K=(o,e,n,a,h)=>{var d;let i=function(t,c=!1){if(a.hasAttribute("data-no-submit")||e.classList.contains("processing"))return!1;if(Array.from(e.querySelectorAll("iam-applied-filters")).forEach((r,p)=>{var u=new Event("tags-set");r.dispatchEvent(u)}),t.type=="submit"&&(e.classList.add("processing"),Array.from(e.querySelectorAll("[data-duplicate]")).forEach((r,p)=>{const u=r.getAttribute("data-duplicate"),b=document.getElementById(u),y=document.querySelector(`[for="${u}"] iam-card`);if(b.checked!=r.checked)if(y){let w=new Event("click");y.dispatchEvent(w)}else b.checked=r.checked}),e.classList.remove("processing")),e.hasAttribute("data-ajax")){if(!c){let r=e.querySelector("[data-pagination]");r.value=1,a.setAttribute("data-page",1)}I(o,e,n,a)}else e.hasAttribute("data-submit")?e.submit():(C(o,e,a),$(o,e));if(e.hasAttribute("data-ajax-post")){let r=new FormData(e),p=new URLSearchParams(r).toString();const u=new XMLHttpRequest;u.open("GET",`${window.location.href}?ajax=true&${p}`),u.send()}};e.querySelector("iam-actionbar[data-search]")&&e.querySelector("iam-actionbar[data-search]").addEventListener("search-submit",t=>{e.querySelector("input[data-search]")?e.querySelector("input[data-search]").value=t.detail.search:e.insertAdjacentHTML("beforeend",`<input type="hidden" name="search" data-search="${e.querySelector("iam-actionbar[data-search]").getAttribute("data-search")}" value="${t.detail.search}"/>`),clearTimeout(d),i(t)}),e.addEventListener("keyup",t=>{clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&(d=setTimeout(function(){i(t)},500))}),e.addEventListener("change",t=>{if(clearTimeout(d),t&&t.target instanceof HTMLElement&&t.target.closest("[data-sort]")&&(e.hasAttribute("data-submit")||O(o,e,h),i(t)),t&&t.target instanceof HTMLElement&&t.target.closest("input[data-search]")&&i(t),t&&t.target instanceof HTMLElement&&t.target.closest("[data-filter][data-no-ajax]")?(C(o,e,a),$(o,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),t&&t.target instanceof HTMLElement&&t.target.hasAttribute("id")){let c=t.target.getAttribute("id");document.querySelector(`[data-duplicate="${c}"]`)&&(document.querySelector(`[data-duplicate="${c}"]`).checked=t.target.checked)}}),e.addEventListener("click",t=>{if(clearTimeout(d),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((r,p)=>{r.innerHTML=""});let c=e.elements;for(let r=0;r<c.length;r++)switch(c[r].type.toLowerCase()?c[r].type.toLowerCase():"text"){case"text":case"password":case"textarea":c[r].value="";break;case"radio":case"checkbox":if(c[r].checked){let u=c[r],b=u.getAttribute("id"),y=document.querySelector(`[for="${b}"`);if(y.querySelector("iam-card")){let w=y.querySelector("iam-card"),L=new Event("click");w.dispatchEvent(L)}u.checked=!1}break;case"select-one":case"select-multi":c[r].selectedIndex=-1;break}e.classList.remove("processing"),e.hasAttribute("data-submit")||O(o,e,h),i(t)}}),e.addEventListener("submit",t=>{clearTimeout(d),e.hasAttribute("data-submit")||t.preventDefault(),i(t)}),e.addEventListener("force",t=>{i(t)}),e.addEventListener("paginate",t=>{i(t,!0)});let l=[],s=[];Array.from(e.querySelectorAll("[data-mimic]")).forEach((t,c)=>{let r=t.getAttribute("data-mimic");Array.from(document.querySelectorAll(`[name="${r}"]`)).forEach((p,u)=>{let b=p.closest("form");l.includes(b)||l.push(b),s.includes(r)||s.push(r)})}),l.forEach((t,c)=>{const r=function(){let p=[],u=new FormData(t);for(const[b,y]of u)document.querySelector(`[data-mimic="${b}"]`)&&!p.includes(b)?(p.push(b),document.querySelector(`[data-mimic="${b}"]`).value=y):document.querySelector(`[data-mimic="${b}"]`)&&(document.querySelector(`[data-mimic="${b}"]`).value+=","+y);for(const b of p){const y=new Event("force");e.dispatchEvent(y)}for(const b of s)if(!u.has(b)&&t.querySelector(`[name="${b}"]`)){document.querySelector(`[data-mimic="${b}"]`).value="";const y=new Event("force");e.dispatchEvent(y)}};t.addEventListener("force",p=>{r()}),t.addEventListener("change",p=>{r()})})},O=(o,e,n)=>{if(e.getAttribute("data-ajax"))return!1;let a=o.querySelector("tbody"),h=e.querySelector('input[type="radio"][data-sort]:checked');if(e.querySelector("select[data-sort]")){let r=e.querySelector("select[data-sort]");h=e.querySelector(`select[data-sort] option:nth-child(${r.selectedIndex+1})`)}let d=h.getAttribute("data-sort"),i=h.getAttribute("data-order"),l=h.getAttribute("data-format");if(!d)return a.innerHTML=n.innerHTML,R(o),!1;let s=[];["asc","desc","descending"].includes(i)||(s=i.split(","));let t=[];Array.from(a.querySelectorAll("tr")).forEach((r,p)=>{let u=r.querySelector('td[data-label="'+d+'"], th[data-label="'+d+'"]').textContent.trim();r.querySelector('[data-label="'+d+'"] .td__content')&&(u=r.querySelector('[data-label="'+d+'"] .td__content').textContent.trim()),s.length&&s.includes(u)&&(u=s.indexOf(u)),B(u)&&(u=Q(u,10)),l&&l=="date"&&(u=new Date(u));const b={index:u,row:r};t.push(b)}),t.sort((r,p)=>r.index>p.index?1:-1),(i=="descending"||i=="desc")&&(t=t.reverse());let c="";t.forEach((r,p)=>{c+=r.row.outerHTML}),a.innerHTML=c},C=(o,e,n)=>{o.classList.remove("table--filtered");let a=z(e),h=[],d=0,i=e.querySelector("[data-pagination]")?parseInt(e.querySelector("[data-pagination]").value):1,l=e.querySelector("[data-show]")?parseInt(e.querySelector("[data-show]").value):15;if(Array.from(o.querySelectorAll("tbody tr")).forEach((t,c)=>{t.classList.remove("filtered"),t.classList.remove("filtered--matched"),t.classList.remove("filtered--show"),t.removeAttribute("data-filtered-by")}),e.querySelector("input[data-search]")){let t=e.querySelector("input[data-search]");e.querySelector("input[data-search]").getAttribute("data-search").split(",").forEach((r,p)=>{h.push({column:`${r.trim()}`,value:`${t.value}`})})}Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML="",t.parentNode.classList.remove("hover")});let s=0;Object.values(a).forEach((t,c)=>{typeof t=="object"&&Object.values(t).length?s+=Object.values(t).length:s++}),s&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((t,c)=>{t.innerHTML+=`(${s})`,t.parentNode.classList.add("hover")}),o.classList.add("table--filtered");for(const[t,c]of Object.entries(a))Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((r,p)=>{let u=!1;c.forEach((b,y)=>{let w=r.querySelector(`[data-label="${t}"]`);if(b.includes("-date-from")){let f=new Date(b.replace("-date-from","")),g=new Date(w.textContent.toLowerCase());f.setHours(0,0,0,0),g.setHours(0,0,0,0),g<f?(r.classList.add("less-than-from-date"),u=!1):!r.classList.contains("less-than-from-date")&&!r.classList.contains("greater-than-to-date")&&(u=!0)}else if(b.includes("-date-to")){let f=new Date(b.replace("-date-to","")),g=new Date(w.textContent.toLowerCase());f.setHours(0,0,0,0),g.setHours(0,0,0,0),g>f?(r.classList.add("greater-than-to-date"),u=!1):!r.classList.contains("less-than-from-date")&&!r.classList.contains("greater-than-to-date")&&(u=!0)}if(b&&b=="$today")b=D("date",new Date);else if(b&&b=="$yesterday"){let f=new Date;f.setDate(f.getDate()-1),b=D("date",f)}else if(b&&(b=="$thisWeek"||b=="$lastWeek")){let f=new Date,g=new Date(f.setDate(f.getDate()-(f.getDay()-1))),m=new Date(f.setDate(f.getDate()-f.getDay()+7)),x=new Date(w.textContent.toLowerCase());if(f.setHours(0,0,0,0),g.setHours(0,0,0,0),m.setHours(0,0,0,0),x.setHours(0,0,0,0),b=="$thisWeek")u=x>=g&&x<=m;else{let A=new Date(g.setDate(g.getDate()-7)),k=new Date(m.setDate(m.getDate()-7));A.setHours(0,0,0,0),k.setHours(0,0,0,0),u=x>=A&&x<=k}}else if(b&&b=="$thisMonth"){let f=new Date,g=f.getFullYear(),m=f.getMonth();var L=new Date(g,m,1),q=new Date(g,m+1,0);let x=new Date(w.textContent.toLowerCase());L.setHours(0,0,0,0),q.setHours(0,0,0,0),x.setHours(0,0,0,0),u=x>=L&&x<=q}else if(b&&b=="$lastMonth"){let f=new Date,g=f.getFullYear(),m=f.getMonth();var E=new Date(g,m-1,1),v=new Date(g,m,0);let x=new Date(w.textContent.toLowerCase());E.setHours(0,0,0,0),v.setHours(0,0,0,0),x.setHours(0,0,0,0),u=x>=E&&x<=v}w&&w.textContent.toLowerCase().includes(b.replace("-"," ").toLowerCase())&&(u=!0)}),u||(r.classList.add("filtered"),r.setAttribute("data-filtered-by",t))});Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).forEach((t,c)=>{let r=!(h.length>0&&h[0].value.length>=3);h.forEach((p,u)=>{let b=t.querySelector(`[data-label="${p.column}"]`);b&&p.value.length>=3&&b.textContent.toLowerCase().includes(p.value.toLowerCase())&&(r=!0)}),r||t.classList.add("filtered")}),Array.from(o.querySelectorAll("tbody tr:not(.filtered")).forEach((t,c)=>{d++,t.classList.add("filtered--matched"),Math.ceil(d/l)==parseInt(i)&&t.classList.add("filtered--show")}),n&&(n.setAttribute("data-total",d),n.setAttribute("data-show",l),n.setAttribute("data-page",i))},$=(o,e,n)=>{Array.from(e.querySelectorAll("[data-query]")).forEach((h,d)=>{let i=h.getAttribute("data-query"),l=0;if(i=="total")n.hasAttribute("data-total")?l=n.getAttribute("data-total"):l=(o.classList.contains("table--filtered"),o.querySelectorAll("tbody tr").length);else if(!i.includes(" == ")&&i.includes(" & ")){let s=i.split(" & "),t="";s.forEach(c=>{t+=`:not([data-filtered-by="${c}"])`}),l=Array.from(o.querySelectorAll(`tbody tr${t}`)).length}else if(!i.includes(" == "))l=Array.from(o.querySelectorAll(`tbody tr:not([data-filtered-by="${i}"])`)).length;else if(i.includes(" && ")){let s=i.split(" && ");l=Array.from(o.querySelectorAll("tbody tr:not(.filtered)")).filter(function(t){let c=!0;for(const[r,p]of Object.entries(s)){let u=p.split(" == ");(!t.querySelector(`td[data-label="${u[0]}"]`)||t.querySelector(`td[data-label="${u[0]}"]`).textContent!=`${u[1]}`)&&(c=!1)}return c}).length}else{let s=i.split(" == ");l=Array.from(o.querySelectorAll(`tbody tr.filtered--matched td[data-label="${s[0]}"], tbody tr[data-filtered-by="${s[0]}"] td[data-label="${s[0]}"]`)).filter(function(t){return t.textContent===s[1]}).length}h.hasAttribute("data-total")?h.setAttribute("data-total",l):h.innerHTML=l})},Z=function(o,e,n,a){if(a.hasAttribute("data-no-submit"))return!1;n.addEventListener("update-page",h=>{let d=e.querySelector("[data-pagination]"),i=h.detail.page;if(d.value=i,e.dispatchEvent(new Event("paginate")),a.setAttribute("data-page",i),o.hasAttribute("data-show-history")){const l=new URL(location);l.searchParams.set("page",i),history.pushState({type:"pagination",form:e.getAttribute("id"),page:i},"",l)}if(!a.hasAttribute("data-no-scroll")){const s=o.getBoundingClientRect().top+window.pageYOffset+-250;window.scrollTo({top:s,behavior:"smooth"})}}),n.addEventListener("update-show",h=>{let d=e.querySelector("[data-show]"),i=h.detail.show;d.value=i,a.setAttribute("data-show",i),e.dispatchEvent(new Event("submit"))})},tt=(o,e)=>{if(!o)return!1;o.addEventListener("click",n=>{et(e)})},et=function(o){for(var e=[],n=o.getElementsByTagName("tr"),a=0;a<n.length;a++){for(var h=n[a].querySelectorAll("td,th"),d=[],i=0;i<h.length;i++)d.push(`"${h[i].textContent}"`);e.push(d.join(","))}e=e.join(`
5
5
  `);let l=new Blob([e],{type:"text/csv"});var s=document.createElement("a");s.download="export.csv";var t=window.URL.createObjectURL(l);s.href=t,s.style.display="none",document.body.appendChild(s),s.click(),document.body.removeChild(s)},P=function(o,e,n,a){if(R(o),G(o,a),$(o,e,a),a&&a.classList.contains("table--cta")){let d=function(){Array.from(o.querySelectorAll("tr")).forEach((i,l)=>{let s=i.offsetHeight;i.style.setProperty("--row-height",`${s}px`)})};const h=J(o);a.style.setProperty("--cta-width",`${h}rem`),new ResizeObserver(d).observe(o)}},z=function(o){let e=new Object;return Array.from(o.querySelectorAll("[data-filter]")).forEach((a,h)=>{if(!(a.type=="radio"&&!a.checked)&&!(a.type=="checkbox"&&!a.checked)&&a&&a.value){let d=a.getAttribute("data-filter"),i=a.value;a.hasAttribute("data-date-from")&&(i+="-date-from"),a.hasAttribute("data-date-to")&&(i+="-date-to"),e[d]||(e[d]=new Array),e[d].push(i)}}),e},I=function(o,e,n,a){return Y(this,void 0,void 0,function*(){let h=new FormData(e),d=new URLSearchParams(h).toString(),i=o.querySelectorAll("thead tr th:not(.expand-button-heading)"),l=o.querySelector("tbody"),s=e.getAttribute("data-ajax");a.classList.add("table--loading");let t=z(e);Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,u)=>{p.innerHTML="",p.parentNode.classList.remove("hover")});let c=0;Object.values(t).forEach((p,u)=>{typeof p=="object"&&Object.values(p).length?c+=Object.values(p).length:c++}),c&&Array.from(e.querySelectorAll("[data-filter-count]")).forEach((p,u)=>{p.innerHTML+=`(${c})`,p.parentNode.classList.add("hover")}),window.controller||(window.controller=[]),window.controller[s]&&window.controller[s].abort(),window.controller[s]=new AbortController;const{signal:r}=controller[s];n.setAttribute("data-loading","true"),e.classList.add("processing");try{yield fetch(s+"?"+d,{signal:r,method:"get",credentials:"same-origin",headers:new Headers({"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"})}).then(p=>p.json()).then(p=>{let u=e.hasAttribute("data-schema")?e.getAttribute("data-schema"):"data",b=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",w=S(p,b,15),L=S(p,y,1),q=S(p,u),E=a.hasAttribute("data-empty-msg")?a.getAttribute("data-empty-msg"):"No results found";q?(l.innerHTML="",q.forEach((v,f)=>{var g=document.createElement("tr");i.forEach((m,x)=>{let A="";var k=document.createElement("td");if(k.setAttribute("data-label",m.innerText),m.getAttribute("data-output")){var H=m.getAttribute("data-output");A=H.replace(new RegExp(/{(.*?)}/,"gm"),function(M){return S(v,M.replace("{","").replace("}",""))})}if(m.hasAttribute("data-output-array")){var H=m.getAttribute("data-output");let F=S(v,H.replace("{","").replace("}",""));A="",F.forEach((j,it)=>{let W=m.getAttribute("data-output-array"),T="";if(m.hasAttribute("data-output-array-property")&&m.hasAttribute("data-output-array-transform")){const _=S(j,m.getAttribute("data-output-array-property")),U=JSON.parse(m.getAttribute("data-output-array-transform"))[_];T=W.replace(`{${m.getAttribute("data-output-array-property")}}`,U)}T=T.replace(new RegExp(/{(.*?)}/,"gm"),function(_){return S(j,_.replace("{","").replace("}",""))}),A+=T})}m.hasAttribute("data-transform")&&(A=JSON.parse(m.getAttribute("data-transform"))[A],!A&&m.hasAttribute("data-default")&&(A=m.getAttribute("data-default"))),k.innerHTML=A,g.appendChild(k)}),l.appendChild(g)}),N(o,e),a.setAttribute("data-total",parseInt(w)),a.setAttribute("data-page",parseInt(L)),P(o,e,n,a),Array.from(e.querySelectorAll("[data-ajax-query]")).forEach((v,f)=>{let g=S(p,v.getAttribute("data-ajax-query"),"");v.hasAttribute("data-total")?v.setAttribute("data-total",g):v.innerHTML=g}),parseInt(w)==0&&(l.innerHTML=`<tr><td colspan="100%"><span>${E}</span></td></tr>`),a.classList.remove("table--loading"),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"Ajax table loaded",url:s,formData:d})):l.innerHTML='<tr><td colspan="100%"><span>Error loading table</span></td></tr>',n.removeAttribute("data-loading"),e.classList.remove("processing")})}catch(p){console.log(p)}})},D=(o,e)=>{switch(o){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",{day:"numeric",month:"long",year:"2-digit"});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",n=document.body.hasAttribute("data-core-css")?document.body.getAttribute("data-core-css"):`${e}/css/core.min.css`,a=document.createElement("template");a.innerHTML=`
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * iamKey v5.6.1-beta17
2
+ * iamKey v5.6.1-beta19
3
3
  * Copyright 2022-2024 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>