UNPKG

@codegouvfr/react-dsfr

Version:

French State Design System React integration library

2 lines 274 kB
/*! 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 r=Object.keys(this.modules).map((function(t){return e.modules[t]}));if(t)for(var n=0,i=r;n<i.length;n+=1){i[n].activate()}else for(var o=0,s=r;o<s.length;o+=1){s[o].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 r=new t,n="fr",i="dsfr",o="@gouvfr",s="1.13.2",a=function(t,e,r,n){switch(this.level=t,this.light=e,this.dark=r,n){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 r=new l(i),n=0,o=t;n<o.length;n+=1){var s=o[n];r.add(s)}this.print(r)},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 l=function(t){this.inputs=["%c"],this.styles=["font-family:Marianne","line-height: 1.5"],this.objects=[],t&&this.add(t+" :")};l.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+" ")}},l.prototype.setColor=function(t){this.styles.push("color:"+t)},l.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")},p=function(){var t=this;this.level=2;var e=function(e){var r=u[e];t[e]=function(){for(var e=[],n=arguments.length;n--;)e[n]=arguments[n];t.level<=r.level&&r.log.apply(r,e)},t[e].print=r.print.bind(r)};for(var r in u)e(r)};p.prototype.state=function(){var t=new l;t.add(r),this.log.print(t)},p.prototype.tree=function(){var t=r.getModule("stage");if(t){var e=new l;this._branch(t.root,0,e),this.log.print(e)}},p.prototype._branch=function(t,e,r){var n="";if(e>0){for(var i="",o=0;o<e;o++)i+=" ";n+=i+"└─ "}n+="["+t.id+"] "+t.html,r.add(n),r.add({"@":t}),r.add("\n");for(var s=0,a=t.children;s<a.length;s+=1){var c=a[s];n+=this._branch(c,e+1,r)}};var h=new p,f=function(t){"loading"!==document.readyState?window.requestAnimationFrame(t):document.addEventListener("DOMContentLoaded",t)},d={AUTO:"auto",MANUAL:"manual",RUNTIME:"runtime",LOADED:"loaded",VUE:"vue",ANGULAR:"angular",REACT:"react"},y=function(t,e,r,n,i){void 0===r&&(r=null),void 0===n&&(n=!0),void 0===i&&(i=!1);var o={bubbles:!0===n,cancelable:!0===i};r&&(o.detail=r);var s=new CustomEvent(e,o);t.dispatchEvent(s)},b=function(t,e,r,n){return void 0===e&&(e=null),void 0===r&&(r=!1),void 0===n&&(n=!1),y(document.documentElement,t,e,r,n)},g=function(t){return n+"-"+t};g.selector=function(t,e){return void 0===e&&(e="."),""+e+g(t)},(g.attr=function(t){return"data-"+g(t)}).selector=function(t,e){var r=g.attr(t);return void 0!==e&&(r+='="'+e+'"'),"["+r+"]"},g.event=function(t){return i+"."+t},g.emission=function(t,e){return"emission:"+t+"."+e};var v={READY:g.event("ready"),START:g.event("start"),STOP:g.event("stop"),RENDER:g.event("render"),RESIZE:g.event("resize"),BREAKPOINT:g.event("breakpoint"),SCROLL_LOCK:g.event("scroll-lock"),SCROLL_UNLOCK:g.event("scroll-unlock")},m=function(){this._mode=d.AUTO,this.isStarted=!1,this.starting=this.start.bind(this),this.preventManipulation=!1},_={mode:{configurable:!0}};m.prototype.configure=function(t,e,r){void 0===t&&(t={}),this.startCallback=e;var n=t.production&&(!r||"false"!==r.production);switch(!0){case r&&!isNaN(r.level):h.level=Number(r.level);break;case r&&r.verbose&&("true"===r.verbose||1===r.verbose):h.level=0;break;case n:h.level=999;break;case t.verbose:h.level=0}h.info("version "+s),b(v.READY),this.mode=t.mode||d.AUTO},_.mode.set=function(t){switch(t){case d.AUTO:this.preventManipulation=!1,e=this.starting,f(e);break;case d.LOADED:this.preventManipulation=!1,f(this.starting);break;case d.RUNTIME:this.preventManipulation=!1,this.start();break;case d.MANUAL:this.preventManipulation=!1;break;case d.VUE:case d.ANGULAR:case d.REACT:this.preventManipulation=!0;break;default:return void h.error("Illegal mode")}var e;this._mode=t,h.info("mode set to "+t)},_.mode.get=function(){return this._mode},m.prototype.start=function(){h.info("start"),this.startCallback()},Object.defineProperties(m.prototype,_);var w=new m,S=function(){this._collection=[]},E={length:{configurable:!0},collection:{configurable:!0}};S.prototype.forEach=function(t){this._collection.forEach(t)},S.prototype.map=function(t){return this._collection.map(t)},E.length.get=function(){return this._collection.length},S.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)},S.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()},S.prototype.execute=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var r=0,n=this._collection;r<n.length;r+=1){var i=n[r];i&&i.apply(null,t)}},S.prototype.clear=function(){this._collection.length=0},S.prototype.clone=function(){var t=new S;return t._collection=this._collection.slice(),t},E.collection.get=function(){return this._collection},Object.defineProperties(S.prototype,E);var O=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}(S),j=function(t,e){return Array.prototype.slice.call(t.querySelectorAll(e))},T=function(t,e){var r=t.parentElement;return r.matches(e)?r:r===document.documentElement?null:T(r,e)},P=function(t,e,r){this.selector=t,this.InstanceClass=e,this.creator=r,this.instances=new S,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 n=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=g.attr("js-"+n)},A={instanceClassName:{configurable:!0},instanceClassNames:{configurable:!0},property:{configurable:!0},attribute:{configurable:!0}};P.prototype.getInstanceClassNames=function(t){var e=Object.getPrototypeOf(t);return e&&"Instance"!==e.instanceClassName?this.getInstanceClassNames(e).concat([t.instanceClassName]):[t.instanceClassName]},P.prototype.hasInstanceClassName=function(t){return this._instanceClassNames.indexOf(t)>-1},P.prototype.introduce=function(){this.isIntroduced||(this.isIntroduced=!0,r.getModule("stage").parse(document.documentElement,this))},P.prototype.parse=function(t,e){var r=[];return t.matches&&t.matches(this.selector)&&r.push(t),!e&&t.querySelectorAll&&t.querySelector(this.selector)&&r.push.apply(r,j(t,this.selector)),r},P.prototype.create=function(t){if(t.node.matches(this.selector)){var e=new this.InstanceClass;return this.instances.add(e),e}},P.prototype.remove=function(t){this.instances.remove(t)},P.prototype.dispose=function(){for(var t=this.instances.collection,e=t.length-1;e>-1;e--)t[e]._dispose();this.creator=null},A.instanceClassName.get=function(){return this._instanceClassName},A.instanceClassNames.get=function(){return this._instanceClassNames},A.property.get=function(){return this._property},A.attribute.get=function(){return this._attribute},Object.defineProperties(P.prototype,A);var N=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,n){var i=new P(t,e,n);return this.add(i),r.isActive&&i.introduce(),i},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}(O),C=0,I=function(t,e){e?this.id=e:(C++,this.id=C),this.node=t,this.attributeNames=[],this.instances=[],this._children=[],this._parent=null,this._projects=[]},L={proxy:{configurable:!0},html:{configurable:!0},parent:{configurable:!0},ascendants:{configurable:!0},children:{configurable:!0},descendants:{configurable:!0}};L.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,r=this.instances;e<r.length;e+=1){var n=r[e];this._proxy[n.registration.property]=n.proxy}}return this._proxy},L.html.get=function(){if(!this.node||!this.node.outerHTML)return"";var t=this.node.outerHTML.indexOf(">");return this.node.outerHTML.substring(0,t+1)},I.prototype.project=function(t){-1===this._projects.indexOf(t)&&this._projects.push(t)},I.prototype.populate=function(){var t=this._projects.slice();this._projects.length=0;for(var e=0,r=t;e<r.length;e+=1){var n=r[e];this.create(n)}},I.prototype.create=function(t){if(!this.hasInstance(t.instanceClassName)){h.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)}},I.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]},L.parent.get=function(){return this._parent},L.ascendants.get=function(){return[this.parent].concat(this.parent.ascendants)},L.children.get=function(){return this._children},L.descendants.get=function(){var t=[].concat(this._children);return this._children.forEach((function(e){return t.push.apply(t,e.descendants)})),t},I.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)},I.prototype.removeChild=function(t){var e=this._children.indexOf(t);if(-1===e)return null;t._parent=null,this._children.splice(e,1)},I.prototype.emit=function(t,e){for(var n=[],i=0,o=r.getModule("stage").collection;i<o.length;i+=1){var s=o[i];n.push.apply(n,s._emit(t,e))}return n},I.prototype._emit=function(t,e){for(var r=[],n=0,i=this.instances;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._emitter.emit(t,e))}return r},I.prototype.ascend=function(t,e){return this._parent?this._parent._ascend(t,e):[]},I.prototype._ascend=function(t,e){for(var r=[],n=0,i=this.instances;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._ascent.emit(t,e))}return this._parent&&r.push.apply(r,this._parent._ascend(t,e)),r},I.prototype.descend=function(t,e){for(var r=[],n=0,i=this._children;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._descend(t,e))}return r},I.prototype._descend=function(t,e){for(var r=[],n=0,i=this.instances;n<i.length;n+=1){var o=i[n];r.push.apply(r,o._descent.emit(t,e))}for(var s=0,a=this._children;s<a.length;s+=1){var c=a[s];r.push.apply(r,c._descend(t,e))}return r},I.prototype.getInstance=function(t){for(var e=0,r=this.instances;e<r.length;e+=1){var n=r[e];if(n.registration.hasInstanceClassName(t))return n}return null},I.prototype.hasInstance=function(t){return null!==this.getInstance(t)},I.prototype.getDescendantInstances=function(t,e,r){if(!t)return[];for(var n=[],i=0,o=this._children;i<o.length;i+=1){var s=o[i],a=s.getInstance(t);a&&(n.push(a),r)||(e&&s.hasInstance(e)||!s.children.length||n.push.apply(n,s.getDescendantInstances(t,e,r)))}return n},I.prototype.getAscendantInstance=function(t,e){if(!t||!this._parent)return null;var r=this._parent.getInstance(t);return r||(e&&this._parent.hasInstance(e)?null:this._parent.getAscendantInstance(t,e))},I.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,r.remove("stage",this),this.parent.removeChild(this),this._children.length=0,h.debug("remove element ["+this.id+"] "+this.html)},I.prototype.prepare=function(t){-1===this.attributeNames.indexOf(t)&&this.attributeNames.push(t)},I.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(I.prototype,L);var D={CLICK:g.emission("root","click"),KEYDOWN:g.emission("root","keydown"),KEYUP:g.emission("root","keyup")},M={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}},x=function(t){return Object.values(M).filter((function(e){return e.value===t}))[0]},R=function(t){function e(){t.call(this,document.documentElement,"root"),this.node.setAttribute(g.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(D.CLICK,t.target)},e.prototype.keydown=function(t){this.emit(D.KEYDOWN,x(t.keyCode))},e.prototype.keyup=function(t){this.emit(D.KEYUP,x(t.keyCode))},e}(I),k=function(t){function e(){t.call(this,"stage"),this.root=new R,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,r=this.collection;e<r.length;e+=1){if(r[e].node===t)return!0}return!1},e.prototype.getElement=function(t){for(var e=0,r=this.collection;e<r.length;e+=1){var n=r[e];if(n.node===t)return n}var i=new I(t);return this.add(i),h.debug("add element ["+i.id+"] "+i.html),i},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 r=0,n=e.children.length-1;n>-1;n--){var i=e.children[n],o=t.node.compareDocumentPosition(i.node);if(o&Node.DOCUMENT_POSITION_CONTAINS)return void this.put(t,i);if(o&Node.DOCUMENT_POSITION_CONTAINED_BY)e.removeChild(i),t.addChild(i,0);else if(o&Node.DOCUMENT_POSITION_PRECEDING){r=n+1;break}}e.addChild(t,r)},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,r=[];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 n=e.getElement(t.target);n.prepare(t.attributeName),-1===r.indexOf(n)&&r.push(n);for(var i=0,o=n.descendants;i<o.length;i+=1){var s=o[i];-1===r.indexOf(s)&&r.push(s)}}-1===e.modifications.indexOf(t.target)&&e.modifications.push(t.target)}})),r.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,r=t;e<r.length;e+=1){var n=r[e];document.documentElement.contains(n)&&this.parse(n)}},e.prototype.dispose=function(t){var e=[];this.forEach((function(r){t.contains(r.node)&&e.push(r)}));for(var r=0,n=e;r<n.length;r+=1){var i=n[r];i.dispose(),this.remove(i)}},e.prototype.parse=function(t,e,n){for(var i=[],o=0,s=e?[e]:r.getModule("register").collection;o<s.length;o+=1)for(var a=s[o],c=0,l=a.parse(t,n);c<l.length;c+=1){var u=l[c],p=this.getElement(u);p.project(a),-1===i.indexOf(p)&&i.push(p)}for(var h=0,f=i;h<f.length;h+=1){f[h].populate()}},e}(O),H=function(t){function e(){t.call(this,"render"),this.rendering=this.render.bind(this),this.nexts=new S}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(r.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()})),b(v.RENDER)}},e}(O),G=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,b(v.RESIZE))},e}(O),F=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 r={isLocked:{configurable:!0}};return r.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(g.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"),b(v.SCROLL_LOCK)}},e.prototype.unlock=function(){this._isLocked&&(this._isLocked=!1,document.documentElement.removeAttribute(g.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"),b(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,r),e}(O),$=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}(O),U=["Marianne","Spectral"],B=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=U.filter((function(t){return document.fonts.check("16px "+t)}));this.forEach((function(e){return e.swapFont(t)}))},e}(O),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}(O),W=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 r={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},r.hash.set=function(t){var e=this._sanitize(t);this._hash!==e&&(window.location.hash=e)},r.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(r){return r.handleHash(e._hash,t)}))},Object.defineProperties(e.prototype,r),e}(O),q=function(){r.create(N),r.create(k),r.create(H),r.create(G),r.create(F),r.create($),r.create(B),r.create(z),r.create(W);var t=r.getModule("register");this.register=t.register.bind(t)},K={isActive:{configurable:!0}};K.isActive.get=function(){return r.isActive},q.prototype.start=function(){h.debug("START"),r.isActive=!0,b(v.START)},q.prototype.stop=function(){h.debug("STOP"),r.isActive=!1,b(v.STOP)},Object.defineProperties(q.prototype,K);var V=new q,Y=function(){};Y.prototype.getColor=function(t,e,r,n){void 0===n&&(n={});var i="--"+t+"-"+e+"-"+r+X(n);return getComputedStyle(document.documentElement).getPropertyValue(i).trim()||null};var X=function(t){switch(!0){case t.hover:return"-hover";case t.active:return"-active";default:return""}},Q=new Y,Z=function(t){return"."===t.charAt(0)?t.substr(1):t},J=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,r){e=Z(e);var n=J(t),i=n.indexOf(e);!0===r?i>-1&&n.splice(i,1):-1===i&&n.push(e),t.className=n.join(" ")},et=function(t,e){return tt(t,e)},rt=function(t,e){return tt(t,e,!0)},nt=function(t,e){return J(t).indexOf(Z(e))>-1},it=['[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(),ot=function(t){return t.querySelectorAll(it)},st=0,at=function(t){if(!document.getElementById(t))return t;for(var e=!0,r=t;e;)t=r+"-"+ ++st,e=document.getElementById(t);return t},ct={addClass:et,hasClass:nt,removeClass:rt,queryParentSelector:T,querySelectorAllArray:j,queryActions:ot,uniqueId:at,dispatch:y},lt=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},lt.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(lt.prototype,ut);var pt={DataURISVG:lt},ht={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")}},ft={TransitionSelector:{NONE:g.selector("transition-none")}},dt=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return e.forEach((function(e){var r=Object.keys(e).reduce((function(t,r){return t[r]=Object.getOwnPropertyDescriptor(e,r),t}),{});Object.getOwnPropertySymbols(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);n.enumerable&&(r[t]=n)})),Object.defineProperties(t,r)})),t},yt={completeAssign:dt},bt={},gt={};Object.defineProperty(gt,"isLegacy",{get:function(){return r.isLegacy}}),gt.setLegacy=function(){r.isLegacy=!0},bt.legacy=gt,bt.dom=ct,bt.image=pt,bt.support=ht,bt.motion=ft,bt.property=yt,bt.ns=g,bt.register=V.register,bt.state=r,bt.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(bt,"preventManipulation",{get:function(){return w.preventManipulation}}),Object.defineProperty(bt,"stage",{get:function(){return r.getModule("stage")}});var vt=function(t){return r.getModule("stage").getProxy(t)};vt.version=s,vt.prefix=n,vt.organisation=o,vt.Modes=d,Object.defineProperty(vt,"mode",{set:function(t){w.mode=t},get:function(){return w.mode}}),vt.internals=bt,vt.version=s,vt.start=V.start,vt.stop=V.stop,vt.inspector=h,vt.colors=Q;var mt=window[i];vt.internals.configuration=mt,w.configure(mt,vt.start,vt.internals.query),window[i]=vt;var _t=function(){this.emissions={}};_t.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)},_t.prototype.remove=function(t,e){if(this.emissions[t])if(e){var r=this.emissions[t].indexOf(e);r>-1&&this.emissions[t].splice(r)}else delete this.emissions[t]},_t.prototype.emit=function(t,e){if(!this.emissions[t])return[];for(var r=[],n=0,i=this.emissions[t];n<i.length;n+=1){var o=i[n];o&&r.push(o(e))}return r},_t.prototype.dispose=function(){this.emissions=null};var wt=function(){this._activeElements=[],window.document.addEventListener("focusin",this._onFocusIn.bind(this))},St={index:{configurable:!0}};wt.prototype._onFocusIn=function(t){this._activeElements.push(t.target)},St.index.get=function(){return this._activeElements.length-1},wt.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()},wt.prototype.focusOnLogo=function(){var t=document.querySelector(vt.header.HeaderSelector.BRAND_LINK);t&&t.focus()},wt.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(wt.prototype,St);var Et=new wt,Ot=function(t,e){this.id=t,this.minWidth=e};Ot.prototype.test=function(){return window.matchMedia("(min-width: "+this.minWidth+"em)").matches};var jt={XS:new Ot("xs",0),SM:new Ot("sm",36),MD:new Ot("md",48),LG:new Ot("lg",62),XL:new Ot("xl",78)},Tt={CLICK:g.event("click")},Pt=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 _t,this._ascent=new _t,this._descent=new _t,this._registrations=[],this._nexts=[]},At={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}},Nt={instanceClassName:{configurable:!0}};Nt.instanceClassName.get=function(){return"Instance"},Pt.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()},Pt.prototype.init=function(){},At.proxy.get=function(){var t=this;return dt({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}})},Pt.prototype.log=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.log.apply(h,t)},Pt.prototype.debug=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.debug.apply(h,t)},Pt.prototype.info=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.info.apply(h,t)},Pt.prototype.warn=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.warn.apply(h,t)},Pt.prototype.error=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift(this.registration.instanceClassName+" #"+this.id+" - "),h.error.apply(h,t)},Pt.prototype.register=function(t,e){var n=r.getModule("register").register(t,e,this);this._registrations.push(n)},Pt.prototype.getRegisteredInstances=function(t){for(var e=0,r=this._registrations;e<r.length;e+=1){var n=r[e];if(n.hasInstanceClassName(t))return n.instances.collection}return[]},Pt.prototype.dispatch=function(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=!0),void 0===n&&(n=!1),y(this.node,t,e,r,n)},Pt.prototype.listen=function(t,e,r){this._listeners[t]||(this._listeners[t]=[]);var n=this._listeners[t],i=new It(this.node,t,e,r);n.push(i),i.listen()},Pt.prototype.unlisten=function(t,e,r){var n=this;if(t){var i=this._listeners[t];if(i)if(e){var o=i.filter((function(t){return t.closure===e&&t.matchOptions(r)}));o.forEach((function(t){return t.unlisten()})),this._listeners[t]=i.filter((function(t){return-1===o.indexOf(t)}))}else i.forEach((function(e){return n.unlisten(t,e.closure)}))}else for(var s in this._listeners)this.unlisten(s)},Pt.prototype.listenClick=function(t){this.listen("click",this._handlingClick,t)},Pt.prototype.unlistenClick=function(t){this.unlisten("click",this._handlingClick,t)},Pt.prototype._handleClick=function(t){this.handleClick(t),this.dispatch(Tt.CLICK,this)},Pt.prototype.handleClick=function(t){},At.hash.set=function(t){r.getModule("hash").hash=t},At.hash.get=function(){return r.getModule("hash").hash},Pt.prototype.listenHash=function(t,e){if(this._hashes){0===this._hashes.length&&r.add("hash",this);var n=new Dt(t,e);this._hashes=this._hashes.filter((function(e){return e.hash!==t})),this._hashes.push(n)}},Pt.prototype.unlistenHash=function(t){this._hashes&&(this._hashes=this._hashes.filter((function(e){return e.hash!==t})),0===this._hashes.length&&r.remove("hash",this))},Pt.prototype.handleHash=function(t,e){if(this._hashes)for(var r=0,n=this._hashes;r<n.length;r+=1){n[r].handle(t,e)}},Pt.prototype.listenKey=function(t,e,r,n,i){void 0===r&&(r=!1),void 0===n&&(n=!1),void 0===i&&(i="down"),-1===this._keyListenerTypes.indexOf(i)&&(this.listen("key"+i,this.handlingKey),this._keyListenerTypes.push(i)),this._keys.push(new Ct(i,t,e,r,n))},Pt.prototype.unlistenKey=function(t,e){var r=this;this._keys=this._keys.filter((function(r){return r.code!==t||r.closure!==e})),this._keyListenerTypes.forEach((function(t){r._keys.some((function(e){return e.type===t}))||r.unlisten("key"+t,r.handlingKey)}))},Pt.prototype.handleKey=function(t){for(var e=0,r=this._keys;e<r.length;e+=1){r[e].handle(t)}},At.isEnabled.get=function(){return this._isEnabled},At.isEnabled.set=function(t){this._isEnabled=t},At.isRendering.get=function(){return this._isRendering},At.isRendering.set=function(t){this._isRendering!==t&&(t?r.add("render",this):r.remove("render",this),this._isRendering=t)},Pt.prototype.render=function(){},Pt.prototype.request=function(t){this._nexts.push(t),r.getModule("render").request(this)},Pt.prototype.next=function(){var t=this._nexts.slice();this._nexts.length=0;for(var e=0,r=t;e<r.length;e+=1){var n=r[e];n&&n()}},At.isResizing.get=function(){return this._isResizing},At.isResizing.set=function(t){this._isResizing!==t&&(t?(r.add("resize",this),this.resize()):r.remove("resize",this),this._isResizing=t)},Pt.prototype.resize=function(){},Pt.prototype.isBreakpoint=function(t){return!0==("string"==typeof t)?jt[t.toUpperCase()].test():t.test()},At.isScrollLocked.get=function(){return this._isScrollLocked},At.isScrollLocked.set=function(t){this._isScrollLocked!==t&&(t?r.add("lock",this):r.remove("lock",this),this._isScrollLocked=t)},At.isLoading.get=function(){return this._isLoading},At.isLoading.set=function(t){this._isLoading!==t&&(t?r.add("load",this):r.remove("load",this),this._isLoading=t)},Pt.prototype.load=function(){},At.isSwappingFont.get=function(){return this._isSwappingFont},At.isSwappingFont.set=function(t){this._isSwappingFont!==t&&(t?r.add("font-swap",this):r.remove("font-swap",this),this._isSwappingFont=t)},Pt.prototype.swapFont=function(){},At.isMouseMoving.get=function(){return this._isMouseMoving},At.isMouseMoving.set=function(t){this._isMouseMoving!==t&&(t?r.add("mouse-move",this):r.remove("mouse-move",this),this._isMouseMoving=t)},Pt.prototype.mouseMove=function(t){},Pt.prototype.examine=function(t){this.node.matches(this.registration.selector)?this.mutate(t):this._dispose()},Pt.prototype.mutate=function(t){},Pt.prototype.retrieveNodeId=function(t,e){if(t.id)return t.id;var r=at(this.id+"-"+e);return this.warn("add id '"+r+"' to "+e),t.setAttribute("id",r),r},At.isDisposed.get=function(){return this._isDisposed},Pt.prototype._dispose=function(){this.debug("dispose instance of "+this.registration.instanceClassName+" on element ["+this.element.id+"]"),this.removeAttribute(this.registration.attribute),this.unlisten(),r.remove("hash",this),this._hashes=null,this._keys=null,this.isRendering=!1,this.isResizing=!1,this._nexts=null,r.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 n=e[t];r.remove("register",n)}this._registrations=null,this.registration.remove(this),this._isDisposed=!0,this.dispose()},Pt.prototype.dispose=function(){},Pt.prototype.emit=function(t,e){return this.element.emit(t,e)},Pt.prototype.addEmission=function(t,e){this._emitter.add(t,e)},Pt.prototype.removeEmission=function(t,e){this._emitter.remove(t,e)},Pt.prototype.ascend=function(t,e){return this.element.ascend(t,e)},Pt.prototype.addAscent=function(t,e){this._ascent.add(t,e)},Pt.prototype.removeAscent=function(t,e){this._ascent.remove(t,e)},Pt.prototype.descend=function(t,e){return this.element.descend(t,e)},Pt.prototype.addDescent=function(t,e){this._descent.add(t,e)},Pt.prototype.removeDescent=function(t,e){this._descent.remove(t,e)},At.style.get=function(){return this.node.style},Pt.prototype.addClass=function(t){et(this.node,t)},Pt.prototype.removeClass=function(t){rt(this.node,t)},Pt.prototype.hasClass=function(t){return nt(this.node,t)},At.classNames.get=function(){return J(this.node)},Pt.prototype.remove=function(){this.node.parentNode.removeChild(this.node)},Pt.prototype.setAttribute=function(t,e){this.node.setAttribute(t,e)},Pt.prototype.getAttribute=function(t){return this.node.getAttribute(t)},Pt.prototype.hasAttribute=function(t){return this.node.hasAttribute(t)},Pt.prototype.removeAttribute=function(t){this.node.removeAttribute(t)},Pt.prototype.setProperty=function(t,e){this.node.style.setProperty(t,e)},Pt.prototype.removeProperty=function(t){this.node.style.removeProperty(t)},Pt.prototype.focus=function(){this.node.focus()},Pt.prototype.blur=function(){this.node.blur()},Pt.prototype.retainFocus=function(){this._focusIndex=Et.index},Pt.prototype.focusBack=function(){Et.focus(this._focusIndex)},Pt.prototype.focusClosest=function(){var t=this._focusClosest(this.node.parentNode);t&&t.focus()},Pt.prototype._focusClosest=function(t){if(!t)return null;var e=[].concat(ot(t));if(e.length<=1)return this._focusClosest(t.parentNode);var r=e.indexOf(this.node);return e[r+(r<e.length-1?1:-1)]},At.hasFocus.get=function(){return this.node===document.activeElement},Pt.prototype.scrollIntoView=function(){var t=this.getRect(),e=r.getModule("lock");t.top<0&&e.move(t.top-50),t.bottom>window.innerHeight&&e.move(t.bottom-window.innerHeight+50)},Pt.prototype.matches=function(t){return this.node.matches(t)},Pt.prototype.querySelector=function(t){return this.node.querySelector(t)},Pt.prototype.querySelectorAll=function(t){return j(this.node,t)},Pt.prototype.queryParentSelector=function(t){return T(this.node,t)},Pt.prototype.getRect=function(){var t=this.node.getBoundingClientRect();return t.center=t.left+.5*t.width,t.middle=t.top+.5*t.height,t},At.isLegacy.get=function(){return r.isLegacy},Object.defineProperties(Pt.prototype,At),Object.defineProperties(Pt,Nt);var Ct=function(t,e,r,n,i){this.type=t,this.eventType="key"+t,this.keyCode=e,this.closure=r,this.preventDefault=!0===n,this.stopPropagation=!0===i};Ct.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 It=function(t,e,r,n){this._node=t,this._type=e,this._closure=r,this._options=n},Lt={closure:{configurable:!0}};Lt.closure.get=function(){return this._closure},It.prototype.listen=function(){this._node.addEventListener(this._type,this._closure,this._options)},It.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(r){return e._options[r]===t[r]})):return!0}return!1},It.prototype.unlisten=function(){this._node.removeEventListener(this._type,this._closure,this._options)},Object.defineProperties(It.prototype,Lt);var Dt=function(t,e){this.hash=t,this.add=e};Dt.prototype.handle=function(t,e){this.hash===t&&this.add(e)};var Mt={DISCLOSE:g.event("disclose"),CONCEAL:g.event("conceal"),CURRENT:g.event("current")},xt={RESET:g.emission("disclosure","reset"),ADDED:g.emission("disclosure","added"),RETRIEVE:g.emission("disclosure","retrieve"),REMOVED:g.emission("disclosure","removed"),GROUP:g.emission("disclosure","group"),UNGROUP:g.emission("disclosure","ungroup"),SPOTLIGHT:g.emission("disclosure","spotlight")},Rt=function(t){function e(e,r,n,i){t.call(this),this.type=e,this._selector=r,this.DisclosureButtonInstanceClass=n,this.disclosuresGroupInstanceClassName=i,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 r={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}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"Disclosure"},e.prototype.init=function(){this.addDescent(xt.RESET,this.reset.bind(this)),this.addDescent(xt.GROUP,this.update.bind(this)),this.addDescent(xt.UNGROUP,this.update.bind(this)),this.addAscent(xt.SPOTLIGHT,this.disclose.bind(this)),this.register('[aria-controls="'+this.id+'"]',this.DisclosureButtonInstanceClass),this.ascend(xt.ADDED),this.listenHash(this.id,this._spotlight.bind(this)),this.update()},r.isEnabled.get=function(){return t.prototype.isEnabled},r.isEnabled.set=function(e){this.isEnabled!==e&&(t.prototype.isEnabled=e,e?this.ascend(xt.ADDED):this.ascend(xt.REMOVED))},r.isActive.get=function(){return this._isActive},r.isActive.set=function(t){this._isActive!==t&&(this._isActive=t,t?this.ascend(xt.ADDED):(this.ascend(xt.REMOVED),this.isDisclosed&&this.conceal()))},r.isPristine.get=function(){return this._isPristine},r.proxy.get=function(){var e=this,r=Object.assign.call(this,t.prototype.proxy,{disclose:e.disclose.bind(e),focus:e.focus.bind(e)});return this.type.canConceal&&(r.conceal=e.conceal.bind(e)),dt(r,{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}})},r.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},r.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(xt.RESET),!0))},r.isDisclosed.get=function(){return this._isDisclosed},r.isDisclosed.set=function(t){if(this._isDisclosed!==t&&(this.isEnabled||!0!==t)){this._isPristine||this.dispatch(t?Mt.DISCLOSE:Mt.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)}},r.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()},r.buttonHasFocus.get=function(){return this.buttons.some((function(t){return t.hasFocus}))},r.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()},r.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(xt.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(xt.REMOVED):this.type.canConceal&&this.conceal()),this.isEnabled&&(this.group&&this.ascend(xt.ADDED),this.hash===this.id&&this._spotlight())))},e.prototype.dispose=function(){this._group=null,this._primaryButtons=null,t.prototype.dispose.call(this),this.ascend(xt.REMOVED)},Object.defineProperties(e.prototype,r),Object.defineProperties(e,n),e}(Pt),kt=function(t){function e(e){t.call(this),this.type=e,this.attributeName=e.ariaState?"aria-"+e.id:g.attr(e.id),this._canDisclose=!1}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isPrimary:{configurable:!0},canDisclose:{configurable:!0},isDisabled:{configurable:!0},proxy:{configurable:!0},isDisclosed:{configurable:!0},isInitiallyDisclosed:{configurable:!0},dx:{configurable:!0},dy:{configurable:!0}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"DisclosureButton"},r.isPrimary.get=function(){return this.registration.creator.primaryButtons.includes(this)},r.canDisclose.get=function(){return this._canDisclose},r.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()},r.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})))},r.isDisclosed.get=function(){return"true"===this.getAttribute(this.attributeName)},r.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},r.dx.get=function(){return this._dx},r.dy.get=function(){return this._dy},Object.defineProperties(e.prototype,r),Object.defineProperties(e,n),e}(Pt),Ht={PREVENT_CONCEAL:g.attr.selector("prevent-conceal"),GROUP:g.attr("group")},Gt=function(t){function e(e,r){t.call(this,r),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 r={proxy:{configurable:!0},members:{configurable:!0},length:{configurable:!0},index:{configurable:!0},current:{configurable:!0},hasFocus:{configurable:!0},isGrouped:{configurable:!0},canUngroup:{configurable:!0}},n={instanceClassName:{configurable:!0}};return n.instanceClassName.get=function(){return"DisclosuresGroup"},e.prototype.init=function(){this.addAscent(xt.ADDED,this.update.bind(this)),this.addAscent(xt.RETRIEVE,this.retrieve.bind(this)),this.addAscent(xt.REMOVED,this.update.bind(this)),this.descend(xt.GROUP),this._isGrouped="false"!==this.getAttribute(Ht.GROUP),this.update()},r.proxy.get=function(){var e=this,r={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 dt.call(this,t.prototype.proxy,r)},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)