{"version":3,"sources":["webpack:///./node_modules/@esri/calcite-components/dist/components/calcite-accordion.js"],"names":["accordionCss","Accordion","super","this","__registerHost","__attachShadow","calciteAccordionChange","appearance","iconPosition","iconType","scale","selectionMode","items","sorted","sortItems","sort","a","b","position","map","item","class","accordion","e","detail","parent","el","key","itemToFocus","target","isFirstItem","itemIndex","isLastItem","length","focusFirstItem","focusNextItem","focusLastItem","focusPrevItem","push","event","requestedAccordionItem","emit","firstItem","focusElement","lastItem","index","nextItem","prevItem","indexOf","focus","defineCustomElement$1","customElements","components","forEach","tagName","get","define","CalciteAccordion","defineCustomElement"],"mappings":"kHAAA;;;;;GAOA,MAAMA,EAAe,g9GAEfC,EAA0B,eAAmB,cAAc,OAC/D,cACEC,QACAC,KAAKC,iBACLD,KAAKE,iBACLF,KAAKG,uBAAyB,eAAYH,KAAM,yBAA0B,GAO1EA,KAAKI,WAAa,UAElBJ,KAAKK,aAAe,MAEpBL,KAAKM,SAAW,UAEhBN,KAAKO,MAAQ,IAGbP,KAAKQ,cAAgB,QAOrBR,KAAKS,MAAQ,GAEbT,KAAKU,QAAS,EACdV,KAAKW,UAAaF,GAAUA,EAAMG,KAAK,CAACC,EAAGC,IAAMD,EAAEE,SAAWD,EAAEC,UAAUC,IAAKH,GAAMA,EAAEI,MAOzF,mBACOjB,KAAKU,SACRV,KAAKS,MAAQT,KAAKW,UAAUX,KAAKS,OACjCT,KAAKU,QAAS,GAGlB,SACE,OAAQ,cAAD,CAAG,MAAO,CAAEQ,MAAO,CACtB,yBAA8C,gBAApBlB,KAAKI,WAC/B,qBAA0C,YAApBJ,KAAKI,WAC3Be,UAA+B,YAApBnB,KAAKI,aACb,eAAE,OAAQ,OAOnB,6BAA6BgB,GAC3B,MAAMH,EAAOG,EAAEC,OAAOJ,KAChBK,EAASF,EAAEC,OAAOC,OACxB,GAAItB,KAAKuB,KAAOD,EAAQ,CACtB,MAAME,EAAMP,EAAKO,IACXC,EAAcL,EAAEM,OAChBC,EAA8C,IAAhC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KACf,aAAgB,CAAC,IAAK,iBACtB,SAAY,CAAC,IAAK,aAClB,MAAS,CAAC,KACV,cAAiB,CAAC,IAAK,mBACtB,CAAC,CAAC,EAAG,+BAAgC,gCAAiC,CAAC,EAAG,+BAAgC,gCAAiC,CAAC,EAAG,6BAA8B,+BAClL,SAASkD,IACP,GAA8B,qBAAnBC,eACT,OAEF,MAAMC,EAAa,CAAC,qBACpBA,EAAWC,QAAQC,IAAa,OAAQA,GACtC,IAAK,oBACEH,eAAeI,IAAID,IACtBH,eAAeK,OAAOF,EAASrD,GAEjC,SAGNiD,IAEA,MAAMO,EAAmBxD,EACnByD,EAAsBR","file":"js/chunk-2d0a36ca.39353859.js","sourcesContent":["/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n * v1.0.0-beta.82\n */\nimport { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';\n\nconst accordionCss = \"@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host([scale=s]){--calcite-accordion-item-spacing-unit:0.25rem;--calcite-accordion-icon-margin:0.5rem;--calcite-accordion-item-padding:var(--calcite-accordion-item-spacing-unit) 0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-accordion-item-spacing-unit:0.5rem;--calcite-accordion-icon-margin:0.75rem;--calcite-accordion-item-padding:var(--calcite-accordion-item-spacing-unit) 0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-accordion-item-spacing-unit:0.75rem;--calcite-accordion-icon-margin:1rem;--calcite-accordion-item-padding:var(--calcite-accordion-item-spacing-unit) 1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host{position:relative;display:block;max-width:100%;line-height:1.5rem;--calcite-accordion-item-border:var(--calcite-ui-border-2);--calcite-accordion-item-background:var(--calcite-ui-foreground-1)}.accordion--transparent{--calcite-accordion-item-border:transparent;--calcite-accordion-item-background:transparent}.accordion--minimal{--calcite-accordion-item-padding:var(--calcite-accordion-item-spacing-unit) 0}.accordion{border-width:1px;border-bottom-width:0px;border-style:solid;border-color:var(--calcite-ui-border-2)}\";\n\nconst Accordion = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {\n constructor() {\n super();\n this.__registerHost();\n this.__attachShadow();\n this.calciteAccordionChange = createEvent(this, \"calciteAccordionChange\", 7);\n //--------------------------------------------------------------------------\n //\n // Public Properties\n //\n //--------------------------------------------------------------------------\n /** specify the appearance - default (containing border), or minimal (no containing border), defaults to default */\n this.appearance = \"default\";\n /** specify the placement of the icon in the header, defaults to end */\n this.iconPosition = \"end\";\n /** specify the type of the icon in the header, defaults to chevron */\n this.iconType = \"chevron\";\n /** specify the scale of accordion, defaults to m */\n this.scale = \"m\";\n /** specify the selection mode - multi (allow any number of open items), single (allow one open item),\n * or single-persist (allow and require one open item), defaults to multi */\n this.selectionMode = \"multi\";\n //--------------------------------------------------------------------------\n //\n // Private State/Props\n //\n //--------------------------------------------------------------------------\n /** created list of Accordion items */\n this.items = [];\n /** keep track of whether the items have been sorted so we don't re-sort */\n this.sorted = false;\n this.sortItems = (items) => items.sort((a, b) => a.position - b.position).map((a) => a.item);\n }\n //--------------------------------------------------------------------------\n //\n // Lifecycle\n //\n //--------------------------------------------------------------------------\n componentDidLoad() {\n if (!this.sorted) {\n this.items = this.sortItems(this.items);\n this.sorted = true;\n }\n }\n render() {\n return (h(\"div\", { class: {\n \"accordion--transparent\": this.appearance === \"transparent\",\n \"accordion--minimal\": this.appearance === \"minimal\",\n accordion: this.appearance === \"default\"\n } }, h(\"slot\", null)));\n }\n //--------------------------------------------------------------------------\n //\n // Event Listeners\n //\n //--------------------------------------------------------------------------\n calciteAccordionItemKeyEvent(e) {\n const item = e.detail.item;\n const parent = e.detail.parent;\n if (this.el === parent) {\n const key = item.key;\n const itemToFocus = e.target;\n const isFirstItem = this.itemIndex(itemToFocus) === 0;\n const isLastItem = this.itemIndex(itemToFocus) === this.items.length - 1;\n switch (key) {\n case \"ArrowDown\":\n if (isLastItem) {\n this.focusFirstItem();\n }\n else {\n this.focusNextItem(itemToFocus);\n }\n break;\n case \"ArrowUp\":\n if (isFirstItem) {\n this.focusLastItem();\n }\n else {\n this.focusPrevItem(itemToFocus);\n }\n break;\n case \"Home\":\n this.focusFirstItem();\n break;\n case \"End\":\n this.focusLastItem();\n break;\n }\n }\n }\n registerCalciteAccordionItem(e) {\n const item = {\n item: e.target,\n parent: e.detail.parent,\n position: e.detail.position\n };\n if (this.el === item.parent) {\n this.items.push(item);\n }\n }\n updateActiveItemOnChange(event) {\n this.requestedAccordionItem = event.detail.requestedAccordionItem;\n this.calciteAccordionChange.emit({\n requestedAccordionItem: this.requestedAccordionItem\n });\n }\n //--------------------------------------------------------------------------\n //\n // Private Methods\n //\n //--------------------------------------------------------------------------\n focusFirstItem() {\n const firstItem = this.items[0];\n this.focusElement(firstItem);\n }\n focusLastItem() {\n const lastItem = this.items[this.items.length - 1];\n this.focusElement(lastItem);\n }\n focusNextItem(e) {\n const index = this.itemIndex(e);\n const nextItem = this.items[index + 1] || this.items[0];\n this.focusElement(nextItem);\n }\n focusPrevItem(e) {\n const index = this.itemIndex(e);\n const prevItem = this.items[index - 1] || this.items[this.items.length - 1];\n this.focusElement(prevItem);\n }\n itemIndex(e) {\n return this.items.indexOf(e);\n }\n focusElement(item) {\n const target = item;\n target.focus();\n }\n get el() { return this; }\n static get style() { return accordionCss; }\n}, [1, \"calcite-accordion\", {\n \"appearance\": [513],\n \"iconPosition\": [513, \"icon-position\"],\n \"iconType\": [513, \"icon-type\"],\n \"scale\": [513],\n \"selectionMode\": [513, \"selection-mode\"]\n }, [[0, \"calciteAccordionItemKeyEvent\", \"calciteAccordionItemKeyEvent\"], [0, \"calciteAccordionItemRegister\", \"registerCalciteAccordionItem\"], [0, \"calciteAccordionItemSelect\", \"updateActiveItemOnChange\"]]]);\nfunction defineCustomElement$1() {\n if (typeof customElements === \"undefined\") {\n return;\n }\n const components = [\"calcite-accordion\"];\n components.forEach(tagName => { switch (tagName) {\n case \"calcite-accordion\":\n if (!customElements.get(tagName)) {\n customElements.define(tagName, Accordion);\n }\n break;\n } });\n}\ndefineCustomElement$1();\n\nconst CalciteAccordion = Accordion;\nconst defineCustomElement = defineCustomElement$1;\n\nexport { CalciteAccordion, defineCustomElement };\n"],"sourceRoot":""}