import{r as t,h as i,g as s}from"./p-5a5e7c99.js";import{_ as n,a as o,M as c,b as e}from"./p-2b926682.js";import"./p-c0a20e71.js";import{M as r}from"./p-216a6f85.js";
/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */var h={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},u={ARIA_PRESSED:"aria-pressed",CHANGE_EVENT:"MDCIconButtonToggle:change"},a=function(t){function i(s){return t.call(this,o({},i.defaultAdapter,s))||this}return n(i,t),Object.defineProperty(i,"cssClasses",{get:function(){return h},enumerable:!0,configurable:!0}),Object.defineProperty(i,"strings",{get:function(){return u},enumerable:!0,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},setAttr:function(){}}},enumerable:!0,configurable:!0}),i.prototype.init=function(){this.adapter_.setAttr(u.ARIA_PRESSED,""+this.isOn())},i.prototype.handleClick=function(){this.toggle(),this.adapter_.notifyChange({isOn:this.isOn()})},i.prototype.isOn=function(){return this.adapter_.hasClass(h.ICON_BUTTON_ON)},i.prototype.toggle=function(t){void 0===t&&(t=!this.isOn()),t?this.adapter_.addClass(h.ICON_BUTTON_ON):this.adapter_.removeClass(h.ICON_BUTTON_ON),this.adapter_.setAttr(u.ARIA_PRESSED,""+t)},i}(c),l=a.strings,f=function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.ripple_=i.createRipple_(),i}return n(i,t),i.attachTo=function(t){return new i(t)},i.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick_=function(){return t.foundation_.handleClick()},this.listen("click",this.handleClick_)},i.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.ripple_.destroy(),t.prototype.destroy.call(this)},i.prototype.getDefaultFoundation=function(){var t=this;return new a({addClass:function(i){return t.root_.classList.add(i)},hasClass:function(i){return t.root_.classList.contains(i)},notifyChange:function(i){return t.emit(l.CHANGE_EVENT,i)},removeClass:function(i){return t.root_.classList.remove(i)},setAttr:function(i,s){return t.root_.setAttribute(i,s)}})},Object.defineProperty(i.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"on",{get:function(){return this.foundation_.isOn()},set:function(t){this.foundation_.toggle(t)},enumerable:!0,configurable:!0}),i.prototype.createRipple_=function(){var t=new r(this.root_);return t.unbounded=!0,t},i}(e);const m=class{constructor(s){t(this,s),this.disabled=!1,this.dense=!1,this.iconToggle=()=>[i("i",{class:"material-icons mdc-icon-button__icon mdc-icon-button__icon--on"},this.iconOn||this.icon),i("i",{class:"material-icons mdc-icon-button__icon"},this.iconOff)],this.svgToggle=()=>[i("slot",{name:"svg-off"}),i("slot",{name:"svg"})],this.imgToggle=()=>[i("img",{src:this.imgOff,class:"mdc-icon-button__icon"}),i("img",{src:this.img,class:"mdc-icon-button__icon mdc-icon-button__icon--on"})]}componentDidLoad(){this.large&&(this.iconButtonEl.style.setProperty("--mdc-ripple-fg-size","43.2px !important"),this.iconButtonEl.style.setProperty("--mdc-ripple-fg-scale","1.66667"),this.iconButtonEl.style.setProperty("--mdc-ripple-fg-scale","14px"),this.iconButtonEl.style.setProperty("--mdc-ripple-top","14px")),(this.icon||this.iconOn)&&this.iconOff||this.img&&this.imgOff||this.svg&&this.svgOff?f.attachTo(this.iconButtonToggleEl):(this.icon||this.img||this.svg)&&(r.attachTo(this.iconButtonEl).unbounded=!0),this.initSvg()}allowClickEvent(t){this.disabled&&t.preventDefault()}initSvg(){if(this.svg||this.svg&&this.svgOff){const t=document.querySelector('svg[slot="svg"]'),i=document.querySelector('svg[slot="svg-off"]');t.classList.add("mdc-icon-button__icon","mdc-icon-button__icon--on"),t.setAttribute("width","24"),t.setAttribute("height","24"),i&&(i.classList.add("mdc-icon-button__icon"),i.setAttribute("width","24"),i.setAttribute("height","24"))}}renderIconButtonToggle(){return i("button",{class:this.setClassIconButtonToggle(),"aria-label":this.label,"aria-hidden":this.pressed,"aria-pressed":this.pressed,disabled:this.disabled,ref:t=>this.iconButtonToggleEl=t},(this.iconOn||this.icon)&&this.iconOff&&this.iconToggle(),this.svg&&document.querySelector('svg[slot="svg-off"]')&&this.svgToggle(),this.img&&this.imgOff&&this.imgToggle())}renderIconButton(){return i("button",{class:{"mdc-icon-button":!0,"materials-dense":this.dense},ref:t=>this.iconButtonEl=t,disabled:this.disabled},this.icon&&i("i",{class:this.getIconClasses()},this.icon),this.img&&i("img",{src:this.img,class:"mdc-icon-button__icon "}),this.svg&&i("slot",{name:"svg"}))}getIconClasses(){return{"mdc-icon-button__icon":!0,"material-icons":!0}}setClassIconButtonToggle(){return{"mdc-icon-button":!0,"mdc-icon-button--on":!this.icon}}render(){return this.iconOn||this.icon&&this.iconOff||this.img&&this.imgOff||this.svg&&this.svgOff?this.renderIconButtonToggle():this.renderIconButton()}get host(){return s(this)}static get style(){return".mdc-icon-button{width:48px;height:48px;padding:12px;font-size:24px;display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px;}.mdc-icon-button:disabled{color:rgba(0,0,0,0.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,0.38));cursor:default;pointer-events:none;}.mdc-icon-button__icon{display:inline-block;}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none;}.mdc-icon-button--on .mdc-icon-button__icon{display:none;}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block;}\@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));}}\@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));}}\@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0;}to{opacity:var(--mdc-ripple-fg-opacity,0);}}\@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0;}to{opacity:var(--mdc-ripple-fg-opacity,0);}}\@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity,0);}to{opacity:0;}}\@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity,0);}to{opacity:0;}}.mdc-ripple-surface--test-edge-var-bug{--mdc-ripple-surface-test-edge-var:1px solid #000;visibility:hidden;}.mdc-ripple-surface--test-edge-var-bug::before{border:var(--mdc-ripple-surface-test-edge-var);}.mdc-icon-button{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:rgba(0,0,0,0);}.mdc-icon-button::before,.mdc-icon-button::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\";}.mdc-icon-button::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;}.mdc-icon-button.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1));}.mdc-icon-button.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center;}.mdc-icon-button.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0);}.mdc-icon-button.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;}.mdc-icon-button.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));}.mdc-icon-button::before,.mdc-icon-button::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%;}.mdc-icon-button.mdc-ripple-upgraded::before,.mdc-icon-button.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%);}.mdc-icon-button.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%);}.mdc-icon-button::before,.mdc-icon-button::after{background-color:#000;}.mdc-icon-button:hover::before{opacity:0.04;}.mdc-icon-button:not(.mdc-ripple-upgraded):focus::before,.mdc-icon-button.mdc-ripple-upgraded--background-focused::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:0.12;}.mdc-icon-button:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear;}.mdc-icon-button:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:0.12;}.mdc-icon-button.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:0.12;}\@font-face{font-family:\"Material Icons\";font-style:normal;font-weight:400;src:url(MaterialIcons-Regular.eot);src:local(\"Material Icons\"),local(\"MaterialIcons-Regular\"),url(MaterialIcons-Regular.woff2) format(\"woff2\"),url(MaterialIcons-Regular.woff) format(\"woff\"),url(MaterialIcons-Regular.ttf) format(\"truetype\");}.material-icons{font-family:\"Material Icons\";font-weight:normal;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;-webkit-font-feature-settings:\"liga\";font-feature-settings:\"liga\";}.mdc-icon-button.materials-dense{width:36px;height:36px;padding:6px;font-size:24px;}.mdc-icon-button.materials-dense svg,.mdc-icon-button.materials-dense img{width:24px;height:24px;}"}};export{m as materials_icon_button};