TP_JO2024/home/dist/dsfr.module.min.js
2024-03-27 17:19:37 +01:00

3 lines
101 KiB
JavaScript

/*! DSFR v1.11.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
const e=new class{constructor(){this.modules={}}create(e){const t=new e;this.modules[t.type]=t}getModule(e){return this.modules[e]}add(e,t){this.modules[e].add(t)}remove(e,t){this.modules[e].remove(t)}get isActive(){return this._isActive}set isActive(e){if(e===this._isActive)return;this._isActive=e;const t=Object.keys(this.modules).map((e=>this.modules[e]));if(e)for(const e of t)e.activate();else for(const e of t)e.deactivate()}get isLegacy(){return this._isLegacy}set isLegacy(e){e!==this._isLegacy&&(this._isLegacy=e)}},t="fr",s="dsfr",i="@gouvfr",n="1.11.2";class r{constructor(e,t,s,i){switch(this.level=e,this.light=t,this.dark=s,i){case"warn":this.logger=console.warn;break;case"error":this.logger=console.error;break;default:this.logger=console.log}}log(...e){const t=new a(s);for(const s of e)t.add(s);this.print(t)}print(e){e.setColor(this.color),this.logger.apply(console,e.getMessage())}get color(){return window.matchMedia("(prefers-color-scheme: dark)").matches?this.dark:this.light}}class a{constructor(e){this.inputs=["%c"],this.styles=["font-family:Marianne","line-height: 1.5"],this.objects=[],e&&this.add(`${e} :`)}add(e){switch(typeof e){case"object":case"function":this.inputs.push("%o "),this.objects.push(e);break;default:this.inputs.push(`${e} `)}}setColor(e){this.styles.push(`color:${e}`)}getMessage(){return[this.inputs.join(""),this.styles.join(";"),...this.objects]}}const o={log:new r(0,"#616161","#989898"),debug:new r(1,"#000091","#8B8BFF"),info:new r(2,"#007c3b","#00ed70"),warn:new r(3,"#ba4500","#fa5c00","warn"),error:new r(4,"#D80600","#FF4641","error")};const h=new class{constructor(){this.level=2;for(const e in o){const t=o[e];this[e]=(...e)=>{this.level<=t.level&&t.log.apply(t,e)},this[e].print=t.print.bind(t)}}state(){const t=new a;t.add(e),this.log.print(t)}tree(){const t=e.getModule("stage");if(!t)return;const s=new a;this._branch(t.root,0,s),this.log.print(s)}_branch(e,t,s){let i="";if(t>0){let e="";for(let s=0;s<t;s++)e+=" ";i+=e+"└─ "}i+=`[${e.id}] ${e.html}`,s.add(i),s.add({"@":e}),s.add("\n");for(const n of e.children)i+=this._branch(n,t+1,s)}},c=e=>{"loading"!==document.readyState?window.requestAnimationFrame(e):document.addEventListener("DOMContentLoaded",e)},l={AUTO:"auto",MANUAL:"manual",RUNTIME:"runtime",LOADED:"loaded",VUE:"vue",ANGULAR:"angular",REACT:"react"};const d=new class{constructor(){this._mode=l.AUTO,this.isStarted=!1,this.starting=this.start.bind(this),this.preventManipulation=!1}configure(e={},t,s){this.startCallback=t;const i=e.production&&(!s||"false"!==s.production);switch(!0){case s&&!isNaN(s.level):h.level=Number(s.level);break;case s&&s.verbose&&("true"===s.verbose||1===s.verbose):h.level=0;break;case i:h.level=999;break;case e.verbose:h.level=0}h.info(`version ${n}`),this.mode=e.mode||l.AUTO}set mode(e){switch(e){case l.AUTO:this.preventManipulation=!1,t=this.starting,c(t);break;case l.LOADED:this.preventManipulation=!1,c(this.starting);break;case l.RUNTIME:this.preventManipulation=!1,this.start();break;case l.MANUAL:this.preventManipulation=!1;break;case l.VUE:case l.ANGULAR:case l.REACT:this.preventManipulation=!0;break;default:return void h.error("Illegal mode")}var t;this._mode=e,h.info(`mode set to ${e}`)}get mode(){return this._mode}start(){h.info("start"),this.startCallback()}};class u{constructor(){this._collection=[]}forEach(e){this._collection.forEach(e)}map(e){return this._collection.map(e)}get length(){return this._collection.length}add(e){return!(this._collection.indexOf(e)>-1)&&(this._collection.push(e),this.onAdd&&this.onAdd(),this.onPopulate&&1===this._collection.length&&this.onPopulate(),!0)}remove(e){const t=this._collection.indexOf(e);if(-1===t)return!1;this._collection.splice(t,1),this.onRemove&&this.onRemove(),this.onEmpty&&0===this._collection.length&&this.onEmpty()}execute(...e){for(const t of this._collection)t&&t.apply(null,e)}clear(){this._collection.length=0}clone(){const e=new u;return e._collection=this._collection.slice(),e}get collection(){return this._collection}}class g extends u{constructor(e){super(),this.type=e,this.isActive=!1}activate(){}deactivate(){}}const p=e=>`${t}-${e}`;p.selector=(e,t)=>(void 0===t&&(t="."),`${t}${p(e)}`),(p.attr=e=>`data-${p(e)}`).selector=(e,t)=>{let s=p.attr(e);return void 0!==t&&(s+=`="${t}"`),`[${s}]`},p.event=e=>`${s}.${e}`,p.emission=(e,t)=>`emission:${e}.${t}`;const m=(e,t)=>Array.prototype.slice.call(e.querySelectorAll(t)),_=(e,t)=>{const s=e.parentElement;return s.matches(t)?s:s===document.documentElement?null:_(s,t)};class b{constructor(e,t,s){this.selector=e,this.InstanceClass=t,this.creator=s,this.instances=new u,this.isIntroduced=!1,this._instanceClassName=this.InstanceClass.instanceClassName,this._instanceClassNames=this.getInstanceClassNames(this.InstanceClass),this._property=this._instanceClassName.substring(0,1).toLowerCase()+this._instanceClassName.substring(1);const i=this._instanceClassName.replace(/[^a-zA-Z0-9]+/g,"-").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([^0-9])/g,"$1-$2").replace(/([^0-9])([0-9])/g,"$1-$2").toLowerCase();this._attribute=p.attr(`js-${i}`)}getInstanceClassNames(e){const t=Object.getPrototypeOf(e);return t&&"Instance"!==t.instanceClassName?[...this.getInstanceClassNames(t),e.instanceClassName]:[e.instanceClassName]}hasInstanceClassName(e){return this._instanceClassNames.indexOf(e)>-1}introduce(){this.isIntroduced||(this.isIntroduced=!0,e.getModule("stage").parse(document.documentElement,this))}parse(e,t){const s=[];return e.matches&&e.matches(this.selector)&&s.push(e),!t&&e.querySelectorAll&&e.querySelector(this.selector)&&s.push.apply(s,m(e,this.selector)),s}create(e){if(!e.node.matches(this.selector))return;const t=new this.InstanceClass;return this.instances.add(t),t}remove(e){this.instances.remove(e)}dispose(){const e=this.instances.collection;for(let t=e.length-1;t>-1;t--)e[t]._dispose();this.creator=null}get instanceClassName(){return this._instanceClassName}get instanceClassNames(){return this._instanceClassNames}get property(){return this._property}get attribute(){return this._attribute}}class E extends g{constructor(){super("register")}register(t,s,i){const n=new b(t,s,i);return this.add(n),e.isActive&&n.introduce(),n}activate(){for(const e of this.collection)e.introduce()}remove(e){e.dispose(),super.remove(e)}}let f=0;class A{constructor(e,t){t?this.id=t:(f++,this.id=f),this.node=e,this.attributeNames=[],this.instances=[],this._children=[],this._parent=null,this._projects=[]}get proxy(){const e=this;if(!this._proxy){this._proxy={id:this.id,get parent(){return e.parent?e.parent.proxy:null},get children(){return e.children.map((e=>e.proxy))}};for(const e of this.instances)this._proxy[e.registration.property]=e.proxy}return this._proxy}get html(){if(!this.node||!this.node.outerHTML)return"";const e=this.node.outerHTML.indexOf(">");return this.node.outerHTML.substring(0,e+1)}project(e){-1===this._projects.indexOf(e)&&this._projects.push(e)}populate(){const e=this._projects.slice();this._projects.length=0;for(const t of e)this.create(t)}create(e){if(this.hasInstance(e.instanceClassName))return;h.debug(`create instance of ${e.instanceClassName} on element [${this.id}]`);const t=e.create(this);this.instances.push(t),t._config(this,e),this._proxy&&(this._proxy[e.property]=t.proxy)}remove(e){const t=this.instances.indexOf(e);t>-1&&this.instances.splice(t,1),this._proxy&&delete this._proxy[e.registration.property]}get parent(){return this._parent}get ascendants(){return[this.parent,...this.parent.ascendants]}get children(){return this._children}get descendants(){const e=[...this._children];return this._children.forEach((t=>e.push(...t.descendants))),e}addChild(e,t){return this._children.indexOf(e)>-1?null:(e._parent=this,!isNaN(t)&&t>-1&&t<this._children.length?this._children.splice(t,0,e):this._children.push(e),e)}removeChild(e){const t=this._children.indexOf(e);if(-1===t)return null;e._parent=null,this._children.splice(t,1)}emit(t,s){const i=e.getModule("stage").collection,n=[];for(const e of i)n.push(...e._emit(t,s));return n}_emit(e,t){const s=[];for(const i of this.instances)s.push(...i._emitter.emit(e,t));return s}ascend(e,t){return this._parent?this._parent._ascend(e,t):[]}_ascend(e,t){const s=[];for(const i of this.instances)s.push(...i._ascent.emit(e,t));return this._parent&&s.push(...this._parent._ascend(e,t)),s}descend(e,t){const s=[];for(const i of this._children)s.push(...i._descend(e,t));return s}_descend(e,t){const s=[];for(const i of this.instances)s.push(...i._descent.emit(e,t));for(const i of this._children)s.push(...i._descend(e,t));return s}getInstance(e){for(const t of this.instances)if(t.registration.hasInstanceClassName(e))return t;return null}hasInstance(e){return null!==this.getInstance(e)}getDescendantInstances(e,t,s){if(!e)return[];const i=[];for(const n of this._children){const r=n.getInstance(e);r&&(i.push(r),s)||(t&&n.hasInstance(t)||!n.children.length||i.push.apply(i,n.getDescendantInstances(e,t,s)))}return i}getAscendantInstance(e,t){if(!e||!this._parent)return null;const s=this._parent.getInstance(e);return s||(t&&this._parent.hasInstance(t)?null:this._parent.getAscendantInstance(e,t))}dispose(){for(let e=this.instances.length-1;e>=0;e--){const t=this.instances[e];t&&t._dispose()}this.instances.length=0,e.remove("stage",this),this.parent.removeChild(this),this._children.length=0,h.debug(`remove element [${this.id}] ${this.html}`)}prepare(e){-1===this.attributeNames.indexOf(e)&&this.attributeNames.push(e)}examine(){const e=this.attributeNames.slice();this.attributeNames.length=0;for(let t=this.instances.length-1;t>-1;t--)this.instances[t].examine(e)}}const T={CLICK:p.emission("root","click"),KEYDOWN:p.emission("root","keydown"),KEYUP:p.emission("root","keyup")},S={TAB:{id:"tab",value:9},ESCAPE:{id:"escape",value:27},END:{id:"end",value:35},HOME:{id:"home",value:36},LEFT:{id:"left",value:37},UP:{id:"up",value:38},RIGHT:{id:"right",value:39},DOWN:{id:"down",value:40}},v=e=>Object.values(S).filter((t=>t.value===e))[0];class y extends A{constructor(){super(document.documentElement,"root"),this.node.setAttribute(p.attr("js"),!0),this.listen()}listen(){document.documentElement.addEventListener("click",this.click.bind(this),{capture:!0}),document.documentElement.addEventListener("keydown",this.keydown.bind(this),{capture:!0}),document.documentElement.addEventListener("keyup",this.keyup.bind(this),{capture:!0})}click(e){this.emit(T.CLICK,e.target)}keydown(e){this.emit(T.KEYDOWN,v(e.keyCode))}keyup(e){this.emit(T.KEYUP,v(e.keyCode))}}class C extends g{constructor(){super("stage"),this.root=new y,super.add(this.root),this.observer=new MutationObserver(this.mutate.bind(this)),this.modifications=[],this.willModify=!1,this.modifying=this.modify.bind(this)}hasElement(e){for(const t of this.collection)if(t.node===e)return!0;return!1}getElement(e){for(const t of this.collection)if(t.node===e)return t;const t=new A(e);return this.add(t),h.debug(`add element [${t.id}] ${t.html}`),t}getProxy(e){if(!this.hasElement(e))return null;return this.getElement(e).proxy}add(e){super.add(e),this.put(e,this.root)}put(e,t){let s=0;for(let i=t.children.length-1;i>-1;i--){const n=t.children[i],r=e.node.compareDocumentPosition(n.node);if(r&Node.DOCUMENT_POSITION_CONTAINS)return void this.put(e,n);if(r&Node.DOCUMENT_POSITION_CONTAINED_BY)t.removeChild(n),e.addChild(n,0);else if(r&Node.DOCUMENT_POSITION_PRECEDING){s=i+1;break}}t.addChild(e,s)}activate(){this.observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}deactivate(){this.observer.disconnect()}mutate(e){const t=[];e.forEach((e=>{switch(e.type){case"childList":e.removedNodes.forEach((e=>this.dispose(e))),e.addedNodes.forEach((e=>this.parse(e)));break;case"attributes":if(this.hasElement(e.target)){const s=this.getElement(e.target);s.prepare(e.attributeName),-1===t.indexOf(s)&&t.push(s);for(const e of s.descendants)-1===t.indexOf(e)&&t.push(e)}-1===this.modifications.indexOf(e.target)&&this.modifications.push(e.target)}})),t.forEach((e=>e.examine())),this.modifications.length&&!this.willModify&&(this.willModify=!0,window.requestAnimationFrame(this.modifying))}modify(){this.willModify=!1;const e=this.modifications.slice();this.modifications.length=0;for(const t of e)document.documentElement.contains(t)&&this.parse(t)}dispose(e){const t=[];this.forEach((s=>{e.contains(s.node)&&t.push(s)}));for(const e of t)e.dispose(),this.remove(e)}parse(t,s,i){const n=s?[s]:e.getModule("register").collection,r=[];for(const e of n){const s=e.parse(t,i);for(const t of s){const s=this.getElement(t);s.project(e),-1===r.indexOf(s)&&r.push(s)}}for(const e of r)e.populate()}}class N extends g{constructor(){super("render"),this.rendering=this.render.bind(this),this.nexts=new u}activate(){window.requestAnimationFrame(this.rendering)}request(e){this.nexts.add(e)}render(){if(!e.isActive)return;if(window.requestAnimationFrame(this.rendering),this.forEach((e=>e.render())),!this.nexts.length)return;const t=this.nexts.clone();this.nexts.clear(),t.forEach((e=>e.next()))}}class D extends g{constructor(){super("resize"),this.requireResize=!1,this.resizing=this.resize.bind(this);const e=this.request.bind(this);document.fonts&&document.fonts.ready.then(e),window.addEventListener("resize",e),window.addEventListener("orientationchange",e)}activate(){this.request()}request(){this.requireResize||(this.requireResize=!0,window.requestAnimationFrame(this.resizing))}resize(){this.requireResize&&(this.forEach((e=>e.resize())),this.requireResize=!1)}}class w extends g{constructor(){super("lock"),this._isLocked=!1,this._scrollY=0,this.onPopulate=this.lock.bind(this),this.onEmpty=this.unlock.bind(this)}get isLocked(){return this._isLocked}lock(){if(!this._isLocked){this._isLocked=!0,this._scrollY=window.scrollY;const e=window.innerWidth-document.documentElement.clientWidth;document.documentElement.setAttribute(p.attr("scrolling"),"false"),document.body.style.top=-this._scrollY+"px",this.behavior=getComputedStyle(document.documentElement).getPropertyValue("scroll-behavior"),"smooth"===this.behavior&&(document.documentElement.style.scrollBehavior="auto"),e>0&&document.documentElement.style.setProperty("--scrollbar-width",`${e}px`)}}unlock(){this._isLocked&&(this._isLocked=!1,document.documentElement.removeAttribute(p.attr("scrolling")),document.body.style.top="",window.scrollTo(0,this._scrollY),"smooth"===this.behavior&&document.documentElement.style.removeProperty("scroll-behavior"),document.documentElement.style.removeProperty("--scrollbar-width"))}move(e){this._isLocked?(this._scrollY+=e,document.body.style.top=-this._scrollY+"px"):window.scrollTo(0,window.scrollY+e)}}class L extends g{constructor(){super("load"),this.loading=this.load.bind(this)}activate(){window.addEventListener("load",this.loading)}load(){this.forEach((e=>e.load()))}}const R=["Marianne","Spectral"];class I extends g{constructor(){super("font-swap"),this.swapping=this.swap.bind(this)}activate(){document.fonts&&document.fonts.addEventListener("loadingdone",this.swapping)}swap(){const e=R.filter((e=>document.fonts.check(`16px ${e}`)));this.forEach((t=>t.swapFont(e)))}}class x extends g{constructor(){super("mouse-move"),this.requireMove=!1,this._isMoving=!1,this.moving=this.move.bind(this),this.requesting=this.request.bind(this),this.onPopulate=this.listen.bind(this),this.onEmpty=this.unlisten.bind(this)}listen(){this._isMoving||(this._isMoving=!0,this.requireMove=!1,document.documentElement.addEventListener("mousemove",this.requesting))}unlisten(){this._isMoving&&(this._isMoving=!1,this.requireMove=!1,document.documentElement.removeEventListener("mousemove",this.requesting))}request(e){this._isMoving&&(this.point={x:e.clientX,y:e.clientY},this.requireMove||(this.requireMove=!0,window.requestAnimationFrame(this.moving)))}move(){this.requireMove&&(this.forEach((e=>e.mouseMove(this.point))),this.requireMove=!1)}}class O extends g{constructor(){super("hash"),this.handling=this.handle.bind(this),this.getLocationHash()}activate(){window.addEventListener("hashchange",this.handling)}deactivate(){window.removeEventListener("hashchange",this.handling)}_sanitize(e){return"#"===e.charAt(0)?e.substring(1):e}set hash(e){const t=this._sanitize(e);this._hash!==t&&(window.location.hash=t)}get hash(){return this._hash}getLocationHash(){const e=window.location.hash;this._hash=this._sanitize(e)}handle(e){this.getLocationHash(),this.forEach((t=>t.handleHash(this._hash,e)))}}const P=new class{constructor(){e.create(E),e.create(C),e.create(N),e.create(D),e.create(w),e.create(L),e.create(I),e.create(x),e.create(O);const t=e.getModule("register");this.register=t.register.bind(t)}get isActive(){return e.isActive}start(){h.debug("START"),e.isActive=!0}stop(){h.debug("STOP"),e.isActive=!1}};const k=e=>{switch(!0){case e.hover:return"-hover";case e.active:return"-active";default:return""}},M=new class{getColor(e,t,s,i={}){const n=`--${e}-${t}-${s}${k(i)}`;return getComputedStyle(document.documentElement).getPropertyValue(n).trim()||null}},G=e=>"."===e.charAt(0)?e.substr(1):e,$=e=>{switch(!0){case!e.className:return[];case"string"==typeof e.className:return e.className.split(" ");case"string"==typeof e.className.baseVal:return e.className.baseVal.split(" ")}return[]},H=(e,t,s)=>{t=G(t);const i=$(e),n=i.indexOf(t);!0===s?n>-1&&i.splice(n,1):-1===n&&i.push(t),e.className=i.join(" ")},U=(e,t)=>H(e,t),B=(e,t)=>H(e,t,!0),F=(e,t)=>$(e).indexOf(G(t))>-1,W=['[tabindex]:not([tabindex="-1"])',"a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details","iframe"].join(),q=e=>e.querySelectorAll(W);let z=0;const j=e=>{if(!document.getElementById(e))return e;let t=!0;const s=e;for(;t;)z++,e=`${s}-${z}`,t=document.getElementById(e);return e},V={addClass:U,hasClass:F,removeClass:B,queryParentSelector:_,querySelectorAllArray:m,queryActions:q,uniqueId:j};const K={DataURISVG:class{constructor(e=0,t=0){this._width=e,this._height=t,this._content=""}get width(){return this._width}set width(e){this._width=e}get height(){return this._height}set height(e){this._height=e}get content(){return this._content}set content(e){this._content=e}getDataURI(e=!1){let t=`<svg xmlns='http://www.w3.org/2000/svg' viewbox='0 0 ${this._width} ${this._height}' width='${this._width}px' height='${this._height}px'>${this._content}</svg>`;return t=t.replace(/#/gi,"%23"),e&&(t=t.replace(/</gi,"%3C"),t=t.replace(/>/gi,"%3E"),t=t.replace(/"/gi,"'"),t=t.replace(/{/gi,"%7B"),t=t.replace(/}/gi,"%7D")),`data:image/svg+xml;charset=utf8,${t}`}}},Y={supportLocalStorage:()=>{try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}},supportAspectRatio:()=>!!window.CSS&&CSS.supports("aspect-ratio: 16 / 9")},X={TransitionSelector:{NONE:p.selector("transition-none")}},Q=(e,...t)=>(t.forEach((t=>{const s=Object.keys(t).reduce(((e,s)=>(e[s]=Object.getOwnPropertyDescriptor(t,s),e)),{});Object.getOwnPropertySymbols(t).forEach((e=>{const i=Object.getOwnPropertyDescriptor(t,e);i.enumerable&&(s[e]=i)})),Object.defineProperties(e,s)})),e),J={completeAssign:Q},Z={},ee={};Object.defineProperty(ee,"isLegacy",{get:()=>e.isLegacy}),ee.setLegacy=()=>{e.isLegacy=!0},Z.legacy=ee,Z.dom=V,Z.image=K,Z.support=Y,Z.motion=X,Z.property=J,Z.ns=p,Z.register=P.register,Z.state=e,Z.query=(e=>{if(e&&e.search){const e=new URLSearchParams(window.location.search).entries();return Object.fromEntries(e)}return null})(window.location),Object.defineProperty(Z,"preventManipulation",{get:()=>d.preventManipulation}),Object.defineProperty(Z,"stage",{get:()=>e.getModule("stage")});const te=t=>e.getModule("stage").getProxy(t);te.version=n,te.prefix=t,te.organisation=i,te.Modes=l,Object.defineProperty(te,"mode",{set:e=>{d.mode=e},get:()=>d.mode}),te.internals=Z,te.version=n,te.start=P.start,te.stop=P.stop,te.inspector=h,te.colors=M;const se=window[s];te.internals.configuration=se,d.configure(se,te.start,te.internals.query),window[s]=te;class ie{constructor(){this.emissions={}}add(e,t){if("function"!=typeof t)throw new Error("closure must be a function");this.emissions[e]||(this.emissions[e]=[]),this.emissions[e].push(t)}remove(e,t){if(this.emissions[e])if(t){const s=this.emissions[e].indexOf(t);s>-1&&this.emissions[e].splice(s)}else delete this.emissions[e]}emit(e,t){if(!this.emissions[e])return[];const s=[];for(const i of this.emissions[e])i&&s.push(i(t));return s}dispose(){this.emissions=null}}class ne{constructor(e,t){this.id=e,this.minWidth=t}test(){return window.matchMedia(`(min-width: ${this.minWidth}em)`).matches}}const re={XS:new ne("xs",0),SM:new ne("sm",36),MD:new ne("md",48),LG:new ne("lg",62),XL:new ne("xl",78)};class ae{constructor(e=!0){this.jsAttribute=e,this._isRendering=!1,this._isResizing=!1,this._isScrollLocked=!1,this._isLoading=!1,this._isSwappingFont=!1,this._isEnabled=!0,this._isDisposed=!1,this._listeners={},this._handlingClick=this.handleClick.bind(this),this._hashes=[],this._hash="",this._keyListenerTypes=[],this._keys=[],this.handlingKey=this.handleKey.bind(this),this._emitter=new ie,this._ascent=new ie,this._descent=new ie,this._registrations=[],this._nexts=[]}static get instanceClassName(){return"Instance"}_config(e,t){this.element=e,this.registration=t,this.node=e.node,this.id=e.node.id,this.jsAttribute&&this.setAttribute(t.attribute,!0),this.init()}init(){}get proxy(){const e=this;return Q({render:()=>e.render(),resize:()=>e.resize()},{get node(){return this.node},get isEnabled(){return e.isEnabled},set isEnabled(t){e.isEnabled=t}})}log(...e){e.unshift(`${this.registration.instanceClassName} #${this.id} - `),h.log.apply(h,e)}debug(...e){e.unshift(`${this.registration.instanceClassName} #${this.id} - `),h.debug.apply(h,e)}info(...e){e.unshift(`${this.registration.instanceClassName} #${this.id} - `),h.info.apply(h,e)}warn(...e){e.unshift(`${this.registration.instanceClassName} #${this.id} - `),h.warn.apply(h,e)}error(...e){e.unshift(`${this.registration.instanceClassName} #${this.id} - `),h.error.apply(h,e)}register(t,s){const i=e.getModule("register").register(t,s,this);this._registrations.push(i)}getRegisteredInstances(e){for(const t of this._registrations)if(t.hasInstanceClassName(e))return t.instances.collection;return[]}dispatch(e,t,s,i){const n=new CustomEvent(e,{detail:t,bubble:!0===s,cancelable:!0===i});this.node.dispatchEvent(n)}listen(e,t,s){this._listeners[e]||(this._listeners[e]=[]);const i=this._listeners[e],n=new he(this.node,e,t,s);i.push(n),n.listen()}unlisten(e,t,s){if(!e){for(const e in this._listeners)this.unlisten(e);return}const i=this._listeners[e];if(!i)return;if(!t)return void i.forEach((t=>this.unlisten(e,t.closure)));const n=i.filter((e=>e.closure===t&&e.matchOptions(s)));n.forEach((e=>e.unlisten())),this._listeners[e]=i.filter((e=>-1===n.indexOf(e)))}listenClick(e){this.listen("click",this._handlingClick,e)}unlistenClick(e){this.unlisten("click",this._handlingClick,e)}handleClick(e){}set hash(t){e.getModule("hash").hash=t}get hash(){return e.getModule("hash").hash}listenHash(t,s){if(!this._hashes)return;0===this._hashes.length&&e.add("hash",this);const i=new ce(t,s);this._hashes=this._hashes.filter((e=>e.hash!==t)),this._hashes.push(i)}unlistenHash(t){this._hashes&&(this._hashes=this._hashes.filter((e=>e.hash!==t)),0===this._hashes.length&&e.remove("hash",this))}handleHash(e,t){if(this._hashes)for(const s of this._hashes)s.handle(e,t)}listenKey(e,t,s=!1,i=!1,n="down"){-1===this._keyListenerTypes.indexOf(n)&&(this.listen(`key${n}`,this.handlingKey),this._keyListenerTypes.push(n)),this._keys.push(new oe(n,e,t,s,i))}unlistenKey(e,t){this._keys=this._keys.filter((s=>s.code!==e||s.closure!==t)),this._keyListenerTypes.forEach((e=>{this._keys.some((t=>t.type===e))||this.unlisten(`key${e}`,this.handlingKey)}))}handleKey(e){for(const t of this._keys)t.handle(e)}get isEnabled(){return this._isEnabled}set isEnabled(e){this._isEnabled=e}get isRendering(){return this._isRendering}set isRendering(t){this._isRendering!==t&&(t?e.add("render",this):e.remove("render",this),this._isRendering=t)}render(){}request(t){this._nexts.push(t),e.getModule("render").request(this)}next(){const e=this._nexts.slice();this._nexts.length=0;for(const t of e)t&&t()}get isResizing(){return this._isResizing}set isResizing(t){this._isResizing!==t&&(t?(e.add("resize",this),this.resize()):e.remove("resize",this),this._isResizing=t)}resize(){}isBreakpoint(e){return!0==("string"==typeof e)?re[e.toUpperCase()].test():e.test()}get isScrollLocked(){return this._isScrollLocked}set isScrollLocked(t){this._isScrollLocked!==t&&(t?e.add("lock",this):e.remove("lock",this),this._isScrollLocked=t)}get isLoading(){return this._isLoading}set isLoading(t){this._isLoading!==t&&(t?e.add("load",this):e.remove("load",this),this._isLoading=t)}load(){}get isSwappingFont(){return this._isSwappingFont}set isSwappingFont(t){this._isSwappingFont!==t&&(t?e.add("font-swap",this):e.remove("font-swap",this),this._isSwappingFont=t)}swapFont(){}get isMouseMoving(){return this._isMouseMoving}set isMouseMoving(t){this._isMouseMoving!==t&&(t?e.add("mouse-move",this):e.remove("mouse-move",this),this._isMouseMoving=t)}mouseMove(e){}examine(e){this.node.matches(this.registration.selector)?this.mutate(e):this._dispose()}mutate(e){}retrieveNodeId(e,t){if(e.id)return e.id;const s=j(`${this.id}-${t}`);return this.warn(`add id '${s}' to ${t}`),e.setAttribute("id",s),s}get isDisposed(){return this._isDisposed}_dispose(){this.debug(`dispose instance of ${this.registration.instanceClassName} on element [${this.element.id}]`),this.removeAttribute(this.registration.attribute),this.unlisten(),e.remove("hash",this),this._hashes=null,this._keys=null,this.isRendering=!1,this.isResizing=!1,this._nexts=null,e.getModule("render").nexts.remove(this),this.isScrollLocked=!1,this.isLoading=!1,this.isSwappingFont=!1,this.isMouseMoving=!1,this._emitter.dispose(),this._emitter=null,this._ascent.dispose(),this._ascent=null,this._descent.dispose(),this._descent=null,this.element.remove(this);for(const t of this._registrations)e.remove("register",t);this._registrations=null,this.registration.remove(this),this._isDisposed=!0,this.dispose()}dispose(){}emit(e,t){return this.element.emit(e,t)}addEmission(e,t){this._emitter.add(e,t)}removeEmission(e,t){this._emitter.remove(e,t)}ascend(e,t){return this.element.ascend(e,t)}addAscent(e,t){this._ascent.add(e,t)}removeAscent(e,t){this._ascent.remove(e,t)}descend(e,t){return this.element.descend(e,t)}addDescent(e,t){this._descent.add(e,t)}removeDescent(e,t){this._descent.remove(e,t)}get style(){return this.node.style}addClass(e){U(this.node,e)}removeClass(e){B(this.node,e)}hasClass(e){return F(this.node,e)}get classNames(){return $(this.node)}remove(){this.node.parentNode.removeChild(this.node)}setAttribute(e,t){this.node.setAttribute(e,t)}getAttribute(e){return this.node.getAttribute(e)}hasAttribute(e){return this.node.hasAttribute(e)}removeAttribute(e){this.node.removeAttribute(e)}setProperty(e,t){this.node.style.setProperty(e,t)}removeProperty(e){this.node.style.removeProperty(e)}focus(){this.node.focus()}blur(){this.node.blur()}focusClosest(){const e=this._focusClosest(this.node.parentNode);e&&e.focus()}_focusClosest(e){if(!e)return null;const t=[...q(e)];if(t.length<=1)return this._focusClosest(e.parentNode);{const e=t.indexOf(this.node);return t[e+(e<t.length-1?1:-1)]}}get hasFocus(){return this.node===document.activeElement}scrollIntoView(){const t=this.getRect(),s=e.getModule("lock");t.top<0&&s.move(t.top-50),t.bottom>window.innerHeight&&s.move(t.bottom-window.innerHeight+50)}matches(e){return this.node.matches(e)}querySelector(e){return this.node.querySelector(e)}querySelectorAll(e){return m(this.node,e)}queryParentSelector(e){return _(this.node,e)}getRect(){const e=this.node.getBoundingClientRect();return e.center=e.left+.5*e.width,e.middle=e.top+.5*e.height,e}get isLegacy(){return e.isLegacy}}class oe{constructor(e,t,s,i,n){this.type=e,this.eventType=`key${e}`,this.keyCode=t,this.closure=s,this.preventDefault=!0===i,this.stopPropagation=!0===n}handle(e){e.type===this.eventType&&e.keyCode===this.keyCode.value&&(this.closure(e),this.preventDefault&&e.preventDefault(),this.stopPropagation&&e.stopPropagation())}}class he{constructor(e,t,s,i){this._node=e,this._type=t,this._closure=s,this._options=i}get closure(){return this._closure}listen(){this._node.addEventListener(this._type,this._closure,this._options)}matchOptions(e=null){switch(!0){case null===e:case"boolean"==typeof this._options&&"boolean"==typeof e&&this._options===e:return!0;case Object.keys(this._options).length!==Object.keys(e).length:return!1;case Object.keys(e).every((t=>this._options[t]===e[t])):return!0}return!1}unlisten(){this._node.removeEventListener(this._type,this._closure,this._options)}}class ce{constructor(e,t){this.hash=e,this.add=t}handle(e,t){this.hash===e&&this.add(t)}}const le={DISCLOSE:p.event("disclose"),CONCEAL:p.event("conceal")},de={RESET:p.emission("disclosure","reset"),ADDED:p.emission("disclosure","added"),RETRIEVE:p.emission("disclosure","retrieve"),REMOVED:p.emission("disclosure","removed"),GROUP:p.emission("disclosure","group"),UNGROUP:p.emission("disclosure","ungroup"),SPOTLIGHT:p.emission("disclosure","spotlight")};class ue extends ae{constructor(e,t,s,i){super(),this.type=e,this._selector=t,this.DisclosureButtonInstanceClass=s,this.disclosuresGroupInstanceClassName=i,this.modifier=this._selector+"--"+this.type.id,this._isPristine=!0,this._isRetrievingPrimaries=!1,this._hasRetrieved=!1,this._primaryButtons=[]}static get instanceClassName(){return"Disclosure"}init(){this.addDescent(de.RESET,this.reset.bind(this)),this.addDescent(de.GROUP,this.update.bind(this)),this.addDescent(de.UNGROUP,this.update.bind(this)),this.addAscent(de.SPOTLIGHT,this.disclose.bind(this)),this.register(`[aria-controls="${this.id}"]`,this.DisclosureButtonInstanceClass),this.ascend(de.ADDED),this.listenHash(this.id,this._spotlight.bind(this)),this.update()}get isEnabled(){return super.isEnabled}set isEnabled(e){this.isEnabled!==e&&(super.isEnabled=e,e?this.ascend(de.ADDED):this.ascend(de.REMOVED))}get isPristine(){return this._isPristine}get proxy(){const e=this,t=Object.assign(super.proxy,{disclose:e.disclose.bind(e),focus:e.focus.bind(e)});this.type.canConceal&&(t.conceal=e.conceal.bind(e));return Q(t,{get buttons(){return e.buttons.map((e=>e.proxy))},get group(){const t=e.group;return t?t.proxy:null},get isDisclosed(){return e.isDisclosed}})}get buttons(){return this.getRegisteredInstances(this.DisclosureButtonInstanceClass.instanceClassName)}update(){this.getGroup(),this.retrievePrimaries()}getGroup(){if(!this.disclosuresGroupInstanceClassName)return void(this._group=null);const e=this.element.getAscendantInstance(this.disclosuresGroupInstanceClassName,this.constructor.instanceClassName);e&&e.validate(this)?this._group=e:this._group=null}get group(){return this._group}disclose(e){return!(!0===this.isDisclosed||!this.isEnabled)&&(this._isPristine=!1,this.isDisclosed=!0,!e&&this.group&&(this.group.current=this),!0)}conceal(e,t=!0){return!1!==this.isDisclosed&&(!(!this.type.canConceal&&this.group&&this.group.current===this)&&(this.isDisclosed=!1,!e&&this.group&&this.group.current===this&&(this.group.current=null),t||this.focus(),this._isPristine||this.descend(de.RESET),!0))}get isDisclosed(){return this._isDisclosed}set isDisclosed(e){if(this._isDisclosed!==e&&(this.isEnabled||!0!==e)){this.dispatch(e?le.DISCLOSE:le.CONCEAL,this.type),this._isDisclosed=e,e?this.addClass(this.modifier):this.removeClass(this.modifier);for(let t=0;t<this.buttons.length;t++)this.buttons[t].apply(e)}}get isInitiallyDisclosed(){return this.primaryButtons.some((e=>e.isInitiallyDisclosed))}hasRetrieved(){return this._hasRetrieved}reset(){}toggle(e){if(this.type.canConceal)switch(!0){case!e:case this.isDisclosed:this.conceal(!1,!1);break;default:this.disclose()}else this.disclose()}get buttonHasFocus(){return this.buttons.some((e=>e.hasFocus))}get hasFocus(){return!!super.hasFocus||(!!this.buttonHasFocus||this.querySelectorAll(":focus").length>0)}focus(){this._primaryButtons.length>0&&this._primaryButtons[0].focus()}get primaryButtons(){return this._primaryButtons}retrievePrimaries(){this._isRetrievingPrimaries||(this._isRetrievingPrimaries=!0,this.request(this._retrievePrimaries.bind(this)))}_retrievePrimaries(){if(this._isRetrievingPrimaries=!1,this._primaryButtons=this._electPrimaries(this.buttons),!this._hasRetrieved&&0!==this._primaryButtons.length)if(this.retrieved(),this._hasRetrieved=!0,this.applyAbility(!0),this.group)this.group.retrieve();else if(this._isPristine&&this.isEnabled&&!this.group)switch(!0){case this.hash===this.id:this._spotlight();break;case this.isInitiallyDisclosed:this.disclose()}}retrieved(){}_spotlight(){this.disclose(),this.request((()=>{this.ascend(de.SPOTLIGHT)}))}_electPrimaries(e){return e.filter((e=>e.canDisclose&&!this.node.contains(e.node)))}applyAbility(e=!1){const t=!this._primaryButtons.every((e=>e.isDisabled));this.isEnabled!==t&&(this.isEnabled=t,e||(!this.isEnabled&&this.isDisclosed&&(this.group?this.ascend(de.REMOVED):this.type.canConceal&&this.conceal()),this.isEnabled&&(this.group&&this.ascend(de.ADDED),this.hash===this.id&&this._spotlight())))}dispose(){this._group=null,this._primaryButtons=null,super.dispose(),this.ascend(de.REMOVED)}}class ge extends ae{constructor(e){super(),this.type=e,this.attributeName=e.ariaState?"aria-"+e.id:p.attr(e.id),this._canDisclose=!1}static get instanceClassName(){return"DisclosureButton"}get isPrimary(){return this.registration.creator.primaryButtons.includes(this)}get canDisclose(){return this._canDisclose}get isDisabled(){return this.type.canDisable&&this.hasAttribute("disabled")}init(){this._canDisclose=this.hasAttribute(this.attributeName),this._isInitiallyDisclosed=this.isDisclosed,this._isContained=this.registration.creator.node.contains(this.node),this.controlsId=this.getAttribute("aria-controls"),this.registration.creator.retrievePrimaries(),this.listenClick()}get proxy(){return Object.assign(super.proxy,{focus:this.focus.bind(this)})}handleClick(e){this.registration.creator&&this.registration.creator.toggle(this.canDisclose)}mutate(e){this._canDisclose=this.hasAttribute(this.attributeName),this.registration.creator.applyAbility(),!this._isApplying&&this.isPrimary&&e.indexOf(this.attributeName)>-1&&this.registration.creator&&(this.isDisclosed?this.registration.creator.disclose():this.type.canConceal&&this.registration.creator.conceal())}apply(e){this.canDisclose&&(this._isApplying=!0,this.setAttribute(this.attributeName,e),this.request((()=>{this._isApplying=!1})))}get isDisclosed(){return"true"===this.getAttribute(this.attributeName)}get isInitiallyDisclosed(){return this._isInitiallyDisclosed}focus(){super.focus(),this.scrollIntoView()}measure(e){const t=this.rect;this._dx=e.x-t.x,this._dy=e.y-t.y}get dx(){return this._dx}get dy(){return this._dy}}const pe={PREVENT_CONCEAL:p.attr.selector("prevent-conceal"),GROUP:p.attr("group")};class me extends ae{constructor(e,t){super(t),this.disclosureInstanceClassName=e,this._members=[],this._index=-1,this._isRetrieving=!1,this._hasRetrieved=!1,this._isGrouped=!0}static get instanceClassName(){return"DisclosuresGroup"}init(){this.addAscent(de.ADDED,this.update.bind(this)),this.addAscent(de.RETRIEVE,this.retrieve.bind(this)),this.addAscent(de.REMOVED,this.update.bind(this)),this.descend(de.GROUP),this._isGrouped="false"!==this.getAttribute(pe.GROUP),this.update()}get proxy(){const e=this,t={set index(t){e.index=t},get index(){return e.index},get length(){return e.length},get current(){const t=e.current;return t?t.proxy:null},get members(){return e.members.map((e=>e.proxy))},get hasFocus(){return e.hasFocus},set isGrouped(t){e.isGrouped=t},get isGrouped(){return e.isGrouped}};return Q(super.proxy,t)}validate(e){return!0}getMembers(){const e=this.element.getDescendantInstances(this.disclosureInstanceClassName,this.constructor.instanceClassName,!0);this._members=e.filter(this.validate.bind(this)).filter((e=>e.isEnabled));e.filter((e=>!this._members.includes(e))).forEach((e=>e.conceal()))}retrieve(e=!1){this._isRetrieving||this._hasRetrieved&&!e||(this._isRetrieving=!0,this.request(this._retrieve.bind(this)))}_retrieve(){if(this.getMembers(),this._isRetrieving=!1,this._hasRetrieved=!0,this.hash)for(let e=0;e<this.length;e++){const t=this.members[e];if(this.hash===t.id)return this.index=e,this.request((()=>{this.ascend(de.SPOTLIGHT)})),e}for(let e=0;e<this.length;e++){if(this.members[e].isInitiallyDisclosed)return this.index=e,e}return this.getIndex()}update(){this.getMembers(),this._hasRetrieved&&this.getIndex()}get members(){return this._members}get length(){return this.members?this.members.length:0}getIndex(e=-1){this._index=void 0;let t=e;for(let e=0;e<this.length;e++)if(this.members[e].isDisclosed){t=e;break}return this.index=t,t}get index(){return this._index}set index(e){if(!(e<-1||e>=this.length||e===this._index)){this._index=e;for(let t=0;t<this.length;t++){const s=this.members[t];e===t?s.isDisclosed||s.disclose(!0):!this.isGrouped&&this.canUngroup||!s.isDisclosed||s.conceal(!0)}this.apply()}}get current(){return-1===this._index||isNaN(this._index)?null:this._members[this._index]||null}set current(e){this.index=this.members.indexOf(e)}get hasFocus(){const e=this.current;return!!e&&e.hasFocus}set isGrouped(e){const t=!!e;this._isGrouped!==t&&(this._isGrouped=t,this.setAttribute(pe.GROUP,!!e),this.update())}get isGrouped(){return this._isGrouped}get canUngroup(){return!1}mutate(e){e.includes(pe.GROUP)&&(this.isGrouped="false"!==this.getAttribute(pe.GROUP))}apply(){}dispose(){super.dispose(),this.descend(de.UNGROUP),this._members=null}}const _e={EXPAND:{id:"expanded",ariaState:!0,ariaControls:!0,canConceal:!0,canDisable:!0},SELECT:{id:"selected",ariaState:!0,ariaControls:!0,canConceal:!1,canDisable:!0},OPENED:{id:"opened",ariaState:!1,ariaControls:!0,canConceal:!0,canDisable:!1}};class be extends ge{constructor(){super(_e.EXPAND)}static get instanceClassName(){return"CollapseButton"}}const Ee={COLLAPSE:p.selector("collapse"),COLLAPSING:p.selector("collapsing")};const fe={CHANGE:p("equisized")};const Ae={TOGGLE:p.event("toggle")};const Te={INJECT_SVG:`[${p.attr("inject-svg")}]`};const Se={ARTWORK_USE:`${p.selector("artwork")} use`},ve={ASSESS_FILE:`${p.attr.selector("assess-file")}`,DETAIL:`${p.attr.selector("assess-file")} [class$="__detail"], ${p.attr.selector("assess-file")} [class*="__detail "]`},ye={UPDATE:p.emission("assess","update"),ADDED:p.emission("assess","added")};const Ce=["32x9","16x9","3x2","4x3","1x1","3x4","2x3"],Ne=(e,t)=>t.map((t=>p.selector(`${e}--${t}`))).join(","),De=`${p.selector("responsive-img")}, ${Ne("responsive-img",Ce)}, ${p.selector("responsive-vid")}, ${Ne("responsive-vid",["16x9","4x3","1x1"])}`,we={RATIO:`${p.selector("ratio")}, ${Ne("ratio",Ce)}, ${De}`},Le=window[s];const Re={TOP:p.selector("placement--top"),RIGHT:p.selector("placement--right"),BOTTOM:p.selector("placement--bottom"),LEFT:p.selector("placement--left")},Ie={START:p.selector("placement--start"),CENTER:p.selector("placement--center"),END:p.selector("placement--end")},xe={TOP:"place_top",RIGHT:"place_right",BOTTOM:"place_bottom",LEFT:"place_left"},Oe={START:"align_start",CENTER:"align_center",END:"align_end"},Pe={AUTO:"placement_auto",MANUAL:"placement_manual"};te.core={Instance:ae,Breakpoints:re,KeyCodes:S,Disclosure:ue,DisclosureButton:ge,DisclosuresGroup:me,DisclosureType:_e,DisclosureEvent:le,DisclosureSelector:pe,DisclosureEmission:de,Collapse:class extends ue{constructor(){super(_e.EXPAND,Ee.COLLAPSE,be,"CollapsesGroup")}static get instanceClassName(){return"Collapse"}init(){super.init(),this.listen("transitionend",this.transitionend.bind(this))}transitionend(e){this.removeClass(Ee.COLLAPSING),this.isDisclosed||(this.isLegacy?this.style.maxHeight="":this.style.removeProperty("--collapse-max-height"))}unbound(){this.isLegacy?this.style.maxHeight="none":this.style.setProperty("--collapse-max-height","none")}disclose(e){if(!0===this.isDisclosed||!this.isEnabled)return!1;this.unbound(),this.request((()=>{this.addClass(Ee.COLLAPSING),this.adjust(),this.request((()=>{super.disclose(e)}))}))}conceal(e,t){if(!1===this.isDisclosed)return!1;this.request((()=>{this.addClass(Ee.COLLAPSING),this.adjust(),this.request((()=>{super.conceal(e,t)}))}))}adjust(){this.setProperty("--collapser","none");const e=this.node.offsetHeight;this.setProperty("--collapse",-e+"px"),this.setProperty("--collapser","")}reset(){this.isPristine||(this.isDisclosed=!1)}_electPrimaries(e){const t=this.element.parent.instances.map((e=>e.collapsePrimary)).filter((t=>void 0!==t&&e.indexOf(t)>-1));if(1===t.length)return t;if(1===(e=super._electPrimaries(e)).length)return e;const s=e.filter((e=>e.dy>=0));if(s.length>0&&(e=s),1===e.length)return e;const i=Math.min(...e.map((e=>e.dy))),n=e.filter((e=>e.dy===i));return n.length>0&&(e=n),1===e.length||e.sort(((e,t)=>Math.abs(t.dx)-Math.abs(e.dx))),e}},CollapseButton:be,CollapsesGroup:class extends me{constructor(){super("Collapse")}static get instanceClassName(){return"CollapsesGroup"}get canUngroup(){return!0}},CollapseSelector:Ee,RootSelector:{ROOT:":root"},RootEmission:T,Equisized:class extends ae{static get instanceClassName(){return"Equisized"}init(){this.ascend(fe.CHANGE)}measure(){return this.isLegacy&&(this.style.width="auto"),this.getRect().width}adjust(e){this.isLegacy&&(this.style.width=`${e}px`)}dispose(){this.ascend(fe.CHANGE)}},EquisizedEmission:fe,Toggle:class extends ae{static get instanceClassName(){return"Toggle"}init(){this.pressed="true"===this.pressed,this.listenClick()}handleClick(){this.toggle()}toggle(){this.pressed="true"!==this.pressed}get pressed(){return this.getAttribute("aria-pressed")}set pressed(e){this.setAttribute("aria-pressed",e?"true":"false"),this.dispatch(Ae.TOGGLE,e)}get proxy(){const e=this,t=Object.assign(super.proxy,{toggle:e.toggle.bind(e)});return Q(t,{get pressed(){return e.pressed},set pressed(t){e.pressed=t}})}},EquisizedsGroup:class extends ae{static get instanceClassName(){return"EquisizedsGroup"}init(){this.isResizing=!0,this.isLoading=!0,this.addAscent(fe.CHANGE,this.resize.bind(this))}load(){this.resize()}resize(){const e=this.element.getDescendantInstances("Equisized");this.isLegacy||this.style.setProperty("--equisized-width","auto");const t=Math.max(...e.map((e=>e.measure())));this.isLegacy?e.forEach((e=>e.adjust(t))):this.style.setProperty("--equisized-width",`${t}px`)}},InjectSvg:class extends ae{static get instanceClassName(){return"InjectSvg"}init(){this.node&&(this.img=this.node.querySelector("img")),this.isLegacy||this.replace()}get proxy(){const e=this;return Object.assign(super.proxy,{replace:e.replace.bind(e),restore:e.restore.bind(e)})}fetch(){this.img&&(this.imgID=this.img.getAttribute("id"),this.imgClass=this.img.getAttribute("class"),this.imgURL=this.img.getAttribute("src"),fetch(this.imgURL).then((e=>e.text())).then((e=>{const t=(new DOMParser).parseFromString(e,"text/html");this.svg=t.querySelector("svg"),this.svg&&this.replace()})))}replace(){if(!this.svg)return void this.fetch();this.imgID&&void 0!==this.imgID&&this.svg.setAttribute("id",this.imgID);let e=this.imgURL.match(/[ \w-]+\./)[0];e&&(e=e.slice(0,-1),["dark","light","system"].includes(e)&&(this.svg.innerHTML=this.svg.innerHTML.replaceAll('id="artwork-',`id="${e}-artwork-`),this.svg.innerHTML=this.svg.innerHTML.replaceAll('"#artwork-',`"#${e}-artwork-`))),this.imgClass&&void 0!==this.imgClass&&this.svg.setAttribute("class",this.imgClass),this.svg.hasAttribute("xmlns:a")&&this.svg.removeAttribute("xmlns:a"),this.node.setAttribute("data-fr-inject-svg",!0);var t,s;t=this.svg,s={"aria-hidden":!0,focusable:!1},Object.keys(s).forEach((e=>t.setAttribute(e,s[e]))),this.node.replaceChild(this.svg,this.img)}restore(){this.img&&this.svg&&(this.node.setAttribute("data-fr-inject-svg",!1),this.node.replaceChild(this.img,this.svg))}},InjectSvgSelector:Te,Artwork:class extends ae{static get instanceClassName(){return"Artwork"}init(){this.isLegacy&&this.replace()}get proxy(){return Object.assign(super.proxy,{replace:this.replace.bind(this)})}fetch(){this.xlink=this.node.getAttribute("href");const e=this.xlink.split("#");this.svgUrl=e[0],this.svgName=e[1];const t=new XMLHttpRequest;t.onload=()=>{const e=(new DOMParser).parseFromString(t.responseText,"text/html");this.realSvgContent=e.getElementById(this.svgName),this.realSvgContent&&(this.realSvgContent.classList.add(this.node.classList),this.replace())},t.open("GET",this.svgUrl),t.send()}replace(){this.realSvgContent?this.node.parentNode.replaceChild(this.realSvgContent,this.node):this.fetch()}},ArtworkSelector:Se,AssessFile:class extends ae{static get instanceClassName(){return"AssessFile"}init(){this.lang=this.getLang(this.node),this.href=this.getAttribute("href"),this.hreflang=this.getAttribute("hreflang"),this.file={},this.gather(),this.addAscent(ye.ADDED,this.update.bind(this)),this.addDescent(ye.ADDED,this.update.bind(this))}getFileLength(){void 0!==this.href?fetch(this.href,{method:"HEAD",mode:"cors"}).then((e=>{this.length=e.headers.get("content-length")||-1,-1===this.length&&h.warn("File size unknown: "+this.href+'\nUnable to get HTTP header: "content-length"'),this.gather()})):this.length=-1}mutate(e){-1!==e.indexOf("href")&&(this.href=this.getAttribute("href"),this.getFileLength()),-1!==e.indexOf("hreflang")&&(this.hreflang=this.getAttribute("hreflang"),this.gather())}gather(){if(this.isLegacy&&(this.length=-1),this.length){if(this.details=[],this.href){const e=this.parseExtension(this.href);e&&this.details.push(e.toUpperCase())}-1!==this.length&&this.details.push(this.bytesToSize(this.length)),this.hreflang&&this.details.push(this.getLangDisplayName(this.hreflang)),this.update()}else this.getFileLength()}update(){this.details&&(this.descend(ye.UPDATE,this.details),this.ascend(ye.UPDATE,this.details))}getLang(e){return e.lang?e.lang:document.documentElement===e?window.navigator.language:this.getLang(e.parentElement)}parseExtension(e){return e.match(/\.(\w{1,9})(?:$|[?#])/)[0].replace(".","")}getLangDisplayName(e){if(this.isLegacy)return e;const t=new Intl.DisplayNames([this.lang],{type:"language"}).of(e);return t.charAt(0).toUpperCase()+t.slice(1)}bytesToSize(e){if(-1===e)return null;let t=["octets","ko","Mo","Go","To"];"bytes"===this.getAttribute(p.attr("assess-file"))&&(t=["bytes","KB","MB","GB","TB"]);const s=parseInt(Math.floor(Math.log(e)/Math.log(1e3)),10);if(0===s)return`${e} ${t[s]}`;const i=e/1e3**s,n=Math.round(100*(i+Number.EPSILON))/100;return`${String(n).replace(".",",")} ${t[s]}`}},AssessDetail:class extends ae{static get instanceClassName(){return"AssessDetail"}init(){this.addDescent(ye.UPDATE,this.update.bind(this)),this.ascend(ye.ADDED)}update(e){this.node.innerHTML=e.join(" - ")}},AssessEmission:ye,AssessSelector:ve,Ratio:class extends ae{static get instanceClassName(){return"Ratio"}init(){if(!Le.internals.support.supportAspectRatio()){this.ratio=16/9;for(const e in this.classNames)if(this.registration.selector.indexOf(this.classNames[e])>0){const t=this.classNames[e].split("ratio-");t[1]&&(this.ratio=t[1].split("x")[0]/t[1].split("x")[1])}this.isRendering=!0,this.update()}}render(){this.getRect().width!==this.currentWidth&&this.update()}update(){this.currentWidth=this.getRect().width,this.style.height=this.currentWidth/this.ratio+"px"}},RatioSelector:we,Placement:class extends ae{constructor(e=Pe.AUTO,t=[xe.BOTTOM,xe.TOP,xe.LEFT,xe.RIGHT],s=[Oe.CENTER,Oe.START,Oe.END],i=16){super(),this._mode=e,this._places=t,this._aligns=s,this._safeAreaMargin=i,this._isShown=!1}static get instanceClassName(){return"Placement"}init(){this.isResizing=!0}get proxy(){const e=this,t=Object.assign(super.proxy,{show:e.show.bind(e),hide:e.hide.bind(e)});return Q(t,{get mode(){return e.mode},set mode(t){e.mode=t},get place(){return e.place},set place(t){e.place=t},get align(){return e.align},set align(t){e.align=t},get isShown(){return e.isShown},set isShown(t){e.isShown=t}})}get mode(){return this._mode}set mode(e){this._mode=e}get place(){return this._place}set place(e){if(this._place!==e){switch(this._place){case xe.TOP:this.removeClass(Re.TOP);break;case xe.RIGHT:this.removeClass(Re.RIGHT);break;case xe.BOTTOM:this.removeClass(Re.BOTTOM);break;case xe.LEFT:this.removeClass(Re.LEFT)}switch(this._place=e,this._place){case xe.TOP:this.addClass(Re.TOP);break;case xe.RIGHT:this.addClass(Re.RIGHT);break;case xe.BOTTOM:this.addClass(Re.BOTTOM);break;case xe.LEFT:this.addClass(Re.LEFT)}}}get align(){return this._align}set align(e){if(this._align!==e){switch(this._align){case Oe.START:this.removeClass(Ie.START);break;case Oe.CENTER:this.removeClass(Ie.CENTER);break;case Oe.END:this.removeClass(Ie.END)}switch(this._align=e,this._align){case Oe.START:this.addClass(Ie.START);break;case Oe.CENTER:this.addClass(Ie.CENTER);break;case Oe.END:this.addClass(Ie.END)}}}show(){this.isShown=!0}hide(){this.isShown=!1}get isShown(){return this._isShown}set isShown(e){this._isShown!==e&&this.isEnabled&&(this.isRendering=e,this._isShown=e)}setReferent(e){this._referent=e}resize(){this.safeArea={top:this._safeAreaMargin,right:window.innerWidth-this._safeAreaMargin,bottom:window.innerHeight-this._safeAreaMargin,left:this._safeAreaMargin,center:.5*window.innerWidth,middle:.5*window.innerHeight}}render(){if(!this._referent)return;if(this.rect=this.getRect(),this.referentRect=this._referent.getRect(),this.mode===Pe.AUTO)switch(this.place=this.getPlace(),this.place){case xe.TOP:case xe.BOTTOM:this.align=this.getHorizontalAlign();break;case xe.LEFT:case xe.RIGHT:this.align=this.getVerticalAlign()}let e,t;switch(this.place){case xe.TOP:t=this.referentRect.top-this.rect.height;break;case xe.RIGHT:e=this.referentRect.right;break;case xe.BOTTOM:t=this.referentRect.bottom;break;case xe.LEFT:e=this.referentRect.left-this.rect.width}switch(this.place){case xe.TOP:case xe.BOTTOM:switch(this.align){case Oe.CENTER:e=this.referentRect.center-.5*this.rect.width;break;case Oe.START:e=this.referentRect.left;break;case Oe.END:e=this.referentRect.right-this.rect.width}break;case xe.RIGHT:case xe.LEFT:switch(this.align){case Oe.CENTER:t=this.referentRect.middle-.5*this.rect.height;break;case Oe.START:t=this.referentRect.top;break;case Oe.END:t=this.referentRect.bottom-this.rect.height}}this._x===e&&this._y===t||(this._x=e+.5|0,this._y=t+.5|0,this.node.style.transform=`translate(${this._x}px,${this._y}px)`)}getPlace(){for(const e of this._places)switch(e){case xe.TOP:if(this.referentRect.top-this.rect.height>this.safeArea.top)return xe.TOP;break;case xe.RIGHT:if(this.referentRect.right+this.rect.width<this.safeArea.right)return xe.RIGHT;break;case xe.BOTTOM:if(this.referentRect.bottom+this.rect.height<this.safeArea.bottom)return xe.BOTTOM;break;case xe.LEFT:if(this.referentRect.left-this.rect.width>this.safeArea.left)return xe.LEFT}return this._places[0]}getHorizontalAlign(){for(const e of this._aligns)switch(e){case Oe.CENTER:if(this.referentRect.center-.5*this.rect.width>this.safeArea.left&&this.referentRect.center+.5*this.rect.width<this.safeArea.right)return Oe.CENTER;break;case Oe.START:if(this.referentRect.left+this.rect.width<this.safeArea.right)return Oe.START;break;case Oe.END:if(this.referentRect.right-this.rect.width>this.safeArea.left)return Oe.END}return this._aligns[0]}getVerticalAlign(){for(const e of this._aligns)switch(e){case Oe.CENTER:if(this.referentRect.middle-.5*this.rect.height>this.safeArea.top&&this.referentRect.middle+.5*this.rect.height<this.safeArea.bottom)return Oe.CENTER;break;case Oe.START:if(this.referentRect.top+this.rect.height<this.safeArea.bottom)return Oe.START;break;case Oe.END:if(this.referentRect.bottom-this.rect.height>this.safeArea.top)return Oe.END}return this._aligns[0]}dispose(){this._referent=null,super.dispose()}},PlacementReferent:class extends ae{constructor(){super(),this._isShown=!1}static get instanceClassName(){return"PlacementReferent"}init(){this.registration.creator.setReferent(this),this._placement=this.registration.creator}get placement(){return this._placement}get isShown(){return this._isShown}set isShown(e){this._isShown!==e&&this.isEnabled&&(this._isShown=e,e?this.registration.creator.show():this.registration.creator.hide())}show(){this.isShown=!0}hide(){this.isShown=!1}},PlacementAlign:Oe,PlacementPosition:xe,PlacementMode:Pe},te.internals.register(te.core.CollapseSelector.COLLAPSE,te.core.Collapse),te.internals.register(te.core.InjectSvgSelector.INJECT_SVG,te.core.InjectSvg),te.internals.register(te.core.RatioSelector.RATIO,te.core.Ratio),te.internals.register(te.core.AssessSelector.ASSESS_FILE,te.core.AssessFile),te.internals.register(te.core.AssessSelector.DETAIL,te.core.AssessDetail);const ke={SYSTEM:"system",LIGHT:"light",DARK:"dark"},Me={THEME:Le.internals.ns.attr("theme"),SCHEME:Le.internals.ns.attr("scheme"),TRANSITION:Le.internals.ns.attr("transition")},Ge={LIGHT:"light",DARK:"dark"},$e={SCHEME:Le.internals.ns.emission("scheme","scheme"),THEME:Le.internals.ns.emission("scheme","theme"),ASK:Le.internals.ns.emission("scheme","ask")},He={SCHEME:Le.internals.ns.event("scheme"),THEME:Le.internals.ns.event("theme")};class Ue extends Le.core.Instance{constructor(){super(!1)}static get instanceClassName(){return"Scheme"}init(){this.changing=this.change.bind(this),this.hasAttribute(Me.TRANSITION)&&(this.removeAttribute(Me.TRANSITION),this.request(this.restoreTransition.bind(this)));const e=Le.internals.support.supportLocalStorage()?localStorage.getItem("scheme"):"",t=this.getAttribute(Me.SCHEME);switch(e){case ke.DARK:case ke.LIGHT:case ke.SYSTEM:this.scheme=e;break;default:switch(t){case ke.DARK:this.scheme=ke.DARK;break;case ke.LIGHT:this.scheme=ke.LIGHT;break;default:this.scheme=ke.SYSTEM}}this.addAscent($e.ASK,this.ask.bind(this)),this.addAscent($e.SCHEME,this.apply.bind(this))}get proxy(){const e=this,t={get scheme(){return e.scheme},set scheme(t){e.scheme=t}};return Le.internals.property.completeAssign(super.proxy,t)}restoreTransition(){this.setAttribute(Me.TRANSITION,"")}ask(){this.descend($e.SCHEME,this.scheme)}apply(e){this.scheme=e}get scheme(){return this._scheme}set scheme(e){if(this._scheme!==e){switch(this._scheme=e,e){case ke.SYSTEM:this.listenPreferences();break;case ke.DARK:this.unlistenPreferences(),this.theme=Ge.DARK;break;case ke.LIGHT:this.unlistenPreferences(),this.theme=Ge.LIGHT;break;default:return void(this.scheme=ke.SYSTEM)}this.descend($e.SCHEME,e),Le.internals.support.supportLocalStorage()&&localStorage.setItem("scheme",e),this.setAttribute(Me.SCHEME,e),this.dispatch(He.SCHEME,{scheme:this._scheme})}}get theme(){return this._theme}set theme(e){if(this._theme!==e)switch(e){case Ge.LIGHT:case Ge.DARK:this._theme=e,this.setAttribute(Me.THEME,e),this.descend($e.THEME,e),this.dispatch(He.THEME,{theme:this._theme}),document.documentElement.style.colorScheme=e===Ge.DARK?"dark":""}}listenPreferences(){this.isListening||(this.isListening=!0,this.mediaQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.mediaQuery.addEventListener&&this.mediaQuery.addEventListener("change",this.changing),this.change())}unlistenPreferences(){this.isListening&&(this.isListening=!1,this.mediaQuery.removeEventListener("change",this.changing),this.mediaQuery=null)}change(){this.isListening&&(this.theme=this.mediaQuery.matches?Ge.DARK:Ge.LIGHT)}mutate(e){e.indexOf(Me.SCHEME)>-1&&(this.scheme=this.getAttribute(Me.SCHEME)),e.indexOf(Me.THEME)>-1&&(this.theme=this.getAttribute(Me.THEME))}dispose(){this.unlistenPreferences()}}const Be={SCHEME:`:root${Le.internals.ns.attr.selector("theme")}, :root${Le.internals.ns.attr.selector("scheme")}`,SWITCH_THEME:Le.internals.ns.selector("switch-theme"),RADIO_BUTTONS:`input[name="${Le.internals.ns("radios-theme")}"]`};Le.scheme={Scheme:Ue,SchemeValue:ke,SchemeSelector:Be,SchemeEmission:$e,SchemeTheme:Ge,SchemeEvent:He},Le.internals.register(Le.scheme.SchemeSelector.SCHEME,Le.scheme.Scheme);const Fe=Le.internals.ns.selector("accordion"),We=Le.internals.ns.selector("collapse"),qe={GROUP:Le.internals.ns.selector("accordions-group"),ACCORDION:Fe,COLLAPSE:`${Fe} > ${We}, ${Fe} > *:not(${Fe}):not(${We}) > ${We}, ${Fe} > *:not(${Fe}):not(${We}) > *:not(${Fe}):not(${We}) > ${We}`,COLLAPSE_LEGACY:`${Fe} ${We}`,BUTTON:`${Fe}__btn`};class ze extends Le.core.Instance{static get instanceClassName(){return"Accordion"}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(qe.BUTTON)))[0]}}class je extends Le.core.CollapsesGroup{static get instanceClassName(){return"AccordionsGroup"}validate(e){const t=e.node.matches(Le.internals.legacy.isLegacy?qe.COLLAPSE_LEGACY:qe.COLLAPSE);return super.validate(e)&&t}}Le.accordion={Accordion:ze,AccordionSelector:qe,AccordionsGroup:je},Le.internals.register(Le.accordion.AccordionSelector.GROUP,Le.accordion.AccordionsGroup),Le.internals.register(Le.accordion.AccordionSelector.ACCORDION,Le.accordion.Accordion);const Ve={EQUISIZED_BUTTON:`${Le.internals.ns.selector("btns-group--equisized")} ${Le.internals.ns.selector("btn")}`,EQUISIZED_GROUP:Le.internals.ns.selector("btns-group--equisized")};Le.button={ButtonSelector:Ve},Le.internals.register(Le.button.ButtonSelector.EQUISIZED_BUTTON,Le.core.Equisized),Le.internals.register(Le.button.ButtonSelector.EQUISIZED_GROUP,Le.core.EquisizedsGroup);class Ke extends Le.core.Instance{static get instanceClassName(){return"CardDownload"}init(){this.addAscent(Le.core.AssessEmission.UPDATE,(e=>{this.descend(Le.core.AssessEmission.UPDATE,e)})),this.addAscent(Le.core.AssessEmission.ADDED,(()=>{this.descend(Le.core.AssessEmission.ADDED)}))}}const Ye={DOWNLOAD:Le.internals.ns.selector("card--download"),DOWNLOAD_DETAIL:`${Le.internals.ns.selector("card--download")} ${Le.internals.ns.selector("card__end")} ${Le.internals.ns.selector("card__detail")}`};Le.card={CardSelector:Ye,CardDownload:Ke},Le.internals.register(Le.card.CardSelector.DOWNLOAD,Le.card.CardDownload),Le.internals.register(Le.card.CardSelector.DOWNLOAD_DETAIL,Le.core.AssessDetail);const Xe={SEGMENTED:Le.internals.ns.selector("segmented"),SEGMENTED_ELEMENTS:Le.internals.ns.selector("segmented__elements"),SEGMENTED_ELEMENT:Le.internals.ns.selector("segmented__element input"),SEGMENTED_LEGEND:Le.internals.ns.selector("segmented__legend")},Qe={ADDED:Le.internals.ns.emission("segmented","added"),REMOVED:Le.internals.ns.emission("segmented","removed")};class Je extends Le.core.Instance{static get instanceClassName(){return"Segmented"}init(){this.elements=this.node.querySelector(Xe.SEGMENTED_ELEMENTS),this.legend=this.node.querySelector(Xe.SEGMENTED_LEGEND),this.addAscent(Qe.ADDED,this.resize.bind(this)),this.addAscent(Qe.REMOVED,this.resize.bind(this)),this._isLegendInline=this.legend&&this.legend.classList.contains(`${Le.prefix}-segmented__legend--inline`),this.isResizing=!0}resize(){const e=`${Le.prefix}-segmented--vertical`,t=`${Le.prefix}-segmented__legend--inline`;this.removeClass(e),this._isLegendInline&&(this.legend.classList.add(t),(this.node.offsetWidth>this.node.parentNode.offsetWidth||this.elements.scrollWidth+this.legend.offsetWidth+16>this.node.parentNode.offsetWidth)&&this.legend.classList.remove(t)),this.elements.offsetWidth>this.node.parentNode.offsetWidth||this.elements.scrollWidth>this.node.parentNode.offsetWidth?this.addClass(e):this.removeClass(e)}}class Ze extends Le.core.Instance{static get instanceClassName(){return"SegmentedElement"}init(){this.ascend(Qe.ADDED)}dispose(){this.ascend(Qe.REMOVED)}}Le.segmented={SegmentedSelector:Xe,SegmentedEmission:Qe,SegmentedElement:Ze,Segmented:Je},Le.internals.register(Le.segmented.SegmentedSelector.SEGMENTED,Le.segmented.Segmented),Le.internals.register(Le.segmented.SegmentedSelector.SEGMENTED_ELEMENT,Le.segmented.SegmentedElement);const et={BREADCRUMB:Le.internals.ns.selector("breadcrumb"),BUTTON:Le.internals.ns.selector("breadcrumb__button")};class tt extends Le.core.Instance{constructor(){super(),this.count=0,this.focusing=this.focus.bind(this)}static get instanceClassName(){return"Breadcrumb"}init(){this.getCollapse(),this.isResizing=!0}get proxy(){const e=this;return Object.assign(super.proxy,{focus:e.focus.bind(e),disclose:e.collapse.disclose.bind(e.collapse)})}getCollapse(){const e=this.collapse;e?e.listen(Le.core.DisclosureEvent.DISCLOSE,this.focusing):this.addAscent(Le.core.DisclosureEmission.ADDED,this.getCollapse.bind(this))}resize(){const e=this.collapse,t=this.links;e&&t.length&&(this.isBreakpoint(Le.core.Breakpoints.MD)?e.buttonHasFocus&&t[0].focus():t.indexOf(document.activeElement)>-1&&e.focus())}get links(){return[...this.querySelectorAll("a[href]")]}get collapse(){return this.element.getDescendantInstances(Le.core.Collapse.instanceClassName,null,!0)[0]}focus(){this.count=0,this._focus()}_focus(){const e=this.links[0];e&&(e.focus(),this.request(this.verify.bind(this)))}verify(){if(this.count++,this.count>100)return;const e=this.links[0];e&&document.activeElement!==e&&this._focus()}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(et.BUTTON)))[0]}}Le.breadcrumb={BreadcrumbSelector:et,Breadcrumb:tt},Le.internals.register(Le.breadcrumb.BreadcrumbSelector.BREADCRUMB,Le.breadcrumb.Breadcrumb);const st={TOOLTIP:Le.internals.ns.selector("tooltip"),SHOWN:Le.internals.ns.selector("tooltip--shown"),BUTTON:Le.internals.ns.selector("btn--tooltip")},it=1,nt=2;class rt extends Le.core.PlacementReferent{constructor(){super(),this._state=0}static get instanceClassName(){return"TooltipReferent"}init(){if(super.init(),this.listen("focusin",this.focusIn.bind(this)),this.listen("focusout",this.focusOut.bind(this)),!this.matches(st.BUTTON)){const e=this.mouseover.bind(this);this.listen("mouseover",e),this.placement.listen("mouseover",e);const t=this.mouseout.bind(this);this.listen("mouseout",t),this.placement.listen("mouseout",t)}this.addEmission(Le.core.RootEmission.KEYDOWN,this._keydown.bind(this)),this.listen("click",this._click.bind(this)),this.addEmission(Le.core.RootEmission.CLICK,this._clickOut.bind(this))}_click(){this.focus()}_clickOut(e){this.node.contains(e)||this.blur()}_keydown(e){if(e===Le.core.KeyCodes.ESCAPE)this.blur(),this.close()}close(){this.state=0}get state(){return this._state}set state(e){this._state!==e&&(this.isShown=e>0,this._state=e)}focusIn(){this.state|=it}focusOut(){this.state&=~it}mouseover(){this.state|=nt}mouseout(){this.state&=~nt}}const at={SHOW:p.event("show"),HIDE:p.event("hide")},ot="hidden",ht="shown",ct="hiding";class lt extends Le.core.Placement{constructor(){super(Le.core.PlacementMode.AUTO,[Le.core.PlacementPosition.TOP,Le.core.PlacementPosition.BOTTOM],[Le.core.PlacementAlign.CENTER,Le.core.PlacementAlign.START,Le.core.PlacementAlign.END]),this.modifier="",this._state=ot}static get instanceClassName(){return"Tooltip"}init(){super.init(),this.register(`[aria-describedby="${this.id}"]`,rt),this.listen("transitionend",this.transitionEnd.bind(this))}transitionEnd(){this._state===ct&&(this._state=ot,this.isShown=!1)}get isShown(){return super.isShown}set isShown(e){if(this.isEnabled)switch(!0){case e:this._state=ht,this.addClass(st.SHOWN),this.dispatch(at.SHOW),super.isShown=!0;break;case this.isShown&&!e&&this._state===ht:this._state=ct,this.removeClass(st.SHOWN);break;case this.isShown&&!e&&this._state===ot:this.dispatch(at.HIDE),super.isShown=!1}}render(){super.render();let e=this.referentRect.center-this.rect.center;const t=.5*this.rect.width-8;e<-t&&(e=-t),e>t&&(e=t),this.setProperty("--arrow-x",`${e.toFixed(2)}px`)}}Le.tooltip={Tooltip:lt,TooltipSelector:st,TooltipEvent:at},Le.internals.register(Le.tooltip.TooltipSelector.TOOLTIP,Le.tooltip.Tooltip);class dt extends Le.core.Instance{static get instanceClassName(){return"ToggleInput"}get isChecked(){return this.node.checked}}class ut extends Le.core.Instance{static get instanceClassName(){return"ToggleStatusLabel"}init(){this.register(`input[id="${this.getAttribute("for")}"]`,dt),this.update(),this.isSwappingFont=!0}get proxy(){return Object.assign(super.proxy,{update:this.update.bind(this)})}get input(){return this.getRegisteredInstances("ToggleInput")[0]}update(){this.node.style.removeProperty("--toggle-status-width");const e=this.input.isChecked,t=getComputedStyle(this.node,":before");let s=parseFloat(t.width);this.input.node.checked=!e;const i=getComputedStyle(this.node,":before"),n=parseFloat(i.width);n>s&&(s=n),this.input.node.checked=e,this.node.style.setProperty("--toggle-status-width",s/16+"rem")}swapFont(e){this.update()}}const gt={STATUS_LABEL:`${Le.internals.ns.selector("toggle__label")}${Le.internals.ns.attr.selector("checked-label")}${Le.internals.ns.attr.selector("unchecked-label")}`};Le.toggle={ToggleStatusLabel:ut,ToggleSelector:gt},Le.internals.register(Le.toggle.ToggleSelector.STATUS_LABEL,Le.toggle.ToggleStatusLabel);const pt=Le.internals.ns.selector("sidemenu__item"),mt=Le.internals.ns.selector("collapse"),_t={LIST:Le.internals.ns.selector("sidemenu__list"),COLLAPSE:`${pt} > ${mt}, ${pt} > *:not(${pt}):not(${mt}) > ${mt}, ${pt} > *:not(${pt}):not(${mt}) > *:not(${pt}):not(${mt}) > ${mt}`,COLLAPSE_LEGACY:`${pt} ${mt}`,ITEM:Le.internals.ns.selector("sidemenu__item"),BUTTON:Le.internals.ns.selector("sidemenu__btn")};class bt extends Le.core.CollapsesGroup{static get instanceClassName(){return"SidemenuList"}validate(e){return super.validate(e)&&e.node.matches(Le.internals.legacy.isLegacy?_t.COLLAPSE_LEGACY:_t.COLLAPSE)}}class Et extends Le.core.Instance{static get instanceClassName(){return"SidemenuItem"}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(_t.BUTTON)))[0]}}Le.sidemenu={SidemenuList:bt,SidemenuItem:Et,SidemenuSelector:_t},Le.internals.register(Le.sidemenu.SidemenuSelector.LIST,Le.sidemenu.SidemenuList),Le.internals.register(Le.sidemenu.SidemenuSelector.ITEM,Le.sidemenu.SidemenuItem);const ft={MODAL:Le.internals.ns.selector("modal"),SCROLL_DIVIDER:Le.internals.ns.selector("scroll-divider"),BODY:Le.internals.ns.selector("modal__body"),TITLE:Le.internals.ns.selector("modal__title")};class At extends Le.core.DisclosureButton{constructor(){super(Le.core.DisclosureType.OPENED)}static get instanceClassName(){return"ModalButton"}}const Tt={CONCEALING_BACKDROP:Le.internals.ns.attr("concealing-backdrop")};class St extends Le.core.Disclosure{constructor(){super(Le.core.DisclosureType.OPENED,ft.MODAL,At,"ModalsGroup"),this._isActive=!1,this.scrolling=this.resize.bind(this,!1),this.resizing=this.resize.bind(this,!0)}static get instanceClassName(){return"Modal"}init(){super.init(),this._isDialog="DIALOG"===this.node.tagName,this.isScrolling=!1,this.listenClick(),this.addEmission(Le.core.RootEmission.KEYDOWN,this._keydown.bind(this))}_keydown(e){if(e===Le.core.KeyCodes.ESCAPE)this._escape()}_escape(){switch(document.activeElement?document.activeElement.tagName:void 0){case"INPUT":case"LABEL":case"TEXTAREA":case"SELECT":case"AUDIO":case"VIDEO":break;default:this.isDisclosed&&(this.conceal(),this.focus())}}retrieved(){this._ensureAccessibleName()}get body(){return this.element.getDescendantInstances("ModalBody","Modal")[0]}handleClick(e){e.target===this.node&&"false"!==this.getAttribute(Tt.CONCEALING_BACKDROP)&&this.conceal()}disclose(e){return!!super.disclose(e)&&(this.body&&this.body.activate(),this.isScrollLocked=!0,this.setAttribute("aria-modal","true"),this.setAttribute("open","true"),this._isDialog||this.activateModal(),!0)}conceal(e,t){return!!super.conceal(e,t)&&(this.isScrollLocked=!1,this.removeAttribute("aria-modal"),this.removeAttribute("open"),this.body&&this.body.deactivate(),this._isDialog||this.deactivateModal(),!0)}get isDialog(){return this._isDialog}set isDialog(e){this._isDialog=e}activateModal(){this._isActive||(this._isActive=!0,this._hasDialogRole="dialog"===this.getAttribute("role"),this._hasDialogRole||this.setAttribute("role","dialog"))}deactivateModal(){this._isActive&&(this._isActive=!1,this._hasDialogRole||this.removeAttribute("role"))}_setAccessibleName(e,t){const s=this.retrieveNodeId(e,t);this.warn(`add reference to ${t} for accessible name (aria-labelledby)`),this.setAttribute("aria-labelledby",s)}_ensureAccessibleName(){if(this.hasAttribute("aria-labelledby")||this.hasAttribute("aria-label"))return;this.warn("missing accessible name");const e=this.node.querySelector(ft.TITLE),t=this.primaryButtons[0];switch(!0){case null!==e:this._setAccessibleName(e,"title");break;case void 0!==t:this.warn("missing required title, fallback to primary button"),this._setAccessibleName(t,"primary")}}}const vt=['[tabindex="0"]',"a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details","iframe"].join(),yt=['[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'].join(),Ct=(e,t)=>{if(!(e instanceof Element))return!1;const s=window.getComputedStyle(e);if(!s)return!1;if("hidden"===s.visibility)return!1;for(void 0===t&&(t=e);t.contains(e);){if("none"===s.display)return!1;e=e.parentElement}return!0};class Nt{constructor(e,t){this.element=null,this.activeElement=null,this.onTrap=e,this.onUntrap=t,this.waiting=this.wait.bind(this),this.handling=this.handle.bind(this),this.focusing=this.maintainFocus.bind(this),this.current=null}get trapped(){return null!==this.element}trap(e){this.trapped&&this.untrap(),this.element=e,this.isTrapping=!0,this.wait(),this.onTrap&&this.onTrap()}wait(){Ct(this.element)?this.trapping():window.requestAnimationFrame(this.waiting)}trapping(){if(!this.isTrapping)return;this.isTrapping=!1;const e=this.focusables;e.length&&-1===e.indexOf(document.activeElement)&&e[0].focus(),this.element.setAttribute("aria-modal",!0),window.addEventListener("keydown",this.handling),document.body.addEventListener("focus",this.focusing,!0)}stun(e){for(const t of e.children)t!==this.element&&(t.contains(this.element)?this.stun(t):this.stunneds.push(new Dt(t)))}maintainFocus(e){if(!this.element.contains(e.target)){const t=this.focusables;if(0===t.length)return;const s=t[0];e.preventDefault(),s.focus()}}handle(e){if(9!==e.keyCode)return;const t=this.focusables;if(0===t.length)return;const s=t[0],i=t[t.length-1],n=t.indexOf(document.activeElement);e.shiftKey?!this.element.contains(document.activeElement)||n<1?(e.preventDefault(),i.focus()):(document.activeElement.tabIndex>0||t[n-1].tabIndex>0)&&(e.preventDefault(),t[n-1].focus()):this.element.contains(document.activeElement)&&n!==t.length-1&&-1!==n?document.activeElement.tabIndex>0&&(e.preventDefault(),t[n+1].focus()):(e.preventDefault(),s.focus())}get focusables(){let e=Le.internals.dom.querySelectorAllArray(this.element,vt);const t=Le.internals.dom.querySelectorAllArray(document.documentElement,'input[type="radio"]');if(t.length){const s={};for(const e of t){const t=e.getAttribute("name");void 0===s[t]&&(s[t]=new wt(t)),s[t].push(e)}e=e.filter((e=>{if("input"!==e.tagName.toLowerCase()||"radio"!==e.getAttribute("type").toLowerCase())return!0;const t=e.getAttribute("name");return s[t].keep(e)}))}const s=Le.internals.dom.querySelectorAllArray(this.element,yt);s.sort(((e,t)=>e.tabIndex-t.tabIndex));const i=e.filter((e=>-1===s.indexOf(e)));return s.concat(i).filter((e=>"-1"!==e.tabIndex&&Ct(e,this.element)))}untrap(){this.trapped&&(this.isTrapping=!1,this.element.removeAttribute("aria-modal"),window.removeEventListener("keydown",this.handling),document.body.removeEventListener("focus",this.focusing,!0),this.element=null,this.onUntrap&&this.onUntrap())}dispose(){this.untrap()}}class Dt{constructor(e){this.element=e,this.inert=e.getAttribute("inert"),this.element.setAttribute("inert","")}unstun(){null===this.inert?this.element.removeAttribute("inert"):this.element.setAttribute("inert",this.inert)}}class wt{constructor(e){this.name=e,this.buttons=[]}push(e){this.buttons.push(e),(e===document.activeElement||e.checked||void 0===this.selected)&&(this.selected=e)}keep(e){return this.selected===e}}class Lt extends Le.core.DisclosuresGroup{constructor(){super("Modal",!1),this.focusTrap=new Nt}static get instanceClassName(){return"ModalsGroup"}apply(e,t){super.apply(e,t),null===this.current?this.focusTrap.untrap():this.focusTrap.trap(this.current.node)}}class Rt extends Le.core.Instance{static get instanceClassName(){return"ModalBody"}init(){this.listen("scroll",this.divide.bind(this))}activate(){this.isResizing=!0,this.resize()}deactivate(){this.isResizing=!1}divide(){this.node.scrollHeight>this.node.clientHeight?this.node.offsetHeight+this.node.scrollTop>=this.node.scrollHeight?this.removeClass(ft.SCROLL_DIVIDER):this.addClass(ft.SCROLL_DIVIDER):this.removeClass(ft.SCROLL_DIVIDER)}resize(){this.adjust(),this.request(this.adjust.bind(this))}adjust(){const e=32*(this.isBreakpoint(Le.core.Breakpoints.MD)?2:1);this.isLegacy?this.style.maxHeight=window.innerHeight-e+"px":this.style.setProperty("--modal-max-height",window.innerHeight-e+"px"),this.divide()}}Le.modal={Modal:St,ModalButton:At,ModalBody:Rt,ModalsGroup:Lt,ModalSelector:ft},Le.internals.register(Le.modal.ModalSelector.MODAL,Le.modal.Modal),Le.internals.register(Le.modal.ModalSelector.BODY,Le.modal.ModalBody),Le.internals.register(Le.core.RootSelector.ROOT,Le.modal.ModalsGroup);const It={TOGGLE:Le.internals.ns.emission("password","toggle"),ADJUST:Le.internals.ns.emission("password","adjust")};class xt extends Le.core.Instance{static get instanceClassName(){return"PasswordToggle"}init(){this.listenClick(),this.ascend(It.ADJUST,this.width),this.isSwappingFont=!0,this._isChecked=this.isChecked}get width(){const e=getComputedStyle(this.node.parentNode);return parseInt(e.width)}get isChecked(){return this.node.checked}set isChecked(e){this._isChecked=e,this.ascend(It.TOGGLE,e)}handleClick(){this.isChecked=!this._isChecked}swapFont(e){this.ascend(It.ADJUST,this.width)}}class Ot extends Le.core.Instance{static get instanceClassName(){return"Password"}init(){this.addAscent(It.TOGGLE,this.toggle.bind(this)),this.addAscent(It.ADJUST,this.adjust.bind(this))}toggle(e){this.descend(It.TOGGLE,e)}adjust(e){this.descend(It.ADJUST,e)}}const Pt={PASSWORD:Le.internals.ns.selector("password"),INPUT:Le.internals.ns.selector("password__input"),LABEL:Le.internals.ns.selector("password__label"),TOOGLE:`${Le.internals.ns.selector("password__checkbox")} input[type="checkbox"]`};class kt extends Le.core.Instance{static get instanceClassName(){return"PasswordInput"}init(){this.addDescent(It.TOGGLE,this.toggle.bind(this)),this._isRevealed="password"===this.hasAttribute("type"),this.listen("keydown",this.capslock.bind(this)),this.listen("keyup",this.capslock.bind(this))}toggle(e){this.isRevealed=e,this.setAttribute("type",e?"text":"password")}get isRevealed(){return this._isRevealed}capslock(e){e&&"function"!=typeof e.getModifierState||(e.getModifierState("CapsLock")?this.node.parentNode.setAttribute(Le.internals.ns.attr("capslock"),""):this.node.parentNode.removeAttribute(Le.internals.ns.attr("capslock")))}set isRevealed(e){this._isRevealed=e,this.setAttribute("type",e?"text":"password")}}class Mt extends Le.core.Instance{static get instanceClassName(){return"PasswordLabel"}init(){this.addDescent(It.ADJUST,this.adjust.bind(this))}adjust(e){const t=Math.ceil(e/16);this.node.style.paddingRight=t+"rem"}}Le.password={Password:Ot,PasswordToggle:xt,PasswordSelector:Pt,PasswordInput:kt,PasswordLabel:Mt},Le.internals.register(Le.password.PasswordSelector.INPUT,Le.password.PasswordInput),Le.internals.register(Le.password.PasswordSelector.PASSWORD,Le.password.Password),Le.internals.register(Le.password.PasswordSelector.TOOGLE,Le.password.PasswordToggle),Le.internals.register(Le.password.PasswordSelector.LABEL,Le.password.PasswordLabel);const Gt=Le.internals.ns.selector("nav__item"),$t=Le.internals.ns.selector("collapse"),Ht={NAVIGATION:Le.internals.ns.selector("nav"),COLLAPSE:`${Gt} > ${$t}, ${Gt} > *:not(${Gt}):not(${$t}) > ${$t}, ${Gt} > *:not(${Gt}):not(${$t}) > *:not(${Gt}):not(${$t}) > ${$t}`,COLLAPSE_LEGACY:`${Gt} ${$t}`,ITEM:Gt,ITEM_RIGHT:`${Gt}--align-right`,MENU:Le.internals.ns.selector("menu"),BUTTON:Le.internals.ns.selector("nav__btn"),TRANSLATE_BUTTON:Le.internals.ns.selector("translate__btn")};class Ut extends Le.core.Instance{constructor(){super(),this._isRightAligned=!1}static get instanceClassName(){return"NavigationItem"}init(){this.addAscent(Le.core.DisclosureEmission.ADDED,this.calculate.bind(this)),this.addAscent(Le.core.DisclosureEmission.REMOVED,this.calculate.bind(this)),this.isResizing=!0,this.calculate()}resize(){this.calculate()}calculate(){const e=this.element.getDescendantInstances(Le.core.Collapse.instanceClassName,null,!0)[0];if(e&&this.isBreakpoint(Le.core.Breakpoints.LG)&&e.element.node.matches(Ht.MENU)){const t=this.element.node.parentElement.getBoundingClientRect().right,s=e.element.node.getBoundingClientRect().width,i=this.element.node.getBoundingClientRect().left;this.isRightAligned=i+s>t}else this.isRightAligned=!1}get isRightAligned(){return this._isRightAligned}set isRightAligned(e){this._isRightAligned!==e&&(this._isRightAligned=e,e?Le.internals.dom.addClass(this.element.node,Ht.ITEM_RIGHT):Le.internals.dom.removeClass(this.element.node,Ht.ITEM_RIGHT))}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&(e.hasClass(Ht.BUTTON)||e.hasClass(Ht.TRANSLATE_BUTTON))))[0]}}const Bt={NONE:-1,INSIDE:0,OUTSIDE:1};class Ft extends Le.core.CollapsesGroup{static get instanceClassName(){return"Navigation"}init(){super.init(),this.clicked=!1,this.out=!1,this.addEmission(Le.core.RootEmission.CLICK,this._handleRootClick.bind(this)),this.listen("mousedown",this.handleMouseDown.bind(this)),this.listenClick({capture:!0}),this.isResizing=!0}validate(e){return super.validate(e)&&e.element.node.matches(Le.internals.legacy.isLegacy?Ht.COLLAPSE_LEGACY:Ht.COLLAPSE)}handleMouseDown(e){this.isBreakpoint(Le.core.Breakpoints.LG)&&-1!==this.index&&this.current&&(this.position=this.current.node.contains(e.target)?Bt.INSIDE:Bt.OUTSIDE,this.requestPosition())}handleClick(e){!e.target.matches("a, button")||e.target.matches("[aria-controls]")||e.target.matches(Le.core.DisclosureSelector.PREVENT_CONCEAL)||(this.index=-1)}_handleRootClick(e){this.isBreakpoint(Le.core.Breakpoints.LG)&&(this.node.contains(e)||(this.out=!0,this.requestPosition()))}requestPosition(){this.isRequesting||(this.isRequesting=!0,this.request(this.getPosition.bind(this)))}getPosition(){if(this.out)switch(this.position){case Bt.OUTSIDE:this.index=-1;break;case Bt.INSIDE:this.current&&!this.current.node.contains(document.activeElement)&&this.current.focus();break;default:this.index>-1&&!this.current.hasFocus&&(this.index=-1)}this.request(this.requested.bind(this))}requested(){this.position=Bt.NONE,this.out=!1,this.isRequesting=!1}get index(){return super.index}set index(e){-1===e&&this.current&&this.current.hasFocus&&this.current.focus(),super.index=e}get canUngroup(){return!this.isBreakpoint(Le.core.Breakpoints.LG)}resize(){this.update()}}Le.navigation={Navigation:Ft,NavigationItem:Ut,NavigationMousePosition:Bt,NavigationSelector:Ht},Le.internals.register(Le.navigation.NavigationSelector.NAVIGATION,Le.navigation.Navigation),Le.internals.register(Le.navigation.NavigationSelector.ITEM,Le.navigation.NavigationItem);class Wt extends Le.core.DisclosureButton{constructor(){super(Le.core.DisclosureType.SELECT)}static get instanceClassName(){return"TabButton"}handleClick(e){super.handleClick(e),this.focus()}apply(e){super.apply(e),this.isPrimary&&(this.setAttribute("tabindex",e?"0":"-1"),e&&this.list&&this.list.focalize(this))}get list(){return this.element.getAscendantInstance("TabsList","TabsGroup")}}const qt={TAB:Le.internals.ns.selector("tabs__tab"),GROUP:Le.internals.ns.selector("tabs"),PANEL:Le.internals.ns.selector("tabs__panel"),LIST:Le.internals.ns.selector("tabs__list"),SHADOW:Le.internals.ns.selector("tabs__shadow"),SHADOW_LEFT:Le.internals.ns.selector("tabs__shadow--left"),SHADOW_RIGHT:Le.internals.ns.selector("tabs__shadow--right"),PANEL_START:Le.internals.ns.selector("tabs__panel--direction-start"),PANEL_END:Le.internals.ns.selector("tabs__panel--direction-end")},zt="direction-start",jt="direction-end",Vt="none";class Kt extends Le.core.Disclosure{constructor(){super(Le.core.DisclosureType.SELECT,qt.PANEL,Wt,"TabsGroup"),this._direction=Vt,this._isPreventingTransition=!1}static get instanceClassName(){return"TabPanel"}get direction(){return this._direction}set direction(e){if(e!==this._direction){switch(this._direction){case zt:this.removeClass(qt.PANEL_START);break;case jt:this.removeClass(qt.PANEL_END);break;case Vt:break;default:return}switch(this._direction=e,this._direction){case zt:this.addClass(qt.PANEL_START);break;case jt:this.addClass(qt.PANEL_END)}}}get isPreventingTransition(){return this._isPreventingTransition}set isPreventingTransition(e){this._isPreventingTransition!==e&&(e?this.addClass(Le.internals.motion.TransitionSelector.NONE):this.removeClass(Le.internals.motion.TransitionSelector.NONE),this._isPreventingTransition=!0===e)}translate(e,t){this.isPreventingTransition=t,this.direction=e}reset(){this.group&&this.group.retrieve(!0)}_electPrimaries(e){return this.group&&this.group.list?super._electPrimaries(e).filter((e=>this.group.list.node.contains(e.node))):[]}}const Yt="tab_keys_left",Xt="tab_keys_right",Qt="tab_keys_home",Jt="tab_keys_end",Zt={PRESS_KEY:Le.internals.ns.emission("tab","press_key"),LIST_HEIGHT:Le.internals.ns.emission("tab","list_height")};class es extends Le.core.DisclosuresGroup{constructor(){super("TabPanel")}static get instanceClassName(){return"TabsGroup"}init(){super.init(),this.listen("transitionend",this.transitionend.bind(this)),this.addAscent(Zt.PRESS_KEY,this.pressKey.bind(this)),this.addAscent(Zt.LIST_HEIGHT,this.setListHeight.bind(this)),this.isRendering=!0}getIndex(e=0){super.getIndex(e)}get list(){return this.element.getDescendantInstances("TabsList","TabsGroup",!0)[0]}setListHeight(e){this.listHeight=e}transitionend(e){this.isPreventingTransition=!0}get buttonHasFocus(){return this.members.some((e=>e.buttonHasFocus))}pressKey(e){switch(e){case Yt:this.pressLeft();break;case Xt:this.pressRight();break;case Qt:this.pressHome();break;case Jt:this.pressEnd()}}pressRight(){this.buttonHasFocus&&(this.index<this.length-1?this.index++:this.index=0,this.focus())}pressLeft(){this.buttonHasFocus&&(this.index>0?this.index--:this.index=this.length-1,this.focus())}pressHome(){this.buttonHasFocus&&(this.index=0,this.focus())}pressEnd(){this.buttonHasFocus&&(this.index=this.length-1,this.focus())}focus(){this.current&&this.current.focus()}apply(){for(let e=0;e<this._index;e++)this.members[e].translate(zt);this.current&&this.current.translate(Vt);for(let e=this._index+1;e<this.length;e++)this.members[e].translate(jt);this.isPreventingTransition=!1}get isPreventingTransition(){return this._isPreventingTransition}set isPreventingTransition(e){this._isPreventingTransition!==e&&(e?this.addClass(Le.internals.motion.TransitionSelector.NONE):this.removeClass(Le.internals.motion.TransitionSelector.NONE),this._isPreventingTransition=!0===e)}render(){if(null===this.current)return;this.node.scrollTop=0,this.node.scrollLeft=0;const e=Math.round(this.current.node.offsetHeight);this.panelHeight!==e&&(this.panelHeight=e,this.style.setProperty("--tabs-height",this.panelHeight+this.listHeight+"px"))}}class ts extends Le.core.Instance{static get instanceClassName(){return"TabsList"}init(){this.listen("scroll",this.scroll.bind(this)),this.listenKey(Le.core.KeyCodes.RIGHT,this.ascend.bind(this,Zt.PRESS_KEY,Xt),!0,!0),this.listenKey(Le.core.KeyCodes.LEFT,this.ascend.bind(this,Zt.PRESS_KEY,Yt),!0,!0),this.listenKey(Le.core.KeyCodes.HOME,this.ascend.bind(this,Zt.PRESS_KEY,Qt),!0,!0),this.listenKey(Le.core.KeyCodes.END,this.ascend.bind(this,Zt.PRESS_KEY,Jt),!0,!0),this.isResizing=!0}focalize(e){const t=e.getRect(),s=this.getRect(),i=this.node.scrollLeft;t.left<s.left?this.node.scrollTo(i-s.left+t.left-16,0):t.right>s.right&&this.node.scrollTo(i-s.right+t.right+16,0)}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,this.apply())}apply(){this._isScrolling?(this.addClass(qt.SHADOW),this.scroll()):(this.removeClass(qt.SHADOW_RIGHT),this.removeClass(qt.SHADOW_LEFT),this.removeClass(qt.SHADOW))}scroll(){const e=this.node.scrollLeft,t=e<=16,s=this.node.scrollWidth-this.node.clientWidth-16,i=Math.abs(e)>=s,n="rtl"===document.documentElement.getAttribute("dir"),r=n?qt.SHADOW_RIGHT:qt.SHADOW_LEFT,a=n?qt.SHADOW_LEFT:qt.SHADOW_RIGHT;t?this.removeClass(r):this.addClass(r),i?this.removeClass(a):this.addClass(a)}resize(){this.isScrolling=this.node.scrollWidth>this.node.clientWidth+16;const e=this.getRect().height;this.setProperty("--tabs-list-height",`${e}px`),this.ascend(Zt.LIST_HEIGHT,e)}dispose(){this.isScrolling=!1}}Le.tab={TabPanel:Kt,TabButton:Wt,TabsGroup:es,TabsList:ts,TabSelector:qt,TabEmission:Zt},Le.internals.register(Le.tab.TabSelector.PANEL,Le.tab.TabPanel),Le.internals.register(Le.tab.TabSelector.GROUP,Le.tab.TabsGroup),Le.internals.register(Le.tab.TabSelector.LIST,Le.tab.TabsList);const ss={SCROLLABLE:Le.internals.ns.emission("table","scrollable"),CHANGE:Le.internals.ns.emission("table","change"),CAPTION_HEIGHT:Le.internals.ns.emission("table","captionheight")};class is extends Le.core.Instance{static get instanceClassName(){return"Table"}init(){this.addAscent(ss.CAPTION_HEIGHT,this.setCaptionHeight.bind(this))}setCaptionHeight(e){this.setProperty("--table-offset",`calc(${e}px + 1rem)`)}}const ns={TABLE:Le.internals.ns.selector("table"),SHADOW:Le.internals.ns.selector("table__shadow"),SHADOW_LEFT:Le.internals.ns.selector("table__shadow--left"),SHADOW_RIGHT:Le.internals.ns.selector("table__shadow--right"),ELEMENT:`${Le.internals.ns.selector("table")}:not(${Le.internals.ns.selector("table--no-scroll")}) table`,CAPTION:`${Le.internals.ns.selector("table")} table caption`};class rs extends Le.core.Instance{static get instanceClassName(){return"TableElement"}init(){this.listen("scroll",this.scroll.bind(this)),this.content=this.querySelector("tbody"),this.isResizing=!0}get isScrolling(){return this._isScrolling}set isScrolling(e){this._isScrolling!==e&&(this._isScrolling=e,e?(this.addClass(ns.SHADOW),this.scroll()):(this.removeClass(ns.SHADOW),this.removeClass(ns.SHADOW_LEFT),this.removeClass(ns.SHADOW_RIGHT)))}scroll(){const e=this.node.scrollLeft<=8,t=this.content.offsetWidth-this.node.offsetWidth-8,s=Math.abs(this.node.scrollLeft)>=t,i="rtl"===document.documentElement.getAttribute("dir"),n=i?ns.SHADOW_RIGHT:ns.SHADOW_LEFT,r=i?ns.SHADOW_LEFT:ns.SHADOW_RIGHT;e?this.removeClass(n):this.addClass(n),s?this.removeClass(r):this.addClass(r)}resize(){this.isScrolling=this.content.offsetWidth>this.node.offsetWidth}dispose(){this.isScrolling=!1}}class as extends Le.core.Instance{static get instanceClassName(){return"TableCaption"}init(){this.height=0,this.isResizing=!0}resize(){const e=this.getRect().height;this.height!==e&&(this.height=e,this.ascend(ss.CAPTION_HEIGHT,e))}}Le.table={Table:is,TableElement:rs,TableCaption:as,TableSelector:ns},Le.internals.register(Le.table.TableSelector.TABLE,Le.table.Table),Le.internals.register(Le.table.TableSelector.ELEMENT,Le.table.TableElement),Le.internals.register(Le.table.TableSelector.CAPTION,Le.table.TableCaption);const os={DISMISS:Le.internals.ns.event("dismiss")};class hs extends Le.core.Instance{static get instanceClassName(){return"TagDismissible"}init(){this.listenClick()}handleClick(){switch(this.focusClosest(),Le.mode){case Le.Modes.ANGULAR:case Le.Modes.REACT:case Le.Modes.VUE:this.request(this.verify.bind(this));break;default:this.remove()}this.dispatch(os.DISMISS)}verify(){document.body.contains(this.node)&&this.warn(`a TagDismissible has just been dismissed and should be removed from the dom. In ${Le.mode} mode, the api doesn't handle dom modification. An event ${os.DISMISS} is dispatched by the element to trigger the removal`)}}const cs={PRESSABLE:`${Le.internals.ns.selector("tag")}[aria-pressed]`,DISMISSIBLE:`${Le.internals.ns.selector("tag--dismiss")}`};Le.tag={TagDismissible:hs,TagSelector:cs,TagEvent:os},Le.internals.register(Le.tag.TagSelector.PRESSABLE,Le.core.Toggle),Le.internals.register(Le.tag.TagSelector.DISMISSIBLE,Le.tag.TagDismissible);const ls=Le.internals.ns.selector("transcription"),ds={TRANSCRIPTION:ls,BUTTON:`${ls}__btn`};class us extends Le.core.Instance{static get instanceClassName(){return"Transcription"}get collapsePrimary(){return this.element.children.map((e=>e.getInstance("CollapseButton"))).filter((e=>null!==e&&e.hasClass(ds.BUTTON)))[0]}}Le.transcription={Transcription:us,TranscriptionSelector:ds},Le.internals.register(Le.transcription.TranscriptionSelector.TRANSCRIPTION,Le.transcription.Transcription);class gs extends Le.core.Instance{static get instanceClassName(){return"TileDownload"}init(){this.addAscent(Le.core.AssessEmission.UPDATE,(e=>{this.descend(Le.core.AssessEmission.UPDATE,e)})),this.addAscent(Le.core.AssessEmission.ADDED,(()=>{this.descend(Le.core.AssessEmission.ADDED)}))}}const ps={DOWNLOAD:Le.internals.ns.selector("tile--download"),DOWNLOAD_DETAIL:`${Le.internals.ns.selector("tile--download")} ${Le.internals.ns.selector("tile__detail")}`};Le.tile={TileSelector:ps,TileDownload:gs},Le.internals.register(Le.tile.TileSelector.DOWNLOAD,Le.tile.TileDownload),Le.internals.register(Le.tile.TileSelector.DOWNLOAD_DETAIL,Le.core.AssessDetail);const ms={RANGE:Le.internals.ns.selector("range"),RANGE_SM:Le.internals.ns.selector("range--sm"),RANGE_STEP:Le.internals.ns.selector("range--step"),RANGE_DOUBLE:Le.internals.ns.selector("range--double"),RANGE_DOUBLE_STEP:Le.internals.ns.selector("range--double")+Le.internals.ns.selector("range--step"),RANGE_INPUT:Le.internals.ns.selector("range input[type=range]:nth-of-type(1)"),RANGE_INPUT2:`${Le.internals.ns.selector("range--double")} input[type=range]:nth-of-type(2)`,RANGE_OUTPUT:Le.internals.ns.selector("range__output"),RANGE_MIN:Le.internals.ns.selector("range__min"),RANGE_MAX:Le.internals.ns.selector("range__max"),RANGE_PREFIX:Le.internals.ns.attr("prefix"),RANGE_SUFFIX:Le.internals.ns.attr("suffix")},_s={VALUE:Le.internals.ns.emission("range","value"),VALUE2:Le.internals.ns.emission("range","value2"),OUTPUT:Le.internals.ns.emission("range","output"),CONSTRAINTS:Le.internals.ns.emission("range","constraints"),MIN:Le.internals.ns.emission("range","min"),MAX:Le.internals.ns.emission("range","max"),STEP:Le.internals.ns.emission("range","step"),PREFIX:Le.internals.ns.emission("range","prefix"),SUFFIX:Le.internals.ns.emission("range","suffix"),DISABLED:Le.internals.ns.emission("range","disabled"),ENABLE_POINTER:Le.internals.ns.emission("range","enable_pointer")};class bs{constructor(){this._width=0,this._min=0,this._max=0,this._value=0,this._thumbSize=24,this._innerWidth=0,this._prefix="",this._suffix="",this._background={}}configure(e){e&&(this._prefix=e._prefix,this._suffix=e._suffix,this._width=e.width,this.setConstraints(e._constraints),this.value=e.value,this.update())}setPrefix(e){this._prefix=null!==e?e:""}setSuffix(e){this._suffix=null!==e?e:""}_decorate(e){return`${this._prefix}${e}${this._suffix}`}get width(){return this._width}set width(e){this._width=e}get isSm(){return this._isSm}set isSm(e){this._isSm!==e&&(this._isSm=e,this.setThumbSize(e?16:24),this.update())}setThumbSize(e,t=1){this._thumbSize=e,this._innerPadding=e*t}get textValue(){return this._decorate(this._value)}get value(){return this._value}set value(e){this._value=e}get outputX(){return this._outputX}setConstraints(e){this._constraints=e,this._min=e.min,this._max=e.max,this._step=e.step,this._rangeWidth=e.rangeWidth}get min(){return this._min}get textMin(){return this._decorate(this._min)}get max(){return this._max}get textMax(){return this._decorate(this._max)}get step(){return this._step}get output(){return{text:this.textValue,transform:`translateX(${this._translateX}px) translateX(-${this._centerPercent}%)`}}_getRatio(e){return(e-this._min)/this._rangeWidth}get progress(){return this._progress}update(){this._update()}_update(){this._innerWidth=this._width-this._innerPadding;const e=this._getRatio(this._value);this._translateX=e*this._width,this._centerPercent=100*e,this._progress={right:`${(this._innerWidth*e+.5*this._innerPadding).toFixed(2)}px`}}}class Es extends bs{get stepWidth(){return`${this._stepWidth.toFixed(3)}px`}_update(){super._update();const e=this._rangeWidth/this._step;for(this._stepWidth=this._innerWidth/e;this._stepWidth<4;)this._stepWidth*=2}}class fs extends bs{get value2(){return this._value}set value2(e){this._value2!==e&&(this._value2=e,this.update())}get textValue(){return`${this._decorate(this._value)} - ${this._decorate(this._value2)}`}setThumbSize(e){super.setThumbSize(e,2)}_update(){super._update();const e=this._getRatio(.5*(this._value+this._value2));this._translateX=e*this._width,this._centerPercent=100*e;const t=this._getRatio(this._value),s=this._getRatio(this._value2);this._progress={left:`${(this._innerWidth*t+.25*this._innerPadding).toFixed(2)}px`,right:`${(this._innerWidth*s+.75*this._innerPadding).toFixed(2)}px`}}}class As extends fs{get stepWidth(){return`${this._stepWidth.toFixed(3)}px`}_update(){super._update();const e=this._rangeWidth/this._step;this._stepWidth=this._innerWidth/e,this._stepWidth<4&&(this._stepWidth*=Math.ceil(4/this._stepWidth))}}const Ts="step",Ss="double",vs="double-step",ys="default";class Cs extends Le.core.Instance{static get instanceClassName(){return"Range"}init(){this._retrieveType(),this._retrieveSize(),this.isLegacy?(this.isResizing=!0,this.isMouseMoving=!0):(this._observer=new ResizeObserver(this.resize.bind(this)),this._observer.observe(this.node)),this.addAscent(_s.CONSTRAINTS,this.setConstraints.bind(this)),this.addAscent(_s.VALUE,this.setValue.bind(this)),this.addAscent(_s.VALUE2,this.setValue2.bind(this)),this.getAttribute(ms.RANGE_PREFIX)&&this.setPrefix(this.getAttribute(ms.RANGE_PREFIX)),this.getAttribute(ms.RANGE_SUFFIX)&&this.setSuffix(this.getAttribute(ms.RANGE_SUFFIX)),this.update()}_retrieveType(){switch(!0){case this.matches(ms.RANGE_DOUBLE_STEP):case this.matches(ms.RANGE_DOUBLE):this.type=Ss;break;case this.matches(ms.RANGE_STEP):this.type=Ts;break;default:this.type=ys}}set type(e){if(this._type===e)return;this._type=e;const t=this._model;switch(this._type){case vs:this._model=new As;break;case Ss:this._model=new fs;break;case Ts:this._model=new Es;break;default:this._model=new bs}this._model.configure(t)}get type(){return this._type}_retrieveSize(){this._model.isSm=this.matches(ms.RANGE_SM)}resize(){this._retrieveWidth(),this.update()}_retrieveWidth(){this._model.width=this.getRect().width}setValue(e){switch(this._model.value=e,this._type){case vs:case Ss:this.descend(_s.VALUE,e)}this.update()}setValue2(e){this._model.value2=e,this.descend(_s.VALUE2,e),this.update()}setConstraints(e){this._model.setConstraints(e),this.update(),this.descend(_s.CONSTRAINTS,e)}setPrefix(e){this._model.setPrefix(e),this.update()}setSuffix(e){this._model.setSuffix(e),this.update()}mutate(e){switch(!0){case e.includes("class"):this._retrieveType(),this._retrieveSize();break;case e.includes(ms.RANGE_PREFIX):case e.includes(ms.RANGE_SUFFIX):this._model.setPrefix(this.getAttribute(ms.RANGE_PREFIX)),this._model.setSuffix(this.getAttribute(ms.RANGE_SUFFIX)),this.update()}}update(){this._model.update(),this.descend(_s.OUTPUT,this._model.output),this.descend(_s.MIN,this._model.textMin),this.descend(_s.MAX,this._model.textMax);const e=this._model.progress;e.left?this.style.setProperty("--progress-left",e.left):this.style.removeProperty("--progress-left"),e.right?(this.style.setProperty("--progress-right",e.right),this.isLegacy&&e.left&&(this.style.setProperty("background-position-x",e.left),this.style.setProperty("background-size",`${parseFloat(e.right)-parseFloat(e.left)}px ${this._model.isSm?"8px":"12px"}`))):(this.style.removeProperty("--progress-right"),this.isLegacy&&(this.style.removeProperty("background-size"),this.style.removeProperty("background-position-x"))),this._model.stepWidth?this.style.setProperty("--step-width",this._model.stepWidth):this.style.removeProperty("--step-width")}mouseMove(e){if(this._type!==Ss&&this._type!==vs)return;const t=e.x-this.getRect().left;this.descend(_s.ENABLE_POINTER,(parseFloat(this._model.progress.right)-parseFloat(this._model.progress.left))/2+parseFloat(this._model.progress.left)<t?2:1)}dispose(){this._observer.disconnect()}}class Ns{constructor(e){this._min=isNaN(e.min)?0:e.min,this._max=isNaN(e.max)?100:e.max,this._step=isNaN(e.step)?1:e.step,this._rangeWidth=this._max-this._min}get min(){return this._min}get max(){return this._max}get step(){return this._step}get rangeWidth(){return this._rangeWidth}test(e,t,s){return this._min===e&&this._max===t&&this._step===s}}class Ds extends Le.core.Instance{static get instanceClassName(){return"RangeInput"}init(){this._init(),this.node.value=this.getAttribute("value"),this._changing=this.change.bind(this),this._listenerType=this.isLegacy?"change":"input",this.listen(this._listenerType,this._changing),this.isLegacy&&this.addDescent(_s.ENABLE_POINTER,this._enablePointer.bind(this)),this.change()}_init(){this._pointerId=1,this.request((()=>{this.hasAttribute("min")||this.setAttribute("min",0),this.ascend(_s.CONSTRAINTS,new Ns(this.node)),this.ascend(_s.DISABLED,this.node.disabled)})),this.addDescent(_s.VALUE2,this.setValue.bind(this))}_enablePointer(e){const t=e===this._pointerId;this._isPointerEnabled!==t&&(this._isPointerEnabled=t,t?this.style.removeProperty("pointer-events"):this.style.setProperty("pointer-events","none"))}setValue(e){parseFloat(this.node.value)>e&&(this.node.value=e,this.change())}change(){this.ascend(_s.VALUE,parseFloat(this.node.value))}mutate(e){e.includes("disabled")&&this.ascend(_s.DISABLED,this.node.disabled),(e.includes("min")||e.includes("max")||e.includes("step"))&&(this.ascend(_s.CONSTRAINTS,new Ns(this.node)),this.change())}dispose(){this._listenerType&&this.unlisten(this._listenerType,this._changing)}}class ws extends Le.core.Instance{static get instanceClassName(){return"RangeOutput"}init(){this.addDescent(_s.OUTPUT,this.change.bind(this))}change(e){this.node.innerText=e.text,this.node.style.transform=e.transform}}class Ls extends Le.core.Instance{static get instanceClassName(){return"RangeLimit"}init(){switch(!0){case this.matches(ms.RANGE_MIN):this.addDescent(_s.MIN,this.change.bind(this));break;case this.matches(ms.RANGE_MAX):this.addDescent(_s.MAX,this.change.bind(this))}}change(e){this.node.innerText=e}}Le.range={Range:Cs,RangeInput:Ds,RangeInput2:class extends Ds{static get instanceClassName(){return"RangeInput2"}_init(){this._pointerId=2,this.addDescent(_s.CONSTRAINTS,this.setConstraints.bind(this)),this.addDescent(_s.VALUE,this.setValue.bind(this))}setValue(e){parseFloat(this.node.value)<e&&(this.node.value=e,this.change())}change(){this.ascend(_s.VALUE2,parseFloat(this.node.value))}setConstraints(e){this.node.min=e.min,this.node.max=e.max,this.node.step=e.step,this.change()}mutate(e){}},RangeOutput:ws,RangeLimit:Ls,RangeEmission:_s,RangeSelector:ms},Le.internals.register(Le.range.RangeSelector.RANGE,Le.range.Range),Le.internals.register(Le.range.RangeSelector.RANGE_INPUT,Le.range.RangeInput),Le.internals.register(Le.range.RangeSelector.RANGE_INPUT2,Le.range.RangeInput2),Le.internals.register(Le.range.RangeSelector.RANGE_OUTPUT,Le.range.RangeOutput),Le.internals.register(Le.range.RangeSelector.RANGE_MIN,Le.range.RangeLimit),Le.internals.register(Le.range.RangeSelector.RANGE_MAX,Le.range.RangeLimit);const Rs={HEADER:Le.internals.ns.selector("header"),TOOLS_LINKS:Le.internals.ns.selector("header__tools-links"),MENU_LINKS:Le.internals.ns.selector("header__menu-links"),BUTTONS:`${Le.internals.ns.selector("header__tools-links")} ${Le.internals.ns.selector("btns-group")}, ${Le.internals.ns.selector("header__tools-links")} ${Le.internals.ns.selector("links-group")}`,MODALS:`${Le.internals.ns.selector("header__search")}${Le.internals.ns.selector("modal")}, ${Le.internals.ns.selector("header__menu")}${Le.internals.ns.selector("modal")}`};class Is extends Le.core.Instance{static get instanceClassName(){return"HeaderLinks"}init(){const e=this.queryParentSelector(Rs.HEADER);this.toolsLinks=e.querySelector(Rs.TOOLS_LINKS),this.menuLinks=e.querySelector(Rs.MENU_LINKS);const t="-mobile",s=this.toolsLinks.innerHTML.replace(/ +/g," "),i=this.menuLinks.innerHTML.replace(/ +/g," ");let n=s.match(/id="(.*?)"/gm)||[];n=n.map((e=>e.replace('id="',"").replace('"',"")));const r=s.match(/aria-controls="(.*?)"/gm);let a=s.replace(/id="(.*?)"/gm,'id="$1'+t+'"');if(r)for(const e of r){const s=e.replace('aria-controls="',"").replace('"',"");n.includes(s)&&(a=a.replace(`aria-controls="${s}"`,`aria-controls="${s+t}"`))}if(a!==i)switch(Le.mode){case Le.Modes.ANGULAR:case Le.Modes.REACT:case Le.Modes.VUE:this.warn(`header__tools-links content is different from header__menu-links content.\nAs you're using a dynamic framework, you should handle duplication of this content yourself, please refer to documentation:\n${Le.header.doc}`);break;default:this.menuLinks.innerHTML=a}}}class xs extends Le.core.Instance{static get instanceClassName(){return"HeaderModal"}init(){this.isResizing=!0}resize(){this.isBreakpoint(Le.core.Breakpoints.LG)?this.deactivateModal():this.activateModal()}activateModal(){const e=this.element.getInstance("Modal");e&&(e.isEnabled=!0,this.listenClick({capture:!0}))}deactivateModal(){const e=this.element.getInstance("Modal");e&&(e.conceal(),e.isEnabled=!1,this.unlistenClick({capture:!0}))}handleClick(e){if(e.target.matches("a, button")&&!e.target.matches("[aria-controls]")&&!e.target.matches(Le.core.DisclosureSelector.PREVENT_CONCEAL)){this.element.getInstance("Modal").conceal()}}}Le.header={HeaderLinks:Is,HeaderModal:xs,HeaderSelector:Rs,doc:"https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/en-tete"},Le.internals.register(Le.header.HeaderSelector.TOOLS_LINKS,Le.header.HeaderLinks),Le.internals.register(Le.header.HeaderSelector.MODALS,Le.header.HeaderModal);const Os={DISPLAY:Le.internals.ns.selector("display"),RADIO_BUTTONS:`input[name="${Le.internals.ns("radios-theme")}"]`,FIELDSET:Le.internals.ns.selector("fieldset")};class Ps extends Le.core.Instance{static get instanceClassName(){return"Display"}init(){if(this.radios=this.querySelectorAll(Os.RADIO_BUTTONS),Le.scheme){this.changing=this.change.bind(this);for(const e of this.radios)e.addEventListener("change",this.changing);this.addDescent(Le.scheme.SchemeEmission.SCHEME,this.apply.bind(this)),this.ascend(Le.scheme.SchemeEmission.ASK)}else this.querySelector(Os.FIELDSET).setAttribute("disabled","")}get scheme(){return this._scheme}set scheme(e){if(this._scheme!==e&&Le.scheme)switch(e){case Le.scheme.SchemeValue.SYSTEM:case Le.scheme.SchemeValue.LIGHT:case Le.scheme.SchemeValue.DARK:this._scheme=e;for(const t of this.radios)t.checked=t.value===e;this.ascend(Le.scheme.SchemeEmission.SCHEME,e)}}change(){for(const e of this.radios)if(e.checked)return void(this.scheme=e.value)}apply(e){this.scheme=e}dispose(){for(const e of this.radios)e.removeEventListener("change",this.changing)}}Le.display={Display:Ps,DisplaySelector:Os},Le.internals.register(Le.display.DisplaySelector.DISPLAY,Le.display.Display);
//# sourceMappingURL=dsfr.module.min.js.map