/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { attachShadowTemplate, coerceBoolean, CustomElement, FoundationProperty } from '@tylertech/forge-core';
import { tylIconCancel } from '@tylertech/tyler-icons/standard';
import { BaseComponent } from '../../core/base/base-component';
import { IconComponent, IconRegistry } from '../../icon';
import { ChipAdapter } from './chip-adapter';
import { CHIP_CONSTANTS } from './chip-constants';
import { ChipFoundation } from './chip-foundation';
const template = '<template><div class=\"forge-chip\" part=\"root button\"><slot name=\"leading\" class=\"forge-chip__leading\"></slot><div role=\"button\" tabindex=\"0\" class=\"forge-chip__content\" part=\"content\"><slot></slot></div><slot name=\"trailing\"></slot></div></template>';
const styles = '@-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{--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:transparent;will-change:transform,opacity;position:relative;outline:0;overflow:hidden}.mdc-ripple-surface::after,.mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface.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-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-ripple-surface.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-ripple-surface.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-ripple-surface::after,.mdc-ripple-surface::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-upgraded--unbounded::after,.mdc-ripple-upgraded--unbounded::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before{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-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,#000)}.mdc-ripple-surface.mdc-ripple-surface--hover::before,.mdc-ripple-surface:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{--mdc-ripple-color:var(--mdc-theme-on-surface)}.forge-chip{--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:transparent;will-change:transform,opacity;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-button-font-size, .875rem);line-height:2.25rem;line-height:var(--mdc-typography-button-line-height, 2.25rem);font-weight:500;font-weight:var(--mdc-typography-button-font-weight,500);letter-spacing:.0892857143em;letter-spacing:var(--mdc-typography-button-letter-spacing, .0892857143em);text-decoration:none;-webkit-text-decoration:var(--mdc-typography-button-text-decoration,none);text-decoration:var(--mdc-typography-button-text-decoration,none);text-transform:uppercase;text-transform:var(--mdc-typography-button-text-transform,uppercase);position:relative;display:-webkit-inline-box;display:inline-flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;min-width:64px;border:none;outline:0;line-height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:0 0;border-radius:4px;border-radius:var(--mdc-shape-small,4px);height:36px;text-transform:none;box-sizing:border-box;overflow:hidden;border-style:solid;-webkit-transition:border 280ms cubic-bezier(.4, 0, .2, 1);transition:border 280ms cubic-bezier(.4, 0, .2, 1);font-family:Roboto,sans-serif;font-family:var(--mdc-outlined-button-label-text-font, var(--mdc-typography-button-font-family, var(--mdc-typography-font-family, Roboto, sans-serif)));font-size:.875rem;font-size:var(--mdc-outlined-button-label-text-size, var(--mdc-typography-button-font-size, .875rem));letter-spacing:.0892857143em;letter-spacing:var(--mdc-outlined-button-label-text-tracking, var(--mdc-typography-button-letter-spacing, .0892857143em));font-weight:500;font-weight:var(--mdc-outlined-button-label-text-weight,var(--mdc-typography-button-font-weight,500));text-transform:uppercase;text-transform:var(--mdc-outlined-button-label-text-transform,var(--mdc-typography-button-text-transform,uppercase));height:36px;height:var(--mdc-outlined-button-container-height,36px);border-radius:4px;border-radius:var(--mdc-outlined-button-container-shape,var(--mdc-shape-small,4px));padding:0 15px 0 15px;border-width:1px;border-width:var(--mdc-outlined-button-outline-width,1px);padding:0 15px 0 15px;border-width:1px;border-radius:16px;width:auto;width:var(--forge-chip-width,auto);height:auto;height:var(--forge-chip-height,auto);min-height:36px;min-height:var(--forge-chip-min-height,36px);box-sizing:border-box;-webkit-transition:background-color 150ms 0s cubic-bezier(0, 0, .2, 1);transition:background-color 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-chip::after,.forge-chip::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.forge-chip::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-chip::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-chip.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-chip.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-chip.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-chip.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}.forge-chip.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))}.forge-chip::after,.forge-chip::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.forge-chip.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-chip::after,.forge-chip::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-chip.mdc-ripple-surface--hover::before,.forge-chip:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-chip.mdc-ripple-upgraded--background-focused::before,.forge-chip:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-chip:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-chip:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-chip.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-chip .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.forge-chip::-moz-focus-inner{padding:0;border:0}.forge-chip:active{outline:0}.forge-chip:hover{cursor:pointer}.forge-chip:disabled{cursor:default;pointer-events:none}.forge-chip .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-shape-small,4px)}.forge-chip:not(:disabled){background-color:transparent}.forge-chip:not(:disabled){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-chip .mdc-button__ripple{border-style:solid;border-color:transparent}.forge-chip:not(:disabled){color:#3f51b5;color:var(--mdc-outlined-button-label-text-color,var(--mdc-theme-primary,#3f51b5))}.forge-chip:disabled{color:rgba(0,0,0,.38);color:var(--mdc-outlined-button-disabled-label-text-color,rgba(0,0,0,.38))}.forge-chip .mdc-button__icon{font-size:1.125rem;font-size:var(--mdc-outlined-button-with-icon-icon-size, 1.125rem);width:1.125rem;width:var(--mdc-outlined-button-with-icon-icon-size,1.125rem);height:1.125rem;height:var(--mdc-outlined-button-with-icon-icon-size,1.125rem)}.forge-chip .mdc-button__ripple::after,.forge-chip .mdc-button__ripple::before{background-color:#3f51b5;background-color:var(--mdc-outlined-button-hover-state-layer-color,var(--mdc-theme-primary,#3f51b5))}.forge-chip.mdc-ripple-surface--hover .mdc-button__ripple::before,.forge-chip:hover .mdc-button__ripple::before{opacity:.04;opacity:var(--mdc-outlined-button-hover-state-layer-opacity, .04)}.forge-chip.mdc-ripple-upgraded--background-focused .mdc-button__ripple::before,.forge-chip:not(.mdc-ripple-upgraded):focus .mdc-button__ripple::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-outlined-button-focus-state-layer-opacity, .12)}.forge-chip:not(.mdc-ripple-upgraded) .mdc-button__ripple::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-chip:not(.mdc-ripple-upgraded):active .mdc-button__ripple::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-outlined-button-pressed-state-layer-opacity, .12)}.forge-chip.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-outlined-button-pressed-state-layer-opacity, 0.12)}.forge-chip .mdc-button__ripple{border-radius:4px;border-radius:var(--mdc-outlined-button-container-shape,var(--mdc-shape-small,4px))}.forge-chip:not(:disabled){border-color:rgba(0,0,0,.12);border-color:var(--mdc-outlined-button-outline-color,rgba(0,0,0,.12))}.forge-chip:disabled{border-color:rgba(0,0,0,.12);border-color:var(--mdc-outlined-button-disabled-outline-color,rgba(0,0,0,.12))}.forge-chip.mdc-button--icon-trailing{padding:0 11px 0 15px}.forge-chip.mdc-button--icon-leading{padding:0 15px 0 11px}.forge-chip .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:1px;border-width:var(--mdc-outlined-button-outline-width,1px)}.forge-chip .mdc-button__touch{left:calc(-1 * 1px);left:calc(-1 * var(--mdc-outlined-button-outline-width,1px));width:calc(100% + 2 * 1px);width:calc(100% + 2 * var(--mdc-outlined-button-outline-width,1px))}.forge-chip.mdc-button--icon-trailing{padding:0 11px 0 15px}.forge-chip.mdc-button--icon-leading{padding:0 15px 0 11px}.forge-chip .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px;border-width:1px}.forge-chip .mdc-button__touch{left:calc(-1 * 1px);width:calc(100% + 2 * 1px)}.forge-chip:not(:disabled){border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-chip .mdc-evolution-chip__ripple{border-radius:16px}.forge-chip .mdc-evolution-chip__action--primary:before{border-radius:16px}.forge-chip .mdc-evolution-chip__icon--primary{border-radius:16px}.forge-chip.forge-chip--disabled{border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));border-color:#e0e0e0;border-color:var(--forge-theme-border-color,#e0e0e0);color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:default;pointer-events:none}.forge-chip.forge-chip--disabled .forge-chip__delete-button{opacity:.54}.forge-chip__leading--hidden{display:none}.forge-chip__content{-webkit-box-flex:1;flex-grow:1;text-align:center}.forge-chip__content:focus{outline:0}.forge-chip ::slotted([slot=leading]){margin-left:-6px;margin-right:4px}.forge-chip ::slotted(forge-avatar[slot]){--forge-avatar-size:24px}.forge-chip ::slotted([slot=trailing]){margin-left:4px;margin-right:-8px}.forge-chip__checkmark{height:24px}.forge-chip__checkmark-svg{width:0;height:24px;-webkit-transition:width 150ms cubic-bezier(.4, 0, .2, 1);transition:width 150ms cubic-bezier(.4, 0, .2, 1)}.forge-chip__checkmark-path{stroke:#ffffff;stroke:var(--mdc-theme-on-primary,#ffffff);-webkit-transition:stroke-dashoffset 150ms 0 cubic-bezier(.4, 0, .6, 1);transition:stroke-dashoffset 150ms 0 cubic-bezier(.4, 0, .6, 1);stroke-width:2px;stroke-dashoffset:29.7833385;stroke-dasharray:29.7833385}.forge-chip__delete-button{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:4px;margin-right:-8px;-webkit-transition:color 150ms linear;transition:color 150ms linear;outline:0;line-height:inherit;position:relative;border-radius:50%}.forge-chip__delete-button:focus{outline:currentColor solid 2px}.forge-chip__delete-button:focus,.forge-chip__delete-button:hover{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-chip__delete-button:active{opacity:.75}.forge-chip__delete-button__touch-target{position:absolute;top:-6px;left:-6px;width:calc(100% + 12px);height:calc(100% + 12px)}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled),.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled),.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled){background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);color:rgba(255,255,255,.87);color:var(--mdc-theme-text-primary-on-dark,rgba(255,255,255,.87))}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled)::after,.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled)::before,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled)::after,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled)::before,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled)::after,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled)::before{background-color:#fff;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-primary,#fff))}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-surface--hover::before,.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled):hover::before,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-surface--hover::before,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled):hover::before,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-surface--hover::before,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled):hover::before{opacity:.08;opacity:var(--mdc-ripple-hover-opacity, .08)}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-upgraded--background-focused::before,.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):focus::before,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-upgraded--background-focused::before,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):focus::before,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-upgraded--background-focused::before,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-focus-opacity, .24)}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded)::after,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded)::after,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):active::after,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):active::after,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-press-opacity, .24)}.forge-chip--choice.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-upgraded,.forge-chip--filter.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-upgraded,.forge-chip--input.forge-chip--selected:not(.forge-chip--disabled).mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.forge-chip--choice.forge-chip--selected.forge-chip--disabled,.forge-chip--filter.forge-chip--selected.forge-chip--disabled,.forge-chip--input.forge-chip--selected.forge-chip--disabled{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);color:rgba(255,255,255,.87);color:var(--mdc-theme-text-primary-on-dark,rgba(255,255,255,.87));opacity:.37}.forge-chip--choice.forge-chip--selected.forge-chip--disabled::after,.forge-chip--choice.forge-chip--selected.forge-chip--disabled::before,.forge-chip--filter.forge-chip--selected.forge-chip--disabled::after,.forge-chip--filter.forge-chip--selected.forge-chip--disabled::before,.forge-chip--input.forge-chip--selected.forge-chip--disabled::after,.forge-chip--input.forge-chip--selected.forge-chip--disabled::before{background-color:#fff;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-primary,#fff))}.forge-chip--choice.forge-chip--selected.forge-chip--disabled.mdc-ripple-surface--hover::before,.forge-chip--choice.forge-chip--selected.forge-chip--disabled:hover::before,.forge-chip--filter.forge-chip--selected.forge-chip--disabled.mdc-ripple-surface--hover::before,.forge-chip--filter.forge-chip--selected.forge-chip--disabled:hover::before,.forge-chip--input.forge-chip--selected.forge-chip--disabled.mdc-ripple-surface--hover::before,.forge-chip--input.forge-chip--selected.forge-chip--disabled:hover::before{opacity:.08;opacity:var(--mdc-ripple-hover-opacity, .08)}.forge-chip--choice.forge-chip--selected.forge-chip--disabled.mdc-ripple-upgraded--background-focused::before,.forge-chip--choice.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded):focus::before,.forge-chip--filter.forge-chip--selected.forge-chip--disabled.mdc-ripple-upgraded--background-focused::before,.forge-chip--filter.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded):focus::before,.forge-chip--input.forge-chip--selected.forge-chip--disabled.mdc-ripple-upgraded--background-focused::before,.forge-chip--input.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-focus-opacity, .24)}.forge-chip--choice.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded)::after,.forge-chip--filter.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded)::after,.forge-chip--input.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-chip--choice.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded):active::after,.forge-chip--filter.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded):active::after,.forge-chip--input.forge-chip--selected.forge-chip--disabled:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-press-opacity, .24)}.forge-chip--choice.forge-chip--selected.forge-chip--disabled.mdc-ripple-upgraded,.forge-chip--filter.forge-chip--selected.forge-chip--disabled.mdc-ripple-upgraded,.forge-chip--input.forge-chip--selected.forge-chip--disabled.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.forge-chip--choice.forge-chip--selected ::slotted([slot=leading]),.forge-chip--filter.forge-chip--selected ::slotted([slot=leading]),.forge-chip--input.forge-chip--selected ::slotted([slot=leading]){color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-chip--choice.forge-chip--selected ::slotted([slot=trailing]),.forge-chip--filter.forge-chip--selected ::slotted([slot=trailing]),.forge-chip--input.forge-chip--selected ::slotted([slot=trailing]){color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-chip--choice.forge-chip--selected .forge-chip__delete-button,.forge-chip--filter.forge-chip--selected .forge-chip__delete-button,.forge-chip--input.forge-chip--selected .forge-chip__delete-button{color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-chip--choice.forge-chip--selected.forge-chip--filter .forge-chip__checkmark,.forge-chip--filter.forge-chip--selected.forge-chip--filter .forge-chip__checkmark,.forge-chip--input.forge-chip--selected.forge-chip--filter .forge-chip__checkmark{margin-left:-6px;margin-right:4px}.forge-chip--choice.forge-chip--selected.forge-chip--filter .forge-chip__checkmark-svg,.forge-chip--filter.forge-chip--selected.forge-chip--filter .forge-chip__checkmark-svg,.forge-chip--input.forge-chip--selected.forge-chip--filter .forge-chip__checkmark-svg{width:24px}.forge-chip--choice.forge-chip--selected.forge-chip--filter .forge-chip__checkmark-path,.forge-chip--filter.forge-chip--selected.forge-chip--filter .forge-chip__checkmark-path,.forge-chip--input.forge-chip--selected.forge-chip--filter .forge-chip__checkmark-path{-webkit-transition:stroke-dashoffset 150ms 50ms cubic-bezier(.4, 0, .6, 1);transition:stroke-dashoffset 150ms 50ms cubic-bezier(.4, 0, .6, 1);stroke-dashoffset:0}.forge-chip--field .forge-chip__delete-button{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-chip--field .forge-chip__delete-button:focus,.forge-chip--field .forge-chip__delete-button:hover{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-chip--field.forge-chip--invalid:not(.forge-chip--disabled) .forge-chip__delete-button{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-chip--field.forge-chip--invalid:not(.forge-chip--disabled) .forge-chip__delete-button:focus,.forge-chip--field.forge-chip--invalid:not(.forge-chip--disabled) .forge-chip__delete-button:hover{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-chip--field.forge-chip--disabled .forge-chip__delete-button{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-chip--dense{min-height:28px;min-height:var(--forge-chip-min-height,28px)}.forge-chip--dense.forge-chip--field{min-height:20px;min-height:var(--forge-chip-min-height,20px);padding:0;margin:0;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.forge-chip--dense.forge-chip--field ::slotted([slot=leading]){margin:0 0 0 2px;font-size:18px!important}.forge-chip--dense.forge-chip--field .forge-chip__content{font-size:12px;padding:0 8px}.forge-chip--dense.forge-chip--field ::slotted([slot=trailing]){font-size:18px!important}.forge-chip--dense.forge-chip--field .forge-chip__delete-button{margin:0 2px 0 0;font-size:18px}.forge-chip--invalid:not(.forge-chip--disabled){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-chip--invalid:not(.forge-chip--disabled)::after,.forge-chip--invalid:not(.forge-chip--disabled)::before{background-color:#b00020;background-color:var(--mdc-ripple-color,var(--mdc-theme-error,#b00020))}.forge-chip--invalid:not(.forge-chip--disabled).mdc-ripple-surface--hover::before,.forge-chip--invalid:not(.forge-chip--disabled):hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-chip--invalid:not(.forge-chip--disabled).mdc-ripple-upgraded--background-focused::before,.forge-chip--invalid:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-chip--invalid:not(.forge-chip--disabled):not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-chip--invalid:not(.forge-chip--disabled):not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-chip--invalid:not(.forge-chip--disabled).mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-chip--invalid:not(.forge-chip--disabled):not(:disabled){border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-chip--invalid:not(.forge-chip--disabled) .forge-chip__delete-button{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-chip--invalid:not(.forge-chip--disabled).forge-chip--selected{background-color:#b00020;background-color:var(--mdc-theme-error,#b00020)}.forge-chip--invalid:not(.forge-chip--disabled).forge-chip--selected .forge-chip__delete-button{color:#fff;color:var(--mdc-theme-on-primary,#fff)}:host{display:inline-block}:host([hidden]){display:none}:host([theme=error]){--mdc-theme-primary:var(--mdc-theme-error)}';
/**
 * The custom element class behind the `<forge-chip>` component.
 *
 * @tag forge-chip
 */
let ChipComponent = class ChipComponent extends BaseComponent {
    constructor() {
        super();
        IconRegistry.define(tylIconCancel);
        attachShadowTemplate(this, template, styles);
        this._foundation = new ChipFoundation(new ChipAdapter(this));
    }
    static get observedAttributes() {
        return [
            CHIP_CONSTANTS.attributes.TYPE,
            CHIP_CONSTANTS.attributes.SELECTED,
            CHIP_CONSTANTS.attributes.DISABLED,
            CHIP_CONSTANTS.attributes.VALUE,
            CHIP_CONSTANTS.attributes.DENSE,
            CHIP_CONSTANTS.attributes.INVALID,
            CHIP_CONSTANTS.attributes.EMULATE_FOCUS
        ];
    }
    connectedCallback() {
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.disconnect();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case CHIP_CONSTANTS.attributes.TYPE:
                this.type = newValue;
                break;
            case CHIP_CONSTANTS.attributes.SELECTED:
                this.selected = coerceBoolean(newValue);
                break;
            case CHIP_CONSTANTS.attributes.DISABLED:
                this.disabled = coerceBoolean(newValue);
                break;
            case CHIP_CONSTANTS.attributes.INVALID:
                this.invalid = coerceBoolean(newValue);
                break;
            case CHIP_CONSTANTS.attributes.VALUE:
                this.value = newValue;
                break;
            case CHIP_CONSTANTS.attributes.DENSE:
                this.dense = coerceBoolean(newValue);
                break;
            case CHIP_CONSTANTS.attributes.EMULATE_FOCUS:
                this.emulateFocus = coerceBoolean(newValue);
        }
    }
    focus() {
        this._foundation.setFocus();
    }
    tryFocusDelete() {
        this._foundation.tryFocusDelete();
    }
};
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "type", void 0);
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "selected", void 0);
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "disabled", void 0);
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "invalid", void 0);
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "value", void 0);
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "dense", void 0);
__decorate([
    FoundationProperty()
], ChipComponent.prototype, "emulateFocus", void 0);
ChipComponent = __decorate([
    CustomElement({
        name: CHIP_CONSTANTS.elementName,
        dependencies: [IconComponent]
    })
], ChipComponent);
export { ChipComponent };
