UNPKG

balm-ui

Version:

A modular and customizable UI library based on Material Design and Vue 3

1 lines 45.5 kB
!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define("UiDrawer",["vue"],t):"object"===typeof exports?exports.UiDrawer=t(require("vue")):e.UiDrawer=t(e.Vue)}("undefined"!==typeof self?self:this,(function(e){return function(){"use strict";var t={744:function(e){var t=function(e){return function(e){return!!e&&"object"===typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function r(e,t,n){return e.concat(t).map((function(e){return i(e,n)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function o(e,t){try{return t in e}catch(n){return!1}}function a(e,t,n){var r={};return n.isMergeableObject(e)&&s(e).forEach((function(t){r[t]=i(e[t],n)})),s(t).forEach((function(s){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,s)||(o(e,s)&&n.isMergeableObject(t[s])?r[s]=function(e,t){if(!t.customMerge)return c;var n=t.customMerge(e);return"function"===typeof n?n:c}(s,n)(e[s],t[s],n):r[s]=i(t[s],n))})),r}function c(e,n,s){(s=s||{}).arrayMerge=s.arrayMerge||r,s.isMergeableObject=s.isMergeableObject||t,s.cloneUnlessOtherwiseSpecified=i;var o=Array.isArray(n);return o===Array.isArray(e)?o?s.arrayMerge(e,n,s):a(e,n,s):i(n,s)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return c(e,n,t)}),{})};var d=c;e.exports=d},262:function(e,t){t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n}},154:function(t){t.exports=e}},n={};function i(e){var r=n[e];if(void 0!==r)return r.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,i),s.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var r={};i.d(r,{default:function(){return qe}});var s=i(744),o=i.n(s);const a=/(?:^\[object\s(.*?)\]$)/;var c=e=>Object.prototype.toString.call(e).replace(a,"$1").toLowerCase();const d=e=>{let{componentProps:t,propName:n,props:i}=e,r=i[n];if("object"===c(r)){const e=t[n].default;t[n].default=()=>o()(e,r)}else Array.isArray(r)?t[n].default=()=>r:t[n].default=r},u=e=>{let{componentMixins:t,propName:n,props:i}=e;if(t.length){let e=t.length;for(;e--;)if(t[e].props&&void 0!==t[e].props[n]){d({componentProps:t[e].props,propName:n,props:i});break}}};var l=(e,t)=>{for(const n of Object.keys(t))e.props?void 0===e.props[n]?u({componentMixins:e.mixins,propName:n,props:t}):d({componentProps:e.props,propName:n,props:t}):u({componentMixins:e.mixins,propName:n,props:t})};var h=(e,t)=>{for(const n of Object.keys(t))if(/^Ui[A-Z]{1}[A-Za-z]+$/.test(n)){const i=e[n],r=t[n];l(i,r)}};var f=e=>{const t={install(t){h(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});for(let n in e){const i=e[n];t.component(i.name,i)}}};return t},p=i(154),I=function(e,t){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},I(e,t)};function E(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var m=function(){return m=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},m.apply(this,arguments)};Object.create;function S(e,t){var n="function"===typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=s.next()).done;)o.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o}function x(e,t,n){if(n||2===arguments.length)for(var i,r=0,s=t.length;r<s;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var y,A,C=function(){function e(e){void 0===e&&(e={}),this.adapter=e}return Object.defineProperty(e,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.destroy=function(){},e}(),b=function(){function e(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=e,this.initialize.apply(this,x([],S(n))),this.foundation=void 0===t?this.getDefaultFoundation():t,this.foundation.init(),this.initialSyncWithDOM()}return e.attachTo=function(t){return new e(t,new C({}))},e.prototype.initialize=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},e.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},e.prototype.initialSyncWithDOM=function(){},e.prototype.destroy=function(){this.foundation.destroy()},e.prototype.listen=function(e,t,n){this.root.addEventListener(e,t,n)},e.prototype.unlisten=function(e,t,n){this.root.removeEventListener(e,t,n)},e.prototype.emit=function(e,t,n){var i;void 0===n&&(n=!1),"function"===typeof CustomEvent?i=new CustomEvent(e,{bubbles:n,detail:t}):(i=document.createEvent("CustomEvent")).initCustomEvent(e,n,!1,t),this.root.dispatchEvent(i)},e}(),T="mdc-dom-focus-sentinel",L=function(){function e(e,t){void 0===t&&(t={}),this.root=e,this.options=t,this.elFocusedBeforeTrapFocus=null}return e.prototype.trapFocus=function(){var e=this.getFocusableElements(this.root);if(0===e.length)throw new Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root),this.options.skipInitialFocus||this.focusInitialElement(e,this.options.initialFocusEl)},e.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+T)).forEach((function(e){e.parentElement.removeChild(e)})),!this.options.skipRestoreFocus&&this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},e.prototype.wrapTabFocus=function(e){var t=this,n=this.createSentinel(),i=this.createSentinel();n.addEventListener("focus",(function(){var n=t.getFocusableElements(e);n.length>0&&n[n.length-1].focus()})),i.addEventListener("focus",(function(){var n=t.getFocusableElements(e);n.length>0&&n[0].focus()})),e.insertBefore(n,e.children[0]),e.appendChild(i)},e.prototype.focusInitialElement=function(e,t){var n=0;t&&(n=Math.max(e.indexOf(t),0)),e[n].focus()},e.prototype.getFocusableElements=function(e){return[].slice.call(e.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter((function(e){var t="true"===e.getAttribute("aria-disabled")||null!=e.getAttribute("disabled")||null!=e.getAttribute("hidden")||"true"===e.getAttribute("aria-hidden"),n=e.tabIndex>=0&&e.getBoundingClientRect().width>0&&!e.classList.contains(T)&&!t,i=!1;if(n){var r=getComputedStyle(e);i="none"===r.display||"hidden"===r.visibility}return n&&!i}))},e.prototype.createSentinel=function(){var e=document.createElement("div");return e.setAttribute("tabindex","0"),e.setAttribute("aria-hidden","true"),e.classList.add(T),e},e}();function v(e,t){return(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,t)}var _={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},g=((y={})[""+_.LIST_ITEM_ACTIVATED_CLASS]="mdc-list-item--activated",y[""+_.LIST_ITEM_CLASS]="mdc-list-item",y[""+_.LIST_ITEM_DISABLED_CLASS]="mdc-list-item--disabled",y[""+_.LIST_ITEM_SELECTED_CLASS]="mdc-list-item--selected",y[""+_.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-list-item__primary-text",y[""+_.ROOT]="mdc-list",y),O=((A={})[""+_.LIST_ITEM_ACTIVATED_CLASS]="mdc-deprecated-list-item--activated",A[""+_.LIST_ITEM_CLASS]="mdc-deprecated-list-item",A[""+_.LIST_ITEM_DISABLED_CLASS]="mdc-deprecated-list-item--disabled",A[""+_.LIST_ITEM_SELECTED_CLASS]="mdc-deprecated-list-item--selected",A[""+_.LIST_ITEM_TEXT_CLASS]="mdc-deprecated-list-item__text",A[""+_.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-deprecated-list-item__primary-text",A[""+_.ROOT]="mdc-deprecated-list",A),F={ACTION_EVENT:"MDCList:action",SELECTION_CHANGE_EVENT:"MDCList:selectionChange",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+_.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+_.LIST_ITEM_CLASS+" a,\n ."+O[_.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+O[_.LIST_ITEM_CLASS]+" a\n ",DEPRECATED_SELECTOR:".mdc-deprecated-list",FOCUSABLE_CHILD_ELEMENTS:"\n ."+_.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+_.LIST_ITEM_CLASS+" a,\n ."+_.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+_.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled),\n .'+O[_.LIST_ITEM_CLASS]+" button:not(:disabled),\n ."+O[_.LIST_ITEM_CLASS]+" a,\n ."+O[_.LIST_ITEM_CLASS]+' input[type="radio"]:not(:disabled),\n .'+O[_.LIST_ITEM_CLASS]+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},D={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},N="Unknown",w="Backspace",M="Enter",R="Spacebar",k="PageUp",B="PageDown",P="End",U="Home",j="ArrowLeft",V="ArrowUp",H="ArrowRight",X="ArrowDown",K="Delete",q="Escape",$="Tab",G=new Set;G.add(w),G.add(M),G.add(R),G.add(k),G.add(B),G.add(P),G.add(U),G.add(j),G.add(V),G.add(H),G.add(X),G.add(K),G.add(q),G.add($);var z=8,Y=13,W=32,Z=33,J=34,Q=35,ee=36,te=37,ne=38,ie=39,re=40,se=46,oe=27,ae=9,ce=new Map;ce.set(z,w),ce.set(Y,M),ce.set(W,R),ce.set(Z,k),ce.set(J,B),ce.set(Q,P),ce.set(ee,U),ce.set(te,j),ce.set(ne,V),ce.set(ie,H),ce.set(re,X),ce.set(se,K),ce.set(oe,q),ce.set(ae,$);var de=new Set;function ue(e){var t=e.key;if(G.has(t))return t;var n=ce.get(e.keyCode);return n||N}de.add(k),de.add(B),de.add(P),de.add(U),de.add(j),de.add(V),de.add(H),de.add(X);var le=["input","button","textarea","select"],he=function(e){var t=e.target;if(t){var n=(""+t.tagName).toLowerCase();-1===le.indexOf(n)&&e.preventDefault()}};function fe(e,t){var n,i=e.nextChar,r=e.focusItemAtIndex,s=e.sortedIndexByFirstChar,o=e.focusedItemIndex,a=e.skipFocus,c=e.isItemAtIndexDisabled;return clearTimeout(t.bufferClearTimeout),t.bufferClearTimeout=setTimeout((function(){Ie(t)}),D.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),t.typeaheadBuffer=t.typeaheadBuffer+i,n=1===t.typeaheadBuffer.length?function(e,t,n,i){var r=i.typeaheadBuffer[0],s=e.get(r);if(!s)return-1;if(r===i.currentFirstChar&&s[i.sortedIndexCursor].index===t){i.sortedIndexCursor=(i.sortedIndexCursor+1)%s.length;var o=s[i.sortedIndexCursor].index;if(!n(o))return o}i.currentFirstChar=r;var a,c=-1;for(a=0;a<s.length;a++)if(!n(s[a].index)){c=a;break}for(;a<s.length;a++)if(s[a].index>t&&!n(s[a].index)){c=a;break}if(-1!==c)return i.sortedIndexCursor=c,s[i.sortedIndexCursor].index;return-1}(s,o,c,t):function(e,t,n){var i=n.typeaheadBuffer[0],r=e.get(i);if(!r)return-1;var s=r[n.sortedIndexCursor];if(0===s.text.lastIndexOf(n.typeaheadBuffer,0)&&!t(s.index))return s.index;var o=(n.sortedIndexCursor+1)%r.length,a=-1;for(;o!==n.sortedIndexCursor;){var c=r[o],d=0===c.text.lastIndexOf(n.typeaheadBuffer,0),u=!t(c.index);if(d&&u){a=o;break}o=(o+1)%r.length}if(-1!==a)return n.sortedIndexCursor=a,r[n.sortedIndexCursor].index;return-1}(s,c,t),-1===n||a||r(n),n}function pe(e){return e.typeaheadBuffer.length>0}function Ie(e){e.typeaheadBuffer=""}function Ee(e,t){var n=e.event,i=e.isTargetListItem,r=e.focusedItemIndex,s=e.focusItemAtIndex,o=e.sortedIndexByFirstChar,a=e.isItemAtIndexDisabled,c="ArrowLeft"===ue(n),d="ArrowUp"===ue(n),u="ArrowRight"===ue(n),l="ArrowDown"===ue(n),h="Home"===ue(n),f="End"===ue(n),p="Enter"===ue(n),I="Spacebar"===ue(n);return n.altKey||n.ctrlKey||n.metaKey||c||d||u||l||h||f||p?-1:I||1!==n.key.length?I?(i&&he(n),i&&pe(t)?fe({focusItemAtIndex:s,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:a},t):-1):-1:(he(n),fe({focusItemAtIndex:s,focusedItemIndex:r,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:a},t))}var me=["Alt","Control","Meta","Shift"];function Se(e){var t=new Set(e?me.filter((function(t){return e.getModifierState(t)})):[]);return function(e){return e.every((function(e){return t.has(e)}))&&e.length===t.size}}var xe=function(e){function t(n){var i=e.call(this,m(m({},t.defaultAdapter),n))||this;return i.wrapFocus=!1,i.isVertical=!0,i.isSingleSelectionList=!1,i.areDisabledItemsFocusable=!0,i.selectedIndex=D.UNSET_INDEX,i.focusedItemIndex=D.UNSET_INDEX,i.useActivatedClass=!1,i.useSelectedAttr=!1,i.ariaCurrentAttrValue=null,i.isCheckboxList=!1,i.isRadioList=!1,i.lastSelectedIndex=null,i.hasTypeahead=!1,i.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},i.sortedIndexByFirstChar=new Map,i}return E(t,e),Object.defineProperty(t,"strings",{get:function(){return F},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return _},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return D},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},notifySelectionChange:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),t.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},t.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},t.prototype.setWrapFocus=function(e){this.wrapFocus=e},t.prototype.setVerticalOrientation=function(e){this.isVertical=e},t.prototype.setSingleSelection=function(e){this.isSingleSelectionList=e,e&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},t.prototype.setDisabledItemsFocusable=function(e){this.areDisabledItemsFocusable=e},t.prototype.maybeInitializeSingleSelection=function(){var e=this.getSelectedIndexFromDOM();e!==D.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(e,_.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=e)},t.prototype.getSelectedIndexFromDOM=function(){for(var e=D.UNSET_INDEX,t=this.adapter.getListItemCount(),n=0;n<t;n++){var i=this.adapter.listItemAtIndexHasClass(n,_.LIST_ITEM_SELECTED_CLASS),r=this.adapter.listItemAtIndexHasClass(n,_.LIST_ITEM_ACTIVATED_CLASS);if(i||r){e=n;break}}return e},t.prototype.setHasTypeahead=function(e){this.hasTypeahead=e,e&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},t.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&pe(this.typeaheadState)},t.prototype.setUseActivatedClass=function(e){this.useActivatedClass=e},t.prototype.setUseSelectedAttribute=function(e){this.useSelectedAttr=e},t.prototype.getSelectedIndex=function(){return this.selectedIndex},t.prototype.setSelectedIndex=function(e,t){void 0===t&&(t={}),this.isIndexValid(e)&&(this.isCheckboxList?this.setCheckboxAtIndex(e,t):this.isRadioList?this.setRadioAtIndex(e,t):this.setSingleSelectionAtIndex(e,t))},t.prototype.handleFocusIn=function(e){e>=0&&(this.focusedItemIndex=e,this.adapter.setAttributeForElementIndex(e,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(e,"0"))},t.prototype.handleFocusOut=function(e){var t=this;e>=0&&(this.adapter.setAttributeForElementIndex(e,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(e,"-1")),setTimeout((function(){t.adapter.isFocusInsideList()||t.setTabindexToFirstSelectedOrFocusedItem()}),0)},t.prototype.isIndexDisabled=function(e){return this.adapter.listItemAtIndexHasClass(e,_.LIST_ITEM_DISABLED_CLASS)},t.prototype.handleKeydown=function(e,t,n){var i,r=this,s="ArrowLeft"===ue(e),o="ArrowUp"===ue(e),a="ArrowRight"===ue(e),c="ArrowDown"===ue(e),d="Home"===ue(e),u="End"===ue(e),l="Enter"===ue(e),h="Spacebar"===ue(e),f=this.isVertical&&c||!this.isVertical&&a,p=this.isVertical&&o||!this.isVertical&&s,I="A"===e.key||"a"===e.key,E=Se(e);if(this.adapter.isRootFocused()){if((p||u)&&E([]))e.preventDefault(),this.focusLastElement();else if((f||d)&&E([]))e.preventDefault(),this.focusFirstElement();else if(p&&E(["Shift"])&&this.isCheckboxList){e.preventDefault(),-1!==(S=this.focusLastElement())&&this.setSelectedIndexOnAction(S,!1)}else if(f&&E(["Shift"])&&this.isCheckboxList){e.preventDefault(),-1!==(S=this.focusFirstElement())&&this.setSelectedIndexOnAction(S,!1)}this.hasTypeahead&&Ee({event:e,focusItemAtIndex:function(e){r.focusItemAtIndex(e)},focusedItemIndex:-1,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return r.isIndexDisabled(e)}},this.typeaheadState)}else{var m=this.adapter.getFocusedElementIndex();if(!(-1===m&&(m=n)<0)){if(f&&E([]))he(e),this.focusNextElement(m);else if(p&&E([]))he(e),this.focusPrevElement(m);else if(f&&E(["Shift"])&&this.isCheckboxList){he(e),-1!==(S=this.focusNextElement(m))&&this.setSelectedIndexOnAction(S,!1)}else if(p&&E(["Shift"])&&this.isCheckboxList){var S;he(e),-1!==(S=this.focusPrevElement(m))&&this.setSelectedIndexOnAction(S,!1)}else if(d&&E([]))he(e),this.focusFirstElement();else if(u&&E([]))he(e),this.focusLastElement();else if(d&&E(["Control","Shift"])&&this.isCheckboxList){if(he(e),this.isIndexDisabled(m))return;this.focusFirstElement(),this.toggleCheckboxRange(0,m,m)}else if(u&&E(["Control","Shift"])&&this.isCheckboxList){if(he(e),this.isIndexDisabled(m))return;this.focusLastElement(),this.toggleCheckboxRange(m,this.adapter.getListItemCount()-1,m)}else if(I&&E(["Control"])&&this.isCheckboxList)e.preventDefault(),this.checkboxListToggleAll(this.selectedIndex===D.UNSET_INDEX?[]:this.selectedIndex,!0);else if((l||h)&&E([])){if(t){if((x=e.target)&&"A"===x.tagName&&l)return;if(he(e),this.isIndexDisabled(m))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(m,!1),this.adapter.notifyAction(m))}}else if((l||h)&&E(["Shift"])&&this.isCheckboxList){var x;if((x=e.target)&&"A"===x.tagName&&l)return;if(he(e),this.isIndexDisabled(m))return;this.isTypeaheadInProgress()||(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:m,m,m),this.adapter.notifyAction(m))}if(this.hasTypeahead)Ee({event:e,focusItemAtIndex:function(e){r.focusItemAtIndex(e)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(e){return r.isIndexDisabled(e)}},this.typeaheadState)}}},t.prototype.handleClick=function(e,t,n){var i,r=Se(n);e!==D.UNSET_INDEX&&(this.isIndexDisabled(e)||(r([])?(this.isSelectableList()&&this.setSelectedIndexOnAction(e,t),this.adapter.notifyAction(e)):this.isCheckboxList&&r(["Shift"])&&(this.toggleCheckboxRange(null!==(i=this.lastSelectedIndex)&&void 0!==i?i:e,e,e),this.adapter.notifyAction(e))))},t.prototype.focusNextElement=function(e){var t=this.adapter.getListItemCount(),n=e,i=null;do{if(++n>=t){if(!this.wrapFocus)return e;n=0}if(n===i)return-1;i=null!==i&&void 0!==i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},t.prototype.focusPrevElement=function(e){var t=this.adapter.getListItemCount(),n=e,i=null;do{if(--n<0){if(!this.wrapFocus)return e;n=t-1}if(n===i)return-1;i=null!==i&&void 0!==i?i:n}while(!this.areDisabledItemsFocusable&&this.isIndexDisabled(n));return this.focusItemAtIndex(n),n},t.prototype.focusFirstElement=function(){return this.focusNextElement(-1)},t.prototype.focusLastElement=function(){return this.focusPrevElement(this.adapter.getListItemCount())},t.prototype.focusInitialElement=function(){var e=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(e),e},t.prototype.setEnabled=function(e,t){this.isIndexValid(e,!1)&&(t?(this.adapter.removeClassForElementIndex(e,_.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,F.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(e,_.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(e,F.ARIA_DISABLED,"true")))},t.prototype.setSingleSelectionAtIndex=function(e,t){if(void 0===t&&(t={}),this.selectedIndex!==e||t.forceUpdate){var n=_.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(n=_.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==D.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,n),this.setAriaForSingleSelectionAtIndex(e),this.setTabindexAtIndex(e),e!==D.UNSET_INDEX&&this.adapter.addClassForElementIndex(e,n),this.selectedIndex=e,t.isUserInteraction&&!t.forceUpdate&&this.adapter.notifySelectionChange([e])}},t.prototype.setAriaForSingleSelectionAtIndex=function(e){this.selectedIndex===D.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(e,F.ARIA_CURRENT));var t=null!==this.ariaCurrentAttrValue,n=t?F.ARIA_CURRENT:F.ARIA_SELECTED;if(this.selectedIndex!==D.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),e!==D.UNSET_INDEX){var i=t?this.ariaCurrentAttrValue:"true";this.adapter.setAttributeForElementIndex(e,n,i)}},t.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?F.ARIA_SELECTED:F.ARIA_CHECKED},t.prototype.setRadioAtIndex=function(e,t){void 0===t&&(t={});var n=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(e,!0),(this.selectedIndex!==e||t.forceUpdate)&&(this.selectedIndex!==D.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,n,"false"),this.adapter.setAttributeForElementIndex(e,n,"true"),this.selectedIndex=e,t.isUserInteraction&&!t.forceUpdate&&this.adapter.notifySelectionChange([e]))},t.prototype.setCheckboxAtIndex=function(e,t){void 0===t&&(t={});for(var n=this.selectedIndex,i=t.isUserInteraction?new Set(n===D.UNSET_INDEX?[]:n):null,r=this.getSelectionAttribute(),s=[],o=0;o<this.adapter.getListItemCount();o++){var a=null===i||void 0===i?void 0:i.has(o),c=e.indexOf(o)>=0;c!==a&&s.push(o),this.adapter.setCheckedCheckboxOrRadioAtIndex(o,c),this.adapter.setAttributeForElementIndex(o,r,c?"true":"false")}this.selectedIndex=e,t.isUserInteraction&&s.length&&this.adapter.notifySelectionChange(s)},t.prototype.toggleCheckboxRange=function(e,t,n){this.lastSelectedIndex=n;for(var i=new Set(this.selectedIndex===D.UNSET_INDEX?[]:this.selectedIndex),r=!(null===i||void 0===i?void 0:i.has(n)),s=S([e,t].sort(),2),o=s[0],a=s[1],c=this.getSelectionAttribute(),d=[],u=o;u<=a;u++){if(!this.isIndexDisabled(u))r!==i.has(u)&&(d.push(u),this.adapter.setCheckedCheckboxOrRadioAtIndex(u,r),this.adapter.setAttributeForElementIndex(u,c,""+r),r?i.add(u):i.delete(u))}d.length&&(this.selectedIndex=x([],S(i)),this.adapter.notifySelectionChange(d))},t.prototype.setTabindexAtIndex=function(e){this.focusedItemIndex===D.UNSET_INDEX&&0!==e?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==e&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===e||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),e!==D.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(e,"tabindex","0")},t.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},t.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var e=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(e)},t.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"===typeof this.selectedIndex&&this.selectedIndex!==D.UNSET_INDEX?this.selectedIndex:this.selectedIndex instanceof Array&&this.selectedIndex.length>0?this.selectedIndex.reduce((function(e,t){return Math.min(e,t)})):0:Math.max(this.focusedItemIndex,0)},t.prototype.isIndexValid=function(e,t){var n=this;if(void 0===t&&(t=!0),e instanceof Array){if(!this.isCheckboxList&&t)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===e.length||e.some((function(e){return n.isIndexInRange(e)}))}if("number"===typeof e){if(this.isCheckboxList&&t)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+e);return this.isIndexInRange(e)||this.isSingleSelectionList&&e===D.UNSET_INDEX}return!1},t.prototype.isIndexInRange=function(e){var t=this.adapter.getListItemCount();return e>=0&&e<t},t.prototype.setSelectedIndexOnAction=function(e,t){this.lastSelectedIndex=e,this.isCheckboxList?(this.toggleCheckboxAtIndex(e,t),this.adapter.notifySelectionChange([e])):this.setSelectedIndex(e,{isUserInteraction:!0})},t.prototype.toggleCheckboxAtIndex=function(e,t){var n,i=this.getSelectionAttribute(),r=this.adapter.isCheckboxCheckedAtIndex(e);t?n=r:(n=!r,this.adapter.setCheckedCheckboxOrRadioAtIndex(e,n)),this.adapter.setAttributeForElementIndex(e,i,n?"true":"false");var s=this.selectedIndex===D.UNSET_INDEX?[]:this.selectedIndex.slice();n?s.push(e):s=s.filter((function(t){return t!==e})),this.selectedIndex=s},t.prototype.focusItemAtIndex=function(e){this.adapter.focusItemAtIndex(e),this.focusedItemIndex=e},t.prototype.checkboxListToggleAll=function(e,t){var n=this.adapter.getListItemCount();if(e.length===n)this.setCheckboxAtIndex([],{isUserInteraction:t});else{for(var i=[],r=0;r<n;r++)(!this.isIndexDisabled(r)||e.indexOf(r)>-1)&&i.push(r);this.setCheckboxAtIndex(i,{isUserInteraction:t})}},t.prototype.typeaheadMatchItem=function(e,t,n){var i=this;return void 0===n&&(n=!1),fe({focusItemAtIndex:function(e){i.focusItemAtIndex(e)},focusedItemIndex:t||this.focusedItemIndex,nextChar:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(e){return i.isIndexDisabled(e)}},this.typeaheadState)},t.prototype.typeaheadInitSortedIndex=function(){return function(e,t){for(var n=new Map,i=0;i<e;i++){var r=t(i).trim();if(r){var s=r[0].toLowerCase();n.has(s)||n.set(s,[]),n.get(s).push({text:r.toLowerCase(),index:i})}}return n.forEach((function(e){e.sort((function(e,t){return e.index-t.index}))})),n}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},t.prototype.clearTypeaheadBuffer=function(){Ie(this.typeaheadState)},t}(C),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),Object.defineProperty(t.prototype,"vertical",{set:function(e){this.foundation.setVerticalOrientation(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[_.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wrapFocus",{set:function(e){this.foundation.setWrapFocus(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasTypeahead",{set:function(e){this.foundation.setHasTypeahead(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"singleSelection",{set:function(e){this.foundation.setSingleSelection(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"disabledItemsFocusable",{set:function(e){this.foundation.setDisabledItemsFocusable(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(e){this.foundation.setSelectedIndex(e)},enumerable:!1,configurable:!0}),t.attachTo=function(e){return new t(e)},t.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.isEvolutionEnabled?this.classNameMap=g:v(this.root,F.DEPRECATED_SELECTOR)?this.classNameMap=O:this.classNameMap=Object.values(_).reduce((function(e,t){return e[t]=t,e}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},t.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},t.prototype.layout=function(){var e=this.root.getAttribute(F.ARIA_ORIENTATION);this.vertical=e!==F.ARIA_ORIENTATION_HORIZONTAL;var t="."+this.classNameMap[_.LIST_ITEM_CLASS]+":not([tabindex])",n=F.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll(t);i.length&&Array.prototype.forEach.call(i,(function(e){e.setAttribute("tabindex","-1")}));var r=this.root.querySelectorAll(n);r.length&&Array.prototype.forEach.call(r,(function(e){e.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},t.prototype.getPrimaryText=function(e){var t,n=e.querySelector("."+this.classNameMap[_.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n)return null!==(t=null===n||void 0===n?void 0:n.textContent)&&void 0!==t?t:"";var i=e.querySelector("."+this.classNameMap[_.LIST_ITEM_TEXT_CLASS]);return i&&i.textContent||""},t.prototype.initializeListType=function(){var e=this;if(this.isInteractive=v(this.root,F.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var t=Array.from(this.root.querySelectorAll(F.SELECTED_ITEM_SELECTOR),(function(t){return e.listElements.indexOf(t)}));v(this.root,F.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=t:t.length>0&&(this.selectedIndex=t[0])}else{var n=this.root.querySelectorAll(F.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(F.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var r=this.root.querySelectorAll(F.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(r,(function(t){return e.listElements.indexOf(t)}))}else i&&(this.selectedIndex=this.listElements.indexOf(i))}},t.prototype.setEnabled=function(e,t){this.foundation.setEnabled(e,t)},t.prototype.typeaheadMatchItem=function(e,t){return this.foundation.typeaheadMatchItem(e,t,!0)},t.prototype.getDefaultFoundation=function(){var e=this;return new xe({addClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.add(e.classNameMap[n])},focusItemAtIndex:function(t){var n=e.listElements[t];n&&n.focus()},getAttributeForElementIndex:function(t,n){return e.listElements[t].getAttribute(n)},getFocusedElementIndex:function(){return e.listElements.indexOf(document.activeElement)},getListItemCount:function(){return e.listElements.length},getPrimaryTextAtIndex:function(t){return e.getPrimaryText(e.listElements[t])},hasCheckboxAtIndex:function(t){return!!e.listElements[t].querySelector(F.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(t){return!!e.listElements[t].querySelector(F.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(t){return e.listElements[t].querySelector(F.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return e.root!==document.activeElement&&e.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===e.root},listItemAtIndexHasClass:function(t,n){return e.listElements[t].classList.contains(e.classNameMap[n])},notifyAction:function(t){e.emit(F.ACTION_EVENT,{index:t},!0)},notifySelectionChange:function(t){e.emit(F.SELECTION_CHANGE_EVENT,{changedIndices:t},!0)},removeClassForElementIndex:function(t,n){var i=e.listElements[t];i&&i.classList.remove(e.classNameMap[n])},setAttributeForElementIndex:function(t,n,i){var r=e.listElements[t];r&&r.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(t,n){var i=e.listElements[t].querySelector(F.CHECKBOX_RADIO_SELECTOR);i.checked=n;var r=document.createEvent("Event");r.initEvent("change",!0,!0),i.dispatchEvent(r)},setTabIndexForListItemChildren:function(t,n){var i=e.listElements[t],r=F.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(i.querySelectorAll(r),(function(e){e.setAttribute("tabindex",n)}))}})},t.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[_.LIST_ITEM_CLASS]+'[tabindex="0"]')){var e=this.initialFocusIndex();-1!==e&&(this.listElements[e].tabIndex=0)}},t.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"===typeof this.selectedIndex&&this.selectedIndex!==D.UNSET_INDEX)return this.selectedIndex;var e=this.root.querySelector("."+this.classNameMap[_.LIST_ITEM_CLASS]+":not(."+this.classNameMap[_.LIST_ITEM_DISABLED_CLASS]+")");return null===e?-1:this.getListItemIndex(e)},t.prototype.getListItemIndex=function(e){var t=function(e,t){if(e.closest)return e.closest(t);for(var n=e;n;){if(v(n,t))return n;n=n.parentElement}return null}(e,"."+this.classNameMap[_.LIST_ITEM_CLASS]+", ."+this.classNameMap[_.ROOT]);return t&&v(t,"."+this.classNameMap[_.LIST_ITEM_CLASS])?this.listElements.indexOf(t):-1},t.prototype.handleFocusInEvent=function(e){var t=this.getListItemIndex(e.target);this.foundation.handleFocusIn(t)},t.prototype.handleFocusOutEvent=function(e){var t=this.getListItemIndex(e.target);this.foundation.handleFocusOut(t)},t.prototype.handleKeydownEvent=function(e){var t=this.getListItemIndex(e.target),n=e.target;this.foundation.handleKeydown(e,n.classList.contains(this.classNameMap[_.LIST_ITEM_CLASS]),t)},t.prototype.handleClickEvent=function(e){var t=this.getListItemIndex(e.target),n=!v(e.target,F.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(t,n,e)},t}(b),Ae={ANIMATE:"mdc-drawer--animate",CLOSING:"mdc-drawer--closing",DISMISSIBLE:"mdc-drawer--dismissible",MODAL:"mdc-drawer--modal",OPEN:"mdc-drawer--open",OPENING:"mdc-drawer--opening",ROOT:"mdc-drawer"},Ce={APP_CONTENT_SELECTOR:".mdc-drawer-app-content",CLOSE_EVENT:"MDCDrawer:closed",OPEN_EVENT:"MDCDrawer:opened",SCRIM_SELECTOR:".mdc-drawer-scrim",LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",LIST_ITEM_ACTIVATED_SELECTOR:".mdc-list-item--activated,.mdc-deprecated-list-item--activated"},be=function(e){function t(n){var i=e.call(this,m(m({},t.defaultAdapter),n))||this;return i.animationFrame=0,i.animationTimer=0,i}return E(t,e),Object.defineProperty(t,"strings",{get:function(){return Ce},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssClasses",{get:function(){return Ae},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},elementHasClass:function(){return!1},notifyClose:function(){},notifyOpen:function(){},saveFocus:function(){},restoreFocus:function(){},focusActiveNavigationItem:function(){},trapFocus:function(){},releaseFocus:function(){}}},enumerable:!1,configurable:!0}),t.prototype.destroy=function(){this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.animationTimer&&clearTimeout(this.animationTimer)},t.prototype.open=function(){var e=this;this.isOpen()||this.isOpening()||this.isClosing()||(this.adapter.addClass(Ae.OPEN),this.adapter.addClass(Ae.ANIMATE),this.runNextAnimationFrame((function(){e.adapter.addClass(Ae.OPENING)})),this.adapter.saveFocus())},t.prototype.close=function(){!this.isOpen()||this.isOpening()||this.isClosing()||this.adapter.addClass(Ae.CLOSING)},t.prototype.isOpen=function(){return this.adapter.hasClass(Ae.OPEN)},t.prototype.isOpening=function(){return this.adapter.hasClass(Ae.OPENING)||this.adapter.hasClass(Ae.ANIMATE)},t.prototype.isClosing=function(){return this.adapter.hasClass(Ae.CLOSING)},t.prototype.handleKeydown=function(e){var t=e.keyCode;("Escape"===e.key||27===t)&&this.close()},t.prototype.handleTransitionEnd=function(e){var t=Ae.OPENING,n=Ae.CLOSING,i=Ae.OPEN,r=Ae.ANIMATE,s=Ae.ROOT;this.isElement(e.target)&&this.adapter.elementHasClass(e.target,s)&&(this.isClosing()?(this.adapter.removeClass(i),this.closed(),this.adapter.restoreFocus(),this.adapter.notifyClose()):(this.adapter.focusActiveNavigationItem(),this.opened(),this.adapter.notifyOpen()),this.adapter.removeClass(r),this.adapter.removeClass(t),this.adapter.removeClass(n))},t.prototype.opened=function(){},t.prototype.closed=function(){},t.prototype.runNextAnimationFrame=function(e){var t=this;cancelAnimationFrame(this.animationFrame),this.animationFrame=requestAnimationFrame((function(){t.animationFrame=0,clearTimeout(t.animationTimer),t.animationTimer=setTimeout(e,0)}))},t.prototype.isElement=function(e){return Boolean(e.classList)},t}(C),Te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),t.prototype.handleScrimClick=function(){this.close()},t.prototype.opened=function(){this.adapter.trapFocus()},t.prototype.closed=function(){this.adapter.releaseFocus()},t}(be);var Le=be.cssClasses,ve=be.strings,_e=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return E(t,e),t.attachTo=function(e){return new t(e)},Object.defineProperty(t.prototype,"open",{get:function(){return this.foundation.isOpen()},set:function(e){e?this.foundation.open():this.foundation.close()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"list",{get:function(){return this.innerList},enumerable:!1,configurable:!0}),t.prototype.initialize=function(e,t){void 0===e&&(e=function(e){return new L(e)}),void 0===t&&(t=function(e){return new ye(e)});var n=this.root.querySelector(ve.LIST_SELECTOR);n&&(this.innerList=t(n),this.innerList.wrapFocus=!0),this.focusTrapFactory=e},t.prototype.initialSyncWithDOM=function(){var e,t=this,n=Le.MODAL,i=ve.SCRIM_SELECTOR;this.scrim=this.root.parentNode.querySelector(i),this.scrim&&this.root.classList.contains(n)&&(this.handleScrimClick=function(){return t.foundation.handleScrimClick()},this.scrim.addEventListener("click",this.handleScrimClick),this.focusTrap=(e=this.root,(0,this.focusTrapFactory)(e,{skipInitialFocus:!0}))),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleTransitionEnd=function(e){t.foundation.handleTransitionEnd(e)},this.listen("keydown",this.handleKeydown),this.listen("transitionend",this.handleTransitionEnd)},t.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("transitionend",this.handleTransitionEnd),this.innerList&&this.innerList.destroy();var e=Le.MODAL;this.scrim&&this.handleScrimClick&&this.root.classList.contains(e)&&(this.scrim.removeEventListener("click",this.handleScrimClick),this.open=!1)},t.prototype.getDefaultFoundation=function(){var e=this,t={addClass:function(t){e.root.classList.add(t)},removeClass:function(t){e.root.classList.remove(t)},hasClass:function(t){return e.root.classList.contains(t)},elementHasClass:function(e,t){return e.classList.contains(t)},saveFocus:function(){e.previousFocus=document.activeElement},restoreFocus:function(){var t=e.previousFocus;t&&t.focus&&e.root.contains(document.activeElement)&&t.focus()},focusActiveNavigationItem:function(){var t=e.root.querySelector(ve.LIST_ITEM_ACTIVATED_SELECTOR);t&&t.focus()},notifyClose:function(){e.emit(ve.CLOSE_EVENT,{},!0)},notifyOpen:function(){e.emit(ve.OPEN_EVENT,{},!0)},trapFocus:function(){e.focusTrap.trapFocus()},releaseFocus:function(){e.focusTrap.releaseFocus()}},n=Le.DISMISSIBLE,i=Le.MODAL;if(this.root.classList.contains(n))return new be(t);if(this.root.classList.contains(i))return new Te(t);throw new Error("MDCDrawer: Failed to instantiate component. Supported variants are "+n+" and "+i+".")},t}(b);var ge=(e,t,n)=>e[n]||e.type===t[n]||e.type===n;const Oe="UiDrawer",Fe={TYPES:{permanent:0,dismissible:1,modal:2},cssClasses:{root:"mdc-drawer-root",scrim:"mdc-drawer-scrim"},EVENTS:{NAV:"nav",CHANGE:"update:modelValue"}},De={name:Oe,customOptions:{UI_DRAWER:Fe}};var Ne=Object.assign(De,{props:{navId:{type:[String,null],default:null},modelValue:{type:Boolean,default:!1},type:{type:[String,Number],default:0},viewportHeight:{type:Boolean,default:!1}},emits:[Fe.EVENTS.NAV,Fe.EVENTS.CHANGE],setup(e,t){let{emit:n}=t;const i=e,r=n,s=(0,p.ref)(null),o=(0,p.reactive)({$drawer:null});let a=null;(0,p.computed)((()=>ge(i,Fe.TYPES,"permanent")));const c=(0,p.computed)((()=>ge(i,Fe.TYPES,"dismissible"))),d=(0,p.computed)((()=>ge(i,Fe.TYPES,"modal"))),u=(0,p.computed)((()=>({"mdc-drawer":!0,"mdc-drawer--dismissible":c.value,"mdc-drawer--modal":d.value})));function l(){if(d.value&&!a){a=document.createElement("div"),a.className=Fe.cssClasses.scrim,a.addEventListener("click",I);const e=s.value;e.parentNode.insertBefore(a,e.nextSibling)}}function h(){let e=!0;return o.$drawer.list&&o.$drawer.list.listElements.length||(e=!1,console.warn(`[${Oe}]: <ui-nav> or <ui-list> is required for <ui-drawer-content> in the drawer`)),e}function f(){const e=s.value;o.$drawer=new _e(e),o.$drawer.listen(Ce.OPEN_EVENT,(()=>{r(Fe.EVENTS.NAV,!0)})),o.$drawer.listen(Ce.CLOSE_EVENT,I),i.navId&&document.getElementById(i.navId)&&(h(),document.getElementById(i.navId).addEventListener("click",(()=>{h()&&(o.$drawer.open=!o.$drawer.open)})),o.$drawer.open=i.modelValue)}function I(){r(Fe.EVENTS.NAV,!1),r(Fe.EVENTS.CHANGE,!1)}return(0,p.onMounted)((()=>{if(i.viewportHeight){s.value.parentNode.classList.add(Fe.cssClasses.root)}(c.value||d.value)&&(l(),f()),(0,p.watch)((()=>i.modelValue),(e=>{o.$drawer&&(o.$drawer.open=e)})),(0,p.watch)((()=>i.type),(()=>{(0,p.nextTick)((()=>{d.value&&(l(),o.$drawer||f())}))}))})),(e,t)=>((0,p.openBlock)(),(0,p.createElementBlock)("aside",{ref_key:"drawer",ref:s,class:(0,p.normalizeClass)(u.value)},[(0,p.renderSlot)(e.$slots,"default")],2))}});var we=Ne;const Me={class:"mdc-drawer__header"};var Re={name:"UiDrawerHeader"},ke=i(262);const Be={class:"mdc-drawer__content"};var Pe={name:"UiDrawerContent"};const Ue={class:"mdc-drawer__title"};var je={name:"UiDrawerTitle"};const Ve={class:"mdc-drawer__subtitle"};var He={name:"UiDrawerSubtitle"};const Xe={class:"mdc-drawer-app-content"};var Ke={name:"UiDrawerAppContent"};var qe=f({UiDrawer:we,UiDrawerHeader:(0,ke.A)(Re,[["render",function(e,t,n,i,r,s){return(0,p.openBlock)(),(0,p.createElementBlock)("header",Me,[(0,p.renderSlot)(e.$slots,"default")])}]]),UiDrawerContent:(0,ke.A)(Pe,[["render",function(e,t,n,i,r,s){return(0,p.openBlock)(),(0,p.createElementBlock)("div",Be,[(0,p.renderSlot)(e.$slots,"default")])}]]),UiDrawerTitle:(0,ke.A)(je,[["render",function(e,t,n,i,r,s){return(0,p.openBlock)(),(0,p.createElementBlock)("h3",Ue,[(0,p.renderSlot)(e.$slots,"default")])}]]),UiDrawerSubtitle:(0,ke.A)(He,[["render",function(e,t,n,i,r,s){return(0,p.openBlock)(),(0,p.createElementBlock)("h6",Ve,[(0,p.renderSlot)(e.$slots,"default")])}]]),UiDrawerAppContent:(0,ke.A)(Ke,[["render",function(e,t,n,i,r,s){return(0,p.openBlock)(),(0,p.createElementBlock)("div",Xe,[(0,p.renderSlot)(e.$slots,"default")])}]])});return r=r.default}()}));