balm-ui
Version:
A modular and customizable UI library based on Material Design and Vue 3
1 lines • 55.5 kB
JavaScript
!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define("UiTabs",["vue"],e):"object"===typeof exports?exports.UiTabs=e(require("vue")):t.UiTabs=e(t.Vue)}("undefined"!==typeof self?self:this,(function(t){return function(){"use strict";var e={744:function(t){var e=function(t){return function(t){return!!t&&"object"===typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===n}(t)}(t)};var n="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function o(t,e,n){return t.concat(e).map((function(t){return r(t,n)}))}function i(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return Object.propertyIsEnumerable.call(t,e)})):[]}(t))}function a(t,e){try{return e in t}catch(n){return!1}}function s(t,e,n){var o={};return n.isMergeableObject(t)&&i(t).forEach((function(e){o[e]=r(t[e],n)})),i(e).forEach((function(i){(function(t,e){return a(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(a(t,i)&&n.isMergeableObject(e[i])?o[i]=function(t,e){if(!e.customMerge)return c;var n=e.customMerge(t);return"function"===typeof n?n:c}(i,n)(t[i],e[i],n):o[i]=r(e[i],n))})),o}function c(t,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||e,i.cloneUnlessOtherwiseSpecified=r;var a=Array.isArray(n);return a===Array.isArray(t)?a?i.arrayMerge(t,n,i):s(t,n,i):r(n,i)}c.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return c(t,n,e)}),{})};var l=c;t.exports=l},262:function(t,e){e.A=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n}},154:function(e){e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};r.d(o,{default:function(){return $t}});var i=r(744),a=r.n(i);const s=/(?:^\[object\s(.*?)\]$)/;var c=t=>Object.prototype.toString.call(t).replace(s,"$1").toLowerCase();const l=t=>{let{componentProps:e,propName:n,props:r}=t,o=r[n];if("object"===c(o)){const t=e[n].default;e[n].default=()=>a()(t,o)}else Array.isArray(o)?e[n].default=()=>o:e[n].default=o},u=t=>{let{componentMixins:e,propName:n,props:r}=t;if(e.length){let t=e.length;for(;t--;)if(e[t].props&&void 0!==e[t].props[n]){l({componentProps:e[t].props,propName:n,props:r});break}}};var d=(t,e)=>{for(const n of Object.keys(e))t.props?void 0===t.props[n]?u({componentMixins:t.mixins,propName:n,props:e}):l({componentProps:t.props,propName:n,props:e}):u({componentMixins:t.mixins,propName:n,props:e})};var f=(t,e)=>{for(const n of Object.keys(e))if(/^Ui[A-Z]{1}[A-Za-z]+$/.test(n)){const r=t[n],o=e[n];d(r,o)}};var p=t=>{const e={install(e){f(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});for(let n in t){const r=t[n];e.component(r.name,r)}}};return e},h=r(154),m=function(t,e){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},m(t,e)};function v(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var y=function(){return y=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},y.apply(this,arguments)};Object.create;function g(t){var e="function"===typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"===typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(t,e){var n="function"===typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function S(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o<i;o++)!r&&o in e||(r||(r=Array.prototype.slice.call(e,0,o)),r[o]=e[o]);return t.concat(r||Array.prototype.slice.call(e))}Object.create;"function"===typeof SuppressedError&&SuppressedError;var A=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),T=function(){function t(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];this.root=t,this.initialize.apply(this,S([],b(n))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new A({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,n){this.root.addEventListener(t,e,n)},t.prototype.unlisten=function(t,e,n){this.root.removeEventListener(t,e,n)},t.prototype.emit=function(t,e,n){var r;void 0===n&&(n=!1),"function"===typeof CustomEvent?r=new CustomEvent(t,{bubbles:n,detail:e}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root.dispatchEvent(r)},t}();function E(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var n={get passive(){return e=!0,!1}},r=function(){};t.document.addEventListener("test",r,n),t.document.removeEventListener("test",r,n)}catch(o){e=!1}return e}(t)&&{passive:!0}}function C(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var I,O={ANIMATING:"mdc-tab-scroller--animating",SCROLL_AREA_SCROLL:"mdc-tab-scroller__scroll-area--scroll",SCROLL_TEST:"mdc-tab-scroller__test"},R={AREA_SELECTOR:".mdc-tab-scroller__scroll-area",CONTENT_SELECTOR:".mdc-tab-scroller__scroll-content"},L=function(t){this.adapter=t},_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.getScrollPositionRTL=function(){var t=this.adapter.getScrollAreaScrollLeft(),e=this.calculateScrollEdges().right;return Math.round(e-t)},e.prototype.scrollToRTL=function(t){var e=this.calculateScrollEdges(),n=this.adapter.getScrollAreaScrollLeft(),r=this.clampScrollValue(e.right-t);return{finalScrollPosition:r,scrollDelta:r-n}},e.prototype.incrementScrollRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(e-t);return{finalScrollPosition:n,scrollDelta:n-e}},e.prototype.getAnimatingScrollPosition=function(t){return t},e.prototype.calculateScrollEdges=function(){return{left:0,right:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth()}},e.prototype.clampScrollValue=function(t){var e=this.calculateScrollEdges();return Math.min(Math.max(e.left,t),e.right)},e}(L),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.getScrollPositionRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft();return Math.round(t-e)},e.prototype.scrollToRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(-t);return{finalScrollPosition:n,scrollDelta:n-e}},e.prototype.incrementScrollRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(e-t);return{finalScrollPosition:n,scrollDelta:n-e}},e.prototype.getAnimatingScrollPosition=function(t,e){return t-e},e.prototype.calculateScrollEdges=function(){var t=this.adapter.getScrollContentOffsetWidth();return{left:this.adapter.getScrollAreaOffsetWidth()-t,right:0}},e.prototype.clampScrollValue=function(t){var e=this.calculateScrollEdges();return Math.max(Math.min(e.right,t),e.left)},e}(L),w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.getScrollPositionRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft();return Math.round(e-t)},e.prototype.scrollToRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(t);return{finalScrollPosition:n,scrollDelta:e-n}},e.prototype.incrementScrollRTL=function(t){var e=this.adapter.getScrollAreaScrollLeft(),n=this.clampScrollValue(e+t);return{finalScrollPosition:n,scrollDelta:e-n}},e.prototype.getAnimatingScrollPosition=function(t,e){return t+e},e.prototype.calculateScrollEdges=function(){return{left:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth(),right:0}},e.prototype.clampScrollValue=function(t){var e=this.calculateScrollEdges();return Math.min(Math.max(e.right,t),e.left)},e}(L),D=function(t){function e(n){var r=t.call(this,y(y({},e.defaultAdapter),n))||this;return r.isAnimating=!1,r}return v(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return O},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return R},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{eventTargetMatchesSelector:function(){return!1},addClass:function(){},removeClass:function(){},addScrollAreaClass:function(){},setScrollAreaStyleProperty:function(){},setScrollContentStyleProperty:function(){},getScrollContentStyleValue:function(){return""},setScrollAreaScrollLeft:function(){},getScrollAreaScrollLeft:function(){return 0},getScrollContentOffsetWidth:function(){return 0},getScrollAreaOffsetWidth:function(){return 0},computeScrollAreaClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},computeScrollContentClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},computeHorizontalScrollbarHeight:function(){return 0}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this.adapter.computeHorizontalScrollbarHeight();this.adapter.setScrollAreaStyleProperty("margin-bottom",-t+"px"),this.adapter.addScrollAreaClass(e.cssClasses.SCROLL_AREA_SCROLL)},e.prototype.getScrollPosition=function(){if(this.isRTL())return this.computeCurrentScrollPositionRTL();var t=this.calculateCurrentTranslateX();return this.adapter.getScrollAreaScrollLeft()-t},e.prototype.handleInteraction=function(){this.isAnimating&&this.stopScrollAnimation()},e.prototype.handleTransitionEnd=function(t){var n=t.target;this.isAnimating&&this.adapter.eventTargetMatchesSelector(n,e.strings.CONTENT_SELECTOR)&&(this.isAnimating=!1,this.adapter.removeClass(e.cssClasses.ANIMATING))},e.prototype.incrementScroll=function(t){0!==t&&this.animate(this.getIncrementScrollOperation(t))},e.prototype.incrementScrollImmediate=function(t){if(0!==t){var e=this.getIncrementScrollOperation(t);0!==e.scrollDelta&&(this.stopScrollAnimation(),this.adapter.setScrollAreaScrollLeft(e.finalScrollPosition))}},e.prototype.scrollTo=function(t){this.isRTL()?this.scrollToImplRTL(t):this.scrollToImpl(t)},e.prototype.getRTLScroller=function(){return this.rtlScrollerInstance||(this.rtlScrollerInstance=this.rtlScrollerFactory()),this.rtlScrollerInstance},e.prototype.calculateCurrentTranslateX=function(){var t=this.adapter.getScrollContentStyleValue("transform");if("none"===t)return 0;var e=/\((.+?)\)/.exec(t);if(!e)return 0;var n=b(e[1].split(","),6),r=(n[0],n[1],n[2],n[3],n[4]);n[5];return parseFloat(r)},e.prototype.clampScrollValue=function(t){var e=this.calculateScrollEdges();return Math.min(Math.max(e.left,t),e.right)},e.prototype.computeCurrentScrollPositionRTL=function(){var t=this.calculateCurrentTranslateX();return this.getRTLScroller().getScrollPositionRTL(t)},e.prototype.calculateScrollEdges=function(){return{left:0,right:this.adapter.getScrollContentOffsetWidth()-this.adapter.getScrollAreaOffsetWidth()}},e.prototype.scrollToImpl=function(t){var e=this.getScrollPosition(),n=this.clampScrollValue(t),r=n-e;this.animate({finalScrollPosition:n,scrollDelta:r})},e.prototype.scrollToImplRTL=function(t){var e=this.getRTLScroller().scrollToRTL(t);this.animate(e)},e.prototype.getIncrementScrollOperation=function(t){if(this.isRTL())return this.getRTLScroller().incrementScrollRTL(t);var e=this.getScrollPosition(),n=t+e,r=this.clampScrollValue(n);return{finalScrollPosition:r,scrollDelta:r-e}},e.prototype.animate=function(t){var n=this;0!==t.scrollDelta&&(this.stopScrollAnimation(),this.adapter.setScrollAreaScrollLeft(t.finalScrollPosition),this.adapter.setScrollContentStyleProperty("transform","translateX("+t.scrollDelta+"px)"),this.adapter.computeScrollAreaClientRect(),requestAnimationFrame((function(){n.adapter.addClass(e.cssClasses.ANIMATING),n.adapter.setScrollContentStyleProperty("transform","none")})),this.isAnimating=!0)},e.prototype.stopScrollAnimation=function(){this.isAnimating=!1;var t=this.getAnimatingScrollPosition();this.adapter.removeClass(e.cssClasses.ANIMATING),this.adapter.setScrollContentStyleProperty("transform","translateX(0px)"),this.adapter.setScrollAreaScrollLeft(t)},e.prototype.getAnimatingScrollPosition=function(){var t=this.calculateCurrentTranslateX(),e=this.adapter.getScrollAreaScrollLeft();return this.isRTL()?this.getRTLScroller().getAnimatingScrollPosition(e,t):e-t},e.prototype.rtlScrollerFactory=function(){var t=this.adapter.getScrollAreaScrollLeft();this.adapter.setScrollAreaScrollLeft(t-1);var e=this.adapter.getScrollAreaScrollLeft();if(e<0)return this.adapter.setScrollAreaScrollLeft(t),new N(this.adapter);var n=this.adapter.computeScrollAreaClientRect(),r=this.adapter.computeScrollContentClientRect(),o=Math.round(r.right-n.right);return this.adapter.setScrollAreaScrollLeft(t),o===e?new w(this.adapter):new _(this.adapter)},e.prototype.isRTL=function(){return"rtl"===this.adapter.getScrollContentStyleValue("direction")},e}(A);var V,x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(){this.area=this.root.querySelector(D.strings.AREA_SELECTOR),this.content=this.root.querySelector(D.strings.CONTENT_SELECTOR)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleInteraction=function(){t.foundation.handleInteraction()},this.handleTransitionEnd=function(e){t.foundation.handleTransitionEnd(e)},this.area.addEventListener("wheel",this.handleInteraction,E()),this.area.addEventListener("touchstart",this.handleInteraction,E()),this.area.addEventListener("pointerdown",this.handleInteraction,E()),this.area.addEventListener("mousedown",this.handleInteraction,E()),this.area.addEventListener("keydown",this.handleInteraction,E()),this.content.addEventListener("transitionend",this.handleTransitionEnd)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.area.removeEventListener("wheel",this.handleInteraction,E()),this.area.removeEventListener("touchstart",this.handleInteraction,E()),this.area.removeEventListener("pointerdown",this.handleInteraction,E()),this.area.removeEventListener("mousedown",this.handleInteraction,E()),this.area.removeEventListener("keydown",this.handleInteraction,E()),this.content.removeEventListener("transitionend",this.handleTransitionEnd)},e.prototype.getDefaultFoundation=function(){var t=this;return new D({eventTargetMatchesSelector:function(t,e){return C(t,e)},addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},addScrollAreaClass:function(e){t.area.classList.add(e)},setScrollAreaStyleProperty:function(e,n){t.area.style.setProperty(e,n)},setScrollContentStyleProperty:function(e,n){t.content.style.setProperty(e,n)},getScrollContentStyleValue:function(e){return window.getComputedStyle(t.content).getPropertyValue(e)},setScrollAreaScrollLeft:function(e){return t.area.scrollLeft=e},getScrollAreaScrollLeft:function(){return t.area.scrollLeft},getScrollContentOffsetWidth:function(){return t.content.offsetWidth},getScrollAreaOffsetWidth:function(){return t.area.offsetWidth},computeScrollAreaClientRect:function(){return t.area.getBoundingClientRect()},computeScrollContentClientRect:function(){return t.content.getBoundingClientRect()},computeHorizontalScrollbarHeight:function(){return function(t,e){if(void 0===e&&(e=!0),e&&"undefined"!==typeof I)return I;var n=t.createElement("div");n.classList.add(O.SCROLL_TEST),t.body.appendChild(n);var r=n.offsetHeight-n.clientHeight;return t.body.removeChild(n),e&&(I=r),r}(document)}})},e.prototype.getScrollPosition=function(){return this.foundation.getScrollPosition()},e.prototype.getScrollContentWidth=function(){return this.content.offsetWidth},e.prototype.incrementScroll=function(t){this.foundation.incrementScroll(t)},e.prototype.scrollTo=function(t){this.foundation.scrollTo(t)},e}(T),P={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},B={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},M={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300};var k=["touchstart","pointerdown","mousedown","keydown"],H=["touchend","pointerup","mouseup","contextmenu"],U=[],F=function(t){function e(n){var r=t.call(this,y(y({},e.defaultAdapter),n))||this;return r.activationAnimationHasEnded=!1,r.activationTimer=0,r.fgDeactivationRemovalTimer=0,r.fgScale="0",r.frame={width:0,height:0},r.initialSize=0,r.layoutFrame=0,r.maxRadius=0,r.unboundedCoords={left:0,top:0},r.activationState=r.defaultActivationState(),r.activationTimerCallback=function(){r.activationAnimationHasEnded=!0,r.runDeactivationUXLogicIfReady()},r.activateHandler=function(t){r.activateImpl(t)},r.deactivateHandler=function(){r.deactivateImpl()},r.focusHandler=function(){r.handleFocus()},r.blurHandler=function(){r.handleBlur()},r.resizeHandler=function(){r.layout()},r}return v(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return P},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return B},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return M},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=this,n=this.supportsPressRipple();if(this.registerRootHandlers(n),n){var r=e.cssClasses,o=r.ROOT,i=r.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(i),t.layoutInternal())}))}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var n=e.cssClasses,r=n.ROOT,o=n.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(r),t.adapter.removeClass(o),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},e.prototype.activate=function(t){this.activateImpl(t)},e.prototype.deactivate=function(){this.deactivateImpl()},e.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},e.prototype.setUnbounded=function(t){var n=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(n):this.adapter.removeClass(n)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)}))},e.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers=function(t){var e,n;if(t){try{for(var r=g(k),o=r.next();!o.done;o=r.next()){var i=o.value;this.adapter.registerInteractionHandler(i,this.activateHandler)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},e.prototype.registerDeactivationHandlers=function(t){var e,n;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var r=g(H),o=r.next();!o.done;o=r.next()){var i=o.value;this.adapter.registerDocumentInteractionHandler(i,this.deactivateHandler)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},e.prototype.deregisterRootHandlers=function(){var t,e;try{for(var n=g(k),r=n.next();!r.done;r=n.next()){var o=r.value;this.adapter.deregisterInteractionHandler(o,this.activateHandler)}}catch(i){t={error:i}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},e.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var n=g(H),r=n.next();!r.done;r=n.next()){var o=r.value;this.adapter.deregisterDocumentInteractionHandler(o,this.deactivateHandler)}}catch(i){t={error:i}}finally{try{r&&!r.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e.prototype.removeCssVars=function(){var t=this,n=e.strings;Object.keys(n).forEach((function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(n[e],null)}))},e.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var n=this.activationState;if(!n.isActivated){var r=this.previousActivationEvent;if(!(r&&void 0!==t&&r.type!==t.type))n.isActivated=!0,n.isProgrammatic=void 0===t,n.activationEvent=t,n.wasActivatedByPointer=!n.isProgrammatic&&(void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type)),void 0!==t&&U.length>0&&U.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(U.push(t.target),this.registerDeactivationHandlers(t)),n.wasElementMadeActive=this.checkElementMadeActive(t),n.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){U=[],n.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(n.wasElementMadeActive=e.checkElementMadeActive(t),n.wasElementMadeActive&&e.animateActivation()),n.wasElementMadeActive||(e.activationState=e.defaultActivationState())})))}}},e.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation=function(){var t=this,n=e.strings,r=n.VAR_FG_TRANSLATE_START,o=n.VAR_FG_TRANSLATE_END,i=e.cssClasses,a=i.FG_DEACTIVATION,s=i.FG_ACTIVATION,c=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var l="",u="";if(!this.adapter.isUnbounded()){var d=this.getFgTranslationCoordinates(),f=d.startPoint,p=d.endPoint;l=f.x+"px, "+f.y+"px",u=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(r,l),this.adapter.updateCssVariable(o,u),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),c)},e.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,n=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,n){if(!t)return{x:0,y:0};var r,o,i=e.x,a=e.y,s=i+n.left,c=a+n.top;if("touchstart"===t.type){var l=t;r=l.changedTouches[0].pageX-s,o=l.changedTouches[0].pageY-c}else{var u=t;r=u.pageX-s,o=u.pageY-c}return{x:r,y:o}}(n,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},e.prototype.runDeactivationUXLogicIfReady=function(){var t=this,n=e.cssClasses.FG_DEACTIVATION,r=this.activationState,o=r.hasDeactivationUXRun,i=r.isActivated;(o||!i)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(n),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(n)}),M.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),e.numbers.TAP_DELAY_MS)},e.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var n=y({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(n)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(n),t.resetActivationState()})))}},e.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady()},e.prototype.layoutInternal=function(){var t=this;this.frame=this.adapter.computeBoundingRect();var n=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?n:Math.sqrt(Math.pow(t.frame.width,2)+Math.pow(t.frame.height,2))+e.numbers.PADDING;var r=Math.floor(n*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&r%2!==0?this.initialSize=r-1:this.initialSize=r,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},e.prototype.updateLayoutCssVars=function(){var t=e.strings,n=t.VAR_FG_SIZE,r=t.VAR_LEFT,o=t.VAR_TOP,i=t.VAR_FG_SCALE;this.adapter.updateCssVariable(n,this.initialSize+"px"),this.adapter.updateCssVariable(i,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(r,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords.top+"px"))},e}(A),j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return v(e,t),e.attachTo=function(t,n){void 0===n&&(n={isUnbounded:void 0});var r=new e(t);return void 0!==n.isUnbounded&&(r.unbounded=n.isUnbounded),r},e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var n,r=t.CSS;if("boolean"===typeof V&&!e)return V;if(!r||"function"!==typeof r.supports)return!1;var o=r.supports("--css-vars","yes"),i=r.supports("(--css-vars: yes)")&&r.supports("color","#00000000");return n=o||i,e||(V=n),n}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,E())},deregisterInteractionHandler:function(e,n){return t.root.removeEventListener(e,n,E())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return C(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,E())},registerInteractionHandler:function(e,n){return t.root.addEventListener(e,n,E())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,n){return t.root.style.setProperty(e,n)}}},Object.defineProperty(e.prototype,"unbounded",{get:function(){return Boolean(this.isUnbounded)},set:function(t){this.isUnbounded=Boolean(t),this.setUnbounded()},enumerable:!1,configurable:!0}),e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getDefaultFoundation=function(){return new F(e.createAdapter(this))},e.prototype.initialSyncWithDOM=function(){var t=this.root;this.isUnbounded="mdcRippleIsUnbounded"in t.dataset},e.prototype.setUnbounded=function(){this.foundation.setUnbounded(Boolean(this.isUnbounded))},e}(T),W={ACTIVE:"mdc-tab-indicator--active",FADE:"mdc-tab-indicator--fade",NO_TRANSITION:"mdc-tab-indicator--no-transition"},K={CONTENT_SELECTOR:".mdc-tab-indicator__content"},G=function(t){function e(n){return t.call(this,y(y({},e.defaultAdapter),n))||this}return v(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return K},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},computeContentClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},setContentStyleProperty:function(){}}},enumerable:!1,configurable:!0}),e.prototype.computeContentClientRect=function(){return this.adapter.computeContentClientRect()},e}(A),Y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.activate=function(){this.adapter.addClass(G.cssClasses.ACTIVE)},e.prototype.deactivate=function(){this.adapter.removeClass(G.cssClasses.ACTIVE)},e}(G),z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.activate=function(t){if(t){var e=this.computeContentClientRect(),n=t.width/e.width,r=t.left-e.left;this.adapter.addClass(G.cssClasses.NO_TRANSITION),this.adapter.setContentStyleProperty("transform","translateX("+r+"px) scaleX("+n+")"),this.computeContentClientRect(),this.adapter.removeClass(G.cssClasses.NO_TRANSITION),this.adapter.addClass(G.cssClasses.ACTIVE),this.adapter.setContentStyleProperty("transform","")}else this.adapter.addClass(G.cssClasses.ACTIVE)},e.prototype.deactivate=function(){this.adapter.removeClass(G.cssClasses.ACTIVE)},e}(G),$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(){this.content=this.root.querySelector(G.strings.CONTENT_SELECTOR)},e.prototype.computeContentClientRect=function(){return this.foundation.computeContentClientRect()},e.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},computeContentClientRect:function(){return t.content.getBoundingClientRect()},setContentStyleProperty:function(e,n){t.content.style.setProperty(e,n)}};return this.root.classList.contains(G.cssClasses.FADE)?new Y(e):new z(e)},e.prototype.activate=function(t){this.foundation.activate(t)},e.prototype.deactivate=function(){this.foundation.deactivate()},e}(T),X={ACTIVE:"mdc-tab--active"},q={ARIA_SELECTED:"aria-selected",CONTENT_SELECTOR:".mdc-tab__content",INTERACTED_EVENT:"MDCTab:interacted",RIPPLE_SELECTOR:".mdc-tab__ripple",TABINDEX:"tabIndex",TAB_INDICATOR_SELECTOR:".mdc-tab-indicator"},Z=function(t){function e(n){var r=t.call(this,y(y({},e.defaultAdapter),n))||this;return r.focusOnActivate=!0,r}return v(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return X},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return q},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},activateIndicator:function(){},deactivateIndicator:function(){},notifyInteracted:function(){},getOffsetLeft:function(){return 0},getOffsetWidth:function(){return 0},getContentOffsetLeft:function(){return 0},getContentOffsetWidth:function(){return 0},focus:function(){}}},enumerable:!1,configurable:!0}),e.prototype.handleClick=function(){this.adapter.notifyInteracted()},e.prototype.isActive=function(){return this.adapter.hasClass(X.ACTIVE)},e.prototype.setFocusOnActivate=function(t){this.focusOnActivate=t},e.prototype.activate=function(t){this.adapter.addClass(X.ACTIVE),this.adapter.setAttr(q.ARIA_SELECTED,"true"),this.adapter.setAttr(q.TABINDEX,"0"),this.adapter.activateIndicator(t),this.focusOnActivate&&this.adapter.focus()},e.prototype.deactivate=function(){this.isActive()&&(this.adapter.removeClass(X.ACTIVE),this.adapter.setAttr(q.ARIA_SELECTED,"false"),this.adapter.setAttr(q.TABINDEX,"-1"),this.adapter.deactivateIndicator())},e.prototype.computeDimensions=function(){var t=this.adapter.getOffsetWidth(),e=this.adapter.getOffsetLeft(),n=this.adapter.getContentOffsetWidth(),r=this.adapter.getContentOffsetLeft();return{contentLeft:e+r,contentRight:e+r+n,rootLeft:e,rootRight:e+t}},e}(A),J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t,e){return new j(t,e)}),void 0===e&&(e=function(t){return new $(t)}),this.id=this.root.id;var n=new F(j.createAdapter(this));this.ripple=t(this.root,n);var r=this.root.querySelector(Z.strings.TAB_INDICATOR_SELECTOR);this.tabIndicator=e(r),this.content=this.root.querySelector(Z.strings.CONTENT_SELECTOR)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new Z({setAttr:function(e,n){return t.root.setAttribute(e,n)},addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},activateIndicator:function(e){t.tabIndicator.activate(e)},deactivateIndicator:function(){t.tabIndicator.deactivate()},notifyInteracted:function(){return t.emit(Z.strings.INTERACTED_EVENT,{tabId:t.id},!0)},getOffsetLeft:function(){return t.root.offsetLeft},getOffsetWidth:function(){return t.root.offsetWidth},getContentOffsetLeft:function(){return t.content.offsetLeft},getContentOffsetWidth:function(){return t.content.offsetWidth},focus:function(){return t.root.focus()}})},Object.defineProperty(e.prototype,"active",{get:function(){return this.foundation.isActive()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"focusOnActivate",{set:function(t){this.foundation.setFocusOnActivate(t)},enumerable:!1,configurable:!0}),e.prototype.activate=function(t){this.foundation.activate(t)},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.computeIndicatorClientRect=function(){return this.tabIndicator.computeContentClientRect()},e.prototype.computeDimensions=function(){return this.foundation.computeDimensions()},e.prototype.focus=function(){this.root.focus()},e}(T),Q={ARROW_LEFT_KEY:"ArrowLeft",ARROW_RIGHT_KEY:"ArrowRight",END_KEY:"End",ENTER_KEY:"Enter",HOME_KEY:"Home",SPACE_KEY:"Space",TAB_ACTIVATED_EVENT:"MDCTabBar:activated",TAB_SCROLLER_SELECTOR:".mdc-tab-scroller",TAB_SELECTOR:".mdc-tab"},tt={ARROW_LEFT_KEYCODE:37,ARROW_RIGHT_KEYCODE:39,END_KEYCODE:35,ENTER_KEYCODE:13,EXTRA_SCROLL_AMOUNT:20,HOME_KEYCODE:36,SPACE_KEYCODE:32},et=new Set;et.add(Q.ARROW_LEFT_KEY),et.add(Q.ARROW_RIGHT_KEY),et.add(Q.END_KEY),et.add(Q.HOME_KEY),et.add(Q.ENTER_KEY),et.add(Q.SPACE_KEY);var nt=new Map;nt.set(tt.ARROW_LEFT_KEYCODE,Q.ARROW_LEFT_KEY),nt.set(tt.ARROW_RIGHT_KEYCODE,Q.ARROW_RIGHT_KEY),nt.set(tt.END_KEYCODE,Q.END_KEY),nt.set(tt.HOME_KEYCODE,Q.HOME_KEY),nt.set(tt.ENTER_KEYCODE,Q.ENTER_KEY),nt.set(tt.SPACE_KEYCODE,Q.SPACE_KEY);var rt=function(t){function e(n){var r=t.call(this,y(y({},e.defaultAdapter),n))||this;return r.useAutomaticActivation=!1,r}return v(e,t),Object.defineProperty(e,"strings",{get:function(){return Q},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return tt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{scrollTo:function(){},incrementScroll:function(){},getScrollPosition:function(){return 0},getScrollContentWidth:function(){return 0},getOffsetWidth:function(){return 0},isRTL:function(){return!1},setActiveTab:function(){},activateTabAtIndex:function(){},deactivateTabAtIndex:function(){},focusTabAtIndex:function(){},getTabIndicatorClientRectAtIndex:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getTabDimensionsAtIndex:function(){return{rootLeft:0,rootRight:0,contentLeft:0,contentRight:0}},getPreviousActiveTabIndex:function(){return-1},getFocusedTabIndex:function(){return-1},getIndexOfTabById:function(){return-1},getTabListLength:function(){return 0},notifyTabActivated:function(){}}},enumerable:!1,configurable:!0}),e.prototype.setUseAutomaticActivation=function(t){this.useAutomaticActivation=t},e.prototype.activateTab=function(t){var e,n=this.adapter.getPreviousActiveTabIndex();this.indexIsInRange(t)&&t!==n&&(-1!==n&&(this.adapter.deactivateTabAtIndex(n),e=this.adapter.getTabIndicatorClientRectAtIndex(n)),this.adapter.activateTabAtIndex(t,e),this.scrollIntoView(t),this.adapter.notifyTabActivated(t))},e.prototype.handleKeyDown=function(t){var e=this.getKeyFromEvent(t);if(void 0!==e)if(this.isActivationKey(e)||t.preventDefault(),this.useAutomaticActivation){if(this.isActivationKey(e))return;var n=this.determineTargetFromKey(this.adapter.getPreviousActiveTabIndex(),e);this.adapter.setActiveTab(n),this.scrollIntoView(n)}else{var r=this.adapter.getFocusedTabIndex();if(this.isActivationKey(e))this.adapter.setActiveTab(r);else{n=this.determineTargetFromKey(r,e);this.adapter.focusTabAtIndex(n),this.scrollIntoView(n)}}},e.prototype.handleTabInteraction=function(t){this.adapter.setActiveTab(this.adapter.getIndexOfTabById(t.detail.tabId))},e.prototype.scrollIntoView=function(t){this.indexIsInRange(t)&&(0!==t?t!==this.adapter.getTabListLength()-1?this.isRTL()?this.scrollIntoViewImplRTL(t):this.scrollIntoViewImpl(t):this.adapter.scrollTo(this.adapter.getScrollContentWidth()):this.adapter.scrollTo(0))},e.prototype.determineTargetFromKey=function(t,e){var n=this.isRTL(),r=this.adapter.getTabListLength()-1,o=t;return e===Q.END_KEY?o=r:e===Q.ARROW_LEFT_KEY&&!n||e===Q.ARROW_RIGHT_KEY&&n?o-=1:e===Q.ARROW_RIGHT_KEY&&!n||e===Q.ARROW_LEFT_KEY&&n?o+=1:o=0,o<0?o=r:o>r&&(o=0),o},e.prototype.calculateScrollIncrement=function(t,e,n,r){var o=this.adapter.getTabDimensionsAtIndex(e),i=o.contentLeft-n-r,a=o.contentRight-n-tt.EXTRA_SCROLL_AMOUNT,s=i+tt.EXTRA_SCROLL_AMOUNT;return e<t?Math.min(a,0):Math.max(s,0)},e.prototype.calculateScrollIncrementRTL=function(t,e,n,r,o){var i=this.adapter.getTabDimensionsAtIndex(e),a=o-i.contentLeft-n,s=o-i.contentRight-n-r+tt.EXTRA_SCROLL_AMOUNT,c=a-tt.EXTRA_SCROLL_AMOUNT;return e>t?Math.max(s,0):Math.min(c,0)},e.prototype.findAdjacentTabIndexClosestToEdge=function(t,e,n,r){var o=e.rootLeft-n,i=e.rootRight-n-r,a=o+i;return o<0||a<0?t-1:i>0||a>0?t+1:-1},e.prototype.findAdjacentTabIndexClosestToEdgeRTL=function(t,e,n,r,o){var i=o-e.rootLeft-r-n,a=o-e.rootRight-n,s=i+a;return i>0||s>0?t+1:a<0||s<0?t-1:-1},e.prototype.getKeyFromEvent=function(t){return et.has(t.key)?t.key:nt.get(t.keyCode)},e.prototype.isActivationKey=function(t){return t===Q.SPACE_KEY||t===Q.ENTER_KEY},e.prototype.indexIsInRange=function(t){return t>=0&&t<this.adapter.getTabListLength()},e.prototype.isRTL=function(){return this.adapter.isRTL()},e.prototype.scrollIntoViewImpl=function(t){var e=this.adapter.getScrollPosition(),n=this.adapter.getOffsetWidth(),r=this.adapter.getTabDimensionsAtIndex(t),o=this.findAdjacentTabIndexClosestToEdge(t,r,e,n);if(this.indexIsInRange(o)){var i=this.calculateScrollIncrement(t,o,e,n);this.adapter.incrementScroll(i)}},e.prototype.scrollIntoViewImplRTL=function(t){var e=this.adapter.getScrollPosition(),n=this.adapter.getOffsetWidth(),r=this.adapter.getTabDimensionsAtIndex(t),o=this.adapter.getScrollContentWidth(),i=this.findAdjacentTabIndexClosestToEdgeRTL(t,r,e,n,o);if(this.indexIsInRange(i)){var a=this.calculateScrollIncrementRTL(t,i,e,n,o);this.adapter.incrementScroll(a)}},e}(A),ot=rt.strings,it=0,at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"focusOnActivate",{set:function(t){var e,n;try{for(var r=g(this.tabList),o=r.next();!o.done;o=r.next()){o.value.focusOnActivate=t}}catch(i){e={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useAutomaticActivation",{set:function(t){this.foundation.setUseAutomaticActivation(t)},enumerable:!1,configurable:!0}),e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new J(t)}),void 0===e&&(e=function(t){return new x(t)}),this.tabList=this.instantiateTabs(t),this.tabScroller=this.instantiatetabScroller(e)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleTabInteraction=function(e){t.foundation.handleTabInteraction(e)},this.handleKeyDown=function(e){t.foundation.handleKeyDown(e)},this.listen(Z.strings.INTERACTED_EVENT,this.handleTabInteraction),this.listen("keydown",this.handleKeyDown);for(var e=0;e<this.tabList.length;e++)if(this.tabList[e].active){this.scrollIntoView(e);break}},e.prototype.destroy=function(){var e,n;t.prototype.destroy.call(this),this.unlisten(Z.strings.INTERACTED_EVENT,this.handleTabInteraction),this.unlisten("keydown",this.handleKeyDown);try{for(var r=g(this.tabList),o=r.next();!o.done;o=r.next()){o.value.destroy()}}catch(i){e={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}this.tabScroller&&this.tabScroller.destroy()},e.prototype.getDefaultFoundation=function(){var t=this;return new rt({scrollTo:function(e){t.tabScroller.scrollTo(e)},incrementScroll:function(e){t.tabScroller.incrementScroll(e)},getScrollPosition:function(){return t.tabScroller.getScrollPosition()},getScrollContentWidth:function(){return t.tabScroller.getScrollContentWidth()},getOffsetWidth:function(){return t.root.offsetWidth},isRTL:function(){return"rtl"===window.getComputedStyle(t.root).getPropertyValue("direction")},setActiveTab:function(e){t.foundation.activateTab(e)},activateTabAtIndex:function(e,n){t.tabList[e].activate(n)},deactivateTabAtIndex:function(e){t.tabList[e].deactivate()},focusTabAtIndex:function(e){t.tabList[e].focus()},getTabIndicatorClientRectAtIndex:function(e){return t.tabList[e].computeIndicatorClientRect()},getTabDimensionsAtIndex:function(e){return t.tabList[e].computeDimensions()},getPreviousActiveTabIndex:function(){for(var e=0;e<t.tabList.length;e++)if(t.tabList[e].active)return e;return-1},getFocusedTabIndex:function(){var e=t.getTabElements(),n=document.activeElement;return e.indexOf(n)},getIndexOfTabById:function(e){for(var n=0;n<t.tabList.length;n++)if(t.tabList[n].id===e)return n;return-1},getTabListLength:function(){return t.tabList.length},notifyTabActivated:function(e){return t.emit(ot.TAB_ACTIVATED_EVENT,{index:e},!0)}})},e.prototype.activateTab=function(t){this.foundation.activateTab(t)},e.prototype.scrollIntoView=function(t){this.foundation.scrollIntoView(t)},e.prototype.getTabElements=function(){return[].slice.call(this.root.querySelectorAll(ot.TAB_SELECTOR))},e.prototype.instantiateTabs=function(t){return this.getTabElements().map((function(e){return e.id=e.id||"mdc-tab-"+ ++it,t(e)}))},e.prototype.instantiatetabScroller=function(t){var e=this.root.querySelector(ot.TAB_SCROLLER_SELECTOR);return e?t(e):null},e}(T);const st={align:{type:String,default:"start"}},ct={EVENTS:{CHANGE:"update:modelValue"}},lt={ALIGN:["start","center","end"],EVENTS:{CHANGE:"update:scrollX"}},ut={UNDERLINE:"underline",ICON:"icon"},dt={TYPES:{text:0,iconOnly:1,textWithIcon:2},cssClasses:{active:"mdc-tab--active",icon:"mdc-tab__icon"},idPrefix:"mdc-tab-"},ft={class:"mdc-tab-scroller__scroll-area"},pt={class:"mdc-tab-scroller__scroll-content"},ht={name:"UiTabScroller",customOptions:{UI_TAB_SCROLLER:lt}};var mt=Object.assign(ht,{props:{...st,scrollX:{type:Number,default:0}},emits:[lt.EVENTS.CHANGE],setup(t,e){let{expose:n,emit:r}=e;const o=t,i=r,a=(0,h.computed)((()=>{let t=["mdc-tab-scroller"];return lt.ALIGN.includes(o.align)&&t.push(`mdc-tab-scroller--align-${o.align}`),t.join(" ")})),s=(0,h.ref)(null),c=(0,h.reactive)({$tabScroller:null,scrollValue:o.scrollX});return(0,h.onMounted)((()=>{c.$tabScroller=new x(s.value),(0,h.watch)((()=>o.scrollX),(t=>{let e=+t;c.$tabScroller.scrollTo(e),c.scrollValue=e}))})),n({increment:function(){let t=+(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0);c.$tabScroller.incrementScroll(t),c.scrollValue+=t,c.scrollValue<0&&(c.scrollValue=0),i(lt.EVENTS.CHANGE,c.scrollValue)}}),(t,e)=>((0,h.openBlock)(),(0,h.createElementBlock)("div",{ref_key:"tabScroller",ref:s,class:(0,h.normalizeClass)(a.value)},[(0,h.createElementVNode)("div",ft,[(0,h.createElementVNode)("div",pt,[(0,h.renderSlot)(t.$slots,"default")])])],2))}});var vt=mt;const yt={modelValue:{type:Number,default:-1}};const gt={name:"UiTabBar",customOptions:{UI_TAB_BAR:ct}};var bt=Object.assign(gt,{props:{...yt,...st},emits:[ct.EVENTS.CHANGE],setup(t,e){let{expose:n,emit:r}=e;const o=t,i=r,a=(0,h.useSlots)(),s=(0,h.ref)(null),c=(0,h.reactive)({$tabBar:null});function l(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.modelValue;const e=~t&&t<c.$tabBar.tabList.length?t:0;c.$tabBar.activateTab(e)}function u(){c.$tabBar=new at(s.value),c.$tabBar.listen(Q.TAB_ACTIVATED_EVENT,(t=>{let{detail:e}=t;i(ct.EVENTS.CHANGE,e.index)})),c.$tabBar.tabList.length&&l()}return(0,h.onMounted)((()=>{u(),(0,h.watch)((()=>o.modelValue),(t=>l(t)))})),n({updated:function(){(0,h.getTransitionRawChildren)(a.default()).length!==c.$tabBar.tabList.length&&(c.$tabBar&&c.$tabBar.destroy(),u())}}),(t,e)=>((0,h.openBlock)(),(0,h.createElementBlock)("div",{ref_key:"tabBar",ref:s,class:"mdc-tab-bar",role:"tablist"},[(0,h.createVNode)(vt,{align:t.align},{default:(0,h.withCtx)((()=>[(0,h.renderSlot)(t.$slots,"default")])),_:3},8,["align"])],512))}});var St=bt;const At={cssClasses:{icon:"material-icons"},EVENTS:{CLICK:"click"},getMaterialIconClass:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return[At.cssClasses.icon,...e]}};var Tt=At;const Et="UiTabIndicator",Ct={name:Et,customOptions:{name:Et,UI_GLOBAL:Tt,UI_TAB_INDICATOR:ut}};var It=Object.assign(Ct,{props:{type:{type:String,default:ut.UNDERLINE},fade:{type:Boolean,default:!1}},setup(t){const e=t,n=(0,h.getCurrentInstance)().parent,r=(0,h.ref)(null),o=(0,h.computed)((()=>n&&n.props.modelValue)),i=(0,h.computed)((()=>({"mdc-tab-indicator":!0,"mdc-tab-indicator--active":o.value,"mdc-tab-indicator--fade":e.fade}))),a=(0,h.computed)((()=>{let t=["mdc-tab-indicator__content",`mdc-tab-indicator__content--${e.type}`];return e.type===ut.ICON&&t.push(Tt.cssClasses.icon),t.join(" ")}));return(0,h.onBeforeMount)((()=>{Object.values(ut).includes(e.type)||console.warn(`[${Et}]: Invalid tab indicator type`)})),(e,n)=>((0,h.openBlock)(),(0,h.createElementBlock)("sp