@codegouvfr/react-dsfr
Version:
French State Design System React integration library
2 lines • 73.6 kB
JavaScript
/*! DSFR v1.13.2 | SPDX-License-Identifier: MIT | License-Filename: LICENSE.md | restricted use (see terms and conditions) */
!function(){"use strict";var t=function(){this.modules={}},e={isActive:{configurable:!0},isLegacy:{configurable:!0}};t.prototype.create=function(t){var e=new t;this.modules[e.type]=e},t.prototype.getModule=function(t){return this.modules[t]},t.prototype.add=function(t,e){this.modules[t].add(e)},t.prototype.remove=function(t,e){this.modules[t].remove(e)},e.isActive.get=function(){return this._isActive},e.isActive.set=function(t){var e=this;if(t!==this._isActive){this._isActive=t;var i=Object.keys(this.modules).map((function(t){return e.modules[t]}));if(t)for(var s=0,n=i;s<n.length;s+=1){n[s].activate()}else for(var r=0,o=i;r<o.length;r+=1){o[r].deactivate()}}},e.isLegacy.get=function(){return this._isLegacy},e.isLegacy.set=function(t){t!==this._isLegacy&&(this._isLegacy=t)},Object.defineProperties(t.prototype,e);var i=new t,s="fr",n="dsfr",r="@gouvfr",o="1.13.2",a=function(t,e,i,s){switch(this.level=t,this.light=e,this.dark=i,s){case"warn":this.logger=console.warn;break;case"error":this.logger=console.error;break;default:this.logger=console.log}},c={color:{configurable:!0}};a.prototype.log=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=new h(n),s=0,r=t;s<r.length;s+=1){var o=r[s];i.add(o)}this.print(i)},a.prototype.print=function(t){t.setColor(this.color),this.logger.apply(console,t.getMessage())},c.color.get=function(){return window.matchMedia("(prefers-color-scheme: dark)").matches?this.dark:this.light},Object.defineProperties(a.prototype,c);var h=function(t){this.inputs=["%c"],this.styles=["font-family:Marianne","line-height: 1.5"],this.objects=[],t&&this.add(t+" :")};h.prototype.add=function(t){switch(typeof t){case"object":case"function":this.inputs.push("%o "),this.objects.push(t);break;default:this.inputs.push(t+" ")}},h.prototype.setColor=function(t){this.styles.push("color:"+t)},h.prototype.getMessage=function(){return[this.inputs.join(""),this.styles.join(";")].concat(this.objects)};var u={log:new a(0,"#616161","#989898"),debug:new a(1,"#000091","#8B8BFF"),info:new a(2,"#007c3b","#00ed70"),warn:new a(3,"#ba4500","#fa5c00","warn"),error:new a(4,"#D80600","#FF4641","error")},l=function(){var t=this;this.level=2;var e=function(e){var i=u[e];t[e]=function(){for(var e=[],s=arguments.length;s--;)e[s]=arguments[s];t.level<=i.level&&i.log.apply(i,e)},t[e].print=i.print.bind(i)};for(var i in u)e(i)};l.prototype.state=function(){var t=new h;t.add(i),this.log.print(t)},l.prototype.tree=function(){var t=i.getModule("stage");if(t){var e=new h;this._branch(t.root,0,e),this.log.print(e)}},l.prototype._branch=function(t,e,i){var s="";if(e>0){for(var n="",r=0;r<e;r++)n+=" ";s+=n+"└─ "}s+="["+t.id+"] "+t.html,i.add(s),i.add({"@":t}),i.add("\n");for(var o=0,a=t.children;o<a.length;o+=1){var c=a[o];s+=this._branch(c,e+1,i)}};var p=new l,d=function(t){"loading"!==document.readyState?window.requestAnimationFrame(t):document.addEventListener("DOMContentLoaded",t)},f={AUTO:"auto",MANUAL:"manual",RUNTIME:"runtime",LOADED:"loaded",VUE:"vue",ANGULAR:"angular",REACT:"react"},g=function(t,e,i,s,n){void 0===i&&(i=null),void 0===s&&(s=!0),void 0===n&&(n=!1);var r={bubbles:!0===s,cancelable:!0===n};i&&(r.detail=i);var o=new CustomEvent(e,r);t.dispatchEvent(o)},y=function(t,e,i,s){return void 0===e&&(e=null),void 0===i&&(i=!1),void 0===s&&(s=!1),g(document.documentElement,t,e,i,s)},m=function(t){return s+"-"+t};m.selector=function(t,e){return void 0===e&&(e="."),""+e+m(t)},(m.attr=function(t){return"data-"+m(t)}).selector=function(t,e){var i=m.attr(t);return void 0!==e&&(i+='="'+e+'"'),"["+i+"]"},m.event=function(t){return n+"."+t},m.emission=function(t,e){return"emission:"+t+"."+e};var v={READY:m.event("ready"),START:m.event("start"),STOP:m.event("stop"),RENDER:m.event("render"),RESIZE:m.event("resize"),BREAKPOINT:m.event("breakpoint"),SCROLL_LOCK:m.event("scroll-lock"),SCROLL_UNLOCK:m.event("scroll-unlock")},_=function(){this._mode=f.AUTO,this.isStarted=!1,this.starting=this.start.bind(this),this.preventManipulation=!1},b={mode:{configurable:!0}};_.prototype.configure=function(t,e,i){void 0===t&&(t={}),this.startCallback=e;var s=t.production&&(!i||"false"!==i.production);switch(!0){case i&&!isNaN(i.level):p.level=Number(i.level);break;case i&&i.verbose&&("true"===i.verbose||1===i.verbose):p.level=0;break;case s:p.level=999;break;case t.verbose:p.level=0}p.info("version "+o),y(v.READY),this.mode=t.mode||f.AUTO},b.mode.set=function(t){switch(t){case f.AUTO:this.preventManipulation=!1,e=this.starting,d(e);break;case f.LOADED:this.preventManipulation=!1,d(this.starting);break;case f.RUNTIME:this.preventManipulation=!1,this.start();break;case f.MANUAL:this.preventManipulation=!1;break;case f.VUE:case f.ANGULAR:case f.REACT:this.preventManipulation=!0;break;default:return void p.error("Illegal mode")}var e;this._mode=t,p.info("mode set to "+t)},b.mode.get=function(){return this._mode},_.prototype.start=function(){p.info("start"),this.startCallback()},Object.defineProperties(_.prototype,b);var E=new _,w=function(){this._collection=[]},C={length:{configurable:!0},collection:{configurable:!0}};w.prototype.forEach=function(t){this._collection.forEach(t)},w.prototype.map=function(t){return this._collection.map(t)},C.length.get=function(){return this._collection.length},w.prototype.add=function(t){return!(this._collection.indexOf(t)>-1)&&(this._collection.push(t),this.onAdd&&this.onAdd(),this.onPopulate&&1===this._collection.length&&this.onPopulate(),!0)},w.prototype.remove=function(t){var e=this._collection.indexOf(t);if(-1===e)return!1;this._collection.splice(e,1),this.onRemove&&this.onRemove(),this.onEmpty&&0===this._collection.length&&this.onEmpty()},w.prototype.execute=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=0,s=this._collection;i<s.length;i+=1){var n=s[i];n&&n.apply(null,t)}},w.prototype.clear=function(){this._collection.length=0},w.prototype.clone=function(){var t=new w;return t._collection=this._collection.slice(),t},C.collection.get=function(){return this._collection},Object.defineProperties(w.prototype,C);var A=function(t){function e(e){t.call(this),this.type=e,this.isActive=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(w),O=function(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))},R=function(t,e){var i=t.parentElement;return i.matches(e)?i:i===document.documentElement?null:R(i,e)},N=function(t,e,i){this.selector=t,this.InstanceClass=e,this.creator=i,this.instances=new w,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);var s=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=m.attr("js-"+s)},T={instanceClassName:{configurable:!0},instanceClassNames:{configurable:!0},property:{configurable:!0},attribute:{configurable:!0}};N.prototype.getInstanceClassNames=function(t){var e=Object.getPrototypeOf(t);return e&&"Instance"!==e.instanceClassName?this.getInstanceClassNames(e).concat([t.instanceClassName]):[t.instanceClassName]},N.prototype.hasInstanceClassName=function(t){return this._instanceClassNames.indexOf(t)>-1},N.prototype.introduce=function(){this.isIntroduced||(this.isIntroduced=!0,i.getModule("stage").parse(document.documentElement,this))},N.prototype.parse=function(t,e){var i=[];return t.matches&&t.matches(this.selector)&&i.push(t),!e&&t.querySelectorAll&&t.querySelector(this.selector)&&i.push.apply(i,O(t,this.selector)),i},N.prototype.create=function(t){if(t.node.matches(this.selector)){var e=new this.InstanceClass;return this.instances.add(e),e}},N.prototype.remove=function(t){this.instances.remove(t)},N.prototype.dispose=function(){for(var t=this.instances.collection,e=t.length-1;e>-1;e--)t[e]._dispose();this.creator=null},T.instanceClassName.get=function(){return this._instanceClassName},T.instanceClassNames.get=function(){return this._instanceClassNames},T.property.get=function(){return this._property},T.attribute.get=function(){return this._attribute},Object.defineProperties(N.prototype,T);var D=function(t){function e(){t.call(this,"register")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.register=function(t,e,s){var n=new N(t,e,s);return this.add(n),i.isActive&&n.introduce(),n},e.prototype.activate=function(){for(var t=0,e=this.collection;t<e.length;t+=1){e[t].introduce()}},e.prototype.remove=function(e){e.dispose(),t.prototype.remove.call(this,e)},e}(A),x=0,P=function(t,e){e?this.id=e:(x++,this.id=x),this.node=t,this.attributeNames=[],this.instances=[],this._children=[],this._parent=null,this._projects=[]},S={proxy:{configurable:!0},html:{configurable:!0},parent:{configurable:!0},ascendants:{configurable:!0},children:{configurable:!0},descendants:{configurable:!0}};S.proxy.get=function(){var t=this;if(!this._proxy){this._proxy={id:this.id,get parent(){return t.parent?t.parent.proxy:null},get children(){return t.children.map((function(t){return t.proxy}))}};for(var e=0,i=this.instances;e<i.length;e+=1){var s=i[e];this._proxy[s.registration.property]=s.proxy}}return this._proxy},S.html.get=function(){if(!this.node||!this.node.outerHTML)return"";var t=this.node.outerHTML.indexOf(">");return this.node.outerHTML.substring(0,t+1)},P.prototype.project=function(t){-1===this._projects.indexOf(t)&&this._projects.push(t)},P.prototype.populate=function(){var t=this._projects.slice();this._projects.length=0;for(var e=0,i=t;e<i.length;e+=1){var s=i[e];this.create(s)}},P.prototype.create=function(t){if(!this.hasInstance(t.instanceClassName)){p.debug("create instance of "+t.instanceClassName+" on element ["+this.id+"]");var e=t.create(this);this.instances.push(e),e._config(this,t),this._proxy&&(this._proxy[t.property]=e.proxy)}},P.prototype.remove=function(t){var e=this.instances.indexOf(t);e>-1&&this.instances.splice(e,1),this._proxy&&delete this._proxy[t.registration.property]},S.parent.get=function(){return this._parent},S.ascendants.get=function(){return[this.parent].concat(this.parent.ascendants)},S.children.get=function(){return this._children},S.descendants.get=function(){var t=[].concat(this._children);return this._children.forEach((function(e){return t.push.apply(t,e.descendants)})),t},P.prototype.addChild=function(t,e){return this._children.indexOf(t)>-1?null:(t._parent=this,!isNaN(e)&&e>-1&&e<this._children.length?this._children.splice(e,0,t):this._children.push(t),t)},P.prototype.removeChild=function(t){var e=this._children.indexOf(t);if(-1===e)return null;t._parent=null,this._children.splice(e,1)},P.prototype.emit=function(t,e){for(var s=[],n=0,r=i.getModule("stage").collection;n<r.length;n+=1){var o=r[n];s.push.apply(s,o._emit(t,e))}return s},P.prototype._emit=function(t,e){for(var i=[],s=0,n=this.instances;s<n.length;s+=1){var r=n[s];i.push.apply(i,r._emitter.emit(t,e))}return i},P.prototype.ascend=function(t,e){return this._parent?this._parent._ascend(t,e):[]},P.prototype._ascend=function(t,e){for(var i=[],s=0,n=this.instances;s<n.length;s+=1){var r=n[s];i.push.apply(i,r._ascent.emit(t,e))}return this._parent&&i.push.apply(i,this._parent._ascend(t,e)),i},P.prototype.descend=function(t,e){for(var i=[],s=0,n=this._children;s<n.length;s+=1){var r=n[s];i.push.apply(i,r._descend(t,e))}return i},P.prototype._descend=function(t,e){for(var i=[],s=0,n=this.instances;s<n.length;s+=1){var r=n[s];i.push.apply(i,r._descent.emit(t,e))}for(var o=0,a=this._children;o<a.length;o+=1){var c=a[o];i.push.apply(i,c._descend(t,e))}return i},P.prototype.getInstance=function(t){for(var e=0,i=this.instances;e<i.length;e+=1){var s=i[e];if(s.registration.hasInstanceClassName(t))return s}return null},P.prototype.hasInstance=function(t){return null!==this.getInstance(t)},P.prototype.getDescendantInstances=function(t,e,i){if(!t)return[];for(var s=[],n=0,r=this._children;n<r.length;n+=1){var o=r[n],a=o.getInstance(t);a&&(s.push(a),i)||(e&&o.hasInstance(e)||!o.children.length||s.push.apply(s,o.getDescendantInstances(t,e,i)))}return s},P.prototype.getAscendantInstance=function(t,e){if(!t||!this._parent)return null;var i=this._parent.getInstance(t);return i||(e&&this._parent.hasInstance(e)?null:this._parent.getAscendantInstance(t,e))},P.prototype.dispose=function(){for(var t=this.instances.length-1;t>=0;t--){var e=this.instances[t];e&&e._dispose()}this.instances.length=0,i.remove("stage",this),this.parent.removeChild(this),this._children.length=0,p.debug("remove element ["+this.id+"] "+this.html)},P.prototype.prepare=function(t){-1===this.attributeNames.indexOf(t)&&this.attributeNames.push(t)},P.prototype.examine=function(){var t=this.attributeNames.slice();this.attributeNames.length=0;for(var e=this.instances.length-1;e>-1;e--)this.instances[e].examine(t)},Object.defineProperties(P.prototype,S);var L={CLICK:m.emission("root","click"),KEYDOWN:m.emission("root","keydown"),KEYUP:m.emission("root","keyup")},k={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}},I=function(t){return Object.values(k).filter((function(e){return e.value===t}))[0]},M=function(t){function e(){t.call(this,document.documentElement,"root"),this.node.setAttribute(m.attr("js"),!0),this.listen()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.listen=function(){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})},e.prototype.click=function(t){this.emit(L.CLICK,t.target)},e.prototype.keydown=function(t){this.emit(L.KEYDOWN,I(t.keyCode))},e.prototype.keyup=function(t){this.emit(L.KEYUP,I(t.keyCode))},e}(P),j=function(t){function e(){t.call(this,"stage"),this.root=new M,t.prototype.add.call(this,this.root),this.observer=new MutationObserver(this.mutate.bind(this)),this.modifications=[],this.willModify=!1,this.modifying=this.modify.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.hasElement=function(t){for(var e=0,i=this.collection;e<i.length;e+=1){if(i[e].node===t)return!0}return!1},e.prototype.getElement=function(t){for(var e=0,i=this.collection;e<i.length;e+=1){var s=i[e];if(s.node===t)return s}var n=new P(t);return this.add(n),p.debug("add element ["+n.id+"] "+n.html),n},e.prototype.getProxy=function(t){return this.hasElement(t)?this.getElement(t).proxy:null},e.prototype.add=function(e){t.prototype.add.call(this,e),this.put(e,this.root)},e.prototype.put=function(t,e){for(var i=0,s=e.children.length-1;s>-1;s--){var n=e.children[s],r=t.node.compareDocumentPosition(n.node);if(r&Node.DOCUMENT_POSITION_CONTAINS)return void this.put(t,n);if(r&Node.DOCUMENT_POSITION_CONTAINED_BY)e.removeChild(n),t.addChild(n,0);else if(r&Node.DOCUMENT_POSITION_PRECEDING){i=s+1;break}}e.addChild(t,i)},e.prototype.activate=function(){this.observer.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})},e.prototype.deactivate=function(){this.observer.disconnect()},e.prototype.mutate=function(t){var e=this,i=[];t.forEach((function(t){switch(t.type){case"childList":t.removedNodes.forEach((function(t){return e.dispose(t)})),t.addedNodes.forEach((function(t){return e.parse(t)}));break;case"attributes":if(e.hasElement(t.target)){var s=e.getElement(t.target);s.prepare(t.attributeName),-1===i.indexOf(s)&&i.push(s);for(var n=0,r=s.descendants;n<r.length;n+=1){var o=r[n];-1===i.indexOf(o)&&i.push(o)}}-1===e.modifications.indexOf(t.target)&&e.modifications.push(t.target)}})),i.forEach((function(t){return t.examine()})),this.modifications.length&&!this.willModify&&(this.willModify=!0,window.requestAnimationFrame(this.modifying))},e.prototype.modify=function(){this.willModify=!1;var t=this.modifications.slice();this.modifications.length=0;for(var e=0,i=t;e<i.length;e+=1){var s=i[e];document.documentElement.contains(s)&&this.parse(s)}},e.prototype.dispose=function(t){var e=[];this.forEach((function(i){t.contains(i.node)&&e.push(i)}));for(var i=0,s=e;i<s.length;i+=1){var n=s[i];n.dispose(),this.remove(n)}},e.prototype.parse=function(t,e,s){for(var n=[],r=0,o=e?[e]:i.getModule("register").collection;r<o.length;r+=1)for(var a=o[r],c=0,h=a.parse(t,s);c<h.length;c+=1){var u=h[c],l=this.getElement(u);l.project(a),-1===n.indexOf(l)&&n.push(l)}for(var p=0,d=n;p<d.length;p+=1){d[p].populate()}},e}(A),G=function(t){function e(){t.call(this,"render"),this.rendering=this.render.bind(this),this.nexts=new w}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){window.requestAnimationFrame(this.rendering)},e.prototype.request=function(t){this.nexts.add(t)},e.prototype.render=function(){if(i.isActive&&(window.requestAnimationFrame(this.rendering),this.forEach((function(t){return t.render()})),this.nexts.length)){var t=this.nexts.clone();this.nexts.clear(),t.forEach((function(t){return t.next()})),y(v.RENDER)}},e}(A),q=function(t){function e(){t.call(this,"resize"),this.requireResize=!1,this.resizing=this.resize.bind(this);var e=this.request.bind(this);document.fonts&&document.fonts.ready.then(e),window.addEventListener("resize",e),window.addEventListener("orientationchange",e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){this.request()},e.prototype.request=function(){this.requireResize||(this.requireResize=!0,window.requestAnimationFrame(this.resizing))},e.prototype.resize=function(){this.requireResize&&(this.forEach((function(t){return t.resize()})),this.requireResize=!1,y(v.RESIZE))},e}(A),U=function(t){function e(){t.call(this,"lock"),this._isLocked=!1,this._scrollY=0,this.onPopulate=this.lock.bind(this),this.onEmpty=this.unlock.bind(this)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={isLocked:{configurable:!0}};return i.isLocked.get=function(){return this._isLocked},e.prototype.lock=function(){if(!this._isLocked){this._isLocked=!0,this._scrollY=window.scrollY;var t=window.innerWidth-document.documentElement.clientWidth;document.documentElement.setAttribute(m.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"),t>0&&document.documentElement.style.setProperty("--scrollbar-width",t+"px"),y(v.SCROLL_LOCK)}},e.prototype.unlock=function(){this._isLocked&&(this._isLocked=!1,document.documentElement.removeAttribute(m.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"),y(v.SCROLL_UNLOCK))},e.prototype.move=function(t){this._isLocked?(this._scrollY+=t,document.body.style.top=-this._scrollY+"px"):window.scrollTo(0,window.scrollY+t)},Object.defineProperties(e.prototype,i),e}(A),F=function(t){function e(){t.call(this,"load"),this.loading=this.load.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){window.addEventListener("load",this.loading)},e.prototype.load=function(){this.forEach((function(t){return t.load()}))},e}(A),B=["Marianne","Spectral"],H=function(t){function e(){t.call(this,"font-swap"),this.swapping=this.swap.bind(this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.activate=function(){document.fonts&&document.fonts.addEventListener("loadingdone",this.swapping)},e.prototype.swap=function(){var t=B.filter((function(t){return document.fonts.check("16px "+t)}));this.forEach((function(e){return e.swapFont(t)}))},e}(A),z=function(t){function e(){t.call(this,"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)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.listen=function(){this._isMoving||(this._isMoving=!0,this.requireMove=!1,document.documentElement.addEventListener("mousemove",this.requesting))},e.prototype.unlisten=function(){this._isMoving&&(this._isMoving=!1,this.requireMove=!1,document.documentElement.removeEventListener("mousemove",this.requesting))},e.prototype.request=function(t){this._isMoving&&(this.point={x:t.clientX,y:t.clientY},this.requireMove||(this.requireMove=!0,window.requestAnimationFrame(this.moving)))},e.prototype.move=function(){var t=this;this.requireMove&&(this.forEach((function(e){return e.mouseMove(t.point)})),this.requireMove=!1)},e}(A),K=function(t){function e(){t.call(this,"hash"),this.handling=this.handle.bind(this),this.getLocationHash()}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={hash:{configurable:!0}};return e.prototype.activate=function(){window.addEventListener("hashchange",this.handling)},e.prototype.deactivate=function(){window.removeEventListener("hashchange",this.handling)},e.prototype._sanitize=function(t){return"#"===t.charAt(0)?t.substring(1):t},i.hash.set=function(t){var e=this._sanitize(t);this._hash!==e&&(window.location.hash=e)},i.hash.get=function(){return this._hash},e.prototype.getLocationHash=function(){var t=window.location.hash;this._hash=this._sanitize(t)},e.prototype.handle=function(t){var e=this;this.getLocationHash(),this.forEach((function(i){return i.handleHash(e._hash,t)}))},Object.defineProperties(e.prototype,i),e}(A),V=function(){i.create(D),i.create(j),i.create(G),i.create(q),i.create(U),i.create(F),i.create(H),i.create(z),i.create(K);var t=i.getModule("register");this.register=t.register.bind(t)},Y={isActive:{configurable:!0}};Y.isActive.get=function(){return i.isActive},V.prototype.start=function(){p.debug("START"),i.isActive=!0,y(v.START)},V.prototype.stop=function(){p.debug("STOP"),i.isActive=!1,y(v.STOP)},Object.defineProperties(V.prototype,Y);var W=new V,$=function(){};$.prototype.getColor=function(t,e,i,s){void 0===s&&(s={});var n="--"+t+"-"+e+"-"+i+X(s);return getComputedStyle(document.documentElement).getPropertyValue(n).trim()||null};var X=function(t){switch(!0){case t.hover:return"-hover";case t.active:return"-active";default:return""}},Z=new $,J=function(t){return"."===t.charAt(0)?t.substr(1):t},Q=function(t){switch(!0){case!t.className:return[];case"string"==typeof t.className:return t.className.split(" ");case"string"==typeof t.className.baseVal:return t.className.baseVal.split(" ")}return[]},tt=function(t,e,i){e=J(e);var s=Q(t),n=s.indexOf(e);!0===i?n>-1&&s.splice(n,1):-1===n&&s.push(e),t.className=s.join(" ")},et=function(t,e){return tt(t,e)},it=function(t,e){return tt(t,e,!0)},st=function(t,e){return Q(t).indexOf(J(e))>-1},nt=['[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(),rt=function(t){return t.querySelectorAll(nt)},ot=0,at=function(t){if(!document.getElementById(t))return t;for(var e=!0,i=t;e;)t=i+"-"+ ++ot,e=document.getElementById(t);return t},ct={addClass:et,hasClass:st,removeClass:it,queryParentSelector:R,querySelectorAllArray:O,queryActions:rt,uniqueId:at,dispatch:g},ht=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._width=t,this._height=e,this._content=""},ut={width:{configurable:!0},height:{configurable:!0},content:{configurable:!0}};ut.width.get=function(){return this._width},ut.width.set=function(t){this._width=t},ut.height.get=function(){return this._height},ut.height.set=function(t){this._height=t},ut.content.get=function(){return this._content},ut.content.set=function(t){this._content=t},ht.prototype.getDataURI=function(t){void 0===t&&(t=!1);var e="<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 e=e.replace(/#/gi,"%23"),t&&(e=(e=(e=(e=(e=e.replace(/</gi,"%3C")).replace(/>/gi,"%3E")).replace(/"/gi,"'")).replace(/{/gi,"%7B")).replace(/}/gi,"%7D")),"data:image/svg+xml;charset=utf8,"+e},Object.defineProperties(ht.prototype,ut);var lt={DataURISVG:ht},pt={supportLocalStorage:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}},supportAspectRatio:function(){return!!window.CSS&&CSS.supports("aspect-ratio: 16 / 9")}},dt={TransitionSelector:{NONE:m.selector("transition-none")}},ft=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];return e.forEach((function(e){var i=Object.keys(e).reduce((function(t,i){return t[i]=Object.getOwnPropertyDescriptor(e,i),t}),{});Object.getOwnPropertySymbols(e).forEach((function(t){var s=Object.getOwnPropertyDescriptor(e,t);s.enumerable&&(i[t]=s)})),Object.defineProperties(t,i)})),t},gt={completeAssign:ft},yt={},mt={};Object.defineProperty(mt,"isLegacy",{get:function(){return i.isLegacy}}),mt.setLegacy=function(){i.isLegacy=!0},yt.legacy=mt,yt.dom=ct,yt.image=lt,yt.support=pt,yt.motion=dt,yt.property=gt,yt.ns=m,yt.register=W.register,yt.state=i,yt.query=function(t){if(t&&t.search){var e=new URLSearchParams(window.location.search).entries();return Object.fromEntries(e)}return null}(window.location),Object.defineProperty(yt,"preventManipulation",{get:function(){return E.preventManipulation}}),Object.defineProperty(yt,"stage",{get:function(){return i.getModule("stage")}});var vt=function(t){return i.getModule("stage").getProxy(t)};vt.version=o,vt.prefix=s,vt.organisation=r,vt.Modes=f,Object.defineProperty(vt,"mode",{set:function(t){E.mode=t},get:function(){return E.mode}}),vt.internals=yt,vt.version=o,vt.start=W.start,vt.stop=W.stop,vt.inspector=p,vt.colors=Z;var _t=window[n];vt.internals.configuration=_t,E.configure(_t,vt.start,vt.internals.query),window[n]=vt;var bt=function(){this.emissions={}};bt.prototype.add=function(t,e){if("function"!=typeof e)throw new Error("closure must be a function");this.emissions[t]||(this.emissions[t]=[]),this.emissions[t].push(e)},bt.prototype.remove=function(t,e){if(this.emissions[t])if(e){var i=this.emissions[t].indexOf(e);i>-1&&this.emissions[t].splice(i)}else delete this.emissions[t]},bt.prototype.emit=function(t,e){if(!this.emissions[t])return[];for(var i=[],s=0,n=this.emissions[t];s<n.length;s+=1){var r=n[s];r&&i.push(r(e))}return i},bt.prototype.dispose=function(){this.emissions=null};var Et=function(){this._activeElements=[],window.document.addEventListener("focusin",this._onFocusIn.bind(this))},wt={index:{configurable:!0}};Et.prototype._onFocusIn=function(t){this._activeElements.push(t.target)},wt.index.get=function(){return this._activeElements.length-1},Et.prototype.focus=function(t){var e=this._activeElements[t];switch(!0){case t<0:case 0===this._activeElements.length:return void this.focusOnLogo();case!e:case!document.documentElement.contains(e):case!this._isDisplayed(e):return void this.focus(t-1)}e.focus()},Et.prototype.focusOnLogo=function(){var t=document.querySelector(vt.header.HeaderSelector.BRAND_LINK);t&&t.focus()},Et.prototype._isDisplayed=function(t){for(;t&&t!==document.documentElement;){if(t===document.body)return!0;var e=window.getComputedStyle(t);if("none"===e.display||"hidden"===e.visibility)return!1;t=t.parentElement}return!0},Object.defineProperties(Et.prototype,wt);var Ct=new Et,At=function(t,e){this.id=t,this.minWidth=e};At.prototype.test=function(){return window.matchMedia("(min-width: "+this.minWidth+"em)").matches};var Ot={XS:new At("xs",0),SM:new At("sm",36),MD:new At("md",48),LG:new At("lg",62),XL:new At("xl",78)},Rt={CLICK:m.event("click")},Nt=function(t){void 0===t&&(t=!0),this.jsAttribute=t,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 bt,this._ascent=new bt,this._descent=new bt,this._registrations=[],this._nexts=[]},Tt={proxy:{configurable:!0},hash:{configurable:!0},isEnabled:{configurable:!0},isRendering:{configurable:!0},isResizing:{configurable:!0},isScrollLocked:{configurable:!0},isLoading:{configurable:!0},isSwappingFont:{configurable:!0},isMouseMoving:{configurable:!0},isDisposed:{configurable:!0},style:{configurable:!0},classNames:{configurable:!0},hasFocus:{configurable:!0},isLegacy:{configurable:!0}},Dt={instanceClassName:{configurable:!0}};Dt.instanceClassName.get=function(){return"Instance"},Nt.prototype._config=function(t,e){this.element=t,this.registration=e,this.node=t.node,this.id=t.node.id,this.jsAttribute&&this.setAttribute(e.attribute,!0),this.init()},Nt.prototype.init=function(){},Tt.proxy.get=function(){var t=this;return ft({render:function(){return t.render()},resize:function(){return t.resize()}},{get node(){return t.node},get isEnabled(){return t.isEnabled},set isEnabled(e){t.isEnabled=e}})},Nt.prototype.log=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),p.log.apply(p,t)},Nt.prototype.debug=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),p.debug.apply(p,t)},Nt.prototype.info=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),p.info.apply(p,t)},Nt.prototype.warn=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),p.warn.apply(p,t)},Nt.prototype.error=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),p.error.apply(p,t)},Nt.prototype.register=function(t,e){var s=i.getModule("register").register(t,e,this);this._registrations.push(s)},Nt.prototype.getRegisteredInstances=function(t){for(var e=0,i=this._registrations;e<i.length;e+=1){var s=i[e];if(s.hasInstanceClassName(t))return s.instances.collection}return[]},Nt.prototype.dispatch=function(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=!0),void 0===s&&(s=!1),g(this.node,t,e,i,s)},Nt.prototype.listen=function(t,e,i){this._listeners[t]||(this._listeners[t]=[]);var s=this._listeners[t],n=new Pt(this.node,t,e,i);s.push(n),n.listen()},Nt.prototype.unlisten=function(t,e,i){var s=this;if(t){var n=this._listeners[t];if(n)if(e){var r=n.filter((function(t){return t.closure===e&&t.matchOptions(i)}));r.forEach((function(t){return t.unlisten()})),this._listeners[t]=n.filter((function(t){return-1===r.indexOf(t)}))}else n.forEach((function(e){return s.unlisten(t,e.closure)}))}else for(var o in this._listeners)this.unlisten(o)},Nt.prototype.listenClick=function(t){this.listen("click",this._handlingClick,t)},Nt.prototype.unlistenClick=function(t){this.unlisten("click",this._handlingClick,t)},Nt.prototype._handleClick=function(t){this.handleClick(t),this.dispatch(Rt.CLICK,this)},Nt.prototype.handleClick=function(t){},Tt.hash.set=function(t){i.getModule("hash").hash=t},Tt.hash.get=function(){return i.getModule("hash").hash},Nt.prototype.listenHash=function(t,e){if(this._hashes){0===this._hashes.length&&i.add("hash",this);var s=new Lt(t,e);this._hashes=this._hashes.filter((function(e){return e.hash!==t})),this._hashes.push(s)}},Nt.prototype.unlistenHash=function(t){this._hashes&&(this._hashes=this._hashes.filter((function(e){return e.hash!==t})),0===this._hashes.length&&i.remove("hash",this))},Nt.prototype.handleHash=function(t,e){if(this._hashes)for(var i=0,s=this._hashes;i<s.length;i+=1){s[i].handle(t,e)}},Nt.prototype.listenKey=function(t,e,i,s,n){void 0===i&&(i=!1),void 0===s&&(s=!1),void 0===n&&(n="down"),-1===this._keyListenerTypes.indexOf(n)&&(this.listen("key"+n,this.handlingKey),this._keyListenerTypes.push(n)),this._keys.push(new xt(n,t,e,i,s))},Nt.prototype.unlistenKey=function(t,e){var i=this;this._keys=this._keys.filter((function(i){return i.code!==t||i.closure!==e})),this._keyListenerTypes.forEach((function(t){i._keys.some((function(e){return e.type===t}))||i.unlisten("key"+t,i.handlingKey)}))},Nt.prototype.handleKey=function(t){for(var e=0,i=this._keys;e<i.length;e+=1){i[e].handle(t)}},Tt.isEnabled.get=function(){return this._isEnabled},Tt.isEnabled.set=function(t){this._isEnabled=t},Tt.isRendering.get=function(){return this._isRendering},Tt.isRendering.set=function(t){this._isRendering!==t&&(t?i.add("render",this):i.remove("render",this),this._isRendering=t)},Nt.prototype.render=function(){},Nt.prototype.request=function(t){this._nexts.push(t),i.getModule("render").request(this)},Nt.prototype.next=function(){var t=this._nexts.slice();this._nexts.length=0;for(var e=0,i=t;e<i.length;e+=1){var s=i[e];s&&s()}},Tt.isResizing.get=function(){return this._isResizing},Tt.isResizing.set=function(t){this._isResizing!==t&&(t?(i.add("resize",this),this.resize()):i.remove("resize",this),this._isResizing=t)},Nt.prototype.resize=function(){},Nt.prototype.isBreakpoint=function(t){return!0==("string"==typeof t)?Ot[t.toUpperCase()].test():t.test()},Tt.isScrollLocked.get=function(){return this._isScrollLocked},Tt.isScrollLocked.set=function(t){this._isScrollLocked!==t&&(t?i.add("lock",this):i.remove("lock",this),this._isScrollLocked=t)},Tt.isLoading.get=function(){return this._isLoading},Tt.isLoading.set=function(t){this._isLoading!==t&&(t?i.add("load",this):i.remove("load",this),this._isLoading=t)},Nt.prototype.load=function(){},Tt.isSwappingFont.get=function(){return this._isSwappingFont},Tt.isSwappingFont.set=function(t){this._isSwappingFont!==t&&(t?i.add("font-swap",this):i.remove("font-swap",this),this._isSwappingFont=t)},Nt.prototype.swapFont=function(){},Tt.isMouseMoving.get=function(){return this._isMouseMoving},Tt.isMouseMoving.set=function(t){this._isMouseMoving!==t&&(t?i.add("mouse-move",this):i.remove("mouse-move",this),this._isMouseMoving=t)},Nt.prototype.mouseMove=function(t){},Nt.prototype.examine=function(t){this.node.matches(this.registration.selector)?this.mutate(t):this._dispose()},Nt.prototype.mutate=function(t){},Nt.prototype.retrieveNodeId=function(t,e){if(t.id)return t.id;var i=at(this.id+"-"+e);return this.warn("add id '"+i+"' to "+e),t.setAttribute("id",i),i},Tt.isDisposed.get=function(){return this._isDisposed},Nt.prototype._dispose=function(){this.debug("dispose instance of "+this.registration.instanceClassName+" on element ["+this.element.id+"]"),this.removeAttribute(this.registration.attribute),this.unlisten(),i.remove("hash",this),this._hashes=null,this._keys=null,this.isRendering=!1,this.isResizing=!1,this._nexts=null,i.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(var t=0,e=this._registrations;t<e.length;t+=1){var s=e[t];i.remove("register",s)}this._registrations=null,this.registration.remove(this),this._isDisposed=!0,this.dispose()},Nt.prototype.dispose=function(){},Nt.prototype.emit=function(t,e){return this.element.emit(t,e)},Nt.prototype.addEmission=function(t,e){this._emitter.add(t,e)},Nt.prototype.removeEmission=function(t,e){this._emitter.remove(t,e)},Nt.prototype.ascend=function(t,e){return this.element.ascend(t,e)},Nt.prototype.addAscent=function(t,e){this._ascent.add(t,e)},Nt.prototype.removeAscent=function(t,e){this._ascent.remove(t,e)},Nt.prototype.descend=function(t,e){return this.element.descend(t,e)},Nt.prototype.addDescent=function(t,e){this._descent.add(t,e)},Nt.prototype.removeDescent=function(t,e){this._descent.remove(t,e)},Tt.style.get=function(){return this.node.style},Nt.prototype.addClass=function(t){et(this.node,t)},Nt.prototype.removeClass=function(t){it(this.node,t)},Nt.prototype.hasClass=function(t){return st(this.node,t)},Tt.classNames.get=function(){return Q(this.node)},Nt.prototype.remove=function(){this.node.parentNode.removeChild(this.node)},Nt.prototype.setAttribute=function(t,e){this.node.setAttribute(t,e)},Nt.prototype.getAttribute=function(t){return this.node.getAttribute(t)},Nt.prototype.hasAttribute=function(t){return this.node.hasAttribute(t)},Nt.prototype.removeAttribute=function(t){this.node.removeAttribute(t)},Nt.prototype.setProperty=function(t,e){this.node.style.setProperty(t,e)},Nt.prototype.removeProperty=function(t){this.node.style.removeProperty(t)},Nt.prototype.focus=function(){this.node.focus()},Nt.prototype.blur=function(){this.node.blur()},Nt.prototype.retainFocus=function(){this._focusIndex=Ct.index},Nt.prototype.focusBack=function(){Ct.focus(this._focusIndex)},Nt.prototype.focusClosest=function(){var t=this._focusClosest(this.node.parentNode);t&&t.focus()},Nt.prototype._focusClosest=function(t){if(!t)return null;var e=[].concat(rt(t));if(e.length<=1)return this._focusClosest(t.parentNode);var i=e.indexOf(this.node);return e[i+(i<e.length-1?1:-1)]},Tt.hasFocus.get=function(){return this.node===document.activeElement},Nt.prototype.scrollIntoView=function(){var t=this.getRect(),e=i.getModule("lock");t.top<0&&e.move(t.top-50),t.bottom>window.innerHeight&&e.move(t.bottom-window.innerHeight+50)},Nt.prototype.matches=function(t){return this.node.matches(t)},Nt.prototype.querySelector=function(t){return this.node.querySelector(t)},Nt.prototype.querySelectorAll=function(t){return O(this.node,t)},Nt.prototype.queryParentSelector=function(t){return R(this.node,t)},Nt.prototype.getRect=function(){var t=this.node.getBoundingClientRect();return t.center=t.left+.5*t.width,t.middle=t.top+.5*t.height,t},Tt.isLegacy.get=function(){return i.isLegacy},Object.defineProperties(Nt.prototype,Tt),Object.defineProperties(Nt,Dt);var xt=function(t,e,i,s,n){this.type=t,this.eventType="key"+t,this.keyCode=e,this.closure=i,this.preventDefault=!0===s,this.stopPropagation=!0===n};xt.prototype.handle=function(t){t.type===this.eventType&&t.keyCode===this.keyCode.value&&(this.closure(t),this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation())};var Pt=function(t,e,i,s){this._node=t,this._type=e,this._closure=i,this._options=s},St={closure:{configurable:!0}};St.closure.get=function(){return this._closure},Pt.prototype.listen=function(){this._node.addEventListener(this._type,this._closure,this._options)},Pt.prototype.matchOptions=function(t){var e=this;switch(void 0===t&&(t=null),!0){case null===t:case"boolean"==typeof this._options&&"boolean"==typeof t&&this._options===t:return!0;case Object.keys(this._options).length!==Object.keys(t).length:return!1;case Object.keys(t).every((function(i){return e._options[i]===t[i]})):return!0}return!1},Pt.prototype.unlisten=function(){this._node.removeEventListener(this._type,this._closure,this._options)},Object.defineProperties(Pt.prototype,St);var Lt=function(t,e){this.hash=t,this.add=e};Lt.prototype.handle=function(t,e){this.hash===t&&this.add(e)};var kt={DISCLOSE:m.event("disclose"),CONCEAL:m.event("conceal"),CURRENT:m.event("current")},It={RESET:m.emission("disclosure","reset"),ADDED:m.emission("disclosure","added"),RETRIEVE:m.emission("disclosure","retrieve"),REMOVED:m.emission("disclosure","removed"),GROUP:m.emission("disclosure","group"),UNGROUP:m.emission("disclosure","ungroup"),SPOTLIGHT:m.emission("disclosure","spotlight")},Mt=function(t){function e(e,i,s,n){t.call(this),this.type=e,this._selector=i,this.DisclosureButtonInstanceClass=s,this.disclosuresGroupInstanceClassName=n,this.modifier=this._selector+"--"+this.type.id,this._isPristine=!0,this._isActive=!0,this._isRetrievingPrimaries=!1,this._hasRetrieved=!1,this._primaryButtons=[]}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={isEnabled:{configurable:!0},isActive:{configurable:!0},isPristine:{configurable:!0},proxy:{configurable:!0},buttons:{configurable:!0},group:{configurable:!0},isDisclosed:{configurable:!0},isInitiallyDisclosed:{configurable:!0},buttonHasFocus:{configurable:!0},hasFocus:{configurable:!0},primaryButtons:{configurable:!0}},s={instanceClassName:{configurable:!0}};return s.instanceClassName.get=function(){return"Disclosure"},e.prototype.init=function(){this.addDescent(It.RESET,this.reset.bind(this)),this.addDescent(It.GROUP,this.update.bind(this)),this.addDescent(It.UNGROUP,this.update.bind(this)),this.addAscent(It.SPOTLIGHT,this.disclose.bind(this)),this.register('[aria-controls="'+this.id+'"]',this.DisclosureButtonInstanceClass),this.ascend(It.ADDED),this.listenHash(this.id,this._spotlight.bind(this)),this.update()},i.isEnabled.get=function(){return t.prototype.isEnabled},i.isEnabled.set=function(e){this.isEnabled!==e&&(t.prototype.isEnabled=e,e?this.ascend(It.ADDED):this.ascend(It.REMOVED))},i.isActive.get=function(){return this._isActive},i.isActive.set=function(t){this._isActive!==t&&(this._isActive=t,t?this.ascend(It.ADDED):(this.ascend(It.REMOVED),this.isDisclosed&&this.conceal()))},i.isPristine.get=function(){return this._isPristine},i.proxy.get=function(){var e=this,i=Object.assign.call(this,t.prototype.proxy,{disclose:e.disclose.bind(e),focus:e.focus.bind(e)});return this.type.canConceal&&(i.conceal=e.conceal.bind(e)),ft(i,{get buttons(){return e.buttons.map((function(t){return t.proxy}))},get group(){var t=e.group;return t?t.proxy:null},get isDisclosed(){return e.isDisclosed},get isEnabled(){return e.isEnabled},get isActive(){return e.isActive}})},i.buttons.get=function(){return this.getRegisteredInstances(this.DisclosureButtonInstanceClass.instanceClassName)},e.prototype.update=function(){this.getGroup(),this.retrievePrimaries()},e.prototype.getGroup=function(){if(this.disclosuresGroupInstanceClassName){var t=this.element.getAscendantInstance(this.disclosuresGroupInstanceClassName,this.constructor.instanceClassName);t&&t.validate(this)?this._group=t:this._group=null}else this._group=null},i.group.get=function(){return this._group},e.prototype.disclose=function(t){return!(!0===this.isDisclosed||!this.isEnabled||!this._isActive)&&(this.retainFocus(),this._isPristine=!1,this.isDisclosed=!0,!t&&this.group&&(this.group.current=this),!0)},e.prototype.conceal=function(t,e){return void 0===e&&(e=!0),!1!==this.isDisclosed&&(!(!this.type.canConceal&&this.group&&this.group.current===this)&&(this.isDisclosed=!1,!t&&this.group&&this.group.current===this&&(this.group.current=null),e||this.focus(),this._isPristine||this.descend(It.RESET),!0))},i.isDisclosed.get=function(){return this._isDisclosed},i.isDisclosed.set=function(t){if(this._isDisclosed!==t&&(this.isEnabled||!0!==t)){this._isPristine||this.dispatch(t?kt.DISCLOSE:kt.CONCEAL,this),this._isDisclosed=t,t?this.addClass(this.modifier):this.removeClass(this.modifier);for(var e=0;e<this.buttons.length;e++)this.buttons[e].apply(t)}},i.isInitiallyDisclosed.get=function(){return this.primaryButtons.some((function(t){return t.isInitiallyDisclosed}))},e.prototype.hasRetrieved=function(){return this._hasRetrieved},e.prototype.reset=function(){},e.prototype.toggle=function(t){if(this.type.canConceal)switch(!0){case!t:case this.isDisclosed:this.conceal(!1,!1);break;default:this.disclose()}else this.disclose()},i.buttonHasFocus.get=function(){return this.buttons.some((function(t){return t.hasFocus}))},i.hasFocus.get=function(){return!!t.prototype.hasFocus||(!!this.buttonHasFocus||this.querySelectorAll(":focus").length>0)},e.prototype.focus=function(){this._primaryButtons.length>0?this._primaryButtons[0].focus():this.focusBack()},i.primaryButtons.get=function(){return this._primaryButtons},e.prototype.retrievePrimaries=function(){this._isRetrievingPrimaries||(this._isRetrievingPrimaries=!0,this.request(this._retrievePrimaries.bind(this)))},e.prototype._retrievePrimaries=function(){if(this._isRetrievingPrimaries=!1,this._primaryButtons=this._electPrimaries(this.buttons),!(this._hasRetrieved||0===this._primaryButtons.length&&this.type.requirePrimary))if(this.retrieved(),this._hasRetrieved=!0,this.applyAbility(!0),this.group)this.group.retrieve();else if(this._isPristine&&this.isEnabled&&this.isActive&&!this.group)switch(!0){case this.hash===this.id:this._spotlight();break;case this.isInitiallyDisclosed:this.disclose()}},e.prototype.retrieved=function(){},e.prototype._spotlight=function(){var t=this;this.disclose(),this.request((function(){t.ascend(It.SPOTLIGHT)}))},e.prototype._electPrimaries=function(t){var e=this;return t.filter((function(t){return t.canDisclose&&!e.node.contains(t.node)}))},e.prototype.applyAbility=function(t){void 0===t&&(t=!1);var e=!this.type.requirePrimary||this._primaryButtons.some((function(t){return!t.isDisabled}));this.isEnabled!==e&&(this.isEnabled=e,t||(!this.isEnabled&&this.isDisclosed&&(this.group?this.ascend(It.REMOVED):this.type.canConceal&&this.conceal()),this.isEnabled&&(this.group&&this.ascend(It.ADDED),this.hash===this.id&&this._spotlight())))},e.prototype.dispose=function(){this._group=null,this._primaryButtons=null,t.prototype.dispose.call(this),this.ascend(It.REMOVED)},Object.defineProperties(e.prototype,i),Object.defineProperties(e,s),e}(Nt),jt=function(t){function e(e){t.call(this),this.type=e,this.attributeName=e.ariaState?"aria-"+e.id:m.attr(e.id),this._canDisclose=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={isPrimary:{configurable:!0},canDisclose:{configurable:!0},isDisabled:{configurable:!0},proxy:{configurable:!0},isDisclosed:{configurable:!0},isInitiallyDisclosed:{configurable:!0},dx:{configurable:!0},dy:{configurable:!0}},s={instanceClassName:{configurable:!0}};return s.instanceClassName.get=function(){return"DisclosureButton"},i.isPrimary.get=function(){return this.registration.creator.primaryButtons.includes(this)},i.canDisclose.get=function(){return this._canDisclose},i.isDisabled.get=function(){return this.type.canDisable&&this.hasAttribute("disabled")},e.prototype.init=function(){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()},i.proxy.get=function(){return Object.assign.call(this,t.prototype.proxy,{focus:this.focus.bind(this)})},e.prototype.handleClick=function(t){this.registration.creator&&this.registration.creator.toggle(this.canDisclose)},e.prototype.mutate=function(t){this._canDisclose=this.hasAttribute(this.attributeName),this.registration.creator.applyAbility(),!this._isApplying&&this.isPrimary&&t.indexOf(this.attributeName)>-1&&this.registration.creator&&(this.isDisclosed?this.registration.creator.disclose():this.type.canConceal&&this.registration.creator.conceal())},e.prototype.apply=function(t){var e=this;this.canDisclose&&(this._isApplying=!0,this.setAttribute(this.attributeName,t),this.request((function(){e._isApplying=!1})))},i.isDisclosed.get=function(){return"true"===this.getAttribute(this.attributeName)},i.isInitiallyDisclosed.get=function(){return this._isInitiallyDisclosed},e.prototype.focus=function(){t.prototype.focus.call(this),this.scrollIntoView()},e.prototype.measure=function(t){var e=this.rect;this._dx=t.x-e.x,this._dy=t.y-e.y},i.dx.get=function(){return this._dx},i.dy.get=function(){return this._dy},Object.defineProperties(e.prototype,i),Object.defineProperties(e,s),e}(Nt),Gt={PREVENT_CONCEAL:m.attr.selector("prevent-conceal"),GROUP:m.attr("group")},qt=function(t){function e(e,i){t.call(this,i),this.disclosureInstanceClassName=e,this._members=[],this._index=-1,this._isRetrieving=!1,this._hasRetrieved=!1,this._isGrouped=!0}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var i={proxy:{configurable:!0},members:{configurable:!0},length:{configurable:!0},index:{configurable:!0},current:{configurable:!0},hasFocus:{configurable:!0},isGrouped:{configurable:!0},canUngroup:{configurable:!0}},s={instanceClassName:{configurable:!0}};return s.instanceClassName.get=function(){return"DisclosuresGroup"},e.prototype.init=function(){this.addAscent(It.ADDED,this.update.bind(this)),this.addAscent(It.RETRIEVE,this.retrieve.bind(this)),this.addAscent(It.REMOVED,this.update.bind(this)),this.descend(It.GROUP),this._isGrouped="false"!==this.getAttribute(Gt.GROUP),this.update()},i.proxy.get=function(){var e=this,i={set index(t){e.index=t},get index(){return e.index},get length(){return e.length},get current(){var t=e.current;return t?t.proxy:null},get members(){return e.members.map((function(t){return t.proxy}))},get hasFocus(){return e.hasFocus},set isGrouped(t){e.isGrouped=t},get isGrouped(){return e.isGrouped}};return ft.call(this,t.prototype.proxy,i)},e.prototype.validate=function(t){return!0},e.prototype.getMembers=function(){var t=this,e=this.element.getDescendantInstances(this.disclosureInstanceClassName,this.constructor.instanceClassName,!0);this._members=e.filter(this.validate.bind(this)