baseframe-js
Version:
Baseframe JS is a comprehensive suite of modular plugins and utilities designed for front-end development
1 lines • 54.7 kB
JavaScript
function Jt(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var J={exports:{}},Zt=J.exports,rt;function Xt(){return rt||(rt=1,(function(d,e){(function(s,t){d.exports=t()})(Zt,(function(){const s=window,t=document,n=t.body,o=t.documentElement,i=p=>({}).toString.call(p).match(/\s([a-zA-Z]+)/)[1].toLowerCase(),c=Object.assign,f=Array.from,m=Array.isArray,h=p=>typeof p=="string",g=p=>i(p)==="object",v=new WeakMap,$=/([\.\#][\w-_\s]+)/g,y=Object.freeze({active:"active",starting:"starting",ending:"ending"}),E=(p,a=y)=>{const r={},u=p?p+"-":"";for(const b in a)Object.hasOwn(a,b)&&c(r,{[b]:u+a[b]});return r},F=(p,a,r=t)=>p==="class"?f(r.getElementsByClassName(a)):p==="id"?t.getElementById(a):p==="tag"?f(r.getElementsByTagName(a)):null,w=(p,a=t)=>f(a.querySelectorAll(p)),j=(p,a=t)=>a.querySelector(p),K=(p,a,r=!1)=>{let u=0,b,C;const A=[];for(;b=p[u];){const T=a(b,u++);T&&(r?((T!==C||!p.find(L=>L===T))&&A.push(T),C=T):A.push(T))}return A},ee=(p,a,r=o)=>{const u=h(r),b=[];for(;(p=p.parentElement)&&(p.matches(a)&&b.unshift(p),!(u?p.matches(r):p===r)););return b},yt=(p,a,r=!1)=>f(p.parentElement.childNodes).filter(b=>b instanceof HTMLElement&&(a?b.matches(a):!0)&&(r?!0:b!==p)),Et=(p,a)=>{let r=p.nextElementSibling;if(a)for(;r&&!r.matches(a);)r=r.nextElementSibling;return r??p},Ct=(p,a)=>{let r=p.previousElementSibling;if(a)for(;r&&!r.matches(a);)r=r.previousElementSibling;return r??p},wt=(p,a)=>{if(h(a))return a==="value"?p.value:p.getAttribute(a);for(const r in a){const u=a[r];u===null?p.removeAttribute(r):p.setAttribute(r,u)}},He=(p,a)=>{if(h(a))return getComputedStyle(p).getPropertyValue(a);for(const r in a){const u=a[r];r.startsWith("--")?p.style.setProperty(r,u):p.style[r]=u}return""},te=p=>p.classList,je=(p,a)=>{const r=te(p);m(a)?r.add(...a):r.add(a)},pe=(p,a)=>{const r=te(p);m(a)?r.remove(...a):r.remove(a)},Ge=(p,a,r)=>{const u=te(p);if(m(a))for(const b of a)u.toggle(b,r);else u.toggle(a,r)},xt=(p,a)=>{const r=te(p);return m(a)?a.every(u=>r.contains(u)):r.contains(a)},Ye=p=>p.getBoundingClientRect(),Tt=p=>{const a=Ye(p);return{top:a.top+s.pageYOffset,left:a.left+s.pageXOffset}},St=(p,a={},r)=>{const[u,...b]=p.split($),C=Bt(b),A=m(a)||a instanceof HTMLElement,T=h(a)||A,L=T?{}:a,D=c(C,L),{style:B}=D,S=c(t.createElement(u),D),O=T&&!r?a:r||"";return B&&g(B)&&He(S,B),O&&S.append(...h(O)?Ke(O):m(O)?O:[O]),S},Ke=p=>{const a=new DOMParser().parseFromString(p,"text/html").body,r=w("script",a);return r&&r.forEach(b=>b.remove()),f(a.childNodes)},kt=p=>{for(;p.firstChild;)p.removeChild(p.firstChild)},qe=(p,...a)=>{const r=m(p)?p:i(p)==="string"||i(p)==="boolean"?[p]:[],u=r.length>0,b=S=>u?r.some(O=>O===S):!1,C=b("deep")||b(!0),A=b("noNull"),T=b("noFalsy"),L=u?a.shift():p;let D,B=0;for(;D=a[B++];)for(const S in D){const O=D[S];if(C&&g(O)){const qt=L[S]?L[S]:L[S]={};qe(r,qt,O)}else L[S]=O,(A&&O===null||T&&!O)&&delete L[S]}return L},Ot=(p=n,a,r,u=null,b=!1)=>{const C=a.split(".")[0],A=T=>{const L=T.___cdata||[];if(u&&p instanceof HTMLElement){const D=h(u)?w(u,p):u,B=T.isTrusted?T.target:T.___synthTarget??T.target,S=D.find(O=>O===B||O.contains(B));S&&r(T,S,...L)}else r(T,p,...L)};v.has(p)?v.get(p).set(a,A):v.set(p,new Map([[a,A]])),p.addEventListener(C,A,b)},It=(p=n,a,r=!1)=>{if(v.has(p)){const u=v.get(p),b=a.split(".")[0],C=u.get(a);p.removeEventListener(b,C,r),u.delete(a)}},At=(p=n,a,r=null,u=[],b=!1)=>{a=a.trim();const C=r?w(r,p instanceof Window?n:p):null;if(C&&C.length===0)return;const A=C?C[0]:p,[T,L=""]=a.split("."),D=/^\[.+\]$/.test(a),B=new Event(D?a:T);if(u.length&&c(B,{___cdata:u}),L||D){const S=v.get(p);if(!S)return;const O=S.get(a);c(B,{___synthTarget:A}),O&&(D?(p.addEventListener(a,O,b),p.dispatchEvent(B),p.removeEventListener(a,O,b)):O(B,A))}else p.dispatchEvent(B)},Je=()=>{let p=!1,a=null,r=()=>{};return(u,b,C=300)=>{p&&(r(),clearTimeout(a)),u(),r=b,p=!0,a=setTimeout(()=>{r(),p=!1},C)}},Lt=(p,a="")=>{const r=Je(),u=E(a);return[(C,A=400,T=()=>{})=>{const L=C?u.starting:u.ending,D=S=>{S.offsetHeight,je(S,L),pe(S,u.active)},B=S=>{pe(S,L),Ge(S,u.active,C)};r(()=>{m(p)?p.forEach(D):D(p)},()=>{m(p)?p.forEach(B):B(p),T()},A)},u]},Pt=(p,a=60)=>{a=Math.min(Math.max(1,a),60);let r=null,u=performance.now();const b=1e3/a,C=()=>cancelAnimationFrame(r),A=T=>{r=window.requestAnimationFrame(A);const L=T-u;if(L<b)return;const D=L%b;u=T-D,p(C)};return p(C),A(u),C},Ze=p=>p.offsetParent!==null||!!(p.offsetWidth||p.offsetHeight||p.getClientRects().length),Dt=p=>!Ze(p),Xe=(p,a)=>p.filter(r=>r.startsWith(a)).map(r=>r.substring(1)),Bt=p=>{const a={},r=Xe(p,"."),u=Xe(p,"#");for(const b of p)r.length&&c(a,{className:r.join(" ")}),u.length&&c(a,{id:u[0]});return a},Qe={CSS_ACTION_STATES:y,addClass:je,attr:wt,css:He,cssActionStates:E,empty:kt,find:w,findBy:F,findOne:j,hasClass:xt,htmlParse:Ke,isVisible:Ze,isHidden:Dt,make:St,map:K,merge:qe,next:Et,parents:ee,prev:Ct,siblings:yt,elemRects:Ye,offset:Tt,off:It,on:Ot,trigger:At,rmClass:pe,tgClass:Ge,useTransition:Je,useCssAnimate:Lt,animateByFrame:Pt,af:f,isArr:m,isStr:h,isObj:g,oa:c,toType:i},{addClass:_t,attr:Nt,css:Ft,elemRects:Mt,offset:Vt,empty:et,find:tt,findBy:Rt,findOne:Ut,map:st,next:zt,prev:Wt,hasClass:de,htmlParse:nt,off:ot,on:at,parents:Ht,siblings:jt,trigger:Gt,rmClass:Yt,tgClass:Kt}=Qe,it="Element is not defined with index: ";class _{elem=[];constructor(a,r){return h(a)?this.elem=tt(a,r):a instanceof _?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=>{et(u);const b=a(r);m(b)?u.append(...b):u.append(b)});else return this.elem[0];return null}find(a,r){if(h(a)){const u=this.elem.map(b=>tt(a,b)).flat();return new _(r?u.filter(r):u)}else return new _(this.map(a,!0))}findBy(a,r,u){const b=this.elem.map(C=>Rt(a,r,C)).flat();return new _(u?b.filter(u):b)}findOne(a){const r=this.elem.map(u=>Ut(a,u)).filter(Boolean);return new _(r)}filter(a){return new _(this.elem.filter(a))}toArray(){return[...this.elem]}map(a,r=!1){return st(this.elem,a,r)}parents(a,r){r instanceof _&&(r=r.elem[0]);const u=st(this.elem,b=>Ht(b,a,r));return new _(u.flat())}siblings(a,r=!1,u=0){return new _(jt(this.elem[u],a,r))}next(a){return new _(zt(this.elem[0],a))}prev(a){return new _(Wt(this.elem[0],a))}get(a){const r=this.elem[a];if(r)return new _(r);console.warn(it+a)}each(a){return this.#e(a),this}css(a){const r=this.#s(a,Ft);return r||this}addClass(a){return this.#e(r=>_t(r,a)),this}rmClass(a){return this.#e(r=>Yt(r,a)),this}tgClass(a,r){return this.#e(u=>Kt(u,a,r)),this}hasClass(a,r="some"){return m(this.elem)?r==="some"?this.elem.some(u=>de(u,a)):this.elem.every(u=>de(u,a)):de(this.elem,a)}attr(a){const r=this.#s(a,Nt);return r||this}#n(a=0,r){const u=this.elem[a];if(u)return r(u);console.warn(it+a)}elemRects(a=0){return this.#n(a,Mt)}offset(a=0){return this.#n(a,Vt)}get hasEls(){return this.elem.length>0}get size(){return this.elem.length}empty(){return this.#e(et),this}remove(){return this.#e(a=>a.remove()),this}insert(a,r="append"){return this.#e(u=>{const b=m(a)?a.map(lt).flat():h(a)?nt(a):lt(a);r==="append"&&u.append(...b),r==="prepend"&&u.prepend(...b),r==="after"&&u.after(...b),r==="before"&&u.before(...b)}),this}html(a){const r=this.#t(nt,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,b=!1){if(m(a))for(const C of a)this.#e(A=>at(A,C,r,u,b));else this.#e(C=>at(C,a,r,u,b));return this}trigger(a,r,u){return this.#e(b=>Gt(b,a,r,u)),this}off(a,r=!1){if(m(a))for(const u of a)this.#e(b=>ot(b,u,r));else this.#e(u=>ot(u,a,r));return this}}const lt=p=>p instanceof _?p.elem:[p],fe=(p,a)=>new _(p,a);return c(fe,Qe),fe.BaseElem=_,fe}))})(J,J.exports)),J.exports}var Qt=Xt(),l=Jt(Qt);const es=d=>{let e={};return typeof d=="string"&&(e=JSON.parse(d.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:ts,toType:ct,isArr:ss,isStr:ns,oa:os,af:Gs}=l,U=document,ue=U.body,me=d=>ct(d)==="function",he=d=>d.offsetHeight,N=()=>{},M=(d,e,s)=>{const t=ct(e)==="object"?e:{};return ts([!0],{},d,t,s)},V=(d,e)=>es(d.dataset[e+"Options"]),as=d=>d.replace(/-./g,e=>e.toUpperCase()[1]),is=d=>d.charAt(0).toLowerCase()+d.substring(1),ls=()=>/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent),pt=new WeakMap,x=(d,e,s)=>{const t=pt.get(d)||pt.set(d,{});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]},dt=(d,e=l,s=!1)=>{if(ss(d))d.forEach(t=>dt(t,e,s));else{const t=d.pluginName,n=is(t),o=!!e.BaseElem,i=o?e.BaseElem.prototype:e.fn,c=(h,g,v)=>{const $=x(h,t);if(!$)x(h,t,new d(h,v,g));else{const y=$.handleUpdate&&l.toType($.handleUpdate)==="function";if(ns(v)){v==="remove"&&d.remove(h),v==="update"&&y&&$.handleUpdate();return}rs($.params,v,s),l.merge($.params,v),y&&$.handleUpdate()}return $},f=function(h){const g=this;return o?g.each((v,$)=>{c(v,$,h)}):g.each(function(v,$){c($,v,h)})};f.getInstance=h=>x(h,t);const m={[n]:f};i[n]=m[n]}},rs=(d,e,s=!0)=>{for(let t in e)({}).hasOwnProperty.call(d,t)||(s&&console.warn(`${t} is not a property that can be used`),delete e[t]);return s&&console.log("Params updated:",e),e},$e="UrlState",G=new Map([["search",new URLSearchParams(location.search.replace("?",""))],["hash",new URLSearchParams(location.hash.replace("#",""))]]),ge=(d="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(/\=$/,""),d==="replace"?history.replaceState(null,"",e):history.pushState(null,"",e)},cs=(d,e)=>{const s=G.get("hash");for(const t of s.keys())s.delete(t);d!==null&&s.set(d,""),e&&ge(e)},ps=(d,e,s,t)=>{if(d==="hashVal"){console.warn("use 'setHashVal' method for setting only the hash val");return}const n=G.get(d);if(s===null)n.has(e)&&n.delete(e);else{const i=Array.isArray(s)?`[${s.join(",")}]`:s;n.set(e,i)}t&&ge(t)},ft=(d,e)=>{const s=G.get(d);if(d==="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},ut=(d=!0)=>{d?l(window).off(`popstate.${$e}`).on(`popstate.${$e}`,()=>{G.set("search",new URLSearchParams(location.search.replace("?",""))),G.set("hash",new URLSearchParams(location.hash.replace("#","")))}):l(window).off(`popstate.${$e}`)},ds=(d,e)=>{const s=G.get(d),t={pattern:"normal",brackets:!0},{pattern:n,brackets:o}=Object.assign(t,e),i=o?"[]":"";return n==="repeat"?[...s.keys()].map(c=>{const f=ft(d,c);return Array.isArray(f)?f.map(m=>`${c}${i}=${encodeURIComponent(m)}`).join("&"):`${c}=${f}`}).join("&"):s.toString()};ut();const z={refresh:ut,print:ds,toUrl:ge,set:ps,setHashVal:cs,get:ft},fs=(d,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,d(o)};return i(t),o},us={immediate:!1,delay:100},be=(d,e="debounceResize",s=!1,t=100)=>{const o=[`resize${e!==""?`.${e}`:""}`];ve(window,o,d,{immediate:s,delay:t})},ve=(d,e,s,t)=>{const n=l(d),o={...us,...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)})},ms=d=>d<.5?8*d*d*d*d:1-8*--d*d*d*d,hs=d=>d<.5?4*d*d*d:(d-1)*(2*d-2)*(2*d-2)+1,$s=d=>1+--d*d*d*d*d,gs=d=>d,bs={linear:gs,easeInOutCubic:hs,easeInOutQuart:ms,easeOutQuint:$s},se="smoothScroll",mt=[`wheel.${se}`,`touchstart.${se}`];let ye=!1;function Ee(d,e=500,s="easeOutQuint",t){if(ye)return;let n=0;const o=window.scrollY,i=Math.abs(o-d),c=o<d?1:-1,f=1e3/60,m=e/f,h=i/m;if(i===0)return;ye=!0,ue.style.scrollBehavior="auto";const g=me(s)?s:bs[s],v=fs(()=>{n+=h;const y=i*g(n/i),E=o+y*c;window.scroll(0,E),n>i&&$()}),$=()=>{me(t)&&t(),v(),l(window).off([...mt,`scroll.${se}`]),ue.style.scrollBehavior=null,ye=!1};l(window).on(mt,$),ve(window,`scroll.${se}`,$)}const vs={get(d){const e=d+"=",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 ys(o);if(n=document.cookie.indexOf(" ",n)+1,n==0)break}return""},set(d,e,s={}){const t=new Date;t.setTime(t.getTime()+(s.expires||0)*60*1e3);const n=s.expires?t.toUTCString():null;document.cookie=d+"="+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(d,e,s){this.get(d)&&(document.cookie=d+"="+(e?"; path="+e:"")+(s?"; domain="+s:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT")}};function ys(d){let e=document.cookie.indexOf(";",d);return e==-1&&(e=document.cookie.length),decodeURI(document.cookie.substring(d,e))}const Es={focusFirst:!0,nameSpace:"focusTrap",focusable:["button","a","input","select","textarea","[tabindex]"]},ht=d=>{const e=l.isVisible(d)&&d.tabIndex!==-1,s=d.nodeName.toUpperCase();return s==="BUTTON"||s==="INPUT"?e&&!d.disabled:e&&d.style.pointerEvents!=="none"},Ce=(d,e)=>{const s=document,t=s.body,{focusFirst:n,focusable:o,nameSpace:i}={...Es,...e},c=l(d),f=typeof o=="string"?o:o.join(","),m=c.find(f).filter(ht);let h=m.hasEls?m.elem[0]:null;return n&&h&&h.focus(),l(t).on(`keydown.${i}`,function(g){const v=c.find(f).filter(ht);if(!v.hasEls)return;const $=s.activeElement,y=v.elem[v.size-1],E=g.key==="Tab";h=v.elem[0],E&&($.nodeName.toUpperCase()==="BODY"&&(h&&h.focus(),g.preventDefault()),g.shiftKey?$&&h&&s.activeElement===h&&(y&&y.focus(),g.preventDefault()):$&&y&&$===y&&(h&&h.focus(),g.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"},Cs="1.3.0",we="AccessibleMenu",W="accessibleMenu",ws={keyDirections:["horizontal","vertical","vertical"],focusCss:"focus",focusInElems:"a, [tabindex]",focusLeaveElems:"a, [tabindex], select, button"};class Be{static defaults=ws;static version=Cs;static pluginName=we;element;$element;params;$aeLiParents=null;activeElem=null;focusInElems="";constructor(e,s){const t=this,n=V(e,W);return t.element=e,t.$element=l(e),t.params=M(Be.defaults,s,n),t.#t(),t}static remove(e,s){l(e).each(t=>{(s||x(t,we)).$element.off([`focusin.${W}`,`mouseleave.${W}`,`blur.${W}`,`keydown.${W}`]),x(t,we,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),g=h.elem.at(-1)===m,v=o&&g;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.${W}`,()=>{e.activeElem=document.activeElement,o&&clearTimeout(o),l(e.activeElem.closest("li")).addClass(s.focusCss).siblings("li").rmClass(s.focusCss)},n).on(`focusout.${W}`,()=>{o=setTimeout(()=>t.rmClass(s.focusCss),200)}).on(`mouseleave.${W}`,()=>{t.rmClass(s.focusCss)}).on(`keydown.${W}`,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 xs="4.0.0",ne="Collapse",Y="collapse",Ts={cssPrefix:"collapse",toggleDuration:500,toggleGroup:!1,moveToTopOnOpen:!1,moveToTopOffset:0,moveToTopDuration:500,urlFilterType:"hash",historyType:"replace",locationFilter:null,loadLocation:!0,afterOpen:N,afterClose:N,afterInit:N};class _e{$element;element;params;toggling;$btnElems;btnElems;$activeItem;initLoaded;static defaults=Ts;static version=xs;static pluginName=ne;#e=l.useTransition();constructor(e,s,t){const n=this;n.element=e,n.$element=l(e);const o=V(e,Y);return n.params=M(_e.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),x(e,ne,n),n}static remove(e,s){l(e).each(t=>{(s||x(t,ne)).$element.off([`click.${Y}`,`[${Y}]`]),l(window).off(`popstate.${Y}`),x(t,ne,null)})}#s(){const e=this,{cssPrefix:s}=e.params;e.$element.on([`click.${Y}`,`[${Y}]`],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.${Y}`,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=z.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;Ee(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`,g=`.${n.cssPrefix}__body.${c}`,v=t.$element.find(g),$=v.filter(w=>n.toggleGroup||w.id===e),y=t.$activeItem.hasClass(c);$.each(w=>l.css(w,{height:w.scrollHeight+"px"}));const E=()=>{if(t.toggling=!0,t.$btnElems.each(w=>{const j=l(w),K=j.attr("aria-controls")===e,ee=j.attr("aria-expanded")==="false";n.toggleGroup?j.attr({"aria-expanded":(K&&ee)+""}):K&&j.attr({"aria-expanded":ee+""})}),$.rmClass(c).addClass([f,h]).each(w=>he(w)).css({height:"0px"}),!y){const w=o.scrollHeight+"px";t.$activeItem.addClass([f,m]).css({height:w})}},F=()=>{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 w=t.$element.find(g).map(K=>K.id),j=w.length===1?w[0]:w.length>0?w:null;z.set(n.urlFilterType,n.locationFilter,j,n.historyType)}t.params.afterOpen(t.btnElems,t.$activeItem.toArray()),t.#n()};t.#e(E,F,t.params.toggleDuration)}}const Ss="2.0.1",xe="LazyLoad",ks="lazyLoad",Os={imgSrcName:"src",bgSrcName:"bgSrc",loadImgs:!0,inEvt:null,outEvt:null,force:!1,observerID:null,unobserve:!0,observerOpts:{rootMargin:"48px"}},oe=new Map;class Ne{element;params;lazyElemObserver;static defaults=Os;static version=Ss;static pluginName=xe;constructor(e,s){const t=this,n=V(e,ks);return t.element=e,t.lazyElemObserver,t.params=M(Ne.defaults,s,n),t.#s(),t}static remove(e,s){l(e).each(t=>{const n=s||x(t,xe);oe.delete(n.params.observerID),n.lazyElemObserver.unobserve(t),x(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 Te=(d,e)=>{if(d.locationFilter!==null&&d.loadLocation&&d.urlFilterType!=="none"){const s=z.get(d.urlFilterType,d.locationFilter);s&&e(s)}},Is="1.2.0",$t="modal",ae="Modal",As={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:N,onOpen:N,onClose:N,afterClose:N},ie=(d,e)=>{d&&typeof d=="function"&&d(e)};class Fe{element;params;modalID;components;modalEvent;focusTrapped;enabledElem;openedOnce;domMarker;cssList;static defaults=As;static version=Is;static pluginName=ae;constructor(e,s){const t=this;t.element=e;const n=V(e,$t),o=M(Fe.defaults,s,n),{cssPrefix:i}=o;return t.params=o,t.modalID=t.params.modalID,t.modalEvent=$t+"_"+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(),Te(t.params,c=>{c===t.modalID&&(t.components.show?t.close():t.#s())}),x(e,ae,t),t}static remove(e,s){l(e).each(t=>{const n=s||x(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}]`]),x(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}`),g=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([g,h]),{backdrop:g,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=>he(f)).addClass(e.cssList.show),l.oa(e.components,{show:!0}),i.focusInDelay!==null&&setTimeout(()=>{e.focusTrapped=Ce(c,{nameSpace:as(e.modalID)})},i.focusInDelay),l(i.appendTo).addClass(e.cssList.open).css({overflow:"hidden",paddingRight:"0px"}),i.urlFilterType!=="none"&&z.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"&&z.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 Ls="2.0.0",Se="NavDesktop",H="navDesktop",Ps={stopWidth:768,delay:800,navLeavingDelay:800,outerElem:document.body,cssPrefix:"menu",hoverCss:"hover"};class Me{element;params;cssList;stayHover;navLeaving;static defaults=Ps;static version=Ls;static pluginName=Se;constructor(e,s){const t=this;t.stayHover,t.navLeaving,t.element=e;const n=V(e,H);t.params=M(Me.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||x(t,Se),o=l(n.element);o.find("ul").off([`mouseover.${H}`,`focusin.${H}`,`focusout.${H}`]),o.off(`mouseout.${H}`),x(t,Se,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=(g,v,$)=>{const y=v.type,E=v.target,F=g.isSameNode(E)||g.contains(E);(!m||m!==y&&F)&&(m=y,$())};n.on([`mouseover.${H}`,`focusin.${H}`],(g,v)=>{h(v,g,()=>{const $=l(v),y=$.parents("li");c.rmClass([t.hoverCss,s.elemEdge]),y.addClass(t.hoverCss),$.addClass(t.hoverCss),e.#t(g.target),e.navLeaving&&clearTimeout(e.navLeaving),e.stayHover&&clearTimeout(e.stayHover),o.addClass(s.hovered).rmClass(s.leaving)})},f),n.on([`mouseout.${H}`,`focusout.${H}`],(g,v)=>{h(v,g,()=>{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 Ds="3.0.0",ke="NavMobile",P="navMobile",Bs={enableBtn:"#mobile-nav-btn",ariaLabel:"Toggle site navigation",tgBtnText:"toggle menu",insertBtnAfter:"a",slideDuration:400,outerElement:ue,outsideClickClose:!0,animateHeight:!0,cssPrefix:"menu",menuBtnCss:"i i-arrow-b",menuBtnSkip:!1,afterNavItemOpen:N,afterNavItemClose:N,afterOpen:N,afterClose:N,doTrapFocus:!0,trapFocusElem:null,stopPropagation:!0,bkptEnable:null};class Ve{$element;element;params;menuOpened;allowClick;cssList;$enableBtn;enableBtn;static defaults=Bs;static version=Ds;static pluginName=ke;#e=l.useTransition();constructor(e,s){const t=this,n=V(e,P);t.$element=l(e),t.element=e,t.params=M(Ve.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.${P}`,`[${P}]`],function(o){e.allowClick&&(e.#t(),o.stopPropagation(),o.preventDefault())}),l(document).on(`keydown.${P}`,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=Ce(s.trapFocusElem||e.$element,{nameSpace:P}))},()=>{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.${P}`,`[${P}]`],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 g=f.hasEls?f.elem[0].scrollHeight:0,v=m?0:g;f.css({height:(m?g:0)+"px"}).each($=>he($)).css({height:v+"px"})}},()=>{c.rmClass(h).tgClass(t.open,!m),f.rmClass(h).tgClass(t.open,!m).css({height:null});const g=c.toArray();m?s.afterNavItemClose(g):s.afterNavItemOpen(g),e.allowClick=!0},s.slideDuration),n.stopPropagation()},`.${t.btn.replace(/\s/g,".")}`),e.$element.on([`click.${P}`,`[${P}]`],(n,o)=>{e.params.stopPropagation&&n.stopPropagation()},"a")}#o(){const e=this;l(document.body).on(`click.${P}`,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(!(me(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},P,!0,200)}static remove(e,s){l(e).each(t=>{const n=s||x(t,ke);l(document).off(`keydown.${P}`),l(n.params.enableBtn).off([`click.${P}`,`[${P}]`]),n.$element.off([`click.${P}`,`[${P}]`]),l(document.body).off(`click.${P}`),l(window).off([`resize.${P}`,`[${P}]`]),x(t,ke,null)})}}const _s="2.0.1",Oe="Parallax",gt="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 Re{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=_s;static pluginName=Oe;constructor(e,s,t){const n=this,o=V(e,gt);return n.$window=l(window),n.$element=l(e),n.element=e,n.params=M(Re.defaults,s,o),n.zInitOffset=0,n.index=t,n.instanceEvent=gt+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 g=h*e.speed,v=h*e.zSpeed,$=g<e.zScrollMaxPxStop?g:e.zScrollMaxPxStop,y=e.params.zAxis?e.lastZSpeed<e.zScrollMaxPxStop?v:e.lastZSpeed:0,F={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=F,e.$element.css(F)}}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||x(t,Oe);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),x(t,Oe,null)})}}const Fs="1.0.1",Ie="ScrollSpy",Ae="scrollSpy",Ms={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 Ue{#e=new Map;inViewEntries=new Set;backUpInViewEntry;#s=null;#t=null;params;element;$spyBody;spyContents;static defaults=Ms;static version=Fs;static pluginName=Ie;constructor(e,s){const t=this,n=V(e,Ae);return t.element=e,t.params=M(Ue.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()};Te(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.${Ae}`,(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"?z.setHashVal(c,s.historyType):(s.urlFilterType==="hash"||s.urlFilterType==="search")&&z.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:U.body);if(c.hasEls){const f=c.offset().top-i;s==="smooth"?Ee(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 g=U.body.scrollHeight-window.scrollY;window.innerHeight>g&&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||x(this,Ie);for(const n of t.spyContents)t.#i(n,"remove");l(t.element).off(`click.${Ae}`).rmClass(`${t.params.cssPrefix}-nav`),t.$spyBody.rmClass(`${t.params.cssPrefix}-body`),t.#t.disconnect(),x(this,Ie,null)})}}const Vs="3.0.1",k="selectEnhance",le="SelectEnhance",Rs={cssPrefix:"select-enhance",cssListModifer:null,mobileNative:!1,emptyValAsPlaceholder:!0,focusIn:N,focusOut:N,beforeChange:N,afterChange:N,blurDuration:250,typeAheadDuration:500,observeSelectbox:!0,listAppendToSelect:!1},{make:Z,findBy:Us}=l,bt=ls();let vt=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=Rs;static version=Vs;static pluginName=le;constructor(e,s,t){const n=this,o=V(e,k);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+k,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=M(q.defaults,s,o),n.#r(),bt&&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.${k}`,(t,n)=>{!n===s&&e.params.beforeChange(e.select)},"option").on(`change.${k}`,(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,vt=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):U.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(U.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(vt)&&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.${k}`,s=>{s.preventDefault(),e.select.disabled||e.textInput.focus()})}#n(){const e=this;l(window).on(`resize.${k}`,()=>{e.optionsShown&&e.closeOptions()})}#o(){const e=this;e.$textInput.on(`click.${k}`,()=>{e.select.disabled||e.showOptions()}).on(`keydown.${k}`,s=>{(s.key===I.down||s.key===I.up)&&(e.showOptions(),s.preventDefault())}).on(`keypress.${k}`,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.${k}`,(o,i)=>{n(i),o.preventDefault()},`.${s}__list-btn`).on(`keypress.${k}`,(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(U.body).off(s).on(s,(t,n)=>{const o=U.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.${k}`,o),e.$selectList.on(`keypress.${k}`,o)}#i(){const e=this;e.$selectEnhance.on(`keydown.navigate_${k}`,(s,t)=>{e.select.disabled||!e.optionsShown||(s.key===I.down&&(e.textInput.isSameNode(U.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_${k}`,(s,t)=>{if(e.select.disabled||!e.optionsShown)return;const n=U.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=Z(`div.${e.params.cssPrefix}#${e.selectId}_wrap`),t=Z(`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),bt&&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=Us("tag","optgroup",e.select),i=e.select.options,c=!!o.length,f=new WeakMap,m=" "+(t?n+"__list--"+t:"");if(c)for(let g=0,v=o.length;g<v;g++){const $=o[g],y=Z("div",{className:n+"__optgroup",role:"group",ariaLabel:$.label||"",textContent:$.label||""});f.set($,l(y))}e.$selectList=s||l(Z("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 g=0,v=i.length;g<v;g++){const $=i[g],y=h+g;if($.hidden)continue;const E=$.parentElement.nodeName.toUpperCase()==="OPTGROUP",F=$.value===""?" "+n+"__list-btn--empty":"",w=Z(`div.${n}__list-btn${F}`,{tabIndex:0,role:"option",id:y,ariaSelected:$.selected+"",textContent:$.textContent});w.dataset.disabled=$.disabled?"disabled":null,w.dataset.value=$.value,e.optionSet.set(w,$),e.optionSet.set($,w),c&&E?f.get($.parentElement).insert(w):e.$selectList.insert(w),$.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 g=0,v=o.length;g<v;g++){const $=o[g];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.${k}`;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,g=e.selectList.offsetHeight,v=i+o,$=f-i>g,y=v-m>g,E=y?!0:!$,F=n?0:s.left+c,w=n?E?s.height:g*-1:E?m:f-g;e.$selectEnhance.tgClass(t+"--pos-above",!E),e.$selectList.css({left:F+"px",top:w+"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=x(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||x(t,le);n.$selectEnhance.off([`keydown.${k}`,`keydown.navigate_${k}`,`click.${k}`,`focusout.${k}`,`blur.${k}`]),n.$label.off(`click.${k}`),l(U.body).off(n.bodyCloseEvt),l(window).off(`resize.${k}`),n.$selectEnhance.insert(n.$select,"after").attr({tabindex:null}).off([`mouseup.${k}`,`change.${k}`]),n.selectboxObserver&&n.selectboxObserver.disconnect(),n.$selectEnhance.remove(),x(t,le,null)})}}const zs="1.5.0",Le="Tabs",R="tabs",Ws={tabsEvent:"click",cssPrefix:"tabs",locationFilter:null,urlFilterType:"hash",historyType:"push",loadLocation:!0,addIDtoPanel:!0,ariaLabel:!0,defaultContent:0,tabChange:()=>{},onInit:()=>{}},re=d=>(d instanceof HTMLButtonElement?d.dataset.href:d.hash)?.replace(/^\#/,"")||"";class ze{$element;params;tabsNav;$tabsNav;$tabsNavBtns;tabsNavBtns;tabsBody;$tabsBody;$tabsBodyPanels;prevTabId;initTabId;initDefaultContent;static defaults=Ws;static version=zs;static pluginName=Le;#e=l.useTransition();constructor(e,s){const t=this,n=V(e,R),o=M(ze.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;Te(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,s,!1)}#n(e){const s=this.tabsNavBtns.find(t=>re(t)===e);return s||null}#o(){const e=this,s=e.params;e.$tabsNavBtns.each(t=>{const n=re(t),o=e.$tabsBodyPanels.filter(i=>i.dataset.tabId===n);l(t).attr({