UNPKG

baseframe-js

Version:

Baseframe JS is a comprehensive suite of modular plugins and utilities designed for front-end development

1 lines 55 kB
(function(k,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(k=typeof globalThis<"u"?globalThis:k||self,Z(k.baseFrame={}))})(this,(function(k){"use strict";function Z(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var Q={exports:{}},Ct=Q.exports,Ge;function wt(){return Ge||(Ge=1,(function(p,e){(function(s,t){p.exports=t()})(Ct,(function(){const s=window,t=document,n=t.body,o=t.documentElement,i=d=>({}).toString.call(d).match(/\s([a-zA-Z]+)/)[1].toLowerCase(),c=Object.assign,f=Array.from,m=Array.isArray,h=d=>typeof d=="string",b=d=>i(d)==="object",v=new WeakMap,$=/([\.\#][\w-_\s]+)/g,y=Object.freeze({active:"active",starting:"starting",ending:"ending"}),E=(d,a=y)=>{const r={},u=d?d+"-":"";for(const g in a)Object.hasOwn(a,g)&&c(r,{[g]:u+a[g]});return r},M=(d,a,r=t)=>d==="class"?f(r.getElementsByClassName(a)):d==="id"?t.getElementById(a):d==="tag"?f(r.getElementsByTagName(a)):null,T=(d,a=t)=>f(a.querySelectorAll(d)),Y=(d,a=t)=>a.querySelector(d),J=(d,a,r=!1)=>{let u=0,g,C;const L=[];for(;g=d[u];){const x=a(g,u++);x&&(r?((x!==C||!d.find(P=>P===x))&&L.push(x),C=x):L.push(x))}return L},de=(d,a,r=o)=>{const u=h(r),g=[];for(;(d=d.parentElement)&&(d.matches(a)&&g.unshift(d),!(u?d.matches(r):d===r)););return g},us=(d,a,r=!1)=>f(d.parentElement.childNodes).filter(g=>g instanceof HTMLElement&&(a?g.matches(a):!0)&&(r?!0:g!==d)),ms=(d,a)=>{let r=d.nextElementSibling;if(a)for(;r&&!r.matches(a);)r=r.nextElementSibling;return r??d},hs=(d,a)=>{let r=d.previousElementSibling;if(a)for(;r&&!r.matches(a);)r=r.previousElementSibling;return r??d},$s=(d,a)=>{if(h(a))return a==="value"?d.value:d.getAttribute(a);for(const r in a){const u=a[r];u===null?d.removeAttribute(r):d.setAttribute(r,u)}},ot=(d,a)=>{if(h(a))return getComputedStyle(d).getPropertyValue(a);for(const r in a){const u=a[r];r.startsWith("--")?d.style.setProperty(r,u):d.style[r]=u}return""},pe=d=>d.classList,at=(d,a)=>{const r=pe(d);m(a)?r.add(...a):r.add(a)},We=(d,a)=>{const r=pe(d);m(a)?r.remove(...a):r.remove(a)},it=(d,a,r)=>{const u=pe(d);if(m(a))for(const g of a)u.toggle(g,r);else u.toggle(a,r)},bs=(d,a)=>{const r=pe(d);return m(a)?a.every(u=>r.contains(u)):r.contains(a)},lt=d=>d.getBoundingClientRect(),gs=d=>{const a=lt(d);return{top:a.top+s.pageYOffset,left:a.left+s.pageXOffset}},vs=(d,a={},r)=>{const[u,...g]=d.split($),C=Os(g),L=m(a)||a instanceof HTMLElement,x=h(a)||L,P=x?{}:a,B=c(C,P),{style:_}=B,O=c(t.createElement(u),B),A=x&&!r?a:r||"";return _&&b(_)&&ot(O,_),A&&O.append(...h(A)?rt(A):m(A)?A:[A]),O},rt=d=>{const a=new DOMParser().parseFromString(d,"text/html").body,r=T("script",a);return r&&r.forEach(g=>g.remove()),f(a.childNodes)},ys=d=>{for(;d.firstChild;)d.removeChild(d.firstChild)},ct=(d,...a)=>{const r=m(d)?d:i(d)==="string"||i(d)==="boolean"?[d]:[],u=r.length>0,g=O=>u?r.some(A=>A===O):!1,C=g("deep")||g(!0),L=g("noNull"),x=g("noFalsy"),P=u?a.shift():d;let B,_=0;for(;B=a[_++];)for(const O in B){const A=B[O];if(C&&b(A)){const zs=P[O]?P[O]:P[O]={};ct(r,zs,A)}else P[O]=A,(L&&A===null||x&&!A)&&delete P[O]}return P},Es=(d=n,a,r,u=null,g=!1)=>{const C=a.split(".")[0],L=x=>{const P=x.___cdata||[];if(u&&d instanceof HTMLElement){const B=h(u)?T(u,d):u,_=x.isTrusted?x.target:x.___synthTarget??x.target,O=B.find(A=>A===_||A.contains(_));O&&r(x,O,...P)}else r(x,d,...P)};v.has(d)?v.get(d).set(a,L):v.set(d,new Map([[a,L]])),d.addEventListener(C,L,g)},Cs=(d=n,a,r=!1)=>{if(v.has(d)){const u=v.get(d),g=a.split(".")[0],C=u.get(a);d.removeEventListener(g,C,r),u.delete(a)}},ws=(d=n,a,r=null,u=[],g=!1)=>{a=a.trim();const C=r?T(r,d instanceof Window?n:d):null;if(C&&C.length===0)return;const L=C?C[0]:d,[x,P=""]=a.split("."),B=/^\[.+\]$/.test(a),_=new Event(B?a:x);if(u.length&&c(_,{___cdata:u}),P||B){const O=v.get(d);if(!O)return;const A=O.get(a);c(_,{___synthTarget:L}),A&&(B?(d.addEventListener(a,A,g),d.dispatchEvent(_),d.removeEventListener(a,A,g)):A(_,L))}else d.dispatchEvent(_)},dt=()=>{let d=!1,a=null,r=()=>{};return(u,g,C=300)=>{d&&(r(),clearTimeout(a)),u(),r=g,d=!0,a=setTimeout(()=>{r(),d=!1},C)}},Ts=(d,a="")=>{const r=dt(),u=E(a);return[(C,L=400,x=()=>{})=>{const P=C?u.starting:u.ending,B=O=>{O.offsetHeight,at(O,P),We(O,u.active)},_=O=>{We(O,P),it(O,u.active,C)};r(()=>{m(d)?d.forEach(B):B(d)},()=>{m(d)?d.forEach(_):_(d),x()},L)},u]},xs=(d,a=60)=>{a=Math.min(Math.max(1,a),60);let r=null,u=performance.now();const g=1e3/a,C=()=>cancelAnimationFrame(r),L=x=>{r=window.requestAnimationFrame(L);const P=x-u;if(P<g)return;const B=P%g;u=x-B,d(C)};return d(C),L(u),C},pt=d=>d.offsetParent!==null||!!(d.offsetWidth||d.offsetHeight||d.getClientRects().length),Ss=d=>!pt(d),ft=(d,a)=>d.filter(r=>r.startsWith(a)).map(r=>r.substring(1)),Os=d=>{const a={},r=ft(d,"."),u=ft(d,"#");for(const g of d)r.length&&c(a,{className:r.join(" ")}),u.length&&c(a,{id:u[0]});return a},ut={CSS_ACTION_STATES:y,addClass:at,attr:$s,css:ot,cssActionStates:E,empty:ys,find:T,findBy:M,findOne:Y,hasClass:bs,htmlParse:rt,isVisible:pt,isHidden:Ss,make:vs,map:J,merge:ct,next:ms,parents:de,prev:hs,siblings:us,elemRects:lt,offset:gs,off:Cs,on:Es,trigger:ws,rmClass:We,tgClass:it,useTransition:dt,useCssAnimate:Ts,animateByFrame:xs,af:f,isArr:m,isStr:h,isObj:b,oa:c,toType:i},{addClass:ks,attr:Is,css:As,elemRects:Ls,offset:Ps,empty:mt,find:ht,findBy:Ds,findOne:Bs,map:$t,next:_s,prev:Ns,hasClass:He,htmlParse:bt,off:gt,on:vt,parents:Fs,siblings:Ms,trigger:Vs,rmClass:Rs,tgClass:Us}=ut,yt="Element is not defined with index: ";class N{elem=[];constructor(a,r){return h(a)?this.elem=ht(a,r):a instanceof N?this.elem=[...a.elem]:a&&(this.elem=m(a)?a:[a]),this}#e(a){let r=0,u;for(;u=this.elem[r];)a(u,r++)}#s(a,r=()=>""){if(h(a)){const u=this.elem[0];return r(u,a)}else this.#e(u=>r(u,a));return""}#t(a,r){if(r)this.#e(u=>{mt(u);const g=a(r);m(g)?u.append(...g):u.append(g)});else return this.elem[0];return null}find(a,r){if(h(a)){const u=this.elem.map(g=>ht(a,g)).flat();return new N(r?u.filter(r):u)}else return new N(this.map(a,!0))}findBy(a,r,u){const g=this.elem.map(C=>Ds(a,r,C)).flat();return new N(u?g.filter(u):g)}findOne(a){const r=this.elem.map(u=>Bs(a,u)).filter(Boolean);return new N(r)}filter(a){return new N(this.elem.filter(a))}toArray(){return[...this.elem]}map(a,r=!1){return $t(this.elem,a,r)}parents(a,r){r instanceof N&&(r=r.elem[0]);const u=$t(this.elem,g=>Fs(g,a,r));return new N(u.flat())}siblings(a,r=!1,u=0){return new N(Ms(this.elem[u],a,r))}next(a){return new N(_s(this.elem[0],a))}prev(a){return new N(Ns(this.elem[0],a))}get(a){const r=this.elem[a];if(r)return new N(r);console.warn(yt+a)}each(a){return this.#e(a),this}css(a){const r=this.#s(a,As);return r||this}addClass(a){return this.#e(r=>ks(r,a)),this}rmClass(a){return this.#e(r=>Rs(r,a)),this}tgClass(a,r){return this.#e(u=>Us(u,a,r)),this}hasClass(a,r="some"){return m(this.elem)?r==="some"?this.elem.some(u=>He(u,a)):this.elem.every(u=>He(u,a)):He(this.elem,a)}attr(a){const r=this.#s(a,Is);return r||this}#n(a=0,r){const u=this.elem[a];if(u)return r(u);console.warn(yt+a)}elemRects(a=0){return this.#n(a,Ls)}offset(a=0){return this.#n(a,Ps)}get hasEls(){return this.elem.length>0}get size(){return this.elem.length}empty(){return this.#e(mt),this}remove(){return this.#e(a=>a.remove()),this}insert(a,r="append"){return this.#e(u=>{const g=m(a)?a.map(Et).flat():h(a)?bt(a):Et(a);r==="append"&&u.append(...g),r==="prepend"&&u.prepend(...g),r==="after"&&u.after(...g),r==="before"&&u.before(...g)}),this}html(a){const r=this.#t(bt,a);return r?r.innerHTML.trim():this}text(a){const r=this.#t(u=>new Text(u),a);return r?r.textContent.trim():this}on(a,r,u=null,g=!1){if(m(a))for(const C of a)this.#e(L=>vt(L,C,r,u,g));else this.#e(C=>vt(C,a,r,u,g));return this}trigger(a,r,u){return this.#e(g=>Vs(g,a,r,u)),this}off(a,r=!1){if(m(a))for(const u of a)this.#e(g=>gt(g,u,r));else this.#e(u=>gt(u,a,r));return this}}const Et=d=>d instanceof N?d.elem:[d],je=(d,a)=>new N(d,a);return c(je,ut),je.BaseElem=N,je}))})(Q,Q.exports)),Q.exports}var Tt=wt();const l=Z(Tt),xt=p=>{let e={};return typeof p=="string"&&(e=JSON.parse(p.replace(/:\s*"([^"]*)"/g,function(s,t){return': "'+t.replace(/:/g,"@colon@")+'"'}).replace(/:\s*'([^']*)'/g,function(s,t){return': "'+t.replace(/:/g,"@colon@")+'"'}).replace(/(['"])?([a-z0-9A-Z_]+)(['"])?\s*:/g,'"$2": ').replace(/@colon@/g,":"))),e},{merge:St,toType:Ye,isArr:Ot,isStr:kt,oa:It,af:Ws}=l,z=document,fe=z.body,ue=p=>Ye(p)==="function",me=p=>p.offsetHeight,F=()=>{},V=(p,e,s)=>{const t=Ye(e)==="object"?e:{};return St([!0],{},p,t,s)},R=(p,e)=>xt(p.dataset[e+"Options"]),At=p=>p.replace(/-./g,e=>e.toUpperCase()[1]),Lt=p=>p.charAt(0).toLowerCase()+p.substring(1),Pt=()=>/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent),Ke=new WeakMap,w=(p,e,s)=>{const t=Ke.get(p)||Ke.set(p,{});if(Reflect.has(t,e)){if(s===null)return delete t[e],null;s&&(t[e]=s)}else s&&s!==null&&(t[e]=s);return t[e]},qe=(p,e=l,s=!1)=>{if(Ot(p))p.forEach(t=>qe(t,e,s));else{const t=p.pluginName,n=Lt(t),o=!!e.BaseElem,i=o?e.BaseElem.prototype:e.fn,c=(h,b,v)=>{const $=w(h,t);if(!$)w(h,t,new p(h,v,b));else{const y=$.handleUpdate&&l.toType($.handleUpdate)==="function";if(kt(v)){v==="remove"&&p.remove(h),v==="update"&&y&&$.handleUpdate();return}Dt($.params,v,s),l.merge($.params,v),y&&$.handleUpdate()}return $},f=function(h){const b=this;return o?b.each((v,$)=>{c(v,$,h)}):b.each(function(v,$){c($,v,h)})};f.getInstance=h=>w(h,t);const m={[n]:f};i[n]=m[n]}},Dt=(p,e,s=!0)=>{for(let t in e)({}).hasOwnProperty.call(p,t)||(s&&console.warn(`${t} is not a property that can be used`),delete e[t]);return s&&console.log("Params updated:",e),e},he="UrlState",G=new Map([["search",new URLSearchParams(location.search.replace("?",""))],["hash",new URLSearchParams(location.hash.replace("#",""))]]),$e=(p="replace")=>{let e="";const s=G.get("hash").toString(),t=G.get("search").toString();t!==""?e+="?"+t:e+=location.href.split(/(\?|\#)/)[0],s!==""&&(e+="#"+s),e=e.replace(/(\=\&)+/g,"&").replace(/\=$/,""),p==="replace"?history.replaceState(null,"",e):history.pushState(null,"",e)},Bt=(p,e)=>{const s=G.get("hash");for(const t of s.keys())s.delete(t);p!==null&&s.set(p,""),e&&$e(e)},_t=(p,e,s,t)=>{if(p==="hashVal"){console.warn("use 'setHashVal' method for setting only the hash val");return}const n=G.get(p);if(s===null)n.has(e)&&n.delete(e);else{const i=Array.isArray(s)?`[${s.join(",")}]`:s;n.set(e,i)}t&&$e(t)},Je=(p,e)=>{const s=G.get(p);if(p==="hashVal")return location.hash.replace("#","");if(s.has(e)){const t=s.get(e).trim();return t.slice(0,1)==="["&&t.slice(-1)==="]"?t.slice(1,-1).split(",").map(o=>/\D/.test(o)?o:+o):t}return null},Ze=(p=!0)=>{p?l(window).off(`popstate.${he}`).on(`popstate.${he}`,()=>{G.set("search",new URLSearchParams(location.search.replace("?",""))),G.set("hash",new URLSearchParams(location.hash.replace("#","")))}):l(window).off(`popstate.${he}`)},Nt=(p,e)=>{const s=G.get(p),t={pattern:"normal",brackets:!0},{pattern:n,brackets:o}=Object.assign(t,e),i=o?"[]":"";return n==="repeat"?[...s.keys()].map(c=>{const f=Je(p,c);return Array.isArray(f)?f.map(m=>`${c}${i}=${encodeURIComponent(m)}`).join("&"):`${c}=${f}`}).join("&"):s.toString()};Ze();const W={refresh:Ze,print:Nt,toUrl:$e,set:_t,setHashVal:Bt,get:Je},Ft=(p,e=60)=>{let s=null,t=performance.now();const n=1e3/e,o=()=>cancelAnimationFrame(s),i=c=>{s=window.requestAnimationFrame(i);const f=c-t;if(f<n)return;const m=f%n;t=c-m,p(o)};return i(t),o},Mt={immediate:!1,delay:100},be=(p,e="debounceResize",s=!1,t=100)=>{const o=[`resize${e!==""?`.${e}`:""}`];ge(window,o,p,{immediate:s,delay:t})},ge=(p,e,s,t)=>{const n=l(p),o={...Mt,...t};let i=null;n.on(e,(c,f)=>{clearTimeout(i),i=setTimeout(s,o.delay,c,f)}),o.immediate&&n.each(c=>{const f=new Event(typeof e=="string"?e:e[0]);setTimeout(s,0,f,c)})},Vt={linear:p=>p,easeInOutCubic:p=>p<.5?4*p*p*p:(p-1)*(2*p-2)*(2*p-2)+1,easeInOutQuart:p=>p<.5?8*p*p*p*p:1-8*--p*p*p*p,easeOutQuint:p=>1+--p*p*p*p*p},se="smoothScroll",Qe=[`wheel.${se}`,`touchstart.${se}`];let ve=!1;function ye(p,e=500,s="easeOutQuint",t){if(ve)return;let n=0;const o=window.scrollY,i=Math.abs(o-p),c=o<p?1:-1,f=1e3/60,m=e/f,h=i/m;if(i===0)return;ve=!0,fe.style.scrollBehavior="auto";const b=ue(s)?s:Vt[s],v=Ft(()=>{n+=h;const y=i*b(n/i),E=o+y*c;window.scroll(0,E),n>i&&$()}),$=()=>{ue(t)&&t(),v(),l(window).off([...Qe,`scroll.${se}`]),fe.style.scrollBehavior=null,ve=!1};l(window).on(Qe,$),ge(window,`scroll.${se}`,$)}const Rt={get(p){const e=p+"=",s=e.length,t=document.cookie.length;let n=0;for(;n<t;){let o=n+s;if(document.cookie.substring(n,o)==e)return Ut(o);if(n=document.cookie.indexOf(" ",n)+1,n==0)break}return""},set(p,e,s={}){const t=new Date;t.setTime(t.getTime()+(s.expires||0)*60*1e3);const n=s.expires?t.toUTCString():null;document.cookie=p+"="+encodeURI(e)+(n?"; expires="+n:"")+"; path="+(s.path?s.path:"/")+(s.domain?"; domain="+s.domain:"")+(s.sameSite?"; sameSite="+s.sameSite:"")+(s.secure||s.sameSite&&s.sameSite.toLowerCase()==="none"?"; secure":"")},remove(p,e,s){this.get(p)&&(document.cookie=p+"="+(e?"; path="+e:"")+(s?"; domain="+s:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT")}};function Ut(p){let e=document.cookie.indexOf(";",p);return e==-1&&(e=document.cookie.length),decodeURI(document.cookie.substring(p,e))}const zt={focusFirst:!0,nameSpace:"focusTrap",focusable:["button","a","input","select","textarea","[tabindex]"]},Xe=p=>{const e=l.isVisible(p)&&p.tabIndex!==-1,s=p.nodeName.toUpperCase();return s==="BUTTON"||s==="INPUT"?e&&!p.disabled:e&&p.style.pointerEvents!=="none"},Ee=(p,e)=>{const s=document,t=s.body,{focusFirst:n,focusable:o,nameSpace:i}={...zt,...e},c=l(p),f=typeof o=="string"?o:o.join(","),m=c.find(f).filter(Xe);let h=m.hasEls?m.elem[0]:null;return n&&h&&h.focus(),l(t).on(`keydown.${i}`,function(b){const v=c.find(f).filter(Xe);if(!v.hasEls)return;const $=s.activeElement,y=v.elem[v.size-1],E=b.key==="Tab";h=v.elem[0],E&&($.nodeName.toUpperCase()==="BODY"&&(h&&h.focus(),b.preventDefault()),b.shiftKey?$&&h&&s.activeElement===h&&(y&&y.focus(),b.preventDefault()):$&&y&&$===y&&(h&&h.focus(),b.preventDefault()))}),{remove:()=>{l(t).off(`keydown.${i}`)}}},I={esc:"Escape",left:"ArrowLeft",right:"ArrowRight",down:"ArrowDown",up:"ArrowUp",enter:"Enter",shift:"Shift",space:"Space",tab:"Tab"},Wt="1.3.0",Ce="AccessibleMenu",H="accessibleMenu",Ht={keyDirections:["horizontal","vertical","vertical"],focusCss:"focus",focusInElems:"a, [tabindex]",focusLeaveElems:"a, [tabindex], select, button"};class we{static defaults=Ht;static version=Wt;static pluginName=Ce;element;$element;params;$aeLiParents=null;activeElem=null;focusInElems="";constructor(e,s){const t=this,n=R(e,H);return t.element=e,t.$element=l(e),t.params=V(we.defaults,s,n),t.#t(),t}static remove(e,s){l(e).each(t=>{(s||w(t,Ce)).$element.off([`focusin.${H}`,`mouseleave.${H}`,`blur.${H}`,`keydown.${H}`]),w(t,Ce,null)})}#e(e){const s=this,t=s.params,n=s.$aeLiParents.elem.length-1,o=e.key,i=t.keyDirections;(o===I.left&&i[n]==="horizontal"||o===I.up&&i[n]==="vertical"||o===I.left&&i[n]==="vertical"&&n>1&&i[n-1]==="vertical"&&s.$aeLiParents.hasEls)&&(s.#o(!0),e.preventDefault())}#s(e){const s=this,t=s.params,n=s.$aeLiParents.size-1,o=s.$aeLiParents.size===1,i=e.key,c=i===I.right&&t.keyDirections[n],f=i===I.down&&t.keyDirections[n],m=s.activeElem.closest("li"),h=l(m).siblings("li",!0),b=h.elem.at(-1)===m,v=o&&b;if((c==="horizontal"||f==="vertical")&&(v||(s.#o(!1),e.preventDefault())),i===I.esc&&v&&l(s.activeElem.closest("li")).rmClass(t.focusCss),c==="vertical"||f==="horizontal"){const $=l(s.activeElem.closest("li")).findOne("ul");s.#n($),e.preventDefault()}}#t(){const e=this,s=e.params,t=e.$element.findBy("tag","li"),n=t.toArray();let o=null;e.$element.on(`focusin.${H}`,()=>{e.activeElem=document.activeElement,o&&clearTimeout(o),l(e.activeElem.closest("li")).addClass(s.focusCss).siblings("li").rmClass(s.focusCss)},n).on(`focusout.${H}`,()=>{o=setTimeout(()=>t.rmClass(s.focusCss),200)}).on(`mouseleave.${H}`,()=>{t.rmClass(s.focusCss)}).on(`keydown.${H}`,i=>{e.$aeLiParents=l(e.activeElem).parents("li",e.element),i.key==I.esc&&e.#n(e.$aeLiParents),e.#e(i),e.#s(i)})}#n(e,s=!1,t=0){if(!e.hasEls)return;const n=this,o=n.params,i=e.find(o.focusInElems,l.isVisible);if(i.hasEls){const c=i.elem[t];l(c.closest("li")).tgClass(o.focusCss,!s),c.focus()}}#o(e){const s=this,t=s.params,n=s.activeElem.closest("li"),o=e?n.previousElementSibling:n.nextElementSibling,i=l(n),c=l(o);if(c.hasEls)s.#n(c,e);else{const f=s.$aeLiParents.size>2?-2:0;i.rmClass(t.focusCss),s.#n(l(s.$aeLiParents.elem.at(f)),e)}}}const jt="4.0.0",ne="Collapse",K="collapse",Gt={cssPrefix:"collapse",toggleDuration:500,toggleGroup:!1,moveToTopOnOpen:!1,moveToTopOffset:0,moveToTopDuration:500,urlFilterType:"hash",historyType:"replace",locationFilter:null,loadLocation:!0,afterOpen:F,afterClose:F,afterInit:F};class Te{$element;element;params;toggling;$btnElems;btnElems;$activeItem;initLoaded;static defaults=Gt;static version=jt;static pluginName=ne;#e=l.useTransition();constructor(e,s,t){const n=this;n.element=e,n.$element=l(e);const o=R(e,K);return n.params=V(Te.defaults,s,o),n.toggling=!1,n.$btnElems=n.$element.find(`.${n.params.cssPrefix}__btn`).attr({"aria-expanded":"false"}),n.btnElems=n.$btnElems.toArray(),n.$activeItem=null,n.initLoaded=!1,n.#t(),n.#s(),n.params.afterInit(e),w(e,ne,n),n}static remove(e,s){l(e).each(t=>{(s||w(t,ne)).$element.off([`click.${K}`,`[${K}]`]),l(window).off(`popstate.${K}`),w(t,ne,null)})}#s(){const e=this,{cssPrefix:s}=e.params;e.$element.on([`click.${K}`,`[${K}]`],function(t,n){const o=l(n).attr("aria-controls")||n.hash.substring(1);e.toggle(o),t.preventDefault()},`.${s}__btn`),l(window).on(`popstate.${K}`,t=>{e.params.historyType==="push"&&(e.#t(),e.initLoaded=!0,t.preventDefault())})}#t(){const e=this,s=e.params,t=n=>{const o=`${s.cssPrefix}--open`,i=e.$element.find("#"+n);i.elem.length&&(e.$activeItem=i,e.$activeItem.addClass(o),e.$btnElems.filter(c=>l(c).attr("aria-controls")===n).attr({"aria-expanded":"true"}))};if(s.locationFilter!==null&&s.loadLocation&&s.urlFilterType!=="none"){const n=W.get(s.urlFilterType,s.locationFilter),o=`${s.cssPrefix}--open`;e.$element.find(`.${s.cssPrefix}__body.${o}`).rmClass(o),e.$btnElems.attr({"aria-expanded":"false"}),n&&(Array.isArray(n)?n.forEach(t):t(n))}}#n(){const e=this,s=e.params;if(e.$activeItem){const t=e.$activeItem.map(o=>o.closest(`.${s.cssPrefix}__item`)),n=typeof s.moveToTopOffset=="function"?s.moveToTopOffset():s.moveToTopOffset;if(t.length&&s.moveToTopOnOpen){const o=t[0].getBoundingClientRect().top+window.scrollY-n;ye(o,s.moveToTopDuration)}}}toggle(e,s=!1){const t=this,n=t.params,o=l.findOne("#"+e,t.element);if(t.toggling&&!s||e===null||!o)return;t.$activeItem=t.$element.find("#"+e);const i=`${n.cssPrefix}--`,c=`${i}open`,f=`${i}toggling`,m=`${i}opening`,h=`${i}closing`,b=`.${n.cssPrefix}__body.${c}`,v=t.$element.find(b),$=v.filter(T=>n.toggleGroup||T.id===e),y=t.$activeItem.hasClass(c);$.each(T=>l.css(T,{height:T.scrollHeight+"px"}));const E=()=>{if(t.toggling=!0,t.$btnElems.each(T=>{const Y=l(T),J=Y.attr("aria-controls")===e,de=Y.attr("aria-expanded")==="false";n.toggleGroup?Y.attr({"aria-expanded":(J&&de)+""}):J&&Y.attr({"aria-expanded":de+""})}),$.rmClass(c).addClass([f,h]).each(T=>me(T)).css({height:"0px"}),!y){const T=o.scrollHeight+"px";t.$activeItem.addClass([f,m]).css({height:T})}},M=()=>{if(t.toggling=!1,$.rmClass([f,h]).css({height:null}),t.params.afterClose(t.btnElems,$.toArray()),y||t.$activeItem.addClass(c).rmClass([f,m]).css({height:null}),n.urlFilterType!=="none"){const T=t.$element.find(b).map(J=>J.id),Y=T.length===1?T[0]:T.length>0?T:null;W.set(n.urlFilterType,n.locationFilter,Y,n.historyType)}t.params.afterOpen(t.btnElems,t.$activeItem.toArray()),t.#n()};t.#e(E,M,t.params.toggleDuration)}}const Yt="2.0.1",xe="LazyLoad",Kt="lazyLoad",qt={imgSrcName:"src",bgSrcName:"bgSrc",loadImgs:!0,inEvt:null,outEvt:null,force:!1,observerID:null,unobserve:!0,observerOpts:{rootMargin:"48px"}},oe=new Map;class Se{element;params;lazyElemObserver;static defaults=qt;static version=Yt;static pluginName=xe;constructor(e,s){const t=this,n=R(e,Kt);return t.element=e,t.lazyElemObserver,t.params=V(Se.defaults,s,n),t.#s(),t}static remove(e,s){l(e).each(t=>{const n=s||w(t,xe);oe.delete(n.params.observerID),n.lazyElemObserver.unobserve(t),w(t,xe,null)})}#e(e,s){const{imgSrcName:t,bgSrcName:n}=e.params,o=s.dataset[t],i=s.dataset[n];s.loading==="lazy"&&(s.loading="eager"),o&&(s.src=o),i&&(s.style.backgroundImage=`url("${i}")`,s.removeAttribute("data-bg-src"))}#s(){const e=this,{observerID:s}=e.params;s&&!oe.has(s)?(oe.set(s,e.#t()),e.lazyElemObserver=oe.get(s)):e.lazyElemObserver=e.#t(),s||console.warn("Its recommended to set an 'observerID', so the element group can leverage the same one.",e.element),e.lazyElemObserver.observe(e.element)}#t(){const e=this,{observerOpts:s}=e.params;return new IntersectionObserver(function(t){t.forEach(function(n){const{inEvt:o,outEvt:i,force:c,unobserve:f,loadImgs:m}=e.params,h=n.target;h instanceof HTMLElement&&(n.isIntersecting&&l.isVisible(h)||c?(m&&e.#e(e,h),typeof o=="function"&&o(h,n),f&&e.lazyElemObserver.unobserve(h)):typeof i=="function"&&i(h,n))})},s)}}const Oe=(p,e)=>{if(p.locationFilter!==null&&p.loadLocation&&p.urlFilterType!=="none"){const s=W.get(p.urlFilterType,p.locationFilter);s&&e(s)}},Jt="1.2.0",et="modal",ae="Modal",Zt={enableEvent:"click",appendTo:document.body,ariaLabelledby:null,ariaLabel:null,cssPrefix:"modal",closeBtnIconCss:"ico i-close",closeBtnLabel:"Close",closeOutDelay:250,focusInDelay:0,backDropClose:!0,fromDOM:!1,modalCss:null,modalID:null,src:"",urlFilterType:"hash",historyType:"replace",locationFilter:"modal",loadLocation:!0,onOpenOnce:F,onOpen:F,onClose:F,afterClose:F},ie=(p,e)=>{p&&typeof p=="function"&&p(e)};class ke{element;params;modalID;components;modalEvent;focusTrapped;enabledElem;openedOnce;domMarker;cssList;static defaults=Zt;static version=Jt;static pluginName=ae;constructor(e,s){const t=this;t.element=e;const n=R(e,et),o=V(ke.defaults,s,n),{cssPrefix:i}=o;return t.params=o,t.modalID=t.params.modalID,t.modalEvent=et+"_"+t.modalID,t.focusTrapped,t.enabledElem,t.openedOnce=!1,t.cssList={show:i+"--show",dismissing:i+"--dismissing",open:i+"-open",btnDismiss:i+"__btn-dismiss",dialog:i+"__dialog",dialogContent:i+"__dialog-content",backdrop:i+"__backdrop",marker:i+"-content-placemarker"},t.components=t.#t(),t.domMarker=l.make(`span.${t.cssList.marker}-content-placemarker#${t.modalID}__marker`),t.#e(),Oe(t.params,c=>{c===t.modalID&&(t.components.show?t.close():t.#s())}),w(e,ae,t),t}static remove(e,s){l(e).each(t=>{const n=s||w(t,ae),o=n.params,{backdrop:i,closeBtn:c}=n.components;n.components.show&&n.components.close(),l(n.element).off(`${n.params.enableEvent}.${n.modalEvent}`),l(c).off(`click.${n.modalEvent}Dismiss`),o.backDropClose&&l(i).off(`click.${n.modalEvent}Dismiss`),l(document).off([`keydown.${n.modalEvent}Dismiss`,`[${n.modalEvent}Dismiss]`]),l(window).off([`popstate.${n.modalEvent}`,`[${n.modalEvent}]`]),w(t,ae,null)})}#e(){const e=this;l(e.element).on(`${e.params.enableEvent}.${e.modalEvent}`,s=>{e.#s(),s.preventDefault()})}#s(){const e=this;e.#n(),l(document).on(`keydown.${e.modalEvent}Dismiss`,function(s){(s.code||s.originalEvent.key)==="Escape"&&(e.close(),s.preventDefault())}),l(document).on(`[${e.modalEvent}Dismiss]`,e.close)}#t(){const{make:e}=l,s=this,t=s.params,n=s.cssList,o=t.cssPrefix+(t.modalCss?" "+t.modalCss:""),i=t.ariaLabelledby||s.element.dataset.ariaLabelledby||null,c=e(`div.${o}`,{id:s.modalID,ariaLabel:t.ariaLabel||s.element.dataset.ariaLabel||null}),f=e(`button.${n.btnDismiss}`,{type:"button",ariaLabel:t.closeBtnLabel},`<i class="${t.closeBtnIconCss}"></i>`),m=e(`div.${n.dialogContent}`),h=e(`div.${n.dialog}`),b=e(`div.${n.backdrop}`),v=l(s.params.src||s.element.hash||s.element.dataset.modalSrc);return c.setAttribute("aria-labelledby",i),l(h).insert([f,m]),l(c).insert([b,h]),{backdrop:b,content:v.elem,contentAppended:!1,dialog:h,dialogContent:m,closeBtn:f,id:s.modalID,modal:c,close:()=>s.close(),show:!1}}#n(){const e=this,{backdrop:s,closeBtn:t,content:n,modal:o}=e.components,i=e.params,c=l(o);e.enabledElem=document.activeElement,i.fromDOM&&l(n).insert(e.domMarker,"after"),e.components.contentAppended||(l(e.components.dialogContent).insert(n),l.oa(e.components,{contentAppended:!0})),l(i.appendTo).insert(o),l(t).on(`click.${e.modalEvent}Dismiss`,()=>e.close()),i.backDropClose&&l(s).on(`click.${e.modalEvent}Dismiss`,()=>e.close()),ie(i.onOpen,e.components),e.openedOnce||(ie(i.onOpenOnce,e.components),e.openedOnce=!0),c.attr({role:"dialog","aria-modal":"true"}).each(f=>me(f)).addClass(e.cssList.show),l.oa(e.components,{show:!0}),i.focusInDelay!==null&&setTimeout(()=>{e.focusTrapped=Ee(c,{nameSpace:At(e.modalID)})},i.focusInDelay),l(i.appendTo).addClass(e.cssList.open).css({overflow:"hidden",paddingRight:"0px"}),i.urlFilterType!=="none"&&W.set(i.urlFilterType,i.locationFilter,e.modalID,i.historyType)}close(){const e=this,s=e.params,{backdrop:t,closeBtn:n,content:o,modal:i}=e.components,c=l(i);ie(s.onClose,e.components),c.addClass(e.cssList.dismissing).rmClass(e.cssList.show),l(n).off(`click.${e.modalEvent}Dismiss`),s.backDropClose&&l(t).off(`click.${e.modalEvent}Dismiss`),l(document).off([`keydown.${e.modalEvent}Dismiss`,`${e.modalEvent}Dismiss`]),s.urlFilterType!=="none"&&W.set(s.urlFilterType,s.locationFilter,null,s.historyType),setTimeout(()=>{c.attr({role:"dialog","aria-modal":""}).rmClass(e.cssList.dismissing).css({display:""}),l(s.appendTo).rmClass(e.cssList.open).css({overflow:null,paddingRight:null}),s.focusInDelay!==null&&e.focusTrapped.remove(),e.enabledElem&&e.enabledElem instanceof HTMLElement&&e.enabledElem.focus(),s.fromDOM&&(l(e.domMarker).insert(o,"after").remove(),l.oa(e.components,{contentAppended:!1})),ie(s.afterClose,e.components),c.remove(),l.oa(e.components,{show:!1})},s.closeOutDelay)}}const Qt="2.0.0",Ie="NavDesktop",j="navDesktop",Xt={stopWidth:768,delay:800,navLeavingDelay:800,outerElem:document.body,cssPrefix:"menu",hoverCss:"hover"};class Ae{element;params;cssList;stayHover;navLeaving;static defaults=Xt;static version=Qt;static pluginName=Ie;constructor(e,s){const t=this;t.stayHover,t.navLeaving,t.element=e;const n=R(e,j);t.params=V(Ae.defaults,s,n);const{cssPrefix:o}=t.params;return t.cssList={hasUL:`${o}__has-ul`,noUl:`${o}__no-ul`,elemEdge:`${o}__on-edge`,hovered:`${o}--hover`,leaving:`${o}--leaving`},t.#e(),t.#s(),t}static remove(e,s){l(e).each(t=>{const n=s||w(t,Ie),o=l(n.element);o.find("ul").off([`mouseover.${j}`,`focusin.${j}`,`focusout.${j}`]),o.off(`mouseout.${j}`),w(t,Ie,null)})}#e(){const e=this,s=e.cssList;l("li",e.element).each((n,o)=>{const i=l(n),f=i.find("ul").hasEls?s.hasUL:s.noUl;i.addClass(f)})}#s(){const e=this,s=e.cssList,t=e.params,n=l(e.element).findOne("ul"),o=l(t.outerElem),i=l(e.element),c=i.find("li, ul"),f=c.toArray();let m=null;const h=(b,v,$)=>{const y=v.type,E=v.target,M=b.isSameNode(E)||b.contains(E);(!m||m!==y&&M)&&(m=y,$())};n.on([`mouseover.${j}`,`focusin.${j}`],(b,v)=>{h(v,b,()=>{const $=l(v),y=$.parents("li");c.rmClass([t.hoverCss,s.elemEdge]),y.addClass(t.hoverCss),$.addClass(t.hoverCss),e.#t(b.target),e.navLeaving&&clearTimeout(e.navLeaving),e.stayHover&&clearTimeout(e.stayHover),o.addClass(s.hovered).rmClass(s.leaving)})},f),n.on([`mouseout.${j}`,`focusout.${j}`],(b,v)=>{h(v,b,()=>{e.stayHover=setTimeout(()=>{i.find(`.${t.hoverCss}`).rmClass([t.hoverCss,s.elemEdge]),i.find(`.${s.elemEdge}`).rmClass(s.elemEdge),o.rmClass(s.hovered).addClass(s.leaving),e.navLeaving=setTimeout(()=>{o.rmClass(s.leaving)},t.navLeavingDelay)},t.delay)})},f)}#t(e){const s=this,t=s.cssList,n=e.closest("li"),{innerWidth:o,pageXOffset:i}=window;if(s.params.stopWidth<o){const c=l.findOne("ul",s.element);if(c){const f=l.elemRects(c),m=f.left+i,h=c.scrollWidth;m+h<=o||n.classList.add(t.elemEdge)}}}}const es="3.0.0",Le="NavMobile",D="navMobile",ts={enableBtn:"#mobile-nav-btn",ariaLabel:"Toggle site navigation",tgBtnText:"toggle menu",insertBtnAfter:"a",slideDuration:400,outerElement:fe,outsideClickClose:!0,animateHeight:!0,cssPrefix:"menu",menuBtnCss:"i i-arrow-b",menuBtnSkip:!1,afterNavItemOpen:F,afterNavItemClose:F,afterOpen:F,afterClose:F,doTrapFocus:!0,trapFocusElem:null,stopPropagation:!0,bkptEnable:null};class Pe{$element;element;params;menuOpened;allowClick;cssList;$enableBtn;enableBtn;static defaults=ts;static version=es;static pluginName=Le;#e=l.useTransition();constructor(e,s){const t=this,n=R(e,D);t.$element=l(e),t.element=e,t.params=V(Pe.defaults,s,n),t.$enableBtn=l(t.params.enableBtn),t.enableBtn=t.$enableBtn.elem[0];const{cssPrefix:o,menuBtnCss:i}=t.params;t.cssList={outerOpen:`${o}--outer-active`,open:`${o}--active`,opening:`${o}--starting`,closing:`${o}--ending`,toggling:`${o}--toggling`,hasUl:`${o}__has-ul`,noUl:`${o}__no-ul`,btn:`${o}__btn-tg ${i}`},t.#a(),t.#s(),t.#l();const c=e.id||e.className;return t.$enableBtn.attr({"aria-controls":c,"aria-label":t.params.ariaLabel}),t}#s(){const e=this,s=e.params,t=e.cssList,n=l(s.enableBtn);n.attr({"aria-expanded":"false"}).on([`click.${D}`,`[${D}]`],function(o){e.allowClick&&(e.#t(),o.stopPropagation(),o.preventDefault())}),l(document).on(`keydown.${D}`,o=>{o.code===I.esc&&e.$element.hasClass(t.open)&&e.allowClick&&(e.#t(),n.hasEls&&n.elem[0].focus())}),e.#n(),e.#o()}#t(){const e=this,s=e.params,t=e.cssList;let n=null;const o=e.$element.find(m=>m.parentElement),i=e.menuOpened,c=[i?t.closing:t.opening,t.toggling],f=l(s.outerElement);e.#e(()=>{e.menuOpened=!i,e.$element.addClass(c),l(s.enableBtn).attr({"aria-expanded":!i+""}),f.tgClass(t.outerOpen,!i).addClass(c),i?(o.find(`.${t.open}`).rmClass(t.open).find("[style]").css({display:null}),n&&n.remove()):s.doTrapFocus&&(n=Ee(s.trapFocusElem||e.$element,{nameSpace:D}))},()=>{f.rmClass(c),e.$element.rmClass(c),i||e.$element.addClass(t.open),(i?s.afterClose:s.afterOpen)(e.element,f.toArray(),e.enableBtn)},s.slideDuration)}#n(){const e=this,s=e.params,t=e.cssList;e.$element.on([`click.${D}`,`[${D}]`],function(n,o){const i=o.closest(`.${t.hasUl}`);if(!e.allowClick||!i)return;const c=l(i),f=c.find("ul").get(0),m=c.hasClass(t.open),h=[t.toggling,m?t.closing:t.opening];e.allowClick=m,e.#e(()=>{if(c.addClass(h).tgClass(t.open,!m),f.addClass(h).tgClass(t.open,!m),s.animateHeight){const b=f.hasEls?f.elem[0].scrollHeight:0,v=m?0:b;f.css({height:(m?b:0)+"px"}).each($=>me($)).css({height:v+"px"})}},()=>{c.rmClass(h).tgClass(t.open,!m),f.rmClass(h).tgClass(t.open,!m).css({height:null});const b=c.toArray();m?s.afterNavItemClose(b):s.afterNavItemOpen(b),e.allowClick=!0},s.slideDuration),n.stopPropagation()},`.${t.btn.replace(/\s/g,".")}`),e.$element.on([`click.${D}`,`[${D}]`],(n,o)=>{e.params.stopPropagation&&n.stopPropagation()},"a")}#o(){const e=this;l(document.body).on(`click.${D}`,s=>{if(e.params.outsideClickClose){if(!e.menuOpened)return;!e.$element.elem[0].contains(s.target)&&e.menuOpened&&e.#t()}})}#a(){const e=this,s=e.params,t=e.cssList;l("li",e.element).each((o,i)=>{const c=l(o),f=c.findBy("tag","ul"),m=f.hasEls?t.hasUl:t.noUl,h=o.nextElementSibling;if(c.addClass(m),!f.hasEls)return;if(!(ue(s.menuBtnSkip)?s.menuBtnSkip(o):s.menuBtnSkip)){const v=c.find(s.insertBtnAfter).get(0);if(!(h?l(h).hasClass(t.btn):!1)){const y=l.make(`button.${t.btn}`,{type:"button",ariaLabel:s.tgBtnText});v.insert(y,"after")}}})}#l(){const e=this,s=e.params;be(()=>{const t=typeof s.bkptEnable=="number";e.allowClick=t?window.innerWidth<=s.bkptEnable:e.$enableBtn.hasEls?l.isVisible(e.$enableBtn.elem[0]):!1},D,!0,200)}static remove(e,s){l(e).each(t=>{const n=s||w(t,Le);l(document).off(`keydown.${D}`),l(n.params.enableBtn).off([`click.${D}`,`[${D}]`]),n.$element.off([`click.${D}`,`[${D}]`]),l(document.body).off(`click.${D}`),l(window).off([`resize.${D}`,`[${D}]`]),w(t,Le,null)})}}const ss="2.0.1",De="Parallax",tt="parallax",ns={speed:7,zSpeed:5,cssPrefix:"parallax",axis:"y",scrollAxis:"y",zAxis:!1,relativeElem:!1,bgFill:!1,rootMargin:0,scrollMaxPxStop:5e3,zScrollMaxPxStop:2e3,minWidth:null,maxWidth:null};class Be{params;zInitOffset;index;instanceEvent;$window;$element;element;elementOffset;$relElem;winHeight;winWidth;elemHeight;elemWidth;speed;zSpeed;fillAmount;bgFill;bgFillProp;axis;zAxis;scrollMaxPxStop;zScrollMaxPxStop;rootMargin;lastZSpeed;lastCssInProps;minWidthIfSet;maxWidthIfSet;effectCleared;cssPrevDir;static defaults=ns;static version=ss;static pluginName=De;constructor(e,s,t){const n=this,o=R(e,tt);return n.$window=l(window),n.$element=l(e),n.element=e,n.params=V(Be.defaults,s,o),n.zInitOffset=0,n.index=t,n.instanceEvent=tt+t,n.$relElem=n.#a,n.cssPrevDir=[],n.#s(),n.#e(),n}#e(){const e=this;be(()=>{e.#s(),e.parallax(e)},`[${e.instanceEvent}_resize]`,!0),l(window).on([`scroll.${e.instanceEvent}`,`[${e.instanceEvent}]`],()=>{window.requestAnimationFrame(()=>{e.parallax(e)})}).trigger(e.instanceEvent)}#s(){const e=this,s=e.#n,t=e.#o,{cssPrefix:n}=e.params,o=`${n}--${e.params.axis}-${t>0?"pos":"neg"}`,i=e.params.zAxis?`${n}--z-${t>0?"pos":"neg"}`:"",c=i?[o,i]:o,f=e.params.rootMargin;e.$element.css({transform:null,height:null,width:null}),e.cssPrevDir&&e.$element.rmClass(e.cssPrevDir),e.$element.addClass(c);const m=e.$relElem.elem[0];e.cssPrevDir=c,e.winHeight=window.innerHeight,e.winWidth=window.innerHeight,e.elemHeight=m.scrollHeight,e.elemWidth=m.scrollWidth,e.speed=s,e.zSpeed=t,e.fillAmount=e.#t,e.bgFill=e.params.bgFill,e.axis=e.params.axis,e.bgFillProp=e.axis==="y"?"height":"width",e.zAxis=e.params.zAxis,e.$relElem=e.#a,e.scrollMaxPxStop=e.params.scrollMaxPxStop,e.zScrollMaxPxStop=e.params.zScrollMaxPxStop,e.lastZSpeed=0,e.rootMargin=typeof e.params.rootMargin=="number"?[f,f]:f,e.minWidthIfSet=e.params.minWidth?e.winWidth>e.params.minWidth:!0,e.maxWidthIfSet=e.params.maxWidth?e.winWidth<e.params.maxWidth:!0,e.elementOffset=e.getElementRects(),e.lastCssInProps&&e.$element.css(e.lastCssInProps)}getElementRects(){const e=this,s=e.$element.elemRects(),t=s.top+window.scrollY,n=s.left+window.scrollX,o=t+e.elemHeight,i=n+e.elemWidth;return{top:t,left:n,bottom:o,right:i}}parallax(e){const{scrollAxis:s}=e.params,[t,n]=e.rootMargin,o=e.minWidthIfSet&&e.maxWidthIfSet,i=s==="y",c=i?e.elementOffset.top:e.elementOffset.left,f=(i?e.winHeight:e.winWidth)-t,m=i?window.scrollY:window.scrollX,h=c>f?f-c+m:c+(m-c);if(e.isInView(i,h,m,n)&&o){const b=h*e.speed,v=h*e.zSpeed,$=b<e.zScrollMaxPxStop?b:e.zScrollMaxPxStop,y=e.params.zAxis?e.lastZSpeed<e.zScrollMaxPxStop?v:e.lastZSpeed:0,M={transform:`translate3d(${e.axis==="y"?`0, ${$}px, ${y}px`:`${$}px, 0, ${y}px`})`,[e.bgFillProp]:e.bgFill?`calc(100% + ${e.fillAmount}px)`:null};e.lastZSpeed=y,e.lastCssInProps=M,e.$element.css(M)}}isInView(e,s,t,n){const o=this,i=e?o.elementOffset.bottom:o.elementOffset.right;return t+n<=i&&s>=0}get#t(){const e=this,s=e.params.scrollAxis==="y";return(e.params.axis==="y"?e.winHeight:e.winWidth+(s?0:e.elemWidth))*Math.abs(e.speed)}get#n(){return this.params.speed/100}get#o(){return this.params.zSpeed/100}get#a(){const e=this,{relativeElem:s}=e.params;return s||e.$element}static remove(e,s){l(e).each(t=>{const n=s||w(t,De);l(window).off([`scroll.${n.instanceEvent}`,`resize.${n.instanceEvent}`,`[${n.instanceEvent}_resize]`,`[${n.instanceEvent}`]),n.$element.css({transform:null,height:null,width:null}).rmClass(n.cssPrevDir),w(t,De,null)})}}const os="1.0.1",_e="ScrollSpy",Ne="scrollSpy",as={observerOptions:{rootMargin:"0px",threshold:1},cssPrefix:"scroll-spy",spyNavElems:"a",spyBody:".scroll-spy-body",spyElems:"h2",scrollBehavior:"smooth",scrollDuration:500,setActiveCssToLi:!0,locationFilter:null,urlFilterType:"hash",historyType:"push",loadLocation:!0};class Fe{#e=new Map;inViewEntries=new Set;backUpInViewEntry;#s=null;#t=null;params;element;$spyBody;spyContents;static defaults=as;static version=os;static pluginName=_e;constructor(e,s){const t=this,n=R(e,Ne);return t.element=e,t.params=V(Fe.defaults,s,n),t.$spyBody=l(t.params.spyBody),t.spyContents=t.$spyBody.find(t.params.spyElems,o=>l.isVisible(o)&&!!o.id).toArray(),t.spyContents.length>0?(l(e).addClass(`${t.params.cssPrefix}-nav`),t.$spyBody.addClass(`${t.params.cssPrefix}-body`),t.#s=t.spyContents[t.spyContents.length-1],t.backUpInViewEntry=t.#o(),t.#a(),t.#n()):console.warn("there is nothing to spy, check your 'spyBody' for those elements",t.params.spyBody),t}#n(){const e=this,s=e.params,t=n=>{e.#l(n),e.#r()};Oe(s,n=>{e.scrollToElement(n,"instant")}),e.#t=new IntersectionObserver(t,s.observerOptions);for(const n of e.spyContents)e.#t.observe(n);l(e.element).on(`click.${Ne}`,(n,o)=>{const i=o,c=(i.nodeName==="A"?i.hash:i.dataset.hash).replace(/^\#/,"");e.scrollToElement(c,s.scrollBehavior).hasEls&&(typeof s.urlFilterType=="string"&&s.locationFilter&&(s.urlFilterType==="hashVal"?W.setHashVal(c,s.historyType):(s.urlFilterType==="hash"||s.urlFilterType==="search")&&W.set(s.urlFilterType,s.locationFilter,c,s.historyType)),n.preventDefault())},s.spyNavElems)}scrollToElement(e,s){const t=this,n=t.params,o=n.observerOptions.root||window,i=parseFloat(n.observerOptions.rootMargin.split(" ")[0])||0,c=l(e?"#"+e:z.body);if(c.hasEls){const f=c.offset().top-i;s==="smooth"?ye(f,n.scrollDuration):o.scrollTo({top:f,behavior:s})}return c}#o(){const s=this.spyContents.map(t=>({el:t,top:t.getBoundingClientRect().top})).sort((t,n)=>t.top<n.top?-1:1);for(let t=0,n=s.length;t<n;t++){const o=s[t],i=s[t-1];if(o.top>=0)return i?i.el:o.el}}#a(){const e=this,{spyNavElems:s,setActiveCssToLi:t}=e.params;l(e.element).find(s).each(n=>{const o=n,i=n.nodeName==="A"?o.hash:o.dataset.hash;if(i){const c=e.spyContents.find(f=>f.id&&f.id===i.replace("#",""));if(c){const f=t&&o.closest("li")||o;e.#e.set(c,f),e.#e.set(o,c)}}})}#l(e){const s=this;for(const t of e){const n=t.target;t.isIntersecting?s.inViewEntries.add(n):s.inViewEntries.has(n)&&(s.backUpInViewEntry=n,s.inViewEntries.delete(n),s.#i(n,"remove"))}}#i(e,s){const t=this,{cssPrefix:n}=t.params,o=t.#e.get(e);o&&(o.classList[s](`${n}-nav__active`),e.classList[s](`${n}-body__active`))}#r(){const e=this,s=e.inViewEntries.size>0,t=s?[]:[e.backUpInViewEntry];for(const n of e.inViewEntries)if(t.length){const o=n.getBoundingClientRect().top;for(let i=0,c=t.length;i<c;i++){const f=t[i],m=f.getBoundingClientRect().top;if(o<m&&o>=0&&(t.splice(i,1,n),e.#i(f,"remove")),e.#s.isSameNode(n)){const b=z.body.scrollHeight-window.scrollY;window.innerHeight>b&&t.push(n)}o===m&&t.push(n)}}else t.push(n);s&&e.#i(e.backUpInViewEntry,"remove");for(const n of t)e.#i(n,"add");if(e.params.callback){const n=t.map(o=>e.#e.get(o));e.params.callback(t,n)}}static remove(e,s){l(e).each(function(){const t=s||w(this,_e);for(const n of t.spyContents)t.#i(n,"remove");l(t.element).off(`click.${Ne}`).rmClass(`${t.params.cssPrefix}-nav`),t.$spyBody.rmClass(`${t.params.cssPrefix}-body`),t.#t.disconnect(),w(this,_e,null)})}}const is="3.0.1",S="selectEnhance",le="SelectEnhance",ls={cssPrefix:"select-enhance",cssListModifer:null,mobileNative:!1,emptyValAsPlaceholder:!0,focusIn:F,focusOut:F,beforeChange:F,afterChange:F,blurDuration:250,typeAheadDuration:500,observeSelectbox:!0,listAppendToSelect:!1},{make:X,findBy:rs}=l,st=Pt();let nt=null;class q{$select;select;params;index;id;selectId;isReadOnly;$label;$selectEnhance;selectEnhance;$textInput;textInput;$selectList;selectList;optionSet;listPosTop;optionsShown;selectboxObserver;selectListBoxInFullView;keyedInput;posTimeout;bodyCloseEvt;toggling;static defaults=ls;static version=is;static pluginName=le;constructor(e,s,t){const n=this,o=R(e,S);return n.index=t,n.$select=l(e),n.select=e,n.id=n.$select.attr("id")||n.$select.attr("name")||"select_enhance_"+t,n.selectId=n.id+"_enhance",n.$label=l(`label[for="${n.id}"]`),n.optionSet=new WeakMap,n.toggling=!1,n.optionsShown=!1,n.listPosTop=!1,n.selectboxObserver,n.selectListBoxInFullView=!0,n.keyedInput="",n.posTimeout=null,n.bodyCloseEvt="click.close_"+n.selectId+S,n.isReadOnly=typeof n.$select.attr("readonly")=="string",n.select.multiple&&console.warn("The SelectEnhance plugin doesn't support multiple selections."),n.$label.hasEls&&n.$label.attr({id:n.selectId+"_lbl"}),n.params=V(q.defaults,s,o),n.#r(),st&&n.params.mobileNative||n.isReadOnly?n.#e():(n.params.observeSelectbox&&n.selectInputMutationObserver(),n.#t(),n.#l(),n.#o(),n.#a(),n.#i(),n.#n(),n.#c()),n}#e(){const e=this;let s=e.#s(e.$select);e.$select.on(`mouseup.${S}`,(t,n)=>{!n===s&&e.params.beforeChange(e.select)},"option").on(`change.${S}`,(t,n)=>{e.params.afterChange(e.select),s=e.#s(e.$select)})}#s(e){return e.find("option").filter(s=>s.selected).elem[0]}showOptions(){const e=this;if(e.select.disabled||e.optionsShown)return;e.optionsShown=!0,nt=e.selectEnhance;const{cssPrefix:s}=e.params,t=e.$selectList.find('[aria-selected="true"]');e.$selectList.css({display:null}),e.params.listAppendToSelect?e.$selectEnhance.insert(e.$selectList):z.body.append(e.selectList),e.$selectEnhance.tgClass(s+"--focused"),e.$textInput.attr({"aria-expanded":"true"}),e.listPosition(),e.eventScrollGetListPosition(!0),e.eventOutsideClickClose(),t.hasEls&&t.elem[0].focus(),e.params.focusIn(e.select)}closeOptions(e=!0){const s=this,{cssPrefix:t}=s.params;s.optionsShown=!1,s.$selectEnhance.addClass(t+"--blurring").rmClass(t+"--focused"),s.$textInput.attr({"aria-expanded":"false"}),s.$selectList.addClass(t+"__list--blurring").rmClass(t+"__list--focused"),l(z.body).off(s.bodyCloseEvt),setTimeout(()=>{s.$selectEnhance.rmClass([`${t}--blurring`,`${t}--pos-above`]).insert(s.$selectList),s.$selectList.css({display:"none"}).rmClass([`${t}__list--blurring`,`${t}__list--focused`,`${t}__list--pos-above`]),s.params.focusOut(s.select),e&&s.selectEnhance.isSameNode(nt)&&s.textInput.focus(),s.eventScrollGetListPosition(!0)},s.params.blurDuration)}setSelectionState(e,s=!0){const t=this,{cssPrefix:n}=t.params,o=t.optionSet.get(e);o&&(t.params.beforeChange(t.select),o.selected=!0,t.params.afterChange(t.select),t.$selectList.find("."+n+"__list-btn[aria-selected]").attr({"aria-selected":"false"}),l(e).attr({"aria-selected":"true"}),t.$textInput.attr({"aria-activedescendant":e.id}),t.$selectEnhance.tgClass(n+"--empty-val",!o.value.trim()),t.select.dispatchEvent(new Event("change")),t.params.emptyValAsPlaceholder&&o.value.trim()===""?t.$textInput.attr({value:"",placeholder:o.text}):t.$textInput.attr({value:o.text}),s?t.closeOptions():e.focus())}#t(){const e=this;e.$label.on(`click.${S}`,s=>{s.preventDefault(),e.select.disabled||e.textInput.focus()})}#n(){const e=this;l(window).on(`resize.${S}`,()=>{e.optionsShown&&e.closeOptions()})}#o(){const e=this;e.$textInput.on(`click.${S}`,()=>{e.select.disabled||e.showOptions()}).on(`keydown.${S}`,s=>{(s.key===I.down||s.key===I.up)&&(e.showOptions(),s.preventDefault())}).on(`keypress.${S}`,s=>{(s.key!==I.tab||s.shiftKey&&s.key!==I.tab)&&s.preventDefault(),(s.code===I.space&&e.keyedInput.trim()===""||s.ctrlKey&&s.altKey&&s.shiftKey&&I.space===s.code)&&e.showOptions()})}#a(){const e=this,{cssPrefix:s}=e.params;let t=null;const n=o=>{window.clearTimeout(t),e.setSelectionState(o),t=window.setTimeout(()=>e.closeOptions(),200)};e.$selectList.on(`click.${S}`,(o,i)=>{n(i),o.preventDefault()},`.${s}__list-btn`).on(`keypress.${S}`,(o,i)=>{(o.key===I.enter||o.code===I.space&&e.keyedInput.trim()==="")&&(n(i),o.preventDefault())},`.${s}__list-btn`)}eventOutsideClickClose(){const e=this;setTimeout(()=>{const s=e.bodyCloseEvt;l(z.body).off(s).on(s,(t,n)=>{const o=z.activeElement;o&&!e.selectList.contains(o)&&e.closeOptions()})},100)}#l(){const e=this;let s=null,t=null,n;function o(i){if(e.select.disabled)return;const c=i.key.length===1?i.key:"";if(e.keyedInput+=c,clearTimeout(s),s=setTimeout(()=>{e.keyedInput=""},e.params.typeAheadDuration),e.keyedInput.trim()){const f=RegExp(e.keyedInput.trim(),"i");n=Array.from(e.select.options).find(m=>f.test(m.text)),n&&(clearTimeout(t),t=setTimeout(()=>{e.setSelectionState(e.optionSet.get(n),!1)},100))}}e.$selectEnhance.on(`keypress.${S}`,o),e.$selectList.on(`keypress.${S}`,o)}#i(){const e=this;e.$selectEnhance.on(`keydown.navigate_${S}`,(s,t)=>{e.select.disabled||!e.optionsShown||(s.key===I.down&&(e.textInput.isSameNode(z.activeElement)||s.preventDefault(),e.traverseOptions(t,"next")),s.key===I.esc&&e.closeOptions(),s.key===I.tab&&e.closeOptions(!1))}),e.$selectList.on(`keydown.navigate_${S}`,(s,t)=>{if(e.select.disabled||!e.optionsShown)return;const n=z.activeElement;s.key===I.down&&(e.textInput.isSameNode(n)||s.preventDefault(),e.traverseOptions(n,"next")),s.key===I.up&&(s.preventDefault(),e.traverseOptions(n,"prev")),s.key===I.esc&&e.closeOptions()})}#r(){const e=this,s=X(`div.${e.params.cssPrefix}#${e.selectId}_wrap`),t=X(`input.${e.params.cssPrefix}__enable-text`,{type:"text",role:"combobox",ariaExpanded:"false",ariaLabel:e.$label.text()||"",id:e.selectId+"_input"}),n=l(s),o=l(t),i=[["aria-controls",e.selectId+"_listbox"],["aria-owns",e.selectId+"_listbox"],["aria-labelledby",e.selectId+"_lbl"],["aria-autocomplete","list"],["aria-activedescendant",""]];for(const[c,f]of i)t.setAttribute(c,f);e.$textInput=o,e.textInput=t,e.$selectEnhance=n,e.selectEnhance=s,e.$select.attr({tabindex:"-1"}).insert(n,"after"),n.insert(e.$select),st&&e.params.mobileNative||e.isReadOnly||(e.$select.insert(o,"after"),q.buildOptionsList(e))}static buildOptionsList(e,s){const{cssListModifer:t,cssPrefix:n}=e.params,o=rs("tag","optgroup",e.select),i=e.select.options,c=!!o.length,f=new WeakMap,m=" "+(t?n+"__list--"+t:"");if(c)for(let b=0,v=o.length;b<v;b++){const $=o[b],y=X("div",{className:n+"__optgroup",role:"group",ariaLabel:$.label||"",textContent:$.label||""});f.set($,l(y))}e.$selectList=s||l(X("div",{className:n+"__list"+m,role:"listbox",id:e.selectId+"_listbox",ariaLabel:e.$label.text()||""})).css({display:"none"}),e.selectList=e.$selectList.elem[0];const h=e.selectId||"select_"+e.index;for(let b=0,v=i.length;b<v;b++){const $=i[b],y=h+b;if($.hidden)continue;const E=$.parentElement.nodeName.toUpperCase()==="OPTGROUP",M=$.value===""?" "+n+"__list-btn--empty":"",T=X(`div.${n}__list-btn${M}`,{tabIndex:0,role:"option",id:y,ariaSelected:$.selected+"",textContent:$.textContent});T.dataset.disabled=$.disabled?"disabled":null,T.dataset.value=$.value,e.optionSet.set(T,$),e.optionSet.set($,T),c&&E?f.get($.parentElement).insert(T):e.$selectList.insert(T),$.selected&&(e.$textInput.attr({"aria-activedescendant":y}),e.$selectEnhance.tgClass(n+"--empty-val",!$.value.trim()),e.params.emptyValAsPlaceholder&&$.value.trim()===""?(e.$textInput.attr({value:""}),e.$textInput.attr({placeholder:$.text})):e.$textInput.attr({value:$.text}))}if(c)for(let b=0,v=o.length;b<v;b++){const $=o[b];e.$selectList.insert(f.get($))}e.$selectEnhance.insert(e.$selectList)}traverseOptions(e,s){const t=e.parentElement,n=s==="next"?e.nextElementSibling:e.previousElementSibling;if(n&&n.focus(),!n&&t.role==="group"){const o=s==="next"?t.nextElementSibling:t.previousElementSibling;o&&(s==="next"?o.firstElementChild?.focus():o.lastElementChild?.focus())}}selectInputMutationObserver(){const e=this,s=e.select,t={attributes:!0,childList:!0,subtree:!0};e.selectboxObserver=new MutationObserver(function(n,o){for(let i=0,c=n.length;i<c;i++){const f=n[i];f.type==="childList"?q.refreshOptions(e.select):f.type==="attributes"&&e.$selectEnhance.tgClass(e.params.cssPrefix+"--disabled",e.select.disabled)}}),e.selectboxObserver.observe(s,t)}eventScrollGetListPosition(e=!0){const s=this,t=`scroll.${S}`;e?l(window).off(t).on(t,()=>{s.posTimeout&&clearTimeout(s.posTimeout),s.posTimeout=setTimeout(()=>s.listPosition(),100)}):l(window).off(t)}#c(){const e=this;if(window.IntersectionObserver){const s=new IntersectionObserver(function(t){e.selectListBoxInFullView=t[0].intersectionRatio===1},{threshold:[0,1]});e.selectList&&s.observe(e.selectList)}}listPosition(){const e=this;if(e.optionsShown){const s=e.$selectEnhance.elemRects(),{cssPrefix:t,listAppendToSelect:n}=e.params,{innerHeight:o,scrollY:i,scrollX:c}=window,f=s.top+i,m=f+s.height,h=e.selectEnhance.offsetWidth,b=e.selectList.offsetHeight,v=i+o,$=f-i>b,y=v-m>b,E=y?!0:!$,M=n?0:s.left+c,T=n?E?s.height:b*-1:E?m:f-b;e.$selectEnhance.tgClass(t+"--pos-above",!E),e.$selectList.css({left:M+"px",top:T+"px",width:h+"px"}).tgClass(t+"__list--focused",e.optionsShown).tgClass(t+"__list--pos-above",!E)}}static refreshOptions(e){l(e).each(s=>{const t=w(s,le);t?(t.$selectList.empty(),t.optionSet=new WeakMap,q.buildOptionsList(t,t.$selectList)):console.warn("No instance of a selectbox",e)})}static remove(e,s){l(e).each(t=>{const n=s||w(t,le);n.$selectEnhance.off([`keydown.${S}`,`keydown.navigate_${S}`,`click.${S}`,`focusout.${S}`,`blur.${S}`]),n.$label.off(`click.${S}`),l(z.body).off(n.bodyCloseEvt),l(window).off(`resize.${S}`),n.$selectEnhance.insert(n.$select,"after").attr({tabindex:null}).off([`mouseup.${S}`,`change.${S}`]),n.selectboxObserver&&n.selectboxObserver.disconnect(),n.$selectEnhance.remove(),w(t,le,null)})}}const cs="1.5.0",Me="Tabs",U="tabs",ds={tabsEvent:"click",cssPrefix:"tabs",locationFilter:null,urlFilterType:"hash",historyType:"push",loadLocation:!0,addIDtoPanel:!0,ariaLabel:!0,defaultContent:0,tabChange:()=>{},onInit:()=>{}},re=p=>(p instanceof HTMLButtonElement?p.dataset.href:p.hash)?.replace(/^\#/,"")||"";class Ve{$element;params;tabsNav;$tabsNav;$tabsNavBtns;tabsNavBtns;tabsBody;$tabsBody;$tabsBodyPanels;prevTabId;initTabId;initDefaultContent;static defaults=ds;static version=cs;static pluginName=Me;#e=l.useTransition();constructor(e,s){const t=this,n=R(e,U),o=V(Ve.defaults,s,n),i=l(e);return t.$element=i,t.params=o,t.tabsNav=l.findOne(`.${o.cssPrefix}__nav`,e),t.tabsBody=l.findOne(`.${o.cssPrefix}__body`,e),t.$tabsNav=l(t.tabsNav),t.$tabsBody=l(t.tabsBody),t.$tabsBodyPanels=t.$tabsBody.find(`.${o.cssPrefix}__panel`,c=>c.parentElement===t.tabsBody),t.$tabsNavBtns=t.$tabsNav.find("a, button"),t.tabsNavBtns=t.$tabsNavBtns.toArray(),t.prevTabId=null,t.initDefaultContent=t.$tabsBodyPanels.get(o.defaultContent).attr("data-tab-id"),t.#o(),t.#a(),t.#t(),t.#s(),t.params.onInit(t.tabsNav,t.tabsBody),t}#s(){const e=this,s=e.params;Oe(s,t=>{if(t){const n=e.#n(t);n&&e.changeTab(n,t,!1)}})}#t(){const e=this,s=e.initDefaultContent,t=e.#n(s);e.changeTab(t,