HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/@material/chips/dist/mdc.chips.js.map
{"version":3,"sources":["webpack://mdc.[name]/webpack/universalModuleDefinition","webpack://mdc.[name]/webpack/bootstrap","webpack://mdc.[name]/./node_modules/process/browser.js","webpack://mdc.[name]/./node_modules/safevalues/builders/attribute_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/html_sanitizer.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/inert_fragment.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/no_clobber.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.js","webpack://mdc.[name]/./node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.js","webpack://mdc.[name]/./node_modules/safevalues/builders/resource_url_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/script_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/sensitive_attributes.js","webpack://mdc.[name]/./node_modules/safevalues/builders/style_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/style_sheet_builders.js","webpack://mdc.[name]/./node_modules/safevalues/builders/url_sanitizer.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/anchor.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/area.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/button.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/element.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/embed.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/form.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/iframe.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/input.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/link.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/object.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/script.js","webpack://mdc.[name]/./node_modules/safevalues/dom/elements/style.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/document.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/dom_parser.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/global.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/location.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/range.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/service_worker_container.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/window.js","webpack://mdc.[name]/./node_modules/safevalues/dom/globals/worker.js","webpack://mdc.[name]/./node_modules/safevalues/dom/index.js","webpack://mdc.[name]/./node_modules/safevalues/environment/dev.js","webpack://mdc.[name]/./node_modules/safevalues/index.js","webpack://mdc.[name]/./node_modules/safevalues/internals/attribute_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/html_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/resource_url_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/script_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/secrets.js","webpack://mdc.[name]/./node_modules/safevalues/internals/string_literal.js","webpack://mdc.[name]/./node_modules/safevalues/internals/style_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/style_sheet_impl.js","webpack://mdc.[name]/./node_modules/safevalues/internals/trusted_types.js","webpack://mdc.[name]/./packages/mdc-animation/animationframe.ts","webpack://mdc.[name]/./packages/mdc-base/component.ts","webpack://mdc.[name]/./packages/mdc-base/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/action/adapter.ts","webpack://mdc.[name]/./packages/mdc-chips/action/component-ripple.ts","webpack://mdc.[name]/./packages/mdc-chips/action/component.ts","webpack://mdc.[name]/./packages/mdc-chips/action/constants.ts","webpack://mdc.[name]/./packages/mdc-chips/action/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/action/index.ts","webpack://mdc.[name]/./packages/mdc-chips/action/primary-foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/action/trailing-foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/action/types.ts","webpack://mdc.[name]/./packages/mdc-chips/chip-set/adapter.ts","webpack://mdc.[name]/./packages/mdc-chips/chip-set/component.ts","webpack://mdc.[name]/./packages/mdc-chips/chip-set/constants.ts","webpack://mdc.[name]/./packages/mdc-chips/chip-set/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/chip-set/index.ts","webpack://mdc.[name]/./packages/mdc-chips/chip-set/types.ts","webpack://mdc.[name]/./packages/mdc-chips/chip/adapter.ts","webpack://mdc.[name]/./packages/mdc-chips/chip/component.ts","webpack://mdc.[name]/./packages/mdc-chips/chip/constants.ts","webpack://mdc.[name]/./packages/mdc-chips/chip/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/chip/index.ts","webpack://mdc.[name]/./packages/mdc-chips/chip/types.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip-set/adapter.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip-set/component.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip-set/constants.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip-set/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip-set/index.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip/adapter.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip/component.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip/constants.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip/index.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/chip/types.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/index.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/trailingaction/adapter.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/trailingaction/component.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/trailingaction/constants.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/trailingaction/foundation.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/trailingaction/index.ts","webpack://mdc.[name]/./packages/mdc-chips/deprecated/trailingaction/types.ts","webpack://mdc.[name]/./packages/mdc-chips/index.ts","webpack://mdc.[name]/./packages/mdc-dom/announce.ts","webpack://mdc.[name]/./packages/mdc-dom/events.ts","webpack://mdc.[name]/./packages/mdc-dom/keyboard.ts","webpack://mdc.[name]/./packages/mdc-dom/ponyfill.ts","webpack://mdc.[name]/./packages/mdc-ripple/component.ts","webpack://mdc.[name]/./packages/mdc-ripple/constants.ts","webpack://mdc.[name]/./packages/mdc-ripple/foundation.ts","webpack://mdc.[name]/./packages/mdc-ripple/util.ts"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;AClFA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;ACvLzB;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,6BAA6B,mBAAO,CAAC,0FAAwB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,wCAAwC;AACxC;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,gFAAwB;AAClD,0BAA0B,mBAAO,CAAC,gGAAgC;AAClE,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,cAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,4BAA4B;AAC5B,4BAA4B;AAC5B,8BAA8B;AAC9B,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxFa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,2EAAuB;AAC/B,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA,gBAAgB,mBAAO,CAAC,+EAAyB;AACjD,sBAAsB,mBAAO,CAAC,6EAAkB;AAChD,uBAAuB,mBAAO,CAAC,6FAAkB;AACjD,mBAAmB,mBAAO,CAAC,qFAAc;AACzC,gCAAgC,mBAAO,CAAC,+IAA2C;AACnF,wBAAwB,mBAAO,CAAC,+HAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAqC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,4BAA4B,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mHAAmH,2BAA2B;AAC9I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA,aAAa,EAEJ;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,8BAA8B,sGAAsG,EAAE;AACtI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,8CAA8C;AACvE;AACA;;;;;;;;;;;;;ACvQa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,gBAAgB,mBAAO,CAAC,+EAAyB;AACjD,uBAAuB,mBAAO,CAAC,6FAAkB;AACjD,gCAAgC,mBAAO,CAAC,+IAA2C;AACnF,wBAAwB,mBAAO,CAAC,+HAAmC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uGAAuG,wBAAwB;AAC/H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA,4DAA4D,UAAU;AACtE;AACA;AACA;AACA;AACA,qDAAqD,UAAU;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,QAAQ,gBAAgB;AACvD;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+FAA+F,sBAAsB;AACrH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,QAAQ,gBAAgB;AAC/C;AACA;AACA;AACA;AACA,qBAAqB,0BAA0B;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,gFAAgF;AAC9H;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,6DAA6D;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,6DAA6D;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;ACpNa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,gBAAgB,mBAAO,CAAC,qFAA4B;AACpD,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC/Ba;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,wBAAwB,mBAAO,CAAC,+GAAmB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,8EAA8E;AACpG;AACA;AACA;AACA;AACA,sBAAsB,8EAA8E;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA,qBAAqB,8EAA8E;AACnG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,8EAA8E;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,8EAA8E;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjPa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,gCAAgC;AAChC;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8FAA8F;;;;;;;;;;;;;ACnDlF;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,0BAA0B,mBAAO,CAAC,gGAAgC;AAClE,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,IAAI;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAmB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,0BAA0B;AACpE;AACA;AACA;;;;;;;;;;;;;ACzNa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,oBAAoB,mBAAO,CAAC,oFAA0B;AACtD,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,UAAU,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA,IAAI,SAAS,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,QAAQ,IAAqC;AAC7C,yCAAyC,iBAAiB,EAAE;AAC5D;AACA;AACA;AACA;AACA;AACA,kDAAkD;AAClD;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA,iDAAiD,qCAAqC,EAAE;AACxF;AACA;AACA;AACA;;;;;;;;;;;;;AC1Fa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,mBAAmB,mBAAO,CAAC,kFAAyB;AACpD;AACA;AACA;AACA;AACA;AACA,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,MAAM;AACrD;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,yCAAyC;AACzC;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA,eAAe;AACf,8DAA8D;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxDa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,uBAAuB,mBAAO,CAAC,0FAA6B;AAC5D,yBAAyB,mBAAO,CAAC,8FAA+B;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA,2DAA2D;AAC3D;AACA;AACA,QAAQ,IAAqC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC7Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvEa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;AACA;AACA;AACA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;AACA;AACA,4EAA4E,OAAO;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,mBAAO,CAAC,6FAAgC;AAC/D,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD,mBAAmB,mBAAO,CAAC,qFAA4B;AACvD;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,wBAAwB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iCAAiC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,uDAAuD,EAAE;AAC3G;AACA,qCAAqC,mCAAmC,EAAE;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpIa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACda;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACrBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE,oBAAoB,mBAAO,CAAC,uFAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ca;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,yBAAyB,mBAAO,CAAC,iGAAkC;AACnE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA,uBAAuB,qBAAqB,eAAe,eAAe;AAC1E,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2BAA2B;AAC5C;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACpCa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,oBAAoB,mBAAO,CAAC,uFAA6B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA,wBAAwB,oBAAoB,eAAe,eAAe;AAC1E,UAAU,UAAU;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,uBAAuB,eAAe;AAC/D,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,sBAAsB,eAAe;AAC7D,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxCa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,kBAAkB,mBAAO,CAAC,mFAA2B;AACrD;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,0BAA0B,mBAAO,CAAC,mGAAmC;AACrE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACZa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,sBAAsB,mBAAO,CAAC,yFAA8B;AAC5D;AACA,eAAe,kBAAkB,eAAe,aAAa;AAC7D,WAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,MAAM,gBAAgB;AACzC;A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AC/D,gDAAgD,qCAAqC,wCAAwC,EAAE,EAAE;AACjI,kDAAkD,qCAAqC,0CAA0C,EAAE,EAAE;AACrI,oDAAoD,qCAAqC,4CAA4C,EAAE,EAAE;;;;;;;;;;;;;AC9D5H;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACxEa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ,gIAAgI,EAAE;AACxK;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC3Ea;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B;AACA,gBAAgB,mBAAO,CAAC,iEAAW;AACnC,sBAAsB,mBAAO,CAAC,6EAAiB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,QAAQ,oIAAoI,EAAE;AAC5K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACnFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACvBa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACtBa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,gBAAgB,sCAAsC,iBAAiB,EAAE;AACvF,6BAA6B,8EAA8E;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA,CAAC;AACD,8CAA8C,cAAc;AAC5D;AACA,mBAAO,CAAC,wEAAoB;AAC5B,gBAAgB,mBAAO,CAAC,iEAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,IAAqC;AACjD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AClFa;AACb;AACA;AACA;AACA;AACA,8CAA8C,cAAc;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,UAAU,EAAE;AAC1D,gDAAgD,UAAU,EAAE;AAC5D,mDAAmD,UAAU;AAC7D,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;ACnDG;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;;;;AACH;AAAA;AACmB,aAAM,SAAG,IAuD5B;AAAC;AAjDI;;;;;AACH,6BAAO,UAAP,UAAmB,KAAgC;AAAnD,oBASC;AARK,aAAO,OAAM;AACjB,YAAa,gCAAyB,UAAM;AACtC,kBAAO,OAAO,OAAM;AACgD;AAC3B;AACrC,qBACV;AAAG,SALkC;AAMjC,aAAO,OAAI,IAAI,KACrB;AAAC;AAKE;;;;AACH,6BAAM,SAAN,UAAkB;AAChB,YAAW,QAAO,KAAO,OAAI,IAAM;AACnC,YAAS,OAAE;AACW,iCAAQ;AACxB,iBAAO,OAAO,OAAM;AAE5B;AAAC;AAIE;;;AACH,6BAAS,YAAT;AAAA,oBAOC;AANwE;AACV;AACd;AAC3C,aAAO,OAAQ,QAAC,UAAE,GAAK;AACrB,kBAAO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+B,4BAAM,IAAS,SAAa,cAAS;AACd;AACtB;AAChC,QACI,oCAAI,IAAS,SAAqB,wBAAO,IAAS,SAAQ,SAAgB;AAE/D,sBACc,6BAAsC;AAEnE,QAAI,CAAa,cAAE;AACI,gCAAmB;AACzC;AACD,WACF;AAAC;AA1BD,+BA0BC;AAED,SAAwC,yBAChB,KAA4B,YAC7B;AACrB,QAAI,CAAI,KAAE;AACR,eAAO,EAAE,GAAG,GAAG,GAAK;AACrB;AACM,QAAC,IAAiB,WAAjB;QAAG,IAAc,WAAC;AAC1B,QAAe,YAAI,IAAa,WAAM;AACtC,QAAe,YAAI,IAAa,WAAK;AAErC,QAAgB;AAChB,QAAgB;AAC0C;AAC1D,QAAO,IAAK,SAAiB,cAAE;AAC7B,YAAgB,aAAqB;AAC1B,sBAAa,WAAe,eAAG,GAAM,QAAa;AAClD,sBAAa,WAAe,eAAG,GAAM,QAAa;AAC9D,WAAM;AACL,YAAgB,aAAqB;AAC1B,sBAAa,WAAM,QAAa;AAChC,sBAAa,WAAM,QAAa;AAC5C;AAED,WAAO,EAAE,GAAa,aAAG,GAC3B;AAAC;AAxBD,mCAwBC,yB","file":"mdc.chips.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"@material/chips\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"chips\"] = factory();\n\telse\n\t\troot[\"mdc\"] = root[\"mdc\"] || {}, root[\"mdc\"][\"chips\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./packages/mdc-chips/index.ts\");\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeAttrPrefix = void 0;\nrequire(\"../environment/dev\");\nvar attribute_impl_1 = require(\"../internals/attribute_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar sensitive_attributes_1 = require(\"./sensitive_attributes\");\n/**\n * Creates a SafeAttributePrefix object from a template literal with no\n * interpolations for attributes that share a common prefix guaranteed to be not\n * security sensitive.\n *\n * The template literal is a prefix that makes it obvious this attribute is not\n * security sensitive. If it doesn't, this function will throw.\n */\nfunction safeAttrPrefix(templ) {\n    if (process.env.NODE_ENV !== 'production') {\n        (0, string_literal_1.assertIsTemplateObject)(templ, true, 'safeAttr is a template literal tag function ' +\n            'and should be called using the tagged template syntax. ' +\n            'For example, safeAttr`foo`;');\n    }\n    var attrPrefix = templ[0].toLowerCase();\n    if (process.env.NODE_ENV !== 'production') {\n        if (attrPrefix.indexOf('on') === 0 || 'on'.indexOf(attrPrefix) === 0) {\n            throw new Error(\"Prefix '\".concat(templ[0], \"' does not guarantee the attribute \") +\n                \"to be safe as it is also a prefix for event handler attributes\" +\n                \"Please use 'addEventListener' to set event handlers.\");\n        }\n        sensitive_attributes_1.SECURITY_SENSITIVE_ATTRIBUTES.forEach(function (sensitiveAttr) {\n            if (sensitiveAttr.indexOf(attrPrefix) === 0) {\n                throw new Error(\"Prefix '\".concat(templ[0], \"' does not guarantee the attribute \") +\n                    \"to be safe as it is also a prefix for \" +\n                    \"the security sensitive attribute '\".concat(sensitiveAttr, \"'. \") +\n                    \"Please use native or safe DOM APIs to set the attribute.\");\n            }\n        });\n    }\n    return (0, attribute_impl_1.createAttributePrefix)(attrPrefix);\n}\nexports.safeAttrPrefix = safeAttrPrefix;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatHtmls = exports.createScriptSrc = exports.createScript = exports.htmlEscape = void 0;\nvar html_impl_1 = require(\"../internals/html_impl\");\nvar resource_url_impl_1 = require(\"../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../internals/script_impl\");\n/**\n * Returns HTML-escaped text as a `SafeHtml` object.\n *\n * Available options:\n * - `preserveSpaces` turns every second consecutive space character into its\n * HTML entity representation (`&#160;`).\n * - `preserveNewlines` turns newline characters into breaks (`<br>`).\n * - `preserveTabs` wraps tab characters in a span with style=white-space:pre.\n */\nfunction htmlEscape(text, options) {\n    if (options === void 0) { options = {}; }\n    var htmlEscapedString = htmlEscapeToString(text);\n    if (options.preserveSpaces) {\n        // Do this first to ensure we preserve spaces after newlines and tabs.\n        htmlEscapedString =\n            htmlEscapedString.replace(/(^|[\\r\\n\\t ]) /g, '$1&#160;');\n    }\n    if (options.preserveNewlines) {\n        htmlEscapedString = htmlEscapedString.replace(/(\\r\\n|\\n|\\r)/g, '<br>');\n    }\n    if (options.preserveTabs) {\n        htmlEscapedString = htmlEscapedString.replace(/(\\t+)/g, '<span style=\"white-space:pre\">$1</span>');\n    }\n    return (0, html_impl_1.createHtml)(htmlEscapedString);\n}\nexports.htmlEscape = htmlEscape;\n/**\n * Creates a `SafeHtml` representing a script tag with inline script content.\n */\nfunction createScript(script, options) {\n    if (options === void 0) { options = {}; }\n    var unwrappedScript = (0, script_impl_1.unwrapScript)(script).toString();\n    var stringTag = \"<script\";\n    if (options.id) {\n        stringTag += \" id=\\\"\".concat(htmlEscapeToString(options.id), \"\\\"\");\n    }\n    if (options.nonce) {\n        stringTag += \" nonce=\\\"\".concat(htmlEscapeToString(options.nonce), \"\\\"\");\n    }\n    if (options.type) {\n        stringTag += \" type=\\\"\".concat(htmlEscapeToString(options.type), \"\\\"\");\n    }\n    stringTag += \">\".concat(unwrappedScript, \"</script>\");\n    return (0, html_impl_1.createHtml)(stringTag);\n}\nexports.createScript = createScript;\n/**\n * Creates a `SafeHtml` representing a script tag with the src attribute.\n * This also supports CSP nonces and async loading.\n */\nfunction createScriptSrc(src, async, nonce) {\n    var unwrappedSrc = (0, resource_url_impl_1.unwrapResourceUrl)(src).toString();\n    var stringTag = \"<script src=\\\"\".concat(htmlEscapeToString(unwrappedSrc), \"\\\"\");\n    if (async) {\n        stringTag += ' async';\n    }\n    if (nonce) {\n        stringTag += \" nonce=\\\"\".concat(htmlEscapeToString(nonce), \"\\\"\");\n    }\n    stringTag += '>\\x3c/script>';\n    return (0, html_impl_1.createHtml)(stringTag);\n}\nexports.createScriptSrc = createScriptSrc;\n/**\n * HTML-escapes the given text (`&`, `<`, `>`, `\"` and `'`).\n */\nfunction htmlEscapeToString(text) {\n    var escaped = text.replace(/&/g, '&amp;')\n        .replace(/</g, '&lt;')\n        .replace(/>/g, '&gt;')\n        .replace(/\"/g, '&quot;')\n        .replace(/'/g, '&apos;');\n    return escaped;\n}\n/** Creates a `SafeHtml` value by concatenating multiple `SafeHtml`s. */\nfunction concatHtmls(htmls) {\n    return (0, html_impl_1.createHtml)(htmls.map(html_impl_1.unwrapHtml).join(''));\n}\nexports.concatHtmls = concatHtmls;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __values = (this && this.__values) || function(o) {\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n    if (m) return m.call(o);\n    if (o && typeof o.length === \"number\") return {\n        next: function () {\n            if (o && i >= o.length) o = void 0;\n            return { value: o && o[i++], done: !o };\n        }\n    };\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n    if (!m) return o;\n    var i = m.call(o), r, ar = [], e;\n    try {\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n    }\n    catch (error) { e = { error: error }; }\n    finally {\n        try {\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\n        }\n        finally { if (e) throw e.error; }\n    }\n    return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.HtmlSanitizerImpl = void 0;\nrequire(\"../../environment/dev\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/* g3_import_pure from '../../internals/pure' */\nvar secrets_1 = require(\"../../internals/secrets\");\nvar url_sanitizer_1 = require(\"../url_sanitizer\");\nvar inert_fragment_1 = require(\"./inert_fragment\");\nvar no_clobber_1 = require(\"./no_clobber\");\nvar default_sanitizer_table_1 = require(\"./sanitizer_table/default_sanitizer_table\");\nvar sanitizer_table_1 = require(\"./sanitizer_table/sanitizer_table\");\n/** Implementation for `HtmlSanitizer` */\nvar HtmlSanitizerImpl = /** @class */ (function () {\n    function HtmlSanitizerImpl(sanitizerTable, token) {\n        this.sanitizerTable = sanitizerTable;\n        this.changes = [];\n        (0, secrets_1.ensureTokenIsValid)(token);\n    }\n    HtmlSanitizerImpl.prototype.sanitizeAssertUnchanged = function (html) {\n        this.changes = [];\n        var sanitizedHtml = this.sanitize(html);\n        if (this.changes.length !== 0) {\n            var message = '';\n            if (process.env.NODE_ENV !== 'production') {\n                message =\n                    \"Unexpected change to HTML value as a result of sanitization. \" +\n                        \"Input: \\\"\".concat(html, \"\\\", sanitized output: \\\"\").concat(sanitizedHtml, \"\\\"\\n\") +\n                        \"List of changes:\".concat(this.changes.join('\\n'));\n            }\n            throw new Error(message);\n        }\n        return sanitizedHtml;\n    };\n    HtmlSanitizerImpl.prototype.sanitize = function (html) {\n        var fakeRoot = document.createElement('span');\n        fakeRoot.appendChild(this.sanitizeToFragment(html));\n        // XML serialization is preferred over HTML serialization as it is\n        // stricter and makes sure all attributes are properly escaped, avoiding\n        // cases where the tree might mutate when parsed again later due to the\n        // complexities of the HTML parsing algorithm\n        var serializedNewTree = new XMLSerializer().serializeToString(fakeRoot);\n        // We remove the outer most element as this is the span node created as\n        // the root for the sanitized tree and contains a spurious xmlns attribute\n        // from the XML serialization step.\n        serializedNewTree = serializedNewTree.slice(serializedNewTree.indexOf('>') + 1, serializedNewTree.lastIndexOf('</'));\n        return (0, html_impl_1.createHtml)(serializedNewTree);\n    };\n    HtmlSanitizerImpl.prototype.sanitizeToFragment = function (html) {\n        var _this = this;\n        var dirtyFragment = (0, inert_fragment_1.createInertFragment)(html);\n        var treeWalker = document.createTreeWalker(dirtyFragment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, \n        // IE10 and IE11 won't accept a proper `NodeFilter` interface, and\n        // expect the filtering function to be passed directly. It seems that\n        // other browsers also do not mind getting the function directly. see\n        // https://stackoverflow.com/q/38245898\n        (function (n) { return _this.nodeFilter(n); }), \n        // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4.\n        false);\n        // `nextNode` is called so we skip the root `DocumentFragment`.\n        var currentNode = treeWalker.nextNode();\n        // We create a root element to attach all the children of the body to. We\n        // use div as it as a semantic-free, generic container and does not\n        // represent anything. This is removed when we serialize the tree back\n        // into a string.\n        var sanitizedFragment = document.createDocumentFragment();\n        var sanitizedParent = sanitizedFragment;\n        while (currentNode !== null) {\n            var sanitizedNode = void 0;\n            if ((0, no_clobber_1.isText)(currentNode)) {\n                sanitizedNode = this.sanitizeTextNode(currentNode);\n            }\n            else if ((0, no_clobber_1.isElement)(currentNode)) {\n                sanitizedNode = this.sanitizeElementNode(currentNode);\n            }\n            else {\n                throw new Error('Node is not of type text or element');\n            }\n            sanitizedParent.appendChild(sanitizedNode);\n            // Advance iterator while keeping track of the sanitized parent for the\n            // current node\n            currentNode = treeWalker.firstChild();\n            if (currentNode) {\n                sanitizedParent = sanitizedNode;\n            }\n            else {\n                while (!(currentNode = treeWalker.nextSibling())) {\n                    if (!(currentNode = treeWalker.parentNode())) {\n                        break;\n                    }\n                    sanitizedParent = sanitizedParent.parentNode;\n                }\n            }\n        }\n        return sanitizedFragment;\n    };\n    HtmlSanitizerImpl.prototype.sanitizeTextNode = function (textNode) {\n        return document.createTextNode(textNode.data);\n    };\n    HtmlSanitizerImpl.prototype.sanitizeElementNode = function (elementNode) {\n        var e_1, _a;\n        var elementName = (0, no_clobber_1.getNodeName)(elementNode);\n        var newNode = document.createElement(elementName);\n        var dirtyAttributes = elementNode.attributes;\n        try {\n            for (var dirtyAttributes_1 = __values(dirtyAttributes), dirtyAttributes_1_1 = dirtyAttributes_1.next(); !dirtyAttributes_1_1.done; dirtyAttributes_1_1 = dirtyAttributes_1.next()) {\n                var _b = dirtyAttributes_1_1.value, name_1 = _b.name, value = _b.value;\n                var policy = this.sanitizerTable.getAttributePolicy(name_1, elementName);\n                if (!this.satisfiesAllConditions(policy.conditions, dirtyAttributes)) {\n                    this.recordChange(\"Not all conditions satisfied for attribute: \".concat(name_1, \".\"));\n                    continue;\n                }\n                switch (policy.policyAction) {\n                    case sanitizer_table_1.AttributePolicyAction.KEEP:\n                        newNode.setAttribute(name_1, value);\n                        break;\n                    case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL:\n                        var sanitizedAttrUrl = (0, url_sanitizer_1.restrictivelySanitizeUrl)(value);\n                        if (sanitizedAttrUrl !== value) {\n                            this.recordChange(\"Url in attribute \".concat(name_1, \" was modified during sanitization. Original url:\\\"\").concat(value, \"\\\" was sanitized to: \\\"\").concat(sanitizedAttrUrl, \"\\\"\"));\n                        }\n                        newNode.setAttribute(name_1, sanitizedAttrUrl);\n                        break;\n                    case sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE:\n                        // We don't consider changing the case of an attribute value to be a\n                        // semantic change\n                        newNode.setAttribute(name_1, value.toLowerCase());\n                        break;\n                    case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE:\n                        newNode.setAttribute(name_1, value);\n                        break;\n                    case sanitizer_table_1.AttributePolicyAction.DROP:\n                        this.recordChange(\"Attribute: \".concat(name_1, \" was dropped\"));\n                        break;\n                    default:\n                        checkExhaustive(policy.policyAction, 'Unhandled AttributePolicyAction case');\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (dirtyAttributes_1_1 && !dirtyAttributes_1_1.done && (_a = dirtyAttributes_1.return)) _a.call(dirtyAttributes_1);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        return newNode;\n    };\n    HtmlSanitizerImpl.prototype.nodeFilter = function (node) {\n        if ((0, no_clobber_1.isText)(node)) {\n            return NodeFilter.FILTER_ACCEPT;\n        }\n        else if (!(0, no_clobber_1.isElement)(node)) {\n            // Getting a node that is neither an `Element` or a `Text` node. This is\n            // likely due to something that is not supposed to be an element in user\n            // code but recognized as such by the TreeWalker (e.g. a polyfill for\n            // other kind of nodes). Since we can't recognize it as an element, we\n            // drop the node, but we don't record it as a meaningful change.\n            return NodeFilter.FILTER_REJECT;\n        }\n        var nodeName = (0, no_clobber_1.getNodeName)(node);\n        if (nodeName === null) {\n            this.recordChange(\"Node name was null for node: \".concat(node));\n            return NodeFilter.FILTER_REJECT;\n        }\n        if (this.sanitizerTable.isAllowedElement(nodeName)) {\n            return NodeFilter.FILTER_ACCEPT;\n        }\n        this.recordChange(\"Element: \".concat(nodeName, \" was dropped\"));\n        return NodeFilter.FILTER_REJECT;\n    };\n    HtmlSanitizerImpl.prototype.recordChange = function (errorMessage) {\n        if (process.env.NODE_ENV !== 'production') {\n            this.changes.push(errorMessage);\n        }\n        else if (this.changes.length === 0) {\n            this.changes.push('');\n        }\n    };\n    HtmlSanitizerImpl.prototype.satisfiesAllConditions = function (conditions, attrs) {\n        var e_2, _a;\n        var _b;\n        if (!conditions) {\n            return true;\n        }\n        try {\n            for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) {\n                var _c = __read(conditions_1_1.value, 2), attrName = _c[0], expectedValues = _c[1];\n                var value = (_b = attrs.getNamedItem(attrName)) === null || _b === void 0 ? void 0 : _b.value;\n                if (value && !expectedValues.has(value)) {\n                    return false;\n                }\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        return true;\n    };\n    return HtmlSanitizerImpl;\n}());\nexports.HtmlSanitizerImpl = HtmlSanitizerImpl;\nvar defaultHtmlSanitizer = \n/* #__PURE__ */ (function () { return new HtmlSanitizerImpl(default_sanitizer_table_1.defaultSanitizerTable, secrets_1.secretToken); })();\n/** Sanitizes untrusted html using the default sanitizer configuration. */\nfunction sanitizeHtml(html) {\n    return defaultHtmlSanitizer.sanitize(html);\n}\nexports.sanitizeHtml = sanitizeHtml;\n/**\n * Sanitizes untrusted html using the default sanitizer configuration. Throws\n * an error if the html was changed.\n */\nfunction sanitizeHtmlAssertUnchanged(html) {\n    return defaultHtmlSanitizer.sanitizeAssertUnchanged(html);\n}\nexports.sanitizeHtmlAssertUnchanged = sanitizeHtmlAssertUnchanged;\n/**\n * Sanitizes untrusted html using the default sanitizer configuration. Throws\n * an error if the html was changed.\n */\nfunction sanitizeHtmlToFragment(html) {\n    return defaultHtmlSanitizer.sanitizeToFragment(html);\n}\nexports.sanitizeHtmlToFragment = sanitizeHtmlToFragment;\nfunction checkExhaustive(value, msg) {\n    if (msg === void 0) { msg = \"unexpected value \".concat(value, \"!\"); }\n    throw new Error(msg);\n}\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __values = (this && this.__values) || function(o) {\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n    if (m) return m.call(o);\n    if (o && typeof o.length === \"number\") return {\n        next: function () {\n            if (o && i >= o.length) o = void 0;\n            return { value: o && o[i++], done: !o };\n        }\n    };\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar __read = (this && this.__read) || function (o, n) {\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n    if (!m) return o;\n    var i = m.call(o), r, ar = [], e;\n    try {\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n    }\n    catch (error) { e = { error: error }; }\n    finally {\n        try {\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\n        }\n        finally { if (e) throw e.error; }\n    }\n    return ar;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HtmlSanitizerBuilder = void 0;\nvar secrets_1 = require(\"../../internals/secrets\");\nvar html_sanitizer_1 = require(\"./html_sanitizer\");\nvar default_sanitizer_table_1 = require(\"./sanitizer_table/default_sanitizer_table\");\nvar sanitizer_table_1 = require(\"./sanitizer_table/sanitizer_table\");\n/** This class allows modifications to the default sanitizer configuration. */\nvar HtmlSanitizerBuilder = /** @class */ (function () {\n    function HtmlSanitizerBuilder() {\n        // To denote if the builder has called build() and therefore should make no\n        // further changes to the sanitizer table.\n        this.calledBuild = false;\n        this.sanitizerTable = default_sanitizer_table_1.defaultSanitizerTable;\n    }\n    /** Builder option to restrict allowed elements to a smaller subset. */\n    HtmlSanitizerBuilder.prototype.onlyAllowElements = function (elementSet) {\n        var e_1, _a;\n        var allowedElements = new Set();\n        var allowedElementPolicies = new Map();\n        try {\n            for (var elementSet_1 = __values(elementSet), elementSet_1_1 = elementSet_1.next(); !elementSet_1_1.done; elementSet_1_1 = elementSet_1.next()) {\n                var element = elementSet_1_1.value;\n                element = element.toUpperCase();\n                if (!this.sanitizerTable.isAllowedElement(element)) {\n                    throw new Error(\"Element: \".concat(element, \", is not allowed by html5_contract.textpb\"));\n                }\n                var elementPolicy = this.sanitizerTable.elementPolicies.get(element);\n                if (elementPolicy !== undefined) {\n                    allowedElementPolicies.set(element, elementPolicy);\n                }\n                else {\n                    allowedElements.add(element);\n                }\n            }\n        }\n        catch (e_1_1) { e_1 = { error: e_1_1 }; }\n        finally {\n            try {\n                if (elementSet_1_1 && !elementSet_1_1.done && (_a = elementSet_1.return)) _a.call(elementSet_1);\n            }\n            finally { if (e_1) throw e_1.error; }\n        }\n        this.sanitizerTable = new sanitizer_table_1.SanitizerTable(allowedElements, allowedElementPolicies, this.sanitizerTable.allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies);\n        return this;\n    };\n    /**\n     * Builder option to restrict allowed attributes to a smaller subset.\n     *\n     * If the attribute isn't currently allowed then it won't be added.\n     */\n    HtmlSanitizerBuilder.prototype.onlyAllowAttributes = function (attributeSet) {\n        var e_2, _a, e_3, _b, e_4, _c;\n        var allowedGlobalAttributes = new Set();\n        var globalAttributePolicies = new Map();\n        var elementPolicies = new Map();\n        try {\n            for (var attributeSet_1 = __values(attributeSet), attributeSet_1_1 = attributeSet_1.next(); !attributeSet_1_1.done; attributeSet_1_1 = attributeSet_1.next()) {\n                var attribute = attributeSet_1_1.value;\n                if (this.sanitizerTable.allowedGlobalAttributes.has(attribute)) {\n                    allowedGlobalAttributes.add(attribute);\n                }\n                if (this.sanitizerTable.globalAttributePolicies.has(attribute)) {\n                    globalAttributePolicies.set(attribute, this.sanitizerTable.globalAttributePolicies.get(attribute));\n                }\n            }\n        }\n        catch (e_2_1) { e_2 = { error: e_2_1 }; }\n        finally {\n            try {\n                if (attributeSet_1_1 && !attributeSet_1_1.done && (_a = attributeSet_1.return)) _a.call(attributeSet_1);\n            }\n            finally { if (e_2) throw e_2.error; }\n        }\n        try {\n            for (var _d = __values(this.sanitizerTable\n                .elementPolicies.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {\n                var _f = __read(_e.value, 2), elementName = _f[0], originalElementPolicy = _f[1];\n                var newElementPolicy = new Map();\n                try {\n                    for (var _g = (e_4 = void 0, __values(originalElementPolicy\n                        .entries())), _h = _g.next(); !_h.done; _h = _g.next()) {\n                        var _j = __read(_h.value, 2), attribute = _j[0], attributePolicy = _j[1];\n                        if (attributeSet.has(attribute)) {\n                            newElementPolicy.set(attribute, attributePolicy);\n                        }\n                    }\n                }\n                catch (e_4_1) { e_4 = { error: e_4_1 }; }\n                finally {\n                    try {\n                        if (_h && !_h.done && (_c = _g.return)) _c.call(_g);\n                    }\n                    finally { if (e_4) throw e_4.error; }\n                }\n                elementPolicies.set(elementName, newElementPolicy);\n            }\n        }\n        catch (e_3_1) { e_3 = { error: e_3_1 }; }\n        finally {\n            try {\n                if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n            }\n            finally { if (e_3) throw e_3.error; }\n        }\n        this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies);\n        return this;\n    };\n    /**\n     * Allows the set of data attributes passed.\n     *\n     * These values must be prefixed with \"data-\"\n     *\n     * If called with onlyAllowElements or onlyAllowAttributes, those methods must\n     * be called first.\n     */\n    HtmlSanitizerBuilder.prototype.allowDataAttributes = function (attributes) {\n        var e_5, _a;\n        var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes);\n        try {\n            for (var attributes_1 = __values(attributes), attributes_1_1 = attributes_1.next(); !attributes_1_1.done; attributes_1_1 = attributes_1.next()) {\n                var attribute = attributes_1_1.value;\n                if (attribute.indexOf('data-') !== 0) {\n                    throw new Error(\"data attribute: \".concat(attribute, \" does not begin with the prefix \\\"data-\\\"\"));\n                }\n                allowedGlobalAttributes.add(attribute);\n            }\n        }\n        catch (e_5_1) { e_5 = { error: e_5_1 }; }\n        finally {\n            try {\n                if (attributes_1_1 && !attributes_1_1.done && (_a = attributes_1.return)) _a.call(attributes_1);\n            }\n            finally { if (e_5) throw e_5.error; }\n        }\n        this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies);\n        return this;\n    };\n    /**\n     * Preserves style attributes. Note that the sanitizer won't parse and\n     * sanitize the values but keep them as they are. In particular this means\n     * that the code will be able to call functions that could do undesirable\n     * things (e.g. `url` to trigger a network request), as well as any custom\n     * properties or functions defined by the application.\n     */\n    HtmlSanitizerBuilder.prototype.allowStyleAttributes = function () {\n        var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n        globalAttributePolicies.set('style', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE });\n        this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n        return this;\n    };\n    /**\n     * Preserves the class attribute on all elements. This means contents can\n     * adopt CSS styles from other page elements and possibly mask themselves as\n     * legitimate UI elements, which can lead to phishing.\n     */\n    HtmlSanitizerBuilder.prototype.allowClassAttributes = function () {\n        var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n        globalAttributePolicies.set('class', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP });\n        this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n        return this;\n    };\n    /**\n     * Preserves id attributes. This carries moderate risk as it allows an\n     * element to override other elements with the same ID.\n     */\n    HtmlSanitizerBuilder.prototype.allowIdAttributes = function () {\n        var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies);\n        globalAttributePolicies.set('id', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP });\n        this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies);\n        return this;\n    };\n    HtmlSanitizerBuilder.prototype.build = function () {\n        if (this.calledBuild) {\n            throw new Error('this sanitizer has already called build');\n        }\n        this.calledBuild = true;\n        return new html_sanitizer_1.HtmlSanitizerImpl(this.sanitizerTable, secrets_1.secretToken);\n    };\n    return HtmlSanitizerBuilder;\n}());\nexports.HtmlSanitizerBuilder = HtmlSanitizerBuilder;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createInertFragment = void 0;\nvar element_1 = require(\"../../dom/elements/element\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/**\n * Returns a fragment that contains the parsed HTML for `dirtyHtml` without\n * executing any of the potential payload.\n */\nfunction createInertFragment(dirtyHtml) {\n    var template = document.createElement('template');\n    // This call is only used to create an inert tree for the sanitizer to\n    // further process and is never returned directly to the caller. We can't use\n    // a reviewed conversion in order to avoid an import loop.\n    var temporarySafeHtml = (0, html_impl_1.createHtml)(dirtyHtml);\n    (0, element_1.setInnerHtml)(template, temporarySafeHtml);\n    return template.content;\n}\nexports.createInertFragment = createInertFragment;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isElement = exports.isText = exports.getNodeName = void 0;\n/**\n * Library that provides safe getters for different node properties and\n * checks for clobbering.\n */\n/** Gets a reasonable nodeName, even for clobbered nodes. */\nfunction getNodeName(node) {\n    var nodeName = node.nodeName;\n    // If the property is clobbered, assume it is an `HTMLFormElement`.\n    return (typeof nodeName === 'string') ? nodeName : 'FORM';\n}\nexports.getNodeName = getNodeName;\n/** Returns true if the object passed is a Text node. */\nfunction isText(node) {\n    // The property cannot get clobbered on Text nodes.\n    return node.nodeType === Node.TEXT_NODE;\n}\nexports.isText = isText;\n/** Returns true if the object passed is an Element node. */\nfunction isElement(node) {\n    var nodeType = node.nodeType;\n    // If the property is clobbered, we can assume it is an `HTMLFormElement`, and\n    // thus an `Element`.\n    return (nodeType === Node.ELEMENT_NODE) || (typeof nodeType !== 'number');\n}\nexports.isElement = isElement;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultSanitizerTable = void 0;\nvar sanitizer_table_1 = require(\"./sanitizer_table\");\n/**\n * GENERATED CODE, DO NOT MODIFY\n * This SanitizerTable was generated from the checked in html contract:\n *  webutil/html/types/codegen/html5_contract.textpb\n *\n * You can regenerate this file with:\n * webutil/html/types/codegen/update_generated_source_files.sh\n */\nexports.defaultSanitizerTable = new sanitizer_table_1.SanitizerTable(new Set([\n    'ARTICLE', 'SECTION', 'NAV', 'ASIDE', 'H1', 'H2',\n    'H3', 'H4', 'H5', 'H6', 'HEADER', 'FOOTER',\n    'ADDRESS', 'P', 'HR', 'PRE', 'BLOCKQUOTE', 'OL',\n    'UL', 'LH', 'LI', 'DL', 'DT', 'DD',\n    'FIGURE', 'FIGCAPTION', 'MAIN', 'DIV', 'EM', 'STRONG',\n    'SMALL', 'S', 'CITE', 'Q', 'DFN', 'ABBR',\n    'RUBY', 'RB', 'RT', 'RTC', 'RP', 'DATA',\n    'TIME', 'CODE', 'VAR', 'SAMP', 'KBD', 'SUB',\n    'SUP', 'I', 'B', 'U', 'MARK', 'BDI',\n    'BDO', 'SPAN', 'BR', 'WBR', 'INS', 'DEL',\n    'PICTURE', 'PARAM', 'TRACK', 'MAP', 'TABLE', 'CAPTION',\n    'COLGROUP', 'COL', 'TBODY', 'THEAD', 'TFOOT', 'TR',\n    'TD', 'TH', 'SELECT', 'DATALIST', 'OPTGROUP', 'OPTION',\n    'OUTPUT', 'PROGRESS', 'METER', 'FIELDSET', 'LEGEND', 'DETAILS',\n    'SUMMARY', 'MENU', 'DIALOG', 'SLOT', 'CANVAS', 'FONT',\n    'CENTER',\n]), new Map([\n    [\n        'A', new Map([\n            ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n        ])\n    ],\n    [\n        'AREA', new Map([\n            ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n        ])\n    ],\n    [\n        'LINK', new Map([\n            [\n                'href', {\n                    policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL,\n                    conditions: new Map([[\n                            'rel', new Set([\n                                'alternate',\n                                'author',\n                                'bookmark',\n                                'canonical',\n                                'cite',\n                                'help',\n                                'icon',\n                                'license',\n                                'next',\n                                'prefetch',\n                                'dns-prefetch',\n                                'prerender',\n                                'preconnect',\n                                'preload',\n                                'prev',\n                                'search',\n                                'subresource',\n                            ])\n                        ]])\n                }\n            ],\n        ])\n    ],\n    [\n        'SOURCE', new Map([\n            ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n        ])\n    ],\n    [\n        'IMG', new Map([\n            ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n        ])\n    ],\n    [\n        'VIDEO', new Map([\n            ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n        ])\n    ],\n    [\n        'AUDIO', new Map([\n            ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n        ])\n    ],\n]), new Set([\n    'title',\n    'aria-atomic',\n    'aria-autocomplete',\n    'aria-busy',\n    'aria-checked',\n    'aria-current',\n    'aria-disabled',\n    'aria-dropeffect',\n    'aria-expanded',\n    'aria-haspopup',\n    'aria-hidden',\n    'aria-invalid',\n    'aria-label',\n    'aria-level',\n    'aria-live',\n    'aria-multiline',\n    'aria-multiselectable',\n    'aria-orientation',\n    'aria-posinset',\n    'aria-pressed',\n    'aria-readonly',\n    'aria-relevant',\n    'aria-required',\n    'aria-selected',\n    'aria-setsize',\n    'aria-sort',\n    'aria-valuemax',\n    'aria-valuemin',\n    'aria-valuenow',\n    'aria-valuetext',\n    'alt',\n    'align',\n    'autocapitalize',\n    'autocomplete',\n    'autocorrect',\n    'autofocus',\n    'autoplay',\n    'bgcolor',\n    'border',\n    'cellpadding',\n    'cellspacing',\n    'checked',\n    'color',\n    'cols',\n    'colspan',\n    'controls',\n    'datetime',\n    'disabled',\n    'download',\n    'draggable',\n    'enctype',\n    'face',\n    'formenctype',\n    'frameborder',\n    'height',\n    'hreflang',\n    'hidden',\n    'ismap',\n    'label',\n    'lang',\n    'loop',\n    'max',\n    'maxlength',\n    'media',\n    'minlength',\n    'min',\n    'multiple',\n    'muted',\n    'nonce',\n    'open',\n    'placeholder',\n    'preload',\n    'rel',\n    'required',\n    'reversed',\n    'role',\n    'rows',\n    'rowspan',\n    'selected',\n    'shape',\n    'size',\n    'sizes',\n    'slot',\n    'span',\n    'spellcheck',\n    'start',\n    'step',\n    'summary',\n    'translate',\n    'type',\n    'valign',\n    'value',\n    'width',\n    'wrap',\n    'itemscope',\n    'itemtype',\n    'itemid',\n    'itemprop',\n    'itemref',\n]), new Map([\n    [\n        'dir', {\n            policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n            conditions: new Map([[\n                    'dir', new Set([\n                        'auto',\n                        'ltr',\n                        'rtl',\n                    ])\n                ]])\n        }\n    ],\n    [\n        'async', {\n            policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n            conditions: new Map([[\n                    'async', new Set([\n                        'async',\n                    ])\n                ]])\n        }\n    ],\n    ['cite', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n    [\n        'loading', {\n            policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n            conditions: new Map([[\n                    'loading', new Set([\n                        'eager',\n                        'lazy',\n                    ])\n                ]])\n        }\n    ],\n    ['poster', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }],\n    [\n        'target', {\n            policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE,\n            conditions: new Map([[\n                    'target', new Set([\n                        '_self',\n                        '_blank',\n                    ])\n                ]])\n        }\n    ],\n]));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AttributePolicyAction = exports.SanitizerTable = void 0;\n/** Class for holding element and attribute policies used for sanitization. */\nvar SanitizerTable = /** @class */ (function () {\n    function SanitizerTable(allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies) {\n        this.allowedElements = allowedElements;\n        this.elementPolicies = elementPolicies;\n        this.allowedGlobalAttributes = allowedGlobalAttributes;\n        this.globalAttributePolicies = globalAttributePolicies;\n    }\n    SanitizerTable.prototype.isAllowedElement = function (elementName) {\n        // Note: `HTMLFormElement`s are always dropped, supporting them is very\n        // costly because of the DOM clobberring they can cause. The additional code\n        // size required to properly work around DOM clobberring issues is large and\n        // shouldn't be put on every user of the sanitizer. Thoroughly review\n        // b/210975025 and the CLs linked there before you start allowing form\n        // elements.\n        return elementName.toLowerCase() !== 'form' &&\n            (this.allowedElements.has(elementName) ||\n                this.elementPolicies.has(elementName));\n    };\n    SanitizerTable.prototype.getAttributePolicy = function (attributeName, elementName) {\n        var elementPolicy = this.elementPolicies.get(elementName);\n        if (elementPolicy === null || elementPolicy === void 0 ? void 0 : elementPolicy.has(attributeName)) {\n            return elementPolicy.get(attributeName);\n        }\n        if (this.allowedGlobalAttributes.has(attributeName)) {\n            return { policyAction: AttributePolicyAction.KEEP };\n        }\n        var globalPolicy = this.globalAttributePolicies.get(attributeName);\n        return globalPolicy || { policyAction: AttributePolicyAction.DROP };\n    };\n    return SanitizerTable;\n}());\nexports.SanitizerTable = SanitizerTable;\n/**\n * Values derived from\n * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy\n */\nvar AttributePolicyAction;\n(function (AttributePolicyAction) {\n    AttributePolicyAction[AttributePolicyAction[\"DROP\"] = 0] = \"DROP\";\n    AttributePolicyAction[AttributePolicyAction[\"KEEP\"] = 1] = \"KEEP\";\n    AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_SANITIZE_URL\"] = 2] = \"KEEP_AND_SANITIZE_URL\";\n    AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_NORMALIZE\"] = 3] = \"KEEP_AND_NORMALIZE\";\n    AttributePolicyAction[AttributePolicyAction[\"KEEP_AND_SANITIZE_STYLE\"] = 4] = \"KEEP_AND_SANITIZE_STYLE\";\n})(AttributePolicyAction = exports.AttributePolicyAction || (exports.AttributePolicyAction = {}));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.blobUrlFromScript = exports.replaceFragment = exports.appendParams = exports.trustedResourceUrl = void 0;\nrequire(\"../environment/dev\");\nvar resource_url_impl_1 = require(\"../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../internals/script_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\n/**\n * Check whether the base url contains a valid origin,\n *\n * A string for an origin must contain only alphanumeric or any of the\n * following: `-.:`, and must not be an IP address. Remember that, as per the\n * documentation for TrustedResourceUrl, the origin must be trustworthy.\n *\n * @param base The base url that contains an origin.\n */\nfunction hasValidOrigin(base) {\n    if (!(/^https:\\/\\//.test(base) || /^\\/\\//.test(base))) {\n        return false;\n    }\n    var originStart = base.indexOf('//') + 2;\n    var originEnd = base.indexOf('/', originStart);\n    // If the base url only contains the prefix (e.g. //), or the slash\n    // for the origin is right after the prefix (e.g. ///), the origin is\n    // missing.\n    if (originEnd <= originStart) {\n        throw new Error(\"Can't interpolate data in a url's origin, \" +\n            \"Please make sure to fully specify the origin, terminated with '/'.\");\n    }\n    var origin = base.substring(originStart, originEnd);\n    if (!/^[0-9a-z.:-]+$/i.test(origin)) {\n        throw new Error('The origin contains unsupported characters.');\n    }\n    if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) {\n        throw new Error('Invalid port number.');\n    }\n    if (!/(^|\\.)[a-z][^.]*$/i.test(origin)) {\n        throw new Error('The top-level domain must start with a letter.');\n    }\n    return true;\n}\n/**\n * Check whether the base url contains a valid about url at its beginning.\n *\n * An about url is either exactly 'about:blank' or 'about:blank#<str>' where\n * <str> can be an arbitrary string.\n *\n * @param base The base url.\n */\nfunction isValidAboutUrl(base) {\n    if (!/^about:blank/.test(base)) {\n        return false;\n    }\n    if (base !== 'about:blank' && !/^about:blank#/.test(base)) {\n        throw new Error('The about url is invalid.');\n    }\n    return true;\n}\n/**\n * Check whether the base url contains a valid path start at its beginning.\n *\n * A valid path start is either a '/' or a '/' followed by at least one\n * character that is not '/' or '\\'.\n *\n * @param base The base url.\n */\nfunction isValidPathStart(base) {\n    if (!/^\\//.test(base)) {\n        return false;\n    }\n    if ((base === '/') ||\n        (base.length > 1 && base[1] !== '/' && base[1] !== '\\\\')) {\n        return true;\n    }\n    throw new Error('The path start in the url is invalid.');\n}\n/**\n * Builds TrustedResourceUrl from a template literal.\n *\n * This factory is a template literal tag function. It should be called with\n * a template literal, with or without embedded expressions. For example,\n *               trustedResourceUrl`//example.com/${bar}`;\n * or\n *               trustedResourceUrl`//example.com`;\n *\n * When this function is called with a template literal without any embedded\n * expressions, the template string may contain anything as the whole URL is\n * a compile-time string constant.\n *\n * When this function is called with a template literal that contains embedded\n * expressions, the template must start with one of the following:\n * - `https://<origin>/`\n * - `//<origin>/`\n * - `/<pathStart>`\n * - `about:blank`\n * - `data:`\n *\n * `<origin>` must contain only alphanumeric or any of the following: `-.:`.\n * Remember that, as per the documentation for TrustedResourceUrl, the origin\n * must be trustworthy. An origin of \"example.com\" could be set with this\n * method, but would tie the security of your site to the security of\n * example.com. Similarly, formats that potentially cover redirects hosted\n * on a trusted origin are problematic, since that could lead to untrusted\n * origins.\n *\n * `<pathStart>` is either an empty string, or a non empty string that does not\n * start with '/' or '\\'.\n * In other words, `/<pathStart>` is either a '/' or a\n * '/' followed by at least one character that is not '/' or '\\'.\n *\n * `data:` (data URL) does not allow embedded expressions in the template\n * literal input.\n *\n * All embedded expressions are URL encoded when they are interpolated. Do not\n * embed expressions that are already URL encoded as they will be double encoded\n * by the builder.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param rest This represents the template's embedded expressions.\n */\nfunction trustedResourceUrl(templateObj) {\n    var rest = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        rest[_i - 1] = arguments[_i];\n    }\n    // Check if templateObj is actually from a template literal.\n    if (process.env.NODE_ENV !== 'production') {\n        (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'trustedResourceUrl is a template literal tag function and ' +\n            'can only be called as such (e.g. trustedResourceUrl`/somepath.js`)');\n    }\n    if (rest.length === 0) {\n        return (0, resource_url_impl_1.createResourceUrl)(templateObj[0]);\n    }\n    var base = templateObj[0].toLowerCase();\n    if (process.env.NODE_ENV !== 'production') {\n        if (/^data:/.test(base)) {\n            throw new Error('Data URLs cannot have expressions in the template literal input.');\n        }\n        if (!hasValidOrigin(base) && !isValidPathStart(base) &&\n            !isValidAboutUrl(base)) {\n            throw new Error('Trying to interpolate expressions in an unsupported url format.');\n        }\n    }\n    var urlParts = [templateObj[0]];\n    for (var i = 0; i < rest.length; i++) {\n        urlParts.push(encodeURIComponent(rest[i]));\n        urlParts.push(templateObj[i + 1]);\n    }\n    return (0, resource_url_impl_1.createResourceUrl)(urlParts.join(''));\n}\nexports.trustedResourceUrl = trustedResourceUrl;\n/**\n * Creates a new TrustedResourceUrl with params added to the URL's search\n * parameters.\n *\n * @param params What to add to the URL. Parameters with value `null` or\n * `undefined` are skipped. Both keys and values will be encoded. Do not pass\n * pre-encoded values as this will result them being double encoded. If the\n * value is an array then the same parameter is added for every element in the\n * array.\n */\nfunction appendParams(trustedUrl, params) {\n    var url = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString();\n    if (/#/.test(url)) {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = \"Found a hash in url (\".concat(url, \"), appending not supported\");\n        }\n        throw new Error(message);\n    }\n    var separator = /\\?/.test(url) ? '&' : '?';\n    // for-of has a big polyfill.\n    // tslint:disable-next-line:ban-iterable-foreach\n    params.forEach(function (value, key) {\n        var values = (value instanceof Array) ? value : [value];\n        for (var i = 0; i < values.length; i++) {\n            var v = values[i];\n            if (v === null || v === undefined) {\n                continue;\n            }\n            url += separator + encodeURIComponent(key) + '=' +\n                encodeURIComponent(String(v));\n            separator = '&';\n        }\n    });\n    return (0, resource_url_impl_1.createResourceUrl)(url);\n}\nexports.appendParams = appendParams;\nvar BEFORE_FRAGMENT_REGEXP = /[^#]*/;\n/**\n * Creates a new TrustedResourceUrl based on an existing one but with the\n * addition of a fragment (the part after `#`). If the URL already has a\n * fragment, it is replaced with the new one.\n * @param fragment The fragment to add to the URL, verbatim, without the leading\n * `#`. No additional escaping is applied.\n */\nfunction replaceFragment(trustedUrl, fragment) {\n    var urlString = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString();\n    return (0, resource_url_impl_1.createResourceUrl)(BEFORE_FRAGMENT_REGEXP.exec(urlString)[0] + '#' + fragment);\n}\nexports.replaceFragment = replaceFragment;\n/**\n * Creates a `TrustedResourceUrl` by generating a `Blob` from a\n * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`.\n *\n * Caller must call `URL.revokeObjectUrl()` on the stringified url to\n * release the underlying `Blob`.\n */\nfunction blobUrlFromScript(safeScript) {\n    var scriptContent = (0, script_impl_1.unwrapScript)(safeScript).toString();\n    var blob = new Blob([scriptContent], { type: 'text/javascript' });\n    return (0, resource_url_impl_1.createResourceUrl)(URL.createObjectURL(blob));\n}\nexports.blobUrlFromScript = blobUrlFromScript;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeScriptWithArgs = exports.scriptFromJson = exports.concatScripts = exports.safeScript = void 0;\nrequire(\"../environment/dev\");\nvar script_impl_1 = require(\"../internals/script_impl\");\nvar string_literal_1 = require(\"../internals/string_literal\");\n/**\n * Creates a SafeScript object from a template literal (without any embedded\n * expressions).\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n *                           safeScript`foo`;\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeScript(templateObj) {\n    if (process.env.NODE_ENV !== 'production') {\n        (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeScript is a template literal tag function ' +\n            'that only accepts template literals without expressions. ' +\n            'For example, safeScript`foo`;');\n    }\n    return (0, script_impl_1.createScript)(templateObj[0]);\n}\nexports.safeScript = safeScript;\n/** Creates a `SafeScript` value by concatenating multiple `SafeScript`s. */\nfunction concatScripts(scripts) {\n    return (0, script_impl_1.createScript)(scripts.map(script_impl_1.unwrapScript).join(''));\n}\nexports.concatScripts = concatScripts;\n/**\n * Converts a serializable value into JSON that is safe to interpolate into a\n * script context. In particular it escapes < characters so that a value of\n * \"</script>\" doesn't break out of the context.\n * @param value The value to serialize.\n */\nfunction scriptFromJson(value) {\n    return (0, script_impl_1.createScript)(JSON.stringify(value).replace(/</g, '\\\\x3c'));\n}\nexports.scriptFromJson = scriptFromJson;\n/**\n * Creates a `SafeScript` object from a template literal (without any embedded\n * expressions) along with additional arguments that the script should have\n * access to. These arguments will be JSON-encoded and passed to the script as\n * a function call.\n * @example\n * ```ts\n * safeScriptWithArgs`function (name, props) {\n *  console.log(name + ' is ' + props.age);\n * }`('Bob', { 'age': 42 })\n * ```\n * would return a `SafeScript` that represents the following code:\n * ```js\n * (function (name, props) {\n *  console.log(name + ' is ' + props.age);\n * })(\"Bob\",{\"age\":42})\n * ```\n * @note Be careful when passing objects as arguments, as unquoted property\n * names may be changed during compilation.\n * @param templateObj This contains the literal part of the template literal.\n * @param emptyArgs Expressions that evaluate to the empty string to enable\n *     inline comments.\n */\nfunction safeScriptWithArgs(templateObj) {\n    var emptyArgs = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        emptyArgs[_i - 1] = arguments[_i];\n    }\n    if (process.env.NODE_ENV !== 'production') {\n        if (emptyArgs.some(function (a) { return a !== ''; })) {\n            throw new Error('safeScriptWithArgs only allows empty string expressions ' +\n                'to enable inline comments.');\n        }\n        (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'safeScriptWithArgs is a template literal tag function ' +\n            'that only accepts template literals. ' +\n            'For example, safeScriptWithArgs`foo`;');\n    }\n    return function () {\n        var argValues = [];\n        for (var _i = 0; _i < arguments.length; _i++) {\n            argValues[_i] = arguments[_i];\n        }\n        var values = argValues.map(function (v) { return scriptFromJson(v).toString(); });\n        return (0, script_impl_1.createScript)(\"(\".concat(templateObj.join(''), \")(\").concat(values.join(','), \")\"));\n    };\n}\nexports.safeScriptWithArgs = safeScriptWithArgs;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SECURITY_SENSITIVE_ATTRIBUTES = void 0;\n// AUTOGENERATED. DO NOT EDIT.\n/**\n * Security sensitive attribute names that should not be set through\n * `setAttribute` or similar functions.\n */\nexports.SECURITY_SENSITIVE_ATTRIBUTES = [\n    'href',\n    'rel',\n    'src',\n    'srcdoc',\n    'action',\n    'formaction',\n    'sandbox',\n    'cite',\n    'poster',\n    'icon',\n];\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatStyles = exports.safeStyle = void 0;\nrequire(\"../environment/dev\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar style_impl_1 = require(\"../internals/style_impl\");\n/**\n * Creates a SafeStyle object from a template literal (without any embedded\n * expressions).\n *\n * ` style` should be in the format\n * ` name: value; [name: value; ...]` and must not have any < or >\n * characters in it. This is so that SafeStyle's contract is preserved,\n * allowing the SafeStyle to correctly be interpreted as a sequence of CSS\n * declarations and without affecting the syntactic structure of any\n * surrounding CSS and HTML.\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n *                          safeStyle`foo`;\n * This function first checks if it is called with a literal template, and\n * then performs basic sanity checks on the format of ` style`\n * but does not constrain the format of ` name} and {@code value`, except\n * for disallowing tag characters.\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeStyle(templateObj) {\n    if (process.env.NODE_ENV !== 'production') {\n        (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyle is a template literal tag function ' +\n            'that only accepts template literals without expressions. ' +\n            'For example, safeStyle`foo`;');\n    }\n    var style = templateObj[0];\n    if (process.env.NODE_ENV !== 'production') {\n        if (/[<>]/.test(style)) {\n            throw new Error('Forbidden characters in style string: ' + style);\n        }\n        if (!/;$/.test(style)) {\n            throw new Error('Style string does not end with \";\": ' + style);\n        }\n        if (!/:/.test(style)) {\n            throw new Error('Style string should contain one or more \":\": ' + style);\n        }\n    }\n    return (0, style_impl_1.createStyle)(style);\n}\nexports.safeStyle = safeStyle;\n/** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */\nfunction concatStyles(styles) {\n    return (0, style_impl_1.createStyle)(styles.map(style_impl_1.unwrapStyle).join(''));\n}\nexports.concatStyles = concatStyles;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.concatStyleSheets = exports.safeStyleSheet = void 0;\nrequire(\"../environment/dev\");\nvar string_literal_1 = require(\"../internals/string_literal\");\nvar style_sheet_impl_1 = require(\"../internals/style_sheet_impl\");\n/**\n * Creates a SafeStyleSheet object from a template literal (without any\n * embedded expressions).\n *\n * This function is a template literal tag function. It should be called with\n * a template literal that does not contain any expressions. For example,\n *                         safeStyleSheet`foo`;\n * The argument must not have any < or > characters in it. This is so that\n * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to\n * correctly be interpreted as a sequence of CSS declarations and without\n * affecting the syntactic structure of any surrounding CSS and HTML.\n *\n * @param templateObj This contains the literal part of the template literal.\n */\nfunction safeStyleSheet(templateObj) {\n    if (process.env.NODE_ENV !== 'production') {\n        (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyleSheet is a template literal tag ' +\n            'function that only accepts template literals without ' +\n            'expressions. For example, safeStyleSheet`foo`;');\n    }\n    var styleSheet = templateObj[0];\n    if (process.env.NODE_ENV !== 'production') {\n        if (/[<>]/.test(styleSheet)) {\n            throw new Error('Forbidden characters in styleSheet string: ' + styleSheet);\n        }\n    }\n    return (0, style_sheet_impl_1.createStyleSheet)(styleSheet);\n}\nexports.safeStyleSheet = safeStyleSheet;\n/**\n * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s.\n */\nfunction concatStyleSheets(sheets) {\n    return (0, style_sheet_impl_1.createStyleSheet)(sheets.map(style_sheet_impl_1.unwrapStyleSheet).join(''));\n}\nexports.concatStyleSheets = concatStyleSheets;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.restrictivelySanitizeUrl = exports.unwrapUrlOrSanitize = exports.sanitizeJavascriptUrl = void 0;\n/**\n * @fileoverview Provides functions to enforce the SafeUrl contract at the sink\n * level.\n */\nrequire(\"../environment/dev\");\nfunction extractScheme(url) {\n    var parsedUrl;\n    try {\n        parsedUrl = new URL(url);\n    }\n    catch (e) {\n        // According to https://url.spec.whatwg.org/#constructors, the URL\n        // constructor with one parameter throws if `url` is not absolute. In this\n        // case, we are sure that no explicit scheme (javascript: ) is set.\n        // This can also be a URL parsing error, but in this case the URL won't be\n        // run anyway.\n        return 'https:';\n    }\n    return parsedUrl.protocol;\n}\n// We can't use an ES6 Set here because gws somehow depends on this code and\n// doesn't want to pay the cost of a polyfill.\nvar ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:'];\n/**\n * Checks that the URL scheme is not javascript.\n * The URL parsing relies on the URL API in browsers that support it.\n * @param url The URL to sanitize for a SafeUrl sink.\n * @return undefined if url has a javascript: scheme, the original URL\n *     otherwise.\n */\nfunction sanitizeJavascriptUrl(url) {\n    var parsedScheme = extractScheme(url);\n    if (parsedScheme === 'javascript:') {\n        if (process.env.NODE_ENV !== 'production') {\n            console.error(\"A URL with content '\".concat(url, \"' was sanitized away.\"));\n        }\n        return undefined;\n    }\n    return url;\n}\nexports.sanitizeJavascriptUrl = sanitizeJavascriptUrl;\n/**\n * Adapter to sanitize string URLs in DOM sink wrappers.\n * @return undefined if the URL was sanitized.\n */\nfunction unwrapUrlOrSanitize(url) {\n    return sanitizeJavascriptUrl(url);\n}\nexports.unwrapUrlOrSanitize = unwrapUrlOrSanitize;\n/**\n * Sanitizes a URL restrictively.\n * This sanitizer protects against XSS and potentially other uncommon and\n * undesirable schemes that an attacker could use for e.g. phishing (tel:,\n * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by\n * the HTML sanitizer.\n */\nfunction restrictivelySanitizeUrl(url) {\n    var parsedScheme = extractScheme(url);\n    if (parsedScheme !== undefined &&\n        ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1) {\n        return url;\n    }\n    return 'about:invalid#zClosurez';\n}\nexports.restrictivelySanitizeUrl = restrictivelySanitizeUrl;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Href attribute from the given Url.\n */\nfunction setHref(anchor, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        anchor.href = sanitizedUrl;\n    }\n}\nexports.setHref = setHref;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Href attribute from the given Url.\n */\nfunction setHref(area, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        area.href = sanitizedUrl;\n    }\n}\nexports.setHref = setHref;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setFormaction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Formaction attribute from the given Url.\n */\nfunction setFormaction(button, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        button.formAction = sanitizedUrl;\n    }\n}\nexports.setFormaction = setFormaction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __read = (this && this.__read) || function (o, n) {\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n    if (!m) return o;\n    var i = m.call(o), r, ar = [], e;\n    try {\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n    }\n    catch (error) { e = { error: error }; }\n    finally {\n        try {\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\n        }\n        finally { if (e) throw e.error; }\n    }\n    return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n        if (ar || !(i in from)) {\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n            ar[i] = from[i];\n        }\n    }\n    return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setPrefixedAttribute = exports.buildPrefixedAttributeSetter = exports.insertAdjacentHtml = exports.setCssText = exports.setOuterHtml = exports.setInnerHtml = void 0;\n/**\n * @fileoverview This contains safe wrappers for properties that aren't specific\n * to one kind of HTMLElement (like innerHTML), plus other setters and functions\n * that are not tied to elements (like location.href or Worker constructor).\n */\nvar attribute_impl_1 = require(\"../../internals/attribute_impl\");\nvar html_impl_1 = require(\"../../internals/html_impl\");\nvar style_impl_1 = require(\"../../internals/style_impl\");\n/**\n * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which\n * may not be a `<script>` element or a `<style>` element.\n */\nfunction setInnerHtml(elOrRoot, v) {\n    if (isElement(elOrRoot)) {\n        throwIfScriptOrStyle(elOrRoot);\n    }\n    elOrRoot.innerHTML = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setInnerHtml = setInnerHtml;\n/**\n * Safely set {@link Element.outerHTML} for the given Element.\n */\nfunction setOuterHtml(e, v) {\n    var parent = e.parentElement;\n    if (parent !== null) {\n        throwIfScriptOrStyle(parent);\n    }\n    e.outerHTML = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setOuterHtml = setOuterHtml;\n/**\n * Set `ElementCSSInlineStyle.cssText` for the given `ElementCSSInlineStyle`.\n */\nfunction setCssText(e, v) {\n    e.style.cssText = (0, style_impl_1.unwrapStyle)(v);\n}\nexports.setCssText = setCssText;\n/**\n * Safely call {@link Element.insertAdjacentHTML} for the given Element.\n */\nfunction insertAdjacentHtml(element, position, v) {\n    var tagContext = (position === 'beforebegin' || position === 'afterend') ?\n        element.parentElement :\n        element;\n    if (tagContext !== null) {\n        throwIfScriptOrStyle(tagContext);\n    }\n    element.insertAdjacentHTML(position, (0, html_impl_1.unwrapHtml)(v));\n}\nexports.insertAdjacentHtml = insertAdjacentHtml;\n/**\n * Given a set of known-to-be-safe prefixes (e.g., \"data-\", \"aria-\", \"js\"),\n * return a setter function that allows you to set attributes on an element,\n * as long as the names of the attributes to be set has one of the prefixes.\n *\n * The returned setter ensures that setting any dangerous attribute, e.g.,\n * \"src\", \"href\" will cause an exception. This is intended to be used as the\n * safe alterantive of `Element#setAttribute`, when applications need to set\n * attributes that do not have security implications and do not have a\n * corresponding DOM property.\n */\nfunction buildPrefixedAttributeSetter(prefix) {\n    var otherPrefixes = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        otherPrefixes[_i - 1] = arguments[_i];\n    }\n    var prefixes = __spreadArray([prefix], __read(otherPrefixes), false);\n    return function (e, attr, value) {\n        setPrefixedAttribute(prefixes, e, attr, value);\n    };\n}\nexports.buildPrefixedAttributeSetter = buildPrefixedAttributeSetter;\n/**\n * The safe alternative to Element#setAttribute. The function takes a list of\n * `SafeAttributePrefix`, making developer intention explicit. The attribute\n * to be set must has one of the safe prefixes, otherwise the function throws\n * an Error.\n */\nfunction setPrefixedAttribute(attrPrefixes, e, attr, value) {\n    if (attrPrefixes.length === 0) {\n        throw new Error('No prefixes are provided');\n    }\n    var prefixes = attrPrefixes.map(function (s) { return (0, attribute_impl_1.unwrapAttributePrefix)(s); });\n    var attrLower = attr.toLowerCase();\n    if (prefixes.every(function (p) { return attrLower.indexOf(p) !== 0; })) {\n        throw new Error(\"Attribute \\\"\".concat(attr, \"\\\" does not match any of the allowed prefixes.\"));\n    }\n    e.setAttribute(attr, value);\n}\nexports.setPrefixedAttribute = setPrefixedAttribute;\nfunction throwIfScriptOrStyle(element) {\n    if (element.tagName.toLowerCase() === 'script') {\n        throw new Error('Use setTextContent with a SafeScript.');\n    }\n    else if (element.tagName.toLowerCase() === 'style') {\n        throw new Error('Use setTextContent with a SafeStyleSheet.');\n    }\n}\nfunction isElement(elOrRoot) {\n    return elOrRoot.tagName !== undefined;\n}\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrc = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/**\n * Sets the Src attribute from the given SafeUrl.\n */\nfunction setSrc(embedEl, url) {\n    embedEl.src = (0, resource_url_impl_1.unwrapResourceUrl)(url);\n}\nexports.setSrc = setSrc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setAction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Action attribute from the given Url.\n */\nfunction setAction(form, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        form.action = sanitizedUrl;\n    }\n}\nexports.setAction = setAction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrcdoc = exports.setSrc = void 0;\n/**\n * @fileoverview Safe iframe helpers and go/intents-for-iframes-for-closure\n */\nvar html_impl_1 = require(\"../../internals/html_impl\");\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Sets the Src attribute using a TrustedResourceUrl */\nfunction setSrc(iframe, v) {\n    iframe.src = (0, resource_url_impl_1.unwrapResourceUrl)(v).toString();\n}\nexports.setSrc = setSrc;\n/** Sets the Srcdoc attribute using a SafeHtml */\nfunction setSrcdoc(iframe, v) {\n    iframe.srcdoc = (0, html_impl_1.unwrapHtml)(v);\n}\nexports.setSrcdoc = setSrcdoc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setFormaction = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * Sets the Formaction attribute from the given Url.\n */\nfunction setFormaction(input, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        input.formAction = sanitizedUrl;\n    }\n}\nexports.setFormaction = setFormaction;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setHrefAndRel = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\nvar SAFE_URL_REL_VALUES = [\n    'alternate',\n    'author',\n    'bookmark',\n    'canonical',\n    'cite',\n    'help',\n    'icon',\n    'license',\n    'next',\n    'prefetch',\n    'dns-prefetch',\n    'prerender',\n    'preconnect',\n    'preload',\n    'prev',\n    'search',\n    'subresource',\n];\nfunction setHrefAndRel(link, url, rel) {\n    if (url instanceof resource_url_impl_1.TrustedResourceUrl) {\n        link.href = (0, resource_url_impl_1.unwrapResourceUrl)(url).toString();\n    }\n    else {\n        if (SAFE_URL_REL_VALUES.indexOf(rel) === -1) {\n            throw new Error(\"TrustedResourceUrl href attribute required with rel=\\\"\".concat(rel, \"\\\"\"));\n        }\n        var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n        if (sanitizedUrl === undefined) {\n            return;\n        }\n        link.href = sanitizedUrl;\n    }\n    link.rel = rel;\n}\nexports.setHrefAndRel = setHrefAndRel;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setData = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Sets the data attribute using a TrustedResourceUrl */\nfunction setData(obj, v) {\n    obj.data = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n}\nexports.setData = setData;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setSrc = exports.setTextContent = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\nvar script_impl_1 = require(\"../../internals/script_impl\");\n/** Returns CSP nonce, if set for any script tag. */\nfunction getScriptNonceFromWindow(win) {\n    var _a;\n    var doc = win.document;\n    // document.querySelector can be undefined in non-browser environments.\n    var script = (_a = doc.querySelector) === null || _a === void 0 ? void 0 : _a.call(doc, 'script[nonce]');\n    if (script) {\n        // Try to get the nonce from the IDL property first, because browsers that\n        // implement additional nonce protection features (currently only Chrome) to\n        // prevent nonce stealing via CSS do not expose the nonce via attributes.\n        // See https://github.com/whatwg/html/issues/2369\n        return script['nonce'] || script.getAttribute('nonce') || '';\n    }\n    return '';\n}\n/** Propagates CSP nonce to dynamically created scripts. */\nfunction setNonceForScriptElement(script) {\n    var win = script.ownerDocument && script.ownerDocument.defaultView;\n    var nonce = getScriptNonceFromWindow(win || window);\n    if (nonce) {\n        script.setAttribute('nonce', nonce);\n    }\n}\n/** Sets textContent from the given SafeScript. */\nfunction setTextContent(script, v) {\n    script.textContent = (0, script_impl_1.unwrapScript)(v);\n    setNonceForScriptElement(script);\n}\nexports.setTextContent = setTextContent;\n/** Sets the Src attribute using a TrustedResourceUrl */\nfunction setSrc(script, v) {\n    script.src = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n    setNonceForScriptElement(script);\n}\nexports.setSrc = setSrc;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setTextContent = void 0;\nvar style_sheet_impl_1 = require(\"../../internals/style_sheet_impl\");\n/** Safe setters for `HTMLStyleElement`s. */\nfunction setTextContent(elem, safeStyleSheet) {\n    elem.textContent = (0, style_sheet_impl_1.unwrapStyleSheet)(safeStyleSheet);\n}\nexports.setTextContent = setTextContent;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.execCommandInsertHtml = exports.execCommand = exports.write = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/**\n * write safely calls {@link Document.write} on the given {@link Document} with\n * the given {@link SafeHtml}.\n */\nfunction write(doc, text) {\n    doc.write((0, html_impl_1.unwrapHtml)(text));\n}\nexports.write = write;\n/**\n * Safely calls {@link Document.execCommand}. When command is insertHtml, a\n * SafeHtml must be passed in as value.\n */\nfunction execCommand(doc, command, value) {\n    var commandString = String(command);\n    var valueArgument = value;\n    if (commandString.toLowerCase() === 'inserthtml') {\n        valueArgument = (0, html_impl_1.unwrapHtml)(value);\n    }\n    return doc.execCommand(commandString, /* showUi= */ false, valueArgument);\n}\nexports.execCommand = execCommand;\n/**\n * Safely calls {@link Document.execCommand}('insertHtml').\n * @deprecated Use safeDocument.execCommand.\n */\nfunction execCommandInsertHtml(doc, html) {\n    return doc.execCommand('insertHTML', /* showUi= */ false, (0, html_impl_1.unwrapHtml)(html));\n}\nexports.execCommandInsertHtml = execCommandInsertHtml;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseFromString = exports.parseHtml = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/** Safely parses a string using the HTML parser. */\nfunction parseHtml(parser, html) {\n    return parseFromString(parser, html, 'text/html');\n}\nexports.parseHtml = parseHtml;\n/** Safely parses a string using the HTML or XML parser. */\nfunction parseFromString(parser, content, contentType) {\n    return parser.parseFromString((0, html_impl_1.unwrapHtml)(content), contentType);\n}\nexports.parseFromString = parseFromString;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.globalEval = void 0;\nvar script_impl_1 = require(\"../../internals/script_impl\");\n/**\n * Evaluates a SafeScript value in the given scope using eval.\n *\n * Strongly consider avoiding this, as eval blocks CSP adoption and does not\n * benefit from compiler optimizations.\n */\nfunction globalEval(win, script) {\n    var trustedScript = (0, script_impl_1.unwrapScript)(script);\n    var result = win.eval(trustedScript);\n    if (result === trustedScript) {\n        // https://crbug.com/1024786 manifesting in workers.\n        result = win.eval(trustedScript.toString());\n    }\n    return result;\n}\nexports.globalEval = globalEval;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assign = exports.replace = exports.setHref = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * setHref safely sets {@link Location.href} on the given {@link Location} with\n * given {@link Url}.\n */\nfunction setHref(loc, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        loc.href = sanitizedUrl;\n    }\n}\nexports.setHref = setHref;\n/**\n * replace safely calls {@link Location.replace} on the given {@link Location}\n * with given {@link Url}.\n */\nfunction replace(loc, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        loc.replace(sanitizedUrl);\n    }\n}\nexports.replace = replace;\n/**\n * assign safely calls {@link Location.assign} on the given {@link Location}\n * with given {@link Url}.\n */\nfunction assign(loc, url) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        loc.assign(sanitizedUrl);\n    }\n}\nexports.assign = assign;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createContextualFragment = void 0;\nvar html_impl_1 = require(\"../../internals/html_impl\");\n/** Safely creates a contextualFragment. */\nfunction createContextualFragment(range, html) {\n    return range.createContextualFragment((0, html_impl_1.unwrapHtml)(html));\n}\nexports.createContextualFragment = createContextualFragment;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.register = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/** Safely registers a service worker by URL */\nfunction register(container, scriptURL, options) {\n    return container.register((0, resource_url_impl_1.unwrapResourceUrl)(scriptURL), options);\n}\nexports.register = register;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.open = void 0;\nvar url_sanitizer_1 = require(\"../../builders/url_sanitizer\");\n/**\n * open calls {@link Window.open} on the given {@link Window}, given a\n * target {@link Url}.\n */\nfunction open(win, url, target, features) {\n    var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url);\n    if (sanitizedUrl !== undefined) {\n        return win.open(sanitizedUrl, target, features);\n    }\n    return null;\n}\nexports.open = open;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __read = (this && this.__read) || function (o, n) {\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n    if (!m) return o;\n    var i = m.call(o), r, ar = [], e;\n    try {\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n    }\n    catch (error) { e = { error: error }; }\n    finally {\n        try {\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\n        }\n        finally { if (e) throw e.error; }\n    }\n    return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n        if (ar || !(i in from)) {\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n            ar[i] = from[i];\n        }\n    }\n    return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.importScripts = exports.createShared = exports.create = void 0;\nvar resource_url_impl_1 = require(\"../../internals/resource_url_impl\");\n/**\n * Safely creates a Web Worker.\n *\n * Example usage:\n *   const trustedResourceUrl = trustedResourceUrl`/safe_script.js`;\n *   safedom.safeWorker.create(trustedResourceUrl);\n * which is a safe alternative to\n *   new Worker(url);\n * The latter can result in loading untrusted code.\n */\nfunction create(url, options) {\n    return new Worker((0, resource_url_impl_1.unwrapResourceUrl)(url), options);\n}\nexports.create = create;\n/** Safely creates a shared Web Worker. */\nfunction createShared(url, options) {\n    return new SharedWorker((0, resource_url_impl_1.unwrapResourceUrl)(url), options);\n}\nexports.createShared = createShared;\n/** Safely calls importScripts */\nfunction importScripts(scope) {\n    var urls = [];\n    for (var _i = 1; _i < arguments.length; _i++) {\n        urls[_i - 1] = arguments[_i];\n    }\n    scope.importScripts.apply(scope, __spreadArray([], __read(urls.map(function (url) { return (0, resource_url_impl_1.unwrapResourceUrl)(url); })), false));\n}\nexports.importScripts = importScripts;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    var desc = Object.getOwnPropertyDescriptor(m, k);\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n      desc = { enumerable: true, get: function() { return m[k]; } };\n    }\n    Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n    if (k2 === undefined) k2 = k;\n    o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n    o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n    if (mod && mod.__esModule) return mod;\n    var result = {};\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n    __setModuleDefault(result, mod);\n    return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeWorker = exports.safeWindow = exports.safeServiceWorkerContainer = exports.safeRange = exports.safeLocation = exports.safeGlobal = exports.safeDomParser = exports.safeDocument = exports.safeStyleEl = exports.safeScriptEl = exports.safeObjectEl = exports.safeLinkEl = exports.safeInputEl = exports.safeIframeEl = exports.safeFormEl = exports.safeEmbedEl = exports.safeElement = exports.safeButtonEl = exports.safeAreaEl = exports.safeAnchorEl = void 0;\n/**\n * @fileoverview This file re-exports all of the wrappers to ensure that we have\n * a clearly defined interface.\n */\nexports.safeAnchorEl = __importStar(require(\"./elements/anchor\"));\nexports.safeAreaEl = __importStar(require(\"./elements/area\"));\nexports.safeButtonEl = __importStar(require(\"./elements/button\"));\nexports.safeElement = __importStar(require(\"./elements/element\"));\nexports.safeEmbedEl = __importStar(require(\"./elements/embed\"));\nexports.safeFormEl = __importStar(require(\"./elements/form\"));\nexports.safeIframeEl = __importStar(require(\"./elements/iframe\"));\nexports.safeInputEl = __importStar(require(\"./elements/input\"));\nexports.safeLinkEl = __importStar(require(\"./elements/link\"));\nexports.safeObjectEl = __importStar(require(\"./elements/object\"));\nexports.safeScriptEl = __importStar(require(\"./elements/script\"));\nexports.safeStyleEl = __importStar(require(\"./elements/style\"));\nexports.safeDocument = __importStar(require(\"./globals/document\"));\nexports.safeDomParser = __importStar(require(\"./globals/dom_parser\"));\nexports.safeGlobal = __importStar(require(\"./globals/global\"));\nexports.safeLocation = __importStar(require(\"./globals/location\"));\nexports.safeRange = __importStar(require(\"./globals/range\"));\nexports.safeServiceWorkerContainer = __importStar(require(\"./globals/service_worker_container\"));\nexports.safeWindow = __importStar(require(\"./globals/window\"));\nexports.safeWorker = __importStar(require(\"./globals/worker\"));\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Ensure process.env.NODE_ENV is set even when not running under Webpack or\n * Node. Terser will strip this out of production binaries.\n */\n/*#__PURE__*/ (function () {\n    if (typeof process === 'undefined') {\n        window.process = { env: { NODE_ENV: 'development' } };\n    }\n})();\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyleSheet = exports.SafeStyleSheet = exports.isStyleSheet = exports.unwrapStyle = exports.SafeStyle = exports.isStyle = exports.unwrapScript = exports.SafeScript = exports.isScript = exports.EMPTY_SCRIPT = exports.unwrapResourceUrl = exports.TrustedResourceUrl = exports.isResourceUrl = exports.unwrapHtml = exports.SafeHtml = exports.isHtml = exports.EMPTY_HTML = exports.unwrapAttributePrefix = exports.SafeAttributePrefix = exports.safeStyleSheet = exports.concatStyleSheets = exports.safeStyle = exports.concatStyles = exports.scriptFromJson = exports.safeScriptWithArgs = exports.safeScript = exports.concatScripts = exports.trustedResourceUrl = exports.replaceFragment = exports.blobUrlFromScript = exports.appendParams = exports.HtmlSanitizerBuilder = exports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.htmlEscape = exports.createScriptSrc = exports.createScript = exports.concatHtmls = exports.safeAttrPrefix = void 0;\n/** Safe builders */\nvar attribute_builders_1 = require(\"./builders/attribute_builders\");\nObject.defineProperty(exports, \"safeAttrPrefix\", { enumerable: true, get: function () { return attribute_builders_1.safeAttrPrefix; } });\nvar html_builders_1 = require(\"./builders/html_builders\");\nObject.defineProperty(exports, \"concatHtmls\", { enumerable: true, get: function () { return html_builders_1.concatHtmls; } });\nObject.defineProperty(exports, \"createScript\", { enumerable: true, get: function () { return html_builders_1.createScript; } });\nObject.defineProperty(exports, \"createScriptSrc\", { enumerable: true, get: function () { return html_builders_1.createScriptSrc; } });\nObject.defineProperty(exports, \"htmlEscape\", { enumerable: true, get: function () { return html_builders_1.htmlEscape; } });\nvar html_sanitizer_1 = require(\"./builders/html_sanitizer/html_sanitizer\");\nObject.defineProperty(exports, \"sanitizeHtml\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtml; } });\nObject.defineProperty(exports, \"sanitizeHtmlAssertUnchanged\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlAssertUnchanged; } });\nObject.defineProperty(exports, \"sanitizeHtmlToFragment\", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlToFragment; } });\nvar html_sanitizer_builder_1 = require(\"./builders/html_sanitizer/html_sanitizer_builder\");\nObject.defineProperty(exports, \"HtmlSanitizerBuilder\", { enumerable: true, get: function () { return html_sanitizer_builder_1.HtmlSanitizerBuilder; } });\nvar resource_url_builders_1 = require(\"./builders/resource_url_builders\");\nObject.defineProperty(exports, \"appendParams\", { enumerable: true, get: function () { return resource_url_builders_1.appendParams; } });\nObject.defineProperty(exports, \"blobUrlFromScript\", { enumerable: true, get: function () { return resource_url_builders_1.blobUrlFromScript; } });\nObject.defineProperty(exports, \"replaceFragment\", { enumerable: true, get: function () { return resource_url_builders_1.replaceFragment; } });\nObject.defineProperty(exports, \"trustedResourceUrl\", { enumerable: true, get: function () { return resource_url_builders_1.trustedResourceUrl; } });\nvar script_builders_1 = require(\"./builders/script_builders\");\nObject.defineProperty(exports, \"concatScripts\", { enumerable: true, get: function () { return script_builders_1.concatScripts; } });\nObject.defineProperty(exports, \"safeScript\", { enumerable: true, get: function () { return script_builders_1.safeScript; } });\nObject.defineProperty(exports, \"safeScriptWithArgs\", { enumerable: true, get: function () { return script_builders_1.safeScriptWithArgs; } });\nObject.defineProperty(exports, \"scriptFromJson\", { enumerable: true, get: function () { return script_builders_1.scriptFromJson; } });\nvar style_builders_1 = require(\"./builders/style_builders\");\nObject.defineProperty(exports, \"concatStyles\", { enumerable: true, get: function () { return style_builders_1.concatStyles; } });\nObject.defineProperty(exports, \"safeStyle\", { enumerable: true, get: function () { return style_builders_1.safeStyle; } });\nvar style_sheet_builders_1 = require(\"./builders/style_sheet_builders\");\nObject.defineProperty(exports, \"concatStyleSheets\", { enumerable: true, get: function () { return style_sheet_builders_1.concatStyleSheets; } });\nObject.defineProperty(exports, \"safeStyleSheet\", { enumerable: true, get: function () { return style_sheet_builders_1.safeStyleSheet; } });\n/** Types, constants and unwrappers */\nvar attribute_impl_1 = require(\"./internals/attribute_impl\");\nObject.defineProperty(exports, \"SafeAttributePrefix\", { enumerable: true, get: function () { return attribute_impl_1.SafeAttributePrefix; } });\nObject.defineProperty(exports, \"unwrapAttributePrefix\", { enumerable: true, get: function () { return attribute_impl_1.unwrapAttributePrefix; } });\nvar html_impl_1 = require(\"./internals/html_impl\");\nObject.defineProperty(exports, \"EMPTY_HTML\", { enumerable: true, get: function () { return html_impl_1.EMPTY_HTML; } });\nObject.defineProperty(exports, \"isHtml\", { enumerable: true, get: function () { return html_impl_1.isHtml; } });\nObject.defineProperty(exports, \"SafeHtml\", { enumerable: true, get: function () { return html_impl_1.SafeHtml; } });\nObject.defineProperty(exports, \"unwrapHtml\", { enumerable: true, get: function () { return html_impl_1.unwrapHtml; } });\nvar resource_url_impl_1 = require(\"./internals/resource_url_impl\");\nObject.defineProperty(exports, \"isResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.isResourceUrl; } });\nObject.defineProperty(exports, \"TrustedResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.TrustedResourceUrl; } });\nObject.defineProperty(exports, \"unwrapResourceUrl\", { enumerable: true, get: function () { return resource_url_impl_1.unwrapResourceUrl; } });\nvar script_impl_1 = require(\"./internals/script_impl\");\nObject.defineProperty(exports, \"EMPTY_SCRIPT\", { enumerable: true, get: function () { return script_impl_1.EMPTY_SCRIPT; } });\nObject.defineProperty(exports, \"isScript\", { enumerable: true, get: function () { return script_impl_1.isScript; } });\nObject.defineProperty(exports, \"SafeScript\", { enumerable: true, get: function () { return script_impl_1.SafeScript; } });\nObject.defineProperty(exports, \"unwrapScript\", { enumerable: true, get: function () { return script_impl_1.unwrapScript; } });\nvar style_impl_1 = require(\"./internals/style_impl\");\nObject.defineProperty(exports, \"isStyle\", { enumerable: true, get: function () { return style_impl_1.isStyle; } });\nObject.defineProperty(exports, \"SafeStyle\", { enumerable: true, get: function () { return style_impl_1.SafeStyle; } });\nObject.defineProperty(exports, \"unwrapStyle\", { enumerable: true, get: function () { return style_impl_1.unwrapStyle; } });\nvar style_sheet_impl_1 = require(\"./internals/style_sheet_impl\");\nObject.defineProperty(exports, \"isStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.isStyleSheet; } });\nObject.defineProperty(exports, \"SafeStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.SafeStyleSheet; } });\nObject.defineProperty(exports, \"unwrapStyleSheet\", { enumerable: true, get: function () { return style_sheet_impl_1.unwrapStyleSheet; } });\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapAttributePrefix = exports.createAttributePrefix = exports.SafeAttributePrefix = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/** A prefix with which an attribute is safe to set using plain strings. */\nvar SafeAttributePrefix = /** @class */ (function () {\n    function SafeAttributePrefix() {\n    }\n    return SafeAttributePrefix;\n}());\nexports.SafeAttributePrefix = SafeAttributePrefix;\n/** Implementation for `SafeAttributePrefix` */\nvar AttributePrefixImpl = /** @class */ (function (_super) {\n    __extends(AttributePrefixImpl, _super);\n    function AttributePrefixImpl(attrPrefix, token) {\n        var _this = _super.call(this) || this;\n        if (process.env.NODE_ENV !== 'production') {\n            (0, secrets_1.ensureTokenIsValid)(token);\n        }\n        _this.privateDoNotAccessOrElseWrappedAttrPrefix = attrPrefix;\n        return _this;\n    }\n    AttributePrefixImpl.prototype.toString = function () {\n        return this.privateDoNotAccessOrElseWrappedAttrPrefix;\n    };\n    return AttributePrefixImpl;\n}(SafeAttributePrefix));\n/**\n * Builds a new `SafeAttribute` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createAttributePrefix(attrPrefix) {\n    return new AttributePrefixImpl(attrPrefix, secrets_1.secretToken);\n}\nexports.createAttributePrefix = createAttributePrefix;\n/**\n * Returns the string value of the passed `SafeAttributePrefix` object while\n * ensuring it has the correct type.\n */\nfunction unwrapAttributePrefix(value) {\n    if (value instanceof AttributePrefixImpl) {\n        return value.privateDoNotAccessOrElseWrappedAttrPrefix;\n    }\n    else {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = 'Unexpected type when unwrapping SafeAttributePrefix';\n        }\n        throw new Error(message);\n    }\n}\nexports.unwrapAttributePrefix = unwrapAttributePrefix;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapHtml = exports.isHtml = exports.EMPTY_HTML = exports.createHtml = exports.SafeHtml = void 0;\nrequire(\"../environment/dev\");\n/* g3_import_pure from './pure' */\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedHTML` in browsers that don't support it.\n */\nvar HtmlImpl = /** @class */ (function () {\n    function HtmlImpl(html, token) {\n        if (process.env.NODE_ENV !== 'production') {\n            (0, secrets_1.ensureTokenIsValid)(token);\n        }\n        this.privateDoNotAccessOrElseWrappedHtml = html;\n    }\n    HtmlImpl.prototype.toString = function () {\n        return this.privateDoNotAccessOrElseWrappedHtml.toString();\n    };\n    return HtmlImpl;\n}());\nfunction createHtmlInternal(html, trusted) {\n    return (trusted !== null && trusted !== void 0 ? trusted : new HtmlImpl(html, secrets_1.secretToken));\n}\nvar GlobalTrustedHTML = (typeof window !== undefined) ? window.TrustedHTML : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.SafeHtml = (GlobalTrustedHTML !== null && GlobalTrustedHTML !== void 0 ? GlobalTrustedHTML : HtmlImpl);\n/**\n * Builds a new `SafeHtml` from the given string, without enforcing safety\n * guarantees. It may cause side effects by creating a Trusted Types policy.\n * This shouldn't be exposed to application developers, and must only be used as\n * a step towards safe builders or safe constants.\n */\nfunction createHtml(html) {\n    var _a;\n    /** @noinline */\n    var noinlineHtml = html;\n    return createHtmlInternal(noinlineHtml, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createHTML(noinlineHtml));\n}\nexports.createHtml = createHtml;\n/**\n * An empty `SafeHtml` constant.\n * Unlike the function above, using this will not create a policy.\n */\nexports.EMPTY_HTML = \n/* #__PURE__ */ (function () { var _a; return createHtmlInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyHTML); })();\n/**\n * Checks if the given value is a `SafeHtml` instance.\n */\nfunction isHtml(value) {\n    return value instanceof exports.SafeHtml;\n}\nexports.isHtml = isHtml;\n/**\n * Returns the value of the passed `SafeHtml` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedHTML` or a string if Trusted Types are disabled.\n */\nfunction unwrapHtml(value) {\n    var _a;\n    if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isHTML(value)) {\n        return value;\n    }\n    else if (value instanceof HtmlImpl) {\n        return value.privateDoNotAccessOrElseWrappedHtml;\n    }\n    else {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = 'Unexpected type when unwrapping SafeHtml';\n        }\n        throw new Error(message);\n    }\n}\nexports.unwrapHtml = unwrapHtml;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapResourceUrl = exports.isResourceUrl = exports.createResourceUrl = exports.TrustedResourceUrl = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedScriptURL` in browsers that don't support\n * it.\n */\nvar ResourceUrlImpl = /** @class */ (function () {\n    function ResourceUrlImpl(url, token) {\n        if (process.env.NODE_ENV !== 'production') {\n            (0, secrets_1.ensureTokenIsValid)(token);\n        }\n        this.privateDoNotAccessOrElseWrappedResourceUrl = url;\n    }\n    ResourceUrlImpl.prototype.toString = function () {\n        return this.privateDoNotAccessOrElseWrappedResourceUrl.toString();\n    };\n    return ResourceUrlImpl;\n}());\nvar GlobalTrustedScriptURL = (typeof window !== undefined) ? window.TrustedScriptURL : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.TrustedResourceUrl = (GlobalTrustedScriptURL !== null && GlobalTrustedScriptURL !== void 0 ? GlobalTrustedScriptURL : ResourceUrlImpl);\n/**\n * Builds a new `TrustedResourceUrl` from the given string, without\n * enforcing safety guarantees. It may cause side effects by creating a Trusted\n * Types policy. This shouldn't be exposed to application developers, and must\n * only be used as a step towards safe builders or safe constants.\n */\nfunction createResourceUrl(url) {\n    var _a;\n    /** @noinline */\n    var noinlineUrl = url;\n    var trustedScriptURL = (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScriptURL(noinlineUrl);\n    return (trustedScriptURL !== null && trustedScriptURL !== void 0 ? trustedScriptURL : new ResourceUrlImpl(noinlineUrl, secrets_1.secretToken));\n}\nexports.createResourceUrl = createResourceUrl;\n/**\n * Checks if the given value is a `TrustedResourceUrl` instance.\n */\nfunction isResourceUrl(value) {\n    return value instanceof exports.TrustedResourceUrl;\n}\nexports.isResourceUrl = isResourceUrl;\n/**\n * Returns the value of the passed `TrustedResourceUrl` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedScriptURL` or a string if Trusted Types are\n * disabled.\n */\nfunction unwrapResourceUrl(value) {\n    var _a;\n    if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScriptURL(value)) {\n        return value;\n    }\n    else if (value instanceof ResourceUrlImpl) {\n        return value.privateDoNotAccessOrElseWrappedResourceUrl;\n    }\n    else {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = 'Unexpected type when unwrapping TrustedResourceUrl';\n        }\n        throw new Error(message);\n    }\n}\nexports.unwrapResourceUrl = unwrapResourceUrl;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapScript = exports.isScript = exports.EMPTY_SCRIPT = exports.createScript = exports.SafeScript = void 0;\nrequire(\"../environment/dev\");\n/* g3_import_pure from './pure' */\nvar secrets_1 = require(\"./secrets\");\nvar trusted_types_1 = require(\"./trusted_types\");\n/**\n * Runtime implementation of `TrustedScript` in browswers that don't support it.\n * script element.\n */\nvar ScriptImpl = /** @class */ (function () {\n    function ScriptImpl(script, token) {\n        if (process.env.NODE_ENV !== 'production') {\n            (0, secrets_1.ensureTokenIsValid)(token);\n        }\n        this.privateDoNotAccessOrElseWrappedScript = script;\n    }\n    ScriptImpl.prototype.toString = function () {\n        return this.privateDoNotAccessOrElseWrappedScript.toString();\n    };\n    return ScriptImpl;\n}());\nfunction createScriptInternal(script, trusted) {\n    return (trusted !== null && trusted !== void 0 ? trusted : new ScriptImpl(script, secrets_1.secretToken));\n}\nvar GlobalTrustedScript = (typeof window !== undefined) ? window.TrustedScript : undefined;\n/**\n * Also exports the constructor so that instanceof checks work.\n */\nexports.SafeScript = (GlobalTrustedScript !== null && GlobalTrustedScript !== void 0 ? GlobalTrustedScript : ScriptImpl);\n/**\n * Builds a new `SafeScript` from the given string, without enforcing\n * safety guarantees. It may cause side effects by creating a Trusted Types\n * policy. This shouldn't be exposed to application developers, and must only be\n * used as a step towards safe builders or safe constants.\n */\nfunction createScript(script) {\n    var _a;\n    /** @noinline */\n    var noinlineScript = script;\n    return createScriptInternal(noinlineScript, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScript(noinlineScript));\n}\nexports.createScript = createScript;\n/**\n * An empty `SafeScript` constant.\n * Unlike the functions above, using this will not create a policy.\n */\nexports.EMPTY_SCRIPT = \n/* #__PURE__ */ (function () { var _a; return createScriptInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyScript); })();\n/**\n * Checks if the given value is a `SafeScript` instance.\n */\nfunction isScript(value) {\n    return value instanceof exports.SafeScript;\n}\nexports.isScript = isScript;\n/**\n * Returns the value of the passed `SafeScript` object while ensuring it\n * has the correct type.\n *\n * Returns a native `TrustedScript` or a string if Trusted Types are disabled.\n */\nfunction unwrapScript(value) {\n    var _a;\n    if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScript(value)) {\n        return value;\n    }\n    else if (value instanceof ScriptImpl) {\n        return value.privateDoNotAccessOrElseWrappedScript;\n    }\n    else {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = 'Unexpected type when unwrapping SafeScript';\n        }\n        throw new Error(message);\n    }\n}\nexports.unwrapScript = unwrapScript;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ensureTokenIsValid = exports.secretToken = void 0;\n/**\n * A secret token that must be passed to safe type constructors. It is only\n * accessible from within safevalues, ensuring that unrestricted safe type\n * creation is only possible within safevalues. In particular, this prevents\n * forgery such as `safeHtmlValue.constructor('javascript:evil')`.\n */\nexports.secretToken = {};\n/**\n * Asserts that the given token matches the secret safevalues token. An\n * exception is thrown if that is not the case.\n */\nfunction ensureTokenIsValid(token) {\n    if (token !== exports.secretToken) {\n        throw new Error('Bad secret');\n    }\n}\nexports.ensureTokenIsValid = ensureTokenIsValid;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assertIsTemplateObject = void 0;\n/**\n * An object of type TemplateStringsArray represents the literal part(s) of a\n * template literal. This function checks if a TemplateStringsArray object is\n * actually from a template literal.\n *\n * @param templateObj This contains the literal part of the template literal.\n * @param hasExprs If true, the input template may contain embedded expressions.\n * @param errorMsg The custom error message in case any checks fail.\n */\nfunction assertIsTemplateObject(templateObj, hasExprs, errorMsg) {\n    if (!Array.isArray(templateObj) || !Array.isArray(templateObj.raw) ||\n        (!hasExprs && templateObj.length !== 1)) {\n        throw new TypeError(errorMsg);\n    }\n}\nexports.assertIsTemplateObject = assertIsTemplateObject;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyle = exports.isStyle = exports.createStyle = exports.SafeStyle = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/**\n * Sequence of CSS declarations safe to use in style contexts in an HTML\n * document or in DOM APIs.\n */\nvar SafeStyle = /** @class */ (function () {\n    function SafeStyle() {\n    }\n    return SafeStyle;\n}());\nexports.SafeStyle = SafeStyle;\n/** Implementation for `SafeStyle` */\nvar StyleImpl = /** @class */ (function (_super) {\n    __extends(StyleImpl, _super);\n    function StyleImpl(style, token) {\n        var _this = _super.call(this) || this;\n        if (process.env.NODE_ENV !== 'production') {\n            (0, secrets_1.ensureTokenIsValid)(token);\n        }\n        _this.privateDoNotAccessOrElseWrappedStyle = style;\n        return _this;\n    }\n    StyleImpl.prototype.toString = function () {\n        return this.privateDoNotAccessOrElseWrappedStyle;\n    };\n    return StyleImpl;\n}(SafeStyle));\n/**\n * Builds a new `SafeStyle` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createStyle(style) {\n    return new StyleImpl(style, secrets_1.secretToken);\n}\nexports.createStyle = createStyle;\n/**\n * Checks if the given value is a `SafeStyle` instance.\n */\nfunction isStyle(value) {\n    return value instanceof StyleImpl;\n}\nexports.isStyle = isStyle;\n/**\n * Returns the string value of the passed `SafeStyle` object while ensuring it\n * has the correct type.\n */\nfunction unwrapStyle(value) {\n    if (value instanceof StyleImpl) {\n        return value.privateDoNotAccessOrElseWrappedStyle;\n    }\n    else {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = 'Unexpected type when unwrapping SafeStyle';\n        }\n        throw new Error(message);\n    }\n}\nexports.unwrapStyle = unwrapStyle;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        if (typeof b !== \"function\" && b !== null)\n            throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unwrapStyleSheet = exports.isStyleSheet = exports.createStyleSheet = exports.SafeStyleSheet = void 0;\nrequire(\"../environment/dev\");\nvar secrets_1 = require(\"./secrets\");\n/**\n * A complete CSS style sheet, safe to use in style contexts in an HTML document\n * or DOM APIs.\n */\nvar SafeStyleSheet = /** @class */ (function () {\n    function SafeStyleSheet() {\n    }\n    return SafeStyleSheet;\n}());\nexports.SafeStyleSheet = SafeStyleSheet;\n/** Implementation for `SafeStyleSheet` */\nvar StyleSheetImpl = /** @class */ (function (_super) {\n    __extends(StyleSheetImpl, _super);\n    function StyleSheetImpl(styleSheet, token) {\n        var _this = _super.call(this) || this;\n        if (process.env.NODE_ENV !== 'production') {\n            (0, secrets_1.ensureTokenIsValid)(token);\n        }\n        _this.privateDoNotAccessOrElseWrappedStyleSheet = styleSheet;\n        return _this;\n    }\n    StyleSheetImpl.prototype.toString = function () {\n        return this.privateDoNotAccessOrElseWrappedStyleSheet;\n    };\n    return StyleSheetImpl;\n}(SafeStyleSheet));\n/**\n * Builds a new `SafeStyleSheet` from the given string, without enforcing\n * safety guarantees. This shouldn't be exposed to application developers, and\n * must only be used as a step towards safe builders or safe constants.\n */\nfunction createStyleSheet(styleSheet) {\n    return new StyleSheetImpl(styleSheet, secrets_1.secretToken);\n}\nexports.createStyleSheet = createStyleSheet;\n/**\n * Checks if the given value is a `SafeStyleSheet` instance.\n */\nfunction isStyleSheet(value) {\n    return value instanceof StyleSheetImpl;\n}\nexports.isStyleSheet = isStyleSheet;\n/**\n * Returns the string value of the passed `SafeStyleSheet` object while\n * ensuring it has the correct type.\n */\nfunction unwrapStyleSheet(value) {\n    if (value instanceof StyleSheetImpl) {\n        return value.privateDoNotAccessOrElseWrappedStyleSheet;\n    }\n    else {\n        var message = '';\n        if (process.env.NODE_ENV !== 'production') {\n            message = 'Unexpected type when unwrapping SafeStyleSheet';\n        }\n        throw new Error(message);\n    }\n}\nexports.unwrapStyleSheet = unwrapStyleSheet;\n","\"use strict\";\n/**\n * @license\n * SPDX-License-Identifier: Apache-2.0\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TEST_ONLY = exports.getTrustedTypesPolicy = exports.getTrustedTypes = void 0;\n/**\n * The name of the Trusted Types policy used by TS safevalues, or empty\n * to disable Trusted Types. This duplicates the 'google#safe', but\n * can be overridden in tests.\n */\nvar trustedTypesPolicyName = 'google#safe';\n/** Helper to retrieve the value of `window.trustedTypes`. */\nfunction trustedTypes() {\n    if (typeof window !== 'undefined') {\n        return window.trustedTypes;\n    }\n    return undefined;\n}\n/**\n * Returns window.trustedTypes if Trusted Types are enabled and supported, or\n * null otherwise.\n */\nfunction getTrustedTypes() {\n    var _a;\n    return (trustedTypesPolicyName !== '') ? ((_a = trustedTypes()) !== null && _a !== void 0 ? _a : null) : null;\n}\nexports.getTrustedTypes = getTrustedTypes;\n/**\n * The Trusted Types policy used by TS safevalues, or null if Trusted Types\n * are not enabled/supported, or undefined if the policy has not been created\n * yet.\n */\nvar trustedTypesPolicy;\n/**\n * Returns the Trusted Types policy used by TS safevalues, or null if Trusted\n * Types are not enabled/supported. The first call to this function will\n * create the policy.\n */\nfunction getTrustedTypesPolicy() {\n    var _a, _b;\n    if (trustedTypesPolicy === undefined) {\n        try {\n            trustedTypesPolicy =\n                (_b = (_a = getTrustedTypes()) === null || _a === void 0 ? void 0 : _a.createPolicy(trustedTypesPolicyName, {\n                    createHTML: function (s) { return s; },\n                    createScript: function (s) { return s; },\n                    createScriptURL: function (s) { return s; }\n                })) !== null && _b !== void 0 ? _b : null;\n        }\n        catch (_c) {\n            // In Chromium versions before 81, trustedTypes.createPolicy throws if\n            // called with a name that is already registered, even if no CSP is set.\n            // Until users have largely migrated to 81 or above, catch the error not\n            // to break the applications functionally. In such case, the code will\n            // fall back to using regular Safe Types.\n            trustedTypesPolicy = null;\n        }\n    }\n    return trustedTypesPolicy;\n}\nexports.getTrustedTypesPolicy = getTrustedTypesPolicy;\n/** Helpers for tests. */\nexports.TEST_ONLY = {\n    resetDefaults: function () {\n        trustedTypesPolicy = undefined;\n        trustedTypesPolicyName = 'google#safe';\n    },\n    setTrustedTypesPolicyName: function (name) {\n        trustedTypesPolicyName = name;\n    },\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * AnimationFrame provides a user-friendly abstraction around requesting\n * and canceling animation frames.\n */\nexport class AnimationFrame {\n  private readonly rafIDs = new Map<string, number>();\n\n  /**\n   * Requests an animation frame. Cancels any existing frame with the same key.\n   * @param {string} key The key for this callback.\n   * @param {FrameRequestCallback} callback The callback to be executed.\n   */\n  request(key: string, callback: FrameRequestCallback) {\n    this.cancel(key);\n    const frameID = requestAnimationFrame((frame) => {\n      this.rafIDs.delete(key);\n      // Callback must come *after* the key is deleted so that nested calls to\n      // request with the same key are not deleted.\n      callback(frame);\n    });\n    this.rafIDs.set(key, frameID);\n  }\n\n  /**\n   * Cancels a queued callback with the given key.\n   * @param {string} key The key for this callback.\n   */\n  cancel(key: string) {\n    const rafID = this.rafIDs.get(key);\n    if (rafID) {\n      cancelAnimationFrame(rafID);\n      this.rafIDs.delete(key);\n    }\n  }\n\n  /**\n   * Cancels all queued callback.\n   */\n  cancelAll() {\n    // Need to use forEach because it's the only iteration method supported\n    // by IE11. Suppress the underscore because we don't need it.\n    // tslint:disable-next-line:enforce-name-casing\n    this.rafIDs.forEach((_, key) => {\n      this.cancel(key);\n    });\n  }\n\n  /**\n   * Returns the queue of unexecuted callback keys.\n   */\n  getQueue(): string[] {\n    const queue: string[] = [];\n    // Need to use forEach because it's the only iteration method supported\n    // by IE11. Suppress the underscore because we don't need it.\n    // tslint:disable-next-line:enforce-name-casing\n    this.rafIDs.forEach((_, key) => {\n      queue.push(key);\n    });\n    return queue;\n  }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {safeAttrPrefix} from 'safevalues';\nimport {safeElement} from 'safevalues/dom';\n\nimport {MDCFoundation} from './foundation';\nimport {CustomEventListener, EventType, SpecificEventListener} from './types';\n\nfunction toCamelCase(str: string) {\n  // tslint:disable-next-line:enforce-name-casing\n  return String(str).replace(/\\-([a-z])/g, (_, match) => match.toUpperCase());\n}\n\n/** MDC Component base */\nexport class MDCComponent<FoundationType extends MDCFoundation> {\n  static attachTo(root: HTMLElement): MDCComponent<MDCFoundation<{}>> {\n    // Subclasses which extend MDCBase should provide an attachTo() method that\n    // takes a root element and returns an instantiated component with its root\n    // set to that element. Also note that in the cases of subclasses, an\n    // explicit foundation class will not have to be passed in; it will simply\n    // be initialized from getDefaultFoundation().\n    return new MDCComponent(root, new MDCFoundation({}));\n  }\n\n  protected foundation: FoundationType;\n\n  constructor(\n      public root: HTMLElement, foundation?: FoundationType,\n      ...args: unknown[]) {\n    this.initialize(...args);\n    // Note that we initialize foundation here and not within the constructor's\n    // default param so that this.root is defined and can be used within the\n    // foundation class.\n    this.foundation =\n        foundation === undefined ? this.getDefaultFoundation() : foundation;\n    this.foundation.init();\n    this.initialSyncWithDOM();\n  }\n\n  /* istanbul ignore next: method param only exists for typing purposes; it does\n   * not need to be unit tested */\n  // tslint:disable-next-line:enforce-name-casing\n  initialize(..._args: unknown[]) {\n    // Subclasses can override this to do any additional setup work that would\n    // be considered part of a \"constructor\". Essentially, it is a hook into the\n    // parent constructor before the foundation is initialized. Any additional\n    // arguments besides root and foundation will be passed in here.\n  }\n\n  getDefaultFoundation(): FoundationType {\n    // Subclasses must override this method to return a properly configured\n    // foundation class for the component.\n    throw new Error(\n        'Subclasses must override getDefaultFoundation to return a properly configured ' +\n        'foundation class');\n  }\n\n  initialSyncWithDOM() {\n    // Subclasses should override this method if they need to perform work to\n    // synchronize with a host DOM object. An example of this would be a form\n    // control wrapper that needs to synchronize its internal state to some\n    // property or attribute of the host DOM. Please note: this is *not* the\n    // place to perform DOM reads/writes that would cause layout / paint, as\n    // this is called synchronously from within the constructor.\n  }\n\n  destroy() {\n    // Subclasses may implement this method to release any resources /\n    // deregister any listeners they have attached. An example of this might be\n    // deregistering a resize event from the window object.\n    this.foundation.destroy();\n  }\n\n  /**\n   * Wrapper method to add an event listener to the component's root element.\n   * This is most useful when listening for custom events.\n   */\n  listen<K extends EventType>(\n      evtType: K, handler: SpecificEventListener<K>,\n      options?: AddEventListenerOptions|boolean): void;\n  listen<E extends Event>(\n      evtType: string, handler: CustomEventListener<E>,\n      options?: AddEventListenerOptions|boolean): void;\n  listen(\n      evtType: string, handler: EventListener,\n      options?: AddEventListenerOptions|boolean) {\n    this.root.addEventListener(evtType, handler, options);\n  }\n\n  /**\n   * Wrapper method to remove an event listener to the component's root element.\n   * This is most useful when unlistening for custom events.\n   */\n  unlisten<K extends EventType>(\n      evtType: K, handler: SpecificEventListener<K>,\n      options?: AddEventListenerOptions|boolean): void;\n  unlisten<E extends Event>(\n      evtType: string, handler: CustomEventListener<E>,\n      options?: AddEventListenerOptions|boolean): void;\n  unlisten(\n      evtType: string, handler: EventListener,\n      options?: AddEventListenerOptions|boolean) {\n    this.root.removeEventListener(evtType, handler, options);\n  }\n\n  /**\n   * Fires a cross-browser-compatible custom event from the component root of\n   * the given type, with the given data.\n   */\n  emit<T extends object>(evtType: string, evtData: T, shouldBubble = false) {\n    let evt: CustomEvent<T>;\n    if (typeof CustomEvent === 'function') {\n      evt = new CustomEvent<T>(evtType, {\n        bubbles: shouldBubble,\n        detail: evtData,\n      });\n    } else {\n      evt = document.createEvent('CustomEvent');\n      evt.initCustomEvent(evtType, shouldBubble, false, evtData);\n    }\n\n    this.root.dispatchEvent(evt);\n  }\n\n  /**\n   * This is a intermediate fix to allow components to use safevalues. This\n   * limits setAttribute to setting tabindex, data attributes, and aria\n   * attributes.\n   *\n   * TODO(b/263990206): remove this method and add these directly in each\n   * component. This will remove this abstraction and make it clear that the\n   * caller can't set any attribute.\n   */\n  protected safeSetAttribute(\n      element: HTMLElement,\n      attribute: string,\n      value: string,\n  ) {\n    if (attribute.toLowerCase() === 'tabindex') {\n      element.tabIndex = Number(value);\n    } else if (attribute.indexOf('data-') === 0) {\n      const dataKey = toCamelCase(attribute.replace(/^data-/, ''));\n      element.dataset[dataKey] = value;\n    } else {\n      safeElement.setPrefixedAttribute(\n          [safeAttrPrefix`aria-`, safeAttrPrefix`role`],\n          element,\n          attribute,\n          value,\n      );\n    }\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCComponent;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/** MDC Foundation */\nexport class MDCFoundation<AdapterType extends {} = {}> {\n  static get cssClasses(): {[key: string]: string} {\n    // Classes extending MDCFoundation should implement this method to return an\n    // object which exports every CSS class the foundation class needs as a\n    // property. e.g. {ACTIVE: 'mdc-component--active'}\n    return {};\n  }\n\n  static get strings(): {[key: string]: string} {\n    // Classes extending MDCFoundation should implement this method to return an\n    // object which exports all semantic strings as constants. e.g. {ARIA_ROLE:\n    // 'tablist'}\n    return {};\n  }\n\n  static get numbers(): {[key: string]: number} {\n    // Classes extending MDCFoundation should implement this method to return an\n    // object which exports all of its semantic numbers as constants.\n    // e.g. {ANIMATION_DELAY_MS: 350}\n    return {};\n  }\n\n  static get defaultAdapter(): {} {\n    // Classes extending MDCFoundation may choose to implement this getter in\n    // order to provide a convenient way of viewing the necessary methods of an\n    // adapter. In the future, this could also be used for adapter validation.\n    return {};\n  }\n\n  constructor(protected adapter: AdapterType = {} as AdapterType) {}\n\n  init() {\n    // Subclasses should override this method to perform initialization routines\n    // (registering events, etc.)\n  }\n\n  destroy() {\n    // Subclasses should override this method to perform de-initialization\n    // routines (de-registering events, etc.)\n  }\n}\n\n/**\n * The constructor for MDCFoundation.\n */\nexport interface MDCFoundationConstructor<AdapterType extends object = any> {\n  new(adapter: AdapterType): MDCFoundation<AdapterType>;\n  readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * The deprecated constructor for MDCFoundation.\n */\nexport interface MDCFoundationDeprecatedConstructor<\n    AdapterType extends object = any> {\n  readonly cssClasses: Record<string, string>;\n  readonly strings: Record<string, string>;\n  readonly numbers: Record<string, number>;\n  readonly defaultAdapter: AdapterType;\n\n  new(adapter?: Partial<AdapterType>): MDCFoundation<AdapterType>;\n  readonly prototype: MDCFoundation<AdapterType>;\n}\n\n/**\n * Retrieves the AdapaterType from the provided MDCFoundation generic type.\n */\nexport type MDCFoundationAdapter<T> =\n    T extends MDCFoundation<infer A>? A : never;\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionAttributes, MDCChipActionEvents} from './constants';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCChipActionAdapter {\n  emitEvent<D extends object>(name: MDCChipActionEvents, detail: D): void;\n\n  focus(): void;\n\n  getAttribute(attr: MDCChipActionAttributes): string|null;\n\n  getElementID(): string;\n\n  removeAttribute(attr: MDCChipActionAttributes): void;\n\n  setAttribute(attr: MDCChipActionAttributes, value: string): void;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Computes the ripple client rect for the primary action given the raw client\n * rect and the selected width graphic style property.\n */\nexport function computePrimaryActionRippleClientRect(\n    clientRect: DOMRect, graphicSelectedWidthStyleValue: string): DOMRect {\n  // parseInt is banned so we need to manually format and parse the string.\n  const graphicWidth = Number(graphicSelectedWidthStyleValue.replace('px', ''));\n  if (Number.isNaN(graphicWidth)) {\n    return clientRect;\n  }\n  // Can't use the spread operator because it has internal problems\n  return {\n    width: clientRect.width + graphicWidth,\n    height: clientRect.height,\n    top: clientRect.top,\n    right: clientRect.right,\n    bottom: clientRect.bottom,\n    left: clientRect.left\n  } as any;\n}\n\n/**\n * Provides the CSS custom property whose value is read by\n * computePrimaryRippleClientRect. The CSS custom property provides the width\n * of the chip graphic when selected. It is only set for the unselected chip\n * variant without a leadinc icon. In all other cases, it will have no value.\n */\nexport const GRAPHIC_SELECTED_WIDTH_STYLE_PROP =\n    '--mdc-chip-graphic-selected-width';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {closest} from '@material/dom/ponyfill';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\nimport {safeAttrPrefix} from 'safevalues';\nimport {safeElement} from 'safevalues/dom';\n\nimport {MDCChipActionAdapter} from './adapter';\nimport {computePrimaryActionRippleClientRect, GRAPHIC_SELECTED_WIDTH_STYLE_PROP} from './component-ripple';\nimport {MDCChipActionCssClasses, MDCChipActionFocusBehavior, MDCChipActionType} from './constants';\nimport {MDCChipActionFoundation} from './foundation';\nimport {MDCChipPrimaryActionFoundation} from './primary-foundation';\nimport {MDCChipTrailingActionFoundation} from './trailing-foundation';\n\n/**\n * MDCChipActionFactory is used by the parent MDCChip component to initialize\n * chip actions.\n */\nexport type MDCChipActionFactory =\n    (el: HTMLElement, foundation?: MDCChipActionFoundation) => MDCChipAction;\n\n\nconst ALLOWED_ATTR_PREFIXES = [\n  safeAttrPrefix`aria-`,\n  safeAttrPrefix`data-`,\n  safeAttrPrefix`disabled`,\n  safeAttrPrefix`role`,\n  safeAttrPrefix`tabindex`,\n];\n\n/**\n * MDCChipAction provides component encapsulation of the different foundation\n * implementations.\n */\nexport class MDCChipAction extends\n    MDCComponent<MDCChipActionFoundation> implements MDCRippleCapableSurface {\n  static override attachTo(root: HTMLElement): MDCChipAction {\n    return new MDCChipAction(root);\n  }\n\n  private readonly rootHTML = this.root;\n\n  // Assigned in #initialize()\n  private rippleInstance!: MDCRipple;\n  // Assigned in #initialSyncWithDOM()\n  private handleClick!: SpecificEventListener<'click'>;\n  private handleKeydown!: SpecificEventListener<'keydown'>;\n\n  get ripple(): MDCRipple {\n    return this.rippleInstance;\n  }\n\n  override initialize(\n      rippleFactory: MDCRippleFactory = (el, foundation) =>\n          new MDCRipple(el, foundation)) {\n    const rippleAdapter: MDCRippleAdapter = {\n      ...MDCRipple.createAdapter(this),\n      computeBoundingRect: () => this.computeRippleClientRect(),\n    };\n    this.rippleInstance =\n        rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n  }\n\n  override initialSyncWithDOM() {\n    this.handleClick = () => {\n      this.foundation.handleClick();\n    };\n\n    this.handleKeydown = (event: KeyboardEvent) => {\n      this.foundation.handleKeydown(event);\n    };\n\n    this.listen('click', this.handleClick);\n    this.listen('keydown', this.handleKeydown);\n  }\n\n  override destroy() {\n    this.ripple.destroy();\n    this.unlisten('click', this.handleClick);\n    this.unlisten('keydown', this.handleKeydown);\n    super.destroy();\n  }\n\n  override getDefaultFoundation() {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const adapter: MDCChipActionAdapter = {\n      emitEvent: (eventName, eventDetail) => {\n        this.emit(eventName, eventDetail, true /* shouldBubble */);\n      },\n      focus: () => {\n        this.rootHTML.focus();\n      },\n      getAttribute: (attrName) => this.root.getAttribute(attrName),\n      getElementID: () => this.root.id,\n      removeAttribute: (name) => {\n        this.root.removeAttribute(name);\n      },\n      setAttribute: (name, value) => {\n        safeElement.setPrefixedAttribute(\n            ALLOWED_ATTR_PREFIXES, this.root, name, value);\n      },\n    };\n\n    if (this.root.classList.contains(MDCChipActionCssClasses.TRAILING_ACTION)) {\n      return new MDCChipTrailingActionFoundation(adapter);\n    }\n\n    // Default to the primary foundation\n    return new MDCChipPrimaryActionFoundation(adapter);\n  }\n\n  setDisabled(isDisabled: boolean) {\n    this.foundation.setDisabled(isDisabled);\n  }\n\n  isDisabled(): boolean {\n    return this.foundation.isDisabled();\n  }\n\n  setFocus(behavior: MDCChipActionFocusBehavior) {\n    this.foundation.setFocus(behavior);\n  }\n\n  isFocusable() {\n    return this.foundation.isFocusable();\n  }\n\n  setSelected(isSelected: boolean) {\n    this.foundation.setSelected(isSelected);\n  }\n\n  isSelected(): boolean {\n    return this.foundation.isSelected();\n  }\n\n  isSelectable(): boolean {\n    return this.foundation.isSelectable();\n  }\n\n  actionType(): MDCChipActionType {\n    return this.foundation.actionType();\n  }\n\n  private computeRippleClientRect(): DOMRect {\n    if (this.root.classList.contains(MDCChipActionCssClasses.PRIMARY_ACTION)) {\n      const chipRoot =\n          closest(this.root, `.${MDCChipActionCssClasses.CHIP_ROOT}`);\n      // Return the root client rect since it's better than nothing\n      if (!chipRoot) return this.root.getBoundingClientRect();\n      const graphicWidth = window.getComputedStyle(chipRoot).getPropertyValue(\n          GRAPHIC_SELECTED_WIDTH_STYLE_PROP);\n      return computePrimaryActionRippleClientRect(\n          chipRoot.getBoundingClientRect(), graphicWidth);\n    }\n\n    return this.root.getBoundingClientRect();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * MDCChipActionCssClasses provides the classes to be queried and manipulated on\n * the root.\n */\nexport enum MDCChipActionCssClasses {\n  PRIMARY_ACTION = 'mdc-evolution-chip__action--primary',\n  TRAILING_ACTION = 'mdc-evolution-chip__action--trailing',\n  CHIP_ROOT = 'mdc-evolution-chip',\n}\n\n/**\n * MDCChipActionInteractionTrigger provides detail of the different triggers for\n * action interactions.\n */\nexport enum MDCChipActionInteractionTrigger {\n  UNSPECIFIED,  // Default type\n  CLICK,\n  BACKSPACE_KEY,\n  DELETE_KEY,\n  SPACEBAR_KEY,\n  ENTER_KEY,\n}\n\n/**\n * MDCChipActionType provides the different types of available actions.\n */\nexport enum MDCChipActionType {\n  UNSPECIFIED,  // Default type\n  PRIMARY,\n  TRAILING,\n}\n\n/**\n * MDCChipActionEvents provides the different events emitted by the action.\n */\nexport enum MDCChipActionEvents {\n  INTERACTION = 'MDCChipAction:interaction',\n  NAVIGATION = 'MDCChipAction:navigation',\n}\n\n/**\n * MDCChipActionFocusBehavior provides configurations for focusing or unfocusing\n * an action.\n */\nexport enum MDCChipActionFocusBehavior {\n  FOCUSABLE,\n  FOCUSABLE_AND_FOCUSED,\n  NOT_FOCUSABLE,\n}\n\n/**\n * MDCChipActionAttributes provides the HTML attributes used by the foundation.\n */\nexport enum MDCChipActionAttributes {\n  ARIA_DISABLED = 'aria-disabled',\n  ARIA_HIDDEN = 'aria-hidden',\n  ARIA_SELECTED = 'aria-selected',\n  DATA_DELETABLE = 'data-mdc-deletable',\n  DISABLED = 'disabled',\n  ROLE = 'role',\n  TAB_INDEX = 'tabindex',\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {isNavigationEvent, KEY, normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCChipActionAdapter} from './adapter';\nimport {MDCChipActionAttributes, MDCChipActionEvents, MDCChipActionFocusBehavior, MDCChipActionInteractionTrigger, MDCChipActionType} from './constants';\nimport {MDCChipActionInteractionEventDetail, MDCChipActionNavigationEventDetail} from './types';\n\nconst triggerMap = new Map<string, MDCChipActionInteractionTrigger>();\ntriggerMap.set(KEY.SPACEBAR, MDCChipActionInteractionTrigger.SPACEBAR_KEY);\ntriggerMap.set(KEY.ENTER, MDCChipActionInteractionTrigger.ENTER_KEY);\ntriggerMap.set(KEY.DELETE, MDCChipActionInteractionTrigger.DELETE_KEY);\ntriggerMap.set(KEY.BACKSPACE, MDCChipActionInteractionTrigger.BACKSPACE_KEY);\n\n\n/**\n * MDCChipActionFoundation provides a base abstract foundation for all chip\n * actions.\n */\nexport abstract class MDCChipActionFoundation extends\n    MDCFoundation<MDCChipActionAdapter> {\n  static override get defaultAdapter(): MDCChipActionAdapter {\n    return {\n      emitEvent: () => undefined,\n      focus: () => undefined,\n      getAttribute: () => null,\n      getElementID: () => '',\n      removeAttribute: () => undefined,\n      setAttribute: () => undefined,\n    };\n  }\n\n  constructor(adapter?: Partial<MDCChipActionAdapter>) {\n    super({...MDCChipActionFoundation.defaultAdapter, ...adapter});\n  }\n\n  handleClick() {\n    // Early exit for cases where the click comes from a source other than the\n    // user's pointer (i.e. programmatic click from AT).\n    if (this.isDisabled()) return;\n    this.emitInteraction(MDCChipActionInteractionTrigger.CLICK);\n  }\n\n  handleKeydown(event: KeyboardEvent) {\n    const key = normalizeKey(event);\n    if (this.shouldNotifyInteractionFromKey(key)) {\n      event.preventDefault();\n      this.emitInteraction(this.getTriggerFromKey(key));\n      return;\n    }\n\n    if (isNavigationEvent(event)) {\n      event.preventDefault();\n      this.emitNavigation(key);\n      return;\n    }\n\n    // signal to propagate the event since this Key isn't handled by chip\n    return true;\n  }\n\n  setDisabled(isDisabled: boolean) {\n    // Use `aria-disabled` for the selectable (listbox) disabled state\n    if (this.isSelectable()) {\n      this.adapter.setAttribute(\n          MDCChipActionAttributes.ARIA_DISABLED, `${isDisabled}`);\n      return;\n    }\n\n    if (isDisabled) {\n      this.adapter.setAttribute(MDCChipActionAttributes.DISABLED, 'true');\n    } else {\n      this.adapter.removeAttribute(MDCChipActionAttributes.DISABLED);\n    }\n  }\n\n  isDisabled(): boolean {\n    if (this.adapter.getAttribute(MDCChipActionAttributes.ARIA_DISABLED) ===\n        'true') {\n      return true;\n    }\n\n    if (this.adapter.getAttribute(MDCChipActionAttributes.DISABLED) !== null) {\n      return true;\n    }\n\n    return false;\n  }\n\n  setFocus(behavior: MDCChipActionFocusBehavior) {\n    // Early exit if not focusable\n    if (!this.isFocusable()) {\n      return;\n    }\n\n    // Add it to the tab order and give focus\n    if (behavior === MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED) {\n      this.adapter.setAttribute(MDCChipActionAttributes.TAB_INDEX, '0');\n      this.adapter.focus();\n      return;\n    }\n\n    // Add to the tab order\n    if (behavior === MDCChipActionFocusBehavior.FOCUSABLE) {\n      this.adapter.setAttribute(MDCChipActionAttributes.TAB_INDEX, '0');\n      return;\n    }\n\n    // Remove it from the tab order\n    if (behavior === MDCChipActionFocusBehavior.NOT_FOCUSABLE) {\n      this.adapter.setAttribute(MDCChipActionAttributes.TAB_INDEX, '-1');\n      return;\n    }\n  }\n\n  isFocusable() {\n    if (this.isDisabled()) {\n      return false;\n    }\n\n    if (this.adapter.getAttribute(MDCChipActionAttributes.ARIA_HIDDEN) ===\n        'true') {\n      return false;\n    }\n\n    return true;\n  }\n\n  setSelected(isSelected: boolean) {\n    // Early exit if not selectable\n    if (!this.isSelectable()) {\n      return;\n    }\n\n    this.adapter.setAttribute(\n        MDCChipActionAttributes.ARIA_SELECTED, `${isSelected}`);\n  }\n\n  isSelected(): boolean {\n    return this.adapter.getAttribute(MDCChipActionAttributes.ARIA_SELECTED) ===\n        'true';\n  }\n\n  private emitInteraction(trigger: MDCChipActionInteractionTrigger) {\n    this.adapter.emitEvent<MDCChipActionInteractionEventDetail>(\n        MDCChipActionEvents.INTERACTION, {\n          actionID: this.adapter.getElementID(),\n          source: this.actionType(),\n          trigger,\n        });\n  }\n\n  private emitNavigation(key: string) {\n    this.adapter.emitEvent<MDCChipActionNavigationEventDetail>(\n        MDCChipActionEvents.NAVIGATION, {\n          source: this.actionType(),\n          key,\n        });\n  }\n\n  private shouldNotifyInteractionFromKey(key: string): boolean {\n    const isFromActionKey = key === KEY.ENTER || key === KEY.SPACEBAR;\n    const isFromRemoveKey = key === KEY.BACKSPACE || key === KEY.DELETE;\n\n    if (isFromActionKey) {\n      return true;\n    }\n\n    if (isFromRemoveKey && this.shouldEmitInteractionOnRemoveKey()) {\n      return true;\n    }\n\n    return false;\n  }\n\n  private getTriggerFromKey(key: string): MDCChipActionInteractionTrigger {\n    const trigger = triggerMap.get(key);\n    if (trigger) {\n      return trigger;\n    }\n\n    // Default case, should ideally never be returned\n    return MDCChipActionInteractionTrigger.UNSPECIFIED;\n  }\n\n  abstract actionType(): MDCChipActionType;\n\n  abstract isSelectable(): boolean;\n\n  protected abstract shouldEmitInteractionOnRemoveKey(): boolean;\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipActionFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './primary-foundation';\nexport * from './trailing-foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionAttributes, MDCChipActionType} from './constants';\nimport {MDCChipActionFoundation} from './foundation';\n\n/**\n * MDCChipPrimaryActionFoundation provides the business logic for the primary\n * chip action.\n */\nexport class MDCChipPrimaryActionFoundation extends MDCChipActionFoundation {\n  isSelectable() {\n    return this.adapter.getAttribute(MDCChipActionAttributes.ROLE) === 'option';\n  }\n\n  actionType() {\n    return MDCChipActionType.PRIMARY;\n  }\n\n  protected shouldEmitInteractionOnRemoveKey() {\n    return this.adapter.getAttribute(MDCChipActionAttributes.DATA_DELETABLE) ===\n        'true';\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipPrimaryActionFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionType} from './constants';\nimport {MDCChipActionFoundation} from './foundation';\n\n/**\n * MDCChipTrailingActionFoundation provides the business logic for the trailing\n * chip action.\n */\nexport class MDCChipTrailingActionFoundation extends MDCChipActionFoundation {\n  isSelectable() {\n    return false;\n  }\n\n  actionType() {\n    return MDCChipActionType.TRAILING;\n  }\n\n  protected shouldEmitInteractionOnRemoveKey() {\n    return true;\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipTrailingActionFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionInteractionTrigger, MDCChipActionType} from './constants';\n\n/**\n * MDCChipActionInteractionEventDetail provides the details for the interaction\n * event.\n */\nexport interface MDCChipActionInteractionEventDetail {\n  actionID: string;\n  source: MDCChipActionType;\n  trigger: MDCChipActionInteractionTrigger;\n}\n\n/**\n * MDCChipActionNavigationEventDetail provides the details for the navigation\n * event.\n */\nexport interface MDCChipActionNavigationEventDetail {\n  source: MDCChipActionType;\n  key: string;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionFocusBehavior, MDCChipActionType} from '../action/constants';\nimport {MDCChipAnimation} from '../chip/constants';\n\nimport {MDCChipSetAttributes, MDCChipSetEvents} from './constants';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCChipSetAdapter {\n  /** Announces the message via an aria-live region */\n  announceMessage(message: string): void;\n\n  /** Emits the given event with the given detail. */\n  emitEvent<D extends object>(eventName: MDCChipSetEvents, eventDetail: D):\n      void;\n\n  /** Returns the value for the given attribute, if it exists. */\n  getAttribute(attrName: MDCChipSetAttributes): string|null;\n\n  /** Returns the actions provided by the child chip at the given index. */\n  getChipActionsAtIndex(index: number): MDCChipActionType[];\n\n  /** Returns the number of child chips. */\n  getChipCount(): number;\n\n  /** Returns the ID of the chip at the given index. */\n  getChipIdAtIndex(index: number): string;\n\n  /** Returns the index of the child chip with the matching ID. */\n  getChipIndexById(chipID: string): number;\n\n  /** Proxies to the MDCChip#isActionFocusable method. */\n  isChipFocusableAtIndex(index: number, actionType: MDCChipActionType): boolean;\n\n  /** Proxies to the MDCChip#isActionSelectable method. */\n  isChipSelectableAtIndex(index: number, actionType: MDCChipActionType):\n      boolean;\n\n  /** Proxies to the MDCChip#isActionSelected method. */\n  isChipSelectedAtIndex(index: number, actionType: MDCChipActionType): boolean;\n\n  /** Removes the chip at the given index. */\n  removeChipAtIndex(index: number): void;\n\n  /** Proxies to the MDCChip#setActionFocus method. */\n  setChipFocusAtIndex(\n      index: number, action: MDCChipActionType,\n      focus: MDCChipActionFocusBehavior): void;\n\n  /** Proxies to the MDCChip#setActionSelected method. */\n  setChipSelectedAtIndex(\n      index: number, actionType: MDCChipActionType, isSelected: boolean): void;\n\n  /** Starts the chip animation at the given index. */\n  startChipAnimationAtIndex(index: number, animation: MDCChipAnimation): void;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener} from '@material/base/types';\nimport {announce} from '@material/dom/announce';\n\nimport {MDCChipActionType} from '../action/constants';\nimport {MDCChip, MDCChipFactory} from '../chip/component';\nimport {MDCChipEvents} from '../chip/constants';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {MDCChipSetCssClasses} from './constants';\nimport {MDCChipSetFoundation} from './foundation';\nimport {ChipAnimationEvent, ChipInteractionEvent, ChipNavigationEvent} from './types';\n\n/**\n * MDCChip provides component encapsulation of the foundation implementation.\n */\nexport class MDCChipSet extends MDCComponent<MDCChipSetFoundation> {\n  static override attachTo(root: HTMLElement): MDCChipSet {\n    return new MDCChipSet(root);\n  }\n\n  // Below properties are all assigned in #initialize()\n  private handleChipAnimation!: CustomEventListener<ChipAnimationEvent>;\n  private handleChipInteraction!: CustomEventListener<ChipInteractionEvent>;\n  private handleChipNavigation!: CustomEventListener<ChipNavigationEvent>;\n  private chips!: MDCChip[];\n\n  override initialize(\n      chipFactory: MDCChipFactory = (el: HTMLElement) => new MDCChip(el)) {\n    this.chips = [];\n    const chipEls = this.root.querySelectorAll<HTMLElement>(\n        `.${MDCChipSetCssClasses.CHIP}`);\n    for (let i = 0; i < chipEls.length; i++) {\n      const chip = chipFactory(chipEls[i]);\n      this.chips.push(chip);\n    }\n  }\n\n  override initialSyncWithDOM() {\n    this.handleChipAnimation = (event) => {\n      this.foundation.handleChipAnimation(event);\n    };\n\n    this.handleChipInteraction = (event) => {\n      this.foundation.handleChipInteraction(event);\n    };\n\n    this.handleChipNavigation = (event) => {\n      this.foundation.handleChipNavigation(event);\n    };\n\n    this.listen(MDCChipEvents.ANIMATION, this.handleChipAnimation);\n    this.listen(MDCChipEvents.INTERACTION, this.handleChipInteraction);\n    this.listen(MDCChipEvents.NAVIGATION, this.handleChipNavigation);\n  }\n\n  override destroy() {\n    this.unlisten(MDCChipEvents.ANIMATION, this.handleChipAnimation);\n    this.unlisten(MDCChipEvents.INTERACTION, this.handleChipInteraction);\n    this.unlisten(MDCChipEvents.NAVIGATION, this.handleChipNavigation);\n    super.destroy();\n  }\n\n  override getDefaultFoundation() {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const adapter: MDCChipSetAdapter = {\n      announceMessage: (message) => {\n        announce(message);\n      },\n      emitEvent: (eventName, eventDetail) => {\n        this.emit(eventName, eventDetail, true /* shouldBubble */);\n      },\n      getAttribute: (attrName) => this.root.getAttribute(attrName),\n      getChipActionsAtIndex: (index) => {\n        if (!this.isIndexValid(index)) return [];\n        return this.chips[index].getActions();\n      },\n      getChipCount: () => this.chips.length,\n      getChipIdAtIndex: (index) => {\n        if (!this.isIndexValid(index)) return '';\n        return this.chips[index].getElementID();\n      },\n      getChipIndexById: (id) =>\n          this.chips.findIndex((chip) => chip.getElementID() === id),\n      isChipFocusableAtIndex: (index, action) => {\n        if (!this.isIndexValid(index)) return false;\n        return this.chips[index].isActionFocusable(action);\n      },\n      isChipSelectableAtIndex: (index, action) => {\n        if (!this.isIndexValid(index)) return false;\n        return this.chips[index].isActionSelectable(action);\n      },\n      isChipSelectedAtIndex: (index, action) => {\n        if (!this.isIndexValid(index)) return false;\n        return this.chips[index].isActionSelected(action);\n      },\n      removeChipAtIndex: (index) => {\n        if (!this.isIndexValid(index)) return;\n        this.chips[index].destroy();\n        this.chips[index].remove();\n        this.chips.splice(index, 1);\n      },\n      setChipFocusAtIndex: (index, action, focus) => {\n        if (!this.isIndexValid(index)) return;\n        this.chips[index].setActionFocus(action, focus);\n      },\n      setChipSelectedAtIndex: (index, action, selected) => {\n        if (!this.isIndexValid(index)) return;\n        this.chips[index].setActionSelected(action, selected);\n      },\n      startChipAnimationAtIndex: (index, animation) => {\n        if (!this.isIndexValid(index)) return;\n        this.chips[index].startAnimation(animation);\n      },\n    };\n\n    // Default to the primary foundation\n    return new MDCChipSetFoundation(adapter);\n  }\n\n  /** Returns the index of the chip with the given ID or -1 if none exists. */\n  getChipIndexByID(chipID: string): number {\n    return this.chips.findIndex((chip) => chip.getElementID() === chipID);\n  }\n\n  /**\n   * Returns the ID of the chip at the given index or an empty string if the\n   * index is out of bounds.\n   */\n  getChipIdAtIndex(index: number): string {\n    if (!this.isIndexValid(index)) return '';\n    return this.chips[index].getElementID();\n  }\n\n  /** Returns the unique indexes of the selected chips. */\n  getSelectedChipIndexes(): ReadonlySet<number> {\n    return this.foundation.getSelectedChipIndexes();\n  }\n\n  /** Sets the selection state of the chip. */\n  setChipSelected(\n      index: number, action: MDCChipActionType, isSelected: boolean) {\n    this.foundation.setChipSelected(index, action, isSelected);\n  }\n\n  /** Returns the selection state of the chip. */\n  isChipSelected(index: number, action: MDCChipActionType) {\n    return this.foundation.isChipSelected(index, action);\n  }\n\n  /** Animates the chip addition at the given index. */\n  addChip(index: number) {\n    this.foundation.addChip(index);\n  }\n\n  /** Removes the chip at the given index. */\n  removeChip(index: number) {\n    this.foundation.removeChip(index);\n  }\n\n  private isIndexValid(index: number): boolean {\n    return index > -1 && index < this.chips.length;\n  }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * MDCChipSetAttributes provides the named constants for attributes used by the\n * foundation.\n */\nexport enum MDCChipSetAttributes {\n  ARIA_MULTISELECTABLE = 'aria-multiselectable',\n}\n\n/**\n * MDCChipSetCssClasses provides the named constants for class names.\n */\nexport enum MDCChipSetCssClasses {\n  CHIP = 'mdc-evolution-chip',\n}\n\n/**\n * MDCChipSetEvents provides the constants for emitted events.\n */\nexport enum MDCChipSetEvents {\n  INTERACTION = 'MDCChipSet:interaction',\n  REMOVAL = 'MDCChipSet:removal',\n  SELECTION = 'MDCChipSet:selection',\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {KEY} from '@material/dom/keyboard';\n\nimport {MDCChipActionFocusBehavior, MDCChipActionType} from '../action/constants';\nimport {MDCChipAnimation} from '../chip/constants';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {MDCChipSetAttributes, MDCChipSetEvents} from './constants';\nimport {ChipAnimationEvent, ChipInteractionEvent, ChipNavigationEvent, MDCChipSetInteractionEventDetail, MDCChipSetRemovalEventDetail, MDCChipSetSelectionEventDetail} from './types';\n\ninterface FocusAction {\n  action: MDCChipActionType;\n  index: number;\n}\n\nenum Operator {\n  INCREMENT,\n  DECREMENT,\n}\n\n/**\n * MDCChipSetFoundation provides a foundation for all chips.\n */\nexport class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> {\n  static override get defaultAdapter(): MDCChipSetAdapter {\n    return {\n      announceMessage: () => undefined,\n      emitEvent: () => undefined,\n      getAttribute: () => null,\n      getChipActionsAtIndex: () => [],\n      getChipCount: () => 0,\n      getChipIdAtIndex: () => '',\n      getChipIndexById: () => 0,\n      isChipFocusableAtIndex: () => false,\n      isChipSelectableAtIndex: () => false,\n      isChipSelectedAtIndex: () => false,\n      removeChipAtIndex: () => {},\n      setChipFocusAtIndex: () => undefined,\n      setChipSelectedAtIndex: () => undefined,\n      startChipAnimationAtIndex: () => undefined,\n    };\n  }\n\n  constructor(adapter?: Partial<MDCChipSetAdapter>) {\n    super({...MDCChipSetFoundation.defaultAdapter, ...adapter});\n  }\n\n  handleChipAnimation({detail}: ChipAnimationEvent) {\n    const {\n      chipID,\n      animation,\n      isComplete,\n      addedAnnouncement,\n      removedAnnouncement\n    } = detail;\n    const index = this.adapter.getChipIndexById(chipID);\n\n    if (animation === MDCChipAnimation.EXIT && isComplete) {\n      if (removedAnnouncement) {\n        this.adapter.announceMessage(removedAnnouncement);\n      }\n      this.removeAfterAnimation(index, chipID);\n      return;\n    }\n\n    if (animation === MDCChipAnimation.ENTER && isComplete &&\n        addedAnnouncement) {\n      this.adapter.announceMessage(addedAnnouncement);\n      return;\n    }\n  }\n\n  handleChipInteraction({detail}: ChipInteractionEvent) {\n    const {source, chipID, isSelectable, isSelected, shouldRemove} = detail;\n    const index = this.adapter.getChipIndexById(chipID);\n\n    if (shouldRemove) {\n      this.removeChip(index);\n      return;\n    }\n\n    this.focusChip(index, source, MDCChipActionFocusBehavior.FOCUSABLE);\n    this.adapter.emitEvent<MDCChipSetInteractionEventDetail>(\n        MDCChipSetEvents.INTERACTION, {\n          chipIndex: index,\n          chipID,\n        });\n\n    if (isSelectable) {\n      this.setSelection(index, source, !isSelected);\n    }\n  }\n\n  handleChipNavigation({detail}: ChipNavigationEvent) {\n    const {chipID, key, isRTL, source} = detail;\n    const index = this.adapter.getChipIndexById(chipID);\n\n    const toNextChip = (key === KEY.ARROW_RIGHT && !isRTL) ||\n        (key === KEY.ARROW_LEFT && isRTL);\n    if (toNextChip) {\n      // Start from the next chip so we increment the index\n      this.focusNextChipFrom(index + 1);\n      return;\n    }\n\n    const toPreviousChip = (key === KEY.ARROW_LEFT && !isRTL) ||\n        (key === KEY.ARROW_RIGHT && isRTL);\n    if (toPreviousChip) {\n      // Start from the previous chip so we decrement the index\n      this.focusPrevChipFrom(index - 1);\n      return;\n    }\n\n    if (key === KEY.ARROW_DOWN) {\n      // Start from the next chip so we increment the index\n      this.focusNextChipFrom(index + 1, source);\n      return;\n    }\n\n    if (key === KEY.ARROW_UP) {\n      // Start from the previous chip so we decrement the index\n      this.focusPrevChipFrom(index - 1, source);\n      return;\n    }\n\n    if (key === KEY.HOME) {\n      this.focusNextChipFrom(0, source);\n      return;\n    }\n\n    if (key === KEY.END) {\n      this.focusPrevChipFrom(this.adapter.getChipCount() - 1, source);\n      return;\n    }\n  }\n\n  /** Returns the unique selected indexes of the chips. */\n  getSelectedChipIndexes(): ReadonlySet<number> {\n    const selectedIndexes = new Set<number>();\n    const chipCount = this.adapter.getChipCount();\n    for (let i = 0; i < chipCount; i++) {\n      const actions = this.adapter.getChipActionsAtIndex(i);\n      for (const action of actions) {\n        if (this.adapter.isChipSelectedAtIndex(i, action)) {\n          selectedIndexes.add(i);\n        }\n      }\n    }\n    return selectedIndexes;\n  }\n\n  /** Sets the selected state of the chip at the given index and action. */\n  setChipSelected(\n      index: number, action: MDCChipActionType, isSelected: boolean) {\n    if (this.adapter.isChipSelectableAtIndex(index, action)) {\n      this.setSelection(index, action, isSelected);\n    }\n  }\n\n  /** Returns the selected state of the chip at the given index and action. */\n  isChipSelected(index: number, action: MDCChipActionType): boolean {\n    return this.adapter.isChipSelectedAtIndex(index, action);\n  }\n\n  /** Removes the chip at the given index. */\n  removeChip(index: number) {\n    // Early exit if the index is out of bounds\n    if (index >= this.adapter.getChipCount() || index < 0) return;\n    this.adapter.startChipAnimationAtIndex(index, MDCChipAnimation.EXIT);\n    this.adapter.emitEvent<MDCChipSetRemovalEventDetail>(\n        MDCChipSetEvents.REMOVAL, {\n          chipID: this.adapter.getChipIdAtIndex(index),\n          chipIndex: index,\n          isComplete: false,\n        });\n  }\n\n  addChip(index: number) {\n    // Early exit if the index is out of bounds\n    if (index >= this.adapter.getChipCount() || index < 0) return;\n    this.adapter.startChipAnimationAtIndex(index, MDCChipAnimation.ENTER);\n  }\n\n  /**\n   * Increments to find the first focusable chip.\n   */\n  private focusNextChipFrom(\n      startIndex: number, targetAction?: MDCChipActionType) {\n    const chipCount = this.adapter.getChipCount();\n    for (let i = startIndex; i < chipCount; i++) {\n      const focusableAction =\n          this.getFocusableAction(i, Operator.INCREMENT, targetAction);\n      if (focusableAction) {\n        this.focusChip(\n            i, focusableAction,\n            MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);\n        return;\n      }\n    }\n  }\n\n  /**\n   * Decrements to find the first focusable chip. Takes an optional target\n   * action that can be used to focus the first matching focusable action.\n   */\n  private focusPrevChipFrom(\n      startIndex: number, targetAction?: MDCChipActionType) {\n    for (let i = startIndex; i > -1; i--) {\n      const focusableAction =\n          this.getFocusableAction(i, Operator.DECREMENT, targetAction);\n      if (focusableAction) {\n        this.focusChip(\n            i, focusableAction,\n            MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);\n        return;\n      }\n    }\n  }\n\n  /** Returns the appropriate focusable action, or null if none exist. */\n  private getFocusableAction(\n      index: number, op: Operator,\n      targetAction?: MDCChipActionType): MDCChipActionType|null {\n    const actions = this.adapter.getChipActionsAtIndex(index);\n    // Reverse the actions if decrementing\n    if (op === Operator.DECREMENT) actions.reverse();\n\n    if (targetAction) {\n      return this.getMatchingFocusableAction(index, actions, targetAction);\n    }\n\n    return this.getFirstFocusableAction(index, actions);\n  }\n\n  /**\n   * Returs the first focusable action, regardless of type, or null if no\n   * focusable actions exist.\n   */\n  private getFirstFocusableAction(index: number, actions: MDCChipActionType[]):\n      MDCChipActionType|null {\n    for (const action of actions) {\n      if (this.adapter.isChipFocusableAtIndex(index, action)) {\n        return action;\n      }\n    }\n    return null;\n  }\n\n  /**\n   * If the actions contain a focusable action that matches the target action,\n   * return that. Otherwise, return the first focusable action, or null if no\n   * focusable action exists.\n   */\n  private getMatchingFocusableAction(\n      index: number, actions: MDCChipActionType[],\n      targetAction: MDCChipActionType): MDCChipActionType|null {\n    let focusableAction = null;\n    for (const action of actions) {\n      if (this.adapter.isChipFocusableAtIndex(index, action)) {\n        focusableAction = action;\n      }\n\n      // Exit and return the focusable action if it matches the target\n      if (focusableAction === targetAction) {\n        return focusableAction;\n      }\n    }\n    return focusableAction;\n  }\n\n  private focusChip(\n      index: number, action: MDCChipActionType,\n      focus: MDCChipActionFocusBehavior) {\n    this.adapter.setChipFocusAtIndex(index, action, focus);\n    const chipCount = this.adapter.getChipCount();\n    for (let i = 0; i < chipCount; i++) {\n      const actions = this.adapter.getChipActionsAtIndex(i);\n      for (const chipAction of actions) {\n        // Skip the action and index provided since we set it above\n        if (chipAction === action && i === index) continue;\n        this.adapter.setChipFocusAtIndex(\n            i, chipAction, MDCChipActionFocusBehavior.NOT_FOCUSABLE);\n      }\n    }\n  }\n\n  private supportsMultiSelect(): boolean {\n    return this.adapter.getAttribute(\n               MDCChipSetAttributes.ARIA_MULTISELECTABLE) === 'true';\n  }\n\n  private setSelection(\n      index: number, action: MDCChipActionType, isSelected: boolean) {\n    this.adapter.setChipSelectedAtIndex(index, action, isSelected);\n    this.adapter.emitEvent<MDCChipSetSelectionEventDetail>(\n        MDCChipSetEvents.SELECTION, {\n          chipID: this.adapter.getChipIdAtIndex(index),\n          chipIndex: index,\n          isSelected,\n        });\n    // Early exit if we support multi-selection\n    if (this.supportsMultiSelect()) {\n      return;\n    }\n\n    // If we get here, we ony support single selection. This means we need to\n    // unselect all chips\n    const chipCount = this.adapter.getChipCount();\n    for (let i = 0; i < chipCount; i++) {\n      const actions = this.adapter.getChipActionsAtIndex(i);\n      for (const chipAction of actions) {\n        // Skip the action and index provided since we set it above\n        if (chipAction === action && i === index) continue;\n        this.adapter.setChipSelectedAtIndex(i, chipAction, false);\n      }\n    }\n  }\n\n  private removeAfterAnimation(index: number, chipID: string) {\n    this.adapter.removeChipAtIndex(index);\n    this.adapter.emitEvent<MDCChipSetRemovalEventDetail>(\n        MDCChipSetEvents.REMOVAL, {\n          chipIndex: index,\n          isComplete: true,\n          chipID,\n        });\n\n    const chipCount = this.adapter.getChipCount();\n    // Early exit if we have an empty chip set\n    if (chipCount <= 0) return;\n    this.focusNearestFocusableAction(index);\n  }\n\n  /**\n   * Find the first focusable action by moving bidirectionally horizontally\n   * from the start index.\n   *\n   * Given chip set [A, B, C, D, E, F, G]...\n   * Let's say we remove chip \"F\". We don't know where the nearest focusable\n   * action is since any of them could be disabled. The nearest focusable\n   * action could be E, it could be G, it could even be A. To find it, we\n   * start from the source index (5 for \"F\" in this case) and move out\n   * horizontally, checking each chip at each index.\n   *\n   */\n  private focusNearestFocusableAction(index: number) {\n    const chipCount = this.adapter.getChipCount();\n    let decrIndex = index;\n    let incrIndex = index;\n    while (decrIndex > -1 || incrIndex < chipCount) {\n      const focusAction = this.getNearestFocusableAction(\n          decrIndex, incrIndex, MDCChipActionType.TRAILING);\n      if (focusAction) {\n        this.focusChip(\n            focusAction.index, focusAction.action,\n            MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);\n        return;\n      }\n\n      decrIndex--;\n      incrIndex++;\n    }\n  }\n\n  private getNearestFocusableAction(\n      decrIndex: number, incrIndex: number,\n      actionType?: MDCChipActionType): FocusAction|null {\n    const decrAction =\n        this.getFocusableAction(decrIndex, Operator.DECREMENT, actionType);\n    if (decrAction) {\n      return {\n        index: decrIndex,\n        action: decrAction,\n      };\n    }\n\n    // Early exit if the incremented and decremented indices are identical\n    if (incrIndex === decrIndex) return null;\n\n    const incrAction =\n        this.getFocusableAction(incrIndex, Operator.INCREMENT, actionType);\n    if (incrAction) {\n      return {\n        index: incrIndex,\n        action: incrAction,\n      };\n    }\n\n    return null;\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipSetFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipAnimationEventDetail, MDCChipInteractionEventDetail, MDCChipNavigationEventDetail} from '../chip/types';\n\n/**\n * MDCChipSetInteractionEventDetail provides detail about the interaction event.\n */\nexport interface MDCChipSetInteractionEventDetail {\n  chipID: string;\n  chipIndex: number;\n}\n\n/**\n * MDCChipSetRemovalEventDetail provides detail about the removal event.\n */\nexport interface MDCChipSetRemovalEventDetail {\n  chipID: string;\n  chipIndex: number;\n  isComplete: boolean;\n}\n\n/**\n * MDCChipSetSelectionEventDetail provides detail about the selection event.\n */\nexport interface MDCChipSetSelectionEventDetail {\n  chipID: string;\n  chipIndex: number;\n  isSelected: boolean;\n}\n\n/**\n * ChipInteractionEvent is the custom event for the interaction event.\n */\nexport type ChipInteractionEvent = CustomEvent<MDCChipInteractionEventDetail>;\n\n/**\n * ChipNavigationEvent is the custom event for the navigation event.\n */\nexport type ChipNavigationEvent = CustomEvent<MDCChipNavigationEventDetail>;\n\n/**\n * ChipAnimationEvent is the custom event for the animation event.\n */\nexport type ChipAnimationEvent = CustomEvent<MDCChipAnimationEventDetail>;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionFocusBehavior, MDCChipActionType} from '../action/constants';\n\nimport {MDCChipAttributes, MDCChipCssClasses, MDCChipEvents} from './constants';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCChipAdapter {\n  /** Adds the given class to the root element. */\n  addClass(className: MDCChipCssClasses): void;\n\n  /** Emits the given event with the given detail. */\n  emitEvent<D extends object>(eventName: MDCChipEvents, eventDetail: D): void;\n\n  /** Returns the child actions provided by the chip. */\n  getActions(): MDCChipActionType[];\n\n  /** Returns the value for the given attribute, if it exists. */\n  getAttribute(attrName: MDCChipAttributes): string|null;\n\n  /** Returns the ID of the root element. */\n  getElementID(): string;\n\n  /** Returns the offset width of the root element. */\n  getOffsetWidth(): number;\n\n  /** Returns true if the root element has the given class. */\n  hasClass(className: MDCChipCssClasses): boolean;\n\n  /** Proxies to the MDCChipAction#isSelectable method. */\n  isActionSelectable(action: MDCChipActionType): boolean;\n\n  /** Proxies to the MDCChipAction#isSelected method. */\n  isActionSelected(action: MDCChipActionType): boolean;\n\n  /** Proxies to the MDCChipAction#isFocusable method. */\n  isActionFocusable(action: MDCChipActionType): boolean;\n\n  /** Proxies to the MDCChipAction#isDisabled method. */\n  isActionDisabled(action: MDCChipActionType): boolean;\n\n  /** Returns true if the text direction is right-to-left. */\n  isRTL(): boolean;\n\n  /** Removes the given class from the root element. */\n  removeClass(className: MDCChipCssClasses): void;\n\n  /** Proxies to the MDCChipAction#setDisabled method. */\n  setActionDisabled(action: MDCChipActionType, isDisabled: boolean): void;\n\n  /** Proxies to the MDCChipAction#setFocus method. */\n  setActionFocus(\n      action: MDCChipActionType, behavior: MDCChipActionFocusBehavior): void;\n\n  /** Proxies to the MDCChipAction#setSelected method. */\n  setActionSelected(action: MDCChipActionType, isSelected: boolean): void;\n\n  /** Sets the style property to the given value. */\n  setStyleProperty(property: string, value: string): void;\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener} from '@material/base/types';\n\nimport {MDCChipAction, MDCChipActionFactory} from '../action/component';\nimport {MDCChipActionEvents, MDCChipActionFocusBehavior, MDCChipActionType} from '../action/constants';\n\nimport {MDCChipAdapter} from './adapter';\nimport {MDCChipAnimation} from './constants';\nimport {MDCChipFoundation} from './foundation';\nimport {ActionInteractionEvent, ActionNavigationEvent} from './types';\n\n/**\n * MDCChipFactory is used by the parent MDCChipSet component to initialize\n * chips.\n */\nexport type MDCChipFactory =\n    (el: HTMLElement, foundation?: MDCChipFoundation) => MDCChip;\n\n/**\n * MDCChip provides component encapsulation of the foundation implementation.\n */\nexport class MDCChip extends MDCComponent<MDCChipFoundation> {\n  static override attachTo(root: HTMLElement): MDCChip {\n    return new MDCChip(root);\n  }\n\n  // Below properties are all assigned in #initialize()\n  private handleActionInteraction!: CustomEventListener<ActionInteractionEvent>;\n  private handleActionNavigation!: CustomEventListener<ActionNavigationEvent>;\n  private actions!: Map<MDCChipActionType, MDCChipAction>;\n\n  override initialize(\n      actionFactory:\n          MDCChipActionFactory = (el: HTMLElement) => new MDCChipAction(el)) {\n    this.actions = new Map();\n    const actionEls =\n        this.root.querySelectorAll<HTMLElement>('.mdc-evolution-chip__action');\n    for (let i = 0; i < actionEls.length; i++) {\n      const action = actionFactory(actionEls[i]);\n      this.actions.set(action.actionType(), action);\n    }\n  }\n\n  override initialSyncWithDOM() {\n    this.handleActionInteraction = (event) => {\n      this.foundation.handleActionInteraction(event);\n    };\n\n    this.handleActionNavigation = (event) => {\n      this.foundation.handleActionNavigation(event);\n    };\n\n    this.listen(MDCChipActionEvents.INTERACTION, this.handleActionInteraction);\n    this.listen(MDCChipActionEvents.NAVIGATION, this.handleActionNavigation);\n  }\n\n  override destroy() {\n    this.unlisten(\n        MDCChipActionEvents.INTERACTION, this.handleActionInteraction);\n    this.unlisten(MDCChipActionEvents.NAVIGATION, this.handleActionNavigation);\n    super.destroy();\n  }\n\n  override getDefaultFoundation() {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const adapter: MDCChipAdapter = {\n      addClass: (className) => {\n        this.root.classList.add(className);\n      },\n      emitEvent: (eventName, eventDetail) => {\n        this.emit(eventName, eventDetail, true /* shouldBubble */);\n      },\n      getActions: () => {\n        const actions: MDCChipActionType[] = [];\n        for (const [key] of this.actions) {\n          actions.push(key);\n        }\n        return actions;\n      },\n      getAttribute: (attrName) => this.root.getAttribute(attrName),\n      getElementID: () => this.root.id,\n      getOffsetWidth: () => {\n        return this.root.offsetWidth;\n      },\n      hasClass: (className) => this.root.classList.contains(className),\n      isActionSelectable: (actionType: MDCChipActionType) => {\n        const action = this.actions.get(actionType);\n        if (action) {\n          return action.isSelectable();\n        }\n        return false;\n      },\n      isActionSelected: (actionType: MDCChipActionType) => {\n        const action = this.actions.get(actionType);\n        if (action) {\n          return action.isSelected();\n        }\n        return false;\n      },\n      isActionFocusable: (actionType: MDCChipActionType) => {\n        const action = this.actions.get(actionType);\n        if (action) {\n          return action.isFocusable();\n        }\n        return false;\n      },\n      isActionDisabled: (actionType: MDCChipActionType) => {\n        const action = this.actions.get(actionType);\n        if (action) {\n          return action.isDisabled();\n        }\n        return false;\n      },\n      isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n                       'direction') === 'rtl',\n      removeClass: (className) => {\n        this.root.classList.remove(className);\n      },\n      setActionDisabled:\n          (actionType: MDCChipActionType, isDisabled: boolean) => {\n            const action = this.actions.get(actionType);\n            if (action) {\n              action.setDisabled(isDisabled);\n            }\n          },\n      setActionFocus:\n          (actionType: MDCChipActionType,\n           behavior: MDCChipActionFocusBehavior) => {\n            const action = this.actions.get(actionType);\n            if (action) {\n              action.setFocus(behavior);\n            }\n          },\n      setActionSelected:\n          (actionType: MDCChipActionType, isSelected: boolean) => {\n            const action = this.actions.get(actionType);\n            if (action) {\n              action.setSelected(isSelected);\n            }\n          },\n      setStyleProperty: (prop: string, value: string) => {\n        this.root.style.setProperty(prop, value);\n      },\n    };\n\n    // Default to the primary foundation\n    return new MDCChipFoundation(adapter);\n  }\n\n  /** Exposed to be called by the parent chip set. */\n  remove() {\n    const parent = this.root.parentNode;\n    if (parent !== null) {\n      parent.removeChild(this.root);\n    }\n  }\n\n  /** Returns the MDCChipActionTypes for the encapsulated actions. */\n  getActions(): MDCChipActionType[] {\n    return this.foundation.getActions();\n  }\n\n  /** Returns the ID of the root element. */\n  getElementID(): string {\n    return this.foundation.getElementID();\n  }\n\n  isDisabled(): boolean {\n    return this.foundation.isDisabled();\n  }\n\n  setDisabled(isDisabled: boolean) {\n    this.foundation.setDisabled(isDisabled);\n  }\n\n  /** Returns the focusability of the action. */\n  isActionFocusable(action: MDCChipActionType): boolean {\n    return this.foundation.isActionFocusable(action);\n  }\n\n  /** Returns the selectability of the action. */\n  isActionSelectable(action: MDCChipActionType): boolean {\n    return this.foundation.isActionSelectable(action);\n  }\n\n  /** Returns the selected state of the action. */\n  isActionSelected(action: MDCChipActionType): boolean {\n    return this.foundation.isActionSelected(action);\n  }\n\n  /** Sets the focus behavior of the action. */\n  setActionFocus(action: MDCChipActionType, focus: MDCChipActionFocusBehavior) {\n    this.foundation.setActionFocus(action, focus);\n  }\n\n  /** Sets the selected state of the action. */\n  setActionSelected(action: MDCChipActionType, isSelected: boolean) {\n    this.foundation.setActionSelected(action, isSelected);\n  }\n\n  /** Starts the animation on the chip. */\n  startAnimation(animation: MDCChipAnimation) {\n    this.foundation.startAnimation(animation);\n  }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * MDCChipCssClasses provides the named constants for class names.\n */\nexport enum MDCChipCssClasses {\n  SELECTING = 'mdc-evolution-chip--selecting',\n  DESELECTING = 'mdc-evolution-chip--deselecting',\n  SELECTING_WITH_PRIMARY_ICON =\n      'mdc-evolution-chip--selecting-with-primary-icon',\n  DESELECTING_WITH_PRIMARY_ICON =\n      'mdc-evolution-chip--deselecting-with-primary-icon',\n  DISABLED = 'mdc-evolution-chip--disabled',\n  ENTER = 'mdc-evolution-chip--enter',\n  EXIT = 'mdc-evolution-chip--exit',\n  SELECTED = 'mdc-evolution-chip--selected',\n  HIDDEN = 'mdc-evolution-chip--hidden',\n  WITH_PRIMARY_ICON = 'mdc-evolution-chip--with-primary-icon',\n}\n\n/**\n * MDCChipEvents provides the named constants for emitted events.\n */\nexport enum MDCChipEvents {\n  INTERACTION = 'MDCChip:interaction',\n  NAVIGATION = 'MDCChip:navigation',\n  ANIMATION = 'MDCChip:animation',\n}\n\n/**\n * MDCChipAttributes provides the named constants for strings used by the\n * foundation.\n */\nexport enum MDCChipAttributes {\n  DATA_REMOVED_ANNOUNCEMENT = 'data-mdc-removed-announcement',\n  DATA_ADDED_ANNOUNCEMENT = 'data-mdc-added-announcement',\n}\n\n/**\n * MDCChipAnimation provides the names of runnable animations.\n */\nexport enum MDCChipAnimation {\n  ENTER = 'mdc-evolution-chip-enter',\n  EXIT = 'mdc-evolution-chip-exit',\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {AnimationFrame} from '@material/animation/animationframe';\nimport {MDCFoundation} from '@material/base/foundation';\nimport {KEY} from '@material/dom/keyboard';\n\nimport {MDCChipActionFocusBehavior, MDCChipActionInteractionTrigger, MDCChipActionType} from '../action/constants';\nimport {MDCChipActionInteractionEventDetail} from '../action/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {MDCChipAnimation, MDCChipAttributes, MDCChipCssClasses, MDCChipEvents} from './constants';\nimport {ActionInteractionEvent, ActionNavigationEvent, MDCChipAnimationEventDetail, MDCChipInteractionEventDetail, MDCChipNavigationEventDetail} from './types';\n\ninterface Navigation {\n  from: MDCChipActionType;\n  to: MDCChipActionType;\n}\n\nenum Direction {\n  UNSPECIFIED,  // Default\n  LEFT,\n  RIGHT,\n}\n\nenum AnimationKeys {\n  SELECTION = 'selection',\n  EXIT = 'exit',\n}\n\n/**\n * MDCChipFoundation provides a foundation for all chips.\n */\nexport class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {\n  static override get defaultAdapter(): MDCChipAdapter {\n    return {\n      addClass: () => undefined,\n      emitEvent: () => undefined,\n      getActions: () => [],\n      getAttribute: () => null,\n      getElementID: () => '',\n      getOffsetWidth: () => 0,\n      hasClass: () => false,\n      isActionDisabled: () => false,\n      isActionFocusable: () => false,\n      isActionSelectable: () => false,\n      isActionSelected: () => false,\n      isRTL: () => false,\n      removeClass: () => undefined,\n      setActionDisabled: () => undefined,\n      setActionFocus: () => undefined,\n      setActionSelected: () => undefined,\n      setStyleProperty: () => undefined,\n    };\n  }\n\n  private readonly animFrame: AnimationFrame;\n\n  constructor(adapter?: Partial<MDCChipAdapter>) {\n    super({...MDCChipFoundation.defaultAdapter, ...adapter});\n    this.animFrame = new AnimationFrame();\n  }\n\n  override destroy() {\n    this.animFrame.cancelAll();\n  }\n\n  getElementID() {\n    return this.adapter.getElementID();\n  }\n\n  setDisabled(isDisabled: boolean) {\n    const actions = this.getActions();\n    for (const action of actions) {\n      this.adapter.setActionDisabled(action, isDisabled);\n    }\n\n    if (isDisabled) {\n      this.adapter.addClass(MDCChipCssClasses.DISABLED);\n    } else {\n      this.adapter.removeClass(MDCChipCssClasses.DISABLED);\n    }\n  }\n\n  isDisabled(): boolean {\n    const actions = this.getActions();\n    for (const action of actions) {\n      if (this.adapter.isActionDisabled(action)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  getActions(): MDCChipActionType[] {\n    return this.adapter.getActions();\n  }\n\n  isActionFocusable(action: MDCChipActionType): boolean {\n    return this.adapter.isActionFocusable(action);\n  }\n\n  isActionSelectable(action: MDCChipActionType): boolean {\n    return this.adapter.isActionSelectable(action);\n  }\n\n  isActionSelected(action: MDCChipActionType): boolean {\n    return this.adapter.isActionSelected(action);\n  }\n\n  setActionFocus(action: MDCChipActionType, focus: MDCChipActionFocusBehavior) {\n    this.adapter.setActionFocus(action, focus);\n  }\n\n  setActionSelected(action: MDCChipActionType, isSelected: boolean) {\n    this.adapter.setActionSelected(action, isSelected);\n    this.animateSelection(isSelected);\n  }\n\n  startAnimation(animation: MDCChipAnimation) {\n    if (animation === MDCChipAnimation.ENTER) {\n      this.adapter.addClass(MDCChipCssClasses.ENTER);\n      return;\n    }\n\n    if (animation === MDCChipAnimation.EXIT) {\n      this.adapter.addClass(MDCChipCssClasses.EXIT);\n      return;\n    }\n  }\n\n  handleAnimationEnd(event: AnimationEvent) {\n    const {animationName} = event;\n    if (animationName === MDCChipAnimation.ENTER) {\n      this.adapter.removeClass(MDCChipCssClasses.ENTER);\n      this.adapter.emitEvent<MDCChipAnimationEventDetail>(\n          MDCChipEvents.ANIMATION, {\n            chipID: this.getElementID(),\n            animation: MDCChipAnimation.ENTER,\n            addedAnnouncement: this.getAddedAnnouncement(),\n            isComplete: true,\n          });\n      return;\n    }\n\n    if (animationName === MDCChipAnimation.EXIT) {\n      this.adapter.removeClass(MDCChipCssClasses.EXIT);\n      this.adapter.addClass(MDCChipCssClasses.HIDDEN);\n      const width = this.adapter.getOffsetWidth();\n      this.adapter.setStyleProperty('width', `${width}px`);\n      // Wait two frames so the width gets applied correctly.\n      this.animFrame.request(AnimationKeys.EXIT, () => {\n        this.animFrame.request(AnimationKeys.EXIT, () => {\n          this.adapter.setStyleProperty('width', '0');\n        });\n      });\n    }\n  }\n\n  handleTransitionEnd() {\n    if (!this.adapter.hasClass(MDCChipCssClasses.HIDDEN)) return;\n\n    this.adapter.emitEvent<MDCChipAnimationEventDetail>(\n        MDCChipEvents.ANIMATION, {\n          chipID: this.getElementID(),\n          animation: MDCChipAnimation.EXIT,\n          removedAnnouncement: this.getRemovedAnnouncement(),\n          isComplete: true,\n        });\n  }\n\n  handleActionInteraction({detail}: ActionInteractionEvent) {\n    const {source, actionID} = detail;\n    const isSelectable = this.adapter.isActionSelectable(source);\n    const isSelected = this.adapter.isActionSelected(source);\n\n    this.adapter.emitEvent<MDCChipInteractionEventDetail>(\n        MDCChipEvents.INTERACTION, {\n          chipID: this.getElementID(),\n          shouldRemove: this.shouldRemove(detail),\n          actionID,\n          isSelectable,\n          isSelected,\n          source,\n        });\n  }\n\n  handleActionNavigation({detail}: ActionNavigationEvent) {\n    const {source, key} = detail;\n    const isRTL = this.adapter.isRTL();\n    const isTrailingActionFocusable =\n        this.adapter.isActionFocusable(MDCChipActionType.TRAILING);\n    const isPrimaryActionFocusable =\n        this.adapter.isActionFocusable(MDCChipActionType.PRIMARY);\n    const dir = this.directionFromKey(key, isRTL);\n\n    const shouldNavigateToTrailing = source === MDCChipActionType.PRIMARY &&\n        dir === Direction.RIGHT && isTrailingActionFocusable;\n\n    const shouldNavigateToPrimary = source === MDCChipActionType.TRAILING &&\n        dir === Direction.LEFT && isPrimaryActionFocusable;\n\n    if (shouldNavigateToTrailing) {\n      this.navigateActions({from: source, to: MDCChipActionType.TRAILING});\n      return;\n    }\n\n    if (shouldNavigateToPrimary) {\n      this.navigateActions({from: source, to: MDCChipActionType.PRIMARY});\n      return;\n    }\n\n    this.adapter.emitEvent<MDCChipNavigationEventDetail>(\n        MDCChipEvents.NAVIGATION, {\n          chipID: this.getElementID(),\n          isRTL,\n          source,\n          key,\n        });\n  }\n\n  private directionFromKey(key: string, isRTL: boolean): Direction {\n    const isLeftKey = key === KEY.ARROW_LEFT;\n    const isRightKey = key === KEY.ARROW_RIGHT;\n    if (!isRTL && isLeftKey || isRTL && isRightKey) {\n      return Direction.LEFT;\n    }\n\n    if (!isRTL && isRightKey || isRTL && isLeftKey) {\n      return Direction.RIGHT;\n    }\n\n    return Direction.UNSPECIFIED;\n  }\n\n  private navigateActions(nav: Navigation) {\n    this.adapter.setActionFocus(\n        nav.from, MDCChipActionFocusBehavior.NOT_FOCUSABLE);\n    this.adapter.setActionFocus(\n        nav.to, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED);\n  }\n\n  private shouldRemove({source, trigger}: MDCChipActionInteractionEventDetail):\n      boolean {\n    if (trigger === MDCChipActionInteractionTrigger.BACKSPACE_KEY ||\n        trigger === MDCChipActionInteractionTrigger.DELETE_KEY) {\n      return true;\n    }\n\n    return source === MDCChipActionType.TRAILING;\n  }\n\n  private getRemovedAnnouncement(): string|undefined {\n    const msg =\n        this.adapter.getAttribute(MDCChipAttributes.DATA_REMOVED_ANNOUNCEMENT);\n    return msg || undefined;\n  }\n\n  private getAddedAnnouncement(): string|undefined {\n    const msg =\n        this.adapter.getAttribute(MDCChipAttributes.DATA_ADDED_ANNOUNCEMENT);\n    return msg || undefined;\n  }\n\n  private animateSelection(isSelected: boolean) {\n    this.resetAnimationStyles();\n    // Wait two frames to ensure the animation classes are unset\n    this.animFrame.request(AnimationKeys.SELECTION, () => {\n      this.animFrame.request(AnimationKeys.SELECTION, () => {\n        this.updateSelectionStyles(isSelected);\n      });\n    });\n  }\n\n  private resetAnimationStyles() {\n    this.adapter.removeClass(MDCChipCssClasses.SELECTING);\n    this.adapter.removeClass(MDCChipCssClasses.DESELECTING);\n    this.adapter.removeClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON);\n    this.adapter.removeClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON);\n  }\n\n  private updateSelectionStyles(isSelected: boolean) {\n    const hasIcon = this.adapter.hasClass(MDCChipCssClasses.WITH_PRIMARY_ICON);\n    if (hasIcon && isSelected) {\n      this.adapter.addClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON);\n      this.animFrame.request(AnimationKeys.SELECTION, () => {\n        this.adapter.addClass(MDCChipCssClasses.SELECTED);\n      });\n      return;\n    }\n\n    if (hasIcon && !isSelected) {\n      this.adapter.addClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON);\n      this.animFrame.request(AnimationKeys.SELECTION, () => {\n        this.adapter.removeClass(MDCChipCssClasses.SELECTED);\n      });\n      return;\n    }\n\n    if (isSelected) {\n      this.adapter.addClass(MDCChipCssClasses.SELECTING);\n      this.animFrame.request(AnimationKeys.SELECTION, () => {\n        this.adapter.addClass(MDCChipCssClasses.SELECTED);\n      });\n      return;\n    }\n\n    if (!isSelected) {\n      this.adapter.addClass(MDCChipCssClasses.DESELECTING);\n      this.animFrame.request(AnimationKeys.SELECTION, () => {\n        this.adapter.removeClass(MDCChipCssClasses.SELECTED);\n      });\n      return;\n    }\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './constants';\nexport * from './foundation';\nexport * from './types';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCChipActionType} from '../action/constants';\nimport {MDCChipActionInteractionEventDetail, MDCChipActionNavigationEventDetail} from '../action/types';\n\nimport {MDCChipAnimation} from './constants';\n\n/** MDCChipInteractionEventDetail provides details for the interaction event. */\nexport interface MDCChipInteractionEventDetail {\n  actionID: string;\n  chipID: string;\n  source: MDCChipActionType;\n  shouldRemove: boolean;\n  isSelectable: boolean;\n  isSelected: boolean;\n}\n\n/** MDCChipNavigationEventDetail provides details for the navigation event. */\nexport interface MDCChipNavigationEventDetail {\n  chipID: string;\n  source: MDCChipActionType;\n  key: string;\n  isRTL: boolean;\n}\n\n/**\n * MDCChipAnimationEventDetail provides details for the animation event.\n */\nexport interface MDCChipAnimationEventDetail {\n  chipID: string;\n  animation: MDCChipAnimation;\n  isComplete: boolean;\n  addedAnnouncement?: string;\n  removedAnnouncement?: string;\n}\n\n/**\n * MDCChipActionInteractionEvent is the custom event for the interaction event.\n */\nexport type ActionInteractionEvent =\n    CustomEvent<MDCChipActionInteractionEventDetail>;\n\n/**\n * MDCChipActionInteractionEvent is the custom event for the interaction event.\n */\nexport type ActionNavigationEvent =\n    CustomEvent<MDCChipActionNavigationEventDetail>;\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCChipSetAdapter {\n  /**\n   * @return true if the root element contains the given class name.\n   */\n  hasClass(className: string): boolean;\n\n  /**\n   * Removes the chip with the given index from the chip set.\n   * Make sure to remove it from the chip list, too.\n   */\n  removeChipAtIndex(index: number): void;\n\n  /**\n   * Sets the selected state of the chip at the given index.\n   */\n  selectChipAtIndex(\n      index: number, isSelected: boolean, shouldNotifyClients: boolean): void;\n\n  /**\n   * Returns the index of the chip at the given ID.\n   * @param chipId the unique ID of the chip\n   * @return the numerical index of the chip with the matching id or -1.\n   */\n  getIndexOfChipById(chipId: string): number;\n\n  /**\n   * Calls Chip#focusPrimaryAction() on the chip at the given index.\n   * @param index the index of the chip\n   */\n  focusChipPrimaryActionAtIndex(index: number): void;\n\n  /**\n   * Calls Chip#focusTrailingAction() on the chip at the given index.\n   * @param index the index of the chip\n   */\n  focusChipTrailingActionAtIndex(index: number): void;\n\n  /**\n   * Removes focus from the chip at the given index.\n   * @param index the index of the chip\n   */\n  removeFocusFromChipAtIndex(index: number): void;\n\n  /**\n   * @return true if the text direction is RTL.\n   */\n  isRTL(): boolean;\n\n  /**\n   * @return the number of chips in the chip set.\n   */\n  getChipListCount(): number;\n\n  /**\n   * Announces the message via an aria-live region.\n   */\n  announceMessage(message: string): void;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {announce} from '@material/dom/announce';\n\nimport {MDCChip, MDCChipFactory} from '../chip/component';\nimport {MDCChipFoundation} from '../chip/foundation';\nimport {MDCChipInteractionEvent, MDCChipNavigationEvent, MDCChipRemovalEvent, MDCChipSelectionEvent} from '../chip/types';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {MDCChipSetFoundation} from './foundation';\n\nconst {INTERACTION_EVENT, SELECTION_EVENT, REMOVAL_EVENT, NAVIGATION_EVENT} =\n    MDCChipFoundation.strings;\nconst {CHIP_SELECTOR} = MDCChipSetFoundation.strings;\n\nlet idCounter = 0;\n\n/** MDC Chip Set */\nexport class MDCChipSet extends MDCComponent<MDCChipSetFoundation> {\n  static override attachTo(root: HTMLElement) {\n    return new MDCChipSet(root);\n  }\n\n  get chips(): readonly MDCChip[] {\n    return this.chipsList.slice();\n  }\n\n  /**\n   * @return An array of the IDs of all selected chips.\n   */\n  get selectedChipIds(): readonly string[] {\n    return this.foundation.getSelectedChipIds();\n  }\n\n  private chipsList!: MDCChip[];  // assigned in initialize()\n  private chipFactory!:\n      (el: HTMLElement) => MDCChip;  // assigned in initialize()\n  private handleChipInteraction!: (evt: MDCChipInteractionEvent) =>\n      void;  // assigned in initialSyncWithDOM()\n  private handleChipSelection!:\n      (evt: MDCChipSelectionEvent) => void;  // assigned in initialSyncWithDOM()\n  private handleChipRemoval!:\n      (evt: MDCChipRemovalEvent) => void;  // assigned in initialSyncWithDOM()\n  private handleChipNavigation!: (evt: MDCChipNavigationEvent) =>\n      void;  // assigned in initialSyncWithDOM()\n\n  /**\n   * @param chipFactory A function which creates a new MDCChip.\n   */\n  override initialize(chipFactory: MDCChipFactory = (el) => new MDCChip(el)) {\n    this.chipFactory = chipFactory;\n    this.chipsList = this.instantiateChips(this.chipFactory);\n  }\n\n  override initialSyncWithDOM() {\n    for (const chip of this.chipsList) {\n      if (chip.id && chip.selected) {\n        this.foundation.select(chip.id);\n      }\n    }\n\n    this.handleChipInteraction = (evt) => {\n      this.foundation.handleChipInteraction(evt.detail);\n    };\n    this.handleChipSelection = (evt) => {\n      this.foundation.handleChipSelection(evt.detail);\n    };\n    this.handleChipRemoval = (evt) => {\n      this.foundation.handleChipRemoval(evt.detail);\n    };\n    this.handleChipNavigation = (evt) => {\n      this.foundation.handleChipNavigation(evt.detail);\n    };\n    this.listen(INTERACTION_EVENT, this.handleChipInteraction);\n    this.listen(SELECTION_EVENT, this.handleChipSelection);\n    this.listen(REMOVAL_EVENT, this.handleChipRemoval);\n    this.listen(NAVIGATION_EVENT, this.handleChipNavigation);\n  }\n\n  override destroy() {\n    for (const chip of this.chipsList) {\n      chip.destroy();\n    }\n\n    this.unlisten(INTERACTION_EVENT, this.handleChipInteraction);\n    this.unlisten(SELECTION_EVENT, this.handleChipSelection);\n    this.unlisten(REMOVAL_EVENT, this.handleChipRemoval);\n    this.unlisten(NAVIGATION_EVENT, this.handleChipNavigation);\n\n    super.destroy();\n  }\n\n  /**\n   * Adds a new chip object to the chip set from the given chip element.\n   */\n  addChip(chipEl: HTMLElement) {\n    chipEl.id = chipEl.id || `mdc-chip-${++idCounter}`;\n    this.chipsList.push(this.chipFactory(chipEl));\n  }\n\n  override getDefaultFoundation() {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const adapter: MDCChipSetAdapter = {\n      announceMessage: (message) => {\n        announce(message);\n      },\n      focusChipPrimaryActionAtIndex: (index) => {\n        this.chipsList[index].focusPrimaryAction();\n      },\n      focusChipTrailingActionAtIndex: (index) => {\n        this.chipsList[index].focusTrailingAction();\n      },\n      getChipListCount: () => this.chips.length,\n      getIndexOfChipById: (chipId) => {\n        return this.findChipIndex(chipId);\n      },\n      hasClass: (className) => this.root.classList.contains(className),\n      isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n                       'direction') === 'rtl',\n      removeChipAtIndex: (index) => {\n        if (index >= 0 && index < this.chips.length) {\n          this.chipsList[index].destroy();\n          this.chipsList[index].remove();\n          this.chipsList.splice(index, 1);\n        }\n      },\n      removeFocusFromChipAtIndex: (index) => {\n        this.chipsList[index].removeFocus();\n      },\n      selectChipAtIndex: (index, selected, shouldNotifyClients) => {\n        if (index >= 0 && index < this.chips.length) {\n          this.chipsList[index].setSelectedFromChipSet(\n              selected, shouldNotifyClients);\n        }\n      },\n    };\n    return new MDCChipSetFoundation(adapter);\n  }\n\n  /**\n   * Instantiates chip components on all of the chip set's child chip elements.\n   */\n  private instantiateChips(chipFactory: MDCChipFactory): MDCChip[] {\n    const chipElements =\n        Array.from(this.root.querySelectorAll<HTMLElement>(CHIP_SELECTOR));\n    return chipElements.map((el) => {\n      el.id = el.id || `mdc-chip-${++idCounter}`;\n      return chipFactory(el);\n    });\n  }\n\n  /**\n   * Returns the index of the chip with the given id, or -1 if the chip does not\n   * exist.\n   */\n  private findChipIndex(chipId: string): number {\n    for (let i = 0; i < this.chips.length; i++) {\n      if (this.chipsList[i].id === chipId) {\n        return i;\n      }\n    }\n    return -1;\n  }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const strings = {\n  CHIP_SELECTOR: '.mdc-chip',\n};\n\nexport const cssClasses = {\n  CHOICE: 'mdc-chip-set--choice',\n  FILTER: 'mdc-chip-set--filter',\n};\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {Direction, EventSource, jumpChipKeys, navigationKeys, strings as chipStrings} from '../chip/constants';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from '../chip/types';\n\nimport {MDCChipSetAdapter} from './adapter';\nimport {cssClasses, strings} from './constants';\n\n/** MDC Chip Set Foundation */\nexport class MDCChipSetFoundation extends MDCFoundation<MDCChipSetAdapter> {\n  static override get strings() {\n    return strings;\n  }\n\n  static override get cssClasses() {\n    return cssClasses;\n  }\n\n  static override get defaultAdapter(): MDCChipSetAdapter {\n    return {\n      announceMessage: () => undefined,\n      focusChipPrimaryActionAtIndex: () => undefined,\n      focusChipTrailingActionAtIndex: () => undefined,\n      getChipListCount: () => -1,\n      getIndexOfChipById: () => -1,\n      hasClass: () => false,\n      isRTL: () => false,\n      removeChipAtIndex: () => undefined,\n      removeFocusFromChipAtIndex: () => undefined,\n      selectChipAtIndex: () => undefined,\n    };\n  }\n\n  /**\n   * The ids of the selected chips in the set. Only used for choice chip set or\n   * filter chip set.\n   */\n  private selectedChipIds: string[] = [];\n\n  constructor(adapter?: Partial<MDCChipSetAdapter>) {\n    super({...MDCChipSetFoundation.defaultAdapter, ...adapter});\n  }\n\n  /**\n   * Returns an array of the IDs of all selected chips.\n   */\n  getSelectedChipIds(): readonly string[] {\n    return this.selectedChipIds.slice();\n  }\n\n  /**\n   * Selects the chip with the given id. Deselects all other chips if the chip\n   * set is of the choice variant. Does not notify clients of the updated\n   * selection state.\n   */\n  select(chipId: string) {\n    this.selectImpl(chipId, false);\n  }\n\n  /**\n   * Handles a chip interaction event\n   */\n  handleChipInteraction({chipId}: MDCChipInteractionEventDetail) {\n    const index = this.adapter.getIndexOfChipById(chipId);\n    this.removeFocusFromChipsExcept(index);\n    if (this.adapter.hasClass(cssClasses.CHOICE) ||\n        this.adapter.hasClass(cssClasses.FILTER)) {\n      this.toggleSelect(chipId);\n    }\n  }\n\n  /**\n   * Handles a chip selection event, used to handle discrepancy when selection\n   * state is set directly on the Chip.\n   */\n  handleChipSelection({chipId, selected, shouldIgnore}:\n                          MDCChipSelectionEventDetail) {\n    // Early exit if we should ignore the event\n    if (shouldIgnore) {\n      return;\n    }\n\n    const chipIsSelected = this.selectedChipIds.indexOf(chipId) >= 0;\n    if (selected && !chipIsSelected) {\n      this.select(chipId);\n    } else if (!selected && chipIsSelected) {\n      this.deselectImpl(chipId);\n    }\n  }\n\n  /**\n   * Handles the event when a chip is removed.\n   */\n  handleChipRemoval({chipId, removedAnnouncement}: MDCChipRemovalEventDetail) {\n    if (removedAnnouncement) {\n      this.adapter.announceMessage(removedAnnouncement);\n    }\n\n    const index = this.adapter.getIndexOfChipById(chipId);\n    this.deselectAndNotifyClients(chipId);\n    this.adapter.removeChipAtIndex(index);\n    const maxIndex = this.adapter.getChipListCount() - 1;\n    if (maxIndex < 0) {\n      return;\n    }\n    const nextIndex = Math.min(index, maxIndex);\n    this.removeFocusFromChipsExcept(nextIndex);\n    // After removing a chip, we should focus the trailing action for the next\n    // chip.\n    this.adapter.focusChipTrailingActionAtIndex(nextIndex);\n  }\n\n  /**\n   * Handles a chip navigation event.\n   */\n  handleChipNavigation({chipId, key, source}: MDCChipNavigationEventDetail) {\n    const maxIndex = this.adapter.getChipListCount() - 1;\n    let index = this.adapter.getIndexOfChipById(chipId);\n    // Early exit if the index is out of range or the key is unusable\n    if (index === -1 || !navigationKeys.has(key)) {\n      return;\n    }\n\n    const isRTL = this.adapter.isRTL();\n    const isLeftKey = key === chipStrings.ARROW_LEFT_KEY ||\n        key === chipStrings.IE_ARROW_LEFT_KEY;\n    const isRightKey = key === chipStrings.ARROW_RIGHT_KEY ||\n        key === chipStrings.IE_ARROW_RIGHT_KEY;\n    const isDownKey = key === chipStrings.ARROW_DOWN_KEY ||\n        key === chipStrings.IE_ARROW_DOWN_KEY;\n    const shouldIncrement =\n        !isRTL && isRightKey || isRTL && isLeftKey || isDownKey;\n    const isHome = key === chipStrings.HOME_KEY;\n    const isEnd = key === chipStrings.END_KEY;\n    if (shouldIncrement) {\n      index++;\n    } else if (isHome) {\n      index = 0;\n    } else if (isEnd) {\n      index = maxIndex;\n    } else {\n      index--;\n    }\n\n    // Early exit if the index is out of bounds\n    if (index < 0 || index > maxIndex) {\n      return;\n    }\n\n    this.removeFocusFromChipsExcept(index);\n    this.focusChipAction(index, key, source);\n  }\n\n  private focusChipAction(index: number, key: string, source: EventSource) {\n    const shouldJumpChips = jumpChipKeys.has(key);\n    if (shouldJumpChips && source === EventSource.PRIMARY) {\n      this.adapter.focusChipPrimaryActionAtIndex(index);\n      return;\n    }\n\n    if (shouldJumpChips && source === EventSource.TRAILING) {\n      this.adapter.focusChipTrailingActionAtIndex(index);\n      return;\n    }\n\n    const dir = this.getDirection(key);\n    if (dir === Direction.LEFT) {\n      this.adapter.focusChipTrailingActionAtIndex(index);\n      return;\n    }\n\n    if (dir === Direction.RIGHT) {\n      this.adapter.focusChipPrimaryActionAtIndex(index);\n      return;\n    }\n  }\n\n  private getDirection(key: string): Direction {\n    const isRTL = this.adapter.isRTL();\n    const isLeftKey = key === chipStrings.ARROW_LEFT_KEY ||\n        key === chipStrings.IE_ARROW_LEFT_KEY;\n    const isRightKey = key === chipStrings.ARROW_RIGHT_KEY ||\n        key === chipStrings.IE_ARROW_RIGHT_KEY;\n    if (!isRTL && isLeftKey || isRTL && isRightKey) {\n      return Direction.LEFT;\n    }\n\n    return Direction.RIGHT;\n  }\n\n  /**\n   * Deselects the chip with the given id and optionally notifies clients.\n   */\n  private deselectImpl(chipId: string, shouldNotifyClients = false) {\n    const index = this.selectedChipIds.indexOf(chipId);\n    if (index >= 0) {\n      this.selectedChipIds.splice(index, 1);\n      const chipIndex = this.adapter.getIndexOfChipById(chipId);\n      this.adapter.selectChipAtIndex(\n          chipIndex, /** isSelected */ false, shouldNotifyClients);\n    }\n  }\n\n  /**\n   * Deselects the chip with the given id and notifies clients.\n   */\n  private deselectAndNotifyClients(chipId: string) {\n    this.deselectImpl(chipId, true);\n  }\n\n  /**\n   * Toggles selection of the chip with the given id.\n   */\n  private toggleSelect(chipId: string) {\n    if (this.selectedChipIds.indexOf(chipId) >= 0) {\n      this.deselectAndNotifyClients(chipId);\n    } else {\n      this.selectAndNotifyClients(chipId);\n    }\n  }\n\n  private removeFocusFromChipsExcept(index: number) {\n    const chipCount = this.adapter.getChipListCount();\n    for (let i = 0; i < chipCount; i++) {\n      if (i !== index) {\n        this.adapter.removeFocusFromChipAtIndex(i);\n      }\n    }\n  }\n\n  private selectAndNotifyClients(chipId: string) {\n    this.selectImpl(chipId, true);\n  }\n\n  private selectImpl(chipId: string, shouldNotifyClients: boolean) {\n    if (this.selectedChipIds.indexOf(chipId) >= 0) {\n      return;\n    }\n\n    if (this.adapter.hasClass(cssClasses.CHOICE) &&\n        this.selectedChipIds.length > 0) {\n      const previouslySelectedChip = this.selectedChipIds[0];\n      const previouslySelectedIndex =\n          this.adapter.getIndexOfChipById(previouslySelectedChip);\n      this.selectedChipIds = [];\n      this.adapter.selectChipAtIndex(\n          previouslySelectedIndex, /** isSelected */ false,\n          shouldNotifyClients);\n    }\n    this.selectedChipIds.push(chipId);\n    const index = this.adapter.getIndexOfChipById(chipId);\n    this.adapter.selectChipAtIndex(\n        index, /** isSelected */ true, shouldNotifyClients);\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipSetFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport {cssClasses as chipSetCssClasses, strings as chipSetStrings} from './constants';\n","/**\n * @license\n * Copyright 2017 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {EventSource} from './constants';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCChipAdapter {\n  /**\n   * Adds a class to the root element.\n   */\n  addClass(className: string): void;\n\n  /**\n   * Removes a class from the root element.\n   */\n  removeClass(className: string): void;\n\n  /**\n   * @return true if the root element contains the given class.\n   */\n  hasClass(className: string): boolean;\n\n  /**\n   * Adds a class to the leading icon element.\n   */\n  addClassToLeadingIcon(className: string): void;\n\n  /**\n   * Removes a class from the leading icon element.\n   */\n  removeClassFromLeadingIcon(className: string): void;\n\n  /**\n   * @return true if target has className, false otherwise.\n   */\n  eventTargetHasClass(target: EventTarget|null, className: string): boolean;\n\n  /**\n   * @return the attribute string value if present, otherwise null\n   */\n  getAttribute(attr: string): string|null;\n\n  /**\n   * Emits a custom \"MDCChip:interaction\" event denoting the chip has been\n   * interacted with (typically on click or keydown).\n   */\n  notifyInteraction(): void;\n\n  /**\n   * Emits a custom \"MDCChip:selection\" event denoting the chip has been\n   * selected or deselected.\n   */\n  notifySelection(selected: boolean, chipSetShouldIgnore: boolean): void;\n\n  /**\n   * Emits a custom \"MDCChip:trailingIconInteraction\" event denoting the\n   * trailing icon has been interacted with (typically on click or keydown).\n   */\n  notifyTrailingIconInteraction(): void;\n\n  /**\n   * Emits a custom event \"MDCChip:removal\" denoting the chip will be removed.\n   */\n  notifyRemoval(removedAnnouncement: string|null): void;\n\n  /**\n   * Emits a custom event \"MDCChip:navigation\" denoting a focus navigation\n   * event.\n   */\n  notifyNavigation(key: string, source: EventSource): void;\n\n  /**\n   * Emits when editing starts.\n   */\n  notifyEditStart(): void;\n\n  /**\n   * Emits when editing finishes.\n   */\n  notifyEditFinish(): void;\n\n  /**\n   * @return The computed property value of the given style property on the root\n   *     element.\n   */\n  getComputedStyleValue(propertyName: string): string;\n\n  /**\n   * Sets the property value of the given style property on the root element.\n   */\n  setStyleProperty(propertyName: string, value: string): void;\n\n  /**\n   * @return Whether the chip has a leading icon.\n   */\n  hasLeadingIcon(): boolean;\n\n  /**\n   * @return The bounding client rect of the root element.\n   */\n  getRootBoundingClientRect(): DOMRect;\n\n  /**\n   * @return The bounding client rect of the checkmark element or null if it\n   *     doesn't exist.\n   */\n  getCheckmarkBoundingClientRect(): DOMRect|null;\n\n  /**\n   * Sets the value of the attribute on the primary action content.\n   */\n  setPrimaryActionAttr(attr: string, value: string): void;\n\n  /**\n   * Gives focus to the primary action.\n   */\n  focusPrimaryAction(): void;\n\n  /**\n   * Sets focus to the trailing action.\n   */\n  focusTrailingAction(): void;\n\n  /**\n   * Removes focus from the trailing action.\n   */\n  removeTrailingActionFocus(): void;\n\n  /**\n   * Returns true if the trailing action is navigable.\n   * Should return the value of MDCChipTrailingAction#isNavigable() or false.\n   */\n  isTrailingActionNavigable(): boolean;\n\n  /**\n   * @return true if the text direction is right-to-left.\n   */\n  isRTL(): boolean;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {CustomEventListener, SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCChipTrailingAction, MDCChipTrailingActionFactory} from '../trailingaction/component';\nimport {strings as trailingActionStrings} from '../trailingaction/constants';\nimport {MDCChipTrailingActionInteractionEvent, MDCChipTrailingActionNavigationEvent} from '../trailingaction/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipFoundation} from './foundation';\nimport {MDCChipInteractionEventDetail, MDCChipNavigationEventDetail, MDCChipRemovalEventDetail, MDCChipSelectionEventDetail} from './types';\n\n/** MDC Chip Factory */\nexport type MDCChipFactory =\n    (el: HTMLElement, foundation?: MDCChipFoundation) => MDCChip;\n\n/** MDC Chip */\nexport class MDCChip extends MDCComponent<MDCChipFoundation> implements\n    MDCRippleCapableSurface {\n  /**\n   * @return Whether the chip is selected.\n   */\n  get selected(): boolean {\n    return this.foundation.isSelected();\n  }\n\n  /**\n   * Sets selected state on the chip.\n   */\n  set selected(selected: boolean) {\n    this.foundation.setSelected(selected);\n  }\n\n  /**\n   * @return Whether a trailing icon click should trigger exit/removal of the\n   *     chip.\n   */\n  get shouldRemoveOnTrailingIconClick(): boolean {\n    return this.foundation.getShouldRemoveOnTrailingIconClick();\n  }\n\n  /**\n   * Sets whether a trailing icon click should trigger exit/removal of the chip.\n   */\n  set shouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n    this.foundation.setShouldRemoveOnTrailingIconClick(shouldRemove);\n  }\n\n  /**\n   * Sets whether a clicking on the chip should focus the primary action.\n   */\n  set setShouldFocusPrimaryActionOnClick(shouldFocus: boolean) {\n    this.foundation.setShouldFocusPrimaryActionOnClick(shouldFocus);\n  }\n\n  get ripple(): MDCRipple {\n    return this.rippleSurface;\n  }\n\n  get id(): string {\n    return this.root.id;\n  }\n\n  static override attachTo(root: HTMLElement) {\n    return new MDCChip(root);\n  }\n\n  private leadingIcon!: HTMLElement|null;    // assigned in initialize()\n  private checkmark!: HTMLElement|null;      // assigned in initialize()\n  private primaryAction!: HTMLElement|null;  // assigned in initialize()\n  private trailingAction!: MDCChipTrailingAction|\n      null;                           // assigned in initialize()\n  private rippleSurface!: MDCRipple;  // assigned in initialize()\n\n  private handleTrailingActionInteraction!: CustomEventListener<\n      MDCChipTrailingActionInteractionEvent>;  // assigned in\n                                               // initialSyncWithDOM()\n  private handleTrailingActionNavigation!: CustomEventListener<\n      MDCChipTrailingActionNavigationEvent>;  // assigned in\n                                              // initialSyncWithDOM()\n  private handleTransitionEnd!:\n      SpecificEventListener<'transitionend'>;  // assigned in\n                                               // initialSyncWithDOM()\n  private handleClick!:\n      SpecificEventListener<'click'>;  // assigned in initialSyncWithDOM()\n  private handleKeydown!:\n      SpecificEventListener<'keydown'>;  // assigned in initialSyncWithDOM()\n  private handleFocusIn!:\n      SpecificEventListener<'focusin'>;  // assigned in initialSyncWIthDOM()\n  private handleFocusOut!:\n      SpecificEventListener<'focusout'>;  // assigned in initialSyncWIthDOM()\n\n  override initialize(\n      rippleFactory:\n          MDCRippleFactory = (el, foundation) => new MDCRipple(el, foundation),\n      trailingActionFactory:\n          MDCChipTrailingActionFactory = (el) => new MDCChipTrailingAction(el),\n  ) {\n    this.leadingIcon =\n        this.root.querySelector<HTMLElement>(strings.LEADING_ICON_SELECTOR);\n    this.checkmark =\n        this.root.querySelector<HTMLElement>(strings.CHECKMARK_SELECTOR);\n    this.primaryAction =\n        this.root.querySelector<HTMLElement>(strings.PRIMARY_ACTION_SELECTOR);\n\n    const trailingActionEl =\n        this.root.querySelector<HTMLElement>(strings.TRAILING_ACTION_SELECTOR);\n\n    if (trailingActionEl) {\n      this.trailingAction = trailingActionFactory(trailingActionEl);\n    }\n\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const rippleAdapter: MDCRippleAdapter = {\n      ...MDCRipple.createAdapter(this),\n      computeBoundingRect: () => this.foundation.getDimensions(),\n    };\n    this.rippleSurface =\n        rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n  }\n\n  override initialSyncWithDOM() {\n    // Custom events\n    this.handleTrailingActionInteraction = () => {\n      this.foundation.handleTrailingActionInteraction();\n    };\n    this.handleTrailingActionNavigation =\n        (evt: MDCChipTrailingActionNavigationEvent) => {\n          this.foundation.handleTrailingActionNavigation(evt);\n        };\n    // Native events\n    this.handleClick = () => {\n      this.foundation.handleClick();\n    };\n    this.handleKeydown = (evt: KeyboardEvent) => {\n      this.foundation.handleKeydown(evt);\n    };\n    this.handleTransitionEnd = (evt: TransitionEvent) => {\n      this.foundation.handleTransitionEnd(evt);\n    };\n    this.handleFocusIn = (evt: FocusEvent) => {\n      this.foundation.handleFocusIn(evt);\n    };\n    this.handleFocusOut = (evt: FocusEvent) => {\n      this.foundation.handleFocusOut(evt);\n    };\n\n\n    this.listen('transitionend', this.handleTransitionEnd);\n    this.listen('click', this.handleClick);\n    this.listen('keydown', this.handleKeydown);\n    this.listen('focusin', this.handleFocusIn);\n    this.listen('focusout', this.handleFocusOut);\n\n    if (this.trailingAction) {\n      this.listen(\n          trailingActionStrings.INTERACTION_EVENT,\n          this.handleTrailingActionInteraction);\n      this.listen(\n          trailingActionStrings.NAVIGATION_EVENT,\n          this.handleTrailingActionNavigation);\n    }\n  }\n\n  override destroy() {\n    this.rippleSurface.destroy();\n\n    this.unlisten('transitionend', this.handleTransitionEnd);\n    this.unlisten('keydown', this.handleKeydown);\n    this.unlisten('click', this.handleClick);\n    this.unlisten('focusin', this.handleFocusIn);\n    this.unlisten('focusout', this.handleFocusOut);\n\n    if (this.trailingAction) {\n      this.unlisten(\n          trailingActionStrings.INTERACTION_EVENT,\n          this.handleTrailingActionInteraction);\n      this.unlisten(\n          trailingActionStrings.NAVIGATION_EVENT,\n          this.handleTrailingActionNavigation);\n    }\n\n    super.destroy();\n  }\n\n  /**\n   * Begins the exit animation which leads to removal of the chip.\n   */\n  beginExit() {\n    this.foundation.beginExit();\n  }\n\n  override getDefaultFoundation() {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const adapter: MDCChipAdapter = {\n      addClass: (className) => {\n        this.root.classList.add(className);\n      },\n      addClassToLeadingIcon: (className) => {\n        if (this.leadingIcon) {\n          this.leadingIcon.classList.add(className);\n        }\n      },\n      eventTargetHasClass: (target, className) =>\n          target ? (target as Element).classList.contains(className) : false,\n      focusPrimaryAction: () => {\n        if (this.primaryAction) {\n          this.primaryAction.focus();\n        }\n      },\n      focusTrailingAction: () => {\n        if (this.trailingAction) {\n          this.trailingAction.focus();\n        }\n      },\n      getAttribute: (attr) => this.root.getAttribute(attr),\n      getCheckmarkBoundingClientRect: () =>\n          this.checkmark ? this.checkmark.getBoundingClientRect() : null,\n      getComputedStyleValue: (propertyName) =>\n          window.getComputedStyle(this.root).getPropertyValue(propertyName),\n      getRootBoundingClientRect: () => this.root.getBoundingClientRect(),\n      hasClass: (className) => this.root.classList.contains(className),\n      hasLeadingIcon: () => !!this.leadingIcon,\n      isRTL: () => window.getComputedStyle(this.root).getPropertyValue(\n                       'direction') === 'rtl',\n      isTrailingActionNavigable: () => {\n        if (this.trailingAction) {\n          return this.trailingAction.isNavigable();\n        }\n        return false;\n      },\n      notifyInteraction: () => {\n        this.emit<MDCChipInteractionEventDetail>(\n            strings.INTERACTION_EVENT, {chipId: this.id},\n            true /* shouldBubble */);\n      },\n      notifyNavigation: (key, source) => {\n        this.emit<MDCChipNavigationEventDetail>(\n            strings.NAVIGATION_EVENT, {chipId: this.id, key, source},\n            true /* shouldBubble */);\n      },\n      notifyRemoval: (removedAnnouncement) => {\n        this.emit<MDCChipRemovalEventDetail>(\n            strings.REMOVAL_EVENT, {chipId: this.id, removedAnnouncement},\n            true /* shouldBubble */);\n      },\n      notifySelection: (selected, shouldIgnore) => {\n        this.emit<MDCChipSelectionEventDetail>(\n            strings.SELECTION_EVENT, {chipId: this.id, selected, shouldIgnore},\n            true /* shouldBubble */);\n      },\n      notifyTrailingIconInteraction: () => {\n        this.emit<MDCChipInteractionEventDetail>(\n            strings.TRAILING_ICON_INTERACTION_EVENT, {chipId: this.id},\n            true /* shouldBubble */);\n      },\n      notifyEditStart: () => {/* Not Implemented. */},\n      notifyEditFinish: () => {/* Not Implemented. */},\n      removeClass: (className) => {\n        this.root.classList.remove(className);\n      },\n      removeClassFromLeadingIcon: (className) => {\n        if (this.leadingIcon) {\n          this.leadingIcon.classList.remove(className);\n        }\n      },\n      removeTrailingActionFocus: () => {\n        if (this.trailingAction) {\n          this.trailingAction.removeFocus();\n        }\n      },\n      setPrimaryActionAttr: (attr, value) => {\n        if (this.primaryAction) {\n          this.safeSetAttribute(this.primaryAction, attr, value);\n        }\n      },\n      setStyleProperty: (propertyName, value) => {\n        this.root.style.setProperty(propertyName, value);\n      },\n    };\n    return new MDCChipFoundation(adapter);\n  }\n\n  setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n    this.foundation.setSelectedFromChipSet(selected, shouldNotifyClients);\n  }\n\n  focusPrimaryAction() {\n    this.foundation.focusPrimaryAction();\n  }\n\n  focusTrailingAction() {\n    this.foundation.focusTrailingAction();\n  }\n\n  removeFocus() {\n    this.foundation.removeFocus();\n  }\n\n  remove() {\n    const parent = this.root.parentNode;\n    if (parent !== null) {\n      parent.removeChild(this.root);\n    }\n  }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum Direction {\n  LEFT = 'left',\n  RIGHT = 'right',\n}\n\nexport enum EventSource {\n  PRIMARY = 'primary',\n  TRAILING = 'trailing',\n  NONE = 'none',\n}\n\nexport const strings = {\n  ADDED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-added-announcement',\n  ARIA_CHECKED: 'aria-checked',\n  ARROW_DOWN_KEY: 'ArrowDown',\n  ARROW_LEFT_KEY: 'ArrowLeft',\n  ARROW_RIGHT_KEY: 'ArrowRight',\n  ARROW_UP_KEY: 'ArrowUp',\n  BACKSPACE_KEY: 'Backspace',\n  CHECKMARK_SELECTOR: '.mdc-chip__checkmark',\n  DELETE_KEY: 'Delete',\n  END_KEY: 'End',\n  ENTER_KEY: 'Enter',\n  ENTRY_ANIMATION_NAME: 'mdc-chip-entry',\n  HOME_KEY: 'Home',\n  IE_ARROW_DOWN_KEY: 'Down',\n  IE_ARROW_LEFT_KEY: 'Left',\n  IE_ARROW_RIGHT_KEY: 'Right',\n  IE_ARROW_UP_KEY: 'Up',\n  IE_DELETE_KEY: 'Del',\n  INTERACTION_EVENT: 'MDCChip:interaction',\n  LEADING_ICON_SELECTOR: '.mdc-chip__icon--leading',\n  NAVIGATION_EVENT: 'MDCChip:navigation',\n  PRIMARY_ACTION_SELECTOR: '.mdc-chip__primary-action',\n  REMOVED_ANNOUNCEMENT_ATTRIBUTE: 'data-mdc-chip-removed-announcement',\n  REMOVAL_EVENT: 'MDCChip:removal',\n  SELECTION_EVENT: 'MDCChip:selection',\n  SPACEBAR_KEY: ' ',\n  TAB_INDEX: 'tabindex',\n  TRAILING_ACTION_SELECTOR: '.mdc-chip-trailing-action',\n  TRAILING_ICON_INTERACTION_EVENT: 'MDCChip:trailingIconInteraction',\n  TRAILING_ICON_SELECTOR: '.mdc-chip__icon--trailing',\n};\n\nexport const cssClasses = {\n  CHECKMARK: 'mdc-chip__checkmark',\n  CHIP_EXIT: 'mdc-chip--exit',\n  DELETABLE: 'mdc-chip--deletable',\n  EDITABLE: 'mdc-chip--editable',\n  EDITING: 'mdc-chip--editing',\n  HIDDEN_LEADING_ICON: 'mdc-chip__icon--leading-hidden',\n  LEADING_ICON: 'mdc-chip__icon--leading',\n  PRIMARY_ACTION: 'mdc-chip__primary-action',\n  PRIMARY_ACTION_FOCUSED: 'mdc-chip--primary-action-focused',\n  SELECTED: 'mdc-chip--selected',\n  TEXT: 'mdc-chip__text',\n  TRAILING_ACTION: 'mdc-chip__trailing-action',\n  TRAILING_ICON: 'mdc-chip__icon--trailing',\n};\n\nexport const navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand\nnavigationKeys.add(strings.ARROW_LEFT_KEY);\nnavigationKeys.add(strings.ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.ARROW_DOWN_KEY);\nnavigationKeys.add(strings.ARROW_UP_KEY);\nnavigationKeys.add(strings.END_KEY);\nnavigationKeys.add(strings.HOME_KEY);\nnavigationKeys.add(strings.IE_ARROW_LEFT_KEY);\nnavigationKeys.add(strings.IE_ARROW_RIGHT_KEY);\nnavigationKeys.add(strings.IE_ARROW_DOWN_KEY);\nnavigationKeys.add(strings.IE_ARROW_UP_KEY);\n\nexport const jumpChipKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand\njumpChipKeys.add(strings.ARROW_UP_KEY);\njumpChipKeys.add(strings.ARROW_DOWN_KEY);\njumpChipKeys.add(strings.HOME_KEY);\njumpChipKeys.add(strings.END_KEY);\njumpChipKeys.add(strings.IE_ARROW_UP_KEY);\njumpChipKeys.add(strings.IE_ARROW_DOWN_KEY);\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCChipTrailingActionNavigationEvent} from '../trailingaction/types';\n\nimport {MDCChipAdapter} from './adapter';\nimport {cssClasses, Direction, EventSource, jumpChipKeys, navigationKeys, strings} from './constants';\n\nconst emptyClientRect = {\n  bottom: 0,\n  height: 0,\n  left: 0,\n  right: 0,\n  top: 0,\n  width: 0,\n} as any;\n\nenum FocusBehavior {\n  SHOULD_FOCUS,\n  SHOULD_NOT_FOCUS,\n}\n\n/** MDC Chip Foundation */\nexport class MDCChipFoundation extends MDCFoundation<MDCChipAdapter> {\n  static override get strings() {\n    return strings;\n  }\n\n  static override get cssClasses() {\n    return cssClasses;\n  }\n\n  static override get defaultAdapter(): MDCChipAdapter {\n    return {\n      addClass: () => undefined,\n      addClassToLeadingIcon: () => undefined,\n      eventTargetHasClass: () => false,\n      focusPrimaryAction: () => undefined,\n      focusTrailingAction: () => undefined,\n      getAttribute: () => null,\n      getCheckmarkBoundingClientRect: () => emptyClientRect,\n      getComputedStyleValue: () => '',\n      getRootBoundingClientRect: () => emptyClientRect,\n      hasClass: () => false,\n      hasLeadingIcon: () => false,\n      isRTL: () => false,\n      isTrailingActionNavigable: () => false,\n      notifyEditFinish: () => undefined,\n      notifyEditStart: () => undefined,\n      notifyInteraction: () => undefined,\n      notifyNavigation: () => undefined,\n      notifyRemoval: () => undefined,\n      notifySelection: () => undefined,\n      notifyTrailingIconInteraction: () => undefined,\n      removeClass: () => undefined,\n      removeClassFromLeadingIcon: () => undefined,\n      removeTrailingActionFocus: () => undefined,\n      setPrimaryActionAttr: () => undefined,\n      setStyleProperty: () => undefined,\n    };\n  }\n\n  /**\n   * Whether a trailing icon click should immediately trigger exit/removal of\n   * the chip.\n   */\n  private shouldRemoveOnTrailingIconClick = true;\n\n  /**\n   * Whether the primary action should receive focus on click. Should only be\n   * set to true for clients who programmatically give focus to a different\n   * element on the page when a chip is clicked (like a menu).\n   */\n  private shouldFocusPrimaryActionOnClick = true;\n\n  constructor(adapter?: Partial<MDCChipAdapter>) {\n    super({...MDCChipFoundation.defaultAdapter, ...adapter});\n  }\n\n  isSelected() {\n    return this.adapter.hasClass(cssClasses.SELECTED);\n  }\n\n  isEditable() {\n    return this.adapter.hasClass(cssClasses.EDITABLE);\n  }\n\n  isEditing() {\n    return this.adapter.hasClass(cssClasses.EDITING);\n  }\n\n  setSelected(selected: boolean) {\n    this.setSelectedImpl(selected);\n    this.notifySelection(selected);\n  }\n\n  setSelectedFromChipSet(selected: boolean, shouldNotifyClients: boolean) {\n    this.setSelectedImpl(selected);\n    if (shouldNotifyClients) {\n      this.notifyIgnoredSelection(selected);\n    }\n  }\n\n  getShouldRemoveOnTrailingIconClick() {\n    return this.shouldRemoveOnTrailingIconClick;\n  }\n\n  setShouldRemoveOnTrailingIconClick(shouldRemove: boolean) {\n    this.shouldRemoveOnTrailingIconClick = shouldRemove;\n  }\n\n  setShouldFocusPrimaryActionOnClick(shouldFocus: boolean) {\n    this.shouldFocusPrimaryActionOnClick = shouldFocus;\n  }\n\n  getDimensions(): DOMRect {\n    const getRootRect = () => this.adapter.getRootBoundingClientRect();\n    const getCheckmarkRect = () =>\n        this.adapter.getCheckmarkBoundingClientRect();\n\n    // When a chip has a checkmark and not a leading icon, the bounding rect\n    // changes in size depending on the current size of the checkmark.\n    if (!this.adapter.hasLeadingIcon()) {\n      const checkmarkRect = getCheckmarkRect();\n      if (checkmarkRect) {\n        const rootRect = getRootRect();\n        // Checkmark is a square, meaning the client rect's width and height are\n        // identical once the animation completes. However, the checkbox is\n        // initially hidden by setting the width to 0. To account for an initial\n        // width of 0, we use the checkbox's height instead (which equals the\n        // end-state width) when adding it to the root client rect's width.\n        return {\n          bottom: rootRect.bottom,\n          height: rootRect.height,\n          left: rootRect.left,\n          right: rootRect.right,\n          top: rootRect.top,\n          width: rootRect.width + checkmarkRect.height,\n        } as any;\n      }\n    }\n\n    return getRootRect();\n  }\n\n  /**\n   * Begins the exit animation which leads to removal of the chip.\n   */\n  beginExit() {\n    this.adapter.addClass(cssClasses.CHIP_EXIT);\n  }\n\n  handleClick() {\n    this.adapter.notifyInteraction();\n    this.setPrimaryActionFocusable(this.getFocusBehavior());\n  }\n\n  handleDoubleClick() {\n    if (this.isEditable()) {\n      this.startEditing();\n    }\n  }\n\n  /**\n   * Handles a transition end event on the root element.\n   */\n  handleTransitionEnd(evt: TransitionEvent) {\n    // Handle transition end event on the chip when it is about to be removed.\n    const shouldHandle =\n        this.adapter.eventTargetHasClass(evt.target, cssClasses.CHIP_EXIT);\n    const widthIsAnimating = evt.propertyName === 'width';\n    const opacityIsAnimating = evt.propertyName === 'opacity';\n\n    if (shouldHandle && opacityIsAnimating) {\n      // See:\n      // https://css-tricks.com/using-css-transitions-auto-dimensions/#article-header-id-5\n      const chipWidth = this.adapter.getComputedStyleValue('width');\n\n      // On the next frame (once we get the computed width), explicitly set the\n      // chip's width to its current pixel width, so we aren't transitioning out\n      // of 'auto'.\n      requestAnimationFrame(() => {\n        this.adapter.setStyleProperty('width', chipWidth);\n\n        // To mitigate jitter, start transitioning padding and margin before\n        // width.\n        this.adapter.setStyleProperty('padding', '0');\n        this.adapter.setStyleProperty('margin', '0');\n\n        // On the next frame (once width is explicitly set), transition width to\n        // 0.\n        requestAnimationFrame(() => {\n          this.adapter.setStyleProperty('width', '0');\n        });\n      });\n      return;\n    }\n\n    if (shouldHandle && widthIsAnimating) {\n      this.removeFocus();\n      const removedAnnouncement =\n          this.adapter.getAttribute(strings.REMOVED_ANNOUNCEMENT_ATTRIBUTE);\n\n      this.adapter.notifyRemoval(removedAnnouncement);\n    }\n\n    // Handle a transition end event on the leading icon or checkmark, since the\n    // transition end event bubbles.\n    if (!opacityIsAnimating) {\n      return;\n    }\n\n    const shouldHideLeadingIcon =\n        this.adapter.eventTargetHasClass(evt.target, cssClasses.LEADING_ICON) &&\n        this.adapter.hasClass(cssClasses.SELECTED);\n    const shouldShowLeadingIcon =\n        this.adapter.eventTargetHasClass(evt.target, cssClasses.CHECKMARK) &&\n        !this.adapter.hasClass(cssClasses.SELECTED);\n\n    if (shouldHideLeadingIcon) {\n      this.adapter.addClassToLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n      return;\n    }\n\n    if (shouldShowLeadingIcon) {\n      this.adapter.removeClassFromLeadingIcon(cssClasses.HIDDEN_LEADING_ICON);\n      return;\n    }\n  }\n\n  handleFocusIn(evt: FocusEvent) {\n    // Early exit if the event doesn't come from the primary action\n    if (!this.eventFromPrimaryAction(evt)) {\n      return;\n    }\n\n    this.adapter.addClass(cssClasses.PRIMARY_ACTION_FOCUSED);\n  }\n\n  handleFocusOut(evt: FocusEvent) {\n    // Early exit if the event doesn't come from the primary action\n    if (!this.eventFromPrimaryAction(evt)) {\n      return;\n    }\n\n    if (this.isEditing()) {\n      this.finishEditing();\n    }\n\n    this.adapter.removeClass(cssClasses.PRIMARY_ACTION_FOCUSED);\n  }\n\n  /**\n   * Handles an interaction event on the trailing icon element. This is used to\n   * prevent the ripple from activating on interaction with the trailing icon.\n   */\n  handleTrailingActionInteraction() {\n    this.adapter.notifyTrailingIconInteraction();\n    this.removeChip();\n  }\n\n  /**\n   * Handles a keydown event from the root element.\n   */\n  handleKeydown(evt: KeyboardEvent) {\n    if (this.isEditing()) {\n      if (this.shouldFinishEditing(evt)) {\n        evt.preventDefault();\n        this.finishEditing();\n      }\n      // When editing, the foundation should only handle key events that finish\n      // the editing process.\n      return;\n    }\n\n    if (this.isEditable()) {\n      if (this.shouldStartEditing(evt)) {\n        evt.preventDefault();\n        this.startEditing();\n      }\n    }\n\n    if (this.shouldNotifyInteraction(evt)) {\n      this.adapter.notifyInteraction();\n      this.setPrimaryActionFocusable(this.getFocusBehavior());\n      return;\n    }\n\n    if (this.isDeleteAction(evt)) {\n      evt.preventDefault();\n      this.removeChip();\n      return;\n    }\n\n    // Early exit if the key is not usable\n    if (!navigationKeys.has(evt.key)) {\n      return;\n    }\n\n    // Prevent default behavior for movement keys which could include scrolling\n    evt.preventDefault();\n    this.focusNextAction(evt.key, EventSource.PRIMARY);\n  }\n\n  handleTrailingActionNavigation(evt: MDCChipTrailingActionNavigationEvent) {\n    this.focusNextAction(evt.detail.key, EventSource.TRAILING);\n  }\n\n  /**\n   * Called by the chip set to remove focus from the chip actions.\n   */\n  removeFocus() {\n    this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n    this.adapter.removeTrailingActionFocus();\n  }\n\n  /**\n   * Called by the chip set to focus the primary action.\n   *\n   */\n  focusPrimaryAction() {\n    this.setPrimaryActionFocusable(FocusBehavior.SHOULD_FOCUS);\n  }\n\n  /**\n   * Called by the chip set to focus the trailing action (if present), otherwise\n   * gives focus to the trailing action.\n   */\n  focusTrailingAction() {\n    const trailingActionIsNavigable = this.adapter.isTrailingActionNavigable();\n    if (trailingActionIsNavigable) {\n      this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '-1');\n      this.adapter.focusTrailingAction();\n      return;\n    }\n\n    this.focusPrimaryAction();\n  }\n\n  private setPrimaryActionFocusable(focusBehavior: FocusBehavior) {\n    this.adapter.setPrimaryActionAttr(strings.TAB_INDEX, '0');\n    if (focusBehavior === FocusBehavior.SHOULD_FOCUS) {\n      this.adapter.focusPrimaryAction();\n    }\n    this.adapter.removeTrailingActionFocus();\n  }\n\n  private getFocusBehavior(): FocusBehavior {\n    if (this.shouldFocusPrimaryActionOnClick) {\n      return FocusBehavior.SHOULD_FOCUS;\n    }\n    return FocusBehavior.SHOULD_NOT_FOCUS;\n  }\n\n  private focusNextAction(key: string, source: EventSource) {\n    const isTrailingActionNavigable = this.adapter.isTrailingActionNavigable();\n    const dir = this.getDirection(key);\n\n    // Early exit if the key should jump chips\n    if (jumpChipKeys.has(key) || !isTrailingActionNavigable) {\n      this.adapter.notifyNavigation(key, source);\n      return;\n    }\n\n    if (source === EventSource.PRIMARY && dir === Direction.RIGHT) {\n      this.focusTrailingAction();\n      return;\n    }\n\n    if (source === EventSource.TRAILING && dir === Direction.LEFT) {\n      this.focusPrimaryAction();\n      return;\n    }\n\n    this.adapter.notifyNavigation(key, EventSource.NONE);\n  }\n\n  private getDirection(key: string): Direction {\n    const isRTL = this.adapter.isRTL();\n    const isLeftKey =\n        key === strings.ARROW_LEFT_KEY || key === strings.IE_ARROW_LEFT_KEY;\n    const isRightKey =\n        key === strings.ARROW_RIGHT_KEY || key === strings.IE_ARROW_RIGHT_KEY;\n    if (!isRTL && isLeftKey || isRTL && isRightKey) {\n      return Direction.LEFT;\n    }\n\n    return Direction.RIGHT;\n  }\n\n  private removeChip() {\n    if (this.shouldRemoveOnTrailingIconClick) {\n      this.beginExit();\n    }\n  }\n\n  private shouldStartEditing(evt: KeyboardEvent): boolean {\n    return this.eventFromPrimaryAction(evt) && evt.key === strings.ENTER_KEY;\n  }\n\n  private shouldFinishEditing(evt: KeyboardEvent): boolean {\n    return evt.key === strings.ENTER_KEY;\n  }\n\n  private shouldNotifyInteraction(evt: KeyboardEvent): boolean {\n    return evt.key === strings.ENTER_KEY || evt.key === strings.SPACEBAR_KEY;\n  }\n\n  private isDeleteAction(evt: KeyboardEvent): boolean {\n    const isDeletable = this.adapter.hasClass(cssClasses.DELETABLE);\n    return isDeletable &&\n        (evt.key === strings.BACKSPACE_KEY || evt.key === strings.DELETE_KEY ||\n         evt.key === strings.IE_DELETE_KEY);\n  }\n\n  private setSelectedImpl(selected: boolean) {\n    if (selected) {\n      this.adapter.addClass(cssClasses.SELECTED);\n      this.adapter.setPrimaryActionAttr(strings.ARIA_CHECKED, 'true');\n    } else {\n      this.adapter.removeClass(cssClasses.SELECTED);\n      this.adapter.setPrimaryActionAttr(strings.ARIA_CHECKED, 'false');\n    }\n  }\n\n  private notifySelection(selected: boolean) {\n    this.adapter.notifySelection(selected, false);\n  }\n\n  private notifyIgnoredSelection(selected: boolean) {\n    this.adapter.notifySelection(selected, true);\n  }\n\n  private eventFromPrimaryAction(evt: Event) {\n    return this.adapter.eventTargetHasClass(\n        evt.target, cssClasses.PRIMARY_ACTION);\n  }\n\n  private startEditing() {\n    this.adapter.addClass(cssClasses.EDITING);\n    this.adapter.notifyEditStart();\n  }\n\n  private finishEditing() {\n    this.adapter.removeClass(cssClasses.EDITING);\n    this.adapter.notifyEditFinish();\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipFoundation;\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {cssClasses as chipCssClasses, strings as chipStrings} from './constants';\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {EventSource} from './constants';\n\nexport interface MDCChipInteractionEventDetail {\n  chipId: string;\n}\n\nexport interface MDCChipSelectionEventDetail extends\n    MDCChipInteractionEventDetail {\n  selected: boolean;\n  shouldIgnore: boolean;\n}\n\nexport interface MDCChipRemovalEventDetail extends\n    MDCChipInteractionEventDetail {\n  removedAnnouncement: string|null;\n}\n\nexport interface MDCChipNavigationEventDetail extends\n    MDCChipInteractionEventDetail {\n  key: string;\n  source: EventSource;\n}\n\n// Note: CustomEvent<T> is not supported by Closure Compiler.\n\nexport interface MDCChipInteractionEvent extends Event {\n  readonly detail: MDCChipInteractionEventDetail;\n}\n\nexport interface MDCChipSelectionEvent extends Event {\n  readonly detail: MDCChipSelectionEventDetail;\n}\n\nexport interface MDCChipRemovalEvent extends Event {\n  readonly detail: MDCChipRemovalEventDetail;\n}\n\nexport interface MDCChipNavigationEvent extends Event {\n  readonly detail: MDCChipNavigationEventDetail;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './trailingaction/index';\nexport * from './chip/index';\nexport * from './chip-set/index';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {InteractionTrigger} from './constants';\n\n/**\n * Defines the shape of the adapter expected by the foundation.\n * Implement this adapter for your framework of choice to delegate updates to\n * the component in your framework of choice. See architecture documentation\n * for more details.\n * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md\n */\nexport interface MDCChipTrailingActionAdapter {\n  focus(): void;\n\n  getAttribute(attr: string): string|null;\n\n  notifyInteraction(trigger: InteractionTrigger): void;\n\n  notifyNavigation(key: string): void;\n\n  setAttribute(attr: string, value: string): void;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {SpecificEventListener} from '@material/base/types';\nimport {MDCRippleAdapter} from '@material/ripple/adapter';\nimport {MDCRipple, MDCRippleFactory} from '@material/ripple/component';\nimport {MDCRippleFoundation} from '@material/ripple/foundation';\nimport {MDCRippleCapableSurface} from '@material/ripple/types';\n\nimport {MDCChipTrailingActionAdapter} from './adapter';\nimport {strings} from './constants';\nimport {MDCChipTrailingActionFoundation} from './foundation';\nimport {MDCChipTrailingActionInteractionEventDetail, MDCChipTrailingActionNavigationEventDetail} from './types';\n\n/**\n * Creates a trailing action component on the given element.\n */\nexport type MDCChipTrailingActionFactory =\n    (el: HTMLElement, foundation?: MDCChipTrailingActionFoundation) =>\n        MDCChipTrailingAction;\n\n/** MDC Chip Trailing Action */\nexport class MDCChipTrailingAction extends\n    MDCComponent<MDCChipTrailingActionFoundation> implements\n        MDCRippleCapableSurface {\n  get ripple(): MDCRipple {\n    return this.rippleSurface;\n  }\n\n  static override attachTo(root: HTMLElement) {\n    return new MDCChipTrailingAction(root);\n  }\n\n  private rippleSurface!: MDCRipple;  // assigned in initialize()\n  private handleClick!:\n      SpecificEventListener<'click'>;  // assigned in initialSyncWithDOM()\n  private handleKeydown!:\n      SpecificEventListener<'keydown'>;  // assigned in initialSyncWithDOM()\n\n  override initialize(\n      rippleFactory: MDCRippleFactory = (el, foundation) =>\n          new MDCRipple(el, foundation)) {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const rippleAdapter: MDCRippleAdapter = MDCRipple.createAdapter(this);\n    this.rippleSurface =\n        rippleFactory(this.root, new MDCRippleFoundation(rippleAdapter));\n  }\n\n  override initialSyncWithDOM() {\n    this.handleClick = (evt: MouseEvent) => {\n      this.foundation.handleClick(evt);\n    };\n    this.handleKeydown = (evt: KeyboardEvent) => {\n      this.foundation.handleKeydown(evt);\n    };\n\n    this.listen('click', this.handleClick);\n    this.listen('keydown', this.handleKeydown);\n  }\n\n  override destroy() {\n    this.rippleSurface.destroy();\n    this.unlisten('click', this.handleClick);\n    this.unlisten('keydown', this.handleKeydown);\n    super.destroy();\n  }\n\n  override getDefaultFoundation() {\n    // DO NOT INLINE this variable. For backward compatibility, foundations take\n    // a Partial<MDCFooAdapter>. To ensure we don't accidentally omit any\n    // methods, we need a separate, strongly typed adapter variable.\n    const adapter: MDCChipTrailingActionAdapter = {\n      focus: () => {\n        this.root.focus();\n      },\n      getAttribute: (attr) => this.root.getAttribute(attr),\n      notifyInteraction: (trigger) => {\n        this.emit<MDCChipTrailingActionInteractionEventDetail>(\n            strings.INTERACTION_EVENT, {trigger}, true /* shouldBubble */);\n      },\n      notifyNavigation: (key) => {\n        this.emit<MDCChipTrailingActionNavigationEventDetail>(\n            strings.NAVIGATION_EVENT, {key}, true /* shouldBubble */);\n      },\n      setAttribute: (attr, value) => {\n        this.safeSetAttribute(this.root, attr, value);\n      },\n    };\n    return new MDCChipTrailingActionFoundation(adapter);\n  }\n\n  isNavigable() {\n    return this.foundation.isNavigable();\n  }\n\n  focus() {\n    this.foundation.focus();\n  }\n\n  removeFocus() {\n    this.foundation.removeFocus();\n  }\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport enum InteractionTrigger {\n  UNSPECIFIED,  // Default type\n  CLICK,\n  BACKSPACE_KEY,\n  DELETE_KEY,\n  SPACEBAR_KEY,\n  ENTER_KEY,\n}\n\nexport const strings = {\n  ARIA_HIDDEN: 'aria-hidden',\n  INTERACTION_EVENT: 'MDCChipTrailingAction:interaction',\n  NAVIGATION_EVENT: 'MDCChipTrailingAction:navigation',\n  TAB_INDEX: 'tabindex',\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\nimport {isNavigationEvent, KEY, normalizeKey} from '@material/dom/keyboard';\n\nimport {MDCChipTrailingActionAdapter} from './adapter';\nimport {InteractionTrigger, strings} from './constants';\n\n/** MDC Chip Trailing Action Foundation */\nexport class MDCChipTrailingActionFoundation extends\n    MDCFoundation<MDCChipTrailingActionAdapter> {\n  static override get strings() {\n    return strings;\n  }\n\n  static override get defaultAdapter(): MDCChipTrailingActionAdapter {\n    return {\n      focus: () => undefined,\n      getAttribute: () => null,\n      setAttribute: () => undefined,\n      notifyInteraction: () => undefined,\n      notifyNavigation: () => undefined,\n    };\n  }\n\n  constructor(adapter?: Partial<MDCChipTrailingActionAdapter>) {\n    super({...MDCChipTrailingActionFoundation.defaultAdapter, ...adapter});\n  }\n\n  handleClick(evt: MouseEvent) {\n    evt.stopPropagation();\n    this.adapter.notifyInteraction(InteractionTrigger.CLICK);\n  }\n\n  handleKeydown(evt: KeyboardEvent) {\n    evt.stopPropagation();\n    const key = normalizeKey(evt);\n    if (this.shouldNotifyInteractionFromKey(key)) {\n      const trigger = this.getTriggerFromKey(key);\n      this.adapter.notifyInteraction(trigger);\n      return;\n    }\n\n    if (isNavigationEvent(evt)) {\n      this.adapter.notifyNavigation(key);\n      return;\n    }\n  }\n\n  removeFocus() {\n    this.adapter.setAttribute(strings.TAB_INDEX, '-1');\n  }\n\n  focus() {\n    this.adapter.setAttribute(strings.TAB_INDEX, '0');\n    this.adapter.focus();\n  }\n\n  isNavigable() {\n    return this.adapter.getAttribute(strings.ARIA_HIDDEN) !== 'true';\n  }\n\n  private shouldNotifyInteractionFromKey(key: string): boolean {\n    const isFromActionKey = key === KEY.ENTER || key === KEY.SPACEBAR;\n    const isFromDeleteKey = key === KEY.BACKSPACE || key === KEY.DELETE;\n\n    return isFromActionKey || isFromDeleteKey;\n  }\n\n  private getTriggerFromKey(key: string): InteractionTrigger {\n    if (key === KEY.SPACEBAR) {\n      return InteractionTrigger.SPACEBAR_KEY;\n    }\n\n    if (key === KEY.ENTER) {\n      return InteractionTrigger.ENTER_KEY;\n    }\n\n    if (key === KEY.DELETE) {\n      return InteractionTrigger.DELETE_KEY;\n    }\n\n    if (key === KEY.BACKSPACE) {\n      return InteractionTrigger.BACKSPACE_KEY;\n    }\n\n    // Default case, should never be returned\n    return InteractionTrigger.UNSPECIFIED;\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCChipTrailingActionFoundation;\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './adapter';\nexport * from './component';\nexport * from './foundation';\nexport * from './types';\nexport {strings as trailingActionStrings} from './constants';\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {InteractionTrigger} from './constants';\n\nexport interface MDCChipTrailingActionInteractionEventDetail {\n  trigger: InteractionTrigger;\n}\n\nexport interface MDCChipTrailingActionNavigationEventDetail {\n  key: string;\n}\n\n// Note: CustomEvent<T> is not supported by Closure Compiler.\n\nexport interface MDCChipTrailingActionInteractionEvent extends Event {\n  readonly detail: MDCChipTrailingActionInteractionEventDetail;\n}\n\nexport interface MDCChipTrailingActionNavigationEvent extends Event {\n  readonly detail: MDCChipTrailingActionNavigationEventDetail;\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport * from './action/index';\nexport * from './chip/index';\nexport * from './chip-set/index';\n\n/**\n * Backwards compatibility for existing clients.\n */\nimport * as deprecated from './deprecated/index';\nexport {\n  deprecated,\n};\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Priorities for the announce function.\n */\nexport enum AnnouncerPriority {\n  POLITE = 'polite',\n  ASSERTIVE = 'assertive',\n}\n\n/**\n * Options for the announce function.\n */\nexport interface AnnouncerMessageOptions {\n  priority?: AnnouncerPriority;\n  ownerDocument?: Document;\n}\n\n/**\n * Data attribute added to live region element.\n */\nexport const DATA_MDC_DOM_ANNOUNCE = 'data-mdc-dom-announce';\n\n/**\n * Announces the given message with optional priority, defaulting to \"polite\"\n */\nexport function announce(message: string, options?: AnnouncerMessageOptions) {\n  Announcer.getInstance().say(message, options);\n}\n\nclass Announcer {\n  private static instance: Announcer;\n  private readonly liveRegions: Map<Document, Map<AnnouncerPriority, Element>>;\n\n  static getInstance(): Announcer {\n    if (!Announcer.instance) {\n      Announcer.instance = new Announcer();\n    }\n\n    return Announcer.instance;\n  }\n\n  // Constructor made private to ensure only the singleton is used\n  private constructor() {\n    this.liveRegions = new Map();\n  }\n\n  say(message: string, options?: AnnouncerMessageOptions) {\n    const priority = options?.priority ?? AnnouncerPriority.POLITE;\n    const ownerDocument = options?.ownerDocument ?? document;\n    const liveRegion = this.getLiveRegion(priority, ownerDocument);\n    // Reset the region to pick up the message, even if the message is the\n    // exact same as before.\n    liveRegion.textContent = '';\n    // Timeout is necessary for screen readers like NVDA and VoiceOver.\n    setTimeout(() => {\n      liveRegion.textContent = message;\n      ownerDocument.addEventListener('click', clearLiveRegion);\n    }, 1);\n\n    function clearLiveRegion() {\n      liveRegion.textContent = '';\n      ownerDocument.removeEventListener('click', clearLiveRegion);\n    }\n  }\n\n  private getLiveRegion(priority: AnnouncerPriority, ownerDocument: Document):\n      Element {\n    let documentLiveRegions = this.liveRegions.get(ownerDocument);\n    if (!documentLiveRegions) {\n      documentLiveRegions = new Map();\n      this.liveRegions.set(ownerDocument, documentLiveRegions);\n    }\n\n    const existingLiveRegion = documentLiveRegions.get(priority);\n    if (existingLiveRegion && ownerDocument.body.contains(existingLiveRegion)) {\n      return existingLiveRegion;\n    }\n\n    const liveRegion = this.createLiveRegion(priority, ownerDocument);\n    documentLiveRegions.set(priority, liveRegion);\n    return liveRegion;\n  }\n\n  private createLiveRegion(\n      priority: AnnouncerPriority, ownerDocument: Document): HTMLDivElement {\n    const el = ownerDocument.createElement('div');\n    el.style.position = 'absolute';\n    el.style.top = '-9999px';\n    el.style.left = '-9999px';\n    el.style.height = '1px';\n    el.style.overflow = 'hidden';\n    el.setAttribute('aria-atomic', 'true');\n    el.setAttribute('aria-live', priority);\n    el.setAttribute(DATA_MDC_DOM_ANNOUNCE, 'true');\n    ownerDocument.body.appendChild(el);\n    return el;\n  }\n}\n","/**\n * @license\n * Copyright 2019 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * Determine whether the current browser supports passive event listeners, and\n * if so, use them.\n */\nexport function applyPassive(globalObj: Window = window): boolean|\n    EventListenerOptions {\n  return supportsPassiveOption(globalObj) ?\n      {passive: true} as AddEventListenerOptions :\n      false;\n}\n\nfunction supportsPassiveOption(globalObj: Window = window): boolean {\n  // See\n  // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener\n  let passiveSupported = false;\n\n  try {\n    const options = {\n      // This function will be called when the browser\n      // attempts to access the passive property.\n      get passive() {\n        passiveSupported = true;\n        return false;\n      }\n    };\n\n    const handler = () => {};\n    globalObj.document.addEventListener('test', handler, options);\n    globalObj.document.removeEventListener(\n        'test', handler, options as EventListenerOptions);\n  } catch (err) {\n    passiveSupported = false;\n  }\n\n  return passiveSupported;\n}\n","/**\n * @license\n * Copyright 2020 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * KEY provides normalized string values for keys.\n */\nexport const KEY = {\n  UNKNOWN: 'Unknown',\n  BACKSPACE: 'Backspace',\n  ENTER: 'Enter',\n  SPACEBAR: 'Spacebar',\n  PAGE_UP: 'PageUp',\n  PAGE_DOWN: 'PageDown',\n  END: 'End',\n  HOME: 'Home',\n  ARROW_LEFT: 'ArrowLeft',\n  ARROW_UP: 'ArrowUp',\n  ARROW_RIGHT: 'ArrowRight',\n  ARROW_DOWN: 'ArrowDown',\n  DELETE: 'Delete',\n  ESCAPE: 'Escape',\n  TAB: 'Tab',\n};\n\nconst normalizedKeys = new Set<string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nnormalizedKeys.add(KEY.BACKSPACE);\nnormalizedKeys.add(KEY.ENTER);\nnormalizedKeys.add(KEY.SPACEBAR);\nnormalizedKeys.add(KEY.PAGE_UP);\nnormalizedKeys.add(KEY.PAGE_DOWN);\nnormalizedKeys.add(KEY.END);\nnormalizedKeys.add(KEY.HOME);\nnormalizedKeys.add(KEY.ARROW_LEFT);\nnormalizedKeys.add(KEY.ARROW_UP);\nnormalizedKeys.add(KEY.ARROW_RIGHT);\nnormalizedKeys.add(KEY.ARROW_DOWN);\nnormalizedKeys.add(KEY.DELETE);\nnormalizedKeys.add(KEY.ESCAPE);\nnormalizedKeys.add(KEY.TAB);\n\nconst KEY_CODE = {\n  BACKSPACE: 8,\n  ENTER: 13,\n  SPACEBAR: 32,\n  PAGE_UP: 33,\n  PAGE_DOWN: 34,\n  END: 35,\n  HOME: 36,\n  ARROW_LEFT: 37,\n  ARROW_UP: 38,\n  ARROW_RIGHT: 39,\n  ARROW_DOWN: 40,\n  DELETE: 46,\n  ESCAPE: 27,\n  TAB: 9,\n};\n\nconst mappedKeyCodes = new Map<number, string>();\n// IE11 has no support for new Map with iterable so we need to initialize this\n// by hand.\nmappedKeyCodes.set(KEY_CODE.BACKSPACE, KEY.BACKSPACE);\nmappedKeyCodes.set(KEY_CODE.ENTER, KEY.ENTER);\nmappedKeyCodes.set(KEY_CODE.SPACEBAR, KEY.SPACEBAR);\nmappedKeyCodes.set(KEY_CODE.PAGE_UP, KEY.PAGE_UP);\nmappedKeyCodes.set(KEY_CODE.PAGE_DOWN, KEY.PAGE_DOWN);\nmappedKeyCodes.set(KEY_CODE.END, KEY.END);\nmappedKeyCodes.set(KEY_CODE.HOME, KEY.HOME);\nmappedKeyCodes.set(KEY_CODE.ARROW_LEFT, KEY.ARROW_LEFT);\nmappedKeyCodes.set(KEY_CODE.ARROW_UP, KEY.ARROW_UP);\nmappedKeyCodes.set(KEY_CODE.ARROW_RIGHT, KEY.ARROW_RIGHT);\nmappedKeyCodes.set(KEY_CODE.ARROW_DOWN, KEY.ARROW_DOWN);\nmappedKeyCodes.set(KEY_CODE.DELETE, KEY.DELETE);\nmappedKeyCodes.set(KEY_CODE.ESCAPE, KEY.ESCAPE);\nmappedKeyCodes.set(KEY_CODE.TAB, KEY.TAB);\n\nconst navigationKeys = new Set<string>();\n// IE11 has no support for new Set with iterable so we need to initialize this\n// by hand.\nnavigationKeys.add(KEY.PAGE_UP);\nnavigationKeys.add(KEY.PAGE_DOWN);\nnavigationKeys.add(KEY.END);\nnavigationKeys.add(KEY.HOME);\nnavigationKeys.add(KEY.ARROW_LEFT);\nnavigationKeys.add(KEY.ARROW_UP);\nnavigationKeys.add(KEY.ARROW_RIGHT);\nnavigationKeys.add(KEY.ARROW_DOWN);\n\n/**\n * normalizeKey returns the normalized string for a navigational action.\n */\nexport function normalizeKey(evt: KeyboardEvent): string {\n  const {key} = evt;\n  // If the event already has a normalized key, return it\n  if (normalizedKeys.has(key)) {\n    return key;\n  }\n\n  // tslint:disable-next-line:deprecation\n  const mappedKey = mappedKeyCodes.get(evt.keyCode);\n  if (mappedKey) {\n    return mappedKey;\n  }\n  return KEY.UNKNOWN;\n}\n\n/**\n * isNavigationEvent returns whether the event is a navigation event\n */\nexport function isNavigationEvent(evt: KeyboardEvent): boolean {\n  return navigationKeys.has(normalizeKey(evt));\n}\n","/**\n * @license\n * Copyright 2018 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @fileoverview A \"ponyfill\" is a polyfill that doesn't modify the global\n * prototype chain. This makes ponyfills safer than traditional polyfills,\n * especially for libraries like MDC.\n */\n\nexport function closest(element: Element, selector: string): Element|null {\n  if (element.closest) {\n    return element.closest(selector);\n  }\n\n  let el: Element|null = element;\n  while (el) {\n    if (matches(el, selector)) {\n      return el;\n    }\n    el = el.parentElement;\n  }\n  return null;\n}\n\n/** Element.matches with support for webkit and IE. */\nexport function matches(element: Element, selector: string): boolean {\n  const nativeMatches = element.matches || element.webkitMatchesSelector ||\n      (element as any).msMatchesSelector;\n  return nativeMatches.call(element, selector);\n}\n\n/**\n * Used to compute the estimated scroll width of elements. When an element is\n * hidden due to display: none; being applied to a parent element, the width is\n * returned as 0. However, the element will have a true width once no longer\n * inside a display: none context. This method computes an estimated width when\n * the element is hidden or returns the true width when the element is visble.\n * @param {Element} element the element whose width to estimate\n */\nexport function estimateScrollWidth(element: Element): number {\n  // Check the offsetParent. If the element inherits display: none from any\n  // parent, the offsetParent property will be null (see\n  // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent).\n  // This check ensures we only clone the node when necessary.\n  const htmlEl = element as HTMLElement;\n  if (htmlEl.offsetParent !== null) {\n    return htmlEl.scrollWidth;\n  }\n\n  const clone = htmlEl.cloneNode(true) as HTMLElement;\n  clone.style.setProperty('position', 'absolute');\n  clone.style.setProperty('transform', 'translate(-9999px, -9999px)');\n  document.documentElement.appendChild(clone);\n  const scrollWidth = clone.scrollWidth;\n  document.documentElement.removeChild(clone);\n  return scrollWidth;\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCComponent} from '@material/base/component';\nimport {applyPassive} from '@material/dom/events';\nimport {matches} from '@material/dom/ponyfill';\n\nimport {MDCRippleAdapter} from './adapter';\nimport {MDCRippleFoundation} from './foundation';\nimport {MDCRippleAttachOpts, MDCRippleCapableSurface} from './types';\nimport * as util from './util';\n\n/** MDC Ripple Factory */\nexport type MDCRippleFactory =\n    (el: HTMLElement, foundation?: MDCRippleFoundation) => MDCRipple;\n\n/** MDC Ripple */\nexport class MDCRipple extends MDCComponent<MDCRippleFoundation> implements\n    MDCRippleCapableSurface {\n  static override attachTo(root: HTMLElement, opts: MDCRippleAttachOpts = {\n    isUnbounded: undefined\n  }): MDCRipple {\n    const ripple = new MDCRipple(root);\n    // Only override unbounded behavior if option is explicitly specified\n    if (opts.isUnbounded !== undefined) {\n      ripple.unbounded = opts.isUnbounded;\n    }\n    return ripple;\n  }\n\n  static createAdapter(instance: MDCRippleCapableSurface): MDCRippleAdapter {\n    return {\n      addClass: (className) => {\n        instance.root.classList.add(className);\n      },\n      browserSupportsCssVars: () => util.supportsCssVariables(window),\n      computeBoundingRect: () => instance.root.getBoundingClientRect(),\n      containsEventTarget: (target) => instance.root.contains(target as Node),\n      deregisterDocumentInteractionHandler: (evtType, handler) => {\n        document.documentElement.removeEventListener(\n            evtType, handler, applyPassive());\n      },\n      deregisterInteractionHandler: (evtType, handler) => {\n        instance.root.removeEventListener(evtType, handler, applyPassive());\n      },\n      deregisterResizeHandler: (handler) => {\n        window.removeEventListener('resize', handler);\n      },\n      getWindowPageOffset: () =>\n          ({x: window.pageXOffset, y: window.pageYOffset}),\n      isSurfaceActive: () => matches(instance.root, ':active'),\n      isSurfaceDisabled: () => Boolean(instance.disabled),\n      isUnbounded: () => Boolean(instance.unbounded),\n      registerDocumentInteractionHandler: (evtType, handler) => {\n        document.documentElement.addEventListener(\n            evtType, handler, applyPassive());\n      },\n      registerInteractionHandler: (evtType, handler) => {\n        instance.root.addEventListener(evtType, handler, applyPassive());\n      },\n      registerResizeHandler: (handler) => {\n        window.addEventListener('resize', handler);\n      },\n      removeClass: (className) => {\n        instance.root.classList.remove(className);\n      },\n      updateCssVariable: (varName, value) => {\n        instance.root.style.setProperty(varName, value);\n      },\n    };\n  }\n\n  disabled = false;\n\n  private isUnbounded?: boolean;\n\n  get unbounded(): boolean {\n    return Boolean(this.isUnbounded);\n  }\n\n  set unbounded(unbounded: boolean) {\n    this.isUnbounded = Boolean(unbounded);\n    this.setUnbounded();\n  }\n\n  activate() {\n    this.foundation.activate();\n  }\n\n  deactivate() {\n    this.foundation.deactivate();\n  }\n\n  layout() {\n    this.foundation.layout();\n  }\n\n  override getDefaultFoundation() {\n    return new MDCRippleFoundation(MDCRipple.createAdapter(this));\n  }\n\n  override initialSyncWithDOM() {\n    const root = this.root;\n    this.isUnbounded = 'mdcRippleIsUnbounded' in root.dataset;\n  }\n\n  /**\n   * Closure Compiler throws an access control error when directly accessing a\n   * protected or private property inside a getter/setter, like unbounded above.\n   * By accessing the protected property inside a method, we solve that problem.\n   * That's why this function exists.\n   */\n  private setUnbounded() {\n    this.foundation.setUnbounded(Boolean(this.isUnbounded));\n  }\n}\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nexport const cssClasses = {\n  // Ripple is a special case where the \"root\" component is really a \"mixin\" of\n  // sorts,\n  // given that it's an 'upgrade' to an existing component. That being said it\n  // is the root\n  // CSS class that all other CSS classes derive from.\n  BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',\n  FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',\n  FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',\n  ROOT: 'mdc-ripple-upgraded',\n  UNBOUNDED: 'mdc-ripple-upgraded--unbounded',\n};\n\nexport const strings = {\n  VAR_FG_SCALE: '--mdc-ripple-fg-scale',\n  VAR_FG_SIZE: '--mdc-ripple-fg-size',\n  VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',\n  VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',\n  VAR_LEFT: '--mdc-ripple-left',\n  VAR_TOP: '--mdc-ripple-top',\n};\n\nexport const numbers = {\n  DEACTIVATION_TIMEOUT_MS:\n      225,  // Corresponds to $mdc-ripple-translate-duration (i.e. activation\n            // animation duration)\n  FG_DEACTIVATION_MS: 150,  // Corresponds to $mdc-ripple-fade-out-duration\n                            // (i.e. deactivation animation duration)\n  INITIAL_ORIGIN_SCALE: 0.6,\n  PADDING: 10,\n  TAP_DELAY_MS:\n      300,  // Delay between touch and simulated mouse events on touch devices\n};\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\nimport {MDCFoundation} from '@material/base/foundation';\n\nimport {MDCRippleAdapter} from './adapter';\nimport {cssClasses, numbers, strings} from './constants';\nimport {MDCRipplePoint} from './types';\nimport {getNormalizedEventCoords} from './util';\n\ninterface ActivationStateType {\n  isActivated?: boolean;\n  hasDeactivationUXRun?: boolean;\n  wasActivatedByPointer?: boolean;\n  wasElementMadeActive?: boolean;\n  activationEvent?: Event;\n  isProgrammatic?: boolean;\n}\n\ninterface FgTranslationCoordinates {\n  startPoint: MDCRipplePoint;\n  endPoint: MDCRipplePoint;\n}\n\ninterface Coordinates {\n  left: number;\n  top: number;\n}\n\ninterface EventHandlerNonNull {\n  (event: Event): any;\n}\n\ntype ActivationEventType = 'touchstart'|'pointerdown'|'mousedown'|'keydown';\ntype DeactivationEventType = 'touchend'|'pointerup'|'mouseup'|'contextmenu';\n\n// Activation events registered on the root element of each instance for\n// activation\nconst ACTIVATION_EVENT_TYPES: ActivationEventType[] = [\n  'touchstart',\n  'pointerdown',\n  'mousedown',\n  'keydown',\n];\n\n// Deactivation events registered on documentElement when a pointer-related down\n// event occurs\nconst POINTER_DEACTIVATION_EVENT_TYPES: DeactivationEventType[] = [\n  'touchend',\n  'pointerup',\n  'mouseup',\n  'contextmenu',\n];\n\n// simultaneous nested activations\nlet activatedTargets: Array<EventTarget|null> = [];\n\n/** MDC Ripple Foundation */\nexport class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {\n  static override get cssClasses() {\n    return cssClasses;\n  }\n\n  static override get strings() {\n    return strings;\n  }\n\n  static override get numbers() {\n    return numbers;\n  }\n\n  static override get defaultAdapter(): MDCRippleAdapter {\n    return {\n      addClass: () => undefined,\n      browserSupportsCssVars: () => true,\n      computeBoundingRect: () =>\n          ({top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0} as any),\n      containsEventTarget: () => true,\n      deregisterDocumentInteractionHandler: () => undefined,\n      deregisterInteractionHandler: () => undefined,\n      deregisterResizeHandler: () => undefined,\n      getWindowPageOffset: () => ({x: 0, y: 0}),\n      isSurfaceActive: () => true,\n      isSurfaceDisabled: () => true,\n      isUnbounded: () => true,\n      registerDocumentInteractionHandler: () => undefined,\n      registerInteractionHandler: () => undefined,\n      registerResizeHandler: () => undefined,\n      removeClass: () => undefined,\n      updateCssVariable: () => undefined,\n    };\n  }\n\n  private activationAnimationHasEnded = false;\n  private activationState: ActivationStateType;\n  private activationTimer = 0;\n  private fgDeactivationRemovalTimer = 0;\n  private fgScale = '0';\n  private frame = {width: 0, height: 0};\n  private initialSize = 0;\n  private layoutFrame = 0;\n  private maxRadius = 0;\n  private unboundedCoords: Coordinates = {left: 0, top: 0};\n\n  private readonly activationTimerCallback: () => void;\n  private readonly activateHandler: EventHandlerNonNull;\n  private readonly deactivateHandler: EventHandlerNonNull;\n  private readonly focusHandler: EventHandlerNonNull;\n  private readonly blurHandler: EventHandlerNonNull;\n  private readonly resizeHandler: EventHandlerNonNull;\n\n  private previousActivationEvent?: Event;\n\n  constructor(adapter?: Partial<MDCRippleAdapter>) {\n    super({...MDCRippleFoundation.defaultAdapter, ...adapter});\n\n    this.activationState = this.defaultActivationState();\n\n    this.activationTimerCallback = () => {\n      this.activationAnimationHasEnded = true;\n      this.runDeactivationUXLogicIfReady();\n    };\n    this.activateHandler = (e) => {\n      this.activateImpl(e);\n    };\n    this.deactivateHandler = () => {\n      this.deactivateImpl();\n    };\n    this.focusHandler = () => {\n      this.handleFocus();\n    };\n    this.blurHandler = () => {\n      this.handleBlur();\n    };\n    this.resizeHandler = () => {\n      this.layout();\n    };\n  }\n\n  override init() {\n    const supportsPressRipple = this.supportsPressRipple();\n\n    this.registerRootHandlers(supportsPressRipple);\n\n    if (supportsPressRipple) {\n      const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n      requestAnimationFrame(() => {\n        this.adapter.addClass(ROOT);\n        if (this.adapter.isUnbounded()) {\n          this.adapter.addClass(UNBOUNDED);\n          // Unbounded ripples need layout logic applied immediately to set\n          // coordinates for both shade and ripple\n          this.layoutInternal();\n        }\n      });\n    }\n  }\n\n  override destroy() {\n    if (this.supportsPressRipple()) {\n      if (this.activationTimer) {\n        clearTimeout(this.activationTimer);\n        this.activationTimer = 0;\n        this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);\n      }\n\n      if (this.fgDeactivationRemovalTimer) {\n        clearTimeout(this.fgDeactivationRemovalTimer);\n        this.fgDeactivationRemovalTimer = 0;\n        this.adapter.removeClass(\n            MDCRippleFoundation.cssClasses.FG_DEACTIVATION);\n      }\n\n      const {ROOT, UNBOUNDED} = MDCRippleFoundation.cssClasses;\n      requestAnimationFrame(() => {\n        this.adapter.removeClass(ROOT);\n        this.adapter.removeClass(UNBOUNDED);\n        this.removeCssVars();\n      });\n    }\n\n    this.deregisterRootHandlers();\n    this.deregisterDeactivationHandlers();\n  }\n\n  /**\n   * @param evt Optional event containing position information.\n   */\n  activate(evt?: Event): void {\n    this.activateImpl(evt);\n  }\n\n  deactivate(): void {\n    this.deactivateImpl();\n  }\n\n  layout(): void {\n    if (this.layoutFrame) {\n      cancelAnimationFrame(this.layoutFrame);\n    }\n    this.layoutFrame = requestAnimationFrame(() => {\n      this.layoutInternal();\n      this.layoutFrame = 0;\n    });\n  }\n\n  setUnbounded(unbounded: boolean): void {\n    const {UNBOUNDED} = MDCRippleFoundation.cssClasses;\n    if (unbounded) {\n      this.adapter.addClass(UNBOUNDED);\n    } else {\n      this.adapter.removeClass(UNBOUNDED);\n    }\n  }\n\n  handleFocus(): void {\n    requestAnimationFrame(() => {\n      this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);\n    });\n  }\n\n  handleBlur(): void {\n    requestAnimationFrame(() => {\n      this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED);\n    });\n  }\n\n  /**\n   * We compute this property so that we are not querying information about the\n   * client until the point in time where the foundation requests it. This\n   * prevents scenarios where client-side feature-detection may happen too\n   * early, such as when components are rendered on the server and then\n   * initialized at mount time on the client.\n   */\n  private supportsPressRipple(): boolean {\n    return this.adapter.browserSupportsCssVars();\n  }\n\n  private defaultActivationState(): ActivationStateType {\n    return {\n      activationEvent: undefined,\n      hasDeactivationUXRun: false,\n      isActivated: false,\n      isProgrammatic: false,\n      wasActivatedByPointer: false,\n      wasElementMadeActive: false,\n    };\n  }\n\n  /**\n   * supportsPressRipple Passed from init to save a redundant function call\n   */\n  private registerRootHandlers(supportsPressRipple: boolean) {\n    if (supportsPressRipple) {\n      for (const evtType of ACTIVATION_EVENT_TYPES) {\n        this.adapter.registerInteractionHandler(evtType, this.activateHandler);\n      }\n      if (this.adapter.isUnbounded()) {\n        this.adapter.registerResizeHandler(this.resizeHandler);\n      }\n    }\n\n    this.adapter.registerInteractionHandler('focus', this.focusHandler);\n    this.adapter.registerInteractionHandler('blur', this.blurHandler);\n  }\n\n  private registerDeactivationHandlers(evt: Event) {\n    if (evt.type === 'keydown') {\n      this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);\n    } else {\n      for (const evtType of POINTER_DEACTIVATION_EVENT_TYPES) {\n        this.adapter.registerDocumentInteractionHandler(\n            evtType, this.deactivateHandler);\n      }\n    }\n  }\n\n  private deregisterRootHandlers() {\n    for (const evtType of ACTIVATION_EVENT_TYPES) {\n      this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);\n    }\n    this.adapter.deregisterInteractionHandler('focus', this.focusHandler);\n    this.adapter.deregisterInteractionHandler('blur', this.blurHandler);\n\n    if (this.adapter.isUnbounded()) {\n      this.adapter.deregisterResizeHandler(this.resizeHandler);\n    }\n  }\n\n  private deregisterDeactivationHandlers() {\n    this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler);\n    for (const evtType of POINTER_DEACTIVATION_EVENT_TYPES) {\n      this.adapter.deregisterDocumentInteractionHandler(\n          evtType, this.deactivateHandler);\n    }\n  }\n\n  private removeCssVars() {\n    const rippleStrings = MDCRippleFoundation.strings;\n    const keys =\n        Object.keys(rippleStrings) as Array<keyof typeof rippleStrings>;\n    keys.forEach((key) => {\n      if (key.indexOf('VAR_') === 0) {\n        this.adapter.updateCssVariable(rippleStrings[key], null);\n      }\n    });\n  }\n\n  private activateImpl(evt?: Event) {\n    if (this.adapter.isSurfaceDisabled()) {\n      return;\n    }\n\n    const activationState = this.activationState;\n    if (activationState.isActivated) {\n      return;\n    }\n\n    // Avoid reacting to follow-on events fired by touch device after an\n    // already-processed user interaction\n    const previousActivationEvent = this.previousActivationEvent;\n    const isSameInteraction = previousActivationEvent && evt !== undefined &&\n        previousActivationEvent.type !== evt.type;\n    if (isSameInteraction) {\n      return;\n    }\n\n    activationState.isActivated = true;\n    activationState.isProgrammatic = evt === undefined;\n    activationState.activationEvent = evt;\n    activationState.wasActivatedByPointer = activationState.isProgrammatic ?\n        false :\n        evt !== undefined &&\n            (evt.type === 'mousedown' || evt.type === 'touchstart' ||\n             evt.type === 'pointerdown');\n\n    const hasActivatedChild = evt !== undefined &&\n        activatedTargets.length > 0 &&\n        activatedTargets.some(\n            (target) => this.adapter.containsEventTarget(target));\n    if (hasActivatedChild) {\n      // Immediately reset activation state, while preserving logic that\n      // prevents touch follow-on events\n      this.resetActivationState();\n      return;\n    }\n\n    if (evt !== undefined) {\n      activatedTargets.push(evt.target);\n      this.registerDeactivationHandlers(evt);\n    }\n\n    activationState.wasElementMadeActive = this.checkElementMadeActive(evt);\n    if (activationState.wasElementMadeActive) {\n      this.animateActivation();\n    }\n\n    requestAnimationFrame(() => {\n      // Reset array on next frame after the current event has had a chance to\n      // bubble to prevent ancestor ripples\n      activatedTargets = [];\n\n      if (!activationState.wasElementMadeActive && evt !== undefined &&\n          ((evt as KeyboardEvent).key === ' ' ||\n           (evt as KeyboardEvent).keyCode === 32)) {\n        // If space was pressed, try again within an rAF call to detect :active,\n        // because different UAs report active states inconsistently when\n        // they're called within event handling code:\n        // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971\n        // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741\n        // We try first outside rAF to support Edge, which does not exhibit this\n        // problem, but will crash if a CSS variable is set within a rAF\n        // callback for a submit button interaction (#2241).\n        activationState.wasElementMadeActive = this.checkElementMadeActive(evt);\n        if (activationState.wasElementMadeActive) {\n          this.animateActivation();\n        }\n      }\n\n      if (!activationState.wasElementMadeActive) {\n        // Reset activation state immediately if element was not made active.\n        this.activationState = this.defaultActivationState();\n      }\n    });\n  }\n\n  private checkElementMadeActive(evt?: Event) {\n    return (evt !== undefined && evt.type === 'keydown') ?\n        this.adapter.isSurfaceActive() :\n        true;\n  }\n\n  private animateActivation() {\n    const {VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END} =\n        MDCRippleFoundation.strings;\n    const {FG_DEACTIVATION, FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n    const {DEACTIVATION_TIMEOUT_MS} = MDCRippleFoundation.numbers;\n\n    this.layoutInternal();\n\n    let translateStart = '';\n    let translateEnd = '';\n\n    if (!this.adapter.isUnbounded()) {\n      const {startPoint, endPoint} = this.getFgTranslationCoordinates();\n      translateStart = `${startPoint.x}px, ${startPoint.y}px`;\n      translateEnd = `${endPoint.x}px, ${endPoint.y}px`;\n    }\n\n    this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);\n    this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);\n    // Cancel any ongoing activation/deactivation animations\n    clearTimeout(this.activationTimer);\n    clearTimeout(this.fgDeactivationRemovalTimer);\n    this.rmBoundedActivationClasses();\n    this.adapter.removeClass(FG_DEACTIVATION);\n\n    // Force layout in order to re-trigger the animation.\n    this.adapter.computeBoundingRect();\n    this.adapter.addClass(FG_ACTIVATION);\n    this.activationTimer = setTimeout(() => {\n      this.activationTimerCallback();\n    }, DEACTIVATION_TIMEOUT_MS);\n  }\n\n  private getFgTranslationCoordinates(): FgTranslationCoordinates {\n    const {activationEvent, wasActivatedByPointer} = this.activationState;\n\n    let startPoint;\n    if (wasActivatedByPointer) {\n      startPoint = getNormalizedEventCoords(\n          activationEvent,\n          this.adapter.getWindowPageOffset(),\n          this.adapter.computeBoundingRect(),\n      );\n    } else {\n      startPoint = {\n        x: this.frame.width / 2,\n        y: this.frame.height / 2,\n      };\n    }\n    // Center the element around the start point.\n    startPoint = {\n      x: startPoint.x - (this.initialSize / 2),\n      y: startPoint.y - (this.initialSize / 2),\n    };\n\n    const endPoint = {\n      x: (this.frame.width / 2) - (this.initialSize / 2),\n      y: (this.frame.height / 2) - (this.initialSize / 2),\n    };\n\n    return {startPoint, endPoint};\n  }\n\n  private runDeactivationUXLogicIfReady() {\n    // This method is called both when a pointing device is released, and when\n    // the activation animation ends. The deactivation animation should only run\n    // after both of those occur.\n    const {FG_DEACTIVATION} = MDCRippleFoundation.cssClasses;\n    const {hasDeactivationUXRun, isActivated} = this.activationState;\n    const activationHasEnded = hasDeactivationUXRun || !isActivated;\n\n    if (activationHasEnded && this.activationAnimationHasEnded) {\n      this.rmBoundedActivationClasses();\n      this.adapter.addClass(FG_DEACTIVATION);\n      this.fgDeactivationRemovalTimer = setTimeout(() => {\n        this.adapter.removeClass(FG_DEACTIVATION);\n      }, numbers.FG_DEACTIVATION_MS);\n    }\n  }\n\n  private rmBoundedActivationClasses() {\n    const {FG_ACTIVATION} = MDCRippleFoundation.cssClasses;\n    this.adapter.removeClass(FG_ACTIVATION);\n    this.activationAnimationHasEnded = false;\n    this.adapter.computeBoundingRect();\n  }\n\n  private resetActivationState() {\n    this.previousActivationEvent = this.activationState.activationEvent;\n    this.activationState = this.defaultActivationState();\n    // Touch devices may fire additional events for the same interaction within\n    // a short time. Store the previous event until it's safe to assume that\n    // subsequent events are for new interactions.\n    setTimeout(\n        () => this.previousActivationEvent = undefined,\n        MDCRippleFoundation.numbers.TAP_DELAY_MS);\n  }\n\n  private deactivateImpl(): void {\n    const activationState = this.activationState;\n    // This can happen in scenarios such as when you have a keyup event that\n    // blurs the element.\n    if (!activationState.isActivated) {\n      return;\n    }\n\n    const state: ActivationStateType = {...activationState};\n\n    if (activationState.isProgrammatic) {\n      requestAnimationFrame(() => {\n        this.animateDeactivation(state);\n      });\n      this.resetActivationState();\n    } else {\n      this.deregisterDeactivationHandlers();\n      requestAnimationFrame(() => {\n        this.activationState.hasDeactivationUXRun = true;\n        this.animateDeactivation(state);\n        this.resetActivationState();\n      });\n    }\n  }\n\n  private animateDeactivation({wasActivatedByPointer, wasElementMadeActive}:\n                                  ActivationStateType) {\n    if (wasActivatedByPointer || wasElementMadeActive) {\n      this.runDeactivationUXLogicIfReady();\n    }\n  }\n\n  private layoutInternal() {\n    this.frame = this.adapter.computeBoundingRect();\n    const maxDim = Math.max(this.frame.height, this.frame.width);\n\n    // Surface diameter is treated differently for unbounded vs. bounded\n    // ripples. Unbounded ripple diameter is calculated smaller since the\n    // surface is expected to already be padded appropriately to extend the\n    // hitbox, and the ripple is expected to meet the edges of the padded hitbox\n    // (which is typically square). Bounded ripples, on the other hand, are\n    // fully expected to expand beyond the surface's longest diameter\n    // (calculated based on the diagonal plus a constant padding), and are\n    // clipped at the surface's border via `overflow: hidden`.\n    const getBoundedRadius = () => {\n      const hypotenuse = Math.sqrt(\n          Math.pow(this.frame.width, 2) + Math.pow(this.frame.height, 2));\n      return hypotenuse + MDCRippleFoundation.numbers.PADDING;\n    };\n\n    this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();\n\n    // Ripple is sized as a fraction of the largest dimension of the surface,\n    // then scales up using a CSS scale transform\n    const initialSize =\n        Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);\n    // Unbounded ripple size should always be even number to equally center\n    // align.\n    if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {\n      this.initialSize = initialSize - 1;\n    } else {\n      this.initialSize = initialSize;\n    }\n    this.fgScale = `${this.maxRadius / this.initialSize}`;\n\n    this.updateLayoutCssVars();\n  }\n\n  private updateLayoutCssVars() {\n    const {\n      VAR_FG_SIZE,\n      VAR_LEFT,\n      VAR_TOP,\n      VAR_FG_SCALE,\n    } = MDCRippleFoundation.strings;\n\n    this.adapter.updateCssVariable(VAR_FG_SIZE, `${this.initialSize}px`);\n    this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale);\n\n    if (this.adapter.isUnbounded()) {\n      this.unboundedCoords = {\n        left: Math.round((this.frame.width / 2) - (this.initialSize / 2)),\n        top: Math.round((this.frame.height / 2) - (this.initialSize / 2)),\n      };\n\n      this.adapter.updateCssVariable(\n          VAR_LEFT, `${this.unboundedCoords.left}px`);\n      this.adapter.updateCssVariable(VAR_TOP, `${this.unboundedCoords.top}px`);\n    }\n  }\n}\n\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCRippleFoundation;\n","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport {MDCRipplePoint} from './types';\n\n/**\n * Stores result from supportsCssVariables to avoid redundant processing to\n * detect CSS custom variable support.\n */\nlet supportsCssVariables_: boolean|undefined;\n\nexport function supportsCssVariables(\n    windowObj: typeof globalThis, forceRefresh = false): boolean {\n  const {CSS} = windowObj;\n  let supportsCssVars = supportsCssVariables_;\n  if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {\n    return supportsCssVariables_;\n  }\n\n  const supportsFunctionPresent = CSS && typeof CSS.supports === 'function';\n  if (!supportsFunctionPresent) {\n    return false;\n  }\n\n  const explicitlySupportsCssVars = CSS.supports('--css-vars', 'yes');\n  // See: https://bugs.webkit.org/show_bug.cgi?id=154669\n  // See: README section on Safari\n  const weAreFeatureDetectingSafari10plus =\n      (CSS.supports('(--css-vars: yes)') && CSS.supports('color', '#00000000'));\n\n  supportsCssVars =\n      explicitlySupportsCssVars || weAreFeatureDetectingSafari10plus;\n\n  if (!forceRefresh) {\n    supportsCssVariables_ = supportsCssVars;\n  }\n  return supportsCssVars;\n}\n\nexport function getNormalizedEventCoords(\n    evt: Event|undefined, pageOffset: MDCRipplePoint,\n    clientRect: DOMRect): MDCRipplePoint {\n  if (!evt) {\n    return {x: 0, y: 0};\n  }\n  const {x, y} = pageOffset;\n  const documentX = x + clientRect.left;\n  const documentY = y + clientRect.top;\n\n  let normalizedX;\n  let normalizedY;\n  // Determine touch point relative to the ripple container.\n  if (evt.type === 'touchstart') {\n    const touchEvent = evt as TouchEvent;\n    normalizedX = touchEvent.changedTouches[0].pageX - documentX;\n    normalizedY = touchEvent.changedTouches[0].pageY - documentY;\n  } else {\n    const mouseEvent = evt as MouseEvent;\n    normalizedX = mouseEvent.pageX - documentX;\n    normalizedY = mouseEvent.pageY - documentY;\n  }\n\n  return {x: normalizedX, y: normalizedY};\n}\n"],"sourceRoot":""}